@zhangqingcq/vgce 0.0.13 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
package/dist/vgce.umd.cjs CHANGED
@@ -350,8 +350,8 @@ echarts.use([`+At+"]);":"Unknown series "+Oe))}return}if(ae==="tooltip"){if(ze){
350
350
  if (customElements.get(tag) == null) {
351
351
  customElements.define(tag, EChartsElement);
352
352
  }
353
- `)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_702730c3_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-702730c3"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},configCenter=[...svg_config_center,...vue_config_center];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:configCenter,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolBar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolBar&&Object.keys(n.customToolBar).length>0?n.customToolBar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e50f27fa_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e50f27fa"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-cc758a32"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"4438ab04":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
354
- ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((Lt=vue.unref(r).handle_svg_info)==null?void 0:Lt.info.id)==Oe.id?"svg-item-move":""} ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((kt=vue.unref(r).handle_svg_info)==null?void 0:kt.info.id)==Oe.id?"svg-item-select":""}`}),null,16,_hoisted_9)):vue.createCommentVNode("",!0),((jt=vue.unref(r).handle_svg_info)==null?void 0:jt.info.id)===Oe.id&&ie.handle_panel&&Oe.config.can_zoom?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0),((ti=ie.select_item.info)==null?void 0:ti.id)==Oe.id&&ie.connection_panel&&Oe.config.have_anchor&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Oe.id!==((ei=vue.unref(r).handle_svg_info)==null?void 0:ei.info.id))?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:7,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_5$2)],2)],8,_hoisted_4$3)),[[vue.vShow,Oe.display]])}),128))],8,_hoisted_3$5)],4)),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:oe,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Oe,At)=>(vue.openBlock(),vue.createElementBlock("li",{key:Oe.title,onClick:qe=>vue.unref($).onContextMenuClick(At)},[vue.createElementVNode("p",{class:vue.normalizeClass(Oe.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Oe.title)+" ",1),vue.createElementVNode("span",_hoisted_11,vue.toDisplayString(Oe.hot_key),1)],2)],8,_hoisted_10))),128))],512),[[vue.vShow,vue.unref($).display]])],544))}}),index_vue_vue_type_style_index_0_scoped_cc758a32_lang="",CenterPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-cc758a32"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var k=function(ie,ae,le){if(typeof ie!="string"){k.original?k.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),k.modules[ie]||(k.payloads[ie]=le,k.modules[ie]=null)};k.modules={},k.payloads={};var V=function(ie,ae,le){if(typeof ae=="string"){var Ie=re(ie,ae);if(Ie!=null)return le&&le(),Ie}else if(Object.prototype.toString.call(ae)==="[object Array]"){for(var ue=[],de=0,Ne=ae.length;de<Ne;++de){var he=re(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=V("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},oe=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return oe(ie,le[0])+"!"+oe(ie,le[1])}if(ae.charAt(0)=="."){var Ie=ie.split("/").slice(0,-1).join("/");for(ae=Ie+"/"+ae;ae.indexOf(".")!==-1&&ue!=ae;){var ue=ae;ae=ae.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return ae},re=function(ie,ae){ae=oe(ie,ae);var le=k.modules[ae];if(!le){if(le=k.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,pe){return V(ae,he,pe)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,k.modules[ae]=Ie,delete k.payloads[ae]}le=k.modules[ae]=Ie||le}return le};function Ce(ie){var ae=g;ie&&(g[ie]||(g[ie]={}),ae=g[ie]),(!ae.define||!ae.define.packaged)&&(k.original=ae.define,ae.define=k,ae.define.packaged=!0),(!ae.require||!ae.require.packaged)&&($.original=ae.require,ae.require=$,ae.require.packaged=!0)}Ce(r)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(r,g,k){function V($,oe,re){Object.defineProperty($,oe,{value:re,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||V(String.prototype,"startsWith",function($,oe){return oe=oe||0,this.lastIndexOf($,oe)===oe}),String.prototype.endsWith||V(String.prototype,"endsWith",function($,oe){var re=this;(oe===void 0||oe>re.length)&&(oe=re.length),oe-=$.length;var Ce=re.indexOf($,oe);return Ce!==-1&&Ce===oe}),String.prototype.repeat||V(String.prototype,"repeat",function($){for(var oe="",re=this;$>0;)$&1&&(oe+=re),($>>=1)&&(re+=re);return oe}),String.prototype.includes||V(String.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var oe=Object($),re=1;re<arguments.length;re++){var Ce=arguments[re];Ce!=null&&Object.keys(Ce).forEach(function(ie){oe[ie]=Ce[ie]})}return oe}),Object.values||(Object.values=function($){return Object.keys($).map(function(oe){return $[oe]})}),Array.prototype.find||V(Array.prototype,"find",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return ie}}),Array.prototype.findIndex||V(Array.prototype,"findIndex",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return Ce}}),Array.prototype.includes||V(Array.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Array.prototype.fill||V(Array.prototype,"fill",function($){for(var oe=this,re=oe.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(re+ie,0):Math.min(ie,re),le=arguments[2],Ie=le===void 0?re:le>>0,ue=Ie<0?Math.max(re+Ie,0):Math.min(Ie,re);ae<ue;)oe[ae]=$,ae++;return oe}),Array.of||V(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,k){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,k){g.last=function(oe){return oe[oe.length-1]},g.stringReverse=function(oe){return oe.split("").reverse().join("")},g.stringRepeat=function(oe,re){for(var Ce="";re>0;)re&1&&(Ce+=oe),(re>>=1)&&(oe+=oe);return Ce};var V=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(oe){return oe.replace(V,"")},g.stringTrimRight=function(oe){return oe.replace($,"")},g.copyObject=function(oe){var re={};for(var Ce in oe)re[Ce]=oe[Ce];return re},g.copyArray=function(oe){for(var re=[],Ce=0,ie=oe.length;Ce<ie;Ce++)oe[Ce]&&typeof oe[Ce]=="object"?re[Ce]=this.copyObject(oe[Ce]):re[Ce]=oe[Ce];return re},g.deepCopy=function oe(re){if(typeof re!="object"||!re)return re;var Ce;if(Array.isArray(re)){Ce=[];for(var ie=0;ie<re.length;ie++)Ce[ie]=oe(re[ie]);return Ce}if(Object.prototype.toString.call(re)!=="[object Object]")return re;Ce={};for(var ie in re)Ce[ie]=oe(re[ie]);return Ce},g.arrayToMap=function(oe){for(var re={},Ce=0;Ce<oe.length;Ce++)re[oe[Ce]]=1;return re},g.createMap=function(oe){var re=Object.create(null);for(var Ce in oe)re[Ce]=oe[Ce];return re},g.arrayRemove=function(oe,re){for(var Ce=0;Ce<=oe.length;Ce++)re===oe[Ce]&&oe.splice(Ce,1)},g.escapeRegExp=function(oe){return oe.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(oe){return(""+oe).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(oe,re){var Ce=[];return oe.replace(re,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(oe){var re=null,Ce=function(){re=null,oe()},ie=function(ae){return ie.cancel(),re=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),oe(),ie},ie.cancel=function(){return clearTimeout(re),re=null,ie},ie.isPending=function(){return re},ie},g.delayedCall=function(oe,re){var Ce=null,ie=function(){Ce=null,oe()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||re))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||re)},ae.schedule=ae,ae.call=function(){this.cancel(),oe()},ae.cancel=function(){Ce&&clearTimeout(Ce),Ce=null},ae.isPending=function(){return Ce},ae}}),ace.define("ace/lib/oop",["require","exports","module"],function(r,g,k){g.inherits=function(V,$){V.super_=$,V.prototype=Object.create($.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(V,$){for(var oe in $)V[oe]=$[oe];return V},g.implement=function(V,$){g.mixin(V,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,k){g.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},g.getOS=function(){return g.isMac?g.OS.MAC:g.isLinux?g.OS.LINUX:g.OS.WINDOWS};var V=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(V.platform)||["other"])[0].toLowerCase(),oe=V.userAgent||"",re=V.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=re=="Microsoft Internet Explorer"||re.indexOf("MSAppHost")>=0?parseFloat((oe.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((oe.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=oe.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(oe.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(oe.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(oe.split(" Edge/")[1])||void 0,g.isAIR=oe.indexOf("AdobeAIR")>=0,g.isAndroid=oe.indexOf("Android")>=0,g.isChromeOS=oe.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(oe)&&!window.MSStream,g.isIOS&&(g.isMac=!0),g.isMobile=g.isIOS||g.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(r,g,k){var V=r("./useragent"),$="http://www.w3.org/1999/xhtml";g.buildDom=function le(Ie,ue,de){if(typeof Ie=="string"&&Ie){var Ne=document.createTextNode(Ie);return ue&&ue.appendChild(Ne),Ne}if(!Array.isArray(Ie))return Ie&&Ie.appendChild&&ue&&ue.appendChild(Ie),Ie;if(typeof Ie[0]!="string"||!Ie[0]){for(var he=[],pe=0;pe<Ie.length;pe++){var ze=le(Ie[pe],ue,de);ze&&he.push(ze)}return he}var Fe=document.createElement(Ie[0]),xe=Ie[1],_e=1;xe&&typeof xe=="object"&&!Array.isArray(xe)&&(_e=2);for(var pe=_e;pe<Ie.length;pe++)le(Ie[pe],Fe,de);return _e==2&&Object.keys(xe).forEach(function(Dt){var $e=xe[Dt];Dt==="class"?Fe.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||Dt=="value"||Dt[0]=="$"?Fe[Dt]=$e:Dt==="ref"?de&&(de[$e]=Fe):Dt==="style"?typeof $e=="string"&&(Fe.style.cssText=$e):$e!=null&&Fe.setAttribute(Dt,$e)}),ue&&ue.appendChild(Fe),Fe},g.getDocumentHead=function(le){return le||(le=document),le.head||le.getElementsByTagName("head")[0]||le.documentElement},g.createElement=function(le,Ie){return document.createElementNS?document.createElementNS(Ie||$,le):document.createElement(le)},g.removeChildren=function(le){le.innerHTML=""},g.createTextNode=function(le,Ie){var ue=Ie?Ie.ownerDocument:document;return ue.createTextNode(le)},g.createFragment=function(le){var Ie=le?le.ownerDocument:document;return Ie.createDocumentFragment()},g.hasCssClass=function(le,Ie){var ue=(le.className+"").split(/\s+/g);return ue.indexOf(Ie)!==-1},g.addCssClass=function(le,Ie){g.hasCssClass(le,Ie)||(le.className+=" "+Ie)},g.removeCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g);;){var de=ue.indexOf(Ie);if(de==-1)break;ue.splice(de,1)}le.className=ue.join(" ")},g.toggleCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g),de=!0;;){var Ne=ue.indexOf(Ie);if(Ne==-1)break;de=!1,ue.splice(Ne,1)}return de&&ue.push(Ie),le.className=ue.join(" "),de},g.setCssClass=function(le,Ie,ue){ue?g.addCssClass(le,Ie):g.removeCssClass(le,Ie)},g.hasCssString=function(le,Ie){var ue=0,de;if(Ie=Ie||document,de=Ie.querySelectorAll("style")){for(;ue<de.length;)if(de[ue++].id===le)return!0}},g.removeElementById=function(le,Ie){Ie=Ie||document,Ie.getElementById(le)&&Ie.getElementById(le).remove()};var oe,re=[];g.useStrictCSP=function(le){oe=le,le==!1?Ce():re||(re=[])};function Ce(){var le=re;re=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(re){if(ue)Ce();else if(ue===!1)return re.push([le,Ie])}if(!oe){var de=ue;!ue||!ue.getRootNode?de=document:(de=ue.getRootNode(),(!de||de==ue)&&(de=document));var Ne=de.ownerDocument||de;if(Ie&&g.hasCssString(Ie,de))return null;Ie&&(le+=`
353
+ `)("x-vue-echarts")}catch{return w=!1}return w=!0}(),U="ecTheme",S=vue.defineComponent({name:"echarts",props:O(O({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},_),L),emits:{},inheritAttrs:!1,setup:function(i,n){var r=n.attrs,g=vue.shallowRef(),k=vue.shallowRef(),V=vue.shallowRef(),$=vue.inject("ecTheme",null),oe=vue.inject("ecInitOptions",null),re=vue.inject("ecUpdateOptions",null),Ce=vue.toRefs(i),ie=Ce.autoresize,ae=Ce.manualUpdate,le=Ce.loading,Ie=Ce.loadingOptions,ue=vue.computed(function(){return V.value||i.option||null}),de=vue.computed(function(){return i.theme||j($,{})}),Ne=vue.computed(function(){return i.initOptions||j(oe,{})}),he=vue.computed(function(){return i.updateOptions||j(re,{})}),pe=vue.computed(function(){return function($e){var Ue={};for(var Ve in $e)x(Ve)||(Ue[Ve]=$e[Ve]);return Ue}(r)}),ze=vue.getCurrentInstance().proxy.$listeners;function Fe($e){if(g.value){var Ue=k.value=init(g.value,de.value,Ne.value);i.group&&(Ue.group=i.group);var Ve=ze;Ve||(Ve={},Object.keys(r).filter(function(At){return At.indexOf("on")===0&&At.length>2}).forEach(function(At){var qe=At.charAt(2).toLowerCase()+At.slice(3);qe.substring(qe.length-4)==="Once"&&(qe="~".concat(qe.substring(0,qe.length-4))),Ve[qe]=r[At]})),Object.keys(Ve).forEach(function(At){var qe=Ve[At];if(qe){var Lt=At.toLowerCase();Lt.charAt(0)==="~"&&(Lt=Lt.substring(1),qe.__once__=!0);var kt=Ue;if(Lt.indexOf("zr:")===0&&(kt=Ue.getZr(),Lt=Lt.substring(3)),qe.__once__){delete qe.__once__;var jt=qe;qe=function(){for(var ti=[],ei=0;ei<arguments.length;ei++)ti[ei]=arguments[ei];jt.apply(void 0,ti),kt.off(Lt,qe)}}kt.on(Lt,qe)}}),ie.value?vue.nextTick(function(){Ue&&!Ue.isDisposed()&&Ue.resize(),Oe()}):Oe()}function Oe(){var At=$e||ue.value;At&&Ue.setOption(At,he.value)}}function xe(){k.value&&(k.value.dispose(),k.value=void 0)}var _e=null;vue.watch(ae,function($e){typeof _e=="function"&&(_e(),_e=null),$e||(_e=vue.watch(function(){return i.option},function(Ue,Ve){Ue&&(k.value?k.value.setOption(Ue,O({notMerge:Ue.value!==(Ve==null?void 0:Ve.value)},he.value)):Fe())},{deep:!0}))},{immediate:!0}),vue.watch([de,Ne],function(){xe(),Fe()},{deep:!0}),vue.watchEffect(function(){i.group&&k.value&&(k.value.group=i.group)});var Dt=y(k);return function($e,Ue,Ve){var Oe=vue.inject("ecLoadingOptions",{}),At=vue.computed(function(){return O(O({},j(Oe,{})),Ve==null?void 0:Ve.value)});vue.watchEffect(function(){var qe=$e.value;qe&&(Ue.value?qe.showLoading(At.value):qe.hideLoading())})}(k,le,Ie),function($e,Ue,Ve){var Oe=null;vue.watch([Ve,$e,Ue],function(At,qe,Lt){var kt=At[0],jt=At[1],ti=At[2];kt&&jt&&ti&&(Oe=throttle$1(function(){jt.resize()},100),addListener(kt,Oe)),Lt(function(){Oe&&kt&&removeListener(kt,Oe)})})}(k,ie,g),vue.onMounted(function(){Fe()}),vue.onBeforeUnmount(function(){T&&g.value?g.value.__dispose=xe:xe()}),O({chart:k,root:g,setOption:function($e,Ue){i.manualUpdate&&(V.value=$e),k.value?k.value.setOption($e,Ue||{}):Fe($e)},nonEventAttrs:pe},Dt)},render:function(){var i=O({},this.nonEventAttrs);return i.ref="root",i.class=i.class?["echarts"].concat(i.class):"echarts",vue.h("x-vue-echarts",i)}});const _sfc_main$l=vue.defineComponent({__name:"pie-charts",props:{title:{type:String,default:"标题"},seriesName:{type:String,default:"详情"},seriesData:{type:Array,default:()=>[]}},setup(i){const n=i;use([install$7,install$6,install$3,install$4,install]),vue.provide(U,"dark");const r=vue.reactive({title:{text:n.title,left:"center"},tooltip:{trigger:"item",formatter:"{a} <br/>{b} : {c} ({d}%)"},legend:{orient:"vertical",left:"left"},series:[{name:n.seriesName,type:"pie",radius:"55%",center:["50%","60%"],data:n.seriesData,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]});return vue.watch(n,g=>{r.title.text=g.title,r.series[0].name=g.seriesName,r.series[0].data=g.seriesData}),(g,k)=>(vue.openBlock(),vue.createBlock(vue.unref(S),{class:"chart",option:r,autoresize:""},null,8,["option"]))}}),pieCharts_vue_vue_type_style_index_0_scoped_2dc3e6cb_lang="",_export_sfc=(i,n)=>{const r=i.__vccOpts||i;for(const[g,k]of n)r[g]=k;return r},PieCharts=_export_sfc(_sfc_main$l,[["__scopeId","data-v-2dc3e6cb"]]),_hoisted_1$g=["id"],_hoisted_2$e=["id"],_hoisted_3$c=["fill"],_hoisted_4$9=["fill"],_hoisted_5$8=["fill"],_hoisted_6$5=vue.createElementVNode("path",{d:"M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z",fill:"#2D4375"},null,-1),_hoisted_7$5=vue.createElementVNode("path",{d:"M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z",fill:"#1E2D4F"},null,-1),_hoisted_8$4=["fill-opacity"],_hoisted_9$3=["fill-opacity"],_hoisted_10$3=["fill-opacity"],_hoisted_11$3=vue.createElementVNode("path",{d:"M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z",fill:"#CEEFF6"},null,-1),_hoisted_12$1=vue.createElementVNode("path",{d:"M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z",fill:"#FFFFFF"},null,-1),_hoisted_13$1=vue.createElementVNode("path",{d:"M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z",fill:"#CEEFF6"},null,-1),_hoisted_14$1=["xlink:href"],_sfc_main$k=vue.defineComponent({__name:"light-a",props:{id:{default:""},isOpen:{type:Boolean,default:!1}},emits:["onChange"],setup(i,{emit:n}){const r=i;return vue.watch(()=>r.isOpen,()=>{n("onChange")}),(g,k)=>(vue.openBlock(),vue.createElementBlock("g",{id:r.id,style:{cursor:"pointer"}},[vue.createElementVNode("symbol",{id:`${r.id}light-121`,viewBox:"0 0 1024 1024"},[vue.createElementVNode("path",{d:"M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z",fill:r.isOpen?"#FDB813":"#cccccc"},null,8,_hoisted_3$c),vue.createElementVNode("path",{d:"M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z",fill:r.isOpen?"#FD9B13":"#bbbbbb"},null,8,_hoisted_4$9),vue.createElementVNode("path",{d:"M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z",fill:r.isOpen?"#F12A3F":"#666666"},null,8,_hoisted_5$8),_hoisted_6$5,_hoisted_7$5,vue.createElementVNode("path",{d:"M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_8$4),vue.createElementVNode("path",{d:"M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_9$3),vue.createElementVNode("path",{d:"M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z",fill:"#FDB813","fill-opacity":r.isOpen?1:0},null,8,_hoisted_10$3),_hoisted_11$3,_hoisted_12$1,_hoisted_13$1],8,_hoisted_2$e),vue.createElementVNode("use",{"xlink:href":`#${r.id}light-121`,width:"100",height:"100"},null,8,_hoisted_14$1)],8,_hoisted_1$g))}}),_hoisted_1$f=["id"],_hoisted_2$d=["id"],_hoisted_3$b=vue.createElementVNode("path",{d:"M512.3 518.9m-469.2 0a469.2 469.2 0 1 0 938.4 0 469.2 469.2 0 1 0-938.4 0Z",fill:"#429BCF"},null,-1),_hoisted_4$8=vue.createElementVNode("path",{d:"M512.3 518.9m-392.5 0a392.5 392.5 0 1 0 785 0 392.5 392.5 0 1 0-785 0Z",fill:"#FFFFFF"},null,-1),_hoisted_5$7={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1-6.8-6.8-6.8-17.9 0-24.8l130.8-130.8c6.8-6.8 17.9-6.8 24.8 0 6.8 6.8 6.8 17.9 0 24.8L524.7 518.7c-3.5 3.4-7.9 5.1-12.4 5.1z",fill:"#2D416C"},_hoisted_6$4=["from","to"],_hoisted_7$4={d:"M512.3 523.8c-4.5 0-9-1.7-12.4-5.1L318.3 337.1c-6.8-6.8-6.8-17.9 0-24.8 6.8-6.8 17.9-6.8 24.8 0L524.7 494c6.8 6.8 6.8 17.9 0 24.8-3.5 3.3-7.9 5-12.4 5z",fill:"#365087"},_hoisted_8$3=["from","to"],_hoisted_9$2=vue.createElementVNode("path",{d:"M512.3 506.3m-47.5 0a47.5 47.5 0 1 0 95 0 47.5 47.5 0 1 0-95 0Z",fill:"#365087"},null,-1),_hoisted_10$2=vue.createElementVNode("path",{d:"M512.3 218.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM512.3 880.8c-9 0-16.3-7.3-16.3-16.3v-29.1c0-9 7.3-16.3 16.3-16.3s16.3 7.3 16.3 16.3v29.1c0 9-7.4 16.3-16.3 16.3zM812.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3zM150.4 518.9c0-9 7.3-16.3 16.3-16.3h29.1c9 0 16.3 7.3 16.3 16.3s-7.3 16.3-16.3 16.3h-29.1c-8.9 0-16.3-7.3-16.3-16.3z",fill:"#2D416C"},null,-1),_hoisted_11$2={d:"M296.9 733.5c-2.2 0-4.5-0.9-6.2-2.6-3.4-3.4-3.4-9 0-12.4L540 469.2c3.4-3.4 9-3.4 12.4 0 3.4 3.4 3.4 9 0 12.4L303.1 731c-1.7 1.7-4 2.5-6.2 2.5z",fill:"#C11B16"},_hoisted_12=["from","to"],_hoisted_13=vue.createElementVNode("path",{d:"M512.3 506.3m-22.8 0a22.8 22.8 0 1 0 45.6 0 22.8 22.8 0 1 0-45.6 0Z",fill:"#fff"},null,-1),_hoisted_14=["xlink:href"],_sfc_main$j=vue.defineComponent({__name:"clock-a",props:{id:{default:""}},setup(i){const n=i,r=vue.ref(new Date),g=r.value.getSeconds(),k=r.value.getMinutes(),V=Math.floor((r.value.getHours()+(k+g/60)/60)*30);return($,oe)=>(vue.openBlock(),vue.createElementBlock("g",{id:n.id},[vue.createElementVNode("symbol",{id:`${n.id}clock-a-n`,viewBox:"0 0 1024 1024"},[_hoisted_3$b,_hoisted_4$8,vue.createElementVNode("path",_hoisted_5$7,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${-45+vue.unref(V)} 512.3 506.3`,to:`${315+vue.unref(V)} 512.3 506.3`,dur:"43200s",repeatCount:"indefinite"},null,8,_hoisted_6$4)]),vue.createElementVNode("path",_hoisted_7$4,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${45+vue.unref(k)*6} 512.3 506.3`,to:`${405+vue.unref(k)*6} 512.3 506.3`,dur:"3600s",repeatCount:"indefinite"},null,8,_hoisted_8$3)]),_hoisted_9$2,_hoisted_10$2,vue.createElementVNode("path",_hoisted_11$2,[vue.createElementVNode("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:`${135.5+vue.unref(g)*6} 512.3 506.3`,to:`${495.5+vue.unref(g)*6} 512.3 506.3`,dur:"60s",repeatCount:"indefinite"},null,8,_hoisted_12)]),_hoisted_13],8,_hoisted_2$d),vue.createElementVNode("use",{"xlink:href":`#${n.id}clock-a-n`,width:"200",height:"200"},null,8,_hoisted_14)],8,_hoisted_1$f))}}),vueComp={"svg-text":_sfc_main$o,"el-button":ElButton,"progress-a":_sfc_main$q,"el-tag":ElTag,"common-table":_sfc_main$n,"pie-charts":PieCharts,"switch-a":_sfc_main$p,"now-time":_sfc_main$m,"light-a":_sfc_main$k,"clock-a":_sfc_main$j},config=[...svg_config_center,...vue_config_center];var EGlobalStoreIntention=(i=>(i.None="None",i.Create="Create",i.Move="Move",i.MoveCanvas="MoveCanvas",i.Select="Select",i.Zoom="Zoom",i.Rotate="Rotate",i.Connection="Connection",i.SetConnectionLineNode="SetConnectionLineNode",i.ContextMenu="ContextMenu",i))(EGlobalStoreIntention||{}),EMouseInfoState=(i=>(i.Down="Down",i.Up="Up",i))(EMouseInfoState||{}),EScaleInfoType=(i=>(i.None="",i.TopLeft="TopLeft",i.TopCenter="TopCenter",i.TopRight="TopRight",i.Left="Left",i.Right="Right",i.BottomLeft="BottomLeft",i.BottomCenter="BottomCenter",i.BottomRight="BottomRight",i))(EScaleInfoType||{});const useGlobalStore=pinia$1.defineStore("global-store",{state:()=>({config_center:config,intention:EGlobalStoreIntention.None,create_svg_info:null,done_json:[],mouse_info:{state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0},handle_svg_info:null,scale_info:{type:EScaleInfoType.None,scale_times:{x:1,y:1},scale_item_info:{x:0,y:0},symmetric_point:{x:0,y:0}},rotate_info:{angle:0},connection_line_node_info:{init_pos:{x:0,y:0},point_index:0}}),getters:{},actions:{setCreateInfo(i){this.intention=EGlobalStoreIntention.Create,this.create_svg_info=i},setDoneJson(i){isOfType(i,"id")?(this.done_json.push(i),vue.nextTick(()=>{setSvgActualInfo(i)})):this.done_json=objectDeepClone(i),vue.nextTick(()=>{useHistoryRecord(objectDeepClone(this.done_json))})},setMouseInfo(i){this.mouse_info=i},setHandleSvgInfo(i,n){let r=n;i?(!r&&r!=0&&(r=this.done_json.findIndex(g=>g.id===i.id)??-1),this.handle_svg_info={info:i,index:r}):this.handle_svg_info=i},setScaleInfo(i){this.scale_info=i},spliceDoneJson(i){const n=useGlobalStore();n.done_json.splice(i,1),useHistoryRecord(n.done_json)}}}),useSvgEditLayoutStore=pinia$1.defineStore("svg-edit-layout-store",{state:()=>({left_nav:!0,right_nav:!0,center_offset:{x:0,y:0}})});var EContextMenuInfoType=(i=>(i.Copy="Copy",i.Delete="Delete",i.MoveUpOneLevel="MoveUpOneLevel",i.MoveDownOneLevel="MoveDownOneLevel",i.MoveUpTopLevel="MoveUpTopLevel",i.MoveDownTopLevel="MoveDownTopLevel",i))(EContextMenuInfoType||{});const useEditPrivateStore=pinia$1.defineStore("edit-private-store",{state:()=>({old_done_components:[],history_doneComponent:[],history_now_index:0,is_record_history:!0,max_record_times:10}),getters:{getTopBtnUndoStatus(i){return i.history_now_index>=1},getTopBtnRedoStatus(i){return i.history_now_index+1!=i.history_doneComponent.length}},actions:{topUndoBtnClick(){if(console.log("撤销"),this.history_now_index<1)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index-=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])},topRedoBtnClick(){if(console.log("重做"),this.history_now_index+1==this.history_doneComponent.length)return;const i=useGlobalStore();this.is_record_history=!1,this.history_now_index+=1,i.setDoneJson(this.history_doneComponent[this.history_now_index])}}}),useContextMenuStore=pinia$1.defineStore("context-menu-store",{state:()=>({display:!1,info:{[EContextMenuInfoType.Copy]:{title:"复制",hot_key:"Ctrl+C",enable:!0},[EContextMenuInfoType.Delete]:{title:"删除",hot_key:"Delete",enable:!0},[EContextMenuInfoType.MoveUpTopLevel]:{title:"置于顶层",hot_key:"Ctrl+→",enable:!0},[EContextMenuInfoType.MoveDownTopLevel]:{title:"置于底层",hot_key:"Ctrl+←",enable:!0},[EContextMenuInfoType.MoveUpOneLevel]:{title:"置于上一层",hot_key:"Ctrl+↑",enable:!0},[EContextMenuInfoType.MoveDownOneLevel]:{title:"置于下一层",hot_key:"Ctrl+↓",enable:!0}}}),actions:{onContextMenuClick(i){const n=useGlobalStore();if(n.handle_svg_info)switch(n.intention=EGlobalStoreIntention.Select,i){case EContextMenuInfoType.Copy:const r=objectDeepClone(n.handle_svg_info.info);r.id=r.name+randomString(),r.title+="-copy",r.x+=10,r.y+=10,n.setDoneJson(r),this.display=!1,n.setHandleSvgInfo(r,n.done_json.length);break;case EContextMenuInfoType.Delete:n.spliceDoneJson(n.handle_svg_info.index),this.display=!1,n.setHandleSvgInfo(null),n.intention=EGlobalStoreIntention.None;break;case EContextMenuInfoType.MoveUpOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length-1)return;const g=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index+1],n.done_json[n.handle_svg_info.index+1]=g,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(g,n.handle_svg_info.index+1);break;case EContextMenuInfoType.MoveDownOneLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const k=n.handle_svg_info.info;n.done_json[n.handle_svg_info.index]=n.done_json[n.handle_svg_info.index-1],n.done_json[n.handle_svg_info.index-1]=k,useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(k,n.handle_svg_info.index-1);break;case EContextMenuInfoType.MoveDownTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===0)return;const V=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.unshift(V),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo(V,0);break;case EContextMenuInfoType.MoveUpTopLevel:if(n.done_json.length===1||n.handle_svg_info.index===n.done_json.length)return;const $=n.handle_svg_info.info;n.done_json.splice(n.handle_svg_info.index,1),n.done_json.push($),useHistoryRecord(n.done_json),this.display=!1,n.setHandleSvgInfo($,n.done_json.length-1);break}}}}),pinia=pinia$1.createPinia(),useHistoryRecord=i=>{const n=useEditPrivateStore();n.is_record_history&&(n.history_now_index+1<n.history_doneComponent.length&&n.history_doneComponent.splice(n.history_now_index+1),n.history_doneComponent.push(i),n.history_now_index=n.history_doneComponent.length-1,n.history_doneComponent.length>n.max_record_times&&(n.history_doneComponent.shift(),n.history_now_index=n.history_doneComponent.length-1)),n.is_record_history=!0},useImportDataModel=i=>{try{const n=JSON.parse(i);if(!n.config||!n.layout_center||!n.done_json)return ElMessage.error("请导入正确的数据模型!"),!1;const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return k.$state=n.config,g.center_offset=n.layout_center,r.setDoneJson(n.done_json),!0}catch(n){return ElMessage.error("请导入正确的数据模型!"),console.error(n),!1}},_hoisted_1$e={"aria-hidden":"true"},_hoisted_2$c=["xlink:href"],_sfc_main$i=vue.defineComponent({__name:"index",props:{name:{type:String,required:!0},props:{type:Object,default:()=>{}}},setup(i){const n=i,r=vue.computed(()=>`#svg-${n.name}`);return(g,k)=>(vue.openBlock(),vue.createElementBlock("svg",_hoisted_1$e,[vue.createElementVNode("use",vue.mergeProps({"xlink:href":r.value},n.props),null,16,_hoisted_2$c)]))}});var EVisibleConfKey=(i=>(i.ImportJson="ImportJson",i.ExportJson="ExportJson",i.ImportFile="ImportFile",i))(EVisibleConfKey||{});const _withScopeId$3=i=>(vue.pushScopeId("data-v-b0ad1445"),i=i(),vue.popScopeId(),i),_hoisted_1$d={class:"flex justify-between",style:{width:"100%"}},_hoisted_2$b={class:"flex items-center justify-between",style:{width:"220px"}},_hoisted_3$a=_withScopeId$3(()=>vue.createElementVNode("div",{class:"flex items-center"},[vue.createElementVNode("span",{class:"logo-title"},"组态编辑器")],-1)),_hoisted_4$7={class:"flex justify-between",style:{width:"calc(100% - 440px)"}},_hoisted_5$6={class:"flex items-center"},_hoisted_6$3={class:"flex items-center mr-20px"},_hoisted_7$3={class:"flex items-center",style:{width:"220px"}},_sfc_main$h=vue.defineComponent({__name:"index",emits:["changeVisible","onReturn","onPreview","onSave"],setup(i,{emit:n}){const r=useSvgEditLayoutStore(pinia),g=useGlobalStore(pinia),k=useEditPrivateStore(pinia),V=useConfigStore(pinia),$=()=>{g.done_json.length<=0||g.setDoneJson([]),g.intention=EGlobalStoreIntention.None},oe=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onPreview",Ce)},re=()=>{const Ce={layout_center:r.center_offset,config:V.$state,done_json:g.done_json};n("onSave",Ce)};return(Ce,ie)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$d,[vue.createElementVNode("div",_hoisted_2$b,[_hoisted_3$a,vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[0]||(ie[0]=ae=>vue.unref(r).left_nav=!vue.unref(r).left_nav)},{default:vue.withCtx(()=>[vue.unref(r).left_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-unfold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-fold"}))]),_:1})]),vue.createElementVNode("div",_hoisted_4$7,[vue.createElementVNode("div",_hoisted_5$6,[vue.createVNode(vue.unref(ElIcon),{title:"撤销 ctrl+z",size:20,class:vue.normalizeClass(`${vue.unref(k).getTopBtnUndoStatus?"bt-Icon":"icon-disable"} ml-20px`),onClick:ie[1]||(ie[1]=()=>vue.unref(k).topUndoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"undo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElIcon),{title:"重做 ctrl+shift+z",class:vue.normalizeClass(`${vue.unref(k).getTopBtnRedoStatus?"bt-Icon":"icon-disable"} ml-5px`),size:20,onClick:ie[2]||(ie[2]=()=>vue.unref(k).topRedoBtnClick())},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"redo"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"清空 ctrl+delete",class:vue.normalizeClass(`${vue.unref(g).done_json.length>0?"bt-Icon":"icon-disable"}`),size:20,onClick:$},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"导入数据模型",class:"bt-Icon",size:20,onClick:ie[3]||(ie[3]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ImportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"import"})]),_:1}),vue.createVNode(vue.unref(ElIcon),{title:"导出数据模型",size:20,class:"bt-Icon ml-5px",onClick:ie[4]||(ie[4]=ae=>n("changeVisible",vue.unref(EVisibleConfKey).ExportJson,!0))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"export"})]),_:1})]),vue.createElementVNode("div",_hoisted_6$3,[vue.createVNode(vue.unref(ElIcon),{title:"返回",class:"bt-Icon",size:20,onClick:ie[5]||(ie[5]=ae=>n("onReturn"))},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"return"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"保存",class:"bt-Icon",size:20,onClick:re},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"save"})]),_:1}),vue.createVNode(vue.unref(ElDivider),{direction:"vertical"}),vue.createVNode(vue.unref(ElIcon),{title:"预览",class:"bt-Icon",size:22,onClick:oe},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"preview"})]),_:1})])]),vue.createElementVNode("div",_hoisted_7$3,[vue.createVNode(vue.unref(ElIcon),{size:24,class:"bt-Icon",onClick:ie[6]||(ie[6]=ae=>vue.unref(r).right_nav=!vue.unref(r).right_nav)},{default:vue.withCtx(()=>[vue.unref(r).right_nav?(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:0,name:"menu-fold"})):(vue.openBlock(),vue.createBlock(_sfc_main$i,{key:1,name:"menu-unfold"}))]),_:1})])]))}}),index_vue_vue_type_style_index_0_scoped_b0ad1445_lang="",TopPanel=_export_sfc(_sfc_main$h,[["__scopeId","data-v-b0ad1445"]]),_hoisted_1$c={style:{"font-weight":"bold"}},_hoisted_2$a={class:"component-group flex flex-wrap"},_hoisted_3$9=["onDragstart","title"],_sfc_main$g=vue.defineComponent({__name:"index",props:{customToolbar:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=vue.ref(n.customToolbar&&Object.keys(n.customToolbar).length>0?n.customToolbar:r.config_center),k=vue.ref(["stateful","stateless","have_animation","custom_svg_group","element-ui","custom-vue","echarts"]),V=oe=>{r.setCreateInfo(oe)},$=oe=>{var re;if(((re=oe.dataTransfer)==null?void 0:re.dropEffect)!=="copy"){ElMessage.warning("请将组件拖到画布中!"),r.intention=EGlobalStoreIntention.None;return}};return(oe,re)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElCollapse),{modelValue:k.value,"onUpdate:modelValue":re[0]||(re[0]=Ce=>k.value=Ce)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,Ce=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:Ce.groupType,key:Ce.title},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$c,vue.toDisplayString(Ce.title),1)]),default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$a,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(Ce.list,ie=>(vue.openBlock(),vue.createElementBlock("div",{class:"ideal",key:ie.name,draggable:"true",onDragstart:ae=>V(ie),onDragend:$,title:ie.title},[vue.createVNode(vue.unref(ElIcon),{size:35,class:"flex items-center"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:ie.name,props:vue.unref(prosToVBind)(ie)},null,8,["name","props"])]),_:2},1024)],40,_hoisted_3$9))),128))])]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_e00305dc_lang="",LeftPanel=_export_sfc(_sfc_main$g,[["__scopeId","data-v-e00305dc"]]),calculateLeftTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightTop=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate(n,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateRightBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:V.x-k.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateLeftBottom=(i,n,r)=>{const g=getCenterPoint(i,n),k=calculateRotatedPointCoordinate(n,g,-r),V=calculateRotatedPointCoordinate(i,g,-r);return{width:k.x-V.x,height:V.y-k.y,is_old_width:!1,is_old_height:!1}},calculateTop=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateRight=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},calculateBottom=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:g.x,y:k.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:1,height:Math.round($),is_old_width:!0,is_old_height:!1}},calculateLeft=(i,n,r,g)=>{const k=calculateRotatedPointCoordinate(i,g,-r),V=calculateRotatedPointCoordinate({x:k.x,y:g.y},g,r),$=Math.sqrt((V.x-n.x)**2+(V.y-n.y)**2);return{width:Math.round($),height:1,is_old_width:!1,is_old_height:!0}},_hoisted_1$b={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$9=["fill","x","y"],_hoisted_3$8=["cx","cy"],_hoisted_4$6=["x1","y1","x2","y2"],_hoisted_5$5=["fill","x","y"],_hoisted_6$2=["fill","x","y"],_hoisted_7$2=["fill","x","y"],_hoisted_8$2=["fill","x","y"],_hoisted_9$1=["fill","x","y"],_hoisted_10$1=["fill","x","y"],_hoisted_11$1=["fill","x","y"],_sfc_main$f=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i;vue.useCssVars(ie=>({d86744e2:V.value}));const r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=[{start:338,end:23,cursor:"nw",type:EScaleInfoType.TopLeft},{start:23,end:68,cursor:"n",type:EScaleInfoType.TopCenter},{start:68,end:113,cursor:"ne",type:EScaleInfoType.TopRight},{start:293,end:338,cursor:"w",type:EScaleInfoType.Left},{start:113,end:158,cursor:"e",type:EScaleInfoType.Right},{start:248,end:293,cursor:"sw",type:EScaleInfoType.BottomLeft},{start:203,end:248,cursor:"s",type:EScaleInfoType.BottomCenter},{start:158,end:203,cursor:"se",type:EScaleInfoType.BottomRight}],oe=(ie,ae)=>{console.log("onHandleMouseDown",ae);const{clientX:le,clientY:Ie}=ae;ae.stopPropagation(),r.intention=EGlobalStoreIntention.Zoom,r.setMouseInfo({state:EMouseInfoState.Down,position_x:le-g.center_offset.x,position_y:Ie-g.center_offset.y,now_position_x:le-g.center_offset.x,now_position_y:Ie-g.center_offset.y,new_position_x:0,new_position_y:0}),r.setScaleInfo({type:ie,scale_times:{x:n.itemInfo.scale_x,y:n.itemInfo.scale_y},scale_item_info:{x:n.itemInfo.x,y:n.itemInfo.y},symmetric_point:{x:n.itemInfo.client.x+Math.abs(le-g.center_offset.x-n.itemInfo.client.x)*(le-g.center_offset.x<n.itemInfo.client.x?1:-1),y:n.itemInfo.client.y+Math.abs(Ie-g.center_offset.y-n.itemInfo.client.y)*(Ie-g.center_offset.y<n.itemInfo.client.y?1:-1)}})},re=ie=>{const{clientX:ae,clientY:le}=ie;ie.stopPropagation(),r.intention=EGlobalStoreIntention.Rotate,r.rotate_info={angle:n.itemInfo.rotate},r.setMouseInfo({state:EMouseInfoState.Down,position_x:ae-g.center_offset.x,position_y:le-g.center_offset.y,now_position_x:ae-g.center_offset.x,now_position_y:le-g.center_offset.y,new_position_x:0,new_position_y:0})},Ce=ie=>{const ae=(ie+n.itemInfo.rotate)%360,le=$.find(Ie=>Ie.start<=ae&&Ie.end>ae);return le?{cursor:le.cursor+"-resize",type:le.type}:{cursor:"nw-resize",type:EScaleInfoType.TopLeft}};return(ie,ae)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$b,[vue.createElementVNode("rect",{id:"resize_tl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(0).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[0]||(ae[0]=le=>oe(vue.unref(EScaleInfoType).TopLeft,le))},null,44,_hoisted_2$9),vue.createElementVNode("circle",{cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-24,r:4,class:"rotate-circle",onMousedown:re},null,40,_hoisted_3$8),vue.createElementVNode("line",{x1:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y1:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),x2:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2,y2:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)-20,style:vue.normalizeStyle({stroke:V.value,"stroke-width":2})},null,12,_hoisted_4$6),vue.createElementVNode("rect",{id:"resize_tc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(45).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value,y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[1]||(ae[1]=le=>oe(vue.unref(EScaleInfoType).TopCenter,le))},null,44,_hoisted_5$5),vue.createElementVNode("rect",{id:"resize_tr",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(90).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width-k.value+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[2]||(ae[2]=le=>oe(vue.unref(EScaleInfoType).TopRight,le))},null,44,_hoisted_6$2),vue.createElementVNode("rect",{id:"resize_l",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(315).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[3]||(ae[3]=le=>oe(vue.unref(EScaleInfoType).Left,le))},null,44,_hoisted_7$2),vue.createElementVNode("rect",{id:"resize_r",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(135).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[4]||(ae[4]=le=>oe(vue.unref(EScaleInfoType).Right,le))},null,44,_hoisted_8$2),vue.createElementVNode("rect",{id:"resize_bl",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(270).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[5]||(ae[5]=le=>oe(vue.unref(EScaleInfoType).BottomLeft,le))},null,44,_hoisted_9$1),vue.createElementVNode("rect",{id:"resize_bc",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(225).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2,y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[6]||(ae[6]=le=>oe(vue.unref(EScaleInfoType).BottomCenter,le))},null,44,_hoisted_10$1),vue.createElementVNode("rect",{id:"resize_br",width:"8",height:"8",fill:V.value,style:vue.normalizeStyle({cursor:Ce(180).cursor,"vector-effect":"non-scaling-stroke"}),"pointer-events":"all",x:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x),y:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y),stroke:"rgba(0,0,0,0)",onMousedown:ae[7]||(ae[7]=le=>oe(vue.unref(EScaleInfoType).BottomRight,le))},null,44,_hoisted_11$1)]))}}),index_vue_vue_type_style_index_0_scoped_450fe66d_lang="",HandlePanel=_export_sfc(_sfc_main$f,[["__scopeId","data-v-450fe66d"]]),_hoisted_1$a={style:{"vector-effect":"non-scaling-stroke"}},_hoisted_2$8=["cx","cy","r","fill"],_hoisted_3$7=["cx","cy","r","fill"],_hoisted_4$5=["cx","cy","r","fill"],_hoisted_5$4=["cx","cy","r","fill"],_sfc_main$e=vue.defineComponent({__name:"index",props:{itemInfo:{}},setup(i){const n=i,r=useGlobalStore(pinia),g=useConfigStore(pinia),k=vue.ref(4),V=vue.ref("#4F80FF"),$=vue.ref(4),oe=(re,Ce)=>{Ce.preventDefault();const{clientX:ie,clientY:ae}=Ce;let le=objectDeepClone(g.connection_line);console.log("onConnectionMouseDown",g.connection_line,Ce),le.bind_anchors.start={type:re,target_id:n.itemInfo.id};const{x:Ie,y:ue}=getAnchorPosByAnchorType(re,n.itemInfo),de={id:straight_line_system.name+randomString(),x:Ie,y:ue,client:{x:ie,y:ae},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...le};de.props.point_position.val.push({x:g.svg.svg_position_center.x,y:g.svg.svg_position_center.y}),r.setHandleSvgInfo(de,r.done_json.length),r.setDoneJson(de),r.intention=EGlobalStoreIntention.Connection,r.setMouseInfo({state:EMouseInfoState.Down,position_x:ie,position_y:ae,now_position_x:ie,now_position_y:ae,new_position_x:0,new_position_y:0})};return(re,Ce)=>(vue.openBlock(),vue.createElementBlock("g",_hoisted_1$a,[vue.createElementVNode("circle",{id:"connection_tc",cx:n.itemInfo.actual_bound.x+n.itemInfo.actual_bound.width/2-k.value+$.value,cy:n.itemInfo.actual_bound.y-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[0]||(Ce[0]=ie=>oe(vue.unref(ELineBindAnchors).TopCenter,ie))},null,40,_hoisted_2$8),vue.createElementVNode("circle",{id:"connection_l",cx:n.itemInfo.actual_bound.x-k.value-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[1]||(Ce[1]=ie=>oe(vue.unref(ELineBindAnchors).Left,ie))},null,40,_hoisted_3$7),vue.createElementVNode("circle",{id:"connection_r",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.width,n.itemInfo.scale_x)+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height*n.itemInfo.scale_y/2-vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[2]||(Ce[2]=ie=>oe(vue.unref(ELineBindAnchors).Right,ie))},null,40,_hoisted_4$5),vue.createElementVNode("circle",{id:"connection_bc",cx:n.itemInfo.actual_bound.x-k.value+n.itemInfo.actual_bound.width/2+$.value,cy:n.itemInfo.actual_bound.y-k.value+n.itemInfo.actual_bound.height+vue.unref(getCoordinateOffset)(n.itemInfo.actual_bound.height,n.itemInfo.scale_y)+$.value,r:$.value,stroke:"rgba(0,0,0,0)","stroke-width":"2",fill:V.value,style:{"vector-effect":"non-scaling-stroke",cursor:"pointer"},"pointer-events":"all",onMousedown:Ce[3]||(Ce[3]=ie=>oe(vue.unref(ELineBindAnchors).BottomCenter,ie))},null,40,_hoisted_5$4)]))}}),_hoisted_1$9=["id","d","stroke","stroke-width","stroke-dasharray"],_hoisted_2$7=["from","to","dur","repeatCount"],_hoisted_3$6=["d","stroke","stroke-width","stroke-dasharray"],_hoisted_4$4=["from","to","dur","repeatCount"],_hoisted_5$3=["r","fill"],_hoisted_6$1=["path","dur","repeatCount"],_hoisted_7$1={key:2},_hoisted_8$1=["cx","cy","stroke","onMousedown"],_sfc_main$d=vue.defineComponent({__name:"index",props:{itemInfo:{},pointVisible:{type:Boolean,default:!1}},setup(i){const n=i,r=useGlobalStore(pinia),g=(k,V,$,oe)=>{if(r.intention===EGlobalStoreIntention.Connection)return;r.setHandleSvgInfo(n.itemInfo);const{clientX:re,clientY:Ce}=V;V.stopPropagation(),r.connection_line_node_info={init_pos:{x:$,y:oe},point_index:k},r.intention=EGlobalStoreIntention.SetConnectionLineNode,r.setMouseInfo({state:EMouseInfoState.Down,position_x:re,position_y:Ce,now_position_x:re,now_position_y:Ce,new_position_x:0,new_position_y:0})};return(k,V)=>{var $,oe,re,Ce,ie;return vue.openBlock(),vue.createElementBlock("g",null,[vue.createElementVNode("path",{id:n.itemInfo.id,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none",stroke:(($=n.itemInfo.animations)==null?void 0:$.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.animations.color.val:n.itemInfo.props.stroke.val,"stroke-width":n.itemInfo.props["stroke-width"].val,style:{cursor:"move"},"stroke-dashoffset":"0","stroke-dasharray":((oe=n.itemInfo.animations)==null?void 0:oe.type.val)===vue.unref(EConfigAnimationsType).Electricity?n.itemInfo.props["stroke-width"].val*3:0},[((re=n.itemInfo.animations)==null?void 0:re.type.val)===vue.unref(EConfigAnimationsType).Electricity?(vue.openBlock(),vue.createElementBlock("animate",{key:0,attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_2$7)):vue.createCommentVNode("",!0)],8,_hoisted_1$9),((Ce=n.itemInfo.animations)==null?void 0:Ce.type.val)===vue.unref(EConfigAnimationsType).WaterDrop?(vue.openBlock(),vue.createElementBlock("path",{key:0,d:vue.unref(positionArrToPath)(n.itemInfo.props.point_position.val),fill:"none","fill-opacity":"0",stroke:n.itemInfo.animations.color.val,"stroke-width":n.itemInfo.props["stroke-width"].val,"stroke-dasharray":n.itemInfo.props["stroke-width"].val*3,"stroke-dashoffset":"0","stroke-linecap":"round"},[vue.createElementVNode("animate",{attributeName:"stroke-dashoffset",from:n.itemInfo.animations.reverse.val?0:1e3,to:n.itemInfo.animations.reverse.val?1e3:0,dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val,fill:"freeze"},null,8,_hoisted_4$4)],8,_hoisted_3$6)):((ie=n.itemInfo.animations)==null?void 0:ie.type.val)===vue.unref(EConfigAnimationsType).Track?(vue.openBlock(),vue.createElementBlock("circle",{key:1,cx:"0",cy:"0",r:n.itemInfo.props["stroke-width"].val*2,fill:n.itemInfo.animations.color.val},[vue.createElementVNode("animateMotion",{path:vue.unref(positionArrToPath)(n.itemInfo.animations.reverse.val?[...n.itemInfo.props.point_position.val].reverse():n.itemInfo.props.point_position.val),dur:`${n.itemInfo.animations.dur.val}s`,repeatCount:n.itemInfo.animations.repeatCount.val},null,8,_hoisted_6$1)],8,_hoisted_5$3)):vue.createCommentVNode("",!0),n.pointVisible?(vue.openBlock(),vue.createElementBlock("g",_hoisted_7$1,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.itemInfo.props.point_position.val,(ae,le)=>(vue.openBlock(),vue.createElementBlock("circle",{key:le,cx:ae.x,cy:ae.y,r:"6","stroke-width":"1",stroke:n.itemInfo.props.stroke.val,fill:"#fff",style:{cursor:"pointer"},onMousedown:Ie=>g(le,Ie,ae.x,ae.y)},null,40,_hoisted_8$1))),128))])):vue.createCommentVNode("",!0)])}}}),_withScopeId$2=i=>(vue.pushScopeId("data-v-b0d244b1"),i=i(),vue.popScopeId(),i),_hoisted_1$8=_withScopeId$2(()=>vue.createElementVNode("defs",null,[vue.createElementVNode("pattern",{id:"pattern_grid",patternUnits:"userSpaceOnUse",x:"0",y:"0",width:"10",height:"10"},[vue.createElementVNode("rect",{width:"1",height:"1",rx:"1",ry:"1",fill:"#aaaaaa"})])],-1)),_hoisted_2$6={key:0,width:"100%",height:"100%",fill:"url(#pattern_grid)"},_hoisted_3$5=["transform"],_hoisted_4$3=["transform"],_hoisted_5$2=["transform","onMousedown","onMouseenter","onMouseleave","onContextmenu"],_hoisted_6=["xlink:href","id","transform"],_hoisted_7=["id"],_hoisted_8=["id","x1","y1","x2","y2"],_hoisted_9=["id"],_hoisted_10=["onClick"],_hoisted_11={class:"shortcut"},_sfc_main$c=vue.defineComponent({__name:"index",setup(i){vue.useCssVars(Ue=>({"36a85969":Ce.value}));const n=vue.getCurrentInstance();Object.keys(vueComp).forEach(Ue=>{var Ve;Object.keys((Ve=n==null?void 0:n.appContext)==null?void 0:Ve.components).includes(Ue)||n==null||n.appContext.app.component(Ue,vueComp[Ue])});const r=useGlobalStore(pinia),g=useConfigStore(pinia),k=useSvgEditLayoutStore(pinia),V=useEditPrivateStore(pinia),$=useContextMenuStore(pinia),oe=vue.ref(),re=vue.ref(),Ce=vue.computed(()=>r.intention==EGlobalStoreIntention.MoveCanvas?"grab":r.intention==EGlobalStoreIntention.Rotate?"url('/src/assets/icons/rotate.svg') 12 12, auto":"default"),ie=vue.reactive({handle_panel:vue.computed(()=>r.intention===EGlobalStoreIntention.Select||r.intention===EGlobalStoreIntention.Zoom||r.intention===EGlobalStoreIntention.Rotate),connection_panel:!1,connection_line:!1,select_item:{info:null,index:-1}}),ae=Ue=>{var Ve;if(r.intention!=EGlobalStoreIntention.None){if(r.intention==EGlobalStoreIntention.Create){if(!r.create_svg_info){console.error("要创建的数据获取失败");return}const Oe=Math.floor(Ue.clientX-k.center_offset.x),At=Math.floor(Ue.clientY-k.center_offset.y),qe={id:randomString(),x:Oe,y:At,client:{x:Oe,y:At},scale_x:1,scale_y:1,rotate:0,actual_bound:{x:0,y:0,width:0,height:0},point_coordinate:{tl:{x:0,y:0},tc:{x:0,y:0},tr:{x:0,y:0},l:{x:0,y:0},r:{x:0,y:0},bl:{x:0,y:0},bc:{x:0,y:0},br:{x:0,y:0}},...objectDeepClone(r.create_svg_info)};r.setHandleSvgInfo(qe,r.done_json.length),r.setDoneJson(qe),r.intention=EGlobalStoreIntention.None}(Ve=re.value)==null||Ve.focus()}},le=Ue=>{Ue.preventDefault()},Ie=Ue=>{Ue.preventDefault()},ue=(Ue,Ve,Oe)=>{var At;(At=re.value)==null||At.focus(),r.intention!==EGlobalStoreIntention.Connection&&(Oe.preventDefault(),Oe.stopPropagation(),r.intention=EGlobalStoreIntention.Select,r.setHandleSvgInfo(Ue,Ve),r.setMouseInfo({state:EMouseInfoState.Down,position_x:Oe.clientX,position_y:Oe.clientY,now_position_x:Ue.x,now_position_y:Ue.y,new_position_x:Ue.x,new_position_y:Ue.y}))},de=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),ie.connection_panel=!0,ie.connection_line=!0,!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.select_item.info=Ue,ie.select_item.index=Ve)},Ne=(Ue,Ve,Oe)=>{Oe.preventDefault(),Oe.stopPropagation(),!((r.intention===EGlobalStoreIntention.Connection||r.intention===EGlobalStoreIntention.SetConnectionLineNode)&&Ue.type===EDoneJsonType.ConnectionLine)&&(ie.connection_panel=!1,ie.connection_line=!1,ie.select_item.info=null,ie.select_item.index=-1)},he=Ue=>{var At,qe,Lt,kt;if(r.mouse_info.state!=EMouseInfoState.Down&&r.intention!==EGlobalStoreIntention.Connection)return;const{clientX:Ve,clientY:Oe}=Ue;if(r.mouse_info.new_position_x=r.mouse_info.now_position_x+Ve-r.mouse_info.position_x,r.mouse_info.new_position_y=r.mouse_info.now_position_y+Oe-r.mouse_info.position_y,(At=r.handle_svg_info)!=null&&At.info&&(r.intention==EGlobalStoreIntention.Select||r.intention==EGlobalStoreIntention.Move))r.handle_svg_info.info.x=r.mouse_info.new_position_x,r.handle_svg_info.info.y=r.mouse_info.new_position_y,r.handle_svg_info.info.client={x:r.mouse_info.new_position_x,y:r.mouse_info.new_position_y},r.intention=EGlobalStoreIntention.Move;else if(r.intention==EGlobalStoreIntention.MoveCanvas)k.center_offset.x=r.mouse_info.new_position_x,k.center_offset.y=r.mouse_info.new_position_y;else if(r.intention===EGlobalStoreIntention.Zoom){if(!r.handle_svg_info)return;const jt={x:Ue.clientX-k.center_offset.x,y:Ue.clientY-k.center_offset.y};let ti={width:0,height:0,is_old_width:!1,is_old_height:!1};if(r.scale_info.type===EScaleInfoType.TopLeft?ti=calculateLeftTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopRight?ti=calculateRightTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomRight?ti=calculateRightBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.BottomLeft?ti=calculateLeftBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate):r.scale_info.type===EScaleInfoType.TopCenter?ti=calculateTop(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Right?ti=calculateRight(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.BottomCenter?ti=calculateBottom(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client):r.scale_info.type===EScaleInfoType.Left&&(ti=calculateLeft(jt,r.scale_info.symmetric_point,r.handle_svg_info.info.rotate,r.handle_svg_info.info.client)),r.handle_svg_info&&ti.width>0&&ti.height>0){const ei=ti.is_old_width?1:ti.width/r.handle_svg_info.info.actual_bound.width,Pt=ti.is_old_height?1:ti.height/r.handle_svg_info.info.actual_bound.height,ni=getCenterPoint(jt,r.scale_info.symmetric_point);ei>0&&r.scale_info.type!==EScaleInfoType.TopCenter&&r.scale_info.type!==EScaleInfoType.BottomCenter&&(r.handle_svg_info.info.scale_x=ei,r.handle_svg_info.info.x=getSvgNowPosition(r.handle_svg_info.info.client.x,ni.x,r.scale_info.scale_item_info.x)),Pt>0&&r.scale_info.type!==EScaleInfoType.Left&&r.scale_info.type!==EScaleInfoType.Right&&(r.handle_svg_info.info.scale_y=Pt,r.handle_svg_info.info.y=getSvgNowPosition(r.handle_svg_info.info.client.y,ni.y,r.scale_info.scale_item_info.y))}}else if(r.intention===EGlobalStoreIntention.Rotate){if(!r.handle_svg_info)return;const jt=Math.atan2(r.mouse_info.position_y-r.handle_svg_info.info.client.y,r.mouse_info.position_x-r.handle_svg_info.info.client.x)/(Math.PI/180),ti=Math.atan2(Oe-k.center_offset.y-r.handle_svg_info.info.client.y,Ve-k.center_offset.x-r.handle_svg_info.info.client.x)/(Math.PI/180);r.handle_svg_info.info.rotate=r.rotate_info.angle+ti-jt}else r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info?r.handle_svg_info.info.props.point_position.val[((qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val.length)-1]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,(Lt=r.handle_svg_info)==null?void 0:Lt.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(kt=r.handle_svg_info)==null?void 0:kt.info.props.point_position.val[0].y)}:r.intention===EGlobalStoreIntention.SetConnectionLineNode&&r.handle_svg_info&&(r.handle_svg_info.info.props.point_position.val[r.connection_line_node_info.point_index]={x:getSvgNowPosition(r.mouse_info.position_x,Ve,r.connection_line_node_info.init_pos.x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,r.connection_line_node_info.init_pos.y)})},pe=()=>{var Ue,Ve,Oe;if(r.mouse_info.state==EMouseInfoState.Down){if((Ue=r.handle_svg_info)!=null&&Ue.info&&r.intention==EGlobalStoreIntention.Move)r.done_json[r.handle_svg_info.index].x=r.mouse_info.new_position_x,r.done_json[r.handle_svg_info.index].y=r.mouse_info.new_position_y,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.intention=EGlobalStoreIntention.None,r.setDoneJson(r.done_json);else if((Ve=r.handle_svg_info)!=null&&Ve.info&&r.intention==EGlobalStoreIntention.Zoom)r.handle_svg_info.info.client={x:r.handle_svg_info.info.x,y:r.handle_svg_info.info.y},r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else if(r.intention===EGlobalStoreIntention.Rotate&&((Oe=r.handle_svg_info)!=null&&Oe.info))setSvgActualInfo(r.done_json[r.handle_svg_info.index]),r.setDoneJson(r.done_json);else{if(r.intention===EGlobalStoreIntention.Connection)return;r.intention!=EGlobalStoreIntention.Select&&(r.intention=EGlobalStoreIntention.None)}r.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}),$.display=!1}},ze=Ue=>{var At,qe;const{clientX:Ve,clientY:Oe}=Ue;if(r.intention===EGlobalStoreIntention.Connection&&r.handle_svg_info){Ue.button===0&&r.handle_svg_info.info.props.point_position.val.push({x:getSvgNowPosition(r.mouse_info.position_x,Ve,(At=r.handle_svg_info)==null?void 0:At.info.props.point_position.val[0].x),y:getSvgNowPosition(r.mouse_info.position_y,Oe,(qe=r.handle_svg_info)==null?void 0:qe.info.props.point_position.val[0].y)}),Ue.button===2&&(r.intention=EGlobalStoreIntention.None,setSvgActualInfo(r.done_json[r.handle_svg_info.index]));return}r.intention=EGlobalStoreIntention.MoveCanvas,r.setMouseInfo({state:EMouseInfoState.Down,position_x:Ve,position_y:Oe,now_position_x:k.center_offset.x,now_position_y:k.center_offset.y,new_position_x:k.center_offset.x,new_position_y:k.center_offset.y})},Fe=Ue=>{Ue.stopPropagation(),Ue.preventDefault()},xe=(Ue,Ve,Oe)=>{console.log(r.intention),r.intention!==EGlobalStoreIntention.Connection&&oe.value&&(r.intention=EGlobalStoreIntention.ContextMenu,r.setHandleSvgInfo(Ue,Ve),oe.value.style.left=Oe.pageX+"px",oe.value.style.top=Oe.pageY+"px",$.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=$.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!0,Ve===r.done_json.length-1&&($.info.MoveUpOneLevel.enable=$.info.MoveUpTopLevel.enable=!1),Ve===0&&($.info.MoveDownOneLevel.enable=$.info.MoveDownTopLevel.enable=!1),$.display=!0)},_e=(Ue,Ve,Oe)=>({x:Ue.x-Ue.width/2*Ve+Ue.width/2,y:Ue.y-Ue.height/2*Oe+Ue.height/2,width:Ue.width*Ve,height:Ue.height*Oe}),Dt=Ue=>{console.log(Ue,733),Ue.preventDefault(),r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowUp"?(r.done_json[r.handle_svg_info.index].y-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowDown"?(r.handle_svg_info.info.y+=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowLeft"?(r.handle_svg_info.info.x-=1,useHistoryRecord(r.done_json)):r.handle_svg_info&&!Ue.ctrlKey&&Ue.key=="ArrowRight"?(r.handle_svg_info.info.x+=1,useHistoryRecord(r.done_json)):Ue.ctrlKey&&Ue.key.toLowerCase()=="c"?$.onContextMenuClick(EContextMenuInfoType.Copy):!Ue.ctrlKey&&Ue.key=="Delete"?$.onContextMenuClick(EContextMenuInfoType.Delete):Ue.ctrlKey&&Ue.key=="ArrowUp"?$.onContextMenuClick(EContextMenuInfoType.MoveUpOneLevel):Ue.ctrlKey&&Ue.key=="ArrowDown"?$.onContextMenuClick(EContextMenuInfoType.MoveDownOneLevel):Ue.ctrlKey&&Ue.key=="ArrowLeft"?$.onContextMenuClick(EContextMenuInfoType.MoveDownTopLevel):Ue.ctrlKey&&Ue.key=="ArrowRight"?$.onContextMenuClick(EContextMenuInfoType.MoveUpTopLevel):Ue.ctrlKey&&Ue.shiftKey&&Ue.key.toLowerCase()=="z"?V.topRedoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="z"?V.topUndoBtnClick():Ue.ctrlKey&&Ue.key.toLowerCase()=="delete"&&(r.done_json.length<=0||r.setDoneJson([]))},$e=()=>{setSvgActualInfo(r.done_json[r.handle_svg_info.index],!0)};return vue.onMounted(()=>{var Ue;(Ue=re.value)==null||Ue.focus()}),(Ue,Ve)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",tabindex:"0",ref_key:"canvasRef",ref:re,onDrop:ae,onDragenter:le,onDragover:Ie,onMousedown:ze,onMousemove:he,onMouseup:pe,onContextmenu:Fe,onKeydown:Dt},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:vue.unref(g).svg.background_color}),width:"100%",height:"100%"},[_hoisted_1$8,vue.unref(g).svg.grid?(vue.openBlock(),vue.createElementBlock("rect",_hoisted_2$6)):vue.createCommentVNode("",!0),vue.createElementVNode("g",{transform:`translate(${vue.unref(g).svg.position_center.x+vue.unref(k).center_offset.x},${vue.unref(g).svg.position_center.y+vue.unref(k).center_offset.y})rotate(0)scale(${vue.unref(g).svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).done_json,(Oe,At)=>{var qe,Lt,kt,jt,ti,ei;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Oe.id,transform:`translate(${Oe.x},${Oe.y})rotate(0)scale(1)`},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Oe)}`)},[vue.createElementVNode("g",{transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2})rotate(${Oe.rotate}) scale(1) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`,onMousedown:Pt=>ue(Oe,At,Pt),onMouseenter:Pt=>de(Oe,At,Pt),onMouseleave:Pt=>Ne(Oe,At,Pt),onContextmenu:Pt=>xe(Oe,At,Pt)},[Oe.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Oe,"point-visible":ie.connection_line&&((qe=ie.select_item.info)==null?void 0:qe.id)==Oe.id},null,8,["item-info","point-visible"])):Oe.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Oe.name}`},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,_hoisted_6)):Oe.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Oe),{width:"100",height:"100",id:Oe.id,onResize:$e,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),null,16,["id","transform"])):Oe.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{id:`foreign-object${Oe.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Oe.tag),vue.mergeProps(vue.unref(prosToVBind)(Oe),{id:Oe.id,transform:`translate(${Oe.actual_bound.x+Oe.actual_bound.width/2},${Oe.actual_bound.y+Oe.actual_bound.height/2}) scale(${Oe.scale_x},${Oe.scale_y}) translate(${-(Oe.actual_bound.x+Oe.actual_bound.width/2)},${-(Oe.actual_bound.y+Oe.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Oe.tag_slot),1)]),_:2},1040,["id","transform"]))],16,_hoisted_7)):Oe.type===vue.unref(EDoneJsonType).StraightLine?(vue.openBlock(),vue.createElementBlock("line",{key:4,id:Oe.id,x1:Oe.props.start_x.val,y1:Oe.props.start_y.val,x2:Oe.props.end_x.val,y2:Oe.props.end_y.val,fill:"#FF0000",stroke:"#FF0000","stroke-width":"2"},null,8,_hoisted_8)):vue.createCommentVNode("",!0),Oe.config.actual_rect?(vue.openBlock(),vue.createElementBlock("rect",vue.mergeProps({key:5,id:`rect${Oe.id}`,fill:"black","fill-opacity":"0"},_e(Oe.actual_bound,Oe.scale_x,Oe.scale_y),{style:{stroke:"none","stroke-width":"2","stroke-miterlimit":"10"},class:`${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).None||vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select?"svg-item-none":""}
354
+ ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Move&&((Lt=vue.unref(r).handle_svg_info)==null?void 0:Lt.info.id)==Oe.id?"svg-item-move":""} ${vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&((kt=vue.unref(r).handle_svg_info)==null?void 0:kt.info.id)==Oe.id?"svg-item-select":""}`}),null,16,_hoisted_9)):vue.createCommentVNode("",!0),((jt=vue.unref(r).handle_svg_info)==null?void 0:jt.info.id)===Oe.id&&ie.handle_panel&&Oe.config.can_zoom?(vue.openBlock(),vue.createBlock(HandlePanel,{key:6,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0),((ti=ie.select_item.info)==null?void 0:ti.id)==Oe.id&&ie.connection_panel&&Oe.config.have_anchor&&(vue.unref(r).intention!==vue.unref(EGlobalStoreIntention).Select||Oe.id!==((ei=vue.unref(r).handle_svg_info)==null?void 0:ei.info.id))?(vue.openBlock(),vue.createBlock(_sfc_main$e,{key:7,"item-info":Oe},null,8,["item-info"])):vue.createCommentVNode("",!0)],40,_hoisted_5$2)],2)],8,_hoisted_4$3)),[[vue.vShow,Oe.display]])}),128))],8,_hoisted_3$5)],4)),vue.withDirectives(vue.createElementVNode("ul",{ref_key:"contextMenuRef",ref:oe,class:"contextMenu"},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref($).info,(Oe,At)=>(vue.openBlock(),vue.createElementBlock("li",{key:Oe.title,onClick:qe=>vue.unref($).onContextMenuClick(At)},[vue.createElementVNode("p",{class:vue.normalizeClass(Oe.enable?"":"disabled")},[vue.createTextVNode(vue.toDisplayString(Oe.title)+" ",1),vue.createElementVNode("span",_hoisted_11,vue.toDisplayString(Oe.hot_key),1)],2)],8,_hoisted_10))),128))],512),[[vue.vShow,vue.unref($).display]])],544))}}),index_vue_vue_type_style_index_0_scoped_b0d244b1_lang="",CenterPanel=_export_sfc(_sfc_main$c,[["__scopeId","data-v-b0d244b1"]]);var ace$2={exports:{}};(function(i,n){(function(){var r="ace",g=function(){return this}();!g&&typeof window<"u"&&(g=window);var k=function(ie,ae,le){if(typeof ie!="string"){k.original?k.original.apply(this,arguments):(console.error("dropping module because define wasn't a string."),console.trace());return}arguments.length==2&&(le=ae),k.modules[ie]||(k.payloads[ie]=le,k.modules[ie]=null)};k.modules={},k.payloads={};var V=function(ie,ae,le){if(typeof ae=="string"){var Ie=re(ie,ae);if(Ie!=null)return le&&le(),Ie}else if(Object.prototype.toString.call(ae)==="[object Array]"){for(var ue=[],de=0,Ne=ae.length;de<Ne;++de){var he=re(ie,ae[de]);if(he==null&&$.original)return;ue.push(he)}return le&&le.apply(null,ue)||!0}},$=function(ie,ae){var le=V("",ie,ae);return le==null&&$.original?$.original.apply(this,arguments):le},oe=function(ie,ae){if(ae.indexOf("!")!==-1){var le=ae.split("!");return oe(ie,le[0])+"!"+oe(ie,le[1])}if(ae.charAt(0)=="."){var Ie=ie.split("/").slice(0,-1).join("/");for(ae=Ie+"/"+ae;ae.indexOf(".")!==-1&&ue!=ae;){var ue=ae;ae=ae.replace(/\/\.\//,"/").replace(/[^\/]+\/\.\.\//,"")}}return ae},re=function(ie,ae){ae=oe(ie,ae);var le=k.modules[ae];if(!le){if(le=k.payloads[ae],typeof le=="function"){var Ie={},ue={id:ae,uri:"",exports:Ie,packaged:!0},de=function(he,pe){return V(ae,he,pe)},Ne=le(de,Ie,ue);Ie=Ne||ue.exports,k.modules[ae]=Ie,delete k.payloads[ae]}le=k.modules[ae]=Ie||le}return le};function Ce(ie){var ae=g;ie&&(g[ie]||(g[ie]={}),ae=g[ie]),(!ae.define||!ae.define.packaged)&&(k.original=ae.define,ae.define=k,ae.define.packaged=!0),(!ae.require||!ae.require.packaged)&&($.original=ae.require,ae.require=$,ae.require.packaged=!0)}Ce(r)})(),ace.define("ace/lib/es6-shim",["require","exports","module"],function(r,g,k){function V($,oe,re){Object.defineProperty($,oe,{value:re,enumerable:!1,writable:!0,configurable:!0})}String.prototype.startsWith||V(String.prototype,"startsWith",function($,oe){return oe=oe||0,this.lastIndexOf($,oe)===oe}),String.prototype.endsWith||V(String.prototype,"endsWith",function($,oe){var re=this;(oe===void 0||oe>re.length)&&(oe=re.length),oe-=$.length;var Ce=re.indexOf($,oe);return Ce!==-1&&Ce===oe}),String.prototype.repeat||V(String.prototype,"repeat",function($){for(var oe="",re=this;$>0;)$&1&&(oe+=re),($>>=1)&&(re+=re);return oe}),String.prototype.includes||V(String.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Object.assign||(Object.assign=function($){if($==null)throw new TypeError("Cannot convert undefined or null to object");for(var oe=Object($),re=1;re<arguments.length;re++){var Ce=arguments[re];Ce!=null&&Object.keys(Ce).forEach(function(ie){oe[ie]=Ce[ie]})}return oe}),Object.values||(Object.values=function($){return Object.keys($).map(function(oe){return $[oe]})}),Array.prototype.find||V(Array.prototype,"find",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return ie}}),Array.prototype.findIndex||V(Array.prototype,"findIndex",function($){for(var oe=this.length,re=arguments[1],Ce=0;Ce<oe;Ce++){var ie=this[Ce];if($.call(re,ie,Ce,this))return Ce}}),Array.prototype.includes||V(Array.prototype,"includes",function($,oe){return this.indexOf($,oe)!=-1}),Array.prototype.fill||V(Array.prototype,"fill",function($){for(var oe=this,re=oe.length>>>0,Ce=arguments[1],ie=Ce>>0,ae=ie<0?Math.max(re+ie,0):Math.min(ie,re),le=arguments[2],Ie=le===void 0?re:le>>0,ue=Ie<0?Math.max(re+Ie,0):Math.min(Ie,re);ae<ue;)oe[ae]=$,ae++;return oe}),Array.of||V(Array,"of",function(){return Array.prototype.slice.call(arguments)})}),ace.define("ace/lib/fixoldbrowsers",["require","exports","module","ace/lib/es6-shim"],function(r,g,k){r("./es6-shim")}),ace.define("ace/lib/lang",["require","exports","module"],function(r,g,k){g.last=function(oe){return oe[oe.length-1]},g.stringReverse=function(oe){return oe.split("").reverse().join("")},g.stringRepeat=function(oe,re){for(var Ce="";re>0;)re&1&&(Ce+=oe),(re>>=1)&&(oe+=oe);return Ce};var V=/^\s\s*/,$=/\s\s*$/;g.stringTrimLeft=function(oe){return oe.replace(V,"")},g.stringTrimRight=function(oe){return oe.replace($,"")},g.copyObject=function(oe){var re={};for(var Ce in oe)re[Ce]=oe[Ce];return re},g.copyArray=function(oe){for(var re=[],Ce=0,ie=oe.length;Ce<ie;Ce++)oe[Ce]&&typeof oe[Ce]=="object"?re[Ce]=this.copyObject(oe[Ce]):re[Ce]=oe[Ce];return re},g.deepCopy=function oe(re){if(typeof re!="object"||!re)return re;var Ce;if(Array.isArray(re)){Ce=[];for(var ie=0;ie<re.length;ie++)Ce[ie]=oe(re[ie]);return Ce}if(Object.prototype.toString.call(re)!=="[object Object]")return re;Ce={};for(var ie in re)Ce[ie]=oe(re[ie]);return Ce},g.arrayToMap=function(oe){for(var re={},Ce=0;Ce<oe.length;Ce++)re[oe[Ce]]=1;return re},g.createMap=function(oe){var re=Object.create(null);for(var Ce in oe)re[Ce]=oe[Ce];return re},g.arrayRemove=function(oe,re){for(var Ce=0;Ce<=oe.length;Ce++)re===oe[Ce]&&oe.splice(Ce,1)},g.escapeRegExp=function(oe){return oe.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")},g.escapeHTML=function(oe){return(""+oe).replace(/&/g,"&#38;").replace(/"/g,"&#34;").replace(/'/g,"&#39;").replace(/</g,"&#60;")},g.getMatchOffsets=function(oe,re){var Ce=[];return oe.replace(re,function(ie){Ce.push({offset:arguments[arguments.length-2],length:ie.length})}),Ce},g.deferredCall=function(oe){var re=null,Ce=function(){re=null,oe()},ie=function(ae){return ie.cancel(),re=setTimeout(Ce,ae||0),ie};return ie.schedule=ie,ie.call=function(){return this.cancel(),oe(),ie},ie.cancel=function(){return clearTimeout(re),re=null,ie},ie.isPending=function(){return re},ie},g.delayedCall=function(oe,re){var Ce=null,ie=function(){Ce=null,oe()},ae=function(le){Ce==null&&(Ce=setTimeout(ie,le||re))};return ae.delay=function(le){Ce&&clearTimeout(Ce),Ce=setTimeout(ie,le||re)},ae.schedule=ae,ae.call=function(){this.cancel(),oe()},ae.cancel=function(){Ce&&clearTimeout(Ce),Ce=null},ae.isPending=function(){return Ce},ae}}),ace.define("ace/lib/oop",["require","exports","module"],function(r,g,k){g.inherits=function(V,$){V.super_=$,V.prototype=Object.create($.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})},g.mixin=function(V,$){for(var oe in $)V[oe]=$[oe];return V},g.implement=function(V,$){g.mixin(V,$)}}),ace.define("ace/lib/useragent",["require","exports","module"],function(r,g,k){g.OS={LINUX:"LINUX",MAC:"MAC",WINDOWS:"WINDOWS"},g.getOS=function(){return g.isMac?g.OS.MAC:g.isLinux?g.OS.LINUX:g.OS.WINDOWS};var V=typeof navigator=="object"?navigator:{},$=(/mac|win|linux/i.exec(V.platform)||["other"])[0].toLowerCase(),oe=V.userAgent||"",re=V.appName||"";g.isWin=$=="win",g.isMac=$=="mac",g.isLinux=$=="linux",g.isIE=re=="Microsoft Internet Explorer"||re.indexOf("MSAppHost")>=0?parseFloat((oe.match(/(?:MSIE |Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]):parseFloat((oe.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:)([0-9]+[\.0-9]+)/)||[])[1]),g.isOldIE=g.isIE&&g.isIE<9,g.isGecko=g.isMozilla=oe.match(/ Gecko\/\d+/),g.isOpera=typeof opera=="object"&&Object.prototype.toString.call(window.opera)=="[object Opera]",g.isWebKit=parseFloat(oe.split("WebKit/")[1])||void 0,g.isChrome=parseFloat(oe.split(" Chrome/")[1])||void 0,g.isEdge=parseFloat(oe.split(" Edge/")[1])||void 0,g.isAIR=oe.indexOf("AdobeAIR")>=0,g.isAndroid=oe.indexOf("Android")>=0,g.isChromeOS=oe.indexOf(" CrOS ")>=0,g.isIOS=/iPad|iPhone|iPod/.test(oe)&&!window.MSStream,g.isIOS&&(g.isMac=!0),g.isMobile=g.isIOS||g.isAndroid}),ace.define("ace/lib/dom",["require","exports","module","ace/lib/useragent"],function(r,g,k){var V=r("./useragent"),$="http://www.w3.org/1999/xhtml";g.buildDom=function le(Ie,ue,de){if(typeof Ie=="string"&&Ie){var Ne=document.createTextNode(Ie);return ue&&ue.appendChild(Ne),Ne}if(!Array.isArray(Ie))return Ie&&Ie.appendChild&&ue&&ue.appendChild(Ie),Ie;if(typeof Ie[0]!="string"||!Ie[0]){for(var he=[],pe=0;pe<Ie.length;pe++){var ze=le(Ie[pe],ue,de);ze&&he.push(ze)}return he}var Fe=document.createElement(Ie[0]),xe=Ie[1],_e=1;xe&&typeof xe=="object"&&!Array.isArray(xe)&&(_e=2);for(var pe=_e;pe<Ie.length;pe++)le(Ie[pe],Fe,de);return _e==2&&Object.keys(xe).forEach(function(Dt){var $e=xe[Dt];Dt==="class"?Fe.className=Array.isArray($e)?$e.join(" "):$e:typeof $e=="function"||Dt=="value"||Dt[0]=="$"?Fe[Dt]=$e:Dt==="ref"?de&&(de[$e]=Fe):Dt==="style"?typeof $e=="string"&&(Fe.style.cssText=$e):$e!=null&&Fe.setAttribute(Dt,$e)}),ue&&ue.appendChild(Fe),Fe},g.getDocumentHead=function(le){return le||(le=document),le.head||le.getElementsByTagName("head")[0]||le.documentElement},g.createElement=function(le,Ie){return document.createElementNS?document.createElementNS(Ie||$,le):document.createElement(le)},g.removeChildren=function(le){le.innerHTML=""},g.createTextNode=function(le,Ie){var ue=Ie?Ie.ownerDocument:document;return ue.createTextNode(le)},g.createFragment=function(le){var Ie=le?le.ownerDocument:document;return Ie.createDocumentFragment()},g.hasCssClass=function(le,Ie){var ue=(le.className+"").split(/\s+/g);return ue.indexOf(Ie)!==-1},g.addCssClass=function(le,Ie){g.hasCssClass(le,Ie)||(le.className+=" "+Ie)},g.removeCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g);;){var de=ue.indexOf(Ie);if(de==-1)break;ue.splice(de,1)}le.className=ue.join(" ")},g.toggleCssClass=function(le,Ie){for(var ue=le.className.split(/\s+/g),de=!0;;){var Ne=ue.indexOf(Ie);if(Ne==-1)break;de=!1,ue.splice(Ne,1)}return de&&ue.push(Ie),le.className=ue.join(" "),de},g.setCssClass=function(le,Ie,ue){ue?g.addCssClass(le,Ie):g.removeCssClass(le,Ie)},g.hasCssString=function(le,Ie){var ue=0,de;if(Ie=Ie||document,de=Ie.querySelectorAll("style")){for(;ue<de.length;)if(de[ue++].id===le)return!0}},g.removeElementById=function(le,Ie){Ie=Ie||document,Ie.getElementById(le)&&Ie.getElementById(le).remove()};var oe,re=[];g.useStrictCSP=function(le){oe=le,le==!1?Ce():re||(re=[])};function Ce(){var le=re;re=null,le&&le.forEach(function(Ie){ie(Ie[0],Ie[1])})}function ie(le,Ie,ue){if(!(typeof document>"u")){if(re){if(ue)Ce();else if(ue===!1)return re.push([le,Ie])}if(!oe){var de=ue;!ue||!ue.getRootNode?de=document:(de=ue.getRootNode(),(!de||de==ue)&&(de=document));var Ne=de.ownerDocument||de;if(Ie&&g.hasCssString(Ie,de))return null;Ie&&(le+=`
355
355
  /*# sourceURL=ace/css/`+Ie+" */");var he=g.createElement("style");he.appendChild(Ne.createTextNode(le)),Ie&&(he.id=Ie),de==Ne&&(de=g.getDocumentHead(Ne)),de.insertBefore(he,de.firstChild)}}}if(g.importCssString=ie,g.importCssStylsheet=function(le,Ie){g.buildDom(["link",{rel:"stylesheet",href:le}],g.getDocumentHead(Ie))},g.scrollbarWidth=function(le){var Ie=g.createElement("ace_inner");Ie.style.width="100%",Ie.style.minWidth="0px",Ie.style.height="200px",Ie.style.display="block";var ue=g.createElement("ace_outer"),de=ue.style;de.position="absolute",de.left="-10000px",de.overflow="hidden",de.width="200px",de.minWidth="0px",de.height="150px",de.display="block",ue.appendChild(Ie);var Ne=le&&le.documentElement||document&&document.documentElement;if(!Ne)return 0;Ne.appendChild(ue);var he=Ie.offsetWidth;de.overflow="scroll";var pe=Ie.offsetWidth;return he===pe&&(pe=ue.clientWidth),Ne.removeChild(ue),he-pe},g.computedStyle=function(le,Ie){return window.getComputedStyle(le,"")||{}},g.setStyle=function(le,Ie,ue){le[Ie]!==ue&&(le[Ie]=ue)},g.HAS_CSS_ANIMATION=!1,g.HAS_CSS_TRANSFORMS=!1,g.HI_DPI=V.isWin?typeof window<"u"&&window.devicePixelRatio>=1.5:!0,V.isChromeOS&&(g.HI_DPI=!1),typeof document<"u"){var ae=document.createElement("div");g.HI_DPI&&ae.style.transform!==void 0&&(g.HAS_CSS_TRANSFORMS=!0),!V.isEdge&&typeof ae.style.animationName<"u"&&(g.HAS_CSS_ANIMATION=!0),ae=null}g.HAS_CSS_TRANSFORMS?g.translate=function(le,Ie,ue){le.style.transform="translate("+Math.round(Ie)+"px, "+Math.round(ue)+"px)"}:g.translate=function(le,Ie,ue){le.style.top=Math.round(ue)+"px",le.style.left=Math.round(Ie)+"px"}}),ace.define("ace/lib/net",["require","exports","module","ace/lib/dom"],function(r,g,k){/*
356
356
  * based on code from:
357
357
  *
@@ -1299,5 +1299,5 @@ styles.join("\\n")
1299
1299
  line-height: 1.4;
1300
1300
  background: #25282c;
1301
1301
  color: #c1c1c1;
1302
- }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,k){g.parForEach=function($,oe,re){var Ce=0,ie=$.length;ie===0&&re();for(var ae=0;ae<ie;ae++)oe($[ae],function(le,Ie){Ce++,Ce===ie&&re(le,Ie)})};var V=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe-1;ie>=0&&re.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe;ie<$.length&&re.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var oe=$.getCursorPosition(),re=$.session.getLine(oe.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(re,oe.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(re,oe.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(r,g,k){var V=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,oe=r("./autocomplete/popup").getAriaId,re=r("./autocomplete/util"),Ce=r("./lib/lang"),ie=r("./lib/dom"),ae=r("./snippets").snippetManager,le=r("./config"),Ie=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new V,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=Ce.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=Ce.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new $(document.body||document.documentElement),this.popup.on("click",function(de){this.insertMatch(),de.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(de,Ne,he){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions({activeDescendant:oe(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var pe=de.renderer;if(this.popup.setRow(this.autoSelect?0:-1),he)he&&!Ne&&this.detach();else{this.popup.setTheme(de.getTheme()),this.popup.setFontSize(de.getFontSize());var ze=pe.layerConfig.lineHeight,Fe=pe.$cursorLayer.getPixelPosition(this.base,!0);Fe.left-=this.popup.getTextLeftOffset();var xe=de.container.getBoundingClientRect();Fe.top+=xe.top-pe.layerConfig.offset,Fe.left+=xe.left-de.renderer.scrollLeft,Fe.left+=pe.gutterWidth,this.popup.show(Fe,ze)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(de){var Ne=this.editor.selection.lead;(Ne.row!=this.base.row||Ne.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(de){var Ne=document.activeElement,he=this.editor.textInput.getElement(),pe=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),ze=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=ze&&!pe&&Ne!=this.tooltipNode&&de.relatedTarget!=he&&this.detach()},this.mousedownListener=function(de){this.detach()},this.mousewheelListener=function(de){this.detach()},this.goTo=function(de){this.popup.goTo(de)},this.insertMatch=function(de,Ne){if(de||(de=this.popup.getData(this.popup.getRow())),!de)return!1;var he=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),de.completer&&de.completer.insertMatch)de.completer.insertMatch(this.editor,de);else{if(!he)return!1;if(he.filterText)for(var pe=this.editor.selection.getAllRanges(),ze=0,Fe;Fe=pe[ze];ze++)Fe.start.column-=he.filterText.length,this.editor.session.remove(Fe);de.snippet?ae.insertSnippet(this.editor,de.snippet):this.editor.execCommand("insertstring",de.value||de)}this.completions==he&&this.detach(),this.editor.endOperation()},this.commands={Up:function(de){de.completer.goTo("up")},Down:function(de){de.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(de){de.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(de){de.completer.goTo("end")},Esc:function(de){de.completer.detach()},Return:function(de){return de.completer.insertMatch()},"Shift-Return":function(de){de.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(de){var Ne=de.completer.insertMatch();if(!Ne&&!de.tabstopManager)de.completer.goTo("down");else return Ne},PageUp:function(de){de.completer.popup.gotoPageUp()},PageDown:function(de){de.completer.popup.gotoPageDown()}},this.gatherCompletions=function(de,Ne){var he=de.getSession(),pe=de.getCursorPosition(),ze=re.getCompletionPrefix(de);this.base=he.doc.createAnchor(pe.row,pe.column-ze.length),this.base.$insertRight=!0;var Fe=[],xe=de.completers.length;return de.completers.forEach(function(_e,Dt){_e.getCompletions(de,he,pe,ze,function($e,Ue){!$e&&Ue&&(Fe=Fe.concat(Ue)),Ne(null,{prefix:re.getCompletionPrefix(de),matches:Fe,finished:--xe===0})})}),!0},this.showPopup=function(de,Ne){this.editor&&this.detach(),this.activated=!0,this.editor=de,de.completer!=this&&(de.completer&&de.completer.detach(),de.completer=this),de.on("changeSelection",this.changeListener),de.on("blur",this.blurListener),de.on("mousedown",this.mousedownListener),de.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,Ne)},this.updateCompletions=function(de,Ne){if(de&&this.base&&this.completions){var he=this.editor.getCursorPosition(),pe=this.editor.session.getTextRange({start:this.base,end:he});if(pe==this.completions.filterText)return;if(this.completions.setFilter(pe),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==pe&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,pe,de);return}if(Ne&&Ne.matches){var he=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(he.row,he.column),this.base.$insertRight=!0,this.completions=new ue(Ne.matches),this.openPopup(this.editor,"",de)}var ze=this.gatherCompletionsId,Fe=function(Ue){if(Ue.finished)return this.detach()}.bind(this),xe=function(Ue){var Ve=Ue.prefix,Oe=Ue.matches;this.completions=new ue(Oe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ve);var At=this.completions.filtered;if(!At.length||At.length==1&&At[0].value==Ve&&!At[0].snippet)return Fe(Ue);if(this.autoInsert&&At.length==1&&Ue.finished)return this.insertMatch(At[0]);this.openPopup(this.editor,Ve,de)}.bind(this),_e=!0,Dt=null;if(this.gatherCompletions(this.editor,function(Ue,Ve){var Oe=Ve.prefix,At=Ve&&Ve.matches;if(!At||!At.length)return Fe(Ve);if(!(Oe.indexOf(Ve.prefix)!==0||ze!=this.gatherCompletionsId)){if(_e){Dt=Ve;return}xe(Ve)}}.bind(this)),_e=!1,Dt){var $e=Dt;Dt=null,xe($e)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var de=this.popup,Ne=de.data,he=Ne&&(Ne[de.getHoveredRow()]||Ne[de.getRow()]),pe=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(ze){return ze.getDocTooltip&&(pe=ze.getDocTooltip(he)),pe}),!pe&&typeof he!="string"&&(pe=he),typeof pe=="string"&&(pe={docText:pe}),!pe||!(pe.docHTML||pe.docText))return this.hideDocTooltip();this.showDocTooltip(pe)},this.showDocTooltip=function(de){this.tooltipNode||(this.tooltipNode=ie.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var Ne=this.tooltipNode;de.docHTML?Ne.innerHTML=de.docHTML:de.docText&&(Ne.textContent=de.docText),Ne.parentNode||document.body.appendChild(Ne);var he=this.popup,pe=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-pe.right<320?pe.left<320?he.isTopdown?(Ne.style.top=pe.bottom+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-pe.left+"px",Ne.style.left=""):(Ne.style.left=pe.right+1+"px",Ne.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var de=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==de&&this.editor.focus(),this.tooltipNode=null,de.parentNode&&de.parentNode.removeChild(de)}},this.onTooltipClick=function(de){for(var Ne=de.target;Ne&&Ne!=this.tooltipNode;){if(Ne.nodeName=="A"&&Ne.href){Ne.rel="noreferrer",Ne.target="_blank";break}Ne=Ne.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var de=this.popup.container;de&&de.parentNode&&de.parentNode.removeChild(de)}this.editor&&this.editor.completer==this&&this.editor.completer==null,this.popup=null}}).call(Ie.prototype),Ie.for=function(de){return de.completer||(le.get("sharedPopups")?(Ie.$shared||(Ie.$sharedInstance=new Ie),de.completer=Ie.$sharedInstance):(de.completer=new Ie,de.once("destroy",function(Ne,he){he.completer.destroy()}))),de.completer},Ie.startCommand={name:"startAutocomplete",exec:function(de,Ne){var he=Ie.for(de);he.autoInsert=!1,he.autoSelect=!0,he.showPopup(de,Ne),he.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var ue=function(de,Ne){this.all=de,this.filtered=de,this.filterText=Ne||"",this.exactMatch=!1};(function(){this.setFilter=function(de){if(de.length>this.filterText&&de.lastIndexOf(this.filterText,0)===0)var Ne=this.filtered;else var Ne=this.all;this.filterText=de,Ne=this.filterCompletions(Ne,this.filterText),Ne=Ne.sort(function(pe,ze){return ze.exactMatch-pe.exactMatch||ze.$score-pe.$score||(pe.caption||pe.value).localeCompare(ze.caption||ze.value)});var he=null;Ne=Ne.filter(function(pe){var ze=pe.snippet||pe.caption||pe.value;return ze===he?!1:(he=ze,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],pe=Ne.toUpperCase(),ze=Ne.toLowerCase();e:for(var Fe=0,xe;xe=de[Fe];Fe++){var _e=xe.caption||xe.value||xe.snippet;if(_e){var Dt=-1,$e=0,Ue=0,Ve,Oe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var At=_e.toLowerCase().indexOf(ze);if(At>-1)Ue=At;else for(var qe=0;qe<Ne.length;qe++){var Lt=_e.indexOf(ze[qe],Dt+1),kt=_e.indexOf(pe[qe],Dt+1);if(Ve=Lt>=0&&(kt<0||Lt<kt)?Lt:kt,Ve<0)continue e;Oe=Ve-Dt-1,Oe>0&&(Dt===-1&&(Ue+=10),Ue+=Oe,$e=$e|1<<qe),Dt=Ve}}xe.matchMask=$e,xe.exactMatch=Ue?0:1,xe.$score=(xe.score||0)-Ue,he.push(xe)}}return he}}).call(ue.prototype),g.Autocomplete=Ie,g.FilteredList=ue}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(r,g,k){var V=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function oe(Ce,ie){var ae=Ce.getTextRange(V.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function re(Ce,ie){var ae=oe(Ce,ie),le=Ce.getValue().split($),Ie=Object.create(null),ue=le[ae];return le.forEach(function(de,Ne){if(!(!de||de===ue)){var he=Math.abs(ae-Ne),pe=le.length-he;Ie[de]?Ie[de]=Math.max(pe,Ie[de]):Ie[de]=pe}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=re(ie,ae),de=Object.keys(ue);Ie(null,de.map(function(Ne){return{caption:Ne,value:Ne,score:ue[Ne],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(r,g,k){var V=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,oe=r("../config"),re=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(xe,_e,Dt,$e,Ue){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(xe,_e,Dt,$e,Ue);var Ve=xe.session.getState(Dt.row),Oe=_e.$mode.getCompletions(Ve,_e,Dt,$e);Ue(null,Oe)}},le=function(xe){var _e={};return xe.replace(/\${(\d+)(:(.*?))?}/g,function(Dt,$e,Ue,Ve){return _e[$e]=Ve||""}).replace(/\$(\d+?)/g,function(Dt,$e){return _e[$e]})},Ie={getCompletions:function(xe,_e,Dt,$e,Ue){var Ve=[],Oe=_e.getTokenAt(Dt.row,Dt.column);Oe&&Oe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ve.push("html-tag"):Ve=V.getActiveScopes(xe);var At=V.snippetMap,qe=[];Ve.forEach(function(Lt){for(var kt=At[Lt]||[],jt=kt.length;jt--;){var ti=kt[jt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Ue(null,qe)},getDocTooltip:function(xe){xe.type=="snippet"&&!xe.docHTML&&(xe.docHTML=["<b>",re.escapeHTML(xe.caption),"</b>","<hr></hr>",re.escapeHTML(le(xe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(xe){ue.length=0,xe&&ue.push.apply(ue,xe)},g.addCompleter=function(xe){ue.push(xe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(xe){return V.expandWithTab(xe)},bindKey:"Tab"},Ne=function(xe,_e){he(_e.session.$mode)},he=function(xe){typeof xe=="string"&&(xe=oe.$modes[xe]),xe&&(V.files||(V.files={}),pe(xe.$id,xe.snippetFileId),xe.modes&&xe.modes.forEach(he))},pe=function(xe,_e){!_e||!xe||V.files[xe]||(V.files[xe]={},oe.loadModule(_e,function(Dt){Dt&&(V.files[xe]=Dt,!Dt.snippets&&Dt.snippetText&&(Dt.snippets=V.parseSnippetFile(Dt.snippetText)),V.register(Dt.snippets||[],Dt.scope),Dt.includeScopes&&(V.snippetMap[Dt.scope].includeScopes=Dt.includeScopes,Dt.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},ze=function(xe){var _e=xe.editor,Dt=_e.completer&&_e.completer.activated;if(xe.command.name==="backspace")Dt&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(xe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!Dt){var Ue=$.for(_e);Ue.autoInsert=!1,Ue.showPopup(_e)}}},Fe=r("../editor").Editor;r("../config").defineOptions(Fe.prototype,"editor",{enableBasicAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.on("afterExec",ze)):this.commands.removeListener("afterExec",ze)},value:!1},enableSnippets:{set:function(xe){xe?(this.commands.addCommand(de),this.on("changeMode",Ne),Ne(null,this)):(this.commands.removeCommand(de),this.off("changeMode",Ne))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(r){i&&(i.exports=r)})}()})(extLanguage_tools),ace$1.config.setModuleUrl("ace/theme/github",themeUrl),ace$1.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace$1.config.setModuleUrl("ace/mode/base",workerBaseUrl),ace$1.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace$1.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl),ace$1.config.setModuleUrl("ace/snippets/json",snippetsJsonUrl),ace$1.config.setModuleUrl("ace/mode/javascript",modeJavascriptUrl),ace$1.config.setModuleUrl("ace/mode/javascript_worker",workerJavascriptUrl),ace$1.config.setModuleUrl("ace/snippets/javascript",snippetsJavascriptUrl),ace$1.require("ace/ext/language_tools");const _sfc_main$b=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),k=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(V){r.lang==="json"?n("update:modelValue",JSON.parse(V)):n("update:modelValue",V)}});return(V,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=oe=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:g.value,"onUpdate:modelValue":$[2]||($[2]=oe=>g.value=oe),title:r.title,width:"60%"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:k.value,"onUpdate:value":$[1]||($[1]=oe=>k.value=oe),lang:r.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$7={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$5={key:1},_hoisted_3$4={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$2={key:1},_sfc_main$a=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},setup(i){const n=i;return(r,g)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.objInfo,(k,V)=>(vue.openBlock(),vue.createElementBlock("div",{key:V},[n.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(V))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(V),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(V),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(V),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(k.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:k.val,placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,vue.toDisplayString(k.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$2,vue.toDisplayString(k.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),n.hide.indexOf(String(V))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:k.title,size:"small"},{default:vue.withCtx(()=>[k.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,placeholder:"Select",size:"small",disabled:!!(k!=null&&k.disabled)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,$=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:3,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:4,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$b,{key:5,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_fdc5f310_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-fdc5f310"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$3=["onMouseenter","onClick"],_sfc_main$9=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),k=vue.ref(!1),V=vue.ref("进入"),$=vue.ref(null),oe=re=>{n("updateCommonAniVal",re),k.value=!1};return vue.watch(()=>r.val,re=>{g.value=re}),(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[g.value?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>oe("")),onClick:Ce[1]||(Ce[1]=ie=>k.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var ie;return[vue.createTextVNode(vue.toDisplayString((ie=vue.unref(common_animate_list).map(ae=>ae.children).reduce((ae,le)=>ae.concat(le)).find(ae=>ae.value==g.value))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>k.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:k.value,"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>k.value=ie),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:V.value,"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>V.value=ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),ie=>(vue.openBlock(),vue.createBlock(vue.unref(ElTabPane),{label:ie.label,name:ie.label,key:ie.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ie.children,(ae,le)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:le,onMouseenter:Ie=>$.value=le,onMouseleave:Ce[3]||(Ce[3]=Ie=>$.value=null),onClick:Ie=>oe(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${$.value==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$3))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_f7641a8c_lang="",CommonAnimate=_export_sfc(_sfc_main$9,[["__scopeId","data-v-f7641a8c"]]),_sfc_main$8=vue.defineComponent({__name:"index",setup(i){var V;const n=useGlobalStore(pinia),r=vue.ref(((V=n.handle_svg_info)==null?void 0:V.info.id)||""),g=$=>{n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo($)},k={children:"children",label:"title"};return($,oe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:vue.unref(n).done_json,props:k,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":r.value},null,8,["data","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-80b9cb5a"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$1=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$7=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=()=>{g.value.push({key:"",val:""})},V=$=>{g.value.splice($,1)};return($,oe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$2,_hoisted_4$1,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:k},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.key,"onUpdate:modelValue":ie=>re.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.val,"onUpdate:modelValue":ie=>re.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>V(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_80b9cb5a_lang="",List=_export_sfc(_sfc_main$7,[["__scopeId","data-v-80b9cb5a"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$6=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],V=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,oe)=>{var re,Ce;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.type,"onUpdate:modelValue":oe[0]||(oe[0]=ie=>g.value.type=ie),onChange:V},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.key,"onUpdate:modelValue":oe[1]||(oe[1]=ie=>g.value.Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.Relation.relation,"onUpdate:modelValue":oe[2]||(oe[2]=ie=>g.value.Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(k,(ie,ae)=>vue.createVNode(vue.unref(ElOption),{value:ie.val,label:ie.label,key:"rop"+ae},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val,"onUpdate:modelValue":oe[3]||(oe[3]=ie=>g.value.Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"&&(((re=g.value.Relation)==null?void 0:re.relation)===">=,=<"||((Ce=g.value.Relation)==null?void 0:Ce.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val2,"onUpdate:modelValue":oe[4]||(oe[4]=ie=>g.value.Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_78b20d94_lang="",Condition=_export_sfc(_sfc_main$6,[["__scopeId","data-v-78b20d94"]]),_withScopeId=i=>(vue.pushScopeId("data-v-2e831e17"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={class:"events-title"},_hoisted_3$1={key:1},_sfc_main$5=vue.defineComponent({__name:"index",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=vue.ref("page"),k=vue.ref("style"),V=(ae,le)=>{ae!=null&&ae.common_animations&&(ae.common_animations.val=le)};n.$subscribe((ae,le)=>{ae.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(le))});const $=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),re=vue.ref();re.value=()=>{var le,Ie;let ae={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.push(ae)};const Ce=(ae,le)=>{ae==="ChangeAttr"?le.attrs=[{key:"",val:""}]:delete le.attrs},ie=ae=>{var le,Ie;(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.splice(ae,1)};return(ae,le)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:g.value,"onUpdate:modelValue":le[11]||(le[11]=Ie=>g.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":le[0]||(le[0]=Ie=>vue.unref(n).svg.background_color=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.x,"onUpdate:modelValue":le[1]||(le[1]=Ie=>vue.unref(n).svg.position_center.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.y,"onUpdate:modelValue":le[2]||(le[2]=Ie=>vue.unref(n).svg.position_center.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":le[3]||(le[3]=Ie=>vue.unref(n).svg.grid=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":le[4]||(le[4]=Ie=>vue.unref(n).svg.ruler=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":le[5]||(le[5]=Ie=>vue.unref(n).svg.scale=Ie),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:oe.value,"onUpdate:modelValue":le[10]||(le[10]=Ie=>oe.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":le[6]||(le[6]=Ie=>vue.unref(n).net.mqtt.url=Ie),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":le[7]||(le[7]=Ie=>vue.unref(n).net.mqtt.user=Ie),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":le[8]||(le[8]=Ie=>vue.unref(n).net.mqtt.pwd=Ie),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":le[9]||(le[9]=Ie=>vue.unref(n).net.mqtt.topics=Ie),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.animations},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(r).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:k.value,"onUpdate:modelValue":le[24]||(le[24]=Ie=>k.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.title,"onUpdate:modelValue":le[12]||(le[12]=Ie=>vue.unref(r).handle_svg_info.info.title=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.x,"onUpdate:modelValue":le[13]||(le[13]=Ie=>vue.unref(r).handle_svg_info.info.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.y,"onUpdate:modelValue":le[14]||(le[14]=Ie=>vue.unref(r).handle_svg_info.info.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.display,"onUpdate:modelValue":le[15]||(le[15]=Ie=>vue.unref(r).handle_svg_info.info.display=Ie)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:re.value},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:$.value,"onUpdate:modelValue":le[16]||(le[16]=Ie=>$.value=Ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ie,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:ue,key:"event"+ue},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(ue+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(de=>ie(ue),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.type,"onUpdate:modelValue":de=>Ie.type=de},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.action,"onUpdate:modelValue":de=>Ie.action=de,onChange:de=>Ce(de,Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ie.target,"onUpdate:modelValue":de=>Ie.target=de,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ie.attrs,"onUpdate:modelValue":de=>Ie.attrs=de},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ie.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$b,{modelValue:Ie.scripts,"onUpdate:modelValue":de=>Ie.scripts=de,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ie.condition,"onUpdate:modelValue":de=>Ie.condition=de},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var Ie;return[(Ie=vue.unref(r).handle_svg_info)!=null&&Ie.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(r).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:le[17]||(le[17]=ue=>{var de;return V((de=vue.unref(r).handle_svg_info)==null?void 0:de.info,ue)}),val:vue.unref(r).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":le[18]||(le[18]=ue=>vue.unref(r).handle_svg_info.info.common_animations.delay=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":le[19]||(le[19]=ue=>vue.unref(r).handle_svg_info.info.common_animations.speed=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":le[20]||(le[20]=ue=>vue.unref(r).handle_svg_info.info.common_animations.repeat=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var Ie;return[vue.createVNode(vue.unref(ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.id,"onUpdate:modelValue":le[21]||(le[21]=ue=>vue.unref(r).handle_svg_info.info.id=ue)},null,8,["modelValue"])]),_:1}),vue.unref(r).handle_svg_info.info.state?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(vue.unref(r).handle_svg_info.info.state,(ue,de)=>{var Ne;return vue.openBlock(),vue.createElementBlock("div",{key:"state"+de},[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:String(de),size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue==null?void 0:ue.default),1)]),_:2},1032,["label"]),de==="OnOff"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:(Ne=vue.unref(r).handle_svg_info.info.state)==null?void 0:Ne.OnOff.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.state.OnOff.default,"onUpdate:modelValue":le[22]||(le[22]=he=>vue.unref(r).handle_svg_info.info.state.OnOff.default=he)},null,8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0)])}),128)):vue.createCommentVNode("",!0),(Ie=vue.unref(r).handle_svg_info.info)!=null&&Ie.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.tag_slot,"onUpdate:modelValue":le[23]||(le[23]=ue=>vue.unref(r).handle_svg_info.info.tag_slot=ue)},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:""},null,8,["obj-info"])]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),index_vue_vue_type_style_index_0_scoped_2e831e17_lang="",index_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-2e831e17"]]),_sfc_main$4=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return vue.onMounted(()=>{const V={layout_center:g.center_offset,config:k.$state,done_json:r.done_json};n.value=JSON.stringify(V,null,2)}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:n.value,"onUpdate:value":$[0]||($[0]=oe=>n.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:V=>{r.value=V},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:r.value,"onUpdate:value":$[0]||($[0]=oe=>r.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$2=vue.defineComponent({name:"V3RulerComponent",props:{position:{type:String,default:"relative",validator:i=>["absolute","fixed","relative","static","inherit"].indexOf(i)!==-1},isHotKey:{type:Boolean,default:!0},isScaleRevise:{type:Boolean,default:!1},value:{type:Array,default:()=>[{type:"h",site:50},{type:"v",site:180}]},contentLayout:{type:Object,default:()=>({top:0,left:0})},parent:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},stepLength:{type:Number,default:50,validator:i=>i%10===0}},emits:["input","update:visible"],setup(i,n){const r=useSvgEditLayoutStore(pinia),g=function(){return function(Ai,hi,wi){Ai&&hi&&wi&&Ai.addEventListener(hi,wi,!1)}}(),k=function(){return function(Ai,hi,wi){Ai&&hi&&Ai.removeEventListener(hi,wi,!1)}}(),V=17;let $=18,oe=vue.ref(0),re=vue.ref(0),Ce=vue.ref([{id:0}]),ie=vue.ref([{id:0}]),ae=0,le=0,Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=0,pe=0,ze="";const Fe=vue.ref(null),xe=vue.ref(null),_e=vue.ref(null),Dt=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:re.value+"px",position:i.position})),Ue=vue.computed(()=>({left:i.contentLayout.left+"px",top:i.contentLayout.top+"px",padding:$+"px 0px 0px "+$+"px"})),Ve=vue.computed(()=>{let Ai=0,hi=0;return i.value.map(wi=>{const Ci=wi.type==="h";return{id:`${wi.type}_${Ci?Ai++:hi++}`,type:wi.type,title:wi.site.toFixed(2)+"px",[Ci?"top":"left"]:wi.site/(i.stepLength/50)+V}})});r.$subscribe(Ai=>{Ai.storeId==="svg-edit-layout-store"&&window.setTimeout(Oe,420)}),vue.onMounted(()=>{g(document,"mousemove",gi),g(document,"mouseup",di),Oe(),g(window,"resize",At)}),vue.onBeforeUnmount(()=>{k(document,"mousemove",gi),k(document,"mouseup",di),k(window,"resize",At)});const Oe=()=>{kt(),ti()},At=()=>{Ce.value=[{id:0}],ie.value=[{id:0}],Oe()},qe=({type:Ai,top:hi,left:wi})=>Ai==="h"?{top:hi+"px"}:{left:wi+"px"},Lt=({type:Ai,id:hi})=>Ai==="h"?pi(hi):yi(hi),kt=()=>{if(i.isScaleRevise){const Ai=Fe.value.offsetLeft,hi=Fe.value.offsetTop;Pt(Ce.value,Ai),Pt(ie.value,hi)}if(i.parent){const Ai=window.getComputedStyle(xe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width"),10),re.value=parseInt(Ai.getPropertyValue("height"),10)}else oe.value=document.documentElement.clientWidth-le,re.value=document.documentElement.clientHeight-ae;he=_e.value.clientWidth,pe=Dt.value.clientHeight,jt()},jt=()=>{ae=Dt.value.getBoundingClientRect().y,le=_e.value.getBoundingClientRect().x},ti=()=>{ei(Ce.value,oe.value),ei(ie.value,re.value)},ei=(Ai,hi)=>{for(let wi=0;wi<hi*i.stepLength/50;wi+=i.stepLength)wi%i.stepLength===0&&wi!=0&&Ai.push({id:wi})},Pt=(Ai,hi)=>{for(let wi=0;wi<hi;wi+=1)wi%i.stepLength===0&&wi+i.stepLength<=hi&&Ai.push({id:wi})},ni=Ai=>{Ie.value=!0,ue=Ai},gi=Ai=>{switch(jt(),ue){case"x":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"y":Ie.value&&(de.value=Ai.pageX-le);break;case"h":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"v":Ie.value&&(de.value=Ai.pageX-le);break}},di=Ai=>{if(jt(),Ie.value){Ie.value=!1;const hi=JSON.parse(JSON.stringify(i.value));switch(ue){case"x":hi.push({type:"h",site:(Ai.pageY-ae-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"y":hi.push({type:"v",site:(Ai.pageX-le-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"h":li(hi,Ai.pageY,ae,pe,"h"),n.emit("input",hi);break;case"v":li(hi,Ai.pageX,le,he,"v"),n.emit("input",hi);break}Ne.value=de.value=-10}},li=(Ai,hi,wi,Ci,mi)=>{if(hi-wi<Ci){let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:-600})}else{let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:(hi-wi-V)*(i.stepLength/50)})}},ai=()=>{ni("x")},ci=()=>{ni("y")},pi=Ai=>{Ie.value=!0,ue="h",ze=Ai},yi=Ai=>{Ie.value=!0,ue="v",ze=Ai};return{wrapperStyle:$e,horizontalDragRuler:ai,xScale:Ce,verticalDragRuler:ci,yScale:ie,verticalDottedTop:Ne,horizontalDottedLeft:de,lineList:Ve,getLineStyle:qe,handleDragLine:Lt,contentStyle:Ue,isDrag:Ie,content:Fe,el:xe,verticalRuler:_e,horizontalRuler:Dt}}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"};function _sfc_render(i,n,r,g,k,V){return vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(i.wrapperStyle),class:"vue-ruler-wrapper",onselectStart:"return false;",ref:"el"},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref:"horizontalRuler",class:"vue-ruler-h",onMousedown:n[0]||(n[0]=vue.withModifiers((...$)=>i.horizontalDragRuler&&i.horizontalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.xScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({left:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{ref:"verticalRuler",class:"vue-ruler-v",onMousedown:n[1]||(n[1]=vue.withModifiers((...$)=>i.verticalDragRuler&&i.verticalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.yScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({top:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:i.verticalDottedTop+"px"}),class:"vue-ruler-ref-dot-h"},null,4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:i.horizontalDottedLeft+"px"}),class:"vue-ruler-ref-dot-v"},null,4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.lineList,$=>(vue.openBlock(),vue.createElementBlock("div",{title:$.title,style:vue.normalizeStyle(i.getLineStyle($)),key:$.id,class:vue.normalizeClass(`vue-ruler-ref-line-${$.type}`),onMousedown:oe=>i.handleDragLine($)},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,i.$props.visible]]),vue.createElementVNode("div",{ref:"content",class:"vue-ruler-content",style:vue.normalizeStyle(i.contentStyle)},[vue.renderSlot(i.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,i.isDrag]])],4)}const Vue3RulerTool=_export_sfc(_sfc_main$2,[["render",_sfc_render]]);function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let k=document.createElement("a");k.download=n+".json",k.style.display="none",k.href=URL.createObjectURL(g),document.body.appendChild(k),k.click(),document.body.removeChild(k)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(k){k&&k.target?n(k.target.result):r("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolBar:{},data:{}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:n,emit:r}){const g=i,k=vue.ref([]),V=he=>{k.value=he},$=useGlobalStore(pinia),oe=useSvgEditLayoutStore(pinia),re=useConfigStore(pinia),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(he,pe)=>{ie[he]=pe},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=he=>["text/plain","application/json"].indexOf(he.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(he).then(pe=>{Ce.value.setVal(pe),ElMessage.success("文件读取成功!")}),!1),ue=he=>{$.setDoneJson(he)};vue.onMounted(()=>{g.data?useImportDataModel(g.data):$.setDoneJson([]),$.intention=EGlobalStoreIntention.None}),n({setGraphNodeJson:ue});const{appContext:de}=vue.getCurrentInstance();function Ne(he){ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(pe=>{fileWrite(he,pe.value.trim()),r("onSave",he)}).catch(pe=>{console.log(pe)})}return(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:ae,onOnReturn:pe[0]||(pe[0]=ze=>r("onReturn")),onOnPreview:pe[1]||(pe[1]=ze=>r("onPreview",ze)),onOnSave:Ne})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).left_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-tool-bar":g.customToolBar},null,8,["custom-tool-bar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(Vue3RulerTool,{class:"canvas-main-pc",value:k.value,"step-length":50,parent:!0,"is-scale-revise":!1,visible:vue.unref(re).svg.ruler,"onUpdate:visible":pe[2]||(pe[2]=ze=>vue.unref(re).svg.ruler=ze),onInput:V},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel)]),_:1},8,["value","visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).right_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ImportJson,"onUpdate:modelValue":pe[4]||(pe[4]=ze=>ie.ImportJson=ze),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElUpload),{beforeUpload:Ie,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:pe[3]||(pe[3]=ze=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:le.value},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:Ce},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ExportJson,"onUpdate:modelValue":pe[5]||(pe[5]=ze=>ie.ExportJson=ze),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_4da50b34_lang="",index$1=_export_sfc(_sfc_main$1,[["__scopeId","data-v-4da50b34"]]);function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(i,n){(function(r){i.exports=r()})(function(){return function(){function r(g,k,V){function $(Ce,ie){if(!k[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(oe)return oe(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=k[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,k,V)}return k[Ce].exports}for(var oe=typeof commonjsRequire=="function"&&commonjsRequire,re=0;re<V.length;re++)$(V[re]);return $}return r}()({1:[function(r,g,k){(function(V,$){(function(){const oe=r("events").EventEmitter,re=r("./store"),Ce=r("./topic-alias-recv"),ie=r("./topic-alias-send"),ae=r("mqtt-packet"),le=r("./default-message-id-provider"),Ie=r("readable-stream").Writable,ue=r("inherits"),de=r("reinterval"),Ne=r("rfdc/default"),he=r("./validations"),pe=r("xtend"),ze=r("debug")("mqttjs:client"),Fe=V?V.nextTick:function(ei){setTimeout(ei,0)},xe=$.setImmediate||function(ei){Fe(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},Dt=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],$e={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function Ue(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ve(ei,Pt){if(ei.options.protocolVersion===5&&Pt.cmd==="publish"){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);const gi=Pt.topic.toString();if(ei.topicAliasSend)if(ni){if(gi.length!==0&&(ze("applyTopicAlias :: register topic: %s - alias: %d",gi,ni),!ei.topicAliasSend.put(gi,ni)))return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}else gi.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(gi),ni?(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",gi,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(gi,ni),Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign topic: %s - alias: %d",gi,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(gi),ni&&(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto use topic: %s - alias: %d",gi,ni))));else if(ni)return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}}function Oe(ei,Pt){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);let gi=Pt.topic.toString();if(gi.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(gi=ei.topicAliasSend.getTopicByAlias(ni),typeof gi>"u")return new Error("Unregistered Topic Alias");Pt.topic=gi}ni&&delete Pt.properties.topicAlias}function At(ei,Pt,ni){ze("sendPacket :: packet: %O",Pt),ze("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Pt),ze("sendPacket :: writing to stream");const gi=ae.writeToStream(Pt,ei.stream,ei.options);ze("sendPacket :: writeToStream result %s",gi),!gi&&ni&&ni!==jt?(ze("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(ze("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(ze("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Pt){typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function Lt(ei){ei&&(ze("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Pt){ei[Pt].volatile&&typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function kt(ei,Pt,ni,gi){ze("storeAndSend :: store packet with cmd %s to outgoingStore",Pt.cmd);let di=Pt,li;if(di.cmd==="publish"&&(di=Ne(Pt),li=Oe(ei,di),li))return ni&&ni(li);ei.outgoingStore.put(di,function(ci){if(ci)return ni&&ni(ci);gi(),At(ei,Pt,ni)})}function jt(ei){ze("nop ::",ei)}function ti(ei,Pt){let ni;const gi=this;if(!(this instanceof ti))return new ti(ei,Pt);this.options=Pt||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Pt[ni];ze("MqttClient :: options.protocol",Pt.protocol),ze("MqttClient :: options.protocolVersion",Pt.protocolVersion),ze("MqttClient :: options.username",Pt.username),ze("MqttClient :: options.keepalive",Pt.keepalive),ze("MqttClient :: options.reconnectPeriod",Pt.reconnectPeriod),ze("MqttClient :: options.rejectUnauthorized",Pt.rejectUnauthorized),ze("MqttClient :: options.topicAliasMaximum",Pt.topicAliasMaximum),this.options.clientId=typeof Pt.clientId=="string"?Pt.clientId:Ue(),ze("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Pt.protocolVersion===5&&Pt.customHandleAcks?Pt.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Pt.outgoingStore||new re,this.incomingStore=Pt.incomingStore||new re,this.queueQoSZero=Pt.queueQoSZero===void 0?!0:Pt.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,Pt.topicAliasMaximum>0&&(Pt.topicAliasMaximum>65535?ze("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Pt.topicAliasMaximum)),this.on("connect",function(){const di=this.queue;function li(){const ai=di.shift();ze("deliver :: entry %o",ai);let ci=null;if(!ai){gi._resubscribe();return}ci=ai.packet,ze("deliver :: call _sendPacket for %o",ci);let pi=!0;ci.messageId&&ci.messageId!==0&&(gi.messageIdProvider.register(ci.messageId)||(pi=!1)),pi?gi._sendPacket(ci,function(yi){ai.cb&&ai.cb(yi),li()}):(ze("messageId: %d has already used. The message is skipped and removed.",ci.messageId),li())}ze("connect :: sending queued packets"),li()}),this.on("close",function(){ze("close :: connected set to `false`"),this.connected=!1,ze("close :: clearing connackTimer"),clearTimeout(this.connackTimer),ze("close :: clearing ping timer"),gi.pingTimer!==null&&(gi.pingTimer.clear(),gi.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),ze("close :: calling _setupReconnect"),this._setupReconnect()}),oe.call(this),ze("MqttClient :: setting up stream"),this._setupStream()}ue(ti,oe),ti.prototype._setupStream=function(){const ei=this,Pt=new Ie,ni=ae.parser(this.options);let gi=null;const di=[];ze("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),ze("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(yi){ze("parser :: on packet push to packets array."),di.push(yi)});function li(){if(di.length)Fe(ai);else{const yi=gi;gi=null,yi()}}function ai(){ze("work :: getting next packet in queue");const yi=di.shift();if(yi)ze("work :: packet pulled from queue"),ei._handlePacket(yi,li);else{ze("work :: no packets in queue");const Ai=gi;gi=null,ze("work :: done flag is %s",!!Ai),Ai&&Ai()}}Pt._write=function(yi,Ai,hi){gi=hi,ze("writable stream :: parsing buffer"),ni.parse(yi),ai()};function ci(yi){ze("streamErrorHandler :: error",yi.message),Dt.includes(yi.code)?(ze("streamErrorHandler :: emitting error"),ei.emit("error",yi)):jt(yi)}ze("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Pt),this.stream.on("error",ci),this.stream.on("close",function(){ze("(%s)stream :: on close",ei.options.clientId),Lt(ei.outgoing),ze("stream: emit close to MqttClient"),ei.emit("close")}),ze("_setupStream: sending packet `connect`");const pi=Object.create(this.options);if(pi.cmd="connect",this.topicAliasRecv&&(pi.properties||(pi.properties={}),this.topicAliasRecv&&(pi.properties.topicAliasMaximum=this.topicAliasRecv.max)),At(this,pi),ni.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return ei.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const yi=pe({cmd:"auth",reasonCode:0},this.options.authPacket);At(this,yi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){ze("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Pt){const ni=this.options;if(ni.protocolVersion===5&&ni.properties&&ni.properties.maximumPacketSize&&ni.properties.maximumPacketSize<ei.length)return this.emit("error",new Error("exceeding packets size "+ei.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(ze("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Pt);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Pt();break;case"pubrel":this._handlePubrel(ei,Pt);break;case"connack":this._handleConnack(ei),Pt();break;case"auth":this._handleAuth(ei),Pt();break;case"pingresp":this._handlePingresp(ei),Pt();break;case"disconnect":this._handleDisconnect(ei),Pt();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==jt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Pt,ni,gi){ze("publish :: message `%s` to topic `%s`",Pt,ei);const di=this.options;if(typeof ni=="function"&&(gi=ni,ni=null),ni=pe({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(gi))return this;const ai=this,ci=function(){let pi=0;if((ni.qos===1||ni.qos===2)&&(pi=ai._nextId(),pi===null))return ze("No messageId left"),!1;const yi={cmd:"publish",topic:ei,payload:Pt,qos:ni.qos,retain:ni.retain,messageId:pi,dup:ni.dup};switch(di.protocolVersion===5&&(yi.properties=ni.properties),ze("publish :: qos",ni.qos),ni.qos){case 1:case 2:ai.outgoing[yi.messageId]={volatile:!1,cb:gi||jt},ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,void 0,ni.cbStorePut);break;default:ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,gi,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ci())&&this._storeProcessingQueue.push({invoke:ci,cbStorePut:ni.cbStorePut,callback:gi}),this},ti.prototype.subscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let hi=0;hi<arguments.length;hi++)Pt[hi]=arguments[hi];const ni=[];let gi=Pt.shift();const di=gi.resubscribe;let li=Pt.pop()||jt,ai=Pt.pop();const ci=this.options.protocolVersion;delete gi.resubscribe,typeof gi=="string"&&(gi=[gi]),typeof li!="function"&&(ai=li,li=jt);const pi=he.validateTopics(gi);if(pi!==null)return xe(li,new Error("Invalid topic "+pi)),this;if(this._checkDisconnecting(li))return ze("subscribe: discconecting true"),this;const yi={qos:0};if(ci===5&&(yi.nl=!1,yi.rap=!1,yi.rh=0),ai=pe(yi,ai),Array.isArray(gi)?gi.forEach(function(hi){if(ze("subscribe: array topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<ai.qos||di){const wi={topic:hi,qos:ai.qos};ci===5&&(wi.nl=ai.nl,wi.rap=ai.rap,wi.rh=ai.rh,wi.properties=ai.properties),ze("subscribe: pushing topic `%s` and qos `%s` to subs list",wi.topic,wi.qos),ni.push(wi)}}):Object.keys(gi).forEach(function(hi){if(ze("subscribe: object topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<gi[hi].qos||di){const wi={topic:hi,qos:gi[hi].qos};ci===5&&(wi.nl=gi[hi].nl,wi.rap=gi[hi].rap,wi.rh=gi[hi].rh,wi.properties=ai.properties),ze("subscribe: pushing `%s` to subs list",wi),ni.push(wi)}}),!ni.length)return li(null,[]),this;const Ai=function(){const hi=ei._nextId();if(hi===null)return ze("No messageId left"),!1;const wi={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:hi};if(ai.properties&&(wi.properties=ai.properties),ei.options.resubscribe){ze("subscribe :: resubscribe true");const Ci=[];ni.forEach(function(mi){if(ei.options.reconnectPeriod>0){const Ni={qos:mi.qos};ci===5&&(Ni.nl=mi.nl||!1,Ni.rap=mi.rap||!1,Ni.rh=mi.rh||0,Ni.properties=mi.properties),ei._resubscribeTopics[mi.topic]=Ni,Ci.push(mi.topic)}}),ei.messageIdToTopic[wi.messageId]=Ci}return ei.outgoing[wi.messageId]={volatile:!0,cb:function(Ci,mi){if(!Ci){const Ni=mi.granted;for(let Mi=0;Mi<Ni.length;Mi+=1)ni[Mi].qos=Ni[Mi]}li(Ci,ni)}},ze("subscribe :: call _sendPacket"),ei._sendPacket(wi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ai())&&this._storeProcessingQueue.push({invoke:Ai,callback:li}),this},ti.prototype.unsubscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let ci=0;ci<arguments.length;ci++)Pt[ci]=arguments[ci];let ni=Pt.shift(),gi=Pt.pop()||jt,di=Pt.pop();typeof ni=="string"&&(ni=[ni]),typeof gi!="function"&&(di=gi,gi=jt);const li=he.validateTopics(ni);if(li!==null)return xe(gi,new Error("Invalid topic "+li)),this;if(ei._checkDisconnecting(gi))return this;const ai=function(){const ci=ei._nextId();if(ci===null)return ze("No messageId left"),!1;const pi={cmd:"unsubscribe",qos:1,messageId:ci};return typeof ni=="string"?pi.unsubscriptions=[ni]:Array.isArray(ni)&&(pi.unsubscriptions=ni),ei.options.resubscribe&&pi.unsubscriptions.forEach(function(yi){delete ei._resubscribeTopics[yi]}),typeof di=="object"&&di.properties&&(pi.properties=di.properties),ei.outgoing[pi.messageId]={volatile:!0,cb:gi},ze("unsubscribe: call _sendPacket"),ei._sendPacket(pi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ai())&&this._storeProcessingQueue.push({invoke:ai,callback:gi}),this},ti.prototype.end=function(ei,Pt,ni){const gi=this;ze("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Pt||jt,Pt=ei,ei=!1,typeof Pt!="object"&&(ni=Pt,Pt=null,typeof ni!="function"&&(ni=jt))),typeof Pt!="object"&&(ni=Pt,Pt=null),ze("end :: cb? %s",!!ni),ni=ni||jt;function di(){ze("end :: closeStores: closing incoming and outgoing stores"),gi.disconnected=!0,gi.incomingStore.close(function(ai){gi.outgoingStore.close(function(ci){if(ze("end :: closeStores: emitting end"),gi.emit("end"),ni){const pi=ai||ci;ze("end :: closeStores: invoking callback with args"),ni(pi)}})}),gi._deferredReconnect&&gi._deferredReconnect()}function li(){ze("end :: (%s) :: finish :: calling _cleanUp with force %s",gi.options.clientId,ei),gi._cleanUp(ei,()=>{ze("end :: finish :: calling process.nextTick on closeStores"),Fe(di.bind(gi))},Pt)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(ze("end :: (%s) :: calling finish in 10ms once outgoing is empty",gi.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,li,10))):(ze("end :: (%s) :: immediately calling finish",gi.options.clientId),li()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Pt=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Pt(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){ze("client reconnect");const Pt=this,ni=function(){ei?(Pt.options.incomingStore=ei.incomingStore,Pt.options.outgoingStore=ei.outgoingStore):(Pt.options.incomingStore=null,Pt.options.outgoingStore=null),Pt.incomingStore=Pt.options.incomingStore||new re,Pt.outgoingStore=Pt.options.outgoingStore||new re,Pt.disconnecting=!1,Pt.disconnected=!1,Pt._deferredReconnect=null,Pt._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){ze("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),ze("client already connected. disconnecting first.")):(ze("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(ze("_setupReconnect :: emit `offline` state"),this.emit("offline"),ze("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),ze("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){ze("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):ze("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){ze("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Pt){const ni=arguments[2];if(Pt&&(ze("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Pt)),ze("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),ze("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const gi=pe({cmd:"disconnect"},ni);ze("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(gi,xe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(ze("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(ze("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Pt&&!this.connected&&(ze("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Pt),Pt())},ti.prototype._sendPacket=function(ei,Pt,ni){ze("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||jt,Pt=Pt||jt;const gi=Ve(this,ei);if(gi){Pt(gi);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),At(this,ei,Pt);return}ze("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Pt,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":kt(this,ei,Pt,ni);return;default:At(this,ei,Pt);return}switch(ei.qos){case 2:case 1:kt(this,ei,Pt,ni);break;case 0:default:At(this,ei,Pt);break}ze("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Pt,ni){ze("_storePacket :: packet: %o",ei),ze("_storePacket :: cb? %s",!!Pt),ni=ni||jt;let gi=ei;if(gi.cmd==="publish"){gi=Ne(ei);const di=Oe(this,gi);if(di)return Pt&&Pt(di)}(gi.qos||0)===0&&this.queueQoSZero||gi.cmd!=="publish"?this.queue.push({packet:gi,cb:Pt}):gi.qos>0?(Pt=this.outgoing[gi.messageId]?this.outgoing[gi.messageId].cb:null,this.outgoingStore.put(gi,function(di){if(di)return Pt&&Pt(di);ni()})):Pt&&Pt(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){ze("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const ei=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=de(function(){ei._checkPing()},this.options.keepalive*1e3))},ti.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},ti.prototype._checkPing=function(){ze("_checkPing :: checking ping..."),this.pingResp?(ze("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(ze("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){ze("_handleConnack");const Pt=this.options,gi=Pt.protocolVersion===5?ei.reasonCode:ei.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,ei.properties){if(ei.properties.topicAliasMaximum){if(ei.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}ei.properties.topicAliasMaximum>0&&(this.topicAliasSend=new ie(ei.properties.topicAliasMaximum))}ei.properties.serverKeepAlive&&Pt.keepalive&&(Pt.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Pt.properties||(Pt.properties={}),Pt.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(gi===0)this.reconnecting=!1,this._onConnect(ei);else if(gi>0){const di=new Error("Connection refused: "+$e[gi]);di.code=gi,this.emit("error",di)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,gi=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const li=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);li.code=gi,this.emit("error",li);return}const di=this;this.handleAuth(ei,function(li,ai){if(li){di.emit("error",li);return}if(gi===24)di.reconnecting=!1,di._sendPacket(ai);else{const ci=new Error("Connection refused: "+$e[gi]);li.code=gi,di.emit("error",ci)}})},ti.prototype.handleAuth=function(ei,Pt){Pt()},ti.prototype._handlePublish=function(ei,Pt){ze("_handlePublish: packet %o",ei),Pt=typeof Pt<"u"?Pt:jt;let ni=ei.topic.toString();const gi=ei.payload,di=ei.qos,li=ei.messageId,ai=this,ci=this.options,pi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let yi;if(ei.properties&&(yi=ei.properties.topicAlias),typeof yi<"u")if(ni.length===0)if(yi>0&&yi<=65535){const Ai=this.topicAliasRecv.getTopicByAlias(yi);if(Ai)ni=Ai,ze("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: unregistered topic alias. alias: %d",yi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,yi))ze("_handlePublish :: registered topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(ze("_handlePublish: qos %d",di),di){case 2:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for pubrec"));Ai?ai._sendPacket({cmd:"pubrec",messageId:li,reasonCode:Ai},Pt):ai.incomingStore.put(ei,function(){ai._sendPacket({cmd:"pubrec",messageId:li},Pt)})});break}case 1:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for puback"));Ai||ai.emit("message",ni,gi,ei),ai.handleMessage(ei,function(hi){if(hi)return Pt&&Pt(hi);ai._sendPacket({cmd:"puback",messageId:li,reasonCode:Ai},Pt)})});break}case 0:this.emit("message",ni,gi,ei),this.handleMessage(ei,Pt);break;default:ze("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Pt){Pt()},ti.prototype._handleAck=function(ei){const Pt=ei.messageId,ni=ei.cmd;let gi=null;const di=this.outgoing[Pt]?this.outgoing[Pt].cb:null,li=this;let ai;if(!di){ze("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(ze("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ci=ei.reasonCode;ci&&ci>0&&ci!==16&&(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)),delete this.outgoing[Pt],this.outgoingStore.del(ei,di),this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue();break}case"pubrec":{gi={cmd:"pubrel",qos:2,messageId:Pt};const ci=ei.reasonCode;ci&&ci>0&&ci!==16?(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)):this._sendPacket(gi);break}case"suback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt);for(let ci=0;ci<ei.granted.length;ci++)if(ei.granted[ci]&128){const pi=this.messageIdToTopic[Pt];pi&&pi.forEach(function(yi){delete li._resubscribeTopics[yi]})}this._invokeStoreProcessingQueue(),di(null,ei);break}case"unsuback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue(),di(null);break}default:li.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Pt){ze("handling pubrel packet"),Pt=typeof Pt<"u"?Pt:jt;const ni=ei.messageId,gi=this,di={cmd:"pubcomp",messageId:ni};gi.incomingStore.get(ei,function(li,ai){li?gi._sendPacket(di,Pt):(gi.emit("message",ai.topic,ai.payload,ai),gi.handleMessage(ai,function(ci){if(ci)return Pt(ci);gi.incomingStore.del(ai,jt),gi._sendPacket(di,Pt)}))})},ti.prototype._handleDisconnect=function(ei){this.emit("disconnect",ei)},ti.prototype._nextId=function(){return this.messageIdProvider.allocate()},ti.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},ti.prototype._resubscribe=function(){ze("_resubscribe");const ei=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion===5&&!this.connackPacket.sessionPresent)&&ei.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){ze("_resubscribe: protocolVersion 5");for(let Pt=0;Pt<ei.length;Pt++){const ni={};ni[ei[Pt]]=this._resubscribeTopics[ei[Pt]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Pt]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},ti.prototype._onConnect=function(ei){if(this.disconnected){this.emit("connect",ei);return}const Pt=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let gi=Pt.outgoingStore.createStream();function di(){Pt._storeProcessing=!1,Pt._packetIdsDuringStoreProcessing={}}Pt.once("close",li),gi.on("error",function(ci){di(),Pt._flushStoreProcessingQueue(),Pt.removeListener("close",li),Pt.emit("error",ci)});function li(){gi.destroy(),gi=null,Pt._flushStoreProcessingQueue(),di()}function ai(){if(!gi)return;Pt._storeProcessing=!0;const ci=gi.read(1);let pi;if(!ci){gi.once("readable",ai);return}if(Pt._packetIdsDuringStoreProcessing[ci.messageId]){ai();return}!Pt.disconnecting&&!Pt.reconnectTimer?(pi=Pt.outgoing[ci.messageId]?Pt.outgoing[ci.messageId].cb:null,Pt.outgoing[ci.messageId]={volatile:!1,cb:function(yi,Ai){pi&&pi(yi,Ai),ai()}},Pt._packetIdsDuringStoreProcessing[ci.messageId]=!0,Pt.messageIdProvider.register(ci.messageId)?Pt._sendPacket(ci):ze("messageId: %d has already used.",ci.messageId)):gi.destroy&&gi.destroy()}gi.on("end",function(){let ci=!0;for(const pi in Pt._packetIdsDuringStoreProcessing)if(!Pt._packetIdsDuringStoreProcessing[pi]){ci=!1;break}ci?(di(),Pt.removeListener("close",li),Pt._invokeAllStoreProcessingQueue(),Pt.emit("connect",ei)):ni()}),ai()}ni()},ti.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const ei=this._storeProcessingQueue[0];if(ei&&ei.invoke())return this._storeProcessingQueue.shift(),!0}return!1},ti.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},ti.prototype._flushStoreProcessingQueue=function(){for(const ei of this._storeProcessingQueue)ei.cbStorePut&&ei.cbStorePut(new Error("Connection closed")),ei.callback&&ei.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},g.exports=ti}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(pe,ze,Fe){re.sendSocketMessage({data:pe.buffer,success:function(){Fe()},fail:function(){Fe(new Error)}})},he._flush=function(ze){re.closeSocket({success:function(){ze()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,pe){const ze=he.protocol==="alis"?"wss":"ws";let Fe=ze+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Fe=ze+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Fe=he.transformWsUrl(Fe,he,pe)),Fe}function de(){ae||(ae=!0,re.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onSocketMessage(function(he){if(typeof he.data=="string"){const pe=V.from(he.data,"base64");Ce.push(pe)}else{const pe=new FileReader;pe.addEventListener("load",function(){let ze=pe.result;ze instanceof ArrayBuffer?ze=V.from(ze):ze=V.from(ze,"utf8"),Ce.push(ze)}),pe.readAsArrayBuffer(he.data)}}),re.onSocketClose(function(){ie.end(),ie.destroy()}),re.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,pe){if(pe.hostname=pe.hostname||pe.host,!pe.hostname)throw new Error("Could not determine host. Specify host manually.");const ze=pe.protocolId==="MQIsdp"&&pe.protocolVersion===3?"mqttv3.1":"mqtt";Ie(pe);const Fe=ue(pe,he);return re=pe.my,re.connectSocket({url:Fe,protocols:ze}),Ce=le(),ie=oe.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,k){const V=r("net"),$=r("debug")("mqttjs:tcp");function oe(re,Ce){Ce.port=Ce.port||1883,Ce.hostname=Ce.hostname||Ce.host||"localhost";const ie=Ce.port,ae=Ce.hostname;return $("port %d and host %s",ie,ae),V.createConnection(ie,ae)}g.exports=oe},{debug:18,net:16}],4:[function(r,g,k){const V=r("tls"),$=r("net"),oe=r("debug")("mqttjs:tls");function re(Ce,ie){ie.port=ie.port||8883,ie.host=ie.hostname||ie.host||"localhost",$.isIP(ie.host)===0&&(ie.servername=ie.host),ie.rejectUnauthorized=ie.rejectUnauthorized!==!1,delete ie.path,oe("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=V.connect(ie);ae.on("secureConnect",function(){ie.rejectUnauthorized&&!ae.authorized?ae.emit("error",new Error("TLS not authorized")):ae.removeListener("error",le)});function le(Ie){ie.rejectUnauthorized&&Ce.emit("error",Ie),ae.end()}return ae.on("error",le),ae}g.exports=re},{debug:18,net:16,tls:16}],5:[function(r,g,k){(function(V){(function(){const{Buffer:$}=r("buffer"),oe=r("ws"),re=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof V<"u"&&V.title==="browser"||typeof __webpack_require__=="function";function Ie(Fe,xe){let _e=Fe.protocol+"://"+Fe.hostname+":"+Fe.port+Fe.path;return typeof Fe.transformWsUrl=="function"&&(_e=Fe.transformWsUrl(_e,Fe,xe)),_e}function ue(Fe){const xe=Fe;return Fe.hostname||(xe.hostname="localhost"),Fe.port||(Fe.protocol==="wss"?xe.port=443:xe.port=80),Fe.path||(xe.path="/"),Fe.wsOptions||(xe.wsOptions={}),!le&&Fe.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Fe,_e)&&!Object.prototype.hasOwnProperty.call(Fe.wsOptions,_e)&&(xe.wsOptions[_e]=Fe[_e])}),xe}function de(Fe){const xe=ue(Fe);if(xe.hostname||(xe.hostname=xe.host),!xe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);xe.hostname=_e.hostname,xe.port||(xe.port=_e.port)}return xe.objectMode===void 0&&(xe.objectMode=!(xe.binary===!0||xe.binary===void 0)),xe}function Ne(Fe,xe,_e){re("createWebSocket"),re("protocol: "+_e.protocolId+" "+_e.protocolVersion);const Dt=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return re("creating new Websocket for url: "+xe+" and protocol: "+Dt),new oe(xe,[Dt],_e.wsOptions)}function he(Fe,xe){const _e=xe.protocolId==="MQIsdp"&&xe.protocolVersion===3?"mqttv3.1":"mqtt",Dt=Ie(xe,Fe),$e=new WebSocket(Dt,[_e]);return $e.binaryType="arraybuffer",$e}function pe(Fe,xe){re("streamBuilder");const _e=ue(xe),Dt=Ie(_e,Fe),$e=Ne(Fe,Dt,_e),Ue=oe.createWebSocketStream($e,_e.wsOptions);return Ue.url=Dt,$e.on("close",()=>{Ue.destroy()}),Ue}function ze(Fe,xe){re("browserStreamBuilder");let _e;const $e=de(xe).browserBufferSize||1024*512,Ue=xe.browserBufferTimeout||1e3,Ve=!xe.objectMode,Oe=he(Fe,xe),At=Lt(xe,ni,gi);xe.objectMode||(At._writev=Pt),At.on("close",()=>{Oe.close()});const qe=typeof Oe.addEventListener<"u";Oe.readyState===Oe.OPEN?_e=At:(_e=_e=Ce(void 0,void 0,xe),xe.objectMode||(_e._writev=Pt),qe?Oe.addEventListener("open",kt):Oe.onopen=kt),_e.socket=Oe,qe?(Oe.addEventListener("close",jt),Oe.addEventListener("error",ti),Oe.addEventListener("message",ei)):(Oe.onclose=jt,Oe.onerror=ti,Oe.onmessage=ei);function Lt(di,li,ai){const ci=new ie({objectModeMode:di.objectMode});return ci._write=li,ci._flush=ai,ci}function kt(){_e.setReadable(At),_e.setWritable(At),_e.emit("connect")}function jt(){_e.end(),_e.destroy()}function ti(di){_e.destroy(di)}function ei(di){let li=di.data;li instanceof ArrayBuffer?li=$.from(li):li=$.from(li,"utf8"),At.push(li)}function Pt(di,li){const ai=new Array(di.length);for(let ci=0;ci<di.length;ci++)typeof di[ci].chunk=="string"?ai[ci]=$.from(di[ci],"utf8"):ai[ci]=di[ci].chunk;this._write($.concat(ai),"binary",li)}function ni(di,li,ai){Oe.bufferedAmount>$e&&setTimeout(ni,Ue,di,li,ai),Ve&&typeof di=="string"&&(di=$.from(di,"utf8"));try{Oe.send(di)}catch(ci){return ai(ci)}ai()}function gi(di){Oe.close(),di()}return _e}le?g.exports=ze:g.exports=pe}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,pe,ze){re.send({data:he.buffer,success:function(){ze()},fail:function(Fe){ze(new Error(Fe))}})},Ne._flush=function(pe){re.close({success:function(){pe()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const pe=Ne.protocol==="wxs"?"wss":"ws";let ze=pe+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(ze=pe+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(ze=Ne.transformWsUrl(ze,Ne,he)),ze}function ue(){re.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=V.from(he):he=V.from(he,"utf8"),Ce.push(he)}),re.onClose(function(){ie.end(),ie.destroy()}),re.onError(function(Ne){ie.destroy(new Error(Ne.errMsg))})}function de(Ne,he){if(he.hostname=he.hostname||he.host,!he.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const ze=Ie(he,Ne);re=wx.connectSocket({url:ze,protocols:[pe]}),Ce=ae(),ie=oe.obj(),ie._destroy=function(xe,_e){re.close({success:function(){_e&&_e(xe)}})};const Fe=ie.destroy;return ie.destroy=function(){ie.destroy=Fe;const xe=this;setTimeout(function(){re.close({fail:function(){xe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,k){function V(){if(!(this instanceof V))return new V;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}V.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},V.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},V.prototype.register=function($){return!0},V.prototype.deallocate=function($){},V.prototype.clear=function(){},g.exports=V},{}],8:[function(r,g,k){const V=r("xtend"),$=r("readable-stream").Readable,oe={objectMode:!0},re={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=V(re,ie),this._inflights=new Map}Ce.prototype.put=function(ie,ae){return this._inflights.set(ie.messageId,ie),ae&&ae(),this},Ce.prototype.createStream=function(){const ie=new $(oe),ae=[];let le=!1,Ie=0;return this._inflights.forEach(function(ue,de){ae.push(ue)}),ie._read=function(){!le&&Ie<ae.length?this.push(ae[Ie++]):this.push(null)},ie.destroy=function(){if(le)return;const ue=this;le=!0,setTimeout(function(){ue.emit("close")},0)},ie},Ce.prototype.del=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?(this._inflights.delete(ie.messageId),ae(null,ie)):ae&&ae(new Error("missing packet")),this},Ce.prototype.get=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?ae(null,ie):ae&&ae(new Error("missing packet")),this},Ce.prototype.close=function(ie){this.options.clean&&(this._inflights=null),ie&&ie()},g.exports=Ce},{"readable-stream":69,xtend:81}],9:[function(r,g,k){function V($){if(!(this instanceof V))return new V($);this.aliasToTopic={},this.max=$}V.prototype.put=function($,oe){return oe===0||oe>this.max?!1:(this.aliasToTopic[oe]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},V.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},V.prototype.clear=function(){this.aliasToTopic={}},g.exports=V},{}],10:[function(r,g,k){const V=r("lru-cache"),$=r("number-allocator").NumberAllocator;function oe(re){if(!(this instanceof oe))return new oe(re);re>0&&(this.aliasToTopic=new V({max:re}),this.topicToAlias={},this.numberAllocator=new $(1,re),this.max=re,this.length=0)}oe.prototype.put=function(re,Ce){if(Ce===0||Ce>this.max)return!1;const ie=this.aliasToTopic.get(Ce);return ie&&delete this.topicToAlias[ie],this.aliasToTopic.set(Ce,re),this.topicToAlias[re]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},oe.prototype.getTopicByAlias=function(re){return this.aliasToTopic.get(re)},oe.prototype.getAliasByTopic=function(re){const Ce=this.topicToAlias[re];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},oe.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},oe.prototype.getLruAlias=function(){const re=this.numberAllocator.firstVacant();return re||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=oe},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,k){function V(oe){const re=oe.split("/");for(let Ce=0;Ce<re.length;Ce++)if(re[Ce]!=="+"){if(re[Ce]==="#")return Ce===re.length-1;if(re[Ce].indexOf("+")!==-1||re[Ce].indexOf("#")!==-1)return!1}return!0}function $(oe){if(oe.length===0)return"empty_topic_list";for(let re=0;re<oe.length;re++)if(!V(oe[re]))return oe[re];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,k){(function(V){(function(){const $=r("../client"),oe=r("../store"),re=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof V<"u"&&V.title!=="browser"||typeof __webpack_require__!="function"?(ae.mqtt=r("./tcp"),ae.tcp=r("./tcp"),ae.ssl=r("./tls"),ae.tls=r("./tls"),ae.mqtts=r("./tls")):(ae.wx=r("./wx"),ae.wxs=r("./wx"),ae.ali=r("./ali"),ae.alis=r("./ali")),ae.ws=r("./ws"),ae.wss=r("./ws");function le(ue){let de;ue.auth&&(de=ue.auth.match(/^(.+):(.+)$/),de?(ue.username=de[1],ue.password=de[2]):ue.username=ue.auth)}function Ie(ue,de){if(ie("connecting to an MQTT broker..."),typeof ue=="object"&&!de&&(de=ue,ue=null),de=de||{},ue){const pe=re.parse(ue,!0);if(pe.port!=null&&(pe.port=Number(pe.port)),de=Ce(pe,de),de.protocol===null)throw new Error("Missing protocol");de.protocol=de.protocol.replace(/:$/,"")}if(le(de),de.query&&typeof de.query.clientId=="string"&&(de.clientId=de.query.clientId),de.cert&&de.key)if(de.protocol){if(["mqtts","wss","wxs","alis"].indexOf(de.protocol)===-1)switch(de.protocol){case"mqtt":de.protocol="mqtts";break;case"ws":de.protocol="wss";break;case"wx":de.protocol="wxs";break;case"ali":de.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+de.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!ae[de.protocol]){const pe=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(ze,Fe){return pe&&Fe%2===0?!1:typeof ae[ze]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(pe){return de.servers&&((!pe._reconnectCount||pe._reconnectCount===de.servers.length)&&(pe._reconnectCount=0),de.host=de.servers[pe._reconnectCount].host,de.port=de.servers[pe._reconnectCount].port,de.protocol=de.servers[pe._reconnectCount].protocol?de.servers[pe._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,pe._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](pe,de)}const he=new $(Ne,de);return he.on("error",function(){}),he}g.exports=Ie,g.exports.connect=Ie,g.exports.MqttClient=$,g.exports.Store=oe}).call(this)}).call(this,r("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(r,g,k){k.byteLength=le,k.toByteArray=ue,k.fromByteArray=he;for(var V=[],$=[],oe=typeof Uint8Array<"u"?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=re.length;Ce<ie;++Ce)V[Ce]=re[Ce],$[re.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(pe){var ze=pe.length;if(ze%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Fe=pe.indexOf("=");Fe===-1&&(Fe=ze);var xe=Fe===ze?0:4-Fe%4;return[Fe,xe]}function le(pe){var ze=ae(pe),Fe=ze[0],xe=ze[1];return(Fe+xe)*3/4-xe}function Ie(pe,ze,Fe){return(ze+Fe)*3/4-Fe}function ue(pe){var ze,Fe=ae(pe),xe=Fe[0],_e=Fe[1],Dt=new oe(Ie(pe,xe,_e)),$e=0,Ue=_e>0?xe-4:xe,Ve;for(Ve=0;Ve<Ue;Ve+=4)ze=$[pe.charCodeAt(Ve)]<<18|$[pe.charCodeAt(Ve+1)]<<12|$[pe.charCodeAt(Ve+2)]<<6|$[pe.charCodeAt(Ve+3)],Dt[$e++]=ze>>16&255,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255;return _e===2&&(ze=$[pe.charCodeAt(Ve)]<<2|$[pe.charCodeAt(Ve+1)]>>4,Dt[$e++]=ze&255),_e===1&&(ze=$[pe.charCodeAt(Ve)]<<10|$[pe.charCodeAt(Ve+1)]<<4|$[pe.charCodeAt(Ve+2)]>>2,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255),Dt}function de(pe){return V[pe>>18&63]+V[pe>>12&63]+V[pe>>6&63]+V[pe&63]}function Ne(pe,ze,Fe){for(var xe,_e=[],Dt=ze;Dt<Fe;Dt+=3)xe=(pe[Dt]<<16&16711680)+(pe[Dt+1]<<8&65280)+(pe[Dt+2]&255),_e.push(de(xe));return _e.join("")}function he(pe){for(var ze,Fe=pe.length,xe=Fe%3,_e=[],Dt=16383,$e=0,Ue=Fe-xe;$e<Ue;$e+=Dt)_e.push(Ne(pe,$e,$e+Dt>Ue?Ue:$e+Dt));return xe===1?(ze=pe[Fe-1],_e.push(V[ze>>2]+V[ze<<4&63]+"==")):xe===2&&(ze=(pe[Fe-2]<<8)+pe[Fe-1],_e.push(V[ze>>10]+V[ze>>4&63]+V[ze<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,k){const{Buffer:V}=r("buffer"),$=Symbol.for("BufferList");function oe(re){if(!(this instanceof oe))return new oe(re);oe._init.call(this,re)}oe._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},oe.prototype._new=function(Ce){return new oe(Ce)},oe.prototype._offset=function(Ce){if(Ce===0)return[0,0];let ie=0;for(let ae=0;ae<this._bufs.length;ae++){const le=ie+this._bufs[ae].length;if(Ce<le||ae===this._bufs.length-1)return[ae,Ce-ie];ie=le}},oe.prototype._reverseOffset=function(re){const Ce=re[0];let ie=re[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},oe.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},oe.prototype.slice=function(Ce,ie){return typeof Ce=="number"&&Ce<0&&(Ce+=this.length),typeof ie=="number"&&ie<0&&(ie+=this.length),this.copy(null,0,Ce,ie)},oe.prototype.copy=function(Ce,ie,ae,le){if((typeof ae!="number"||ae<0)&&(ae=0),(typeof le!="number"||le>this.length)&&(le=this.length),ae>=this.length||le<=0)return Ce||V.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,pe=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:V.concat(this._bufs,this.length);for(let ze=0;ze<this._bufs.length;ze++)this._bufs[ze].copy(Ce,he),he+=this._bufs[ze].length;return Ce}if(Ne<=this._bufs[ue[0]].length-pe)return Ie?this._bufs[ue[0]].copy(Ce,ie,pe,pe+Ne):this._bufs[ue[0]].slice(pe,pe+Ne);Ie||(Ce=V.allocUnsafe(de));for(let ze=ue[0];ze<this._bufs.length;ze++){const Fe=this._bufs[ze].length-pe;if(Ne>Fe)this._bufs[ze].copy(Ce,he,pe),he+=Fe;else{this._bufs[ze].copy(Ce,he,pe,pe+Ne),he+=Fe;break}Ne-=Fe,pe&&(pe=0)}return Ce.length>he?Ce.slice(0,he):Ce},oe.prototype.shallowSlice=function(Ce,ie){if(Ce=Ce||0,ie=typeof ie!="number"?this.length:ie,Ce<0&&(Ce+=this.length),ie<0&&(ie+=this.length),Ce===ie)return this._new();const ae=this._offset(Ce),le=this._offset(ie),Ie=this._bufs.slice(ae[0],le[0]+1);return le[1]===0?Ie.pop():Ie[Ie.length-1]=Ie[Ie.length-1].slice(0,le[1]),ae[1]!==0&&(Ie[0]=Ie[0].slice(ae[1])),this._new(Ie)},oe.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},oe.prototype.consume=function(Ce){if(Ce=Math.trunc(Ce),Number.isNaN(Ce)||Ce<=0)return this;for(;this._bufs.length;)if(Ce>=this._bufs[0].length)Ce-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(Ce),this.length-=Ce;break}return this},oe.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},oe.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(V.from(Ce.buffer,Ce.byteOffset,Ce.byteLength));else if(Array.isArray(Ce))for(let ie=0;ie<Ce.length;ie++)this.append(Ce[ie]);else if(this._isBufferList(Ce))for(let ie=0;ie<Ce._bufs.length;ie++)this.append(Ce._bufs[ie]);else typeof Ce=="number"&&(Ce=Ce.toString()),this._appendBuffer(V.from(Ce));return this},oe.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},oe.prototype.indexOf=function(re,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof re=="function"||Array.isArray(re))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof re=="number"?re=V.from([re]):typeof re=="string"?re=V.from(re,ie):this._isBufferList(re)?re=re.slice():Array.isArray(re.buffer)?re=V.from(re.buffer,re.byteOffset,re.byteLength):V.isBuffer(re)||(re=V.from(re)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),re.length===0)return Ce>this.length?this.length:Ce;const ae=this._offset(Ce);let le=ae[0],Ie=ae[1];for(;le<this._bufs.length;le++){const ue=this._bufs[le];for(;Ie<ue.length;)if(ue.length-Ie>=re.length){const Ne=ue.indexOf(re,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-re.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,re))return Ne;Ie++}Ie=0}return-1},oe.prototype._match=function(re,Ce){if(this.length-re<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(re+ie)!==Ce[ie])return!1;return!0},function(){const re={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const Ce in re)(function(ie){re[ie]===null?oe.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:oe.prototype[ie]=function(ae=0){return this.slice(ae,ae+re[ie])[ie](0)}})(Ce)}(),oe.prototype._isBufferList=function(Ce){return Ce instanceof oe||oe.isBufferList(Ce)},oe.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=oe},{buffer:17}],15:[function(r,g,k){const V=r("readable-stream").Duplex,$=r("inherits"),oe=r("./BufferList");function re(Ce){if(!(this instanceof re))return new re(Ce);if(typeof Ce=="function"){this._callback=Ce;const ie=function(le){this._callback&&(this._callback(le),this._callback=null)}.bind(this);this.on("pipe",function(le){le.on("error",ie)}),this.on("unpipe",function(le){le.removeListener("error",ie)}),Ce=null}oe._init.call(this,Ce),V.call(this)}$(re,V),Object.assign(re.prototype,oe.prototype),re.prototype._new=function(ie){return new re(ie)},re.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},re.prototype._read=function(ie){if(!this.length)return this.push(null);ie=Math.min(ie,this.length),this.push(this.slice(0,ie)),this.consume(ie)},re.prototype.end=function(ie){V.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},re.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},re.prototype._isBufferList=function(ie){return ie instanceof re||ie instanceof oe||re.isBufferList(ie)},re.isBufferList=oe.isBufferList,g.exports=re,g.exports.BufferListStream=re,g.exports.BufferList=oe},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,k){},{}],17:[function(r,g,k){(function(V){(function(){var $=r("base64-js"),oe=r("ieee754");k.Buffer=ae,k.SlowBuffer=xe,k.INSPECT_MAX_BYTES=50;var re=2147483647;k.kMaxLength=re,ae.TYPED_ARRAY_SUPPORT=Ce(),!ae.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ce(){try{var oi=new Uint8Array(1);return oi.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},oi.foo()===42}catch{return!1}}Object.defineProperty(ae.prototype,"parent",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.buffer}}),Object.defineProperty(ae.prototype,"offset",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.byteOffset}});function ie(oi){if(oi>re)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Et=new Uint8Array(oi);return Et.__proto__=ae.prototype,Et}function ae(oi,Et,ii){if(typeof oi=="number"){if(typeof Et=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Et,ii)}typeof Symbol<"u"&&Symbol.species!=null&&ae[Symbol.species]===ae&&Object.defineProperty(ae,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ae.poolSize=8192;function le(oi,Et,ii){if(typeof oi=="string")return Ne(oi,Et);if(ArrayBuffer.isView(oi))return he(oi);if(oi==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi);if(si(oi,ArrayBuffer)||oi&&si(oi.buffer,ArrayBuffer))return pe(oi,Et,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ri=oi.valueOf&&oi.valueOf();if(ri!=null&&ri!==oi)return ae.from(ri,Et,ii);var ui=ze(oi);if(ui)return ui;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Et,ii);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi)}ae.from=function(oi,Et,ii){return le(oi,Et,ii)},ae.prototype.__proto__=Uint8Array.prototype,ae.__proto__=Uint8Array;function Ie(oi){if(typeof oi!="number")throw new TypeError('"size" argument must be of type number');if(oi<0)throw new RangeError('The value "'+oi+'" is invalid for option "size"')}function ue(oi,Et,ii){return Ie(oi),oi<=0?ie(oi):Et!==void 0?typeof ii=="string"?ie(oi).fill(Et,ii):ie(oi).fill(Et):ie(oi)}ae.alloc=function(oi,Et,ii){return ue(oi,Et,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Fe(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Et){if((typeof Et!="string"||Et==="")&&(Et="utf8"),!ae.isEncoding(Et))throw new TypeError("Unknown encoding: "+Et);var ii=_e(oi,Et)|0,ri=ie(ii),ui=ri.write(oi,Et);return ui!==ii&&(ri=ri.slice(0,ui)),ri}function he(oi){for(var Et=oi.length<0?0:Fe(oi.length)|0,ii=ie(Et),ri=0;ri<Et;ri+=1)ii[ri]=oi[ri]&255;return ii}function pe(oi,Et,ii){if(Et<0||oi.byteLength<Et)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Et+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var ri;return Et===void 0&&ii===void 0?ri=new Uint8Array(oi):ii===void 0?ri=new Uint8Array(oi,Et):ri=new Uint8Array(oi,Et,ii),ri.__proto__=ae.prototype,ri}function ze(oi){if(ae.isBuffer(oi)){var Et=Fe(oi.length)|0,ii=ie(Et);return ii.length===0||oi.copy(ii,0,0,Et),ii}if(oi.length!==void 0)return typeof oi.length!="number"||Ii(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Fe(oi){if(oi>=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return oi|0}function xe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Et){return Et!=null&&Et._isBuffer===!0&&Et!==ae.prototype},ae.compare=function(Et,ii){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Et)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Et===ii)return 0;for(var ri=Et.length,ui=ii.length,vi=0,bi=Math.min(ri,ui);vi<bi;++vi)if(Et[vi]!==ii[vi]){ri=Et[vi],ui=ii[vi];break}return ri<ui?-1:ui<ri?1:0},ae.isEncoding=function(Et){switch(String(Et).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ae.concat=function(Et,ii){if(!Array.isArray(Et))throw new TypeError('"list" argument must be an Array of Buffers');if(Et.length===0)return ae.alloc(0);var ri;if(ii===void 0)for(ii=0,ri=0;ri<Et.length;++ri)ii+=Et[ri].length;var ui=ae.allocUnsafe(ii),vi=0;for(ri=0;ri<Et.length;++ri){var bi=Et[ri];if(si(bi,Uint8Array)&&(bi=ae.from(bi)),!ae.isBuffer(bi))throw new TypeError('"list" argument must be an Array of Buffers');bi.copy(ui,vi),vi+=bi.length}return ui};function _e(oi,Et){if(ae.isBuffer(oi))return oi.length;if(ArrayBuffer.isView(oi)||si(oi,ArrayBuffer))return oi.byteLength;if(typeof oi!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oi);var ii=oi.length,ri=arguments.length>2&&arguments[2]===!0;if(!ri&&ii===0)return 0;for(var ui=!1;;)switch(Et){case"ascii":case"latin1":case"binary":return ii;case"utf8":case"utf-8":return Ni(oi).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ii*2;case"hex":return ii>>>1;case"base64":return zi(oi).length;default:if(ui)return ri?-1:Ni(oi).length;Et=(""+Et).toLowerCase(),ui=!0}}ae.byteLength=_e;function Dt(oi,Et,ii){var ri=!1;if((Et===void 0||Et<0)&&(Et=0),Et>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Et>>>=0,ii<=Et))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return li(this,Et,ii);case"utf8":case"utf-8":return ei(this,Et,ii);case"ascii":return gi(this,Et,ii);case"latin1":case"binary":return di(this,Et,ii);case"base64":return ti(this,Et,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ai(this,Et,ii);default:if(ri)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),ri=!0}}ae.prototype._isBuffer=!0;function $e(oi,Et,ii){var ri=oi[Et];oi[Et]=oi[ii],oi[ii]=ri}ae.prototype.swap16=function(){var Et=this.length;if(Et%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Et;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Et=this.length;if(Et%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Et;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Et=this.length;if(Et%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Et;ii+=8)$e(this,ii,ii+7),$e(this,ii+1,ii+6),$e(this,ii+2,ii+5),$e(this,ii+3,ii+4);return this},ae.prototype.toString=function(){var Et=this.length;return Et===0?"":arguments.length===0?ei(this,0,Et):Dt.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Et){if(!ae.isBuffer(Et))throw new TypeError("Argument must be a Buffer");return this===Et?!0:ae.compare(this,Et)===0},ae.prototype.inspect=function(){var Et="",ii=k.INSPECT_MAX_BYTES;return Et=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Et+=" ... "),"<Buffer "+Et+">"},ae.prototype.compare=function(Et,ii,ri,ui,vi){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),!ae.isBuffer(Et))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Et);if(ii===void 0&&(ii=0),ri===void 0&&(ri=Et?Et.length:0),ui===void 0&&(ui=0),vi===void 0&&(vi=this.length),ii<0||ri>Et.length||ui<0||vi>this.length)throw new RangeError("out of range index");if(ui>=vi&&ii>=ri)return 0;if(ui>=vi)return-1;if(ii>=ri)return 1;if(ii>>>=0,ri>>>=0,ui>>>=0,vi>>>=0,this===Et)return 0;for(var bi=vi-ui,Zi=ri-ii,Gi=Math.min(bi,Zi),Yi=this.slice(ui,vi),Oi=Et.slice(ii,ri),xi=0;xi<Gi;++xi)if(Yi[xi]!==Oi[xi]){bi=Yi[xi],Zi=Oi[xi];break}return bi<Zi?-1:Zi<bi?1:0};function Ue(oi,Et,ii,ri,ui){if(oi.length===0)return-1;if(typeof ii=="string"?(ri=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,Ii(ii)&&(ii=ui?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(ui)return-1;ii=oi.length-1}else if(ii<0)if(ui)ii=0;else return-1;if(typeof Et=="string"&&(Et=ae.from(Et,ri)),ae.isBuffer(Et))return Et.length===0?-1:Ve(oi,Et,ii,ri,ui);if(typeof Et=="number")return Et=Et&255,typeof Uint8Array.prototype.indexOf=="function"?ui?Uint8Array.prototype.indexOf.call(oi,Et,ii):Uint8Array.prototype.lastIndexOf.call(oi,Et,ii):Ve(oi,[Et],ii,ri,ui);throw new TypeError("val must be string, number or Buffer")}function Ve(oi,Et,ii,ri,ui){var vi=1,bi=oi.length,Zi=Et.length;if(ri!==void 0&&(ri=String(ri).toLowerCase(),ri==="ucs2"||ri==="ucs-2"||ri==="utf16le"||ri==="utf-16le")){if(oi.length<2||Et.length<2)return-1;vi=2,bi/=2,Zi/=2,ii/=2}function Gi(Wi,ki){return vi===1?Wi[ki]:Wi.readUInt16BE(ki*vi)}var Yi;if(ui){var Oi=-1;for(Yi=ii;Yi<bi;Yi++)if(Gi(oi,Yi)===Gi(Et,Oi===-1?0:Yi-Oi)){if(Oi===-1&&(Oi=Yi),Yi-Oi+1===Zi)return Oi*vi}else Oi!==-1&&(Yi-=Yi-Oi),Oi=-1}else for(ii+Zi>bi&&(ii=bi-Zi),Yi=ii;Yi>=0;Yi--){for(var xi=!0,Li=0;Li<Zi;Li++)if(Gi(oi,Yi+Li)!==Gi(Et,Li)){xi=!1;break}if(xi)return Yi}return-1}ae.prototype.includes=function(Et,ii,ri){return this.indexOf(Et,ii,ri)!==-1},ae.prototype.indexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!0)},ae.prototype.lastIndexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!1)};function Oe(oi,Et,ii,ri){ii=Number(ii)||0;var ui=oi.length-ii;ri?(ri=Number(ri),ri>ui&&(ri=ui)):ri=ui;var vi=Et.length;ri>vi/2&&(ri=vi/2);for(var bi=0;bi<ri;++bi){var Zi=parseInt(Et.substr(bi*2,2),16);if(Ii(Zi))return bi;oi[ii+bi]=Zi}return bi}function At(oi,Et,ii,ri){return Si(Ni(Et,oi.length-ii),oi,ii,ri)}function qe(oi,Et,ii,ri){return Si(Mi(Et),oi,ii,ri)}function Lt(oi,Et,ii,ri){return qe(oi,Et,ii,ri)}function kt(oi,Et,ii,ri){return Si(zi(Et),oi,ii,ri)}function jt(oi,Et,ii,ri){return Si(fi(Et,oi.length-ii),oi,ii,ri)}ae.prototype.write=function(Et,ii,ri,ui){if(ii===void 0)ui="utf8",ri=this.length,ii=0;else if(ri===void 0&&typeof ii=="string")ui=ii,ri=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(ri)?(ri=ri>>>0,ui===void 0&&(ui="utf8")):(ui=ri,ri=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var vi=this.length-ii;if((ri===void 0||ri>vi)&&(ri=vi),Et.length>0&&(ri<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");ui||(ui="utf8");for(var bi=!1;;)switch(ui){case"hex":return Oe(this,Et,ii,ri);case"utf8":case"utf-8":return At(this,Et,ii,ri);case"ascii":return qe(this,Et,ii,ri);case"latin1":case"binary":return Lt(this,Et,ii,ri);case"base64":return kt(this,Et,ii,ri);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,Et,ii,ri);default:if(bi)throw new TypeError("Unknown encoding: "+ui);ui=(""+ui).toLowerCase(),bi=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Et,ii){return Et===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Et,ii))}function ei(oi,Et,ii){ii=Math.min(oi.length,ii);for(var ri=[],ui=Et;ui<ii;){var vi=oi[ui],bi=null,Zi=vi>239?4:vi>223?3:vi>191?2:1;if(ui+Zi<=ii){var Gi,Yi,Oi,xi;switch(Zi){case 1:vi<128&&(bi=vi);break;case 2:Gi=oi[ui+1],(Gi&192)===128&&(xi=(vi&31)<<6|Gi&63,xi>127&&(bi=xi));break;case 3:Gi=oi[ui+1],Yi=oi[ui+2],(Gi&192)===128&&(Yi&192)===128&&(xi=(vi&15)<<12|(Gi&63)<<6|Yi&63,xi>2047&&(xi<55296||xi>57343)&&(bi=xi));break;case 4:Gi=oi[ui+1],Yi=oi[ui+2],Oi=oi[ui+3],(Gi&192)===128&&(Yi&192)===128&&(Oi&192)===128&&(xi=(vi&15)<<18|(Gi&63)<<12|(Yi&63)<<6|Oi&63,xi>65535&&xi<1114112&&(bi=xi))}}bi===null?(bi=65533,Zi=1):bi>65535&&(bi-=65536,ri.push(bi>>>10&1023|55296),bi=56320|bi&1023),ri.push(bi),ui+=Zi}return ni(ri)}var Pt=4096;function ni(oi){var Et=oi.length;if(Et<=Pt)return String.fromCharCode.apply(String,oi);for(var ii="",ri=0;ri<Et;)ii+=String.fromCharCode.apply(String,oi.slice(ri,ri+=Pt));return ii}function gi(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]&127);return ri}function di(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]);return ri}function li(oi,Et,ii){var ri=oi.length;(!Et||Et<0)&&(Et=0),(!ii||ii<0||ii>ri)&&(ii=ri);for(var ui="",vi=Et;vi<ii;++vi)ui+=mi(oi[vi]);return ui}function ai(oi,Et,ii){for(var ri=oi.slice(Et,ii),ui="",vi=0;vi<ri.length;vi+=2)ui+=String.fromCharCode(ri[vi]+ri[vi+1]*256);return ui}ae.prototype.slice=function(Et,ii){var ri=this.length;Et=~~Et,ii=ii===void 0?ri:~~ii,Et<0?(Et+=ri,Et<0&&(Et=0)):Et>ri&&(Et=ri),ii<0?(ii+=ri,ii<0&&(ii=0)):ii>ri&&(ii=ri),ii<Et&&(ii=Et);var ui=this.subarray(Et,ii);return ui.__proto__=ae.prototype,ui};function ci(oi,Et,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Et>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return ui},ae.prototype.readUIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et+--ii],vi=1;ii>0&&(vi*=256);)ui+=this[Et+--ii]*vi;return ui},ae.prototype.readUInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]},ae.prototype.readUInt16LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]|this[Et+1]<<8},ae.prototype.readUInt16BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]<<8|this[Et+1]},ae.prototype.readUInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),(this[Et]|this[Et+1]<<8|this[Et+2]<<16)+this[Et+3]*16777216},ae.prototype.readUInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]*16777216+(this[Et+1]<<16|this[Et+2]<<8|this[Et+3])},ae.prototype.readIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return vi*=128,ui>=vi&&(ui-=Math.pow(2,8*ii)),ui},ae.prototype.readIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=ii,vi=1,bi=this[Et+--ui];ui>0&&(vi*=256);)bi+=this[Et+--ui]*vi;return vi*=128,bi>=vi&&(bi-=Math.pow(2,8*ii)),bi},ae.prototype.readInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]&128?(255-this[Et]+1)*-1:this[Et]},ae.prototype.readInt16LE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et]|this[Et+1]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt16BE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et+1]|this[Et]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]|this[Et+1]<<8|this[Et+2]<<16|this[Et+3]<<24},ae.prototype.readInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]<<24|this[Et+1]<<16|this[Et+2]<<8|this[Et+3]},ae.prototype.readFloatLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!0,23,4)},ae.prototype.readFloatBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!1,23,4)},ae.prototype.readDoubleLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!0,52,8)},ae.prototype.readDoubleBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!1,52,8)};function pi(oi,Et,ii,ri,ui,vi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Et>ui||Et<vi)throw new RangeError('"value" argument is out of bounds');if(ii+ri>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=1,Zi=0;for(this[ii]=Et&255;++Zi<ri&&(bi*=256);)this[ii+Zi]=Et/bi&255;return ii+ri},ae.prototype.writeUIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=ri-1,Zi=1;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)this[ii+bi]=Et/Zi&255;return ii+ri},ae.prototype.writeUInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,255,0),this[ii]=Et&255,ii+1},ae.prototype.writeUInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeUInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeUInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii+3]=Et>>>24,this[ii+2]=Et>>>16,this[ii+1]=Et>>>8,this[ii]=Et&255,ii+4},ae.prototype.writeUInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4},ae.prototype.writeIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=0,Zi=1,Gi=0;for(this[ii]=Et&255;++bi<ri&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi-1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=ri-1,Zi=1,Gi=0;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi+1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,127,-128),Et<0&&(Et=255+Et+1),this[ii]=Et&255,ii+1},ae.prototype.writeInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),this[ii]=Et&255,this[ii+1]=Et>>>8,this[ii+2]=Et>>>16,this[ii+3]=Et>>>24,ii+4},ae.prototype.writeInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),Et<0&&(Et=4294967295+Et+1),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4};function yi(oi,Et,ii,ri,ui,vi){if(ii+ri>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function Ai(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,4),oe.write(oi,Et,ii,ri,23,4),ii+4}ae.prototype.writeFloatLE=function(Et,ii,ri){return Ai(this,Et,ii,!0,ri)},ae.prototype.writeFloatBE=function(Et,ii,ri){return Ai(this,Et,ii,!1,ri)};function hi(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,8),oe.write(oi,Et,ii,ri,52,8),ii+8}ae.prototype.writeDoubleLE=function(Et,ii,ri){return hi(this,Et,ii,!0,ri)},ae.prototype.writeDoubleBE=function(Et,ii,ri){return hi(this,Et,ii,!1,ri)},ae.prototype.copy=function(Et,ii,ri,ui){if(!ae.isBuffer(Et))throw new TypeError("argument should be a Buffer");if(ri||(ri=0),!ui&&ui!==0&&(ui=this.length),ii>=Et.length&&(ii=Et.length),ii||(ii=0),ui>0&&ui<ri&&(ui=ri),ui===ri||Et.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(ri<0||ri>=this.length)throw new RangeError("Index out of range");if(ui<0)throw new RangeError("sourceEnd out of bounds");ui>this.length&&(ui=this.length),Et.length-ii<ui-ri&&(ui=Et.length-ii+ri);var vi=ui-ri;if(this===Et&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,ri,ui);else if(this===Et&&ri<ii&&ii<ui)for(var bi=vi-1;bi>=0;--bi)Et[bi+ii]=this[bi+ri];else Uint8Array.prototype.set.call(Et,this.subarray(ri,ui),ii);return vi},ae.prototype.fill=function(Et,ii,ri,ui){if(typeof Et=="string"){if(typeof ii=="string"?(ui=ii,ii=0,ri=this.length):typeof ri=="string"&&(ui=ri,ri=this.length),ui!==void 0&&typeof ui!="string")throw new TypeError("encoding must be a string");if(typeof ui=="string"&&!ae.isEncoding(ui))throw new TypeError("Unknown encoding: "+ui);if(Et.length===1){var vi=Et.charCodeAt(0);(ui==="utf8"&&vi<128||ui==="latin1")&&(Et=vi)}}else typeof Et=="number"&&(Et=Et&255);if(ii<0||this.length<ii||this.length<ri)throw new RangeError("Out of range index");if(ri<=ii)return this;ii=ii>>>0,ri=ri===void 0?this.length:ri>>>0,Et||(Et=0);var bi;if(typeof Et=="number")for(bi=ii;bi<ri;++bi)this[bi]=Et;else{var Zi=ae.isBuffer(Et)?Et:ae.from(Et,ui),Gi=Zi.length;if(Gi===0)throw new TypeError('The value "'+Et+'" is invalid for argument "value"');for(bi=0;bi<ri-ii;++bi)this[bi+ii]=Zi[bi%Gi]}return this};var wi=/[^+/0-9A-Za-z-_]/g;function Ci(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(wi,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function mi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Et){Et=Et||1/0;for(var ii,ri=oi.length,ui=null,vi=[],bi=0;bi<ri;++bi){if(ii=oi.charCodeAt(bi),ii>55295&&ii<57344){if(!ui){if(ii>56319){(Et-=3)>-1&&vi.push(239,191,189);continue}else if(bi+1===ri){(Et-=3)>-1&&vi.push(239,191,189);continue}ui=ii;continue}if(ii<56320){(Et-=3)>-1&&vi.push(239,191,189),ui=ii;continue}ii=(ui-55296<<10|ii-56320)+65536}else ui&&(Et-=3)>-1&&vi.push(239,191,189);if(ui=null,ii<128){if((Et-=1)<0)break;vi.push(ii)}else if(ii<2048){if((Et-=2)<0)break;vi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Et-=3)<0)break;vi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Et-=4)<0)break;vi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return vi}function Mi(oi){for(var Et=[],ii=0;ii<oi.length;++ii)Et.push(oi.charCodeAt(ii)&255);return Et}function fi(oi,Et){for(var ii,ri,ui,vi=[],bi=0;bi<oi.length&&!((Et-=2)<0);++bi)ii=oi.charCodeAt(bi),ri=ii>>8,ui=ii%256,vi.push(ui),vi.push(ri);return vi}function zi(oi){return $.toByteArray(Ci(oi))}function Si(oi,Et,ii,ri){for(var ui=0;ui<ri&&!(ui+ii>=Et.length||ui>=oi.length);++ui)Et[ui+ii]=oi[ui];return ui}function si(oi,Et){return oi instanceof Et||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Et.name}function Ii(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,k){(function(V){(function(){k.formatArgs=oe,k.save=re,k.load=Ce,k.useColors=$,k.storage=ie(),k.destroy=(()=>{let le=!1;return()=>{le||(le=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),k.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oe(le){if(le[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+le[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;const Ie="color: "+this.color;le.splice(1,0,Ie,"color: inherit");let ue=0,de=0;le[0].replace(/%[a-zA-Z%]/g,Ne=>{Ne!=="%%"&&(ue++,Ne==="%c"&&(de=ue))}),le.splice(de,0,Ie)}k.log=console.debug||console.log||(()=>{});function re(le){try{le?k.storage.setItem("debug",le):k.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=k.storage.getItem("debug")}catch{}return!le&&typeof V<"u"&&"env"in V&&(le=V.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(k);const{formatters:ae}=g.exports;ae.j=function(le){try{return JSON.stringify(le)}catch(Ie){return"[UnexpectedJSONParseError]: "+Ie.message}}}).call(this)}).call(this,r("_process"))},{"./common":19,_process:50}],19:[function(r,g,k){function V($){re.debug=re,re.default=re,re.coerce=ue,re.disable=ae,re.enable=ie,re.enabled=le,re.humanize=r("ms"),re.destroy=de,Object.keys($).forEach(Ne=>{re[Ne]=$[Ne]}),re.names=[],re.skips=[],re.formatters={};function oe(Ne){let he=0;for(let pe=0;pe<Ne.length;pe++)he=(he<<5)-he+Ne.charCodeAt(pe),he|=0;return re.colors[Math.abs(he)%re.colors.length]}re.selectColor=oe;function re(Ne){let he,pe=null,ze,Fe;function xe(..._e){if(!xe.enabled)return;const Dt=xe,$e=Number(new Date),Ue=$e-(he||$e);Dt.diff=Ue,Dt.prev=he,Dt.curr=$e,he=$e,_e[0]=re.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ve=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(At,qe)=>{if(At==="%%")return"%";Ve++;const Lt=re.formatters[qe];if(typeof Lt=="function"){const kt=_e[Ve];At=Lt.call(Dt,kt),_e.splice(Ve,1),Ve--}return At}),re.formatArgs.call(Dt,_e),(Dt.log||re.log).apply(Dt,_e)}return xe.namespace=Ne,xe.useColors=re.useColors(),xe.color=re.selectColor(Ne),xe.extend=Ce,xe.destroy=re.destroy,Object.defineProperty(xe,"enabled",{enumerable:!0,configurable:!1,get:()=>pe!==null?pe:(ze!==re.namespaces&&(ze=re.namespaces,Fe=re.enabled(Ne)),Fe),set:_e=>{pe=_e}}),typeof re.init=="function"&&re.init(xe),xe}function Ce(Ne,he){const pe=re(this.namespace+(typeof he>"u"?":":he)+Ne);return pe.log=this.log,pe}function ie(Ne){re.save(Ne),re.namespaces=Ne,re.names=[],re.skips=[];let he;const pe=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),ze=pe.length;for(he=0;he<ze;he++)pe[he]&&(Ne=pe[he].replace(/\*/g,".*?"),Ne[0]==="-"?re.skips.push(new RegExp("^"+Ne.substr(1)+"$")):re.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...re.names.map(Ie),...re.skips.map(Ie).map(he=>"-"+he)].join(",");return re.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,pe;for(he=0,pe=re.skips.length;he<pe;he++)if(re.skips[he].test(Ne))return!1;for(he=0,pe=re.names.length;he<pe;he++)if(re.names[he].test(Ne))return!0;return!1}function Ie(Ne){return Ne.toString().substring(2,Ne.toString().length-2).replace(/\.\*\?$/,"*")}function ue(Ne){return Ne instanceof Error?Ne.stack||Ne.message:Ne}function de(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return re.enable(re.load()),re}g.exports=V},{ms:45}],20:[function(r,g,k){(function(V,$){(function(){var oe=r("readable-stream"),re=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(ze,Fe){ze._corked?ze.once("uncork",Fe):Fe()},Ie=function(ze,Fe){ze._autoDestroy&&ze.destroy(Fe)},ue=function(ze,Fe){return function(xe){xe?Ie(ze,xe.message==="premature close"?null:xe):Fe&&!ze._ended&&ze.end()}},de=function(ze,Fe){if(!ze||ze._writableState&&ze._writableState.finished)return Fe();if(ze._writableState)return ze.end(Fe);ze.end(),Fe()},Ne=function(){},he=function(ze){return new oe.Readable({objectMode:!0,highWaterMark:16}).wrap(ze)},pe=function(ze,Fe,xe){if(!(this instanceof pe))return new pe(ze,Fe,xe);oe.Duplex.call(this,xe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!xe||xe.autoDestroy!==!1,this._forwardDestroy=!xe||xe.destroy!==!1,this._forwardEnd=!xe||xe.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,ze&&this.setWritable(ze),Fe&&this.setReadable(Fe)};Ce(pe,oe.Duplex),pe.obj=function(ze,Fe,xe){return xe||(xe={}),xe.objectMode=!0,xe.highWaterMark=16,new pe(ze,Fe,xe)},pe.prototype.cork=function(){++this._corked===1&&this.emit("cork")},pe.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},pe.prototype.setWritable=function(ze){if(this._unwrite&&this._unwrite(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.end();return}var Fe=this,xe=re(ze,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Fe._ondrain;Fe._ondrain=null,$e&&$e()},Dt=function(){Fe._writable.removeListener("drain",_e),xe()};this._unwrite&&V.nextTick(_e),this._writable=ze,this._writable.on("drain",_e),this._unwrite=Dt,this.uncork()},pe.prototype.setReadable=function(ze){if(this._unread&&this._unread(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.push(null),this.resume();return}var Fe=this,xe=re(ze,{writable:!1,readable:!0},ue(this)),_e=function(){Fe._forward()},Dt=function(){Fe.push(null)},$e=function(){Fe._readable2.removeListener("readable",_e),Fe._readable2.removeListener("end",Dt),xe()};this._drained=!0,this._readable=ze,this._readable2=ze._readableState?ze:he(ze),this._readable2.on("readable",_e),this._readable2.on("end",Dt),this._unread=$e,this._forward()},pe.prototype._read=function(){this._drained=!0,this._forward()},pe.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var ze;this._drained&&(ze=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(ze));this._forwarding=!1}},pe.prototype.destroy=function(ze,Fe){if(Fe||(Fe=Ne),this.destroyed)return Fe(null);this.destroyed=!0;var xe=this;V.nextTick(function(){xe._destroy(ze),Fe(null)})},pe.prototype._destroy=function(ze){if(ze){var Fe=this._ondrain;this._ondrain=null,Fe?Fe(ze):this.emit("error",ze)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},pe.prototype._write=function(ze,Fe,xe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,ze,Fe,xe));if(ze===ae)return this._finish(xe);if(!this._writable)return xe();this._writable.write(ze)===!1?this._ondrain=xe:this.destroyed||xe()}},pe.prototype._finish=function(ze){var Fe=this;this.emit("preend"),le(this,function(){de(Fe._forwardEnd&&Fe._writable,function(){Fe._writableState.prefinished===!1&&(Fe._writableState.prefinished=!0),Fe.emit("prefinish"),le(Fe,ze)})})},pe.prototype.end=function(ze,Fe,xe){return typeof ze=="function"?this.end(null,null,ze):typeof Fe=="function"?this.end(ze,null,Fe):(this._ended=!0,ze&&this.write(ze),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),oe.Writable.prototype.end.call(this,xe))},g.exports=pe}).call(this)}).call(this,r("_process"),r("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(r,g,k){(function(V){(function(){var $=r("once"),oe=function(){},re=function(ae){return ae.setHeader&&typeof ae.abort=="function"},Ce=function(ae){return ae.stdio&&Array.isArray(ae.stdio)&&ae.stdio.length===3},ie=function(ae,le,Ie){if(typeof le=="function")return ie(ae,null,le);le||(le={}),Ie=$(Ie||oe);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,pe=!1,ze=function(){ae.writable||Fe()},Fe=function(){he=!1,Ne||Ie.call(ae)},xe=function(){Ne=!1,he||Ie.call(ae)},_e=function(Oe){Ie.call(ae,Oe?new Error("exited with error code: "+Oe):null)},Dt=function(Oe){Ie.call(ae,Oe)},$e=function(){V.nextTick(Ue)},Ue=function(){if(!pe){if(Ne&&!(de&&de.ended&&!de.destroyed))return Ie.call(ae,new Error("premature close"));if(he&&!(ue&&ue.ended&&!ue.destroyed))return Ie.call(ae,new Error("premature close"))}},Ve=function(){ae.req.on("finish",Fe)};return re(ae)?(ae.on("complete",Fe),ae.on("abort",$e),ae.req?Ve():ae.on("request",Ve)):he&&!ue&&(ae.on("end",ze),ae.on("close",ze)),Ce(ae)&&ae.on("exit",_e),ae.on("end",xe),ae.on("finish",Fe),le.error!==!1&&ae.on("error",Dt),ae.on("close",$e),function(){pe=!0,ae.removeListener("complete",Fe),ae.removeListener("abort",$e),ae.removeListener("request",Ve),ae.req&&ae.req.removeListener("finish",Fe),ae.removeListener("end",ze),ae.removeListener("close",ze),ae.removeListener("finish",Fe),ae.removeListener("exit",_e),ae.removeListener("end",xe),ae.removeListener("error",Dt),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,k){var V=Object.create||Ve,$=Object.keys||Oe,oe=Function.prototype.bind||At;function re(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=V(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=re,re.EventEmitter=re,re.prototype._events=void 0,re.prototype._maxListeners=void 0;var Ce=10,ie;try{var ae={};Object.defineProperty&&Object.defineProperty(ae,"x",{value:0}),ie=ae.x===0}catch{ie=!1}ie?Object.defineProperty(re,"defaultMaxListeners",{enumerable:!0,get:function(){return Ce},set:function(qe){if(typeof qe!="number"||qe<0||qe!==qe)throw new TypeError('"defaultMaxListeners" must be a positive number');Ce=qe}}):re.defaultMaxListeners=Ce,re.prototype.setMaxListeners=function(Lt){if(typeof Lt!="number"||Lt<0||isNaN(Lt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=Lt,this};function le(qe){return qe._maxListeners===void 0?re.defaultMaxListeners:qe._maxListeners}re.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,Lt,kt){if(Lt)qe.call(kt);else for(var jt=qe.length,ti=$e(qe,jt),ei=0;ei<jt;++ei)ti[ei].call(kt)}function ue(qe,Lt,kt,jt){if(Lt)qe.call(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].call(kt,jt)}function de(qe,Lt,kt,jt,ti){if(Lt)qe.call(kt,jt,ti);else for(var ei=qe.length,Pt=$e(qe,ei),ni=0;ni<ei;++ni)Pt[ni].call(kt,jt,ti)}function Ne(qe,Lt,kt,jt,ti,ei){if(Lt)qe.call(kt,jt,ti,ei);else for(var Pt=qe.length,ni=$e(qe,Pt),gi=0;gi<Pt;++gi)ni[gi].call(kt,jt,ti,ei)}function he(qe,Lt,kt,jt){if(Lt)qe.apply(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].apply(kt,jt)}re.prototype.emit=function(Lt){var kt,jt,ti,ei,Pt,ni,gi=Lt==="error";if(ni=this._events,ni)gi=gi&&ni.error==null;else if(!gi)return!1;if(gi){if(arguments.length>1&&(kt=arguments[1]),kt instanceof Error)throw kt;var di=new Error('Unhandled "error" event. ('+kt+")");throw di.context=kt,di}if(jt=ni[Lt],!jt)return!1;var li=typeof jt=="function";switch(ti=arguments.length,ti){case 1:Ie(jt,li,this);break;case 2:ue(jt,li,this,arguments[1]);break;case 3:de(jt,li,this,arguments[1],arguments[2]);break;case 4:Ne(jt,li,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Pt=1;Pt<ti;Pt++)ei[Pt-1]=arguments[Pt];he(jt,li,this,ei)}return!0};function pe(qe,Lt,kt,jt){var ti,ei,Pt;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",Lt,kt.listener?kt.listener:kt),ei=qe._events),Pt=ei[Lt]):(ei=qe._events=V(null),qe._eventsCount=0),!Pt)Pt=ei[Lt]=kt,++qe._eventsCount;else if(typeof Pt=="function"?Pt=ei[Lt]=jt?[kt,Pt]:[Pt,kt]:jt?Pt.unshift(kt):Pt.push(kt),!Pt.warned&&(ti=le(qe),ti&&ti>0&&Pt.length>ti)){Pt.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Pt.length+' "'+String(Lt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=Lt,ni.count=Pt.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}re.prototype.addListener=function(Lt,kt){return pe(this,Lt,kt,!1)},re.prototype.on=re.prototype.addListener,re.prototype.prependListener=function(Lt,kt){return pe(this,Lt,kt,!0)};function ze(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var qe=new Array(arguments.length),Lt=0;Lt<qe.length;++Lt)qe[Lt]=arguments[Lt];this.listener.apply(this.target,qe)}}function Fe(qe,Lt,kt){var jt={fired:!1,wrapFn:void 0,target:qe,type:Lt,listener:kt},ti=oe.call(ze,jt);return ti.listener=kt,jt.wrapFn=ti,ti}re.prototype.once=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.on(Lt,Fe(this,Lt,kt)),this},re.prototype.prependOnceListener=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(Lt,Fe(this,Lt,kt)),this},re.prototype.removeListener=function(Lt,kt){var jt,ti,ei,Pt,ni;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(jt=ti[Lt],!jt)return this;if(jt===kt||jt.listener===kt)--this._eventsCount===0?this._events=V(null):(delete ti[Lt],ti.removeListener&&this.emit("removeListener",Lt,jt.listener||kt));else if(typeof jt!="function"){for(ei=-1,Pt=jt.length-1;Pt>=0;Pt--)if(jt[Pt]===kt||jt[Pt].listener===kt){ni=jt[Pt].listener,ei=Pt;break}if(ei<0)return this;ei===0?jt.shift():Dt(jt,ei),jt.length===1&&(ti[Lt]=jt[0]),ti.removeListener&&this.emit("removeListener",Lt,ni||kt)}return this},re.prototype.removeAllListeners=function(Lt){var kt,jt,ti;if(jt=this._events,!jt)return this;if(!jt.removeListener)return arguments.length===0?(this._events=V(null),this._eventsCount=0):jt[Lt]&&(--this._eventsCount===0?this._events=V(null):delete jt[Lt]),this;if(arguments.length===0){var ei=$(jt),Pt;for(ti=0;ti<ei.length;++ti)Pt=ei[ti],Pt!=="removeListener"&&this.removeAllListeners(Pt);return this.removeAllListeners("removeListener"),this._events=V(null),this._eventsCount=0,this}if(kt=jt[Lt],typeof kt=="function")this.removeListener(Lt,kt);else if(kt)for(ti=kt.length-1;ti>=0;ti--)this.removeListener(Lt,kt[ti]);return this};function xe(qe,Lt,kt){var jt=qe._events;if(!jt)return[];var ti=jt[Lt];return ti?typeof ti=="function"?kt?[ti.listener||ti]:[ti]:kt?Ue(ti):$e(ti,ti.length):[]}re.prototype.listeners=function(Lt){return xe(this,Lt,!0)},re.prototype.rawListeners=function(Lt){return xe(this,Lt,!1)},re.listenerCount=function(qe,Lt){return typeof qe.listenerCount=="function"?qe.listenerCount(Lt):_e.call(qe,Lt)},re.prototype.listenerCount=_e;function _e(qe){var Lt=this._events;if(Lt){var kt=Lt[qe];if(typeof kt=="function")return 1;if(kt)return kt.length}return 0}re.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Dt(qe,Lt){for(var kt=Lt,jt=kt+1,ti=qe.length;jt<ti;kt+=1,jt+=1)qe[kt]=qe[jt];qe.pop()}function $e(qe,Lt){for(var kt=new Array(Lt),jt=0;jt<Lt;++jt)kt[jt]=qe[jt];return kt}function Ue(qe){for(var Lt=new Array(qe.length),kt=0;kt<Lt.length;++kt)Lt[kt]=qe[kt].listener||qe[kt];return Lt}function Ve(qe){var Lt=function(){};return Lt.prototype=qe,new Lt}function Oe(qe){for(var Lt in qe)Object.prototype.hasOwnProperty.call(qe,Lt);return Lt}function At(qe){var Lt=this;return function(){return Lt.apply(qe,arguments)}}},{}],23:[function(r,g,k){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */k.read=function(V,$,oe,re,Ce){var ie,ae,le=Ce*8-re-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=oe?Ce-1:0,he=oe?-1:1,pe=V[$+Ne];for(Ne+=he,ie=pe&(1<<-de)-1,pe>>=-de,de+=le;de>0;ie=ie*256+V[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=re;de>0;ae=ae*256+V[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(pe?-1:1)*(1/0);ae=ae+Math.pow(2,re),ie=ie-ue}return(pe?-1:1)*ae*Math.pow(2,ie-re)},k.write=function(V,$,oe,re,Ce,ie){var ae,le,Ie,ue=ie*8-Ce-1,de=(1<<ue)-1,Ne=de>>1,he=Ce===23?Math.pow(2,-24)-Math.pow(2,-77):0,pe=re?0:ie-1,ze=re?1:-1,Fe=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(le=isNaN($)?1:0,ae=de):(ae=Math.floor(Math.log($)/Math.LN2),$*(Ie=Math.pow(2,-ae))<1&&(ae--,Ie*=2),ae+Ne>=1?$+=he/Ie:$+=he*Math.pow(2,1-Ne),$*Ie>=2&&(ae++,Ie/=2),ae+Ne>=de?(le=0,ae=de):ae+Ne>=1?(le=($*Ie-1)*Math.pow(2,Ce),ae=ae+Ne):(le=$*Math.pow(2,Ne-1)*Math.pow(2,Ce),ae=0));Ce>=8;V[oe+pe]=le&255,pe+=ze,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;V[oe+pe]=ae&255,pe+=ze,ae/=256,ue-=8);V[oe+pe-ze]|=Fe*128}},{}],24:[function(r,g,k){typeof Object.create=="function"?g.exports=function($,oe){oe&&($.super_=oe,$.prototype=Object.create(oe.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,oe){if(oe){$.super_=oe;var re=function(){};re.prototype=oe.prototype,$.prototype=new re,$.prototype.constructor=$}}},{}],25:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=function(){function $(oe,re){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=oe,this.value=re}return $.prototype.rotateLeft=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=ie:oe.rightChild===this&&(oe.rightChild=ie)),ie.parent=oe,ie.brother=re,ie.leftChild=this,ie.rightChild=le,re&&(re.brother=ie),this.parent=ie,this.brother=le,this.leftChild=Ce,this.rightChild=ae,le&&(le.parent=ie,le.brother=this),Ce&&(Ce.parent=this,Ce.brother=ae),ae&&(ae.parent=this,ae.brother=Ce),ie},$.prototype.rotateRight=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=Ce:oe.rightChild===this&&(oe.rightChild=Ce)),Ce.parent=oe,Ce.brother=re,Ce.leftChild=ae,Ce.rightChild=this,re&&(re.brother=Ce),ae&&(ae.parent=Ce,ae.brother=this),this.parent=Ce,this.brother=ae,this.leftChild=le,this.rightChild=ie,le&&(le.parent=this,le.brother=ie),ie&&(ie.parent=this,ie.brother=le),Ce},$.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},$.TreeNodeColorType={red:!0,black:!1},$}();Object.freeze(V),k.default=V},{}],26:[function(r,g,k){var V=this&&this.__generator||function(oe,re){var Ce={label:0,sent:function(){if(le[0]&1)throw le[1];return le[1]},trys:[],ops:[]},ie,ae,le,Ie;return Ie={next:ue(0),throw:ue(1),return:ue(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function ue(Ne){return function(he){return de([Ne,he])}}function de(Ne){if(ie)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(ie=1,ae&&(le=Ne[0]&2?ae.return:Ne[0]?ae.throw||((le=ae.return)&&le.call(ae),0):ae.next)&&!(le=le.call(ae,Ne[1])).done)return le;switch(ae=0,le&&(Ne=[Ne[0]&2,le.value]),Ne[0]){case 0:case 1:le=Ne;break;case 4:return Ce.label++,{value:Ne[1],done:!1};case 5:Ce.label++,ae=Ne[1],Ne=[0];continue;case 7:Ne=Ce.ops.pop(),Ce.trys.pop();continue;default:if(le=Ce.trys,!(le=le.length>0&&le[le.length-1])&&(Ne[0]===6||Ne[0]===2)){Ce=0;continue}if(Ne[0]===3&&(!le||Ne[1]>le[0]&&Ne[1]<le[3])){Ce.label=Ne[1];break}if(Ne[0]===6&&Ce.label<le[1]){Ce.label=le[1],le=Ne;break}if(le&&Ce.label<le[2]){Ce.label=le[2],Ce.ops.push(Ne);break}le[2]&&Ce.ops.pop(),Ce.trys.pop();continue}Ne=re.call(oe,Ce)}catch(he){Ne=[6,he],ae=0}finally{ie=le=0}if(Ne[0]&5)throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(oe){var re=this;oe===void 0&&(oe=[]);var Ce=[],ie=0,ae=0,le=0,Ie=0,ue=0,de=0;this.size=function(){return de},this.empty=function(){return de===0},this.clear=function(){ie=le=ae=Ie=ue=de=0,he.call(this,$.bucketSize),de=0},this.front=function(){return Ce[ie][ae]},this.back=function(){return Ce[le][Ie]},this.forEach=function(pe){if(!this.empty()){var ze=0;if(ie===le){for(var Fe=ae;Fe<=Ie;++Fe)pe(Ce[ie][Fe],ze++);return}for(var Fe=ae;Fe<$.bucketSize;++Fe)pe(Ce[ie][Fe],ze++);for(var Fe=ie+1;Fe<le;++Fe)for(var xe=0;xe<$.bucketSize;++xe)pe(Ce[Fe][xe],ze++);for(var Fe=0;Fe<=Ie;++Fe)pe(Ce[le][Fe],ze++)}};var Ne=function(pe){var ze=ie*$.bucketSize+ae,Fe=ze+pe,xe=le*$.bucketSize+Ie;if(Fe<ze||Fe>xe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Fe/$.bucketSize),Dt=Fe%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:Dt}};this.getElementByPos=function(pe){var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;return Ce[Fe][xe]},this.eraseElementByPos=function(pe){var ze=this;if(pe<0||pe>de)throw new Error("pos should more than 0 and less than queue's size");if(pe===0)this.popFront();else if(pe===this.size())this.popBack();else{for(var Fe=[],xe=pe+1;xe<de;++xe)Fe.push(this.getElementByPos(xe));this.cut(pe),this.popBack(),Fe.forEach(function(_e){return ze.pushBack(_e)})}},this.eraseElementByValue=function(pe){if(!this.empty()){var ze=[];this.forEach(function(_e){_e!==pe&&ze.push(_e)});for(var Fe=ze.length,xe=0;xe<Fe;++xe)this.setElementByPos(xe,ze[xe]);this.cut(Fe-1)}};var he=function(pe){for(var ze=[],Fe=pe*$.sigma,xe=Math.max(Math.ceil(Fe/$.bucketSize),2),_e=0;_e<xe;++_e)ze.push(new Array($.bucketSize));var Dt=Math.ceil(pe/$.bucketSize),$e=Math.floor(xe/2)-Math.floor(Dt/2),Ue=$e,Ve=0;if(this.size())for(var _e=0;_e<Dt;++_e){for(var Oe=0;Oe<$.bucketSize;++Oe)if(ze[$e+_e][Oe]=this.front(),this.popFront(),this.empty()){Ue=$e+_e,Ve=Oe;break}if(this.empty())break}Ce=ze,ie=$e,ae=0,le=Ue,Ie=Ve,ue=xe,de=pe};this.pushBack=function(pe){this.empty()||(le===ue-1&&Ie===$.bucketSize-1&&he.call(this,this.size()),Ie<$.bucketSize-1?++Ie:le<ue-1&&(++le,Ie=0)),++de,Ce[le][Ie]=pe},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(pe,ze){var Fe=Ne(pe),xe=Fe.curNodeBucketIndex,_e=Fe.curNodePointerIndex;Ce[xe][_e]=ze},this.insert=function(pe,ze,Fe){var xe=this;if(Fe===void 0&&(Fe=1),pe===0)for(;Fe--;)this.pushFront(ze);else if(pe===this.size())for(;Fe--;)this.pushBack(ze);else{for(var _e=[],Dt=pe;Dt<de;++Dt)_e.push(this.getElementByPos(Dt));this.cut(pe-1);for(var Dt=0;Dt<Fe;++Dt)this.pushBack(ze);_e.forEach(function($e){return xe.pushBack($e)})}},this.find=function(pe){if(ie===le){for(var ze=ae;ze<=Ie;++ze)if(Ce[ie][ze]===pe)return!0;return!1}for(var ze=ae;ze<$.bucketSize;++ze)if(Ce[ie][ze]===pe)return!0;for(var ze=ie+1;ze<le;++ze)for(var Fe=0;Fe<$.bucketSize;++Fe)if(Ce[ze][Fe]===pe)return!0;for(var ze=0;ze<=Ie;++ze)if(Ce[le][ze]===pe)return!0;return!1},this.reverse=function(){for(var pe=0,ze=de-1;pe<ze;){var Fe=this.getElementByPos(pe);this.setElementByPos(pe,this.getElementByPos(ze)),this.setElementByPos(ze,Fe),++pe,--ze}},this.unique=function(){if(!this.empty()){var pe=[],ze=this.front();this.forEach(function(xe,_e){(_e===0||xe!==ze)&&(pe.push(xe),ze=xe)});for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,pe[Fe]);this.cut(pe.length-1)}},this.sort=function(pe){var ze=[];this.forEach(function(xe){ze.push(xe)}),ze.sort(pe);for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,ze[Fe])},this.pushFront=function(pe){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=pe},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var pe=this,ze=[];this.forEach(function(Dt){ze.push(Dt)});var Fe=ze.length;Ce=[];for(var xe=Math.ceil(Fe/$.bucketSize),_e=0;_e<xe;++_e)Ce.push(new Array($.bucketSize));this.clear(),ze.forEach(function(Dt){return pe.pushBack(Dt)})},this.cut=function(pe){if(pe<0){this.clear();return}var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;le=Fe,Ie=xe,de=pe+1},this[Symbol.iterator]=function(){return function(){var ze,ze,ze,pe,ze;return V(this,function(Fe){switch(Fe.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];ze=ae,Fe.label=1;case 1:return ze<=Ie?[4,Ce[ie][ze]]:[3,4];case 2:Fe.sent(),Fe.label=3;case 3:return++ze,[3,1];case 4:return[2];case 5:ze=ae,Fe.label=6;case 6:return ze<$.bucketSize?[4,Ce[ie][ze]]:[3,9];case 7:Fe.sent(),Fe.label=8;case 8:return++ze,[3,6];case 9:ze=ie+1,Fe.label=10;case 10:if(!(ze<le))return[3,15];pe=0,Fe.label=11;case 11:return pe<$.bucketSize?[4,Ce[ze][pe]]:[3,14];case 12:Fe.sent(),Fe.label=13;case 13:return++pe,[3,11];case 14:return++ze,[3,10];case 15:ze=0,Fe.label=16;case 16:return ze<=Ie?[4,Ce[le][ze]]:[3,19];case 17:Fe.sent(),Fe.label=18;case 18:return++ze,[3,16];case 19:return[2]}})}()},function(){var pe=$.bucketSize;oe.size?pe=oe.size():oe.length&&(pe=oe.length);var ze=pe*$.sigma;ue=Math.ceil(ze/$.bucketSize),ue=Math.max(ue,3);for(var Fe=0;Fe<ue;++Fe)Ce.push(new Array($.bucketSize));var xe=Math.ceil(pe/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(xe/2),le=ie,oe.forEach(function(_e){return re.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),k.default=$},{}],27:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../LinkList/LinkList"),re=r("../Map/Map");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze,Fe,xe=0,_e="";if(typeof pe=="number")xe=Math.floor(pe),xe=(xe<<5)-xe,xe=xe&xe;else{typeof pe!="string"?_e=JSON.stringify(pe):_e=pe;try{for(var Dt=$(_e),$e=Dt.next();!$e.done;$e=Dt.next()){var Ue=$e.value,Ve=Ue.charCodeAt(0);xe=(xe<<5)-xe+Ve,xe=xe&xe}}catch(Oe){ze={error:Oe}}finally{try{$e&&!$e.done&&(Fe=Dt.return)&&Fe.call(Dt)}finally{if(ze)throw ze.error}}}return xe^=xe>>>16,xe},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof oe.default&&Fe.size()===1){var _e=Fe.front(),Dt=_e.key,$e=_e.value;ze[le(Dt)&Ne-1]=new oe.default([{key:Dt,value:$e}])}else if(Fe instanceof re.default){var Ue=new oe.default,Ve=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?Ve.pushBack(qe):Ue.pushBack(qe)}),Ue.size()>Ce.untreeifyThreshold?ze[xe]=new re.default(Ue):Ue.size()&&(ze[xe]=Ue),Ve.size()>Ce.untreeifyThreshold?ze[xe+pe]=new re.default(Ve):Ve.size()&&(ze[xe+pe]=Ve)}else{var Oe=new oe.default,At=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?At.pushBack(qe):Oe.pushBack(qe)}),Oe.size()&&(ze[xe]=Oe),At.size()&&(ze[xe+pe]=At)}de[xe].clear()}}),de=ze}};this.setElement=function(pe,ze){var Fe,xe;if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(ze==null){this.eraseElementByKey(pe);return}var _e=le(pe)&Ne-1;if(!de[_e])++ue,de[_e]=new oe.default([{key:pe,value:ze}]);else{var Dt=de[_e].size();if(de[_e]instanceof oe.default){try{for(var $e=$(de[_e]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(Ve.key===pe){Ve.value=ze;return}}}catch(At){Fe={error:At}}finally{try{Ue&&!Ue.done&&(xe=$e.return)&&xe.call($e)}finally{if(Fe)throw Fe.error}}de[_e].pushBack({key:pe,value:ze}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new re.default(de[_e]))}else de[_e].setElement(pe,ze);var Oe=de[_e].size();ue+=Oe-Dt}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){if(de[xe]instanceof re.default)return de[xe].getElementByKey(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return $e.value}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}}},this.eraseElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){var _e=de[xe].size();if(de[xe]instanceof re.default)de[xe].eraseElementByKey(pe),de[xe].size()<=Ce.untreeifyThreshold&&(de[xe]=new oe.default(de[xe]));else{var Dt=-1;try{for(var $e=$(de[xe]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(++Dt,Ve.key===pe){de[xe].eraseElementByPos(Dt);break}}}catch(At){ze={error:At}}finally{try{Ue&&!Ue.done&&(Fe=$e.return)&&Fe.call($e)}finally{if(ze)throw ze.error}}}var Oe=de[xe].size();ue+=Oe-_e}},this.find=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(!de[xe])return!1;if(de[xe]instanceof re.default)return de[xe].find(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return!0}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}return!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){var ze=pe.key,Fe=pe.value;return Ie.setElement(ze,Fe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Set/Set"),re=r("../LinkList/LinkList");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze=0,Fe="";if(typeof pe=="number")ze=Math.floor(pe),ze=(ze<<5)-ze,ze=ze&ze;else{typeof pe!="string"?Fe=JSON.stringify(pe):Fe=pe;for(var xe=0;xe<Fe.length;xe++){var _e=Fe.charCodeAt(xe);ze=(ze<<5)-ze+_e,ze=ze&ze}}return ze^=ze>>>16,ze},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof re.default&&Fe.size()===1){var _e=Fe.front();if(_e===void 0)throw new Error("unknown error");ze[le(_e)&Ne-1]=new re.default([_e])}else if(Fe instanceof oe.default){var Dt=new re.default,$e=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?$e.pushBack(Oe):Dt.pushBack(Oe)}),Dt.size()>Ce.untreeifyThreshold?ze[xe]=new oe.default(Dt):Dt.size()&&(ze[xe]=Dt),$e.size()>Ce.untreeifyThreshold?ze[xe+pe]=new oe.default($e):$e.size()&&(ze[xe+pe]=$e)}else{var Ue=new re.default,Ve=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?Ve.pushBack(Oe):Ue.pushBack(Oe)}),Ue.size()&&(ze[xe]=Ue),Ve.size()&&(ze[xe+pe]=Ve)}de[xe].clear()}}),de=ze}};this.insert=function(pe){if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var ze=le(pe)&Ne-1;if(!de[ze])de[ze]=new re.default([pe]),++ue;else{var Fe=de[ze].size();if(de[ze]instanceof re.default){if(de[ze].find(pe))return;de[ze].pushBack(pe),de[ze].size()>=Ce.treeifyThreshold&&(de[ze]=new oe.default(de[ze]))}else de[ze].insert(pe);var xe=de[ze].size();ue+=xe-Fe}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(pe){var ze=le(pe)&Ne-1;if(de[ze]){var Fe=de[ze].size();de[ze].eraseElementByValue(pe),de[ze]instanceof oe.default&&de[ze].size()<=Ce.untreeifyThreshold&&(de[ze]=new re.default(de[ze]));var xe=de[ze].size();ue+=xe-Fe}},this.find=function(pe){var ze=le(pe)&Ne-1;return de[ze]?de[ze].find(pe):!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){return Ie.insert(pe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,k){var V=this&&this.__generator||function(re,Ce){var ie={label:0,sent:function(){if(Ie[0]&1)throw Ie[1];return Ie[1]},trys:[],ops:[]},ae,le,Ie,ue;return ue={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ue[Symbol.iterator]=function(){return this}),ue;function de(he){return function(pe){return Ne([he,pe])}}function Ne(he){if(ae)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ae=1,le&&(Ie=he[0]&2?le.return:he[0]?le.throw||((Ie=le.return)&&Ie.call(le),0):le.next)&&!(Ie=Ie.call(le,he[1])).done)return Ie;switch(le=0,Ie&&(he=[he[0]&2,Ie.value]),he[0]){case 0:case 1:Ie=he;break;case 4:return ie.label++,{value:he[1],done:!1};case 5:ie.label++,le=he[1],he=[0];continue;case 7:he=ie.ops.pop(),ie.trys.pop();continue;default:if(Ie=ie.trys,!(Ie=Ie.length>0&&Ie[Ie.length-1])&&(he[0]===6||he[0]===2)){ie=0;continue}if(he[0]===3&&(!Ie||he[1]>Ie[0]&&he[1]<Ie[3])){ie.label=he[1];break}if(he[0]===6&&ie.label<Ie[1]){ie.label=Ie[1],Ie=he;break}if(Ie&&ie.label<Ie[2]){ie.label=Ie[2],ie.ops.push(he);break}Ie[2]&&ie.ops.pop(),ie.trys.pop();continue}he=Ce.call(re,ie)}catch(pe){he=[6,pe],le=0}finally{ae=Ie=0}if(he[0]&5)throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0});var $=function(){function re(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return re}();function oe(re){var Ce=this;re===void 0&&(re=[]);var ie=0,ae=void 0,le=void 0;this.size=function(){return ie},this.empty=function(){return ie===0},this.clear=function(){ae=le=void 0,ie=0},this.front=function(){return ae==null?void 0:ae.value},this.back=function(){return le==null?void 0:le.value},this.forEach=function(Ie){for(var ue=ae,de=0;ue;){if(ue.value===void 0)throw new Error("unknown error");Ie(ue.value,de++),ue=ue.next}},this.getElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var ue=ae;Ie--&&ue;)ue=ue.next;if(!ue||ue.value===void 0)throw new Error("unknown error");return ue.value},this.eraseElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("erase pos must more then 0 and less then the list length");if(Ie===0)this.popFront();else if(Ie===ie-1)this.popBack();else{for(var ue=ae;Ie--;){if(!(ue!=null&&ue.next))throw new Error("unknown error");ue=ue.next}if(!ue||!ue.pre||!ue.next)throw new Error("unknown error");var de=ue.pre,Ne=ue.next;Ne.pre=de,de.next=Ne,ie>0&&--ie}},this.eraseElementByValue=function(Ie){for(;ae&&ae.value===Ie;)this.popFront();for(;le&&le.value===Ie;)this.popBack();if(ae)for(var ue=ae;ue;){if(ue.value===Ie){var de=ue.pre,Ne=ue.next;Ne&&(Ne.pre=de),de&&(de.next=Ne),ie>0&&--ie}ue=ue.next}},this.pushBack=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);le?(le.next=ue,ue.pre=le,le=ue):ae=le=ue},this.popBack=function(){le&&(ie>0&&--ie,le&&(ae===le?ae=le=void 0:(le=le.pre,le&&(le.next=void 0))))},this.setElementByPos=function(Ie,ue){if(ue==null)throw new Error("you can't set null or undefined here");if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var de=ae;Ie--;){if(!de)throw new Error("unknown error");de=de.next}de&&(de.value=ue)},this.insert=function(Ie,ue,de){if(de===void 0&&(de=1),ue==null)throw new Error("you can't insert null or undefined here");if(Ie<0||Ie>ie)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(de<0)throw new Error("insert size must more than 0");if(Ie===0)for(;de--;)this.pushFront(ue);else if(Ie===ie)for(;de--;)this.pushBack(ue);else{for(var Ne=ae,he=1;he<Ie;++he){if(!(Ne!=null&&Ne.next))throw new Error("unknown error");Ne=Ne==null?void 0:Ne.next}if(!Ne)throw new Error("unknown error");var pe=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=pe,pe&&(pe.pre=Ne)}},this.find=function(Ie){for(var ue=ae;ue;){if(ue.value===Ie)return!0;ue=ue.next}return!1},this.reverse=function(){for(var Ie=ae,ue=le,de=0;Ie&&ue&&de*2<ie;){var Ne=Ie.value;Ie.value=ue.value,ue.value=Ne,Ie=Ie.next,ue=ue.pre,++de}},this.unique=function(){for(var Ie=ae;Ie;){for(var ue=Ie;ue&&ue.next&&ue.value===ue.next.value;)ue=ue.next,ie>0&&--ie;Ie.next=ue.next,Ie.next&&(Ie.next.pre=Ie),Ie=Ie.next}},this.sort=function(Ie){var ue=[];this.forEach(function(Ne){ue.push(Ne)}),ue.sort(Ie);var de=ae;ue.forEach(function(Ne){de&&(de.value=Ne,de=de.next)})},this.pushFront=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);ae?(ue.next=ae,ae.pre=ue,ae=ue):ae=le=ue},this.popFront=function(){ae&&(ie>0&&--ie,ae&&(ae===le?ae=le=void 0:(ae=ae.next,ae&&(ae.pre=void 0))))},this.merge=function(Ie){var ue=this,de=ae;Ie.forEach(function(Ne){for(;de&&de.value!==void 0&&de.value<=Ne;)de=de.next;if(de===void 0)ue.pushBack(Ne),de=le;else if(de===ae)ue.pushFront(Ne),de=ae;else{++ie;var he=de.pre;he&&(he.next=new $(Ne),he.next.pre=he,he.next.next=de,de&&(de.pre=he.next))}})},this[Symbol.iterator]=function(){return function(){var Ie;return V(this,function(ue){switch(ue.label){case 0:Ie=ae,ue.label=1;case 1:if(Ie===void 0)return[3,3];if(!Ie.value)throw new Error("unknown error");return[4,Ie.value];case 2:return ue.sent(),Ie=Ie.next,[3,1];case 3:return[2]}})}()},re.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(oe),k.default=oe},{}],30:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=Ie.value=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=void 0};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.back=function(){if(!this.empty()){var Oe=de(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown Error")};var Ne=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe<0?Ne(Oe.rightChild,At):Ne(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.lowerBound=function(Oe){return Ne(Ie,Oe)};var he=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe<=0?he(Oe.rightChild,At):he(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.upperBound=function(Oe){return he(Ie,Oe)};var pe=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe>0?pe(Oe.leftChild,At):pe(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseLowerBound=function(Oe){return pe(Ie,Oe)};var ze=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe>=0?ze(Oe.leftChild,At):ze(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseUpperBound=function(Oe){return ze(Ie,Oe)};var Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}},xe=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}}Fe(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},_e=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=_e(Oe.leftChild,At);return qe||At(Oe)?!0:_e(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;_e(Ie,function(qe){return Oe===At?(xe(qe),!0):(++At,!1)})},this.eraseElementByKey=function(Oe){if(!this.empty()){var At=Ue(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||xe(At)}};var Dt=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?Dt(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?Dt(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},$e=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,$e(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),$e(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),$e(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.setElement=function(Oe,At){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(At==null){this.eraseElementByKey(Oe);return}if(this.empty()){++le,Ie.key=Oe,Ie.value=At,Ie.color=oe.default.TreeNodeColorType.black;return}var qe=Dt(Ie,Oe);if(qe.key!==void 0&&ie(qe.key,Oe)===0){qe.value=At;return}++le,qe.key=Oe,qe.value=At,$e(qe),Ie.color=oe.default.TreeNodeColorType.black};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?Ue(Oe.leftChild,At):qe>0?Ue(Oe.rightChild,At):Oe}};this.find=function(Oe){return!!Ue(Ie,Oe)},this.getElementByKey=function(Oe){var At=Ue(Ie,Oe);if((At==null?void 0:At.key)===void 0||(At==null?void 0:At.value)===void 0)throw new Error("unknown error");return At.value},this.union=function(Oe){var At=this;Oe.forEach(function(qe){var Lt=qe.key,kt=qe.value;return At.setElement(Lt,kt)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0||Oe.value===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,{key:Oe.key,value:Oe.value}];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){var At=Oe.key,qe=Oe.value;return ae.setElement(At,qe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],31:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($,oe){$===void 0&&($=[]),oe=oe||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var re=[];$.forEach(function(le){return re.push(le)});var Ce=re.length,ie=function(le,Ie){if(le<0||le>=Ce)throw new Error("unknown error");if(Ie<0||Ie>=Ce)throw new Error("unknown error");var ue=re[le];re[le]=re[Ie],re[Ie]=ue},ae=function(le){if(le<0||le>=Ce)throw new Error("unknown error");var Ie=le*2+1,ue=le*2+2;Ie<Ce&&oe(re[le],re[Ie])>0&&ie(le,Ie),ue<Ce&&oe(re[le],re[ue])>0&&ie(le,ue)};(function(){for(var le=Math.floor((Ce-1)/2);le>=0;--le)for(var Ie=le,ue=Ie*2+1;ue<Ce;){var de=ue,Ne=de+1,he=de;if(Ne<Ce&&oe(re[de],re[Ne])>0&&(he=Ne),oe(re[Ie],re[he])<=0)break;ie(Ie,he),Ie=he,ue=Ie*2+1}})(),this.size=function(){return Ce},this.empty=function(){return Ce===0},this.clear=function(){Ce=0,re.length=0},this.push=function(le){if(re.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(oe(re[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=re[Ce-1];--Ce;for(var Ie=0;Ie<this.size();){var ue=Ie*2+1,de=Ie*2+2;if(ue>=this.size())break;var Ne=ue;if(de<this.size()&&oe(re[ue],re[de])>0&&(Ne=de),oe(re[Ne],le)>=0)break;re[Ie]=re[Ne],Ie=Ne}re[Ie]=le}},this.top=function(){return re[0]},Object.freeze(this)}Object.freeze(V),k.default=V},{}],32:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=r("../LinkList/LinkList");function $(oe){oe===void 0&&(oe=[]);var re=new V.default(oe);this.size=function(){return re.size()},this.empty=function(){return re.empty()},this.clear=function(){re.clear()},this.push=function(Ce){re.pushBack(Ce)},this.pop=function(){re.popFront()},this.front=function(){return re.front()},Object.freeze(this)}Object.freeze($),k.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=Ie.parent=void 0,Ie.color=oe.default.TreeNodeColorType.black};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);return Oe.key}},this.back=function(){if(!this.empty()){var Oe=de(Ie);return Oe.key}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown error")};var Ne=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}},he=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}}Ne(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},pe=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=pe(Oe.leftChild,At);return qe||At(Oe)?!0:pe(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;pe(Ie,function(qe){return Oe===At?(he(qe),!0):(++At,!1)})},this.eraseElementByValue=function(Oe){if(!this.empty()){var At=xe(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||he(At)}};var ze=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?ze(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?ze(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,Fe(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),Fe(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),Fe(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.insert=function(Oe){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty()){++le,Ie.key=Oe,Ie.color=oe.default.TreeNodeColorType.black;return}var At=ze(Ie,Oe);At.key!==void 0&&ie(At.key,Oe)===0||(++le,At.key=Oe,Fe(At),Ie.color=oe.default.TreeNodeColorType.black)};var xe=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?xe(Oe.leftChild,At):qe>0?xe(Oe.rightChild,At):Oe}};this.find=function(Oe){var At=xe(Ie,Oe);return At!==void 0&&At.key!==void 0&&ie(At.key,Oe)===0};var _e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe<0)return _e(Oe.rightChild,At);var Lt=_e(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.lowerBound=function(Oe){return _e(Ie,Oe)};var Dt=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe<=0)return Dt(Oe.rightChild,At);var Lt=Dt(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.upperBound=function(Oe){return Dt(Ie,Oe)};var $e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe>0)return $e(Oe.leftChild,At);var Lt=$e(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseLowerBound=function(Oe){return $e(Ie,Oe)};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe>=0)return Ue(Oe.leftChild,At);var Lt=Ue(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseUpperBound=function(Oe){return Ue(Ie,Oe)},this.union=function(Oe){var At=this;Oe.forEach(function(qe){return At.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,Oe.key];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){return ae.insert(Oe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],34:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($){var oe=this;$===void 0&&($=[]);var re=0,Ce=[];this.size=function(){return re},this.empty=function(){return re===0},this.clear=function(){re=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++re},this.pop=function(){Ce.pop(),re>0&&--re},this.top=function(){return Ce[re-1]},$.forEach(function(ie){return oe.push(ie)}),Object.freeze(this)}Object.freeze(V),k.default=V},{}],35:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__read||function(ie,ae){var le=typeof Symbol=="function"&&ie[Symbol.iterator];if(!le)return ie;var Ie=le.call(ie),ue,de=[],Ne;try{for(;(ae===void 0||ae-- >0)&&!(ue=Ie.next()).done;)de.push(ue.value)}catch(he){Ne={error:he}}finally{try{ue&&!ue.done&&(le=Ie.return)&&le.call(Ie)}finally{if(Ne)throw Ne.error}}return de},oe=this&&this.__spreadArray||function(ie,ae,le){if(le||arguments.length===2)for(var Ie=0,ue=ae.length,de;Ie<ue;Ie++)(de||!(Ie in ae))&&(de||(de=Array.prototype.slice.call(ae,0,Ie)),de[Ie]=ae[Ie]);return ie.concat(de||Array.prototype.slice.call(ae))},re=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});function Ce(ie){var ae=this;ie===void 0&&(ie=[]);var le=0,Ie=[];this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.length=0},this.front=function(){if(!this.empty())return Ie[0]},this.back=function(){if(!this.empty())return Ie[le-1]},this.forEach=function(ue){Ie.forEach(ue)},this.getElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");return Ie[ue]},this.eraseElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");for(var de=ue;de<le-1;++de)Ie[de]=Ie[de+1];this.popBack()},this.eraseElementByValue=function(ue){var de=[];this.forEach(function(he){he!==ue&&de.push(he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.pushBack=function(ue){Ie.push(ue),++le},this.popBack=function(){Ie.pop(),le>0&&--le},this.setElementByPos=function(ue,de){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");Ie[ue]=de},this.insert=function(ue,de,Ne){if(Ne===void 0&&(Ne=1),ue<0||ue>le)throw new Error("pos must more than 0 and less than or equal to vector's size");Ie.splice.apply(Ie,oe([ue,0],$(new Array(Ne).fill(de)),!1)),le+=Ne},this.find=function(ue){return Ie.includes(ue)},this.reverse=function(){Ie.reverse()},this.unique=function(){var ue,de=[];this.forEach(function(he,pe){(pe===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return V(this,function(ue){switch(ue.label){case 0:return[5,re(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{}],36:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0}),k.HashMap=k.HashSet=k.Map=k.Set=k.PriorityQueue=k.Deque=k.LinkList=k.Queue=k.Stack=k.Vector=void 0;var V=r("./Vector/Vector");k.Vector=V.default;var $=r("./Stack/Stack");k.Stack=$.default;var oe=r("./Queue/Queue");k.Queue=oe.default;var re=r("./LinkList/LinkList");k.LinkList=re.default;var Ce=r("./Deque/Deque");k.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");k.PriorityQueue=ie.default;var ae=r("./Set/Set");k.Set=ae.default;var le=r("./Map/Map");k.Map=le.default;var Ie=r("./HashSet/HashSet");k.HashSet=Ie.default;var ue=r("./HashMap/HashMap");k.HashMap=ue.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(r,g,k){const V=r("yallist"),$=Symbol("max"),oe=Symbol("length"),re=Symbol("lengthCalculator"),Ce=Symbol("allowStale"),ie=Symbol("maxAge"),ae=Symbol("dispose"),le=Symbol("noDisposeOnSet"),Ie=Symbol("lruList"),ue=Symbol("cache"),de=Symbol("updateAgeOnGet"),Ne=()=>1;class he{constructor(Ue){if(typeof Ue=="number"&&(Ue={max:Ue}),Ue||(Ue={}),Ue.max&&(typeof Ue.max!="number"||Ue.max<0))throw new TypeError("max must be a non-negative number");this[$]=Ue.max||1/0;const Ve=Ue.length||Ne;if(this[re]=typeof Ve!="function"?Ne:Ve,this[Ce]=Ue.stale||!1,Ue.maxAge&&typeof Ue.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Ue.maxAge||0,this[ae]=Ue.dispose,this[le]=Ue.noDisposeOnSet||!1,this[de]=Ue.updateAgeOnGet||!1,this.reset()}set max(Ue){if(typeof Ue!="number"||Ue<0)throw new TypeError("max must be a non-negative number");this[$]=Ue||1/0,Fe(this)}get max(){return this[$]}set allowStale(Ue){this[Ce]=!!Ue}get allowStale(){return this[Ce]}set maxAge(Ue){if(typeof Ue!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Ue,Fe(this)}get maxAge(){return this[ie]}set lengthCalculator(Ue){typeof Ue!="function"&&(Ue=Ne),Ue!==this[re]&&(this[re]=Ue,this[oe]=0,this[Ie].forEach(Ve=>{Ve.length=this[re](Ve.value,Ve.key),this[oe]+=Ve.length})),Fe(this)}get lengthCalculator(){return this[re]}get length(){return this[oe]}get itemCount(){return this[Ie].length}rforEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].tail;Oe!==null;){const At=Oe.prev;Dt(this,Ue,Oe,Ve),Oe=At}}forEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].head;Oe!==null;){const At=Oe.next;Dt(this,Ue,Oe,Ve),Oe=At}}keys(){return this[Ie].toArray().map(Ue=>Ue.key)}values(){return this[Ie].toArray().map(Ue=>Ue.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Ue=>this[ae](Ue.key,Ue.value)),this[ue]=new Map,this[Ie]=new V,this[oe]=0}dump(){return this[Ie].map(Ue=>ze(this,Ue)?!1:{k:Ue.key,v:Ue.value,e:Ue.now+(Ue.maxAge||0)}).toArray().filter(Ue=>Ue)}dumpLru(){return this[Ie]}set(Ue,Ve,Oe){if(Oe=Oe||this[ie],Oe&&typeof Oe!="number")throw new TypeError("maxAge must be a number");const At=Oe?Date.now():0,qe=this[re](Ve,Ue);if(this[ue].has(Ue)){if(qe>this[$])return xe(this,this[ue].get(Ue)),!1;const jt=this[ue].get(Ue).value;return this[ae]&&(this[le]||this[ae](Ue,jt.value)),jt.now=At,jt.maxAge=Oe,jt.value=Ve,this[oe]+=qe-jt.length,jt.length=qe,this.get(Ue),Fe(this),!0}const Lt=new _e(Ue,Ve,qe,At,Oe);return Lt.length>this[$]?(this[ae]&&this[ae](Ue,Ve),!1):(this[oe]+=Lt.length,this[Ie].unshift(Lt),this[ue].set(Ue,this[Ie].head),Fe(this),!0)}has(Ue){if(!this[ue].has(Ue))return!1;const Ve=this[ue].get(Ue).value;return!ze(this,Ve)}get(Ue){return pe(this,Ue,!0)}peek(Ue){return pe(this,Ue,!1)}pop(){const Ue=this[Ie].tail;return Ue?(xe(this,Ue),Ue.value):null}del(Ue){xe(this,this[ue].get(Ue))}load(Ue){this.reset();const Ve=Date.now();for(let Oe=Ue.length-1;Oe>=0;Oe--){const At=Ue[Oe],qe=At.e||0;if(qe===0)this.set(At.k,At.v);else{const Lt=qe-Ve;Lt>0&&this.set(At.k,At.v,Lt)}}}prune(){this[ue].forEach((Ue,Ve)=>pe(this,Ve,!1))}}const pe=($e,Ue,Ve)=>{const Oe=$e[ue].get(Ue);if(Oe){const At=Oe.value;if(ze($e,At)){if(xe($e,Oe),!$e[Ce])return}else Ve&&($e[de]&&(Oe.value.now=Date.now()),$e[Ie].unshiftNode(Oe));return At.value}},ze=($e,Ue)=>{if(!Ue||!Ue.maxAge&&!$e[ie])return!1;const Ve=Date.now()-Ue.now;return Ue.maxAge?Ve>Ue.maxAge:$e[ie]&&Ve>$e[ie]},Fe=$e=>{if($e[oe]>$e[$])for(let Ue=$e[Ie].tail;$e[oe]>$e[$]&&Ue!==null;){const Ve=Ue.prev;xe($e,Ue),Ue=Ve}},xe=($e,Ue)=>{if(Ue){const Ve=Ue.value;$e[ae]&&$e[ae](Ve.key,Ve.value),$e[oe]-=Ve.length,$e[ue].delete(Ve.key),$e[Ie].removeNode(Ue)}};class _e{constructor(Ue,Ve,Oe,At,qe){this.key=Ue,this.value=Ve,this.length=Oe,this.now=At,this.maxAge=qe||0}}const Dt=($e,Ue,Ve,Oe)=>{let At=Ve.value;ze($e,At)&&(xe($e,Ve),$e[Ce]||(At=void 0)),At&&Ue.call(Oe,At.value,At.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,k){(function(V){(function(){const $=g.exports;$.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},$.codes={};for(const re in $.types){const Ce=$.types[re];$.codes[Ce]=re}$.CMD_SHIFT=4,$.CMD_MASK=240,$.DUP_MASK=8,$.QOS_MASK=3,$.QOS_SHIFT=1,$.RETAIN_MASK=1,$.VARBYTEINT_MASK=127,$.VARBYTEINT_FIN_MASK=128,$.VARBYTEINT_MAX=268435455,$.SESSIONPRESENT_MASK=1,$.SESSIONPRESENT_HEADER=V.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=V.from([$.codes.connack<<$.CMD_SHIFT]),$.USERNAME_MASK=128,$.PASSWORD_MASK=64,$.WILL_RETAIN_MASK=32,$.WILL_QOS_MASK=24,$.WILL_QOS_SHIFT=3,$.WILL_FLAG_MASK=4,$.CLEAN_SESSION_MASK=2,$.CONNECT_HEADER=V.from([$.codes.connect<<$.CMD_SHIFT]),$.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},$.propertiesCodes={};for(const re in $.properties){const Ce=$.properties[re];$.propertiesCodes[Ce]=re}$.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function oe(re){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=V.alloc(1);return le.writeUInt8($.codes[re]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=oe("publish"),$.SUBSCRIBE_HEADER=oe("subscribe"),$.SUBSCRIBE_OPTIONS_QOS_MASK=3,$.SUBSCRIBE_OPTIONS_NL_MASK=1,$.SUBSCRIBE_OPTIONS_NL_SHIFT=2,$.SUBSCRIBE_OPTIONS_RAP_MASK=1,$.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,$.SUBSCRIBE_OPTIONS_RH_MASK=3,$.SUBSCRIBE_OPTIONS_RH_SHIFT=4,$.SUBSCRIBE_OPTIONS_RH=[0,16,32],$.SUBSCRIBE_OPTIONS_NL=4,$.SUBSCRIBE_OPTIONS_RAP=8,$.SUBSCRIBE_OPTIONS_QOS=[0,1,2],$.UNSUBSCRIBE_HEADER=oe("unsubscribe"),$.ACKS={unsuback:oe("unsuback"),puback:oe("puback"),pubcomp:oe("pubcomp"),pubrel:oe("pubrel"),pubrec:oe("pubrec")},$.SUBACK_HEADER=V.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=V.from([3]),$.VERSION4=V.from([4]),$.VERSION5=V.from([5]),$.VERSION131=V.from([131]),$.VERSION132=V.from([132]),$.QOS=[0,1,2].map(re=>V.from([re])),$.EMPTY={pingreq:V.from([$.codes.pingreq<<4,0]),pingresp:V.from([$.codes.pingresp<<4,0]),disconnect:V.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,k){(function(V){(function(){const $=r("./writeToStream"),oe=r("events");function re(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends oe{constructor(){super(),this._array=new Array(20),this._i=0}write(ae){return this._array[this._i++]=ae,!0}concat(){let ae=0;const le=new Array(this._array.length),Ie=this._array;let ue=0,de;for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?le[de]=Ie[de].length:le[de]=V.byteLength(Ie[de]),ae+=le[de];const Ne=V.allocUnsafe(ae);for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?(Ie[de].copy(Ne,ue),ue+=le[de]):(Ne.write(Ie[de],ue),ue+=le[de]);return Ne}}g.exports=re}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,k){k.parser=r("./parser").parser,k.generate=r("./generate"),k.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,k){(function(V){(function(){const oe={},re=V.isBuffer(V.from([1,2]).subarray(0,1));function Ce(Ie){const ue=V.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)oe[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=V.allocUnsafe(4);do de=Ie%128|0,Ie=Ie/128|0,Ie>0&&(de=de|128),he.writeUInt8(de,Ne++);while(Ie>0&&Ne<4);return Ie>0&&(Ne=0),re?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=V.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:oe,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,k){class V{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=V},{}],43:[function(r,g,k){const V=r("bl"),$=r("events"),oe=r("./packet"),re=r("./constants"),Ce=r("debug")("mqtt-packet:parser");class ie extends ${constructor(){super(),this.parser=this.constructor.parser}static parser(le){return this instanceof ie?(this.settings=le||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new ie().parser(le)}_resetState(){Ce("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new oe,this.error=null,this._list=V(),this._stateCounter=0}parse(le){for(this.error&&this._resetState(),this._list.append(le),Ce("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,Ce("parse: state complete. _stateCounter is now: %d",this._stateCounter),Ce("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return Ce("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const le=this._list.readUInt8(0);return this.packet.cmd=re.types[le>>re.CMD_SHIFT],this.packet.retain=(le&re.RETAIN_MASK)!==0,this.packet.qos=le>>re.QOS_SHIFT&re.QOS_MASK,this.packet.dup=(le&re.DUP_MASK)!==0,Ce("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const le=this._parseVarByteNum(!0);return le&&(this.packet.length=le.value,this._list.consume(le.bytes)),Ce("_parseLength %d",le.value),!!le}_parsePayload(){Ce("_parsePayload: payload %O",this._list);let le=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}le=!0}return Ce("_parsePayload complete result: %s",le),le}_parseConnect(){Ce("_parseConnect");let le,Ie,ue,de;const Ne={},he=this.packet,pe=this._parseString();if(pe===null)return this._emitError(new Error("Cannot parse protocolId"));if(pe!=="MQTT"&&pe!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=pe,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(he.protocolVersion=this._list.readUInt8(this._pos),he.protocolVersion>=128&&(he.bridgeMode=!0,he.protocolVersion=he.protocolVersion-128),he.protocolVersion!==3&&he.protocolVersion!==4&&he.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(Ne.username=this._list.readUInt8(this._pos)&re.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&re.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&re.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&re.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&re.WILL_QOS_MASK)>>re.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&re.CLEAN_SESSION_MASK)!==0,this._pos++,he.keepalive=this._parseNum(),he.keepalive===-1)return this._emitError(new Error("Packet too short"));if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.properties=Fe)}const ze=this._parseString();if(ze===null)return this._emitError(new Error("Packet too short"));if(he.clientId=ze,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.will.properties=Fe)}if(le=this._parseString(),le===null)return this._emitError(new Error("Cannot parse will topic"));if(he.will.topic=le,Ce("_parseConnect: packet.will.topic: %s",he.will.topic),Ie=this._parseBuffer(),Ie===null)return this._emitError(new Error("Cannot parse will payload"));he.will.payload=Ie,Ce("_parseConnect: packet.will.paylaod: %s",he.will.payload)}if(Ne.username){if(de=this._parseString(),de===null)return this._emitError(new Error("Cannot parse username"));he.username=de,Ce("_parseConnect: packet.username: %s",he.username)}if(Ne.password){if(ue=this._parseBuffer(),ue===null)return this._emitError(new Error("Cannot parse password"));he.password=ue}return this.settings=he,Ce("_parseConnect: complete"),he}_parseConnack(){Ce("_parseConnack");const le=this.packet;if(this._list.length<1)return null;if(le.sessionPresent=!!(this._list.readUInt8(this._pos++)&re.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?le.reasonCode=this._list.readUInt8(this._pos++):le.reasonCode=0;else{if(this._list.length<2)return null;le.returnCode=this._list.readUInt8(this._pos++)}if(le.returnCode===-1||le.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}Ce("_parseConnack: complete")}_parsePublish(){Ce("_parsePublish");const le=this.packet;if(le.topic=this._parseString(),le.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(le.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}le.payload=this._list.slice(this._pos,le.length),Ce("_parsePublish: payload from buffer list: %o",le.payload)}}_parseSubscribe(){Ce("_parseSubscribe");const le=this.packet;let Ie,ue,de,Ne,he,pe,ze;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(le.properties=Fe)}for(;this._pos<le.length;){if(Ie=this._parseString(),Ie===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=le.length)return this._emitError(new Error("Malformed Subscribe Payload"));ue=this._parseByte(),de=ue&re.SUBSCRIBE_OPTIONS_QOS_MASK,pe=(ue>>re.SUBSCRIBE_OPTIONS_NL_SHIFT&re.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>re.SUBSCRIBE_OPTIONS_RAP_SHIFT&re.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>re.SUBSCRIBE_OPTIONS_RH_SHIFT&re.SUBSCRIBE_OPTIONS_RH_MASK,ze={topic:Ie,qos:de},this.settings.protocolVersion===5?(ze.nl=pe,ze.rap=he,ze.rh=Ne):this.settings.bridgeMode&&(ze.rh=0,ze.rap=!0,ze.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",ze),le.subscriptions.push(ze)}}}_parseSuback(){Ce("_parseSuback");const le=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){Ce("_parseUnsubscribe");const le=this.packet;if(le.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<le.length;){const Ie=this._parseString();if(Ie===null)return this._emitError(new Error("Cannot parse topic"));Ce("_parseUnsubscribe: push topic `%s` to unsubscriptions",Ie),le.unsubscriptions.push(Ie)}}}_parseUnsuback(){Ce("_parseUnsuback");const le=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();for(Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),le.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){Ce("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const le=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5&&(le.length>2?(le.reasonCode=this._parseByte(),Ce("_parseConfirmation: packet.reasonCode `%d`",le.reasonCode)):le.reasonCode=0,le.length>3)){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return!0}_parseDisconnect(){const le=this.packet;if(Ce("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?le.reasonCode=this._parseByte():le.reasonCode=0;const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return Ce("_parseDisconnect result: true"),!0}_parseAuth(){Ce("_parseAuth");const le=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));le.reasonCode=this._parseByte();const Ie=this._parseProperties();return Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),Ce("_parseAuth: result: true"),!0}_parseMessageId(){const le=this.packet;return le.messageId=this._parseNum(),le.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(Ce("_parseMessageId: packet.messageId %d",le.messageId),!0)}_parseString(le){const Ie=this._parseNum(),ue=Ie+this._pos;if(Ie===-1||ue>this._list.length||ue>this.packet.length)return null;const de=this._list.toString("utf8",this._pos,ue);return this._pos+=Ie,Ce("_parseString: result: %s",de),de}_parseStringPair(){return Ce("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const le=this._parseNum(),Ie=le+this._pos;if(le===-1||Ie>this._list.length||Ie>this.packet.length)return null;const ue=this._list.slice(this._pos,Ie);return this._pos+=le,Ce("_parseBuffer: result: %o",ue),ue}_parseNum(){if(this._list.length-this._pos<2)return-1;const le=this._list.readUInt16BE(this._pos);return this._pos+=2,Ce("_parseNum: result: %s",le),le}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const le=this._list.readUInt32BE(this._pos);return this._pos+=4,Ce("_parse4ByteNum: result: %s",le),le}_parseVarByteNum(le){Ce("_parseVarByteNum");const Ie=4;let ue=0,de=1,Ne=0,he=!1,pe;const ze=this._pos?this._pos:0;for(;ue<Ie&&ze+ue<this._list.length;){if(pe=this._list.readUInt8(ze+ue++),Ne+=de*(pe&re.VARBYTEINT_MASK),de*=128,!(pe&re.VARBYTEINT_FIN_MASK)){he=!0;break}if(this._list.length<=ue)break}return!he&&ue===Ie&&this._list.length>=ue&&this._emitError(new Error("Invalid variable byte integer")),ze&&(this._pos+=ue),he=he?le?{bytes:ue,value:Ne}:Ne:!1,Ce("_parseVarByteNum: result: %o",he),he}_parseByte(){let le;return this._pos<this._list.length&&(le=this._list.readUInt8(this._pos),this._pos++),Ce("_parseByte: result: %o",le),le}_parseByType(le){switch(Ce("_parseByType: type: %s",le),le){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){Ce("_parseProperties");const le=this._parseVarByteNum(),ue=this._pos+le,de={};for(;this._pos<ue;){const Ne=this._parseByte();if(!Ne)return this._emitError(new Error("Cannot parse property code type")),!1;const he=re.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const pe=this._parseByType(re.propertiesTypes[he]);if(de[he][pe.name])if(Array.isArray(de[he][pe.name]))de[he][pe.name].push(pe.value);else{const ze=de[he][pe.name];de[he][pe.name]=[ze],de[he][pe.name].push(pe.value)}else de[he][pe.name]=pe.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(re.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(re.propertiesTypes[he]))):de[he]=this._parseByType(re.propertiesTypes[he])}return de}_newPacket(){return Ce("_newPacket"),this.packet&&(this._list.consume(this.packet.length),Ce("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),Ce("_newPacket: new packet"),this.packet=new oe,this._pos=0,!0}_emitError(le){Ce("_emitError"),this.error=le,this.emit("error",le)}}g.exports=ie},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(r,g,k){(function(V){(function(){const $=r("./constants"),oe=V.allocUnsafe(0),re=V.from([0]),Ce=r("./numbers"),ie=r("process-nextick-args").nextTick,ae=r("debug")("mqtt-packet:writeToStream"),le=Ce.cache,Ie=Ce.generateNumber,ue=Ce.generateCache,de=Ce.genBufVariableByteInt,Ne=Ce.generate4ByteBuffer;let he=ni,pe=!0;function ze(wi,Ci,mi){switch(ae("generate called"),Ci.cork&&(Ci.cork(),ie(Fe,Ci)),pe&&(pe=!1,ue()),ae("generate: packet.cmd: %s",wi.cmd),wi.cmd){case"connect":return xe(wi,Ci);case"connack":return _e(wi,Ci,mi);case"publish":return Dt(wi,Ci,mi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(wi,Ci,mi);case"subscribe":return Ue(wi,Ci,mi);case"suback":return Ve(wi,Ci,mi);case"unsubscribe":return Oe(wi,Ci,mi);case"unsuback":return At(wi,Ci,mi);case"pingreq":case"pingresp":return qe(wi,Ci);case"disconnect":return Lt(wi,Ci,mi);case"auth":return kt(wi,Ci,mi);default:return Ci.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(ze,"cacheNumbers",{get(){return he===ni},set(wi){wi?((!le||Object.keys(le).length===0)&&(pe=!0),he=ni):(pe=!1,he=gi)}});function Fe(wi){wi.uncork()}function xe(wi,Ci,mi){const Ni=wi||{},Mi=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const zi=Ni.will;let Si=Ni.clean;const si=Ni.keepalive||0,Ii=Ni.clientId||"",oi=Ni.username,Et=Ni.password,ii=Ni.properties;Si===void 0&&(Si=!0);let ri=0;if(!Mi||typeof Mi!="string"&&!V.isBuffer(Mi))return Ci.emit("error",new Error("Invalid protocolId")),!1;if(ri+=Mi.length+2,fi!==3&&fi!==4&&fi!==5)return Ci.emit("error",new Error("Invalid protocol version")),!1;if(ri+=1,(typeof Ii=="string"||V.isBuffer(Ii))&&(Ii||fi>=4)&&(Ii||Si))ri+=V.byteLength(Ii)+2;else{if(fi<4)return Ci.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(Si*1===0)return Ci.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof si!="number"||si<0||si>65535||si%1!==0)return Ci.emit("error",new Error("Invalid keepalive")),!1;if(ri+=2,ri+=1,fi===5){var ui=ai(Ci,ii);if(!ui)return!1;ri+=ui.length}if(zi){if(typeof zi!="object")return Ci.emit("error",new Error("Invalid will")),!1;if(!zi.topic||typeof zi.topic!="string")return Ci.emit("error",new Error("Invalid will topic")),!1;if(ri+=V.byteLength(zi.topic)+2,ri+=2,zi.payload)if(zi.payload.length>=0)typeof zi.payload=="string"?ri+=V.byteLength(zi.payload):ri+=zi.payload.length;else return Ci.emit("error",new Error("Invalid will payload")),!1;var vi={};if(fi===5){if(vi=ai(Ci,zi.properties),!vi)return!1;ri+=vi.length}}let bi=!1;if(oi!=null)if(hi(oi))bi=!0,ri+=V.byteLength(oi)+2;else return Ci.emit("error",new Error("Invalid username")),!1;if(Et!=null){if(!bi)return Ci.emit("error",new Error("Username is required to use password")),!1;if(hi(Et))ri+=Ai(Et)+2;else return Ci.emit("error",new Error("Invalid password")),!1}Ci.write($.CONNECT_HEADER),ti(Ci,ri),li(Ci,Mi),Ni.bridgeMode&&(fi+=128),Ci.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let Zi=0;return Zi|=oi!=null?$.USERNAME_MASK:0,Zi|=Et!=null?$.PASSWORD_MASK:0,Zi|=zi&&zi.retain?$.WILL_RETAIN_MASK:0,Zi|=zi&&zi.qos?zi.qos<<$.WILL_QOS_SHIFT:0,Zi|=zi?$.WILL_FLAG_MASK:0,Zi|=Si?$.CLEAN_SESSION_MASK:0,Ci.write(V.from([Zi])),he(Ci,si),fi===5&&ui.write(),li(Ci,Ii),zi&&(fi===5&&vi.write(),ei(Ci,zi.topic),li(Ci,zi.payload)),oi!=null&&li(Ci,oi),Et!=null&&li(Ci,Et),!0}function _e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Ni===5?Mi.reasonCode:Mi.returnCode,zi=Mi.properties;let Si=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=ai(Ci,zi),!si)return!1;Si+=si.length}return Ci.write($.CONNACK_HEADER),ti(Ci,Si),Ci.write(Mi.sessionPresent?$.SESSIONPRESENT_HEADER:re),Ci.write(V.from([fi])),si!=null&&si.write(),!0}function Dt(wi,Ci,mi){ae("publish: packet: %o",wi);const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.qos||0,zi=Mi.retain?$.RETAIN_MASK:0,Si=Mi.topic,si=Mi.payload||oe,Ii=Mi.messageId,oi=Mi.properties;let Et=0;if(typeof Si=="string")Et+=V.byteLength(Si)+2;else if(V.isBuffer(Si))Et+=Si.length+2;else return Ci.emit("error",new Error("Invalid topic")),!1;if(V.isBuffer(si)?Et+=si.length:Et+=V.byteLength(si),fi&&typeof Ii!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;fi&&(Et+=2);let ii=null;if(Ni===5){if(ii=ai(Ci,oi),!ii)return!1;Et+=ii.length}return Ci.write($.PUBLISH_HEADER[fi][Mi.dup?1:0][zi?1:0]),ti(Ci,Et),he(Ci,Ai(Si)),Ci.write(Si),fi>0&&he(Ci,Ii),ii!=null&&ii.write(),ae("publish: payload: %o",si),Ci.write(si)}function $e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.cmd||"puback",zi=Mi.messageId,Si=Mi.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const Ii=Mi.reasonCode,oi=Mi.properties;let Et=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ci(Ci,oi,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[fi][si][Si][0]),ti(Ci,Et),he(Ci,zi),Ni===5&&Ci.write(V.from([Ii])),ii!==null&&ii.write(),!0}function Ue(wi,Ci,mi){ae("subscribe: packet: ");const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.dup?$.DUP_MASK:0,zi=Mi.messageId,Si=Mi.subscriptions,si=Mi.properties;let Ii=0;if(typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;Ii+=2;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}if(typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){const ri=Si[ii].topic,ui=Si[ii].qos;if(typeof ri!="string")return Ci.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof ui!="number")return Ci.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(Si[ii].nl||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Si[ii].rap||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const Zi=Si[ii].rh||0;if(typeof Zi!="number"||Zi>2)return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}Ii+=V.byteLength(ri)+2+1}else return Ci.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),Ci.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(Ci,Ii),he(Ci,zi),oi!==null&&oi.write();let Et=!0;for(const ii of Si){const ri=ii.topic,ui=ii.qos,vi=+ii.nl,bi=+ii.rap,Zi=ii.rh;let Gi;ei(Ci,ri),Gi=$.SUBSCRIBE_OPTIONS_QOS[ui],Ni===5&&(Gi|=vi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=bi?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=Zi?$.SUBSCRIBE_OPTIONS_RH[Zi]:0),Et=Ci.write(V.from([Gi]))}return Et}function Ve(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.granted,Si=Mi.properties;let si=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof zi=="object"&&zi.length)for(let oi=0;oi<zi.length;oi+=1){if(typeof zi[oi]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let Ii=null;if(Ni===5){if(Ii=ci(Ci,Si,mi,si),!Ii)return!1;si+=Ii.length}return Ci.write($.SUBACK_HEADER),ti(Ci,si),he(Ci,fi),Ii!==null&&Ii.write(),Ci.write(V.from(zi))}function Oe(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.unsubscriptions,si=Mi.properties;let Ii=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ii+=2,typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){if(typeof Si[ii]!="string")return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;Ii+=V.byteLength(Si[ii])+2}else return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}Ci.write($.UNSUBSCRIBE_HEADER[1][zi?1:0][0]),ti(Ci,Ii),he(Ci,fi),oi!==null&&oi.write();let Et=!0;for(let ii=0;ii<Si.length;ii++)Et=ei(Ci,Si[ii]);return Et}function At(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.granted,si=Mi.properties,Ii=Mi.cmd,oi=0;let Et=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof Si=="object"&&Si.length)for(let ri=0;ri<Si.length;ri+=1){if(typeof Si[ri]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;Et+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ci(Ci,si,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[Ii][oi][zi][0]),ti(Ci,Et),he(Ci,fi),ii!==null&&ii.write(),Ni===5&&Ci.write(V.from(Si)),!0}function qe(wi,Ci,mi){return Ci.write($.EMPTY[wi.cmd])}function Lt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0,si=null;if(Ni===5){if(si=ci(Ci,zi,mi,Si),!si)return!1;Si+=si.length}return Ci.write(V.from([$.codes.disconnect<<4])),ti(Ci,Si),Ni===5&&Ci.write(V.from([fi])),si!==null&&si.write(),!0}function kt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0;Ni!==5&&Ci.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ci(Ci,zi,mi,Si);return si?(Si+=si.length,Ci.write(V.from([$.codes.auth<<4])),ti(Ci,Si),Ci.write(V.from([fi])),si!==null&&si.write(),!0):!1}const jt={};function ti(wi,Ci){if(Ci>$.VARBYTEINT_MAX)return wi.emit("error",new Error(`Invalid variable byte integer: ${Ci}`)),!1;let mi=jt[Ci];return mi||(mi=de(Ci),Ci<16384&&(jt[Ci]=mi)),ae("writeVarByteInt: writing to stream: %o",mi),wi.write(mi)}function ei(wi,Ci){const mi=V.byteLength(Ci);return he(wi,mi),ae("writeString: %s",Ci),wi.write(Ci,"utf8")}function Pt(wi,Ci,mi){ei(wi,Ci),ei(wi,mi)}function ni(wi,Ci){return ae("writeNumberCached: number: %d",Ci),ae("writeNumberCached: %o",le[Ci]),wi.write(le[Ci])}function gi(wi,Ci){const mi=Ie(Ci);return ae("writeNumberGenerated: %o",mi),wi.write(mi)}function di(wi,Ci){const mi=Ne(Ci);return ae("write4ByteNumber: %o",mi),wi.write(mi)}function li(wi,Ci){typeof Ci=="string"?ei(wi,Ci):Ci?(he(wi,Ci.length),wi.write(Ci)):he(wi,0)}function ai(wi,Ci){if(typeof Ci!="object"||Ci.length!=null)return{length:1,write(){yi(wi,{},0)}};let mi=0;function Ni(fi,zi){const Si=$.propertiesTypes[fi];let si=0;switch(Si){case"byte":{if(typeof zi!="boolean")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"int8":{if(typeof zi!="number"||zi<0||zi>255)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"binary":{if(zi&&zi===null)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(zi)+2;break}case"int16":{if(typeof zi!="number"||zi<0||zi>65535)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2;break}case"int32":{if(typeof zi!="number"||zi<0||zi>4294967295)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+4;break}case"var":{if(typeof zi!="number"||zi<0||zi>268435455)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(de(zi));break}case"string":{if(typeof zi!="string")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2+V.byteLength(zi.toString());break}case"pair":{if(typeof zi!="object")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=Object.getOwnPropertyNames(zi).reduce((Ii,oi)=>{const Et=zi[oi];return Array.isArray(Et)?Ii+=Et.reduce((ii,ri)=>(ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(ri.toString()),ii),0):Ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(zi[oi].toString()),Ii},0);break}default:return wi.emit("error",new Error(`Invalid property ${fi}: ${zi}`)),!1}return si}if(Ci)for(const fi in Ci){let zi=0,Si=0;const si=Ci[fi];if(Array.isArray(si))for(let Ii=0;Ii<si.length;Ii++){if(Si=Ni(fi,si[Ii]),!Si)return!1;zi+=Si}else{if(Si=Ni(fi,si),!Si)return!1;zi=Si}if(!zi)return!1;mi+=zi}return{length:V.byteLength(de(mi))+mi,write(){yi(wi,Ci,mi)}}}function ci(wi,Ci,mi,Ni){const Mi=["reasonString","userProperties"],fi=mi&&mi.properties&&mi.properties.maximumPacketSize?mi.properties.maximumPacketSize:0;let zi=ai(wi,Ci);if(fi)for(;Ni+zi.length>fi;){const Si=Mi.shift();if(Si&&Ci[Si])delete Ci[Si],zi=ai(wi,Ci);else return!1}return zi}function pi(wi,Ci,mi){switch($.propertiesTypes[Ci]){case"byte":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([+mi]));break}case"int8":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([mi]));break}case"binary":{wi.write(V.from([$.properties[Ci]])),li(wi,mi);break}case"int16":{wi.write(V.from([$.properties[Ci]])),he(wi,mi);break}case"int32":{wi.write(V.from([$.properties[Ci]])),di(wi,mi);break}case"var":{wi.write(V.from([$.properties[Ci]])),ti(wi,mi);break}case"string":{wi.write(V.from([$.properties[Ci]])),ei(wi,mi);break}case"pair":{Object.getOwnPropertyNames(mi).forEach(Mi=>{const fi=mi[Mi];Array.isArray(fi)?fi.forEach(zi=>{wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),zi.toString())}):(wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),fi.toString()))});break}default:return wi.emit("error",new Error(`Invalid property ${Ci} value: ${mi}`)),!1}}function yi(wi,Ci,mi){ti(wi,mi);for(const Ni in Ci)if(Object.prototype.hasOwnProperty.call(Ci,Ni)&&Ci[Ni]!==null){const Mi=Ci[Ni];if(Array.isArray(Mi))for(let fi=0;fi<Mi.length;fi++)pi(wi,Ni,Mi[fi]);else pi(wi,Ni,Mi)}}function Ai(wi){return wi?wi instanceof V?wi.length:V.byteLength(wi):0}function hi(wi){return typeof wi=="string"||wi instanceof V}g.exports=ze}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,k){var V=1e3,$=V*60,oe=$*60,re=oe*24,Ce=re*7,ie=re*365.25;g.exports=function(de,Ne){Ne=Ne||{};var he=typeof de;if(he==="string"&&de.length>0)return ae(de);if(he==="number"&&isFinite(de))return Ne.long?Ie(de):le(de);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(de))};function ae(de){if(de=String(de),!(de.length>100)){var Ne=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(de);if(Ne){var he=parseFloat(Ne[1]),pe=(Ne[2]||"ms").toLowerCase();switch(pe){case"years":case"year":case"yrs":case"yr":case"y":return he*ie;case"weeks":case"week":case"w":return he*Ce;case"days":case"day":case"d":return he*re;case"hours":case"hour":case"hrs":case"hr":case"h":return he*oe;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*V;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=re?Math.round(de/re)+"d":Ne>=oe?Math.round(de/oe)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=V?Math.round(de/V)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=re?ue(de,Ne,re,"day"):Ne>=oe?ue(de,Ne,oe,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=V?ue(de,Ne,V,"second"):de+" ms"}function ue(de,Ne,he,pe){var ze=Ne>=he*1.5;return Math.round(de/he)+" "+pe+(ze?"s":"")}},{}],46:[function(r,g,k){const V=r("./lib/number-allocator.js");g.exports.NumberAllocator=V},{"./lib/number-allocator.js":47}],47:[function(r,g,k){const V=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),oe=r("debug")("number-allocator:error");function re(ie,ae){this.low=ie,this.high=ae}re.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},re.prototype.compare=function(ie){return this.low<ie.low&&this.high<ie.low?-1:ie.low<this.low&&ie.high<this.low?1:0};function Ce(ie,ae){if(!(this instanceof Ce))return new Ce(ie,ae);this.min=ie,this.max=ae,this.ss=new V([],(le,Ie)=>le.compare(Ie)),$("Create"),this.clear()}Ce.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},Ce.prototype.alloc=function(){if(this.ss.size()===0)return $("alloc():empty"),null;const ie=this.ss.front(),ae=ie.low;return ae+1<=ie.high?++ie.low:this.ss.eraseElementByPos(0),$("alloc():"+ae),ae},Ce.prototype.use=function(ie){const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.equals(ae))return this.ss.eraseElementByValue(le),$("use():"+ie),!0;if(le.low>ie)return!1;if(le.low===ie)return++le.low,$("use():"+ie),!0;if(le.high===ie)return--le.high,$("use():"+ie),!0;const Ie=le.low;return le.low=ie+1,this.ss.insert(new re(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){oe("free():"+ie+" is out of range");return}const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){oe("free():"+ie+" has already been vacant");return}if(le===this.ss.front())ie+1===le.low?--le.low:this.ss.insert(ae);else{const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?ie+1===le.low?(this.ss.eraseElementByValue(Ie),le.low=Ie.low):Ie.high=ie:ie+1===le.low?le.low=ie:this.ss.insert(ae)}}else{if(le===this.ss.front()){this.ss.insert(ae);return}const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?Ie.high=ie:this.ss.insert(ae)}$("free():"+ie)},Ce.prototype.clear=function(){$("clear()"),this.ss.clear(),this.ss.insert(new re(this.min,this.max))},Ce.prototype.intervalCount=function(){return this.ss.size()},Ce.prototype.dump=function(){console.log("length:"+this.ss.size());for(const ie of this.ss)console.log(ie)},g.exports=Ce},{debug:18,"js-sdsl":36}],48:[function(r,g,k){var V=r("wrappy");g.exports=V($),g.exports.strict=V(oe),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return oe(this)},configurable:!0})});function $(re){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=re.apply(this,arguments))};return Ce.called=!1,Ce}function oe(re){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=re.apply(this,arguments)},ie=re.name||"Function wrapped with `once`";return Ce.onceError=ie+" shouldn't be called more than once",Ce.called=!1,Ce}},{wrappy:79}],49:[function(r,g,k){(function(V){(function(){typeof V>"u"||!V.version||V.version.indexOf("v0.")===0||V.version.indexOf("v1.")===0&&V.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=V;function $(oe,re,Ce,ie){if(typeof oe!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return V.nextTick(oe);case 2:return V.nextTick(function(){oe.call(null,re)});case 3:return V.nextTick(function(){oe.call(null,re,Ce)});case 4:return V.nextTick(function(){oe.call(null,re,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return V.nextTick(function(){oe.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,k){var V=g.exports={},$,oe;function re(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=re}catch{$=re}try{typeof clearTimeout=="function"?oe=clearTimeout:oe=Ce}catch{oe=Ce}})();function ie(Fe){if($===setTimeout)return setTimeout(Fe,0);if(($===re||!$)&&setTimeout)return $=setTimeout,setTimeout(Fe,0);try{return $(Fe,0)}catch{try{return $.call(null,Fe,0)}catch{return $.call(this,Fe,0)}}}function ae(Fe){if(oe===clearTimeout)return clearTimeout(Fe);if((oe===Ce||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(Fe);try{return oe(Fe)}catch{try{return oe.call(null,Fe)}catch{return oe.call(this,Fe)}}}var le=[],Ie=!1,ue,de=-1;function Ne(){!Ie||!ue||(Ie=!1,ue.length?le=ue.concat(le):de=-1,le.length&&he())}function he(){if(!Ie){var Fe=ie(Ne);Ie=!0;for(var xe=le.length;xe;){for(ue=le,le=[];++de<xe;)ue&&ue[de].run();de=-1,xe=le.length}ue=null,Ie=!1,ae(Fe)}}V.nextTick=function(Fe){var xe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)xe[_e-1]=arguments[_e];le.push(new pe(Fe,xe)),le.length===1&&!Ie&&ie(he)};function pe(Fe,xe){this.fun=Fe,this.array=xe}pe.prototype.run=function(){this.fun.apply(null,this.array)},V.title="browser",V.browser=!0,V.env={},V.argv=[],V.version="",V.versions={};function ze(){}V.on=ze,V.addListener=ze,V.once=ze,V.off=ze,V.removeListener=ze,V.removeAllListeners=ze,V.emit=ze,V.prependListener=ze,V.prependOnceListener=ze,V.listeners=function(Fe){return[]},V.binding=function(Fe){throw new Error("process.binding is not supported")},V.cwd=function(){return"/"},V.chdir=function(Fe){throw new Error("process.chdir is not supported")},V.umask=function(){return 0}},{}],51:[function(r,g,k){(function(V){(function(){(function($){var oe=typeof k=="object"&&k&&!k.nodeType&&k,re=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof V=="object"&&V;(Ce.global===Ce||Ce.window===Ce||Ce.self===Ce)&&($=Ce);var ie,ae=2147483647,le=36,Ie=1,ue=26,de=38,Ne=700,he=72,pe=128,ze="-",Fe=/^xn--/,xe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$e=le-Ie,Ue=Math.floor,Ve=String.fromCharCode,Oe;function At(ai){throw new RangeError(Dt[ai])}function qe(ai,ci){for(var pi=ai.length,yi=[];pi--;)yi[pi]=ci(ai[pi]);return yi}function Lt(ai,ci){var pi=ai.split("@"),yi="";pi.length>1&&(yi=pi[0]+"@",ai=pi[1]),ai=ai.replace(_e,".");var Ai=ai.split("."),hi=qe(Ai,ci).join(".");return yi+hi}function kt(ai){for(var ci=[],pi=0,yi=ai.length,Ai,hi;pi<yi;)Ai=ai.charCodeAt(pi++),Ai>=55296&&Ai<=56319&&pi<yi?(hi=ai.charCodeAt(pi++),(hi&64512)==56320?ci.push(((Ai&1023)<<10)+(hi&1023)+65536):(ci.push(Ai),pi--)):ci.push(Ai);return ci}function jt(ai){return qe(ai,function(ci){var pi="";return ci>65535&&(ci-=65536,pi+=Ve(ci>>>10&1023|55296),ci=56320|ci&1023),pi+=Ve(ci),pi}).join("")}function ti(ai){return ai-48<10?ai-22:ai-65<26?ai-65:ai-97<26?ai-97:le}function ei(ai,ci){return ai+22+75*(ai<26)-((ci!=0)<<5)}function Pt(ai,ci,pi){var yi=0;for(ai=pi?Ue(ai/Ne):ai>>1,ai+=Ue(ai/ci);ai>$e*ue>>1;yi+=le)ai=Ue(ai/$e);return Ue(yi+($e+1)*ai/(ai+de))}function ni(ai){var ci=[],pi=ai.length,yi,Ai=0,hi=pe,wi=he,Ci,mi,Ni,Mi,fi,zi,Si,si,Ii;for(Ci=ai.lastIndexOf(ze),Ci<0&&(Ci=0),mi=0;mi<Ci;++mi)ai.charCodeAt(mi)>=128&&At("not-basic"),ci.push(ai.charCodeAt(mi));for(Ni=Ci>0?Ci+1:0;Ni<pi;){for(Mi=Ai,fi=1,zi=le;Ni>=pi&&At("invalid-input"),Si=ti(ai.charCodeAt(Ni++)),(Si>=le||Si>Ue((ae-Ai)/fi))&&At("overflow"),Ai+=Si*fi,si=zi<=wi?Ie:zi>=wi+ue?ue:zi-wi,!(Si<si);zi+=le)Ii=le-si,fi>Ue(ae/Ii)&&At("overflow"),fi*=Ii;yi=ci.length+1,wi=Pt(Ai-Mi,yi,Mi==0),Ue(Ai/yi)>ae-hi&&At("overflow"),hi+=Ue(Ai/yi),Ai%=yi,ci.splice(Ai++,0,hi)}return jt(ci)}function gi(ai){var ci,pi,yi,Ai,hi,wi,Ci,mi,Ni,Mi,fi,zi=[],Si,si,Ii,oi;for(ai=kt(ai),Si=ai.length,ci=pe,pi=0,hi=he,wi=0;wi<Si;++wi)fi=ai[wi],fi<128&&zi.push(Ve(fi));for(yi=Ai=zi.length,Ai&&zi.push(ze);yi<Si;){for(Ci=ae,wi=0;wi<Si;++wi)fi=ai[wi],fi>=ci&&fi<Ci&&(Ci=fi);for(si=yi+1,Ci-ci>Ue((ae-pi)/si)&&At("overflow"),pi+=(Ci-ci)*si,ci=Ci,wi=0;wi<Si;++wi)if(fi=ai[wi],fi<ci&&++pi>ae&&At("overflow"),fi==ci){for(mi=pi,Ni=le;Mi=Ni<=hi?Ie:Ni>=hi+ue?ue:Ni-hi,!(mi<Mi);Ni+=le)oi=mi-Mi,Ii=le-Mi,zi.push(Ve(ei(Mi+oi%Ii,0))),mi=Ue(oi/Ii);zi.push(Ve(ei(mi,0))),hi=Pt(pi,si,yi==Ai),pi=0,++yi}++pi,++ci}return zi.join("")}function di(ai){return Lt(ai,function(ci){return Fe.test(ci)?ni(ci.slice(4).toLowerCase()):ci})}function li(ai){return Lt(ai,function(ci){return xe.test(ci)?"xn--"+gi(ci):ci})}if(ie={version:"1.4.1",ucs2:{decode:kt,encode:jt},decode:ni,encode:gi,toASCII:li,toUnicode:di},oe&&re)if(g.exports==oe)re.exports=ie;else for(Oe in ie)ie.hasOwnProperty(Oe)&&(oe[Oe]=ie[Oe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,k){function V(oe,re){return Object.prototype.hasOwnProperty.call(oe,re)}g.exports=function(oe,re,Ce,ie){re=re||"&",Ce=Ce||"=";var ae={};if(typeof oe!="string"||oe.length===0)return ae;var le=/\+/g;oe=oe.split(re);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=oe.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=oe[de].replace(le,"%20"),he=Ne.indexOf(Ce),pe,ze,Fe,xe;he>=0?(pe=Ne.substr(0,he),ze=Ne.substr(he+1)):(pe=Ne,ze=""),Fe=decodeURIComponent(pe),xe=decodeURIComponent(ze),V(ae,Fe)?$(ae[Fe])?ae[Fe].push(xe):ae[Fe]=[ae[Fe],xe]:ae[Fe]=xe}return ae};var $=Array.isArray||function(oe){return Object.prototype.toString.call(oe)==="[object Array]"}},{}],53:[function(r,g,k){var V=function(Ce){switch(typeof Ce){case"string":return Ce;case"boolean":return Ce?"true":"false";case"number":return isFinite(Ce)?Ce:"";default:return""}};g.exports=function(Ce,ie,ae,le){return ie=ie||"&",ae=ae||"=",Ce===null&&(Ce=void 0),typeof Ce=="object"?oe(re(Ce),function(Ie){var ue=encodeURIComponent(V(Ie))+ae;return $(Ce[Ie])?oe(Ce[Ie],function(de){return ue+encodeURIComponent(V(de))}).join(ie):ue+encodeURIComponent(V(Ce[Ie]))}).join(ie):le?encodeURIComponent(V(le))+ae+encodeURIComponent(V(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function oe(Ce,ie){if(Ce.map)return Ce.map(ie);for(var ae=[],le=0;le<Ce.length;le++)ae.push(ie(Ce[le],le));return ae}var re=Object.keys||function(Ce){var ie=[];for(var ae in Ce)Object.prototype.hasOwnProperty.call(Ce,ae)&&ie.push(ae);return ie}},{}],54:[function(r,g,k){k.decode=k.parse=r("./decode"),k.encode=k.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,k){function V(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function oe(le,Ie,ue){ue||(ue=Error);function de(he,pe,ze){return typeof Ie=="string"?Ie:Ie(he,pe,ze)}var Ne=function(he){V(pe,he);function pe(ze,Fe,xe){return he.call(this,de(ze,Fe,xe))||this}return pe}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function re(le,Ie){if(Array.isArray(le)){var ue=le.length;return le=le.map(function(de){return String(de)}),ue>2?"one of ".concat(Ie," ").concat(le.slice(0,ue-1).join(", "),", or ")+le[ue-1]:ue===2?"one of ".concat(Ie," ").concat(le[0]," or ").concat(le[1]):"of ".concat(Ie," ").concat(le[0])}else return"of ".concat(Ie," ").concat(String(le))}function Ce(le,Ie,ue){return le.substr(!ue||ue<0?0:+ue,Ie.length)===Ie}function ie(le,Ie,ue){return(ue===void 0||ue>le.length)&&(ue=le.length),le.substring(ue-Ie.length,ue)===Ie}function ae(le,Ie,ue){return typeof ue!="number"&&(ue=0),ue+Ie.length>le.length?!1:le.indexOf(Ie,ue)!==-1}oe("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),oe("ERR_INVALID_ARG_TYPE",function(le,Ie,ue){var de;typeof Ie=="string"&&Ce(Ie,"not ")?(de="must not be",Ie=Ie.replace(/^not /,"")):de="must be";var Ne;if(ie(le," argument"))Ne="The ".concat(le," ").concat(de," ").concat(re(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(re(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),oe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),oe("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),oe("ERR_STREAM_PREMATURE_CLOSE","Premature close"),oe("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),oe("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),oe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),oe("ERR_STREAM_WRITE_AFTER_END","write after end"),oe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),oe("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),oe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,k){(function(V){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var oe=r("./_stream_readable"),re=r("./_stream_writable");r("inherits")(le,oe);for(var Ce=$(re.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=re.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);oe.call(this,de),re.call(this,de),this.allowHalfOpen=!0,de&&(de.readable===!1&&(this.readable=!1),de.writable===!1&&(this.writable=!1),de.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Ie)))}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ie(){this._writableState.ended||V.nextTick(ue,this)}function ue(de){de.end()}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(Ne){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=Ne,this._writableState.destroyed=Ne)}})}).call(this)}).call(this,r("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(r,g,k){g.exports=$;var V=r("./_stream_transform");r("inherits")($,V);function $(oe){if(!(this instanceof $))return new $(oe);V.call(this,oe)}$.prototype._transform=function(oe,re,Ce){Ce(null,oe)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,k){(function(V,$){(function(){g.exports=jt;var oe;jt.ReadableState=kt,r("events").EventEmitter;var re=function(Ii,oi){return Ii.listeners(oi).length},Ce=r("./internal/streams/stream"),ie=r("buffer").Buffer,ae=$.Uint8Array||function(){};function le(si){return ie.from(si)}function Ie(si){return ie.isBuffer(si)||si instanceof ae}var ue=r("util"),de;ue&&ue.debuglog?de=ue.debuglog("stream"):de=function(){};var Ne=r("./internal/streams/buffer_list"),he=r("./internal/streams/destroy"),pe=r("./internal/streams/state"),ze=pe.getHighWaterMark,Fe=r("../errors").codes,xe=Fe.ERR_INVALID_ARG_TYPE,_e=Fe.ERR_STREAM_PUSH_AFTER_EOF,Dt=Fe.ERR_METHOD_NOT_IMPLEMENTED,$e=Fe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ue,Ve,Oe;r("inherits")(jt,Ce);var At=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function Lt(si,Ii,oi){if(typeof si.prependListener=="function")return si.prependListener(Ii,oi);!si._events||!si._events[Ii]?si.on(Ii,oi):Array.isArray(si._events[Ii])?si._events[Ii].unshift(oi):si._events[Ii]=[oi,si._events[Ii]]}function kt(si,Ii,oi){oe=oe||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=Ii instanceof oe),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=ze(this,si,"readableHighWaterMark",oi),this.buffer=new Ne,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=si.emitClose!==!1,this.autoDestroy=!!si.autoDestroy,this.destroyed=!1,this.defaultEncoding=si.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,si.encoding&&(Ue||(Ue=r("string_decoder/").StringDecoder),this.decoder=new Ue(si.encoding),this.encoding=si.encoding)}function jt(si){if(oe=oe||r("./_stream_duplex"),!(this instanceof jt))return new jt(si);var Ii=this instanceof oe;this._readableState=new kt(si,this,Ii),this.readable=!0,si&&(typeof si.read=="function"&&(this._read=si.read),typeof si.destroy=="function"&&(this._destroy=si.destroy)),Ce.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Ii){this._readableState&&(this._readableState.destroyed=Ii)}}),jt.prototype.destroy=he.destroy,jt.prototype._undestroy=he.undestroy,jt.prototype._destroy=function(si,Ii){Ii(si)},jt.prototype.push=function(si,Ii){var oi=this._readableState,Et;return oi.objectMode?Et=!0:typeof si=="string"&&(Ii=Ii||oi.defaultEncoding,Ii!==oi.encoding&&(si=ie.from(si,Ii),Ii=""),Et=!0),ti(this,si,Ii,!1,Et)},jt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,Ii,oi,Et,ii){de("readableAddChunk",Ii);var ri=si._readableState;if(Ii===null)ri.reading=!1,li(si,ri);else{var ui;if(ii||(ui=Pt(ri,Ii)),ui)At(si,ui);else if(ri.objectMode||Ii&&Ii.length>0)if(typeof Ii!="string"&&!ri.objectMode&&Object.getPrototypeOf(Ii)!==ie.prototype&&(Ii=le(Ii)),Et)ri.endEmitted?At(si,new $e):ei(si,ri,Ii,!0);else if(ri.ended)At(si,new _e);else{if(ri.destroyed)return!1;ri.reading=!1,ri.decoder&&!oi?(Ii=ri.decoder.write(Ii),ri.objectMode||Ii.length!==0?ei(si,ri,Ii,!1):pi(si,ri)):ei(si,ri,Ii,!1)}else Et||(ri.reading=!1,pi(si,ri))}return!ri.ended&&(ri.length<ri.highWaterMark||ri.length===0)}function ei(si,Ii,oi,Et){Ii.flowing&&Ii.length===0&&!Ii.sync?(Ii.awaitDrain=0,si.emit("data",oi)):(Ii.length+=Ii.objectMode?1:oi.length,Et?Ii.buffer.unshift(oi):Ii.buffer.push(oi),Ii.needReadable&&ai(si)),pi(si,Ii)}function Pt(si,Ii){var oi;return!Ie(Ii)&&typeof Ii!="string"&&Ii!==void 0&&!si.objectMode&&(oi=new xe("chunk",["string","Buffer","Uint8Array"],Ii)),oi}jt.prototype.isPaused=function(){return this._readableState.flowing===!1},jt.prototype.setEncoding=function(si){Ue||(Ue=r("string_decoder/").StringDecoder);var Ii=new Ue(si);this._readableState.decoder=Ii,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Et="";oi!==null;)Et+=Ii.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Et!==""&&this._readableState.buffer.push(Et),this._readableState.length=Et.length,this};var ni=1073741824;function gi(si){return si>=ni?si=ni:(si--,si|=si>>>1,si|=si>>>2,si|=si>>>4,si|=si>>>8,si|=si>>>16,si++),si}function di(si,Ii){return si<=0||Ii.length===0&&Ii.ended?0:Ii.objectMode?1:si!==si?Ii.flowing&&Ii.length?Ii.buffer.head.data.length:Ii.length:(si>Ii.highWaterMark&&(Ii.highWaterMark=gi(si)),si<=Ii.length?si:Ii.ended?Ii.length:(Ii.needReadable=!0,0))}jt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var Ii=this._readableState,oi=si;if(si!==0&&(Ii.emittedReadable=!1),si===0&&Ii.needReadable&&((Ii.highWaterMark!==0?Ii.length>=Ii.highWaterMark:Ii.length>0)||Ii.ended))return de("read: emitReadable",Ii.length,Ii.ended),Ii.length===0&&Ii.ended?fi(this):ai(this),null;if(si=di(si,Ii),si===0&&Ii.ended)return Ii.length===0&&fi(this),null;var Et=Ii.needReadable;de("need readable",Et),(Ii.length===0||Ii.length-si<Ii.highWaterMark)&&(Et=!0,de("length less than watermark",Et)),Ii.ended||Ii.reading?(Et=!1,de("reading or ended",Et)):Et&&(de("do read"),Ii.reading=!0,Ii.sync=!0,Ii.length===0&&(Ii.needReadable=!0),this._read(Ii.highWaterMark),Ii.sync=!1,Ii.reading||(si=di(oi,Ii)));var ii;return si>0?ii=Mi(si,Ii):ii=null,ii===null?(Ii.needReadable=Ii.length<=Ii.highWaterMark,si=0):(Ii.length-=si,Ii.awaitDrain=0),Ii.length===0&&(Ii.ended||(Ii.needReadable=!0),oi!==si&&Ii.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function li(si,Ii){if(de("onEofChunk"),!Ii.ended){if(Ii.decoder){var oi=Ii.decoder.end();oi&&oi.length&&(Ii.buffer.push(oi),Ii.length+=Ii.objectMode?1:oi.length)}Ii.ended=!0,Ii.sync?ai(si):(Ii.needReadable=!1,Ii.emittedReadable||(Ii.emittedReadable=!0,ci(si)))}}function ai(si){var Ii=si._readableState;de("emitReadable",Ii.needReadable,Ii.emittedReadable),Ii.needReadable=!1,Ii.emittedReadable||(de("emitReadable",Ii.flowing),Ii.emittedReadable=!0,V.nextTick(ci,si))}function ci(si){var Ii=si._readableState;de("emitReadable_",Ii.destroyed,Ii.length,Ii.ended),!Ii.destroyed&&(Ii.length||Ii.ended)&&(si.emit("readable"),Ii.emittedReadable=!1),Ii.needReadable=!Ii.flowing&&!Ii.ended&&Ii.length<=Ii.highWaterMark,Ni(si)}function pi(si,Ii){Ii.readingMore||(Ii.readingMore=!0,V.nextTick(yi,si,Ii))}function yi(si,Ii){for(;!Ii.reading&&!Ii.ended&&(Ii.length<Ii.highWaterMark||Ii.flowing&&Ii.length===0);){var oi=Ii.length;if(de("maybeReadMore read 0"),si.read(0),oi===Ii.length)break}Ii.readingMore=!1}jt.prototype._read=function(si){At(this,new Dt("_read()"))},jt.prototype.pipe=function(si,Ii){var oi=this,Et=this._readableState;switch(Et.pipesCount){case 0:Et.pipes=si;break;case 1:Et.pipes=[Et.pipes,si];break;default:Et.pipes.push(si);break}Et.pipesCount+=1,de("pipe count=%d opts=%j",Et.pipesCount,Ii);var ii=(!Ii||Ii.end!==!1)&&si!==V.stdout&&si!==V.stderr,ri=ii?vi:Wi;Et.endEmitted?V.nextTick(ri):oi.once("end",ri),si.on("unpipe",ui);function ui(ki,Ri){de("onunpipe"),ki===oi&&Ri&&Ri.hasUnpiped===!1&&(Ri.hasUnpiped=!0,Gi())}function vi(){de("onend"),si.end()}var bi=Ai(oi);si.on("drain",bi);var Zi=!1;function Gi(){de("cleanup"),si.removeListener("close",xi),si.removeListener("finish",Li),si.removeListener("drain",bi),si.removeListener("error",Oi),si.removeListener("unpipe",ui),oi.removeListener("end",vi),oi.removeListener("end",Wi),oi.removeListener("data",Yi),Zi=!0,Et.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&bi()}oi.on("data",Yi);function Yi(ki){de("ondata");var Ri=si.write(ki);de("dest.write",Ri),Ri===!1&&((Et.pipesCount===1&&Et.pipes===si||Et.pipesCount>1&&Si(Et.pipes,si)!==-1)&&!Zi&&(de("false write response, pause",Et.awaitDrain),Et.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Wi(),si.removeListener("error",Oi),re(si,"error")===0&&At(si,ki)}Lt(si,"error",Oi);function xi(){si.removeListener("finish",Li),Wi()}si.once("close",xi);function Li(){de("onfinish"),si.removeListener("close",xi),Wi()}si.once("finish",Li);function Wi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Et.flowing||(de("pipe resume"),oi.resume()),si};function Ai(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&re(si,"data")&&(oi.flowing=!0,Ni(si))}}jt.prototype.unpipe=function(si){var Ii=this._readableState,oi={hasUnpiped:!1};if(Ii.pipesCount===0)return this;if(Ii.pipesCount===1)return si&&si!==Ii.pipes?this:(si||(si=Ii.pipes),Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Et=Ii.pipes,ii=Ii.pipesCount;Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1;for(var ri=0;ri<ii;ri++)Et[ri].emit("unpipe",this,{hasUnpiped:!1});return this}var ui=Si(Ii.pipes,si);return ui===-1?this:(Ii.pipes.splice(ui,1),Ii.pipesCount-=1,Ii.pipesCount===1&&(Ii.pipes=Ii.pipes[0]),si.emit("unpipe",this,oi),this)},jt.prototype.on=function(si,Ii){var oi=Ce.prototype.on.call(this,si,Ii),Et=this._readableState;return si==="data"?(Et.readableListening=this.listenerCount("readable")>0,Et.flowing!==!1&&this.resume()):si==="readable"&&!Et.endEmitted&&!Et.readableListening&&(Et.readableListening=Et.needReadable=!0,Et.flowing=!1,Et.emittedReadable=!1,de("on readable",Et.length,Et.reading),Et.length?ai(this):Et.reading||V.nextTick(wi,this)),oi},jt.prototype.addListener=jt.prototype.on,jt.prototype.removeListener=function(si,Ii){var oi=Ce.prototype.removeListener.call(this,si,Ii);return si==="readable"&&V.nextTick(hi,this),oi},jt.prototype.removeAllListeners=function(si){var Ii=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&V.nextTick(hi,this),Ii};function hi(si){var Ii=si._readableState;Ii.readableListening=si.listenerCount("readable")>0,Ii.resumeScheduled&&!Ii.paused?Ii.flowing=!0:si.listenerCount("data")>0&&si.resume()}function wi(si){de("readable nexttick read 0"),si.read(0)}jt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,Ci(this,si)),si.paused=!1,this};function Ci(si,Ii){Ii.resumeScheduled||(Ii.resumeScheduled=!0,V.nextTick(mi,si,Ii))}function mi(si,Ii){de("resume",Ii.reading),Ii.reading||si.read(0),Ii.resumeScheduled=!1,si.emit("resume"),Ni(si),Ii.flowing&&!Ii.reading&&si.read(0)}jt.prototype.pause=function(){return de("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(de("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(si){var Ii=si._readableState;for(de("flow",Ii.flowing);Ii.flowing&&si.read()!==null;);}jt.prototype.wrap=function(si){var Ii=this,oi=this._readableState,Et=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var ui=oi.decoder.end();ui&&ui.length&&Ii.push(ui)}Ii.push(null)}),si.on("data",function(ui){if(de("wrapped data"),oi.decoder&&(ui=oi.decoder.write(ui)),!(oi.objectMode&&ui==null)&&!(!oi.objectMode&&(!ui||!ui.length))){var vi=Ii.push(ui);vi||(Et=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(vi){return function(){return si[vi].apply(si,arguments)}}(ii));for(var ri=0;ri<qe.length;ri++)si.on(qe[ri],this.emit.bind(this,qe[ri]));return this._read=function(ui){de("wrapped _read",ui),Et&&(Et=!1,si.resume())},this},typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return Ve===void 0&&(Ve=r("./internal/streams/async_iterator")),Ve(this)}),Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ii){this._readableState&&(this._readableState.flowing=Ii)}}),jt._fromList=Mi,Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Mi(si,Ii){if(Ii.length===0)return null;var oi;return Ii.objectMode?oi=Ii.buffer.shift():!si||si>=Ii.length?(Ii.decoder?oi=Ii.buffer.join(""):Ii.buffer.length===1?oi=Ii.buffer.first():oi=Ii.buffer.concat(Ii.length),Ii.buffer.clear()):oi=Ii.buffer.consume(si,Ii.decoder),oi}function fi(si){var Ii=si._readableState;de("endReadable",Ii.endEmitted),Ii.endEmitted||(Ii.ended=!0,V.nextTick(zi,Ii,si))}function zi(si,Ii){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,Ii.readable=!1,Ii.emit("end"),si.autoDestroy)){var oi=Ii._writableState;(!oi||oi.autoDestroy&&oi.finished)&&Ii.destroy()}}typeof Symbol=="function"&&(jt.from=function(si,Ii){return Oe===void 0&&(Oe=r("./internal/streams/from")),Oe(jt,si,Ii)});function Si(si,Ii){for(var oi=0,Et=si.length;oi<Et;oi++)if(si[oi]===Ii)return oi;return-1}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(r,g,k){g.exports=le;var V=r("../errors").codes,$=V.ERR_METHOD_NOT_IMPLEMENTED,oe=V.ERR_MULTIPLE_CALLBACK,re=V.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=V.ERR_TRANSFORM_WITH_LENGTH_0,ie=r("./_stream_duplex");r("inherits")(le,ie);function ae(de,Ne){var he=this._transformState;he.transforming=!1;var pe=he.writecb;if(pe===null)return this.emit("error",new oe);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),pe(de);var ze=this._readableState;ze.reading=!1,(ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}function le(de){if(!(this instanceof le))return new le(de);ie.call(this,de),this._transformState={afterTransform:ae.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,de&&(typeof de.transform=="function"&&(this._transform=de.transform),typeof de.flush=="function"&&(this._flush=de.flush)),this.on("prefinish",Ie)}function Ie(){var de=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(Ne,he){ue(de,Ne,he)}):ue(this,null,null)}le.prototype.push=function(de,Ne){return this._transformState.needTransform=!1,ie.prototype.push.call(this,de,Ne)},le.prototype._transform=function(de,Ne,he){he(new $("_transform()"))},le.prototype._write=function(de,Ne,he){var pe=this._transformState;if(pe.writecb=he,pe.writechunk=de,pe.writeencoding=Ne,!pe.transforming){var ze=this._readableState;(pe.needTransform||ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}},le.prototype._read=function(de){var Ne=this._transformState;Ne.writechunk!==null&&!Ne.transforming?(Ne.transforming=!0,this._transform(Ne.writechunk,Ne.writeencoding,Ne.afterTransform)):Ne.needTransform=!0},le.prototype._destroy=function(de,Ne){ie.prototype._destroy.call(this,de,function(he){Ne(he)})};function ue(de,Ne,he){if(Ne)return de.emit("error",Ne);if(he!=null&&de.push(he),de._writableState.length)throw new Ce;if(de._transformState.transforming)throw new re;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,k){(function(V,$){(function(){g.exports=kt;function oe(Ni){var Mi=this;this.next=null,this.entry=null,this.finish=function(){mi(Mi,Ni)}}var re;kt.WritableState=qe;var Ce={deprecate:r("util-deprecate")},ie=r("./internal/streams/stream"),ae=r("buffer").Buffer,le=$.Uint8Array||function(){};function Ie(Ni){return ae.from(Ni)}function ue(Ni){return ae.isBuffer(Ni)||Ni instanceof le}var de=r("./internal/streams/destroy"),Ne=r("./internal/streams/state"),he=Ne.getHighWaterMark,pe=r("../errors").codes,ze=pe.ERR_INVALID_ARG_TYPE,Fe=pe.ERR_METHOD_NOT_IMPLEMENTED,xe=pe.ERR_MULTIPLE_CALLBACK,_e=pe.ERR_STREAM_CANNOT_PIPE,Dt=pe.ERR_STREAM_DESTROYED,$e=pe.ERR_STREAM_NULL_VALUES,Ue=pe.ERR_STREAM_WRITE_AFTER_END,Ve=pe.ERR_UNKNOWN_ENCODING,Oe=de.errorOrDestroy;r("inherits")(kt,ie);function At(){}function qe(Ni,Mi,fi){re=re||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=Mi instanceof re),this.objectMode=!!Ni.objectMode,fi&&(this.objectMode=this.objectMode||!!Ni.writableObjectMode),this.highWaterMark=he(this,Ni,"writableHighWaterMark",fi),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var zi=Ni.decodeStrings===!1;this.decodeStrings=!zi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Si){li(Mi,Si)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ni.emitClose!==!1,this.autoDestroy=!!Ni.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oe(this)}qe.prototype.getBuffer=function(){for(var Mi=this.bufferedRequest,fi=[];Mi;)fi.push(Mi),Mi=Mi.next;return fi},function(){try{Object.defineProperty(qe.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Lt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Lt=Function.prototype[Symbol.hasInstance],Object.defineProperty(kt,Symbol.hasInstance,{value:function(Mi){return Lt.call(this,Mi)?!0:this!==kt?!1:Mi&&Mi._writableState instanceof qe}})):Lt=function(Mi){return Mi instanceof this};function kt(Ni){re=re||r("./_stream_duplex");var Mi=this instanceof re;if(!Mi&&!Lt.call(kt,this))return new kt(Ni);this._writableState=new qe(Ni,this,Mi),this.writable=!0,Ni&&(typeof Ni.write=="function"&&(this._write=Ni.write),typeof Ni.writev=="function"&&(this._writev=Ni.writev),typeof Ni.destroy=="function"&&(this._destroy=Ni.destroy),typeof Ni.final=="function"&&(this._final=Ni.final)),ie.call(this)}kt.prototype.pipe=function(){Oe(this,new _e)};function jt(Ni,Mi){var fi=new Ue;Oe(Ni,fi),V.nextTick(Mi,fi)}function ti(Ni,Mi,fi,zi){var Si;return fi===null?Si=new $e:typeof fi!="string"&&!Mi.objectMode&&(Si=new ze("chunk",["string","Buffer"],fi)),Si?(Oe(Ni,Si),V.nextTick(zi,Si),!1):!0}kt.prototype.write=function(Ni,Mi,fi){var zi=this._writableState,Si=!1,si=!zi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof Mi=="function"&&(fi=Mi,Mi=null),si?Mi="buffer":Mi||(Mi=zi.defaultEncoding),typeof fi!="function"&&(fi=At),zi.ending?jt(this,fi):(si||ti(this,zi,Ni,fi))&&(zi.pendingcb++,Si=Pt(this,zi,si,Ni,Mi,fi)),Si},kt.prototype.cork=function(){this._writableState.corked++},kt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&pi(this,Ni))},kt.prototype.setDefaultEncoding=function(Mi){if(typeof Mi=="string"&&(Mi=Mi.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Mi+"").toLowerCase())>-1))throw new Ve(Mi);return this._writableState.defaultEncoding=Mi,this},Object.defineProperty(kt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,Mi,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof Mi=="string"&&(Mi=ae.from(Mi,fi)),Mi}Object.defineProperty(kt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Pt(Ni,Mi,fi,zi,Si,si){if(!fi){var Ii=ei(Mi,zi,Si);zi!==Ii&&(fi=!0,Si="buffer",zi=Ii)}var oi=Mi.objectMode?1:zi.length;Mi.length+=oi;var Et=Mi.length<Mi.highWaterMark;if(Et||(Mi.needDrain=!0),Mi.writing||Mi.corked){var ii=Mi.lastBufferedRequest;Mi.lastBufferedRequest={chunk:zi,encoding:Si,isBuf:fi,callback:si,next:null},ii?ii.next=Mi.lastBufferedRequest:Mi.bufferedRequest=Mi.lastBufferedRequest,Mi.bufferedRequestCount+=1}else ni(Ni,Mi,!1,oi,zi,Si,si);return Et}function ni(Ni,Mi,fi,zi,Si,si,Ii){Mi.writelen=zi,Mi.writecb=Ii,Mi.writing=!0,Mi.sync=!0,Mi.destroyed?Mi.onwrite(new Dt("write")):fi?Ni._writev(Si,Mi.onwrite):Ni._write(Si,si,Mi.onwrite),Mi.sync=!1}function gi(Ni,Mi,fi,zi,Si){--Mi.pendingcb,fi?(V.nextTick(Si,zi),V.nextTick(wi,Ni,Mi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi)):(Si(zi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi),wi(Ni,Mi))}function di(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function li(Ni,Mi){var fi=Ni._writableState,zi=fi.sync,Si=fi.writecb;if(typeof Si!="function")throw new xe;if(di(fi),Mi)gi(Ni,fi,zi,Mi,Si);else{var si=yi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&pi(Ni,fi),zi?V.nextTick(ai,Ni,fi,si,Si):ai(Ni,fi,si,Si)}}function ai(Ni,Mi,fi,zi){fi||ci(Ni,Mi),Mi.pendingcb--,zi(),wi(Ni,Mi)}function ci(Ni,Mi){Mi.length===0&&Mi.needDrain&&(Mi.needDrain=!1,Ni.emit("drain"))}function pi(Ni,Mi){Mi.bufferProcessing=!0;var fi=Mi.bufferedRequest;if(Ni._writev&&fi&&fi.next){var zi=Mi.bufferedRequestCount,Si=new Array(zi),si=Mi.corkedRequestsFree;si.entry=fi;for(var Ii=0,oi=!0;fi;)Si[Ii]=fi,fi.isBuf||(oi=!1),fi=fi.next,Ii+=1;Si.allBuffers=oi,ni(Ni,Mi,!0,Mi.length,Si,"",si.finish),Mi.pendingcb++,Mi.lastBufferedRequest=null,si.next?(Mi.corkedRequestsFree=si.next,si.next=null):Mi.corkedRequestsFree=new oe(Mi),Mi.bufferedRequestCount=0}else{for(;fi;){var Et=fi.chunk,ii=fi.encoding,ri=fi.callback,ui=Mi.objectMode?1:Et.length;if(ni(Ni,Mi,!1,ui,Et,ii,ri),fi=fi.next,Mi.bufferedRequestCount--,Mi.writing)break}fi===null&&(Mi.lastBufferedRequest=null)}Mi.bufferedRequest=fi,Mi.bufferProcessing=!1}kt.prototype._write=function(Ni,Mi,fi){fi(new Fe("_write()"))},kt.prototype._writev=null,kt.prototype.end=function(Ni,Mi,fi){var zi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,Mi=null):typeof Mi=="function"&&(fi=Mi,Mi=null),Ni!=null&&this.write(Ni,Mi),zi.corked&&(zi.corked=1,this.uncork()),zi.ending||Ci(this,zi,fi),this},Object.defineProperty(kt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function Ai(Ni,Mi){Ni._final(function(fi){Mi.pendingcb--,fi&&Oe(Ni,fi),Mi.prefinished=!0,Ni.emit("prefinish"),wi(Ni,Mi)})}function hi(Ni,Mi){!Mi.prefinished&&!Mi.finalCalled&&(typeof Ni._final=="function"&&!Mi.destroyed?(Mi.pendingcb++,Mi.finalCalled=!0,V.nextTick(Ai,Ni,Mi)):(Mi.prefinished=!0,Ni.emit("prefinish")))}function wi(Ni,Mi){var fi=yi(Mi);if(fi&&(hi(Ni,Mi),Mi.pendingcb===0&&(Mi.finished=!0,Ni.emit("finish"),Mi.autoDestroy))){var zi=Ni._readableState;(!zi||zi.autoDestroy&&zi.endEmitted)&&Ni.destroy()}return fi}function Ci(Ni,Mi,fi){Mi.ending=!0,wi(Ni,Mi),fi&&(Mi.finished?V.nextTick(fi):Ni.once("finish",fi)),Mi.ended=!0,Ni.writable=!1}function mi(Ni,Mi,fi){var zi=Ni.entry;for(Ni.entry=null;zi;){var Si=zi.callback;Mi.pendingcb--,Si(fi),zi=zi.next}Mi.corkedRequestsFree.next=Ni}Object.defineProperty(kt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Mi){this._writableState&&(this._writableState.destroyed=Mi)}}),kt.prototype.destroy=de.destroy,kt.prototype._undestroy=de.undestroy,kt.prototype._destroy=function(Ni,Mi){Mi(Ni)}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(r,g,k){(function(V){(function(){var $;function oe(Dt,$e,Ue){return $e in Dt?Object.defineProperty(Dt,$e,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):Dt[$e]=Ue,Dt}var re=r("./end-of-stream"),Ce=Symbol("lastResolve"),ie=Symbol("lastReject"),ae=Symbol("error"),le=Symbol("ended"),Ie=Symbol("lastPromise"),ue=Symbol("handlePromise"),de=Symbol("stream");function Ne(Dt,$e){return{value:Dt,done:$e}}function he(Dt){var $e=Dt[Ce];if($e!==null){var Ue=Dt[de].read();Ue!==null&&(Dt[Ie]=null,Dt[Ce]=null,Dt[ie]=null,$e(Ne(Ue,!1)))}}function pe(Dt){V.nextTick(he,Dt)}function ze(Dt,$e){return function(Ue,Ve){Dt.then(function(){if($e[le]){Ue(Ne(void 0,!0));return}$e[ue](Ue,Ve)},Ve)}}var Fe=Object.getPrototypeOf(function(){}),xe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Ue=this[ae];if(Ue!==null)return Promise.reject(Ue);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,Lt){V.nextTick(function(){$e[ae]?Lt($e[ae]):qe(Ne(void 0,!0))})});var Ve=this[Ie],Oe;if(Ve)Oe=new Promise(ze(Ve,this));else{var At=this[de].read();if(At!==null)return Promise.resolve(Ne(At,!1));Oe=new Promise(this[ue])}return this[Ie]=Oe,Oe}},oe($,Symbol.asyncIterator,function(){return this}),oe($,"return",function(){var $e=this;return new Promise(function(Ue,Ve){$e[de].destroy(null,function(Oe){if(Oe){Ve(Oe);return}Ue(Ne(void 0,!0))})})}),$),Fe),_e=function($e){var Ue,Ve=Object.create(xe,(Ue={},oe(Ue,de,{value:$e,writable:!0}),oe(Ue,Ce,{value:null,writable:!0}),oe(Ue,ie,{value:null,writable:!0}),oe(Ue,ae,{value:null,writable:!0}),oe(Ue,le,{value:$e._readableState.endEmitted,writable:!0}),oe(Ue,ue,{value:function(At,qe){var Lt=Ve[de].read();Lt?(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Ne(Lt,!1))):(Ve[Ce]=At,Ve[ie]=qe)},writable:!0}),Ue));return Ve[Ie]=null,re($e,function(Oe){if(Oe&&Oe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var At=Ve[ie];At!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Oe)),Ve[ae]=Oe;return}var qe=Ve[Ce];qe!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,qe(Ne(void 0,!0))),Ve[le]=!0}),$e.on("readable",pe.bind(null,Ve)),Ve};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,k){function V(he,pe){var ze=Object.keys(he);if(Object.getOwnPropertySymbols){var Fe=Object.getOwnPropertySymbols(he);pe&&(Fe=Fe.filter(function(xe){return Object.getOwnPropertyDescriptor(he,xe).enumerable})),ze.push.apply(ze,Fe)}return ze}function $(he){for(var pe=1;pe<arguments.length;pe++){var ze=arguments[pe]!=null?arguments[pe]:{};pe%2?V(Object(ze),!0).forEach(function(Fe){oe(he,Fe,ze[Fe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(ze)):V(Object(ze)).forEach(function(Fe){Object.defineProperty(he,Fe,Object.getOwnPropertyDescriptor(ze,Fe))})}return he}function oe(he,pe,ze){return pe in he?Object.defineProperty(he,pe,{value:ze,enumerable:!0,configurable:!0,writable:!0}):he[pe]=ze,he}function re(he,pe){if(!(he instanceof pe))throw new TypeError("Cannot call a class as a function")}function Ce(he,pe){for(var ze=0;ze<pe.length;ze++){var Fe=pe[ze];Fe.enumerable=Fe.enumerable||!1,Fe.configurable=!0,"value"in Fe&&(Fe.writable=!0),Object.defineProperty(he,Fe.key,Fe)}}function ie(he,pe,ze){return pe&&Ce(he.prototype,pe),ze&&Ce(he,ze),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,pe,ze){le.prototype.copy.call(he,pe,ze)}g.exports=function(){function he(){re(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(ze){var Fe={data:ze,next:null};this.length>0?this.tail.next=Fe:this.head=Fe,this.tail=Fe,++this.length}},{key:"unshift",value:function(ze){var Fe={data:ze,next:this.head};this.length===0&&(this.tail=Fe),this.head=Fe,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ze=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ze}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ze){if(this.length===0)return"";for(var Fe=this.head,xe=""+Fe.data;Fe=Fe.next;)xe+=ze+Fe.data;return xe}},{key:"concat",value:function(ze){if(this.length===0)return le.alloc(0);for(var Fe=le.allocUnsafe(ze>>>0),xe=this.head,_e=0;xe;)Ne(xe.data,Fe,_e),_e+=xe.data.length,xe=xe.next;return Fe}},{key:"consume",value:function(ze,Fe){var xe;return ze<this.head.data.length?(xe=this.head.data.slice(0,ze),this.head.data=this.head.data.slice(ze)):ze===this.head.data.length?xe=this.shift():xe=Fe?this._getString(ze):this._getBuffer(ze),xe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ze){var Fe=this.head,xe=1,_e=Fe.data;for(ze-=_e.length;Fe=Fe.next;){var Dt=Fe.data,$e=ze>Dt.length?Dt.length:ze;if($e===Dt.length?_e+=Dt:_e+=Dt.slice(0,ze),ze-=$e,ze===0){$e===Dt.length?(++xe,Fe.next?this.head=Fe.next:this.head=this.tail=null):(this.head=Fe,Fe.data=Dt.slice($e));break}++xe}return this.length-=xe,_e}},{key:"_getBuffer",value:function(ze){var Fe=le.allocUnsafe(ze),xe=this.head,_e=1;for(xe.data.copy(Fe),ze-=xe.data.length;xe=xe.next;){var Dt=xe.data,$e=ze>Dt.length?Dt.length:ze;if(Dt.copy(Fe,Fe.length-ze,0,$e),ze-=$e,ze===0){$e===Dt.length?(++_e,xe.next?this.head=xe.next:this.head=this.tail=null):(this.head=xe,xe.data=Dt.slice($e));break}++_e}return this.length-=_e,Fe}},{key:de,value:function(ze,Fe){return ue(this,$({},Fe,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,k){(function(V){(function(){function $(le,Ie){var ue=this,de=this._readableState&&this._readableState.destroyed,Ne=this._writableState&&this._writableState.destroyed;return de||Ne?(Ie?Ie(le):le&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,V.nextTick(ie,this,le)):V.nextTick(ie,this,le)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(le||null,function(he){!Ie&&he?ue._writableState?ue._writableState.errorEmitted?V.nextTick(re,ue):(ue._writableState.errorEmitted=!0,V.nextTick(oe,ue,he)):V.nextTick(oe,ue,he):Ie?(V.nextTick(re,ue),Ie(he)):V.nextTick(re,ue)}),this)}function oe(le,Ie){ie(le,Ie),re(le)}function re(le){le._writableState&&!le._writableState.emitClose||le._readableState&&!le._readableState.emitClose||le.emit("close")}function Ce(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ie(le,Ie){le.emit("error",Ie)}function ae(le,Ie){var ue=le._readableState,de=le._writableState;ue&&ue.autoDestroy||de&&de.autoDestroy?le.destroy(Ie):le.emit("error",Ie)}g.exports={destroy:$,undestroy:Ce,errorOrDestroy:ae}}).call(this)}).call(this,r("_process"))},{_process:50}],64:[function(r,g,k){var V=r("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function $(ie){var ae=!1;return function(){if(!ae){ae=!0;for(var le=arguments.length,Ie=new Array(le),ue=0;ue<le;ue++)Ie[ue]=arguments[ue];ie.apply(this,Ie)}}}function oe(){}function re(ie){return ie.setHeader&&typeof ie.abort=="function"}function Ce(ie,ae,le){if(typeof ae=="function")return Ce(ie,null,ae);ae||(ae={}),le=$(le||oe);var Ie=ae.readable||ae.readable!==!1&&ie.readable,ue=ae.writable||ae.writable!==!1&&ie.writable,de=function(){ie.writable||he()},Ne=ie._writableState&&ie._writableState.finished,he=function(){ue=!1,Ne=!0,Ie||le.call(ie)},pe=ie._readableState&&ie._readableState.endEmitted,ze=function(){Ie=!1,pe=!0,ue||le.call(ie)},Fe=function($e){le.call(ie,$e)},xe=function(){var $e;if(Ie&&!pe)return(!ie._readableState||!ie._readableState.ended)&&($e=new V),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new V),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return re(ie)?(ie.on("complete",he),ie.on("abort",xe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",ze),ie.on("finish",he),ae.error!==!1&&ie.on("error",Fe),ie.on("close",xe),function(){ie.removeListener("complete",he),ie.removeListener("abort",xe),ie.removeListener("request",_e),ie.req&&ie.req.removeListener("finish",he),ie.removeListener("end",de),ie.removeListener("close",de),ie.removeListener("finish",he),ie.removeListener("end",ze),ie.removeListener("error",Fe),ie.removeListener("close",xe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,k){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,k){var V;function $(he){var pe=!1;return function(){pe||(pe=!0,he.apply(void 0,arguments))}}var oe=r("../../../errors").codes,re=oe.ERR_MISSING_ARGS,Ce=oe.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,pe,ze,Fe){Fe=$(Fe);var xe=!1;he.on("close",function(){xe=!0}),V===void 0&&(V=r("./end-of-stream")),V(he,{readable:pe,writable:ze},function(Dt){if(Dt)return Fe(Dt);xe=!0,Fe()});var _e=!1;return function(Dt){if(!xe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Fe(Dt||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,pe){return he.pipe(pe)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,pe=new Array(he),ze=0;ze<he;ze++)pe[ze]=arguments[ze];var Fe=de(pe);if(Array.isArray(pe[0])&&(pe=pe[0]),pe.length<2)throw new re("streams");var xe,_e=pe.map(function(Dt,$e){var Ue=$e<pe.length-1,Ve=$e>0;return le(Dt,Ue,Ve,function(Oe){xe||(xe=Oe),Oe&&_e.forEach(Ie),!Ue&&(_e.forEach(Ie),Fe(xe))})});return pe.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,k){var V=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(re,Ce,ie){return re.highWaterMark!=null?re.highWaterMark:Ce?re[ie]:null}function oe(re,Ce,ie,ae){var le=$(Ce,ae,ie);if(le!=null){if(!(isFinite(le)&&Math.floor(le)===le)||le<0){var Ie=ae?ie:"highWaterMark";throw new V(Ie,le)}return Math.floor(le)}return re.objectMode?16:16*1024}g.exports={getHighWaterMark:oe}},{"../../../errors":55}],68:[function(r,g,k){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,k){k=g.exports=r("./lib/_stream_readable.js"),k.Stream=k,k.Readable=k,k.Writable=r("./lib/_stream_writable.js"),k.Duplex=r("./lib/_stream_duplex.js"),k.Transform=r("./lib/_stream_transform.js"),k.PassThrough=r("./lib/_stream_passthrough.js"),k.finished=r("./lib/internal/streams/end-of-stream.js"),k.pipeline=r("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(r,g,k){function V(oe,re,Ce){var ie=this;this._callback=oe,this._args=Ce,this._interval=setInterval(oe,re,this._args),this.reschedule=function(ae){ae||(ae=ie._interval),ie._interval&&clearInterval(ie._interval),ie._interval=setInterval(ie._callback,ae,ie._args)},this.clear=function(){ie._interval&&(clearInterval(ie._interval),ie._interval=void 0)},this.destroy=function(){ie._interval&&clearInterval(ie._interval),ie._callback=void 0,ie._interval=void 0,ie._args=void 0}}function $(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var oe;if(arguments.length>0){oe=new Array(arguments.length-2);for(var re=0;re<oe.length;re++)oe[re]=arguments[re+2]}return new V(arguments[0],arguments[1],oe)}g.exports=$},{}],71:[function(r,g,k){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,k){(function(V){(function(){g.exports=oe;function $(Ce){return Ce instanceof V?V.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function oe(Ce){if(Ce=Ce||{},Ce.circles)return re(Ce);return Ce.proto?le:ae;function ie(Ie,ue){for(var de=Object.keys(Ie),Ne=new Array(de.length),he=0;he<de.length;he++){var pe=de[he],ze=Ie[pe];typeof ze!="object"||ze===null?Ne[pe]=ze:ze instanceof Date?Ne[pe]=new Date(ze):ArrayBuffer.isView(ze)?Ne[pe]=$(ze):Ne[pe]=ue(ze)}return Ne}function ae(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,ae);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),ae));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),ae));var ue={};for(var de in Ie)if(Object.hasOwnProperty.call(Ie,de)!==!1){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),ae)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),ae)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=ae(Ne)}return ue}function le(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,le);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),le));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),le));var ue={};for(var de in Ie){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),le)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),le)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=le(Ne)}return ue}}function re(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),pe=new Array(he.length),ze=0;ze<he.length;ze++){var Fe=he[ze],xe=de[Fe];if(typeof xe!="object"||xe===null)pe[Fe]=xe;else if(xe instanceof Date)pe[Fe]=new Date(xe);else if(ArrayBuffer.isView(xe))pe[Fe]=$(xe);else{var _e=ie.indexOf(xe);_e!==-1?pe[Fe]=ae[_e]:pe[Fe]=Ne(xe)}}return pe}function Ie(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,Ie);if(de instanceof Map)return new Map(le(Array.from(de),Ie));if(de instanceof Set)return new Set(le(Array.from(de),Ie));var Ne={};ie.push(de),ae.push(Ne);for(var he in de)if(Object.hasOwnProperty.call(de,he)!==!1){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),Ie));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),Ie));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=Ie(pe)}}return ie.pop(),ae.pop(),Ne}function ue(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,ue);if(de instanceof Map)return new Map(le(Array.from(de),ue));if(de instanceof Set)return new Set(le(Array.from(de),ue));var Ne={};ie.push(de),ae.push(Ne);for(var he in de){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),ue));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),ue));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=ue(pe)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,k){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=r("buffer"),$=V.Buffer;function oe(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=V:(oe(V,k),k.Buffer=re);function re(Ce,ie,ae){return $(Ce,ie,ae)}re.prototype=Object.create($.prototype),oe($,re),re.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},re.alloc=function(Ce,ie,ae){if(typeof Ce!="number")throw new TypeError("Argument must be a number");var le=$(Ce);return ie!==void 0?typeof ae=="string"?le.fill(ie,ae):le.fill(ie):le.fill(0),le},re.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},re.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return V.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,k){g.exports=V;function V(oe){var re=oe._readableState;return re?re.objectMode||typeof oe._duplexState=="number"?oe.read():oe.read($(re)):null}function $(oe){return oe.buffer.length?oe.buffer.head?oe.buffer.head.data.length:oe.buffer[0].length:oe.length}},{}],75:[function(r,g,k){var V=r("safe-buffer").Buffer,$=V.isEncoding||function(_e){switch(_e=""+_e,_e&&_e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oe(_e){if(!_e)return"utf8";for(var Dt;;)switch(_e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _e;default:if(Dt)return;_e=(""+_e).toLowerCase(),Dt=!0}}function re(_e){var Dt=oe(_e);if(typeof Dt!="string"&&(V.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return Dt||_e}k.StringDecoder=Ce;function Ce(_e){this.encoding=re(_e);var Dt;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,Dt=4;break;case"utf8":this.fillLast=Ie,Dt=4;break;case"base64":this.text=pe,this.end=ze,Dt=3;break;default:this.write=Fe,this.end=xe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(Dt)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var Dt,$e;if(this.lastNeed){if(Dt=this.fillLast(_e),Dt===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?Dt?Dt+this.text(_e,$e):this.text(_e,$e):Dt||""},Ce.prototype.end=de,Ce.prototype.text=ue,Ce.prototype.fillLast=function(_e){if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_e.length),this.lastNeed-=_e.length};function ie(_e){return _e<=127?0:_e>>5===6?2:_e>>4===14?3:_e>>3===30?4:_e>>6===2?-1:-2}function ae(_e,Dt,$e){var Ue=Dt.length-1;if(Ue<$e)return 0;var Ve=ie(Dt[Ue]);return Ve>=0?(Ve>0&&(_e.lastNeed=Ve-1),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(_e.lastNeed=Ve-2),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(Ve===2?Ve=0:_e.lastNeed=Ve-3),Ve):0))}function le(_e,Dt,$e){if((Dt[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&Dt.length>1){if((Dt[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&Dt.length>2&&(Dt[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var Dt=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,Dt,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,Dt,0,_e.length),this.lastNeed-=_e.length}function ue(_e,Dt){var $e=ae(this,_e,Dt);if(!this.lastNeed)return _e.toString("utf8",Dt);this.lastTotal=$e;var Ue=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Ue),_e.toString("utf8",Dt,Ue)}function de(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+"�":Dt}function Ne(_e,Dt){if((_e.length-Dt)%2===0){var $e=_e.toString("utf16le",Dt);if($e){var Ue=$e.charCodeAt($e.length-1);if(Ue>=55296&&Ue<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1],$e.slice(0,-1)}return $e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_e[_e.length-1],_e.toString("utf16le",Dt,_e.length-1)}function he(_e){var Dt=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return Dt+this.lastChar.toString("utf16le",0,$e)}return Dt}function pe(_e,Dt){var $e=(_e.length-Dt)%3;return $e===0?_e.toString("base64",Dt):(this.lastNeed=3-$e,this.lastTotal=3,$e===1?this.lastChar[0]=_e[_e.length-1]:(this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1]),_e.toString("base64",Dt,_e.length-$e))}function ze(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+this.lastChar.toString("base64",0,3-this.lastNeed):Dt}function Fe(_e){return _e.toString(this.encoding)}function xe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,k){var V=r("punycode"),$=r("./util");k.parse=Dt,k.resolve=Ue,k.resolveObject=Ve,k.format=$e,k.Url=oe;function oe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var re=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1303
- `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ze={javascript:!0,"javascript:":!0},Fe={javascript:!0,"javascript:":!0},xe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function Dt(Oe,At,qe){if(Oe&&$.isObject(Oe)&&Oe instanceof oe)return Oe;var Lt=new oe;return Lt.parse(Oe,At,qe),Lt}oe.prototype.parse=function(Oe,At,qe){if(!$.isString(Oe))throw new TypeError("Parameter 'url' must be a string, not "+typeof Oe);var Lt=Oe.indexOf("?"),kt=Lt!==-1&&Lt<Oe.indexOf("#")?"?":"#",jt=Oe.split(kt),ti=/\\/g;jt[0]=jt[0].replace(ti,"/"),Oe=jt.join(kt);var ei=Oe;if(ei=ei.trim(),!qe&&Oe.split("#").length===1){var Pt=ie.exec(ei);if(Pt)return this.path=ei,this.href=ei,this.pathname=Pt[1],Pt[2]?(this.search=Pt[2],At?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):At&&(this.search="",this.query={}),this}var ni=re.exec(ei);if(ni){ni=ni[0];var gi=ni.toLowerCase();this.protocol=gi,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var di=ei.substr(0,2)==="//";di&&!(ni&&Fe[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Fe[ni]&&(di||ni&&!xe[ni])){for(var li=-1,ai=0;ai<de.length;ai++){var ci=ei.indexOf(de[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}var pi,yi;li===-1?yi=ei.lastIndexOf("@"):yi=ei.lastIndexOf("@",li),yi!==-1&&(pi=ei.slice(0,yi),ei=ei.slice(yi+1),this.auth=decodeURIComponent(pi)),li=-1;for(var ai=0;ai<ue.length;ai++){var ci=ei.indexOf(ue[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}li===-1&&(li=ei.length),this.host=ei.slice(0,li),ei=ei.slice(li),this.parseHost(),this.hostname=this.hostname||"";var Ai=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Ai)for(var hi=this.hostname.split(/\./),ai=0,wi=hi.length;ai<wi;ai++){var Ci=hi[ai];if(Ci&&!Ci.match(he)){for(var mi="",Ni=0,Mi=Ci.length;Ni<Mi;Ni++)Ci.charCodeAt(Ni)>127?mi+="x":mi+=Ci[Ni];if(!mi.match(he)){var fi=hi.slice(0,ai),zi=hi.slice(ai+1),Si=Ci.match(pe);Si&&(fi.push(Si[1]),zi.unshift(Si[2])),zi.length&&(ei="/"+zi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ai||(this.hostname=V.toASCII(this.hostname));var si=this.port?":"+this.port:"",Ii=this.hostname||"";this.host=Ii+si,this.href+=this.host,Ai&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!ze[gi])for(var ai=0,wi=Ie.length;ai<wi;ai++){var oi=Ie[ai];if(ei.indexOf(oi)!==-1){var Et=encodeURIComponent(oi);Et===oi&&(Et=escape(oi)),ei=ei.split(oi).join(Et)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var ri=ei.indexOf("?");if(ri!==-1?(this.search=ei.substr(ri),this.query=ei.substr(ri+1),At&&(this.query=_e.parse(this.query)),ei=ei.slice(0,ri)):At&&(this.search="",this.query={}),ei&&(this.pathname=ei),xe[gi]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",ui=this.search||"";this.path=si+ui}return this.href=this.format(),this};function $e(Oe){return $.isString(Oe)&&(Oe=Dt(Oe)),Oe instanceof oe?Oe.format():oe.prototype.format.call(Oe)}oe.prototype.format=function(){var Oe=this.auth||"";Oe&&(Oe=encodeURIComponent(Oe),Oe=Oe.replace(/%3A/i,":"),Oe+="@");var At=this.protocol||"",qe=this.pathname||"",Lt=this.hash||"",kt=!1,jt="";this.host?kt=Oe+this.host:this.hostname&&(kt=Oe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(kt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(jt=_e.stringify(this.query));var ti=this.search||jt&&"?"+jt||"";return At&&At.substr(-1)!==":"&&(At+=":"),this.slashes||(!At||xe[At])&&kt!==!1?(kt="//"+(kt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):kt||(kt=""),Lt&&Lt.charAt(0)!=="#"&&(Lt="#"+Lt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),At+kt+qe+ti+Lt};function Ue(Oe,At){return Dt(Oe,!1,!0).resolve(At)}oe.prototype.resolve=function(Oe){return this.resolveObject(Dt(Oe,!1,!0)).format()};function Ve(Oe,At){return Oe?Dt(Oe,!1,!0).resolveObject(At):At}oe.prototype.resolveObject=function(Oe){if($.isString(Oe)){var At=new oe;At.parse(Oe,!1,!0),Oe=At}for(var qe=new oe,Lt=Object.keys(this),kt=0;kt<Lt.length;kt++){var jt=Lt[kt];qe[jt]=this[jt]}if(qe.hash=Oe.hash,Oe.href==="")return qe.href=qe.format(),qe;if(Oe.slashes&&!Oe.protocol){for(var ti=Object.keys(Oe),ei=0;ei<ti.length;ei++){var Pt=ti[ei];Pt!=="protocol"&&(qe[Pt]=Oe[Pt])}return xe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(Oe.protocol&&Oe.protocol!==qe.protocol){if(!xe[Oe.protocol]){for(var ni=Object.keys(Oe),gi=0;gi<ni.length;gi++){var di=ni[gi];qe[di]=Oe[di]}return qe.href=qe.format(),qe}if(qe.protocol=Oe.protocol,!Oe.host&&!Fe[Oe.protocol]){for(var wi=(Oe.pathname||"").split("/");wi.length&&!(Oe.host=wi.shift()););Oe.host||(Oe.host=""),Oe.hostname||(Oe.hostname=""),wi[0]!==""&&wi.unshift(""),wi.length<2&&wi.unshift(""),qe.pathname=wi.join("/")}else qe.pathname=Oe.pathname;if(qe.search=Oe.search,qe.query=Oe.query,qe.host=Oe.host||"",qe.auth=Oe.auth,qe.hostname=Oe.hostname||Oe.host,qe.port=Oe.port,qe.pathname||qe.search){var li=qe.pathname||"",ai=qe.search||"";qe.path=li+ai}return qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe}var ci=qe.pathname&&qe.pathname.charAt(0)==="/",pi=Oe.host||Oe.pathname&&Oe.pathname.charAt(0)==="/",yi=pi||ci||qe.host&&Oe.pathname,Ai=yi,hi=qe.pathname&&qe.pathname.split("/")||[],wi=Oe.pathname&&Oe.pathname.split("/")||[],Ci=qe.protocol&&!xe[qe.protocol];if(Ci&&(qe.hostname="",qe.port=null,qe.host&&(hi[0]===""?hi[0]=qe.host:hi.unshift(qe.host)),qe.host="",Oe.protocol&&(Oe.hostname=null,Oe.port=null,Oe.host&&(wi[0]===""?wi[0]=Oe.host:wi.unshift(Oe.host)),Oe.host=null),yi=yi&&(wi[0]===""||hi[0]==="")),pi)qe.host=Oe.host||Oe.host===""?Oe.host:qe.host,qe.hostname=Oe.hostname||Oe.hostname===""?Oe.hostname:qe.hostname,qe.search=Oe.search,qe.query=Oe.query,hi=wi;else if(wi.length)hi||(hi=[]),hi.pop(),hi=hi.concat(wi),qe.search=Oe.search,qe.query=Oe.query;else if(!$.isNullOrUndefined(Oe.search)){if(Ci){qe.hostname=qe.host=hi.shift();var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return qe.search=Oe.search,qe.query=Oe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!hi.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=hi.slice(-1)[0],Mi=(qe.host||Oe.host||hi.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,zi=hi.length;zi>=0;zi--)Ni=hi[zi],Ni==="."?hi.splice(zi,1):Ni===".."?(hi.splice(zi,1),fi++):fi&&(hi.splice(zi,1),fi--);if(!yi&&!Ai)for(;fi--;fi)hi.unshift("..");yi&&hi[0]!==""&&(!hi[0]||hi[0].charAt(0)!=="/")&&hi.unshift(""),Mi&&hi.join("/").substr(-1)!=="/"&&hi.push("");var Si=hi[0]===""||hi[0]&&hi[0].charAt(0)==="/";if(Ci){qe.hostname=qe.host=Si?"":hi.length?hi.shift():"";var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return yi=yi||qe.host&&hi.length,yi&&!Si&&hi.unshift(""),hi.length?qe.pathname=hi.join("/"):(qe.pathname=null,qe.path=null),(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.auth=Oe.auth||qe.auth,qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe},oe.prototype.parseHost=function(){var Oe=this.host,At=Ce.exec(Oe);At&&(At=At[0],At!==":"&&(this.port=At.substr(1)),Oe=Oe.substr(0,Oe.length-At.length)),Oe&&(this.hostname=Oe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,k){g.exports={isString:function(V){return typeof V=="string"},isObject:function(V){return typeof V=="object"&&V!==null},isNull:function(V){return V===null},isNullOrUndefined:function(V){return V==null}}},{}],78:[function(r,g,k){(function(V){(function(){g.exports=$;function $(re,Ce){if(oe("noDeprecation"))return re;var ie=!1;function ae(){if(!ie){if(oe("throwDeprecation"))throw new Error(Ce);oe("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return re.apply(this,arguments)}return ae}function oe(re){try{if(!V.localStorage)return!1}catch{return!1}var Ce=V.localStorage[re];return Ce==null?!1:String(Ce).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],79:[function(r,g,k){g.exports=V;function V($,oe){if($&&oe)return V($)(oe);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){re[Ce]=$[Ce]}),re;function re(){for(var Ce=new Array(arguments.length),ie=0;ie<Ce.length;ie++)Ce[ie]=arguments[ie];var ae=$.apply(this,Ce),le=Ce[Ce.length-1];return typeof ae=="function"&&ae!==le&&Object.keys(le).forEach(function(Ie){ae[Ie]=le[Ie]}),ae}}},{}],80:[function(r,g,k){g.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],81:[function(r,g,k){g.exports=$;var V=Object.prototype.hasOwnProperty;function $(){for(var oe={},re=0;re<arguments.length;re++){var Ce=arguments[re];for(var ie in Ce)V.call(Ce,ie)&&(oe[ie]=Ce[ie])}return oe}},{}],82:[function(r,g,k){g.exports=function(V){V.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,k){g.exports=V,V.Node=Ce,V.create=V;function V(ie){var ae=this;if(ae instanceof V||(ae=new V),ae.tail=null,ae.head=null,ae.length=0,ie&&typeof ie.forEach=="function")ie.forEach(function(ue){ae.push(ue)});else if(arguments.length>0)for(var le=0,Ie=arguments.length;le<Ie;le++)ae.push(arguments[le]);return ae}V.prototype.removeNode=function(ie){if(ie.list!==this)throw new Error("removing node which does not belong to this list");var ae=ie.next,le=ie.prev;return ae&&(ae.prev=le),le&&(le.next=ae),ie===this.head&&(this.head=ae),ie===this.tail&&(this.tail=le),ie.list.length--,ie.next=null,ie.prev=null,ie.list=null,ae},V.prototype.unshiftNode=function(ie){if(ie!==this.head){ie.list&&ie.list.removeNode(ie);var ae=this.head;ie.list=this,ie.next=ae,ae&&(ae.prev=ie),this.head=ie,this.tail||(this.tail=ie),this.length++}},V.prototype.pushNode=function(ie){if(ie!==this.tail){ie.list&&ie.list.removeNode(ie);var ae=this.tail;ie.list=this,ie.prev=ae,ae&&(ae.next=ie),this.tail=ie,this.head||(this.head=ie),this.length++}},V.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},V.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},V.prototype.pop=function(){if(this.tail){var ie=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,ie}},V.prototype.shift=function(){if(this.head){var ie=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,ie}},V.prototype.forEach=function(ie,ae){ae=ae||this;for(var le=this.head,Ie=0;le!==null;Ie++)ie.call(ae,le.value,Ie,this),le=le.next},V.prototype.forEachReverse=function(ie,ae){ae=ae||this;for(var le=this.tail,Ie=this.length-1;le!==null;Ie--)ie.call(ae,le.value,Ie,this),le=le.prev},V.prototype.get=function(ie){for(var ae=0,le=this.head;le!==null&&ae<ie;ae++)le=le.next;if(ae===ie&&le!==null)return le.value},V.prototype.getReverse=function(ie){for(var ae=0,le=this.tail;le!==null&&ae<ie;ae++)le=le.prev;if(ae===ie&&le!==null)return le.value},V.prototype.map=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},V.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},V.prototype.reduce=function(ie,ae){var le,Ie=this.head;if(arguments.length>1)le=ae;else if(this.head)Ie=this.head.next,le=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=0;Ie!==null;ue++)le=ie(le,Ie.value,ue),Ie=Ie.next;return le},V.prototype.reduceReverse=function(ie,ae){var le,Ie=this.tail;if(arguments.length>1)le=ae;else if(this.tail)Ie=this.tail.prev,le=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=this.length-1;Ie!==null;ue--)le=ie(le,Ie.value,ue),Ie=Ie.prev;return le},V.prototype.toArray=function(){for(var ie=new Array(this.length),ae=0,le=this.head;le!==null;ae++)ie[ae]=le.value,le=le.next;return ie},V.prototype.toArrayReverse=function(){for(var ie=new Array(this.length),ae=0,le=this.tail;le!==null;ae++)ie[ae]=le.value,le=le.prev;return ie},V.prototype.slice=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(;ue!==null&&Ie<ae;Ie++,ue=ue.next)le.push(ue.value);return le},V.prototype.sliceReverse=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=this.length,ue=this.tail;ue!==null&&Ie>ae;Ie--)ue=ue.prev;for(;ue!==null&&Ie>ie;Ie--,ue=ue.prev)le.push(ue.value);return le},V.prototype.splice=function(ie,ae,...le){ie>this.length&&(ie=this.length-1),ie<0&&(ie=this.length+ie);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(var de=[],Ie=0;ue&&Ie<ae;Ie++)de.push(ue.value),ue=this.removeNode(ue);ue===null&&(ue=this.tail),ue!==this.head&&ue!==this.tail&&(ue=ue.prev);for(var Ie=0;Ie<le.length;Ie++)ue=$(this,ue,le[Ie]);return de},V.prototype.reverse=function(){for(var ie=this.head,ae=this.tail,le=ie;le!==null;le=le.prev){var Ie=le.prev;le.prev=le.next,le.next=Ie}return this.head=ae,this.tail=ie,this};function $(ie,ae,le){var Ie=ae===ie.head?new Ce(le,null,ae,ie):new Ce(le,ae,ae.next,ie);return Ie.next===null&&(ie.tail=Ie),Ie.prev===null&&(ie.head=Ie),ie.length++,Ie}function oe(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function re(ie,ae){ie.head=new Ce(ae,null,ie.head,ie),ie.tail||(ie.tail=ie.head),ie.length++}function Ce(ie,ae,le,Ie){if(!(this instanceof Ce))return new Ce(ie,ae,le,Ie);this.list=Ie,this.value=ie,ae?(ae.next=this,this.prev=ae):this.prev=null,le?(le.prev=this,this.next=le):this.next=null}try{r("./iterator.js")(V)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,k)=>{client=mqttExports.connect(i,{username:n,password:r}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(g,{qos:1})}),client.on("message",k)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1=["transform"],_hoisted_2=["transform","onClick"],_hoisted_3=["transform"],_hoisted_4=["xlink:href","id","transform"],_hoisted_5=["id"],_sfc_main=vue.defineComponent({__name:"index",props:{data:{},canvasDrag:{type:Boolean,default:!0}},setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance();Object.keys(vueComp).forEach(ue=>{var de;Object.keys((de=g==null?void 0:g.appContext)==null?void 0:de.components).includes(ue)||g==null||g.appContext.app.component(ue,vueComp[ue])});const k=vue.reactive(r.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50}},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),V=useGlobalStore(pinia),$=ue=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection)return;if(!r.canvasDrag){console.log(r.canvasDrag);return}const{clientX:de,clientY:Ne}=ue;V.mouse_info.new_position_x=V.mouse_info.now_position_x+de-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+Ne-V.mouse_info.position_y,V.intention==EGlobalStoreIntention.MoveCanvas&&(k.layout_center.x=V.mouse_info.new_position_x,k.layout_center.y=V.mouse_info.new_position_y)},oe=()=>{V.mouse_info.state==EMouseInfoState.Down&&(V.intention!=EGlobalStoreIntention.Select&&(V.intention=EGlobalStoreIntention.None),V.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}))},re=ue=>{console.log("onCanvasMouseDown",ue);const{clientX:de,clientY:Ne}=ue;V.intention=EGlobalStoreIntention.MoveCanvas,V.setMouseInfo({state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:k.layout_center.x,now_position_y:k.layout_center.y,new_position_x:k.layout_center.x,new_position_y:k.layout_center.y})},Ce=(ue,de,Ne)=>({x:ue.x-ue.width/2*de+ue.width/2,y:ue.y-ue.height/2*Ne+ue.height/2,width:ue.width*de,height:ue.height*Ne}),ie=(ue,de,Ne)=>setArrItemByID(ue,de,Ne,k.done_json),ae=ue=>{var de;if(((de=ue.events)==null?void 0:de.length)>0){for(let Ne of ue.events)if(Ne.type===EEventType.Click||Ne.type===EEventType.Change){if(Ne.condition&&Ne.condition.type!=="None"&&Ne.condition.type==="Relation"&&Ne.condition.Relation&&Ne.condition.Relation.relation){const he=Ne.condition.Relation.key,pe=Ne.condition.Relation.relation,ze=valFormat(Ne.condition.Relation.val),Fe=valFormat(Ne.condition.Relation.val2);if(ue.props.hasOwnProperty(he)){const xe=ue.props[he].val;if(!le(xe,pe,ze,Fe))continue}}if(Ne.action===EEventAction.ChangeAttr){if(Ne.attrs&&Ne.attrs.length>0){let he;if(Ne.target){for(let pe of V.done_json)if(pe.id===Ne.target){he=pe;break}}else he=ue;if(!he)continue;for(let pe of Ne.attrs)he.state&&he.state.hasOwnProperty(pe.key)?he.state[pe.key].default=valFormat(pe.val):he.props.hasOwnProperty(pe.key)&&(he.props[pe.key].val=valFormat(pe.val))}}else Ne.action===EEventAction.JavaScript&&new Function(Ne.scripts)()}}},le=(ue,de,Ne,he)=>{switch(de){case">":return ue>Ne;case">=":return ue>=Ne;case"<":return ue<Ne;case"<=":return ue<=Ne;case"==":return ue==Ne;case"!=":return ue!=Ne;case">=,=<":return ue>=Ne&&ue<=he;case"<,>":return ue<Ne||ue>he}};vue.onMounted(()=>{Ie()}),vue.onBeforeUnmount(close);const Ie=()=>{const ue=k.config.net.mqtt;ue&&ue.url&&ue.user&&ue.pwd&&ue.topics&&sub(ue.url,ue.user,ue.pwd,ue.topics,(de,Ne)=>{console.log(de),console.log(Ne.toString())})};return n({setNodeAttrByID:ie}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:re,onMousemove:$,onMouseup:oe},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:k.config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${k.config.svg.position_center.x+k.layout_center.x},${k.config.svg.position_center.y+k.layout_center.y})rotate(0)scale(${k.config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.done_json,Ne=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Ne.id,transform:`translate(${Ne.x},${Ne.y})rotate(0)scale(1)`,onClick:he=>ae(Ne)},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Ne)}`)},[vue.createElementVNode("g",{transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2})rotate(${Ne.rotate}) scale(1) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`},[Ne.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Ne},null,8,["item-info"])):Ne.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Ne.name}`},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,_hoisted_4)):Ne.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):Ne.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},Ce(Ne.actual_bound,Ne.scale_x,Ne.scale_y),{id:`foreign-object${Ne.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps(vue.unref(prosToVBind)(Ne),{id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],8,_hoisted_2)),[[vue.vShow,Ne.display]])),128))],8,_hoisted_1)],4))],32))}}),index_vue_vue_type_style_index_0_scoped_aefb5edf_lang="",index=_export_sfc(_sfc_main,[["__scopeId","data-v-aefb5edf"]]);exports.SvgEditor=index$1,exports.SvgViewer=index,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
1302
+ }`,"autocompletion.css",!1),g.AcePopup=Ie,g.$singleLineEditor=le,g.getAriaId=ae}),ace.define("ace/autocomplete/util",["require","exports","module"],function(r,g,k){g.parForEach=function($,oe,re){var Ce=0,ie=$.length;ie===0&&re();for(var ae=0;ae<ie;ae++)oe($[ae],function(le,Ie){Ce++,Ce===ie&&re(le,Ie)})};var V=/[a-zA-Z_0-9\$\-\u00A2-\u2000\u2070-\uFFFF]/;g.retrievePrecedingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe-1;ie>=0&&re.test($[ie]);ie--)Ce.push($[ie]);return Ce.reverse().join("")},g.retrieveFollowingIdentifier=function($,oe,re){re=re||V;for(var Ce=[],ie=oe;ie<$.length&&re.test($[ie]);ie++)Ce.push($[ie]);return Ce},g.getCompletionPrefix=function($){var oe=$.getCursorPosition(),re=$.session.getLine(oe.row),Ce;return $.completers.forEach(function(ie){ie.identifierRegexps&&ie.identifierRegexps.forEach(function(ae){!Ce&&ae&&(Ce=this.retrievePrecedingIdentifier(re,oe.column,ae))}.bind(this))}.bind(this)),Ce||this.retrievePrecedingIdentifier(re,oe.column)}}),ace.define("ace/autocomplete",["require","exports","module","ace/keyboard/hash_handler","ace/autocomplete/popup","ace/autocomplete/popup","ace/autocomplete/util","ace/lib/lang","ace/lib/dom","ace/snippets","ace/config"],function(r,g,k){var V=r("./keyboard/hash_handler").HashHandler,$=r("./autocomplete/popup").AcePopup,oe=r("./autocomplete/popup").getAriaId,re=r("./autocomplete/util"),Ce=r("./lib/lang"),ie=r("./lib/dom"),ae=r("./snippets").snippetManager,le=r("./config"),Ie=function(){this.autoInsert=!1,this.autoSelect=!0,this.exactMatch=!1,this.gatherCompletionsId=0,this.keyboardHandler=new V,this.keyboardHandler.bindKeys(this.commands),this.blurListener=this.blurListener.bind(this),this.changeListener=this.changeListener.bind(this),this.mousedownListener=this.mousedownListener.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this),this.changeTimer=Ce.delayedCall(function(){this.updateCompletions(!0)}.bind(this)),this.tooltipTimer=Ce.delayedCall(this.updateDocTooltip.bind(this),50)};(function(){this.$init=function(){return this.popup=new $(document.body||document.documentElement),this.popup.on("click",function(de){this.insertMatch(),de.stop()}.bind(this)),this.popup.focus=this.editor.focus.bind(this.editor),this.popup.on("show",this.tooltipTimer.bind(null,null)),this.popup.on("select",this.tooltipTimer.bind(null,null)),this.popup.on("changeHoverMarker",this.tooltipTimer.bind(null,null)),this.popup},this.getPopup=function(){return this.popup||this.$init()},this.openPopup=function(de,Ne,he){this.popup||this.$init(),this.popup.autoSelect=this.autoSelect,this.popup.setData(this.completions.filtered,this.completions.filterText),this.editor.textInput.setAriaOptions({activeDescendant:oe(this.popup.getRow())}),de.keyBinding.addKeyboardHandler(this.keyboardHandler);var pe=de.renderer;if(this.popup.setRow(this.autoSelect?0:-1),he)he&&!Ne&&this.detach();else{this.popup.setTheme(de.getTheme()),this.popup.setFontSize(de.getFontSize());var ze=pe.layerConfig.lineHeight,Fe=pe.$cursorLayer.getPixelPosition(this.base,!0);Fe.left-=this.popup.getTextLeftOffset();var xe=de.container.getBoundingClientRect();Fe.top+=xe.top-pe.layerConfig.offset,Fe.left+=xe.left-de.renderer.scrollLeft,Fe.left+=pe.gutterWidth,this.popup.show(Fe,ze)}this.changeTimer.cancel()},this.detach=function(){this.editor.keyBinding.removeKeyboardHandler(this.keyboardHandler),this.editor.off("changeSelection",this.changeListener),this.editor.off("blur",this.blurListener),this.editor.off("mousedown",this.mousedownListener),this.editor.off("mousewheel",this.mousewheelListener),this.changeTimer.cancel(),this.hideDocTooltip(),this.gatherCompletionsId+=1,this.popup&&this.popup.isOpen&&this.popup.hide(),this.base&&this.base.detach(),this.activated=!1,this.completions=this.base=null},this.changeListener=function(de){var Ne=this.editor.selection.lead;(Ne.row!=this.base.row||Ne.column<this.base.column)&&this.detach(),this.activated?this.changeTimer.schedule():this.detach()},this.blurListener=function(de){var Ne=document.activeElement,he=this.editor.textInput.getElement(),pe=de.relatedTarget&&this.tooltipNode&&this.tooltipNode.contains(de.relatedTarget),ze=this.popup&&this.popup.container;Ne!=he&&Ne.parentNode!=ze&&!pe&&Ne!=this.tooltipNode&&de.relatedTarget!=he&&this.detach()},this.mousedownListener=function(de){this.detach()},this.mousewheelListener=function(de){this.detach()},this.goTo=function(de){this.popup.goTo(de)},this.insertMatch=function(de,Ne){if(de||(de=this.popup.getData(this.popup.getRow())),!de)return!1;var he=this.completions;if(this.editor.startOperation({command:{name:"insertMatch"}}),de.completer&&de.completer.insertMatch)de.completer.insertMatch(this.editor,de);else{if(!he)return!1;if(he.filterText)for(var pe=this.editor.selection.getAllRanges(),ze=0,Fe;Fe=pe[ze];ze++)Fe.start.column-=he.filterText.length,this.editor.session.remove(Fe);de.snippet?ae.insertSnippet(this.editor,de.snippet):this.editor.execCommand("insertstring",de.value||de)}this.completions==he&&this.detach(),this.editor.endOperation()},this.commands={Up:function(de){de.completer.goTo("up")},Down:function(de){de.completer.goTo("down")},"Ctrl-Up|Ctrl-Home":function(de){de.completer.goTo("start")},"Ctrl-Down|Ctrl-End":function(de){de.completer.goTo("end")},Esc:function(de){de.completer.detach()},Return:function(de){return de.completer.insertMatch()},"Shift-Return":function(de){de.completer.insertMatch(null,{deleteSuffix:!0})},Tab:function(de){var Ne=de.completer.insertMatch();if(!Ne&&!de.tabstopManager)de.completer.goTo("down");else return Ne},PageUp:function(de){de.completer.popup.gotoPageUp()},PageDown:function(de){de.completer.popup.gotoPageDown()}},this.gatherCompletions=function(de,Ne){var he=de.getSession(),pe=de.getCursorPosition(),ze=re.getCompletionPrefix(de);this.base=he.doc.createAnchor(pe.row,pe.column-ze.length),this.base.$insertRight=!0;var Fe=[],xe=de.completers.length;return de.completers.forEach(function(_e,Dt){_e.getCompletions(de,he,pe,ze,function($e,Ue){!$e&&Ue&&(Fe=Fe.concat(Ue)),Ne(null,{prefix:re.getCompletionPrefix(de),matches:Fe,finished:--xe===0})})}),!0},this.showPopup=function(de,Ne){this.editor&&this.detach(),this.activated=!0,this.editor=de,de.completer!=this&&(de.completer&&de.completer.detach(),de.completer=this),de.on("changeSelection",this.changeListener),de.on("blur",this.blurListener),de.on("mousedown",this.mousedownListener),de.on("mousewheel",this.mousewheelListener),this.updateCompletions(!1,Ne)},this.updateCompletions=function(de,Ne){if(de&&this.base&&this.completions){var he=this.editor.getCursorPosition(),pe=this.editor.session.getTextRange({start:this.base,end:he});if(pe==this.completions.filterText)return;if(this.completions.setFilter(pe),!this.completions.filtered.length)return this.detach();if(this.completions.filtered.length==1&&this.completions.filtered[0].value==pe&&!this.completions.filtered[0].snippet)return this.detach();this.openPopup(this.editor,pe,de);return}if(Ne&&Ne.matches){var he=this.editor.getSelectionRange().start;return this.base=this.editor.session.doc.createAnchor(he.row,he.column),this.base.$insertRight=!0,this.completions=new ue(Ne.matches),this.openPopup(this.editor,"",de)}var ze=this.gatherCompletionsId,Fe=function(Ue){if(Ue.finished)return this.detach()}.bind(this),xe=function(Ue){var Ve=Ue.prefix,Oe=Ue.matches;this.completions=new ue(Oe),this.exactMatch&&(this.completions.exactMatch=!0),this.completions.setFilter(Ve);var At=this.completions.filtered;if(!At.length||At.length==1&&At[0].value==Ve&&!At[0].snippet)return Fe(Ue);if(this.autoInsert&&At.length==1&&Ue.finished)return this.insertMatch(At[0]);this.openPopup(this.editor,Ve,de)}.bind(this),_e=!0,Dt=null;if(this.gatherCompletions(this.editor,function(Ue,Ve){var Oe=Ve.prefix,At=Ve&&Ve.matches;if(!At||!At.length)return Fe(Ve);if(!(Oe.indexOf(Ve.prefix)!==0||ze!=this.gatherCompletionsId)){if(_e){Dt=Ve;return}xe(Ve)}}.bind(this)),_e=!1,Dt){var $e=Dt;Dt=null,xe($e)}},this.cancelContextMenu=function(){this.editor.$mouseHandler.cancelContextMenu()},this.updateDocTooltip=function(){var de=this.popup,Ne=de.data,he=Ne&&(Ne[de.getHoveredRow()]||Ne[de.getRow()]),pe=null;if(!he||!this.editor||!this.popup.isOpen)return this.hideDocTooltip();if(this.editor.completers.some(function(ze){return ze.getDocTooltip&&(pe=ze.getDocTooltip(he)),pe}),!pe&&typeof he!="string"&&(pe=he),typeof pe=="string"&&(pe={docText:pe}),!pe||!(pe.docHTML||pe.docText))return this.hideDocTooltip();this.showDocTooltip(pe)},this.showDocTooltip=function(de){this.tooltipNode||(this.tooltipNode=ie.createElement("div"),this.tooltipNode.className="ace_tooltip ace_doc-tooltip",this.tooltipNode.style.margin=0,this.tooltipNode.style.pointerEvents="auto",this.tooltipNode.tabIndex=-1,this.tooltipNode.onblur=this.blurListener.bind(this),this.tooltipNode.onclick=this.onTooltipClick.bind(this));var Ne=this.tooltipNode;de.docHTML?Ne.innerHTML=de.docHTML:de.docText&&(Ne.textContent=de.docText),Ne.parentNode||document.body.appendChild(Ne);var he=this.popup,pe=he.container.getBoundingClientRect();Ne.style.top=he.container.style.top,Ne.style.bottom=he.container.style.bottom,Ne.style.display="block",window.innerWidth-pe.right<320?pe.left<320?he.isTopdown?(Ne.style.top=pe.bottom+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.top=he.container.offsetTop-Ne.offsetHeight+"px",Ne.style.left=pe.left+"px",Ne.style.right="",Ne.style.bottom=""):(Ne.style.right=window.innerWidth-pe.left+"px",Ne.style.left=""):(Ne.style.left=pe.right+1+"px",Ne.style.right="")},this.hideDocTooltip=function(){if(this.tooltipTimer.cancel(),!!this.tooltipNode){var de=this.tooltipNode;!this.editor.isFocused()&&document.activeElement==de&&this.editor.focus(),this.tooltipNode=null,de.parentNode&&de.parentNode.removeChild(de)}},this.onTooltipClick=function(de){for(var Ne=de.target;Ne&&Ne!=this.tooltipNode;){if(Ne.nodeName=="A"&&Ne.href){Ne.rel="noreferrer",Ne.target="_blank";break}Ne=Ne.parentNode}},this.destroy=function(){if(this.detach(),this.popup){this.popup.destroy();var de=this.popup.container;de&&de.parentNode&&de.parentNode.removeChild(de)}this.editor&&this.editor.completer==this&&this.editor.completer==null,this.popup=null}}).call(Ie.prototype),Ie.for=function(de){return de.completer||(le.get("sharedPopups")?(Ie.$shared||(Ie.$sharedInstance=new Ie),de.completer=Ie.$sharedInstance):(de.completer=new Ie,de.once("destroy",function(Ne,he){he.completer.destroy()}))),de.completer},Ie.startCommand={name:"startAutocomplete",exec:function(de,Ne){var he=Ie.for(de);he.autoInsert=!1,he.autoSelect=!0,he.showPopup(de,Ne),he.cancelContextMenu()},bindKey:"Ctrl-Space|Ctrl-Shift-Space|Alt-Space"};var ue=function(de,Ne){this.all=de,this.filtered=de,this.filterText=Ne||"",this.exactMatch=!1};(function(){this.setFilter=function(de){if(de.length>this.filterText&&de.lastIndexOf(this.filterText,0)===0)var Ne=this.filtered;else var Ne=this.all;this.filterText=de,Ne=this.filterCompletions(Ne,this.filterText),Ne=Ne.sort(function(pe,ze){return ze.exactMatch-pe.exactMatch||ze.$score-pe.$score||(pe.caption||pe.value).localeCompare(ze.caption||ze.value)});var he=null;Ne=Ne.filter(function(pe){var ze=pe.snippet||pe.caption||pe.value;return ze===he?!1:(he=ze,!0)}),this.filtered=Ne},this.filterCompletions=function(de,Ne){var he=[],pe=Ne.toUpperCase(),ze=Ne.toLowerCase();e:for(var Fe=0,xe;xe=de[Fe];Fe++){var _e=xe.caption||xe.value||xe.snippet;if(_e){var Dt=-1,$e=0,Ue=0,Ve,Oe;if(this.exactMatch){if(Ne!==_e.substr(0,Ne.length))continue e}else{var At=_e.toLowerCase().indexOf(ze);if(At>-1)Ue=At;else for(var qe=0;qe<Ne.length;qe++){var Lt=_e.indexOf(ze[qe],Dt+1),kt=_e.indexOf(pe[qe],Dt+1);if(Ve=Lt>=0&&(kt<0||Lt<kt)?Lt:kt,Ve<0)continue e;Oe=Ve-Dt-1,Oe>0&&(Dt===-1&&(Ue+=10),Ue+=Oe,$e=$e|1<<qe),Dt=Ve}}xe.matchMask=$e,xe.exactMatch=Ue?0:1,xe.$score=(xe.score||0)-Ue,he.push(xe)}}return he}}).call(ue.prototype),g.Autocomplete=Ie,g.FilteredList=ue}),ace.define("ace/autocomplete/text_completer",["require","exports","module","ace/range"],function(r,g,k){var V=r("../range").Range,$=/[^a-zA-Z_0-9\$\-\u00C0-\u1FFF\u2C00-\uD7FF\w]+/;function oe(Ce,ie){var ae=Ce.getTextRange(V.fromPoints({row:0,column:0},ie));return ae.split($).length-1}function re(Ce,ie){var ae=oe(Ce,ie),le=Ce.getValue().split($),Ie=Object.create(null),ue=le[ae];return le.forEach(function(de,Ne){if(!(!de||de===ue)){var he=Math.abs(ae-Ne),pe=le.length-he;Ie[de]?Ie[de]=Math.max(pe,Ie[de]):Ie[de]=pe}}),Ie}g.getCompletions=function(Ce,ie,ae,le,Ie){var ue=re(ie,ae),de=Object.keys(ue);Ie(null,de.map(function(Ne){return{caption:Ne,value:Ne,score:ue[Ne],meta:"local"}}))}}),ace.define("ace/ext/language_tools",["require","exports","module","ace/snippets","ace/autocomplete","ace/config","ace/lib/lang","ace/autocomplete/util","ace/autocomplete/text_completer","ace/editor","ace/config"],function(r,g,k){var V=r("../snippets").snippetManager,$=r("../autocomplete").Autocomplete,oe=r("../config"),re=r("../lib/lang"),Ce=r("../autocomplete/util"),ie=r("../autocomplete/text_completer"),ae={getCompletions:function(xe,_e,Dt,$e,Ue){if(_e.$mode.completer)return _e.$mode.completer.getCompletions(xe,_e,Dt,$e,Ue);var Ve=xe.session.getState(Dt.row),Oe=_e.$mode.getCompletions(Ve,_e,Dt,$e);Ue(null,Oe)}},le=function(xe){var _e={};return xe.replace(/\${(\d+)(:(.*?))?}/g,function(Dt,$e,Ue,Ve){return _e[$e]=Ve||""}).replace(/\$(\d+?)/g,function(Dt,$e){return _e[$e]})},Ie={getCompletions:function(xe,_e,Dt,$e,Ue){var Ve=[],Oe=_e.getTokenAt(Dt.row,Dt.column);Oe&&Oe.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/)?Ve.push("html-tag"):Ve=V.getActiveScopes(xe);var At=V.snippetMap,qe=[];Ve.forEach(function(Lt){for(var kt=At[Lt]||[],jt=kt.length;jt--;){var ti=kt[jt],ei=ti.name||ti.tabTrigger;ei&&qe.push({caption:ei,snippet:ti.content,meta:ti.tabTrigger&&!ti.name?ti.tabTrigger+"⇥ ":"snippet",type:"snippet"})}},this),Ue(null,qe)},getDocTooltip:function(xe){xe.type=="snippet"&&!xe.docHTML&&(xe.docHTML=["<b>",re.escapeHTML(xe.caption),"</b>","<hr></hr>",re.escapeHTML(le(xe.snippet))].join(""))}},ue=[Ie,ie,ae];g.setCompleters=function(xe){ue.length=0,xe&&ue.push.apply(ue,xe)},g.addCompleter=function(xe){ue.push(xe)},g.textCompleter=ie,g.keyWordCompleter=ae,g.snippetCompleter=Ie;var de={name:"expandSnippet",exec:function(xe){return V.expandWithTab(xe)},bindKey:"Tab"},Ne=function(xe,_e){he(_e.session.$mode)},he=function(xe){typeof xe=="string"&&(xe=oe.$modes[xe]),xe&&(V.files||(V.files={}),pe(xe.$id,xe.snippetFileId),xe.modes&&xe.modes.forEach(he))},pe=function(xe,_e){!_e||!xe||V.files[xe]||(V.files[xe]={},oe.loadModule(_e,function(Dt){Dt&&(V.files[xe]=Dt,!Dt.snippets&&Dt.snippetText&&(Dt.snippets=V.parseSnippetFile(Dt.snippetText)),V.register(Dt.snippets||[],Dt.scope),Dt.includeScopes&&(V.snippetMap[Dt.scope].includeScopes=Dt.includeScopes,Dt.includeScopes.forEach(function($e){he("ace/mode/"+$e)})))}))},ze=function(xe){var _e=xe.editor,Dt=_e.completer&&_e.completer.activated;if(xe.command.name==="backspace")Dt&&!Ce.getCompletionPrefix(_e)&&_e.completer.detach();else if(xe.command.name==="insertstring"){var $e=Ce.getCompletionPrefix(_e);if($e&&!Dt){var Ue=$.for(_e);Ue.autoInsert=!1,Ue.showPopup(_e)}}},Fe=r("../editor").Editor;r("../config").defineOptions(Fe.prototype,"editor",{enableBasicAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.addCommand($.startCommand)):this.commands.removeCommand($.startCommand)},value:!1},enableLiveAutocompletion:{set:function(xe){xe?(this.completers||(this.completers=Array.isArray(xe)?xe:ue),this.commands.on("afterExec",ze)):this.commands.removeListener("afterExec",ze)},value:!1},enableSnippets:{set:function(xe){xe?(this.commands.addCommand(de),this.on("changeMode",Ne),Ne(null,this)):(this.commands.removeCommand(de),this.off("changeMode",Ne))},value:!1}})}),function(){ace.require(["ace/ext/language_tools"],function(r){i&&(i.exports=r)})}()})(extLanguage_tools),ace$1.config.setModuleUrl("ace/theme/github",themeUrl),ace$1.config.setModuleUrl("ace/theme/kr_theme",themeUrl2),ace$1.config.setModuleUrl("ace/mode/base",workerBaseUrl),ace$1.config.setModuleUrl("ace/mode/json",modeJsonUrl),ace$1.config.setModuleUrl("ace/mode/json_worker",workerJsonUrl),ace$1.config.setModuleUrl("ace/snippets/json",snippetsJsonUrl),ace$1.config.setModuleUrl("ace/mode/javascript",modeJavascriptUrl),ace$1.config.setModuleUrl("ace/mode/javascript_worker",workerJavascriptUrl),ace$1.config.setModuleUrl("ace/snippets/javascript",snippetsJavascriptUrl),ace$1.require("ace/ext/language_tools");const _sfc_main$b=vue.defineComponent({__name:"code-edit-modal",props:{modelValue:{default:()=>({})},lang:{default:"json"},title:{default:"编辑"}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.ref(!1),k=vue.computed({get(){return r.lang==="json"?JSON.stringify(r.modelValue,null,2):r.modelValue},set(V){r.lang==="json"?n("update:modelValue",JSON.parse(V)):n("update:modelValue",V)}});return(V,$)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElButton),{onClick:$[0]||($[0]=oe=>g.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("···")]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:g.value,"onUpdate:modelValue":$[2]||($[2]=oe=>g.value=oe),title:r.title,width:"60%"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(VAceEditor),{value:k.value,"onUpdate:value":$[1]||($[1]=oe=>k.value=oe),lang:r.lang,theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value","lang"])]),_:1},8,["modelValue","title"])]))}}),_hoisted_1$7={class:"one-row-txt",style:{width:"78px"}},_hoisted_2$5={key:1},_hoisted_3$4={class:"one-row-txt",style:{width:"145px"}},_hoisted_4$2={key:1},_sfc_main$a=vue.defineComponent({__name:"dynamic-el-form-item",props:{objInfo:{default:()=>({})},hide:{default:()=>[]},code:{type:Boolean,default:!1}},setup(i){const n=i;return(r,g)=>(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(n.objInfo,(k,V)=>(vue.openBlock(),vue.createElementBlock("div",{key:V},[n.code?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,class:"props-row",size:"small"},{label:vue.withCtx(()=>[vue.unref(getStringWidth)(String(V))>78?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:String(V),placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$7,vue.toDisplayString(V),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_2$5,vue.toDisplayString(V),1))]),default:vue.withCtx(()=>[vue.unref(getStringWidth)(String(k.val))>145?(vue.openBlock(),vue.createBlock(vue.unref(ElTooltip),{key:0,content:k.val,placement:"left","popper-class":"props-popper"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_3$4,vue.toDisplayString(k.val),1)]),_:2},1032,["content"])):(vue.openBlock(),vue.createElementBlock("span",_hoisted_4$2,vue.toDisplayString(k.val),1))]),_:2},1024)):vue.createCommentVNode("",!0),n.hide.indexOf(String(V))<0?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:k.title,size:"small"},{default:vue.withCtx(()=>[k.type===vue.unref(EConfigItemPropsType).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElSelect),{key:0,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,placeholder:"Select",size:"small",disabled:!!(k!=null&&k.disabled)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.options,$=>(vue.openBlock(),vue.createBlock(vue.unref(ElOption),{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).InputNumber?(vue.openBlock(),vue.createBlock(vue.unref(ElInputNumber),{key:1,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Input?(vue.openBlock(),vue.createBlock(vue.unref(ElInput),{key:2,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Color?(vue.openBlock(),vue.createBlock(vue.unref(ElColorPicker),{key:3,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).Switch?(vue.openBlock(),vue.createBlock(vue.unref(ElSwitch),{key:4,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):k.type===vue.unref(EConfigItemPropsType).JsonEdit?(vue.openBlock(),vue.createBlock(_sfc_main$b,{key:5,modelValue:k.val,"onUpdate:modelValue":$=>k.val=$,disabled:!!(k!=null&&k.disabled)},null,8,["modelValue","onUpdate:modelValue","disabled"])):vue.createCommentVNode("",!0)]),_:2},1032,["label"])):vue.createCommentVNode("",!0)]))),128))}}),dynamicElFormItem_vue_vue_type_style_index_0_scoped_a1ba665e_lang="",dynamicElFormItem_vue_vue_type_style_index_1_lang="",DynamicElFormItem=_export_sfc(_sfc_main$a,[["__scopeId","data-v-a1ba665e"]]),_hoisted_1$6={style:{height:"100%"}},_hoisted_2$4={class:"flex flex-wrap"},_hoisted_3$3=["onMouseenter","onClick"],_sfc_main$9=vue.defineComponent({__name:"common-animate",props:{val:{}},emits:["updateCommonAniVal"],setup(i,{emit:n}){const r=i,g=vue.ref(r.val),k=vue.ref(!1),V=vue.ref("进入"),$=vue.ref(null),oe=re=>{n("updateCommonAniVal",re),k.value=!1};return vue.watch(()=>r.val,re=>{g.value=re}),(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$6,[g.value?(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:0,closable:"",onClose:Ce[0]||(Ce[0]=ie=>oe("")),onClick:Ce[1]||(Ce[1]=ie=>k.value=!0),style:{cursor:"pointer"}},{default:vue.withCtx(()=>{var ie;return[vue.createTextVNode(vue.toDisplayString((ie=vue.unref(common_animate_list).map(ae=>ae.children).reduce((ae,le)=>ae.concat(le)).find(ae=>ae.value==g.value))==null?void 0:ie.label)+" ",1),vue.createVNode(vue.unref(ElIcon),{size:10},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"setting"})]),_:1})]}),_:1})):(vue.openBlock(),vue.createBlock(vue.unref(ElTag),{key:1,type:"success",style:{cursor:"pointer"},onClick:Ce[2]||(Ce[2]=ie=>k.value=!0)},{default:vue.withCtx(()=>[vue.createTextVNode("新增")]),_:1})),vue.createVNode(vue.unref(ElDrawer),{modelValue:k.value,"onUpdate:modelValue":Ce[5]||(Ce[5]=ie=>k.value=ie),title:"选择动画",direction:"ltr"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabs),{modelValue:V.value,"onUpdate:modelValue":Ce[4]||(Ce[4]=ie=>V.value=ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(common_animate_list),ie=>(vue.openBlock(),vue.createBlock(vue.unref(ElTabPane),{label:ie.label,name:ie.label,key:ie.label},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{height:"500px"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$4,[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(ie.children,(ae,le)=>(vue.openBlock(),vue.createElementBlock("div",{class:"animate",key:le,onMouseenter:Ie=>$.value=le,onMouseleave:Ce[3]||(Ce[3]=Ie=>$.value=null),onClick:Ie=>oe(ae.value)},[vue.createElementVNode("div",{class:vue.normalizeClass(`${$.value==le?`animate__animated animate__${ae.value} animate__slow animate__infinite`:""}`)},vue.toDisplayString(ae.label),3)],40,_hoisted_3$3))),128))])]),_:2},1024)]),_:2},1032,["label","name"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["modelValue"])]))}}),commonAnimate_vue_vue_type_style_index_0_scoped_f7641a8c_lang="",CommonAnimate=_export_sfc(_sfc_main$9,[["__scopeId","data-v-f7641a8c"]]),_sfc_main$8=vue.defineComponent({__name:"index",setup(i){var V;const n=useGlobalStore(pinia),r=vue.ref(((V=n.handle_svg_info)==null?void 0:V.info.id)||""),g=$=>{n.intention=EGlobalStoreIntention.Select,n.setHandleSvgInfo($)},k={children:"children",label:"title"};return($,oe)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTree),{data:vue.unref(n).done_json,props:k,onNodeClick:g,"default-expand-all":!0,"expand-on-click-node":!1,"highlight-current":!0,"node-key":"id","current-node-key":r.value},null,8,["data","current-node-key"]))}}),_withScopeId$1=i=>(vue.pushScopeId("data-v-8ce989ed"),i=i(),vue.popScopeId(),i),_hoisted_1$5={class:"wall-l"},_hoisted_2$3={class:"head-l"},_hoisted_3$2=_withScopeId$1(()=>vue.createElementVNode("span",null,"key",-1)),_hoisted_4$1=_withScopeId$1(()=>vue.createElementVNode("span",null,"value",-1)),_hoisted_5$1={class:"row-l"},_sfc_main$7=vue.defineComponent({__name:"list",props:{modelValue:{default:()=>[{key:"",val:""}]}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=()=>{g.value.push({key:"",val:""})},V=$=>{g.value.splice($,1)};return($,oe)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_1$5,[vue.createElementVNode("div",_hoisted_2$3,[_hoisted_3$2,_hoisted_4$1,vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:k},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"add"})]),_:1})]),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(g.value,(re,Ce)=>(vue.openBlock(),vue.createElementBlock("div",_hoisted_5$1,[vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.key,"onUpdate:modelValue":ie=>re.key=ie,size:"small",placeholder:"key"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElInput),{class:"content-l",modelValue:re.val,"onUpdate:modelValue":ie=>re.val=ie,size:"small",placeholder:"value"},null,8,["modelValue","onUpdate:modelValue"]),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:ie=>V(Ce)},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])]))),256))]))}}),list_vue_vue_type_style_index_0_scoped_8ce989ed_lang="",List=_export_sfc(_sfc_main$7,[["__scopeId","data-v-8ce989ed"]]),_hoisted_1$4={class:"c-wall-d"},_sfc_main$6=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:n}){const r=i,g=vue.computed({get(){return r.modelValue},set($){n("update:modelValue",$)}}),k=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],V=$=>{$!=="None"&&(g.value.Relation={key:"",relation:"",val:"",val2:""}),n("update:modelValue",g)};return($,oe)=>{var re,Ce;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.type,"onUpdate:modelValue":oe[0]||(oe[0]=ie=>g.value.type=ie),onChange:V},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.key,"onUpdate:modelValue":oe[1]||(oe[1]=ie=>g.value.Relation.key=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:g.value.Relation.relation,"onUpdate:modelValue":oe[2]||(oe[2]=ie=>g.value.Relation.relation=ie)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(k,(ie,ae)=>vue.createVNode(vue.unref(ElOption),{value:ie.val,label:ie.label,key:"rop"+ae},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val,"onUpdate:modelValue":oe[3]||(oe[3]=ie=>g.value.Relation.val=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),g.value.type==="Relation"&&(((re=g.value.Relation)==null?void 0:re.relation)===">=,=<"||((Ce=g.value.Relation)==null?void 0:Ce.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:g.value.Relation.val2,"onUpdate:modelValue":oe[4]||(oe[4]=ie=>g.value.Relation.val2=ie)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_a72b6fe7_lang="",Condition=_export_sfc(_sfc_main$6,[["__scopeId","data-v-a72b6fe7"]]),_withScopeId=i=>(vue.pushScopeId("data-v-bdbaeafd"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2={class:"events-title"},_hoisted_3$1={key:1},_sfc_main$5=vue.defineComponent({__name:"index",setup(i){const n=useConfigStore(pinia),r=useGlobalStore(pinia),g=vue.ref("page"),k=vue.ref("style"),V=(ae,le)=>{ae!=null&&ae.common_animations&&(ae.common_animations.val=le)};n.$subscribe((ae,le)=>{ae.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(le))});const $=vue.ref(numberArray(20)),oe=vue.ref(["MQTT"]),re=vue.ref();re.value=()=>{var le,Ie;let ae={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.push(ae)};const Ce=(ae,le)=>{ae==="ChangeAttr"?le.attrs=[{key:"",val:""}]:delete le.attrs},ie=ae=>{var le,Ie;(Ie=(le=r.handle_svg_info)==null?void 0:le.info)==null||Ie.events.splice(ae,1)};return(ae,le)=>vue.unref(r).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:g.value,"onUpdate:modelValue":le[11]||(le[11]=Ie=>g.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElColorPicker),{modelValue:vue.unref(n).svg.background_color,"onUpdate:modelValue":le[0]||(le[0]=Ie=>vue.unref(n).svg.background_color=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.x,"onUpdate:modelValue":le[1]||(le[1]=Ie=>vue.unref(n).svg.position_center.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y原点",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.position_center.y,"onUpdate:modelValue":le[2]||(le[2]=Ie=>vue.unref(n).svg.position_center.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.grid,"onUpdate:modelValue":le[3]||(le[3]=Ie=>vue.unref(n).svg.grid=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(n).svg.ruler,"onUpdate:modelValue":le[4]||(le[4]=Ie=>vue.unref(n).svg.ruler=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(n).svg.scale,"onUpdate:modelValue":le[5]||(le[5]=Ie=>vue.unref(n).svg.scale=Ie),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapse),{modelValue:oe.value,"onUpdate:modelValue":le[10]||(le[10]=Ie=>oe.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.url,"onUpdate:modelValue":le[6]||(le[6]=Ie=>vue.unref(n).net.mqtt.url=Ie),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.user,"onUpdate:modelValue":le[7]||(le[7]=Ie=>vue.unref(n).net.mqtt.user=Ie),placeholder:"username"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.pwd,"onUpdate:modelValue":le[8]||(le[8]=Ie=>vue.unref(n).net.mqtt.pwd=Ie),placeholder:"password"},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(n).net.mqtt.topics,"onUpdate:modelValue":le[9]||(le[9]=Ie=>vue.unref(n).net.mqtt.topics=Ie),placeholder:"topics"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(n).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(n).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).connection_line.animations},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.unref(r).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(r).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:k.value,"onUpdate:modelValue":le[24]||(le[24]=Ie=>k.value=Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.title,"onUpdate:modelValue":le[12]||(le[12]=Ie=>vue.unref(r).handle_svg_info.info.title=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"x坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.x,"onUpdate:modelValue":le[13]||(le[13]=Ie=>vue.unref(r).handle_svg_info.info.x=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInputNumber),{modelValue:vue.unref(r).handle_svg_info.info.y,"onUpdate:modelValue":le[14]||(le[14]=Ie=>vue.unref(r).handle_svg_info.info.y=Ie)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.display,"onUpdate:modelValue":le[15]||(le[15]=Ie=>vue.unref(r).handle_svg_info.info.display=Ie)},null,8,["modelValue"])]),_:1})]),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{type:"primary",style:{width:"100%"},onClick:re.value},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(ElCollapse),{modelValue:$.value,"onUpdate:modelValue":le[16]||(le[16]=Ie=>$.value=Ie)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).handle_svg_info.info.events,(Ie,ue)=>(vue.openBlock(),vue.createBlock(vue.unref(ElCollapseItem),{name:ue,key:"event"+ue},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_2$2,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(ue+1),1),vue.createVNode(vue.unref(ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(de=>ie(ue),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$i,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.type,"onUpdate:modelValue":de=>Ie.type=de},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:Ie.action,"onUpdate:modelValue":de=>Ie.action=de,onChange:de=>Ce(de,Ie)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(ElOption),{value:"JavaScript",label:"执行JavaScript"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:Ie.target,"onUpdate:modelValue":de=>Ie.target=de,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),Ie.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:Ie.attrs,"onUpdate:modelValue":de=>Ie.attrs=de},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),Ie.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$b,{modelValue:Ie.scripts,"onUpdate:modelValue":de=>Ie.scripts=de,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:Ie.condition,"onUpdate:modelValue":de=>Ie.condition=de},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var Ie;return[(Ie=vue.unref(r).handle_svg_info)!=null&&Ie.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(r).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:le[17]||(le[17]=ue=>{var de;return V((de=vue.unref(r).handle_svg_info)==null?void 0:de.info,ue)}),val:vue.unref(r).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":le[18]||(le[18]=ue=>vue.unref(r).handle_svg_info.info.common_animations.delay=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":le[19]||(le[19]=ue=>vue.unref(r).handle_svg_info.info.common_animations.speed=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(r).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":le[20]||(le[20]=ue=>vue.unref(r).handle_svg_info.info.common_animations.repeat=ue)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var Ie;return[vue.createVNode(vue.unref(ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.id,"onUpdate:modelValue":le[21]||(le[21]=ue=>vue.unref(r).handle_svg_info.info.id=ue)},null,8,["modelValue"])]),_:1}),vue.unref(r).handle_svg_info.info.state?(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,{key:0},vue.renderList(vue.unref(r).handle_svg_info.info.state,(ue,de)=>{var Ne;return vue.openBlock(),vue.createElementBlock("div",{key:"state"+de},[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:String(de),size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(ue==null?void 0:ue.default),1)]),_:2},1032,["label"]),de==="OnOff"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:(Ne=vue.unref(r).handle_svg_info.info.state)==null?void 0:Ne.OnOff.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSwitch),{modelValue:vue.unref(r).handle_svg_info.info.state.OnOff.default,"onUpdate:modelValue":le[22]||(le[22]=he=>vue.unref(r).handle_svg_info.info.state.OnOff.default=he)},null,8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0)])}),128)):vue.createCommentVNode("",!0),(Ie=vue.unref(r).handle_svg_info.info)!=null&&Ie.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(r).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(r).handle_svg_info.info.tag_slot,"onUpdate:modelValue":le[23]||(le[23]=ue=>vue.unref(r).handle_svg_info.info.tag_slot=ue)},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).handle_svg_info.info.props,code:""},null,8,["obj-info"])]}),_:1})]),_:1}),vue.createVNode(vue.unref(ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$8)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),index_vue_vue_type_style_index_0_scoped_bdbaeafd_lang="",index_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc(_sfc_main$5,[["__scopeId","data-v-bdbaeafd"]]),_sfc_main$4=vue.defineComponent({__name:"index",setup(i){const n=vue.ref(""),r=useGlobalStore(pinia),g=useSvgEditLayoutStore(pinia),k=useConfigStore(pinia);return vue.onMounted(()=>{const V={layout_center:g.center_offset,config:k.$state,done_json:r.done_json};n.value=JSON.stringify(V,null,2)}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:n.value,"onUpdate:value":$[0]||($[0]=oe=>n.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"index",setup(i,{expose:n}){const r=vue.ref("");return n({setVal:V=>{r.value=V},onImportJson:()=>{useImportDataModel(r.value)&&ElMessage.success("导入成功")}}),(V,$)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:r.value,"onUpdate:value":$[0]||($[0]=oe=>r.value=oe),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$2=vue.defineComponent({name:"V3RulerComponent",props:{position:{type:String,default:"relative",validator:i=>["absolute","fixed","relative","static","inherit"].indexOf(i)!==-1},isHotKey:{type:Boolean,default:!0},isScaleRevise:{type:Boolean,default:!1},value:{type:Array,default:()=>[{type:"h",site:50},{type:"v",site:180}]},contentLayout:{type:Object,default:()=>({top:0,left:0})},parent:{type:Boolean,default:!1},visible:{type:Boolean,default:!0},stepLength:{type:Number,default:50,validator:i=>i%10===0}},emits:["input","update:visible"],setup(i,n){const r=useSvgEditLayoutStore(pinia),g=function(){return function(Ai,hi,wi){Ai&&hi&&wi&&Ai.addEventListener(hi,wi,!1)}}(),k=function(){return function(Ai,hi,wi){Ai&&hi&&Ai.removeEventListener(hi,wi,!1)}}(),V=17;let $=18,oe=vue.ref(0),re=vue.ref(0),Ce=vue.ref([{id:0}]),ie=vue.ref([{id:0}]),ae=0,le=0,Ie=vue.ref(!1),ue="",de=vue.ref(-999),Ne=vue.ref(-999),he=0,pe=0,ze="";const Fe=vue.ref(null),xe=vue.ref(null),_e=vue.ref(null),Dt=vue.ref(null),$e=vue.computed(()=>({width:oe.value+"px",height:re.value+"px",position:i.position})),Ue=vue.computed(()=>({left:i.contentLayout.left+"px",top:i.contentLayout.top+"px",padding:$+"px 0px 0px "+$+"px"})),Ve=vue.computed(()=>{let Ai=0,hi=0;return i.value.map(wi=>{const Ci=wi.type==="h";return{id:`${wi.type}_${Ci?Ai++:hi++}`,type:wi.type,title:wi.site.toFixed(2)+"px",[Ci?"top":"left"]:wi.site/(i.stepLength/50)+V}})});r.$subscribe(Ai=>{Ai.storeId==="svg-edit-layout-store"&&window.setTimeout(Oe,420)}),vue.onMounted(()=>{g(document,"mousemove",gi),g(document,"mouseup",di),Oe(),g(window,"resize",At)}),vue.onBeforeUnmount(()=>{k(document,"mousemove",gi),k(document,"mouseup",di),k(window,"resize",At)});const Oe=()=>{kt(),ti()},At=()=>{Ce.value=[{id:0}],ie.value=[{id:0}],Oe()},qe=({type:Ai,top:hi,left:wi})=>Ai==="h"?{top:hi+"px"}:{left:wi+"px"},Lt=({type:Ai,id:hi})=>Ai==="h"?pi(hi):yi(hi),kt=()=>{if(i.isScaleRevise){const Ai=Fe.value.offsetLeft,hi=Fe.value.offsetTop;Pt(Ce.value,Ai),Pt(ie.value,hi)}if(i.parent){const Ai=window.getComputedStyle(xe.value.parentNode,null);oe.value=parseInt(Ai.getPropertyValue("width"),10),re.value=parseInt(Ai.getPropertyValue("height"),10)}else oe.value=document.documentElement.clientWidth-le,re.value=document.documentElement.clientHeight-ae;he=_e.value.clientWidth,pe=Dt.value.clientHeight,jt()},jt=()=>{ae=Dt.value.getBoundingClientRect().y,le=_e.value.getBoundingClientRect().x},ti=()=>{ei(Ce.value,oe.value),ei(ie.value,re.value)},ei=(Ai,hi)=>{for(let wi=0;wi<hi*i.stepLength/50;wi+=i.stepLength)wi%i.stepLength===0&&wi!=0&&Ai.push({id:wi})},Pt=(Ai,hi)=>{for(let wi=0;wi<hi;wi+=1)wi%i.stepLength===0&&wi+i.stepLength<=hi&&Ai.push({id:wi})},ni=Ai=>{Ie.value=!0,ue=Ai},gi=Ai=>{switch(jt(),ue){case"x":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"y":Ie.value&&(de.value=Ai.pageX-le);break;case"h":Ie.value&&(Ne.value=Ai.pageY-ae);break;case"v":Ie.value&&(de.value=Ai.pageX-le);break}},di=Ai=>{if(jt(),Ie.value){Ie.value=!1;const hi=JSON.parse(JSON.stringify(i.value));switch(ue){case"x":hi.push({type:"h",site:(Ai.pageY-ae-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"y":hi.push({type:"v",site:(Ai.pageX-le-V)*(i.stepLength/50)}),n.emit("input",hi);break;case"h":li(hi,Ai.pageY,ae,pe,"h"),n.emit("input",hi);break;case"v":li(hi,Ai.pageX,le,he,"v"),n.emit("input",hi);break}Ne.value=de.value=-10}},li=(Ai,hi,wi,Ci,mi)=>{if(hi-wi<Ci){let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:-600})}else{let Ni;Ve.value.forEach((Mi,fi)=>{Mi.id===ze&&(Ni=fi)}),Ai.splice(Ni,1,{type:mi,site:(hi-wi-V)*(i.stepLength/50)})}},ai=()=>{ni("x")},ci=()=>{ni("y")},pi=Ai=>{Ie.value=!0,ue="h",ze=Ai},yi=Ai=>{Ie.value=!0,ue="v",ze=Ai};return{wrapperStyle:$e,horizontalDragRuler:ai,xScale:Ce,verticalDragRuler:ci,yScale:ie,verticalDottedTop:Ne,horizontalDottedLeft:de,lineList:Ve,getLineStyle:qe,handleDragLine:Lt,contentStyle:Ue,isDrag:Ie,content:Fe,el:xe,verticalRuler:_e,horizontalRuler:Dt}}}),index_vue_vue_type_style_index_0_lang="",_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"};function _sfc_render(i,n,r,g,k,V){return vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(i.wrapperStyle),class:"vue-ruler-wrapper",onselectStart:"return false;",ref:"el"},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref:"horizontalRuler",class:"vue-ruler-h",onMousedown:n[0]||(n[0]=vue.withModifiers((...$)=>i.horizontalDragRuler&&i.horizontalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.xScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({left:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{ref:"verticalRuler",class:"vue-ruler-v",onMousedown:n[1]||(n[1]=vue.withModifiers((...$)=>i.verticalDragRuler&&i.verticalDragRuler(...$),["stop"]))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.yScale,($,oe)=>(vue.openBlock(),vue.createElementBlock("span",{key:oe,style:vue.normalizeStyle({top:oe*50+2+"px"}),class:"n"},vue.toDisplayString($.id),5))),128))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:i.verticalDottedTop+"px"}),class:"vue-ruler-ref-dot-h"},null,4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:i.horizontalDottedLeft+"px"}),class:"vue-ruler-ref-dot-v"},null,4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.lineList,$=>(vue.openBlock(),vue.createElementBlock("div",{title:$.title,style:vue.normalizeStyle(i.getLineStyle($)),key:$.id,class:vue.normalizeClass(`vue-ruler-ref-line-${$.type}`),onMousedown:oe=>i.handleDragLine($)},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,i.$props.visible]]),vue.createElementVNode("div",{ref:"content",class:"vue-ruler-content",style:vue.normalizeStyle(i.contentStyle)},[vue.renderSlot(i.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,i.isDrag]])],4)}const Vue3RulerTool=_export_sfc(_sfc_main$2,[["render",_sfc_render]]);function fileWrite(i,n=new Date(Date.now()).toLocaleString()){const r=JSON.stringify(i),g=new Blob([r]);let k=document.createElement("a");k.download=n+".json",k.style.display="none",k.href=URL.createObjectURL(g),document.body.appendChild(k),k.click(),document.body.removeChild(k)}function fileRead(i){return new Promise((n,r)=>{let g=new FileReader;g.readAsText(i,"UTF-8"),g.onload=function(k){k&&k.target?n(k.target.result):r("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},data:{},saveFile:{type:Boolean,default:!1}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:n,emit:r}){const g=i,k=vue.ref([]),V=he=>{k.value=he},$=useGlobalStore(pinia),oe=useSvgEditLayoutStore(pinia),re=useConfigStore(pinia),Ce=vue.ref(),ie=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),ae=(he,pe)=>{ie[he]=pe},le=vue.ref();le.value=()=>{Ce.value.onImportJson(),ae(EVisibleConfKey.ImportJson,!1)};const Ie=he=>["text/plain","application/json"].indexOf(he.type)<0?(ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(he).then(pe=>{Ce.value.setVal(pe),ElMessage.success("文件读取成功!")}),!1),ue=he=>{$.setDoneJson(he)};vue.onMounted(()=>{g.data?useImportDataModel(g.data):$.setDoneJson([]),$.intention=EGlobalStoreIntention.None}),n({setGraphNodeJson:ue});const{appContext:de}=vue.getCurrentInstance();function Ne(he){g.saveFile?ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},de).then(pe=>{fileWrite(he,pe.value.trim()),r("onSave",he)}).catch(pe=>{console.log(pe)}):r("onSave",he)}return(he,pe)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:ae,onOnReturn:pe[0]||(pe[0]=ze=>r("onReturn")),onOnPreview:pe[1]||(pe[1]=ze=>r("onPreview",ze)),onOnSave:Ne})]),_:1}),vue.createVNode(vue.unref(ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).left_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":g.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(Vue3RulerTool,{class:"canvas-main-pc",value:k.value,"step-length":50,parent:!0,"is-scale-revise":!1,visible:vue.unref(re).svg.ruler,"onUpdate:visible":pe[2]||(pe[2]=ze=>vue.unref(re).svg.ruler=ze),onInput:V},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel)]),_:1},8,["value","visible"])])]),_:1}),vue.createVNode(vue.unref(ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(oe).right_nav?"show-nav":"hide-nav"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:1})]),_:1}),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ImportJson,"onUpdate:modelValue":pe[4]||(pe[4]=ze=>ie.ImportJson=ze),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(ElUpload),{beforeUpload:Ie,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElButton),{onClick:pe[3]||(pe[3]=ze=>ae(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(ElButton),{type:"primary",onClick:le.value},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:Ce},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(ElDialog),{class:"modal-full",modelValue:ie.ExportJson,"onUpdate:modelValue":pe[5]||(pe[5]=ze=>ie.ExportJson=ze),title:"导出",width:"60%","destroy-on-close":""},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$4)]),_:1},8,["modelValue"])]))}}),index_vue_vue_type_style_index_0_scoped_acde8f01_lang="",index$1=_export_sfc(_sfc_main$1,[["__scopeId","data-v-acde8f01"]]);function commonjsRequire(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var mqtt={exports:{}};(function(i,n){(function(r){i.exports=r()})(function(){return function(){function r(g,k,V){function $(Ce,ie){if(!k[Ce]){if(!g[Ce]){var ae=typeof commonjsRequire=="function"&&commonjsRequire;if(!ie&&ae)return ae(Ce,!0);if(oe)return oe(Ce,!0);var le=new Error("Cannot find module '"+Ce+"'");throw le.code="MODULE_NOT_FOUND",le}var Ie=k[Ce]={exports:{}};g[Ce][0].call(Ie.exports,function(ue){var de=g[Ce][1][ue];return $(de||ue)},Ie,Ie.exports,r,g,k,V)}return k[Ce].exports}for(var oe=typeof commonjsRequire=="function"&&commonjsRequire,re=0;re<V.length;re++)$(V[re]);return $}return r}()({1:[function(r,g,k){(function(V,$){(function(){const oe=r("events").EventEmitter,re=r("./store"),Ce=r("./topic-alias-recv"),ie=r("./topic-alias-send"),ae=r("mqtt-packet"),le=r("./default-message-id-provider"),Ie=r("readable-stream").Writable,ue=r("inherits"),de=r("reinterval"),Ne=r("rfdc/default"),he=r("./validations"),pe=r("xtend"),ze=r("debug")("mqttjs:client"),Fe=V?V.nextTick:function(ei){setTimeout(ei,0)},xe=$.setImmediate||function(ei){Fe(ei)},_e={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},Dt=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],$e={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function Ue(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function Ve(ei,Pt){if(ei.options.protocolVersion===5&&Pt.cmd==="publish"){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);const gi=Pt.topic.toString();if(ei.topicAliasSend)if(ni){if(gi.length!==0&&(ze("applyTopicAlias :: register topic: %s - alias: %d",gi,ni),!ei.topicAliasSend.put(gi,ni)))return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}else gi.length!==0&&(ei.options.autoAssignTopicAlias?(ni=ei.topicAliasSend.getAliasByTopic(gi),ni?(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",gi,ni)):(ni=ei.topicAliasSend.getLruAlias(),ei.topicAliasSend.put(gi,ni),Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto assign topic: %s - alias: %d",gi,ni))):ei.options.autoUseTopicAlias&&(ni=ei.topicAliasSend.getAliasByTopic(gi),ni&&(Pt.topic="",Pt.properties={...Pt.properties,topicAlias:ni},ze("applyTopicAlias :: auto use topic: %s - alias: %d",gi,ni))));else if(ni)return ze("applyTopicAlias :: error out of range. topic: %s - alias: %d",gi,ni),new Error("Sending Topic Alias out of range")}}function Oe(ei,Pt){let ni;Pt.properties&&(ni=Pt.properties.topicAlias);let gi=Pt.topic.toString();if(gi.length===0){if(typeof ni>"u")return new Error("Unregistered Topic Alias");if(gi=ei.topicAliasSend.getTopicByAlias(ni),typeof gi>"u")return new Error("Unregistered Topic Alias");Pt.topic=gi}ni&&delete Pt.properties.topicAlias}function At(ei,Pt,ni){ze("sendPacket :: packet: %O",Pt),ze("sendPacket :: emitting `packetsend`"),ei.emit("packetsend",Pt),ze("sendPacket :: writing to stream");const gi=ae.writeToStream(Pt,ei.stream,ei.options);ze("sendPacket :: writeToStream result %s",gi),!gi&&ni&&ni!==jt?(ze("sendPacket :: handle events on `drain` once through callback."),ei.stream.once("drain",ni)):ni&&(ze("sendPacket :: invoking cb"),ni())}function qe(ei){ei&&(ze("flush: queue exists? %b",!!ei),Object.keys(ei).forEach(function(Pt){typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function Lt(ei){ei&&(ze("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(ei).forEach(function(Pt){ei[Pt].volatile&&typeof ei[Pt].cb=="function"&&(ei[Pt].cb(new Error("Connection closed")),delete ei[Pt])}))}function kt(ei,Pt,ni,gi){ze("storeAndSend :: store packet with cmd %s to outgoingStore",Pt.cmd);let di=Pt,li;if(di.cmd==="publish"&&(di=Ne(Pt),li=Oe(ei,di),li))return ni&&ni(li);ei.outgoingStore.put(di,function(ci){if(ci)return ni&&ni(ci);gi(),At(ei,Pt,ni)})}function jt(ei){ze("nop ::",ei)}function ti(ei,Pt){let ni;const gi=this;if(!(this instanceof ti))return new ti(ei,Pt);this.options=Pt||{};for(ni in _e)typeof this.options[ni]>"u"?this.options[ni]=_e[ni]:this.options[ni]=Pt[ni];ze("MqttClient :: options.protocol",Pt.protocol),ze("MqttClient :: options.protocolVersion",Pt.protocolVersion),ze("MqttClient :: options.username",Pt.username),ze("MqttClient :: options.keepalive",Pt.keepalive),ze("MqttClient :: options.reconnectPeriod",Pt.reconnectPeriod),ze("MqttClient :: options.rejectUnauthorized",Pt.rejectUnauthorized),ze("MqttClient :: options.topicAliasMaximum",Pt.topicAliasMaximum),this.options.clientId=typeof Pt.clientId=="string"?Pt.clientId:Ue(),ze("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=Pt.protocolVersion===5&&Pt.customHandleAcks?Pt.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=ei,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new le:this.options.messageIdProvider,this.outgoingStore=Pt.outgoingStore||new re,this.incomingStore=Pt.incomingStore||new re,this.queueQoSZero=Pt.queueQoSZero===void 0?!0:Pt.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,Pt.topicAliasMaximum>0&&(Pt.topicAliasMaximum>65535?ze("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new Ce(Pt.topicAliasMaximum)),this.on("connect",function(){const di=this.queue;function li(){const ai=di.shift();ze("deliver :: entry %o",ai);let ci=null;if(!ai){gi._resubscribe();return}ci=ai.packet,ze("deliver :: call _sendPacket for %o",ci);let pi=!0;ci.messageId&&ci.messageId!==0&&(gi.messageIdProvider.register(ci.messageId)||(pi=!1)),pi?gi._sendPacket(ci,function(yi){ai.cb&&ai.cb(yi),li()}):(ze("messageId: %d has already used. The message is skipped and removed.",ci.messageId),li())}ze("connect :: sending queued packets"),li()}),this.on("close",function(){ze("close :: connected set to `false`"),this.connected=!1,ze("close :: clearing connackTimer"),clearTimeout(this.connackTimer),ze("close :: clearing ping timer"),gi.pingTimer!==null&&(gi.pingTimer.clear(),gi.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),ze("close :: calling _setupReconnect"),this._setupReconnect()}),oe.call(this),ze("MqttClient :: setting up stream"),this._setupStream()}ue(ti,oe),ti.prototype._setupStream=function(){const ei=this,Pt=new Ie,ni=ae.parser(this.options);let gi=null;const di=[];ze("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),ze("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),ni.on("packet",function(yi){ze("parser :: on packet push to packets array."),di.push(yi)});function li(){if(di.length)Fe(ai);else{const yi=gi;gi=null,yi()}}function ai(){ze("work :: getting next packet in queue");const yi=di.shift();if(yi)ze("work :: packet pulled from queue"),ei._handlePacket(yi,li);else{ze("work :: no packets in queue");const Ai=gi;gi=null,ze("work :: done flag is %s",!!Ai),Ai&&Ai()}}Pt._write=function(yi,Ai,hi){gi=hi,ze("writable stream :: parsing buffer"),ni.parse(yi),ai()};function ci(yi){ze("streamErrorHandler :: error",yi.message),Dt.includes(yi.code)?(ze("streamErrorHandler :: emitting error"),ei.emit("error",yi)):jt(yi)}ze("_setupStream :: pipe stream to writable stream"),this.stream.pipe(Pt),this.stream.on("error",ci),this.stream.on("close",function(){ze("(%s)stream :: on close",ei.options.clientId),Lt(ei.outgoing),ze("stream: emit close to MqttClient"),ei.emit("close")}),ze("_setupStream: sending packet `connect`");const pi=Object.create(this.options);if(pi.cmd="connect",this.topicAliasRecv&&(pi.properties||(pi.properties={}),this.topicAliasRecv&&(pi.properties.topicAliasMaximum=this.topicAliasRecv.max)),At(this,pi),ni.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return ei.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){const yi=pe({cmd:"auth",reasonCode:0},this.options.authPacket);At(this,yi)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){ze("!!connectTimeout hit!! Calling _cleanUp with force `true`"),ei._cleanUp(!0)},this.options.connectTimeout)},ti.prototype._handlePacket=function(ei,Pt){const ni=this.options;if(ni.protocolVersion===5&&ni.properties&&ni.properties.maximumPacketSize&&ni.properties.maximumPacketSize<ei.length)return this.emit("error",new Error("exceeding packets size "+ei.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(ze("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",ei),ei.cmd){case"publish":this._handlePublish(ei,Pt);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(ei),Pt();break;case"pubrel":this._handlePubrel(ei,Pt);break;case"connack":this._handleConnack(ei),Pt();break;case"auth":this._handleAuth(ei),Pt();break;case"pingresp":this._handlePingresp(ei),Pt();break;case"disconnect":this._handleDisconnect(ei),Pt();break}},ti.prototype._checkDisconnecting=function(ei){return this.disconnecting&&(ei&&ei!==jt?ei(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},ti.prototype.publish=function(ei,Pt,ni,gi){ze("publish :: message `%s` to topic `%s`",Pt,ei);const di=this.options;if(typeof ni=="function"&&(gi=ni,ni=null),ni=pe({qos:0,retain:!1,dup:!1},ni),this._checkDisconnecting(gi))return this;const ai=this,ci=function(){let pi=0;if((ni.qos===1||ni.qos===2)&&(pi=ai._nextId(),pi===null))return ze("No messageId left"),!1;const yi={cmd:"publish",topic:ei,payload:Pt,qos:ni.qos,retain:ni.retain,messageId:pi,dup:ni.dup};switch(di.protocolVersion===5&&(yi.properties=ni.properties),ze("publish :: qos",ni.qos),ni.qos){case 1:case 2:ai.outgoing[yi.messageId]={volatile:!1,cb:gi||jt},ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,void 0,ni.cbStorePut);break;default:ze("MqttClient:publish: packet cmd: %s",yi.cmd),ai._sendPacket(yi,gi,ni.cbStorePut);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ci())&&this._storeProcessingQueue.push({invoke:ci,cbStorePut:ni.cbStorePut,callback:gi}),this},ti.prototype.subscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let hi=0;hi<arguments.length;hi++)Pt[hi]=arguments[hi];const ni=[];let gi=Pt.shift();const di=gi.resubscribe;let li=Pt.pop()||jt,ai=Pt.pop();const ci=this.options.protocolVersion;delete gi.resubscribe,typeof gi=="string"&&(gi=[gi]),typeof li!="function"&&(ai=li,li=jt);const pi=he.validateTopics(gi);if(pi!==null)return xe(li,new Error("Invalid topic "+pi)),this;if(this._checkDisconnecting(li))return ze("subscribe: discconecting true"),this;const yi={qos:0};if(ci===5&&(yi.nl=!1,yi.rap=!1,yi.rh=0),ai=pe(yi,ai),Array.isArray(gi)?gi.forEach(function(hi){if(ze("subscribe: array topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<ai.qos||di){const wi={topic:hi,qos:ai.qos};ci===5&&(wi.nl=ai.nl,wi.rap=ai.rap,wi.rh=ai.rh,wi.properties=ai.properties),ze("subscribe: pushing topic `%s` and qos `%s` to subs list",wi.topic,wi.qos),ni.push(wi)}}):Object.keys(gi).forEach(function(hi){if(ze("subscribe: object topic %s",hi),!Object.prototype.hasOwnProperty.call(ei._resubscribeTopics,hi)||ei._resubscribeTopics[hi].qos<gi[hi].qos||di){const wi={topic:hi,qos:gi[hi].qos};ci===5&&(wi.nl=gi[hi].nl,wi.rap=gi[hi].rap,wi.rh=gi[hi].rh,wi.properties=ai.properties),ze("subscribe: pushing `%s` to subs list",wi),ni.push(wi)}}),!ni.length)return li(null,[]),this;const Ai=function(){const hi=ei._nextId();if(hi===null)return ze("No messageId left"),!1;const wi={cmd:"subscribe",subscriptions:ni,qos:1,retain:!1,dup:!1,messageId:hi};if(ai.properties&&(wi.properties=ai.properties),ei.options.resubscribe){ze("subscribe :: resubscribe true");const Ci=[];ni.forEach(function(mi){if(ei.options.reconnectPeriod>0){const Ni={qos:mi.qos};ci===5&&(Ni.nl=mi.nl||!1,Ni.rap=mi.rap||!1,Ni.rh=mi.rh||0,Ni.properties=mi.properties),ei._resubscribeTopics[mi.topic]=Ni,Ci.push(mi.topic)}}),ei.messageIdToTopic[wi.messageId]=Ci}return ei.outgoing[wi.messageId]={volatile:!0,cb:function(Ci,mi){if(!Ci){const Ni=mi.granted;for(let Mi=0;Mi<Ni.length;Mi+=1)ni[Mi].qos=Ni[Mi]}li(Ci,ni)}},ze("subscribe :: call _sendPacket"),ei._sendPacket(wi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!Ai())&&this._storeProcessingQueue.push({invoke:Ai,callback:li}),this},ti.prototype.unsubscribe=function(){const ei=this,Pt=new Array(arguments.length);for(let ci=0;ci<arguments.length;ci++)Pt[ci]=arguments[ci];let ni=Pt.shift(),gi=Pt.pop()||jt,di=Pt.pop();typeof ni=="string"&&(ni=[ni]),typeof gi!="function"&&(di=gi,gi=jt);const li=he.validateTopics(ni);if(li!==null)return xe(gi,new Error("Invalid topic "+li)),this;if(ei._checkDisconnecting(gi))return this;const ai=function(){const ci=ei._nextId();if(ci===null)return ze("No messageId left"),!1;const pi={cmd:"unsubscribe",qos:1,messageId:ci};return typeof ni=="string"?pi.unsubscriptions=[ni]:Array.isArray(ni)&&(pi.unsubscriptions=ni),ei.options.resubscribe&&pi.unsubscriptions.forEach(function(yi){delete ei._resubscribeTopics[yi]}),typeof di=="object"&&di.properties&&(pi.properties=di.properties),ei.outgoing[pi.messageId]={volatile:!0,cb:gi},ze("unsubscribe: call _sendPacket"),ei._sendPacket(pi),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ai())&&this._storeProcessingQueue.push({invoke:ai,callback:gi}),this},ti.prototype.end=function(ei,Pt,ni){const gi=this;ze("end :: (%s)",this.options.clientId),(ei==null||typeof ei!="boolean")&&(ni=Pt||jt,Pt=ei,ei=!1,typeof Pt!="object"&&(ni=Pt,Pt=null,typeof ni!="function"&&(ni=jt))),typeof Pt!="object"&&(ni=Pt,Pt=null),ze("end :: cb? %s",!!ni),ni=ni||jt;function di(){ze("end :: closeStores: closing incoming and outgoing stores"),gi.disconnected=!0,gi.incomingStore.close(function(ai){gi.outgoingStore.close(function(ci){if(ze("end :: closeStores: emitting end"),gi.emit("end"),ni){const pi=ai||ci;ze("end :: closeStores: invoking callback with args"),ni(pi)}})}),gi._deferredReconnect&&gi._deferredReconnect()}function li(){ze("end :: (%s) :: finish :: calling _cleanUp with force %s",gi.options.clientId,ei),gi._cleanUp(ei,()=>{ze("end :: finish :: calling process.nextTick on closeStores"),Fe(di.bind(gi))},Pt)}return this.disconnecting?(ni(),this):(this._clearReconnect(),this.disconnecting=!0,!ei&&Object.keys(this.outgoing).length>0?(ze("end :: (%s) :: calling finish in 10ms once outgoing is empty",gi.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,li,10))):(ze("end :: (%s) :: immediately calling finish",gi.options.clientId),li()),this)},ti.prototype.removeOutgoingMessage=function(ei){const Pt=this.outgoing[ei]?this.outgoing[ei].cb:null;return delete this.outgoing[ei],this.outgoingStore.del({messageId:ei},function(){Pt(new Error("Message removed"))}),this},ti.prototype.reconnect=function(ei){ze("client reconnect");const Pt=this,ni=function(){ei?(Pt.options.incomingStore=ei.incomingStore,Pt.options.outgoingStore=ei.outgoingStore):(Pt.options.incomingStore=null,Pt.options.outgoingStore=null),Pt.incomingStore=Pt.options.incomingStore||new re,Pt.outgoingStore=Pt.options.outgoingStore||new re,Pt.disconnecting=!1,Pt.disconnected=!1,Pt._deferredReconnect=null,Pt._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=ni:ni(),this},ti.prototype._reconnect=function(){ze("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),ze("client already connected. disconnecting first.")):(ze("_reconnect: calling _setupStream"),this._setupStream())},ti.prototype._setupReconnect=function(){const ei=this;!ei.disconnecting&&!ei.reconnectTimer&&ei.options.reconnectPeriod>0?(this.reconnecting||(ze("_setupReconnect :: emit `offline` state"),this.emit("offline"),ze("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),ze("_setupReconnect :: setting reconnectTimer for %d ms",ei.options.reconnectPeriod),ei.reconnectTimer=setInterval(function(){ze("reconnectTimer :: reconnect triggered!"),ei._reconnect()},ei.options.reconnectPeriod)):ze("_setupReconnect :: doing nothing...")},ti.prototype._clearReconnect=function(){ze("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},ti.prototype._cleanUp=function(ei,Pt){const ni=arguments[2];if(Pt&&(ze("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",Pt)),ze("_cleanUp :: forced? %s",ei),ei)this.options.reconnectPeriod===0&&this.options.clean&&qe(this.outgoing),ze("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const gi=pe({cmd:"disconnect"},ni);ze("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(gi,xe.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(ze("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(ze("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),Pt&&!this.connected&&(ze("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",Pt),Pt())},ti.prototype._sendPacket=function(ei,Pt,ni){ze("_sendPacket :: (%s) :: start",this.options.clientId),ni=ni||jt,Pt=Pt||jt;const gi=Ve(this,ei);if(gi){Pt(gi);return}if(!this.connected){if(ei.cmd==="auth"){this._shiftPingInterval(),At(this,ei,Pt);return}ze("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(ei,Pt,ni);return}switch(this._shiftPingInterval(),ei.cmd){case"publish":break;case"pubrel":kt(this,ei,Pt,ni);return;default:At(this,ei,Pt);return}switch(ei.qos){case 2:case 1:kt(this,ei,Pt,ni);break;case 0:default:At(this,ei,Pt);break}ze("_sendPacket :: (%s) :: end",this.options.clientId)},ti.prototype._storePacket=function(ei,Pt,ni){ze("_storePacket :: packet: %o",ei),ze("_storePacket :: cb? %s",!!Pt),ni=ni||jt;let gi=ei;if(gi.cmd==="publish"){gi=Ne(ei);const di=Oe(this,gi);if(di)return Pt&&Pt(di)}(gi.qos||0)===0&&this.queueQoSZero||gi.cmd!=="publish"?this.queue.push({packet:gi,cb:Pt}):gi.qos>0?(Pt=this.outgoing[gi.messageId]?this.outgoing[gi.messageId].cb:null,this.outgoingStore.put(gi,function(di){if(di)return Pt&&Pt(di);ni()})):Pt&&Pt(new Error("No connection to broker"))},ti.prototype._setupPingTimer=function(){ze("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const ei=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=de(function(){ei._checkPing()},this.options.keepalive*1e3))},ti.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},ti.prototype._checkPing=function(){ze("_checkPing :: checking ping..."),this.pingResp?(ze("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(ze("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},ti.prototype._handlePingresp=function(){this.pingResp=!0},ti.prototype._handleConnack=function(ei){ze("_handleConnack");const Pt=this.options,gi=Pt.protocolVersion===5?ei.reasonCode:ei.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,ei.properties){if(ei.properties.topicAliasMaximum){if(ei.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}ei.properties.topicAliasMaximum>0&&(this.topicAliasSend=new ie(ei.properties.topicAliasMaximum))}ei.properties.serverKeepAlive&&Pt.keepalive&&(Pt.keepalive=ei.properties.serverKeepAlive,this._shiftPingInterval()),ei.properties.maximumPacketSize&&(Pt.properties||(Pt.properties={}),Pt.properties.maximumPacketSize=ei.properties.maximumPacketSize)}if(gi===0)this.reconnecting=!1,this._onConnect(ei);else if(gi>0){const di=new Error("Connection refused: "+$e[gi]);di.code=gi,this.emit("error",di)}},ti.prototype._handleAuth=function(ei){const ni=this.options.protocolVersion,gi=ni===5?ei.reasonCode:ei.returnCode;if(ni!==5){const li=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+ni);li.code=gi,this.emit("error",li);return}const di=this;this.handleAuth(ei,function(li,ai){if(li){di.emit("error",li);return}if(gi===24)di.reconnecting=!1,di._sendPacket(ai);else{const ci=new Error("Connection refused: "+$e[gi]);li.code=gi,di.emit("error",ci)}})},ti.prototype.handleAuth=function(ei,Pt){Pt()},ti.prototype._handlePublish=function(ei,Pt){ze("_handlePublish: packet %o",ei),Pt=typeof Pt<"u"?Pt:jt;let ni=ei.topic.toString();const gi=ei.payload,di=ei.qos,li=ei.messageId,ai=this,ci=this.options,pi=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let yi;if(ei.properties&&(yi=ei.properties.topicAlias),typeof yi<"u")if(ni.length===0)if(yi>0&&yi<=65535){const Ai=this.topicAliasRecv.getTopicByAlias(yi);if(Ai)ni=Ai,ze("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: unregistered topic alias. alias: %d",yi),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(ni,yi))ze("_handlePublish :: registered topic: %s - alias: %d",ni,yi);else{ze("_handlePublish :: topic alias out of range. alias: %d",yi),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(ze("_handlePublish: qos %d",di),di){case 2:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for pubrec"));Ai?ai._sendPacket({cmd:"pubrec",messageId:li,reasonCode:Ai},Pt):ai.incomingStore.put(ei,function(){ai._sendPacket({cmd:"pubrec",messageId:li},Pt)})});break}case 1:{ci.customHandleAcks(ni,gi,ei,function(yi,Ai){if(yi instanceof Error||(Ai=yi,yi=null),yi)return ai.emit("error",yi);if(pi.indexOf(Ai)===-1)return ai.emit("error",new Error("Wrong reason code for puback"));Ai||ai.emit("message",ni,gi,ei),ai.handleMessage(ei,function(hi){if(hi)return Pt&&Pt(hi);ai._sendPacket({cmd:"puback",messageId:li,reasonCode:Ai},Pt)})});break}case 0:this.emit("message",ni,gi,ei),this.handleMessage(ei,Pt);break;default:ze("_handlePublish: unknown QoS. Doing nothing.");break}},ti.prototype.handleMessage=function(ei,Pt){Pt()},ti.prototype._handleAck=function(ei){const Pt=ei.messageId,ni=ei.cmd;let gi=null;const di=this.outgoing[Pt]?this.outgoing[Pt].cb:null,li=this;let ai;if(!di){ze("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(ze("_handleAck :: packet type",ni),ni){case"pubcomp":case"puback":{const ci=ei.reasonCode;ci&&ci>0&&ci!==16&&(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)),delete this.outgoing[Pt],this.outgoingStore.del(ei,di),this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue();break}case"pubrec":{gi={cmd:"pubrel",qos:2,messageId:Pt};const ci=ei.reasonCode;ci&&ci>0&&ci!==16?(ai=new Error("Publish error: "+$e[ci]),ai.code=ci,di(ai,ei)):this._sendPacket(gi);break}case"suback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt);for(let ci=0;ci<ei.granted.length;ci++)if(ei.granted[ci]&128){const pi=this.messageIdToTopic[Pt];pi&&pi.forEach(function(yi){delete li._resubscribeTopics[yi]})}this._invokeStoreProcessingQueue(),di(null,ei);break}case"unsuback":{delete this.outgoing[Pt],this.messageIdProvider.deallocate(Pt),this._invokeStoreProcessingQueue(),di(null);break}default:li.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&Object.keys(this.outgoing).length===0&&this.emit("outgoingEmpty")},ti.prototype._handlePubrel=function(ei,Pt){ze("handling pubrel packet"),Pt=typeof Pt<"u"?Pt:jt;const ni=ei.messageId,gi=this,di={cmd:"pubcomp",messageId:ni};gi.incomingStore.get(ei,function(li,ai){li?gi._sendPacket(di,Pt):(gi.emit("message",ai.topic,ai.payload,ai),gi.handleMessage(ai,function(ci){if(ci)return Pt(ci);gi.incomingStore.del(ai,jt),gi._sendPacket(di,Pt)}))})},ti.prototype._handleDisconnect=function(ei){this.emit("disconnect",ei)},ti.prototype._nextId=function(){return this.messageIdProvider.allocate()},ti.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},ti.prototype._resubscribe=function(){ze("_resubscribe");const ei=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion===5&&!this.connackPacket.sessionPresent)&&ei.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){ze("_resubscribe: protocolVersion 5");for(let Pt=0;Pt<ei.length;Pt++){const ni={};ni[ei[Pt]]=this._resubscribeTopics[ei[Pt]],ni.resubscribe=!0,this.subscribe(ni,{properties:ni[ei[Pt]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1},ti.prototype._onConnect=function(ei){if(this.disconnected){this.emit("connect",ei);return}const Pt=this;this.connackPacket=ei,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;function ni(){let gi=Pt.outgoingStore.createStream();function di(){Pt._storeProcessing=!1,Pt._packetIdsDuringStoreProcessing={}}Pt.once("close",li),gi.on("error",function(ci){di(),Pt._flushStoreProcessingQueue(),Pt.removeListener("close",li),Pt.emit("error",ci)});function li(){gi.destroy(),gi=null,Pt._flushStoreProcessingQueue(),di()}function ai(){if(!gi)return;Pt._storeProcessing=!0;const ci=gi.read(1);let pi;if(!ci){gi.once("readable",ai);return}if(Pt._packetIdsDuringStoreProcessing[ci.messageId]){ai();return}!Pt.disconnecting&&!Pt.reconnectTimer?(pi=Pt.outgoing[ci.messageId]?Pt.outgoing[ci.messageId].cb:null,Pt.outgoing[ci.messageId]={volatile:!1,cb:function(yi,Ai){pi&&pi(yi,Ai),ai()}},Pt._packetIdsDuringStoreProcessing[ci.messageId]=!0,Pt.messageIdProvider.register(ci.messageId)?Pt._sendPacket(ci):ze("messageId: %d has already used.",ci.messageId)):gi.destroy&&gi.destroy()}gi.on("end",function(){let ci=!0;for(const pi in Pt._packetIdsDuringStoreProcessing)if(!Pt._packetIdsDuringStoreProcessing[pi]){ci=!1;break}ci?(di(),Pt.removeListener("close",li),Pt._invokeAllStoreProcessingQueue(),Pt.emit("connect",ei)):ni()}),ai()}ni()},ti.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const ei=this._storeProcessingQueue[0];if(ei&&ei.invoke())return this._storeProcessingQueue.shift(),!0}return!1},ti.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},ti.prototype._flushStoreProcessingQueue=function(){for(const ei of this._storeProcessingQueue)ei.cbStorePut&&ei.cbStorePut(new Error("Connection closed")),ei.callback&&ei.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},g.exports=ti}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":7,"./store":8,"./topic-alias-recv":9,"./topic-alias-send":10,"./validations":11,_process:50,debug:18,events:22,inherits:24,"mqtt-packet":40,"readable-stream":69,reinterval:70,"rfdc/default":71,xtend:81}],2:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie,ae=!1;function le(){const he=new $;return he._write=function(pe,ze,Fe){re.sendSocketMessage({data:pe.buffer,success:function(){Fe()},fail:function(){Fe(new Error)}})},he._flush=function(ze){re.closeSocket({success:function(){ze()}})},he}function Ie(he){he.hostname||(he.hostname="localhost"),he.path||(he.path="/"),he.wsOptions||(he.wsOptions={})}function ue(he,pe){const ze=he.protocol==="alis"?"wss":"ws";let Fe=ze+"://"+he.hostname+he.path;return he.port&&he.port!==80&&he.port!==443&&(Fe=ze+"://"+he.hostname+":"+he.port+he.path),typeof he.transformWsUrl=="function"&&(Fe=he.transformWsUrl(Fe,he,pe)),Fe}function de(){ae||(ae=!0,re.onSocketOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onSocketMessage(function(he){if(typeof he.data=="string"){const pe=V.from(he.data,"base64");Ce.push(pe)}else{const pe=new FileReader;pe.addEventListener("load",function(){let ze=pe.result;ze instanceof ArrayBuffer?ze=V.from(ze):ze=V.from(ze,"utf8"),Ce.push(ze)}),pe.readAsArrayBuffer(he.data)}}),re.onSocketClose(function(){ie.end(),ie.destroy()}),re.onSocketError(function(he){ie.destroy(he)}))}function Ne(he,pe){if(pe.hostname=pe.hostname||pe.host,!pe.hostname)throw new Error("Could not determine host. Specify host manually.");const ze=pe.protocolId==="MQIsdp"&&pe.protocolVersion===3?"mqttv3.1":"mqtt";Ie(pe);const Fe=ue(pe,he);return re=pe.my,re.connectSocket({url:Fe,protocols:ze}),Ce=le(),ie=oe.obj(),de(),ie}g.exports=Ne},{buffer:17,duplexify:20,"readable-stream":69}],3:[function(r,g,k){const V=r("net"),$=r("debug")("mqttjs:tcp");function oe(re,Ce){Ce.port=Ce.port||1883,Ce.hostname=Ce.hostname||Ce.host||"localhost";const ie=Ce.port,ae=Ce.hostname;return $("port %d and host %s",ie,ae),V.createConnection(ie,ae)}g.exports=oe},{debug:18,net:16}],4:[function(r,g,k){const V=r("tls"),$=r("net"),oe=r("debug")("mqttjs:tls");function re(Ce,ie){ie.port=ie.port||8883,ie.host=ie.hostname||ie.host||"localhost",$.isIP(ie.host)===0&&(ie.servername=ie.host),ie.rejectUnauthorized=ie.rejectUnauthorized!==!1,delete ie.path,oe("port %d host %s rejectUnauthorized %b",ie.port,ie.host,ie.rejectUnauthorized);const ae=V.connect(ie);ae.on("secureConnect",function(){ie.rejectUnauthorized&&!ae.authorized?ae.emit("error",new Error("TLS not authorized")):ae.removeListener("error",le)});function le(Ie){ie.rejectUnauthorized&&Ce.emit("error",Ie),ae.end()}return ae.on("error",le),ae}g.exports=re},{debug:18,net:16,tls:16}],5:[function(r,g,k){(function(V){(function(){const{Buffer:$}=r("buffer"),oe=r("ws"),re=r("debug")("mqttjs:ws"),Ce=r("duplexify"),ie=r("readable-stream").Transform,ae=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],le=typeof V<"u"&&V.title==="browser"||typeof __webpack_require__=="function";function Ie(Fe,xe){let _e=Fe.protocol+"://"+Fe.hostname+":"+Fe.port+Fe.path;return typeof Fe.transformWsUrl=="function"&&(_e=Fe.transformWsUrl(_e,Fe,xe)),_e}function ue(Fe){const xe=Fe;return Fe.hostname||(xe.hostname="localhost"),Fe.port||(Fe.protocol==="wss"?xe.port=443:xe.port=80),Fe.path||(xe.path="/"),Fe.wsOptions||(xe.wsOptions={}),!le&&Fe.protocol==="wss"&&ae.forEach(function(_e){Object.prototype.hasOwnProperty.call(Fe,_e)&&!Object.prototype.hasOwnProperty.call(Fe.wsOptions,_e)&&(xe.wsOptions[_e]=Fe[_e])}),xe}function de(Fe){const xe=ue(Fe);if(xe.hostname||(xe.hostname=xe.host),!xe.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const _e=new URL(document.URL);xe.hostname=_e.hostname,xe.port||(xe.port=_e.port)}return xe.objectMode===void 0&&(xe.objectMode=!(xe.binary===!0||xe.binary===void 0)),xe}function Ne(Fe,xe,_e){re("createWebSocket"),re("protocol: "+_e.protocolId+" "+_e.protocolVersion);const Dt=_e.protocolId==="MQIsdp"&&_e.protocolVersion===3?"mqttv3.1":"mqtt";return re("creating new Websocket for url: "+xe+" and protocol: "+Dt),new oe(xe,[Dt],_e.wsOptions)}function he(Fe,xe){const _e=xe.protocolId==="MQIsdp"&&xe.protocolVersion===3?"mqttv3.1":"mqtt",Dt=Ie(xe,Fe),$e=new WebSocket(Dt,[_e]);return $e.binaryType="arraybuffer",$e}function pe(Fe,xe){re("streamBuilder");const _e=ue(xe),Dt=Ie(_e,Fe),$e=Ne(Fe,Dt,_e),Ue=oe.createWebSocketStream($e,_e.wsOptions);return Ue.url=Dt,$e.on("close",()=>{Ue.destroy()}),Ue}function ze(Fe,xe){re("browserStreamBuilder");let _e;const $e=de(xe).browserBufferSize||1024*512,Ue=xe.browserBufferTimeout||1e3,Ve=!xe.objectMode,Oe=he(Fe,xe),At=Lt(xe,ni,gi);xe.objectMode||(At._writev=Pt),At.on("close",()=>{Oe.close()});const qe=typeof Oe.addEventListener<"u";Oe.readyState===Oe.OPEN?_e=At:(_e=_e=Ce(void 0,void 0,xe),xe.objectMode||(_e._writev=Pt),qe?Oe.addEventListener("open",kt):Oe.onopen=kt),_e.socket=Oe,qe?(Oe.addEventListener("close",jt),Oe.addEventListener("error",ti),Oe.addEventListener("message",ei)):(Oe.onclose=jt,Oe.onerror=ti,Oe.onmessage=ei);function Lt(di,li,ai){const ci=new ie({objectModeMode:di.objectMode});return ci._write=li,ci._flush=ai,ci}function kt(){_e.setReadable(At),_e.setWritable(At),_e.emit("connect")}function jt(){_e.end(),_e.destroy()}function ti(di){_e.destroy(di)}function ei(di){let li=di.data;li instanceof ArrayBuffer?li=$.from(li):li=$.from(li,"utf8"),At.push(li)}function Pt(di,li){const ai=new Array(di.length);for(let ci=0;ci<di.length;ci++)typeof di[ci].chunk=="string"?ai[ci]=$.from(di[ci],"utf8"):ai[ci]=di[ci].chunk;this._write($.concat(ai),"binary",li)}function ni(di,li,ai){Oe.bufferedAmount>$e&&setTimeout(ni,Ue,di,li,ai),Ve&&typeof di=="string"&&(di=$.from(di,"utf8"));try{Oe.send(di)}catch(ci){return ai(ci)}ai()}function gi(di){Oe.close(),di()}return _e}le?g.exports=ze:g.exports=pe}).call(this)}).call(this,r("_process"))},{_process:50,buffer:17,debug:18,duplexify:20,"readable-stream":69,ws:80}],6:[function(r,g,k){const{Buffer:V}=r("buffer"),$=r("readable-stream").Transform,oe=r("duplexify");let re,Ce,ie;function ae(){const Ne=new $;return Ne._write=function(he,pe,ze){re.send({data:he.buffer,success:function(){ze()},fail:function(Fe){ze(new Error(Fe))}})},Ne._flush=function(pe){re.close({success:function(){pe()}})},Ne}function le(Ne){Ne.hostname||(Ne.hostname="localhost"),Ne.path||(Ne.path="/"),Ne.wsOptions||(Ne.wsOptions={})}function Ie(Ne,he){const pe=Ne.protocol==="wxs"?"wss":"ws";let ze=pe+"://"+Ne.hostname+Ne.path;return Ne.port&&Ne.port!==80&&Ne.port!==443&&(ze=pe+"://"+Ne.hostname+":"+Ne.port+Ne.path),typeof Ne.transformWsUrl=="function"&&(ze=Ne.transformWsUrl(ze,Ne,he)),ze}function ue(){re.onOpen(function(){ie.setReadable(Ce),ie.setWritable(Ce),ie.emit("connect")}),re.onMessage(function(Ne){let he=Ne.data;he instanceof ArrayBuffer?he=V.from(he):he=V.from(he,"utf8"),Ce.push(he)}),re.onClose(function(){ie.end(),ie.destroy()}),re.onError(function(Ne){ie.destroy(new Error(Ne.errMsg))})}function de(Ne,he){if(he.hostname=he.hostname||he.host,!he.hostname)throw new Error("Could not determine host. Specify host manually.");const pe=he.protocolId==="MQIsdp"&&he.protocolVersion===3?"mqttv3.1":"mqtt";le(he);const ze=Ie(he,Ne);re=wx.connectSocket({url:ze,protocols:[pe]}),Ce=ae(),ie=oe.obj(),ie._destroy=function(xe,_e){re.close({success:function(){_e&&_e(xe)}})};const Fe=ie.destroy;return ie.destroy=function(){ie.destroy=Fe;const xe=this;setTimeout(function(){re.close({fail:function(){xe._destroy(new Error)}})},0)}.bind(ie),ue(),ie}g.exports=de},{buffer:17,duplexify:20,"readable-stream":69}],7:[function(r,g,k){function V(){if(!(this instanceof V))return new V;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}V.prototype.allocate=function(){const $=this.nextId++;return this.nextId===65536&&(this.nextId=1),$},V.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},V.prototype.register=function($){return!0},V.prototype.deallocate=function($){},V.prototype.clear=function(){},g.exports=V},{}],8:[function(r,g,k){const V=r("xtend"),$=r("readable-stream").Readable,oe={objectMode:!0},re={clean:!0};function Ce(ie){if(!(this instanceof Ce))return new Ce(ie);this.options=ie||{},this.options=V(re,ie),this._inflights=new Map}Ce.prototype.put=function(ie,ae){return this._inflights.set(ie.messageId,ie),ae&&ae(),this},Ce.prototype.createStream=function(){const ie=new $(oe),ae=[];let le=!1,Ie=0;return this._inflights.forEach(function(ue,de){ae.push(ue)}),ie._read=function(){!le&&Ie<ae.length?this.push(ae[Ie++]):this.push(null)},ie.destroy=function(){if(le)return;const ue=this;le=!0,setTimeout(function(){ue.emit("close")},0)},ie},Ce.prototype.del=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?(this._inflights.delete(ie.messageId),ae(null,ie)):ae&&ae(new Error("missing packet")),this},Ce.prototype.get=function(ie,ae){return ie=this._inflights.get(ie.messageId),ie?ae(null,ie):ae&&ae(new Error("missing packet")),this},Ce.prototype.close=function(ie){this.options.clean&&(this._inflights=null),ie&&ie()},g.exports=Ce},{"readable-stream":69,xtend:81}],9:[function(r,g,k){function V($){if(!(this instanceof V))return new V($);this.aliasToTopic={},this.max=$}V.prototype.put=function($,oe){return oe===0||oe>this.max?!1:(this.aliasToTopic[oe]=$,this.length=Object.keys(this.aliasToTopic).length,!0)},V.prototype.getTopicByAlias=function($){return this.aliasToTopic[$]},V.prototype.clear=function(){this.aliasToTopic={}},g.exports=V},{}],10:[function(r,g,k){const V=r("lru-cache"),$=r("number-allocator").NumberAllocator;function oe(re){if(!(this instanceof oe))return new oe(re);re>0&&(this.aliasToTopic=new V({max:re}),this.topicToAlias={},this.numberAllocator=new $(1,re),this.max=re,this.length=0)}oe.prototype.put=function(re,Ce){if(Ce===0||Ce>this.max)return!1;const ie=this.aliasToTopic.get(Ce);return ie&&delete this.topicToAlias[ie],this.aliasToTopic.set(Ce,re),this.topicToAlias[re]=Ce,this.numberAllocator.use(Ce),this.length=this.aliasToTopic.length,!0},oe.prototype.getTopicByAlias=function(re){return this.aliasToTopic.get(re)},oe.prototype.getAliasByTopic=function(re){const Ce=this.topicToAlias[re];return typeof Ce<"u"&&this.aliasToTopic.get(Ce),Ce},oe.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},oe.prototype.getLruAlias=function(){const re=this.numberAllocator.firstVacant();return re||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},g.exports=oe},{"lru-cache":37,"number-allocator":46}],11:[function(r,g,k){function V(oe){const re=oe.split("/");for(let Ce=0;Ce<re.length;Ce++)if(re[Ce]!=="+"){if(re[Ce]==="#")return Ce===re.length-1;if(re[Ce].indexOf("+")!==-1||re[Ce].indexOf("#")!==-1)return!1}return!0}function $(oe){if(oe.length===0)return"empty_topic_list";for(let re=0;re<oe.length;re++)if(!V(oe[re]))return oe[re];return null}g.exports={validateTopics:$}},{}],12:[function(r,g,k){(function(V){(function(){const $=r("../client"),oe=r("../store"),re=r("url"),Ce=r("xtend"),ie=r("debug")("mqttjs"),ae={};typeof V<"u"&&V.title!=="browser"||typeof __webpack_require__!="function"?(ae.mqtt=r("./tcp"),ae.tcp=r("./tcp"),ae.ssl=r("./tls"),ae.tls=r("./tls"),ae.mqtts=r("./tls")):(ae.wx=r("./wx"),ae.wxs=r("./wx"),ae.ali=r("./ali"),ae.alis=r("./ali")),ae.ws=r("./ws"),ae.wss=r("./ws");function le(ue){let de;ue.auth&&(de=ue.auth.match(/^(.+):(.+)$/),de?(ue.username=de[1],ue.password=de[2]):ue.username=ue.auth)}function Ie(ue,de){if(ie("connecting to an MQTT broker..."),typeof ue=="object"&&!de&&(de=ue,ue=null),de=de||{},ue){const pe=re.parse(ue,!0);if(pe.port!=null&&(pe.port=Number(pe.port)),de=Ce(pe,de),de.protocol===null)throw new Error("Missing protocol");de.protocol=de.protocol.replace(/:$/,"")}if(le(de),de.query&&typeof de.query.clientId=="string"&&(de.clientId=de.query.clientId),de.cert&&de.key)if(de.protocol){if(["mqtts","wss","wxs","alis"].indexOf(de.protocol)===-1)switch(de.protocol){case"mqtt":de.protocol="mqtts";break;case"ws":de.protocol="wss";break;case"wx":de.protocol="wxs";break;case"ali":de.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+de.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!ae[de.protocol]){const pe=["mqtts","wss"].indexOf(de.protocol)!==-1;de.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(ze,Fe){return pe&&Fe%2===0?!1:typeof ae[ze]=="function"})[0]}if(de.clean===!1&&!de.clientId)throw new Error("Missing clientId for unclean clients");de.protocol&&(de.defaultProtocol=de.protocol);function Ne(pe){return de.servers&&((!pe._reconnectCount||pe._reconnectCount===de.servers.length)&&(pe._reconnectCount=0),de.host=de.servers[pe._reconnectCount].host,de.port=de.servers[pe._reconnectCount].port,de.protocol=de.servers[pe._reconnectCount].protocol?de.servers[pe._reconnectCount].protocol:de.defaultProtocol,de.hostname=de.host,pe._reconnectCount++),ie("calling streambuilder for",de.protocol),ae[de.protocol](pe,de)}const he=new $(Ne,de);return he.on("error",function(){}),he}g.exports=Ie,g.exports.connect=Ie,g.exports.MqttClient=$,g.exports.Store=oe}).call(this)}).call(this,r("_process"))},{"../client":1,"../store":8,"./ali":2,"./tcp":3,"./tls":4,"./ws":5,"./wx":6,_process:50,debug:18,url:76,xtend:81}],13:[function(r,g,k){k.byteLength=le,k.toByteArray=ue,k.fromByteArray=he;for(var V=[],$=[],oe=typeof Uint8Array<"u"?Uint8Array:Array,re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ce=0,ie=re.length;Ce<ie;++Ce)V[Ce]=re[Ce],$[re.charCodeAt(Ce)]=Ce;$["-".charCodeAt(0)]=62,$["_".charCodeAt(0)]=63;function ae(pe){var ze=pe.length;if(ze%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var Fe=pe.indexOf("=");Fe===-1&&(Fe=ze);var xe=Fe===ze?0:4-Fe%4;return[Fe,xe]}function le(pe){var ze=ae(pe),Fe=ze[0],xe=ze[1];return(Fe+xe)*3/4-xe}function Ie(pe,ze,Fe){return(ze+Fe)*3/4-Fe}function ue(pe){var ze,Fe=ae(pe),xe=Fe[0],_e=Fe[1],Dt=new oe(Ie(pe,xe,_e)),$e=0,Ue=_e>0?xe-4:xe,Ve;for(Ve=0;Ve<Ue;Ve+=4)ze=$[pe.charCodeAt(Ve)]<<18|$[pe.charCodeAt(Ve+1)]<<12|$[pe.charCodeAt(Ve+2)]<<6|$[pe.charCodeAt(Ve+3)],Dt[$e++]=ze>>16&255,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255;return _e===2&&(ze=$[pe.charCodeAt(Ve)]<<2|$[pe.charCodeAt(Ve+1)]>>4,Dt[$e++]=ze&255),_e===1&&(ze=$[pe.charCodeAt(Ve)]<<10|$[pe.charCodeAt(Ve+1)]<<4|$[pe.charCodeAt(Ve+2)]>>2,Dt[$e++]=ze>>8&255,Dt[$e++]=ze&255),Dt}function de(pe){return V[pe>>18&63]+V[pe>>12&63]+V[pe>>6&63]+V[pe&63]}function Ne(pe,ze,Fe){for(var xe,_e=[],Dt=ze;Dt<Fe;Dt+=3)xe=(pe[Dt]<<16&16711680)+(pe[Dt+1]<<8&65280)+(pe[Dt+2]&255),_e.push(de(xe));return _e.join("")}function he(pe){for(var ze,Fe=pe.length,xe=Fe%3,_e=[],Dt=16383,$e=0,Ue=Fe-xe;$e<Ue;$e+=Dt)_e.push(Ne(pe,$e,$e+Dt>Ue?Ue:$e+Dt));return xe===1?(ze=pe[Fe-1],_e.push(V[ze>>2]+V[ze<<4&63]+"==")):xe===2&&(ze=(pe[Fe-2]<<8)+pe[Fe-1],_e.push(V[ze>>10]+V[ze>>4&63]+V[ze<<2&63]+"=")),_e.join("")}},{}],14:[function(r,g,k){const{Buffer:V}=r("buffer"),$=Symbol.for("BufferList");function oe(re){if(!(this instanceof oe))return new oe(re);oe._init.call(this,re)}oe._init=function(Ce){Object.defineProperty(this,$,{value:!0}),this._bufs=[],this.length=0,Ce&&this.append(Ce)},oe.prototype._new=function(Ce){return new oe(Ce)},oe.prototype._offset=function(Ce){if(Ce===0)return[0,0];let ie=0;for(let ae=0;ae<this._bufs.length;ae++){const le=ie+this._bufs[ae].length;if(Ce<le||ae===this._bufs.length-1)return[ae,Ce-ie];ie=le}},oe.prototype._reverseOffset=function(re){const Ce=re[0];let ie=re[1];for(let ae=0;ae<Ce;ae++)ie+=this._bufs[ae].length;return ie},oe.prototype.get=function(Ce){if(Ce>this.length||Ce<0)return;const ie=this._offset(Ce);return this._bufs[ie[0]][ie[1]]},oe.prototype.slice=function(Ce,ie){return typeof Ce=="number"&&Ce<0&&(Ce+=this.length),typeof ie=="number"&&ie<0&&(ie+=this.length),this.copy(null,0,Ce,ie)},oe.prototype.copy=function(Ce,ie,ae,le){if((typeof ae!="number"||ae<0)&&(ae=0),(typeof le!="number"||le>this.length)&&(le=this.length),ae>=this.length||le<=0)return Ce||V.alloc(0);const Ie=!!Ce,ue=this._offset(ae),de=le-ae;let Ne=de,he=Ie&&ie||0,pe=ue[1];if(ae===0&&le===this.length){if(!Ie)return this._bufs.length===1?this._bufs[0]:V.concat(this._bufs,this.length);for(let ze=0;ze<this._bufs.length;ze++)this._bufs[ze].copy(Ce,he),he+=this._bufs[ze].length;return Ce}if(Ne<=this._bufs[ue[0]].length-pe)return Ie?this._bufs[ue[0]].copy(Ce,ie,pe,pe+Ne):this._bufs[ue[0]].slice(pe,pe+Ne);Ie||(Ce=V.allocUnsafe(de));for(let ze=ue[0];ze<this._bufs.length;ze++){const Fe=this._bufs[ze].length-pe;if(Ne>Fe)this._bufs[ze].copy(Ce,he,pe),he+=Fe;else{this._bufs[ze].copy(Ce,he,pe,pe+Ne),he+=Fe;break}Ne-=Fe,pe&&(pe=0)}return Ce.length>he?Ce.slice(0,he):Ce},oe.prototype.shallowSlice=function(Ce,ie){if(Ce=Ce||0,ie=typeof ie!="number"?this.length:ie,Ce<0&&(Ce+=this.length),ie<0&&(ie+=this.length),Ce===ie)return this._new();const ae=this._offset(Ce),le=this._offset(ie),Ie=this._bufs.slice(ae[0],le[0]+1);return le[1]===0?Ie.pop():Ie[Ie.length-1]=Ie[Ie.length-1].slice(0,le[1]),ae[1]!==0&&(Ie[0]=Ie[0].slice(ae[1])),this._new(Ie)},oe.prototype.toString=function(Ce,ie,ae){return this.slice(ie,ae).toString(Ce)},oe.prototype.consume=function(Ce){if(Ce=Math.trunc(Ce),Number.isNaN(Ce)||Ce<=0)return this;for(;this._bufs.length;)if(Ce>=this._bufs[0].length)Ce-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(Ce),this.length-=Ce;break}return this},oe.prototype.duplicate=function(){const Ce=this._new();for(let ie=0;ie<this._bufs.length;ie++)Ce.append(this._bufs[ie]);return Ce},oe.prototype.append=function(Ce){if(Ce==null)return this;if(Ce.buffer)this._appendBuffer(V.from(Ce.buffer,Ce.byteOffset,Ce.byteLength));else if(Array.isArray(Ce))for(let ie=0;ie<Ce.length;ie++)this.append(Ce[ie]);else if(this._isBufferList(Ce))for(let ie=0;ie<Ce._bufs.length;ie++)this.append(Ce._bufs[ie]);else typeof Ce=="number"&&(Ce=Ce.toString()),this._appendBuffer(V.from(Ce));return this},oe.prototype._appendBuffer=function(Ce){this._bufs.push(Ce),this.length+=Ce.length},oe.prototype.indexOf=function(re,Ce,ie){if(ie===void 0&&typeof Ce=="string"&&(ie=Ce,Ce=void 0),typeof re=="function"||Array.isArray(re))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof re=="number"?re=V.from([re]):typeof re=="string"?re=V.from(re,ie):this._isBufferList(re)?re=re.slice():Array.isArray(re.buffer)?re=V.from(re.buffer,re.byteOffset,re.byteLength):V.isBuffer(re)||(re=V.from(re)),Ce=Number(Ce||0),isNaN(Ce)&&(Ce=0),Ce<0&&(Ce=this.length+Ce),Ce<0&&(Ce=0),re.length===0)return Ce>this.length?this.length:Ce;const ae=this._offset(Ce);let le=ae[0],Ie=ae[1];for(;le<this._bufs.length;le++){const ue=this._bufs[le];for(;Ie<ue.length;)if(ue.length-Ie>=re.length){const Ne=ue.indexOf(re,Ie);if(Ne!==-1)return this._reverseOffset([le,Ne]);Ie=ue.length-re.length+1}else{const Ne=this._reverseOffset([le,Ie]);if(this._match(Ne,re))return Ne;Ie++}Ie=0}return-1},oe.prototype._match=function(re,Ce){if(this.length-re<Ce.length)return!1;for(let ie=0;ie<Ce.length;ie++)if(this.get(re+ie)!==Ce[ie])return!1;return!0},function(){const re={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const Ce in re)(function(ie){re[ie]===null?oe.prototype[ie]=function(ae,le){return this.slice(ae,ae+le)[ie](0,le)}:oe.prototype[ie]=function(ae=0){return this.slice(ae,ae+re[ie])[ie](0)}})(Ce)}(),oe.prototype._isBufferList=function(Ce){return Ce instanceof oe||oe.isBufferList(Ce)},oe.isBufferList=function(Ce){return Ce!=null&&Ce[$]},g.exports=oe},{buffer:17}],15:[function(r,g,k){const V=r("readable-stream").Duplex,$=r("inherits"),oe=r("./BufferList");function re(Ce){if(!(this instanceof re))return new re(Ce);if(typeof Ce=="function"){this._callback=Ce;const ie=function(le){this._callback&&(this._callback(le),this._callback=null)}.bind(this);this.on("pipe",function(le){le.on("error",ie)}),this.on("unpipe",function(le){le.removeListener("error",ie)}),Ce=null}oe._init.call(this,Ce),V.call(this)}$(re,V),Object.assign(re.prototype,oe.prototype),re.prototype._new=function(ie){return new re(ie)},re.prototype._write=function(ie,ae,le){this._appendBuffer(ie),typeof le=="function"&&le()},re.prototype._read=function(ie){if(!this.length)return this.push(null);ie=Math.min(ie,this.length),this.push(this.slice(0,ie)),this.consume(ie)},re.prototype.end=function(ie){V.prototype.end.call(this,ie),this._callback&&(this._callback(null,this.slice()),this._callback=null)},re.prototype._destroy=function(ie,ae){this._bufs.length=0,this.length=0,ae(ie)},re.prototype._isBufferList=function(ie){return ie instanceof re||ie instanceof oe||re.isBufferList(ie)},re.isBufferList=oe.isBufferList,g.exports=re,g.exports.BufferListStream=re,g.exports.BufferList=oe},{"./BufferList":14,inherits:24,"readable-stream":69}],16:[function(r,g,k){},{}],17:[function(r,g,k){(function(V){(function(){var $=r("base64-js"),oe=r("ieee754");k.Buffer=ae,k.SlowBuffer=xe,k.INSPECT_MAX_BYTES=50;var re=2147483647;k.kMaxLength=re,ae.TYPED_ARRAY_SUPPORT=Ce(),!ae.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function Ce(){try{var oi=new Uint8Array(1);return oi.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},oi.foo()===42}catch{return!1}}Object.defineProperty(ae.prototype,"parent",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.buffer}}),Object.defineProperty(ae.prototype,"offset",{enumerable:!0,get:function(){if(ae.isBuffer(this))return this.byteOffset}});function ie(oi){if(oi>re)throw new RangeError('The value "'+oi+'" is invalid for option "size"');var Et=new Uint8Array(oi);return Et.__proto__=ae.prototype,Et}function ae(oi,Et,ii){if(typeof oi=="number"){if(typeof Et=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return de(oi)}return le(oi,Et,ii)}typeof Symbol<"u"&&Symbol.species!=null&&ae[Symbol.species]===ae&&Object.defineProperty(ae,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ae.poolSize=8192;function le(oi,Et,ii){if(typeof oi=="string")return Ne(oi,Et);if(ArrayBuffer.isView(oi))return he(oi);if(oi==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi);if(si(oi,ArrayBuffer)||oi&&si(oi.buffer,ArrayBuffer))return pe(oi,Et,ii);if(typeof oi=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var ri=oi.valueOf&&oi.valueOf();if(ri!=null&&ri!==oi)return ae.from(ri,Et,ii);var ui=ze(oi);if(ui)return ui;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof oi[Symbol.toPrimitive]=="function")return ae.from(oi[Symbol.toPrimitive]("string"),Et,ii);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof oi)}ae.from=function(oi,Et,ii){return le(oi,Et,ii)},ae.prototype.__proto__=Uint8Array.prototype,ae.__proto__=Uint8Array;function Ie(oi){if(typeof oi!="number")throw new TypeError('"size" argument must be of type number');if(oi<0)throw new RangeError('The value "'+oi+'" is invalid for option "size"')}function ue(oi,Et,ii){return Ie(oi),oi<=0?ie(oi):Et!==void 0?typeof ii=="string"?ie(oi).fill(Et,ii):ie(oi).fill(Et):ie(oi)}ae.alloc=function(oi,Et,ii){return ue(oi,Et,ii)};function de(oi){return Ie(oi),ie(oi<0?0:Fe(oi)|0)}ae.allocUnsafe=function(oi){return de(oi)},ae.allocUnsafeSlow=function(oi){return de(oi)};function Ne(oi,Et){if((typeof Et!="string"||Et==="")&&(Et="utf8"),!ae.isEncoding(Et))throw new TypeError("Unknown encoding: "+Et);var ii=_e(oi,Et)|0,ri=ie(ii),ui=ri.write(oi,Et);return ui!==ii&&(ri=ri.slice(0,ui)),ri}function he(oi){for(var Et=oi.length<0?0:Fe(oi.length)|0,ii=ie(Et),ri=0;ri<Et;ri+=1)ii[ri]=oi[ri]&255;return ii}function pe(oi,Et,ii){if(Et<0||oi.byteLength<Et)throw new RangeError('"offset" is outside of buffer bounds');if(oi.byteLength<Et+(ii||0))throw new RangeError('"length" is outside of buffer bounds');var ri;return Et===void 0&&ii===void 0?ri=new Uint8Array(oi):ii===void 0?ri=new Uint8Array(oi,Et):ri=new Uint8Array(oi,Et,ii),ri.__proto__=ae.prototype,ri}function ze(oi){if(ae.isBuffer(oi)){var Et=Fe(oi.length)|0,ii=ie(Et);return ii.length===0||oi.copy(ii,0,0,Et),ii}if(oi.length!==void 0)return typeof oi.length!="number"||Ii(oi.length)?ie(0):he(oi);if(oi.type==="Buffer"&&Array.isArray(oi.data))return he(oi.data)}function Fe(oi){if(oi>=re)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+re.toString(16)+" bytes");return oi|0}function xe(oi){return+oi!=oi&&(oi=0),ae.alloc(+oi)}ae.isBuffer=function(Et){return Et!=null&&Et._isBuffer===!0&&Et!==ae.prototype},ae.compare=function(Et,ii){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),si(ii,Uint8Array)&&(ii=ae.from(ii,ii.offset,ii.byteLength)),!ae.isBuffer(Et)||!ae.isBuffer(ii))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Et===ii)return 0;for(var ri=Et.length,ui=ii.length,vi=0,bi=Math.min(ri,ui);vi<bi;++vi)if(Et[vi]!==ii[vi]){ri=Et[vi],ui=ii[vi];break}return ri<ui?-1:ui<ri?1:0},ae.isEncoding=function(Et){switch(String(Et).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ae.concat=function(Et,ii){if(!Array.isArray(Et))throw new TypeError('"list" argument must be an Array of Buffers');if(Et.length===0)return ae.alloc(0);var ri;if(ii===void 0)for(ii=0,ri=0;ri<Et.length;++ri)ii+=Et[ri].length;var ui=ae.allocUnsafe(ii),vi=0;for(ri=0;ri<Et.length;++ri){var bi=Et[ri];if(si(bi,Uint8Array)&&(bi=ae.from(bi)),!ae.isBuffer(bi))throw new TypeError('"list" argument must be an Array of Buffers');bi.copy(ui,vi),vi+=bi.length}return ui};function _e(oi,Et){if(ae.isBuffer(oi))return oi.length;if(ArrayBuffer.isView(oi)||si(oi,ArrayBuffer))return oi.byteLength;if(typeof oi!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof oi);var ii=oi.length,ri=arguments.length>2&&arguments[2]===!0;if(!ri&&ii===0)return 0;for(var ui=!1;;)switch(Et){case"ascii":case"latin1":case"binary":return ii;case"utf8":case"utf-8":return Ni(oi).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ii*2;case"hex":return ii>>>1;case"base64":return zi(oi).length;default:if(ui)return ri?-1:Ni(oi).length;Et=(""+Et).toLowerCase(),ui=!0}}ae.byteLength=_e;function Dt(oi,Et,ii){var ri=!1;if((Et===void 0||Et<0)&&(Et=0),Et>this.length||((ii===void 0||ii>this.length)&&(ii=this.length),ii<=0)||(ii>>>=0,Et>>>=0,ii<=Et))return"";for(oi||(oi="utf8");;)switch(oi){case"hex":return li(this,Et,ii);case"utf8":case"utf-8":return ei(this,Et,ii);case"ascii":return gi(this,Et,ii);case"latin1":case"binary":return di(this,Et,ii);case"base64":return ti(this,Et,ii);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ai(this,Et,ii);default:if(ri)throw new TypeError("Unknown encoding: "+oi);oi=(oi+"").toLowerCase(),ri=!0}}ae.prototype._isBuffer=!0;function $e(oi,Et,ii){var ri=oi[Et];oi[Et]=oi[ii],oi[ii]=ri}ae.prototype.swap16=function(){var Et=this.length;if(Et%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var ii=0;ii<Et;ii+=2)$e(this,ii,ii+1);return this},ae.prototype.swap32=function(){var Et=this.length;if(Et%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var ii=0;ii<Et;ii+=4)$e(this,ii,ii+3),$e(this,ii+1,ii+2);return this},ae.prototype.swap64=function(){var Et=this.length;if(Et%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var ii=0;ii<Et;ii+=8)$e(this,ii,ii+7),$e(this,ii+1,ii+6),$e(this,ii+2,ii+5),$e(this,ii+3,ii+4);return this},ae.prototype.toString=function(){var Et=this.length;return Et===0?"":arguments.length===0?ei(this,0,Et):Dt.apply(this,arguments)},ae.prototype.toLocaleString=ae.prototype.toString,ae.prototype.equals=function(Et){if(!ae.isBuffer(Et))throw new TypeError("Argument must be a Buffer");return this===Et?!0:ae.compare(this,Et)===0},ae.prototype.inspect=function(){var Et="",ii=k.INSPECT_MAX_BYTES;return Et=this.toString("hex",0,ii).replace(/(.{2})/g,"$1 ").trim(),this.length>ii&&(Et+=" ... "),"<Buffer "+Et+">"},ae.prototype.compare=function(Et,ii,ri,ui,vi){if(si(Et,Uint8Array)&&(Et=ae.from(Et,Et.offset,Et.byteLength)),!ae.isBuffer(Et))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Et);if(ii===void 0&&(ii=0),ri===void 0&&(ri=Et?Et.length:0),ui===void 0&&(ui=0),vi===void 0&&(vi=this.length),ii<0||ri>Et.length||ui<0||vi>this.length)throw new RangeError("out of range index");if(ui>=vi&&ii>=ri)return 0;if(ui>=vi)return-1;if(ii>=ri)return 1;if(ii>>>=0,ri>>>=0,ui>>>=0,vi>>>=0,this===Et)return 0;for(var bi=vi-ui,Zi=ri-ii,Gi=Math.min(bi,Zi),Yi=this.slice(ui,vi),Oi=Et.slice(ii,ri),xi=0;xi<Gi;++xi)if(Yi[xi]!==Oi[xi]){bi=Yi[xi],Zi=Oi[xi];break}return bi<Zi?-1:Zi<bi?1:0};function Ue(oi,Et,ii,ri,ui){if(oi.length===0)return-1;if(typeof ii=="string"?(ri=ii,ii=0):ii>2147483647?ii=2147483647:ii<-2147483648&&(ii=-2147483648),ii=+ii,Ii(ii)&&(ii=ui?0:oi.length-1),ii<0&&(ii=oi.length+ii),ii>=oi.length){if(ui)return-1;ii=oi.length-1}else if(ii<0)if(ui)ii=0;else return-1;if(typeof Et=="string"&&(Et=ae.from(Et,ri)),ae.isBuffer(Et))return Et.length===0?-1:Ve(oi,Et,ii,ri,ui);if(typeof Et=="number")return Et=Et&255,typeof Uint8Array.prototype.indexOf=="function"?ui?Uint8Array.prototype.indexOf.call(oi,Et,ii):Uint8Array.prototype.lastIndexOf.call(oi,Et,ii):Ve(oi,[Et],ii,ri,ui);throw new TypeError("val must be string, number or Buffer")}function Ve(oi,Et,ii,ri,ui){var vi=1,bi=oi.length,Zi=Et.length;if(ri!==void 0&&(ri=String(ri).toLowerCase(),ri==="ucs2"||ri==="ucs-2"||ri==="utf16le"||ri==="utf-16le")){if(oi.length<2||Et.length<2)return-1;vi=2,bi/=2,Zi/=2,ii/=2}function Gi(Wi,ki){return vi===1?Wi[ki]:Wi.readUInt16BE(ki*vi)}var Yi;if(ui){var Oi=-1;for(Yi=ii;Yi<bi;Yi++)if(Gi(oi,Yi)===Gi(Et,Oi===-1?0:Yi-Oi)){if(Oi===-1&&(Oi=Yi),Yi-Oi+1===Zi)return Oi*vi}else Oi!==-1&&(Yi-=Yi-Oi),Oi=-1}else for(ii+Zi>bi&&(ii=bi-Zi),Yi=ii;Yi>=0;Yi--){for(var xi=!0,Li=0;Li<Zi;Li++)if(Gi(oi,Yi+Li)!==Gi(Et,Li)){xi=!1;break}if(xi)return Yi}return-1}ae.prototype.includes=function(Et,ii,ri){return this.indexOf(Et,ii,ri)!==-1},ae.prototype.indexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!0)},ae.prototype.lastIndexOf=function(Et,ii,ri){return Ue(this,Et,ii,ri,!1)};function Oe(oi,Et,ii,ri){ii=Number(ii)||0;var ui=oi.length-ii;ri?(ri=Number(ri),ri>ui&&(ri=ui)):ri=ui;var vi=Et.length;ri>vi/2&&(ri=vi/2);for(var bi=0;bi<ri;++bi){var Zi=parseInt(Et.substr(bi*2,2),16);if(Ii(Zi))return bi;oi[ii+bi]=Zi}return bi}function At(oi,Et,ii,ri){return Si(Ni(Et,oi.length-ii),oi,ii,ri)}function qe(oi,Et,ii,ri){return Si(Mi(Et),oi,ii,ri)}function Lt(oi,Et,ii,ri){return qe(oi,Et,ii,ri)}function kt(oi,Et,ii,ri){return Si(zi(Et),oi,ii,ri)}function jt(oi,Et,ii,ri){return Si(fi(Et,oi.length-ii),oi,ii,ri)}ae.prototype.write=function(Et,ii,ri,ui){if(ii===void 0)ui="utf8",ri=this.length,ii=0;else if(ri===void 0&&typeof ii=="string")ui=ii,ri=this.length,ii=0;else if(isFinite(ii))ii=ii>>>0,isFinite(ri)?(ri=ri>>>0,ui===void 0&&(ui="utf8")):(ui=ri,ri=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var vi=this.length-ii;if((ri===void 0||ri>vi)&&(ri=vi),Et.length>0&&(ri<0||ii<0)||ii>this.length)throw new RangeError("Attempt to write outside buffer bounds");ui||(ui="utf8");for(var bi=!1;;)switch(ui){case"hex":return Oe(this,Et,ii,ri);case"utf8":case"utf-8":return At(this,Et,ii,ri);case"ascii":return qe(this,Et,ii,ri);case"latin1":case"binary":return Lt(this,Et,ii,ri);case"base64":return kt(this,Et,ii,ri);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jt(this,Et,ii,ri);default:if(bi)throw new TypeError("Unknown encoding: "+ui);ui=(""+ui).toLowerCase(),bi=!0}},ae.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ti(oi,Et,ii){return Et===0&&ii===oi.length?$.fromByteArray(oi):$.fromByteArray(oi.slice(Et,ii))}function ei(oi,Et,ii){ii=Math.min(oi.length,ii);for(var ri=[],ui=Et;ui<ii;){var vi=oi[ui],bi=null,Zi=vi>239?4:vi>223?3:vi>191?2:1;if(ui+Zi<=ii){var Gi,Yi,Oi,xi;switch(Zi){case 1:vi<128&&(bi=vi);break;case 2:Gi=oi[ui+1],(Gi&192)===128&&(xi=(vi&31)<<6|Gi&63,xi>127&&(bi=xi));break;case 3:Gi=oi[ui+1],Yi=oi[ui+2],(Gi&192)===128&&(Yi&192)===128&&(xi=(vi&15)<<12|(Gi&63)<<6|Yi&63,xi>2047&&(xi<55296||xi>57343)&&(bi=xi));break;case 4:Gi=oi[ui+1],Yi=oi[ui+2],Oi=oi[ui+3],(Gi&192)===128&&(Yi&192)===128&&(Oi&192)===128&&(xi=(vi&15)<<18|(Gi&63)<<12|(Yi&63)<<6|Oi&63,xi>65535&&xi<1114112&&(bi=xi))}}bi===null?(bi=65533,Zi=1):bi>65535&&(bi-=65536,ri.push(bi>>>10&1023|55296),bi=56320|bi&1023),ri.push(bi),ui+=Zi}return ni(ri)}var Pt=4096;function ni(oi){var Et=oi.length;if(Et<=Pt)return String.fromCharCode.apply(String,oi);for(var ii="",ri=0;ri<Et;)ii+=String.fromCharCode.apply(String,oi.slice(ri,ri+=Pt));return ii}function gi(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]&127);return ri}function di(oi,Et,ii){var ri="";ii=Math.min(oi.length,ii);for(var ui=Et;ui<ii;++ui)ri+=String.fromCharCode(oi[ui]);return ri}function li(oi,Et,ii){var ri=oi.length;(!Et||Et<0)&&(Et=0),(!ii||ii<0||ii>ri)&&(ii=ri);for(var ui="",vi=Et;vi<ii;++vi)ui+=mi(oi[vi]);return ui}function ai(oi,Et,ii){for(var ri=oi.slice(Et,ii),ui="",vi=0;vi<ri.length;vi+=2)ui+=String.fromCharCode(ri[vi]+ri[vi+1]*256);return ui}ae.prototype.slice=function(Et,ii){var ri=this.length;Et=~~Et,ii=ii===void 0?ri:~~ii,Et<0?(Et+=ri,Et<0&&(Et=0)):Et>ri&&(Et=ri),ii<0?(ii+=ri,ii<0&&(ii=0)):ii>ri&&(ii=ri),ii<Et&&(ii=Et);var ui=this.subarray(Et,ii);return ui.__proto__=ae.prototype,ui};function ci(oi,Et,ii){if(oi%1!==0||oi<0)throw new RangeError("offset is not uint");if(oi+Et>ii)throw new RangeError("Trying to access beyond buffer length")}ae.prototype.readUIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return ui},ae.prototype.readUIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et+--ii],vi=1;ii>0&&(vi*=256);)ui+=this[Et+--ii]*vi;return ui},ae.prototype.readUInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]},ae.prototype.readUInt16LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]|this[Et+1]<<8},ae.prototype.readUInt16BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,2,this.length),this[Et]<<8|this[Et+1]},ae.prototype.readUInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),(this[Et]|this[Et+1]<<8|this[Et+2]<<16)+this[Et+3]*16777216},ae.prototype.readUInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]*16777216+(this[Et+1]<<16|this[Et+2]<<8|this[Et+3])},ae.prototype.readIntLE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=this[Et],vi=1,bi=0;++bi<ii&&(vi*=256);)ui+=this[Et+bi]*vi;return vi*=128,ui>=vi&&(ui-=Math.pow(2,8*ii)),ui},ae.prototype.readIntBE=function(Et,ii,ri){Et=Et>>>0,ii=ii>>>0,ri||ci(Et,ii,this.length);for(var ui=ii,vi=1,bi=this[Et+--ui];ui>0&&(vi*=256);)bi+=this[Et+--ui]*vi;return vi*=128,bi>=vi&&(bi-=Math.pow(2,8*ii)),bi},ae.prototype.readInt8=function(Et,ii){return Et=Et>>>0,ii||ci(Et,1,this.length),this[Et]&128?(255-this[Et]+1)*-1:this[Et]},ae.prototype.readInt16LE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et]|this[Et+1]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt16BE=function(Et,ii){Et=Et>>>0,ii||ci(Et,2,this.length);var ri=this[Et+1]|this[Et]<<8;return ri&32768?ri|4294901760:ri},ae.prototype.readInt32LE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]|this[Et+1]<<8|this[Et+2]<<16|this[Et+3]<<24},ae.prototype.readInt32BE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),this[Et]<<24|this[Et+1]<<16|this[Et+2]<<8|this[Et+3]},ae.prototype.readFloatLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!0,23,4)},ae.prototype.readFloatBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,4,this.length),oe.read(this,Et,!1,23,4)},ae.prototype.readDoubleLE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!0,52,8)},ae.prototype.readDoubleBE=function(Et,ii){return Et=Et>>>0,ii||ci(Et,8,this.length),oe.read(this,Et,!1,52,8)};function pi(oi,Et,ii,ri,ui,vi){if(!ae.isBuffer(oi))throw new TypeError('"buffer" argument must be a Buffer instance');if(Et>ui||Et<vi)throw new RangeError('"value" argument is out of bounds');if(ii+ri>oi.length)throw new RangeError("Index out of range")}ae.prototype.writeUIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=1,Zi=0;for(this[ii]=Et&255;++Zi<ri&&(bi*=256);)this[ii+Zi]=Et/bi&255;return ii+ri},ae.prototype.writeUIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,ri=ri>>>0,!ui){var vi=Math.pow(2,8*ri)-1;pi(this,Et,ii,ri,vi,0)}var bi=ri-1,Zi=1;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)this[ii+bi]=Et/Zi&255;return ii+ri},ae.prototype.writeUInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,255,0),this[ii]=Et&255,ii+1},ae.prototype.writeUInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeUInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,65535,0),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeUInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii+3]=Et>>>24,this[ii+2]=Et>>>16,this[ii+1]=Et>>>8,this[ii]=Et&255,ii+4},ae.prototype.writeUInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,4294967295,0),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4},ae.prototype.writeIntLE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=0,Zi=1,Gi=0;for(this[ii]=Et&255;++bi<ri&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi-1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeIntBE=function(Et,ii,ri,ui){if(Et=+Et,ii=ii>>>0,!ui){var vi=Math.pow(2,8*ri-1);pi(this,Et,ii,ri,vi-1,-vi)}var bi=ri-1,Zi=1,Gi=0;for(this[ii+bi]=Et&255;--bi>=0&&(Zi*=256);)Et<0&&Gi===0&&this[ii+bi+1]!==0&&(Gi=1),this[ii+bi]=(Et/Zi>>0)-Gi&255;return ii+ri},ae.prototype.writeInt8=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,1,127,-128),Et<0&&(Et=255+Et+1),this[ii]=Et&255,ii+1},ae.prototype.writeInt16LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et&255,this[ii+1]=Et>>>8,ii+2},ae.prototype.writeInt16BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,2,32767,-32768),this[ii]=Et>>>8,this[ii+1]=Et&255,ii+2},ae.prototype.writeInt32LE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),this[ii]=Et&255,this[ii+1]=Et>>>8,this[ii+2]=Et>>>16,this[ii+3]=Et>>>24,ii+4},ae.prototype.writeInt32BE=function(Et,ii,ri){return Et=+Et,ii=ii>>>0,ri||pi(this,Et,ii,4,2147483647,-2147483648),Et<0&&(Et=4294967295+Et+1),this[ii]=Et>>>24,this[ii+1]=Et>>>16,this[ii+2]=Et>>>8,this[ii+3]=Et&255,ii+4};function yi(oi,Et,ii,ri,ui,vi){if(ii+ri>oi.length)throw new RangeError("Index out of range");if(ii<0)throw new RangeError("Index out of range")}function Ai(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,4),oe.write(oi,Et,ii,ri,23,4),ii+4}ae.prototype.writeFloatLE=function(Et,ii,ri){return Ai(this,Et,ii,!0,ri)},ae.prototype.writeFloatBE=function(Et,ii,ri){return Ai(this,Et,ii,!1,ri)};function hi(oi,Et,ii,ri,ui){return Et=+Et,ii=ii>>>0,ui||yi(oi,Et,ii,8),oe.write(oi,Et,ii,ri,52,8),ii+8}ae.prototype.writeDoubleLE=function(Et,ii,ri){return hi(this,Et,ii,!0,ri)},ae.prototype.writeDoubleBE=function(Et,ii,ri){return hi(this,Et,ii,!1,ri)},ae.prototype.copy=function(Et,ii,ri,ui){if(!ae.isBuffer(Et))throw new TypeError("argument should be a Buffer");if(ri||(ri=0),!ui&&ui!==0&&(ui=this.length),ii>=Et.length&&(ii=Et.length),ii||(ii=0),ui>0&&ui<ri&&(ui=ri),ui===ri||Et.length===0||this.length===0)return 0;if(ii<0)throw new RangeError("targetStart out of bounds");if(ri<0||ri>=this.length)throw new RangeError("Index out of range");if(ui<0)throw new RangeError("sourceEnd out of bounds");ui>this.length&&(ui=this.length),Et.length-ii<ui-ri&&(ui=Et.length-ii+ri);var vi=ui-ri;if(this===Et&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(ii,ri,ui);else if(this===Et&&ri<ii&&ii<ui)for(var bi=vi-1;bi>=0;--bi)Et[bi+ii]=this[bi+ri];else Uint8Array.prototype.set.call(Et,this.subarray(ri,ui),ii);return vi},ae.prototype.fill=function(Et,ii,ri,ui){if(typeof Et=="string"){if(typeof ii=="string"?(ui=ii,ii=0,ri=this.length):typeof ri=="string"&&(ui=ri,ri=this.length),ui!==void 0&&typeof ui!="string")throw new TypeError("encoding must be a string");if(typeof ui=="string"&&!ae.isEncoding(ui))throw new TypeError("Unknown encoding: "+ui);if(Et.length===1){var vi=Et.charCodeAt(0);(ui==="utf8"&&vi<128||ui==="latin1")&&(Et=vi)}}else typeof Et=="number"&&(Et=Et&255);if(ii<0||this.length<ii||this.length<ri)throw new RangeError("Out of range index");if(ri<=ii)return this;ii=ii>>>0,ri=ri===void 0?this.length:ri>>>0,Et||(Et=0);var bi;if(typeof Et=="number")for(bi=ii;bi<ri;++bi)this[bi]=Et;else{var Zi=ae.isBuffer(Et)?Et:ae.from(Et,ui),Gi=Zi.length;if(Gi===0)throw new TypeError('The value "'+Et+'" is invalid for argument "value"');for(bi=0;bi<ri-ii;++bi)this[bi+ii]=Zi[bi%Gi]}return this};var wi=/[^+/0-9A-Za-z-_]/g;function Ci(oi){if(oi=oi.split("=")[0],oi=oi.trim().replace(wi,""),oi.length<2)return"";for(;oi.length%4!==0;)oi=oi+"=";return oi}function mi(oi){return oi<16?"0"+oi.toString(16):oi.toString(16)}function Ni(oi,Et){Et=Et||1/0;for(var ii,ri=oi.length,ui=null,vi=[],bi=0;bi<ri;++bi){if(ii=oi.charCodeAt(bi),ii>55295&&ii<57344){if(!ui){if(ii>56319){(Et-=3)>-1&&vi.push(239,191,189);continue}else if(bi+1===ri){(Et-=3)>-1&&vi.push(239,191,189);continue}ui=ii;continue}if(ii<56320){(Et-=3)>-1&&vi.push(239,191,189),ui=ii;continue}ii=(ui-55296<<10|ii-56320)+65536}else ui&&(Et-=3)>-1&&vi.push(239,191,189);if(ui=null,ii<128){if((Et-=1)<0)break;vi.push(ii)}else if(ii<2048){if((Et-=2)<0)break;vi.push(ii>>6|192,ii&63|128)}else if(ii<65536){if((Et-=3)<0)break;vi.push(ii>>12|224,ii>>6&63|128,ii&63|128)}else if(ii<1114112){if((Et-=4)<0)break;vi.push(ii>>18|240,ii>>12&63|128,ii>>6&63|128,ii&63|128)}else throw new Error("Invalid code point")}return vi}function Mi(oi){for(var Et=[],ii=0;ii<oi.length;++ii)Et.push(oi.charCodeAt(ii)&255);return Et}function fi(oi,Et){for(var ii,ri,ui,vi=[],bi=0;bi<oi.length&&!((Et-=2)<0);++bi)ii=oi.charCodeAt(bi),ri=ii>>8,ui=ii%256,vi.push(ui),vi.push(ri);return vi}function zi(oi){return $.toByteArray(Ci(oi))}function Si(oi,Et,ii,ri){for(var ui=0;ui<ri&&!(ui+ii>=Et.length||ui>=oi.length);++ui)Et[ui+ii]=oi[ui];return ui}function si(oi,Et){return oi instanceof Et||oi!=null&&oi.constructor!=null&&oi.constructor.name!=null&&oi.constructor.name===Et.name}function Ii(oi){return oi!==oi}}).call(this)}).call(this,r("buffer").Buffer)},{"base64-js":13,buffer:17,ieee754:23}],18:[function(r,g,k){(function(V){(function(){k.formatArgs=oe,k.save=re,k.load=Ce,k.useColors=$,k.storage=ie(),k.destroy=(()=>{let le=!1;return()=>{le||(le=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),k.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function $(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function oe(le){if(le[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+le[0]+(this.useColors?"%c ":" ")+"+"+g.exports.humanize(this.diff),!this.useColors)return;const Ie="color: "+this.color;le.splice(1,0,Ie,"color: inherit");let ue=0,de=0;le[0].replace(/%[a-zA-Z%]/g,Ne=>{Ne!=="%%"&&(ue++,Ne==="%c"&&(de=ue))}),le.splice(de,0,Ie)}k.log=console.debug||console.log||(()=>{});function re(le){try{le?k.storage.setItem("debug",le):k.storage.removeItem("debug")}catch{}}function Ce(){let le;try{le=k.storage.getItem("debug")}catch{}return!le&&typeof V<"u"&&"env"in V&&(le=V.env.DEBUG),le}function ie(){try{return localStorage}catch{}}g.exports=r("./common")(k);const{formatters:ae}=g.exports;ae.j=function(le){try{return JSON.stringify(le)}catch(Ie){return"[UnexpectedJSONParseError]: "+Ie.message}}}).call(this)}).call(this,r("_process"))},{"./common":19,_process:50}],19:[function(r,g,k){function V($){re.debug=re,re.default=re,re.coerce=ue,re.disable=ae,re.enable=ie,re.enabled=le,re.humanize=r("ms"),re.destroy=de,Object.keys($).forEach(Ne=>{re[Ne]=$[Ne]}),re.names=[],re.skips=[],re.formatters={};function oe(Ne){let he=0;for(let pe=0;pe<Ne.length;pe++)he=(he<<5)-he+Ne.charCodeAt(pe),he|=0;return re.colors[Math.abs(he)%re.colors.length]}re.selectColor=oe;function re(Ne){let he,pe=null,ze,Fe;function xe(..._e){if(!xe.enabled)return;const Dt=xe,$e=Number(new Date),Ue=$e-(he||$e);Dt.diff=Ue,Dt.prev=he,Dt.curr=$e,he=$e,_e[0]=re.coerce(_e[0]),typeof _e[0]!="string"&&_e.unshift("%O");let Ve=0;_e[0]=_e[0].replace(/%([a-zA-Z%])/g,(At,qe)=>{if(At==="%%")return"%";Ve++;const Lt=re.formatters[qe];if(typeof Lt=="function"){const kt=_e[Ve];At=Lt.call(Dt,kt),_e.splice(Ve,1),Ve--}return At}),re.formatArgs.call(Dt,_e),(Dt.log||re.log).apply(Dt,_e)}return xe.namespace=Ne,xe.useColors=re.useColors(),xe.color=re.selectColor(Ne),xe.extend=Ce,xe.destroy=re.destroy,Object.defineProperty(xe,"enabled",{enumerable:!0,configurable:!1,get:()=>pe!==null?pe:(ze!==re.namespaces&&(ze=re.namespaces,Fe=re.enabled(Ne)),Fe),set:_e=>{pe=_e}}),typeof re.init=="function"&&re.init(xe),xe}function Ce(Ne,he){const pe=re(this.namespace+(typeof he>"u"?":":he)+Ne);return pe.log=this.log,pe}function ie(Ne){re.save(Ne),re.namespaces=Ne,re.names=[],re.skips=[];let he;const pe=(typeof Ne=="string"?Ne:"").split(/[\s,]+/),ze=pe.length;for(he=0;he<ze;he++)pe[he]&&(Ne=pe[he].replace(/\*/g,".*?"),Ne[0]==="-"?re.skips.push(new RegExp("^"+Ne.substr(1)+"$")):re.names.push(new RegExp("^"+Ne+"$")))}function ae(){const Ne=[...re.names.map(Ie),...re.skips.map(Ie).map(he=>"-"+he)].join(",");return re.enable(""),Ne}function le(Ne){if(Ne[Ne.length-1]==="*")return!0;let he,pe;for(he=0,pe=re.skips.length;he<pe;he++)if(re.skips[he].test(Ne))return!1;for(he=0,pe=re.names.length;he<pe;he++)if(re.names[he].test(Ne))return!0;return!1}function Ie(Ne){return Ne.toString().substring(2,Ne.toString().length-2).replace(/\.\*\?$/,"*")}function ue(Ne){return Ne instanceof Error?Ne.stack||Ne.message:Ne}function de(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return re.enable(re.load()),re}g.exports=V},{ms:45}],20:[function(r,g,k){(function(V,$){(function(){var oe=r("readable-stream"),re=r("end-of-stream"),Ce=r("inherits"),ie=r("stream-shift"),ae=$.from&&$.from!==Uint8Array.from?$.from([0]):new $([0]),le=function(ze,Fe){ze._corked?ze.once("uncork",Fe):Fe()},Ie=function(ze,Fe){ze._autoDestroy&&ze.destroy(Fe)},ue=function(ze,Fe){return function(xe){xe?Ie(ze,xe.message==="premature close"?null:xe):Fe&&!ze._ended&&ze.end()}},de=function(ze,Fe){if(!ze||ze._writableState&&ze._writableState.finished)return Fe();if(ze._writableState)return ze.end(Fe);ze.end(),Fe()},Ne=function(){},he=function(ze){return new oe.Readable({objectMode:!0,highWaterMark:16}).wrap(ze)},pe=function(ze,Fe,xe){if(!(this instanceof pe))return new pe(ze,Fe,xe);oe.Duplex.call(this,xe),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!xe||xe.autoDestroy!==!1,this._forwardDestroy=!xe||xe.destroy!==!1,this._forwardEnd=!xe||xe.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,ze&&this.setWritable(ze),Fe&&this.setReadable(Fe)};Ce(pe,oe.Duplex),pe.obj=function(ze,Fe,xe){return xe||(xe={}),xe.objectMode=!0,xe.highWaterMark=16,new pe(ze,Fe,xe)},pe.prototype.cork=function(){++this._corked===1&&this.emit("cork")},pe.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},pe.prototype.setWritable=function(ze){if(this._unwrite&&this._unwrite(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.end();return}var Fe=this,xe=re(ze,{writable:!0,readable:!1},ue(this,this._forwardEnd)),_e=function(){var $e=Fe._ondrain;Fe._ondrain=null,$e&&$e()},Dt=function(){Fe._writable.removeListener("drain",_e),xe()};this._unwrite&&V.nextTick(_e),this._writable=ze,this._writable.on("drain",_e),this._unwrite=Dt,this.uncork()},pe.prototype.setReadable=function(ze){if(this._unread&&this._unread(),this.destroyed){ze&&ze.destroy&&ze.destroy();return}if(ze===null||ze===!1){this.push(null),this.resume();return}var Fe=this,xe=re(ze,{writable:!1,readable:!0},ue(this)),_e=function(){Fe._forward()},Dt=function(){Fe.push(null)},$e=function(){Fe._readable2.removeListener("readable",_e),Fe._readable2.removeListener("end",Dt),xe()};this._drained=!0,this._readable=ze,this._readable2=ze._readableState?ze:he(ze),this._readable2.on("readable",_e),this._readable2.on("end",Dt),this._unread=$e,this._forward()},pe.prototype._read=function(){this._drained=!0,this._forward()},pe.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var ze;this._drained&&(ze=ie(this._readable2))!==null;)this.destroyed||(this._drained=this.push(ze));this._forwarding=!1}},pe.prototype.destroy=function(ze,Fe){if(Fe||(Fe=Ne),this.destroyed)return Fe(null);this.destroyed=!0;var xe=this;V.nextTick(function(){xe._destroy(ze),Fe(null)})},pe.prototype._destroy=function(ze){if(ze){var Fe=this._ondrain;this._ondrain=null,Fe?Fe(ze):this.emit("error",ze)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},pe.prototype._write=function(ze,Fe,xe){if(!this.destroyed){if(this._corked)return le(this,this._write.bind(this,ze,Fe,xe));if(ze===ae)return this._finish(xe);if(!this._writable)return xe();this._writable.write(ze)===!1?this._ondrain=xe:this.destroyed||xe()}},pe.prototype._finish=function(ze){var Fe=this;this.emit("preend"),le(this,function(){de(Fe._forwardEnd&&Fe._writable,function(){Fe._writableState.prefinished===!1&&(Fe._writableState.prefinished=!0),Fe.emit("prefinish"),le(Fe,ze)})})},pe.prototype.end=function(ze,Fe,xe){return typeof ze=="function"?this.end(null,null,ze):typeof Fe=="function"?this.end(ze,null,Fe):(this._ended=!0,ze&&this.write(ze),!this._writableState.ending&&!this._writableState.destroyed&&this.write(ae),oe.Writable.prototype.end.call(this,xe))},g.exports=pe}).call(this)}).call(this,r("_process"),r("buffer").Buffer)},{_process:50,buffer:17,"end-of-stream":21,inherits:24,"readable-stream":69,"stream-shift":74}],21:[function(r,g,k){(function(V){(function(){var $=r("once"),oe=function(){},re=function(ae){return ae.setHeader&&typeof ae.abort=="function"},Ce=function(ae){return ae.stdio&&Array.isArray(ae.stdio)&&ae.stdio.length===3},ie=function(ae,le,Ie){if(typeof le=="function")return ie(ae,null,le);le||(le={}),Ie=$(Ie||oe);var ue=ae._writableState,de=ae._readableState,Ne=le.readable||le.readable!==!1&&ae.readable,he=le.writable||le.writable!==!1&&ae.writable,pe=!1,ze=function(){ae.writable||Fe()},Fe=function(){he=!1,Ne||Ie.call(ae)},xe=function(){Ne=!1,he||Ie.call(ae)},_e=function(Oe){Ie.call(ae,Oe?new Error("exited with error code: "+Oe):null)},Dt=function(Oe){Ie.call(ae,Oe)},$e=function(){V.nextTick(Ue)},Ue=function(){if(!pe){if(Ne&&!(de&&de.ended&&!de.destroyed))return Ie.call(ae,new Error("premature close"));if(he&&!(ue&&ue.ended&&!ue.destroyed))return Ie.call(ae,new Error("premature close"))}},Ve=function(){ae.req.on("finish",Fe)};return re(ae)?(ae.on("complete",Fe),ae.on("abort",$e),ae.req?Ve():ae.on("request",Ve)):he&&!ue&&(ae.on("end",ze),ae.on("close",ze)),Ce(ae)&&ae.on("exit",_e),ae.on("end",xe),ae.on("finish",Fe),le.error!==!1&&ae.on("error",Dt),ae.on("close",$e),function(){pe=!0,ae.removeListener("complete",Fe),ae.removeListener("abort",$e),ae.removeListener("request",Ve),ae.req&&ae.req.removeListener("finish",Fe),ae.removeListener("end",ze),ae.removeListener("close",ze),ae.removeListener("finish",Fe),ae.removeListener("exit",_e),ae.removeListener("end",xe),ae.removeListener("error",Dt),ae.removeListener("close",$e)}};g.exports=ie}).call(this)}).call(this,r("_process"))},{_process:50,once:48}],22:[function(r,g,k){var V=Object.create||Ve,$=Object.keys||Oe,oe=Function.prototype.bind||At;function re(){(!this._events||!Object.prototype.hasOwnProperty.call(this,"_events"))&&(this._events=V(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}g.exports=re,re.EventEmitter=re,re.prototype._events=void 0,re.prototype._maxListeners=void 0;var Ce=10,ie;try{var ae={};Object.defineProperty&&Object.defineProperty(ae,"x",{value:0}),ie=ae.x===0}catch{ie=!1}ie?Object.defineProperty(re,"defaultMaxListeners",{enumerable:!0,get:function(){return Ce},set:function(qe){if(typeof qe!="number"||qe<0||qe!==qe)throw new TypeError('"defaultMaxListeners" must be a positive number');Ce=qe}}):re.defaultMaxListeners=Ce,re.prototype.setMaxListeners=function(Lt){if(typeof Lt!="number"||Lt<0||isNaN(Lt))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=Lt,this};function le(qe){return qe._maxListeners===void 0?re.defaultMaxListeners:qe._maxListeners}re.prototype.getMaxListeners=function(){return le(this)};function Ie(qe,Lt,kt){if(Lt)qe.call(kt);else for(var jt=qe.length,ti=$e(qe,jt),ei=0;ei<jt;++ei)ti[ei].call(kt)}function ue(qe,Lt,kt,jt){if(Lt)qe.call(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].call(kt,jt)}function de(qe,Lt,kt,jt,ti){if(Lt)qe.call(kt,jt,ti);else for(var ei=qe.length,Pt=$e(qe,ei),ni=0;ni<ei;++ni)Pt[ni].call(kt,jt,ti)}function Ne(qe,Lt,kt,jt,ti,ei){if(Lt)qe.call(kt,jt,ti,ei);else for(var Pt=qe.length,ni=$e(qe,Pt),gi=0;gi<Pt;++gi)ni[gi].call(kt,jt,ti,ei)}function he(qe,Lt,kt,jt){if(Lt)qe.apply(kt,jt);else for(var ti=qe.length,ei=$e(qe,ti),Pt=0;Pt<ti;++Pt)ei[Pt].apply(kt,jt)}re.prototype.emit=function(Lt){var kt,jt,ti,ei,Pt,ni,gi=Lt==="error";if(ni=this._events,ni)gi=gi&&ni.error==null;else if(!gi)return!1;if(gi){if(arguments.length>1&&(kt=arguments[1]),kt instanceof Error)throw kt;var di=new Error('Unhandled "error" event. ('+kt+")");throw di.context=kt,di}if(jt=ni[Lt],!jt)return!1;var li=typeof jt=="function";switch(ti=arguments.length,ti){case 1:Ie(jt,li,this);break;case 2:ue(jt,li,this,arguments[1]);break;case 3:de(jt,li,this,arguments[1],arguments[2]);break;case 4:Ne(jt,li,this,arguments[1],arguments[2],arguments[3]);break;default:for(ei=new Array(ti-1),Pt=1;Pt<ti;Pt++)ei[Pt-1]=arguments[Pt];he(jt,li,this,ei)}return!0};function pe(qe,Lt,kt,jt){var ti,ei,Pt;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ei=qe._events,ei?(ei.newListener&&(qe.emit("newListener",Lt,kt.listener?kt.listener:kt),ei=qe._events),Pt=ei[Lt]):(ei=qe._events=V(null),qe._eventsCount=0),!Pt)Pt=ei[Lt]=kt,++qe._eventsCount;else if(typeof Pt=="function"?Pt=ei[Lt]=jt?[kt,Pt]:[Pt,kt]:jt?Pt.unshift(kt):Pt.push(kt),!Pt.warned&&(ti=le(qe),ti&&ti>0&&Pt.length>ti)){Pt.warned=!0;var ni=new Error("Possible EventEmitter memory leak detected. "+Pt.length+' "'+String(Lt)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');ni.name="MaxListenersExceededWarning",ni.emitter=qe,ni.type=Lt,ni.count=Pt.length,typeof console=="object"&&console.warn&&console.warn("%s: %s",ni.name,ni.message)}return qe}re.prototype.addListener=function(Lt,kt){return pe(this,Lt,kt,!1)},re.prototype.on=re.prototype.addListener,re.prototype.prependListener=function(Lt,kt){return pe(this,Lt,kt,!0)};function ze(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var qe=new Array(arguments.length),Lt=0;Lt<qe.length;++Lt)qe[Lt]=arguments[Lt];this.listener.apply(this.target,qe)}}function Fe(qe,Lt,kt){var jt={fired:!1,wrapFn:void 0,target:qe,type:Lt,listener:kt},ti=oe.call(ze,jt);return ti.listener=kt,jt.wrapFn=ti,ti}re.prototype.once=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.on(Lt,Fe(this,Lt,kt)),this},re.prototype.prependOnceListener=function(Lt,kt){if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(Lt,Fe(this,Lt,kt)),this},re.prototype.removeListener=function(Lt,kt){var jt,ti,ei,Pt,ni;if(typeof kt!="function")throw new TypeError('"listener" argument must be a function');if(ti=this._events,!ti)return this;if(jt=ti[Lt],!jt)return this;if(jt===kt||jt.listener===kt)--this._eventsCount===0?this._events=V(null):(delete ti[Lt],ti.removeListener&&this.emit("removeListener",Lt,jt.listener||kt));else if(typeof jt!="function"){for(ei=-1,Pt=jt.length-1;Pt>=0;Pt--)if(jt[Pt]===kt||jt[Pt].listener===kt){ni=jt[Pt].listener,ei=Pt;break}if(ei<0)return this;ei===0?jt.shift():Dt(jt,ei),jt.length===1&&(ti[Lt]=jt[0]),ti.removeListener&&this.emit("removeListener",Lt,ni||kt)}return this},re.prototype.removeAllListeners=function(Lt){var kt,jt,ti;if(jt=this._events,!jt)return this;if(!jt.removeListener)return arguments.length===0?(this._events=V(null),this._eventsCount=0):jt[Lt]&&(--this._eventsCount===0?this._events=V(null):delete jt[Lt]),this;if(arguments.length===0){var ei=$(jt),Pt;for(ti=0;ti<ei.length;++ti)Pt=ei[ti],Pt!=="removeListener"&&this.removeAllListeners(Pt);return this.removeAllListeners("removeListener"),this._events=V(null),this._eventsCount=0,this}if(kt=jt[Lt],typeof kt=="function")this.removeListener(Lt,kt);else if(kt)for(ti=kt.length-1;ti>=0;ti--)this.removeListener(Lt,kt[ti]);return this};function xe(qe,Lt,kt){var jt=qe._events;if(!jt)return[];var ti=jt[Lt];return ti?typeof ti=="function"?kt?[ti.listener||ti]:[ti]:kt?Ue(ti):$e(ti,ti.length):[]}re.prototype.listeners=function(Lt){return xe(this,Lt,!0)},re.prototype.rawListeners=function(Lt){return xe(this,Lt,!1)},re.listenerCount=function(qe,Lt){return typeof qe.listenerCount=="function"?qe.listenerCount(Lt):_e.call(qe,Lt)},re.prototype.listenerCount=_e;function _e(qe){var Lt=this._events;if(Lt){var kt=Lt[qe];if(typeof kt=="function")return 1;if(kt)return kt.length}return 0}re.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Dt(qe,Lt){for(var kt=Lt,jt=kt+1,ti=qe.length;jt<ti;kt+=1,jt+=1)qe[kt]=qe[jt];qe.pop()}function $e(qe,Lt){for(var kt=new Array(Lt),jt=0;jt<Lt;++jt)kt[jt]=qe[jt];return kt}function Ue(qe){for(var Lt=new Array(qe.length),kt=0;kt<Lt.length;++kt)Lt[kt]=qe[kt].listener||qe[kt];return Lt}function Ve(qe){var Lt=function(){};return Lt.prototype=qe,new Lt}function Oe(qe){for(var Lt in qe)Object.prototype.hasOwnProperty.call(qe,Lt);return Lt}function At(qe){var Lt=this;return function(){return Lt.apply(qe,arguments)}}},{}],23:[function(r,g,k){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */k.read=function(V,$,oe,re,Ce){var ie,ae,le=Ce*8-re-1,Ie=(1<<le)-1,ue=Ie>>1,de=-7,Ne=oe?Ce-1:0,he=oe?-1:1,pe=V[$+Ne];for(Ne+=he,ie=pe&(1<<-de)-1,pe>>=-de,de+=le;de>0;ie=ie*256+V[$+Ne],Ne+=he,de-=8);for(ae=ie&(1<<-de)-1,ie>>=-de,de+=re;de>0;ae=ae*256+V[$+Ne],Ne+=he,de-=8);if(ie===0)ie=1-ue;else{if(ie===Ie)return ae?NaN:(pe?-1:1)*(1/0);ae=ae+Math.pow(2,re),ie=ie-ue}return(pe?-1:1)*ae*Math.pow(2,ie-re)},k.write=function(V,$,oe,re,Ce,ie){var ae,le,Ie,ue=ie*8-Ce-1,de=(1<<ue)-1,Ne=de>>1,he=Ce===23?Math.pow(2,-24)-Math.pow(2,-77):0,pe=re?0:ie-1,ze=re?1:-1,Fe=$<0||$===0&&1/$<0?1:0;for($=Math.abs($),isNaN($)||$===1/0?(le=isNaN($)?1:0,ae=de):(ae=Math.floor(Math.log($)/Math.LN2),$*(Ie=Math.pow(2,-ae))<1&&(ae--,Ie*=2),ae+Ne>=1?$+=he/Ie:$+=he*Math.pow(2,1-Ne),$*Ie>=2&&(ae++,Ie/=2),ae+Ne>=de?(le=0,ae=de):ae+Ne>=1?(le=($*Ie-1)*Math.pow(2,Ce),ae=ae+Ne):(le=$*Math.pow(2,Ne-1)*Math.pow(2,Ce),ae=0));Ce>=8;V[oe+pe]=le&255,pe+=ze,le/=256,Ce-=8);for(ae=ae<<Ce|le,ue+=Ce;ue>0;V[oe+pe]=ae&255,pe+=ze,ae/=256,ue-=8);V[oe+pe-ze]|=Fe*128}},{}],24:[function(r,g,k){typeof Object.create=="function"?g.exports=function($,oe){oe&&($.super_=oe,$.prototype=Object.create(oe.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}}))}:g.exports=function($,oe){if(oe){$.super_=oe;var re=function(){};re.prototype=oe.prototype,$.prototype=new re,$.prototype.constructor=$}}},{}],25:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=function(){function $(oe,re){this.color=!0,this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0,this.leftChild=void 0,this.rightChild=void 0,this.key=oe,this.value=re}return $.prototype.rotateLeft=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild,ie=this.rightChild;if(!ie)throw new Error("unknown error");var ae=ie.leftChild,le=ie.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=ie:oe.rightChild===this&&(oe.rightChild=ie)),ie.parent=oe,ie.brother=re,ie.leftChild=this,ie.rightChild=le,re&&(re.brother=ie),this.parent=ie,this.brother=le,this.leftChild=Ce,this.rightChild=ae,le&&(le.parent=ie,le.brother=this),Ce&&(Ce.parent=this,Ce.brother=ae),ae&&(ae.parent=this,ae.brother=Ce),ie},$.prototype.rotateRight=function(){var oe=this.parent,re=this.brother,Ce=this.leftChild;if(!Ce)throw new Error("unknown error");var ie=this.rightChild,ae=Ce.leftChild,le=Ce.rightChild;return oe&&(oe.leftChild===this?oe.leftChild=Ce:oe.rightChild===this&&(oe.rightChild=Ce)),Ce.parent=oe,Ce.brother=re,Ce.leftChild=ae,Ce.rightChild=this,re&&(re.brother=Ce),ae&&(ae.parent=Ce,ae.brother=this),this.parent=Ce,this.brother=ae,this.leftChild=le,this.rightChild=ie,le&&(le.parent=this,le.brother=ie),ie&&(ie.parent=this,ie.brother=le),Ce},$.prototype.remove=function(){if(this.leftChild||this.rightChild)throw new Error("can only remove leaf node");this.parent&&(this===this.parent.leftChild?this.parent.leftChild=void 0:this===this.parent.rightChild&&(this.parent.rightChild=void 0)),this.brother&&(this.brother.brother=void 0),this.key=void 0,this.value=void 0,this.parent=void 0,this.brother=void 0},$.TreeNodeColorType={red:!0,black:!1},$}();Object.freeze(V),k.default=V},{}],26:[function(r,g,k){var V=this&&this.__generator||function(oe,re){var Ce={label:0,sent:function(){if(le[0]&1)throw le[1];return le[1]},trys:[],ops:[]},ie,ae,le,Ie;return Ie={next:ue(0),throw:ue(1),return:ue(2)},typeof Symbol=="function"&&(Ie[Symbol.iterator]=function(){return this}),Ie;function ue(Ne){return function(he){return de([Ne,he])}}function de(Ne){if(ie)throw new TypeError("Generator is already executing.");for(;Ce;)try{if(ie=1,ae&&(le=Ne[0]&2?ae.return:Ne[0]?ae.throw||((le=ae.return)&&le.call(ae),0):ae.next)&&!(le=le.call(ae,Ne[1])).done)return le;switch(ae=0,le&&(Ne=[Ne[0]&2,le.value]),Ne[0]){case 0:case 1:le=Ne;break;case 4:return Ce.label++,{value:Ne[1],done:!1};case 5:Ce.label++,ae=Ne[1],Ne=[0];continue;case 7:Ne=Ce.ops.pop(),Ce.trys.pop();continue;default:if(le=Ce.trys,!(le=le.length>0&&le[le.length-1])&&(Ne[0]===6||Ne[0]===2)){Ce=0;continue}if(Ne[0]===3&&(!le||Ne[1]>le[0]&&Ne[1]<le[3])){Ce.label=Ne[1];break}if(Ne[0]===6&&Ce.label<le[1]){Ce.label=le[1],le=Ne;break}if(le&&Ce.label<le[2]){Ce.label=le[2],Ce.ops.push(Ne);break}le[2]&&Ce.ops.pop(),Ce.trys.pop();continue}Ne=re.call(oe,Ce)}catch(he){Ne=[6,he],ae=0}finally{ie=le=0}if(Ne[0]&5)throw Ne[1];return{value:Ne[0]?Ne[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0}),$.sigma=3,$.bucketSize=5e3;function $(oe){var re=this;oe===void 0&&(oe=[]);var Ce=[],ie=0,ae=0,le=0,Ie=0,ue=0,de=0;this.size=function(){return de},this.empty=function(){return de===0},this.clear=function(){ie=le=ae=Ie=ue=de=0,he.call(this,$.bucketSize),de=0},this.front=function(){return Ce[ie][ae]},this.back=function(){return Ce[le][Ie]},this.forEach=function(pe){if(!this.empty()){var ze=0;if(ie===le){for(var Fe=ae;Fe<=Ie;++Fe)pe(Ce[ie][Fe],ze++);return}for(var Fe=ae;Fe<$.bucketSize;++Fe)pe(Ce[ie][Fe],ze++);for(var Fe=ie+1;Fe<le;++Fe)for(var xe=0;xe<$.bucketSize;++xe)pe(Ce[Fe][xe],ze++);for(var Fe=0;Fe<=Ie;++Fe)pe(Ce[le][Fe],ze++)}};var Ne=function(pe){var ze=ie*$.bucketSize+ae,Fe=ze+pe,xe=le*$.bucketSize+Ie;if(Fe<ze||Fe>xe)throw new Error("pos should more than 0 and less than queue's size");var _e=Math.floor(Fe/$.bucketSize),Dt=Fe%$.bucketSize;return{curNodeBucketIndex:_e,curNodePointerIndex:Dt}};this.getElementByPos=function(pe){var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;return Ce[Fe][xe]},this.eraseElementByPos=function(pe){var ze=this;if(pe<0||pe>de)throw new Error("pos should more than 0 and less than queue's size");if(pe===0)this.popFront();else if(pe===this.size())this.popBack();else{for(var Fe=[],xe=pe+1;xe<de;++xe)Fe.push(this.getElementByPos(xe));this.cut(pe),this.popBack(),Fe.forEach(function(_e){return ze.pushBack(_e)})}},this.eraseElementByValue=function(pe){if(!this.empty()){var ze=[];this.forEach(function(_e){_e!==pe&&ze.push(_e)});for(var Fe=ze.length,xe=0;xe<Fe;++xe)this.setElementByPos(xe,ze[xe]);this.cut(Fe-1)}};var he=function(pe){for(var ze=[],Fe=pe*$.sigma,xe=Math.max(Math.ceil(Fe/$.bucketSize),2),_e=0;_e<xe;++_e)ze.push(new Array($.bucketSize));var Dt=Math.ceil(pe/$.bucketSize),$e=Math.floor(xe/2)-Math.floor(Dt/2),Ue=$e,Ve=0;if(this.size())for(var _e=0;_e<Dt;++_e){for(var Oe=0;Oe<$.bucketSize;++Oe)if(ze[$e+_e][Oe]=this.front(),this.popFront(),this.empty()){Ue=$e+_e,Ve=Oe;break}if(this.empty())break}Ce=ze,ie=$e,ae=0,le=Ue,Ie=Ve,ue=xe,de=pe};this.pushBack=function(pe){this.empty()||(le===ue-1&&Ie===$.bucketSize-1&&he.call(this,this.size()),Ie<$.bucketSize-1?++Ie:le<ue-1&&(++le,Ie=0)),++de,Ce[le][Ie]=pe},this.popBack=function(){this.empty()||(this.size()!==1&&(Ie>0?--Ie:ie<le&&(--le,Ie=$.bucketSize-1)),de>0&&--de)},this.setElementByPos=function(pe,ze){var Fe=Ne(pe),xe=Fe.curNodeBucketIndex,_e=Fe.curNodePointerIndex;Ce[xe][_e]=ze},this.insert=function(pe,ze,Fe){var xe=this;if(Fe===void 0&&(Fe=1),pe===0)for(;Fe--;)this.pushFront(ze);else if(pe===this.size())for(;Fe--;)this.pushBack(ze);else{for(var _e=[],Dt=pe;Dt<de;++Dt)_e.push(this.getElementByPos(Dt));this.cut(pe-1);for(var Dt=0;Dt<Fe;++Dt)this.pushBack(ze);_e.forEach(function($e){return xe.pushBack($e)})}},this.find=function(pe){if(ie===le){for(var ze=ae;ze<=Ie;++ze)if(Ce[ie][ze]===pe)return!0;return!1}for(var ze=ae;ze<$.bucketSize;++ze)if(Ce[ie][ze]===pe)return!0;for(var ze=ie+1;ze<le;++ze)for(var Fe=0;Fe<$.bucketSize;++Fe)if(Ce[ze][Fe]===pe)return!0;for(var ze=0;ze<=Ie;++ze)if(Ce[le][ze]===pe)return!0;return!1},this.reverse=function(){for(var pe=0,ze=de-1;pe<ze;){var Fe=this.getElementByPos(pe);this.setElementByPos(pe,this.getElementByPos(ze)),this.setElementByPos(ze,Fe),++pe,--ze}},this.unique=function(){if(!this.empty()){var pe=[],ze=this.front();this.forEach(function(xe,_e){(_e===0||xe!==ze)&&(pe.push(xe),ze=xe)});for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,pe[Fe]);this.cut(pe.length-1)}},this.sort=function(pe){var ze=[];this.forEach(function(xe){ze.push(xe)}),ze.sort(pe);for(var Fe=0;Fe<de;++Fe)this.setElementByPos(Fe,ze[Fe])},this.pushFront=function(pe){this.empty()||(ie===0&&ae===0&&he.call(this,this.size()),ae>0?--ae:ie>0&&(--ie,ae=$.bucketSize-1)),++de,Ce[ie][ae]=pe},this.popFront=function(){this.empty()||(this.size()!==1&&(ae<$.bucketSize-1?++ae:ie<le&&(++ie,ae=0)),de>0&&--de)},this.shrinkToFit=function(){var pe=this,ze=[];this.forEach(function(Dt){ze.push(Dt)});var Fe=ze.length;Ce=[];for(var xe=Math.ceil(Fe/$.bucketSize),_e=0;_e<xe;++_e)Ce.push(new Array($.bucketSize));this.clear(),ze.forEach(function(Dt){return pe.pushBack(Dt)})},this.cut=function(pe){if(pe<0){this.clear();return}var ze=Ne(pe),Fe=ze.curNodeBucketIndex,xe=ze.curNodePointerIndex;le=Fe,Ie=xe,de=pe+1},this[Symbol.iterator]=function(){return function(){var ze,ze,ze,pe,ze;return V(this,function(Fe){switch(Fe.label){case 0:if(de===0)return[2];if(ie!==le)return[3,5];ze=ae,Fe.label=1;case 1:return ze<=Ie?[4,Ce[ie][ze]]:[3,4];case 2:Fe.sent(),Fe.label=3;case 3:return++ze,[3,1];case 4:return[2];case 5:ze=ae,Fe.label=6;case 6:return ze<$.bucketSize?[4,Ce[ie][ze]]:[3,9];case 7:Fe.sent(),Fe.label=8;case 8:return++ze,[3,6];case 9:ze=ie+1,Fe.label=10;case 10:if(!(ze<le))return[3,15];pe=0,Fe.label=11;case 11:return pe<$.bucketSize?[4,Ce[ze][pe]]:[3,14];case 12:Fe.sent(),Fe.label=13;case 13:return++pe,[3,11];case 14:return++ze,[3,10];case 15:ze=0,Fe.label=16;case 16:return ze<=Ie?[4,Ce[le][ze]]:[3,19];case 17:Fe.sent(),Fe.label=18;case 18:return++ze,[3,16];case 19:return[2]}})}()},function(){var pe=$.bucketSize;oe.size?pe=oe.size():oe.length&&(pe=oe.length);var ze=pe*$.sigma;ue=Math.ceil(ze/$.bucketSize),ue=Math.max(ue,3);for(var Fe=0;Fe<ue;++Fe)Ce.push(new Array($.bucketSize));var xe=Math.ceil(pe/$.bucketSize);ie=Math.floor(ue/2)-Math.floor(xe/2),le=ie,oe.forEach(function(_e){return re.pushBack(_e)})}(),Object.freeze(this)}Object.freeze($),k.default=$},{}],27:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../LinkList/LinkList"),re=r("../Map/Map");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze,Fe,xe=0,_e="";if(typeof pe=="number")xe=Math.floor(pe),xe=(xe<<5)-xe,xe=xe&xe;else{typeof pe!="string"?_e=JSON.stringify(pe):_e=pe;try{for(var Dt=$(_e),$e=Dt.next();!$e.done;$e=Dt.next()){var Ue=$e.value,Ve=Ue.charCodeAt(0);xe=(xe<<5)-xe+Ve,xe=xe&xe}}catch(Oe){ze={error:Oe}}finally{try{$e&&!$e.done&&(Fe=Dt.return)&&Fe.call(Dt)}finally{if(ze)throw ze.error}}}return xe^=xe>>>16,xe},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof oe.default&&Fe.size()===1){var _e=Fe.front(),Dt=_e.key,$e=_e.value;ze[le(Dt)&Ne-1]=new oe.default([{key:Dt,value:$e}])}else if(Fe instanceof re.default){var Ue=new oe.default,Ve=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?Ve.pushBack(qe):Ue.pushBack(qe)}),Ue.size()>Ce.untreeifyThreshold?ze[xe]=new re.default(Ue):Ue.size()&&(ze[xe]=Ue),Ve.size()>Ce.untreeifyThreshold?ze[xe+pe]=new re.default(Ve):Ve.size()&&(ze[xe+pe]=Ve)}else{var Oe=new oe.default,At=new oe.default;Fe.forEach(function(qe){var Lt=le(qe.key);Lt&pe?At.pushBack(qe):Oe.pushBack(qe)}),Oe.size()&&(ze[xe]=Oe),At.size()&&(ze[xe+pe]=At)}de[xe].clear()}}),de=ze}};this.setElement=function(pe,ze){var Fe,xe;if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(ze==null){this.eraseElementByKey(pe);return}var _e=le(pe)&Ne-1;if(!de[_e])++ue,de[_e]=new oe.default([{key:pe,value:ze}]);else{var Dt=de[_e].size();if(de[_e]instanceof oe.default){try{for(var $e=$(de[_e]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(Ve.key===pe){Ve.value=ze;return}}}catch(At){Fe={error:At}}finally{try{Ue&&!Ue.done&&(xe=$e.return)&&xe.call($e)}finally{if(Fe)throw Fe.error}}de[_e].pushBack({key:pe,value:ze}),de[_e].size()>=Ce.treeifyThreshold&&(de[_e]=new re.default(de[_e]))}else de[_e].setElement(pe,ze);var Oe=de[_e].size();ue+=Oe-Dt}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.getElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){if(de[xe]instanceof re.default)return de[xe].getElementByKey(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return $e.value}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}}},this.eraseElementByKey=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(de[xe]){var _e=de[xe].size();if(de[xe]instanceof re.default)de[xe].eraseElementByKey(pe),de[xe].size()<=Ce.untreeifyThreshold&&(de[xe]=new oe.default(de[xe]));else{var Dt=-1;try{for(var $e=$(de[xe]),Ue=$e.next();!Ue.done;Ue=$e.next()){var Ve=Ue.value;if(++Dt,Ve.key===pe){de[xe].eraseElementByPos(Dt);break}}}catch(At){ze={error:At}}finally{try{Ue&&!Ue.done&&(Fe=$e.return)&&Fe.call($e)}finally{if(ze)throw ze.error}}}var Oe=de[xe].size();ue+=Oe-_e}},this.find=function(pe){var ze,Fe,xe=le(pe)&Ne-1;if(!de[xe])return!1;if(de[xe]instanceof re.default)return de[xe].find(pe);try{for(var _e=$(de[xe]),Dt=_e.next();!Dt.done;Dt=_e.next()){var $e=Dt.value;if($e.key===pe)return!0}}catch(Ue){ze={error:Ue}}finally{try{Dt&&!Dt.done&&(Fe=_e.return)&&Fe.call(_e)}finally{if(ze)throw ze.error}}return!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){var ze=pe.key,Fe=pe.value;return Ie.setElement(ze,Fe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Map/Map":30}],28:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Set/Set"),re=r("../LinkList/LinkList");Ce.initSize=16,Ce.maxSize=1<<30,Ce.sigma=.75,Ce.treeifyThreshold=8,Ce.untreeifyThreshold=6,Ce.minTreeifySize=64;function Ce(ie,ae,le){var Ie=this;if(ie===void 0&&(ie=[]),ae===void 0&&(ae=Ce.initSize),le=le||function(pe){var ze=0,Fe="";if(typeof pe=="number")ze=Math.floor(pe),ze=(ze<<5)-ze,ze=ze&ze;else{typeof pe!="string"?Fe=JSON.stringify(pe):Fe=pe;for(var xe=0;xe<Fe.length;xe++){var _e=Fe.charCodeAt(xe);ze=(ze<<5)-ze+_e,ze=ze&ze}}return ze^=ze>>>16,ze},ae&ae-1)throw new Error("initBucketNum must be 2 to the power of n");var ue=0,de=[],Ne=Math.max(Ce.initSize,Math.min(Ce.maxSize,ae));this.size=function(){return ue},this.empty=function(){return ue===0},this.clear=function(){ue=0,Ne=ae,de=[]},this.forEach=function(pe){var ze=0;de.forEach(function(Fe){Fe.forEach(function(xe){pe(xe,ze++)})})};var he=function(pe){if(!(pe>=Ce.maxSize)){Ne=pe*2;var ze=[];de.forEach(function(Fe,xe){if(!Fe.empty()){if(Fe instanceof re.default&&Fe.size()===1){var _e=Fe.front();if(_e===void 0)throw new Error("unknown error");ze[le(_e)&Ne-1]=new re.default([_e])}else if(Fe instanceof oe.default){var Dt=new re.default,$e=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?$e.pushBack(Oe):Dt.pushBack(Oe)}),Dt.size()>Ce.untreeifyThreshold?ze[xe]=new oe.default(Dt):Dt.size()&&(ze[xe]=Dt),$e.size()>Ce.untreeifyThreshold?ze[xe+pe]=new oe.default($e):$e.size()&&(ze[xe+pe]=$e)}else{var Ue=new re.default,Ve=new re.default;Fe.forEach(function(Oe){var At=le(Oe);At&pe?Ve.pushBack(Oe):Ue.pushBack(Oe)}),Ue.size()&&(ze[xe]=Ue),Ve.size()&&(ze[xe+pe]=Ve)}de[xe].clear()}}),de=ze}};this.insert=function(pe){if(pe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");var ze=le(pe)&Ne-1;if(!de[ze])de[ze]=new re.default([pe]),++ue;else{var Fe=de[ze].size();if(de[ze]instanceof re.default){if(de[ze].find(pe))return;de[ze].pushBack(pe),de[ze].size()>=Ce.treeifyThreshold&&(de[ze]=new oe.default(de[ze]))}else de[ze].insert(pe);var xe=de[ze].size();ue+=xe-Fe}ue>Ne*Ce.sigma&&he.call(this,Ne)},this.eraseElementByValue=function(pe){var ze=le(pe)&Ne-1;if(de[ze]){var Fe=de[ze].size();de[ze].eraseElementByValue(pe),de[ze]instanceof oe.default&&de[ze].size()<=Ce.untreeifyThreshold&&(de[ze]=new re.default(de[ze]));var xe=de[ze].size();ue+=xe-Fe}},this.find=function(pe){var ze=le(pe)&Ne-1;return de[ze]?de[ze].find(pe):!1},this[Symbol.iterator]=function(){return function(){var pe,ze,Fe,xe,_e,Dt,$e;return V(this,function(Ue){switch(Ue.label){case 0:pe=0,Ue.label=1;case 1:if(!(pe<Ne))return[3,10];for(;pe<Ne&&!de[pe];)++pe;if(pe>=Ne)return[3,10];Ue.label=2;case 2:Ue.trys.push([2,7,8,9]),ze=(Dt=void 0,$(de[pe])),Fe=ze.next(),Ue.label=3;case 3:return Fe.done?[3,6]:(xe=Fe.value,[4,xe]);case 4:Ue.sent(),Ue.label=5;case 5:return Fe=ze.next(),[3,3];case 6:return[3,9];case 7:return _e=Ue.sent(),Dt={error:_e},[3,9];case 8:try{Fe&&!Fe.done&&($e=ze.return)&&$e.call(ze)}finally{if(Dt)throw Dt.error}return[7];case 9:return++pe,[3,1];case 10:return[2]}})}()},ie.forEach(function(pe){return Ie.insert(pe)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{"../LinkList/LinkList":29,"../Set/Set":33}],29:[function(r,g,k){var V=this&&this.__generator||function(re,Ce){var ie={label:0,sent:function(){if(Ie[0]&1)throw Ie[1];return Ie[1]},trys:[],ops:[]},ae,le,Ie,ue;return ue={next:de(0),throw:de(1),return:de(2)},typeof Symbol=="function"&&(ue[Symbol.iterator]=function(){return this}),ue;function de(he){return function(pe){return Ne([he,pe])}}function Ne(he){if(ae)throw new TypeError("Generator is already executing.");for(;ie;)try{if(ae=1,le&&(Ie=he[0]&2?le.return:he[0]?le.throw||((Ie=le.return)&&Ie.call(le),0):le.next)&&!(Ie=Ie.call(le,he[1])).done)return Ie;switch(le=0,Ie&&(he=[he[0]&2,Ie.value]),he[0]){case 0:case 1:Ie=he;break;case 4:return ie.label++,{value:he[1],done:!1};case 5:ie.label++,le=he[1],he=[0];continue;case 7:he=ie.ops.pop(),ie.trys.pop();continue;default:if(Ie=ie.trys,!(Ie=Ie.length>0&&Ie[Ie.length-1])&&(he[0]===6||he[0]===2)){ie=0;continue}if(he[0]===3&&(!Ie||he[1]>Ie[0]&&he[1]<Ie[3])){ie.label=he[1];break}if(he[0]===6&&ie.label<Ie[1]){ie.label=Ie[1],Ie=he;break}if(Ie&&ie.label<Ie[2]){ie.label=Ie[2],ie.ops.push(he);break}Ie[2]&&ie.ops.pop(),ie.trys.pop();continue}he=Ce.call(re,ie)}catch(pe){he=[6,pe],le=0}finally{ae=Ie=0}if(he[0]&5)throw he[1];return{value:he[0]?he[1]:void 0,done:!0}}};Object.defineProperty(k,"__esModule",{value:!0});var $=function(){function re(Ce){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=Ce}return re}();function oe(re){var Ce=this;re===void 0&&(re=[]);var ie=0,ae=void 0,le=void 0;this.size=function(){return ie},this.empty=function(){return ie===0},this.clear=function(){ae=le=void 0,ie=0},this.front=function(){return ae==null?void 0:ae.value},this.back=function(){return le==null?void 0:le.value},this.forEach=function(Ie){for(var ue=ae,de=0;ue;){if(ue.value===void 0)throw new Error("unknown error");Ie(ue.value,de++),ue=ue.next}},this.getElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var ue=ae;Ie--&&ue;)ue=ue.next;if(!ue||ue.value===void 0)throw new Error("unknown error");return ue.value},this.eraseElementByPos=function(Ie){if(Ie<0||Ie>=ie)throw new Error("erase pos must more then 0 and less then the list length");if(Ie===0)this.popFront();else if(Ie===ie-1)this.popBack();else{for(var ue=ae;Ie--;){if(!(ue!=null&&ue.next))throw new Error("unknown error");ue=ue.next}if(!ue||!ue.pre||!ue.next)throw new Error("unknown error");var de=ue.pre,Ne=ue.next;Ne.pre=de,de.next=Ne,ie>0&&--ie}},this.eraseElementByValue=function(Ie){for(;ae&&ae.value===Ie;)this.popFront();for(;le&&le.value===Ie;)this.popBack();if(ae)for(var ue=ae;ue;){if(ue.value===Ie){var de=ue.pre,Ne=ue.next;Ne&&(Ne.pre=de),de&&(de.next=Ne),ie>0&&--ie}ue=ue.next}},this.pushBack=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);le?(le.next=ue,ue.pre=le,le=ue):ae=le=ue},this.popBack=function(){le&&(ie>0&&--ie,le&&(ae===le?ae=le=void 0:(le=le.pre,le&&(le.next=void 0))))},this.setElementByPos=function(Ie,ue){if(ue==null)throw new Error("you can't set null or undefined here");if(Ie<0||Ie>=ie)throw new Error("pos must more then 0 and less then the list length");for(var de=ae;Ie--;){if(!de)throw new Error("unknown error");de=de.next}de&&(de.value=ue)},this.insert=function(Ie,ue,de){if(de===void 0&&(de=1),ue==null)throw new Error("you can't insert null or undefined here");if(Ie<0||Ie>ie)throw new Error("insert pos must more then 0 and less then or equal to the list length");if(de<0)throw new Error("insert size must more than 0");if(Ie===0)for(;de--;)this.pushFront(ue);else if(Ie===ie)for(;de--;)this.pushBack(ue);else{for(var Ne=ae,he=1;he<Ie;++he){if(!(Ne!=null&&Ne.next))throw new Error("unknown error");Ne=Ne==null?void 0:Ne.next}if(!Ne)throw new Error("unknown error");var pe=Ne.next;for(ie+=de;de--;)Ne.next=new $(ue),Ne.next.pre=Ne,Ne=Ne.next;Ne.next=pe,pe&&(pe.pre=Ne)}},this.find=function(Ie){for(var ue=ae;ue;){if(ue.value===Ie)return!0;ue=ue.next}return!1},this.reverse=function(){for(var Ie=ae,ue=le,de=0;Ie&&ue&&de*2<ie;){var Ne=Ie.value;Ie.value=ue.value,ue.value=Ne,Ie=Ie.next,ue=ue.pre,++de}},this.unique=function(){for(var Ie=ae;Ie;){for(var ue=Ie;ue&&ue.next&&ue.value===ue.next.value;)ue=ue.next,ie>0&&--ie;Ie.next=ue.next,Ie.next&&(Ie.next.pre=Ie),Ie=Ie.next}},this.sort=function(Ie){var ue=[];this.forEach(function(Ne){ue.push(Ne)}),ue.sort(Ie);var de=ae;ue.forEach(function(Ne){de&&(de.value=Ne,de=de.next)})},this.pushFront=function(Ie){if(Ie==null)throw new Error("you can't push null or undefined here");++ie;var ue=new $(Ie);ae?(ue.next=ae,ae.pre=ue,ae=ue):ae=le=ue},this.popFront=function(){ae&&(ie>0&&--ie,ae&&(ae===le?ae=le=void 0:(ae=ae.next,ae&&(ae.pre=void 0))))},this.merge=function(Ie){var ue=this,de=ae;Ie.forEach(function(Ne){for(;de&&de.value!==void 0&&de.value<=Ne;)de=de.next;if(de===void 0)ue.pushBack(Ne),de=le;else if(de===ae)ue.pushFront(Ne),de=ae;else{++ie;var he=de.pre;he&&(he.next=new $(Ne),he.next.pre=he,he.next.next=de,de&&(de.pre=he.next))}})},this[Symbol.iterator]=function(){return function(){var Ie;return V(this,function(ue){switch(ue.label){case 0:Ie=ae,ue.label=1;case 1:if(Ie===void 0)return[3,3];if(!Ie.value)throw new Error("unknown error");return[4,Ie.value];case 2:return ue.sent(),Ie=Ie.next,[3,1];case 3:return[2]}})}()},re.forEach(function(Ie){return Ce.pushBack(Ie)}),Object.freeze(this)}Object.freeze(oe),k.default=oe},{}],30:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=Ie.value=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=void 0};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.back=function(){if(!this.empty()){var Oe=de(Ie);if(Oe.key===void 0||Oe.value===void 0)throw new Error("unknown error");return{key:Oe.key,value:Oe.value}}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown Error")};var Ne=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe<0?Ne(Oe.rightChild,At):Ne(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.lowerBound=function(Oe){return Ne(Ie,Oe)};var he=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe<=0?he(Oe.rightChild,At):he(Oe.leftChild,At)||{key:Oe.key,value:Oe.value}}};this.upperBound=function(Oe){return he(Ie,Oe)};var pe=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe===0?{key:Oe.key,value:Oe.value}:qe>0?pe(Oe.leftChild,At):pe(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseLowerBound=function(Oe){return pe(Ie,Oe)};var ze=function(Oe,At){if(!(!Oe||Oe.key===void 0||Oe.value===void 0)){var qe=ie(Oe.key,At);return qe>=0?ze(Oe.leftChild,At):ze(Oe.rightChild,At)||{key:Oe.key,value:Oe.value}}};this.reverseUpperBound=function(Oe){return ze(Ie,Oe)};var Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Fe(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Fe(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Fe(At))}},xe=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe;var Lt=Oe.value;Oe.value=At.value,At.value=Lt,Oe=At}}Fe(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},_e=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=_e(Oe.leftChild,At);return qe||At(Oe)?!0:_e(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;_e(Ie,function(qe){return Oe===At?(xe(qe),!0):(++At,!1)})},this.eraseElementByKey=function(Oe){if(!this.empty()){var At=Ue(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||xe(At)}};var Dt=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?Dt(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?Dt(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},$e=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,$e(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),$e(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),$e(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.setElement=function(Oe,At){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(At==null){this.eraseElementByKey(Oe);return}if(this.empty()){++le,Ie.key=Oe,Ie.value=At,Ie.color=oe.default.TreeNodeColorType.black;return}var qe=Dt(Ie,Oe);if(qe.key!==void 0&&ie(qe.key,Oe)===0){qe.value=At;return}++le,qe.key=Oe,qe.value=At,$e(qe),Ie.color=oe.default.TreeNodeColorType.black};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?Ue(Oe.leftChild,At):qe>0?Ue(Oe.rightChild,At):Oe}};this.find=function(Oe){return!!Ue(Ie,Oe)},this.getElementByKey=function(Oe){var At=Ue(Ie,Oe);if((At==null?void 0:At.key)===void 0||(At==null?void 0:At.value)===void 0)throw new Error("unknown error");return At.value},this.union=function(Oe){var At=this;Oe.forEach(function(qe){var Lt=qe.key,kt=qe.value;return At.setElement(Lt,kt)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0||Oe.value===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,{key:Oe.key,value:Oe.value}];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){var At=Oe.key,qe=Oe.value;return ae.setElement(At,qe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],31:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($,oe){$===void 0&&($=[]),oe=oe||function(le,Ie){return le>Ie?-1:le<Ie?1:0};var re=[];$.forEach(function(le){return re.push(le)});var Ce=re.length,ie=function(le,Ie){if(le<0||le>=Ce)throw new Error("unknown error");if(Ie<0||Ie>=Ce)throw new Error("unknown error");var ue=re[le];re[le]=re[Ie],re[Ie]=ue},ae=function(le){if(le<0||le>=Ce)throw new Error("unknown error");var Ie=le*2+1,ue=le*2+2;Ie<Ce&&oe(re[le],re[Ie])>0&&ie(le,Ie),ue<Ce&&oe(re[le],re[ue])>0&&ie(le,ue)};(function(){for(var le=Math.floor((Ce-1)/2);le>=0;--le)for(var Ie=le,ue=Ie*2+1;ue<Ce;){var de=ue,Ne=de+1,he=de;if(Ne<Ce&&oe(re[de],re[Ne])>0&&(he=Ne),oe(re[Ie],re[he])<=0)break;ie(Ie,he),Ie=he,ue=Ie*2+1}})(),this.size=function(){return Ce},this.empty=function(){return Ce===0},this.clear=function(){Ce=0,re.length=0},this.push=function(le){if(re.push(le),++Ce,Ce!==1)for(var Ie=Ce-1;Ie>0;){var ue=Math.floor((Ie-1)/2);if(oe(re[ue],le)<=0)break;ae(ue),Ie=ue}},this.pop=function(){if(!this.empty()){if(this.size()===1){--Ce;return}var le=re[Ce-1];--Ce;for(var Ie=0;Ie<this.size();){var ue=Ie*2+1,de=Ie*2+2;if(ue>=this.size())break;var Ne=ue;if(de<this.size()&&oe(re[ue],re[de])>0&&(Ne=de),oe(re[Ne],le)>=0)break;re[Ie]=re[Ne],Ie=Ne}re[Ie]=le}},this.top=function(){return re[0]},Object.freeze(this)}Object.freeze(V),k.default=V},{}],32:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});var V=r("../LinkList/LinkList");function $(oe){oe===void 0&&(oe=[]);var re=new V.default(oe);this.size=function(){return re.size()},this.empty=function(){return re.empty()},this.clear=function(){re.clear()},this.push=function(Ce){re.pushBack(Ce)},this.pop=function(){re.popFront()},this.front=function(){return re.front()},Object.freeze(this)}Object.freeze($),k.default=$},{"../LinkList/LinkList":29}],33:[function(r,g,k){var V=this&&this.__generator||function(Ce,ie){var ae={label:0,sent:function(){if(ue[0]&1)throw ue[1];return ue[1]},trys:[],ops:[]},le,Ie,ue,de;return de={next:Ne(0),throw:Ne(1),return:Ne(2)},typeof Symbol=="function"&&(de[Symbol.iterator]=function(){return this}),de;function Ne(pe){return function(ze){return he([pe,ze])}}function he(pe){if(le)throw new TypeError("Generator is already executing.");for(;ae;)try{if(le=1,Ie&&(ue=pe[0]&2?Ie.return:pe[0]?Ie.throw||((ue=Ie.return)&&ue.call(Ie),0):Ie.next)&&!(ue=ue.call(Ie,pe[1])).done)return ue;switch(Ie=0,ue&&(pe=[pe[0]&2,ue.value]),pe[0]){case 0:case 1:ue=pe;break;case 4:return ae.label++,{value:pe[1],done:!1};case 5:ae.label++,Ie=pe[1],pe=[0];continue;case 7:pe=ae.ops.pop(),ae.trys.pop();continue;default:if(ue=ae.trys,!(ue=ue.length>0&&ue[ue.length-1])&&(pe[0]===6||pe[0]===2)){ae=0;continue}if(pe[0]===3&&(!ue||pe[1]>ue[0]&&pe[1]<ue[3])){ae.label=pe[1];break}if(pe[0]===6&&ae.label<ue[1]){ae.label=ue[1],ue=pe;break}if(ue&&ae.label<ue[2]){ae.label=ue[2],ae.ops.push(pe);break}ue[2]&&ae.ops.pop(),ae.trys.pop();continue}pe=ie.call(Ce,ae)}catch(ze){pe=[6,ze],Ie=0}finally{le=ue=0}if(pe[0]&5)throw pe[1];return{value:pe[0]?pe[1]:void 0,done:!0}}},$=this&&this.__values||function(Ce){var ie=typeof Symbol=="function"&&Symbol.iterator,ae=ie&&Ce[ie],le=0;if(ae)return ae.call(Ce);if(Ce&&typeof Ce.length=="number")return{next:function(){return Ce&&le>=Ce.length&&(Ce=void 0),{value:Ce&&Ce[le++],done:!Ce}}};throw new TypeError(ie?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});var oe=r("../Base/TreeNode");function re(Ce,ie){var ae=this;Ce===void 0&&(Ce=[]),ie=ie||function(Oe,At){return Oe<At?-1:Oe>At?1:0};var le=0,Ie=new oe.default;Ie.color=oe.default.TreeNodeColorType.black,this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.key=void 0,Ie.leftChild=Ie.rightChild=Ie.brother=Ie.parent=void 0,Ie.color=oe.default.TreeNodeColorType.black};var ue=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.leftChild?ue(Oe.leftChild):Oe},de=function(Oe){if(!Oe||Oe.key===void 0)throw new Error("unknown error");return Oe.rightChild?de(Oe.rightChild):Oe};this.front=function(){if(!this.empty()){var Oe=ue(Ie);return Oe.key}},this.back=function(){if(!this.empty()){var Oe=de(Ie);return Oe.key}},this.forEach=function(Oe){var At,qe,Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;Oe(ti,Lt++)}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}},this.getElementByPos=function(Oe){var At,qe;if(Oe<0||Oe>=this.size())throw new Error("pos must more than 0 and less than set's size");var Lt=0;try{for(var kt=$(this),jt=kt.next();!jt.done;jt=kt.next()){var ti=jt.value;if(Lt===Oe)return ti;++Lt}}catch(ei){At={error:ei}}finally{try{jt&&!jt.done&&(qe=kt.return)&&qe.call(kt)}finally{if(At)throw At.error}}throw new Error("unknown error")};var Ne=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(Oe.color===oe.default.TreeNodeColorType.red){Oe.color=oe.default.TreeNodeColorType.black;return}var qe=Oe.brother;if(!qe)throw new Error("unknown error");if(Oe===At.leftChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateLeft();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateRight();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}else if(Oe===At.rightChild){if(qe.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.black,At.color=oe.default.TreeNodeColorType.red;var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Ne(Oe)}else if(qe.color===oe.default.TreeNodeColorType.black)if(qe.leftChild&&qe.leftChild.color===oe.default.TreeNodeColorType.red){qe.color=At.color,At.color=oe.default.TreeNodeColorType.black,qe.leftChild&&(qe.leftChild.color=oe.default.TreeNodeColorType.black);var Lt=At.rotateRight();Ie===At&&(Ie=Lt),Oe.color=oe.default.TreeNodeColorType.black}else if((!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&qe.rightChild&&qe.rightChild.color===oe.default.TreeNodeColorType.red){qe.color=oe.default.TreeNodeColorType.red,qe.rightChild&&(qe.rightChild.color=oe.default.TreeNodeColorType.black);var Lt=qe.rotateLeft();Ie===qe&&(Ie=Lt),Ne(Oe)}else(!qe.leftChild||qe.leftChild.color===oe.default.TreeNodeColorType.black)&&(!qe.rightChild||qe.rightChild.color===oe.default.TreeNodeColorType.black)&&(qe.color=oe.default.TreeNodeColorType.red,Ne(At))}},he=function(Oe){for(var At=Oe;At.leftChild||At.rightChild;){if(At.rightChild){At=ue(At.rightChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}if(At.leftChild){At=de(At.leftChild);var qe=Oe.key;Oe.key=At.key,At.key=qe,Oe=At}}Ne(At),At&&At.remove(),--le,Ie.color=oe.default.TreeNodeColorType.black},pe=function(Oe,At){if(!Oe||Oe.key===void 0)return!1;var qe=pe(Oe.leftChild,At);return qe||At(Oe)?!0:pe(Oe.rightChild,At)};this.eraseElementByPos=function(Oe){if(Oe<0||Oe>=le)throw new Error("pos must more than 0 and less than set's size");var At=0;pe(Ie,function(qe){return Oe===At?(he(qe),!0):(++At,!1)})},this.eraseElementByValue=function(Oe){if(!this.empty()){var At=xe(Ie,Oe);At===void 0||At.key===void 0||ie(At.key,Oe)!==0||he(At)}};var ze=function(Oe,At){if(!Oe||Oe.key===void 0)throw new Error("unknown error");var qe=ie(At,Oe.key);return qe<0?Oe.leftChild?ze(Oe.leftChild,At):(Oe.leftChild=new oe.default,Oe.leftChild.parent=Oe,Oe.leftChild.brother=Oe.rightChild,Oe.rightChild&&(Oe.rightChild.brother=Oe.leftChild),Oe.leftChild):qe>0?Oe.rightChild?ze(Oe.rightChild,At):(Oe.rightChild=new oe.default,Oe.rightChild.parent=Oe,Oe.rightChild.brother=Oe.leftChild,Oe.leftChild&&(Oe.leftChild.brother=Oe.rightChild),Oe.rightChild):Oe},Fe=function(Oe){var At=Oe.parent;if(!At){if(Oe===Ie)return;throw new Error("unknown error")}if(At.color!==oe.default.TreeNodeColorType.black&&At.color===oe.default.TreeNodeColorType.red){var qe=At.brother,Lt=At.parent;if(!Lt)throw new Error("unknown error");if(qe&&qe.color===oe.default.TreeNodeColorType.red)qe.color=At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red,Fe(Lt);else if(!qe||qe.color===oe.default.TreeNodeColorType.black){if(At===Lt.leftChild){if(Oe===At.leftChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateRight();Lt===Ie&&(Ie=kt)}else if(Oe===At.rightChild){var kt=At.rotateLeft();Lt===Ie&&(Ie=kt),Fe(At)}}else if(At===Lt.rightChild){if(Oe===At.leftChild){var kt=At.rotateRight();Lt===Ie&&(Ie=kt),Fe(At)}else if(Oe===At.rightChild){At.color=oe.default.TreeNodeColorType.black,Lt.color=oe.default.TreeNodeColorType.red;var kt=Lt.rotateLeft();Lt===Ie&&(Ie=kt)}}}}};this.insert=function(Oe){if(Oe==null)throw new Error("to avoid some unnecessary errors, we don't suggest you insert null or undefined here");if(this.empty()){++le,Ie.key=Oe,Ie.color=oe.default.TreeNodeColorType.black;return}var At=ze(Ie,Oe);At.key!==void 0&&ie(At.key,Oe)===0||(++le,At.key=Oe,Fe(At),Ie.color=oe.default.TreeNodeColorType.black)};var xe=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(At,Oe.key);return qe<0?xe(Oe.leftChild,At):qe>0?xe(Oe.rightChild,At):Oe}};this.find=function(Oe){var At=xe(Ie,Oe);return At!==void 0&&At.key!==void 0&&ie(At.key,Oe)===0};var _e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe<0)return _e(Oe.rightChild,At);var Lt=_e(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.lowerBound=function(Oe){return _e(Ie,Oe)};var Dt=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe<=0)return Dt(Oe.rightChild,At);var Lt=Dt(Oe.leftChild,At);return Lt!==void 0?Lt:Oe.key}};this.upperBound=function(Oe){return Dt(Ie,Oe)};var $e=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe===0)return Oe.key;if(qe>0)return $e(Oe.leftChild,At);var Lt=$e(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseLowerBound=function(Oe){return $e(Ie,Oe)};var Ue=function(Oe,At){if(!(!Oe||Oe.key===void 0)){var qe=ie(Oe.key,At);if(qe>=0)return Ue(Oe.leftChild,At);var Lt=Ue(Oe.rightChild,At);return Lt!==void 0?Lt:Oe.key}};this.reverseUpperBound=function(Oe){return Ue(Ie,Oe)},this.union=function(Oe){var At=this;Oe.forEach(function(qe){return At.insert(qe)})},this.getHeight=function(){if(this.empty())return 0;var Oe=function(At){return At?Math.max(Oe(At.leftChild),Oe(At.rightChild))+1:1};return Oe(Ie)};var Ve=function(Oe){return V(this,function(At){switch(At.label){case 0:return!Oe||Oe.key===void 0?[2]:[5,$(Ve(Oe.leftChild))];case 1:return At.sent(),[4,Oe.key];case 2:return At.sent(),[5,$(Ve(Oe.rightChild))];case 3:return At.sent(),[2]}})};this[Symbol.iterator]=function(){return Ve(Ie)},Ce.forEach(function(Oe){return ae.insert(Oe)}),Object.freeze(this)}Object.freeze(re),k.default=re},{"../Base/TreeNode":25}],34:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0});function V($){var oe=this;$===void 0&&($=[]);var re=0,Ce=[];this.size=function(){return re},this.empty=function(){return re===0},this.clear=function(){re=0,Ce.length=0},this.push=function(ie){Ce.push(ie),++re},this.pop=function(){Ce.pop(),re>0&&--re},this.top=function(){return Ce[re-1]},$.forEach(function(ie){return oe.push(ie)}),Object.freeze(this)}Object.freeze(V),k.default=V},{}],35:[function(r,g,k){var V=this&&this.__generator||function(ie,ae){var le={label:0,sent:function(){if(de[0]&1)throw de[1];return de[1]},trys:[],ops:[]},Ie,ue,de,Ne;return Ne={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(Ne[Symbol.iterator]=function(){return this}),Ne;function he(ze){return function(Fe){return pe([ze,Fe])}}function pe(ze){if(Ie)throw new TypeError("Generator is already executing.");for(;le;)try{if(Ie=1,ue&&(de=ze[0]&2?ue.return:ze[0]?ue.throw||((de=ue.return)&&de.call(ue),0):ue.next)&&!(de=de.call(ue,ze[1])).done)return de;switch(ue=0,de&&(ze=[ze[0]&2,de.value]),ze[0]){case 0:case 1:de=ze;break;case 4:return le.label++,{value:ze[1],done:!1};case 5:le.label++,ue=ze[1],ze=[0];continue;case 7:ze=le.ops.pop(),le.trys.pop();continue;default:if(de=le.trys,!(de=de.length>0&&de[de.length-1])&&(ze[0]===6||ze[0]===2)){le=0;continue}if(ze[0]===3&&(!de||ze[1]>de[0]&&ze[1]<de[3])){le.label=ze[1];break}if(ze[0]===6&&le.label<de[1]){le.label=de[1],de=ze;break}if(de&&le.label<de[2]){le.label=de[2],le.ops.push(ze);break}de[2]&&le.ops.pop(),le.trys.pop();continue}ze=ae.call(ie,le)}catch(Fe){ze=[6,Fe],ue=0}finally{Ie=de=0}if(ze[0]&5)throw ze[1];return{value:ze[0]?ze[1]:void 0,done:!0}}},$=this&&this.__read||function(ie,ae){var le=typeof Symbol=="function"&&ie[Symbol.iterator];if(!le)return ie;var Ie=le.call(ie),ue,de=[],Ne;try{for(;(ae===void 0||ae-- >0)&&!(ue=Ie.next()).done;)de.push(ue.value)}catch(he){Ne={error:he}}finally{try{ue&&!ue.done&&(le=Ie.return)&&le.call(Ie)}finally{if(Ne)throw Ne.error}}return de},oe=this&&this.__spreadArray||function(ie,ae,le){if(le||arguments.length===2)for(var Ie=0,ue=ae.length,de;Ie<ue;Ie++)(de||!(Ie in ae))&&(de||(de=Array.prototype.slice.call(ae,0,Ie)),de[Ie]=ae[Ie]);return ie.concat(de||Array.prototype.slice.call(ae))},re=this&&this.__values||function(ie){var ae=typeof Symbol=="function"&&Symbol.iterator,le=ae&&ie[ae],Ie=0;if(le)return le.call(ie);if(ie&&typeof ie.length=="number")return{next:function(){return ie&&Ie>=ie.length&&(ie=void 0),{value:ie&&ie[Ie++],done:!ie}}};throw new TypeError(ae?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(k,"__esModule",{value:!0});function Ce(ie){var ae=this;ie===void 0&&(ie=[]);var le=0,Ie=[];this.size=function(){return le},this.empty=function(){return le===0},this.clear=function(){le=0,Ie.length=0},this.front=function(){if(!this.empty())return Ie[0]},this.back=function(){if(!this.empty())return Ie[le-1]},this.forEach=function(ue){Ie.forEach(ue)},this.getElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");return Ie[ue]},this.eraseElementByPos=function(ue){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");for(var de=ue;de<le-1;++de)Ie[de]=Ie[de+1];this.popBack()},this.eraseElementByValue=function(ue){var de=[];this.forEach(function(he){he!==ue&&de.push(he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.pushBack=function(ue){Ie.push(ue),++le},this.popBack=function(){Ie.pop(),le>0&&--le},this.setElementByPos=function(ue,de){if(ue<0||ue>=le)throw new Error("pos must more than 0 and less than vector's size");Ie[ue]=de},this.insert=function(ue,de,Ne){if(Ne===void 0&&(Ne=1),ue<0||ue>le)throw new Error("pos must more than 0 and less than or equal to vector's size");Ie.splice.apply(Ie,oe([ue,0],$(new Array(Ne).fill(de)),!1)),le+=Ne},this.find=function(ue){return Ie.includes(ue)},this.reverse=function(){Ie.reverse()},this.unique=function(){var ue,de=[];this.forEach(function(he,pe){(pe===0||he!==ue)&&(de.push(he),ue=he)}),de.forEach(function(he,pe){Ie[pe]=he});for(var Ne=de.length;le>Ne;)this.popBack()},this.sort=function(ue){Ie.sort(ue)},this[Symbol.iterator]=function(){return function(){return V(this,function(ue){switch(ue.label){case 0:return[5,re(Ie)];case 1:return[2,ue.sent()]}})}()},ie.forEach(function(ue){return ae.pushBack(ue)}),Object.freeze(this)}Object.freeze(Ce),k.default=Ce},{}],36:[function(r,g,k){Object.defineProperty(k,"__esModule",{value:!0}),k.HashMap=k.HashSet=k.Map=k.Set=k.PriorityQueue=k.Deque=k.LinkList=k.Queue=k.Stack=k.Vector=void 0;var V=r("./Vector/Vector");k.Vector=V.default;var $=r("./Stack/Stack");k.Stack=$.default;var oe=r("./Queue/Queue");k.Queue=oe.default;var re=r("./LinkList/LinkList");k.LinkList=re.default;var Ce=r("./Deque/Deque");k.Deque=Ce.default;var ie=r("./PriorityQueue/PriorityQueue");k.PriorityQueue=ie.default;var ae=r("./Set/Set");k.Set=ae.default;var le=r("./Map/Map");k.Map=le.default;var Ie=r("./HashSet/HashSet");k.HashSet=Ie.default;var ue=r("./HashMap/HashMap");k.HashMap=ue.default},{"./Deque/Deque":26,"./HashMap/HashMap":27,"./HashSet/HashSet":28,"./LinkList/LinkList":29,"./Map/Map":30,"./PriorityQueue/PriorityQueue":31,"./Queue/Queue":32,"./Set/Set":33,"./Stack/Stack":34,"./Vector/Vector":35}],37:[function(r,g,k){const V=r("yallist"),$=Symbol("max"),oe=Symbol("length"),re=Symbol("lengthCalculator"),Ce=Symbol("allowStale"),ie=Symbol("maxAge"),ae=Symbol("dispose"),le=Symbol("noDisposeOnSet"),Ie=Symbol("lruList"),ue=Symbol("cache"),de=Symbol("updateAgeOnGet"),Ne=()=>1;class he{constructor(Ue){if(typeof Ue=="number"&&(Ue={max:Ue}),Ue||(Ue={}),Ue.max&&(typeof Ue.max!="number"||Ue.max<0))throw new TypeError("max must be a non-negative number");this[$]=Ue.max||1/0;const Ve=Ue.length||Ne;if(this[re]=typeof Ve!="function"?Ne:Ve,this[Ce]=Ue.stale||!1,Ue.maxAge&&typeof Ue.maxAge!="number")throw new TypeError("maxAge must be a number");this[ie]=Ue.maxAge||0,this[ae]=Ue.dispose,this[le]=Ue.noDisposeOnSet||!1,this[de]=Ue.updateAgeOnGet||!1,this.reset()}set max(Ue){if(typeof Ue!="number"||Ue<0)throw new TypeError("max must be a non-negative number");this[$]=Ue||1/0,Fe(this)}get max(){return this[$]}set allowStale(Ue){this[Ce]=!!Ue}get allowStale(){return this[Ce]}set maxAge(Ue){if(typeof Ue!="number")throw new TypeError("maxAge must be a non-negative number");this[ie]=Ue,Fe(this)}get maxAge(){return this[ie]}set lengthCalculator(Ue){typeof Ue!="function"&&(Ue=Ne),Ue!==this[re]&&(this[re]=Ue,this[oe]=0,this[Ie].forEach(Ve=>{Ve.length=this[re](Ve.value,Ve.key),this[oe]+=Ve.length})),Fe(this)}get lengthCalculator(){return this[re]}get length(){return this[oe]}get itemCount(){return this[Ie].length}rforEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].tail;Oe!==null;){const At=Oe.prev;Dt(this,Ue,Oe,Ve),Oe=At}}forEach(Ue,Ve){Ve=Ve||this;for(let Oe=this[Ie].head;Oe!==null;){const At=Oe.next;Dt(this,Ue,Oe,Ve),Oe=At}}keys(){return this[Ie].toArray().map(Ue=>Ue.key)}values(){return this[Ie].toArray().map(Ue=>Ue.value)}reset(){this[ae]&&this[Ie]&&this[Ie].length&&this[Ie].forEach(Ue=>this[ae](Ue.key,Ue.value)),this[ue]=new Map,this[Ie]=new V,this[oe]=0}dump(){return this[Ie].map(Ue=>ze(this,Ue)?!1:{k:Ue.key,v:Ue.value,e:Ue.now+(Ue.maxAge||0)}).toArray().filter(Ue=>Ue)}dumpLru(){return this[Ie]}set(Ue,Ve,Oe){if(Oe=Oe||this[ie],Oe&&typeof Oe!="number")throw new TypeError("maxAge must be a number");const At=Oe?Date.now():0,qe=this[re](Ve,Ue);if(this[ue].has(Ue)){if(qe>this[$])return xe(this,this[ue].get(Ue)),!1;const jt=this[ue].get(Ue).value;return this[ae]&&(this[le]||this[ae](Ue,jt.value)),jt.now=At,jt.maxAge=Oe,jt.value=Ve,this[oe]+=qe-jt.length,jt.length=qe,this.get(Ue),Fe(this),!0}const Lt=new _e(Ue,Ve,qe,At,Oe);return Lt.length>this[$]?(this[ae]&&this[ae](Ue,Ve),!1):(this[oe]+=Lt.length,this[Ie].unshift(Lt),this[ue].set(Ue,this[Ie].head),Fe(this),!0)}has(Ue){if(!this[ue].has(Ue))return!1;const Ve=this[ue].get(Ue).value;return!ze(this,Ve)}get(Ue){return pe(this,Ue,!0)}peek(Ue){return pe(this,Ue,!1)}pop(){const Ue=this[Ie].tail;return Ue?(xe(this,Ue),Ue.value):null}del(Ue){xe(this,this[ue].get(Ue))}load(Ue){this.reset();const Ve=Date.now();for(let Oe=Ue.length-1;Oe>=0;Oe--){const At=Ue[Oe],qe=At.e||0;if(qe===0)this.set(At.k,At.v);else{const Lt=qe-Ve;Lt>0&&this.set(At.k,At.v,Lt)}}}prune(){this[ue].forEach((Ue,Ve)=>pe(this,Ve,!1))}}const pe=($e,Ue,Ve)=>{const Oe=$e[ue].get(Ue);if(Oe){const At=Oe.value;if(ze($e,At)){if(xe($e,Oe),!$e[Ce])return}else Ve&&($e[de]&&(Oe.value.now=Date.now()),$e[Ie].unshiftNode(Oe));return At.value}},ze=($e,Ue)=>{if(!Ue||!Ue.maxAge&&!$e[ie])return!1;const Ve=Date.now()-Ue.now;return Ue.maxAge?Ve>Ue.maxAge:$e[ie]&&Ve>$e[ie]},Fe=$e=>{if($e[oe]>$e[$])for(let Ue=$e[Ie].tail;$e[oe]>$e[$]&&Ue!==null;){const Ve=Ue.prev;xe($e,Ue),Ue=Ve}},xe=($e,Ue)=>{if(Ue){const Ve=Ue.value;$e[ae]&&$e[ae](Ve.key,Ve.value),$e[oe]-=Ve.length,$e[ue].delete(Ve.key),$e[Ie].removeNode(Ue)}};class _e{constructor(Ue,Ve,Oe,At,qe){this.key=Ue,this.value=Ve,this.length=Oe,this.now=At,this.maxAge=qe||0}}const Dt=($e,Ue,Ve,Oe)=>{let At=Ve.value;ze($e,At)&&(xe($e,Ve),$e[Ce]||(At=void 0)),At&&Ue.call(Oe,At.value,At.key,$e)};g.exports=he},{yallist:83}],38:[function(r,g,k){(function(V){(function(){const $=g.exports;$.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},$.codes={};for(const re in $.types){const Ce=$.types[re];$.codes[Ce]=re}$.CMD_SHIFT=4,$.CMD_MASK=240,$.DUP_MASK=8,$.QOS_MASK=3,$.QOS_SHIFT=1,$.RETAIN_MASK=1,$.VARBYTEINT_MASK=127,$.VARBYTEINT_FIN_MASK=128,$.VARBYTEINT_MAX=268435455,$.SESSIONPRESENT_MASK=1,$.SESSIONPRESENT_HEADER=V.from([$.SESSIONPRESENT_MASK]),$.CONNACK_HEADER=V.from([$.codes.connack<<$.CMD_SHIFT]),$.USERNAME_MASK=128,$.PASSWORD_MASK=64,$.WILL_RETAIN_MASK=32,$.WILL_QOS_MASK=24,$.WILL_QOS_SHIFT=3,$.WILL_FLAG_MASK=4,$.CLEAN_SESSION_MASK=2,$.CONNECT_HEADER=V.from([$.codes.connect<<$.CMD_SHIFT]),$.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},$.propertiesCodes={};for(const re in $.properties){const Ce=$.properties[re];$.propertiesCodes[Ce]=re}$.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"};function oe(re){return[0,1,2].map(Ce=>[0,1].map(ie=>[0,1].map(ae=>{const le=V.alloc(1);return le.writeUInt8($.codes[re]<<$.CMD_SHIFT|(ie?$.DUP_MASK:0)|Ce<<$.QOS_SHIFT|ae,0,!0),le})))}$.PUBLISH_HEADER=oe("publish"),$.SUBSCRIBE_HEADER=oe("subscribe"),$.SUBSCRIBE_OPTIONS_QOS_MASK=3,$.SUBSCRIBE_OPTIONS_NL_MASK=1,$.SUBSCRIBE_OPTIONS_NL_SHIFT=2,$.SUBSCRIBE_OPTIONS_RAP_MASK=1,$.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,$.SUBSCRIBE_OPTIONS_RH_MASK=3,$.SUBSCRIBE_OPTIONS_RH_SHIFT=4,$.SUBSCRIBE_OPTIONS_RH=[0,16,32],$.SUBSCRIBE_OPTIONS_NL=4,$.SUBSCRIBE_OPTIONS_RAP=8,$.SUBSCRIBE_OPTIONS_QOS=[0,1,2],$.UNSUBSCRIBE_HEADER=oe("unsubscribe"),$.ACKS={unsuback:oe("unsuback"),puback:oe("puback"),pubcomp:oe("pubcomp"),pubrel:oe("pubrel"),pubrec:oe("pubrec")},$.SUBACK_HEADER=V.from([$.codes.suback<<$.CMD_SHIFT]),$.VERSION3=V.from([3]),$.VERSION4=V.from([4]),$.VERSION5=V.from([5]),$.VERSION131=V.from([131]),$.VERSION132=V.from([132]),$.QOS=[0,1,2].map(re=>V.from([re])),$.EMPTY={pingreq:V.from([$.codes.pingreq<<4,0]),pingresp:V.from([$.codes.pingresp<<4,0]),disconnect:V.from([$.codes.disconnect<<4,0])}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],39:[function(r,g,k){(function(V){(function(){const $=r("./writeToStream"),oe=r("events");function re(ie,ae){const le=new Ce;return $(ie,le,ae),le.concat()}class Ce extends oe{constructor(){super(),this._array=new Array(20),this._i=0}write(ae){return this._array[this._i++]=ae,!0}concat(){let ae=0;const le=new Array(this._array.length),Ie=this._array;let ue=0,de;for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?le[de]=Ie[de].length:le[de]=V.byteLength(Ie[de]),ae+=le[de];const Ne=V.allocUnsafe(ae);for(de=0;de<Ie.length&&Ie[de]!==void 0;de++)typeof Ie[de]!="string"?(Ie[de].copy(Ne,ue),ue+=le[de]):(Ne.write(Ie[de],ue),ue+=le[de]);return Ne}}g.exports=re}).call(this)}).call(this,r("buffer").Buffer)},{"./writeToStream":44,buffer:17,events:22}],40:[function(r,g,k){k.parser=r("./parser").parser,k.generate=r("./generate"),k.writeToStream=r("./writeToStream")},{"./generate":39,"./parser":43,"./writeToStream":44}],41:[function(r,g,k){(function(V){(function(){const oe={},re=V.isBuffer(V.from([1,2]).subarray(0,1));function Ce(Ie){const ue=V.allocUnsafe(2);return ue.writeUInt8(Ie>>8,0),ue.writeUInt8(Ie&255,0+1),ue}function ie(){for(let Ie=0;Ie<65536;Ie++)oe[Ie]=Ce(Ie)}function ae(Ie){let de=0,Ne=0;const he=V.allocUnsafe(4);do de=Ie%128|0,Ie=Ie/128|0,Ie>0&&(de=de|128),he.writeUInt8(de,Ne++);while(Ie>0&&Ne<4);return Ie>0&&(Ne=0),re?he.subarray(0,Ne):he.slice(0,Ne)}function le(Ie){const ue=V.allocUnsafe(4);return ue.writeUInt32BE(Ie,0),ue}g.exports={cache:oe,generateCache:ie,generateNumber:Ce,genBufVariableByteInt:ae,generate4ByteBuffer:le}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],42:[function(r,g,k){class V{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}g.exports=V},{}],43:[function(r,g,k){const V=r("bl"),$=r("events"),oe=r("./packet"),re=r("./constants"),Ce=r("debug")("mqtt-packet:parser");class ie extends ${constructor(){super(),this.parser=this.constructor.parser}static parser(le){return this instanceof ie?(this.settings=le||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new ie().parser(le)}_resetState(){Ce("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new oe,this.error=null,this._list=V(),this._stateCounter=0}parse(le){for(this.error&&this._resetState(),this._list.append(le),Ce("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,Ce("parse: state complete. _stateCounter is now: %d",this._stateCounter),Ce("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return Ce("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const le=this._list.readUInt8(0);return this.packet.cmd=re.types[le>>re.CMD_SHIFT],this.packet.retain=(le&re.RETAIN_MASK)!==0,this.packet.qos=le>>re.QOS_SHIFT&re.QOS_MASK,this.packet.dup=(le&re.DUP_MASK)!==0,Ce("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const le=this._parseVarByteNum(!0);return le&&(this.packet.length=le.value,this._list.consume(le.bytes)),Ce("_parseLength %d",le.value),!!le}_parsePayload(){Ce("_parsePayload: payload %O",this._list);let le=!1;if(this.packet.length===0||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}le=!0}return Ce("_parsePayload complete result: %s",le),le}_parseConnect(){Ce("_parseConnect");let le,Ie,ue,de;const Ne={},he=this.packet,pe=this._parseString();if(pe===null)return this._emitError(new Error("Cannot parse protocolId"));if(pe!=="MQTT"&&pe!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(he.protocolId=pe,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(he.protocolVersion=this._list.readUInt8(this._pos),he.protocolVersion>=128&&(he.bridgeMode=!0,he.protocolVersion=he.protocolVersion-128),he.protocolVersion!==3&&he.protocolVersion!==4&&he.protocolVersion!==5)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(Ne.username=this._list.readUInt8(this._pos)&re.USERNAME_MASK,Ne.password=this._list.readUInt8(this._pos)&re.PASSWORD_MASK,Ne.will=this._list.readUInt8(this._pos)&re.WILL_FLAG_MASK,Ne.will&&(he.will={},he.will.retain=(this._list.readUInt8(this._pos)&re.WILL_RETAIN_MASK)!==0,he.will.qos=(this._list.readUInt8(this._pos)&re.WILL_QOS_MASK)>>re.WILL_QOS_SHIFT),he.clean=(this._list.readUInt8(this._pos)&re.CLEAN_SESSION_MASK)!==0,this._pos++,he.keepalive=this._parseNum(),he.keepalive===-1)return this._emitError(new Error("Packet too short"));if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.properties=Fe)}const ze=this._parseString();if(ze===null)return this._emitError(new Error("Packet too short"));if(he.clientId=ze,Ce("_parseConnect: packet.clientId: %s",he.clientId),Ne.will){if(he.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(he.will.properties=Fe)}if(le=this._parseString(),le===null)return this._emitError(new Error("Cannot parse will topic"));if(he.will.topic=le,Ce("_parseConnect: packet.will.topic: %s",he.will.topic),Ie=this._parseBuffer(),Ie===null)return this._emitError(new Error("Cannot parse will payload"));he.will.payload=Ie,Ce("_parseConnect: packet.will.paylaod: %s",he.will.payload)}if(Ne.username){if(de=this._parseString(),de===null)return this._emitError(new Error("Cannot parse username"));he.username=de,Ce("_parseConnect: packet.username: %s",he.username)}if(Ne.password){if(ue=this._parseBuffer(),ue===null)return this._emitError(new Error("Cannot parse password"));he.password=ue}return this.settings=he,Ce("_parseConnect: complete"),he}_parseConnack(){Ce("_parseConnack");const le=this.packet;if(this._list.length<1)return null;if(le.sessionPresent=!!(this._list.readUInt8(this._pos++)&re.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?le.reasonCode=this._list.readUInt8(this._pos++):le.reasonCode=0;else{if(this._list.length<2)return null;le.returnCode=this._list.readUInt8(this._pos++)}if(le.returnCode===-1||le.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}Ce("_parseConnack: complete")}_parsePublish(){Ce("_parsePublish");const le=this.packet;if(le.topic=this._parseString(),le.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(le.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}le.payload=this._list.slice(this._pos,le.length),Ce("_parsePublish: payload from buffer list: %o",le.payload)}}_parseSubscribe(){Ce("_parseSubscribe");const le=this.packet;let Ie,ue,de,Ne,he,pe,ze;if(le.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(le.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Fe=this._parseProperties();Object.getOwnPropertyNames(Fe).length&&(le.properties=Fe)}for(;this._pos<le.length;){if(Ie=this._parseString(),Ie===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=le.length)return this._emitError(new Error("Malformed Subscribe Payload"));ue=this._parseByte(),de=ue&re.SUBSCRIBE_OPTIONS_QOS_MASK,pe=(ue>>re.SUBSCRIBE_OPTIONS_NL_SHIFT&re.SUBSCRIBE_OPTIONS_NL_MASK)!==0,he=(ue>>re.SUBSCRIBE_OPTIONS_RAP_SHIFT&re.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,Ne=ue>>re.SUBSCRIBE_OPTIONS_RH_SHIFT&re.SUBSCRIBE_OPTIONS_RH_MASK,ze={topic:Ie,qos:de},this.settings.protocolVersion===5?(ze.nl=pe,ze.rap=he,ze.rh=Ne):this.settings.bridgeMode&&(ze.rh=0,ze.rap=!0,ze.nl=!0),Ce("_parseSubscribe: push subscription `%s` to subscription",ze),le.subscriptions.push(ze)}}}_parseSuback(){Ce("_parseSuback");const le=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){Ce("_parseUnsubscribe");const le=this.packet;if(le.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}for(;this._pos<le.length;){const Ie=this._parseString();if(Ie===null)return this._emitError(new Error("Cannot parse topic"));Ce("_parseUnsubscribe: push topic `%s` to unsubscriptions",Ie),le.unsubscriptions.push(Ie)}}}_parseUnsuback(){Ce("_parseUnsuback");const le=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(this.settings.protocolVersion===5){const Ie=this._parseProperties();for(Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),le.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){Ce("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const le=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5&&(le.length>2?(le.reasonCode=this._parseByte(),Ce("_parseConfirmation: packet.reasonCode `%d`",le.reasonCode)):le.reasonCode=0,le.length>3)){const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return!0}_parseDisconnect(){const le=this.packet;if(Ce("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?le.reasonCode=this._parseByte():le.reasonCode=0;const Ie=this._parseProperties();Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie)}return Ce("_parseDisconnect result: true"),!0}_parseAuth(){Ce("_parseAuth");const le=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));le.reasonCode=this._parseByte();const Ie=this._parseProperties();return Object.getOwnPropertyNames(Ie).length&&(le.properties=Ie),Ce("_parseAuth: result: true"),!0}_parseMessageId(){const le=this.packet;return le.messageId=this._parseNum(),le.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(Ce("_parseMessageId: packet.messageId %d",le.messageId),!0)}_parseString(le){const Ie=this._parseNum(),ue=Ie+this._pos;if(Ie===-1||ue>this._list.length||ue>this.packet.length)return null;const de=this._list.toString("utf8",this._pos,ue);return this._pos+=Ie,Ce("_parseString: result: %s",de),de}_parseStringPair(){return Ce("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const le=this._parseNum(),Ie=le+this._pos;if(le===-1||Ie>this._list.length||Ie>this.packet.length)return null;const ue=this._list.slice(this._pos,Ie);return this._pos+=le,Ce("_parseBuffer: result: %o",ue),ue}_parseNum(){if(this._list.length-this._pos<2)return-1;const le=this._list.readUInt16BE(this._pos);return this._pos+=2,Ce("_parseNum: result: %s",le),le}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const le=this._list.readUInt32BE(this._pos);return this._pos+=4,Ce("_parse4ByteNum: result: %s",le),le}_parseVarByteNum(le){Ce("_parseVarByteNum");const Ie=4;let ue=0,de=1,Ne=0,he=!1,pe;const ze=this._pos?this._pos:0;for(;ue<Ie&&ze+ue<this._list.length;){if(pe=this._list.readUInt8(ze+ue++),Ne+=de*(pe&re.VARBYTEINT_MASK),de*=128,!(pe&re.VARBYTEINT_FIN_MASK)){he=!0;break}if(this._list.length<=ue)break}return!he&&ue===Ie&&this._list.length>=ue&&this._emitError(new Error("Invalid variable byte integer")),ze&&(this._pos+=ue),he=he?le?{bytes:ue,value:Ne}:Ne:!1,Ce("_parseVarByteNum: result: %o",he),he}_parseByte(){let le;return this._pos<this._list.length&&(le=this._list.readUInt8(this._pos),this._pos++),Ce("_parseByte: result: %o",le),le}_parseByType(le){switch(Ce("_parseByType: type: %s",le),le){case"byte":return this._parseByte()!==0;case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){Ce("_parseProperties");const le=this._parseVarByteNum(),ue=this._pos+le,de={};for(;this._pos<ue;){const Ne=this._parseByte();if(!Ne)return this._emitError(new Error("Cannot parse property code type")),!1;const he=re.propertiesCodes[Ne];if(!he)return this._emitError(new Error("Unknown property")),!1;if(he==="userProperties"){de[he]||(de[he]=Object.create(null));const pe=this._parseByType(re.propertiesTypes[he]);if(de[he][pe.name])if(Array.isArray(de[he][pe.name]))de[he][pe.name].push(pe.value);else{const ze=de[he][pe.name];de[he][pe.name]=[ze],de[he][pe.name].push(pe.value)}else de[he][pe.name]=pe.value;continue}de[he]?Array.isArray(de[he])?de[he].push(this._parseByType(re.propertiesTypes[he])):(de[he]=[de[he]],de[he].push(this._parseByType(re.propertiesTypes[he]))):de[he]=this._parseByType(re.propertiesTypes[he])}return de}_newPacket(){return Ce("_newPacket"),this.packet&&(this._list.consume(this.packet.length),Ce("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),Ce("_newPacket: new packet"),this.packet=new oe,this._pos=0,!0}_emitError(le){Ce("_emitError"),this.error=le,this.emit("error",le)}}g.exports=ie},{"./constants":38,"./packet":42,bl:15,debug:18,events:22}],44:[function(r,g,k){(function(V){(function(){const $=r("./constants"),oe=V.allocUnsafe(0),re=V.from([0]),Ce=r("./numbers"),ie=r("process-nextick-args").nextTick,ae=r("debug")("mqtt-packet:writeToStream"),le=Ce.cache,Ie=Ce.generateNumber,ue=Ce.generateCache,de=Ce.genBufVariableByteInt,Ne=Ce.generate4ByteBuffer;let he=ni,pe=!0;function ze(wi,Ci,mi){switch(ae("generate called"),Ci.cork&&(Ci.cork(),ie(Fe,Ci)),pe&&(pe=!1,ue()),ae("generate: packet.cmd: %s",wi.cmd),wi.cmd){case"connect":return xe(wi,Ci);case"connack":return _e(wi,Ci,mi);case"publish":return Dt(wi,Ci,mi);case"puback":case"pubrec":case"pubrel":case"pubcomp":return $e(wi,Ci,mi);case"subscribe":return Ue(wi,Ci,mi);case"suback":return Ve(wi,Ci,mi);case"unsubscribe":return Oe(wi,Ci,mi);case"unsuback":return At(wi,Ci,mi);case"pingreq":case"pingresp":return qe(wi,Ci);case"disconnect":return Lt(wi,Ci,mi);case"auth":return kt(wi,Ci,mi);default:return Ci.emit("error",new Error("Unknown command")),!1}}Object.defineProperty(ze,"cacheNumbers",{get(){return he===ni},set(wi){wi?((!le||Object.keys(le).length===0)&&(pe=!0),he=ni):(pe=!1,he=gi)}});function Fe(wi){wi.uncork()}function xe(wi,Ci,mi){const Ni=wi||{},Mi=Ni.protocolId||"MQTT";let fi=Ni.protocolVersion||4;const zi=Ni.will;let Si=Ni.clean;const si=Ni.keepalive||0,Ii=Ni.clientId||"",oi=Ni.username,Et=Ni.password,ii=Ni.properties;Si===void 0&&(Si=!0);let ri=0;if(!Mi||typeof Mi!="string"&&!V.isBuffer(Mi))return Ci.emit("error",new Error("Invalid protocolId")),!1;if(ri+=Mi.length+2,fi!==3&&fi!==4&&fi!==5)return Ci.emit("error",new Error("Invalid protocol version")),!1;if(ri+=1,(typeof Ii=="string"||V.isBuffer(Ii))&&(Ii||fi>=4)&&(Ii||Si))ri+=V.byteLength(Ii)+2;else{if(fi<4)return Ci.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(Si*1===0)return Ci.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof si!="number"||si<0||si>65535||si%1!==0)return Ci.emit("error",new Error("Invalid keepalive")),!1;if(ri+=2,ri+=1,fi===5){var ui=ai(Ci,ii);if(!ui)return!1;ri+=ui.length}if(zi){if(typeof zi!="object")return Ci.emit("error",new Error("Invalid will")),!1;if(!zi.topic||typeof zi.topic!="string")return Ci.emit("error",new Error("Invalid will topic")),!1;if(ri+=V.byteLength(zi.topic)+2,ri+=2,zi.payload)if(zi.payload.length>=0)typeof zi.payload=="string"?ri+=V.byteLength(zi.payload):ri+=zi.payload.length;else return Ci.emit("error",new Error("Invalid will payload")),!1;var vi={};if(fi===5){if(vi=ai(Ci,zi.properties),!vi)return!1;ri+=vi.length}}let bi=!1;if(oi!=null)if(hi(oi))bi=!0,ri+=V.byteLength(oi)+2;else return Ci.emit("error",new Error("Invalid username")),!1;if(Et!=null){if(!bi)return Ci.emit("error",new Error("Username is required to use password")),!1;if(hi(Et))ri+=Ai(Et)+2;else return Ci.emit("error",new Error("Invalid password")),!1}Ci.write($.CONNECT_HEADER),ti(Ci,ri),li(Ci,Mi),Ni.bridgeMode&&(fi+=128),Ci.write(fi===131?$.VERSION131:fi===132?$.VERSION132:fi===4?$.VERSION4:fi===5?$.VERSION5:$.VERSION3);let Zi=0;return Zi|=oi!=null?$.USERNAME_MASK:0,Zi|=Et!=null?$.PASSWORD_MASK:0,Zi|=zi&&zi.retain?$.WILL_RETAIN_MASK:0,Zi|=zi&&zi.qos?zi.qos<<$.WILL_QOS_SHIFT:0,Zi|=zi?$.WILL_FLAG_MASK:0,Zi|=Si?$.CLEAN_SESSION_MASK:0,Ci.write(V.from([Zi])),he(Ci,si),fi===5&&ui.write(),li(Ci,Ii),zi&&(fi===5&&vi.write(),ei(Ci,zi.topic),li(Ci,zi.payload)),oi!=null&&li(Ci,oi),Et!=null&&li(Ci,Et),!0}function _e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Ni===5?Mi.reasonCode:Mi.returnCode,zi=Mi.properties;let Si=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid return code")),!1;let si=null;if(Ni===5){if(si=ai(Ci,zi),!si)return!1;Si+=si.length}return Ci.write($.CONNACK_HEADER),ti(Ci,Si),Ci.write(Mi.sessionPresent?$.SESSIONPRESENT_HEADER:re),Ci.write(V.from([fi])),si!=null&&si.write(),!0}function Dt(wi,Ci,mi){ae("publish: packet: %o",wi);const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.qos||0,zi=Mi.retain?$.RETAIN_MASK:0,Si=Mi.topic,si=Mi.payload||oe,Ii=Mi.messageId,oi=Mi.properties;let Et=0;if(typeof Si=="string")Et+=V.byteLength(Si)+2;else if(V.isBuffer(Si))Et+=Si.length+2;else return Ci.emit("error",new Error("Invalid topic")),!1;if(V.isBuffer(si)?Et+=si.length:Et+=V.byteLength(si),fi&&typeof Ii!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;fi&&(Et+=2);let ii=null;if(Ni===5){if(ii=ai(Ci,oi),!ii)return!1;Et+=ii.length}return Ci.write($.PUBLISH_HEADER[fi][Mi.dup?1:0][zi?1:0]),ti(Ci,Et),he(Ci,Ai(Si)),Ci.write(Si),fi>0&&he(Ci,Ii),ii!=null&&ii.write(),ae("publish: payload: %o",si),Ci.write(si)}function $e(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.cmd||"puback",zi=Mi.messageId,Si=Mi.dup&&fi==="pubrel"?$.DUP_MASK:0;let si=0;const Ii=Mi.reasonCode,oi=Mi.properties;let Et=Ni===5?3:2;if(fi==="pubrel"&&(si=1),typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;let ii=null;if(Ni===5&&typeof oi=="object"){if(ii=ci(Ci,oi,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[fi][si][Si][0]),ti(Ci,Et),he(Ci,zi),Ni===5&&Ci.write(V.from([Ii])),ii!==null&&ii.write(),!0}function Ue(wi,Ci,mi){ae("subscribe: packet: ");const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.dup?$.DUP_MASK:0,zi=Mi.messageId,Si=Mi.subscriptions,si=Mi.properties;let Ii=0;if(typeof zi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;Ii+=2;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}if(typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){const ri=Si[ii].topic,ui=Si[ii].qos;if(typeof ri!="string")return Ci.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if(typeof ui!="number")return Ci.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(Ni===5){if(typeof(Si[ii].nl||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Si[ii].rap||!1)!="boolean")return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const Zi=Si[ii].rh||0;if(typeof Zi!="number"||Zi>2)return Ci.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}Ii+=V.byteLength(ri)+2+1}else return Ci.emit("error",new Error("Invalid subscriptions")),!1;ae("subscribe: writing to stream: %o",$.SUBSCRIBE_HEADER),Ci.write($.SUBSCRIBE_HEADER[1][fi?1:0][0]),ti(Ci,Ii),he(Ci,zi),oi!==null&&oi.write();let Et=!0;for(const ii of Si){const ri=ii.topic,ui=ii.qos,vi=+ii.nl,bi=+ii.rap,Zi=ii.rh;let Gi;ei(Ci,ri),Gi=$.SUBSCRIBE_OPTIONS_QOS[ui],Ni===5&&(Gi|=vi?$.SUBSCRIBE_OPTIONS_NL:0,Gi|=bi?$.SUBSCRIBE_OPTIONS_RAP:0,Gi|=Zi?$.SUBSCRIBE_OPTIONS_RH[Zi]:0),Et=Ci.write(V.from([Gi]))}return Et}function Ve(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.granted,Si=Mi.properties;let si=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(si+=2,typeof zi=="object"&&zi.length)for(let oi=0;oi<zi.length;oi+=1){if(typeof zi[oi]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;si+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let Ii=null;if(Ni===5){if(Ii=ci(Ci,Si,mi,si),!Ii)return!1;si+=Ii.length}return Ci.write($.SUBACK_HEADER),ti(Ci,si),he(Ci,fi),Ii!==null&&Ii.write(),Ci.write(V.from(zi))}function Oe(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.unsubscriptions,si=Mi.properties;let Ii=0;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ii+=2,typeof Si=="object"&&Si.length)for(let ii=0;ii<Si.length;ii+=1){if(typeof Si[ii]!="string")return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;Ii+=V.byteLength(Si[ii])+2}else return Ci.emit("error",new Error("Invalid unsubscriptions")),!1;let oi=null;if(Ni===5){if(oi=ai(Ci,si),!oi)return!1;Ii+=oi.length}Ci.write($.UNSUBSCRIBE_HEADER[1][zi?1:0][0]),ti(Ci,Ii),he(Ci,fi),oi!==null&&oi.write();let Et=!0;for(let ii=0;ii<Si.length;ii++)Et=ei(Ci,Si[ii]);return Et}function At(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.messageId,zi=Mi.dup?$.DUP_MASK:0,Si=Mi.granted,si=Mi.properties,Ii=Mi.cmd,oi=0;let Et=2;if(typeof fi!="number")return Ci.emit("error",new Error("Invalid messageId")),!1;if(Ni===5)if(typeof Si=="object"&&Si.length)for(let ri=0;ri<Si.length;ri+=1){if(typeof Si[ri]!="number")return Ci.emit("error",new Error("Invalid qos vector")),!1;Et+=1}else return Ci.emit("error",new Error("Invalid qos vector")),!1;let ii=null;if(Ni===5){if(ii=ci(Ci,si,mi,Et),!ii)return!1;Et+=ii.length}return Ci.write($.ACKS[Ii][oi][zi][0]),ti(Ci,Et),he(Ci,fi),ii!==null&&ii.write(),Ni===5&&Ci.write(V.from(Si)),!0}function qe(wi,Ci,mi){return Ci.write($.EMPTY[wi.cmd])}function Lt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0,si=null;if(Ni===5){if(si=ci(Ci,zi,mi,Si),!si)return!1;Si+=si.length}return Ci.write(V.from([$.codes.disconnect<<4])),ti(Ci,Si),Ni===5&&Ci.write(V.from([fi])),si!==null&&si.write(),!0}function kt(wi,Ci,mi){const Ni=mi?mi.protocolVersion:4,Mi=wi||{},fi=Mi.reasonCode,zi=Mi.properties;let Si=Ni===5?1:0;Ni!==5&&Ci.emit("error",new Error("Invalid mqtt version for auth packet"));const si=ci(Ci,zi,mi,Si);return si?(Si+=si.length,Ci.write(V.from([$.codes.auth<<4])),ti(Ci,Si),Ci.write(V.from([fi])),si!==null&&si.write(),!0):!1}const jt={};function ti(wi,Ci){if(Ci>$.VARBYTEINT_MAX)return wi.emit("error",new Error(`Invalid variable byte integer: ${Ci}`)),!1;let mi=jt[Ci];return mi||(mi=de(Ci),Ci<16384&&(jt[Ci]=mi)),ae("writeVarByteInt: writing to stream: %o",mi),wi.write(mi)}function ei(wi,Ci){const mi=V.byteLength(Ci);return he(wi,mi),ae("writeString: %s",Ci),wi.write(Ci,"utf8")}function Pt(wi,Ci,mi){ei(wi,Ci),ei(wi,mi)}function ni(wi,Ci){return ae("writeNumberCached: number: %d",Ci),ae("writeNumberCached: %o",le[Ci]),wi.write(le[Ci])}function gi(wi,Ci){const mi=Ie(Ci);return ae("writeNumberGenerated: %o",mi),wi.write(mi)}function di(wi,Ci){const mi=Ne(Ci);return ae("write4ByteNumber: %o",mi),wi.write(mi)}function li(wi,Ci){typeof Ci=="string"?ei(wi,Ci):Ci?(he(wi,Ci.length),wi.write(Ci)):he(wi,0)}function ai(wi,Ci){if(typeof Ci!="object"||Ci.length!=null)return{length:1,write(){yi(wi,{},0)}};let mi=0;function Ni(fi,zi){const Si=$.propertiesTypes[fi];let si=0;switch(Si){case"byte":{if(typeof zi!="boolean")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"int8":{if(typeof zi!="number"||zi<0||zi>255)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+1;break}case"binary":{if(zi&&zi===null)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(zi)+2;break}case"int16":{if(typeof zi!="number"||zi<0||zi>65535)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2;break}case"int32":{if(typeof zi!="number"||zi<0||zi>4294967295)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+4;break}case"var":{if(typeof zi!="number"||zi<0||zi>268435455)return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+V.byteLength(de(zi));break}case"string":{if(typeof zi!="string")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=1+2+V.byteLength(zi.toString());break}case"pair":{if(typeof zi!="object")return wi.emit("error",new Error(`Invalid ${fi}: ${zi}`)),!1;si+=Object.getOwnPropertyNames(zi).reduce((Ii,oi)=>{const Et=zi[oi];return Array.isArray(Et)?Ii+=Et.reduce((ii,ri)=>(ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(ri.toString()),ii),0):Ii+=1+2+V.byteLength(oi.toString())+2+V.byteLength(zi[oi].toString()),Ii},0);break}default:return wi.emit("error",new Error(`Invalid property ${fi}: ${zi}`)),!1}return si}if(Ci)for(const fi in Ci){let zi=0,Si=0;const si=Ci[fi];if(Array.isArray(si))for(let Ii=0;Ii<si.length;Ii++){if(Si=Ni(fi,si[Ii]),!Si)return!1;zi+=Si}else{if(Si=Ni(fi,si),!Si)return!1;zi=Si}if(!zi)return!1;mi+=zi}return{length:V.byteLength(de(mi))+mi,write(){yi(wi,Ci,mi)}}}function ci(wi,Ci,mi,Ni){const Mi=["reasonString","userProperties"],fi=mi&&mi.properties&&mi.properties.maximumPacketSize?mi.properties.maximumPacketSize:0;let zi=ai(wi,Ci);if(fi)for(;Ni+zi.length>fi;){const Si=Mi.shift();if(Si&&Ci[Si])delete Ci[Si],zi=ai(wi,Ci);else return!1}return zi}function pi(wi,Ci,mi){switch($.propertiesTypes[Ci]){case"byte":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([+mi]));break}case"int8":{wi.write(V.from([$.properties[Ci]])),wi.write(V.from([mi]));break}case"binary":{wi.write(V.from([$.properties[Ci]])),li(wi,mi);break}case"int16":{wi.write(V.from([$.properties[Ci]])),he(wi,mi);break}case"int32":{wi.write(V.from([$.properties[Ci]])),di(wi,mi);break}case"var":{wi.write(V.from([$.properties[Ci]])),ti(wi,mi);break}case"string":{wi.write(V.from([$.properties[Ci]])),ei(wi,mi);break}case"pair":{Object.getOwnPropertyNames(mi).forEach(Mi=>{const fi=mi[Mi];Array.isArray(fi)?fi.forEach(zi=>{wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),zi.toString())}):(wi.write(V.from([$.properties[Ci]])),Pt(wi,Mi.toString(),fi.toString()))});break}default:return wi.emit("error",new Error(`Invalid property ${Ci} value: ${mi}`)),!1}}function yi(wi,Ci,mi){ti(wi,mi);for(const Ni in Ci)if(Object.prototype.hasOwnProperty.call(Ci,Ni)&&Ci[Ni]!==null){const Mi=Ci[Ni];if(Array.isArray(Mi))for(let fi=0;fi<Mi.length;fi++)pi(wi,Ni,Mi[fi]);else pi(wi,Ni,Mi)}}function Ai(wi){return wi?wi instanceof V?wi.length:V.byteLength(wi):0}function hi(wi){return typeof wi=="string"||wi instanceof V}g.exports=ze}).call(this)}).call(this,r("buffer").Buffer)},{"./constants":38,"./numbers":41,buffer:17,debug:18,"process-nextick-args":49}],45:[function(r,g,k){var V=1e3,$=V*60,oe=$*60,re=oe*24,Ce=re*7,ie=re*365.25;g.exports=function(de,Ne){Ne=Ne||{};var he=typeof de;if(he==="string"&&de.length>0)return ae(de);if(he==="number"&&isFinite(de))return Ne.long?Ie(de):le(de);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(de))};function ae(de){if(de=String(de),!(de.length>100)){var Ne=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(de);if(Ne){var he=parseFloat(Ne[1]),pe=(Ne[2]||"ms").toLowerCase();switch(pe){case"years":case"year":case"yrs":case"yr":case"y":return he*ie;case"weeks":case"week":case"w":return he*Ce;case"days":case"day":case"d":return he*re;case"hours":case"hour":case"hrs":case"hr":case"h":return he*oe;case"minutes":case"minute":case"mins":case"min":case"m":return he*$;case"seconds":case"second":case"secs":case"sec":case"s":return he*V;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return he;default:return}}}}function le(de){var Ne=Math.abs(de);return Ne>=re?Math.round(de/re)+"d":Ne>=oe?Math.round(de/oe)+"h":Ne>=$?Math.round(de/$)+"m":Ne>=V?Math.round(de/V)+"s":de+"ms"}function Ie(de){var Ne=Math.abs(de);return Ne>=re?ue(de,Ne,re,"day"):Ne>=oe?ue(de,Ne,oe,"hour"):Ne>=$?ue(de,Ne,$,"minute"):Ne>=V?ue(de,Ne,V,"second"):de+" ms"}function ue(de,Ne,he,pe){var ze=Ne>=he*1.5;return Math.round(de/he)+" "+pe+(ze?"s":"")}},{}],46:[function(r,g,k){const V=r("./lib/number-allocator.js");g.exports.NumberAllocator=V},{"./lib/number-allocator.js":47}],47:[function(r,g,k){const V=r("js-sdsl").Set,$=r("debug")("number-allocator:trace"),oe=r("debug")("number-allocator:error");function re(ie,ae){this.low=ie,this.high=ae}re.prototype.equals=function(ie){return this.low===ie.low&&this.high===ie.high},re.prototype.compare=function(ie){return this.low<ie.low&&this.high<ie.low?-1:ie.low<this.low&&ie.high<this.low?1:0};function Ce(ie,ae){if(!(this instanceof Ce))return new Ce(ie,ae);this.min=ie,this.max=ae,this.ss=new V([],(le,Ie)=>le.compare(Ie)),$("Create"),this.clear()}Ce.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},Ce.prototype.alloc=function(){if(this.ss.size()===0)return $("alloc():empty"),null;const ie=this.ss.front(),ae=ie.low;return ae+1<=ie.high?++ie.low:this.ss.eraseElementByPos(0),$("alloc():"+ae),ae},Ce.prototype.use=function(ie){const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.equals(ae))return this.ss.eraseElementByValue(le),$("use():"+ie),!0;if(le.low>ie)return!1;if(le.low===ie)return++le.low,$("use():"+ie),!0;if(le.high===ie)return--le.high,$("use():"+ie),!0;const Ie=le.low;return le.low=ie+1,this.ss.insert(new re(Ie,ie-1)),$("use():"+ie),!0}return $("use():failed"),!1},Ce.prototype.free=function(ie){if(ie<this.min||ie>this.max){oe("free():"+ie+" is out of range");return}const ae=new re(ie,ie),le=this.ss.lowerBound(ae);if(le){if(le.low<=ie&&ie<=le.high){oe("free():"+ie+" has already been vacant");return}if(le===this.ss.front())ie+1===le.low?--le.low:this.ss.insert(ae);else{const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?ie+1===le.low?(this.ss.eraseElementByValue(Ie),le.low=Ie.low):Ie.high=ie:ie+1===le.low?le.low=ie:this.ss.insert(ae)}}else{if(le===this.ss.front()){this.ss.insert(ae);return}const Ie=this.ss.reverseLowerBound(ae);Ie.high+1===ie?Ie.high=ie:this.ss.insert(ae)}$("free():"+ie)},Ce.prototype.clear=function(){$("clear()"),this.ss.clear(),this.ss.insert(new re(this.min,this.max))},Ce.prototype.intervalCount=function(){return this.ss.size()},Ce.prototype.dump=function(){console.log("length:"+this.ss.size());for(const ie of this.ss)console.log(ie)},g.exports=Ce},{debug:18,"js-sdsl":36}],48:[function(r,g,k){var V=r("wrappy");g.exports=V($),g.exports.strict=V(oe),$.proto=$(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return $(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return oe(this)},configurable:!0})});function $(re){var Ce=function(){return Ce.called?Ce.value:(Ce.called=!0,Ce.value=re.apply(this,arguments))};return Ce.called=!1,Ce}function oe(re){var Ce=function(){if(Ce.called)throw new Error(Ce.onceError);return Ce.called=!0,Ce.value=re.apply(this,arguments)},ie=re.name||"Function wrapped with `once`";return Ce.onceError=ie+" shouldn't be called more than once",Ce.called=!1,Ce}},{wrappy:79}],49:[function(r,g,k){(function(V){(function(){typeof V>"u"||!V.version||V.version.indexOf("v0.")===0||V.version.indexOf("v1.")===0&&V.version.indexOf("v1.8.")!==0?g.exports={nextTick:$}:g.exports=V;function $(oe,re,Ce,ie){if(typeof oe!="function")throw new TypeError('"callback" argument must be a function');var ae=arguments.length,le,Ie;switch(ae){case 0:case 1:return V.nextTick(oe);case 2:return V.nextTick(function(){oe.call(null,re)});case 3:return V.nextTick(function(){oe.call(null,re,Ce)});case 4:return V.nextTick(function(){oe.call(null,re,Ce,ie)});default:for(le=new Array(ae-1),Ie=0;Ie<le.length;)le[Ie++]=arguments[Ie];return V.nextTick(function(){oe.apply(null,le)})}}}).call(this)}).call(this,r("_process"))},{_process:50}],50:[function(r,g,k){var V=g.exports={},$,oe;function re(){throw new Error("setTimeout has not been defined")}function Ce(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?$=setTimeout:$=re}catch{$=re}try{typeof clearTimeout=="function"?oe=clearTimeout:oe=Ce}catch{oe=Ce}})();function ie(Fe){if($===setTimeout)return setTimeout(Fe,0);if(($===re||!$)&&setTimeout)return $=setTimeout,setTimeout(Fe,0);try{return $(Fe,0)}catch{try{return $.call(null,Fe,0)}catch{return $.call(this,Fe,0)}}}function ae(Fe){if(oe===clearTimeout)return clearTimeout(Fe);if((oe===Ce||!oe)&&clearTimeout)return oe=clearTimeout,clearTimeout(Fe);try{return oe(Fe)}catch{try{return oe.call(null,Fe)}catch{return oe.call(this,Fe)}}}var le=[],Ie=!1,ue,de=-1;function Ne(){!Ie||!ue||(Ie=!1,ue.length?le=ue.concat(le):de=-1,le.length&&he())}function he(){if(!Ie){var Fe=ie(Ne);Ie=!0;for(var xe=le.length;xe;){for(ue=le,le=[];++de<xe;)ue&&ue[de].run();de=-1,xe=le.length}ue=null,Ie=!1,ae(Fe)}}V.nextTick=function(Fe){var xe=new Array(arguments.length-1);if(arguments.length>1)for(var _e=1;_e<arguments.length;_e++)xe[_e-1]=arguments[_e];le.push(new pe(Fe,xe)),le.length===1&&!Ie&&ie(he)};function pe(Fe,xe){this.fun=Fe,this.array=xe}pe.prototype.run=function(){this.fun.apply(null,this.array)},V.title="browser",V.browser=!0,V.env={},V.argv=[],V.version="",V.versions={};function ze(){}V.on=ze,V.addListener=ze,V.once=ze,V.off=ze,V.removeListener=ze,V.removeAllListeners=ze,V.emit=ze,V.prependListener=ze,V.prependOnceListener=ze,V.listeners=function(Fe){return[]},V.binding=function(Fe){throw new Error("process.binding is not supported")},V.cwd=function(){return"/"},V.chdir=function(Fe){throw new Error("process.chdir is not supported")},V.umask=function(){return 0}},{}],51:[function(r,g,k){(function(V){(function(){(function($){var oe=typeof k=="object"&&k&&!k.nodeType&&k,re=typeof g=="object"&&g&&!g.nodeType&&g,Ce=typeof V=="object"&&V;(Ce.global===Ce||Ce.window===Ce||Ce.self===Ce)&&($=Ce);var ie,ae=2147483647,le=36,Ie=1,ue=26,de=38,Ne=700,he=72,pe=128,ze="-",Fe=/^xn--/,xe=/[^\x20-\x7E]/,_e=/[\x2E\u3002\uFF0E\uFF61]/g,Dt={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},$e=le-Ie,Ue=Math.floor,Ve=String.fromCharCode,Oe;function At(ai){throw new RangeError(Dt[ai])}function qe(ai,ci){for(var pi=ai.length,yi=[];pi--;)yi[pi]=ci(ai[pi]);return yi}function Lt(ai,ci){var pi=ai.split("@"),yi="";pi.length>1&&(yi=pi[0]+"@",ai=pi[1]),ai=ai.replace(_e,".");var Ai=ai.split("."),hi=qe(Ai,ci).join(".");return yi+hi}function kt(ai){for(var ci=[],pi=0,yi=ai.length,Ai,hi;pi<yi;)Ai=ai.charCodeAt(pi++),Ai>=55296&&Ai<=56319&&pi<yi?(hi=ai.charCodeAt(pi++),(hi&64512)==56320?ci.push(((Ai&1023)<<10)+(hi&1023)+65536):(ci.push(Ai),pi--)):ci.push(Ai);return ci}function jt(ai){return qe(ai,function(ci){var pi="";return ci>65535&&(ci-=65536,pi+=Ve(ci>>>10&1023|55296),ci=56320|ci&1023),pi+=Ve(ci),pi}).join("")}function ti(ai){return ai-48<10?ai-22:ai-65<26?ai-65:ai-97<26?ai-97:le}function ei(ai,ci){return ai+22+75*(ai<26)-((ci!=0)<<5)}function Pt(ai,ci,pi){var yi=0;for(ai=pi?Ue(ai/Ne):ai>>1,ai+=Ue(ai/ci);ai>$e*ue>>1;yi+=le)ai=Ue(ai/$e);return Ue(yi+($e+1)*ai/(ai+de))}function ni(ai){var ci=[],pi=ai.length,yi,Ai=0,hi=pe,wi=he,Ci,mi,Ni,Mi,fi,zi,Si,si,Ii;for(Ci=ai.lastIndexOf(ze),Ci<0&&(Ci=0),mi=0;mi<Ci;++mi)ai.charCodeAt(mi)>=128&&At("not-basic"),ci.push(ai.charCodeAt(mi));for(Ni=Ci>0?Ci+1:0;Ni<pi;){for(Mi=Ai,fi=1,zi=le;Ni>=pi&&At("invalid-input"),Si=ti(ai.charCodeAt(Ni++)),(Si>=le||Si>Ue((ae-Ai)/fi))&&At("overflow"),Ai+=Si*fi,si=zi<=wi?Ie:zi>=wi+ue?ue:zi-wi,!(Si<si);zi+=le)Ii=le-si,fi>Ue(ae/Ii)&&At("overflow"),fi*=Ii;yi=ci.length+1,wi=Pt(Ai-Mi,yi,Mi==0),Ue(Ai/yi)>ae-hi&&At("overflow"),hi+=Ue(Ai/yi),Ai%=yi,ci.splice(Ai++,0,hi)}return jt(ci)}function gi(ai){var ci,pi,yi,Ai,hi,wi,Ci,mi,Ni,Mi,fi,zi=[],Si,si,Ii,oi;for(ai=kt(ai),Si=ai.length,ci=pe,pi=0,hi=he,wi=0;wi<Si;++wi)fi=ai[wi],fi<128&&zi.push(Ve(fi));for(yi=Ai=zi.length,Ai&&zi.push(ze);yi<Si;){for(Ci=ae,wi=0;wi<Si;++wi)fi=ai[wi],fi>=ci&&fi<Ci&&(Ci=fi);for(si=yi+1,Ci-ci>Ue((ae-pi)/si)&&At("overflow"),pi+=(Ci-ci)*si,ci=Ci,wi=0;wi<Si;++wi)if(fi=ai[wi],fi<ci&&++pi>ae&&At("overflow"),fi==ci){for(mi=pi,Ni=le;Mi=Ni<=hi?Ie:Ni>=hi+ue?ue:Ni-hi,!(mi<Mi);Ni+=le)oi=mi-Mi,Ii=le-Mi,zi.push(Ve(ei(Mi+oi%Ii,0))),mi=Ue(oi/Ii);zi.push(Ve(ei(mi,0))),hi=Pt(pi,si,yi==Ai),pi=0,++yi}++pi,++ci}return zi.join("")}function di(ai){return Lt(ai,function(ci){return Fe.test(ci)?ni(ci.slice(4).toLowerCase()):ci})}function li(ai){return Lt(ai,function(ci){return xe.test(ci)?"xn--"+gi(ci):ci})}if(ie={version:"1.4.1",ucs2:{decode:kt,encode:jt},decode:ni,encode:gi,toASCII:li,toUnicode:di},oe&&re)if(g.exports==oe)re.exports=ie;else for(Oe in ie)ie.hasOwnProperty(Oe)&&(oe[Oe]=ie[Oe]);else $.punycode=ie})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],52:[function(r,g,k){function V(oe,re){return Object.prototype.hasOwnProperty.call(oe,re)}g.exports=function(oe,re,Ce,ie){re=re||"&",Ce=Ce||"=";var ae={};if(typeof oe!="string"||oe.length===0)return ae;var le=/\+/g;oe=oe.split(re);var Ie=1e3;ie&&typeof ie.maxKeys=="number"&&(Ie=ie.maxKeys);var ue=oe.length;Ie>0&&ue>Ie&&(ue=Ie);for(var de=0;de<ue;++de){var Ne=oe[de].replace(le,"%20"),he=Ne.indexOf(Ce),pe,ze,Fe,xe;he>=0?(pe=Ne.substr(0,he),ze=Ne.substr(he+1)):(pe=Ne,ze=""),Fe=decodeURIComponent(pe),xe=decodeURIComponent(ze),V(ae,Fe)?$(ae[Fe])?ae[Fe].push(xe):ae[Fe]=[ae[Fe],xe]:ae[Fe]=xe}return ae};var $=Array.isArray||function(oe){return Object.prototype.toString.call(oe)==="[object Array]"}},{}],53:[function(r,g,k){var V=function(Ce){switch(typeof Ce){case"string":return Ce;case"boolean":return Ce?"true":"false";case"number":return isFinite(Ce)?Ce:"";default:return""}};g.exports=function(Ce,ie,ae,le){return ie=ie||"&",ae=ae||"=",Ce===null&&(Ce=void 0),typeof Ce=="object"?oe(re(Ce),function(Ie){var ue=encodeURIComponent(V(Ie))+ae;return $(Ce[Ie])?oe(Ce[Ie],function(de){return ue+encodeURIComponent(V(de))}).join(ie):ue+encodeURIComponent(V(Ce[Ie]))}).join(ie):le?encodeURIComponent(V(le))+ae+encodeURIComponent(V(Ce)):""};var $=Array.isArray||function(Ce){return Object.prototype.toString.call(Ce)==="[object Array]"};function oe(Ce,ie){if(Ce.map)return Ce.map(ie);for(var ae=[],le=0;le<Ce.length;le++)ae.push(ie(Ce[le],le));return ae}var re=Object.keys||function(Ce){var ie=[];for(var ae in Ce)Object.prototype.hasOwnProperty.call(Ce,ae)&&ie.push(ae);return ie}},{}],54:[function(r,g,k){k.decode=k.parse=r("./decode"),k.encode=k.stringify=r("./encode")},{"./decode":52,"./encode":53}],55:[function(r,g,k){function V(le,Ie){le.prototype=Object.create(Ie.prototype),le.prototype.constructor=le,le.__proto__=Ie}var $={};function oe(le,Ie,ue){ue||(ue=Error);function de(he,pe,ze){return typeof Ie=="string"?Ie:Ie(he,pe,ze)}var Ne=function(he){V(pe,he);function pe(ze,Fe,xe){return he.call(this,de(ze,Fe,xe))||this}return pe}(ue);Ne.prototype.name=ue.name,Ne.prototype.code=le,$[le]=Ne}function re(le,Ie){if(Array.isArray(le)){var ue=le.length;return le=le.map(function(de){return String(de)}),ue>2?"one of ".concat(Ie," ").concat(le.slice(0,ue-1).join(", "),", or ")+le[ue-1]:ue===2?"one of ".concat(Ie," ").concat(le[0]," or ").concat(le[1]):"of ".concat(Ie," ").concat(le[0])}else return"of ".concat(Ie," ").concat(String(le))}function Ce(le,Ie,ue){return le.substr(!ue||ue<0?0:+ue,Ie.length)===Ie}function ie(le,Ie,ue){return(ue===void 0||ue>le.length)&&(ue=le.length),le.substring(ue-Ie.length,ue)===Ie}function ae(le,Ie,ue){return typeof ue!="number"&&(ue=0),ue+Ie.length>le.length?!1:le.indexOf(Ie,ue)!==-1}oe("ERR_INVALID_OPT_VALUE",function(le,Ie){return'The value "'+Ie+'" is invalid for option "'+le+'"'},TypeError),oe("ERR_INVALID_ARG_TYPE",function(le,Ie,ue){var de;typeof Ie=="string"&&Ce(Ie,"not ")?(de="must not be",Ie=Ie.replace(/^not /,"")):de="must be";var Ne;if(ie(le," argument"))Ne="The ".concat(le," ").concat(de," ").concat(re(Ie,"type"));else{var he=ae(le,".")?"property":"argument";Ne='The "'.concat(le,'" ').concat(he," ").concat(de," ").concat(re(Ie,"type"))}return Ne+=". Received type ".concat(typeof ue),Ne},TypeError),oe("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),oe("ERR_METHOD_NOT_IMPLEMENTED",function(le){return"The "+le+" method is not implemented"}),oe("ERR_STREAM_PREMATURE_CLOSE","Premature close"),oe("ERR_STREAM_DESTROYED",function(le){return"Cannot call "+le+" after a stream was destroyed"}),oe("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),oe("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),oe("ERR_STREAM_WRITE_AFTER_END","write after end"),oe("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),oe("ERR_UNKNOWN_ENCODING",function(le){return"Unknown encoding: "+le},TypeError),oe("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),g.exports.codes=$},{}],56:[function(r,g,k){(function(V){(function(){var $=Object.keys||function(de){var Ne=[];for(var he in de)Ne.push(he);return Ne};g.exports=le;var oe=r("./_stream_readable"),re=r("./_stream_writable");r("inherits")(le,oe);for(var Ce=$(re.prototype),ie=0;ie<Ce.length;ie++){var ae=Ce[ie];le.prototype[ae]||(le.prototype[ae]=re.prototype[ae])}function le(de){if(!(this instanceof le))return new le(de);oe.call(this,de),re.call(this,de),this.allowHalfOpen=!0,de&&(de.readable===!1&&(this.readable=!1),de.writable===!1&&(this.writable=!1),de.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",Ie)))}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Ie(){this._writableState.ended||V.nextTick(ue,this)}function ue(de){de.end()}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(Ne){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=Ne,this._writableState.destroyed=Ne)}})}).call(this)}).call(this,r("_process"))},{"./_stream_readable":58,"./_stream_writable":60,_process:50,inherits:24}],57:[function(r,g,k){g.exports=$;var V=r("./_stream_transform");r("inherits")($,V);function $(oe){if(!(this instanceof $))return new $(oe);V.call(this,oe)}$.prototype._transform=function(oe,re,Ce){Ce(null,oe)}},{"./_stream_transform":59,inherits:24}],58:[function(r,g,k){(function(V,$){(function(){g.exports=jt;var oe;jt.ReadableState=kt,r("events").EventEmitter;var re=function(Ii,oi){return Ii.listeners(oi).length},Ce=r("./internal/streams/stream"),ie=r("buffer").Buffer,ae=$.Uint8Array||function(){};function le(si){return ie.from(si)}function Ie(si){return ie.isBuffer(si)||si instanceof ae}var ue=r("util"),de;ue&&ue.debuglog?de=ue.debuglog("stream"):de=function(){};var Ne=r("./internal/streams/buffer_list"),he=r("./internal/streams/destroy"),pe=r("./internal/streams/state"),ze=pe.getHighWaterMark,Fe=r("../errors").codes,xe=Fe.ERR_INVALID_ARG_TYPE,_e=Fe.ERR_STREAM_PUSH_AFTER_EOF,Dt=Fe.ERR_METHOD_NOT_IMPLEMENTED,$e=Fe.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Ue,Ve,Oe;r("inherits")(jt,Ce);var At=he.errorOrDestroy,qe=["error","close","destroy","pause","resume"];function Lt(si,Ii,oi){if(typeof si.prependListener=="function")return si.prependListener(Ii,oi);!si._events||!si._events[Ii]?si.on(Ii,oi):Array.isArray(si._events[Ii])?si._events[Ii].unshift(oi):si._events[Ii]=[oi,si._events[Ii]]}function kt(si,Ii,oi){oe=oe||r("./_stream_duplex"),si=si||{},typeof oi!="boolean"&&(oi=Ii instanceof oe),this.objectMode=!!si.objectMode,oi&&(this.objectMode=this.objectMode||!!si.readableObjectMode),this.highWaterMark=ze(this,si,"readableHighWaterMark",oi),this.buffer=new Ne,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=si.emitClose!==!1,this.autoDestroy=!!si.autoDestroy,this.destroyed=!1,this.defaultEncoding=si.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,si.encoding&&(Ue||(Ue=r("string_decoder/").StringDecoder),this.decoder=new Ue(si.encoding),this.encoding=si.encoding)}function jt(si){if(oe=oe||r("./_stream_duplex"),!(this instanceof jt))return new jt(si);var Ii=this instanceof oe;this._readableState=new kt(si,this,Ii),this.readable=!0,si&&(typeof si.read=="function"&&(this._read=si.read),typeof si.destroy=="function"&&(this._destroy=si.destroy)),Ce.call(this)}Object.defineProperty(jt.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(Ii){this._readableState&&(this._readableState.destroyed=Ii)}}),jt.prototype.destroy=he.destroy,jt.prototype._undestroy=he.undestroy,jt.prototype._destroy=function(si,Ii){Ii(si)},jt.prototype.push=function(si,Ii){var oi=this._readableState,Et;return oi.objectMode?Et=!0:typeof si=="string"&&(Ii=Ii||oi.defaultEncoding,Ii!==oi.encoding&&(si=ie.from(si,Ii),Ii=""),Et=!0),ti(this,si,Ii,!1,Et)},jt.prototype.unshift=function(si){return ti(this,si,null,!0,!1)};function ti(si,Ii,oi,Et,ii){de("readableAddChunk",Ii);var ri=si._readableState;if(Ii===null)ri.reading=!1,li(si,ri);else{var ui;if(ii||(ui=Pt(ri,Ii)),ui)At(si,ui);else if(ri.objectMode||Ii&&Ii.length>0)if(typeof Ii!="string"&&!ri.objectMode&&Object.getPrototypeOf(Ii)!==ie.prototype&&(Ii=le(Ii)),Et)ri.endEmitted?At(si,new $e):ei(si,ri,Ii,!0);else if(ri.ended)At(si,new _e);else{if(ri.destroyed)return!1;ri.reading=!1,ri.decoder&&!oi?(Ii=ri.decoder.write(Ii),ri.objectMode||Ii.length!==0?ei(si,ri,Ii,!1):pi(si,ri)):ei(si,ri,Ii,!1)}else Et||(ri.reading=!1,pi(si,ri))}return!ri.ended&&(ri.length<ri.highWaterMark||ri.length===0)}function ei(si,Ii,oi,Et){Ii.flowing&&Ii.length===0&&!Ii.sync?(Ii.awaitDrain=0,si.emit("data",oi)):(Ii.length+=Ii.objectMode?1:oi.length,Et?Ii.buffer.unshift(oi):Ii.buffer.push(oi),Ii.needReadable&&ai(si)),pi(si,Ii)}function Pt(si,Ii){var oi;return!Ie(Ii)&&typeof Ii!="string"&&Ii!==void 0&&!si.objectMode&&(oi=new xe("chunk",["string","Buffer","Uint8Array"],Ii)),oi}jt.prototype.isPaused=function(){return this._readableState.flowing===!1},jt.prototype.setEncoding=function(si){Ue||(Ue=r("string_decoder/").StringDecoder);var Ii=new Ue(si);this._readableState.decoder=Ii,this._readableState.encoding=this._readableState.decoder.encoding;for(var oi=this._readableState.buffer.head,Et="";oi!==null;)Et+=Ii.write(oi.data),oi=oi.next;return this._readableState.buffer.clear(),Et!==""&&this._readableState.buffer.push(Et),this._readableState.length=Et.length,this};var ni=1073741824;function gi(si){return si>=ni?si=ni:(si--,si|=si>>>1,si|=si>>>2,si|=si>>>4,si|=si>>>8,si|=si>>>16,si++),si}function di(si,Ii){return si<=0||Ii.length===0&&Ii.ended?0:Ii.objectMode?1:si!==si?Ii.flowing&&Ii.length?Ii.buffer.head.data.length:Ii.length:(si>Ii.highWaterMark&&(Ii.highWaterMark=gi(si)),si<=Ii.length?si:Ii.ended?Ii.length:(Ii.needReadable=!0,0))}jt.prototype.read=function(si){de("read",si),si=parseInt(si,10);var Ii=this._readableState,oi=si;if(si!==0&&(Ii.emittedReadable=!1),si===0&&Ii.needReadable&&((Ii.highWaterMark!==0?Ii.length>=Ii.highWaterMark:Ii.length>0)||Ii.ended))return de("read: emitReadable",Ii.length,Ii.ended),Ii.length===0&&Ii.ended?fi(this):ai(this),null;if(si=di(si,Ii),si===0&&Ii.ended)return Ii.length===0&&fi(this),null;var Et=Ii.needReadable;de("need readable",Et),(Ii.length===0||Ii.length-si<Ii.highWaterMark)&&(Et=!0,de("length less than watermark",Et)),Ii.ended||Ii.reading?(Et=!1,de("reading or ended",Et)):Et&&(de("do read"),Ii.reading=!0,Ii.sync=!0,Ii.length===0&&(Ii.needReadable=!0),this._read(Ii.highWaterMark),Ii.sync=!1,Ii.reading||(si=di(oi,Ii)));var ii;return si>0?ii=Mi(si,Ii):ii=null,ii===null?(Ii.needReadable=Ii.length<=Ii.highWaterMark,si=0):(Ii.length-=si,Ii.awaitDrain=0),Ii.length===0&&(Ii.ended||(Ii.needReadable=!0),oi!==si&&Ii.ended&&fi(this)),ii!==null&&this.emit("data",ii),ii};function li(si,Ii){if(de("onEofChunk"),!Ii.ended){if(Ii.decoder){var oi=Ii.decoder.end();oi&&oi.length&&(Ii.buffer.push(oi),Ii.length+=Ii.objectMode?1:oi.length)}Ii.ended=!0,Ii.sync?ai(si):(Ii.needReadable=!1,Ii.emittedReadable||(Ii.emittedReadable=!0,ci(si)))}}function ai(si){var Ii=si._readableState;de("emitReadable",Ii.needReadable,Ii.emittedReadable),Ii.needReadable=!1,Ii.emittedReadable||(de("emitReadable",Ii.flowing),Ii.emittedReadable=!0,V.nextTick(ci,si))}function ci(si){var Ii=si._readableState;de("emitReadable_",Ii.destroyed,Ii.length,Ii.ended),!Ii.destroyed&&(Ii.length||Ii.ended)&&(si.emit("readable"),Ii.emittedReadable=!1),Ii.needReadable=!Ii.flowing&&!Ii.ended&&Ii.length<=Ii.highWaterMark,Ni(si)}function pi(si,Ii){Ii.readingMore||(Ii.readingMore=!0,V.nextTick(yi,si,Ii))}function yi(si,Ii){for(;!Ii.reading&&!Ii.ended&&(Ii.length<Ii.highWaterMark||Ii.flowing&&Ii.length===0);){var oi=Ii.length;if(de("maybeReadMore read 0"),si.read(0),oi===Ii.length)break}Ii.readingMore=!1}jt.prototype._read=function(si){At(this,new Dt("_read()"))},jt.prototype.pipe=function(si,Ii){var oi=this,Et=this._readableState;switch(Et.pipesCount){case 0:Et.pipes=si;break;case 1:Et.pipes=[Et.pipes,si];break;default:Et.pipes.push(si);break}Et.pipesCount+=1,de("pipe count=%d opts=%j",Et.pipesCount,Ii);var ii=(!Ii||Ii.end!==!1)&&si!==V.stdout&&si!==V.stderr,ri=ii?vi:Wi;Et.endEmitted?V.nextTick(ri):oi.once("end",ri),si.on("unpipe",ui);function ui(ki,Ri){de("onunpipe"),ki===oi&&Ri&&Ri.hasUnpiped===!1&&(Ri.hasUnpiped=!0,Gi())}function vi(){de("onend"),si.end()}var bi=Ai(oi);si.on("drain",bi);var Zi=!1;function Gi(){de("cleanup"),si.removeListener("close",xi),si.removeListener("finish",Li),si.removeListener("drain",bi),si.removeListener("error",Oi),si.removeListener("unpipe",ui),oi.removeListener("end",vi),oi.removeListener("end",Wi),oi.removeListener("data",Yi),Zi=!0,Et.awaitDrain&&(!si._writableState||si._writableState.needDrain)&&bi()}oi.on("data",Yi);function Yi(ki){de("ondata");var Ri=si.write(ki);de("dest.write",Ri),Ri===!1&&((Et.pipesCount===1&&Et.pipes===si||Et.pipesCount>1&&Si(Et.pipes,si)!==-1)&&!Zi&&(de("false write response, pause",Et.awaitDrain),Et.awaitDrain++),oi.pause())}function Oi(ki){de("onerror",ki),Wi(),si.removeListener("error",Oi),re(si,"error")===0&&At(si,ki)}Lt(si,"error",Oi);function xi(){si.removeListener("finish",Li),Wi()}si.once("close",xi);function Li(){de("onfinish"),si.removeListener("close",xi),Wi()}si.once("finish",Li);function Wi(){de("unpipe"),oi.unpipe(si)}return si.emit("pipe",oi),Et.flowing||(de("pipe resume"),oi.resume()),si};function Ai(si){return function(){var oi=si._readableState;de("pipeOnDrain",oi.awaitDrain),oi.awaitDrain&&oi.awaitDrain--,oi.awaitDrain===0&&re(si,"data")&&(oi.flowing=!0,Ni(si))}}jt.prototype.unpipe=function(si){var Ii=this._readableState,oi={hasUnpiped:!1};if(Ii.pipesCount===0)return this;if(Ii.pipesCount===1)return si&&si!==Ii.pipes?this:(si||(si=Ii.pipes),Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1,si&&si.emit("unpipe",this,oi),this);if(!si){var Et=Ii.pipes,ii=Ii.pipesCount;Ii.pipes=null,Ii.pipesCount=0,Ii.flowing=!1;for(var ri=0;ri<ii;ri++)Et[ri].emit("unpipe",this,{hasUnpiped:!1});return this}var ui=Si(Ii.pipes,si);return ui===-1?this:(Ii.pipes.splice(ui,1),Ii.pipesCount-=1,Ii.pipesCount===1&&(Ii.pipes=Ii.pipes[0]),si.emit("unpipe",this,oi),this)},jt.prototype.on=function(si,Ii){var oi=Ce.prototype.on.call(this,si,Ii),Et=this._readableState;return si==="data"?(Et.readableListening=this.listenerCount("readable")>0,Et.flowing!==!1&&this.resume()):si==="readable"&&!Et.endEmitted&&!Et.readableListening&&(Et.readableListening=Et.needReadable=!0,Et.flowing=!1,Et.emittedReadable=!1,de("on readable",Et.length,Et.reading),Et.length?ai(this):Et.reading||V.nextTick(wi,this)),oi},jt.prototype.addListener=jt.prototype.on,jt.prototype.removeListener=function(si,Ii){var oi=Ce.prototype.removeListener.call(this,si,Ii);return si==="readable"&&V.nextTick(hi,this),oi},jt.prototype.removeAllListeners=function(si){var Ii=Ce.prototype.removeAllListeners.apply(this,arguments);return(si==="readable"||si===void 0)&&V.nextTick(hi,this),Ii};function hi(si){var Ii=si._readableState;Ii.readableListening=si.listenerCount("readable")>0,Ii.resumeScheduled&&!Ii.paused?Ii.flowing=!0:si.listenerCount("data")>0&&si.resume()}function wi(si){de("readable nexttick read 0"),si.read(0)}jt.prototype.resume=function(){var si=this._readableState;return si.flowing||(de("resume"),si.flowing=!si.readableListening,Ci(this,si)),si.paused=!1,this};function Ci(si,Ii){Ii.resumeScheduled||(Ii.resumeScheduled=!0,V.nextTick(mi,si,Ii))}function mi(si,Ii){de("resume",Ii.reading),Ii.reading||si.read(0),Ii.resumeScheduled=!1,si.emit("resume"),Ni(si),Ii.flowing&&!Ii.reading&&si.read(0)}jt.prototype.pause=function(){return de("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(de("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(si){var Ii=si._readableState;for(de("flow",Ii.flowing);Ii.flowing&&si.read()!==null;);}jt.prototype.wrap=function(si){var Ii=this,oi=this._readableState,Et=!1;si.on("end",function(){if(de("wrapped end"),oi.decoder&&!oi.ended){var ui=oi.decoder.end();ui&&ui.length&&Ii.push(ui)}Ii.push(null)}),si.on("data",function(ui){if(de("wrapped data"),oi.decoder&&(ui=oi.decoder.write(ui)),!(oi.objectMode&&ui==null)&&!(!oi.objectMode&&(!ui||!ui.length))){var vi=Ii.push(ui);vi||(Et=!0,si.pause())}});for(var ii in si)this[ii]===void 0&&typeof si[ii]=="function"&&(this[ii]=function(vi){return function(){return si[vi].apply(si,arguments)}}(ii));for(var ri=0;ri<qe.length;ri++)si.on(qe[ri],this.emit.bind(this,qe[ri]));return this._read=function(ui){de("wrapped _read",ui),Et&&(Et=!1,si.resume())},this},typeof Symbol=="function"&&(jt.prototype[Symbol.asyncIterator]=function(){return Ve===void 0&&(Ve=r("./internal/streams/async_iterator")),Ve(this)}),Object.defineProperty(jt.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(jt.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(jt.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ii){this._readableState&&(this._readableState.flowing=Ii)}}),jt._fromList=Mi,Object.defineProperty(jt.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Mi(si,Ii){if(Ii.length===0)return null;var oi;return Ii.objectMode?oi=Ii.buffer.shift():!si||si>=Ii.length?(Ii.decoder?oi=Ii.buffer.join(""):Ii.buffer.length===1?oi=Ii.buffer.first():oi=Ii.buffer.concat(Ii.length),Ii.buffer.clear()):oi=Ii.buffer.consume(si,Ii.decoder),oi}function fi(si){var Ii=si._readableState;de("endReadable",Ii.endEmitted),Ii.endEmitted||(Ii.ended=!0,V.nextTick(zi,Ii,si))}function zi(si,Ii){if(de("endReadableNT",si.endEmitted,si.length),!si.endEmitted&&si.length===0&&(si.endEmitted=!0,Ii.readable=!1,Ii.emit("end"),si.autoDestroy)){var oi=Ii._writableState;(!oi||oi.autoDestroy&&oi.finished)&&Ii.destroy()}}typeof Symbol=="function"&&(jt.from=function(si,Ii){return Oe===void 0&&(Oe=r("./internal/streams/from")),Oe(jt,si,Ii)});function Si(si,Ii){for(var oi=0,Et=si.length;oi<Et;oi++)if(si[oi]===Ii)return oi;return-1}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/async_iterator":61,"./internal/streams/buffer_list":62,"./internal/streams/destroy":63,"./internal/streams/from":65,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,events:22,inherits:24,"string_decoder/":75,util:16}],59:[function(r,g,k){g.exports=le;var V=r("../errors").codes,$=V.ERR_METHOD_NOT_IMPLEMENTED,oe=V.ERR_MULTIPLE_CALLBACK,re=V.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ce=V.ERR_TRANSFORM_WITH_LENGTH_0,ie=r("./_stream_duplex");r("inherits")(le,ie);function ae(de,Ne){var he=this._transformState;he.transforming=!1;var pe=he.writecb;if(pe===null)return this.emit("error",new oe);he.writechunk=null,he.writecb=null,Ne!=null&&this.push(Ne),pe(de);var ze=this._readableState;ze.reading=!1,(ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}function le(de){if(!(this instanceof le))return new le(de);ie.call(this,de),this._transformState={afterTransform:ae.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,de&&(typeof de.transform=="function"&&(this._transform=de.transform),typeof de.flush=="function"&&(this._flush=de.flush)),this.on("prefinish",Ie)}function Ie(){var de=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(Ne,he){ue(de,Ne,he)}):ue(this,null,null)}le.prototype.push=function(de,Ne){return this._transformState.needTransform=!1,ie.prototype.push.call(this,de,Ne)},le.prototype._transform=function(de,Ne,he){he(new $("_transform()"))},le.prototype._write=function(de,Ne,he){var pe=this._transformState;if(pe.writecb=he,pe.writechunk=de,pe.writeencoding=Ne,!pe.transforming){var ze=this._readableState;(pe.needTransform||ze.needReadable||ze.length<ze.highWaterMark)&&this._read(ze.highWaterMark)}},le.prototype._read=function(de){var Ne=this._transformState;Ne.writechunk!==null&&!Ne.transforming?(Ne.transforming=!0,this._transform(Ne.writechunk,Ne.writeencoding,Ne.afterTransform)):Ne.needTransform=!0},le.prototype._destroy=function(de,Ne){ie.prototype._destroy.call(this,de,function(he){Ne(he)})};function ue(de,Ne,he){if(Ne)return de.emit("error",Ne);if(he!=null&&de.push(he),de._writableState.length)throw new Ce;if(de._transformState.transforming)throw new re;return de.push(null)}},{"../errors":55,"./_stream_duplex":56,inherits:24}],60:[function(r,g,k){(function(V,$){(function(){g.exports=kt;function oe(Ni){var Mi=this;this.next=null,this.entry=null,this.finish=function(){mi(Mi,Ni)}}var re;kt.WritableState=qe;var Ce={deprecate:r("util-deprecate")},ie=r("./internal/streams/stream"),ae=r("buffer").Buffer,le=$.Uint8Array||function(){};function Ie(Ni){return ae.from(Ni)}function ue(Ni){return ae.isBuffer(Ni)||Ni instanceof le}var de=r("./internal/streams/destroy"),Ne=r("./internal/streams/state"),he=Ne.getHighWaterMark,pe=r("../errors").codes,ze=pe.ERR_INVALID_ARG_TYPE,Fe=pe.ERR_METHOD_NOT_IMPLEMENTED,xe=pe.ERR_MULTIPLE_CALLBACK,_e=pe.ERR_STREAM_CANNOT_PIPE,Dt=pe.ERR_STREAM_DESTROYED,$e=pe.ERR_STREAM_NULL_VALUES,Ue=pe.ERR_STREAM_WRITE_AFTER_END,Ve=pe.ERR_UNKNOWN_ENCODING,Oe=de.errorOrDestroy;r("inherits")(kt,ie);function At(){}function qe(Ni,Mi,fi){re=re||r("./_stream_duplex"),Ni=Ni||{},typeof fi!="boolean"&&(fi=Mi instanceof re),this.objectMode=!!Ni.objectMode,fi&&(this.objectMode=this.objectMode||!!Ni.writableObjectMode),this.highWaterMark=he(this,Ni,"writableHighWaterMark",fi),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var zi=Ni.decodeStrings===!1;this.decodeStrings=!zi,this.defaultEncoding=Ni.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Si){li(Mi,Si)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=Ni.emitClose!==!1,this.autoDestroy=!!Ni.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new oe(this)}qe.prototype.getBuffer=function(){for(var Mi=this.bufferedRequest,fi=[];Mi;)fi.push(Mi),Mi=Mi.next;return fi},function(){try{Object.defineProperty(qe.prototype,"buffer",{get:Ce.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Lt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Lt=Function.prototype[Symbol.hasInstance],Object.defineProperty(kt,Symbol.hasInstance,{value:function(Mi){return Lt.call(this,Mi)?!0:this!==kt?!1:Mi&&Mi._writableState instanceof qe}})):Lt=function(Mi){return Mi instanceof this};function kt(Ni){re=re||r("./_stream_duplex");var Mi=this instanceof re;if(!Mi&&!Lt.call(kt,this))return new kt(Ni);this._writableState=new qe(Ni,this,Mi),this.writable=!0,Ni&&(typeof Ni.write=="function"&&(this._write=Ni.write),typeof Ni.writev=="function"&&(this._writev=Ni.writev),typeof Ni.destroy=="function"&&(this._destroy=Ni.destroy),typeof Ni.final=="function"&&(this._final=Ni.final)),ie.call(this)}kt.prototype.pipe=function(){Oe(this,new _e)};function jt(Ni,Mi){var fi=new Ue;Oe(Ni,fi),V.nextTick(Mi,fi)}function ti(Ni,Mi,fi,zi){var Si;return fi===null?Si=new $e:typeof fi!="string"&&!Mi.objectMode&&(Si=new ze("chunk",["string","Buffer"],fi)),Si?(Oe(Ni,Si),V.nextTick(zi,Si),!1):!0}kt.prototype.write=function(Ni,Mi,fi){var zi=this._writableState,Si=!1,si=!zi.objectMode&&ue(Ni);return si&&!ae.isBuffer(Ni)&&(Ni=Ie(Ni)),typeof Mi=="function"&&(fi=Mi,Mi=null),si?Mi="buffer":Mi||(Mi=zi.defaultEncoding),typeof fi!="function"&&(fi=At),zi.ending?jt(this,fi):(si||ti(this,zi,Ni,fi))&&(zi.pendingcb++,Si=Pt(this,zi,si,Ni,Mi,fi)),Si},kt.prototype.cork=function(){this._writableState.corked++},kt.prototype.uncork=function(){var Ni=this._writableState;Ni.corked&&(Ni.corked--,!Ni.writing&&!Ni.corked&&!Ni.bufferProcessing&&Ni.bufferedRequest&&pi(this,Ni))},kt.prototype.setDefaultEncoding=function(Mi){if(typeof Mi=="string"&&(Mi=Mi.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Mi+"").toLowerCase())>-1))throw new Ve(Mi);return this._writableState.defaultEncoding=Mi,this},Object.defineProperty(kt.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ei(Ni,Mi,fi){return!Ni.objectMode&&Ni.decodeStrings!==!1&&typeof Mi=="string"&&(Mi=ae.from(Mi,fi)),Mi}Object.defineProperty(kt.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Pt(Ni,Mi,fi,zi,Si,si){if(!fi){var Ii=ei(Mi,zi,Si);zi!==Ii&&(fi=!0,Si="buffer",zi=Ii)}var oi=Mi.objectMode?1:zi.length;Mi.length+=oi;var Et=Mi.length<Mi.highWaterMark;if(Et||(Mi.needDrain=!0),Mi.writing||Mi.corked){var ii=Mi.lastBufferedRequest;Mi.lastBufferedRequest={chunk:zi,encoding:Si,isBuf:fi,callback:si,next:null},ii?ii.next=Mi.lastBufferedRequest:Mi.bufferedRequest=Mi.lastBufferedRequest,Mi.bufferedRequestCount+=1}else ni(Ni,Mi,!1,oi,zi,Si,si);return Et}function ni(Ni,Mi,fi,zi,Si,si,Ii){Mi.writelen=zi,Mi.writecb=Ii,Mi.writing=!0,Mi.sync=!0,Mi.destroyed?Mi.onwrite(new Dt("write")):fi?Ni._writev(Si,Mi.onwrite):Ni._write(Si,si,Mi.onwrite),Mi.sync=!1}function gi(Ni,Mi,fi,zi,Si){--Mi.pendingcb,fi?(V.nextTick(Si,zi),V.nextTick(wi,Ni,Mi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi)):(Si(zi),Ni._writableState.errorEmitted=!0,Oe(Ni,zi),wi(Ni,Mi))}function di(Ni){Ni.writing=!1,Ni.writecb=null,Ni.length-=Ni.writelen,Ni.writelen=0}function li(Ni,Mi){var fi=Ni._writableState,zi=fi.sync,Si=fi.writecb;if(typeof Si!="function")throw new xe;if(di(fi),Mi)gi(Ni,fi,zi,Mi,Si);else{var si=yi(fi)||Ni.destroyed;!si&&!fi.corked&&!fi.bufferProcessing&&fi.bufferedRequest&&pi(Ni,fi),zi?V.nextTick(ai,Ni,fi,si,Si):ai(Ni,fi,si,Si)}}function ai(Ni,Mi,fi,zi){fi||ci(Ni,Mi),Mi.pendingcb--,zi(),wi(Ni,Mi)}function ci(Ni,Mi){Mi.length===0&&Mi.needDrain&&(Mi.needDrain=!1,Ni.emit("drain"))}function pi(Ni,Mi){Mi.bufferProcessing=!0;var fi=Mi.bufferedRequest;if(Ni._writev&&fi&&fi.next){var zi=Mi.bufferedRequestCount,Si=new Array(zi),si=Mi.corkedRequestsFree;si.entry=fi;for(var Ii=0,oi=!0;fi;)Si[Ii]=fi,fi.isBuf||(oi=!1),fi=fi.next,Ii+=1;Si.allBuffers=oi,ni(Ni,Mi,!0,Mi.length,Si,"",si.finish),Mi.pendingcb++,Mi.lastBufferedRequest=null,si.next?(Mi.corkedRequestsFree=si.next,si.next=null):Mi.corkedRequestsFree=new oe(Mi),Mi.bufferedRequestCount=0}else{for(;fi;){var Et=fi.chunk,ii=fi.encoding,ri=fi.callback,ui=Mi.objectMode?1:Et.length;if(ni(Ni,Mi,!1,ui,Et,ii,ri),fi=fi.next,Mi.bufferedRequestCount--,Mi.writing)break}fi===null&&(Mi.lastBufferedRequest=null)}Mi.bufferedRequest=fi,Mi.bufferProcessing=!1}kt.prototype._write=function(Ni,Mi,fi){fi(new Fe("_write()"))},kt.prototype._writev=null,kt.prototype.end=function(Ni,Mi,fi){var zi=this._writableState;return typeof Ni=="function"?(fi=Ni,Ni=null,Mi=null):typeof Mi=="function"&&(fi=Mi,Mi=null),Ni!=null&&this.write(Ni,Mi),zi.corked&&(zi.corked=1,this.uncork()),zi.ending||Ci(this,zi,fi),this},Object.defineProperty(kt.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function yi(Ni){return Ni.ending&&Ni.length===0&&Ni.bufferedRequest===null&&!Ni.finished&&!Ni.writing}function Ai(Ni,Mi){Ni._final(function(fi){Mi.pendingcb--,fi&&Oe(Ni,fi),Mi.prefinished=!0,Ni.emit("prefinish"),wi(Ni,Mi)})}function hi(Ni,Mi){!Mi.prefinished&&!Mi.finalCalled&&(typeof Ni._final=="function"&&!Mi.destroyed?(Mi.pendingcb++,Mi.finalCalled=!0,V.nextTick(Ai,Ni,Mi)):(Mi.prefinished=!0,Ni.emit("prefinish")))}function wi(Ni,Mi){var fi=yi(Mi);if(fi&&(hi(Ni,Mi),Mi.pendingcb===0&&(Mi.finished=!0,Ni.emit("finish"),Mi.autoDestroy))){var zi=Ni._readableState;(!zi||zi.autoDestroy&&zi.endEmitted)&&Ni.destroy()}return fi}function Ci(Ni,Mi,fi){Mi.ending=!0,wi(Ni,Mi),fi&&(Mi.finished?V.nextTick(fi):Ni.once("finish",fi)),Mi.ended=!0,Ni.writable=!1}function mi(Ni,Mi,fi){var zi=Ni.entry;for(Ni.entry=null;zi;){var Si=zi.callback;Mi.pendingcb--,Si(fi),zi=zi.next}Mi.corkedRequestsFree.next=Ni}Object.defineProperty(kt.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Mi){this._writableState&&(this._writableState.destroyed=Mi)}}),kt.prototype.destroy=de.destroy,kt.prototype._undestroy=de.undestroy,kt.prototype._destroy=function(Ni,Mi){Mi(Ni)}}).call(this)}).call(this,r("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":55,"./_stream_duplex":56,"./internal/streams/destroy":63,"./internal/streams/state":67,"./internal/streams/stream":68,_process:50,buffer:17,inherits:24,"util-deprecate":78}],61:[function(r,g,k){(function(V){(function(){var $;function oe(Dt,$e,Ue){return $e in Dt?Object.defineProperty(Dt,$e,{value:Ue,enumerable:!0,configurable:!0,writable:!0}):Dt[$e]=Ue,Dt}var re=r("./end-of-stream"),Ce=Symbol("lastResolve"),ie=Symbol("lastReject"),ae=Symbol("error"),le=Symbol("ended"),Ie=Symbol("lastPromise"),ue=Symbol("handlePromise"),de=Symbol("stream");function Ne(Dt,$e){return{value:Dt,done:$e}}function he(Dt){var $e=Dt[Ce];if($e!==null){var Ue=Dt[de].read();Ue!==null&&(Dt[Ie]=null,Dt[Ce]=null,Dt[ie]=null,$e(Ne(Ue,!1)))}}function pe(Dt){V.nextTick(he,Dt)}function ze(Dt,$e){return function(Ue,Ve){Dt.then(function(){if($e[le]){Ue(Ne(void 0,!0));return}$e[ue](Ue,Ve)},Ve)}}var Fe=Object.getPrototypeOf(function(){}),xe=Object.setPrototypeOf(($={get stream(){return this[de]},next:function(){var $e=this,Ue=this[ae];if(Ue!==null)return Promise.reject(Ue);if(this[le])return Promise.resolve(Ne(void 0,!0));if(this[de].destroyed)return new Promise(function(qe,Lt){V.nextTick(function(){$e[ae]?Lt($e[ae]):qe(Ne(void 0,!0))})});var Ve=this[Ie],Oe;if(Ve)Oe=new Promise(ze(Ve,this));else{var At=this[de].read();if(At!==null)return Promise.resolve(Ne(At,!1));Oe=new Promise(this[ue])}return this[Ie]=Oe,Oe}},oe($,Symbol.asyncIterator,function(){return this}),oe($,"return",function(){var $e=this;return new Promise(function(Ue,Ve){$e[de].destroy(null,function(Oe){if(Oe){Ve(Oe);return}Ue(Ne(void 0,!0))})})}),$),Fe),_e=function($e){var Ue,Ve=Object.create(xe,(Ue={},oe(Ue,de,{value:$e,writable:!0}),oe(Ue,Ce,{value:null,writable:!0}),oe(Ue,ie,{value:null,writable:!0}),oe(Ue,ae,{value:null,writable:!0}),oe(Ue,le,{value:$e._readableState.endEmitted,writable:!0}),oe(Ue,ue,{value:function(At,qe){var Lt=Ve[de].read();Lt?(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Ne(Lt,!1))):(Ve[Ce]=At,Ve[ie]=qe)},writable:!0}),Ue));return Ve[Ie]=null,re($e,function(Oe){if(Oe&&Oe.code!=="ERR_STREAM_PREMATURE_CLOSE"){var At=Ve[ie];At!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,At(Oe)),Ve[ae]=Oe;return}var qe=Ve[Ce];qe!==null&&(Ve[Ie]=null,Ve[Ce]=null,Ve[ie]=null,qe(Ne(void 0,!0))),Ve[le]=!0}),$e.on("readable",pe.bind(null,Ve)),Ve};g.exports=_e}).call(this)}).call(this,r("_process"))},{"./end-of-stream":64,_process:50}],62:[function(r,g,k){function V(he,pe){var ze=Object.keys(he);if(Object.getOwnPropertySymbols){var Fe=Object.getOwnPropertySymbols(he);pe&&(Fe=Fe.filter(function(xe){return Object.getOwnPropertyDescriptor(he,xe).enumerable})),ze.push.apply(ze,Fe)}return ze}function $(he){for(var pe=1;pe<arguments.length;pe++){var ze=arguments[pe]!=null?arguments[pe]:{};pe%2?V(Object(ze),!0).forEach(function(Fe){oe(he,Fe,ze[Fe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(he,Object.getOwnPropertyDescriptors(ze)):V(Object(ze)).forEach(function(Fe){Object.defineProperty(he,Fe,Object.getOwnPropertyDescriptor(ze,Fe))})}return he}function oe(he,pe,ze){return pe in he?Object.defineProperty(he,pe,{value:ze,enumerable:!0,configurable:!0,writable:!0}):he[pe]=ze,he}function re(he,pe){if(!(he instanceof pe))throw new TypeError("Cannot call a class as a function")}function Ce(he,pe){for(var ze=0;ze<pe.length;ze++){var Fe=pe[ze];Fe.enumerable=Fe.enumerable||!1,Fe.configurable=!0,"value"in Fe&&(Fe.writable=!0),Object.defineProperty(he,Fe.key,Fe)}}function ie(he,pe,ze){return pe&&Ce(he.prototype,pe),ze&&Ce(he,ze),he}var ae=r("buffer"),le=ae.Buffer,Ie=r("util"),ue=Ie.inspect,de=ue&&ue.custom||"inspect";function Ne(he,pe,ze){le.prototype.copy.call(he,pe,ze)}g.exports=function(){function he(){re(this,he),this.head=null,this.tail=null,this.length=0}return ie(he,[{key:"push",value:function(ze){var Fe={data:ze,next:null};this.length>0?this.tail.next=Fe:this.head=Fe,this.tail=Fe,++this.length}},{key:"unshift",value:function(ze){var Fe={data:ze,next:this.head};this.length===0&&(this.tail=Fe),this.head=Fe,++this.length}},{key:"shift",value:function(){if(this.length!==0){var ze=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,ze}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(ze){if(this.length===0)return"";for(var Fe=this.head,xe=""+Fe.data;Fe=Fe.next;)xe+=ze+Fe.data;return xe}},{key:"concat",value:function(ze){if(this.length===0)return le.alloc(0);for(var Fe=le.allocUnsafe(ze>>>0),xe=this.head,_e=0;xe;)Ne(xe.data,Fe,_e),_e+=xe.data.length,xe=xe.next;return Fe}},{key:"consume",value:function(ze,Fe){var xe;return ze<this.head.data.length?(xe=this.head.data.slice(0,ze),this.head.data=this.head.data.slice(ze)):ze===this.head.data.length?xe=this.shift():xe=Fe?this._getString(ze):this._getBuffer(ze),xe}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(ze){var Fe=this.head,xe=1,_e=Fe.data;for(ze-=_e.length;Fe=Fe.next;){var Dt=Fe.data,$e=ze>Dt.length?Dt.length:ze;if($e===Dt.length?_e+=Dt:_e+=Dt.slice(0,ze),ze-=$e,ze===0){$e===Dt.length?(++xe,Fe.next?this.head=Fe.next:this.head=this.tail=null):(this.head=Fe,Fe.data=Dt.slice($e));break}++xe}return this.length-=xe,_e}},{key:"_getBuffer",value:function(ze){var Fe=le.allocUnsafe(ze),xe=this.head,_e=1;for(xe.data.copy(Fe),ze-=xe.data.length;xe=xe.next;){var Dt=xe.data,$e=ze>Dt.length?Dt.length:ze;if(Dt.copy(Fe,Fe.length-ze,0,$e),ze-=$e,ze===0){$e===Dt.length?(++_e,xe.next?this.head=xe.next:this.head=this.tail=null):(this.head=xe,xe.data=Dt.slice($e));break}++_e}return this.length-=_e,Fe}},{key:de,value:function(ze,Fe){return ue(this,$({},Fe,{depth:0,customInspect:!1}))}}]),he}()},{buffer:17,util:16}],63:[function(r,g,k){(function(V){(function(){function $(le,Ie){var ue=this,de=this._readableState&&this._readableState.destroyed,Ne=this._writableState&&this._writableState.destroyed;return de||Ne?(Ie?Ie(le):le&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,V.nextTick(ie,this,le)):V.nextTick(ie,this,le)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(le||null,function(he){!Ie&&he?ue._writableState?ue._writableState.errorEmitted?V.nextTick(re,ue):(ue._writableState.errorEmitted=!0,V.nextTick(oe,ue,he)):V.nextTick(oe,ue,he):Ie?(V.nextTick(re,ue),Ie(he)):V.nextTick(re,ue)}),this)}function oe(le,Ie){ie(le,Ie),re(le)}function re(le){le._writableState&&!le._writableState.emitClose||le._readableState&&!le._readableState.emitClose||le.emit("close")}function Ce(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function ie(le,Ie){le.emit("error",Ie)}function ae(le,Ie){var ue=le._readableState,de=le._writableState;ue&&ue.autoDestroy||de&&de.autoDestroy?le.destroy(Ie):le.emit("error",Ie)}g.exports={destroy:$,undestroy:Ce,errorOrDestroy:ae}}).call(this)}).call(this,r("_process"))},{_process:50}],64:[function(r,g,k){var V=r("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function $(ie){var ae=!1;return function(){if(!ae){ae=!0;for(var le=arguments.length,Ie=new Array(le),ue=0;ue<le;ue++)Ie[ue]=arguments[ue];ie.apply(this,Ie)}}}function oe(){}function re(ie){return ie.setHeader&&typeof ie.abort=="function"}function Ce(ie,ae,le){if(typeof ae=="function")return Ce(ie,null,ae);ae||(ae={}),le=$(le||oe);var Ie=ae.readable||ae.readable!==!1&&ie.readable,ue=ae.writable||ae.writable!==!1&&ie.writable,de=function(){ie.writable||he()},Ne=ie._writableState&&ie._writableState.finished,he=function(){ue=!1,Ne=!0,Ie||le.call(ie)},pe=ie._readableState&&ie._readableState.endEmitted,ze=function(){Ie=!1,pe=!0,ue||le.call(ie)},Fe=function($e){le.call(ie,$e)},xe=function(){var $e;if(Ie&&!pe)return(!ie._readableState||!ie._readableState.ended)&&($e=new V),le.call(ie,$e);if(ue&&!Ne)return(!ie._writableState||!ie._writableState.ended)&&($e=new V),le.call(ie,$e)},_e=function(){ie.req.on("finish",he)};return re(ie)?(ie.on("complete",he),ie.on("abort",xe),ie.req?_e():ie.on("request",_e)):ue&&!ie._writableState&&(ie.on("end",de),ie.on("close",de)),ie.on("end",ze),ie.on("finish",he),ae.error!==!1&&ie.on("error",Fe),ie.on("close",xe),function(){ie.removeListener("complete",he),ie.removeListener("abort",xe),ie.removeListener("request",_e),ie.req&&ie.req.removeListener("finish",he),ie.removeListener("end",de),ie.removeListener("close",de),ie.removeListener("finish",he),ie.removeListener("end",ze),ie.removeListener("error",Fe),ie.removeListener("close",xe)}}g.exports=Ce},{"../../../errors":55}],65:[function(r,g,k){g.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],66:[function(r,g,k){var V;function $(he){var pe=!1;return function(){pe||(pe=!0,he.apply(void 0,arguments))}}var oe=r("../../../errors").codes,re=oe.ERR_MISSING_ARGS,Ce=oe.ERR_STREAM_DESTROYED;function ie(he){if(he)throw he}function ae(he){return he.setHeader&&typeof he.abort=="function"}function le(he,pe,ze,Fe){Fe=$(Fe);var xe=!1;he.on("close",function(){xe=!0}),V===void 0&&(V=r("./end-of-stream")),V(he,{readable:pe,writable:ze},function(Dt){if(Dt)return Fe(Dt);xe=!0,Fe()});var _e=!1;return function(Dt){if(!xe&&!_e){if(_e=!0,ae(he))return he.abort();if(typeof he.destroy=="function")return he.destroy();Fe(Dt||new Ce("pipe"))}}}function Ie(he){he()}function ue(he,pe){return he.pipe(pe)}function de(he){return!he.length||typeof he[he.length-1]!="function"?ie:he.pop()}function Ne(){for(var he=arguments.length,pe=new Array(he),ze=0;ze<he;ze++)pe[ze]=arguments[ze];var Fe=de(pe);if(Array.isArray(pe[0])&&(pe=pe[0]),pe.length<2)throw new re("streams");var xe,_e=pe.map(function(Dt,$e){var Ue=$e<pe.length-1,Ve=$e>0;return le(Dt,Ue,Ve,function(Oe){xe||(xe=Oe),Oe&&_e.forEach(Ie),!Ue&&(_e.forEach(Ie),Fe(xe))})});return pe.reduce(ue)}g.exports=Ne},{"../../../errors":55,"./end-of-stream":64}],67:[function(r,g,k){var V=r("../../../errors").codes.ERR_INVALID_OPT_VALUE;function $(re,Ce,ie){return re.highWaterMark!=null?re.highWaterMark:Ce?re[ie]:null}function oe(re,Ce,ie,ae){var le=$(Ce,ae,ie);if(le!=null){if(!(isFinite(le)&&Math.floor(le)===le)||le<0){var Ie=ae?ie:"highWaterMark";throw new V(Ie,le)}return Math.floor(le)}return re.objectMode?16:16*1024}g.exports={getHighWaterMark:oe}},{"../../../errors":55}],68:[function(r,g,k){g.exports=r("events").EventEmitter},{events:22}],69:[function(r,g,k){k=g.exports=r("./lib/_stream_readable.js"),k.Stream=k,k.Readable=k,k.Writable=r("./lib/_stream_writable.js"),k.Duplex=r("./lib/_stream_duplex.js"),k.Transform=r("./lib/_stream_transform.js"),k.PassThrough=r("./lib/_stream_passthrough.js"),k.finished=r("./lib/internal/streams/end-of-stream.js"),k.pipeline=r("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":56,"./lib/_stream_passthrough.js":57,"./lib/_stream_readable.js":58,"./lib/_stream_transform.js":59,"./lib/_stream_writable.js":60,"./lib/internal/streams/end-of-stream.js":64,"./lib/internal/streams/pipeline.js":66}],70:[function(r,g,k){function V(oe,re,Ce){var ie=this;this._callback=oe,this._args=Ce,this._interval=setInterval(oe,re,this._args),this.reschedule=function(ae){ae||(ae=ie._interval),ie._interval&&clearInterval(ie._interval),ie._interval=setInterval(ie._callback,ae,ie._args)},this.clear=function(){ie._interval&&(clearInterval(ie._interval),ie._interval=void 0)},this.destroy=function(){ie._interval&&clearInterval(ie._interval),ie._callback=void 0,ie._interval=void 0,ie._args=void 0}}function $(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var oe;if(arguments.length>0){oe=new Array(arguments.length-2);for(var re=0;re<oe.length;re++)oe[re]=arguments[re+2]}return new V(arguments[0],arguments[1],oe)}g.exports=$},{}],71:[function(r,g,k){g.exports=r("./index.js")()},{"./index.js":72}],72:[function(r,g,k){(function(V){(function(){g.exports=oe;function $(Ce){return Ce instanceof V?V.from(Ce):new Ce.constructor(Ce.buffer.slice(),Ce.byteOffset,Ce.length)}function oe(Ce){if(Ce=Ce||{},Ce.circles)return re(Ce);return Ce.proto?le:ae;function ie(Ie,ue){for(var de=Object.keys(Ie),Ne=new Array(de.length),he=0;he<de.length;he++){var pe=de[he],ze=Ie[pe];typeof ze!="object"||ze===null?Ne[pe]=ze:ze instanceof Date?Ne[pe]=new Date(ze):ArrayBuffer.isView(ze)?Ne[pe]=$(ze):Ne[pe]=ue(ze)}return Ne}function ae(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,ae);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),ae));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),ae));var ue={};for(var de in Ie)if(Object.hasOwnProperty.call(Ie,de)!==!1){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),ae)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),ae)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=ae(Ne)}return ue}function le(Ie){if(typeof Ie!="object"||Ie===null)return Ie;if(Ie instanceof Date)return new Date(Ie);if(Array.isArray(Ie))return ie(Ie,le);if(Ie instanceof Map)return new Map(ie(Array.from(Ie),le));if(Ie instanceof Set)return new Set(ie(Array.from(Ie),le));var ue={};for(var de in Ie){var Ne=Ie[de];typeof Ne!="object"||Ne===null?ue[de]=Ne:Ne instanceof Date?ue[de]=new Date(Ne):Ne instanceof Map?ue[de]=new Map(ie(Array.from(Ne),le)):Ne instanceof Set?ue[de]=new Set(ie(Array.from(Ne),le)):ArrayBuffer.isView(Ne)?ue[de]=$(Ne):ue[de]=le(Ne)}return ue}}function re(Ce){var ie=[],ae=[];return Ce.proto?ue:Ie;function le(de,Ne){for(var he=Object.keys(de),pe=new Array(he.length),ze=0;ze<he.length;ze++){var Fe=he[ze],xe=de[Fe];if(typeof xe!="object"||xe===null)pe[Fe]=xe;else if(xe instanceof Date)pe[Fe]=new Date(xe);else if(ArrayBuffer.isView(xe))pe[Fe]=$(xe);else{var _e=ie.indexOf(xe);_e!==-1?pe[Fe]=ae[_e]:pe[Fe]=Ne(xe)}}return pe}function Ie(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,Ie);if(de instanceof Map)return new Map(le(Array.from(de),Ie));if(de instanceof Set)return new Set(le(Array.from(de),Ie));var Ne={};ie.push(de),ae.push(Ne);for(var he in de)if(Object.hasOwnProperty.call(de,he)!==!1){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),Ie));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),Ie));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=Ie(pe)}}return ie.pop(),ae.pop(),Ne}function ue(de){if(typeof de!="object"||de===null)return de;if(de instanceof Date)return new Date(de);if(Array.isArray(de))return le(de,ue);if(de instanceof Map)return new Map(le(Array.from(de),ue));if(de instanceof Set)return new Set(le(Array.from(de),ue));var Ne={};ie.push(de),ae.push(Ne);for(var he in de){var pe=de[he];if(typeof pe!="object"||pe===null)Ne[he]=pe;else if(pe instanceof Date)Ne[he]=new Date(pe);else if(pe instanceof Map)Ne[he]=new Map(le(Array.from(pe),ue));else if(pe instanceof Set)Ne[he]=new Set(le(Array.from(pe),ue));else if(ArrayBuffer.isView(pe))Ne[he]=$(pe);else{var ze=ie.indexOf(pe);ze!==-1?Ne[he]=ae[ze]:Ne[he]=ue(pe)}}return ie.pop(),ae.pop(),Ne}}}).call(this)}).call(this,r("buffer").Buffer)},{buffer:17}],73:[function(r,g,k){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=r("buffer"),$=V.Buffer;function oe(Ce,ie){for(var ae in Ce)ie[ae]=Ce[ae]}$.from&&$.alloc&&$.allocUnsafe&&$.allocUnsafeSlow?g.exports=V:(oe(V,k),k.Buffer=re);function re(Ce,ie,ae){return $(Ce,ie,ae)}re.prototype=Object.create($.prototype),oe($,re),re.from=function(Ce,ie,ae){if(typeof Ce=="number")throw new TypeError("Argument must not be a number");return $(Ce,ie,ae)},re.alloc=function(Ce,ie,ae){if(typeof Ce!="number")throw new TypeError("Argument must be a number");var le=$(Ce);return ie!==void 0?typeof ae=="string"?le.fill(ie,ae):le.fill(ie):le.fill(0),le},re.allocUnsafe=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return $(Ce)},re.allocUnsafeSlow=function(Ce){if(typeof Ce!="number")throw new TypeError("Argument must be a number");return V.SlowBuffer(Ce)}},{buffer:17}],74:[function(r,g,k){g.exports=V;function V(oe){var re=oe._readableState;return re?re.objectMode||typeof oe._duplexState=="number"?oe.read():oe.read($(re)):null}function $(oe){return oe.buffer.length?oe.buffer.head?oe.buffer.head.data.length:oe.buffer[0].length:oe.length}},{}],75:[function(r,g,k){var V=r("safe-buffer").Buffer,$=V.isEncoding||function(_e){switch(_e=""+_e,_e&&_e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function oe(_e){if(!_e)return"utf8";for(var Dt;;)switch(_e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _e;default:if(Dt)return;_e=(""+_e).toLowerCase(),Dt=!0}}function re(_e){var Dt=oe(_e);if(typeof Dt!="string"&&(V.isEncoding===$||!$(_e)))throw new Error("Unknown encoding: "+_e);return Dt||_e}k.StringDecoder=Ce;function Ce(_e){this.encoding=re(_e);var Dt;switch(this.encoding){case"utf16le":this.text=Ne,this.end=he,Dt=4;break;case"utf8":this.fillLast=Ie,Dt=4;break;case"base64":this.text=pe,this.end=ze,Dt=3;break;default:this.write=Fe,this.end=xe;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=V.allocUnsafe(Dt)}Ce.prototype.write=function(_e){if(_e.length===0)return"";var Dt,$e;if(this.lastNeed){if(Dt=this.fillLast(_e),Dt===void 0)return"";$e=this.lastNeed,this.lastNeed=0}else $e=0;return $e<_e.length?Dt?Dt+this.text(_e,$e):this.text(_e,$e):Dt||""},Ce.prototype.end=de,Ce.prototype.text=ue,Ce.prototype.fillLast=function(_e){if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_e.length),this.lastNeed-=_e.length};function ie(_e){return _e<=127?0:_e>>5===6?2:_e>>4===14?3:_e>>3===30?4:_e>>6===2?-1:-2}function ae(_e,Dt,$e){var Ue=Dt.length-1;if(Ue<$e)return 0;var Ve=ie(Dt[Ue]);return Ve>=0?(Ve>0&&(_e.lastNeed=Ve-1),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(_e.lastNeed=Ve-2),Ve):--Ue<$e||Ve===-2?0:(Ve=ie(Dt[Ue]),Ve>=0?(Ve>0&&(Ve===2?Ve=0:_e.lastNeed=Ve-3),Ve):0))}function le(_e,Dt,$e){if((Dt[0]&192)!==128)return _e.lastNeed=0,"�";if(_e.lastNeed>1&&Dt.length>1){if((Dt[1]&192)!==128)return _e.lastNeed=1,"�";if(_e.lastNeed>2&&Dt.length>2&&(Dt[2]&192)!==128)return _e.lastNeed=2,"�"}}function Ie(_e){var Dt=this.lastTotal-this.lastNeed,$e=le(this,_e);if($e!==void 0)return $e;if(this.lastNeed<=_e.length)return _e.copy(this.lastChar,Dt,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_e.copy(this.lastChar,Dt,0,_e.length),this.lastNeed-=_e.length}function ue(_e,Dt){var $e=ae(this,_e,Dt);if(!this.lastNeed)return _e.toString("utf8",Dt);this.lastTotal=$e;var Ue=_e.length-($e-this.lastNeed);return _e.copy(this.lastChar,0,Ue),_e.toString("utf8",Dt,Ue)}function de(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+"�":Dt}function Ne(_e,Dt){if((_e.length-Dt)%2===0){var $e=_e.toString("utf16le",Dt);if($e){var Ue=$e.charCodeAt($e.length-1);if(Ue>=55296&&Ue<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1],$e.slice(0,-1)}return $e}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_e[_e.length-1],_e.toString("utf16le",Dt,_e.length-1)}function he(_e){var Dt=_e&&_e.length?this.write(_e):"";if(this.lastNeed){var $e=this.lastTotal-this.lastNeed;return Dt+this.lastChar.toString("utf16le",0,$e)}return Dt}function pe(_e,Dt){var $e=(_e.length-Dt)%3;return $e===0?_e.toString("base64",Dt):(this.lastNeed=3-$e,this.lastTotal=3,$e===1?this.lastChar[0]=_e[_e.length-1]:(this.lastChar[0]=_e[_e.length-2],this.lastChar[1]=_e[_e.length-1]),_e.toString("base64",Dt,_e.length-$e))}function ze(_e){var Dt=_e&&_e.length?this.write(_e):"";return this.lastNeed?Dt+this.lastChar.toString("base64",0,3-this.lastNeed):Dt}function Fe(_e){return _e.toString(this.encoding)}function xe(_e){return _e&&_e.length?this.write(_e):""}},{"safe-buffer":73}],76:[function(r,g,k){var V=r("punycode"),$=r("./util");k.parse=Dt,k.resolve=Ue,k.resolveObject=Ve,k.format=$e,k.Url=oe;function oe(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var re=/^([a-z0-9.+-]+:)/i,Ce=/:[0-9]*$/,ie=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,ae=["<",">",'"',"`"," ","\r",`
1303
+ `," "],le=["{","}","|","\\","^","`"].concat(ae),Ie=["'"].concat(le),ue=["%","/","?",";","#"].concat(Ie),de=["/","?","#"],Ne=255,he=/^[+a-z0-9A-Z_-]{0,63}$/,pe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ze={javascript:!0,"javascript:":!0},Fe={javascript:!0,"javascript:":!0},xe={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_e=r("querystring");function Dt(Oe,At,qe){if(Oe&&$.isObject(Oe)&&Oe instanceof oe)return Oe;var Lt=new oe;return Lt.parse(Oe,At,qe),Lt}oe.prototype.parse=function(Oe,At,qe){if(!$.isString(Oe))throw new TypeError("Parameter 'url' must be a string, not "+typeof Oe);var Lt=Oe.indexOf("?"),kt=Lt!==-1&&Lt<Oe.indexOf("#")?"?":"#",jt=Oe.split(kt),ti=/\\/g;jt[0]=jt[0].replace(ti,"/"),Oe=jt.join(kt);var ei=Oe;if(ei=ei.trim(),!qe&&Oe.split("#").length===1){var Pt=ie.exec(ei);if(Pt)return this.path=ei,this.href=ei,this.pathname=Pt[1],Pt[2]?(this.search=Pt[2],At?this.query=_e.parse(this.search.substr(1)):this.query=this.search.substr(1)):At&&(this.search="",this.query={}),this}var ni=re.exec(ei);if(ni){ni=ni[0];var gi=ni.toLowerCase();this.protocol=gi,ei=ei.substr(ni.length)}if(qe||ni||ei.match(/^\/\/[^@\/]+@[^@\/]+/)){var di=ei.substr(0,2)==="//";di&&!(ni&&Fe[ni])&&(ei=ei.substr(2),this.slashes=!0)}if(!Fe[ni]&&(di||ni&&!xe[ni])){for(var li=-1,ai=0;ai<de.length;ai++){var ci=ei.indexOf(de[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}var pi,yi;li===-1?yi=ei.lastIndexOf("@"):yi=ei.lastIndexOf("@",li),yi!==-1&&(pi=ei.slice(0,yi),ei=ei.slice(yi+1),this.auth=decodeURIComponent(pi)),li=-1;for(var ai=0;ai<ue.length;ai++){var ci=ei.indexOf(ue[ai]);ci!==-1&&(li===-1||ci<li)&&(li=ci)}li===-1&&(li=ei.length),this.host=ei.slice(0,li),ei=ei.slice(li),this.parseHost(),this.hostname=this.hostname||"";var Ai=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!Ai)for(var hi=this.hostname.split(/\./),ai=0,wi=hi.length;ai<wi;ai++){var Ci=hi[ai];if(Ci&&!Ci.match(he)){for(var mi="",Ni=0,Mi=Ci.length;Ni<Mi;Ni++)Ci.charCodeAt(Ni)>127?mi+="x":mi+=Ci[Ni];if(!mi.match(he)){var fi=hi.slice(0,ai),zi=hi.slice(ai+1),Si=Ci.match(pe);Si&&(fi.push(Si[1]),zi.unshift(Si[2])),zi.length&&(ei="/"+zi.join(".")+ei),this.hostname=fi.join(".");break}}}this.hostname.length>Ne?this.hostname="":this.hostname=this.hostname.toLowerCase(),Ai||(this.hostname=V.toASCII(this.hostname));var si=this.port?":"+this.port:"",Ii=this.hostname||"";this.host=Ii+si,this.href+=this.host,Ai&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),ei[0]!=="/"&&(ei="/"+ei))}if(!ze[gi])for(var ai=0,wi=Ie.length;ai<wi;ai++){var oi=Ie[ai];if(ei.indexOf(oi)!==-1){var Et=encodeURIComponent(oi);Et===oi&&(Et=escape(oi)),ei=ei.split(oi).join(Et)}}var ii=ei.indexOf("#");ii!==-1&&(this.hash=ei.substr(ii),ei=ei.slice(0,ii));var ri=ei.indexOf("?");if(ri!==-1?(this.search=ei.substr(ri),this.query=ei.substr(ri+1),At&&(this.query=_e.parse(this.query)),ei=ei.slice(0,ri)):At&&(this.search="",this.query={}),ei&&(this.pathname=ei),xe[gi]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var si=this.pathname||"",ui=this.search||"";this.path=si+ui}return this.href=this.format(),this};function $e(Oe){return $.isString(Oe)&&(Oe=Dt(Oe)),Oe instanceof oe?Oe.format():oe.prototype.format.call(Oe)}oe.prototype.format=function(){var Oe=this.auth||"";Oe&&(Oe=encodeURIComponent(Oe),Oe=Oe.replace(/%3A/i,":"),Oe+="@");var At=this.protocol||"",qe=this.pathname||"",Lt=this.hash||"",kt=!1,jt="";this.host?kt=Oe+this.host:this.hostname&&(kt=Oe+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(kt+=":"+this.port)),this.query&&$.isObject(this.query)&&Object.keys(this.query).length&&(jt=_e.stringify(this.query));var ti=this.search||jt&&"?"+jt||"";return At&&At.substr(-1)!==":"&&(At+=":"),this.slashes||(!At||xe[At])&&kt!==!1?(kt="//"+(kt||""),qe&&qe.charAt(0)!=="/"&&(qe="/"+qe)):kt||(kt=""),Lt&&Lt.charAt(0)!=="#"&&(Lt="#"+Lt),ti&&ti.charAt(0)!=="?"&&(ti="?"+ti),qe=qe.replace(/[?#]/g,function(ei){return encodeURIComponent(ei)}),ti=ti.replace("#","%23"),At+kt+qe+ti+Lt};function Ue(Oe,At){return Dt(Oe,!1,!0).resolve(At)}oe.prototype.resolve=function(Oe){return this.resolveObject(Dt(Oe,!1,!0)).format()};function Ve(Oe,At){return Oe?Dt(Oe,!1,!0).resolveObject(At):At}oe.prototype.resolveObject=function(Oe){if($.isString(Oe)){var At=new oe;At.parse(Oe,!1,!0),Oe=At}for(var qe=new oe,Lt=Object.keys(this),kt=0;kt<Lt.length;kt++){var jt=Lt[kt];qe[jt]=this[jt]}if(qe.hash=Oe.hash,Oe.href==="")return qe.href=qe.format(),qe;if(Oe.slashes&&!Oe.protocol){for(var ti=Object.keys(Oe),ei=0;ei<ti.length;ei++){var Pt=ti[ei];Pt!=="protocol"&&(qe[Pt]=Oe[Pt])}return xe[qe.protocol]&&qe.hostname&&!qe.pathname&&(qe.path=qe.pathname="/"),qe.href=qe.format(),qe}if(Oe.protocol&&Oe.protocol!==qe.protocol){if(!xe[Oe.protocol]){for(var ni=Object.keys(Oe),gi=0;gi<ni.length;gi++){var di=ni[gi];qe[di]=Oe[di]}return qe.href=qe.format(),qe}if(qe.protocol=Oe.protocol,!Oe.host&&!Fe[Oe.protocol]){for(var wi=(Oe.pathname||"").split("/");wi.length&&!(Oe.host=wi.shift()););Oe.host||(Oe.host=""),Oe.hostname||(Oe.hostname=""),wi[0]!==""&&wi.unshift(""),wi.length<2&&wi.unshift(""),qe.pathname=wi.join("/")}else qe.pathname=Oe.pathname;if(qe.search=Oe.search,qe.query=Oe.query,qe.host=Oe.host||"",qe.auth=Oe.auth,qe.hostname=Oe.hostname||Oe.host,qe.port=Oe.port,qe.pathname||qe.search){var li=qe.pathname||"",ai=qe.search||"";qe.path=li+ai}return qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe}var ci=qe.pathname&&qe.pathname.charAt(0)==="/",pi=Oe.host||Oe.pathname&&Oe.pathname.charAt(0)==="/",yi=pi||ci||qe.host&&Oe.pathname,Ai=yi,hi=qe.pathname&&qe.pathname.split("/")||[],wi=Oe.pathname&&Oe.pathname.split("/")||[],Ci=qe.protocol&&!xe[qe.protocol];if(Ci&&(qe.hostname="",qe.port=null,qe.host&&(hi[0]===""?hi[0]=qe.host:hi.unshift(qe.host)),qe.host="",Oe.protocol&&(Oe.hostname=null,Oe.port=null,Oe.host&&(wi[0]===""?wi[0]=Oe.host:wi.unshift(Oe.host)),Oe.host=null),yi=yi&&(wi[0]===""||hi[0]==="")),pi)qe.host=Oe.host||Oe.host===""?Oe.host:qe.host,qe.hostname=Oe.hostname||Oe.hostname===""?Oe.hostname:qe.hostname,qe.search=Oe.search,qe.query=Oe.query,hi=wi;else if(wi.length)hi||(hi=[]),hi.pop(),hi=hi.concat(wi),qe.search=Oe.search,qe.query=Oe.query;else if(!$.isNullOrUndefined(Oe.search)){if(Ci){qe.hostname=qe.host=hi.shift();var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return qe.search=Oe.search,qe.query=Oe.query,(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.href=qe.format(),qe}if(!hi.length)return qe.pathname=null,qe.search?qe.path="/"+qe.search:qe.path=null,qe.href=qe.format(),qe;for(var Ni=hi.slice(-1)[0],Mi=(qe.host||Oe.host||hi.length>1)&&(Ni==="."||Ni==="..")||Ni==="",fi=0,zi=hi.length;zi>=0;zi--)Ni=hi[zi],Ni==="."?hi.splice(zi,1):Ni===".."?(hi.splice(zi,1),fi++):fi&&(hi.splice(zi,1),fi--);if(!yi&&!Ai)for(;fi--;fi)hi.unshift("..");yi&&hi[0]!==""&&(!hi[0]||hi[0].charAt(0)!=="/")&&hi.unshift(""),Mi&&hi.join("/").substr(-1)!=="/"&&hi.push("");var Si=hi[0]===""||hi[0]&&hi[0].charAt(0)==="/";if(Ci){qe.hostname=qe.host=Si?"":hi.length?hi.shift():"";var mi=qe.host&&qe.host.indexOf("@")>0?qe.host.split("@"):!1;mi&&(qe.auth=mi.shift(),qe.host=qe.hostname=mi.shift())}return yi=yi||qe.host&&hi.length,yi&&!Si&&hi.unshift(""),hi.length?qe.pathname=hi.join("/"):(qe.pathname=null,qe.path=null),(!$.isNull(qe.pathname)||!$.isNull(qe.search))&&(qe.path=(qe.pathname?qe.pathname:"")+(qe.search?qe.search:"")),qe.auth=Oe.auth||qe.auth,qe.slashes=qe.slashes||Oe.slashes,qe.href=qe.format(),qe},oe.prototype.parseHost=function(){var Oe=this.host,At=Ce.exec(Oe);At&&(At=At[0],At!==":"&&(this.port=At.substr(1)),Oe=Oe.substr(0,Oe.length-At.length)),Oe&&(this.hostname=Oe)}},{"./util":77,punycode:51,querystring:54}],77:[function(r,g,k){g.exports={isString:function(V){return typeof V=="string"},isObject:function(V){return typeof V=="object"&&V!==null},isNull:function(V){return V===null},isNullOrUndefined:function(V){return V==null}}},{}],78:[function(r,g,k){(function(V){(function(){g.exports=$;function $(re,Ce){if(oe("noDeprecation"))return re;var ie=!1;function ae(){if(!ie){if(oe("throwDeprecation"))throw new Error(Ce);oe("traceDeprecation")?console.trace(Ce):console.warn(Ce),ie=!0}return re.apply(this,arguments)}return ae}function oe(re){try{if(!V.localStorage)return!1}catch{return!1}var Ce=V.localStorage[re];return Ce==null?!1:String(Ce).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],79:[function(r,g,k){g.exports=V;function V($,oe){if($&&oe)return V($)(oe);if(typeof $!="function")throw new TypeError("need wrapper function");return Object.keys($).forEach(function(Ce){re[Ce]=$[Ce]}),re;function re(){for(var Ce=new Array(arguments.length),ie=0;ie<Ce.length;ie++)Ce[ie]=arguments[ie];var ae=$.apply(this,Ce),le=Ce[Ce.length-1];return typeof ae=="function"&&ae!==le&&Object.keys(le).forEach(function(Ie){ae[Ie]=le[Ie]}),ae}}},{}],80:[function(r,g,k){g.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}],81:[function(r,g,k){g.exports=$;var V=Object.prototype.hasOwnProperty;function $(){for(var oe={},re=0;re<arguments.length;re++){var Ce=arguments[re];for(var ie in Ce)V.call(Ce,ie)&&(oe[ie]=Ce[ie])}return oe}},{}],82:[function(r,g,k){g.exports=function(V){V.prototype[Symbol.iterator]=function*(){for(let $=this.head;$;$=$.next)yield $.value}}},{}],83:[function(r,g,k){g.exports=V,V.Node=Ce,V.create=V;function V(ie){var ae=this;if(ae instanceof V||(ae=new V),ae.tail=null,ae.head=null,ae.length=0,ie&&typeof ie.forEach=="function")ie.forEach(function(ue){ae.push(ue)});else if(arguments.length>0)for(var le=0,Ie=arguments.length;le<Ie;le++)ae.push(arguments[le]);return ae}V.prototype.removeNode=function(ie){if(ie.list!==this)throw new Error("removing node which does not belong to this list");var ae=ie.next,le=ie.prev;return ae&&(ae.prev=le),le&&(le.next=ae),ie===this.head&&(this.head=ae),ie===this.tail&&(this.tail=le),ie.list.length--,ie.next=null,ie.prev=null,ie.list=null,ae},V.prototype.unshiftNode=function(ie){if(ie!==this.head){ie.list&&ie.list.removeNode(ie);var ae=this.head;ie.list=this,ie.next=ae,ae&&(ae.prev=ie),this.head=ie,this.tail||(this.tail=ie),this.length++}},V.prototype.pushNode=function(ie){if(ie!==this.tail){ie.list&&ie.list.removeNode(ie);var ae=this.tail;ie.list=this,ie.prev=ae,ae&&(ae.next=ie),this.tail=ie,this.head||(this.head=ie),this.length++}},V.prototype.push=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)oe(this,arguments[ie]);return this.length},V.prototype.unshift=function(){for(var ie=0,ae=arguments.length;ie<ae;ie++)re(this,arguments[ie]);return this.length},V.prototype.pop=function(){if(this.tail){var ie=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,ie}},V.prototype.shift=function(){if(this.head){var ie=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,ie}},V.prototype.forEach=function(ie,ae){ae=ae||this;for(var le=this.head,Ie=0;le!==null;Ie++)ie.call(ae,le.value,Ie,this),le=le.next},V.prototype.forEachReverse=function(ie,ae){ae=ae||this;for(var le=this.tail,Ie=this.length-1;le!==null;Ie--)ie.call(ae,le.value,Ie,this),le=le.prev},V.prototype.get=function(ie){for(var ae=0,le=this.head;le!==null&&ae<ie;ae++)le=le.next;if(ae===ie&&le!==null)return le.value},V.prototype.getReverse=function(ie){for(var ae=0,le=this.tail;le!==null&&ae<ie;ae++)le=le.prev;if(ae===ie&&le!==null)return le.value},V.prototype.map=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.head;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.next;return le},V.prototype.mapReverse=function(ie,ae){ae=ae||this;for(var le=new V,Ie=this.tail;Ie!==null;)le.push(ie.call(ae,Ie.value,this)),Ie=Ie.prev;return le},V.prototype.reduce=function(ie,ae){var le,Ie=this.head;if(arguments.length>1)le=ae;else if(this.head)Ie=this.head.next,le=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=0;Ie!==null;ue++)le=ie(le,Ie.value,ue),Ie=Ie.next;return le},V.prototype.reduceReverse=function(ie,ae){var le,Ie=this.tail;if(arguments.length>1)le=ae;else if(this.tail)Ie=this.tail.prev,le=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var ue=this.length-1;Ie!==null;ue--)le=ie(le,Ie.value,ue),Ie=Ie.prev;return le},V.prototype.toArray=function(){for(var ie=new Array(this.length),ae=0,le=this.head;le!==null;ae++)ie[ae]=le.value,le=le.next;return ie},V.prototype.toArrayReverse=function(){for(var ie=new Array(this.length),ae=0,le=this.tail;le!==null;ae++)ie[ae]=le.value,le=le.prev;return ie},V.prototype.slice=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(;ue!==null&&Ie<ae;Ie++,ue=ue.next)le.push(ue.value);return le},V.prototype.sliceReverse=function(ie,ae){ae=ae||this.length,ae<0&&(ae+=this.length),ie=ie||0,ie<0&&(ie+=this.length);var le=new V;if(ae<ie||ae<0)return le;ie<0&&(ie=0),ae>this.length&&(ae=this.length);for(var Ie=this.length,ue=this.tail;ue!==null&&Ie>ae;Ie--)ue=ue.prev;for(;ue!==null&&Ie>ie;Ie--,ue=ue.prev)le.push(ue.value);return le},V.prototype.splice=function(ie,ae,...le){ie>this.length&&(ie=this.length-1),ie<0&&(ie=this.length+ie);for(var Ie=0,ue=this.head;ue!==null&&Ie<ie;Ie++)ue=ue.next;for(var de=[],Ie=0;ue&&Ie<ae;Ie++)de.push(ue.value),ue=this.removeNode(ue);ue===null&&(ue=this.tail),ue!==this.head&&ue!==this.tail&&(ue=ue.prev);for(var Ie=0;Ie<le.length;Ie++)ue=$(this,ue,le[Ie]);return de},V.prototype.reverse=function(){for(var ie=this.head,ae=this.tail,le=ie;le!==null;le=le.prev){var Ie=le.prev;le.prev=le.next,le.next=Ie}return this.head=ae,this.tail=ie,this};function $(ie,ae,le){var Ie=ae===ie.head?new Ce(le,null,ae,ie):new Ce(le,ae,ae.next,ie);return Ie.next===null&&(ie.tail=Ie),Ie.prev===null&&(ie.head=Ie),ie.length++,Ie}function oe(ie,ae){ie.tail=new Ce(ae,ie.tail,null,ie),ie.head||(ie.head=ie.tail),ie.length++}function re(ie,ae){ie.head=new Ce(ae,null,ie.head,ie),ie.tail||(ie.tail=ie.head),ie.length++}function Ce(ie,ae,le,Ie){if(!(this instanceof Ce))return new Ce(ie,ae,le,Ie);this.list=Ie,this.value=ie,ae?(ae.next=this,this.prev=ae):this.prev=null,le?(le.prev=this,this.next=le):this.next=null}try{r("./iterator.js")(V)}catch{}},{"./iterator.js":82}]},{},[12])(12)})})(mqtt);var mqttExports=mqtt.exports;let client;const sub=(i,n,r,g,k)=>{client=mqttExports.connect(i,{username:n,password:r}),client.on("connect",()=>{console.log("MQTT服务器连接成功"),console.log(client.options.clientId),client.subscribe(g,{qos:1})}),client.on("message",k)},close=()=>{client&&client.end&&client.end(!0,{},()=>{console.log("MQTT服务连接关闭")})},_hoisted_1=["transform"],_hoisted_2=["transform","onClick"],_hoisted_3=["transform"],_hoisted_4=["xlink:href","id","transform"],_hoisted_5=["id"],_sfc_main=vue.defineComponent({__name:"index",props:{data:{},canvasDrag:{type:Boolean,default:!0}},setup(i,{expose:n}){const r=i,g=vue.getCurrentInstance();Object.keys(vueComp).forEach(ue=>{var de;Object.keys((de=g==null?void 0:g.appContext)==null?void 0:de.components).includes(ue)||g==null||g.appContext.app.component(ue,vueComp[ue])});const k=vue.reactive(r.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,position_center:{x:-333,y:-113},svg_position_center:{x:50,y:50}},net:{mqtt:{url:"",user:"",pwd:"",topics:""}}},done_json:[]}),V=useGlobalStore(pinia),$=ue=>{if(V.mouse_info.state!=EMouseInfoState.Down&&V.intention!==EGlobalStoreIntention.Connection)return;if(!r.canvasDrag){console.log(r.canvasDrag);return}const{clientX:de,clientY:Ne}=ue;V.mouse_info.new_position_x=V.mouse_info.now_position_x+de-V.mouse_info.position_x,V.mouse_info.new_position_y=V.mouse_info.now_position_y+Ne-V.mouse_info.position_y,V.intention==EGlobalStoreIntention.MoveCanvas&&(k.layout_center.x=V.mouse_info.new_position_x,k.layout_center.y=V.mouse_info.new_position_y)},oe=()=>{V.mouse_info.state==EMouseInfoState.Down&&(V.intention!=EGlobalStoreIntention.Select&&(V.intention=EGlobalStoreIntention.None),V.setMouseInfo({state:EMouseInfoState.Up,position_x:0,position_y:0,now_position_x:0,now_position_y:0,new_position_x:0,new_position_y:0}))},re=ue=>{console.log("onCanvasMouseDown",ue);const{clientX:de,clientY:Ne}=ue;V.intention=EGlobalStoreIntention.MoveCanvas,V.setMouseInfo({state:EMouseInfoState.Down,position_x:de,position_y:Ne,now_position_x:k.layout_center.x,now_position_y:k.layout_center.y,new_position_x:k.layout_center.x,new_position_y:k.layout_center.y})},Ce=(ue,de,Ne)=>({x:ue.x-ue.width/2*de+ue.width/2,y:ue.y-ue.height/2*Ne+ue.height/2,width:ue.width*de,height:ue.height*Ne}),ie=(ue,de,Ne)=>setArrItemByID(ue,de,Ne,k.done_json),ae=ue=>{var de;if(((de=ue.events)==null?void 0:de.length)>0){for(let Ne of ue.events)if(Ne.type===EEventType.Click||Ne.type===EEventType.Change){if(Ne.condition&&Ne.condition.type!=="None"&&Ne.condition.type==="Relation"&&Ne.condition.Relation&&Ne.condition.Relation.relation){const he=Ne.condition.Relation.key,pe=Ne.condition.Relation.relation,ze=valFormat(Ne.condition.Relation.val),Fe=valFormat(Ne.condition.Relation.val2);if(ue.props.hasOwnProperty(he)){const xe=ue.props[he].val;if(!le(xe,pe,ze,Fe))continue}}if(Ne.action===EEventAction.ChangeAttr){if(Ne.attrs&&Ne.attrs.length>0){let he;if(Ne.target){for(let pe of V.done_json)if(pe.id===Ne.target){he=pe;break}}else he=ue;if(!he)continue;for(let pe of Ne.attrs)he.state&&he.state.hasOwnProperty(pe.key)?he.state[pe.key].default=valFormat(pe.val):he.props.hasOwnProperty(pe.key)&&(he.props[pe.key].val=valFormat(pe.val))}}else Ne.action===EEventAction.JavaScript&&new Function(Ne.scripts)()}}},le=(ue,de,Ne,he)=>{switch(de){case">":return ue>Ne;case">=":return ue>=Ne;case"<":return ue<Ne;case"<=":return ue<=Ne;case"==":return ue==Ne;case"!=":return ue!=Ne;case">=,=<":return ue>=Ne&&ue<=he;case"<,>":return ue<Ne||ue>he}};vue.onMounted(()=>{Ie()}),vue.onBeforeUnmount(close);const Ie=()=>{const ue=k.config.net.mqtt;ue&&ue.url&&ue.user&&ue.pwd&&ue.topics&&sub(ue.url,ue.user,ue.pwd,ue.topics,(de,Ne)=>{console.log(de),console.log(Ne.toString())})};return n({setNodeAttrByID:ie}),(ue,de)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",onMousedown:re,onMousemove:$,onMouseup:oe},[(vue.openBlock(),vue.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",style:vue.normalizeStyle({backgroundColor:k.config.svg.background_color}),width:"100%",height:"100%"},[vue.createElementVNode("g",{transform:`translate(${k.config.svg.position_center.x+k.layout_center.x},${k.config.svg.position_center.y+k.layout_center.y})rotate(0)scale(${k.config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(k.done_json,Ne=>vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:Ne.id,transform:`translate(${Ne.x},${Ne.y})rotate(0)scale(1)`,onClick:he=>ae(Ne)},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(Ne)}`)},[vue.createElementVNode("g",{transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2})rotate(${Ne.rotate}) scale(1) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`},[Ne.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$d,{key:0,"item-info":Ne},null,8,["item-info"])):Ne.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${Ne.name}`},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,_hoisted_4)):Ne.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps({key:2},vue.unref(prosToVBind)(Ne),{width:"100",height:"100",id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),null,16,["id","onOnChange","transform"])):Ne.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3},Ce(Ne.actual_bound,Ne.scale_x,Ne.scale_y),{id:`foreign-object${Ne.id}`}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ne.tag),vue.mergeProps(vue.unref(prosToVBind)(Ne),{id:Ne.id,onOnChange:he=>ae(Ne),transform:`translate(${Ne.actual_bound.x+Ne.actual_bound.width/2},${Ne.actual_bound.y+Ne.actual_bound.height/2}) scale(${Ne.scale_x},${Ne.scale_y}) translate(${-(Ne.actual_bound.x+Ne.actual_bound.width/2)},${-(Ne.actual_bound.y+Ne.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(Ne.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_5)):vue.createCommentVNode("",!0)],8,_hoisted_3)],2)],8,_hoisted_2)),[[vue.vShow,Ne.display]])),128))],8,_hoisted_1)],4))],32))}}),index_vue_vue_type_style_index_0_scoped_a4451d40_lang="",index=_export_sfc(_sfc_main,[["__scopeId","data-v-a4451d40"]]);exports.SvgEditor=index$1,exports.SvgViewer=index,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});