@zhangqingcq/vgce 0.1.26 → 0.1.29

Sign up to get free protection for your applications and to get access to all the features.
package/dist/vgce.umd.cjs CHANGED
@@ -269,6 +269,6 @@ usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:o,curr
269
269
  z-index:-1000 !important;
270
270
  top:0 !important;
271
271
  right:0 !important;
272
- `,CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function calculateNodeStyling(i){const r=window.getComputedStyle(i),n=r.getPropertyValue("box-sizing"),o=Number.parseFloat(r.getPropertyValue("padding-bottom"))+Number.parseFloat(r.getPropertyValue("padding-top")),a=Number.parseFloat(r.getPropertyValue("border-bottom-width"))+Number.parseFloat(r.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(c=>`${c}:${r.getPropertyValue(c)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:n}}function calcTextareaHeight(i,r=1,n){var o;hiddenTextarea||(hiddenTextarea=document.createElement("textarea"),document.body.appendChild(hiddenTextarea));const{paddingSize:a,borderSize:u,boxSizing:c,contextStyle:d}=calculateNodeStyling(i);hiddenTextarea.setAttribute("style",`${d};${HIDDEN_STYLE}`),hiddenTextarea.value=i.value||i.placeholder||"";let f=hiddenTextarea.scrollHeight;const h={};c==="border-box"?f=f+u:c==="content-box"&&(f=f-a),hiddenTextarea.value="";const y=hiddenTextarea.scrollHeight-a;if(isNumber(r)){let g=y*r;c==="border-box"&&(g=g+a+u),f=Math.max(g,f),h.minHeight=`${g}px`}if(isNumber(n)){let g=y*n;c==="border-box"&&(g=g+a+u),f=Math.min(g,f)}return h.height=`${f}px`,(o=hiddenTextarea.parentNode)==null||o.removeChild(hiddenTextarea),hiddenTextarea=void 0,h}const inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:Boolean,modelValue:{type:definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:definePropType([Object,Array,String]),default:()=>mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...useAriaProps(["ariaLabel"])}),inputEmits={[UPDATE_MODEL_EVENT]:i=>isString(i),input:i=>isString(i),change:i=>isString(i),focus:i=>i instanceof FocusEvent,blur:i=>i instanceof FocusEvent,clear:()=>!0,mouseleave:i=>i instanceof MouseEvent,mouseenter:i=>i instanceof MouseEvent,keydown:i=>i instanceof Event,compositionstart:i=>i instanceof CompositionEvent,compositionupdate:i=>i instanceof CompositionEvent,compositionend:i=>i instanceof CompositionEvent},__default__$9=vue.defineComponent({name:"ElInput",inheritAttrs:!1}),_sfc_main$p=vue.defineComponent({...__default__$9,props:inputProps,emits:inputEmits,setup(i,{expose:r,emit:n}){const o=i,a=vue.useAttrs(),u=vue.useSlots(),c=vue.computed(()=>{const Ue={};return o.containerRole==="combobox"&&(Ue["aria-haspopup"]=a["aria-haspopup"],Ue["aria-owns"]=a["aria-owns"],Ue["aria-expanded"]=a["aria-expanded"]),Ue}),d=vue.computed(()=>[o.type==="textarea"?A.b():b.b(),b.m(v.value),b.is("disabled",_.value),b.is("exceed",vn.value),{[b.b("group")]:u.prepend||u.append,[b.m("prefix")]:u.prefix||o.prefixIcon,[b.m("suffix")]:u.suffix||o.suffixIcon||o.clearable||o.showPassword,[b.bm("suffix","password-clear")]:Oe.value&&Et.value,[b.b("hidden")]:o.type==="hidden"},a.class]),f=vue.computed(()=>[b.e("wrapper"),b.is("focus",D.value)]),h=useAttrs({excludeKeys:vue.computed(()=>Object.keys(c.value))}),{form:y,formItem:g}=useFormItem(),{inputId:p}=useFormItemInputId(o,{formItemContext:g}),v=useFormSize(),_=useFormDisabled(),b=useNamespace("input"),A=useNamespace("textarea"),w=vue.shallowRef(),S=vue.shallowRef(),T=vue.ref(!1),x=vue.ref(!1),M=vue.ref(),L=vue.shallowRef(o.inputStyle),O=vue.computed(()=>w.value||S.value),{wrapperRef:re,isFocused:D,handleFocus:z,handleBlur:V}=useFocusController(O,{beforeFocus(){return _.value},afterBlur(){var Ue;o.validateEvent&&((Ue=g==null?void 0:g.validate)==null||Ue.call(g,"blur").catch(_n=>debugWarn(_n)))}}),j=vue.computed(()=>{var Ue;return(Ue=y==null?void 0:y.statusIcon)!=null?Ue:!1}),F=vue.computed(()=>(g==null?void 0:g.validateState)||""),Ce=vue.computed(()=>F.value&&ValidateComponentsMap[F.value]),le=vue.computed(()=>x.value?view_default:hide_default),pe=vue.computed(()=>[a.style]),$e=vue.computed(()=>[o.inputStyle,L.value,{resize:o.resize}]),Fe=vue.computed(()=>lodashEs.isNil(o.modelValue)?"":String(o.modelValue)),Oe=vue.computed(()=>o.clearable&&!_.value&&!o.readonly&&!!Fe.value&&(D.value||T.value)),Et=vue.computed(()=>o.showPassword&&!_.value&&!!Fe.value&&(!!Fe.value||D.value)),he=vue.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!_.value&&!o.readonly&&!o.showPassword),In=vue.computed(()=>Fe.value.length),vn=vue.computed(()=>!!he.value&&In.value>Number(o.maxlength)),kt=vue.computed(()=>!!u.suffix||!!o.suffixIcon||Oe.value||o.showPassword||he.value||!!F.value&&j.value),[ue,At]=useCursor(w);useResizeObserver(S,Ue=>{if(Pt(),!he.value||o.resize!=="both")return;const _n=Ue[0],{width:wn}=_n.contentRect;M.value={right:`calc(100% - ${wn+15+6}px)`}});const jt=()=>{const{type:Ue,autosize:_n}=o;if(!(!isClient||Ue!=="textarea"||!S.value))if(_n){const wn=isObject(_n)?_n.minRows:void 0,Tn=isObject(_n)?_n.maxRows:void 0,Ln=calcTextareaHeight(S.value,wn,Tn);L.value={overflowY:"hidden",...Ln},vue.nextTick(()=>{S.value.offsetHeight,L.value=Ln})}else L.value={minHeight:calcTextareaHeight(S.value).minHeight}},Pt=(Ue=>{let _n=!1;return()=>{var wn;if(_n||!o.autosize)return;((wn=S.value)==null?void 0:wn.offsetParent)===null||(Ue(),_n=!0)}})(jt),Ie=()=>{const Ue=O.value,_n=o.formatter?o.formatter(Fe.value):Fe.value;!Ue||Ue.value===_n||(Ue.value=_n)},de=async Ue=>{ue();let{value:_n}=Ue.target;if(o.formatter&&(_n=o.parser?o.parser(_n):_n),!xe.value){if(_n===Fe.value){Ie();return}n(UPDATE_MODEL_EVENT,_n),n("input",_n),await vue.nextTick(),Ie(),At()}},ze=Ue=>{n("change",Ue.target.value)},{isComposing:xe,handleCompositionStart:Ne,handleCompositionUpdate:Lt,handleCompositionEnd:Dt}=useComposition({emit:n,afterComposition:de}),Cn=()=>{x.value=!x.value,ie()},ie=async()=>{var Ue;await vue.nextTick(),(Ue=O.value)==null||Ue.focus()},ae=()=>{var Ue;return(Ue=O.value)==null?void 0:Ue.blur()},Y=Ue=>{T.value=!1,n("mouseleave",Ue)},k=Ue=>{T.value=!0,n("mouseenter",Ue)},$=Ue=>{n("keydown",Ue)},oe=()=>{var Ue;(Ue=O.value)==null||Ue.select()},_e=()=>{n(UPDATE_MODEL_EVENT,""),n("change",""),n("clear"),n("input","")};return vue.watch(()=>o.modelValue,()=>{var Ue;vue.nextTick(()=>jt()),o.validateEvent&&((Ue=g==null?void 0:g.validate)==null||Ue.call(g,"change").catch(_n=>debugWarn(_n)))}),vue.watch(Fe,()=>Ie()),vue.watch(()=>o.type,async()=>{await vue.nextTick(),Ie(),jt()}),vue.onMounted(()=>{!o.formatter&&o.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),Ie(),vue.nextTick(jt)}),r({input:w,textarea:S,ref:O,textareaStyle:$e,autosize:vue.toRef(o,"autosize"),isComposing:xe,focus:ie,blur:ae,select:oe,clear:_e,resizeTextarea:jt}),(Ue,_n)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps(vue.unref(c),{class:[vue.unref(d),{[vue.unref(b).bm("group","append")]:Ue.$slots.append,[vue.unref(b).bm("group","prepend")]:Ue.$slots.prepend}],style:vue.unref(pe),role:Ue.containerRole,onMouseenter:k,onMouseleave:Y}),[vue.createCommentVNode(" input "),Ue.type!=="textarea"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createCommentVNode(" prepend slot "),Ue.$slots.prepend?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(b).be("group","prepend"))},[vue.renderSlot(Ue.$slots,"prepend")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref_key:"wrapperRef",ref:re,class:vue.normalizeClass(vue.unref(f))},[vue.createCommentVNode(" prefix slot "),Ue.$slots.prefix||Ue.prefixIcon?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(b).e("prefix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("prefix-inner"))},[vue.renderSlot(Ue.$slots,"prefix"),Ue.prefixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ue.prefixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("input",vue.mergeProps({id:vue.unref(p),ref_key:"input",ref:w,class:vue.unref(b).e("inner")},vue.unref(h),{minlength:Ue.minlength,maxlength:Ue.maxlength,type:Ue.showPassword?x.value?"text":"password":Ue.type,disabled:vue.unref(_),readonly:Ue.readonly,autocomplete:Ue.autocomplete,tabindex:Ue.tabindex,"aria-label":Ue.ariaLabel,placeholder:Ue.placeholder,style:Ue.inputStyle,form:Ue.form,autofocus:Ue.autofocus,onCompositionstart:vue.unref(Ne),onCompositionupdate:vue.unref(Lt),onCompositionend:vue.unref(Dt),onInput:de,onChange:ze,onKeydown:$}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),vue.createCommentVNode(" suffix slot "),vue.unref(kt)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(vue.unref(b).e("suffix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("suffix-inner"))},[!vue.unref(Oe)||!vue.unref(Et)||!vue.unref(he)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.renderSlot(Ue.$slots,"suffix"),Ue.suffixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ue.suffixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],64)):vue.createCommentVNode("v-if",!0),vue.unref(Oe)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("clear")]),onMousedown:vue.withModifiers(vue.unref(NOOP),["prevent"]),onClick:_e},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_close_default))]),_:1},8,["class","onMousedown"])):vue.createCommentVNode("v-if",!0),vue.unref(Et)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("password")]),onClick:Cn},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(le))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.unref(he)?(vue.openBlock(),vue.createElementBlock("span",{key:3,class:vue.normalizeClass(vue.unref(b).e("count"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("count-inner"))},vue.toDisplayString(vue.unref(In))+" / "+vue.toDisplayString(Ue.maxlength),3)],2)):vue.createCommentVNode("v-if",!0),vue.unref(F)&&vue.unref(Ce)&&vue.unref(j)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:4,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("validateIcon"),vue.unref(b).is("loading",vue.unref(F)==="validating")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(Ce))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0)],2),vue.createCommentVNode(" append slot "),Ue.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(b).be("group","append"))},[vue.renderSlot(Ue.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" textarea "),vue.createElementVNode("textarea",vue.mergeProps({id:vue.unref(p),ref_key:"textarea",ref:S,class:[vue.unref(A).e("inner"),vue.unref(b).is("focus",vue.unref(D))]},vue.unref(h),{minlength:Ue.minlength,maxlength:Ue.maxlength,tabindex:Ue.tabindex,disabled:vue.unref(_),readonly:Ue.readonly,autocomplete:Ue.autocomplete,style:vue.unref($e),"aria-label":Ue.ariaLabel,placeholder:Ue.placeholder,form:Ue.form,autofocus:Ue.autofocus,rows:Ue.rows,onCompositionstart:vue.unref(Ne),onCompositionupdate:vue.unref(Lt),onCompositionend:vue.unref(Dt),onInput:de,onFocus:vue.unref(z),onBlur:vue.unref(V),onChange:ze,onKeydown:$}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),vue.unref(he)?(vue.openBlock(),vue.createElementBlock("span",{key:0,style:vue.normalizeStyle(M.value),class:vue.normalizeClass(vue.unref(b).e("count"))},vue.toDisplayString(vue.unref(In))+" / "+vue.toDisplayString(Ue.maxlength),7)):vue.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var Input=_export_sfc(_sfc_main$p,[["__file","input.vue"]]);const ElInput=withInstall(Input),GAP=4,BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},renderThumbStyle=({move:i,size:r,bar:n})=>({[n.size]:r,transform:`translate${n.axis}(${i}%)`}),scrollbarContextKey=Symbol("scrollbarContextKey"),thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),COMPONENT_NAME$2="Thumb",_sfc_main$o=vue.defineComponent({__name:"thumb",props:thumbProps,setup(i){const r=i,n=vue.inject(scrollbarContextKey),o=useNamespace("scrollbar");n||throwError(COMPONENT_NAME$2,"can not inject scrollbar context");const a=vue.ref(),u=vue.ref(),c=vue.ref({}),d=vue.ref(!1);let f=!1,h=!1,y=isClient?document.onselectstart:null;const g=vue.computed(()=>BAR_MAP[r.vertical?"vertical":"horizontal"]),p=vue.computed(()=>renderThumbStyle({size:r.size,move:r.move,bar:g.value})),v=vue.computed(()=>a.value[g.value.offset]**2/n.wrapElement[g.value.scrollSize]/r.ratio/u.value[g.value.offset]),_=L=>{var O;if(L.stopPropagation(),L.ctrlKey||[1,2].includes(L.button))return;(O=window.getSelection())==null||O.removeAllRanges(),A(L);const re=L.currentTarget;re&&(c.value[g.value.axis]=re[g.value.offset]-(L[g.value.client]-re.getBoundingClientRect()[g.value.direction]))},b=L=>{if(!u.value||!a.value||!n.wrapElement)return;const O=Math.abs(L.target.getBoundingClientRect()[g.value.direction]-L[g.value.client]),re=u.value[g.value.offset]/2,D=(O-re)*100*v.value/a.value[g.value.offset];n.wrapElement[g.value.scroll]=D*n.wrapElement[g.value.scrollSize]/100},A=L=>{L.stopImmediatePropagation(),f=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),y=document.onselectstart,document.onselectstart=()=>!1},w=L=>{if(!a.value||!u.value||f===!1)return;const O=c.value[g.value.axis];if(!O)return;const re=(a.value.getBoundingClientRect()[g.value.direction]-L[g.value.client])*-1,D=u.value[g.value.offset]-O,z=(re-D)*100*v.value/a.value[g.value.offset];n.wrapElement[g.value.scroll]=z*n.wrapElement[g.value.scrollSize]/100},S=()=>{f=!1,c.value[g.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),M(),h&&(d.value=!1)},T=()=>{h=!1,d.value=!!r.size},x=()=>{h=!0,d.value=f};vue.onBeforeUnmount(()=>{M(),document.removeEventListener("mouseup",S)});const M=()=>{document.onselectstart!==y&&(document.onselectstart=y)};return useEventListener(vue.toRef(n,"scrollbarElement"),"mousemove",T),useEventListener(vue.toRef(n,"scrollbarElement"),"mouseleave",x),(L,O)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(o).b("fade"),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{ref_key:"instance",ref:a,class:vue.normalizeClass([vue.unref(o).e("bar"),vue.unref(o).is(vue.unref(g).key)]),onMousedown:b},[vue.createElementVNode("div",{ref_key:"thumb",ref:u,class:vue.normalizeClass(vue.unref(o).e("thumb")),style:vue.normalizeStyle(vue.unref(p)),onMousedown:_},null,38)],34),[[vue.vShow,L.always||d.value]])]),_:1},8,["name"]))}});var Thumb=_export_sfc(_sfc_main$o,[["__file","thumb.vue"]]);const barProps=buildProps({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),_sfc_main$n=vue.defineComponent({__name:"bar",props:barProps,setup(i,{expose:r}){const n=i,o=vue.inject(scrollbarContextKey),a=vue.ref(0),u=vue.ref(0),c=vue.ref(""),d=vue.ref(""),f=vue.ref(1),h=vue.ref(1);return r({handleScroll:p=>{if(p){const v=p.offsetHeight-GAP,_=p.offsetWidth-GAP;u.value=p.scrollTop*100/v*f.value,a.value=p.scrollLeft*100/_*h.value}},update:()=>{const p=o==null?void 0:o.wrapElement;if(!p)return;const v=p.offsetHeight-GAP,_=p.offsetWidth-GAP,b=v**2/p.scrollHeight,A=_**2/p.scrollWidth,w=Math.max(b,n.minSize),S=Math.max(A,n.minSize);f.value=b/(v-b)/(w/(v-w)),h.value=A/(_-A)/(S/(_-S)),d.value=w+GAP<v?`${w}px`:"",c.value=S+GAP<_?`${S}px`:""}}),(p,v)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(Thumb,{move:a.value,ratio:h.value,size:c.value,always:p.always},null,8,["move","ratio","size","always"]),vue.createVNode(Thumb,{move:u.value,ratio:f.value,size:d.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}});var Bar=_export_sfc(_sfc_main$n,[["__file","bar.vue"]]);const scrollbarProps=buildProps({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:definePropType([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...useAriaProps(["ariaLabel","ariaOrientation"])}),scrollbarEmits={scroll:({scrollTop:i,scrollLeft:r})=>[i,r].every(isNumber)},COMPONENT_NAME$1="ElScrollbar",__default__$8=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$m=vue.defineComponent({...__default__$8,props:scrollbarProps,emits:scrollbarEmits,setup(i,{expose:r,emit:n}){const o=i,a=useNamespace("scrollbar");let u,c,d=0,f=0;const h=vue.ref(),y=vue.ref(),g=vue.ref(),p=vue.ref(),v=vue.computed(()=>{const M={};return o.height&&(M.height=addUnit(o.height)),o.maxHeight&&(M.maxHeight=addUnit(o.maxHeight)),[o.wrapStyle,M]}),_=vue.computed(()=>[o.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!o.native}]),b=vue.computed(()=>[a.e("view"),o.viewClass]),A=()=>{var M;y.value&&((M=p.value)==null||M.handleScroll(y.value),d=y.value.scrollTop,f=y.value.scrollLeft,n("scroll",{scrollTop:y.value.scrollTop,scrollLeft:y.value.scrollLeft}))};function w(M,L){isObject(M)?y.value.scrollTo(M):isNumber(M)&&isNumber(L)&&y.value.scrollTo(M,L)}const S=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}y.value.scrollTop=M},T=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}y.value.scrollLeft=M},x=()=>{var M;(M=p.value)==null||M.update()};return vue.watch(()=>o.noresize,M=>{M?(u==null||u(),c==null||c()):({stop:u}=useResizeObserver(g,x),c=useEventListener("resize",x))},{immediate:!0}),vue.watch(()=>[o.maxHeight,o.height],()=>{o.native||vue.nextTick(()=>{var M;x(),y.value&&((M=p.value)==null||M.handleScroll(y.value))})}),vue.provide(scrollbarContextKey,vue.reactive({scrollbarElement:h,wrapElement:y})),vue.onActivated(()=>{y.value&&(y.value.scrollTop=d,y.value.scrollLeft=f)}),vue.onMounted(()=>{o.native||vue.nextTick(()=>{x()})}),vue.onUpdated(()=>x()),r({wrapRef:y,update:x,scrollTo:w,setScrollTop:S,setScrollLeft:T,handleScroll:A}),(M,L)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"scrollbarRef",ref:h,class:vue.normalizeClass(vue.unref(a).b())},[vue.createElementVNode("div",{ref_key:"wrapRef",ref:y,class:vue.normalizeClass(vue.unref(_)),style:vue.normalizeStyle(vue.unref(v)),tabindex:M.tabindex,onScroll:A},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(M.tag),{id:M.id,ref_key:"resizeRef",ref:g,class:vue.normalizeClass(vue.unref(b)),style:vue.normalizeStyle(M.viewStyle),role:M.role,"aria-label":M.ariaLabel,"aria-orientation":M.ariaOrientation},{default:vue.withCtx(()=>[vue.renderSlot(M.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),M.native?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(Bar,{key:0,ref_key:"barRef",ref:p,always:M.always,"min-size":M.minSize},null,8,["always","min-size"]))],2))}});var Scrollbar=_export_sfc(_sfc_main$m,[["__file","scrollbar.vue"]]);const ElScrollbar=withInstall(Scrollbar),POPPER_INJECTION_KEY=Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=Symbol("popperContent"),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),__default__$7=vue.defineComponent({name:"ElPopper",inheritAttrs:!1}),_sfc_main$l=vue.defineComponent({...__default__$7,props:popperProps,setup(i,{expose:r}){const n=i,o=vue.ref(),a=vue.ref(),u=vue.ref(),c=vue.ref(),d=vue.computed(()=>n.role),f={triggerRef:o,popperInstanceRef:a,contentRef:u,referenceRef:c,role:d};return r(f),vue.provide(POPPER_INJECTION_KEY,f),(h,y)=>vue.renderSlot(h.$slots,"default")}});var Popper=_export_sfc(_sfc_main$l,[["__file","popper.vue"]]);const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),__default__$6=vue.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),_sfc_main$k=vue.defineComponent({...__default__$6,props:popperArrowProps,setup(i,{expose:r}){const n=i,o=useNamespace("popper"),{arrowOffset:a,arrowRef:u,arrowStyle:c}=vue.inject(POPPER_CONTENT_INJECTION_KEY,void 0);return vue.watch(()=>n.arrowOffset,d=>{a.value=d}),vue.onBeforeUnmount(()=>{u.value=void 0}),r({arrowRef:u}),(d,f)=>(vue.openBlock(),vue.createElementBlock("span",{ref_key:"arrowRef",ref:u,class:vue.normalizeClass(vue.unref(o).e("arrow")),style:vue.normalizeStyle(vue.unref(c)),"data-popper-arrow":""},null,6))}});var ElPopperArrow=_export_sfc(_sfc_main$k,[["__file","arrow.vue"]]);const NAME="ElOnlyChild",OnlyChild=vue.defineComponent({name:NAME,setup(i,{slots:r,attrs:n}){var o;const a=vue.inject(FORWARD_REF_INJECTION_KEY),u=useForwardRefDirective((o=a==null?void 0:a.setForwardRef)!=null?o:NOOP);return()=>{var c;const d=(c=r.default)==null?void 0:c.call(r,n);if(!d)return null;if(d.length>1)return debugWarn(NAME,"requires exact only one valid child."),null;const f=findFirstLegitChild(d);return f?vue.withDirectives(vue.cloneVNode(f,n),[[u]]):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(i){if(!i)return null;const r=i;for(const n of r){if(isObject(n))switch(n.type){case vue.Comment:continue;case vue.Text:case"svg":return wrapTextContent(n);case vue.Fragment:return findFirstLegitChild(n.children);default:return n}return wrapTextContent(n)}return null}function wrapTextContent(i){const r=useNamespace("only-child");return vue.createVNode("span",{class:r.e("content")},[i])}const popperTriggerProps=buildProps({virtualRef:{type:definePropType(Object)},virtualTriggering:Boolean,onMouseenter:{type:definePropType(Function)},onMouseleave:{type:definePropType(Function)},onClick:{type:definePropType(Function)},onKeydown:{type:definePropType(Function)},onFocus:{type:definePropType(Function)},onBlur:{type:definePropType(Function)},onContextmenu:{type:definePropType(Function)},id:String,open:Boolean}),__default__$5=vue.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),_sfc_main$j=vue.defineComponent({...__default__$5,props:popperTriggerProps,setup(i,{expose:r}){const n=i,{role:o,triggerRef:a}=vue.inject(POPPER_INJECTION_KEY,void 0);useForwardRef(a);const u=vue.computed(()=>d.value?n.id:void 0),c=vue.computed(()=>{if(o&&o.value==="tooltip")return n.open&&n.id?n.id:void 0}),d=vue.computed(()=>{if(o&&o.value!=="tooltip")return o.value}),f=vue.computed(()=>d.value?`${n.open}`:void 0);let h;const y=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return vue.onMounted(()=>{vue.watch(()=>n.virtualRef,g=>{g&&(a.value=unrefElement(g))},{immediate:!0}),vue.watch(a,(g,p)=>{h==null||h(),h=void 0,isElement(g)&&(y.forEach(v=>{var _;const b=n[v];b&&(g.addEventListener(v.slice(2).toLowerCase(),b),(_=p==null?void 0:p.removeEventListener)==null||_.call(p,v.slice(2).toLowerCase(),b))}),h=vue.watch([u,c,d,f],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((_,b)=>{lodashEs.isNil(v[b])?g.removeAttribute(_):g.setAttribute(_,v[b])})},{immediate:!0})),isElement(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),vue.onBeforeUnmount(()=>{if(h==null||h(),h=void 0,a.value&&isElement(a.value)){const g=a.value;y.forEach(p=>{const v=n[p];v&&g.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),r({triggerRef:a}),(g,p)=>g.virtualTriggering?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(OnlyChild),vue.mergeProps({key:0},g.$attrs,{"aria-controls":vue.unref(u),"aria-describedby":vue.unref(c),"aria-expanded":vue.unref(f),"aria-haspopup":vue.unref(d)}),{default:vue.withCtx(()=>[vue.renderSlot(g.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var ElPopperTrigger=_export_sfc(_sfc_main$j,[["__file","trigger.vue"]]);const FOCUS_AFTER_TRAPPED="focus-trap.focus-after-trapped",FOCUS_AFTER_RELEASED="focus-trap.focus-after-released",FOCUSOUT_PREVENTED="focus-trap.focusout-prevented",FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},ON_TRAP_FOCUS_EVT="focusAfterTrapped",ON_RELEASE_FOCUS_EVT="focusAfterReleased",FOCUS_TRAP_INJECTION_KEY=Symbol("elFocusTrap"),focusReason=vue.ref(),lastUserFocusTimestamp=vue.ref(0),lastAutomatedFocusTimestamp=vue.ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=i=>{const r=[],n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r},getVisibleElement=(i,r)=>{for(const n of i)if(!isHidden(n,r))return n},isHidden=(i,r)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(r&&i===r)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1},getEdges=i=>{const r=obtainAllFocusableElements(i),n=getVisibleElement(r,i),o=getVisibleElement(r.reverse(),i);return[n,o]},isSelectable=i=>i instanceof HTMLInputElement&&"select"in i,tryFocus=(i,r)=>{if(i&&i.focus){const n=document.activeElement;i.focus({preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),i!==n&&isSelectable(i)&&r&&i.select()}};function removeFromStack(i,r){const n=[...i],o=i.indexOf(r);return o!==-1&&n.splice(o,1),n}const createFocusableStack=()=>{let i=[];return{push:o=>{const a=i[0];a&&o!==a&&a.pause(),i=removeFromStack(i,o),i.unshift(o)},remove:o=>{var a,u;i=removeFromStack(i,o),(u=(a=i[0])==null?void 0:a.resume)==null||u.call(a)}}},focusFirstDescendant=(i,r=!1)=>{const n=document.activeElement;for(const o of i)if(tryFocus(o,r),document.activeElement!==n)return},focusableStack=createFocusableStack(),isFocusCausedByUserEvent=()=>lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value,notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},useFocusReason=()=>(vue.onMounted(()=>{focusReasonUserCount===0&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),vue.onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason,lastUserFocusTimestamp,lastAutomatedFocusTimestamp}),createFocusOutPreventedEvent=i=>new CustomEvent(FOCUSOUT_PREVENTED,{...FOCUSOUT_PREVENTED_OPTS,detail:i}),_sfc_main$i=vue.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[ON_TRAP_FOCUS_EVT,ON_RELEASE_FOCUS_EVT,"focusin","focusout","focusout-prevented","release-requested"],setup(i,{emit:r}){const n=vue.ref();let o,a;const{focusReason:u}=useFocusReason();useEscapeKeydown(_=>{i.trapped&&!c.paused&&r("release-requested",_)});const c={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},d=_=>{if(!i.loop&&!i.trapped||c.paused)return;const{key:b,altKey:A,ctrlKey:w,metaKey:S,currentTarget:T,shiftKey:x}=_,{loop:M}=i,L=b===EVENT_CODE.tab&&!A&&!w&&!S,O=document.activeElement;if(L&&O){const re=T,[D,z]=getEdges(re);if(D&&z){if(!x&&O===z){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||(_.preventDefault(),M&&tryFocus(D,!0))}else if(x&&[D,re].includes(O)){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||(_.preventDefault(),M&&tryFocus(z,!0))}}else if(O===re){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||_.preventDefault()}}};vue.provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:n,onKeydown:d}),vue.watch(()=>i.focusTrapEl,_=>{_&&(n.value=_)},{immediate:!0}),vue.watch([n],([_],[b])=>{_&&(_.addEventListener("keydown",d),_.addEventListener("focusin",y),_.addEventListener("focusout",g)),b&&(b.removeEventListener("keydown",d),b.removeEventListener("focusin",y),b.removeEventListener("focusout",g))});const f=_=>{r(ON_TRAP_FOCUS_EVT,_)},h=_=>r(ON_RELEASE_FOCUS_EVT,_),y=_=>{const b=vue.unref(n);if(!b)return;const A=_.target,w=_.relatedTarget,S=A&&b.contains(A);i.trapped||w&&b.contains(w)||(o=w),S&&r("focusin",_),!c.paused&&i.trapped&&(S?a=A:tryFocus(a,!0))},g=_=>{const b=vue.unref(n);if(!(c.paused||!b))if(i.trapped){const A=_.relatedTarget;!lodashEs.isNil(A)&&!b.contains(A)&&setTimeout(()=>{if(!c.paused&&i.trapped){const w=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",w),w.defaultPrevented||tryFocus(a,!0)}},0)}else{const A=_.target;A&&b.contains(A)||r("focusout",_)}};async function p(){await vue.nextTick();const _=vue.unref(n);if(_){focusableStack.push(c);const b=_.contains(document.activeElement)?o:document.activeElement;if(o=b,!_.contains(b)){const w=new Event(FOCUS_AFTER_TRAPPED,FOCUS_AFTER_TRAPPED_OPTS);_.addEventListener(FOCUS_AFTER_TRAPPED,f),_.dispatchEvent(w),w.defaultPrevented||vue.nextTick(()=>{let S=i.focusStartEl;isString(S)||(tryFocus(S),document.activeElement!==S&&(S="first")),S==="first"&&focusFirstDescendant(obtainAllFocusableElements(_),!0),(document.activeElement===b||S==="container")&&tryFocus(_)})}}}function v(){const _=vue.unref(n);if(_){_.removeEventListener(FOCUS_AFTER_TRAPPED,f);const b=new CustomEvent(FOCUS_AFTER_RELEASED,{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:u.value}});_.addEventListener(FOCUS_AFTER_RELEASED,h),_.dispatchEvent(b),!b.defaultPrevented&&(u.value=="keyboard"||!isFocusCausedByUserEvent()||_.contains(document.activeElement))&&tryFocus(o??document.body),_.removeEventListener(FOCUS_AFTER_RELEASED,h),focusableStack.remove(c)}}return vue.onMounted(()=>{i.trapped&&p(),vue.watch(()=>i.trapped,_=>{_?p():v()})}),vue.onBeforeUnmount(()=>{i.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",d),n.value.removeEventListener("focusin",y),n.value.removeEventListener("focusout",g),n.value=void 0)}),{onKeydown:d}}});function _sfc_render$4(i,r,n,o,a,u){return vue.renderSlot(i.$slots,"default",{handleKeydown:i.onKeydown})}var ElFocusTrap=_export_sfc(_sfc_main$i,[["render",_sfc_render$4],["__file","focus-trap.vue"]]);const POSITIONING_STRATEGIES=["fixed","absolute"],popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:definePropType(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:definePropType(Object),default:()=>({})},strategy:{type:String,values:POSITIONING_STRATEGIES,default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,id:String,style:{type:definePropType([String,Array,Object])},className:{type:definePropType([String,Array,Object])},effect:{type:definePropType(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:definePropType([String,Array,Object])},popperStyle:{type:definePropType([String,Array,Object])},referenceEl:{type:definePropType(Object)},triggerTargetEl:{type:definePropType(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...useAriaProps(["ariaLabel"])}),popperContentEmits={mouseenter:i=>i instanceof MouseEvent,mouseleave:i=>i instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},buildPopperOptions=(i,r=[])=>{const{placement:n,strategy:o,popperOptions:a}=i,u={placement:n,strategy:o,...a,modifiers:[...genModifiers(i),...r]};return deriveExtraModifiers(u,a==null?void 0:a.modifiers),u},unwrapMeasurableEl=i=>{if(isClient)return unrefElement(i)};function genModifiers(i){const{offset:r,gpuAcceleration:n,fallbackPlacements:o}=i;return[{name:"offset",options:{offset:[0,r??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:o}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function deriveExtraModifiers(i,r){r&&(i.modifiers=[...i.modifiers,...r??[]])}const DEFAULT_ARROW_OFFSET=0,usePopperContent=i=>{const{popperInstanceRef:r,contentRef:n,triggerRef:o,role:a}=vue.inject(POPPER_INJECTION_KEY,void 0),u=vue.ref(),c=vue.ref(),d=vue.computed(()=>({name:"eventListeners",enabled:!!i.visible})),f=vue.computed(()=>{var w;const S=vue.unref(u),T=(w=vue.unref(c))!=null?w:DEFAULT_ARROW_OFFSET;return{name:"arrow",enabled:!lodashEs.isUndefined(S),options:{element:S,padding:T}}}),h=vue.computed(()=>({onFirstUpdate:()=>{_()},...buildPopperOptions(i,[vue.unref(f),vue.unref(d)])})),y=vue.computed(()=>unwrapMeasurableEl(i.referenceEl)||vue.unref(o)),{attributes:g,state:p,styles:v,update:_,forceUpdate:b,instanceRef:A}=usePopper(y,n,h);return vue.watch(A,w=>r.value=w),vue.onMounted(()=>{vue.watch(()=>{var w;return(w=vue.unref(y))==null?void 0:w.getBoundingClientRect()},()=>{_()})}),{attributes:g,arrowRef:u,contentRef:n,instanceRef:A,state:p,styles:v,role:a,forceUpdate:b,update:_}},usePopperContentDOM=(i,{attributes:r,styles:n,role:o})=>{const{nextZIndex:a}=useZIndex(),u=useNamespace("popper"),c=vue.computed(()=>vue.unref(r).popper),d=vue.ref(isNumber(i.zIndex)?i.zIndex:a()),f=vue.computed(()=>[u.b(),u.is("pure",i.pure),u.is(i.effect),i.popperClass]),h=vue.computed(()=>[{zIndex:vue.unref(d)},vue.unref(n).popper,i.popperStyle||{}]),y=vue.computed(()=>o.value==="dialog"?"false":void 0),g=vue.computed(()=>vue.unref(n).arrow||{});return{ariaModal:y,arrowStyle:g,contentAttrs:c,contentClass:f,contentStyle:h,contentZIndex:d,updateZIndex:()=>{d.value=isNumber(i.zIndex)?i.zIndex:a()}}},usePopperContentFocusTrap=(i,r)=>{const n=vue.ref(!1),o=vue.ref();return{focusStartRef:o,trapped:n,onFocusAfterReleased:h=>{var y;((y=h.detail)==null?void 0:y.focusReason)!=="pointer"&&(o.value="first",r("blur"))},onFocusAfterTrapped:()=>{r("focus")},onFocusInTrap:h=>{i.visible&&!n.value&&(h.target&&(o.value=h.target),n.value=!0)},onFocusoutPrevented:h=>{i.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,r("close")}}},__default__$4=vue.defineComponent({name:"ElPopperContent"}),_sfc_main$h=vue.defineComponent({...__default__$4,props:popperContentProps,emits:popperContentEmits,setup(i,{expose:r,emit:n}){const o=i,{focusStartRef:a,trapped:u,onFocusAfterReleased:c,onFocusAfterTrapped:d,onFocusInTrap:f,onFocusoutPrevented:h,onReleaseRequested:y}=usePopperContentFocusTrap(o,n),{attributes:g,arrowRef:p,contentRef:v,styles:_,instanceRef:b,role:A,update:w}=usePopperContent(o),{ariaModal:S,arrowStyle:T,contentAttrs:x,contentClass:M,contentStyle:L,updateZIndex:O}=usePopperContentDOM(o,{styles:_,attributes:g,role:A}),re=vue.inject(formItemContextKey,void 0),D=vue.ref();vue.provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:T,arrowRef:p,arrowOffset:D}),re&&vue.provide(formItemContextKey,{...re,addInputId:NOOP,removeInputId:NOOP});let z;const V=(F=!0)=>{w(),F&&O()},j=()=>{V(!1),o.visible&&o.focusOnShow?u.value=!0:o.visible===!1&&(u.value=!1)};return vue.onMounted(()=>{vue.watch(()=>o.triggerTargetEl,(F,Ce)=>{z==null||z(),z=void 0;const le=vue.unref(F||v.value),pe=vue.unref(Ce||v.value);isElement(le)&&(z=vue.watch([A,()=>o.ariaLabel,S,()=>o.id],$e=>{["role","aria-label","aria-modal","id"].forEach((Fe,Oe)=>{lodashEs.isNil($e[Oe])?le.removeAttribute(Fe):le.setAttribute(Fe,$e[Oe])})},{immediate:!0})),pe!==le&&isElement(pe)&&["role","aria-label","aria-modal","id"].forEach($e=>{pe.removeAttribute($e)})},{immediate:!0}),vue.watch(()=>o.visible,j,{immediate:!0})}),vue.onBeforeUnmount(()=>{z==null||z(),z=void 0}),r({popperContentRef:v,popperInstanceRef:b,updatePopper:V,contentStyle:L}),(F,Ce)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({ref_key:"contentRef",ref:v},vue.unref(x),{style:vue.unref(L),class:vue.unref(M),tabindex:"-1",onMouseenter:le=>F.$emit("mouseenter",le),onMouseleave:le=>F.$emit("mouseleave",le)}),[vue.createVNode(vue.unref(ElFocusTrap),{trapped:vue.unref(u),"trap-on-focus-in":!0,"focus-trap-el":vue.unref(v),"focus-start-el":vue.unref(a),onFocusAfterTrapped:vue.unref(d),onFocusAfterReleased:vue.unref(c),onFocusin:vue.unref(f),onFocusoutPrevented:vue.unref(h),onReleaseRequested:vue.unref(y)},{default:vue.withCtx(()=>[vue.renderSlot(F.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var ElPopperContent=_export_sfc(_sfc_main$h,[["__file","content.vue"]]);const ElPopper=withInstall(Popper),TOOLTIP_INJECTION_KEY=Symbol("elTooltip"),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:definePropType([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:definePropType(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...useAriaProps(["ariaLabel"])}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:definePropType([String,Array]),default:"hover"},triggerKeys:{type:definePropType(Array),default:()=>[EVENT_CODE.enter,EVENT_CODE.space]}}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=createModelToggleComposable("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],isTriggerType=(i,r)=>isArray(i)?i.includes(r):i===r,whenTrigger=(i,r,n)=>o=>{isTriggerType(vue.unref(i),r)&&n(o)},__default__$3=vue.defineComponent({name:"ElTooltipTrigger"}),_sfc_main$g=vue.defineComponent({...__default__$3,props:useTooltipTriggerProps,setup(i,{expose:r}){const n=i,o=useNamespace("tooltip"),{controlled:a,id:u,open:c,onOpen:d,onClose:f,onToggle:h}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),y=vue.ref(null),g=()=>{if(vue.unref(a)||n.disabled)return!0},p=vue.toRef(n,"trigger"),v=composeEventHandlers(g,whenTrigger(p,"hover",d)),_=composeEventHandlers(g,whenTrigger(p,"hover",f)),b=composeEventHandlers(g,whenTrigger(p,"click",x=>{x.button===0&&h(x)})),A=composeEventHandlers(g,whenTrigger(p,"focus",d)),w=composeEventHandlers(g,whenTrigger(p,"focus",f)),S=composeEventHandlers(g,whenTrigger(p,"contextmenu",x=>{x.preventDefault(),h(x)})),T=composeEventHandlers(g,x=>{const{code:M}=x;n.triggerKeys.includes(M)&&(x.preventDefault(),h(x))});return r({triggerRef:y}),(x,M)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopperTrigger),{id:vue.unref(u),"virtual-ref":x.virtualRef,open:vue.unref(c),"virtual-triggering":x.virtualTriggering,class:vue.normalizeClass(vue.unref(o).e("trigger")),onBlur:vue.unref(w),onClick:vue.unref(b),onContextmenu:vue.unref(S),onFocus:vue.unref(A),onMouseenter:vue.unref(v),onMouseleave:vue.unref(_),onKeydown:vue.unref(T)},{default:vue.withCtx(()=>[vue.renderSlot(x.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ElTooltipTrigger=_export_sfc(_sfc_main$g,[["__file","trigger.vue"]]);const teleportProps=buildProps({to:{type:definePropType([String,Object]),required:!0},disabled:Boolean}),_sfc_main$f=vue.defineComponent({__name:"teleport",props:teleportProps,setup(i){return(r,n)=>r.disabled?vue.renderSlot(r.$slots,"default",{key:0}):(vue.openBlock(),vue.createBlock(vue.Teleport,{key:1,to:r.to},[vue.renderSlot(r.$slots,"default")],8,["to"]))}});var Teleport=_export_sfc(_sfc_main$f,[["__file","teleport.vue"]]);const ElTeleport=withInstall(Teleport),__default__$2=vue.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_sfc_main$e=vue.defineComponent({...__default__$2,props:useTooltipContentProps,setup(i,{expose:r}){const n=i,{selector:o}=usePopperContainerId(),a=useNamespace("tooltip"),u=vue.ref(null);let c;const{controlled:d,id:f,open:h,trigger:y,onClose:g,onOpen:p,onShow:v,onHide:_,onBeforeShow:b,onBeforeHide:A}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),w=vue.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),S=vue.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);vue.onBeforeUnmount(()=>{c==null||c()});const T=vue.computed(()=>vue.unref(S)?!0:vue.unref(h)),x=vue.computed(()=>n.disabled?!1:vue.unref(h)),M=vue.computed(()=>n.appendTo||o.value),L=vue.computed(()=>{var pe;return(pe=n.style)!=null?pe:{}}),O=vue.ref(!0),re=()=>{_(),O.value=!0},D=()=>{if(vue.unref(d))return!0},z=composeEventHandlers(D,()=>{n.enterable&&vue.unref(y)==="hover"&&p()}),V=composeEventHandlers(D,()=>{vue.unref(y)==="hover"&&g()}),j=()=>{var pe,$e;($e=(pe=u.value)==null?void 0:pe.updatePopper)==null||$e.call(pe),b==null||b()},F=()=>{A==null||A()},Ce=()=>{v(),c=onClickOutside(vue.computed(()=>{var pe;return(pe=u.value)==null?void 0:pe.popperContentRef}),()=>{if(vue.unref(d))return;vue.unref(y)!=="hover"&&g()})},le=()=>{n.virtualTriggering||g()};return vue.watch(()=>vue.unref(h),pe=>{pe?O.value=!1:c==null||c()},{flush:"post"}),vue.watch(()=>n.content,()=>{var pe,$e;($e=(pe=u.value)==null?void 0:pe.updatePopper)==null||$e.call(pe)}),r({contentRef:u}),(pe,$e)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTeleport),{disabled:!pe.teleported,to:vue.unref(M)},{default:vue.withCtx(()=>[vue.createVNode(vue.Transition,{name:vue.unref(w),onAfterLeave:re,onBeforeEnter:j,onAfterEnter:Ce,onBeforeLeave:F},{default:vue.withCtx(()=>[vue.unref(T)?vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElPopperContent),vue.mergeProps({key:0,id:vue.unref(f),ref_key:"contentRef",ref:u},pe.$attrs,{"aria-label":pe.ariaLabel,"aria-hidden":O.value,"boundaries-padding":pe.boundariesPadding,"fallback-placements":pe.fallbackPlacements,"gpu-acceleration":pe.gpuAcceleration,offset:pe.offset,placement:pe.placement,"popper-options":pe.popperOptions,strategy:pe.strategy,effect:pe.effect,enterable:pe.enterable,pure:pe.pure,"popper-class":pe.popperClass,"popper-style":[pe.popperStyle,vue.unref(L)],"reference-el":pe.referenceEl,"trigger-target-el":pe.triggerTargetEl,visible:vue.unref(x),"z-index":pe.zIndex,onMouseenter:vue.unref(z),onMouseleave:vue.unref(V),onBlur:le,onClose:vue.unref(g)}),{default:vue.withCtx(()=>[vue.renderSlot(pe.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[vue.vShow,vue.unref(x)]]):vue.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var ElTooltipContent=_export_sfc(_sfc_main$e,[["__file","content.vue"]]);const __default__$1=vue.defineComponent({name:"ElTooltip"}),_sfc_main$d=vue.defineComponent({...__default__$1,props:useTooltipProps,emits:tooltipEmits,setup(i,{expose:r,emit:n}){const o=i;usePopperContainer();const a=useId(),u=vue.ref(),c=vue.ref(),d=()=>{var w;const S=vue.unref(u);S&&((w=S.popperInstanceRef)==null||w.update())},f=vue.ref(!1),h=vue.ref(),{show:y,hide:g,hasUpdateHandler:p}=useTooltipModelToggle({indicator:f,toggleReason:h}),{onOpen:v,onClose:_}=useDelayedToggle({showAfter:vue.toRef(o,"showAfter"),hideAfter:vue.toRef(o,"hideAfter"),autoClose:vue.toRef(o,"autoClose"),open:y,close:g}),b=vue.computed(()=>isBoolean(o.visible)&&!p.value);vue.provide(TOOLTIP_INJECTION_KEY,{controlled:b,id:a,open:vue.readonly(f),trigger:vue.toRef(o,"trigger"),onOpen:w=>{v(w)},onClose:w=>{_(w)},onToggle:w=>{vue.unref(f)?_(w):v(w)},onShow:()=>{n("show",h.value)},onHide:()=>{n("hide",h.value)},onBeforeShow:()=>{n("before-show",h.value)},onBeforeHide:()=>{n("before-hide",h.value)},updatePopper:d}),vue.watch(()=>o.disabled,w=>{w&&f.value&&(f.value=!1)});const A=w=>{var S,T;const x=(T=(S=c.value)==null?void 0:S.contentRef)==null?void 0:T.popperContentRef,M=(w==null?void 0:w.relatedTarget)||document.activeElement;return x&&x.contains(M)};return vue.onDeactivated(()=>f.value&&g()),r({popperRef:u,contentRef:c,isFocusInsideContent:A,updatePopper:d,onOpen:v,onClose:_,hide:g}),(w,S)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopper),{ref_key:"popperRef",ref:u,role:w.role},{default:vue.withCtx(()=>[vue.createVNode(ElTooltipTrigger,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:vue.withCtx(()=>[w.$slots.default?vue.renderSlot(w.$slots,"default",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),vue.createVNode(ElTooltipContent,{ref_key:"contentRef",ref:c,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:vue.withCtx(()=>[vue.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(vue.openBlock(),vue.createElementBlock("span",{key:0,innerHTML:w.content},null,8,["innerHTML"])):(vue.openBlock(),vue.createElementBlock("span",{key:1},vue.toDisplayString(w.content),1))]),w.showArrow?(vue.openBlock(),vue.createBlock(vue.unref(ElPopperArrow),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):vue.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Tooltip=_export_sfc(_sfc_main$d,[["__file","tooltip.vue"]]);const ElTooltip=withInstall(Tooltip);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const nodeList=new Map;if(isClient){let i;document.addEventListener("mousedown",r=>i=r),document.addEventListener("mouseup",r=>{if(i){for(const n of nodeList.values())for(const{documentHandler:o}of n)o(r,i);i=void 0}})}function createDocumentHandler(i,r){let n=[];return Array.isArray(r.arg)?n=r.arg:isElement(r.arg)&&n.push(r.arg),function(o,a){const u=r.instance.popperRef,c=o.target,d=a==null?void 0:a.target,f=!r||!r.instance,h=!c||!d,y=i.contains(c)||i.contains(d),g=i===c,p=n.length&&n.some(_=>_==null?void 0:_.contains(c))||n.length&&n.includes(d),v=u&&(u.contains(c)||u.contains(d));f||h||y||g||p||v||r.value(o,a)}}const ClickOutside={beforeMount(i,r){nodeList.has(i)||nodeList.set(i,[]),nodeList.get(i).push({documentHandler:createDocumentHandler(i,r),bindingFn:r.value})},updated(i,r){nodeList.has(i)||nodeList.set(i,[]);const n=nodeList.get(i),o=n.findIndex(u=>u.bindingFn===r.oldValue),a={documentHandler:createDocumentHandler(i,r),bindingFn:r.value};o>=0?n.splice(o,1,a):n.push(a)},unmounted(i){nodeList.delete(i)}},tagProps=buildProps({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:componentSizes},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tagEmits={close:i=>i instanceof MouseEvent,click:i=>i instanceof MouseEvent},__default__=vue.defineComponent({name:"ElTag"}),_sfc_main$c=vue.defineComponent({...__default__,props:tagProps,emits:tagEmits,setup(i,{emit:r}){const n=i,o=useFormSize(),a=useNamespace("tag"),u=vue.computed(()=>{const{type:h,hit:y,effect:g,closable:p,round:v}=n;return[a.b(),a.is("closable",p),a.m(h||"primary"),a.m(o.value),a.m(g),a.is("hit",y),a.is("round",v)]}),c=h=>{r("close",h)},d=h=>{r("click",h)},f=h=>{h.component.subTree.component.bum=null};return(h,y)=>h.disableTransitions?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:h.color}),onClick:d},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(h.$slots,"default")],2),h.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,name:`${vue.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:f},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:h.color}),onClick:d},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(h.$slots,"default")],2),h.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Tag=_export_sfc(_sfc_main$c,[["__file","tag.vue"]]);const ElTag=withInstall(Tag),selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect");function useOption(i,r){const n=vue.inject(selectKey),o=vue.inject(selectGroupKey,{disabled:!1}),a=vue.computed(()=>y(lodashEs.castArray(n.props.modelValue),i.value)),u=vue.computed(()=>{var v;if(n.props.multiple){const _=lodashEs.castArray((v=n.props.modelValue)!=null?v:[]);return!a.value&&_.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),c=vue.computed(()=>i.label||(isObject(i.value)?"":i.value)),d=vue.computed(()=>i.value||i.label||""),f=vue.computed(()=>i.disabled||r.groupDisabled||u.value),h=vue.getCurrentInstance(),y=(v=[],_)=>{if(isObject(i.value)){const b=n.props.valueKey;return v&&v.some(A=>vue.toRaw(lodashEs.get(A,b))===lodashEs.get(_,b))}else return v&&v.includes(_)},g=()=>{!i.disabled&&!o.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(h.proxy))},p=v=>{const _=new RegExp(escapeStringRegexp(v),"i");r.visible=_.test(c.value)||i.created};return vue.watch(()=>c.value,()=>{!i.created&&!n.props.remote&&n.setSelected()}),vue.watch(()=>i.value,(v,_)=>{const{remote:b,valueKey:A}=n.props;if(v!==_&&(n.onOptionDestroy(_,h.proxy),n.onOptionCreate(h.proxy)),!i.created&&!b){if(A&&isObject(v)&&isObject(_)&&v[A]===_[A])return;n.setSelected()}}),vue.watch(()=>o.disabled,()=>{r.groupDisabled=o.disabled},{immediate:!0}),{select:n,currentLabel:c,currentValue:d,itemSelected:a,isDisabled:f,hoverItem:g,updateOption:p}}const _sfc_main$b=vue.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(i){const r=useNamespace("select"),n=useId(),o=vue.computed(()=>[r.be("dropdown","item"),r.is("disabled",vue.unref(d)),r.is("selected",vue.unref(c)),r.is("hovering",vue.unref(p))]),a=vue.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:u,itemSelected:c,isDisabled:d,select:f,hoverItem:h,updateOption:y}=useOption(i,a),{visible:g,hover:p}=vue.toRefs(a),v=vue.getCurrentInstance().proxy;f.onOptionCreate(v),vue.onBeforeUnmount(()=>{const b=v.value,{selected:A}=f.states,S=(f.props.multiple?A:[A]).some(T=>T.value===v.value);vue.nextTick(()=>{f.states.cachedOptions.get(b)===v&&!S&&f.states.cachedOptions.delete(b)}),f.onOptionDestroy(b,v)});function _(){d.value||f.handleOptionSelect(v)}return{ns:r,id:n,containerKls:o,currentLabel:u,itemSelected:c,isDisabled:d,select:f,hoverItem:h,updateOption:y,visible:g,hover:p,selectOptionClick:_,states:a}}});function _sfc_render$3(i,r,n,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("li",{id:i.id,class:vue.normalizeClass(i.containerKls),role:"option","aria-disabled":i.isDisabled||void 0,"aria-selected":i.itemSelected,onMouseenter:i.hoverItem,onClick:vue.withModifiers(i.selectOptionClick,["stop"])},[vue.renderSlot(i.$slots,"default",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[vue.vShow,i.visible]])}var Option=_export_sfc(_sfc_main$b,[["render",_sfc_render$3],["__file","option.vue"]]);const _sfc_main$a=vue.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const i=vue.inject(selectKey),r=useNamespace("select"),n=vue.computed(()=>i.props.popperClass),o=vue.computed(()=>i.props.multiple),a=vue.computed(()=>i.props.fitInputWidth),u=vue.ref("");function c(){var d;u.value=`${(d=i.selectRef)==null?void 0:d.offsetWidth}px`}return vue.onMounted(()=>{c(),useResizeObserver(i.selectRef,c)}),{ns:r,minWidth:u,popperClass:n,isMultiple:o,isFitInputWidth:a}}});function _sfc_render$2(i,r,n,o,a,u){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([i.ns.b("dropdown"),i.ns.is("multiple",i.isMultiple),i.popperClass]),style:vue.normalizeStyle({[i.isFitInputWidth?"width":"minWidth"]:i.minWidth})},[i.$slots.header?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("dropdown","header"))},[vue.renderSlot(i.$slots,"header")],2)):vue.createCommentVNode("v-if",!0),vue.renderSlot(i.$slots,"default"),i.$slots.footer?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.be("dropdown","footer"))},[vue.renderSlot(i.$slots,"footer")],2)):vue.createCommentVNode("v-if",!0)],6)}var ElSelectMenu=_export_sfc(_sfc_main$a,[["render",_sfc_render$2],["__file","select-dropdown.vue"]]);const MINIMUM_INPUT_WIDTH=11,useSelect=(i,r)=>{const{t:n}=useLocale(),o=useId(),a=useNamespace("select"),u=useNamespace("input"),c=vue.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),d=vue.ref(null),f=vue.ref(null),h=vue.ref(null),y=vue.ref(null),g=vue.ref(null),p=vue.ref(null),v=vue.ref(null),_=vue.ref(null),b=vue.ref(null),A=vue.ref(null),w=vue.ref(null),S=vue.ref(null),{isComposing:T,handleCompositionStart:x,handleCompositionUpdate:M,handleCompositionEnd:L}=useComposition({afterComposition:bn=>Tn(bn)}),{wrapperRef:O,isFocused:re,handleBlur:D}=useFocusController(g,{beforeFocus(){return $e.value},afterFocus(){i.automaticDropdown&&!z.value&&(z.value=!0,c.menuVisibleOnFocus=!0)},beforeBlur(bn){var En,Rn;return((En=h.value)==null?void 0:En.isFocusInsideContent(bn))||((Rn=y.value)==null?void 0:Rn.isFocusInsideContent(bn))},afterBlur(){z.value=!1,c.menuVisibleOnFocus=!1}}),z=vue.ref(!1),V=vue.ref(),{form:j,formItem:F}=useFormItem(),{inputId:Ce}=useFormItemInputId(i,{formItemContext:F}),{valueOnClear:le,isEmptyValue:pe}=useEmptyValues(i),$e=vue.computed(()=>i.disabled||(j==null?void 0:j.disabled)),Fe=vue.computed(()=>isArray(i.modelValue)?i.modelValue.length>0:!pe(i.modelValue)),Oe=vue.computed(()=>i.clearable&&!$e.value&&c.inputHovering&&Fe.value),Et=vue.computed(()=>i.remote&&i.filterable&&!i.remoteShowSuffix?"":i.suffixIcon),he=vue.computed(()=>a.is("reverse",Et.value&&z.value)),In=vue.computed(()=>(F==null?void 0:F.validateState)||""),vn=vue.computed(()=>ValidateComponentsMap[In.value]),kt=vue.computed(()=>i.remote?300:0),ue=vue.computed(()=>i.loading?i.loadingText||n("el.select.loading"):i.remote&&!c.inputValue&&c.options.size===0?!1:i.filterable&&c.inputValue&&c.options.size>0&&At.value===0?i.noMatchText||n("el.select.noMatch"):c.options.size===0?i.noDataText||n("el.select.noData"):null),At=vue.computed(()=>jt.value.filter(bn=>bn.visible).length),jt=vue.computed(()=>{const bn=Array.from(c.options.values()),En=[];return c.optionValues.forEach(Rn=>{const Pn=bn.findIndex(Dn=>Dn.value===Rn);Pn>-1&&En.push(bn[Pn])}),En.length>=bn.length?En:bn}),hn=vue.computed(()=>Array.from(c.cachedOptions.values())),Pt=vue.computed(()=>{const bn=jt.value.filter(En=>!En.created).some(En=>En.currentLabel===c.inputValue);return i.filterable&&i.allowCreate&&c.inputValue!==""&&!bn}),Ie=()=>{i.filterable&&isFunction(i.filterMethod)||i.filterable&&i.remote&&isFunction(i.remoteMethod)||jt.value.forEach(bn=>{var En;(En=bn.updateOption)==null||En.call(bn,c.inputValue)})},de=useFormSize(),ze=vue.computed(()=>["small"].includes(de.value)?"small":"default"),xe=vue.computed({get(){return z.value&&ue.value!==!1},set(bn){z.value=bn}}),Ne=vue.computed(()=>{if(i.multiple&&!isUndefined(i.modelValue))return lodashEs.castArray(i.modelValue).length===0&&!c.inputValue;const bn=isArray(i.modelValue)?i.modelValue[0]:i.modelValue;return i.filterable||isUndefined(bn)?!c.inputValue:!0}),Lt=vue.computed(()=>{var bn;const En=(bn=i.placeholder)!=null?bn:n("el.select.placeholder");return i.multiple||!Fe.value?En:c.selectedLabel}),Dt=vue.computed(()=>isIOS?null:"mouseenter");vue.watch(()=>i.modelValue,(bn,En)=>{i.multiple&&i.filterable&&!i.reserveKeyword&&(c.inputValue="",Cn("")),ae(),!lodashEs.isEqual(bn,En)&&i.validateEvent&&(F==null||F.validate("change").catch(Rn=>debugWarn(Rn)))},{flush:"post",deep:!0}),vue.watch(()=>z.value,bn=>{bn?Cn(c.inputValue):(c.inputValue="",c.previousQuery=null,c.isBeforeHide=!0),r("visible-change",bn)}),vue.watch(()=>c.options.entries(),()=>{var bn;if(!isClient)return;const En=((bn=d.value)==null?void 0:bn.querySelectorAll("input"))||[];(!i.filterable&&!i.defaultFirstOption&&!isUndefined(i.modelValue)||!Array.from(En).includes(document.activeElement))&&ae(),i.defaultFirstOption&&(i.filterable||i.remote)&&At.value&&ie()},{flush:"post"}),vue.watch(()=>c.hoveringIndex,bn=>{isNumber(bn)&&bn>-1?V.value=jt.value[bn]||{}:V.value={},jt.value.forEach(En=>{En.hover=V.value===En})}),vue.watchEffect(()=>{c.isBeforeHide||Ie()});const Cn=bn=>{c.previousQuery===bn||T.value||(c.previousQuery=bn,i.filterable&&isFunction(i.filterMethod)?i.filterMethod(bn):i.filterable&&i.remote&&isFunction(i.remoteMethod)&&i.remoteMethod(bn),i.defaultFirstOption&&(i.filterable||i.remote)&&At.value?vue.nextTick(ie):vue.nextTick(k))},ie=()=>{const bn=jt.value.filter(Pn=>Pn.visible&&!Pn.disabled&&!Pn.states.groupDisabled),En=bn.find(Pn=>Pn.created),Rn=bn[0];c.hoveringIndex=Mn(jt.value,En||Rn)},ae=()=>{if(i.multiple)c.selectedLabel="";else{const En=isArray(i.modelValue)?i.modelValue[0]:i.modelValue,Rn=Y(En);c.selectedLabel=Rn.currentLabel,c.selected=[Rn];return}const bn=[];isUndefined(i.modelValue)||lodashEs.castArray(i.modelValue).forEach(En=>{bn.push(Y(En))}),c.selected=bn},Y=bn=>{let En;const Rn=toRawType(bn).toLowerCase()==="object",Pn=toRawType(bn).toLowerCase()==="null",Dn=toRawType(bn).toLowerCase()==="undefined";for(let Zn=c.cachedOptions.size-1;Zn>=0;Zn--){const kn=hn.value[Zn];if(Rn?lodashEs.get(kn.value,i.valueKey)===lodashEs.get(bn,i.valueKey):kn.value===bn){En={value:bn,currentLabel:kn.currentLabel,get isDisabled(){return kn.isDisabled}};break}}if(En)return En;const $n=Rn?bn.label:!Pn&&!Dn?bn:"";return{value:bn,currentLabel:$n}},k=()=>{c.hoveringIndex=jt.value.findIndex(bn=>c.selected.some(En=>Jn(En)===Jn(bn)))},$=()=>{c.selectionWidth=f.value.getBoundingClientRect().width},oe=()=>{c.calculatorWidth=p.value.getBoundingClientRect().width},_e=()=>{c.collapseItemWidth=w.value.getBoundingClientRect().width},Ue=()=>{var bn,En;(En=(bn=h.value)==null?void 0:bn.updatePopper)==null||En.call(bn)},_n=()=>{var bn,En;(En=(bn=y.value)==null?void 0:bn.updatePopper)==null||En.call(bn)},wn=()=>{c.inputValue.length>0&&!z.value&&(z.value=!0),Cn(c.inputValue)},Tn=bn=>{if(c.inputValue=bn.target.value,i.remote)Ln();else return wn()},Ln=lodashEs.debounce(()=>{wn()},kt.value),Ve=bn=>{lodashEs.isEqual(i.modelValue,bn)||r(CHANGE_EVENT,bn)},qe=bn=>lodashEs.findLastIndex(bn,En=>!c.disabledOptions.has(En)),Sn=bn=>{if(i.multiple&&bn.code!==EVENT_CODE.delete&&bn.target.value.length<=0){const En=lodashEs.castArray(i.modelValue).slice(),Rn=qe(En);if(Rn<0)return;const Pn=En[Rn];En.splice(Rn,1),r(UPDATE_MODEL_EVENT,En),Ve(En),r("remove-tag",Pn)}},An=(bn,En)=>{const Rn=c.selected.indexOf(En);if(Rn>-1&&!$e.value){const Pn=lodashEs.castArray(i.modelValue).slice();Pn.splice(Rn,1),r(UPDATE_MODEL_EVENT,Pn),Ve(Pn),r("remove-tag",En.value)}bn.stopPropagation(),Fn()},xn=bn=>{bn.stopPropagation();const En=i.multiple?[]:le.value;if(i.multiple)for(const Rn of c.selected)Rn.isDisabled&&En.push(Rn.value);r(UPDATE_MODEL_EVENT,En),Ve(En),c.hoveringIndex=-1,z.value=!1,r("clear"),Fn()},Bn=bn=>{var En;if(i.multiple){const Rn=lodashEs.castArray((En=i.modelValue)!=null?En:[]).slice(),Pn=Mn(Rn,bn.value);Pn>-1?Rn.splice(Pn,1):(i.multipleLimit<=0||Rn.length<i.multipleLimit)&&Rn.push(bn.value),r(UPDATE_MODEL_EVENT,Rn),Ve(Rn),bn.created&&Cn(""),i.filterable&&!i.reserveKeyword&&(c.inputValue="")}else r(UPDATE_MODEL_EVENT,bn.value),Ve(bn.value),z.value=!1;Fn(),!z.value&&vue.nextTick(()=>{Gn(bn)})},Mn=(bn=[],En)=>{if(!isObject(En))return bn.indexOf(En);const Rn=i.valueKey;let Pn=-1;return bn.some((Dn,$n)=>vue.toRaw(lodashEs.get(Dn,Rn))===lodashEs.get(En,Rn)?(Pn=$n,!0):!1),Pn},Gn=bn=>{var En,Rn,Pn,Dn,$n;const Xn=isArray(bn)?bn[0]:bn;let Zn=null;if(Xn!=null&&Xn.value){const kn=jt.value.filter(qn=>qn.value===Xn.value);kn.length>0&&(Zn=kn[0].$el)}if(h.value&&Zn){const kn=(Dn=(Pn=(Rn=(En=h.value)==null?void 0:En.popperRef)==null?void 0:Rn.contentRef)==null?void 0:Pn.querySelector)==null?void 0:Dn.call(Pn,`.${a.be("dropdown","wrap")}`);kn&&scrollIntoView(kn,Zn)}($n=S.value)==null||$n.handleScroll()},Vn=bn=>{c.options.set(bn.value,bn),c.cachedOptions.set(bn.value,bn),bn.disabled&&c.disabledOptions.set(bn.value,bn)},Un=(bn,En)=>{c.options.get(bn)===En&&c.options.delete(bn)},jn=vue.computed(()=>{var bn,En;return(En=(bn=h.value)==null?void 0:bn.popperRef)==null?void 0:En.contentRef}),Kn=()=>{c.isBeforeHide=!1,vue.nextTick(()=>Gn(c.selected))},Fn=()=>{var bn;(bn=g.value)==null||bn.focus()},Hn=()=>{var bn;if(z.value){z.value=!1,vue.nextTick(()=>{var En;return(En=g.value)==null?void 0:En.blur()});return}(bn=g.value)==null||bn.blur()},zn=bn=>{xn(bn)},Yn=bn=>{if(z.value=!1,re.value){const En=new FocusEvent("focus",bn);vue.nextTick(()=>D(En))}},Wn=()=>{c.inputValue.length>0?c.inputValue="":z.value=!1},On=()=>{$e.value||(isIOS&&(c.inputHovering=!0),c.menuVisibleOnFocus?c.menuVisibleOnFocus=!1:z.value=!z.value)},Nn=()=>{z.value?jt.value[c.hoveringIndex]&&Bn(jt.value[c.hoveringIndex]):On()},Jn=bn=>isObject(bn.value)?lodashEs.get(bn.value,i.valueKey):bn.value,tr=vue.computed(()=>jt.value.filter(bn=>bn.visible).every(bn=>bn.disabled)),nr=vue.computed(()=>i.multiple?i.collapseTags?c.selected.slice(0,i.maxCollapseTags):c.selected:[]),rr=vue.computed(()=>i.multiple?i.collapseTags?c.selected.slice(i.maxCollapseTags):[]:[]),Qn=bn=>{if(!z.value){z.value=!0;return}if(!(c.options.size===0||c.filteredOptionsCount===0||T.value)&&!tr.value){bn==="next"?(c.hoveringIndex++,c.hoveringIndex===c.options.size&&(c.hoveringIndex=0)):bn==="prev"&&(c.hoveringIndex--,c.hoveringIndex<0&&(c.hoveringIndex=c.options.size-1));const En=jt.value[c.hoveringIndex];(En.disabled===!0||En.states.groupDisabled===!0||!En.visible)&&Qn(bn),vue.nextTick(()=>Gn(V.value))}},ir=()=>{if(!f.value)return 0;const bn=window.getComputedStyle(f.value);return Number.parseFloat(bn.gap||"6px")},or=vue.computed(()=>{const bn=ir();return{maxWidth:`${w.value&&i.maxCollapseTags===1?c.selectionWidth-c.collapseItemWidth-bn:c.selectionWidth}px`}}),ar=vue.computed(()=>({maxWidth:`${c.selectionWidth}px`})),sr=vue.computed(()=>({width:`${Math.max(c.calculatorWidth,MINIMUM_INPUT_WIDTH)}px`}));return useResizeObserver(f,$),useResizeObserver(p,oe),useResizeObserver(b,Ue),useResizeObserver(O,Ue),useResizeObserver(A,_n),useResizeObserver(w,_e),vue.onMounted(()=>{ae()}),{inputId:Ce,contentId:o,nsSelect:a,nsInput:u,states:c,isFocused:re,expanded:z,optionsArray:jt,hoverOption:V,selectSize:de,filteredOptionsCount:At,resetCalculatorWidth:oe,updateTooltip:Ue,updateTagTooltip:_n,debouncedOnInputChange:Ln,onInput:Tn,deletePrevTag:Sn,deleteTag:An,deleteSelected:xn,handleOptionSelect:Bn,scrollToOption:Gn,hasModelValue:Fe,shouldShowPlaceholder:Ne,currentPlaceholder:Lt,mouseEnterEventName:Dt,showClose:Oe,iconComponent:Et,iconReverse:he,validateState:In,validateIcon:vn,showNewOption:Pt,updateOptions:Ie,collapseTagSize:ze,setSelected:ae,selectDisabled:$e,emptyText:ue,handleCompositionStart:x,handleCompositionUpdate:M,handleCompositionEnd:L,onOptionCreate:Vn,onOptionDestroy:Un,handleMenuEnter:Kn,focus:Fn,blur:Hn,handleClearClick:zn,handleClickOutside:Yn,handleEsc:Wn,toggleMenu:On,selectOption:Nn,getValueKey:Jn,navigateOptions:Qn,dropdownMenuVisible:xe,showTagList:nr,collapseTagList:rr,tagStyle:or,collapseTagStyle:ar,inputStyle:sr,popperRef:jn,inputRef:g,tooltipRef:h,tagTooltipRef:y,calculatorRef:p,prefixRef:v,suffixRef:_,selectRef:d,wrapperRef:O,selectionRef:f,scrollbarRef:S,menuRef:b,tagMenuRef:A,collapseItemRef:w}};var ElOptions=vue.defineComponent({name:"ElOptions",setup(i,{slots:r}){const n=vue.inject(selectKey);let o=[];return()=>{var a,u;const c=(a=r.default)==null?void 0:a.call(r),d=[];function f(h){isArray(h)&&h.forEach(y=>{var g,p,v,_;const b=(g=(y==null?void 0:y.type)||{})==null?void 0:g.name;b==="ElOptionGroup"?f(!isString(y.children)&&!isArray(y.children)&&isFunction((p=y.children)==null?void 0:p.default)?(v=y.children)==null?void 0:v.default():y.children):b==="ElOption"?d.push((_=y.props)==null?void 0:_.value):isArray(y.children)&&f(y.children)})}return c.length&&f((u=c[0])==null?void 0:u.children),lodashEs.isEqual(d,o)||(o=d,n&&(n.states.optionValues=d)),c}}});const SelectProps=buildProps({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:useSizeProp,effect:{type:definePropType(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:definePropType(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:Boolean,suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},tagEffect:{...tagProps.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:definePropType(String),values:Ee,default:"bottom-start"},fallbackPlacements:{type:definePropType(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...useEmptyValuesProps,...useAriaProps(["ariaLabel"])}),COMPONENT_NAME="ElSelect",_sfc_main$9=vue.defineComponent({name:COMPONENT_NAME,componentName:COMPONENT_NAME,components:{ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:SelectProps,emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(i,{emit:r}){const n=vue.computed(()=>{const{modelValue:c,multiple:d}=i,f=d?[]:void 0;return isArray(c)?d?c:f:d?f:c}),o=vue.reactive({...vue.toRefs(i),modelValue:n}),a=useSelect(o,r);vue.provide(selectKey,vue.reactive({props:o,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected}));const u=vue.computed(()=>i.multiple?a.states.selected.map(c=>c.currentLabel):a.states.selectedLabel);return{...a,modelValue:n,selectedLabel:u}}});function _sfc_render$1(i,r,n,o,a,u){const c=vue.resolveComponent("el-tag"),d=vue.resolveComponent("el-tooltip"),f=vue.resolveComponent("el-icon"),h=vue.resolveComponent("el-option"),y=vue.resolveComponent("el-options"),g=vue.resolveComponent("el-scrollbar"),p=vue.resolveComponent("el-select-menu"),v=vue.resolveDirective("click-outside");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"selectRef",class:vue.normalizeClass([i.nsSelect.b(),i.nsSelect.m(i.selectSize)]),[vue.toHandlerKey(i.mouseEnterEventName)]:_=>i.states.inputHovering=!0,onMouseleave:_=>i.states.inputHovering=!1},[vue.createVNode(d,{ref:"tooltipRef",visible:i.dropdownMenuVisible,placement:i.placement,teleported:i.teleported,"popper-class":[i.nsSelect.e("popper"),i.popperClass],"popper-options":i.popperOptions,"fallback-placements":i.fallbackPlacements,effect:i.effect,pure:"",trigger:"click",transition:`${i.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:i.persistent,"append-to":i.appendTo,onBeforeShow:i.handleMenuEnter,onHide:_=>i.states.isBeforeHide=!1},{default:vue.withCtx(()=>{var _;return[vue.createElementVNode("div",{ref:"wrapperRef",class:vue.normalizeClass([i.nsSelect.e("wrapper"),i.nsSelect.is("focused",i.isFocused),i.nsSelect.is("hovering",i.states.inputHovering),i.nsSelect.is("filterable",i.filterable),i.nsSelect.is("disabled",i.selectDisabled)]),onClick:vue.withModifiers(i.toggleMenu,["prevent"])},[i.$slots.prefix?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"prefixRef",class:vue.normalizeClass(i.nsSelect.e("prefix"))},[vue.renderSlot(i.$slots,"prefix")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"selectionRef",class:vue.normalizeClass([i.nsSelect.e("selection"),i.nsSelect.is("near",i.multiple&&!i.$slots.prefix&&!!i.states.selected.length)])},[i.multiple?vue.renderSlot(i.$slots,"tag",{key:0},()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.showTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:i.getValueKey(b),class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{closable:!i.selectDisabled&&!b.isDisabled,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",style:vue.normalizeStyle(i.tagStyle),onClose:A=>i.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))},[vue.renderSlot(i.$slots,"label",{label:b.currentLabel,value:b.value},()=>[vue.createTextVNode(vue.toDisplayString(b.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),i.collapseTags&&i.states.selected.length>i.maxCollapseTags?(vue.openBlock(),vue.createBlock(d,{key:0,ref:"tagTooltipRef",disabled:i.dropdownMenuVisible||!i.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:i.effect,placement:"bottom",teleported:i.teleported},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"collapseItemRef",class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{closable:!1,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",style:vue.normalizeStyle(i.collapseTagStyle)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))}," + "+vue.toDisplayString(i.states.selected.length-i.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"tagMenuRef",class:vue.normalizeClass(i.nsSelect.e("selection"))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.collapseTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:i.getValueKey(b),class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{class:"in-tooltip",closable:!i.selectDisabled&&!b.isDisabled,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",onClose:A=>i.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))},[vue.renderSlot(i.$slots,"label",{label:b.currentLabel,value:b.value},()=>[vue.createTextVNode(vue.toDisplayString(b.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):vue.createCommentVNode("v-if",!0)]):vue.createCommentVNode("v-if",!0),i.selectDisabled?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass([i.nsSelect.e("selected-item"),i.nsSelect.e("input-wrapper"),i.nsSelect.is("hidden",!i.filterable)])},[vue.withDirectives(vue.createElementVNode("input",{id:i.inputId,ref:"inputRef","onUpdate:modelValue":b=>i.states.inputValue=b,type:"text",name:i.name,class:vue.normalizeClass([i.nsSelect.e("input"),i.nsSelect.is(i.selectSize)]),disabled:i.selectDisabled,autocomplete:i.autocomplete,style:vue.normalizeStyle(i.inputStyle),role:"combobox",readonly:!i.filterable,spellcheck:"false","aria-activedescendant":((_=i.hoverOption)==null?void 0:_.id)||"","aria-controls":i.contentId,"aria-expanded":i.dropdownMenuVisible,"aria-label":i.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[vue.withKeys(vue.withModifiers(b=>i.navigateOptions("next"),["stop","prevent"]),["down"]),vue.withKeys(vue.withModifiers(b=>i.navigateOptions("prev"),["stop","prevent"]),["up"]),vue.withKeys(vue.withModifiers(i.handleEsc,["stop","prevent"]),["esc"]),vue.withKeys(vue.withModifiers(i.selectOption,["stop","prevent"]),["enter"]),vue.withKeys(vue.withModifiers(i.deletePrevTag,["stop"]),["delete"])],onCompositionstart:i.handleCompositionStart,onCompositionupdate:i.handleCompositionUpdate,onCompositionend:i.handleCompositionEnd,onInput:i.onInput,onClick:vue.withModifiers(i.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[vue.vModelText,i.states.inputValue]]),i.filterable?(vue.openBlock(),vue.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:vue.normalizeClass(i.nsSelect.e("input-calculator")),textContent:vue.toDisplayString(i.states.inputValue)},null,10,["textContent"])):vue.createCommentVNode("v-if",!0)],2)),i.shouldShowPlaceholder?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass([i.nsSelect.e("selected-item"),i.nsSelect.e("placeholder"),i.nsSelect.is("transparent",!i.hasModelValue||i.expanded&&!i.states.inputValue)])},[i.hasModelValue?vue.renderSlot(i.$slots,"label",{key:0,label:i.currentPlaceholder,value:i.modelValue},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.currentPlaceholder),1)]):(vue.openBlock(),vue.createElementBlock("span",{key:1},vue.toDisplayString(i.currentPlaceholder),1))],2)):vue.createCommentVNode("v-if",!0)],2),vue.createElementVNode("div",{ref:"suffixRef",class:vue.normalizeClass(i.nsSelect.e("suffix"))},[i.iconComponent&&!i.showClose?(vue.openBlock(),vue.createBlock(f,{key:0,class:vue.normalizeClass([i.nsSelect.e("caret"),i.nsSelect.e("icon"),i.iconReverse])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.showClose&&i.clearIcon?(vue.openBlock(),vue.createBlock(f,{key:1,class:vue.normalizeClass([i.nsSelect.e("caret"),i.nsSelect.e("icon"),i.nsSelect.e("clear")]),onClick:i.handleClearClick},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.clearIcon)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.validateState&&i.validateIcon?(vue.openBlock(),vue.createBlock(f,{key:2,class:vue.normalizeClass([i.nsInput.e("icon"),i.nsInput.e("validateIcon")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.validateIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:vue.withCtx(()=>[vue.createVNode(p,{ref:"menuRef"},{default:vue.withCtx(()=>[i.$slots.header?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.nsSelect.be("dropdown","header")),onClick:vue.withModifiers(()=>{},["stop"])},[vue.renderSlot(i.$slots,"header")],10,["onClick"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(g,{id:i.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":i.nsSelect.be("dropdown","wrap"),"view-class":i.nsSelect.be("dropdown","list"),class:vue.normalizeClass([i.nsSelect.is("empty",i.filteredOptionsCount===0)]),role:"listbox","aria-label":i.ariaLabel,"aria-orientation":"vertical"},{default:vue.withCtx(()=>[i.showNewOption?(vue.openBlock(),vue.createBlock(h,{key:0,value:i.states.inputValue,created:!0},null,8,["value"])):vue.createCommentVNode("v-if",!0),vue.createVNode(y,null,{default:vue.withCtx(()=>[vue.renderSlot(i.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[vue.vShow,i.states.options.size>0&&!i.loading]]),i.$slots.loading&&i.loading?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.nsSelect.be("dropdown","loading"))},[vue.renderSlot(i.$slots,"loading")],2)):i.loading||i.filteredOptionsCount===0?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.nsSelect.be("dropdown","empty"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.emptyText),1)])],2)):vue.createCommentVNode("v-if",!0),i.$slots.footer?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(i.nsSelect.be("dropdown","footer")),onClick:vue.withModifiers(()=>{},["stop"])},[vue.renderSlot(i.$slots,"footer")],10,["onClick"])):vue.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,i.handleClickOutside,i.popperRef]])}var Select=_export_sfc(_sfc_main$9,[["render",_sfc_render$1],["__file","select.vue"]]);const _sfc_main$8=vue.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(i){const r=useNamespace("select"),n=vue.ref(null),o=vue.getCurrentInstance(),a=vue.ref([]);vue.provide(selectGroupKey,vue.reactive({...vue.toRefs(i)}));const u=vue.computed(()=>a.value.some(h=>h.visible===!0)),c=h=>{var y,g;return((y=h.type)==null?void 0:y.name)==="ElOption"&&!!((g=h.component)!=null&&g.proxy)},d=h=>{const y=lodashEs.castArray(h),g=[];return y.forEach(p=>{var v,_;c(p)?g.push(p.component.proxy):(v=p.children)!=null&&v.length?g.push(...d(p.children)):(_=p.component)!=null&&_.subTree&&g.push(...d(p.component.subTree))}),g},f=()=>{a.value=d(o.subTree)};return vue.onMounted(()=>{f()}),useMutationObserver(n,f,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:u,ns:r}}});function _sfc_render(i,r,n,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",{ref:"groupRef",class:vue.normalizeClass(i.ns.be("group","wrap"))},[vue.createElementVNode("li",{class:vue.normalizeClass(i.ns.be("group","title"))},vue.toDisplayString(i.label),3),vue.createElementVNode("li",null,[vue.createElementVNode("ul",{class:vue.normalizeClass(i.ns.b("group"))},[vue.renderSlot(i.$slots,"default")],2)])],2)),[[vue.vShow,i.visible]])}var OptionGroup=_export_sfc(_sfc_main$8,[["render",_sfc_render],["__file","option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const _hoisted_1$4={class:"c-wall-d"},_sfc_main$7=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:r}){const n=i,o=r,a=vue.computed({get(){return n.modelValue},set(d){o("update:modelValue",d)}}),u=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],c=d=>{d!=="None"&&(a.value.Relation={key:"",relation:"",val:"",val2:""}),o("update:modelValue",a)};return(d,f)=>{var h,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(a).type,"onUpdate:modelValue":f[0]||(f[0]=g=>vue.unref(a).type=g),onChange:c},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.key,"onUpdate:modelValue":f[1]||(f[1]=g=>vue.unref(a).Relation.key=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(a).Relation.relation,"onUpdate:modelValue":f[2]||(f[2]=g=>vue.unref(a).Relation.relation=g)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(u,(g,p)=>vue.createVNode(vue.unref(ElOption),{value:g.val,label:g.label,key:"rop"+p},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.val,"onUpdate:modelValue":f[3]||(f[3]=g=>vue.unref(a).Relation.val=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"&&(((h=vue.unref(a).Relation)==null?void 0:h.relation)===">=,=<"||((y=vue.unref(a).Relation)==null?void 0:y.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.val2,"onUpdate:modelValue":f[4]||(f[4]=g=>vue.unref(a).Relation.val2=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(i,{emit:r}){const n=useGlobalStore(pinia),o=r,a=i,u=vue.computed({get(){return a.modelValue!==null},set(g){let p=null;g&&(p={target_id:"",type:""}),o("update:modelValue",p)}}),c=vue.computed({get(){var g;return((g=a.modelValue)==null?void 0:g.target_id)??void 0},set(g){let p=null;u.value&&(p={target_id:g,type:d.value}),o("update:modelValue",p)}}),d=vue.computed({get(){var g;return((g=a.modelValue)==null?void 0:g.type)??void 0},set(g){let p=null;u.value&&(p={target_id:c.value,type:g}),o("update:modelValue",p)}}),f=vue.computed(()=>n.done_json.filter(g=>g.type!==EDoneJsonType.ConnectionLine).map(g=>({label:g.title,value:g.id}))),h=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function y(){vue.nextTick(function(){var g,p;if(u.value&&((g=a.modelValue)!=null&&g.target_id)&&((p=a.modelValue)!=null&&p.type)&&n.handle_svg_info){let v=null;for(let _ of n.done_json)_.id===a.modelValue.target_id&&(v=_);v&&(setSvgActualInfo(v),moveAnchors(v))}})}return(g,p)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:a.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(u),"onUpdate:modelValue":p[0]||(p[0]=v=>vue.isRef(u)?u.value=v:null),onChange:y},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(u)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(c),"onUpdate:modelValue":p[1]||(p[1]=v=>vue.isRef(c)?c.value=v:null),onChange:y},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(u)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(d),"onUpdate:modelValue":p[2]||(p[2]=v=>vue.isRef(d)?d.value=v:null),onChange:y},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(h,v=>vue.createVNode(vue.unref(elementPlus.ElOption),{key:v.value,label:v.label,value:v.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=i=>(vue.pushScopeId("data-v-501a0a37"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2=_withScopeId(()=>vue.createElementVNode("span",{style:{color:"#999"}},"(开启后这里无需配置)",-1)),_hoisted_3$1={key:2},_hoisted_4$1={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(i){const r=useConfigStore(pinia),n=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=vue.ref("page"),u=vue.ref("style"),c=(_,b)=>{_!=null&&_.common_animations&&(_.common_animations.val=b)};r.$subscribe((_,b)=>{_.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(b))});const d=vue.ref(numberArray(20)),f=vue.ref(["MQTT"]),h=vue.ref();h.value=()=>{var b,A;let _={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(A=(b=n.handle_svg_info)==null?void 0:b.info)==null||A.events.push(_)};const y=(_,b)=>{_==="ChangeAttr"?b.attrs=[{key:"",val:""}]:delete b.attrs},g=_=>{var b,A;(A=(b=n.handle_svg_info)==null?void 0:b.info)==null||A.events.splice(_,1)},p=()=>{o.center_offset={x:0,y:0}},v=(_,b,A)=>{vue.nextTick(function(){if(n.handle_svg_info){const w=n.done_json[n.handle_svg_info.index];A?setSvgActualInfo(w,A):setSvgActualInfo(w),moveAnchors(w)}})};return(_,b)=>vue.unref(n).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(a),"onUpdate:modelValue":b[14]||(b[14]=A=>vue.isRef(a)?a.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(r).svg.background_color,"onUpdate:modelValue":b[0]||(b[0]=A=>vue.unref(r).svg.background_color=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",onClick:p,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.x,"onUpdate:modelValue":b[1]||(b[1]=A=>vue.unref(o).center_offset.x=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.y,"onUpdate:modelValue":b[2]||(b[2]=A=>vue.unref(o).center_offset.y=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(r).svg.scale,"onUpdate:modelValue":b[3]||(b[3]=A=>vue.unref(r).svg.scale=A),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).svg.ruler,"onUpdate:modelValue":b[4]||(b[4]=A=>vue.unref(r).svg.ruler=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).svg.grid,"onUpdate:modelValue":b[5]||(b[5]=A=>vue.unref(r).svg.grid=A)},null,8,["modelValue"])]),_:1}),vue.unref(r).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(r).svg.grid_color,"onUpdate:modelValue":b[6]||(b[6]=A=>vue.unref(r).svg.grid_color=A)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(r).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(r).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:vue.unref(r).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(r).connection_line.animations.type.val,"onUpdate:modelValue":b[7]||(b[7]=A=>vue.unref(r).connection_line.animations.type.val=A),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).connection_line.animations.type.options,A=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(r).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(r).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(f),"onUpdate:modelValue":b[13]||(b[13]=A=>vue.isRef(f)?f.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"外部配置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).net.mqtt.useGlobalMqtt,"onUpdate:modelValue":b[8]||(b[8]=A=>vue.unref(r).net.mqtt.useGlobalMqtt=A)},null,8,["modelValue"]),_hoisted_2$2]),_:1}),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.url,"onUpdate:modelValue":b[9]||(b[9]=A=>vue.unref(r).net.mqtt.url=A),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.user,"onUpdate:modelValue":b[10]||(b[10]=A=>vue.unref(r).net.mqtt.user=A),placeholder:"username"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.pwd,"onUpdate:modelValue":b[11]||(b[11]=A=>vue.unref(r).net.mqtt.pwd=A),placeholder:"password"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.topics,"onUpdate:modelValue":b[12]||(b[12]=A=>vue.unref(r).net.mqtt.topics=A),placeholder:"topics"},null,8,["modelValue"])]),_:1}))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$u)]),_:1})]),_:1},8,["modelValue"])):vue.unref(n).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(n).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:vue.unref(u),"onUpdate:modelValue":b[35]||(b[35]=A=>vue.isRef(u)?u.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,S,T;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.title,"onUpdate:modelValue":b[15]||(b[15]=x=>vue.unref(n).handle_svg_info.info.title=x)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.x,"onUpdate:modelValue":b[16]||(b[16]=x=>vue.unref(n).handle_svg_info.info.x=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.y,"onUpdate:modelValue":b[17]||(b[17]=x=>vue.unref(n).handle_svg_info.info.y=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.scale_x,"onUpdate:modelValue":b[18]||(b[18]=x=>vue.unref(n).handle_svg_info.info.scale_x=x),onChange:v},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(w=(A=vue.unref(n).handle_svg_info)==null?void 0:A.info)==null?void 0:w.config.can_zoom]]),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.scale_y,"onUpdate:modelValue":b[19]||(b[19]=x=>vue.unref(n).handle_svg_info.info.scale_y=x),onChange:v},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(T=(S=vue.unref(n).handle_svg_info)==null?void 0:S.info)==null?void 0:T.config.can_zoom]]),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.rotate,"onUpdate:modelValue":b[20]||(b[20]=x=>vue.unref(n).handle_svg_info.info.rotate=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).handle_svg_info.info.display,"onUpdate:modelValue":b[21]||(b[21]=x=>vue.unref(n).handle_svg_info.info.display=x)},null,8,["modelValue"])]),_:1})]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,S,T,x,M,L,O;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.id,"onUpdate:modelValue":b[22]||(b[22]=re=>vue.unref(n).handle_svg_info.info.id=re)},null,8,["modelValue"])]),_:1}),(w=(A=vue.unref(n).handle_svg_info)==null?void 0:A.info)!=null&&w.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(n).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(T=(S=vue.unref(n).handle_svg_info)==null?void 0:S.info)!=null&&T.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.defaultState,"onUpdate:modelValue":b[23]||(b[23]=re=>vue.unref(n).handle_svg_info.info.defaultState=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.state,(re,D)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:"state"+String(D),label:re.label,value:D},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(x=vue.unref(n).handle_svg_info.info)!=null&&x.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(n).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.tag_slot,"onUpdate:modelValue":b[24]||(b[24]=re=>vue.unref(n).handle_svg_info.info.tag_slot=re),onInput:b[25]||(b[25]=re=>v(re,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).handle_svg_info.info.props,code:"",onChange:b[26]||(b[26]=re=>v(re,null,!0))},null,8,["obj-info"]),vue.unref(n).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:vue.unref(n).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":b[27]||(b[27]=re=>vue.unref(n).handle_svg_info.info.animations.type.val=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.animations.type.options,re=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:re.value,label:re.label,value:re.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((M=vue.unref(n).handle_svg_info.info.animations)==null?void 0:M.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(n).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((L=vue.unref(n).handle_svg_info)==null?void 0:L.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(n).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":b[28]||(b[28]=re=>vue.unref(n).handle_svg_info.info.bind_anchors.start=re),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((O=vue.unref(n).handle_svg_info)==null?void 0:O.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(n).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":b[29]||(b[29]=re=>vue.unref(n).handle_svg_info.info.bind_anchors.end=re),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(h)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(d),"onUpdate:modelValue":b[30]||(b[30]=A=>vue.isRef(d)?d.value=A:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.events,(A,w)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:w,key:"event"+w},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$1,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(w+1),1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(S=>g(w),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$E,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.type,"onUpdate:modelValue":S=>A.type=S},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.action,"onUpdate:modelValue":S=>A.action=S,onChange:S=>y(S,A)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"JavaScript",label:"执行 JavaScript"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Emit",label:"emit 事件"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:A.target,"onUpdate:modelValue":S=>A.target=S,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:A.attrs,"onUpdate:modelValue":S=>A.attrs=S},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),A.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$x,{modelValue:A.scripts,"onUpdate:modelValue":S=>A.scripts=S,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:A.condition,"onUpdate:modelValue":S=>A.condition=S},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var A;return[(A=vue.unref(n).handle_svg_info)!=null&&A.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(n).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:b[31]||(b[31]=w=>{var S;return c((S=vue.unref(n).handle_svg_info)==null?void 0:S.info,w)}),val:vue.unref(n).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":b[32]||(b[32]=w=>vue.unref(n).handle_svg_info.info.common_animations.delay=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":b[33]||(b[33]=w=>vue.unref(n).handle_svg_info.info.common_animations.speed=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":b[34]||(b[34]=w=>vue.unref(n).handle_svg_info.info.common_animations.repeat=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$u)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_501a0a37_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc$1(_sfc_main$5,[["__scopeId","data-v-501a0a37"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(i){const r=vue.ref(""),n=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return vue.onMounted(()=>{const u={layout_center:o.center_offset,config:a.$state,done_json:n.done_json};r.value=JSON.stringify(u,null,2)}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(r),"onUpdate:value":c[0]||(c[0]=d=>vue.isRef(r)?r.value=d:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"import-json",setup(i,{expose:r}){const n=vue.ref("");return r({setVal:u=>{n.value=u},onImportJson:()=>{useImportDataModel(n.value)&&elementPlus.ElMessage.success("导入成功")}}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":c[0]||(c[0]=d=>vue.isRef(n)?n.value=d:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(i,{emit:r}){const n=r,o=i,a=useSvgEditLayoutStore(pinia),u=useConfigStore(pinia),c=function(){return function(Ie,de,ze){Ie&&de&&ze&&Ie.addEventListener(de,ze,!1)}}(),d=function(){return function(Ie,de,ze){Ie&&de&&Ie.removeEventListener(de,ze,!1)}}();let f=18,h=vue.ref(0),y=vue.ref(0),g=vue.ref([]),p=vue.ref([]);const v=vue.ref([]);let _=vue.ref(!1),b="",A=vue.ref(-999),w=vue.ref(-999),S=18,T=18,x="";const M=vue.ref(null),L=vue.ref(null),O=vue.ref(null),re=vue.ref(null),D=vue.computed(()=>({width:h.value+"px",height:y.value+"px"})),z=vue.computed(()=>({padding:f+"px 0px 0px "+f+"px"})),V=vue.computed(()=>{let Ie=0,de=0;return v.value.map(ze=>{const xe=ze.type==="h";return{id:`${ze.type}_${xe?Ie++:de++}`,type:ze.type,title:ze.site.toFixed(0)+"px",[xe?"top":"left"]:ze.site*u.svg.scale+f+a.center_offset[xe?"y":"x"]*u.svg.scale}})});a.$subscribe(Ie=>{var de,ze,xe,Ne;((ze=(de=Ie.events)==null?void 0:de.target)!=null&&ze.hasOwnProperty("left_nav")||(Ne=(xe=Ie.events)==null?void 0:xe.target)!=null&&Ne.hasOwnProperty("right_nav"))&&window.setTimeout(j,420)}),u.$subscribe(Ie=>{var de,ze;(ze=(de=Ie.events)==null?void 0:de.target)!=null&&ze.hasOwnProperty("scale")&&$e()}),vue.onMounted(()=>{c(document,"mousemove",Oe),c(document,"mouseup",In),j(),c(window,"resize",F)}),vue.onBeforeUnmount(()=>{d(document,"mousemove",Oe),d(document,"mouseup",In),d(window,"resize",F)});const j=()=>{pe(),$e()},F=()=>{g.value=[],p.value=[],j()},Ce=({type:Ie,top:de,left:ze})=>Ie==="h"?{top:de+"px"}:{left:ze+"px"},le=({type:Ie,id:de})=>Ie==="h"?jt(de):hn(de),pe=()=>{const Ie=window.getComputedStyle(L.value.parentNode,null);h.value=parseInt(Ie.getPropertyValue("width")),y.value=parseInt(Ie.getPropertyValue("height")),S=O.value.clientWidth,T=re.value.clientHeight},$e=()=>{Fe(g.value,h.value,a.center_offset.x),Fe(p.value,y.value,a.center_offset.y)},Fe=(Ie,de,ze)=>{if(Ie.length===0)for(let xe=0;xe<de;xe+=o.stepLength)xe%o.stepLength===0&&Ie.push({id:myFixed(xe/u.svg.scale-ze,0)});else Ie.forEach((xe,Ne)=>{xe.id=myFixed(Ne*o.stepLength/u.svg.scale-ze,0)})},Oe=Ie=>{$e(),Et(Ie)},Et=Ie=>{if(!(Ie.layerX===Ie.x||Ie.layerY===Ie.y))switch(b){case"x":_.value&&(w.value=Ie.layerY);break;case"y":_.value&&(A.value=Ie.layerX);break;case"h":_.value&&(w.value=Ie.layerY);break;case"v":_.value&&(A.value=Ie.layerX);break}},he=Ie=>{_.value=!0,b=Ie},In=Ie=>{vn(Ie)},vn=Ie=>{if(_.value){switch(_.value=!1,b){case"x":const de=Math.round((Ie.layerY-f)/u.svg.scale-a.center_offset.y);if(de<=0){w.value=-999;return}v.value.push({type:"h",site:de});break;case"y":const ze=Math.round((Ie.layerX-f)/u.svg.scale-a.center_offset.x);if(ze<=0){A.value=-999;return}v.value.push({type:"v",site:ze});break;case"h":kt(v.value,Math.round((Ie.layerY-f)/u.svg.scale-a.center_offset.y),Math.round(T/u.svg.scale-a.center_offset.y),"h");break;case"v":kt(v.value,Math.round((Ie.layerX-f)/u.svg.scale-a.center_offset.x),Math.round(S/u.svg.scale-a.center_offset.x),"v");break}w.value=A.value=-999}},kt=(Ie,de,ze,xe)=>{if(de<ze){let Ne;V.value.forEach((Lt,Dt)=>{Lt.id===x&&(Ne=Dt)}),Ie.splice(Ne,1)}else{let Ne;V.value.forEach((Lt,Dt)=>{Lt.id===x&&(Ne=Dt)}),Ie.splice(Ne,1,{type:xe,site:de})}},ue=()=>{he("x")},At=()=>{he("y")},jt=Ie=>{_.value=!0,b="h",x=Ie},hn=Ie=>{_.value=!0,b="v",x=Ie},Pt=()=>{n("onLineMouseUp")};return(Ie,de)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref(D)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:L},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:re,class:"vue-ruler-h",onMousedown:vue.withModifiers(ue,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(ze,xe)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:xe*Ie.stepLength+"px"}),class:"n"},vue.toDisplayString(ze.id),5))),256))],544),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:O,class:"vue-ruler-v",onMousedown:vue.withModifiers(At,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(p),(ze,xe)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:xe*Ie.stepLength+"px"}),class:"n"},vue.toDisplayString(ze.id),5))),256))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(w)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(w)-vue.unref(T))/vue.unref(u).svg.scale-vue.unref(a).center_offset.y)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(A)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(A)-vue.unref(S))/vue.unref(u).svg.scale-vue.unref(a).center_offset.x)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(V),ze=>(vue.openBlock(),vue.createElementBlock("div",{title:ze.title,style:vue.normalizeStyle(Ce(ze)),key:ze.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ze.type}`),onMousedown:xe=>le(ze),onMouseup:Pt,onContextmenu:de[0]||(de[0]=(...xe)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...xe))},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,o.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:M,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(z))},[vue.renderSlot(Ie.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,vue.unref(_)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(i,r=new Date(Date.now()).toLocaleString()){const n=JSON.stringify(i),o=new Blob([n]);let a=document.createElement("a");a.download=r+".json",a.style.display="none",a.href=URL.createObjectURL(o),document.body.appendChild(a),a.click(),document.body.removeChild(a)}function fileRead(i){return new Promise((r,n)=>{let o=new FileReader;o.readAsText(i,"UTF-8"),o.onload=function(a){a&&a.target?r(a.target.result):n("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},vueComp:{},data:{},saveFile:{type:Boolean,default:!1},mqtt:{default:()=>({cover:!1,url:"",user:"",pwd:"",topics:""})}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:r,emit:n}){setEditorLoadTime();const o=n,a=i,u=useGlobalStore(pinia),c=useSvgEditLayoutStore(pinia),d=useConfigStore(pinia),f=useEditPrivateStore(pinia),h=vue.ref(),y=vue.ref(),g=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),p=(x,M)=>{g[x]=M},v=vue.ref();v.value=()=>{y.value.onImportJson(),p(EVisibleConfKey.ImportJson,!1)};const _=x=>["text/plain","application/json"].indexOf(x.type)<0?(elementPlus.ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(x).then(M=>{y.value.setVal(M),elementPlus.ElMessage.success("文件读取成功!")}),!1),b=x=>{u.setDoneJson(x)};vue.onMounted(()=>{f.history_doneComponent=[],f.history_now_index=0,a.data?useImportDataModel(a.data):u.setDoneJson([]),u.intention=EGlobalStoreIntention.None});const{appContext:A}=vue.getCurrentInstance();function w(x){o("onReturn",{data:x,isChange:f.getTopBtnUndoStatus})}function S(x){a.saveFile?elementPlus.ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},A).then(M=>{fileWrite(x,M.value.trim()),o("onSave",x)}).catch(M=>{console.log(M)}):o("onSave",x)}function T(){h.value.onCanvasMouseUp()}return vue.onMounted(()=>{var x,M,L,O,re;d.net.mqtt.useGlobalMqtt=!!((x=a.mqtt)!=null&&x.cover),d.net.mqtt.global.url=((M=a.mqtt)==null?void 0:M.url)||"",d.net.mqtt.global.user=((L=a.mqtt)==null?void 0:L.user)||"",d.net.mqtt.global.pwd=((O=a.mqtt)==null?void 0:O.pwd)||"",d.net.mqtt.global.topics=((re=a.mqtt)==null?void 0:re.topics)||""}),r({setGraphNodeJson:b}),(x,M)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:p,onOnReturn:w,onOnPreview:M[0]||(M[0]=L=>o("onPreview",L)),onOnSave:S})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(c).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":a.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref(d).svg.ruler,onOnLineMouseUp:T},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:h,vueComp:a.vueComp},{background:vue.withCtx(()=>[vue.renderSlot(x.$slots,"background",{},void 0,!0)]),_:3},8,["vueComp"])]),_:3},8,["visible"])])]),_:3}),vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(c).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:3})]),_:3}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(g).ImportJson,"onUpdate:modelValue":M[2]||(M[2]=L=>vue.unref(g).ImportJson=L),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElUpload),{beforeUpload:_,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[1]||(M[1]=L=>p(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:vue.unref(v)},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:y},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(g).ExportJson,"onUpdate:modelValue":M[3]||(M[3]=L=>vue.unref(g).ExportJson=L),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_7097d2ce_lang="",index=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-7097d2ce"]]);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,r){(function(n){i.exports=n()})(function(){return function(){function n(o,a,u){function c(h,y){if(!a[h]){if(!o[h]){var g=typeof commonjsRequire=="function"&&commonjsRequire;if(!y&&g)return g(h,!0);if(d)return d(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var v=a[h]={exports:{}};o[h][0].call(v.exports,function(_){var b=o[h][1][_];return c(b||_)},v,v.exports,n,o,a,u)}return a[h].exports}for(var d=typeof commonjsRequire=="function"&&commonjsRequire,f=0;f<u.length;f++)c(u[f]);return c}return n}()({1:[function(n,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0}),a.TypedEventEmitter=void 0;const c=u(n("events")),d=n("./shared");class f{}a.TypedEventEmitter=f,(0,d.applyMixin)(f,c.default)},{"./shared":17,events:49}],2:[function(n,o,a){(function(u,c){(function(){var d=this&&this.__createBinding||(Object.create?function(V,j,F,Ce){Ce===void 0&&(Ce=F);var le=Object.getOwnPropertyDescriptor(j,F);(!le||("get"in le?!j.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return j[F]}}),Object.defineProperty(V,Ce,le)}:function(V,j,F,Ce){Ce===void 0&&(Ce=F),V[Ce]=j[F]}),f=this&&this.__setModuleDefault||(Object.create?function(V,j){Object.defineProperty(V,"default",{enumerable:!0,value:j})}:function(V,j){V.default=j}),h=this&&this.__importStar||function(V){if(V&&V.__esModule)return V;var j={};if(V!=null)for(var F in V)F!=="default"&&Object.prototype.hasOwnProperty.call(V,F)&&d(j,V,F);return f(j,V),j},y=this&&this.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(a,"__esModule",{value:!0});const g=y(n("./topic-alias-recv")),p=y(n("mqtt-packet")),v=y(n("./default-message-id-provider")),_=n("readable-stream"),b=y(n("reinterval")),A=y(n("rfdc/default")),w=h(n("./validations")),S=y(n("debug")),T=y(n("./store")),x=y(n("./handlers")),M=n("./TypedEmitter"),L=u?u.nextTick:V=>{setTimeout(V,0)},O=c.setImmediate||((...V)=>{const j=V.shift();L(()=>{j(...V)})}),re={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},D=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class z extends M.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(j,F){super(),this.options=F||{};for(const Ce in re)typeof this.options[Ce]>"u"?this.options[Ce]=re[Ce]:this.options[Ce]=F[Ce];this.log=this.options.log||(0,S.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",F.protocol),this.log("MqttClient :: options.protocolVersion",F.protocolVersion),this.log("MqttClient :: options.username",F.username),this.log("MqttClient :: options.keepalive",F.keepalive),this.log("MqttClient :: options.reconnectPeriod",F.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",F.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",F.properties?F.properties.topicAliasMaximum:void 0),this.options.clientId=typeof F.clientId=="string"?F.clientId:z.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=F.protocolVersion===5&&F.customHandleAcks?F.customHandleAcks:(...Ce)=>{Ce[3](null,0)},this.options.writeCache||(p.default.writeToStream.cacheNumbers=!1),this.streamBuilder=j,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new v.default:this.options.messageIdProvider,this.outgoingStore=F.outgoingStore||new T.default,this.incomingStore=F.incomingStore||new T.default,this.queueQoSZero=F.queueQoSZero===void 0?!0:F.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,F.properties&&F.properties.topicAliasMaximum>0&&(F.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default(F.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:Ce}=this,le=()=>{const pe=Ce.shift();this.log("deliver :: entry %o",pe);let $e=null;if(!pe){this._resubscribe();return}$e=pe.packet,this.log("deliver :: call _sendPacket for %o",$e);let Fe=!0;$e.messageId&&$e.messageId!==0&&(this.messageIdProvider.register($e.messageId)||(Fe=!1)),Fe?this._sendPacket($e,Oe=>{pe.cb&&pe.cb(Oe),le()}):(this.log("messageId: %d has already used. The message is skipped and removed.",$e.messageId),le())};this.log("connect :: sending queued packets"),le()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(j,F){F()}handleMessage(j,F){F()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var j;const F=new _.Writable,Ce=p.default.parser(this.options);let le=null;const pe=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),Ce.on("packet",he=>{this.log("parser :: on packet push to packets array."),pe.push(he)});const $e=()=>{this.log("work :: getting next packet in queue");const he=pe.shift();if(he)this.log("work :: packet pulled from queue"),(0,x.default)(this,he,Fe);else{this.log("work :: no packets in queue");const In=le;le=null,this.log("work :: done flag is %s",!!In),In&&In()}},Fe=()=>{if(pe.length)L($e);else{const he=le;le=null,he()}};F._write=(he,In,vn)=>{le=vn,this.log("writable stream :: parsing buffer"),Ce.parse(he),$e()};const Oe=he=>{this.log("streamErrorHandler :: error",he.message),D.includes(he.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",he)):this.noop(he)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(F),this.stream.on("error",Oe),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const Et={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(Et.will=Object.assign(Object.assign({},this.options.will),{payload:(j=this.options.will)===null||j===void 0?void 0:j.payload})),this.topicAliasRecv&&(Et.properties||(Et.properties={}),this.topicAliasRecv&&(Et.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(Et),Ce.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.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 he=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(he)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(j,F,Ce,le){this.log("publish :: message `%s` to topic `%s`",F,j);const{options:pe}=this;typeof Ce=="function"&&(le=Ce,Ce=null),Ce=Ce||{},Ce=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),Ce);const{qos:Fe,retain:Oe,dup:Et,properties:he,cbStorePut:In}=Ce;if(this._checkDisconnecting(le))return this;const vn=()=>{let kt=0;if((Fe===1||Fe===2)&&(kt=this._nextId(),kt===null))return this.log("No messageId left"),!1;const ue={cmd:"publish",topic:j,payload:F,qos:Fe,retain:Oe,messageId:kt,dup:Et};switch(pe.protocolVersion===5&&(ue.properties=he),this.log("publish :: qos",Fe),Fe){case 1:case 2:this.outgoing[ue.messageId]={volatile:!1,cb:le||this.noop},this.log("MqttClient:publish: packet cmd: %s",ue.cmd),this._sendPacket(ue,void 0,In);break;default:this.log("MqttClient:publish: packet cmd: %s",ue.cmd),this._sendPacket(ue,le,In);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,cbStorePut:Ce.cbStorePut,callback:le}),this}publishAsync(j,F,Ce){return new Promise((le,pe)=>{this.publish(j,F,Ce,($e,Fe)=>{$e?pe($e):le(Fe)})})}subscribe(j,F,Ce){const le=this.options.protocolVersion;typeof F=="function"&&(Ce=F),Ce=Ce||this.noop;let pe=!1,$e=[];typeof j=="string"?(j=[j],$e=j):Array.isArray(j)?$e=j:typeof j=="object"&&(pe=j.resubscribe,delete j.resubscribe,$e=Object.keys(j));const Fe=w.validateTopics($e);if(Fe!==null)return O(Ce,new Error(`Invalid topic ${Fe}`)),this;if(this._checkDisconnecting(Ce))return this.log("subscribe: discconecting true"),this;const Oe={qos:0};le===5&&(Oe.nl=!1,Oe.rap=!1,Oe.rh=0),F=Object.assign(Object.assign({},Oe),F);const Et=F.properties,he=[],In=(kt,ue)=>{if(ue=ue||F,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,kt)||this._resubscribeTopics[kt].qos<ue.qos||pe){const At={topic:kt,qos:ue.qos};le===5&&(At.nl=ue.nl,At.rap=ue.rap,At.rh=ue.rh,At.properties=Et),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",At.topic,At.qos),he.push(At)}};if(Array.isArray(j)?j.forEach(kt=>{this.log("subscribe: array topic %s",kt),In(kt)}):Object.keys(j).forEach(kt=>{this.log("subscribe: object topic %s, %o",kt,j[kt]),In(kt,j[kt])}),!he.length)return Ce(null,[]),this;const vn=()=>{const kt=this._nextId();if(kt===null)return this.log("No messageId left"),!1;const ue={cmd:"subscribe",subscriptions:he,messageId:kt};if(Et&&(ue.properties=Et),this.options.resubscribe){this.log("subscribe :: resubscribe true");const At=[];he.forEach(jt=>{if(this.options.reconnectPeriod>0){const hn={qos:jt.qos};le===5&&(hn.nl=jt.nl||!1,hn.rap=jt.rap||!1,hn.rh=jt.rh||0,hn.properties=jt.properties),this._resubscribeTopics[jt.topic]=hn,At.push(jt.topic)}}),this.messageIdToTopic[ue.messageId]=At}return this.outgoing[ue.messageId]={volatile:!0,cb(At,jt){if(!At){const{granted:hn}=jt;for(let Pt=0;Pt<hn.length;Pt+=1)he[Pt].qos=hn[Pt]}Ce(At,he)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(ue),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,callback:Ce}),this}subscribeAsync(j,F){return new Promise((Ce,le)=>{this.subscribe(j,F,(pe,$e)=>{pe?le(pe):Ce($e)})})}unsubscribe(j,F,Ce){typeof j=="string"&&(j=[j]),typeof F=="function"&&(Ce=F),Ce=Ce||this.noop;const le=w.validateTopics(j);if(le!==null)return O(Ce,new Error(`Invalid topic ${le}`)),this;if(this._checkDisconnecting(Ce))return this;const pe=()=>{const $e=this._nextId();if($e===null)return this.log("No messageId left"),!1;const Fe={cmd:"unsubscribe",messageId:$e,unsubscriptions:[]};return typeof j=="string"?Fe.unsubscriptions=[j]:Array.isArray(j)&&(Fe.unsubscriptions=j),this.options.resubscribe&&Fe.unsubscriptions.forEach(Oe=>{delete this._resubscribeTopics[Oe]}),typeof F=="object"&&F.properties&&(Fe.properties=F.properties),this.outgoing[Fe.messageId]={volatile:!0,cb:Ce},this.log("unsubscribe: call _sendPacket"),this._sendPacket(Fe),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!pe())&&this._storeProcessingQueue.push({invoke:pe,callback:Ce}),this}unsubscribeAsync(j,F){return new Promise((Ce,le)=>{this.unsubscribe(j,F,(pe,$e)=>{pe?le(pe):Ce($e)})})}end(j,F,Ce){this.log("end :: (%s)",this.options.clientId),(j==null||typeof j!="boolean")&&(Ce=Ce||F,F=j,j=!1),typeof F!="object"&&(Ce=Ce||F,F=null),this.log("end :: cb? %s",!!Ce),(!Ce||typeof Ce!="function")&&(Ce=this.noop);const le=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close($e=>{this.outgoingStore.close(Fe=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),Ce){const Oe=$e||Fe;this.log("end :: closeStores: invoking callback with args"),Ce(Oe)}})}),this._deferredReconnect&&this._deferredReconnect()},pe=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,j),this._cleanUp(j,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),L(le)},F)};return this.disconnecting?(Ce(),this):(this._clearReconnect(),this.disconnecting=!0,!j&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,pe,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),pe()),this)}endAsync(j,F){return new Promise((Ce,le)=>{this.end(j,F,pe=>{pe?le(pe):Ce()})})}removeOutgoingMessage(j){if(this.outgoing[j]){const{cb:F}=this.outgoing[j];this._removeOutgoingAndStoreMessage(j,()=>{F(new Error("Message removed"))})}return this}reconnect(j){this.log("client reconnect");const F=()=>{j?(this.options.incomingStore=j.incomingStore,this.options.outgoingStore=j.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new T.default,this.outgoingStore=this.options.outgoingStore||new T.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=F:F(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(j=>{this.outgoing[j].volatile&&typeof this.outgoing[j].cb=="function"&&(this.outgoing[j].cb(new Error("Connection closed")),delete this.outgoing[j])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(j=>{typeof this.outgoing[j].cb=="function"&&(this.outgoing[j].cb(new Error("Connection closed")),delete this.outgoing[j])}))}_removeTopicAliasAndRecoverTopicName(j){let F;j.properties&&(F=j.properties.topicAlias);let Ce=j.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",F,Ce),Ce.length===0){if(typeof F>"u")return new Error("Unregistered Topic Alias");if(Ce=this.topicAliasSend.getTopicByAlias(F),typeof Ce>"u")return new Error("Unregistered Topic Alias");j.topic=Ce}F&&delete j.properties.topicAlias}_checkDisconnecting(j){return this.disconnecting&&(j&&j!==this.noop?j(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(j,F,Ce={}){if(F&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",F)),this.log("_cleanUp :: forced? %s",j),j)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const le=Object.assign({cmd:"disconnect"},Ce);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(le,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),O(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),F&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",F),F())}_storeAndSend(j,F,Ce){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",j.cmd);let le=j,pe;if(le.cmd==="publish"&&(le=(0,A.default)(j),pe=this._removeTopicAliasAndRecoverTopicName(le),pe))return F&&F(pe);this.outgoingStore.put(le,$e=>{if($e)return F&&F($e);Ce(),this._writePacket(j,F)})}_applyTopicAlias(j){if(this.options.protocolVersion===5&&j.cmd==="publish"){let F;j.properties&&(F=j.properties.topicAlias);const Ce=j.topic.toString();if(this.topicAliasSend)if(F){if(Ce.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",Ce,F),!this.topicAliasSend.put(Ce,F)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",Ce,F),new Error("Sending Topic Alias out of range")}else Ce.length!==0&&(this.options.autoAssignTopicAlias?(F=this.topicAliasSend.getAliasByTopic(Ce),F?(j.topic="",j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",Ce,F)):(F=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(Ce,F),j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",Ce,F))):this.options.autoUseTopicAlias&&(F=this.topicAliasSend.getAliasByTopic(Ce),F&&(j.topic="",j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",Ce,F))));else if(F)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",Ce,F),new Error("Sending Topic Alias out of range")}}_noop(j){this.log("noop ::",j)}_writePacket(j,F){this.log("_writePacket :: packet: %O",j),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",j),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const Ce=p.default.writeToStream(j,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",Ce),!Ce&&F&&F!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",F)):F&&(this.log("_writePacket :: invoking cb"),F())}_sendPacket(j,F,Ce,le){this.log("_sendPacket :: (%s) :: start",this.options.clientId),Ce=Ce||this.noop,F=F||this.noop;const pe=this._applyTopicAlias(j);if(pe){F(pe);return}if(!this.connected){if(j.cmd==="auth"){this._writePacket(j,F);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(j,F,Ce);return}if(le){this._writePacket(j,F);return}switch(j.cmd){case"publish":break;case"pubrel":this._storeAndSend(j,F,Ce);return;default:this._writePacket(j,F);return}switch(j.qos){case 2:case 1:this._storeAndSend(j,F,Ce);break;case 0:default:this._writePacket(j,F);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(j,F,Ce){this.log("_storePacket :: packet: %o",j),this.log("_storePacket :: cb? %s",!!F),Ce=Ce||this.noop;let le=j;if(le.cmd==="publish"){le=(0,A.default)(j);const $e=this._removeTopicAliasAndRecoverTopicName(le);if($e)return F&&F($e)}const pe=le.qos||0;pe===0&&this.queueQoSZero||le.cmd!=="publish"?this.queue.push({packet:le,cb:F}):pe>0?(F=this.outgoing[le.messageId]?this.outgoing[le.messageId].cb:null,this.outgoingStore.put(le,$e=>{if($e)return F&&F($e);Ce()})):F&&F(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,b.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const j=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&j.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let F=0;F<j.length;F++){const Ce={};Ce[j[F]]=this._resubscribeTopics[j[F]],Ce.resubscribe=!0,this.subscribe(Ce,{properties:Ce[j[F]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(j){if(this.disconnected){this.emit("connect",j);return}this.connackPacket=j,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const F=()=>{let Ce=this.outgoingStore.createStream();const le=()=>{Ce.destroy(),Ce=null,this._flushStoreProcessingQueue(),pe()},pe=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",le),Ce.on("error",Fe=>{pe(),this._flushStoreProcessingQueue(),this.removeListener("close",le),this.emit("error",Fe)});const $e=()=>{if(!Ce)return;const Fe=Ce.read(1);let Oe;if(!Fe){Ce.once("readable",$e);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[Fe.messageId]){$e();return}!this.disconnecting&&!this.reconnectTimer?(Oe=this.outgoing[Fe.messageId]?this.outgoing[Fe.messageId].cb:null,this.outgoing[Fe.messageId]={volatile:!1,cb(Et,he){Oe&&Oe(Et,he),$e()}},this._packetIdsDuringStoreProcessing[Fe.messageId]=!0,this.messageIdProvider.register(Fe.messageId)?this._sendPacket(Fe,void 0,void 0,!0):this.log("messageId: %d has already used.",Fe.messageId)):Ce.destroy&&Ce.destroy()};Ce.on("end",()=>{let Fe=!0;for(const Oe in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[Oe]){Fe=!1;break}Fe?(pe(),this.removeListener("close",le),this._invokeAllStoreProcessingQueue(),this.emit("connect",j)):F()}),$e()};F()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const j=this._storeProcessingQueue[0];if(j&&j.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const j of this._storeProcessingQueue)j.cbStorePut&&j.cbStorePut(new Error("Connection closed")),j.callback&&j.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(j,F){delete this.outgoing[j],this.outgoingStore.del({messageId:j},(Ce,le)=>{F(Ce,le),this.messageIdProvider.deallocate(j),this._invokeStoreProcessingQueue()})}}a.default=z}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(n,o,a){var u=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=n("readable-stream"),f=u(n("duplexify"));let h,y,g,p=!1;function v(){const S=new d.Transform;return S._write=(T,x,M)=>{h.sendSocketMessage({data:T.buffer,success(){M()},fail(){M(new Error)}})},S._flush=T=>{h.closeSocket({success(){T()}})},S}function _(S){S.hostname||(S.hostname="localhost"),S.path||(S.path="/"),S.wsOptions||(S.wsOptions={})}function b(S,T){const x=S.protocol==="alis"?"wss":"ws";let M=`${x}://${S.hostname}${S.path}`;return S.port&&S.port!==80&&S.port!==443&&(M=`${x}://${S.hostname}:${S.port}${S.path}`),typeof S.transformWsUrl=="function"&&(M=S.transformWsUrl(M,S,T)),M}function A(){p||(p=!0,h.onSocketOpen(()=>{g.setReadable(y),g.setWritable(y),g.emit("connect")}),h.onSocketMessage(S=>{if(typeof S.data=="string"){const T=c.Buffer.from(S.data,"base64");y.push(T)}else{const T=new FileReader;T.addEventListener("load",()=>{let x=T.result;x instanceof ArrayBuffer?x=c.Buffer.from(x):x=c.Buffer.from(x,"utf8"),y.push(x)}),T.readAsArrayBuffer(S.data)}}),h.onSocketClose(()=>{g.end(),g.destroy()}),h.onSocketError(S=>{g.destroy(S)}))}const w=(S,T)=>{if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");const x=T.protocolId==="MQIsdp"&&T.protocolVersion===3?"mqttv3.1":"mqtt";_(T);const M=b(T,S);return h=T.my,h.connectSocket({url:M,protocols:x}),y=v(),g=f.default.obj(),A(),g};a.default=w},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(n,o,a){var u=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(a,"__esModule",{value:!0}),a.connectAsync=void 0;const c=u(n("debug")),d=u(n("url")),f=u(n("../client")),h=u(n("../is-browser")),y=(0,c.default)("mqttjs"),g={};h.default?(g.wx=n("./wx").default,g.wxs=n("./wx").default,g.ali=n("./ali").default,g.alis=n("./ali").default):(g.mqtt=n("./tcp").default,g.tcp=n("./tcp").default,g.ssl=n("./tls").default,g.tls=g.ssl,g.mqtts=n("./tls").default),g.ws=n("./ws").default,g.wss=n("./ws").default;function p(b){let A;b.auth&&(A=b.auth.match(/^(.+):(.+)$/),A?(b.username=A[1],b.password=A[2]):b.username=b.auth)}function v(b,A){if(y("connecting to an MQTT broker..."),typeof b=="object"&&!A&&(A=b,b=""),A=A||{},b&&typeof b=="string"){const T=d.default.parse(b,!0);if(T.port!=null&&(T.port=Number(T.port)),A=Object.assign(Object.assign({},T),A),A.protocol===null)throw new Error("Missing protocol");A.protocol=A.protocol.replace(/:$/,"")}if(p(A),A.query&&typeof A.query.clientId=="string"&&(A.clientId=A.query.clientId),A.cert&&A.key)if(A.protocol){if(["mqtts","wss","wxs","alis"].indexOf(A.protocol)===-1)switch(A.protocol){case"mqtt":A.protocol="mqtts";break;case"ws":A.protocol="wss";break;case"wx":A.protocol="wxs";break;case"ali":A.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${A.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!g[A.protocol]){const T=["mqtts","wss"].indexOf(A.protocol)!==-1;A.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((x,M)=>T&&M%2===0?!1:typeof g[x]=="function")[0]}if(A.clean===!1&&!A.clientId)throw new Error("Missing clientId for unclean clients");A.protocol&&(A.defaultProtocol=A.protocol);function w(T){return A.servers&&((!T._reconnectCount||T._reconnectCount===A.servers.length)&&(T._reconnectCount=0),A.host=A.servers[T._reconnectCount].host,A.port=A.servers[T._reconnectCount].port,A.protocol=A.servers[T._reconnectCount].protocol?A.servers[T._reconnectCount].protocol:A.defaultProtocol,A.hostname=A.host,T._reconnectCount++),y("calling streambuilder for",A.protocol),g[A.protocol](T,A)}const S=new f.default(w,A);return S.on("error",()=>{}),S}function _(b,A,w=!0){return new Promise((S,T)=>{const x=v(b,A),M={connect:O=>{L(),S(x)},end:()=>{L(),S(x)},error:O=>{L(),x.end(),T(O)}};w===!1&&(M.close=()=>{M.error(new Error("Couldn't connect to server"))});function L(){Object.keys(M).forEach(O=>{x.off(O,M[O])})}Object.keys(M).forEach(O=>{x.on(O,M[O])})})}a.connectAsync=_,a.default=v},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(n,o,a){var u=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("net")),f=(0,u(n("debug")).default)("mqttjs:tcp"),h=(y,g)=>{g.port=g.port||1883,g.hostname=g.hostname||g.host||"localhost";const{port:p}=g,v=g.hostname;return f("port %d and host %s",p,v),c.default.createConnection(p,v)};a.default=h},{debug:30,net:26}],6:[function(n,o,a){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("tls")),d=u(n("net")),h=(0,u(n("debug")).default)("mqttjs:tls"),y=(g,p)=>{p.port=p.port||8883,p.host=p.hostname||p.host||"localhost",d.default.isIP(p.host)===0&&(p.servername=p.host),p.rejectUnauthorized=p.rejectUnauthorized!==!1,delete p.path,h("port %d host %s rejectUnauthorized %b",p.port,p.host,p.rejectUnauthorized);const v=c.default.connect(p);v.on("secureConnect",()=>{p.rejectUnauthorized&&!v.authorized?v.emit("error",new Error("TLS not authorized")):v.removeListener("error",_)});function _(b){p.rejectUnauthorized&&g.emit("error",b),v.end()}return v.on("error",_),v};a.default=y},{debug:30,net:26,tls:26}],7:[function(n,o,a){var u=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=u(n("ws")),f=u(n("debug")),h=u(n("duplexify")),y=n("readable-stream"),g=u(n("../is-browser")),p=(0,f.default)("mqttjs:ws"),v=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function _(M,L){let O=`${M.protocol}://${M.hostname}:${M.port}${M.path}`;return typeof M.transformWsUrl=="function"&&(O=M.transformWsUrl(O,M,L)),O}function b(M){const L=M;return M.hostname||(L.hostname="localhost"),M.port||(M.protocol==="wss"?L.port=443:L.port=80),M.path||(L.path="/"),M.wsOptions||(L.wsOptions={}),!g.default&&M.protocol==="wss"&&v.forEach(O=>{Object.prototype.hasOwnProperty.call(M,O)&&!Object.prototype.hasOwnProperty.call(M.wsOptions,O)&&(L.wsOptions[O]=M[O])}),L}function A(M){const L=b(M);if(L.hostname||(L.hostname=L.host),!L.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const O=new URL(document.URL);L.hostname=O.hostname,L.port||(L.port=Number(O.port))}return L.objectMode===void 0&&(L.objectMode=!(L.binary===!0||L.binary===void 0)),L}function w(M,L,O){p("createWebSocket"),p(`protocol: ${O.protocolId} ${O.protocolVersion}`);const re=O.protocolId==="MQIsdp"&&O.protocolVersion===3?"mqttv3.1":"mqtt";p(`creating new Websocket for url: ${L} and protocol: ${re}`);let D;return O.createWebsocket?D=O.createWebsocket(L,[re],O):D=new d.default(L,[re],O.wsOptions),D}function S(M,L){const O=L.protocolId==="MQIsdp"&&L.protocolVersion===3?"mqttv3.1":"mqtt",re=_(L,M);let D;return L.createWebsocket?D=L.createWebsocket(re,[O],L):D=new WebSocket(re,[O]),D.binaryType="arraybuffer",D}const T=(M,L)=>{p("streamBuilder");const O=b(L),re=_(O,M),D=w(M,re,O),z=d.default.createWebSocketStream(D,O.wsOptions);return z.url=re,D.on("close",()=>{z.destroy()}),z},x=(M,L)=>{p("browserStreamBuilder");let O;const D=A(L).browserBufferSize||1024*512,z=L.browserBufferTimeout||1e3,V=!L.objectMode,j=S(M,L),F=le(L,he,In);L.objectMode||(F._writev=Et),F.on("close",()=>{j.close()});const Ce=typeof j.addEventListener<"u";j.readyState===j.OPEN?O=F:(O=(0,h.default)(void 0,void 0,L),L.objectMode||(O._writev=Et),Ce?j.addEventListener("open",pe):j.onopen=pe),O.socket=j,Ce?(j.addEventListener("close",$e),j.addEventListener("error",Fe),j.addEventListener("message",Oe)):(j.onclose=$e,j.onerror=Fe,j.onmessage=Oe);function le(vn,kt,ue){const At=new y.Transform({objectMode:vn.objectMode});return At._write=kt,At._flush=ue,At}function pe(){O.setReadable(F),O.setWritable(F),O.emit("connect")}function $e(){O.end(),O.destroy()}function Fe(vn){O.destroy(vn)}function Oe(vn){let{data:kt}=vn;kt instanceof ArrayBuffer?kt=c.Buffer.from(kt):kt=c.Buffer.from(kt,"utf8"),F.push(kt)}function Et(vn,kt){const ue=new Array(vn.length);for(let At=0;At<vn.length;At++)typeof vn[At].chunk=="string"?ue[At]=c.Buffer.from(vn[At],"utf8"):ue[At]=vn[At].chunk;this._write(c.Buffer.concat(ue),"binary",kt)}function he(vn,kt,ue){j.bufferedAmount>D&&setTimeout(he,z,vn,kt,ue),V&&typeof vn=="string"&&(vn=c.Buffer.from(vn,"utf8"));try{j.send(vn)}catch(At){return ue(At)}ue()}function In(vn){j.close(),vn()}return O};a.default=g.default?x:T},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(n,o,a){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=n("readable-stream"),f=u(n("duplexify"));let h,y,g;function p(){const w=new d.Transform;return w._write=(S,T,x)=>{h.send({data:S.buffer,success(){x()},fail(M){x(new Error(M))}})},w._flush=S=>{h.close({success(){S()}})},w}function v(w){w.hostname||(w.hostname="localhost"),w.path||(w.path="/"),w.wsOptions||(w.wsOptions={})}function _(w,S){const T=w.protocol==="wxs"?"wss":"ws";let x=`${T}://${w.hostname}${w.path}`;return w.port&&w.port!==80&&w.port!==443&&(x=`${T}://${w.hostname}:${w.port}${w.path}`),typeof w.transformWsUrl=="function"&&(x=w.transformWsUrl(x,w,S)),x}function b(){h.onOpen(()=>{g.setReadable(y),g.setWritable(y),g.emit("connect")}),h.onMessage(w=>{let{data:S}=w;S instanceof ArrayBuffer?S=c.Buffer.from(S):S=c.Buffer.from(S,"utf8"),y.push(S)}),h.onClose(()=>{g.emit("close"),g.end(),g.destroy()}),h.onError(w=>{g.destroy(new Error(w.errMsg))})}const A=(w,S)=>{if(S.hostname=S.hostname||S.host,!S.hostname)throw new Error("Could not determine host. Specify host manually.");const T=S.protocolId==="MQIsdp"&&S.protocolVersion===3?"mqttv3.1":"mqtt";v(S);const x=_(S,w);h=wx.connectSocket({url:x,protocols:[T]}),y=p(),g=f.default.obj(),g._destroy=(L,O)=>{h.close({success(){O&&O(L)}})};const M=g.destroy;return g.destroy=()=>{g.destroy=M,setTimeout(()=>{h.close({fail(){g._destroy(new Error)}})},0)},b(),g};a.default=A},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){const d=this.nextId++;return this.nextId===65536&&(this.nextId=1),d}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(d){return!0}deallocate(d){}clear(){}}a.default=u},{}],10:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=void 0,a.ReasonCodes={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"};const u=(c,d)=>{const{messageId:f}=d,h=d.cmd;let y=null;const g=c.outgoing[f]?c.outgoing[f].cb:null;let p;if(!g){c.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(c.log("_handleAck :: packet type",h),h){case"pubcomp":case"puback":{const v=d.reasonCode;v&&v>0&&v!==16?(p=new Error(`Publish error: ${a.ReasonCodes[v]}`),p.code=v,c._removeOutgoingAndStoreMessage(f,()=>{g(p,d)})):c._removeOutgoingAndStoreMessage(f,g);break}case"pubrec":{y={cmd:"pubrel",qos:2,messageId:f};const v=d.reasonCode;v&&v>0&&v!==16?(p=new Error(`Publish error: ${a.ReasonCodes[v]}`),p.code=v,c._removeOutgoingAndStoreMessage(f,()=>{g(p,d)})):c._sendPacket(y);break}case"suback":{delete c.outgoing[f],c.messageIdProvider.deallocate(f);const v=d.granted;for(let _=0;_<v.length;_++)if(v[_]&128){const b=c.messageIdToTopic[f];b&&b.forEach(A=>{delete c._resubscribeTopics[A]})}delete c.messageIdToTopic[f],c._invokeStoreProcessingQueue(),g(null,d);break}case"unsuback":{delete c.outgoing[f],c.messageIdProvider.deallocate(f),c._invokeStoreProcessingQueue(),g(null);break}default:c.emit("error",new Error("unrecognized packet type"))}c.disconnecting&&Object.keys(c.outgoing).length===0&&c.emit("outgoingEmpty")};a.default=u},{}],11:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("../shared"),c=n("./ack"),d=(f,h)=>{const{options:y}=f,g=y.protocolVersion,p=g===5?h.reasonCode:h.returnCode;if(g!==5){const v=new u.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${g}`,p);f.emit("error",v);return}f.handleAuth(h,(v,_)=>{if(v){f.emit("error",v);return}if(p===24)f.reconnecting=!1,f._sendPacket(_);else{const b=new u.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[p]}`,p);f.emit("error",b)}})};a.default=d},{"../shared":17,"./ack":10}],12:[function(n,o,a){var u=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("./ack"),d=u(n("../topic-alias-send")),f=n("../shared"),h=(y,g)=>{y.log("_handleConnack");const{options:p}=y,_=p.protocolVersion===5?g.reasonCode:g.returnCode;if(clearTimeout(y.connackTimer),delete y.topicAliasSend,g.properties){if(g.properties.topicAliasMaximum){if(g.properties.topicAliasMaximum>65535){y.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}g.properties.topicAliasMaximum>0&&(y.topicAliasSend=new d.default(g.properties.topicAliasMaximum))}g.properties.serverKeepAlive&&p.keepalive&&(p.keepalive=g.properties.serverKeepAlive,y._shiftPingInterval()),g.properties.maximumPacketSize&&(p.properties||(p.properties={}),p.properties.maximumPacketSize=g.properties.maximumPacketSize)}if(_===0)y.reconnecting=!1,y._onConnect(g);else if(_>0){const b=new f.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[_]}`,_);y.emit("error",b)}};a.default=h},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(n,o,a){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("./publish")),d=u(n("./auth")),f=u(n("./connack")),h=u(n("./ack")),y=u(n("./pubrel")),g=(p,v,_)=>{const{options:b}=p;if(b.protocolVersion===5&&b.properties&&b.properties.maximumPacketSize&&b.properties.maximumPacketSize<v.length)return p.emit("error",new Error(`exceeding packets size ${v.cmd}`)),p.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),p;switch(p.log("_handlePacket :: emitting packetreceive"),p.emit("packetreceive",v),v.cmd){case"publish":(0,c.default)(p,v,_);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,h.default)(p,v),_();break;case"pubrel":(0,y.default)(p,v,_);break;case"connack":(0,f.default)(p,v),_();break;case"auth":(0,d.default)(p,v),_();break;case"pingresp":p.pingResp=!0,_();break;case"disconnect":p.emit("disconnect",v),_();break;default:p.log("_handlePacket :: unknown command"),_();break}};a.default=g},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=[0,16,128,131,135,144,145,151,153],c=(d,f,h)=>{d.log("handlePublish: packet %o",f),h=typeof h<"u"?h:d.noop;let y=f.topic.toString();const g=f.payload,{qos:p}=f,{messageId:v}=f,{options:_}=d;if(d.options.protocolVersion===5){let b;if(f.properties&&(b=f.properties.topicAlias),typeof b<"u")if(y.length===0)if(b>0&&b<=65535){const A=d.topicAliasRecv.getTopicByAlias(b);if(A)y=A,d.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",y,b);else{d.log("handlePublish :: unregistered topic alias. alias: %d",b),d.emit("error",new Error("Received unregistered Topic Alias"));return}}else{d.log("handlePublish :: topic alias out of range. alias: %d",b),d.emit("error",new Error("Received Topic Alias is out of range"));return}else if(d.topicAliasRecv.put(y,b))d.log("handlePublish :: registered topic: %s - alias: %d",y,b);else{d.log("handlePublish :: topic alias out of range. alias: %d",b),d.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(d.log("handlePublish: qos %d",p),p){case 2:{_.customHandleAcks(y,g,f,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return d.emit("error",b);if(u.indexOf(A)===-1)return d.emit("error",new Error("Wrong reason code for pubrec"));A?d._sendPacket({cmd:"pubrec",messageId:v,reasonCode:A},h):d.incomingStore.put(f,()=>{d._sendPacket({cmd:"pubrec",messageId:v},h)})});break}case 1:{_.customHandleAcks(y,g,f,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return d.emit("error",b);if(u.indexOf(A)===-1)return d.emit("error",new Error("Wrong reason code for puback"));A||d.emit("message",y,g,f),d.handleMessage(f,w=>{if(w)return h&&h(w);d._sendPacket({cmd:"puback",messageId:v,reasonCode:A},h)})});break}case 0:d.emit("message",y,g,f),d.handleMessage(f,h);break;default:d.log("handlePublish: unknown QoS. Doing nothing.");break}};a.default=c},{}],15:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=(c,d,f)=>{c.log("handling pubrel packet");const h=typeof f<"u"?f:c.noop,{messageId:y}=d,g={cmd:"pubcomp",messageId:y};c.incomingStore.get(d,(p,v)=>{p?c._sendPacket(g,h):(c.emit("message",v.topic,v.payload,v),c.handleMessage(v,_=>{if(_)return h(_);c.incomingStore.del(v,c.noop),c._sendPacket(g,h)}))})};a.default=u},{}],16:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=typeof window<"u"&&typeof window.document<"u"||typeof self<"u"&&typeof self.postMessage=="function";a.default=u},{}],17:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.applyMixin=a.ErrorWithReasonCode=void 0;class u extends Error{constructor(f,h){super(f),this.code=h,Object.setPrototypeOf(this,u.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}a.ErrorWithReasonCode=u;function c(d,f,h=!1){var y;const g=[f];for(;;){const p=g[0],v=Object.getPrototypeOf(p);if(v!=null&&v.prototype)g.unshift(v);else break}for(const p of g)for(const v of Object.getOwnPropertyNames(p.prototype))(h||v!=="constructor")&&Object.defineProperty(d.prototype,v,(y=Object.getOwnPropertyDescriptor(p.prototype,v))!==null&&y!==void 0?y:Object.create(null))}a.applyMixin=c},{}],18:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("readable-stream"),c={objectMode:!0},d={clean:!0};class f{constructor(y){this.options=y||{},this.options=Object.assign(Object.assign({},d),y),this._inflights=new Map}put(y,g){return this._inflights.set(y.messageId,y),g&&g(),this}createStream(){const y=new u.Readable(c),g=[];let p=!1,v=0;return this._inflights.forEach((_,b)=>{g.push(_)}),y._read=()=>{!p&&v<g.length?y.push(g[v++]):y.push(null)},y.destroy=_=>{if(!p)return p=!0,setTimeout(()=>{y.emit("close")},0),y},y}del(y,g){const p=this._inflights.get(y.messageId);return p?(this._inflights.delete(y.messageId),g(null,p)):g&&g(new Error("missing packet")),this}get(y,g){const p=this._inflights.get(y.messageId);return p?g(null,p):g&&g(new Error("missing packet")),this}close(y){this.options.clean&&(this._inflights=null),y&&y()}}a.default=f},{"readable-stream":125}],19:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(d){this.aliasToTopic={},this.max=d}put(d,f){return f===0||f>this.max?!1:(this.aliasToTopic[f]=d,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(d){return this.aliasToTopic[d]}clear(){this.aliasToTopic={}}}a.default=u},{}],20:[function(n,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("lru-cache")),d=n("number-allocator");class f{constructor(y){y>0&&(this.aliasToTopic=new c.default({max:y}),this.topicToAlias={},this.numberAllocator=new d.NumberAllocator(1,y),this.max=y,this.length=0)}put(y,g){if(g===0||g>this.max)return!1;const p=this.aliasToTopic.get(g);return p&&delete this.topicToAlias[p],this.aliasToTopic.set(g,y),this.topicToAlias[y]=g,this.numberAllocator.use(g),this.length=this.aliasToTopic.size,!0}getTopicByAlias(y){return this.aliasToTopic.get(y)}getAliasByTopic(y){const g=this.topicToAlias[y];return typeof g<"u"&&this.aliasToTopic.get(g),g}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const y=this.numberAllocator.firstVacant();return y||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}a.default=f},{"lru-cache":72,"number-allocator":98}],21:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("number-allocator");class c{constructor(){this.numberAllocator=new u.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(f){return this.numberAllocator.use(f)}deallocate(f){this.numberAllocator.free(f)}clear(){this.numberAllocator.clear()}}a.default=c},{"number-allocator":98}],22:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.validateTopics=a.validateTopic=void 0;function u(d){const f=d.split("/");for(let h=0;h<f.length;h++)if(f[h]!=="+"){if(f[h]==="#")return h===f.length-1;if(f[h].indexOf("+")!==-1||f[h].indexOf("#")!==-1)return!1}return!0}a.validateTopic=u;function c(d){if(d.length===0)return"empty_topic_list";for(let f=0;f<d.length;f++)if(!u(d[f]))return d[f];return null}a.validateTopics=c},{}],23:[function(n,o,a){var u=this&&this.__createBinding||(Object.create?function(A,w,S,T){T===void 0&&(T=S);var x=Object.getOwnPropertyDescriptor(w,S);(!x||("get"in x?!w.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return w[S]}}),Object.defineProperty(A,T,x)}:function(A,w,S,T){T===void 0&&(T=S),A[T]=w[S]}),c=this&&this.__setModuleDefault||(Object.create?function(A,w){Object.defineProperty(A,"default",{enumerable:!0,value:w})}:function(A,w){A.default=w}),d=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var w={};if(A!=null)for(var S in A)S!=="default"&&Object.prototype.hasOwnProperty.call(A,S)&&u(w,A,S);return c(w,A),w},f=this&&this.__exportStar||function(A,w){for(var S in A)S!=="default"&&!Object.prototype.hasOwnProperty.call(w,S)&&u(w,A,S)},h=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=a.UniqueMessageIdProvider=a.DefaultMessageIdProvider=a.Store=a.MqttClient=a.connectAsync=a.connect=a.Client=void 0;const y=h(n("./lib/client"));a.MqttClient=y.default;const g=h(n("./lib/default-message-id-provider"));a.DefaultMessageIdProvider=g.default;const p=h(n("./lib/unique-message-id-provider"));a.UniqueMessageIdProvider=p.default;const v=h(n("./lib/store"));a.Store=v.default;const _=d(n("./lib/connect"));a.connect=_.default,Object.defineProperty(a,"connectAsync",{enumerable:!0,get:function(){return _.connectAsync}}),a.Client=y.default,f(n("./lib/client"),a),f(n("./lib/shared"),a);var b=n("./lib/handlers/ack");Object.defineProperty(a,"ReasonCodes",{enumerable:!0,get:function(){return b.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(n,o,a){const{AbortController:u,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;o.exports=u,o.exports.AbortSignal=c,o.exports.default=u},{}],25:[function(n,o,a){a.byteLength=p,a.toByteArray=_,a.fromByteArray=w;for(var u=[],c=[],d=typeof Uint8Array<"u"?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,y=f.length;h<y;++h)u[h]=f[h],c[f.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function g(S){var T=S.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=S.indexOf("=");x===-1&&(x=T);var M=x===T?0:4-x%4;return[x,M]}function p(S){var T=g(S),x=T[0],M=T[1];return(x+M)*3/4-M}function v(S,T,x){return(T+x)*3/4-x}function _(S){var T,x=g(S),M=x[0],L=x[1],O=new d(v(S,M,L)),re=0,D=L>0?M-4:M,z;for(z=0;z<D;z+=4)T=c[S.charCodeAt(z)]<<18|c[S.charCodeAt(z+1)]<<12|c[S.charCodeAt(z+2)]<<6|c[S.charCodeAt(z+3)],O[re++]=T>>16&255,O[re++]=T>>8&255,O[re++]=T&255;return L===2&&(T=c[S.charCodeAt(z)]<<2|c[S.charCodeAt(z+1)]>>4,O[re++]=T&255),L===1&&(T=c[S.charCodeAt(z)]<<10|c[S.charCodeAt(z+1)]<<4|c[S.charCodeAt(z+2)]>>2,O[re++]=T>>8&255,O[re++]=T&255),O}function b(S){return u[S>>18&63]+u[S>>12&63]+u[S>>6&63]+u[S&63]}function A(S,T,x){for(var M,L=[],O=T;O<x;O+=3)M=(S[O]<<16&16711680)+(S[O+1]<<8&65280)+(S[O+2]&255),L.push(b(M));return L.join("")}function w(S){for(var T,x=S.length,M=x%3,L=[],O=16383,re=0,D=x-M;re<D;re+=O)L.push(A(S,re,re+O>D?D:re+O));return M===1?(T=S[x-1],L.push(u[T>>2]+u[T<<4&63]+"==")):M===2&&(T=(S[x-2]<<8)+S[x-1],L.push(u[T>>10]+u[T>>4&63]+u[T<<2&63]+"=")),L.join("")}},{}],26:[function(n,o,a){},{}],27:[function(n,o,a){var u=n("buffer"),c=u.Buffer;function d(h,y){for(var g in h)y[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(d(u,a),a.Buffer=f);function f(h,y,g){return c(h,y,g)}d(c,f),f.from=function(h,y,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,y,g)},f.alloc=function(h,y,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return y!==void 0?typeof g=="string"?p.fill(y,g):p.fill(y):p.fill(0),p},f.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},f.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],28:[function(n,o,a){var u=n("safe-buffer").Buffer,c=u.isEncoding||function(L){switch(L=""+L,L&&L.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 d(L){if(!L)return"utf8";for(var O;;)switch(L){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 L;default:if(O)return;L=(""+L).toLowerCase(),O=!0}}function f(L){var O=d(L);if(typeof O!="string"&&(u.isEncoding===c||!c(L)))throw new Error("Unknown encoding: "+L);return O||L}a.StringDecoder=h;function h(L){this.encoding=f(L);var O;switch(this.encoding){case"utf16le":this.text=A,this.end=w,O=4;break;case"utf8":this.fillLast=v,O=4;break;case"base64":this.text=S,this.end=T,O=3;break;default:this.write=x,this.end=M;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(O)}h.prototype.write=function(L){if(L.length===0)return"";var O,re;if(this.lastNeed){if(O=this.fillLast(L),O===void 0)return"";re=this.lastNeed,this.lastNeed=0}else re=0;return re<L.length?O?O+this.text(L,re):this.text(L,re):O||""},h.prototype.end=b,h.prototype.text=_,h.prototype.fillLast=function(L){if(this.lastNeed<=L.length)return L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,L.length),this.lastNeed-=L.length};function y(L){return L<=127?0:L>>5===6?2:L>>4===14?3:L>>3===30?4:L>>6===2?-1:-2}function g(L,O,re){var D=O.length-1;if(D<re)return 0;var z=y(O[D]);return z>=0?(z>0&&(L.lastNeed=z-1),z):--D<re||z===-2?0:(z=y(O[D]),z>=0?(z>0&&(L.lastNeed=z-2),z):--D<re||z===-2?0:(z=y(O[D]),z>=0?(z>0&&(z===2?z=0:L.lastNeed=z-3),z):0))}function p(L,O,re){if((O[0]&192)!==128)return L.lastNeed=0,"�";if(L.lastNeed>1&&O.length>1){if((O[1]&192)!==128)return L.lastNeed=1,"�";if(L.lastNeed>2&&O.length>2&&(O[2]&192)!==128)return L.lastNeed=2,"�"}}function v(L){var O=this.lastTotal-this.lastNeed,re=p(this,L);if(re!==void 0)return re;if(this.lastNeed<=L.length)return L.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,O,0,L.length),this.lastNeed-=L.length}function _(L,O){var re=g(this,L,O);if(!this.lastNeed)return L.toString("utf8",O);this.lastTotal=re;var D=L.length-(re-this.lastNeed);return L.copy(this.lastChar,0,D),L.toString("utf8",O,D)}function b(L){var O=L&&L.length?this.write(L):"";return this.lastNeed?O+"�":O}function A(L,O){if((L.length-O)%2===0){var re=L.toString("utf16le",O);if(re){var D=re.charCodeAt(re.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1],re.slice(0,-1)}return re}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=L[L.length-1],L.toString("utf16le",O,L.length-1)}function w(L){var O=L&&L.length?this.write(L):"";if(this.lastNeed){var re=this.lastTotal-this.lastNeed;return O+this.lastChar.toString("utf16le",0,re)}return O}function S(L,O){var re=(L.length-O)%3;return re===0?L.toString("base64",O):(this.lastNeed=3-re,this.lastTotal=3,re===1?this.lastChar[0]=L[L.length-1]:(this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1]),L.toString("base64",O,L.length-re))}function T(L){var O=L&&L.length?this.write(L):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function x(L){return L.toString(this.encoding)}function M(L){return L&&L.length?this.write(L):""}},{"safe-buffer":27}],29:[function(n,o,a){(function(u){(function(){var c=n("base64-js"),d=n("ieee754");a.Buffer=g,a.SlowBuffer=M,a.INSPECT_MAX_BYTES=50;var f=2147483647;a.kMaxLength=f,g.TYPED_ARRAY_SUPPORT=h(),!g.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 h(){try{var Y=new Uint8Array(1);return Y.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Y.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function y(Y){if(Y>f)throw new RangeError('The value "'+Y+'" is invalid for option "size"');var k=new Uint8Array(Y);return k.__proto__=g.prototype,k}function g(Y,k,$){if(typeof Y=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(Y)}return p(Y,k,$)}typeof Symbol<"u"&&Symbol.species!=null&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192;function p(Y,k,$){if(typeof Y=="string")return A(Y,k);if(ArrayBuffer.isView(Y))return w(Y);if(Y==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(ie(Y,ArrayBuffer)||Y&&ie(Y.buffer,ArrayBuffer))return S(Y,k,$);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var oe=Y.valueOf&&Y.valueOf();if(oe!=null&&oe!==Y)return g.from(oe,k,$);var _e=T(Y);if(_e)return _e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return g.from(Y[Symbol.toPrimitive]("string"),k,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}g.from=function(Y,k,$){return p(Y,k,$)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array;function v(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function _(Y,k,$){return v(Y),Y<=0?y(Y):k!==void 0?typeof $=="string"?y(Y).fill(k,$):y(Y).fill(k):y(Y)}g.alloc=function(Y,k,$){return _(Y,k,$)};function b(Y){return v(Y),y(Y<0?0:x(Y)|0)}g.allocUnsafe=function(Y){return b(Y)},g.allocUnsafeSlow=function(Y){return b(Y)};function A(Y,k){if((typeof k!="string"||k==="")&&(k="utf8"),!g.isEncoding(k))throw new TypeError("Unknown encoding: "+k);var $=L(Y,k)|0,oe=y($),_e=oe.write(Y,k);return _e!==$&&(oe=oe.slice(0,_e)),oe}function w(Y){for(var k=Y.length<0?0:x(Y.length)|0,$=y(k),oe=0;oe<k;oe+=1)$[oe]=Y[oe]&255;return $}function S(Y,k,$){if(k<0||Y.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(Y.byteLength<k+($||0))throw new RangeError('"length" is outside of buffer bounds');var oe;return k===void 0&&$===void 0?oe=new Uint8Array(Y):$===void 0?oe=new Uint8Array(Y,k):oe=new Uint8Array(Y,k,$),oe.__proto__=g.prototype,oe}function T(Y){if(g.isBuffer(Y)){var k=x(Y.length)|0,$=y(k);return $.length===0||Y.copy($,0,0,k),$}if(Y.length!==void 0)return typeof Y.length!="number"||ae(Y.length)?y(0):w(Y);if(Y.type==="Buffer"&&Array.isArray(Y.data))return w(Y.data)}function x(Y){if(Y>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return Y|0}function M(Y){return+Y!=Y&&(Y=0),g.alloc(+Y)}g.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==g.prototype},g.compare=function(k,$){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),ie($,Uint8Array)&&($=g.from($,$.offset,$.byteLength)),!g.isBuffer(k)||!g.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===$)return 0;for(var oe=k.length,_e=$.length,Ue=0,_n=Math.min(oe,_e);Ue<_n;++Ue)if(k[Ue]!==$[Ue]){oe=k[Ue],_e=$[Ue];break}return oe<_e?-1:_e<oe?1:0},g.isEncoding=function(k){switch(String(k).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}},g.concat=function(k,$){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return g.alloc(0);var oe;if($===void 0)for($=0,oe=0;oe<k.length;++oe)$+=k[oe].length;var _e=g.allocUnsafe($),Ue=0;for(oe=0;oe<k.length;++oe){var _n=k[oe];if(ie(_n,Uint8Array)&&(_n=g.from(_n)),!g.isBuffer(_n))throw new TypeError('"list" argument must be an Array of Buffers');_n.copy(_e,Ue),Ue+=_n.length}return _e};function L(Y,k){if(g.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||ie(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);var $=Y.length,oe=arguments.length>2&&arguments[2]===!0;if(!oe&&$===0)return 0;for(var _e=!1;;)switch(k){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return xe(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Dt(Y).length;default:if(_e)return oe?-1:xe(Y).length;k=(""+k).toLowerCase(),_e=!0}}g.byteLength=L;function O(Y,k,$){var oe=!1;if((k===void 0||k<0)&&(k=0),k>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,k>>>=0,$<=k))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return vn(this,k,$);case"utf8":case"utf-8":return Fe(this,k,$);case"ascii":return he(this,k,$);case"latin1":case"binary":return In(this,k,$);case"base64":return $e(this,k,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,k,$);default:if(oe)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),oe=!0}}g.prototype._isBuffer=!0;function re(Y,k,$){var oe=Y[k];Y[k]=Y[$],Y[$]=oe}g.prototype.swap16=function(){var k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var $=0;$<k;$+=2)re(this,$,$+1);return this},g.prototype.swap32=function(){var k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var $=0;$<k;$+=4)re(this,$,$+3),re(this,$+1,$+2);return this},g.prototype.swap64=function(){var k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var $=0;$<k;$+=8)re(this,$,$+7),re(this,$+1,$+6),re(this,$+2,$+5),re(this,$+3,$+4);return this},g.prototype.toString=function(){var k=this.length;return k===0?"":arguments.length===0?Fe(this,0,k):O.apply(this,arguments)},g.prototype.toLocaleString=g.prototype.toString,g.prototype.equals=function(k){if(!g.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:g.compare(this,k)===0},g.prototype.inspect=function(){var k="",$=a.INSPECT_MAX_BYTES;return k=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(k+=" ... "),"<Buffer "+k+">"},g.prototype.compare=function(k,$,oe,_e,Ue){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),!g.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if($===void 0&&($=0),oe===void 0&&(oe=k?k.length:0),_e===void 0&&(_e=0),Ue===void 0&&(Ue=this.length),$<0||oe>k.length||_e<0||Ue>this.length)throw new RangeError("out of range index");if(_e>=Ue&&$>=oe)return 0;if(_e>=Ue)return-1;if($>=oe)return 1;if($>>>=0,oe>>>=0,_e>>>=0,Ue>>>=0,this===k)return 0;for(var _n=Ue-_e,wn=oe-$,Tn=Math.min(_n,wn),Ln=this.slice(_e,Ue),Ve=k.slice($,oe),qe=0;qe<Tn;++qe)if(Ln[qe]!==Ve[qe]){_n=Ln[qe],wn=Ve[qe];break}return _n<wn?-1:wn<_n?1:0};function D(Y,k,$,oe,_e){if(Y.length===0)return-1;if(typeof $=="string"?(oe=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,ae($)&&($=_e?0:Y.length-1),$<0&&($=Y.length+$),$>=Y.length){if(_e)return-1;$=Y.length-1}else if($<0)if(_e)$=0;else return-1;if(typeof k=="string"&&(k=g.from(k,oe)),g.isBuffer(k))return k.length===0?-1:z(Y,k,$,oe,_e);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?_e?Uint8Array.prototype.indexOf.call(Y,k,$):Uint8Array.prototype.lastIndexOf.call(Y,k,$):z(Y,[k],$,oe,_e);throw new TypeError("val must be string, number or Buffer")}function z(Y,k,$,oe,_e){var Ue=1,_n=Y.length,wn=k.length;if(oe!==void 0&&(oe=String(oe).toLowerCase(),oe==="ucs2"||oe==="ucs-2"||oe==="utf16le"||oe==="utf-16le")){if(Y.length<2||k.length<2)return-1;Ue=2,_n/=2,wn/=2,$/=2}function Tn(An,xn){return Ue===1?An[xn]:An.readUInt16BE(xn*Ue)}var Ln;if(_e){var Ve=-1;for(Ln=$;Ln<_n;Ln++)if(Tn(Y,Ln)===Tn(k,Ve===-1?0:Ln-Ve)){if(Ve===-1&&(Ve=Ln),Ln-Ve+1===wn)return Ve*Ue}else Ve!==-1&&(Ln-=Ln-Ve),Ve=-1}else for($+wn>_n&&($=_n-wn),Ln=$;Ln>=0;Ln--){for(var qe=!0,Sn=0;Sn<wn;Sn++)if(Tn(Y,Ln+Sn)!==Tn(k,Sn)){qe=!1;break}if(qe)return Ln}return-1}g.prototype.includes=function(k,$,oe){return this.indexOf(k,$,oe)!==-1},g.prototype.indexOf=function(k,$,oe){return D(this,k,$,oe,!0)},g.prototype.lastIndexOf=function(k,$,oe){return D(this,k,$,oe,!1)};function V(Y,k,$,oe){$=Number($)||0;var _e=Y.length-$;oe?(oe=Number(oe),oe>_e&&(oe=_e)):oe=_e;var Ue=k.length;oe>Ue/2&&(oe=Ue/2);for(var _n=0;_n<oe;++_n){var wn=parseInt(k.substr(_n*2,2),16);if(ae(wn))return _n;Y[$+_n]=wn}return _n}function j(Y,k,$,oe){return Cn(xe(k,Y.length-$),Y,$,oe)}function F(Y,k,$,oe){return Cn(Ne(k),Y,$,oe)}function Ce(Y,k,$,oe){return F(Y,k,$,oe)}function le(Y,k,$,oe){return Cn(Dt(k),Y,$,oe)}function pe(Y,k,$,oe){return Cn(Lt(k,Y.length-$),Y,$,oe)}g.prototype.write=function(k,$,oe,_e){if($===void 0)_e="utf8",oe=this.length,$=0;else if(oe===void 0&&typeof $=="string")_e=$,oe=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(oe)?(oe=oe>>>0,_e===void 0&&(_e="utf8")):(_e=oe,oe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ue=this.length-$;if((oe===void 0||oe>Ue)&&(oe=Ue),k.length>0&&(oe<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");_e||(_e="utf8");for(var _n=!1;;)switch(_e){case"hex":return V(this,k,$,oe);case"utf8":case"utf-8":return j(this,k,$,oe);case"ascii":return F(this,k,$,oe);case"latin1":case"binary":return Ce(this,k,$,oe);case"base64":return le(this,k,$,oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,k,$,oe);default:if(_n)throw new TypeError("Unknown encoding: "+_e);_e=(""+_e).toLowerCase(),_n=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $e(Y,k,$){return k===0&&$===Y.length?c.fromByteArray(Y):c.fromByteArray(Y.slice(k,$))}function Fe(Y,k,$){$=Math.min(Y.length,$);for(var oe=[],_e=k;_e<$;){var Ue=Y[_e],_n=null,wn=Ue>239?4:Ue>223?3:Ue>191?2:1;if(_e+wn<=$){var Tn,Ln,Ve,qe;switch(wn){case 1:Ue<128&&(_n=Ue);break;case 2:Tn=Y[_e+1],(Tn&192)===128&&(qe=(Ue&31)<<6|Tn&63,qe>127&&(_n=qe));break;case 3:Tn=Y[_e+1],Ln=Y[_e+2],(Tn&192)===128&&(Ln&192)===128&&(qe=(Ue&15)<<12|(Tn&63)<<6|Ln&63,qe>2047&&(qe<55296||qe>57343)&&(_n=qe));break;case 4:Tn=Y[_e+1],Ln=Y[_e+2],Ve=Y[_e+3],(Tn&192)===128&&(Ln&192)===128&&(Ve&192)===128&&(qe=(Ue&15)<<18|(Tn&63)<<12|(Ln&63)<<6|Ve&63,qe>65535&&qe<1114112&&(_n=qe))}}_n===null?(_n=65533,wn=1):_n>65535&&(_n-=65536,oe.push(_n>>>10&1023|55296),_n=56320|_n&1023),oe.push(_n),_e+=wn}return Et(oe)}var Oe=4096;function Et(Y){var k=Y.length;if(k<=Oe)return String.fromCharCode.apply(String,Y);for(var $="",oe=0;oe<k;)$+=String.fromCharCode.apply(String,Y.slice(oe,oe+=Oe));return $}function he(Y,k,$){var oe="";$=Math.min(Y.length,$);for(var _e=k;_e<$;++_e)oe+=String.fromCharCode(Y[_e]&127);return oe}function In(Y,k,$){var oe="";$=Math.min(Y.length,$);for(var _e=k;_e<$;++_e)oe+=String.fromCharCode(Y[_e]);return oe}function vn(Y,k,$){var oe=Y.length;(!k||k<0)&&(k=0),(!$||$<0||$>oe)&&($=oe);for(var _e="",Ue=k;Ue<$;++Ue)_e+=ze(Y[Ue]);return _e}function kt(Y,k,$){for(var oe=Y.slice(k,$),_e="",Ue=0;Ue<oe.length;Ue+=2)_e+=String.fromCharCode(oe[Ue]+oe[Ue+1]*256);return _e}g.prototype.slice=function(k,$){var oe=this.length;k=~~k,$=$===void 0?oe:~~$,k<0?(k+=oe,k<0&&(k=0)):k>oe&&(k=oe),$<0?($+=oe,$<0&&($=0)):$>oe&&($=oe),$<k&&($=k);var _e=this.subarray(k,$);return _e.__proto__=g.prototype,_e};function ue(Y,k,$){if(Y%1!==0||Y<0)throw new RangeError("offset is not uint");if(Y+k>$)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUIntLE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k],Ue=1,_n=0;++_n<$&&(Ue*=256);)_e+=this[k+_n]*Ue;return _e},g.prototype.readUIntBE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k+--$],Ue=1;$>0&&(Ue*=256);)_e+=this[k+--$]*Ue;return _e},g.prototype.readUInt8=function(k,$){return k=k>>>0,$||ue(k,1,this.length),this[k]},g.prototype.readUInt16LE=function(k,$){return k=k>>>0,$||ue(k,2,this.length),this[k]|this[k+1]<<8},g.prototype.readUInt16BE=function(k,$){return k=k>>>0,$||ue(k,2,this.length),this[k]<<8|this[k+1]},g.prototype.readUInt32LE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},g.prototype.readUInt32BE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},g.prototype.readIntLE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k],Ue=1,_n=0;++_n<$&&(Ue*=256);)_e+=this[k+_n]*Ue;return Ue*=128,_e>=Ue&&(_e-=Math.pow(2,8*$)),_e},g.prototype.readIntBE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=$,Ue=1,_n=this[k+--_e];_e>0&&(Ue*=256);)_n+=this[k+--_e]*Ue;return Ue*=128,_n>=Ue&&(_n-=Math.pow(2,8*$)),_n},g.prototype.readInt8=function(k,$){return k=k>>>0,$||ue(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},g.prototype.readInt16LE=function(k,$){k=k>>>0,$||ue(k,2,this.length);var oe=this[k]|this[k+1]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt16BE=function(k,$){k=k>>>0,$||ue(k,2,this.length);var oe=this[k+1]|this[k]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt32LE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},g.prototype.readInt32BE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},g.prototype.readFloatLE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),d.read(this,k,!0,23,4)},g.prototype.readFloatBE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),d.read(this,k,!1,23,4)},g.prototype.readDoubleLE=function(k,$){return k=k>>>0,$||ue(k,8,this.length),d.read(this,k,!0,52,8)},g.prototype.readDoubleBE=function(k,$){return k=k>>>0,$||ue(k,8,this.length),d.read(this,k,!1,52,8)};function At(Y,k,$,oe,_e,Ue){if(!g.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>_e||k<Ue)throw new RangeError('"value" argument is out of bounds');if($+oe>Y.length)throw new RangeError("Index out of range")}g.prototype.writeUIntLE=function(k,$,oe,_e){if(k=+k,$=$>>>0,oe=oe>>>0,!_e){var Ue=Math.pow(2,8*oe)-1;At(this,k,$,oe,Ue,0)}var _n=1,wn=0;for(this[$]=k&255;++wn<oe&&(_n*=256);)this[$+wn]=k/_n&255;return $+oe},g.prototype.writeUIntBE=function(k,$,oe,_e){if(k=+k,$=$>>>0,oe=oe>>>0,!_e){var Ue=Math.pow(2,8*oe)-1;At(this,k,$,oe,Ue,0)}var _n=oe-1,wn=1;for(this[$+_n]=k&255;--_n>=0&&(wn*=256);)this[$+_n]=k/wn&255;return $+oe},g.prototype.writeUInt8=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,1,255,0),this[$]=k&255,$+1},g.prototype.writeUInt16LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,65535,0),this[$]=k&255,this[$+1]=k>>>8,$+2},g.prototype.writeUInt16BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,65535,0),this[$]=k>>>8,this[$+1]=k&255,$+2},g.prototype.writeUInt32LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,4294967295,0),this[$+3]=k>>>24,this[$+2]=k>>>16,this[$+1]=k>>>8,this[$]=k&255,$+4},g.prototype.writeUInt32BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,4294967295,0),this[$]=k>>>24,this[$+1]=k>>>16,this[$+2]=k>>>8,this[$+3]=k&255,$+4},g.prototype.writeIntLE=function(k,$,oe,_e){if(k=+k,$=$>>>0,!_e){var Ue=Math.pow(2,8*oe-1);At(this,k,$,oe,Ue-1,-Ue)}var _n=0,wn=1,Tn=0;for(this[$]=k&255;++_n<oe&&(wn*=256);)k<0&&Tn===0&&this[$+_n-1]!==0&&(Tn=1),this[$+_n]=(k/wn>>0)-Tn&255;return $+oe},g.prototype.writeIntBE=function(k,$,oe,_e){if(k=+k,$=$>>>0,!_e){var Ue=Math.pow(2,8*oe-1);At(this,k,$,oe,Ue-1,-Ue)}var _n=oe-1,wn=1,Tn=0;for(this[$+_n]=k&255;--_n>=0&&(wn*=256);)k<0&&Tn===0&&this[$+_n+1]!==0&&(Tn=1),this[$+_n]=(k/wn>>0)-Tn&255;return $+oe},g.prototype.writeInt8=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,1,127,-128),k<0&&(k=255+k+1),this[$]=k&255,$+1},g.prototype.writeInt16LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,32767,-32768),this[$]=k&255,this[$+1]=k>>>8,$+2},g.prototype.writeInt16BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,32767,-32768),this[$]=k>>>8,this[$+1]=k&255,$+2},g.prototype.writeInt32LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,2147483647,-2147483648),this[$]=k&255,this[$+1]=k>>>8,this[$+2]=k>>>16,this[$+3]=k>>>24,$+4},g.prototype.writeInt32BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[$]=k>>>24,this[$+1]=k>>>16,this[$+2]=k>>>8,this[$+3]=k&255,$+4};function jt(Y,k,$,oe,_e,Ue){if($+oe>Y.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function hn(Y,k,$,oe,_e){return k=+k,$=$>>>0,_e||jt(Y,k,$,4),d.write(Y,k,$,oe,23,4),$+4}g.prototype.writeFloatLE=function(k,$,oe){return hn(this,k,$,!0,oe)},g.prototype.writeFloatBE=function(k,$,oe){return hn(this,k,$,!1,oe)};function Pt(Y,k,$,oe,_e){return k=+k,$=$>>>0,_e||jt(Y,k,$,8),d.write(Y,k,$,oe,52,8),$+8}g.prototype.writeDoubleLE=function(k,$,oe){return Pt(this,k,$,!0,oe)},g.prototype.writeDoubleBE=function(k,$,oe){return Pt(this,k,$,!1,oe)},g.prototype.copy=function(k,$,oe,_e){if(!g.isBuffer(k))throw new TypeError("argument should be a Buffer");if(oe||(oe=0),!_e&&_e!==0&&(_e=this.length),$>=k.length&&($=k.length),$||($=0),_e>0&&_e<oe&&(_e=oe),_e===oe||k.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(oe<0||oe>=this.length)throw new RangeError("Index out of range");if(_e<0)throw new RangeError("sourceEnd out of bounds");_e>this.length&&(_e=this.length),k.length-$<_e-oe&&(_e=k.length-$+oe);var Ue=_e-oe;if(this===k&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin($,oe,_e);else if(this===k&&oe<$&&$<_e)for(var _n=Ue-1;_n>=0;--_n)k[_n+$]=this[_n+oe];else Uint8Array.prototype.set.call(k,this.subarray(oe,_e),$);return Ue},g.prototype.fill=function(k,$,oe,_e){if(typeof k=="string"){if(typeof $=="string"?(_e=$,$=0,oe=this.length):typeof oe=="string"&&(_e=oe,oe=this.length),_e!==void 0&&typeof _e!="string")throw new TypeError("encoding must be a string");if(typeof _e=="string"&&!g.isEncoding(_e))throw new TypeError("Unknown encoding: "+_e);if(k.length===1){var Ue=k.charCodeAt(0);(_e==="utf8"&&Ue<128||_e==="latin1")&&(k=Ue)}}else typeof k=="number"&&(k=k&255);if($<0||this.length<$||this.length<oe)throw new RangeError("Out of range index");if(oe<=$)return this;$=$>>>0,oe=oe===void 0?this.length:oe>>>0,k||(k=0);var _n;if(typeof k=="number")for(_n=$;_n<oe;++_n)this[_n]=k;else{var wn=g.isBuffer(k)?k:g.from(k,_e),Tn=wn.length;if(Tn===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(_n=0;_n<oe-$;++_n)this[_n+$]=wn[_n%Tn]}return this};var Ie=/[^+/0-9A-Za-z-_]/g;function de(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ie,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function ze(Y){return Y<16?"0"+Y.toString(16):Y.toString(16)}function xe(Y,k){k=k||1/0;for(var $,oe=Y.length,_e=null,Ue=[],_n=0;_n<oe;++_n){if($=Y.charCodeAt(_n),$>55295&&$<57344){if(!_e){if($>56319){(k-=3)>-1&&Ue.push(239,191,189);continue}else if(_n+1===oe){(k-=3)>-1&&Ue.push(239,191,189);continue}_e=$;continue}if($<56320){(k-=3)>-1&&Ue.push(239,191,189),_e=$;continue}$=(_e-55296<<10|$-56320)+65536}else _e&&(k-=3)>-1&&Ue.push(239,191,189);if(_e=null,$<128){if((k-=1)<0)break;Ue.push($)}else if($<2048){if((k-=2)<0)break;Ue.push($>>6|192,$&63|128)}else if($<65536){if((k-=3)<0)break;Ue.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((k-=4)<0)break;Ue.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return Ue}function Ne(Y){for(var k=[],$=0;$<Y.length;++$)k.push(Y.charCodeAt($)&255);return k}function Lt(Y,k){for(var $,oe,_e,Ue=[],_n=0;_n<Y.length&&!((k-=2)<0);++_n)$=Y.charCodeAt(_n),oe=$>>8,_e=$%256,Ue.push(_e),Ue.push(oe);return Ue}function Dt(Y){return c.toByteArray(de(Y))}function Cn(Y,k,$,oe){for(var _e=0;_e<oe&&!(_e+$>=k.length||_e>=Y.length);++_e)k[_e+$]=Y[_e];return _e}function ie(Y,k){return Y instanceof k||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===k.name}function ae(Y){return Y!==Y}}).call(this)}).call(this,n("buffer").Buffer)},{"base64-js":25,buffer:29,ieee754:50}],30:[function(n,o,a){(function(u){(function(){a.formatArgs=d,a.save=f,a.load=h,a.useColors=c,a.storage=y(),a.destroy=(()=>{let p=!1;return()=>{p||(p=!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`."))}})(),a.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 c(){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 d(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),!this.useColors)return;const v="color: "+this.color;p.splice(1,0,v,"color: inherit");let _=0,b=0;p[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(_++,A==="%c"&&(b=_))}),p.splice(b,0,v)}a.log=console.debug||console.log||(()=>{});function f(p){try{p?a.storage.setItem("debug",p):a.storage.removeItem("debug")}catch{}}function h(){let p;try{p=a.storage.getItem("debug")}catch{}return!p&&typeof u<"u"&&"env"in u&&(p=u.env.DEBUG),p}function y(){try{return localStorage}catch{}}o.exports=n("./common")(a);const{formatters:g}=o.exports;g.j=function(p){try{return JSON.stringify(p)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}}}).call(this)}).call(this,n("_process"))},{"./common":31,_process:102}],31:[function(n,o,a){function u(c){f.debug=f,f.default=f,f.coerce=_,f.disable=g,f.enable=y,f.enabled=p,f.humanize=n("ms"),f.destroy=b,Object.keys(c).forEach(A=>{f[A]=c[A]}),f.names=[],f.skips=[],f.formatters={};function d(A){let w=0;for(let S=0;S<A.length;S++)w=(w<<5)-w+A.charCodeAt(S),w|=0;return f.colors[Math.abs(w)%f.colors.length]}f.selectColor=d;function f(A){let w,S=null,T,x;function M(...L){if(!M.enabled)return;const O=M,re=Number(new Date),D=re-(w||re);O.diff=D,O.prev=w,O.curr=re,w=re,L[0]=f.coerce(L[0]),typeof L[0]!="string"&&L.unshift("%O");let z=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(j,F)=>{if(j==="%%")return"%";z++;const Ce=f.formatters[F];if(typeof Ce=="function"){const le=L[z];j=Ce.call(O,le),L.splice(z,1),z--}return j}),f.formatArgs.call(O,L),(O.log||f.log).apply(O,L)}return M.namespace=A,M.useColors=f.useColors(),M.color=f.selectColor(A),M.extend=h,M.destroy=f.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(T!==f.namespaces&&(T=f.namespaces,x=f.enabled(A)),x),set:L=>{S=L}}),typeof f.init=="function"&&f.init(M),M}function h(A,w){const S=f(this.namespace+(typeof w>"u"?":":w)+A);return S.log=this.log,S}function y(A){f.save(A),f.namespaces=A,f.names=[],f.skips=[];let w;const S=(typeof A=="string"?A:"").split(/[\s,]+/),T=S.length;for(w=0;w<T;w++)S[w]&&(A=S[w].replace(/\*/g,".*?"),A[0]==="-"?f.skips.push(new RegExp("^"+A.slice(1)+"$")):f.names.push(new RegExp("^"+A+"$")))}function g(){const A=[...f.names.map(v),...f.skips.map(v).map(w=>"-"+w)].join(",");return f.enable(""),A}function p(A){if(A[A.length-1]==="*")return!0;let w,S;for(w=0,S=f.skips.length;w<S;w++)if(f.skips[w].test(A))return!1;for(w=0,S=f.names.length;w<S;w++)if(f.names[w].test(A))return!0;return!1}function v(A){return A.toString().substring(2,A.toString().length-2).replace(/\.\*\?$/,"*")}function _(A){return A instanceof Error?A.stack||A.message:A}function b(){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 f.enable(f.load()),f}o.exports=u},{ms:97}],32:[function(n,o,a){(function(u,c){(function(){var d=n("readable-stream"),f=n("end-of-stream"),h=n("inherits"),y=n("stream-shift"),g=c.from&&c.from!==Uint8Array.from?c.from([0]):new c([0]),p=function(T,x){T._corked?T.once("uncork",x):x()},v=function(T,x){T._autoDestroy&&T.destroy(x)},_=function(T,x){return function(M){M?v(T,M.message==="premature close"?null:M):x&&!T._ended&&T.end()}},b=function(T,x){if(!T||T._writableState&&T._writableState.finished)return x();if(T._writableState)return T.end(x);T.end(),x()},A=function(){},w=function(T){return new d.Readable({objectMode:!0,highWaterMark:16}).wrap(T)},S=function(T,x,M){if(!(this instanceof S))return new S(T,x,M);d.Duplex.call(this,M),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!M||M.autoDestroy!==!1,this._forwardDestroy=!M||M.destroy!==!1,this._forwardEnd=!M||M.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,T&&this.setWritable(T),x&&this.setReadable(x)};h(S,d.Duplex),S.obj=function(T,x,M){return M||(M={}),M.objectMode=!0,M.highWaterMark=16,new S(T,x,M)},S.prototype.cork=function(){++this._corked===1&&this.emit("cork")},S.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},S.prototype.setWritable=function(T){if(this._unwrite&&this._unwrite(),this.destroyed){T&&T.destroy&&T.destroy();return}if(T===null||T===!1){this.end();return}var x=this,M=f(T,{writable:!0,readable:!1},_(this,this._forwardEnd)),L=function(){var re=x._ondrain;x._ondrain=null,re&&re()},O=function(){x._writable.removeListener("drain",L),M()};this._unwrite&&u.nextTick(L),this._writable=T,this._writable.on("drain",L),this._unwrite=O,this.uncork()},S.prototype.setReadable=function(T){if(this._unread&&this._unread(),this.destroyed){T&&T.destroy&&T.destroy();return}if(T===null||T===!1){this.push(null),this.resume();return}var x=this,M=f(T,{writable:!1,readable:!0},_(this)),L=function(){x._forward()},O=function(){x.push(null)},re=function(){x._readable2.removeListener("readable",L),x._readable2.removeListener("end",O),M()};this._drained=!0,this._readable=T,this._readable2=T._readableState?T:w(T),this._readable2.on("readable",L),this._readable2.on("end",O),this._unread=re,this._forward()},S.prototype._read=function(){this._drained=!0,this._forward()},S.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var T;this._drained&&(T=y(this._readable2))!==null;)this.destroyed||(this._drained=this.push(T));this._forwarding=!1}},S.prototype.destroy=function(T,x){if(x||(x=A),this.destroyed)return x(null);this.destroyed=!0;var M=this;u.nextTick(function(){M._destroy(T),x(null)})},S.prototype._destroy=function(T){if(T){var x=this._ondrain;this._ondrain=null,x?x(T):this.emit("error",T)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},S.prototype._write=function(T,x,M){if(!this.destroyed){if(this._corked)return p(this,this._write.bind(this,T,x,M));if(T===g)return this._finish(M);if(!this._writable)return M();this._writable.write(T)===!1?this._ondrain=M:this.destroyed||M()}},S.prototype._finish=function(T){var x=this;this.emit("preend"),p(this,function(){b(x._forwardEnd&&x._writable,function(){x._writableState.prefinished===!1&&(x._writableState.prefinished=!0),x.emit("prefinish"),p(x,T)})})},S.prototype.end=function(T,x,M){return typeof T=="function"?this.end(null,null,T):typeof x=="function"?this.end(T,null,x):(this._ended=!0,T&&this.write(T),!this._writableState.ending&&!this._writableState.destroyed&&this.write(g),d.Writable.prototype.end.call(this,M))},o.exports=S}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:102,buffer:29,"end-of-stream":48,inherits:51,"readable-stream":47,"stream-shift":135}],33:[function(n,o,a){function u(p,v){p.prototype=Object.create(v.prototype),p.prototype.constructor=p,p.__proto__=v}var c={};function d(p,v,_){_||(_=Error);function b(w,S,T){return typeof v=="string"?v:v(w,S,T)}var A=function(w){u(S,w);function S(T,x,M){return w.call(this,b(T,x,M))||this}return S}(_);A.prototype.name=_.name,A.prototype.code=p,c[p]=A}function f(p,v){if(Array.isArray(p)){var _=p.length;return p=p.map(function(b){return String(b)}),_>2?"one of ".concat(v," ").concat(p.slice(0,_-1).join(", "),", or ")+p[_-1]:_===2?"one of ".concat(v," ").concat(p[0]," or ").concat(p[1]):"of ".concat(v," ").concat(p[0])}else return"of ".concat(v," ").concat(String(p))}function h(p,v,_){return p.substr(!_||_<0?0:+_,v.length)===v}function y(p,v,_){return(_===void 0||_>p.length)&&(_=p.length),p.substring(_-v.length,_)===v}function g(p,v,_){return typeof _!="number"&&(_=0),_+v.length>p.length?!1:p.indexOf(v,_)!==-1}d("ERR_INVALID_OPT_VALUE",function(p,v){return'The value "'+v+'" is invalid for option "'+p+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(p,v,_){var b;typeof v=="string"&&h(v,"not ")?(b="must not be",v=v.replace(/^not /,"")):b="must be";var A;if(y(p," argument"))A="The ".concat(p," ").concat(b," ").concat(f(v,"type"));else{var w=g(p,".")?"property":"argument";A='The "'.concat(p,'" ').concat(w," ").concat(b," ").concat(f(v,"type"))}return A+=". Received type ".concat(typeof _),A},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=c},{}],34:[function(n,o,a){(function(u){(function(){var c=Object.keys||function(b){var A=[];for(var w in b)A.push(w);return A};o.exports=p;var d=n("./_stream_readable"),f=n("./_stream_writable");n("inherits")(p,d);for(var h=c(f.prototype),y=0;y<h.length;y++){var g=h[y];p.prototype[g]||(p.prototype[g]=f.prototype[g])}function p(b){if(!(this instanceof p))return new p(b);d.call(this,b),f.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v)))}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function v(){this._writableState.ended||u.nextTick(_,this)}function _(b){b.end()}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(A){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=A,this._writableState.destroyed=A)}})}).call(this)}).call(this,n("_process"))},{"./_stream_readable":36,"./_stream_writable":38,_process:102,inherits:51}],35:[function(n,o,a){o.exports=c;var u=n("./_stream_transform");n("inherits")(c,u);function c(d){if(!(this instanceof c))return new c(d);u.call(this,d)}c.prototype._transform=function(d,f,h){h(null,d)}},{"./_stream_transform":37,inherits:51}],36:[function(n,o,a){(function(u,c){(function(){o.exports=pe;var d;pe.ReadableState=le,n("events").EventEmitter;var f=function(ae,Y){return ae.listeners(Y).length},h=n("./internal/streams/stream"),y=n("buffer").Buffer,g=c.Uint8Array||function(){};function p(ie){return y.from(ie)}function v(ie){return y.isBuffer(ie)||ie instanceof g}var _=n("util"),b;_&&_.debuglog?b=_.debuglog("stream"):b=function(){};var A=n("./internal/streams/buffer_list"),w=n("./internal/streams/destroy"),S=n("./internal/streams/state"),T=S.getHighWaterMark,x=n("../errors").codes,M=x.ERR_INVALID_ARG_TYPE,L=x.ERR_STREAM_PUSH_AFTER_EOF,O=x.ERR_METHOD_NOT_IMPLEMENTED,re=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,D,z,V;n("inherits")(pe,h);var j=w.errorOrDestroy,F=["error","close","destroy","pause","resume"];function Ce(ie,ae,Y){if(typeof ie.prependListener=="function")return ie.prependListener(ae,Y);!ie._events||!ie._events[ae]?ie.on(ae,Y):Array.isArray(ie._events[ae])?ie._events[ae].unshift(Y):ie._events[ae]=[Y,ie._events[ae]]}function le(ie,ae,Y){d=d||n("./_stream_duplex"),ie=ie||{},typeof Y!="boolean"&&(Y=ae instanceof d),this.objectMode=!!ie.objectMode,Y&&(this.objectMode=this.objectMode||!!ie.readableObjectMode),this.highWaterMark=T(this,ie,"readableHighWaterMark",Y),this.buffer=new A,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=ie.emitClose!==!1,this.autoDestroy=!!ie.autoDestroy,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(D||(D=n("string_decoder/").StringDecoder),this.decoder=new D(ie.encoding),this.encoding=ie.encoding)}function pe(ie){if(d=d||n("./_stream_duplex"),!(this instanceof pe))return new pe(ie);var ae=this instanceof d;this._readableState=new le(ie,this,ae),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),h.call(this)}Object.defineProperty(pe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ae){this._readableState&&(this._readableState.destroyed=ae)}}),pe.prototype.destroy=w.destroy,pe.prototype._undestroy=w.undestroy,pe.prototype._destroy=function(ie,ae){ae(ie)},pe.prototype.push=function(ie,ae){var Y=this._readableState,k;return Y.objectMode?k=!0:typeof ie=="string"&&(ae=ae||Y.defaultEncoding,ae!==Y.encoding&&(ie=y.from(ie,ae),ae=""),k=!0),$e(this,ie,ae,!1,k)},pe.prototype.unshift=function(ie){return $e(this,ie,null,!0,!1)};function $e(ie,ae,Y,k,$){b("readableAddChunk",ae);var oe=ie._readableState;if(ae===null)oe.reading=!1,vn(ie,oe);else{var _e;if($||(_e=Oe(oe,ae)),_e)j(ie,_e);else if(oe.objectMode||ae&&ae.length>0)if(typeof ae!="string"&&!oe.objectMode&&Object.getPrototypeOf(ae)!==y.prototype&&(ae=p(ae)),k)oe.endEmitted?j(ie,new re):Fe(ie,oe,ae,!0);else if(oe.ended)j(ie,new L);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!Y?(ae=oe.decoder.write(ae),oe.objectMode||ae.length!==0?Fe(ie,oe,ae,!1):At(ie,oe)):Fe(ie,oe,ae,!1)}else k||(oe.reading=!1,At(ie,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function Fe(ie,ae,Y,k){ae.flowing&&ae.length===0&&!ae.sync?(ae.awaitDrain=0,ie.emit("data",Y)):(ae.length+=ae.objectMode?1:Y.length,k?ae.buffer.unshift(Y):ae.buffer.push(Y),ae.needReadable&&kt(ie)),At(ie,ae)}function Oe(ie,ae){var Y;return!v(ae)&&typeof ae!="string"&&ae!==void 0&&!ie.objectMode&&(Y=new M("chunk",["string","Buffer","Uint8Array"],ae)),Y}pe.prototype.isPaused=function(){return this._readableState.flowing===!1},pe.prototype.setEncoding=function(ie){D||(D=n("string_decoder/").StringDecoder);var ae=new D(ie);this._readableState.decoder=ae,this._readableState.encoding=this._readableState.decoder.encoding;for(var Y=this._readableState.buffer.head,k="";Y!==null;)k+=ae.write(Y.data),Y=Y.next;return this._readableState.buffer.clear(),k!==""&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var Et=1073741824;function he(ie){return ie>=Et?ie=Et:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function In(ie,ae){return ie<=0||ae.length===0&&ae.ended?0:ae.objectMode?1:ie!==ie?ae.flowing&&ae.length?ae.buffer.head.data.length:ae.length:(ie>ae.highWaterMark&&(ae.highWaterMark=he(ie)),ie<=ae.length?ie:ae.ended?ae.length:(ae.needReadable=!0,0))}pe.prototype.read=function(ie){b("read",ie),ie=parseInt(ie,10);var ae=this._readableState,Y=ie;if(ie!==0&&(ae.emittedReadable=!1),ie===0&&ae.needReadable&&((ae.highWaterMark!==0?ae.length>=ae.highWaterMark:ae.length>0)||ae.ended))return b("read: emitReadable",ae.length,ae.ended),ae.length===0&&ae.ended?Lt(this):kt(this),null;if(ie=In(ie,ae),ie===0&&ae.ended)return ae.length===0&&Lt(this),null;var k=ae.needReadable;b("need readable",k),(ae.length===0||ae.length-ie<ae.highWaterMark)&&(k=!0,b("length less than watermark",k)),ae.ended||ae.reading?(k=!1,b("reading or ended",k)):k&&(b("do read"),ae.reading=!0,ae.sync=!0,ae.length===0&&(ae.needReadable=!0),this._read(ae.highWaterMark),ae.sync=!1,ae.reading||(ie=In(Y,ae)));var $;return ie>0?$=Ne(ie,ae):$=null,$===null?(ae.needReadable=ae.length<=ae.highWaterMark,ie=0):(ae.length-=ie,ae.awaitDrain=0),ae.length===0&&(ae.ended||(ae.needReadable=!0),Y!==ie&&ae.ended&&Lt(this)),$!==null&&this.emit("data",$),$};function vn(ie,ae){if(b("onEofChunk"),!ae.ended){if(ae.decoder){var Y=ae.decoder.end();Y&&Y.length&&(ae.buffer.push(Y),ae.length+=ae.objectMode?1:Y.length)}ae.ended=!0,ae.sync?kt(ie):(ae.needReadable=!1,ae.emittedReadable||(ae.emittedReadable=!0,ue(ie)))}}function kt(ie){var ae=ie._readableState;b("emitReadable",ae.needReadable,ae.emittedReadable),ae.needReadable=!1,ae.emittedReadable||(b("emitReadable",ae.flowing),ae.emittedReadable=!0,u.nextTick(ue,ie))}function ue(ie){var ae=ie._readableState;b("emitReadable_",ae.destroyed,ae.length,ae.ended),!ae.destroyed&&(ae.length||ae.ended)&&(ie.emit("readable"),ae.emittedReadable=!1),ae.needReadable=!ae.flowing&&!ae.ended&&ae.length<=ae.highWaterMark,xe(ie)}function At(ie,ae){ae.readingMore||(ae.readingMore=!0,u.nextTick(jt,ie,ae))}function jt(ie,ae){for(;!ae.reading&&!ae.ended&&(ae.length<ae.highWaterMark||ae.flowing&&ae.length===0);){var Y=ae.length;if(b("maybeReadMore read 0"),ie.read(0),Y===ae.length)break}ae.readingMore=!1}pe.prototype._read=function(ie){j(this,new O("_read()"))},pe.prototype.pipe=function(ie,ae){var Y=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=ie;break;case 1:k.pipes=[k.pipes,ie];break;default:k.pipes.push(ie);break}k.pipesCount+=1,b("pipe count=%d opts=%j",k.pipesCount,ae);var $=(!ae||ae.end!==!1)&&ie!==u.stdout&&ie!==u.stderr,oe=$?Ue:An;k.endEmitted?u.nextTick(oe):Y.once("end",oe),ie.on("unpipe",_e);function _e(xn,Bn){b("onunpipe"),xn===Y&&Bn&&Bn.hasUnpiped===!1&&(Bn.hasUnpiped=!0,Tn())}function Ue(){b("onend"),ie.end()}var _n=hn(Y);ie.on("drain",_n);var wn=!1;function Tn(){b("cleanup"),ie.removeListener("close",qe),ie.removeListener("finish",Sn),ie.removeListener("drain",_n),ie.removeListener("error",Ve),ie.removeListener("unpipe",_e),Y.removeListener("end",Ue),Y.removeListener("end",An),Y.removeListener("data",Ln),wn=!0,k.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&_n()}Y.on("data",Ln);function Ln(xn){b("ondata");var Bn=ie.write(xn);b("dest.write",Bn),Bn===!1&&((k.pipesCount===1&&k.pipes===ie||k.pipesCount>1&&Cn(k.pipes,ie)!==-1)&&!wn&&(b("false write response, pause",k.awaitDrain),k.awaitDrain++),Y.pause())}function Ve(xn){b("onerror",xn),An(),ie.removeListener("error",Ve),f(ie,"error")===0&&j(ie,xn)}Ce(ie,"error",Ve);function qe(){ie.removeListener("finish",Sn),An()}ie.once("close",qe);function Sn(){b("onfinish"),ie.removeListener("close",qe),An()}ie.once("finish",Sn);function An(){b("unpipe"),Y.unpipe(ie)}return ie.emit("pipe",Y),k.flowing||(b("pipe resume"),Y.resume()),ie};function hn(ie){return function(){var Y=ie._readableState;b("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&f(ie,"data")&&(Y.flowing=!0,xe(ie))}}pe.prototype.unpipe=function(ie){var ae=this._readableState,Y={hasUnpiped:!1};if(ae.pipesCount===0)return this;if(ae.pipesCount===1)return ie&&ie!==ae.pipes?this:(ie||(ie=ae.pipes),ae.pipes=null,ae.pipesCount=0,ae.flowing=!1,ie&&ie.emit("unpipe",this,Y),this);if(!ie){var k=ae.pipes,$=ae.pipesCount;ae.pipes=null,ae.pipesCount=0,ae.flowing=!1;for(var oe=0;oe<$;oe++)k[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var _e=Cn(ae.pipes,ie);return _e===-1?this:(ae.pipes.splice(_e,1),ae.pipesCount-=1,ae.pipesCount===1&&(ae.pipes=ae.pipes[0]),ie.emit("unpipe",this,Y),this)},pe.prototype.on=function(ie,ae){var Y=h.prototype.on.call(this,ie,ae),k=this._readableState;return ie==="data"?(k.readableListening=this.listenerCount("readable")>0,k.flowing!==!1&&this.resume()):ie==="readable"&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,b("on readable",k.length,k.reading),k.length?kt(this):k.reading||u.nextTick(Ie,this)),Y},pe.prototype.addListener=pe.prototype.on,pe.prototype.removeListener=function(ie,ae){var Y=h.prototype.removeListener.call(this,ie,ae);return ie==="readable"&&u.nextTick(Pt,this),Y},pe.prototype.removeAllListeners=function(ie){var ae=h.prototype.removeAllListeners.apply(this,arguments);return(ie==="readable"||ie===void 0)&&u.nextTick(Pt,this),ae};function Pt(ie){var ae=ie._readableState;ae.readableListening=ie.listenerCount("readable")>0,ae.resumeScheduled&&!ae.paused?ae.flowing=!0:ie.listenerCount("data")>0&&ie.resume()}function Ie(ie){b("readable nexttick read 0"),ie.read(0)}pe.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(b("resume"),ie.flowing=!ie.readableListening,de(this,ie)),ie.paused=!1,this};function de(ie,ae){ae.resumeScheduled||(ae.resumeScheduled=!0,u.nextTick(ze,ie,ae))}function ze(ie,ae){b("resume",ae.reading),ae.reading||ie.read(0),ae.resumeScheduled=!1,ie.emit("resume"),xe(ie),ae.flowing&&!ae.reading&&ie.read(0)}pe.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function xe(ie){var ae=ie._readableState;for(b("flow",ae.flowing);ae.flowing&&ie.read()!==null;);}pe.prototype.wrap=function(ie){var ae=this,Y=this._readableState,k=!1;ie.on("end",function(){if(b("wrapped end"),Y.decoder&&!Y.ended){var _e=Y.decoder.end();_e&&_e.length&&ae.push(_e)}ae.push(null)}),ie.on("data",function(_e){if(b("wrapped data"),Y.decoder&&(_e=Y.decoder.write(_e)),!(Y.objectMode&&_e==null)&&!(!Y.objectMode&&(!_e||!_e.length))){var Ue=ae.push(_e);Ue||(k=!0,ie.pause())}});for(var $ in ie)this[$]===void 0&&typeof ie[$]=="function"&&(this[$]=function(Ue){return function(){return ie[Ue].apply(ie,arguments)}}($));for(var oe=0;oe<F.length;oe++)ie.on(F[oe],this.emit.bind(this,F[oe]));return this._read=function(_e){b("wrapped _read",_e),k&&(k=!1,ie.resume())},this},typeof Symbol=="function"&&(pe.prototype[Symbol.asyncIterator]=function(){return z===void 0&&(z=n("./internal/streams/async_iterator")),z(this)}),Object.defineProperty(pe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(pe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(pe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ae){this._readableState&&(this._readableState.flowing=ae)}}),pe._fromList=Ne,Object.defineProperty(pe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Ne(ie,ae){if(ae.length===0)return null;var Y;return ae.objectMode?Y=ae.buffer.shift():!ie||ie>=ae.length?(ae.decoder?Y=ae.buffer.join(""):ae.buffer.length===1?Y=ae.buffer.first():Y=ae.buffer.concat(ae.length),ae.buffer.clear()):Y=ae.buffer.consume(ie,ae.decoder),Y}function Lt(ie){var ae=ie._readableState;b("endReadable",ae.endEmitted),ae.endEmitted||(ae.ended=!0,u.nextTick(Dt,ae,ie))}function Dt(ie,ae){if(b("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ae.readable=!1,ae.emit("end"),ie.autoDestroy)){var Y=ae._writableState;(!Y||Y.autoDestroy&&Y.finished)&&ae.destroy()}}typeof Symbol=="function"&&(pe.from=function(ie,ae){return V===void 0&&(V=n("./internal/streams/from")),V(pe,ie,ae)});function Cn(ie,ae){for(var Y=0,k=ie.length;Y<k;Y++)if(ie[Y]===ae)return Y;return-1}}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/async_iterator":39,"./internal/streams/buffer_list":40,"./internal/streams/destroy":41,"./internal/streams/from":43,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,events:49,inherits:51,"string_decoder/":136,util:26}],37:[function(n,o,a){o.exports=p;var u=n("../errors").codes,c=u.ERR_METHOD_NOT_IMPLEMENTED,d=u.ERR_MULTIPLE_CALLBACK,f=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,h=u.ERR_TRANSFORM_WITH_LENGTH_0,y=n("./_stream_duplex");n("inherits")(p,y);function g(b,A){var w=this._transformState;w.transforming=!1;var S=w.writecb;if(S===null)return this.emit("error",new d);w.writechunk=null,w.writecb=null,A!=null&&this.push(A),S(b);var T=this._readableState;T.reading=!1,(T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}function p(b){if(!(this instanceof p))return new p(b);y.call(this,b),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",v)}function v(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(A,w){_(b,A,w)}):_(this,null,null)}p.prototype.push=function(b,A){return this._transformState.needTransform=!1,y.prototype.push.call(this,b,A)},p.prototype._transform=function(b,A,w){w(new c("_transform()"))},p.prototype._write=function(b,A,w){var S=this._transformState;if(S.writecb=w,S.writechunk=b,S.writeencoding=A,!S.transforming){var T=this._readableState;(S.needTransform||T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}},p.prototype._read=function(b){var A=this._transformState;A.writechunk!==null&&!A.transforming?(A.transforming=!0,this._transform(A.writechunk,A.writeencoding,A.afterTransform)):A.needTransform=!0},p.prototype._destroy=function(b,A){y.prototype._destroy.call(this,b,function(w){A(w)})};function _(b,A,w){if(A)return b.emit("error",A);if(w!=null&&b.push(w),b._writableState.length)throw new h;if(b._transformState.transforming)throw new f;return b.push(null)}},{"../errors":33,"./_stream_duplex":34,inherits:51}],38:[function(n,o,a){(function(u,c){(function(){o.exports=le;function d(xe){var Ne=this;this.next=null,this.entry=null,this.finish=function(){ze(Ne,xe)}}var f;le.WritableState=F;var h={deprecate:n("util-deprecate")},y=n("./internal/streams/stream"),g=n("buffer").Buffer,p=c.Uint8Array||function(){};function v(xe){return g.from(xe)}function _(xe){return g.isBuffer(xe)||xe instanceof p}var b=n("./internal/streams/destroy"),A=n("./internal/streams/state"),w=A.getHighWaterMark,S=n("../errors").codes,T=S.ERR_INVALID_ARG_TYPE,x=S.ERR_METHOD_NOT_IMPLEMENTED,M=S.ERR_MULTIPLE_CALLBACK,L=S.ERR_STREAM_CANNOT_PIPE,O=S.ERR_STREAM_DESTROYED,re=S.ERR_STREAM_NULL_VALUES,D=S.ERR_STREAM_WRITE_AFTER_END,z=S.ERR_UNKNOWN_ENCODING,V=b.errorOrDestroy;n("inherits")(le,y);function j(){}function F(xe,Ne,Lt){f=f||n("./_stream_duplex"),xe=xe||{},typeof Lt!="boolean"&&(Lt=Ne instanceof f),this.objectMode=!!xe.objectMode,Lt&&(this.objectMode=this.objectMode||!!xe.writableObjectMode),this.highWaterMark=w(this,xe,"writableHighWaterMark",Lt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Dt=xe.decodeStrings===!1;this.decodeStrings=!Dt,this.defaultEncoding=xe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Cn){vn(Ne,Cn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=xe.emitClose!==!1,this.autoDestroy=!!xe.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}F.prototype.getBuffer=function(){for(var Ne=this.bufferedRequest,Lt=[];Ne;)Lt.push(Ne),Ne=Ne.next;return Lt},function(){try{Object.defineProperty(F.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(le,Symbol.hasInstance,{value:function(Ne){return Ce.call(this,Ne)?!0:this!==le?!1:Ne&&Ne._writableState instanceof F}})):Ce=function(Ne){return Ne instanceof this};function le(xe){f=f||n("./_stream_duplex");var Ne=this instanceof f;if(!Ne&&!Ce.call(le,this))return new le(xe);this._writableState=new F(xe,this,Ne),this.writable=!0,xe&&(typeof xe.write=="function"&&(this._write=xe.write),typeof xe.writev=="function"&&(this._writev=xe.writev),typeof xe.destroy=="function"&&(this._destroy=xe.destroy),typeof xe.final=="function"&&(this._final=xe.final)),y.call(this)}le.prototype.pipe=function(){V(this,new L)};function pe(xe,Ne){var Lt=new D;V(xe,Lt),u.nextTick(Ne,Lt)}function $e(xe,Ne,Lt,Dt){var Cn;return Lt===null?Cn=new re:typeof Lt!="string"&&!Ne.objectMode&&(Cn=new T("chunk",["string","Buffer"],Lt)),Cn?(V(xe,Cn),u.nextTick(Dt,Cn),!1):!0}le.prototype.write=function(xe,Ne,Lt){var Dt=this._writableState,Cn=!1,ie=!Dt.objectMode&&_(xe);return ie&&!g.isBuffer(xe)&&(xe=v(xe)),typeof Ne=="function"&&(Lt=Ne,Ne=null),ie?Ne="buffer":Ne||(Ne=Dt.defaultEncoding),typeof Lt!="function"&&(Lt=j),Dt.ending?pe(this,Lt):(ie||$e(this,Dt,xe,Lt))&&(Dt.pendingcb++,Cn=Oe(this,Dt,ie,xe,Ne,Lt)),Cn},le.prototype.cork=function(){this._writableState.corked++},le.prototype.uncork=function(){var xe=this._writableState;xe.corked&&(xe.corked--,!xe.writing&&!xe.corked&&!xe.bufferProcessing&&xe.bufferedRequest&&At(this,xe))},le.prototype.setDefaultEncoding=function(Ne){if(typeof Ne=="string"&&(Ne=Ne.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ne+"").toLowerCase())>-1))throw new z(Ne);return this._writableState.defaultEncoding=Ne,this},Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Fe(xe,Ne,Lt){return!xe.objectMode&&xe.decodeStrings!==!1&&typeof Ne=="string"&&(Ne=g.from(Ne,Lt)),Ne}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Oe(xe,Ne,Lt,Dt,Cn,ie){if(!Lt){var ae=Fe(Ne,Dt,Cn);Dt!==ae&&(Lt=!0,Cn="buffer",Dt=ae)}var Y=Ne.objectMode?1:Dt.length;Ne.length+=Y;var k=Ne.length<Ne.highWaterMark;if(k||(Ne.needDrain=!0),Ne.writing||Ne.corked){var $=Ne.lastBufferedRequest;Ne.lastBufferedRequest={chunk:Dt,encoding:Cn,isBuf:Lt,callback:ie,next:null},$?$.next=Ne.lastBufferedRequest:Ne.bufferedRequest=Ne.lastBufferedRequest,Ne.bufferedRequestCount+=1}else Et(xe,Ne,!1,Y,Dt,Cn,ie);return k}function Et(xe,Ne,Lt,Dt,Cn,ie,ae){Ne.writelen=Dt,Ne.writecb=ae,Ne.writing=!0,Ne.sync=!0,Ne.destroyed?Ne.onwrite(new O("write")):Lt?xe._writev(Cn,Ne.onwrite):xe._write(Cn,ie,Ne.onwrite),Ne.sync=!1}function he(xe,Ne,Lt,Dt,Cn){--Ne.pendingcb,Lt?(u.nextTick(Cn,Dt),u.nextTick(Ie,xe,Ne),xe._writableState.errorEmitted=!0,V(xe,Dt)):(Cn(Dt),xe._writableState.errorEmitted=!0,V(xe,Dt),Ie(xe,Ne))}function In(xe){xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0}function vn(xe,Ne){var Lt=xe._writableState,Dt=Lt.sync,Cn=Lt.writecb;if(typeof Cn!="function")throw new M;if(In(Lt),Ne)he(xe,Lt,Dt,Ne,Cn);else{var ie=jt(Lt)||xe.destroyed;!ie&&!Lt.corked&&!Lt.bufferProcessing&&Lt.bufferedRequest&&At(xe,Lt),Dt?u.nextTick(kt,xe,Lt,ie,Cn):kt(xe,Lt,ie,Cn)}}function kt(xe,Ne,Lt,Dt){Lt||ue(xe,Ne),Ne.pendingcb--,Dt(),Ie(xe,Ne)}function ue(xe,Ne){Ne.length===0&&Ne.needDrain&&(Ne.needDrain=!1,xe.emit("drain"))}function At(xe,Ne){Ne.bufferProcessing=!0;var Lt=Ne.bufferedRequest;if(xe._writev&&Lt&&Lt.next){var Dt=Ne.bufferedRequestCount,Cn=new Array(Dt),ie=Ne.corkedRequestsFree;ie.entry=Lt;for(var ae=0,Y=!0;Lt;)Cn[ae]=Lt,Lt.isBuf||(Y=!1),Lt=Lt.next,ae+=1;Cn.allBuffers=Y,Et(xe,Ne,!0,Ne.length,Cn,"",ie.finish),Ne.pendingcb++,Ne.lastBufferedRequest=null,ie.next?(Ne.corkedRequestsFree=ie.next,ie.next=null):Ne.corkedRequestsFree=new d(Ne),Ne.bufferedRequestCount=0}else{for(;Lt;){var k=Lt.chunk,$=Lt.encoding,oe=Lt.callback,_e=Ne.objectMode?1:k.length;if(Et(xe,Ne,!1,_e,k,$,oe),Lt=Lt.next,Ne.bufferedRequestCount--,Ne.writing)break}Lt===null&&(Ne.lastBufferedRequest=null)}Ne.bufferedRequest=Lt,Ne.bufferProcessing=!1}le.prototype._write=function(xe,Ne,Lt){Lt(new x("_write()"))},le.prototype._writev=null,le.prototype.end=function(xe,Ne,Lt){var Dt=this._writableState;return typeof xe=="function"?(Lt=xe,xe=null,Ne=null):typeof Ne=="function"&&(Lt=Ne,Ne=null),xe!=null&&this.write(xe,Ne),Dt.corked&&(Dt.corked=1,this.uncork()),Dt.ending||de(this,Dt,Lt),this},Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function jt(xe){return xe.ending&&xe.length===0&&xe.bufferedRequest===null&&!xe.finished&&!xe.writing}function hn(xe,Ne){xe._final(function(Lt){Ne.pendingcb--,Lt&&V(xe,Lt),Ne.prefinished=!0,xe.emit("prefinish"),Ie(xe,Ne)})}function Pt(xe,Ne){!Ne.prefinished&&!Ne.finalCalled&&(typeof xe._final=="function"&&!Ne.destroyed?(Ne.pendingcb++,Ne.finalCalled=!0,u.nextTick(hn,xe,Ne)):(Ne.prefinished=!0,xe.emit("prefinish")))}function Ie(xe,Ne){var Lt=jt(Ne);if(Lt&&(Pt(xe,Ne),Ne.pendingcb===0&&(Ne.finished=!0,xe.emit("finish"),Ne.autoDestroy))){var Dt=xe._readableState;(!Dt||Dt.autoDestroy&&Dt.endEmitted)&&xe.destroy()}return Lt}function de(xe,Ne,Lt){Ne.ending=!0,Ie(xe,Ne),Lt&&(Ne.finished?u.nextTick(Lt):xe.once("finish",Lt)),Ne.ended=!0,xe.writable=!1}function ze(xe,Ne,Lt){var Dt=xe.entry;for(xe.entry=null;Dt;){var Cn=Dt.callback;Ne.pendingcb--,Cn(Lt),Dt=Dt.next}Ne.corkedRequestsFree.next=xe}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Ne){this._writableState&&(this._writableState.destroyed=Ne)}}),le.prototype.destroy=b.destroy,le.prototype._undestroy=b.undestroy,le.prototype._destroy=function(xe,Ne){Ne(xe)}}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/destroy":41,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,inherits:51,"util-deprecate":139}],39:[function(n,o,a){(function(u){(function(){var c;function d(O,re,D){return re in O?Object.defineProperty(O,re,{value:D,enumerable:!0,configurable:!0,writable:!0}):O[re]=D,O}var f=n("./end-of-stream"),h=Symbol("lastResolve"),y=Symbol("lastReject"),g=Symbol("error"),p=Symbol("ended"),v=Symbol("lastPromise"),_=Symbol("handlePromise"),b=Symbol("stream");function A(O,re){return{value:O,done:re}}function w(O){var re=O[h];if(re!==null){var D=O[b].read();D!==null&&(O[v]=null,O[h]=null,O[y]=null,re(A(D,!1)))}}function S(O){u.nextTick(w,O)}function T(O,re){return function(D,z){O.then(function(){if(re[p]){D(A(void 0,!0));return}re[_](D,z)},z)}}var x=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((c={get stream(){return this[b]},next:function(){var re=this,D=this[g];if(D!==null)return Promise.reject(D);if(this[p])return Promise.resolve(A(void 0,!0));if(this[b].destroyed)return new Promise(function(F,Ce){u.nextTick(function(){re[g]?Ce(re[g]):F(A(void 0,!0))})});var z=this[v],V;if(z)V=new Promise(T(z,this));else{var j=this[b].read();if(j!==null)return Promise.resolve(A(j,!1));V=new Promise(this[_])}return this[v]=V,V}},d(c,Symbol.asyncIterator,function(){return this}),d(c,"return",function(){var re=this;return new Promise(function(D,z){re[b].destroy(null,function(V){if(V){z(V);return}D(A(void 0,!0))})})}),c),x),L=function(re){var D,z=Object.create(M,(D={},d(D,b,{value:re,writable:!0}),d(D,h,{value:null,writable:!0}),d(D,y,{value:null,writable:!0}),d(D,g,{value:null,writable:!0}),d(D,p,{value:re._readableState.endEmitted,writable:!0}),d(D,_,{value:function(j,F){var Ce=z[b].read();Ce?(z[v]=null,z[h]=null,z[y]=null,j(A(Ce,!1))):(z[h]=j,z[y]=F)},writable:!0}),D));return z[v]=null,f(re,function(V){if(V&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"){var j=z[y];j!==null&&(z[v]=null,z[h]=null,z[y]=null,j(V)),z[g]=V;return}var F=z[h];F!==null&&(z[v]=null,z[h]=null,z[y]=null,F(A(void 0,!0))),z[p]=!0}),re.on("readable",S.bind(null,z)),z};o.exports=L}).call(this)}).call(this,n("_process"))},{"./end-of-stream":42,_process:102}],40:[function(n,o,a){function u(w,S){var T=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);S&&(x=x.filter(function(M){return Object.getOwnPropertyDescriptor(w,M).enumerable})),T.push.apply(T,x)}return T}function c(w){for(var S=1;S<arguments.length;S++){var T=arguments[S]!=null?arguments[S]:{};S%2?u(Object(T),!0).forEach(function(x){d(w,x,T[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(T)):u(Object(T)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(T,x))})}return w}function d(w,S,T){return S in w?Object.defineProperty(w,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[S]=T,w}function f(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function h(w,S){for(var T=0;T<S.length;T++){var x=S[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}function y(w,S,T){return S&&h(w.prototype,S),T&&h(w,T),w}var g=n("buffer"),p=g.Buffer,v=n("util"),_=v.inspect,b=_&&_.custom||"inspect";function A(w,S,T){p.prototype.copy.call(w,S,T)}o.exports=function(){function w(){f(this,w),this.head=null,this.tail=null,this.length=0}return y(w,[{key:"push",value:function(T){var x={data:T,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(T){var x={data:T,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var x=this.head,M=""+x.data;x=x.next;)M+=T+x.data;return M}},{key:"concat",value:function(T){if(this.length===0)return p.alloc(0);for(var x=p.allocUnsafe(T>>>0),M=this.head,L=0;M;)A(M.data,x,L),L+=M.data.length,M=M.next;return x}},{key:"consume",value:function(T,x){var M;return T<this.head.data.length?(M=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?M=this.shift():M=x?this._getString(T):this._getBuffer(T),M}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var x=this.head,M=1,L=x.data;for(T-=L.length;x=x.next;){var O=x.data,re=T>O.length?O.length:T;if(re===O.length?L+=O:L+=O.slice(0,T),T-=re,T===0){re===O.length?(++M,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=O.slice(re));break}++M}return this.length-=M,L}},{key:"_getBuffer",value:function(T){var x=p.allocUnsafe(T),M=this.head,L=1;for(M.data.copy(x),T-=M.data.length;M=M.next;){var O=M.data,re=T>O.length?O.length:T;if(O.copy(x,x.length-T,0,re),T-=re,T===0){re===O.length?(++L,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=O.slice(re));break}++L}return this.length-=L,x}},{key:b,value:function(T,x){return _(this,c({},x,{depth:0,customInspect:!1}))}}]),w}()},{buffer:29,util:26}],41:[function(n,o,a){(function(u){(function(){function c(p,v){var _=this,b=this._readableState&&this._readableState.destroyed,A=this._writableState&&this._writableState.destroyed;return b||A?(v?v(p):p&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(y,this,p)):u.nextTick(y,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(w){!v&&w?_._writableState?_._writableState.errorEmitted?u.nextTick(f,_):(_._writableState.errorEmitted=!0,u.nextTick(d,_,w)):u.nextTick(d,_,w):v?(u.nextTick(f,_),v(w)):u.nextTick(f,_)}),this)}function d(p,v){y(p,v),f(p)}function f(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function h(){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 y(p,v){p.emit("error",v)}function g(p,v){var _=p._readableState,b=p._writableState;_&&_.autoDestroy||b&&b.autoDestroy?p.destroy(v):p.emit("error",v)}o.exports={destroy:c,undestroy:h,errorOrDestroy:g}}).call(this)}).call(this,n("_process"))},{_process:102}],42:[function(n,o,a){var u=n("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function c(y){var g=!1;return function(){if(!g){g=!0;for(var p=arguments.length,v=new Array(p),_=0;_<p;_++)v[_]=arguments[_];y.apply(this,v)}}}function d(){}function f(y){return y.setHeader&&typeof y.abort=="function"}function h(y,g,p){if(typeof g=="function")return h(y,null,g);g||(g={}),p=c(p||d);var v=g.readable||g.readable!==!1&&y.readable,_=g.writable||g.writable!==!1&&y.writable,b=function(){y.writable||w()},A=y._writableState&&y._writableState.finished,w=function(){_=!1,A=!0,v||p.call(y)},S=y._readableState&&y._readableState.endEmitted,T=function(){v=!1,S=!0,_||p.call(y)},x=function(re){p.call(y,re)},M=function(){var re;if(v&&!S)return(!y._readableState||!y._readableState.ended)&&(re=new u),p.call(y,re);if(_&&!A)return(!y._writableState||!y._writableState.ended)&&(re=new u),p.call(y,re)},L=function(){y.req.on("finish",w)};return f(y)?(y.on("complete",w),y.on("abort",M),y.req?L():y.on("request",L)):_&&!y._writableState&&(y.on("end",b),y.on("close",b)),y.on("end",T),y.on("finish",w),g.error!==!1&&y.on("error",x),y.on("close",M),function(){y.removeListener("complete",w),y.removeListener("abort",M),y.removeListener("request",L),y.req&&y.req.removeListener("finish",w),y.removeListener("end",b),y.removeListener("close",b),y.removeListener("finish",w),y.removeListener("end",T),y.removeListener("error",x),y.removeListener("close",M)}}o.exports=h},{"../../../errors":33}],43:[function(n,o,a){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],44:[function(n,o,a){var u;function c(w){var S=!1;return function(){S||(S=!0,w.apply(void 0,arguments))}}var d=n("../../../errors").codes,f=d.ERR_MISSING_ARGS,h=d.ERR_STREAM_DESTROYED;function y(w){if(w)throw w}function g(w){return w.setHeader&&typeof w.abort=="function"}function p(w,S,T,x){x=c(x);var M=!1;w.on("close",function(){M=!0}),u===void 0&&(u=n("./end-of-stream")),u(w,{readable:S,writable:T},function(O){if(O)return x(O);M=!0,x()});var L=!1;return function(O){if(!M&&!L){if(L=!0,g(w))return w.abort();if(typeof w.destroy=="function")return w.destroy();x(O||new h("pipe"))}}}function v(w){w()}function _(w,S){return w.pipe(S)}function b(w){return!w.length||typeof w[w.length-1]!="function"?y:w.pop()}function A(){for(var w=arguments.length,S=new Array(w),T=0;T<w;T++)S[T]=arguments[T];var x=b(S);if(Array.isArray(S[0])&&(S=S[0]),S.length<2)throw new f("streams");var M,L=S.map(function(O,re){var D=re<S.length-1,z=re>0;return p(O,D,z,function(V){M||(M=V),V&&L.forEach(v),!D&&(L.forEach(v),x(M))})});return S.reduce(_)}o.exports=A},{"../../../errors":33,"./end-of-stream":42}],45:[function(n,o,a){var u=n("../../../errors").codes.ERR_INVALID_OPT_VALUE;function c(f,h,y){return f.highWaterMark!=null?f.highWaterMark:h?f[y]:null}function d(f,h,y,g){var p=c(h,g,y);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var v=g?y:"highWaterMark";throw new u(v,p)}return Math.floor(p)}return f.objectMode?16:16*1024}o.exports={getHighWaterMark:d}},{"../../../errors":33}],46:[function(n,o,a){o.exports=n("events").EventEmitter},{events:49}],47:[function(n,o,a){a=o.exports=n("./lib/_stream_readable.js"),a.Stream=a,a.Readable=a,a.Writable=n("./lib/_stream_writable.js"),a.Duplex=n("./lib/_stream_duplex.js"),a.Transform=n("./lib/_stream_transform.js"),a.PassThrough=n("./lib/_stream_passthrough.js"),a.finished=n("./lib/internal/streams/end-of-stream.js"),a.pipeline=n("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":34,"./lib/_stream_passthrough.js":35,"./lib/_stream_readable.js":36,"./lib/_stream_transform.js":37,"./lib/_stream_writable.js":38,"./lib/internal/streams/end-of-stream.js":42,"./lib/internal/streams/pipeline.js":44}],48:[function(n,o,a){(function(u){(function(){var c=n("once"),d=function(){},f=function(g){return g.setHeader&&typeof g.abort=="function"},h=function(g){return g.stdio&&Array.isArray(g.stdio)&&g.stdio.length===3},y=function(g,p,v){if(typeof p=="function")return y(g,null,p);p||(p={}),v=c(v||d);var _=g._writableState,b=g._readableState,A=p.readable||p.readable!==!1&&g.readable,w=p.writable||p.writable!==!1&&g.writable,S=!1,T=function(){g.writable||x()},x=function(){w=!1,A||v.call(g)},M=function(){A=!1,w||v.call(g)},L=function(V){v.call(g,V?new Error("exited with error code: "+V):null)},O=function(V){v.call(g,V)},re=function(){u.nextTick(D)},D=function(){if(!S){if(A&&!(b&&b.ended&&!b.destroyed))return v.call(g,new Error("premature close"));if(w&&!(_&&_.ended&&!_.destroyed))return v.call(g,new Error("premature close"))}},z=function(){g.req.on("finish",x)};return f(g)?(g.on("complete",x),g.on("abort",re),g.req?z():g.on("request",z)):w&&!_&&(g.on("end",T),g.on("close",T)),h(g)&&g.on("exit",L),g.on("end",M),g.on("finish",x),p.error!==!1&&g.on("error",O),g.on("close",re),function(){S=!0,g.removeListener("complete",x),g.removeListener("abort",re),g.removeListener("request",z),g.req&&g.req.removeListener("finish",x),g.removeListener("end",T),g.removeListener("close",T),g.removeListener("finish",x),g.removeListener("exit",L),g.removeListener("end",M),g.removeListener("error",O),g.removeListener("close",re)}};o.exports=y}).call(this)}).call(this,n("_process"))},{_process:102,once:100}],49:[function(n,o,a){var u=typeof Reflect=="object"?Reflect:null,c=u&&typeof u.apply=="function"?u.apply:function(z,V,j){return Function.prototype.apply.call(z,V,j)},d;u&&typeof u.ownKeys=="function"?d=u.ownKeys:Object.getOwnPropertySymbols?d=function(z){return Object.getOwnPropertyNames(z).concat(Object.getOwnPropertySymbols(z))}:d=function(z){return Object.getOwnPropertyNames(z)};function f(D){console&&console.warn&&console.warn(D)}var h=Number.isNaN||function(z){return z!==z};function y(){y.init.call(this)}o.exports=y,o.exports.once=L,y.EventEmitter=y,y.prototype._events=void 0,y.prototype._eventsCount=0,y.prototype._maxListeners=void 0;var g=10;function p(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(y,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(D){if(typeof D!="number"||D<0||h(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");g=D}}),y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(z){if(typeof z!="number"||z<0||h(z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+z+".");return this._maxListeners=z,this};function v(D){return D._maxListeners===void 0?y.defaultMaxListeners:D._maxListeners}y.prototype.getMaxListeners=function(){return v(this)},y.prototype.emit=function(z){for(var V=[],j=1;j<arguments.length;j++)V.push(arguments[j]);var F=z==="error",Ce=this._events;if(Ce!==void 0)F=F&&Ce.error===void 0;else if(!F)return!1;if(F){var le;if(V.length>0&&(le=V[0]),le instanceof Error)throw le;var pe=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw pe.context=le,pe}var $e=Ce[z];if($e===void 0)return!1;if(typeof $e=="function")c($e,this,V);else for(var Fe=$e.length,Oe=T($e,Fe),j=0;j<Fe;++j)c(Oe[j],this,V);return!0};function _(D,z,V,j){var F,Ce,le;if(p(V),Ce=D._events,Ce===void 0?(Ce=D._events=Object.create(null),D._eventsCount=0):(Ce.newListener!==void 0&&(D.emit("newListener",z,V.listener?V.listener:V),Ce=D._events),le=Ce[z]),le===void 0)le=Ce[z]=V,++D._eventsCount;else if(typeof le=="function"?le=Ce[z]=j?[V,le]:[le,V]:j?le.unshift(V):le.push(V),F=v(D),F>0&&le.length>F&&!le.warned){le.warned=!0;var pe=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(z)+" listeners added. Use emitter.setMaxListeners() to increase limit");pe.name="MaxListenersExceededWarning",pe.emitter=D,pe.type=z,pe.count=le.length,f(pe)}return D}y.prototype.addListener=function(z,V){return _(this,z,V,!1)},y.prototype.on=y.prototype.addListener,y.prototype.prependListener=function(z,V){return _(this,z,V,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(D,z,V){var j={fired:!1,wrapFn:void 0,target:D,type:z,listener:V},F=b.bind(j);return F.listener=V,j.wrapFn=F,F}y.prototype.once=function(z,V){return p(V),this.on(z,A(this,z,V)),this},y.prototype.prependOnceListener=function(z,V){return p(V),this.prependListener(z,A(this,z,V)),this},y.prototype.removeListener=function(z,V){var j,F,Ce,le,pe;if(p(V),F=this._events,F===void 0)return this;if(j=F[z],j===void 0)return this;if(j===V||j.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete F[z],F.removeListener&&this.emit("removeListener",z,j.listener||V));else if(typeof j!="function"){for(Ce=-1,le=j.length-1;le>=0;le--)if(j[le]===V||j[le].listener===V){pe=j[le].listener,Ce=le;break}if(Ce<0)return this;Ce===0?j.shift():x(j,Ce),j.length===1&&(F[z]=j[0]),F.removeListener!==void 0&&this.emit("removeListener",z,pe||V)}return this},y.prototype.off=y.prototype.removeListener,y.prototype.removeAllListeners=function(z){var V,j,F;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[z]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[z]),this;if(arguments.length===0){var Ce=Object.keys(j),le;for(F=0;F<Ce.length;++F)le=Ce[F],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=j[z],typeof V=="function")this.removeListener(z,V);else if(V!==void 0)for(F=V.length-1;F>=0;F--)this.removeListener(z,V[F]);return this};function w(D,z,V){var j=D._events;if(j===void 0)return[];var F=j[z];return F===void 0?[]:typeof F=="function"?V?[F.listener||F]:[F]:V?M(F):T(F,F.length)}y.prototype.listeners=function(z){return w(this,z,!0)},y.prototype.rawListeners=function(z){return w(this,z,!1)},y.listenerCount=function(D,z){return typeof D.listenerCount=="function"?D.listenerCount(z):S.call(D,z)},y.prototype.listenerCount=S;function S(D){var z=this._events;if(z!==void 0){var V=z[D];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}y.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function T(D,z){for(var V=new Array(z),j=0;j<z;++j)V[j]=D[j];return V}function x(D,z){for(;z+1<D.length;z++)D[z]=D[z+1];D.pop()}function M(D){for(var z=new Array(D.length),V=0;V<z.length;++V)z[V]=D[V].listener||D[V];return z}function L(D,z){return new Promise(function(V,j){function F(le){D.removeListener(z,Ce),j(le)}function Ce(){typeof D.removeListener=="function"&&D.removeListener("error",F),V([].slice.call(arguments))}re(D,z,Ce,{once:!0}),z!=="error"&&O(D,F,{once:!0})})}function O(D,z,V){typeof D.on=="function"&&re(D,"error",z,V)}function re(D,z,V,j){if(typeof D.on=="function")j.once?D.once(z,V):D.on(z,V);else if(typeof D.addEventListener=="function")D.addEventListener(z,function F(Ce){j.once&&D.removeEventListener(z,F),V(Ce)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}},{}],50:[function(n,o,a){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */a.read=function(u,c,d,f,h){var y,g,p=h*8-f-1,v=(1<<p)-1,_=v>>1,b=-7,A=d?h-1:0,w=d?-1:1,S=u[c+A];for(A+=w,y=S&(1<<-b)-1,S>>=-b,b+=p;b>0;y=y*256+u[c+A],A+=w,b-=8);for(g=y&(1<<-b)-1,y>>=-b,b+=f;b>0;g=g*256+u[c+A],A+=w,b-=8);if(y===0)y=1-_;else{if(y===v)return g?NaN:(S?-1:1)*(1/0);g=g+Math.pow(2,f),y=y-_}return(S?-1:1)*g*Math.pow(2,y-f)},a.write=function(u,c,d,f,h,y){var g,p,v,_=y*8-h-1,b=(1<<_)-1,A=b>>1,w=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=f?0:y-1,T=f?1:-1,x=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(p=isNaN(c)?1:0,g=b):(g=Math.floor(Math.log(c)/Math.LN2),c*(v=Math.pow(2,-g))<1&&(g--,v*=2),g+A>=1?c+=w/v:c+=w*Math.pow(2,1-A),c*v>=2&&(g++,v/=2),g+A>=b?(p=0,g=b):g+A>=1?(p=(c*v-1)*Math.pow(2,h),g=g+A):(p=c*Math.pow(2,A-1)*Math.pow(2,h),g=0));h>=8;u[d+S]=p&255,S+=T,p/=256,h-=8);for(g=g<<h|p,_+=h;_>0;u[d+S]=g&255,S+=T,g/=256,_-=8);u[d+S-T]|=x*128}},{}],51:[function(n,o,a){typeof Object.create=="function"?o.exports=function(c,d){d&&(c.super_=d,c.prototype=Object.create(d.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(c,d){if(d){c.super_=d;var f=function(){};f.prototype=d.prototype,c.prototype=new f,c.prototype.constructor=c}}},{}],52:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.ContainerIterator=a.Container=a.Base=void 0;class u{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}}a.ContainerIterator=u;class c{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}a.Base=c;class d extends c{}a.Container=d},{}],53:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.HashContainerIterator=a.HashContainer=void 0;var u=n("../../ContainerBase"),c=f(n("../../../utils/checkObject")),d=n("../../../utils/throwError");function f(g){return g&&g.t?g:{default:g}}class h extends u.ContainerIterator{constructor(p,v,_){super(_),this.o=p,this.h=v,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this})}}a.HashContainerIterator=h;class y extends u.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(p){const{L:v,B:_}=p;v.B=_,_.L=v,p===this.p&&(this.p=_),p===this._&&(this._=v),this.i-=1}M(p,v,_){_===void 0&&(_=(0,c.default)(p));let b;if(_){const A=p[this.HASH_TAG];if(A!==void 0)return this.H[A].l=v,this.i;Object.defineProperty(p,this.HASH_TAG,{value:this.H.length,configurable:!0}),b={u:p,l:v,L:this._,B:this.h},this.H.push(b)}else{const A=this.g[p];if(A)return A.l=v,this.i;b={u:p,l:v,L:this._,B:this.h},this.g[p]=b}return this.i===0?(this.p=b,this.h.B=b):this._.B=b,this._=b,this.h.L=b,++this.i}I(p,v){if(v===void 0&&(v=(0,c.default)(p)),v){const _=p[this.HASH_TAG];return _===void 0?this.h:this.H[_]}else return this.g[p]||this.h}clear(){const p=this.HASH_TAG;this.H.forEach(function(v){delete v.u[p]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(p,v){let _;if(v===void 0&&(v=(0,c.default)(p)),v){const b=p[this.HASH_TAG];if(b===void 0)return!1;delete p[this.HASH_TAG],_=this.H[b],delete this.H[b]}else{if(_=this.g[p],_===void 0)return!1;delete this.g[p]}return this.V(_),!0}eraseElementByIterator(p){const v=p.o;return v===this.h&&(0,d.throwIteratorAccessError)(),this.V(v),p.next()}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;let v=this.p;for(;p--;)v=v.B;return this.V(v),this.i}}a.HashContainer=y},{"../../../utils/checkObject":70,"../../../utils/throwError":71,"../../ContainerBase":52}],54:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./Base"),c=f(n("../../utils/checkObject")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends u.HashContainerIterator{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){this.o===this.h&&(0,d.throwIteratorAccessError)();const v=this;return new Proxy([],{get(_,b){if(b==="0")return v.o.u;if(b==="1")return v.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return v.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.HashContainer{constructor(v=[]){super();const _=this;v.forEach(function(b){_.setElement(b[0],b[1])})}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(v,_,b){return this.M(v,_,b)}getElementByKey(v,_){if(_===void 0&&(_=(0,c.default)(v)),_){const A=v[this.HASH_TAG];return A!==void 0?this.H[A].l:void 0}const b=this.g[v];return b?b.l:void 0}getElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return[_.u,_.l]}find(v,_){const b=this.I(v,_);return new h(b,this.h,this)}forEach(v){let _=0,b=this.p;for(;b!==this.h;)v([b.u,b.l],_++,this),b=b.B}[Symbol.iterator](){return(function*(){let v=this.p;for(;v!==this.h;)yield[v.u,v.l],v=v.B}).bind(this)()}}var g=y;a.default=g},{"../../utils/checkObject":70,"../../utils/throwError":71,"./Base":53}],55:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./Base"),c=n("../../utils/throwError");class d extends u.HashContainerIterator{constructor(g,p,v,_){super(g,p,_),this.container=v}get pointer(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o.u}copy(){return new d(this.o,this.h,this.container,this.iteratorType)}}class f extends u.HashContainer{constructor(g=[]){super();const p=this;g.forEach(function(v){p.insert(v)})}begin(){return new d(this.p,this.h,this)}end(){return new d(this.h,this.h,this)}rBegin(){return new d(this._,this.h,this,1)}rEnd(){return new d(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(g,p){return this.M(g,void 0,p)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=this.p;for(;g--;)p=p.B;return p.u}find(g,p){const v=this.I(g,p);return new d(v,this.h,this)}forEach(g){let p=0,v=this.p;for(;v!==this.h;)g(v.u,p++,this),v=v.B}[Symbol.iterator](){return(function*(){let g=this.p;for(;g!==this.h;)yield g.u,g=g.B}).bind(this)()}}var h=f;a.default=h},{"../../utils/throwError":71,"./Base":53}],56:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[],y=function(p,v){return p>v?-1:p<v?1:0},g=!0){if(super(),this.v=y,Array.isArray(h))this.C=g?[...h]:h;else{this.C=[];const v=this;h.forEach(function(_){v.C.push(_)})}this.i=this.C.length;const p=this.i>>1;for(let v=this.i-1>>1;v>=0;--v)this.k(v,p)}m(h){const y=this.C[h];for(;h>0;){const g=h-1>>1,p=this.C[g];if(this.v(p,y)<=0)break;this.C[h]=p,h=g}this.C[h]=y}k(h,y){const g=this.C[h];for(;h<y;){let p=h<<1|1;const v=p+1;let _=this.C[p];if(v<this.i&&this.v(_,this.C[v])>0&&(p=v,_=this.C[v]),this.v(_,g)>=0)break;this.C[h]=_,h=p}this.C[h]=g}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;const h=this.C[0],y=this.C.pop();return this.i-=1,this.i&&(this.C[0]=y,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){const y=this.C.indexOf(h);return y<0?!1:(y===0?this.pop():y===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(y,1,this.C.pop()),this.i-=1,this.m(y),this.k(y,this.i>>1)),!0)}updateItem(h){const y=this.C.indexOf(h);return y<0?!1:(this.m(y),this.k(y,this.i>>1),!0)}toArray(){return[...this.C]}}var d=c;a.default=d},{"../ContainerBase":52}],57:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.j=0,this.q=[];const y=this;h.forEach(function(g){y.push(g)})}clear(){this.q=[],this.i=this.j=0}push(h){const y=this.q.length;if(this.j/y>.5&&this.j+this.i>=y&&y>4096){const g=this.i;for(let p=0;p<g;++p)this.q[p]=this.q[this.j+p];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;const h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}}var d=c;a.default=d},{"../ContainerBase":52}],58:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.S=[];const y=this;h.forEach(function(g){y.push(g)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}}var d=c;a.default=d},{"../ContainerBase":52}],59:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.RandomIterator=void 0;var u=n("../../ContainerBase"),c=n("../../../utils/throwError");class d extends u.ContainerIterator{constructor(h,y){super(y),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,c.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,c.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,c.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,c.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}}a.RandomIterator=d},{"../../../utils/throwError":71,"../../ContainerBase":52}],60:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../../ContainerBase");class c extends u.Container{}var d=c;a.default=d},{"../../ContainerBase":52}],61:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(n("./Base")),c=n("./Base/RandomIterator");function d(g){return g&&g.t?g:{default:g}}class f extends c.RandomIterator{constructor(p,v,_){super(p,_),this.container=v}copy(){return new f(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],v=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];const _=(()=>{if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size;if(typeof p.size=="function")return p.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=v,this.P=Math.max(Math.ceil(_/this.F),1);for(let w=0;w<this.P;++w)this.A.push(new Array(this.F));const b=Math.ceil(_/this.F);this.j=this.R=(this.P>>1)-(b>>1),this.D=this.N=this.F-_%this.F>>1;const A=this;p.forEach(function(w){A.pushBack(w)})}T(){const p=[],v=Math.max(this.P>>1,1);for(let _=0;_<v;++_)p[_]=new Array(this.F);for(let _=this.j;_<this.P;++_)p[p.length]=this.A[_];for(let _=0;_<this.R;++_)p[p.length]=this.A[_];p[p.length]=[...this.A[this.R]],this.j=v,this.R=p.length-1;for(let _=0;_<v;++_)p[p.length]=new Array(this.F);this.A=p,this.P=p.length}O(p){const v=this.D+p+1,_=v%this.F;let b=_-1,A=this.j+(v-_)/this.F;return _===0&&(A-=1),A%=this.P,b<0&&(b+=this.F),{curNodeBucketIndex:A,curNodePointerIndex:b}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new f(0,this)}end(){return new f(this.i,this)}rBegin(){return new f(this.i-1,this,1)}rEnd(){return new f(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(p){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=p,this.i}popBack(){if(this.i===0)return;const p=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,p}pushFront(p){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=p,this.i}popFront(){if(this.i===0)return;const p=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,p}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:v,curNodePointerIndex:_}=this.O(p);return this.A[v][_]}setElementByPos(p,v){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:_,curNodePointerIndex:b}=this.O(p);this.A[_][b]=v}insert(p,v,_=1){if(p<0||p>this.i)throw new RangeError;if(p===0)for(;_--;)this.pushFront(v);else if(p===this.i)for(;_--;)this.pushBack(v);else{const b=[];for(let A=p;A<this.i;++A)b.push(this.getElementByPos(A));this.cut(p-1);for(let A=0;A<_;++A)this.pushBack(v);for(let A=0;A<b.length;++A)this.pushBack(b[A])}return this.i}cut(p){if(p<0)return this.clear(),0;const{curNodeBucketIndex:v,curNodePointerIndex:_}=this.O(p);return this.R=v,this.N=_,this.i=p+1,this.i}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;if(p===0)this.popFront();else if(p===this.i-1)this.popBack();else{const v=[];for(let b=p+1;b<this.i;++b)v.push(this.getElementByPos(b));this.cut(p),this.popBack();const _=this;v.forEach(function(b){_.pushBack(b)})}return this.i}eraseElementByValue(p){if(this.i===0)return 0;const v=[];for(let b=0;b<this.i;++b){const A=this.getElementByPos(b);A!==p&&v.push(A)}const _=v.length;for(let b=0;b<_;++b)this.setElementByPos(b,v[b]);return this.cut(_-1)}eraseElementByIterator(p){const v=p.o;return this.eraseElementByPos(v),p=p.next(),p}find(p){for(let v=0;v<this.i;++v)if(this.getElementByPos(v)===p)return new f(v,this);return this.end()}reverse(){let p=0,v=this.i-1;for(;p<v;){const _=this.getElementByPos(p);this.setElementByPos(p,this.getElementByPos(v)),this.setElementByPos(v,_),p+=1,v-=1}}unique(){if(this.i<=1)return this.i;let p=1,v=this.getElementByPos(0);for(let _=1;_<this.i;++_){const b=this.getElementByPos(_);b!==v&&(v=b,this.setElementByPos(p++,b))}for(;this.i>p;)this.popBack();return this.i}sort(p){const v=[];for(let _=0;_<this.i;++_)v.push(this.getElementByPos(_));v.sort(p);for(let _=0;_<this.i;++_)this.setElementByPos(_,v[_])}shrinkToFit(){if(this.i===0)return;const p=[];this.forEach(function(v){p.push(v)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let v=0;v<this.P;++v)this.A.push(new Array(this.F));for(let v=0;v<p.length;++v)this.pushBack(p[v])}forEach(p){for(let v=0;v<this.i;++v)p(this.getElementByPos(v),v,this)}[Symbol.iterator](){return(function*(){for(let p=0;p<this.i;++p)yield this.getElementByPos(p)}).bind(this)()}}var y=h;a.default=y},{"./Base":60,"./Base/RandomIterator":59}],62:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=n("../ContainerBase"),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.ContainerIterator{constructor(v,_,b,A){super(A),this.o=v,this.h=_,this.container=b,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.l}set pointer(v){this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.l=v}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;const _=this;v.forEach(function(b){_.pushBack(b)})}V(v){const{L:_,B:b}=v;_.B=b,b.L=_,v===this.p&&(this.p=b),v===this._&&(this._=_),this.i-=1}G(v,_){const b=_.B,A={l:v,L:_,B:b};_.B=A,b.L=A,_===this.h&&(this.p=A),b===this.h&&(this._=A),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return _.l}eraseElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return this.V(_),this.i}eraseElementByValue(v){let _=this.p;for(;_!==this.h;)_.l===v&&this.V(_),_=_.B;return this.i}eraseElementByIterator(v){const _=v.o;return _===this.h&&(0,d.throwIteratorAccessError)(),v=v.next(),this.V(_),v}pushBack(v){return this.G(v,this._),this.i}popBack(){if(this.i===0)return;const v=this._.l;return this.V(this._),v}pushFront(v){return this.G(v,this.h),this.i}popFront(){if(this.i===0)return;const v=this.p.l;return this.V(this.p),v}setElementByPos(v,_){if(v<0||v>this.i-1)throw new RangeError;let b=this.p;for(;v--;)b=b.B;b.l=_}insert(v,_,b=1){if(v<0||v>this.i)throw new RangeError;if(b<=0)return this.i;if(v===0)for(;b--;)this.pushFront(_);else if(v===this.i)for(;b--;)this.pushBack(_);else{let A=this.p;for(let S=1;S<v;++S)A=A.B;const w=A.B;for(this.i+=b;b--;)A.B={l:_,L:A},A.B.L=A,A=A.B;A.B=w,w.L=A}return this.i}find(v){let _=this.p;for(;_!==this.h;){if(_.l===v)return new h(_,this.h,this);_=_.B}return this.end()}reverse(){if(this.i<=1)return;let v=this.p,_=this._,b=0;for(;b<<1<this.i;){const A=v.l;v.l=_.l,_.l=A,v=v.B,_=_.L,b+=1}}unique(){if(this.i<=1)return this.i;let v=this.p;for(;v!==this.h;){let _=v;for(;_.B!==this.h&&_.l===_.B.l;)_=_.B,this.i-=1;v.B=_.B,v.B.L=v,v=v.B}return this.i}sort(v){if(this.i<=1)return;const _=[];this.forEach(function(A){_.push(A)}),_.sort(v);let b=this.p;_.forEach(function(A){b.l=A,b=b.B})}merge(v){const _=this;if(this.i===0)v.forEach(function(b){_.pushBack(b)});else{let b=this.p;v.forEach(function(A){for(;b!==_.h&&b.l<=A;)b=b.B;_.G(A,b.L)})}return this.i}forEach(v){let _=this.p,b=0;for(;_!==this.h;)v(_.l,b++,this),_=_.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let v=this.p;for(;v!==this.h;)yield v.l,v=v.B}).bind(this)()}}var g=y;a.default=g},{"../../utils/throwError":71,"../ContainerBase":52,"./Base":60}],63:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(n("./Base")),c=n("./Base/RandomIterator");function d(g){return g&&g.t?g:{default:g}}class f extends c.RandomIterator{constructor(p,v,_){super(p,_),this.container=v}copy(){return new f(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],v=!0){if(super(),Array.isArray(p))this.J=v?[...p]:p,this.i=p.length;else{this.J=[];const _=this;p.forEach(function(b){_.pushBack(b)})}}clear(){this.i=0,this.J.length=0}begin(){return new f(0,this)}end(){return new f(this.i,this)}rBegin(){return new f(this.i-1,this,1)}rEnd(){return new f(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J[p]}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J.splice(p,1),this.i-=1,this.i}eraseElementByValue(p){let v=0;for(let _=0;_<this.i;++_)this.J[_]!==p&&(this.J[v++]=this.J[_]);return this.i=this.J.length=v,this.i}eraseElementByIterator(p){const v=p.o;return p=p.next(),this.eraseElementByPos(v),p}pushBack(p){return this.J.push(p),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(p,v){if(p<0||p>this.i-1)throw new RangeError;this.J[p]=v}insert(p,v,_=1){if(p<0||p>this.i)throw new RangeError;return this.J.splice(p,0,...new Array(_).fill(v)),this.i+=_,this.i}find(p){for(let v=0;v<this.i;++v)if(this.J[v]===p)return new f(v,this);return this.end()}reverse(){this.J.reverse()}unique(){let p=1;for(let v=1;v<this.i;++v)this.J[v]!==this.J[v-1]&&(this.J[p++]=this.J[v]);return this.i=this.J.length=p,this.i}sort(p){this.J.sort(p)}forEach(p){for(let v=0;v<this.i;++v)p(this.J[v],v,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}}var y=h;a.default=y},{"./Base":60,"./Base/RandomIterator":59}],64:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../../ContainerBase"),c=n("../../../utils/throwError");class d extends u.ContainerIterator{constructor(y,g,p){super(p),this.o=y,this.h=g,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let y=this.o;const g=this.h.tt;if(y===this.h)return g?g.rt-1:0;let p=0;for(y.U&&(p+=y.U.rt);y!==g;){const v=y.tt;y===v.W&&(p+=1,v.U&&(p+=v.U.rt)),y=v}return p}}var f=d;a.default=f},{"../../../utils/throwError":71,"../../ContainerBase":52}],65:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.TreeNodeEnableIndex=a.TreeNode=void 0;class u{constructor(f,h){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=f,this.l=h}L(){let f=this;if(f.ee===1&&f.tt.tt===f)f=f.W;else if(f.U)for(f=f.U;f.W;)f=f.W;else{let h=f.tt;for(;h.U===f;)f=h,h=f.tt;f=h}return f}B(){let f=this;if(f.W){for(f=f.W;f.U;)f=f.U;return f}else{let h=f.tt;for(;h.W===f;)f=h,h=f.tt;return f.W!==h?h:f}}te(){const f=this.tt,h=this.W,y=h.U;return f.tt===this?f.tt=h:f.U===this?f.U=h:f.W=h,h.tt=f,h.U=this,this.tt=h,this.W=y,y&&(y.tt=this),h}se(){const f=this.tt,h=this.U,y=h.W;return f.tt===this?f.tt=h:f.U===this?f.U=h:f.W=h,h.tt=f,h.W=this,this.tt=h,this.U=y,y&&(y.tt=this),h}}a.TreeNode=u;class c extends u{constructor(){super(...arguments),this.rt=1}te(){const f=super.te();return this.ie(),f.ie(),f}se(){const f=super.se();return this.ie(),f.ie(),f}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}a.TreeNodeEnableIndex=c},{}],66:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./TreeNode"),c=n("../../ContainerBase"),d=n("../../../utils/throwError");class f extends c.Container{constructor(g=function(v,_){return v<_?-1:v>_?1:0},p=!1){super(),this.Y=void 0,this.v=g,p?(this.re=u.TreeNodeEnableIndex,this.M=function(v,_,b){const A=this.ne(v,_,b);if(A){let w=A.tt;for(;w!==this.h;)w.rt+=1,w=w.tt;const S=this.he(A);if(S){const{parentNode:T,grandParent:x,curNode:M}=S;T.ie(),x.ie(),M.ie()}}return this.i},this.V=function(v){let _=this.fe(v);for(;_!==this.h;)_.rt-=1,_=_.tt}):(this.re=u.TreeNode,this.M=function(v,_,b){const A=this.ne(v,_,b);return A&&this.he(A),this.i},this.V=this.fe),this.h=new this.re}X(g,p){let v=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)g=g.W;else if(_>0)v=g,g=g.U;else return g}return v}Z(g,p){let v=this.h;for(;g;)this.v(g.u,p)<=0?g=g.W:(v=g,g=g.U);return v}$(g,p){let v=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)v=g,g=g.W;else if(_>0)g=g.U;else return g}return v}rr(g,p){let v=this.h;for(;g;)this.v(g.u,p)<0?(v=g,g=g.W):g=g.U;return v}ue(g){for(;;){const p=g.tt;if(p===this.h)return;if(g.ee===1){g.ee=0;return}if(g===p.U){const v=p.W;if(v.ee===1)v.ee=0,p.ee=1,p===this.Y?this.Y=p.te():p.te();else if(v.W&&v.W.ee===1){v.ee=p.ee,p.ee=0,v.W.ee=0,p===this.Y?this.Y=p.te():p.te();return}else v.U&&v.U.ee===1?(v.ee=1,v.U.ee=0,v.se()):(v.ee=1,g=p)}else{const v=p.U;if(v.ee===1)v.ee=0,p.ee=1,p===this.Y?this.Y=p.se():p.se();else if(v.U&&v.U.ee===1){v.ee=p.ee,p.ee=0,v.U.ee=0,p===this.Y?this.Y=p.se():p.se();return}else v.W&&v.W.ee===1?(v.ee=1,v.W.ee=0,v.te()):(v.ee=1,g=p)}}}fe(g){if(this.i===1)return this.clear(),this.h;let p=g;for(;p.U||p.W;){if(p.W)for(p=p.W;p.U;)p=p.U;else p=p.U;[g.u,p.u]=[p.u,g.u],[g.l,p.l]=[p.l,g.l],g=p}this.h.U===p?this.h.U=p.tt:this.h.W===p&&(this.h.W=p.tt),this.ue(p);const v=p.tt;return p===v.U?v.U=void 0:v.W=void 0,this.i-=1,this.Y.ee=0,v}oe(g,p){return g===void 0?!1:this.oe(g.U,p)||p(g)?!0:this.oe(g.W,p)}he(g){for(;;){const p=g.tt;if(p.ee===0)return;const v=p.tt;if(p===v.U){const _=v.W;if(_&&_.ee===1){if(_.ee=p.ee=0,v===this.Y)return;v.ee=1,g=v;continue}else if(g===p.W){if(g.ee=0,g.U&&(g.U.tt=p),g.W&&(g.W.tt=v),p.W=g.U,v.U=g.W,g.U=p,g.W=v,v===this.Y)this.Y=g,this.h.tt=g;else{const b=v.tt;b.U===v?b.U=g:b.W=g}return g.tt=v.tt,p.tt=g,v.tt=g,v.ee=1,{parentNode:p,grandParent:v,curNode:g}}else p.ee=0,v===this.Y?this.Y=v.se():v.se(),v.ee=1}else{const _=v.U;if(_&&_.ee===1){if(_.ee=p.ee=0,v===this.Y)return;v.ee=1,g=v;continue}else if(g===p.U){if(g.ee=0,g.U&&(g.U.tt=v),g.W&&(g.W.tt=p),v.W=g.U,p.U=g.W,g.U=v,g.W=p,v===this.Y)this.Y=g,this.h.tt=g;else{const b=v.tt;b.U===v?b.U=g:b.W=g}return g.tt=v.tt,p.tt=g,v.tt=g,v.ee=1,{parentNode:p,grandParent:v,curNode:g}}else p.ee=0,v===this.Y?this.Y=v.te():v.te(),v.ee=1}return}}ne(g,p,v){if(this.Y===void 0){this.i+=1,this.Y=new this.re(g,p),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let _;const b=this.h.U,A=this.v(b.u,g);if(A===0){b.l=p;return}else if(A>0)b.U=new this.re(g,p),b.U.tt=b,_=b.U,this.h.U=_;else{const w=this.h.W,S=this.v(w.u,g);if(S===0){w.l=p;return}else if(S<0)w.W=new this.re(g,p),w.W.tt=w,_=w.W,this.h.W=_;else{if(v!==void 0){const T=v.o;if(T!==this.h){const x=this.v(T.u,g);if(x===0){T.l=p;return}else if(x>0){const M=T.L(),L=this.v(M.u,g);if(L===0){M.l=p;return}else L<0&&(_=new this.re(g,p),M.W===void 0?(M.W=_,_.tt=M):(T.U=_,_.tt=T))}}}if(_===void 0)for(_=this.Y;;){const T=this.v(_.u,g);if(T>0){if(_.U===void 0){_.U=new this.re(g,p),_.U.tt=_,_=_.U;break}_=_.U}else if(T<0){if(_.W===void 0){_.W=new this.re(g,p),_.W.tt=_,_=_.W;break}_=_.W}else{_.l=p;return}}}}return this.i+=1,_}I(g,p){for(;g;){const v=this.v(g.u,p);if(v<0)g=g.W;else if(v>0)g=g.U;else return g}return g||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(g,p){const v=g.o;if(v===this.h&&(0,d.throwIteratorAccessError)(),this.i===1)return v.u=p,!0;if(v===this.h.U)return this.v(v.B().u,p)>0?(v.u=p,!0):!1;if(v===this.h.W)return this.v(v.L().u,p)<0?(v.u=p,!0):!1;const _=v.L().u;if(this.v(_,p)>=0)return!1;const b=v.B().u;return this.v(b,p)<=0?!1:(v.u=p,!0)}eraseElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=0;const v=this;return this.oe(this.Y,function(_){return g===p?(v.V(_),!0):(p+=1,!1)}),this.i}eraseElementByKey(g){if(this.i===0)return!1;const p=this.I(this.Y,g);return p===this.h?!1:(this.V(p),!0)}eraseElementByIterator(g){const p=g.o;p===this.h&&(0,d.throwIteratorAccessError)();const v=p.W===void 0;return g.iteratorType===0?v&&g.next():(!v||p.U===void 0)&&g.next(),this.V(p),g}forEach(g){let p=0;for(const v of this)g(v,p++,this)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p,v=0;for(const _ of this){if(v===g){p=_;break}v+=1}return p}getHeight(){if(this.i===0)return 0;const g=function(p){return p?Math.max(g(p.U),g(p.W))+1:0};return g(this.Y)}}var h=f;a.default=h},{"../../../utils/throwError":71,"../../ContainerBase":52,"./TreeNode":65}],67:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=f(n("./Base/TreeIterator")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){this.o===this.h&&(0,d.throwIteratorAccessError)();const v=this;return new Proxy([],{get(_,b){if(b==="0")return v.o.u;if(b==="1")return v.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return v.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[],_,b){super(_,b);const A=this;v.forEach(function(w){A.setElement(w[0],w[1])})}*K(v){v!==void 0&&(yield*this.K(v.U),yield[v.u,v.l],yield*this.K(v.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i===0)return;const v=this.h.U;return[v.u,v.l]}back(){if(this.i===0)return;const v=this.h.W;return[v.u,v.l]}lowerBound(v){const _=this.X(this.Y,v);return new h(_,this.h,this)}upperBound(v){const _=this.Z(this.Y,v);return new h(_,this.h,this)}reverseLowerBound(v){const _=this.$(this.Y,v);return new h(_,this.h,this)}reverseUpperBound(v){const _=this.rr(this.Y,v);return new h(_,this.h,this)}setElement(v,_,b){return this.M(v,_,b)}find(v){const _=this.I(this.Y,v);return new h(_,this.h,this)}getElementByKey(v){return this.I(this.Y,v).l}union(v){const _=this;return v.forEach(function(b){_.setElement(b[0],b[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=y;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],68:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=f(n("./Base/TreeIterator")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.u}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[],_,b){super(_,b);const A=this;v.forEach(function(w){A.insert(w)})}*K(v){v!==void 0&&(yield*this.K(v.U),yield v.u,yield*this.K(v.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(v,_){return this.M(v,void 0,_)}find(v){const _=this.I(this.Y,v);return new h(_,this.h,this)}lowerBound(v){const _=this.X(this.Y,v);return new h(_,this.h,this)}upperBound(v){const _=this.Z(this.Y,v);return new h(_,this.h,this)}reverseLowerBound(v){const _=this.$(this.Y,v);return new h(_,this.h,this)}reverseUpperBound(v){const _=this.rr(this.Y,v);return new h(_,this.h,this)}union(v){const _=this;return v.forEach(function(b){_.insert(b)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=y;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],69:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),Object.defineProperty(a,"Deque",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(a,"HashMap",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(a,"HashSet",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(a,"LinkList",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(a,"OrderedMap",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(a,"OrderedSet",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(a,"PriorityQueue",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(a,"Queue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(a,"Stack",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(a,"Vector",{enumerable:!0,get:function(){return f.default}});var u=b(n("./container/OtherContainer/Stack")),c=b(n("./container/OtherContainer/Queue")),d=b(n("./container/OtherContainer/PriorityQueue")),f=b(n("./container/SequentialContainer/Vector")),h=b(n("./container/SequentialContainer/LinkList")),y=b(n("./container/SequentialContainer/Deque")),g=b(n("./container/TreeContainer/OrderedSet")),p=b(n("./container/TreeContainer/OrderedMap")),v=b(n("./container/HashContainer/HashSet")),_=b(n("./container/HashContainer/HashMap"));function b(A){return A&&A.t?A:{default:A}}},{"./container/HashContainer/HashMap":54,"./container/HashContainer/HashSet":55,"./container/OtherContainer/PriorityQueue":56,"./container/OtherContainer/Queue":57,"./container/OtherContainer/Stack":58,"./container/SequentialContainer/Deque":61,"./container/SequentialContainer/LinkList":62,"./container/SequentialContainer/Vector":63,"./container/TreeContainer/OrderedMap":67,"./container/TreeContainer/OrderedSet":68}],70:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=u;function u(c){const d=typeof c;return d==="object"&&c!==null||d==="function"}},{}],71:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.throwIteratorAccessError=u;function u(){throw new RangeError("Iterator access denied!")}},{}],72:[function(n,o,a){(function(u){(function(){const c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,f=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(D=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||D,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},h=typeof AbortSignal=="function",y=typeof f.AbortSignal=="function",g=h?AbortSignal:y?f.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(D){D.type==="abort"&&(this.aborted=!0,this.onabort(D),this._listeners.forEach(z=>z(D),this))}onabort(){}addEventListener(D,z){D==="abort"&&this._listeners.push(z)}removeEventListener(D,z){D==="abort"&&(this._listeners=this._listeners.filter(V=>V!==z))}},p=new Set,v=(re,D)=>{const z=`LRU_CACHE_OPTION_${re}`;w(z)&&S(z,`${re} option`,`options.${D}`,O)},_=(re,D)=>{const z=`LRU_CACHE_METHOD_${re}`;if(w(z)){const{prototype:V}=O,{get:j}=Object.getOwnPropertyDescriptor(V,re);S(z,`${re} method`,`cache.${D}()`,j)}},b=(re,D)=>{const z=`LRU_CACHE_PROPERTY_${re}`;if(w(z)){const{prototype:V}=O,{get:j}=Object.getOwnPropertyDescriptor(V,re);S(z,`${re} property`,`cache.${D}`,j)}},A=(...re)=>{typeof u=="object"&&u&&typeof u.emitWarning=="function"?u.emitWarning(...re):console.error(...re)},w=re=>!p.has(re),S=(re,D,z,V)=>{p.add(re);const j=`The ${D} is deprecated. Please use ${z} instead.`;A(j,"DeprecationWarning",re,V)},T=re=>re&&re===Math.floor(re)&&re>0&&isFinite(re),x=re=>T(re)?re<=Math.pow(2,8)?Uint8Array:re<=Math.pow(2,16)?Uint16Array:re<=Math.pow(2,32)?Uint32Array:re<=Number.MAX_SAFE_INTEGER?M:null:null;class M extends Array{constructor(D){super(D),this.fill(0)}}class L{constructor(D){if(D===0)return[];const z=x(D);this.heap=new z(D),this.length=0}push(D){this.heap[this.length++]=D}pop(){return this.heap[--this.length]}}class O{constructor(D={}){const{max:z=0,ttl:V,ttlResolution:j=1,ttlAutopurge:F,updateAgeOnGet:Ce,updateAgeOnHas:le,allowStale:pe,dispose:$e,disposeAfter:Fe,noDisposeOnSet:Oe,noUpdateTTL:Et,maxSize:he=0,maxEntrySize:In=0,sizeCalculation:vn,fetchMethod:kt,fetchContext:ue,noDeleteOnFetchRejection:At,noDeleteOnStaleGet:jt,allowStaleOnFetchRejection:hn,allowStaleOnFetchAbort:Pt,ignoreFetchAbort:Ie}=D,{length:de,maxAge:ze,stale:xe}=D instanceof O?{}:D;if(z!==0&&!T(z))throw new TypeError("max option must be a nonnegative integer");const Ne=z?x(z):Array;if(!Ne)throw new Error("invalid max value: "+z);if(this.max=z,this.maxSize=he,this.maxEntrySize=In||this.maxSize,this.sizeCalculation=vn||de,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=kt||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=ue,!this.fetchMethod&&ue!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(z).fill(null),this.valList=new Array(z).fill(null),this.next=new Ne(z),this.prev=new Ne(z),this.head=0,this.tail=0,this.free=new L(z),this.initialFill=1,this.size=0,typeof $e=="function"&&(this.dispose=$e),typeof Fe=="function"?(this.disposeAfter=Fe,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!Oe,this.noUpdateTTL=!!Et,this.noDeleteOnFetchRejection=!!At,this.allowStaleOnFetchRejection=!!hn,this.allowStaleOnFetchAbort=!!Pt,this.ignoreFetchAbort=!!Ie,this.maxEntrySize!==0){if(this.maxSize!==0&&!T(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!pe||!!xe,this.noDeleteOnStaleGet=!!jt,this.updateAgeOnGet=!!Ce,this.updateAgeOnHas=!!le,this.ttlResolution=T(j)||j===0?j:1,this.ttlAutopurge=!!F,this.ttl=V||ze||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const Lt="LRU_CACHE_UNBOUNDED";w(Lt)&&(p.add(Lt),A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,O))}xe&&v("stale","allowStale"),ze&&v("maxAge","ttl"),de&&v("length","sizeCalculation")}getRemainingTTL(D){return this.has(D,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new M(this.max),this.starts=new M(this.max),this.setItemTTL=(V,j,F=c.now())=>{if(this.starts[V]=j!==0?F:0,this.ttls[V]=j,j!==0&&this.ttlAutopurge){const Ce=setTimeout(()=>{this.isStale(V)&&this.delete(this.keyList[V])},j+1);Ce.unref&&Ce.unref()}},this.updateItemAge=V=>{this.starts[V]=this.ttls[V]!==0?c.now():0},this.statusTTL=(V,j)=>{V&&(V.ttl=this.ttls[j],V.start=this.starts[j],V.now=D||z(),V.remainingTTL=V.now+V.ttl-V.start)};let D=0;const z=()=>{const V=c.now();if(this.ttlResolution>0){D=V;const j=setTimeout(()=>D=0,this.ttlResolution);j.unref&&j.unref()}return V};this.getRemainingTTL=V=>{const j=this.keyMap.get(V);return j===void 0?0:this.ttls[j]===0||this.starts[j]===0?1/0:this.starts[j]+this.ttls[j]-(D||z())},this.isStale=V=>this.ttls[V]!==0&&this.starts[V]!==0&&(D||z())-this.starts[V]>this.ttls[V]}updateItemAge(D){}statusTTL(D,z){}setItemTTL(D,z,V){}isStale(D){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new M(this.max),this.removeItemSize=D=>{this.calculatedSize-=this.sizes[D],this.sizes[D]=0},this.requireSize=(D,z,V,j)=>{if(this.isBackgroundFetch(z))return 0;if(!T(V))if(j){if(typeof j!="function")throw new TypeError("sizeCalculation must be a function");if(V=j(z,D),!T(V))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V},this.addItemSize=(D,z,V)=>{if(this.sizes[D]=z,this.maxSize){const j=this.maxSize-this.sizes[D];for(;this.calculatedSize>j;)this.evict(!0)}this.calculatedSize+=this.sizes[D],V&&(V.entrySize=z,V.totalCalculatedSize=this.calculatedSize)}}removeItemSize(D){}addItemSize(D,z){}requireSize(D,z,V,j){if(V||j)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:D=this.allowStale}={}){if(this.size)for(let z=this.tail;!(!this.isValidIndex(z)||((D||!this.isStale(z))&&(yield z),z===this.head));)z=this.prev[z]}*rindexes({allowStale:D=this.allowStale}={}){if(this.size)for(let z=this.head;!(!this.isValidIndex(z)||((D||!this.isStale(z))&&(yield z),z===this.tail));)z=this.next[z]}isValidIndex(D){return D!==void 0&&this.keyMap.get(this.keyList[D])===D}*entries(){for(const D of this.indexes())this.valList[D]!==void 0&&this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield[this.keyList[D],this.valList[D]])}*rentries(){for(const D of this.rindexes())this.valList[D]!==void 0&&this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield[this.keyList[D],this.valList[D]])}*keys(){for(const D of this.indexes())this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.keyList[D])}*rkeys(){for(const D of this.rindexes())this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.keyList[D])}*values(){for(const D of this.indexes())this.valList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.valList[D])}*rvalues(){for(const D of this.rindexes())this.valList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.valList[D])}[Symbol.iterator](){return this.entries()}find(D,z){for(const V of this.indexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;if(F!==void 0&&D(F,this.keyList[V],this))return this.get(this.keyList[V],z)}}forEach(D,z=this){for(const V of this.indexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;F!==void 0&&D.call(z,F,this.keyList[V],this)}}rforEach(D,z=this){for(const V of this.rindexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;F!==void 0&&D.call(z,F,this.keyList[V],this)}}get prune(){return _("prune","purgeStale"),this.purgeStale}purgeStale(){let D=!1;for(const z of this.rindexes({allowStale:!0}))this.isStale(z)&&(this.delete(this.keyList[z]),D=!0);return D}dump(){const D=[];for(const z of this.indexes({allowStale:!0})){const V=this.keyList[z],j=this.valList[z],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;if(F===void 0)continue;const Ce={value:F};if(this.ttls){Ce.ttl=this.ttls[z];const le=c.now()-this.starts[z];Ce.start=Math.floor(Date.now()-le)}this.sizes&&(Ce.size=this.sizes[z]),D.unshift([V,Ce])}return D}load(D){this.clear();for(const[z,V]of D){if(V.start){const j=Date.now()-V.start;V.start=c.now()-j}this.set(z,V.value,V)}}dispose(D,z,V){}set(D,z,{ttl:V=this.ttl,start:j,noDisposeOnSet:F=this.noDisposeOnSet,size:Ce=0,sizeCalculation:le=this.sizeCalculation,noUpdateTTL:pe=this.noUpdateTTL,status:$e}={}){if(Ce=this.requireSize(D,z,Ce,le),this.maxEntrySize&&Ce>this.maxEntrySize)return $e&&($e.set="miss",$e.maxEntrySizeExceeded=!0),this.delete(D),this;let Fe=this.size===0?void 0:this.keyMap.get(D);if(Fe===void 0)Fe=this.newIndex(),this.keyList[Fe]=D,this.valList[Fe]=z,this.keyMap.set(D,Fe),this.next[this.tail]=Fe,this.prev[Fe]=this.tail,this.tail=Fe,this.size++,this.addItemSize(Fe,Ce,$e),$e&&($e.set="add"),pe=!1;else{this.moveToTail(Fe);const Oe=this.valList[Fe];if(z!==Oe){if(this.isBackgroundFetch(Oe)?Oe.__abortController.abort(new Error("replaced")):F||(this.dispose(Oe,D,"set"),this.disposeAfter&&this.disposed.push([Oe,D,"set"])),this.removeItemSize(Fe),this.valList[Fe]=z,this.addItemSize(Fe,Ce,$e),$e){$e.set="replace";const Et=Oe&&this.isBackgroundFetch(Oe)?Oe.__staleWhileFetching:Oe;Et!==void 0&&($e.oldValue=Et)}}else $e&&($e.set="update")}if(V!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),pe||this.setItemTTL(Fe,V,j),this.statusTTL($e,Fe),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const D=this.valList[this.head];return this.evict(!0),D}}evict(D){const z=this.head,V=this.keyList[z],j=this.valList[z];return this.isBackgroundFetch(j)?j.__abortController.abort(new Error("evicted")):(this.dispose(j,V,"evict"),this.disposeAfter&&this.disposed.push([j,V,"evict"])),this.removeItemSize(z),D&&(this.keyList[z]=null,this.valList[z]=null,this.free.push(z)),this.head=this.next[z],this.keyMap.delete(V),this.size--,z}has(D,{updateAgeOnHas:z=this.updateAgeOnHas,status:V}={}){const j=this.keyMap.get(D);if(j!==void 0)if(this.isStale(j))V&&(V.has="stale",this.statusTTL(V,j));else return z&&this.updateItemAge(j),V&&(V.has="hit"),this.statusTTL(V,j),!0;else V&&(V.has="miss");return!1}peek(D,{allowStale:z=this.allowStale}={}){const V=this.keyMap.get(D);if(V!==void 0&&(z||!this.isStale(V))){const j=this.valList[V];return this.isBackgroundFetch(j)?j.__staleWhileFetching:j}}backgroundFetch(D,z,V,j){const F=z===void 0?void 0:this.valList[z];if(this.isBackgroundFetch(F))return F;const Ce=new f;V.signal&&V.signal.addEventListener("abort",()=>Ce.abort(V.signal.reason));const le={signal:Ce.signal,options:V,context:j},pe=(he,In=!1)=>{const{aborted:vn}=Ce.signal,kt=V.ignoreFetchAbort&&he!==void 0;return V.status&&(vn&&!In?(V.status.fetchAborted=!0,V.status.fetchError=Ce.signal.reason,kt&&(V.status.fetchAbortIgnored=!0)):V.status.fetchResolved=!0),vn&&!kt&&!In?Fe(Ce.signal.reason):(this.valList[z]===Et&&(he===void 0?Et.__staleWhileFetching?this.valList[z]=Et.__staleWhileFetching:this.delete(D):(V.status&&(V.status.fetchUpdated=!0),this.set(D,he,le.options))),he)},$e=he=>(V.status&&(V.status.fetchRejected=!0,V.status.fetchError=he),Fe(he)),Fe=he=>{const{aborted:In}=Ce.signal,vn=In&&V.allowStaleOnFetchAbort,kt=vn||V.allowStaleOnFetchRejection,ue=kt||V.noDeleteOnFetchRejection;if(this.valList[z]===Et&&(!ue||Et.__staleWhileFetching===void 0?this.delete(D):vn||(this.valList[z]=Et.__staleWhileFetching)),kt)return V.status&&Et.__staleWhileFetching!==void 0&&(V.status.returnedStale=!0),Et.__staleWhileFetching;if(Et.__returned===Et)throw he},Oe=(he,In)=>{this.fetchMethod(D,F,le).then(vn=>he(vn),In),Ce.signal.addEventListener("abort",()=>{(!V.ignoreFetchAbort||V.allowStaleOnFetchAbort)&&(he(),V.allowStaleOnFetchAbort&&(he=vn=>pe(vn,!0)))})};V.status&&(V.status.fetchDispatched=!0);const Et=new Promise(Oe).then(pe,$e);return Et.__abortController=Ce,Et.__staleWhileFetching=F,Et.__returned=null,z===void 0?(this.set(D,Et,{...le.options,status:void 0}),z=this.keyMap.get(D)):this.valList[z]=Et,Et}isBackgroundFetch(D){return D&&typeof D=="object"&&typeof D.then=="function"&&Object.prototype.hasOwnProperty.call(D,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(D,"__returned")&&(D.__returned===D||D.__returned===null)}async fetch(D,{allowStale:z=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:j=this.noDeleteOnStaleGet,ttl:F=this.ttl,noDisposeOnSet:Ce=this.noDisposeOnSet,size:le=0,sizeCalculation:pe=this.sizeCalculation,noUpdateTTL:$e=this.noUpdateTTL,noDeleteOnFetchRejection:Fe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Oe=this.allowStaleOnFetchRejection,ignoreFetchAbort:Et=this.ignoreFetchAbort,allowStaleOnFetchAbort:he=this.allowStaleOnFetchAbort,fetchContext:In=this.fetchContext,forceRefresh:vn=!1,status:kt,signal:ue}={}){if(!this.fetchMethod)return kt&&(kt.fetch="get"),this.get(D,{allowStale:z,updateAgeOnGet:V,noDeleteOnStaleGet:j,status:kt});const At={allowStale:z,updateAgeOnGet:V,noDeleteOnStaleGet:j,ttl:F,noDisposeOnSet:Ce,size:le,sizeCalculation:pe,noUpdateTTL:$e,noDeleteOnFetchRejection:Fe,allowStaleOnFetchRejection:Oe,allowStaleOnFetchAbort:he,ignoreFetchAbort:Et,status:kt,signal:ue};let jt=this.keyMap.get(D);if(jt===void 0){kt&&(kt.fetch="miss");const hn=this.backgroundFetch(D,jt,At,In);return hn.__returned=hn}else{const hn=this.valList[jt];if(this.isBackgroundFetch(hn)){const xe=z&&hn.__staleWhileFetching!==void 0;return kt&&(kt.fetch="inflight",xe&&(kt.returnedStale=!0)),xe?hn.__staleWhileFetching:hn.__returned=hn}const Pt=this.isStale(jt);if(!vn&&!Pt)return kt&&(kt.fetch="hit"),this.moveToTail(jt),V&&this.updateItemAge(jt),this.statusTTL(kt,jt),hn;const Ie=this.backgroundFetch(D,jt,At,In),de=Ie.__staleWhileFetching!==void 0,ze=de&&z;return kt&&(kt.fetch=de&&Pt?"stale":"refresh",ze&&Pt&&(kt.returnedStale=!0)),ze?Ie.__staleWhileFetching:Ie.__returned=Ie}}get(D,{allowStale:z=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:j=this.noDeleteOnStaleGet,status:F}={}){const Ce=this.keyMap.get(D);if(Ce!==void 0){const le=this.valList[Ce],pe=this.isBackgroundFetch(le);return this.statusTTL(F,Ce),this.isStale(Ce)?(F&&(F.get="stale"),pe?(F&&(F.returnedStale=z&&le.__staleWhileFetching!==void 0),z?le.__staleWhileFetching:void 0):(j||this.delete(D),F&&(F.returnedStale=z),z?le:void 0)):(F&&(F.get="hit"),pe?le.__staleWhileFetching:(this.moveToTail(Ce),V&&this.updateItemAge(Ce),le))}else F&&(F.get="miss")}connect(D,z){this.prev[z]=D,this.next[D]=z}moveToTail(D){D!==this.tail&&(D===this.head?this.head=this.next[D]:this.connect(this.prev[D],this.next[D]),this.connect(this.tail,D),this.tail=D)}get del(){return _("del","delete"),this.delete}delete(D){let z=!1;if(this.size!==0){const V=this.keyMap.get(D);if(V!==void 0)if(z=!0,this.size===1)this.clear();else{this.removeItemSize(V);const j=this.valList[V];this.isBackgroundFetch(j)?j.__abortController.abort(new Error("deleted")):(this.dispose(j,D,"delete"),this.disposeAfter&&this.disposed.push([j,D,"delete"])),this.keyMap.delete(D),this.keyList[V]=null,this.valList[V]=null,V===this.tail?this.tail=this.prev[V]:V===this.head?this.head=this.next[V]:(this.next[this.prev[V]]=this.next[V],this.prev[this.next[V]]=this.prev[V]),this.size--,this.free.push(V)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return z}clear(){for(const D of this.rindexes({allowStale:!0})){const z=this.valList[D];if(this.isBackgroundFetch(z))z.__abortController.abort(new Error("deleted"));else{const V=this.keyList[D];this.dispose(z,V,"delete"),this.disposeAfter&&this.disposed.push([z,V,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return _("reset","clear"),this.clear}get length(){return b("length","size"),this.size}static get AbortController(){return f}static get AbortSignal(){return g}}o.exports=O}).call(this)}).call(this,n("_process"))},{_process:102}],73:[function(n,o,a){const u=o.exports,{Buffer:c}=n("buffer");u.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"},u.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},u.requiredHeaderFlagsErrors={};for(const f in u.requiredHeaderFlags){const h=u.requiredHeaderFlags[f];u.requiredHeaderFlagsErrors[f]="Invalid header flag bits, must be 0x"+h.toString(16)+" for "+u.types[f]+" packet"}u.codes={};for(const f in u.types){const h=u.types[f];u.codes[h]=f}u.CMD_SHIFT=4,u.CMD_MASK=240,u.DUP_MASK=8,u.QOS_MASK=3,u.QOS_SHIFT=1,u.RETAIN_MASK=1,u.VARBYTEINT_MASK=127,u.VARBYTEINT_FIN_MASK=128,u.VARBYTEINT_MAX=268435455,u.SESSIONPRESENT_MASK=1,u.SESSIONPRESENT_HEADER=c.from([u.SESSIONPRESENT_MASK]),u.CONNACK_HEADER=c.from([u.codes.connack<<u.CMD_SHIFT]),u.USERNAME_MASK=128,u.PASSWORD_MASK=64,u.WILL_RETAIN_MASK=32,u.WILL_QOS_MASK=24,u.WILL_QOS_SHIFT=3,u.WILL_FLAG_MASK=4,u.CLEAN_SESSION_MASK=2,u.CONNECT_HEADER=c.from([u.codes.connect<<u.CMD_SHIFT]),u.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},u.propertiesCodes={};for(const f in u.properties){const h=u.properties[f];u.propertiesCodes[h]=f}u.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 d(f){return[0,1,2].map(h=>[0,1].map(y=>[0,1].map(g=>{const p=c.alloc(1);return p.writeUInt8(u.codes[f]<<u.CMD_SHIFT|(y?u.DUP_MASK:0)|h<<u.QOS_SHIFT|g,0,!0),p})))}u.PUBLISH_HEADER=d("publish"),u.SUBSCRIBE_HEADER=d("subscribe"),u.SUBSCRIBE_OPTIONS_QOS_MASK=3,u.SUBSCRIBE_OPTIONS_NL_MASK=1,u.SUBSCRIBE_OPTIONS_NL_SHIFT=2,u.SUBSCRIBE_OPTIONS_RAP_MASK=1,u.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,u.SUBSCRIBE_OPTIONS_RH_MASK=3,u.SUBSCRIBE_OPTIONS_RH_SHIFT=4,u.SUBSCRIBE_OPTIONS_RH=[0,16,32],u.SUBSCRIBE_OPTIONS_NL=4,u.SUBSCRIBE_OPTIONS_RAP=8,u.SUBSCRIBE_OPTIONS_QOS=[0,1,2],u.UNSUBSCRIBE_HEADER=d("unsubscribe"),u.ACKS={unsuback:d("unsuback"),puback:d("puback"),pubcomp:d("pubcomp"),pubrel:d("pubrel"),pubrec:d("pubrec")},u.SUBACK_HEADER=c.from([u.codes.suback<<u.CMD_SHIFT]),u.VERSION3=c.from([3]),u.VERSION4=c.from([4]),u.VERSION5=c.from([5]),u.VERSION131=c.from([131]),u.VERSION132=c.from([132]),u.QOS=[0,1,2].map(f=>c.from([f])),u.EMPTY={pingreq:c.from([u.codes.pingreq<<4,0]),pingresp:c.from([u.codes.pingresp<<4,0]),disconnect:c.from([u.codes.disconnect<<4,0])},u.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},u.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},u.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},u.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",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"},u.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},{buffer:29}],74:[function(n,o,a){const u=n("./writeToStream"),c=n("events"),{Buffer:d}=n("buffer");function f(y,g){const p=new h;return u(y,p,g),p.concat()}class h extends c{constructor(){super(),this._array=new Array(20),this._i=0}write(g){return this._array[this._i++]=g,!0}concat(){let g=0;const p=new Array(this._array.length),v=this._array;let _=0,b;for(b=0;b<v.length&&v[b]!==void 0;b++)typeof v[b]!="string"?p[b]=v[b].length:p[b]=d.byteLength(v[b]),g+=p[b];const A=d.allocUnsafe(g);for(b=0;b<v.length&&v[b]!==void 0;b++)typeof v[b]!="string"?(v[b].copy(A,_),_+=p[b]):(A.write(v[b],_),_+=p[b]);return A}destroy(g){g&&this.emit("error",g)}}o.exports=f},{"./writeToStream":96,buffer:29,events:49}],75:[function(n,o,a){a.parser=n("./parser").parser,a.generate=n("./generate"),a.writeToStream=n("./writeToStream")},{"./generate":74,"./parser":95,"./writeToStream":96}],76:[function(n,o,a){const{Buffer:u}=n("buffer"),c=Symbol.for("BufferList");function d(f){if(!(this instanceof d))return new d(f);d._init.call(this,f)}d._init=function(h){Object.defineProperty(this,c,{value:!0}),this._bufs=[],this.length=0,h&&this.append(h)},d.prototype._new=function(h){return new d(h)},d.prototype._offset=function(h){if(h===0)return[0,0];let y=0;for(let g=0;g<this._bufs.length;g++){const p=y+this._bufs[g].length;if(h<p||g===this._bufs.length-1)return[g,h-y];y=p}},d.prototype._reverseOffset=function(f){const h=f[0];let y=f[1];for(let g=0;g<h;g++)y+=this._bufs[g].length;return y},d.prototype.get=function(h){if(h>this.length||h<0)return;const y=this._offset(h);return this._bufs[y[0]][y[1]]},d.prototype.slice=function(h,y){return typeof h=="number"&&h<0&&(h+=this.length),typeof y=="number"&&y<0&&(y+=this.length),this.copy(null,0,h,y)},d.prototype.copy=function(h,y,g,p){if((typeof g!="number"||g<0)&&(g=0),(typeof p!="number"||p>this.length)&&(p=this.length),g>=this.length||p<=0)return h||u.alloc(0);const v=!!h,_=this._offset(g),b=p-g;let A=b,w=v&&y||0,S=_[1];if(g===0&&p===this.length){if(!v)return this._bufs.length===1?this._bufs[0]:u.concat(this._bufs,this.length);for(let T=0;T<this._bufs.length;T++)this._bufs[T].copy(h,w),w+=this._bufs[T].length;return h}if(A<=this._bufs[_[0]].length-S)return v?this._bufs[_[0]].copy(h,y,S,S+A):this._bufs[_[0]].slice(S,S+A);v||(h=u.allocUnsafe(b));for(let T=_[0];T<this._bufs.length;T++){const x=this._bufs[T].length-S;if(A>x)this._bufs[T].copy(h,w,S),w+=x;else{this._bufs[T].copy(h,w,S,S+A),w+=x;break}A-=x,S&&(S=0)}return h.length>w?h.slice(0,w):h},d.prototype.shallowSlice=function(h,y){if(h=h||0,y=typeof y!="number"?this.length:y,h<0&&(h+=this.length),y<0&&(y+=this.length),h===y)return this._new();const g=this._offset(h),p=this._offset(y),v=this._bufs.slice(g[0],p[0]+1);return p[1]===0?v.pop():v[v.length-1]=v[v.length-1].slice(0,p[1]),g[1]!==0&&(v[0]=v[0].slice(g[1])),this._new(v)},d.prototype.toString=function(h,y,g){return this.slice(y,g).toString(h)},d.prototype.consume=function(h){if(h=Math.trunc(h),Number.isNaN(h)||h<=0)return this;for(;this._bufs.length;)if(h>=this._bufs[0].length)h-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(h),this.length-=h;break}return this},d.prototype.duplicate=function(){const h=this._new();for(let y=0;y<this._bufs.length;y++)h.append(this._bufs[y]);return h},d.prototype.append=function(h){if(h==null)return this;if(h.buffer)this._appendBuffer(u.from(h.buffer,h.byteOffset,h.byteLength));else if(Array.isArray(h))for(let y=0;y<h.length;y++)this.append(h[y]);else if(this._isBufferList(h))for(let y=0;y<h._bufs.length;y++)this.append(h._bufs[y]);else typeof h=="number"&&(h=h.toString()),this._appendBuffer(u.from(h));return this},d.prototype._appendBuffer=function(h){this._bufs.push(h),this.length+=h.length},d.prototype.indexOf=function(f,h,y){if(y===void 0&&typeof h=="string"&&(y=h,h=void 0),typeof f=="function"||Array.isArray(f))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof f=="number"?f=u.from([f]):typeof f=="string"?f=u.from(f,y):this._isBufferList(f)?f=f.slice():Array.isArray(f.buffer)?f=u.from(f.buffer,f.byteOffset,f.byteLength):u.isBuffer(f)||(f=u.from(f)),h=Number(h||0),isNaN(h)&&(h=0),h<0&&(h=this.length+h),h<0&&(h=0),f.length===0)return h>this.length?this.length:h;const g=this._offset(h);let p=g[0],v=g[1];for(;p<this._bufs.length;p++){const _=this._bufs[p];for(;v<_.length;)if(_.length-v>=f.length){const A=_.indexOf(f,v);if(A!==-1)return this._reverseOffset([p,A]);v=_.length-f.length+1}else{const A=this._reverseOffset([p,v]);if(this._match(A,f))return A;v++}v=0}return-1},d.prototype._match=function(f,h){if(this.length-f<h.length)return!1;for(let y=0;y<h.length;y++)if(this.get(f+y)!==h[y])return!1;return!0},function(){const f={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 h in f)(function(y){f[y]===null?d.prototype[y]=function(g,p){return this.slice(g,g+p)[y](0,p)}:d.prototype[y]=function(g=0){return this.slice(g,g+f[y])[y](0)}})(h)}(),d.prototype._isBufferList=function(h){return h instanceof d||d.isBufferList(h)},d.isBufferList=function(h){return h!=null&&h[c]},o.exports=d},{buffer:29}],77:[function(n,o,a){const u=n("readable-stream").Duplex,c=n("inherits"),d=n("./BufferList");function f(h){if(!(this instanceof f))return new f(h);if(typeof h=="function"){this._callback=h;const y=(function(p){this._callback&&(this._callback(p),this._callback=null)}).bind(this);this.on("pipe",function(p){p.on("error",y)}),this.on("unpipe",function(p){p.removeListener("error",y)}),h=null}d._init.call(this,h),u.call(this)}c(f,u),Object.assign(f.prototype,d.prototype),f.prototype._new=function(y){return new f(y)},f.prototype._write=function(y,g,p){this._appendBuffer(y),typeof p=="function"&&p()},f.prototype._read=function(y){if(!this.length)return this.push(null);y=Math.min(y,this.length),this.push(this.slice(0,y)),this.consume(y)},f.prototype.end=function(y){u.prototype.end.call(this,y),this._callback&&(this._callback(null,this.slice()),this._callback=null)},f.prototype._destroy=function(y,g){this._bufs.length=0,this.length=0,g(y)},f.prototype._isBufferList=function(y){return y instanceof f||y instanceof d||f.isBufferList(y)},f.isBufferList=d.isBufferList,o.exports=f,o.exports.BufferListStream=f,o.exports.BufferList=d},{"./BufferList":76,inherits:51,"readable-stream":92}],78:[function(n,o,a){arguments[4][33][0].apply(a,arguments)},{dup:33}],79:[function(n,o,a){arguments[4][34][0].apply(a,arguments)},{"./_stream_readable":81,"./_stream_writable":83,_process:102,dup:34,inherits:51}],80:[function(n,o,a){arguments[4][35][0].apply(a,arguments)},{"./_stream_transform":82,dup:35,inherits:51}],81:[function(n,o,a){arguments[4][36][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/async_iterator":84,"./internal/streams/buffer_list":85,"./internal/streams/destroy":86,"./internal/streams/from":88,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:36,events:49,inherits:51,"string_decoder/":136,util:26}],82:[function(n,o,a){arguments[4][37][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,dup:37,inherits:51}],83:[function(n,o,a){arguments[4][38][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:38,inherits:51,"util-deprecate":139}],84:[function(n,o,a){arguments[4][39][0].apply(a,arguments)},{"./end-of-stream":87,_process:102,dup:39}],85:[function(n,o,a){arguments[4][40][0].apply(a,arguments)},{buffer:29,dup:40,util:26}],86:[function(n,o,a){arguments[4][41][0].apply(a,arguments)},{_process:102,dup:41}],87:[function(n,o,a){arguments[4][42][0].apply(a,arguments)},{"../../../errors":78,dup:42}],88:[function(n,o,a){arguments[4][43][0].apply(a,arguments)},{dup:43}],89:[function(n,o,a){arguments[4][44][0].apply(a,arguments)},{"../../../errors":78,"./end-of-stream":87,dup:44}],90:[function(n,o,a){arguments[4][45][0].apply(a,arguments)},{"../../../errors":78,dup:45}],91:[function(n,o,a){arguments[4][46][0].apply(a,arguments)},{dup:46,events:49}],92:[function(n,o,a){arguments[4][47][0].apply(a,arguments)},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89,dup:47}],93:[function(n,o,a){const{Buffer:u}=n("buffer"),c=65536,d={},f=u.isBuffer(u.from([1,2]).subarray(0,1));function h(v){const _=u.allocUnsafe(2);return _.writeUInt8(v>>8,0),_.writeUInt8(v&255,0+1),_}function y(){for(let v=0;v<c;v++)d[v]=h(v)}function g(v){let b=0,A=0;const w=u.allocUnsafe(4);do b=v%128|0,v=v/128|0,v>0&&(b=b|128),w.writeUInt8(b,A++);while(v>0&&A<4);return v>0&&(A=0),f?w.subarray(0,A):w.slice(0,A)}function p(v){const _=u.allocUnsafe(4);return _.writeUInt32BE(v,0),_}o.exports={cache:d,generateCache:y,generateNumber:h,genBufVariableByteInt:g,generate4ByteBuffer:p}},{buffer:29}],94:[function(n,o,a){class u{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}o.exports=u},{}],95:[function(n,o,a){const u=n("bl"),c=n("events"),d=n("./packet"),f=n("./constants"),h=n("debug")("mqtt-packet:parser");class y extends c{constructor(){super(),this.parser=this.constructor.parser}static parser(p){return this instanceof y?(this.settings=p||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new y().parser(p)}_resetState(){h("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new d,this.error=null,this._list=u(),this._stateCounter=0}parse(p){for(this.error&&this._resetState(),this._list.append(p),h("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++,h("parse: state complete. _stateCounter is now: %d",this._stateCounter),h("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return h("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const p=this._list.readUInt8(0),v=p>>f.CMD_SHIFT;this.packet.cmd=f.types[v];const _=p&15,b=f.requiredHeaderFlags[v];return b!=null&&_!==b?this._emitError(new Error(f.requiredHeaderFlagsErrors[v])):(this.packet.retain=(p&f.RETAIN_MASK)!==0,this.packet.qos=p>>f.QOS_SHIFT&f.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(p&f.DUP_MASK)!==0,h("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const p=this._parseVarByteNum(!0);return p&&(this.packet.length=p.value,this._list.consume(p.bytes)),h("_parseLength %d",p.value),!!p}_parsePayload(){h("_parsePayload: payload %O",this._list);let p=!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"))}p=!0}return h("_parsePayload complete result: %s",p),p}_parseConnect(){h("_parseConnect");let p,v,_,b;const A={},w=this.packet,S=this._parseString();if(S===null)return this._emitError(new Error("Cannot parse protocolId"));if(S!=="MQTT"&&S!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(w.protocolId=S,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(w.protocolVersion=this._list.readUInt8(this._pos),w.protocolVersion>=128&&(w.bridgeMode=!0,w.protocolVersion=w.protocolVersion-128),w.protocolVersion!==3&&w.protocolVersion!==4&&w.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(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));A.username=this._list.readUInt8(this._pos)&f.USERNAME_MASK,A.password=this._list.readUInt8(this._pos)&f.PASSWORD_MASK,A.will=this._list.readUInt8(this._pos)&f.WILL_FLAG_MASK;const T=!!(this._list.readUInt8(this._pos)&f.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&f.WILL_QOS_MASK)>>f.WILL_QOS_SHIFT;if(A.will)w.will={},w.will.retain=T,w.will.qos=x;else{if(T)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(w.clean=(this._list.readUInt8(this._pos)&f.CLEAN_SESSION_MASK)!==0,this._pos++,w.keepalive=this._parseNum(),w.keepalive===-1)return this._emitError(new Error("Packet too short"));if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.properties=L)}const M=this._parseString();if(M===null)return this._emitError(new Error("Packet too short"));if(w.clientId=M,h("_parseConnect: packet.clientId: %s",w.clientId),A.will){if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.will.properties=L)}if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse will topic"));if(w.will.topic=p,h("_parseConnect: packet.will.topic: %s",w.will.topic),v=this._parseBuffer(),v===null)return this._emitError(new Error("Cannot parse will payload"));w.will.payload=v,h("_parseConnect: packet.will.paylaod: %s",w.will.payload)}if(A.username){if(b=this._parseString(),b===null)return this._emitError(new Error("Cannot parse username"));w.username=b,h("_parseConnect: packet.username: %s",w.username)}if(A.password){if(_=this._parseBuffer(),_===null)return this._emitError(new Error("Cannot parse password"));w.password=_}return this.settings=w,h("_parseConnect: complete"),w}_parseConnack(){h("_parseConnack");const p=this.packet;if(this._list.length<1)return null;const v=this._list.readUInt8(this._pos++);if(v>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(p.sessionPresent=!!(v&f.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?p.reasonCode=this._list.readUInt8(this._pos++):p.reasonCode=0;else{if(this._list.length<2)return null;p.returnCode=this._list.readUInt8(this._pos++)}if(p.returnCode===-1||p.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(p.properties=_)}h("_parseConnack: complete")}_parsePublish(){h("_parsePublish");const p=this.packet;if(p.topic=this._parseString(),p.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(p.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}p.payload=this._list.slice(this._pos,p.length),h("_parsePublish: payload from buffer list: %o",p.payload)}}_parseSubscribe(){h("_parseSubscribe");const p=this.packet;let v,_,b,A,w,S,T;if(p.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(p.properties=x)}if(p.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<p.length;){if(v=this._parseString(),v===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=p.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(_=this._parseByte(),this.settings.protocolVersion===5){if(_&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(_&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(b=_&f.SUBSCRIBE_OPTIONS_QOS_MASK,b>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(S=(_>>f.SUBSCRIBE_OPTIONS_NL_SHIFT&f.SUBSCRIBE_OPTIONS_NL_MASK)!==0,w=(_>>f.SUBSCRIBE_OPTIONS_RAP_SHIFT&f.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,A=_>>f.SUBSCRIBE_OPTIONS_RH_SHIFT&f.SUBSCRIBE_OPTIONS_RH_MASK,A>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));T={topic:v,qos:b},this.settings.protocolVersion===5?(T.nl=S,T.rap=w,T.rh=A):this.settings.bridgeMode&&(T.rh=0,T.rap=!0,T.nl=!0),h("_parseSubscribe: push subscription `%s` to subscription",T),p.subscriptions.push(T)}}}_parseSuback(){h("_parseSuback");const p=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}if(p.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const v=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!f.MQTT5_SUBACK_CODES[v])return this._emitError(new Error("Invalid suback code"))}else if(v>2&&v!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(v)}}}_parseUnsubscribe(){h("_parseUnsubscribe");const p=this.packet;if(p.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}if(p.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<p.length;){const v=this._parseString();if(v===null)return this._emitError(new Error("Cannot parse topic"));h("_parseUnsubscribe: push topic `%s` to unsubscriptions",v),p.unsubscriptions.push(v)}}}_parseUnsuback(){h("_parseUnsuback");const p=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&p.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(p.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){const v=this._parseProperties();for(Object.getOwnPropertyNames(v).length&&(p.properties=v),p.granted=[];this._pos<this.packet.length;){const _=this._list.readUInt8(this._pos++);if(!f.MQTT5_UNSUBACK_CODES[_])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(_)}}}_parseConfirmation(){h("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const p=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(p.length>2){switch(p.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!f.MQTT5_PUBACK_PUBREC_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!f.MQTT5_PUBREL_PUBCOMP_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}h("_parseConfirmation: packet.reasonCode `%d`",p.reasonCode)}else p.reasonCode=0;if(p.length>3){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}}return!0}_parseDisconnect(){const p=this.packet;if(h("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(p.reasonCode=this._parseByte(),f.MQTT5_DISCONNECT_CODES[p.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):p.reasonCode=0;const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}return h("_parseDisconnect result: true"),!0}_parseAuth(){h("_parseAuth");const p=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(p.reasonCode=this._parseByte(),!f.MQTT5_AUTH_CODES[p.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const v=this._parseProperties();return Object.getOwnPropertyNames(v).length&&(p.properties=v),h("_parseAuth: result: true"),!0}_parseMessageId(){const p=this.packet;return p.messageId=this._parseNum(),p.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(h("_parseMessageId: packet.messageId %d",p.messageId),!0)}_parseString(p){const v=this._parseNum(),_=v+this._pos;if(v===-1||_>this._list.length||_>this.packet.length)return null;const b=this._list.toString("utf8",this._pos,_);return this._pos+=v,h("_parseString: result: %s",b),b}_parseStringPair(){return h("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const p=this._parseNum(),v=p+this._pos;if(p===-1||v>this._list.length||v>this.packet.length)return null;const _=this._list.slice(this._pos,v);return this._pos+=p,h("_parseBuffer: result: %o",_),_}_parseNum(){if(this._list.length-this._pos<2)return-1;const p=this._list.readUInt16BE(this._pos);return this._pos+=2,h("_parseNum: result: %s",p),p}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const p=this._list.readUInt32BE(this._pos);return this._pos+=4,h("_parse4ByteNum: result: %s",p),p}_parseVarByteNum(p){h("_parseVarByteNum");const v=4;let _=0,b=1,A=0,w=!1,S;const T=this._pos?this._pos:0;for(;_<v&&T+_<this._list.length;){if(S=this._list.readUInt8(T+_++),A+=b*(S&f.VARBYTEINT_MASK),b*=128,!(S&f.VARBYTEINT_FIN_MASK)){w=!0;break}if(this._list.length<=_)break}return!w&&_===v&&this._list.length>=_&&this._emitError(new Error("Invalid variable byte integer")),T&&(this._pos+=_),w?p?w={bytes:_,value:A}:w=A:w=!1,h("_parseVarByteNum: result: %o",w),w}_parseByte(){let p;return this._pos<this._list.length&&(p=this._list.readUInt8(this._pos),this._pos++),h("_parseByte: result: %o",p),p}_parseByType(p){switch(h("_parseByType: type: %s",p),p){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(){h("_parseProperties");const p=this._parseVarByteNum(),_=this._pos+p,b={};for(;this._pos<_;){const A=this._parseByte();if(!A)return this._emitError(new Error("Cannot parse property code type")),!1;const w=f.propertiesCodes[A];if(!w)return this._emitError(new Error("Unknown property")),!1;if(w==="userProperties"){b[w]||(b[w]=Object.create(null));const S=this._parseByType(f.propertiesTypes[w]);if(b[w][S.name])if(Array.isArray(b[w][S.name]))b[w][S.name].push(S.value);else{const T=b[w][S.name];b[w][S.name]=[T],b[w][S.name].push(S.value)}else b[w][S.name]=S.value;continue}b[w]?Array.isArray(b[w])?b[w].push(this._parseByType(f.propertiesTypes[w])):(b[w]=[b[w]],b[w].push(this._parseByType(f.propertiesTypes[w]))):b[w]=this._parseByType(f.propertiesTypes[w])}return b}_newPacket(){return h("_newPacket"),this.packet&&(this._list.consume(this.packet.length),h("_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)),h("_newPacket: new packet"),this.packet=new d,this._pos=0,!0}_emitError(p){h("_emitError",p),this.error=p,this.emit("error",p)}}o.exports=y},{"./constants":73,"./packet":94,bl:77,debug:30,events:49}],96:[function(n,o,a){const u=n("./constants"),{Buffer:c}=n("buffer"),d=c.allocUnsafe(0),f=c.from([0]),h=n("./numbers"),y=n("process-nextick-args").nextTick,g=n("debug")("mqtt-packet:writeToStream"),p=h.cache,v=h.generateNumber,_=h.generateCache,b=h.genBufVariableByteInt,A=h.generate4ByteBuffer;let w=Et,S=!0;function T(Ie,de,ze){switch(g("generate called"),de.cork&&(de.cork(),y(x,de)),S&&(S=!1,_()),g("generate: packet.cmd: %s",Ie.cmd),Ie.cmd){case"connect":return M(Ie,de);case"connack":return L(Ie,de,ze);case"publish":return O(Ie,de,ze);case"puback":case"pubrec":case"pubrel":case"pubcomp":return re(Ie,de,ze);case"subscribe":return D(Ie,de,ze);case"suback":return z(Ie,de,ze);case"unsubscribe":return V(Ie,de,ze);case"unsuback":return j(Ie,de,ze);case"pingreq":case"pingresp":return F(Ie,de);case"disconnect":return Ce(Ie,de,ze);case"auth":return le(Ie,de,ze);default:return de.destroy(new Error("Unknown command")),!1}}Object.defineProperty(T,"cacheNumbers",{get(){return w===Et},set(Ie){Ie?((!p||Object.keys(p).length===0)&&(S=!0),w=Et):(S=!1,w=he)}});function x(Ie){Ie.uncork()}function M(Ie,de,ze){const xe=Ie||{},Ne=xe.protocolId||"MQTT";let Lt=xe.protocolVersion||4;const Dt=xe.will;let Cn=xe.clean;const ie=xe.keepalive||0,ae=xe.clientId||"",Y=xe.username,k=xe.password,$=xe.properties;Cn===void 0&&(Cn=!0);let oe=0;if(!Ne||typeof Ne!="string"&&!c.isBuffer(Ne))return de.destroy(new Error("Invalid protocolId")),!1;if(oe+=Ne.length+2,Lt!==3&&Lt!==4&&Lt!==5)return de.destroy(new Error("Invalid protocol version")),!1;if(oe+=1,(typeof ae=="string"||c.isBuffer(ae))&&(ae||Lt>=4)&&(ae||Cn))oe+=c.byteLength(ae)+2;else{if(Lt<4)return de.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(Cn*1===0)return de.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof ie!="number"||ie<0||ie>65535||ie%1!==0)return de.destroy(new Error("Invalid keepalive")),!1;oe+=2,oe+=1;let _e,Ue;if(Lt===5){if(_e=kt(de,$),!_e)return!1;oe+=_e.length}if(Dt){if(typeof Dt!="object")return de.destroy(new Error("Invalid will")),!1;if(!Dt.topic||typeof Dt.topic!="string")return de.destroy(new Error("Invalid will topic")),!1;if(oe+=c.byteLength(Dt.topic)+2,oe+=2,Dt.payload)if(Dt.payload.length>=0)typeof Dt.payload=="string"?oe+=c.byteLength(Dt.payload):oe+=Dt.payload.length;else return de.destroy(new Error("Invalid will payload")),!1;if(Ue={},Lt===5){if(Ue=kt(de,Dt.properties),!Ue)return!1;oe+=Ue.length}}let _n=!1;if(Y!=null)if(Pt(Y))_n=!0,oe+=c.byteLength(Y)+2;else return de.destroy(new Error("Invalid username")),!1;if(k!=null){if(!_n)return de.destroy(new Error("Username is required to use password")),!1;if(Pt(k))oe+=hn(k)+2;else return de.destroy(new Error("Invalid password")),!1}de.write(u.CONNECT_HEADER),$e(de,oe),vn(de,Ne),xe.bridgeMode&&(Lt+=128),de.write(Lt===131?u.VERSION131:Lt===132?u.VERSION132:Lt===4?u.VERSION4:Lt===5?u.VERSION5:u.VERSION3);let wn=0;return wn|=Y!=null?u.USERNAME_MASK:0,wn|=k!=null?u.PASSWORD_MASK:0,wn|=Dt&&Dt.retain?u.WILL_RETAIN_MASK:0,wn|=Dt&&Dt.qos?Dt.qos<<u.WILL_QOS_SHIFT:0,wn|=Dt?u.WILL_FLAG_MASK:0,wn|=Cn?u.CLEAN_SESSION_MASK:0,de.write(c.from([wn])),w(de,ie),Lt===5&&_e.write(),vn(de,ae),Dt&&(Lt===5&&Ue.write(),Fe(de,Dt.topic),vn(de,Dt.payload)),Y!=null&&vn(de,Y),k!=null&&vn(de,k),!0}function L(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=xe===5?Ne.reasonCode:Ne.returnCode,Dt=Ne.properties;let Cn=2;if(typeof Lt!="number")return de.destroy(new Error("Invalid return code")),!1;let ie=null;if(xe===5){if(ie=kt(de,Dt),!ie)return!1;Cn+=ie.length}return de.write(u.CONNACK_HEADER),$e(de,Cn),de.write(Ne.sessionPresent?u.SESSIONPRESENT_HEADER:f),de.write(c.from([Lt])),ie!=null&&ie.write(),!0}function O(Ie,de,ze){g("publish: packet: %o",Ie);const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.qos||0,Dt=Ne.retain?u.RETAIN_MASK:0,Cn=Ne.topic,ie=Ne.payload||d,ae=Ne.messageId,Y=Ne.properties;let k=0;if(typeof Cn=="string")k+=c.byteLength(Cn)+2;else if(c.isBuffer(Cn))k+=Cn.length+2;else return de.destroy(new Error("Invalid topic")),!1;if(c.isBuffer(ie)?k+=ie.length:k+=c.byteLength(ie),Lt&&typeof ae!="number")return de.destroy(new Error("Invalid messageId")),!1;Lt&&(k+=2);let $=null;if(xe===5){if($=kt(de,Y),!$)return!1;k+=$.length}return de.write(u.PUBLISH_HEADER[Lt][Ne.dup?1:0][Dt?1:0]),$e(de,k),w(de,hn(Cn)),de.write(Cn),Lt>0&&w(de,ae),$!=null&&$.write(),g("publish: payload: %o",ie),de.write(ie)}function re(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.cmd||"puback",Dt=Ne.messageId,Cn=Ne.dup&&Lt==="pubrel"?u.DUP_MASK:0;let ie=0;const ae=Ne.reasonCode,Y=Ne.properties;let k=xe===5?3:2;if(Lt==="pubrel"&&(ie=1),typeof Dt!="number")return de.destroy(new Error("Invalid messageId")),!1;let $=null;if(xe===5&&typeof Y=="object"){if($=ue(de,Y,ze,k),!$)return!1;k+=$.length}return de.write(u.ACKS[Lt][ie][Cn][0]),k===3&&(k+=ae!==0?1:-1),$e(de,k),w(de,Dt),xe===5&&k!==2&&de.write(c.from([ae])),$!==null?$.write():k===4&&de.write(c.from([0])),!0}function D(Ie,de,ze){g("subscribe: packet: ");const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.dup?u.DUP_MASK:0,Dt=Ne.messageId,Cn=Ne.subscriptions,ie=Ne.properties;let ae=0;if(typeof Dt!="number")return de.destroy(new Error("Invalid messageId")),!1;ae+=2;let Y=null;if(xe===5){if(Y=kt(de,ie),!Y)return!1;ae+=Y.length}if(typeof Cn=="object"&&Cn.length)for(let $=0;$<Cn.length;$+=1){const oe=Cn[$].topic,_e=Cn[$].qos;if(typeof oe!="string")return de.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof _e!="number")return de.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(xe===5){if(typeof(Cn[$].nl||!1)!="boolean")return de.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Cn[$].rap||!1)!="boolean")return de.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const wn=Cn[$].rh||0;if(typeof wn!="number"||wn>2)return de.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}ae+=c.byteLength(oe)+2+1}else return de.destroy(new Error("Invalid subscriptions")),!1;g("subscribe: writing to stream: %o",u.SUBSCRIBE_HEADER),de.write(u.SUBSCRIBE_HEADER[1][Lt?1:0][0]),$e(de,ae),w(de,Dt),Y!==null&&Y.write();let k=!0;for(const $ of Cn){const oe=$.topic,_e=$.qos,Ue=+$.nl,_n=+$.rap,wn=$.rh;let Tn;Fe(de,oe),Tn=u.SUBSCRIBE_OPTIONS_QOS[_e],xe===5&&(Tn|=Ue?u.SUBSCRIBE_OPTIONS_NL:0,Tn|=_n?u.SUBSCRIBE_OPTIONS_RAP:0,Tn|=wn?u.SUBSCRIBE_OPTIONS_RH[wn]:0),k=de.write(c.from([Tn]))}return k}function z(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.granted,Cn=Ne.properties;let ie=0;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(ie+=2,typeof Dt=="object"&&Dt.length)for(let Y=0;Y<Dt.length;Y+=1){if(typeof Dt[Y]!="number")return de.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return de.destroy(new Error("Invalid qos vector")),!1;let ae=null;if(xe===5){if(ae=ue(de,Cn,ze,ie),!ae)return!1;ie+=ae.length}return de.write(u.SUBACK_HEADER),$e(de,ie),w(de,Lt),ae!==null&&ae.write(),de.write(c.from(Dt))}function V(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.dup?u.DUP_MASK:0,Cn=Ne.unsubscriptions,ie=Ne.properties;let ae=0;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(ae+=2,typeof Cn=="object"&&Cn.length)for(let $=0;$<Cn.length;$+=1){if(typeof Cn[$]!="string")return de.destroy(new Error("Invalid unsubscriptions")),!1;ae+=c.byteLength(Cn[$])+2}else return de.destroy(new Error("Invalid unsubscriptions")),!1;let Y=null;if(xe===5){if(Y=kt(de,ie),!Y)return!1;ae+=Y.length}de.write(u.UNSUBSCRIBE_HEADER[1][Dt?1:0][0]),$e(de,ae),w(de,Lt),Y!==null&&Y.write();let k=!0;for(let $=0;$<Cn.length;$++)k=Fe(de,Cn[$]);return k}function j(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.dup?u.DUP_MASK:0,Cn=Ne.granted,ie=Ne.properties,ae=Ne.cmd,Y=0;let k=2;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(xe===5)if(typeof Cn=="object"&&Cn.length)for(let oe=0;oe<Cn.length;oe+=1){if(typeof Cn[oe]!="number")return de.destroy(new Error("Invalid qos vector")),!1;k+=1}else return de.destroy(new Error("Invalid qos vector")),!1;let $=null;if(xe===5){if($=ue(de,ie,ze,k),!$)return!1;k+=$.length}return de.write(u.ACKS[ae][Y][Dt][0]),$e(de,k),w(de,Lt),$!==null&&$.write(),xe===5&&de.write(c.from(Cn)),!0}function F(Ie,de,ze){return de.write(u.EMPTY[Ie.cmd])}function Ce(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.reasonCode,Dt=Ne.properties;let Cn=xe===5?1:0,ie=null;if(xe===5){if(ie=ue(de,Dt,ze,Cn),!ie)return!1;Cn+=ie.length}return de.write(c.from([u.codes.disconnect<<4])),$e(de,Cn),xe===5&&de.write(c.from([Lt])),ie!==null&&ie.write(),!0}function le(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.reasonCode,Dt=Ne.properties;let Cn=xe===5?1:0;xe!==5&&de.destroy(new Error("Invalid mqtt version for auth packet"));const ie=ue(de,Dt,ze,Cn);return ie?(Cn+=ie.length,de.write(c.from([u.codes.auth<<4])),$e(de,Cn),de.write(c.from([Lt])),ie!==null&&ie.write(),!0):!1}const pe={};function $e(Ie,de){if(de>u.VARBYTEINT_MAX)return Ie.destroy(new Error(`Invalid variable byte integer: ${de}`)),!1;let ze=pe[de];return ze||(ze=b(de),de<16384&&(pe[de]=ze)),g("writeVarByteInt: writing to stream: %o",ze),Ie.write(ze)}function Fe(Ie,de){const ze=c.byteLength(de);return w(Ie,ze),g("writeString: %s",de),Ie.write(de,"utf8")}function Oe(Ie,de,ze){Fe(Ie,de),Fe(Ie,ze)}function Et(Ie,de){return g("writeNumberCached: number: %d",de),g("writeNumberCached: %o",p[de]),Ie.write(p[de])}function he(Ie,de){const ze=v(de);return g("writeNumberGenerated: %o",ze),Ie.write(ze)}function In(Ie,de){const ze=A(de);return g("write4ByteNumber: %o",ze),Ie.write(ze)}function vn(Ie,de){typeof de=="string"?Fe(Ie,de):de?(w(Ie,de.length),Ie.write(de)):w(Ie,0)}function kt(Ie,de){if(typeof de!="object"||de.length!=null)return{length:1,write(){jt(Ie,{},0)}};let ze=0;function xe(Lt,Dt){const Cn=u.propertiesTypes[Lt];let ie=0;switch(Cn){case"byte":{if(typeof Dt!="boolean")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+1;break}case"int8":{if(typeof Dt!="number"||Dt<0||Dt>255)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+1;break}case"binary":{if(Dt&&Dt===null)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+c.byteLength(Dt)+2;break}case"int16":{if(typeof Dt!="number"||Dt<0||Dt>65535)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+2;break}case"int32":{if(typeof Dt!="number"||Dt<0||Dt>4294967295)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+4;break}case"var":{if(typeof Dt!="number"||Dt<0||Dt>268435455)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+c.byteLength(b(Dt));break}case"string":{if(typeof Dt!="string")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+2+c.byteLength(Dt.toString());break}case"pair":{if(typeof Dt!="object")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=Object.getOwnPropertyNames(Dt).reduce((ae,Y)=>{const k=Dt[Y];return Array.isArray(k)?ae+=k.reduce(($,oe)=>($+=1+2+c.byteLength(Y.toString())+2+c.byteLength(oe.toString()),$),0):ae+=1+2+c.byteLength(Y.toString())+2+c.byteLength(Dt[Y].toString()),ae},0);break}default:return Ie.destroy(new Error(`Invalid property ${Lt}: ${Dt}`)),!1}return ie}if(de)for(const Lt in de){let Dt=0,Cn=0;const ie=de[Lt];if(Array.isArray(ie))for(let ae=0;ae<ie.length;ae++){if(Cn=xe(Lt,ie[ae]),!Cn)return!1;Dt+=Cn}else{if(Cn=xe(Lt,ie),!Cn)return!1;Dt=Cn}if(!Dt)return!1;ze+=Dt}return{length:c.byteLength(b(ze))+ze,write(){jt(Ie,de,ze)}}}function ue(Ie,de,ze,xe){const Ne=["reasonString","userProperties"],Lt=ze&&ze.properties&&ze.properties.maximumPacketSize?ze.properties.maximumPacketSize:0;let Dt=kt(Ie,de);if(Lt)for(;xe+Dt.length>Lt;){const Cn=Ne.shift();if(Cn&&de[Cn])delete de[Cn],Dt=kt(Ie,de);else return!1}return Dt}function At(Ie,de,ze){switch(u.propertiesTypes[de]){case"byte":{Ie.write(c.from([u.properties[de]])),Ie.write(c.from([+ze]));break}case"int8":{Ie.write(c.from([u.properties[de]])),Ie.write(c.from([ze]));break}case"binary":{Ie.write(c.from([u.properties[de]])),vn(Ie,ze);break}case"int16":{Ie.write(c.from([u.properties[de]])),w(Ie,ze);break}case"int32":{Ie.write(c.from([u.properties[de]])),In(Ie,ze);break}case"var":{Ie.write(c.from([u.properties[de]])),$e(Ie,ze);break}case"string":{Ie.write(c.from([u.properties[de]])),Fe(Ie,ze);break}case"pair":{Object.getOwnPropertyNames(ze).forEach(Ne=>{const Lt=ze[Ne];Array.isArray(Lt)?Lt.forEach(Dt=>{Ie.write(c.from([u.properties[de]])),Oe(Ie,Ne.toString(),Dt.toString())}):(Ie.write(c.from([u.properties[de]])),Oe(Ie,Ne.toString(),Lt.toString()))});break}default:return Ie.destroy(new Error(`Invalid property ${de} value: ${ze}`)),!1}}function jt(Ie,de,ze){$e(Ie,ze);for(const xe in de)if(Object.prototype.hasOwnProperty.call(de,xe)&&de[xe]!==null){const Ne=de[xe];if(Array.isArray(Ne))for(let Lt=0;Lt<Ne.length;Lt++)At(Ie,xe,Ne[Lt]);else At(Ie,xe,Ne)}}function hn(Ie){return Ie?Ie instanceof c?Ie.length:c.byteLength(Ie):0}function Pt(Ie){return typeof Ie=="string"||Ie instanceof c}o.exports=T},{"./constants":73,"./numbers":93,buffer:29,debug:30,"process-nextick-args":101}],97:[function(n,o,a){var u=1e3,c=u*60,d=c*60,f=d*24,h=f*7,y=f*365.25;o.exports=function(b,A){A=A||{};var w=typeof b;if(w==="string"&&b.length>0)return g(b);if(w==="number"&&isFinite(b))return A.long?v(b):p(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function g(b){if(b=String(b),!(b.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(A){var w=parseFloat(A[1]),S=(A[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return w*y;case"weeks":case"week":case"w":return w*h;case"days":case"day":case"d":return w*f;case"hours":case"hour":case"hrs":case"hr":case"h":return w*d;case"minutes":case"minute":case"mins":case"min":case"m":return w*c;case"seconds":case"second":case"secs":case"sec":case"s":return w*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function p(b){var A=Math.abs(b);return A>=f?Math.round(b/f)+"d":A>=d?Math.round(b/d)+"h":A>=c?Math.round(b/c)+"m":A>=u?Math.round(b/u)+"s":b+"ms"}function v(b){var A=Math.abs(b);return A>=f?_(b,A,f,"day"):A>=d?_(b,A,d,"hour"):A>=c?_(b,A,c,"minute"):A>=u?_(b,A,u,"second"):b+" ms"}function _(b,A,w,S){var T=A>=w*1.5;return Math.round(b/w)+" "+S+(T?"s":"")}},{}],98:[function(n,o,a){const u=n("./lib/number-allocator.js");o.exports.NumberAllocator=u},{"./lib/number-allocator.js":99}],99:[function(n,o,a){const u=n("js-sdsl").OrderedSet,c=n("debug")("number-allocator:trace"),d=n("debug")("number-allocator:error");function f(y,g){this.low=y,this.high=g}f.prototype.equals=function(y){return this.low===y.low&&this.high===y.high},f.prototype.compare=function(y){return this.low<y.low&&this.high<y.low?-1:y.low<this.low&&y.high<this.low?1:0};function h(y,g){if(!(this instanceof h))return new h(y,g);this.min=y,this.max=g,this.ss=new u([],(p,v)=>p.compare(v)),c("Create"),this.clear()}h.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},h.prototype.alloc=function(){if(this.ss.size()===0)return c("alloc():empty"),null;const y=this.ss.begin(),g=y.pointer.low,p=y.pointer.high,v=g;return v+1<=p?this.ss.updateKeyByIterator(y,new f(g+1,p)):this.ss.eraseElementByPos(0),c("alloc():"+v),v},h.prototype.use=function(y){const g=new f(y,y),p=this.ss.lowerBound(g);if(!p.equals(this.ss.end())){const v=p.pointer.low,_=p.pointer.high;return p.pointer.equals(g)?(this.ss.eraseElementByIterator(p),c("use():"+y),!0):v>y?!1:v===y?(this.ss.updateKeyByIterator(p,new f(v+1,_)),c("use():"+y),!0):_===y?(this.ss.updateKeyByIterator(p,new f(v,_-1)),c("use():"+y),!0):(this.ss.updateKeyByIterator(p,new f(y+1,_)),this.ss.insert(new f(v,y-1)),c("use():"+y),!0)}return c("use():failed"),!1},h.prototype.free=function(y){if(y<this.min||y>this.max){d("free():"+y+" is out of range");return}const g=new f(y,y),p=this.ss.upperBound(g);if(p.equals(this.ss.end())){if(p.equals(this.ss.begin())){this.ss.insert(g);return}p.pre();const v=p.pointer.high;p.pointer.high+1===y?this.ss.updateKeyByIterator(p,new f(v,y)):this.ss.insert(g)}else if(p.equals(this.ss.begin()))if(y+1===p.pointer.low){const v=p.pointer.high;this.ss.updateKeyByIterator(p,new f(y,v))}else this.ss.insert(g);else{const v=p.pointer.low,_=p.pointer.high;p.pre();const b=p.pointer.low;p.pointer.high+1===y?y+1===v?(this.ss.eraseElementByIterator(p),this.ss.updateKeyByIterator(p,new f(b,_))):this.ss.updateKeyByIterator(p,new f(b,y)):y+1===v?(this.ss.eraseElementByIterator(p.next()),this.ss.insert(new f(y,_))):this.ss.insert(g)}c("free():"+y)},h.prototype.clear=function(){c("clear()"),this.ss.clear(),this.ss.insert(new f(this.min,this.max))},h.prototype.intervalCount=function(){return this.ss.size()},h.prototype.dump=function(){console.log("length:"+this.ss.size());for(const y of this.ss)console.log(y)},o.exports=h},{debug:30,"js-sdsl":69}],100:[function(n,o,a){var u=n("wrappy");o.exports=u(c),o.exports.strict=u(d),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return d(this)},configurable:!0})});function c(f){var h=function(){return h.called?h.value:(h.called=!0,h.value=f.apply(this,arguments))};return h.called=!1,h}function d(f){var h=function(){if(h.called)throw new Error(h.onceError);return h.called=!0,h.value=f.apply(this,arguments)},y=f.name||"Function wrapped with `once`";return h.onceError=y+" shouldn't be called more than once",h.called=!1,h}},{wrappy:140}],101:[function(n,o,a){(function(u){(function(){typeof u>"u"||!u.version||u.version.indexOf("v0.")===0||u.version.indexOf("v1.")===0&&u.version.indexOf("v1.8.")!==0?o.exports={nextTick:c}:o.exports=u;function c(d,f,h,y){if(typeof d!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,p,v;switch(g){case 0:case 1:return u.nextTick(d);case 2:return u.nextTick(function(){d.call(null,f)});case 3:return u.nextTick(function(){d.call(null,f,h)});case 4:return u.nextTick(function(){d.call(null,f,h,y)});default:for(p=new Array(g-1),v=0;v<p.length;)p[v++]=arguments[v];return u.nextTick(function(){d.apply(null,p)})}}}).call(this)}).call(this,n("_process"))},{_process:102}],102:[function(n,o,a){var u=o.exports={},c,d;function f(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?c=setTimeout:c=f}catch{c=f}try{typeof clearTimeout=="function"?d=clearTimeout:d=h}catch{d=h}})();function y(x){if(c===setTimeout)return setTimeout(x,0);if((c===f||!c)&&setTimeout)return c=setTimeout,setTimeout(x,0);try{return c(x,0)}catch{try{return c.call(null,x,0)}catch{return c.call(this,x,0)}}}function g(x){if(d===clearTimeout)return clearTimeout(x);if((d===h||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(x);try{return d(x)}catch{try{return d.call(null,x)}catch{return d.call(this,x)}}}var p=[],v=!1,_,b=-1;function A(){!v||!_||(v=!1,_.length?p=_.concat(p):b=-1,p.length&&w())}function w(){if(!v){var x=y(A);v=!0;for(var M=p.length;M;){for(_=p,p=[];++b<M;)_&&_[b].run();b=-1,M=p.length}_=null,v=!1,g(x)}}u.nextTick=function(x){var M=new Array(arguments.length-1);if(arguments.length>1)for(var L=1;L<arguments.length;L++)M[L-1]=arguments[L];p.push(new S(x,M)),p.length===1&&!v&&y(w)};function S(x,M){this.fun=x,this.array=M}S.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={};function T(){}u.on=T,u.addListener=T,u.once=T,u.off=T,u.removeListener=T,u.removeAllListeners=T,u.emit=T,u.prependListener=T,u.prependOnceListener=T,u.listeners=function(x){return[]},u.binding=function(x){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(x){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],103:[function(n,o,a){(function(u){(function(){(function(c){var d=typeof a=="object"&&a&&!a.nodeType&&a,f=typeof o=="object"&&o&&!o.nodeType&&o,h=typeof u=="object"&&u;(h.global===h||h.window===h||h.self===h)&&(c=h);var y,g=2147483647,p=36,v=1,_=26,b=38,A=700,w=72,S=128,T="-",x=/^xn--/,M=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},re=p-v,D=Math.floor,z=String.fromCharCode,V;function j(kt){throw new RangeError(O[kt])}function F(kt,ue){for(var At=kt.length,jt=[];At--;)jt[At]=ue(kt[At]);return jt}function Ce(kt,ue){var At=kt.split("@"),jt="";At.length>1&&(jt=At[0]+"@",kt=At[1]),kt=kt.replace(L,".");var hn=kt.split("."),Pt=F(hn,ue).join(".");return jt+Pt}function le(kt){for(var ue=[],At=0,jt=kt.length,hn,Pt;At<jt;)hn=kt.charCodeAt(At++),hn>=55296&&hn<=56319&&At<jt?(Pt=kt.charCodeAt(At++),(Pt&64512)==56320?ue.push(((hn&1023)<<10)+(Pt&1023)+65536):(ue.push(hn),At--)):ue.push(hn);return ue}function pe(kt){return F(kt,function(ue){var At="";return ue>65535&&(ue-=65536,At+=z(ue>>>10&1023|55296),ue=56320|ue&1023),At+=z(ue),At}).join("")}function $e(kt){return kt-48<10?kt-22:kt-65<26?kt-65:kt-97<26?kt-97:p}function Fe(kt,ue){return kt+22+75*(kt<26)-((ue!=0)<<5)}function Oe(kt,ue,At){var jt=0;for(kt=At?D(kt/A):kt>>1,kt+=D(kt/ue);kt>re*_>>1;jt+=p)kt=D(kt/re);return D(jt+(re+1)*kt/(kt+b))}function Et(kt){var ue=[],At=kt.length,jt,hn=0,Pt=S,Ie=w,de,ze,xe,Ne,Lt,Dt,Cn,ie,ae;for(de=kt.lastIndexOf(T),de<0&&(de=0),ze=0;ze<de;++ze)kt.charCodeAt(ze)>=128&&j("not-basic"),ue.push(kt.charCodeAt(ze));for(xe=de>0?de+1:0;xe<At;){for(Ne=hn,Lt=1,Dt=p;xe>=At&&j("invalid-input"),Cn=$e(kt.charCodeAt(xe++)),(Cn>=p||Cn>D((g-hn)/Lt))&&j("overflow"),hn+=Cn*Lt,ie=Dt<=Ie?v:Dt>=Ie+_?_:Dt-Ie,!(Cn<ie);Dt+=p)ae=p-ie,Lt>D(g/ae)&&j("overflow"),Lt*=ae;jt=ue.length+1,Ie=Oe(hn-Ne,jt,Ne==0),D(hn/jt)>g-Pt&&j("overflow"),Pt+=D(hn/jt),hn%=jt,ue.splice(hn++,0,Pt)}return pe(ue)}function he(kt){var ue,At,jt,hn,Pt,Ie,de,ze,xe,Ne,Lt,Dt=[],Cn,ie,ae,Y;for(kt=le(kt),Cn=kt.length,ue=S,At=0,Pt=w,Ie=0;Ie<Cn;++Ie)Lt=kt[Ie],Lt<128&&Dt.push(z(Lt));for(jt=hn=Dt.length,hn&&Dt.push(T);jt<Cn;){for(de=g,Ie=0;Ie<Cn;++Ie)Lt=kt[Ie],Lt>=ue&&Lt<de&&(de=Lt);for(ie=jt+1,de-ue>D((g-At)/ie)&&j("overflow"),At+=(de-ue)*ie,ue=de,Ie=0;Ie<Cn;++Ie)if(Lt=kt[Ie],Lt<ue&&++At>g&&j("overflow"),Lt==ue){for(ze=At,xe=p;Ne=xe<=Pt?v:xe>=Pt+_?_:xe-Pt,!(ze<Ne);xe+=p)Y=ze-Ne,ae=p-Ne,Dt.push(z(Fe(Ne+Y%ae,0))),ze=D(Y/ae);Dt.push(z(Fe(ze,0))),Pt=Oe(At,ie,jt==hn),At=0,++jt}++At,++ue}return Dt.join("")}function In(kt){return Ce(kt,function(ue){return x.test(ue)?Et(ue.slice(4).toLowerCase()):ue})}function vn(kt){return Ce(kt,function(ue){return M.test(ue)?"xn--"+he(ue):ue})}if(y={version:"1.4.1",ucs2:{decode:le,encode:pe},decode:Et,encode:he,toASCII:vn,toUnicode:In},d&&f)if(o.exports==d)f.exports=y;else for(V in y)y.hasOwnProperty(V)&&(d[V]=y[V]);else c.punycode=y})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],104:[function(n,o,a){function u(d,f){return Object.prototype.hasOwnProperty.call(d,f)}o.exports=function(d,f,h,y){f=f||"&",h=h||"=";var g={};if(typeof d!="string"||d.length===0)return g;var p=/\+/g;d=d.split(f);var v=1e3;y&&typeof y.maxKeys=="number"&&(v=y.maxKeys);var _=d.length;v>0&&_>v&&(_=v);for(var b=0;b<_;++b){var A=d[b].replace(p,"%20"),w=A.indexOf(h),S,T,x,M;w>=0?(S=A.substr(0,w),T=A.substr(w+1)):(S=A,T=""),x=decodeURIComponent(S),M=decodeURIComponent(T),u(g,x)?c(g[x])?g[x].push(M):g[x]=[g[x],M]:g[x]=M}return g};var c=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}},{}],105:[function(n,o,a){var u=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};o.exports=function(h,y,g,p){return y=y||"&",g=g||"=",h===null&&(h=void 0),typeof h=="object"?d(f(h),function(v){var _=encodeURIComponent(u(v))+g;return c(h[v])?d(h[v],function(b){return _+encodeURIComponent(u(b))}).join(y):_+encodeURIComponent(u(h[v]))}).join(y):p?encodeURIComponent(u(p))+g+encodeURIComponent(u(h)):""};var c=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function d(h,y){if(h.map)return h.map(y);for(var g=[],p=0;p<h.length;p++)g.push(y(h[p],p));return g}var f=Object.keys||function(h){var y=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&y.push(g);return y}},{}],106:[function(n,o,a){a.decode=a.parse=n("./decode"),a.encode=a.stringify=n("./encode")},{"./decode":104,"./encode":105}],107:[function(n,o,a){const{AbortError:u,codes:c}=n("../../ours/errors"),{isNodeStream:d,isWebStream:f,kControllerErrorFunction:h}=n("./utils"),y=n("./end-of-stream"),{ERR_INVALID_ARG_TYPE:g}=c,p=(v,_)=>{if(typeof v!="object"||!("aborted"in v))throw new g(_,"AbortSignal",v)};o.exports.addAbortSignal=function(_,b){if(p(_,"signal"),!d(b)&&!f(b))throw new g("stream",["ReadableStream","WritableStream","Stream"],b);return o.exports.addAbortSignalNoValidate(_,b)},o.exports.addAbortSignalNoValidate=function(v,_){if(typeof v!="object"||!("aborted"in v))return _;const b=d(_)?()=>{_.destroy(new u(void 0,{cause:v.reason}))}:()=>{_[h](new u(void 0,{cause:v.reason}))};return v.aborted?b():(v.addEventListener("abort",b),y(_,()=>v.removeEventListener("abort",b))),_}},{"../../ours/errors":126,"./end-of-stream":113,"./utils":122}],108:[function(n,o,a){const{StringPrototypeSlice:u,SymbolIterator:c,TypedArrayPrototypeSet:d,Uint8Array:f}=n("../../ours/primordials"),{Buffer:h}=n("buffer"),{inspect:y}=n("../../ours/util");o.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const v={data:p,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}unshift(p){const v={data:p,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let v=this.head,_=""+v.data;for(;(v=v.next)!==null;)_+=p+v.data;return _}concat(p){if(this.length===0)return h.alloc(0);const v=h.allocUnsafe(p>>>0);let _=this.head,b=0;for(;_;)d(v,_.data,b),b+=_.data.length,_=_.next;return v}consume(p,v){const _=this.head.data;if(p<_.length){const b=_.slice(0,p);return this.head.data=_.slice(p),b}return p===_.length?this.shift():v?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[c](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let v="",_=this.head,b=0;do{const A=_.data;if(p>A.length)v+=A,p-=A.length;else{p===A.length?(v+=A,++b,_.next?this.head=_.next:this.head=this.tail=null):(v+=u(A,0,p),this.head=_,_.data=u(A,p));break}++b}while((_=_.next)!==null);return this.length-=b,v}_getBuffer(p){const v=h.allocUnsafe(p),_=p;let b=this.head,A=0;do{const w=b.data;if(p>w.length)d(v,w,_-p),p-=w.length;else{p===w.length?(d(v,w,_-p),++A,b.next?this.head=b.next:this.head=this.tail=null):(d(v,new f(w.buffer,w.byteOffset,p),_-p),this.head=b,b.data=w.slice(p));break}++A}while((b=b.next)!==null);return this.length-=A,v}[Symbol.for("nodejs.util.inspect.custom")](p,v){return y(this,{...v,depth:0,customInspect:!1})}}},{"../../ours/primordials":127,"../../ours/util":128,buffer:29}],109:[function(n,o,a){const{pipeline:u}=n("./pipeline"),c=n("./duplex"),{destroyer:d}=n("./destroy"),{isNodeStream:f,isReadable:h,isWritable:y,isWebStream:g,isTransformStream:p,isWritableStream:v,isReadableStream:_}=n("./utils"),{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:A,ERR_MISSING_ARGS:w}}=n("../../ours/errors"),S=n("./end-of-stream");o.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return c.from(x[0]);const M=[...x];if(typeof x[0]=="function"&&(x[0]=c.from(x[0])),typeof x[x.length-1]=="function"){const pe=x.length-1;x[pe]=c.from(x[pe])}for(let pe=0;pe<x.length;++pe)if(!(!f(x[pe])&&!g(x[pe]))){if(pe<x.length-1&&!(h(x[pe])||_(x[pe])||p(x[pe])))throw new A(`streams[${pe}]`,M[pe],"must be readable");if(pe>0&&!(y(x[pe])||v(x[pe])||p(x[pe])))throw new A(`streams[${pe}]`,M[pe],"must be writable")}let L,O,re,D,z;function V(pe){const $e=D;D=null,$e?$e(pe):pe?z.destroy(pe):!le&&!Ce&&z.destroy()}const j=x[0],F=u(x,V),Ce=!!(y(j)||v(j)||p(j)),le=!!(h(F)||_(F)||p(F));if(z=new c({writableObjectMode:!!(j!=null&&j.writableObjectMode),readableObjectMode:!!(F!=null&&F.writableObjectMode),writable:Ce,readable:le}),Ce){if(f(j))z._write=function($e,Fe,Oe){j.write($e,Fe)?Oe():L=Oe},z._final=function($e){j.end(),O=$e},j.on("drain",function(){if(L){const $e=L;L=null,$e()}});else if(g(j)){const Fe=(p(j)?j.writable:j).getWriter();z._write=async function(Oe,Et,he){try{await Fe.ready,Fe.write(Oe).catch(()=>{}),he()}catch(In){he(In)}},z._final=async function(Oe){try{await Fe.ready,Fe.close().catch(()=>{}),O=Oe}catch(Et){Oe(Et)}}}const pe=p(F)?F.readable:F;S(pe,()=>{if(O){const $e=O;O=null,$e()}})}if(le){if(f(F))F.on("readable",function(){if(re){const pe=re;re=null,pe()}}),F.on("end",function(){z.push(null)}),z._read=function(){for(;;){const pe=F.read();if(pe===null){re=z._read;return}if(!z.push(pe))return}};else if(g(F)){const $e=(p(F)?F.readable:F).getReader();z._read=async function(){for(;;)try{const{value:Fe,done:Oe}=await $e.read();if(!z.push(Fe))return;if(Oe){z.push(null);return}}catch{return}}}}return z._destroy=function(pe,$e){!pe&&D!==null&&(pe=new b),re=null,L=null,O=null,D===null?$e(pe):(D=$e,f(F)&&d(F,pe))},z}},{"../../ours/errors":126,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./pipeline":118,"./utils":122}],110:[function(n,o,a){const u=n("process/"),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:d},AbortError:f}=n("../../ours/errors"),{Symbol:h}=n("../../ours/primordials"),{kDestroyed:y,isDestroyed:g,isFinished:p,isServerRequest:v}=n("./utils"),_=h("kDestroy"),b=h("kConstruct");function A(le,pe,$e){le&&(le.stack,pe&&!pe.errored&&(pe.errored=le),$e&&!$e.errored&&($e.errored=le))}function w(le,pe){const $e=this._readableState,Fe=this._writableState,Oe=Fe||$e;return Fe!=null&&Fe.destroyed||$e!=null&&$e.destroyed?(typeof pe=="function"&&pe(),this):(A(le,Fe,$e),Fe&&(Fe.destroyed=!0),$e&&($e.destroyed=!0),Oe.constructed?S(this,le,pe):this.once(_,function(Et){S(this,c(Et,le),pe)}),this)}function S(le,pe,$e){let Fe=!1;function Oe(Et){if(Fe)return;Fe=!0;const he=le._readableState,In=le._writableState;A(Et,In,he),In&&(In.closed=!0),he&&(he.closed=!0),typeof $e=="function"&&$e(Et),Et?u.nextTick(T,le,Et):u.nextTick(x,le)}try{le._destroy(pe||null,Oe)}catch(Et){Oe(Et)}}function T(le,pe){M(le,pe),x(le)}function x(le){const pe=le._readableState,$e=le._writableState;$e&&($e.closeEmitted=!0),pe&&(pe.closeEmitted=!0),($e!=null&&$e.emitClose||pe!=null&&pe.emitClose)&&le.emit("close")}function M(le,pe){const $e=le._readableState,Fe=le._writableState;Fe!=null&&Fe.errorEmitted||$e!=null&&$e.errorEmitted||(Fe&&(Fe.errorEmitted=!0),$e&&($e.errorEmitted=!0),le.emit("error",pe))}function L(){const le=this._readableState,pe=this._writableState;le&&(le.constructed=!0,le.closed=!1,le.closeEmitted=!1,le.destroyed=!1,le.errored=null,le.errorEmitted=!1,le.reading=!1,le.ended=le.readable===!1,le.endEmitted=le.readable===!1),pe&&(pe.constructed=!0,pe.destroyed=!1,pe.closed=!1,pe.closeEmitted=!1,pe.errored=null,pe.errorEmitted=!1,pe.finalCalled=!1,pe.prefinished=!1,pe.ended=pe.writable===!1,pe.ending=pe.writable===!1,pe.finished=pe.writable===!1)}function O(le,pe,$e){const Fe=le._readableState,Oe=le._writableState;if(Oe!=null&&Oe.destroyed||Fe!=null&&Fe.destroyed)return this;Fe!=null&&Fe.autoDestroy||Oe!=null&&Oe.autoDestroy?le.destroy(pe):pe&&(pe.stack,Oe&&!Oe.errored&&(Oe.errored=pe),Fe&&!Fe.errored&&(Fe.errored=pe),$e?u.nextTick(M,le,pe):M(le,pe))}function re(le,pe){if(typeof le._construct!="function")return;const $e=le._readableState,Fe=le._writableState;$e&&($e.constructed=!1),Fe&&(Fe.constructed=!1),le.once(b,pe),!(le.listenerCount(b)>1)&&u.nextTick(D,le)}function D(le){let pe=!1;function $e(Fe){if(pe){O(le,Fe??new d);return}pe=!0;const Oe=le._readableState,Et=le._writableState,he=Et||Oe;Oe&&(Oe.constructed=!0),Et&&(Et.constructed=!0),he.destroyed?le.emit(_,Fe):Fe?O(le,Fe,!0):u.nextTick(z,le)}try{le._construct(Fe=>{u.nextTick($e,Fe)})}catch(Fe){u.nextTick($e,Fe)}}function z(le){le.emit(b)}function V(le){return(le==null?void 0:le.setHeader)&&typeof le.abort=="function"}function j(le){le.emit("close")}function F(le,pe){le.emit("error",pe),u.nextTick(j,le)}function Ce(le,pe){!le||g(le)||(!pe&&!p(le)&&(pe=new f),v(le)?(le.socket=null,le.destroy(pe)):V(le)?le.abort():V(le.req)?le.req.abort():typeof le.destroy=="function"?le.destroy(pe):typeof le.close=="function"?le.close():pe?u.nextTick(F,le,pe):u.nextTick(j,le),le.destroyed||(le[y]=!0))}o.exports={construct:re,destroyer:Ce,destroy:w,undestroy:L,errorOrDestroy:O}},{"../../ours/errors":126,"../../ours/primordials":127,"./utils":122,"process/":102}],111:[function(n,o,a){const{ObjectDefineProperties:u,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:d,ObjectSetPrototypeOf:f}=n("../../ours/primordials");o.exports=g;const h=n("./readable"),y=n("./writable");f(g.prototype,h.prototype),f(g,h);{const b=d(y.prototype);for(let A=0;A<b.length;A++){const w=b[A];g.prototype[w]||(g.prototype[w]=y.prototype[w])}}function g(b){if(!(this instanceof g))return new g(b);h.call(this,b),y.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}u(g.prototype,{writable:{__proto__:null,...c(y.prototype,"writable")},writableHighWaterMark:{__proto__:null,...c(y.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...c(y.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...c(y.prototype,"writableBuffer")},writableLength:{__proto__:null,...c(y.prototype,"writableLength")},writableFinished:{__proto__:null,...c(y.prototype,"writableFinished")},writableCorked:{__proto__:null,...c(y.prototype,"writableCorked")},writableEnded:{__proto__:null,...c(y.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...c(y.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let p;function v(){return p===void 0&&(p={}),p}g.fromWeb=function(b,A){return v().newStreamDuplexFromReadableWritablePair(b,A)},g.toWeb=function(b){return v().newReadableWritablePairFromDuplex(b)};let _;g.from=function(b){return _||(_=n("./duplexify")),_(b,"body")}},{"../../ours/primordials":127,"./duplexify":112,"./readable":119,"./writable":123}],112:[function(n,o,a){const u=n("process/"),c=n("buffer"),{isReadable:d,isWritable:f,isIterable:h,isNodeStream:y,isReadableNodeStream:g,isWritableNodeStream:p,isDuplexNodeStream:v}=n("./utils"),_=n("./end-of-stream"),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:w}}=n("../../ours/errors"),{destroyer:S}=n("./destroy"),T=n("./duplex"),x=n("./readable"),{createDeferredPromise:M}=n("../../ours/util"),L=n("./from"),O=globalThis.Blob||c.Blob,re=typeof O<"u"?function(le){return le instanceof O}:function(le){return!1},D=globalThis.AbortController||n("abort-controller").AbortController,{FunctionPrototypeCall:z}=n("../../ours/primordials");class V extends T{constructor(le){super(le),(le==null?void 0:le.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(le==null?void 0:le.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}o.exports=function Ce(le,pe){if(v(le))return le;if(g(le))return F({readable:le});if(p(le))return F({writable:le});if(y(le))return F({writable:!1,readable:!1});if(typeof le=="function"){const{value:Fe,write:Oe,final:Et,destroy:he}=j(le);if(h(Fe))return L(V,Fe,{objectMode:!0,write:Oe,final:Et,destroy:he});const In=Fe==null?void 0:Fe.then;if(typeof In=="function"){let vn;const kt=z(In,Fe,ue=>{if(ue!=null)throw new w("nully","body",ue)},ue=>{S(vn,ue)});return vn=new V({objectMode:!0,readable:!1,write:Oe,final(ue){Et(async()=>{try{await kt,u.nextTick(ue,null)}catch(At){u.nextTick(ue,At)}})},destroy:he})}throw new w("Iterable, AsyncIterable or AsyncFunction",pe,Fe)}if(re(le))return Ce(le.arrayBuffer());if(h(le))return L(V,le,{objectMode:!0,writable:!1});if(typeof(le==null?void 0:le.writable)=="object"||typeof(le==null?void 0:le.readable)=="object"){const Fe=le!=null&&le.readable?g(le==null?void 0:le.readable)?le==null?void 0:le.readable:Ce(le.readable):void 0,Oe=le!=null&&le.writable?p(le==null?void 0:le.writable)?le==null?void 0:le.writable:Ce(le.writable):void 0;return F({readable:Fe,writable:Oe})}const $e=le==null?void 0:le.then;if(typeof $e=="function"){let Fe;return z($e,le,Oe=>{Oe!=null&&Fe.push(Oe),Fe.push(null)},Oe=>{S(Fe,Oe)}),Fe=new V({objectMode:!0,writable:!1,read(){}})}throw new A(pe,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],le)};function j(Ce){let{promise:le,resolve:pe}=M();const $e=new D,Fe=$e.signal;return{value:Ce(async function*(){for(;;){const Et=le;le=null;const{chunk:he,done:In,cb:vn}=await Et;if(u.nextTick(vn),In)return;if(Fe.aborted)throw new b(void 0,{cause:Fe.reason});({promise:le,resolve:pe}=M()),yield he}}(),{signal:Fe}),write(Et,he,In){const vn=pe;pe=null,vn({chunk:Et,done:!1,cb:In})},final(Et){const he=pe;pe=null,he({done:!0,cb:Et})},destroy(Et,he){$e.abort(),he(Et)}}}function F(Ce){const le=Ce.readable&&typeof Ce.readable.read!="function"?x.wrap(Ce.readable):Ce.readable,pe=Ce.writable;let $e=!!d(le),Fe=!!f(pe),Oe,Et,he,In,vn;function kt(ue){const At=In;In=null,At?At(ue):ue&&vn.destroy(ue)}return vn=new V({readableObjectMode:!!(le!=null&&le.readableObjectMode),writableObjectMode:!!(pe!=null&&pe.writableObjectMode),readable:$e,writable:Fe}),Fe&&(_(pe,ue=>{Fe=!1,ue&&S(le,ue),kt(ue)}),vn._write=function(ue,At,jt){pe.write(ue,At)?jt():Oe=jt},vn._final=function(ue){pe.end(),Et=ue},pe.on("drain",function(){if(Oe){const ue=Oe;Oe=null,ue()}}),pe.on("finish",function(){if(Et){const ue=Et;Et=null,ue()}})),$e&&(_(le,ue=>{$e=!1,ue&&S(le,ue),kt(ue)}),le.on("readable",function(){if(he){const ue=he;he=null,ue()}}),le.on("end",function(){vn.push(null)}),vn._read=function(){for(;;){const ue=le.read();if(ue===null){he=vn._read;return}if(!vn.push(ue))return}}),vn._destroy=function(ue,At){!ue&&In!==null&&(ue=new b),he=null,Oe=null,Et=null,In===null?At(ue):(In=At,S(pe,ue),S(le,ue))},vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./readable":119,"./utils":122,"abort-controller":24,buffer:29,"process/":102}],113:[function(n,o,a){const u=n("process/"),{AbortError:c,codes:d}=n("../../ours/errors"),{ERR_INVALID_ARG_TYPE:f,ERR_STREAM_PREMATURE_CLOSE:h}=d,{kEmptyObject:y,once:g}=n("../../ours/util"),{validateAbortSignal:p,validateFunction:v,validateObject:_,validateBoolean:b}=n("../validators"),{Promise:A,PromisePrototypeThen:w}=n("../../ours/primordials"),{isClosed:S,isReadable:T,isReadableNodeStream:x,isReadableStream:M,isReadableFinished:L,isReadableErrored:O,isWritable:re,isWritableNodeStream:D,isWritableStream:z,isWritableFinished:V,isWritableErrored:j,isNodeStream:F,willEmitClose:Ce,kIsClosedPromise:le}=n("./utils");function pe(he){return he.setHeader&&typeof he.abort=="function"}const $e=()=>{};function Fe(he,In,vn){var kt,ue;if(arguments.length===2?(vn=In,In=y):In==null?In=y:_(In,"options"),v(vn,"callback"),p(In.signal,"options.signal"),vn=g(vn),M(he)||z(he))return Oe(he,In,vn);if(!F(he))throw new f("stream",["ReadableStream","WritableStream","Stream"],he);const At=(kt=In.readable)!==null&&kt!==void 0?kt:x(he),jt=(ue=In.writable)!==null&&ue!==void 0?ue:D(he),hn=he._writableState,Pt=he._readableState,Ie=()=>{he.writable||xe()};let de=Ce(he)&&x(he)===At&&D(he)===jt,ze=V(he,!1);const xe=()=>{ze=!0,he.destroyed&&(de=!1),!(de&&(!he.readable||At))&&(!At||Ne)&&vn.call(he)};let Ne=L(he,!1);const Lt=()=>{Ne=!0,he.destroyed&&(de=!1),!(de&&(!he.writable||jt))&&(!jt||ze)&&vn.call(he)},Dt=$=>{vn.call(he,$)};let Cn=S(he);const ie=()=>{Cn=!0;const $=j(he)||O(he);if($&&typeof $!="boolean")return vn.call(he,$);if(At&&!Ne&&x(he,!0)&&!L(he,!1))return vn.call(he,new h);if(jt&&!ze&&!V(he,!1))return vn.call(he,new h);vn.call(he)},ae=()=>{Cn=!0;const $=j(he)||O(he);if($&&typeof $!="boolean")return vn.call(he,$);vn.call(he)},Y=()=>{he.req.on("finish",xe)};pe(he)?(he.on("complete",xe),de||he.on("abort",ie),he.req?Y():he.on("request",Y)):jt&&!hn&&(he.on("end",Ie),he.on("close",Ie)),!de&&typeof he.aborted=="boolean"&&he.on("aborted",ie),he.on("end",Lt),he.on("finish",xe),In.error!==!1&&he.on("error",Dt),he.on("close",ie),Cn?u.nextTick(ie):hn!=null&&hn.errorEmitted||Pt!=null&&Pt.errorEmitted?de||u.nextTick(ae):(!At&&(!de||T(he))&&(ze||re(he)===!1)||!jt&&(!de||re(he))&&(Ne||T(he)===!1)||Pt&&he.req&&he.aborted)&&u.nextTick(ae);const k=()=>{vn=$e,he.removeListener("aborted",ie),he.removeListener("complete",xe),he.removeListener("abort",ie),he.removeListener("request",Y),he.req&&he.req.removeListener("finish",xe),he.removeListener("end",Ie),he.removeListener("close",Ie),he.removeListener("finish",xe),he.removeListener("end",Lt),he.removeListener("error",Dt),he.removeListener("close",ie)};if(In.signal&&!Cn){const $=()=>{const oe=vn;k(),oe.call(he,new c(void 0,{cause:In.signal.reason}))};if(In.signal.aborted)u.nextTick($);else{const oe=vn;vn=g((..._e)=>{In.signal.removeEventListener("abort",$),oe.apply(he,_e)}),In.signal.addEventListener("abort",$)}}return k}function Oe(he,In,vn){let kt=!1,ue=$e;if(In.signal)if(ue=()=>{kt=!0,vn.call(he,new c(void 0,{cause:In.signal.reason}))},In.signal.aborted)u.nextTick(ue);else{const jt=vn;vn=g((...hn)=>{In.signal.removeEventListener("abort",ue),jt.apply(he,hn)}),In.signal.addEventListener("abort",ue)}const At=(...jt)=>{kt||u.nextTick(()=>vn.apply(he,jt))};return w(he[le].promise,At,At),$e}function Et(he,In){var vn;let kt=!1;return In===null&&(In=y),(vn=In)!==null&&vn!==void 0&&vn.cleanup&&(b(In.cleanup,"cleanup"),kt=In.cleanup),new A((ue,At)=>{const jt=Fe(he,In,hn=>{kt&&jt(),hn?At(hn):ue()})})}o.exports=Fe,o.exports.finished=Et},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./utils":122,"process/":102}],114:[function(n,o,a){const u=n("process/"),{PromisePrototypeThen:c,SymbolAsyncIterator:d,SymbolIterator:f}=n("../../ours/primordials"),{Buffer:h}=n("buffer"),{ERR_INVALID_ARG_TYPE:y,ERR_STREAM_NULL_VALUES:g}=n("../../ours/errors").codes;function p(v,_,b){let A;if(typeof _=="string"||_ instanceof h)return new v({objectMode:!0,...b,read(){this.push(_),this.push(null)}});let w;if(_&&_[d])w=!0,A=_[d]();else if(_&&_[f])w=!1,A=_[f]();else throw new y("iterable",["Iterable"],_);const S=new v({objectMode:!0,highWaterMark:1,...b});let T=!1;S._read=function(){T||(T=!0,M())},S._destroy=function(L,O){c(x(L),()=>u.nextTick(O,L),re=>u.nextTick(O,re||L))};async function x(L){const O=L!=null,re=typeof A.throw=="function";if(O&&re){const{value:D,done:z}=await A.throw(L);if(await D,z)return}if(typeof A.return=="function"){const{value:D}=await A.return();await D}}async function M(){for(;;){try{const{value:L,done:O}=w?await A.next():A.next();if(O)S.push(null);else{const re=L&&typeof L.then=="function"?await L:L;if(re===null)throw T=!1,new g;if(S.push(re))continue;T=!1}}catch(L){S.destroy(L)}break}}return S}o.exports=p},{"../../ours/errors":126,"../../ours/primordials":127,buffer:29,"process/":102}],115:[function(n,o,a){const{ArrayIsArray:u,ObjectSetPrototypeOf:c}=n("../../ours/primordials"),{EventEmitter:d}=n("events");function f(y){d.call(this,y)}c(f.prototype,d.prototype),c(f,d),f.prototype.pipe=function(y,g){const p=this;function v(x){y.writable&&y.write(x)===!1&&p.pause&&p.pause()}p.on("data",v);function _(){p.readable&&p.resume&&p.resume()}y.on("drain",_),!y._isStdio&&(!g||g.end!==!1)&&(p.on("end",A),p.on("close",w));let b=!1;function A(){b||(b=!0,y.end())}function w(){b||(b=!0,typeof y.destroy=="function"&&y.destroy())}function S(x){T(),d.listenerCount(this,"error")===0&&this.emit("error",x)}h(p,"error",S),h(y,"error",S);function T(){p.removeListener("data",v),y.removeListener("drain",_),p.removeListener("end",A),p.removeListener("close",w),p.removeListener("error",S),y.removeListener("error",S),p.removeListener("end",T),p.removeListener("close",T),y.removeListener("close",T)}return p.on("end",T),p.on("close",T),y.on("close",T),y.emit("pipe",p),y};function h(y,g,p){if(typeof y.prependListener=="function")return y.prependListener(g,p);!y._events||!y._events[g]?y.on(g,p):u(y._events[g])?y._events[g].unshift(p):y._events[g]=[p,y._events[g]]}o.exports={Stream:f,prependListener:h}},{"../../ours/primordials":127,events:49}],116:[function(n,o,a){const u=globalThis.AbortController||n("abort-controller").AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:d,ERR_MISSING_ARGS:f,ERR_OUT_OF_RANGE:h},AbortError:y}=n("../../ours/errors"),{validateAbortSignal:g,validateInteger:p,validateObject:v}=n("../validators"),_=n("../../ours/primordials").Symbol("kWeak"),{finished:b}=n("./end-of-stream"),A=n("./compose"),{addAbortSignalNoValidate:w}=n("./add-abort-signal"),{isWritable:S,isNodeStream:T}=n("./utils"),{ArrayPrototypePush:x,MathFloor:M,Number:L,NumberIsNaN:O,Promise:re,PromiseReject:D,PromisePrototypeThen:z,Symbol:V}=n("../../ours/primordials"),j=V("kEmpty"),F=V("kEof");function Ce(Pt,Ie){if(Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),T(Pt)&&!S(Pt))throw new c("stream",Pt,"must be writable");const de=A(this,Pt);return Ie!=null&&Ie.signal&&w(Ie.signal,de),de}function le(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal");let de=1;return(Ie==null?void 0:Ie.concurrency)!=null&&(de=M(Ie.concurrency)),p(de,"concurrency",1),(async function*(){var xe,Ne;const Lt=new u,Dt=this,Cn=[],ie=Lt.signal,ae={signal:ie},Y=()=>Lt.abort();Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted&&Y(),Ie==null||(Ne=Ie.signal)===null||Ne===void 0||Ne.addEventListener("abort",Y);let k,$,oe=!1;function _e(){oe=!0}async function Ue(){try{for await(let Tn of Dt){var _n;if(oe)return;if(ie.aborted)throw new y;try{Tn=Pt(Tn,ae)}catch(Ln){Tn=D(Ln)}Tn!==j&&(typeof((_n=Tn)===null||_n===void 0?void 0:_n.catch)=="function"&&Tn.catch(_e),Cn.push(Tn),k&&(k(),k=null),!oe&&Cn.length&&Cn.length>=de&&await new re(Ln=>{$=Ln}))}Cn.push(F)}catch(Tn){const Ln=D(Tn);z(Ln,void 0,_e),Cn.push(Ln)}finally{var wn;oe=!0,k&&(k(),k=null),Ie==null||(wn=Ie.signal)===null||wn===void 0||wn.removeEventListener("abort",Y)}}Ue();try{for(;;){for(;Cn.length>0;){const _n=await Cn[0];if(_n===F)return;if(ie.aborted)throw new y;_n!==j&&(yield _n),Cn.shift(),$&&($(),$=null)}await new re(_n=>{k=_n})}}finally{Lt.abort(),oe=!0,$&&($(),$=null)}}).call(this)}function pe(Pt=void 0){return Pt!=null&&v(Pt,"options"),(Pt==null?void 0:Pt.signal)!=null&&g(Pt.signal,"options.signal"),(async function*(){let de=0;for await(const xe of this){var ze;if(Pt!=null&&(ze=Pt.signal)!==null&&ze!==void 0&&ze.aborted)throw new y({cause:Pt.signal.reason});yield[de++,xe]}}).call(this)}async function $e(Pt,Ie=void 0){for await(const de of he.call(this,Pt,Ie))return!0;return!1}async function Fe(Pt,Ie=void 0){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);return!await $e.call(this,async(...de)=>!await Pt(...de),Ie)}async function Oe(Pt,Ie){for await(const de of he.call(this,Pt,Ie))return de}async function Et(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);async function de(ze,xe){return await Pt(ze,xe),j}for await(const ze of le.call(this,de,Ie));}function he(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);async function de(ze,xe){return await Pt(ze,xe)?ze:j}return le.call(this,de,Ie)}class In extends f{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function vn(Pt,Ie,de){var ze;if(typeof Pt!="function")throw new d("reducer",["Function","AsyncFunction"],Pt);de!=null&&v(de,"options"),(de==null?void 0:de.signal)!=null&&g(de.signal,"options.signal");let xe=arguments.length>1;if(de!=null&&(ze=de.signal)!==null&&ze!==void 0&&ze.aborted){const ie=new y(void 0,{cause:de.signal.reason});throw this.once("error",()=>{}),await b(this.destroy(ie)),ie}const Ne=new u,Lt=Ne.signal;if(de!=null&&de.signal){const ie={once:!0,[_]:this};de.signal.addEventListener("abort",()=>Ne.abort(),ie)}let Dt=!1;try{for await(const ie of this){var Cn;if(Dt=!0,de!=null&&(Cn=de.signal)!==null&&Cn!==void 0&&Cn.aborted)throw new y;xe?Ie=await Pt(Ie,ie,{signal:Lt}):(Ie=ie,xe=!0)}if(!Dt&&!xe)throw new In}finally{Ne.abort()}return Ie}async function kt(Pt){Pt!=null&&v(Pt,"options"),(Pt==null?void 0:Pt.signal)!=null&&g(Pt.signal,"options.signal");const Ie=[];for await(const ze of this){var de;if(Pt!=null&&(de=Pt.signal)!==null&&de!==void 0&&de.aborted)throw new y(void 0,{cause:Pt.signal.reason});x(Ie,ze)}return Ie}function ue(Pt,Ie){const de=le.call(this,Pt,Ie);return(async function*(){for await(const xe of de)yield*xe}).call(this)}function At(Pt){if(Pt=L(Pt),O(Pt))return 0;if(Pt<0)throw new h("number",">= 0",Pt);return Pt}function jt(Pt,Ie=void 0){return Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),Pt=At(Pt),(async function*(){var ze;if(Ie!=null&&(ze=Ie.signal)!==null&&ze!==void 0&&ze.aborted)throw new y;for await(const Ne of this){var xe;if(Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted)throw new y;Pt--<=0&&(yield Ne)}}).call(this)}function hn(Pt,Ie=void 0){return Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),Pt=At(Pt),(async function*(){var ze;if(Ie!=null&&(ze=Ie.signal)!==null&&ze!==void 0&&ze.aborted)throw new y;for await(const Ne of this){var xe;if(Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted)throw new y;if(Pt-- >0)yield Ne;else return}}).call(this)}o.exports.streamReturningOperators={asIndexedPairs:pe,drop:jt,filter:he,flatMap:ue,map:le,take:hn,compose:Ce},o.exports.promiseReturningOperators={every:Fe,forEach:Et,reduce:vn,toArray:kt,some:$e,find:Oe}},{"../../ours/errors":126,"../../ours/primordials":127,"../validators":124,"./add-abort-signal":107,"./compose":109,"./end-of-stream":113,"./utils":122,"abort-controller":24}],117:[function(n,o,a){const{ObjectSetPrototypeOf:u}=n("../../ours/primordials");o.exports=d;const c=n("./transform");u(d.prototype,c.prototype),u(d,c);function d(f){if(!(this instanceof d))return new d(f);c.call(this,f)}d.prototype._transform=function(f,h,y){y(null,f)}},{"../../ours/primordials":127,"./transform":121}],118:[function(n,o,a){const u=n("process/"),{ArrayIsArray:c,Promise:d,SymbolAsyncIterator:f}=n("../../ours/primordials"),h=n("./end-of-stream"),{once:y}=n("../../ours/util"),g=n("./destroy"),p=n("./duplex"),{aggregateTwoErrors:v,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:T}=n("../../ours/errors"),{validateFunction:x,validateAbortSignal:M}=n("../validators"),{isIterable:L,isReadable:O,isReadableNodeStream:re,isNodeStream:D,isTransformStream:z,isWebStream:V,isReadableStream:j,isReadableEnded:F}=n("./utils"),Ce=globalThis.AbortController||n("abort-controller").AbortController;let le,pe;function $e(At,jt,hn){let Pt=!1;At.on("close",()=>{Pt=!0});const Ie=h(At,{readable:jt,writable:hn},de=>{Pt=!de});return{destroy:de=>{Pt||(Pt=!0,g.destroyer(At,de||new w("pipe")))},cleanup:Ie}}function Fe(At){return x(At[At.length-1],"streams[stream.length - 1]"),At.pop()}function Oe(At){if(L(At))return At;if(re(At))return Et(At);throw new _("val",["Readable","Iterable","AsyncIterable"],At)}async function*Et(At){pe||(pe=n("./readable")),yield*pe.prototype[f].call(At)}async function he(At,jt,hn,{end:Pt}){let Ie,de=null;const ze=Lt=>{if(Lt&&(Ie=Lt),de){const Dt=de;de=null,Dt()}},xe=()=>new d((Lt,Dt)=>{Ie?Dt(Ie):de=()=>{Ie?Dt(Ie):Lt()}});jt.on("drain",ze);const Ne=h(jt,{readable:!1},ze);try{jt.writableNeedDrain&&await xe();for await(const Lt of At)jt.write(Lt)||await xe();Pt&&jt.end(),await xe(),hn()}catch(Lt){hn(Ie!==Lt?v(Ie,Lt):Lt)}finally{Ne(),jt.off("drain",ze)}}async function In(At,jt,hn,{end:Pt}){z(jt)&&(jt=jt.writable);const Ie=jt.getWriter();try{for await(const de of At)await Ie.ready,Ie.write(de).catch(()=>{});await Ie.ready,Pt&&await Ie.close(),hn()}catch(de){try{await Ie.abort(de),hn(de)}catch(ze){hn(ze)}}}function vn(...At){return kt(At,y(Fe(At)))}function kt(At,jt,hn){if(At.length===1&&c(At[0])&&(At=At[0]),At.length<2)throw new A("streams");const Pt=new Ce,Ie=Pt.signal,de=hn==null?void 0:hn.signal,ze=[];M(de,"options.signal");function xe(){ae(new T)}de==null||de.addEventListener("abort",xe);let Ne,Lt;const Dt=[];let Cn=0;function ie(oe){ae(oe,--Cn===0)}function ae(oe,_e){if(oe&&(!Ne||Ne.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Ne=oe),!(!Ne&&!_e)){for(;Dt.length;)Dt.shift()(Ne);de==null||de.removeEventListener("abort",xe),Pt.abort(),_e&&(Ne||ze.forEach(Ue=>Ue()),u.nextTick(jt,Ne,Lt))}}let Y;for(let oe=0;oe<At.length;oe++){const _e=At[oe],Ue=oe<At.length-1,_n=oe>0,wn=Ue||(hn==null?void 0:hn.end)!==!1,Tn=oe===At.length-1;if(D(_e)){let Ln=function(Ve){Ve&&Ve.name!=="AbortError"&&Ve.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ie(Ve)};if(wn){const{destroy:Ve,cleanup:qe}=$e(_e,Ue,_n);Dt.push(Ve),O(_e)&&Tn&&ze.push(qe)}_e.on("error",Ln),O(_e)&&Tn&&ze.push(()=>{_e.removeListener("error",Ln)})}if(oe===0)if(typeof _e=="function"){if(Y=_e({signal:Ie}),!L(Y))throw new b("Iterable, AsyncIterable or Stream","source",Y)}else L(_e)||re(_e)||z(_e)?Y=_e:Y=p.from(_e);else if(typeof _e=="function"){if(z(Y)){var k;Y=Oe((k=Y)===null||k===void 0?void 0:k.readable)}else Y=Oe(Y);if(Y=_e(Y,{signal:Ie}),Ue){if(!L(Y,!0))throw new b("AsyncIterable",`transform[${oe-1}]`,Y)}else{var $;le||(le=n("./passthrough"));const Ln=new le({objectMode:!0}),Ve=($=Y)===null||$===void 0?void 0:$.then;if(typeof Ve=="function")Cn++,Ve.call(Y,An=>{Lt=An,An!=null&&Ln.write(An),wn&&Ln.end(),u.nextTick(ie)},An=>{Ln.destroy(An),u.nextTick(ie,An)});else if(L(Y,!0))Cn++,he(Y,Ln,ie,{end:wn});else if(j(Y)||z(Y)){const An=Y.readable||Y;Cn++,he(An,Ln,ie,{end:wn})}else throw new b("AsyncIterable or Promise","destination",Y);Y=Ln;const{destroy:qe,cleanup:Sn}=$e(Y,!1,!0);Dt.push(qe),Tn&&ze.push(Sn)}}else if(D(_e)){if(re(Y)){Cn+=2;const Ln=ue(Y,_e,ie,{end:wn});O(_e)&&Tn&&ze.push(Ln)}else if(z(Y)||j(Y)){const Ln=Y.readable||Y;Cn++,he(Ln,_e,ie,{end:wn})}else if(L(Y))Cn++,he(Y,_e,ie,{end:wn});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=_e}else if(V(_e)){if(re(Y))Cn++,In(Oe(Y),_e,ie,{end:wn});else if(j(Y)||L(Y))Cn++,In(Y,_e,ie,{end:wn});else if(z(Y))Cn++,In(Y.readable,_e,ie,{end:wn});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=_e}else Y=p.from(_e)}return(Ie!=null&&Ie.aborted||de!=null&&de.aborted)&&u.nextTick(xe),Y}function ue(At,jt,hn,{end:Pt}){let Ie=!1;if(jt.on("close",()=>{Ie||hn(new S)}),At.pipe(jt,{end:!1}),Pt){let de=function(){Ie=!0,jt.end()};F(At)?u.nextTick(de):At.once("end",de)}else hn();return h(At,{readable:!0,writable:!1},de=>{const ze=At._readableState;de&&de.code==="ERR_STREAM_PREMATURE_CLOSE"&&ze&&ze.ended&&!ze.errored&&!ze.errorEmitted?At.once("end",hn).once("error",hn):hn(de)}),h(jt,{readable:!1,writable:!0},hn)}o.exports={pipelineImpl:kt,pipeline:vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./passthrough":117,"./readable":119,"./utils":122,"abort-controller":24,"process/":102}],119:[function(n,o,a){const u=n("process/"),{ArrayPrototypeIndexOf:c,NumberIsInteger:d,NumberIsNaN:f,NumberParseInt:h,ObjectDefineProperties:y,ObjectKeys:g,ObjectSetPrototypeOf:p,Promise:v,SafeSet:_,SymbolAsyncIterator:b,Symbol:A}=n("../../ours/primordials");o.exports=ue,ue.ReadableState=kt;const{EventEmitter:w}=n("events"),{Stream:S,prependListener:T}=n("./legacy"),{Buffer:x}=n("buffer"),{addAbortSignal:M}=n("./add-abort-signal"),L=n("./end-of-stream");let O=n("../../ours/util").debuglog("stream",Ve=>{O=Ve});const re=n("./buffer_list"),D=n("./destroy"),{getHighWaterMark:z,getDefaultHighWaterMark:V}=n("./state"),{aggregateTwoErrors:j,codes:{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:le,ERR_STREAM_PUSH_AFTER_EOF:pe,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$e}}=n("../../ours/errors"),{validateObject:Fe}=n("../validators"),Oe=A("kPaused"),{StringDecoder:Et}=n("string_decoder"),he=n("./from");p(ue.prototype,S.prototype),p(ue,S);const In=()=>{},{errorOrDestroy:vn}=D;function kt(Ve,qe,Sn){typeof Sn!="boolean"&&(Sn=qe instanceof n("./duplex")),this.objectMode=!!(Ve&&Ve.objectMode),Sn&&(this.objectMode=this.objectMode||!!(Ve&&Ve.readableObjectMode)),this.highWaterMark=Ve?z(this,Ve,"readableHighWaterMark",Sn):V(!1),this.buffer=new re,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Oe]=null,this.errorEmitted=!1,this.emitClose=!Ve||Ve.emitClose!==!1,this.autoDestroy=!Ve||Ve.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=Ve&&Ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,Ve&&Ve.encoding&&(this.decoder=new Et(Ve.encoding),this.encoding=Ve.encoding)}function ue(Ve){if(!(this instanceof ue))return new ue(Ve);const qe=this instanceof n("./duplex");this._readableState=new kt(Ve,this,qe),Ve&&(typeof Ve.read=="function"&&(this._read=Ve.read),typeof Ve.destroy=="function"&&(this._destroy=Ve.destroy),typeof Ve.construct=="function"&&(this._construct=Ve.construct),Ve.signal&&!qe&&M(Ve.signal,this)),S.call(this,Ve),D.construct(this,()=>{this._readableState.needReadable&&Ne(this,this._readableState)})}ue.prototype.destroy=D.destroy,ue.prototype._undestroy=D.undestroy,ue.prototype._destroy=function(Ve,qe){qe(Ve)},ue.prototype[w.captureRejectionSymbol]=function(Ve){this.destroy(Ve)},ue.prototype.push=function(Ve,qe){return At(this,Ve,qe,!1)},ue.prototype.unshift=function(Ve,qe){return At(this,Ve,qe,!0)};function At(Ve,qe,Sn,An){O("readableAddChunk",qe);const xn=Ve._readableState;let Bn;if(xn.objectMode||(typeof qe=="string"?(Sn=Sn||xn.defaultEncoding,xn.encoding!==Sn&&(An&&xn.encoding?qe=x.from(qe,Sn).toString(xn.encoding):(qe=x.from(qe,Sn),Sn=""))):qe instanceof x?Sn="":S._isUint8Array(qe)?(qe=S._uint8ArrayToBuffer(qe),Sn=""):qe!=null&&(Bn=new F("chunk",["string","Buffer","Uint8Array"],qe))),Bn)vn(Ve,Bn);else if(qe===null)xn.reading=!1,de(Ve,xn);else if(xn.objectMode||qe&&qe.length>0)if(An)if(xn.endEmitted)vn(Ve,new $e);else{if(xn.destroyed||xn.errored)return!1;jt(Ve,xn,qe,!0)}else if(xn.ended)vn(Ve,new pe);else{if(xn.destroyed||xn.errored)return!1;xn.reading=!1,xn.decoder&&!Sn?(qe=xn.decoder.write(qe),xn.objectMode||qe.length!==0?jt(Ve,xn,qe,!1):Ne(Ve,xn)):jt(Ve,xn,qe,!1)}else An||(xn.reading=!1,Ne(Ve,xn));return!xn.ended&&(xn.length<xn.highWaterMark||xn.length===0)}function jt(Ve,qe,Sn,An){qe.flowing&&qe.length===0&&!qe.sync&&Ve.listenerCount("data")>0?(qe.multiAwaitDrain?qe.awaitDrainWriters.clear():qe.awaitDrainWriters=null,qe.dataEmitted=!0,Ve.emit("data",Sn)):(qe.length+=qe.objectMode?1:Sn.length,An?qe.buffer.unshift(Sn):qe.buffer.push(Sn),qe.needReadable&&ze(Ve)),Ne(Ve,qe)}ue.prototype.isPaused=function(){const Ve=this._readableState;return Ve[Oe]===!0||Ve.flowing===!1},ue.prototype.setEncoding=function(Ve){const qe=new Et(Ve);this._readableState.decoder=qe,this._readableState.encoding=this._readableState.decoder.encoding;const Sn=this._readableState.buffer;let An="";for(const xn of Sn)An+=qe.write(xn);return Sn.clear(),An!==""&&Sn.push(An),this._readableState.length=An.length,this};const hn=1073741824;function Pt(Ve){if(Ve>hn)throw new le("size","<= 1GiB",Ve);return Ve--,Ve|=Ve>>>1,Ve|=Ve>>>2,Ve|=Ve>>>4,Ve|=Ve>>>8,Ve|=Ve>>>16,Ve++,Ve}function Ie(Ve,qe){return Ve<=0||qe.length===0&&qe.ended?0:qe.objectMode?1:f(Ve)?qe.flowing&&qe.length?qe.buffer.first().length:qe.length:Ve<=qe.length?Ve:qe.ended?qe.length:0}ue.prototype.read=function(Ve){O("read",Ve),Ve===void 0?Ve=NaN:d(Ve)||(Ve=h(Ve,10));const qe=this._readableState,Sn=Ve;if(Ve>qe.highWaterMark&&(qe.highWaterMark=Pt(Ve)),Ve!==0&&(qe.emittedReadable=!1),Ve===0&&qe.needReadable&&((qe.highWaterMark!==0?qe.length>=qe.highWaterMark:qe.length>0)||qe.ended))return O("read: emitReadable",qe.length,qe.ended),qe.length===0&&qe.ended?Ue(this):ze(this),null;if(Ve=Ie(Ve,qe),Ve===0&&qe.ended)return qe.length===0&&Ue(this),null;let An=qe.needReadable;if(O("need readable",An),(qe.length===0||qe.length-Ve<qe.highWaterMark)&&(An=!0,O("length less than watermark",An)),qe.ended||qe.reading||qe.destroyed||qe.errored||!qe.constructed)An=!1,O("reading, ended or constructing",An);else if(An){O("do read"),qe.reading=!0,qe.sync=!0,qe.length===0&&(qe.needReadable=!0);try{this._read(qe.highWaterMark)}catch(Bn){vn(this,Bn)}qe.sync=!1,qe.reading||(Ve=Ie(Sn,qe))}let xn;return Ve>0?xn=_e(Ve,qe):xn=null,xn===null?(qe.needReadable=qe.length<=qe.highWaterMark,Ve=0):(qe.length-=Ve,qe.multiAwaitDrain?qe.awaitDrainWriters.clear():qe.awaitDrainWriters=null),qe.length===0&&(qe.ended||(qe.needReadable=!0),Sn!==Ve&&qe.ended&&Ue(this)),xn!==null&&!qe.errorEmitted&&!qe.closeEmitted&&(qe.dataEmitted=!0,this.emit("data",xn)),xn};function de(Ve,qe){if(O("onEofChunk"),!qe.ended){if(qe.decoder){const Sn=qe.decoder.end();Sn&&Sn.length&&(qe.buffer.push(Sn),qe.length+=qe.objectMode?1:Sn.length)}qe.ended=!0,qe.sync?ze(Ve):(qe.needReadable=!1,qe.emittedReadable=!0,xe(Ve))}}function ze(Ve){const qe=Ve._readableState;O("emitReadable",qe.needReadable,qe.emittedReadable),qe.needReadable=!1,qe.emittedReadable||(O("emitReadable",qe.flowing),qe.emittedReadable=!0,u.nextTick(xe,Ve))}function xe(Ve){const qe=Ve._readableState;O("emitReadable_",qe.destroyed,qe.length,qe.ended),!qe.destroyed&&!qe.errored&&(qe.length||qe.ended)&&(Ve.emit("readable"),qe.emittedReadable=!1),qe.needReadable=!qe.flowing&&!qe.ended&&qe.length<=qe.highWaterMark,k(Ve)}function Ne(Ve,qe){!qe.readingMore&&qe.constructed&&(qe.readingMore=!0,u.nextTick(Lt,Ve,qe))}function Lt(Ve,qe){for(;!qe.reading&&!qe.ended&&(qe.length<qe.highWaterMark||qe.flowing&&qe.length===0);){const Sn=qe.length;if(O("maybeReadMore read 0"),Ve.read(0),Sn===qe.length)break}qe.readingMore=!1}ue.prototype._read=function(Ve){throw new Ce("_read()")},ue.prototype.pipe=function(Ve,qe){const Sn=this,An=this._readableState;An.pipes.length===1&&(An.multiAwaitDrain||(An.multiAwaitDrain=!0,An.awaitDrainWriters=new _(An.awaitDrainWriters?[An.awaitDrainWriters]:[]))),An.pipes.push(Ve),O("pipe count=%d opts=%j",An.pipes.length,qe);const Bn=(!qe||qe.end!==!1)&&Ve!==u.stdout&&Ve!==u.stderr?Gn:Wn;An.endEmitted?u.nextTick(Bn):Sn.once("end",Bn),Ve.on("unpipe",Mn);function Mn(On,Nn){O("onunpipe"),On===Sn&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,jn())}function Gn(){O("onend"),Ve.end()}let Vn,Un=!1;function jn(){O("cleanup"),Ve.removeListener("close",zn),Ve.removeListener("finish",Yn),Vn&&Ve.removeListener("drain",Vn),Ve.removeListener("error",Hn),Ve.removeListener("unpipe",Mn),Sn.removeListener("end",Gn),Sn.removeListener("end",Wn),Sn.removeListener("data",Fn),Un=!0,Vn&&An.awaitDrainWriters&&(!Ve._writableState||Ve._writableState.needDrain)&&Vn()}function Kn(){Un||(An.pipes.length===1&&An.pipes[0]===Ve?(O("false write response, pause",0),An.awaitDrainWriters=Ve,An.multiAwaitDrain=!1):An.pipes.length>1&&An.pipes.includes(Ve)&&(O("false write response, pause",An.awaitDrainWriters.size),An.awaitDrainWriters.add(Ve)),Sn.pause()),Vn||(Vn=Dt(Sn,Ve),Ve.on("drain",Vn))}Sn.on("data",Fn);function Fn(On){O("ondata");const Nn=Ve.write(On);O("dest.write",Nn),Nn===!1&&Kn()}function Hn(On){if(O("onerror",On),Wn(),Ve.removeListener("error",Hn),Ve.listenerCount("error")===0){const Nn=Ve._writableState||Ve._readableState;Nn&&!Nn.errorEmitted?vn(Ve,On):Ve.emit("error",On)}}T(Ve,"error",Hn);function zn(){Ve.removeListener("finish",Yn),Wn()}Ve.once("close",zn);function Yn(){O("onfinish"),Ve.removeListener("close",zn),Wn()}Ve.once("finish",Yn);function Wn(){O("unpipe"),Sn.unpipe(Ve)}return Ve.emit("pipe",Sn),Ve.writableNeedDrain===!0?An.flowing&&Kn():An.flowing||(O("pipe resume"),Sn.resume()),Ve};function Dt(Ve,qe){return function(){const An=Ve._readableState;An.awaitDrainWriters===qe?(O("pipeOnDrain",1),An.awaitDrainWriters=null):An.multiAwaitDrain&&(O("pipeOnDrain",An.awaitDrainWriters.size),An.awaitDrainWriters.delete(qe)),(!An.awaitDrainWriters||An.awaitDrainWriters.size===0)&&Ve.listenerCount("data")&&Ve.resume()}}ue.prototype.unpipe=function(Ve){const qe=this._readableState,Sn={hasUnpiped:!1};if(qe.pipes.length===0)return this;if(!Ve){const xn=qe.pipes;qe.pipes=[],this.pause();for(let Bn=0;Bn<xn.length;Bn++)xn[Bn].emit("unpipe",this,{hasUnpiped:!1});return this}const An=c(qe.pipes,Ve);return An===-1?this:(qe.pipes.splice(An,1),qe.pipes.length===0&&this.pause(),Ve.emit("unpipe",this,Sn),this)},ue.prototype.on=function(Ve,qe){const Sn=S.prototype.on.call(this,Ve,qe),An=this._readableState;return Ve==="data"?(An.readableListening=this.listenerCount("readable")>0,An.flowing!==!1&&this.resume()):Ve==="readable"&&!An.endEmitted&&!An.readableListening&&(An.readableListening=An.needReadable=!0,An.flowing=!1,An.emittedReadable=!1,O("on readable",An.length,An.reading),An.length?ze(this):An.reading||u.nextTick(ie,this)),Sn},ue.prototype.addListener=ue.prototype.on,ue.prototype.removeListener=function(Ve,qe){const Sn=S.prototype.removeListener.call(this,Ve,qe);return Ve==="readable"&&u.nextTick(Cn,this),Sn},ue.prototype.off=ue.prototype.removeListener,ue.prototype.removeAllListeners=function(Ve){const qe=S.prototype.removeAllListeners.apply(this,arguments);return(Ve==="readable"||Ve===void 0)&&u.nextTick(Cn,this),qe};function Cn(Ve){const qe=Ve._readableState;qe.readableListening=Ve.listenerCount("readable")>0,qe.resumeScheduled&&qe[Oe]===!1?qe.flowing=!0:Ve.listenerCount("data")>0?Ve.resume():qe.readableListening||(qe.flowing=null)}function ie(Ve){O("readable nexttick read 0"),Ve.read(0)}ue.prototype.resume=function(){const Ve=this._readableState;return Ve.flowing||(O("resume"),Ve.flowing=!Ve.readableListening,ae(this,Ve)),Ve[Oe]=!1,this};function ae(Ve,qe){qe.resumeScheduled||(qe.resumeScheduled=!0,u.nextTick(Y,Ve,qe))}function Y(Ve,qe){O("resume",qe.reading),qe.reading||Ve.read(0),qe.resumeScheduled=!1,Ve.emit("resume"),k(Ve),qe.flowing&&!qe.reading&&Ve.read(0)}ue.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Oe]=!0,this};function k(Ve){const qe=Ve._readableState;for(O("flow",qe.flowing);qe.flowing&&Ve.read()!==null;);}ue.prototype.wrap=function(Ve){let qe=!1;Ve.on("data",An=>{!this.push(An)&&Ve.pause&&(qe=!0,Ve.pause())}),Ve.on("end",()=>{this.push(null)}),Ve.on("error",An=>{vn(this,An)}),Ve.on("close",()=>{this.destroy()}),Ve.on("destroy",()=>{this.destroy()}),this._read=()=>{qe&&Ve.resume&&(qe=!1,Ve.resume())};const Sn=g(Ve);for(let An=1;An<Sn.length;An++){const xn=Sn[An];this[xn]===void 0&&typeof Ve[xn]=="function"&&(this[xn]=Ve[xn].bind(Ve))}return this},ue.prototype[b]=function(){return $(this)},ue.prototype.iterator=function(Ve){return Ve!==void 0&&Fe(Ve,"options"),$(this,Ve)};function $(Ve,qe){typeof Ve.read!="function"&&(Ve=ue.wrap(Ve,{objectMode:!0}));const Sn=oe(Ve,qe);return Sn.stream=Ve,Sn}async function*oe(Ve,qe){let Sn=In;function An(Mn){this===Ve?(Sn(),Sn=In):Sn=Mn}Ve.on("readable",An);let xn;const Bn=L(Ve,{writable:!1},Mn=>{xn=Mn?j(xn,Mn):null,Sn(),Sn=In});try{for(;;){const Mn=Ve.destroyed?null:Ve.read();if(Mn!==null)yield Mn;else{if(xn)throw xn;if(xn===null)return;await new v(An)}}}catch(Mn){throw xn=j(xn,Mn),xn}finally{(xn||(qe==null?void 0:qe.destroyOnReturn)!==!1)&&(xn===void 0||Ve._readableState.autoDestroy)?D.destroyer(Ve,null):(Ve.off("readable",An),Bn())}}y(ue.prototype,{readable:{__proto__:null,get(){const Ve=this._readableState;return!!Ve&&Ve.readable!==!1&&!Ve.destroyed&&!Ve.errorEmitted&&!Ve.endEmitted},set(Ve){this._readableState&&(this._readableState.readable=!!Ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ve){this._readableState&&(this._readableState.flowing=Ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Ve){this._readableState&&(this._readableState.destroyed=Ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),y(kt.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Oe]!==!1},set(Ve){this[Oe]=!!Ve}}}),ue._fromList=_e;function _e(Ve,qe){if(qe.length===0)return null;let Sn;return qe.objectMode?Sn=qe.buffer.shift():!Ve||Ve>=qe.length?(qe.decoder?Sn=qe.buffer.join(""):qe.buffer.length===1?Sn=qe.buffer.first():Sn=qe.buffer.concat(qe.length),qe.buffer.clear()):Sn=qe.buffer.consume(Ve,qe.decoder),Sn}function Ue(Ve){const qe=Ve._readableState;O("endReadable",qe.endEmitted),qe.endEmitted||(qe.ended=!0,u.nextTick(_n,qe,Ve))}function _n(Ve,qe){if(O("endReadableNT",Ve.endEmitted,Ve.length),!Ve.errored&&!Ve.closeEmitted&&!Ve.endEmitted&&Ve.length===0){if(Ve.endEmitted=!0,qe.emit("end"),qe.writable&&qe.allowHalfOpen===!1)u.nextTick(wn,qe);else if(Ve.autoDestroy){const Sn=qe._writableState;(!Sn||Sn.autoDestroy&&(Sn.finished||Sn.writable===!1))&&qe.destroy()}}}function wn(Ve){Ve.writable&&!Ve.writableEnded&&!Ve.destroyed&&Ve.end()}ue.from=function(Ve,qe){return he(ue,Ve,qe)};let Tn;function Ln(){return Tn===void 0&&(Tn={}),Tn}ue.fromWeb=function(Ve,qe){return Ln().newStreamReadableFromReadableStream(Ve,qe)},ue.toWeb=function(Ve,qe){return Ln().newReadableStreamFromStreamReadable(Ve,qe)},ue.wrap=function(Ve,qe){var Sn,An;return new ue({objectMode:(Sn=(An=Ve.readableObjectMode)!==null&&An!==void 0?An:Ve.objectMode)!==null&&Sn!==void 0?Sn:!0,...qe,destroy(xn,Bn){D.destroyer(Ve,xn),Bn(xn)}}).wrap(Ve)}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./add-abort-signal":107,"./buffer_list":108,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102,string_decoder:28}],120:[function(n,o,a){const{MathFloor:u,NumberIsInteger:c}=n("../../ours/primordials"),{ERR_INVALID_ARG_VALUE:d}=n("../../ours/errors").codes;function f(g,p,v){return g.highWaterMark!=null?g.highWaterMark:p?g[v]:null}function h(g){return g?16:16*1024}function y(g,p,v,_){const b=f(p,_,v);if(b!=null){if(!c(b)||b<0){const A=_?`options.${v}`:"options.highWaterMark";throw new d(A,b)}return u(b)}return h(g.objectMode)}o.exports={getHighWaterMark:y,getDefaultHighWaterMark:h}},{"../../ours/errors":126,"../../ours/primordials":127}],121:[function(n,o,a){const{ObjectSetPrototypeOf:u,Symbol:c}=n("../../ours/primordials");o.exports=g;const{ERR_METHOD_NOT_IMPLEMENTED:d}=n("../../ours/errors").codes,f=n("./duplex"),{getHighWaterMark:h}=n("./state");u(g.prototype,f.prototype),u(g,f);const y=c("kCallback");function g(_){if(!(this instanceof g))return new g(_);const b=_?h(this,_,"readableHighWaterMark",!0):null;b===0&&(_={..._,highWaterMark:null,readableHighWaterMark:b,writableHighWaterMark:_.writableHighWaterMark||0}),f.call(this,_),this._readableState.sync=!1,this[y]=null,_&&(typeof _.transform=="function"&&(this._transform=_.transform),typeof _.flush=="function"&&(this._flush=_.flush)),this.on("prefinish",v)}function p(_){typeof this._flush=="function"&&!this.destroyed?this._flush((b,A)=>{if(b){_?_(b):this.destroy(b);return}A!=null&&this.push(A),this.push(null),_&&_()}):(this.push(null),_&&_())}function v(){this._final!==p&&p.call(this)}g.prototype._final=p,g.prototype._transform=function(_,b,A){throw new d("_transform()")},g.prototype._write=function(_,b,A){const w=this._readableState,S=this._writableState,T=w.length;this._transform(_,b,(x,M)=>{if(x){A(x);return}M!=null&&this.push(M),S.ended||T===w.length||w.length<w.highWaterMark?A():this[y]=A})},g.prototype._read=function(){if(this[y]){const _=this[y];this[y]=null,_()}}},{"../../ours/errors":126,"../../ours/primordials":127,"./duplex":111,"./state":120}],122:[function(n,o,a){const{Symbol:u,SymbolAsyncIterator:c,SymbolIterator:d,SymbolFor:f}=n("../../ours/primordials"),h=u("kDestroyed"),y=u("kIsErrored"),g=u("kIsReadable"),p=u("kIsDisturbed"),v=f("nodejs.webstream.isClosedPromise"),_=f("nodejs.webstream.controllerErrorFunction");function b(ue,At=!1){var jt;return!!(ue&&typeof ue.pipe=="function"&&typeof ue.on=="function"&&(!At||typeof ue.pause=="function"&&typeof ue.resume=="function")&&(!ue._writableState||((jt=ue._readableState)===null||jt===void 0?void 0:jt.readable)!==!1)&&(!ue._writableState||ue._readableState))}function A(ue){var At;return!!(ue&&typeof ue.write=="function"&&typeof ue.on=="function"&&(!ue._readableState||((At=ue._writableState)===null||At===void 0?void 0:At.writable)!==!1))}function w(ue){return!!(ue&&typeof ue.pipe=="function"&&ue._readableState&&typeof ue.on=="function"&&typeof ue.write=="function")}function S(ue){return ue&&(ue._readableState||ue._writableState||typeof ue.write=="function"&&typeof ue.on=="function"||typeof ue.pipe=="function"&&typeof ue.on=="function")}function T(ue){return!!(ue&&!S(ue)&&typeof ue.pipeThrough=="function"&&typeof ue.getReader=="function"&&typeof ue.cancel=="function")}function x(ue){return!!(ue&&!S(ue)&&typeof ue.getWriter=="function"&&typeof ue.abort=="function")}function M(ue){return!!(ue&&!S(ue)&&typeof ue.readable=="object"&&typeof ue.writable=="object")}function L(ue){return T(ue)||x(ue)||M(ue)}function O(ue,At){return ue==null?!1:At===!0?typeof ue[c]=="function":At===!1?typeof ue[d]=="function":typeof ue[c]=="function"||typeof ue[d]=="function"}function re(ue){if(!S(ue))return null;const At=ue._writableState,jt=ue._readableState,hn=At||jt;return!!(ue.destroyed||ue[h]||hn!=null&&hn.destroyed)}function D(ue){if(!A(ue))return null;if(ue.writableEnded===!0)return!0;const At=ue._writableState;return At!=null&&At.errored?!1:typeof(At==null?void 0:At.ended)!="boolean"?null:At.ended}function z(ue,At){if(!A(ue))return null;if(ue.writableFinished===!0)return!0;const jt=ue._writableState;return jt!=null&&jt.errored?!1:typeof(jt==null?void 0:jt.finished)!="boolean"?null:!!(jt.finished||At===!1&&jt.ended===!0&&jt.length===0)}function V(ue){if(!b(ue))return null;if(ue.readableEnded===!0)return!0;const At=ue._readableState;return!At||At.errored?!1:typeof(At==null?void 0:At.ended)!="boolean"?null:At.ended}function j(ue,At){if(!b(ue))return null;const jt=ue._readableState;return jt!=null&&jt.errored?!1:typeof(jt==null?void 0:jt.endEmitted)!="boolean"?null:!!(jt.endEmitted||At===!1&&jt.ended===!0&&jt.length===0)}function F(ue){return ue&&ue[g]!=null?ue[g]:typeof(ue==null?void 0:ue.readable)!="boolean"?null:re(ue)?!1:b(ue)&&ue.readable&&!j(ue)}function Ce(ue){return typeof(ue==null?void 0:ue.writable)!="boolean"?null:re(ue)?!1:A(ue)&&ue.writable&&!D(ue)}function le(ue,At){return S(ue)?re(ue)?!0:!((At==null?void 0:At.readable)!==!1&&F(ue)||(At==null?void 0:At.writable)!==!1&&Ce(ue)):null}function pe(ue){var At,jt;return S(ue)?ue.writableErrored?ue.writableErrored:(At=(jt=ue._writableState)===null||jt===void 0?void 0:jt.errored)!==null&&At!==void 0?At:null:null}function $e(ue){var At,jt;return S(ue)?ue.readableErrored?ue.readableErrored:(At=(jt=ue._readableState)===null||jt===void 0?void 0:jt.errored)!==null&&At!==void 0?At:null:null}function Fe(ue){if(!S(ue))return null;if(typeof ue.closed=="boolean")return ue.closed;const At=ue._writableState,jt=ue._readableState;return typeof(At==null?void 0:At.closed)=="boolean"||typeof(jt==null?void 0:jt.closed)=="boolean"?(At==null?void 0:At.closed)||(jt==null?void 0:jt.closed):typeof ue._closed=="boolean"&&Oe(ue)?ue._closed:null}function Oe(ue){return typeof ue._closed=="boolean"&&typeof ue._defaultKeepAlive=="boolean"&&typeof ue._removedConnection=="boolean"&&typeof ue._removedContLen=="boolean"}function Et(ue){return typeof ue._sent100=="boolean"&&Oe(ue)}function he(ue){var At;return typeof ue._consuming=="boolean"&&typeof ue._dumped=="boolean"&&((At=ue.req)===null||At===void 0?void 0:At.upgradeOrConnect)===void 0}function In(ue){if(!S(ue))return null;const At=ue._writableState,jt=ue._readableState,hn=At||jt;return!hn&&Et(ue)||!!(hn&&hn.autoDestroy&&hn.emitClose&&hn.closed===!1)}function vn(ue){var At;return!!(ue&&((At=ue[p])!==null&&At!==void 0?At:ue.readableDidRead||ue.readableAborted))}function kt(ue){var At,jt,hn,Pt,Ie,de,ze,xe,Ne,Lt;return!!(ue&&((At=(jt=(hn=(Pt=(Ie=(de=ue[y])!==null&&de!==void 0?de:ue.readableErrored)!==null&&Ie!==void 0?Ie:ue.writableErrored)!==null&&Pt!==void 0?Pt:(ze=ue._readableState)===null||ze===void 0?void 0:ze.errorEmitted)!==null&&hn!==void 0?hn:(xe=ue._writableState)===null||xe===void 0?void 0:xe.errorEmitted)!==null&&jt!==void 0?jt:(Ne=ue._readableState)===null||Ne===void 0?void 0:Ne.errored)!==null&&At!==void 0?At:!((Lt=ue._writableState)===null||Lt===void 0)&&Lt.errored))}o.exports={kDestroyed:h,isDisturbed:vn,kIsDisturbed:p,isErrored:kt,kIsErrored:y,isReadable:F,kIsReadable:g,kIsClosedPromise:v,kControllerErrorFunction:_,isClosed:Fe,isDestroyed:re,isDuplexNodeStream:w,isFinished:le,isIterable:O,isReadableNodeStream:b,isReadableStream:T,isReadableEnded:V,isReadableFinished:j,isReadableErrored:$e,isNodeStream:S,isWebStream:L,isWritable:Ce,isWritableNodeStream:A,isWritableStream:x,isWritableEnded:D,isWritableFinished:z,isWritableErrored:pe,isServerRequest:he,isServerResponse:Et,willEmitClose:In,isTransformStream:M}},{"../../ours/primordials":127}],123:[function(n,o,a){const u=n("process/"),{ArrayPrototypeSlice:c,Error:d,FunctionPrototypeSymbolHasInstance:f,ObjectDefineProperty:h,ObjectDefineProperties:y,ObjectSetPrototypeOf:g,StringPrototypeToLowerCase:p,Symbol:v,SymbolHasInstance:_}=n("../../ours/primordials");o.exports=Et,Et.WritableState=Fe;const{EventEmitter:b}=n("events"),A=n("./legacy").Stream,{Buffer:w}=n("buffer"),S=n("./destroy"),{addAbortSignal:T}=n("./add-abort-signal"),{getHighWaterMark:x,getDefaultHighWaterMark:M}=n("./state"),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_MULTIPLE_CALLBACK:re,ERR_STREAM_CANNOT_PIPE:D,ERR_STREAM_DESTROYED:z,ERR_STREAM_ALREADY_FINISHED:V,ERR_STREAM_NULL_VALUES:j,ERR_STREAM_WRITE_AFTER_END:F,ERR_UNKNOWN_ENCODING:Ce}=n("../../ours/errors").codes,{errorOrDestroy:le}=S;g(Et.prototype,A.prototype),g(Et,A);function pe(){}const $e=v("kOnFinished");function Fe(ie,ae,Y){typeof Y!="boolean"&&(Y=ae instanceof n("./duplex")),this.objectMode=!!(ie&&ie.objectMode),Y&&(this.objectMode=this.objectMode||!!(ie&&ie.writableObjectMode)),this.highWaterMark=ie?x(this,ie,"writableHighWaterMark",Y):M(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const k=!!(ie&&ie.decodeStrings===!1);this.decodeStrings=!k,this.defaultEncoding=ie&&ie.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ue.bind(void 0,ae),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Oe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ie||ie.emitClose!==!1,this.autoDestroy=!ie||ie.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[$e]=[]}function Oe(ie){ie.buffered=[],ie.bufferedIndex=0,ie.allBuffers=!0,ie.allNoop=!0}Fe.prototype.getBuffer=function(){return c(this.buffered,this.bufferedIndex)},h(Fe.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Et(ie){const ae=this instanceof n("./duplex");if(!ae&&!f(Et,this))return new Et(ie);this._writableState=new Fe(ie,this,ae),ie&&(typeof ie.write=="function"&&(this._write=ie.write),typeof ie.writev=="function"&&(this._writev=ie.writev),typeof ie.destroy=="function"&&(this._destroy=ie.destroy),typeof ie.final=="function"&&(this._final=ie.final),typeof ie.construct=="function"&&(this._construct=ie.construct),ie.signal&&T(ie.signal,this)),A.call(this,ie),S.construct(this,()=>{const Y=this._writableState;Y.writing||Pt(this,Y),xe(this,Y)})}h(Et,_,{__proto__:null,value:function(ie){return f(this,ie)?!0:this!==Et?!1:ie&&ie._writableState instanceof Fe}}),Et.prototype.pipe=function(){le(this,new D)};function he(ie,ae,Y,k){const $=ie._writableState;if(typeof Y=="function")k=Y,Y=$.defaultEncoding;else{if(!Y)Y=$.defaultEncoding;else if(Y!=="buffer"&&!w.isEncoding(Y))throw new Ce(Y);typeof k!="function"&&(k=pe)}if(ae===null)throw new j;if(!$.objectMode)if(typeof ae=="string")$.decodeStrings!==!1&&(ae=w.from(ae,Y),Y="buffer");else if(ae instanceof w)Y="buffer";else if(A._isUint8Array(ae))ae=A._uint8ArrayToBuffer(ae),Y="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],ae);let oe;return $.ending?oe=new F:$.destroyed&&(oe=new z("write")),oe?(u.nextTick(k,oe),le(ie,oe,!0),oe):($.pendingcb++,In(ie,$,ae,Y,k))}Et.prototype.write=function(ie,ae,Y){return he(this,ie,ae,Y)===!0},Et.prototype.cork=function(){this._writableState.corked++},Et.prototype.uncork=function(){const ie=this._writableState;ie.corked&&(ie.corked--,ie.writing||Pt(this,ie))},Et.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=p(ae)),!w.isEncoding(ae))throw new Ce(ae);return this._writableState.defaultEncoding=ae,this};function In(ie,ae,Y,k,$){const oe=ae.objectMode?1:Y.length;ae.length+=oe;const _e=ae.length<ae.highWaterMark;return _e||(ae.needDrain=!0),ae.writing||ae.corked||ae.errored||!ae.constructed?(ae.buffered.push({chunk:Y,encoding:k,callback:$}),ae.allBuffers&&k!=="buffer"&&(ae.allBuffers=!1),ae.allNoop&&$!==pe&&(ae.allNoop=!1)):(ae.writelen=oe,ae.writecb=$,ae.writing=!0,ae.sync=!0,ie._write(Y,k,ae.onwrite),ae.sync=!1),_e&&!ae.errored&&!ae.destroyed}function vn(ie,ae,Y,k,$,oe,_e){ae.writelen=k,ae.writecb=_e,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new z("write")):Y?ie._writev($,ae.onwrite):ie._write($,oe,ae.onwrite),ae.sync=!1}function kt(ie,ae,Y,k){--ae.pendingcb,k(Y),hn(ae),le(ie,Y)}function ue(ie,ae){const Y=ie._writableState,k=Y.sync,$=Y.writecb;if(typeof $!="function"){le(ie,new re);return}Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ae?(ae.stack,Y.errored||(Y.errored=ae),ie._readableState&&!ie._readableState.errored&&(ie._readableState.errored=ae),k?u.nextTick(kt,ie,Y,ae,$):kt(ie,Y,ae,$)):(Y.buffered.length>Y.bufferedIndex&&Pt(ie,Y),k?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===$?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:$,stream:ie,state:Y},u.nextTick(At,Y.afterWriteTickInfo)):jt(ie,Y,1,$))}function At({stream:ie,state:ae,count:Y,cb:k}){return ae.afterWriteTickInfo=null,jt(ie,ae,Y,k)}function jt(ie,ae,Y,k){for(!ae.ending&&!ie.destroyed&&ae.length===0&&ae.needDrain&&(ae.needDrain=!1,ie.emit("drain"));Y-- >0;)ae.pendingcb--,k();ae.destroyed&&hn(ae),xe(ie,ae)}function hn(ie){if(ie.writing)return;for(let $=ie.bufferedIndex;$<ie.buffered.length;++$){var ae;const{chunk:oe,callback:_e}=ie.buffered[$],Ue=ie.objectMode?1:oe.length;ie.length-=Ue,_e((ae=ie.errored)!==null&&ae!==void 0?ae:new z("write"))}const Y=ie[$e].splice(0);for(let $=0;$<Y.length;$++){var k;Y[$]((k=ie.errored)!==null&&k!==void 0?k:new z("end"))}Oe(ie)}function Pt(ie,ae){if(ae.corked||ae.bufferProcessing||ae.destroyed||!ae.constructed)return;const{buffered:Y,bufferedIndex:k,objectMode:$}=ae,oe=Y.length-k;if(!oe)return;let _e=k;if(ae.bufferProcessing=!0,oe>1&&ie._writev){ae.pendingcb-=oe-1;const Ue=ae.allNoop?pe:wn=>{for(let Tn=_e;Tn<Y.length;++Tn)Y[Tn].callback(wn)},_n=ae.allNoop&&_e===0?Y:c(Y,_e);_n.allBuffers=ae.allBuffers,vn(ie,ae,!0,ae.length,_n,"",Ue),Oe(ae)}else{do{const{chunk:Ue,encoding:_n,callback:wn}=Y[_e];Y[_e++]=null;const Tn=$?1:Ue.length;vn(ie,ae,!1,Tn,Ue,_n,wn)}while(_e<Y.length&&!ae.writing);_e===Y.length?Oe(ae):_e>256?(Y.splice(0,_e),ae.bufferedIndex=0):ae.bufferedIndex=_e}ae.bufferProcessing=!1}Et.prototype._write=function(ie,ae,Y){if(this._writev)this._writev([{chunk:ie,encoding:ae}],Y);else throw new O("_write()")},Et.prototype._writev=null,Et.prototype.end=function(ie,ae,Y){const k=this._writableState;typeof ie=="function"?(Y=ie,ie=null,ae=null):typeof ae=="function"&&(Y=ae,ae=null);let $;if(ie!=null){const oe=he(this,ie,ae);oe instanceof d&&($=oe)}return k.corked&&(k.corked=1,this.uncork()),$||(!k.errored&&!k.ending?(k.ending=!0,xe(this,k,!0),k.ended=!0):k.finished?$=new V("end"):k.destroyed&&($=new z("end"))),typeof Y=="function"&&($||k.finished?u.nextTick(Y,$):k[$e].push(Y)),this};function Ie(ie){return ie.ending&&!ie.destroyed&&ie.constructed&&ie.length===0&&!ie.errored&&ie.buffered.length===0&&!ie.finished&&!ie.writing&&!ie.errorEmitted&&!ie.closeEmitted}function de(ie,ae){let Y=!1;function k($){if(Y){le(ie,$??re());return}if(Y=!0,ae.pendingcb--,$){const oe=ae[$e].splice(0);for(let _e=0;_e<oe.length;_e++)oe[_e]($);le(ie,$,ae.sync)}else Ie(ae)&&(ae.prefinished=!0,ie.emit("prefinish"),ae.pendingcb++,u.nextTick(Ne,ie,ae))}ae.sync=!0,ae.pendingcb++;try{ie._final(k)}catch($){k($)}ae.sync=!1}function ze(ie,ae){!ae.prefinished&&!ae.finalCalled&&(typeof ie._final=="function"&&!ae.destroyed?(ae.finalCalled=!0,de(ie,ae)):(ae.prefinished=!0,ie.emit("prefinish")))}function xe(ie,ae,Y){Ie(ae)&&(ze(ie,ae),ae.pendingcb===0&&(Y?(ae.pendingcb++,u.nextTick((k,$)=>{Ie($)?Ne(k,$):$.pendingcb--},ie,ae)):Ie(ae)&&(ae.pendingcb++,Ne(ie,ae))))}function Ne(ie,ae){ae.pendingcb--,ae.finished=!0;const Y=ae[$e].splice(0);for(let k=0;k<Y.length;k++)Y[k]();if(ie.emit("finish"),ae.autoDestroy){const k=ie._readableState;(!k||k.autoDestroy&&(k.endEmitted||k.readable===!1))&&ie.destroy()}}y(Et.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ie){this._writableState&&(this._writableState.destroyed=ie)}},writable:{__proto__:null,get(){const ie=this._writableState;return!!ie&&ie.writable!==!1&&!ie.destroyed&&!ie.errored&&!ie.ending&&!ie.ended},set(ie){this._writableState&&(this._writableState.writable=!!ie)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ie=this._writableState;return ie?!ie.destroyed&&!ie.ending&&ie.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Lt=S.destroy;Et.prototype.destroy=function(ie,ae){const Y=this._writableState;return!Y.destroyed&&(Y.bufferedIndex<Y.buffered.length||Y[$e].length)&&u.nextTick(hn,Y),Lt.call(this,ie,ae),this},Et.prototype._undestroy=S.undestroy,Et.prototype._destroy=function(ie,ae){ae(ie)},Et.prototype[b.captureRejectionSymbol]=function(ie){this.destroy(ie)};let Dt;function Cn(){return Dt===void 0&&(Dt={}),Dt}Et.fromWeb=function(ie,ae){return Cn().newStreamWritableFromWritableStream(ie,ae)},Et.toWeb=function(ie){return Cn().newWritableStreamFromStreamWritable(ie)}},{"../../ours/errors":126,"../../ours/primordials":127,"./add-abort-signal":107,"./destroy":110,"./duplex":111,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102}],124:[function(n,o,a){const{ArrayIsArray:u,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:d,ArrayPrototypeMap:f,NumberIsInteger:h,NumberIsNaN:y,NumberMAX_SAFE_INTEGER:g,NumberMIN_SAFE_INTEGER:p,NumberParseInt:v,ObjectPrototypeHasOwnProperty:_,RegExpPrototypeExec:b,String:A,StringPrototypeToUpperCase:w,StringPrototypeTrim:S}=n("../ours/primordials"),{hideStackFrames:T,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:M,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:O,ERR_UNKNOWN_SIGNAL:re}}=n("../ours/errors"),{normalizeEncoding:D}=n("../ours/util"),{isAsyncFunction:z,isArrayBufferView:V}=n("../ours/util").types,j={};function F(oe){return oe===(oe|0)}function Ce(oe){return oe===oe>>>0}const le=/^[0-7]+$/,pe="must be a 32-bit unsigned integer or an octal string";function $e(oe,_e,Ue){if(typeof oe>"u"&&(oe=Ue),typeof oe=="string"){if(b(le,oe)===null)throw new L(_e,oe,pe);oe=v(oe,8)}return Et(oe,_e),oe}const Fe=T((oe,_e,Ue=p,_n=g)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);if(oe<Ue||oe>_n)throw new O(_e,`>= ${Ue} && <= ${_n}`,oe)}),Oe=T((oe,_e,Ue=-2147483648,_n=2147483647)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);if(oe<Ue||oe>_n)throw new O(_e,`>= ${Ue} && <= ${_n}`,oe)}),Et=T((oe,_e,Ue=!1)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);const _n=Ue?1:0,wn=4294967295;if(oe<_n||oe>wn)throw new O(_e,`>= ${_n} && <= ${wn}`,oe)});function he(oe,_e){if(typeof oe!="string")throw new M(_e,"string",oe)}function In(oe,_e,Ue=void 0,_n){if(typeof oe!="number")throw new M(_e,"number",oe);if(Ue!=null&&oe<Ue||_n!=null&&oe>_n||(Ue!=null||_n!=null)&&y(oe))throw new O(_e,`${Ue!=null?`>= ${Ue}`:""}${Ue!=null&&_n!=null?" && ":""}${_n!=null?`<= ${_n}`:""}`,oe)}const vn=T((oe,_e,Ue)=>{if(!c(Ue,oe)){const wn="must be one of: "+d(f(Ue,Tn=>typeof Tn=="string"?`'${Tn}'`:A(Tn)),", ");throw new L(_e,oe,wn)}});function kt(oe,_e){if(typeof oe!="boolean")throw new M(_e,"boolean",oe)}function ue(oe,_e,Ue){return oe==null||!_(oe,_e)?Ue:oe[_e]}const At=T((oe,_e,Ue=null)=>{const _n=ue(Ue,"allowArray",!1),wn=ue(Ue,"allowFunction",!1);if(!ue(Ue,"nullable",!1)&&oe===null||!_n&&u(oe)||typeof oe!="object"&&(!wn||typeof oe!="function"))throw new M(_e,"Object",oe)}),jt=T((oe,_e)=>{if(oe!=null&&typeof oe!="object"&&typeof oe!="function")throw new M(_e,"a dictionary",oe)}),hn=T((oe,_e,Ue=0)=>{if(!u(oe))throw new M(_e,"Array",oe);if(oe.length<Ue){const _n=`must be longer than ${Ue}`;throw new L(_e,oe,_n)}});function Pt(oe,_e){hn(oe,_e);for(let Ue=0;Ue<oe.length;Ue++)he(oe[Ue],`${_e}[${Ue}]`)}function Ie(oe,_e){hn(oe,_e);for(let Ue=0;Ue<oe.length;Ue++)kt(oe[Ue],`${_e}[${Ue}]`)}function de(oe,_e="signal"){if(he(oe,_e),j[oe]===void 0)throw j[w(oe)]!==void 0?new re(oe+" (signals must use all capital letters)"):new re(oe)}const ze=T((oe,_e="buffer")=>{if(!V(oe))throw new M(_e,["Buffer","TypedArray","DataView"],oe)});function xe(oe,_e){const Ue=D(_e),_n=oe.length;if(Ue==="hex"&&_n%2!==0)throw new L("encoding",_e,`is invalid for data of length ${_n}`)}function Ne(oe,_e="Port",Ue=!0){if(typeof oe!="number"&&typeof oe!="string"||typeof oe=="string"&&S(oe).length===0||+oe!==+oe>>>0||oe>65535||oe===0&&!Ue)throw new x(_e,oe,Ue);return oe|0}const Lt=T((oe,_e)=>{if(oe!==void 0&&(oe===null||typeof oe!="object"||!("aborted"in oe)))throw new M(_e,"AbortSignal",oe)}),Dt=T((oe,_e)=>{if(typeof oe!="function")throw new M(_e,"Function",oe)}),Cn=T((oe,_e)=>{if(typeof oe!="function"||z(oe))throw new M(_e,"Function",oe)}),ie=T((oe,_e)=>{if(oe!==void 0)throw new M(_e,"undefined",oe)});function ae(oe,_e,Ue){if(!c(Ue,oe))throw new M(_e,`('${d(Ue,"|")}')`,oe)}const Y=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function k(oe,_e){if(typeof oe>"u"||!b(Y,oe))throw new L(_e,oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function $(oe){if(typeof oe=="string")return k(oe,"hints"),oe;if(u(oe)){const _e=oe.length;let Ue="";if(_e===0)return Ue;for(let _n=0;_n<_e;_n++){const wn=oe[_n];k(wn,"hints"),Ue+=wn,_n!==_e-1&&(Ue+=", ")}return Ue}throw new L("hints",oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o.exports={isInt32:F,isUint32:Ce,parseFileMode:$e,validateArray:hn,validateStringArray:Pt,validateBooleanArray:Ie,validateBoolean:kt,validateBuffer:ze,validateDictionary:jt,validateEncoding:xe,validateFunction:Dt,validateInt32:Oe,validateInteger:Fe,validateNumber:In,validateObject:At,validateOneOf:vn,validatePlainFunction:Cn,validatePort:Ne,validateSignalName:de,validateString:he,validateUint32:Et,validateUndefined:ie,validateUnion:ae,validateAbortSignal:Lt,validateLinkHeaderValue:$}},{"../ours/errors":126,"../ours/primordials":127,"../ours/util":128}],125:[function(n,o,a){const u=n("../stream"),c=n("../stream/promises"),d=u.Readable.destroy;o.exports=u.Readable,o.exports._uint8ArrayToBuffer=u._uint8ArrayToBuffer,o.exports._isUint8Array=u._isUint8Array,o.exports.isDisturbed=u.isDisturbed,o.exports.isErrored=u.isErrored,o.exports.isReadable=u.isReadable,o.exports.Readable=u.Readable,o.exports.Writable=u.Writable,o.exports.Duplex=u.Duplex,o.exports.Transform=u.Transform,o.exports.PassThrough=u.PassThrough,o.exports.addAbortSignal=u.addAbortSignal,o.exports.finished=u.finished,o.exports.destroy=u.destroy,o.exports.destroy=d,o.exports.pipeline=u.pipeline,o.exports.compose=u.compose,Object.defineProperty(u,"promises",{configurable:!0,enumerable:!0,get(){return c}}),o.exports.Stream=u.Stream,o.exports.default=o.exports},{"../stream":129,"../stream/promises":130}],126:[function(n,o,a){const{format:u,inspect:c,AggregateError:d}=n("./util"),f=globalThis.AggregateError||d,h=Symbol("kIsNodeError"),y=["string","function","number","object","Function","Object","boolean","bigint","symbol"],g=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",v={};function _(M,L){if(!M)throw new v.ERR_INTERNAL_ASSERTION(L)}function b(M){let L="",O=M.length;const re=M[0]==="-"?1:0;for(;O>=re+4;O-=3)L=`_${M.slice(O-3,O)}${L}`;return`${M.slice(0,O)}${L}`}function A(M,L,O){if(typeof L=="function")return _(L.length<=O.length,`Code: ${M}; The provided arguments length (${O.length}) does not match the required ones (${L.length}).`),L(...O);const re=(L.match(/%[dfijoOs]/g)||[]).length;return _(re===O.length,`Code: ${M}; The provided arguments length (${O.length}) does not match the required ones (${re}).`),O.length===0?L:u(L,...O)}function w(M,L,O){O||(O=Error);class re extends O{constructor(...z){super(A(M,L,z))}toString(){return`${this.name} [${M}]: ${this.message}`}}Object.defineProperties(re.prototype,{name:{value:O.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${M}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),re.prototype.code=M,re.prototype[h]=!0,v[M]=re}function S(M){const L=p+M.name;return Object.defineProperty(M,"name",{value:L}),M}function T(M,L){if(M&&L&&M!==L){if(Array.isArray(L.errors))return L.errors.push(M),L;const O=new f([L,M],L.message);return O.code=L.code,O}return M||L}class x extends Error{constructor(L="The operation was aborted",O=void 0){if(O!==void 0&&typeof O!="object")throw new v.ERR_INVALID_ARG_TYPE("options","Object",O);super(L,O),this.code="ABORT_ERR",this.name="AbortError"}}w("ERR_ASSERTION","%s",Error),w("ERR_INVALID_ARG_TYPE",(M,L,O)=>{_(typeof M=="string","'name' must be a string"),Array.isArray(L)||(L=[L]);let re="The ";M.endsWith(" argument")?re+=`${M} `:re+=`"${M}" ${M.includes(".")?"property":"argument"} `,re+="must be ";const D=[],z=[],V=[];for(const F of L)_(typeof F=="string","All expected entries have to be of type string"),y.includes(F)?D.push(F.toLowerCase()):g.test(F)?z.push(F):(_(F!=="object",'The value "object" should be written as "Object"'),V.push(F));if(z.length>0){const F=D.indexOf("object");F!==-1&&(D.splice(D,F,1),z.push("Object"))}if(D.length>0){switch(D.length){case 1:re+=`of type ${D[0]}`;break;case 2:re+=`one of type ${D[0]} or ${D[1]}`;break;default:{const F=D.pop();re+=`one of type ${D.join(", ")}, or ${F}`}}(z.length>0||V.length>0)&&(re+=" or ")}if(z.length>0){switch(z.length){case 1:re+=`an instance of ${z[0]}`;break;case 2:re+=`an instance of ${z[0]} or ${z[1]}`;break;default:{const F=z.pop();re+=`an instance of ${z.join(", ")}, or ${F}`}}V.length>0&&(re+=" or ")}switch(V.length){case 0:break;case 1:V[0].toLowerCase()!==V[0]&&(re+="an "),re+=`${V[0]}`;break;case 2:re+=`one of ${V[0]} or ${V[1]}`;break;default:{const F=V.pop();re+=`one of ${V.join(", ")}, or ${F}`}}if(O==null)re+=`. Received ${O}`;else if(typeof O=="function"&&O.name)re+=`. Received function ${O.name}`;else if(typeof O=="object"){var j;if((j=O.constructor)!==null&&j!==void 0&&j.name)re+=`. Received an instance of ${O.constructor.name}`;else{const F=c(O,{depth:-1});re+=`. Received ${F}`}}else{let F=c(O,{colors:!1});F.length>25&&(F=`${F.slice(0,25)}...`),re+=`. Received type ${typeof O} (${F})`}return re},TypeError),w("ERR_INVALID_ARG_VALUE",(M,L,O="is invalid")=>{let re=c(L);return re.length>128&&(re=re.slice(0,128)+"..."),`The ${M.includes(".")?"property":"argument"} '${M}' ${O}. Received ${re}`},TypeError),w("ERR_INVALID_RETURN_VALUE",(M,L,O)=>{var re;const D=O!=null&&(re=O.constructor)!==null&&re!==void 0&&re.name?`instance of ${O.constructor.name}`:`type ${typeof O}`;return`Expected ${M} to be returned from the "${L}" function but got ${D}.`},TypeError),w("ERR_MISSING_ARGS",(...M)=>{_(M.length>0,"At least one arg needs to be specified");let L;const O=M.length;switch(M=(Array.isArray(M)?M:[M]).map(re=>`"${re}"`).join(" or "),O){case 1:L+=`The ${M[0]} argument`;break;case 2:L+=`The ${M[0]} and ${M[1]} arguments`;break;default:{const re=M.pop();L+=`The ${M.join(", ")}, and ${re} arguments`}break}return`${L} must be specified`},TypeError),w("ERR_OUT_OF_RANGE",(M,L,O)=>{_(L,'Missing "range" argument');let re;return Number.isInteger(O)&&Math.abs(O)>2**32?re=b(String(O)):typeof O=="bigint"?(re=String(O),(O>2n**32n||O<-(2n**32n))&&(re=b(re)),re+="n"):re=c(O),`The value of "${M}" is out of range. It must be ${L}. Received ${re}`},RangeError),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),w("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),w("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),w("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),w("ERR_STREAM_WRITE_AFTER_END","write after end",Error),w("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),o.exports={AbortError:x,aggregateTwoErrors:S(T),hideStackFrames:S,codes:v}},{"./util":128}],127:[function(n,o,a){o.exports={ArrayIsArray(u){return Array.isArray(u)},ArrayPrototypeIncludes(u,c){return u.includes(c)},ArrayPrototypeIndexOf(u,c){return u.indexOf(c)},ArrayPrototypeJoin(u,c){return u.join(c)},ArrayPrototypeMap(u,c){return u.map(c)},ArrayPrototypePop(u,c){return u.pop(c)},ArrayPrototypePush(u,c){return u.push(c)},ArrayPrototypeSlice(u,c,d){return u.slice(c,d)},Error,FunctionPrototypeCall(u,c,...d){return u.call(c,...d)},FunctionPrototypeSymbolHasInstance(u,c){return Function.prototype[Symbol.hasInstance].call(u,c)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(u,c){return Object.defineProperties(u,c)},ObjectDefineProperty(u,c,d){return Object.defineProperty(u,c,d)},ObjectGetOwnPropertyDescriptor(u,c){return Object.getOwnPropertyDescriptor(u,c)},ObjectKeys(u){return Object.keys(u)},ObjectSetPrototypeOf(u,c){return Object.setPrototypeOf(u,c)},Promise,PromisePrototypeCatch(u,c){return u.catch(c)},PromisePrototypeThen(u,c,d){return u.then(c,d)},PromiseReject(u){return Promise.reject(u)},ReflectApply:Reflect.apply,RegExpPrototypeTest(u,c){return u.test(c)},SafeSet:Set,String,StringPrototypeSlice(u,c,d){return u.slice(c,d)},StringPrototypeToLowerCase(u){return u.toLowerCase()},StringPrototypeToUpperCase(u){return u.toUpperCase()},StringPrototypeTrim(u){return u.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(u,c,d){return u.set(c,d)},Uint8Array}},{}],128:[function(n,o,a){const u=n("buffer"),c=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||u.Blob,f=typeof d<"u"?function(g){return g instanceof d}:function(g){return!1};class h extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let p="";for(let v=0;v<g.length;v++)p+=` ${g[v].stack}
272
+ `,CONTEXT_STYLE=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function calculateNodeStyling(i){const r=window.getComputedStyle(i),n=r.getPropertyValue("box-sizing"),o=Number.parseFloat(r.getPropertyValue("padding-bottom"))+Number.parseFloat(r.getPropertyValue("padding-top")),a=Number.parseFloat(r.getPropertyValue("border-bottom-width"))+Number.parseFloat(r.getPropertyValue("border-top-width"));return{contextStyle:CONTEXT_STYLE.map(c=>`${c}:${r.getPropertyValue(c)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:n}}function calcTextareaHeight(i,r=1,n){var o;hiddenTextarea||(hiddenTextarea=document.createElement("textarea"),document.body.appendChild(hiddenTextarea));const{paddingSize:a,borderSize:u,boxSizing:c,contextStyle:d}=calculateNodeStyling(i);hiddenTextarea.setAttribute("style",`${d};${HIDDEN_STYLE}`),hiddenTextarea.value=i.value||i.placeholder||"";let f=hiddenTextarea.scrollHeight;const h={};c==="border-box"?f=f+u:c==="content-box"&&(f=f-a),hiddenTextarea.value="";const y=hiddenTextarea.scrollHeight-a;if(isNumber(r)){let g=y*r;c==="border-box"&&(g=g+a+u),f=Math.max(g,f),h.minHeight=`${g}px`}if(isNumber(n)){let g=y*n;c==="border-box"&&(g=g+a+u),f=Math.min(g,f)}return h.height=`${f}px`,(o=hiddenTextarea.parentNode)==null||o.removeChild(hiddenTextarea),hiddenTextarea=void 0,h}const inputProps=buildProps({id:{type:String,default:void 0},size:useSizeProp,disabled:Boolean,modelValue:{type:definePropType([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:definePropType([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:iconPropType},prefixIcon:{type:iconPropType},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:definePropType([Object,Array,String]),default:()=>mutable({})},autofocus:Boolean,rows:{type:Number,default:2},...useAriaProps(["ariaLabel"])}),inputEmits={[UPDATE_MODEL_EVENT]:i=>isString(i),input:i=>isString(i),change:i=>isString(i),focus:i=>i instanceof FocusEvent,blur:i=>i instanceof FocusEvent,clear:()=>!0,mouseleave:i=>i instanceof MouseEvent,mouseenter:i=>i instanceof MouseEvent,keydown:i=>i instanceof Event,compositionstart:i=>i instanceof CompositionEvent,compositionupdate:i=>i instanceof CompositionEvent,compositionend:i=>i instanceof CompositionEvent},__default__$9=vue.defineComponent({name:"ElInput",inheritAttrs:!1}),_sfc_main$p=vue.defineComponent({...__default__$9,props:inputProps,emits:inputEmits,setup(i,{expose:r,emit:n}){const o=i,a=vue.useAttrs(),u=vue.useSlots(),c=vue.computed(()=>{const Ue={};return o.containerRole==="combobox"&&(Ue["aria-haspopup"]=a["aria-haspopup"],Ue["aria-owns"]=a["aria-owns"],Ue["aria-expanded"]=a["aria-expanded"]),Ue}),d=vue.computed(()=>[o.type==="textarea"?A.b():b.b(),b.m(v.value),b.is("disabled",_.value),b.is("exceed",vn.value),{[b.b("group")]:u.prepend||u.append,[b.m("prefix")]:u.prefix||o.prefixIcon,[b.m("suffix")]:u.suffix||o.suffixIcon||o.clearable||o.showPassword,[b.bm("suffix","password-clear")]:Oe.value&&Et.value,[b.b("hidden")]:o.type==="hidden"},a.class]),f=vue.computed(()=>[b.e("wrapper"),b.is("focus",D.value)]),h=useAttrs({excludeKeys:vue.computed(()=>Object.keys(c.value))}),{form:y,formItem:g}=useFormItem(),{inputId:p}=useFormItemInputId(o,{formItemContext:g}),v=useFormSize(),_=useFormDisabled(),b=useNamespace("input"),A=useNamespace("textarea"),w=vue.shallowRef(),S=vue.shallowRef(),T=vue.ref(!1),x=vue.ref(!1),M=vue.ref(),L=vue.shallowRef(o.inputStyle),O=vue.computed(()=>w.value||S.value),{wrapperRef:re,isFocused:D,handleFocus:z,handleBlur:V}=useFocusController(O,{beforeFocus(){return _.value},afterBlur(){var Ue;o.validateEvent&&((Ue=g==null?void 0:g.validate)==null||Ue.call(g,"blur").catch(_n=>debugWarn(_n)))}}),j=vue.computed(()=>{var Ue;return(Ue=y==null?void 0:y.statusIcon)!=null?Ue:!1}),F=vue.computed(()=>(g==null?void 0:g.validateState)||""),Ce=vue.computed(()=>F.value&&ValidateComponentsMap[F.value]),le=vue.computed(()=>x.value?view_default:hide_default),pe=vue.computed(()=>[a.style]),$e=vue.computed(()=>[o.inputStyle,L.value,{resize:o.resize}]),Fe=vue.computed(()=>lodashEs.isNil(o.modelValue)?"":String(o.modelValue)),Oe=vue.computed(()=>o.clearable&&!_.value&&!o.readonly&&!!Fe.value&&(D.value||T.value)),Et=vue.computed(()=>o.showPassword&&!_.value&&!!Fe.value&&(!!Fe.value||D.value)),he=vue.computed(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!_.value&&!o.readonly&&!o.showPassword),In=vue.computed(()=>Fe.value.length),vn=vue.computed(()=>!!he.value&&In.value>Number(o.maxlength)),kt=vue.computed(()=>!!u.suffix||!!o.suffixIcon||Oe.value||o.showPassword||he.value||!!F.value&&j.value),[ue,At]=useCursor(w);useResizeObserver(S,Ue=>{if(Pt(),!he.value||o.resize!=="both")return;const _n=Ue[0],{width:wn}=_n.contentRect;M.value={right:`calc(100% - ${wn+15+6}px)`}});const jt=()=>{const{type:Ue,autosize:_n}=o;if(!(!isClient||Ue!=="textarea"||!S.value))if(_n){const wn=isObject(_n)?_n.minRows:void 0,Tn=isObject(_n)?_n.maxRows:void 0,Ln=calcTextareaHeight(S.value,wn,Tn);L.value={overflowY:"hidden",...Ln},vue.nextTick(()=>{S.value.offsetHeight,L.value=Ln})}else L.value={minHeight:calcTextareaHeight(S.value).minHeight}},Pt=(Ue=>{let _n=!1;return()=>{var wn;if(_n||!o.autosize)return;((wn=S.value)==null?void 0:wn.offsetParent)===null||(Ue(),_n=!0)}})(jt),Ie=()=>{const Ue=O.value,_n=o.formatter?o.formatter(Fe.value):Fe.value;!Ue||Ue.value===_n||(Ue.value=_n)},de=async Ue=>{ue();let{value:_n}=Ue.target;if(o.formatter&&(_n=o.parser?o.parser(_n):_n),!xe.value){if(_n===Fe.value){Ie();return}n(UPDATE_MODEL_EVENT,_n),n("input",_n),await vue.nextTick(),Ie(),At()}},ze=Ue=>{n("change",Ue.target.value)},{isComposing:xe,handleCompositionStart:Ne,handleCompositionUpdate:Lt,handleCompositionEnd:Dt}=useComposition({emit:n,afterComposition:de}),Cn=()=>{x.value=!x.value,ie()},ie=async()=>{var Ue;await vue.nextTick(),(Ue=O.value)==null||Ue.focus()},ae=()=>{var Ue;return(Ue=O.value)==null?void 0:Ue.blur()},Y=Ue=>{T.value=!1,n("mouseleave",Ue)},k=Ue=>{T.value=!0,n("mouseenter",Ue)},$=Ue=>{n("keydown",Ue)},oe=()=>{var Ue;(Ue=O.value)==null||Ue.select()},_e=()=>{n(UPDATE_MODEL_EVENT,""),n("change",""),n("clear"),n("input","")};return vue.watch(()=>o.modelValue,()=>{var Ue;vue.nextTick(()=>jt()),o.validateEvent&&((Ue=g==null?void 0:g.validate)==null||Ue.call(g,"change").catch(_n=>debugWarn(_n)))}),vue.watch(Fe,()=>Ie()),vue.watch(()=>o.type,async()=>{await vue.nextTick(),Ie(),jt()}),vue.onMounted(()=>{!o.formatter&&o.parser&&debugWarn("ElInput","If you set the parser, you also need to set the formatter."),Ie(),vue.nextTick(jt)}),r({input:w,textarea:S,ref:O,textareaStyle:$e,autosize:vue.toRef(o,"autosize"),isComposing:xe,focus:ie,blur:ae,select:oe,clear:_e,resizeTextarea:jt}),(Ue,_n)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps(vue.unref(c),{class:[vue.unref(d),{[vue.unref(b).bm("group","append")]:Ue.$slots.append,[vue.unref(b).bm("group","prepend")]:Ue.$slots.prepend}],style:vue.unref(pe),role:Ue.containerRole,onMouseenter:k,onMouseleave:Y}),[vue.createCommentVNode(" input "),Ue.type!=="textarea"?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.createCommentVNode(" prepend slot "),Ue.$slots.prepend?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(vue.unref(b).be("group","prepend"))},[vue.renderSlot(Ue.$slots,"prepend")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref_key:"wrapperRef",ref:re,class:vue.normalizeClass(vue.unref(f))},[vue.createCommentVNode(" prefix slot "),Ue.$slots.prefix||Ue.prefixIcon?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(b).e("prefix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("prefix-inner"))},[vue.renderSlot(Ue.$slots,"prefix"),Ue.prefixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ue.prefixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("input",vue.mergeProps({id:vue.unref(p),ref_key:"input",ref:w,class:vue.unref(b).e("inner")},vue.unref(h),{minlength:Ue.minlength,maxlength:Ue.maxlength,type:Ue.showPassword?x.value?"text":"password":Ue.type,disabled:vue.unref(_),readonly:Ue.readonly,autocomplete:Ue.autocomplete,tabindex:Ue.tabindex,"aria-label":Ue.ariaLabel,placeholder:Ue.placeholder,style:Ue.inputStyle,form:Ue.form,autofocus:Ue.autofocus,onCompositionstart:vue.unref(Ne),onCompositionupdate:vue.unref(Lt),onCompositionend:vue.unref(Dt),onInput:de,onChange:ze,onKeydown:$}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),vue.createCommentVNode(" suffix slot "),vue.unref(kt)?(vue.openBlock(),vue.createElementBlock("span",{key:1,class:vue.normalizeClass(vue.unref(b).e("suffix"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("suffix-inner"))},[!vue.unref(Oe)||!vue.unref(Et)||!vue.unref(he)?(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:0},[vue.renderSlot(Ue.$slots,"suffix"),Ue.suffixIcon?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(b).e("icon"))},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(Ue.suffixIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],64)):vue.createCommentVNode("v-if",!0),vue.unref(Oe)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:1,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("clear")]),onMousedown:vue.withModifiers(vue.unref(NOOP),["prevent"]),onClick:_e},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(circle_close_default))]),_:1},8,["class","onMousedown"])):vue.createCommentVNode("v-if",!0),vue.unref(Et)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:2,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("password")]),onClick:Cn},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(le))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),vue.unref(he)?(vue.openBlock(),vue.createElementBlock("span",{key:3,class:vue.normalizeClass(vue.unref(b).e("count"))},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(b).e("count-inner"))},vue.toDisplayString(vue.unref(In))+" / "+vue.toDisplayString(Ue.maxlength),3)],2)):vue.createCommentVNode("v-if",!0),vue.unref(F)&&vue.unref(Ce)&&vue.unref(j)?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:4,class:vue.normalizeClass([vue.unref(b).e("icon"),vue.unref(b).e("validateIcon"),vue.unref(b).is("loading",vue.unref(F)==="validating")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(vue.unref(Ce))))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],2)):vue.createCommentVNode("v-if",!0)],2),vue.createCommentVNode(" append slot "),Ue.$slots.append?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(vue.unref(b).be("group","append"))},[vue.renderSlot(Ue.$slots,"append")],2)):vue.createCommentVNode("v-if",!0)],64)):(vue.openBlock(),vue.createElementBlock(vue.Fragment,{key:1},[vue.createCommentVNode(" textarea "),vue.createElementVNode("textarea",vue.mergeProps({id:vue.unref(p),ref_key:"textarea",ref:S,class:[vue.unref(A).e("inner"),vue.unref(b).is("focus",vue.unref(D))]},vue.unref(h),{minlength:Ue.minlength,maxlength:Ue.maxlength,tabindex:Ue.tabindex,disabled:vue.unref(_),readonly:Ue.readonly,autocomplete:Ue.autocomplete,style:vue.unref($e),"aria-label":Ue.ariaLabel,placeholder:Ue.placeholder,form:Ue.form,autofocus:Ue.autofocus,rows:Ue.rows,onCompositionstart:vue.unref(Ne),onCompositionupdate:vue.unref(Lt),onCompositionend:vue.unref(Dt),onInput:de,onFocus:vue.unref(z),onBlur:vue.unref(V),onChange:ze,onKeydown:$}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),vue.unref(he)?(vue.openBlock(),vue.createElementBlock("span",{key:0,style:vue.normalizeStyle(M.value),class:vue.normalizeClass(vue.unref(b).e("count"))},vue.toDisplayString(vue.unref(In))+" / "+vue.toDisplayString(Ue.maxlength),7)):vue.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var Input=_export_sfc(_sfc_main$p,[["__file","input.vue"]]);const ElInput=withInstall(Input),GAP=4,BAR_MAP={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},renderThumbStyle=({move:i,size:r,bar:n})=>({[n.size]:r,transform:`translate${n.axis}(${i}%)`}),scrollbarContextKey=Symbol("scrollbarContextKey"),thumbProps=buildProps({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),COMPONENT_NAME$2="Thumb",_sfc_main$o=vue.defineComponent({__name:"thumb",props:thumbProps,setup(i){const r=i,n=vue.inject(scrollbarContextKey),o=useNamespace("scrollbar");n||throwError(COMPONENT_NAME$2,"can not inject scrollbar context");const a=vue.ref(),u=vue.ref(),c=vue.ref({}),d=vue.ref(!1);let f=!1,h=!1,y=isClient?document.onselectstart:null;const g=vue.computed(()=>BAR_MAP[r.vertical?"vertical":"horizontal"]),p=vue.computed(()=>renderThumbStyle({size:r.size,move:r.move,bar:g.value})),v=vue.computed(()=>a.value[g.value.offset]**2/n.wrapElement[g.value.scrollSize]/r.ratio/u.value[g.value.offset]),_=L=>{var O;if(L.stopPropagation(),L.ctrlKey||[1,2].includes(L.button))return;(O=window.getSelection())==null||O.removeAllRanges(),A(L);const re=L.currentTarget;re&&(c.value[g.value.axis]=re[g.value.offset]-(L[g.value.client]-re.getBoundingClientRect()[g.value.direction]))},b=L=>{if(!u.value||!a.value||!n.wrapElement)return;const O=Math.abs(L.target.getBoundingClientRect()[g.value.direction]-L[g.value.client]),re=u.value[g.value.offset]/2,D=(O-re)*100*v.value/a.value[g.value.offset];n.wrapElement[g.value.scroll]=D*n.wrapElement[g.value.scrollSize]/100},A=L=>{L.stopImmediatePropagation(),f=!0,document.addEventListener("mousemove",w),document.addEventListener("mouseup",S),y=document.onselectstart,document.onselectstart=()=>!1},w=L=>{if(!a.value||!u.value||f===!1)return;const O=c.value[g.value.axis];if(!O)return;const re=(a.value.getBoundingClientRect()[g.value.direction]-L[g.value.client])*-1,D=u.value[g.value.offset]-O,z=(re-D)*100*v.value/a.value[g.value.offset];n.wrapElement[g.value.scroll]=z*n.wrapElement[g.value.scrollSize]/100},S=()=>{f=!1,c.value[g.value.axis]=0,document.removeEventListener("mousemove",w),document.removeEventListener("mouseup",S),M(),h&&(d.value=!1)},T=()=>{h=!1,d.value=!!r.size},x=()=>{h=!0,d.value=f};vue.onBeforeUnmount(()=>{M(),document.removeEventListener("mouseup",S)});const M=()=>{document.onselectstart!==y&&(document.onselectstart=y)};return useEventListener(vue.toRef(n,"scrollbarElement"),"mousemove",T),useEventListener(vue.toRef(n,"scrollbarElement"),"mouseleave",x),(L,O)=>(vue.openBlock(),vue.createBlock(vue.Transition,{name:vue.unref(o).b("fade"),persisted:""},{default:vue.withCtx(()=>[vue.withDirectives(vue.createElementVNode("div",{ref_key:"instance",ref:a,class:vue.normalizeClass([vue.unref(o).e("bar"),vue.unref(o).is(vue.unref(g).key)]),onMousedown:b},[vue.createElementVNode("div",{ref_key:"thumb",ref:u,class:vue.normalizeClass(vue.unref(o).e("thumb")),style:vue.normalizeStyle(vue.unref(p)),onMousedown:_},null,38)],34),[[vue.vShow,L.always||d.value]])]),_:1},8,["name"]))}});var Thumb=_export_sfc(_sfc_main$o,[["__file","thumb.vue"]]);const barProps=buildProps({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}}),_sfc_main$n=vue.defineComponent({__name:"bar",props:barProps,setup(i,{expose:r}){const n=i,o=vue.inject(scrollbarContextKey),a=vue.ref(0),u=vue.ref(0),c=vue.ref(""),d=vue.ref(""),f=vue.ref(1),h=vue.ref(1);return r({handleScroll:p=>{if(p){const v=p.offsetHeight-GAP,_=p.offsetWidth-GAP;u.value=p.scrollTop*100/v*f.value,a.value=p.scrollLeft*100/_*h.value}},update:()=>{const p=o==null?void 0:o.wrapElement;if(!p)return;const v=p.offsetHeight-GAP,_=p.offsetWidth-GAP,b=v**2/p.scrollHeight,A=_**2/p.scrollWidth,w=Math.max(b,n.minSize),S=Math.max(A,n.minSize);f.value=b/(v-b)/(w/(v-w)),h.value=A/(_-A)/(S/(_-S)),d.value=w+GAP<v?`${w}px`:"",c.value=S+GAP<_?`${S}px`:""}}),(p,v)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(Thumb,{move:a.value,ratio:h.value,size:c.value,always:p.always},null,8,["move","ratio","size","always"]),vue.createVNode(Thumb,{move:u.value,ratio:f.value,size:d.value,vertical:"",always:p.always},null,8,["move","ratio","size","always"])],64))}});var Bar=_export_sfc(_sfc_main$n,[["__file","bar.vue"]]);const scrollbarProps=buildProps({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:definePropType([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...useAriaProps(["ariaLabel","ariaOrientation"])}),scrollbarEmits={scroll:({scrollTop:i,scrollLeft:r})=>[i,r].every(isNumber)},COMPONENT_NAME$1="ElScrollbar",__default__$8=vue.defineComponent({name:COMPONENT_NAME$1}),_sfc_main$m=vue.defineComponent({...__default__$8,props:scrollbarProps,emits:scrollbarEmits,setup(i,{expose:r,emit:n}){const o=i,a=useNamespace("scrollbar");let u,c,d=0,f=0;const h=vue.ref(),y=vue.ref(),g=vue.ref(),p=vue.ref(),v=vue.computed(()=>{const M={};return o.height&&(M.height=addUnit(o.height)),o.maxHeight&&(M.maxHeight=addUnit(o.maxHeight)),[o.wrapStyle,M]}),_=vue.computed(()=>[o.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!o.native}]),b=vue.computed(()=>[a.e("view"),o.viewClass]),A=()=>{var M;y.value&&((M=p.value)==null||M.handleScroll(y.value),d=y.value.scrollTop,f=y.value.scrollLeft,n("scroll",{scrollTop:y.value.scrollTop,scrollLeft:y.value.scrollLeft}))};function w(M,L){isObject(M)?y.value.scrollTo(M):isNumber(M)&&isNumber(L)&&y.value.scrollTo(M,L)}const S=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}y.value.scrollTop=M},T=M=>{if(!isNumber(M)){debugWarn(COMPONENT_NAME$1,"value must be a number");return}y.value.scrollLeft=M},x=()=>{var M;(M=p.value)==null||M.update()};return vue.watch(()=>o.noresize,M=>{M?(u==null||u(),c==null||c()):({stop:u}=useResizeObserver(g,x),c=useEventListener("resize",x))},{immediate:!0}),vue.watch(()=>[o.maxHeight,o.height],()=>{o.native||vue.nextTick(()=>{var M;x(),y.value&&((M=p.value)==null||M.handleScroll(y.value))})}),vue.provide(scrollbarContextKey,vue.reactive({scrollbarElement:h,wrapElement:y})),vue.onActivated(()=>{y.value&&(y.value.scrollTop=d,y.value.scrollLeft=f)}),vue.onMounted(()=>{o.native||vue.nextTick(()=>{x()})}),vue.onUpdated(()=>x()),r({wrapRef:y,update:x,scrollTo:w,setScrollTop:S,setScrollLeft:T,handleScroll:A}),(M,L)=>(vue.openBlock(),vue.createElementBlock("div",{ref_key:"scrollbarRef",ref:h,class:vue.normalizeClass(vue.unref(a).b())},[vue.createElementVNode("div",{ref_key:"wrapRef",ref:y,class:vue.normalizeClass(vue.unref(_)),style:vue.normalizeStyle(vue.unref(v)),tabindex:M.tabindex,onScroll:A},[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(M.tag),{id:M.id,ref_key:"resizeRef",ref:g,class:vue.normalizeClass(vue.unref(b)),style:vue.normalizeStyle(M.viewStyle),role:M.role,"aria-label":M.ariaLabel,"aria-orientation":M.ariaOrientation},{default:vue.withCtx(()=>[vue.renderSlot(M.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),M.native?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(Bar,{key:0,ref_key:"barRef",ref:p,always:M.always,"min-size":M.minSize},null,8,["always","min-size"]))],2))}});var Scrollbar=_export_sfc(_sfc_main$m,[["__file","scrollbar.vue"]]);const ElScrollbar=withInstall(Scrollbar),POPPER_INJECTION_KEY=Symbol("popper"),POPPER_CONTENT_INJECTION_KEY=Symbol("popperContent"),roleTypes=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],popperProps=buildProps({role:{type:String,values:roleTypes,default:"tooltip"}}),__default__$7=vue.defineComponent({name:"ElPopper",inheritAttrs:!1}),_sfc_main$l=vue.defineComponent({...__default__$7,props:popperProps,setup(i,{expose:r}){const n=i,o=vue.ref(),a=vue.ref(),u=vue.ref(),c=vue.ref(),d=vue.computed(()=>n.role),f={triggerRef:o,popperInstanceRef:a,contentRef:u,referenceRef:c,role:d};return r(f),vue.provide(POPPER_INJECTION_KEY,f),(h,y)=>vue.renderSlot(h.$slots,"default")}});var Popper=_export_sfc(_sfc_main$l,[["__file","popper.vue"]]);const popperArrowProps=buildProps({arrowOffset:{type:Number,default:5}}),__default__$6=vue.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),_sfc_main$k=vue.defineComponent({...__default__$6,props:popperArrowProps,setup(i,{expose:r}){const n=i,o=useNamespace("popper"),{arrowOffset:a,arrowRef:u,arrowStyle:c}=vue.inject(POPPER_CONTENT_INJECTION_KEY,void 0);return vue.watch(()=>n.arrowOffset,d=>{a.value=d}),vue.onBeforeUnmount(()=>{u.value=void 0}),r({arrowRef:u}),(d,f)=>(vue.openBlock(),vue.createElementBlock("span",{ref_key:"arrowRef",ref:u,class:vue.normalizeClass(vue.unref(o).e("arrow")),style:vue.normalizeStyle(vue.unref(c)),"data-popper-arrow":""},null,6))}});var ElPopperArrow=_export_sfc(_sfc_main$k,[["__file","arrow.vue"]]);const NAME="ElOnlyChild",OnlyChild=vue.defineComponent({name:NAME,setup(i,{slots:r,attrs:n}){var o;const a=vue.inject(FORWARD_REF_INJECTION_KEY),u=useForwardRefDirective((o=a==null?void 0:a.setForwardRef)!=null?o:NOOP);return()=>{var c;const d=(c=r.default)==null?void 0:c.call(r,n);if(!d)return null;if(d.length>1)return debugWarn(NAME,"requires exact only one valid child."),null;const f=findFirstLegitChild(d);return f?vue.withDirectives(vue.cloneVNode(f,n),[[u]]):(debugWarn(NAME,"no valid child node found"),null)}}});function findFirstLegitChild(i){if(!i)return null;const r=i;for(const n of r){if(isObject(n))switch(n.type){case vue.Comment:continue;case vue.Text:case"svg":return wrapTextContent(n);case vue.Fragment:return findFirstLegitChild(n.children);default:return n}return wrapTextContent(n)}return null}function wrapTextContent(i){const r=useNamespace("only-child");return vue.createVNode("span",{class:r.e("content")},[i])}const popperTriggerProps=buildProps({virtualRef:{type:definePropType(Object)},virtualTriggering:Boolean,onMouseenter:{type:definePropType(Function)},onMouseleave:{type:definePropType(Function)},onClick:{type:definePropType(Function)},onKeydown:{type:definePropType(Function)},onFocus:{type:definePropType(Function)},onBlur:{type:definePropType(Function)},onContextmenu:{type:definePropType(Function)},id:String,open:Boolean}),__default__$5=vue.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),_sfc_main$j=vue.defineComponent({...__default__$5,props:popperTriggerProps,setup(i,{expose:r}){const n=i,{role:o,triggerRef:a}=vue.inject(POPPER_INJECTION_KEY,void 0);useForwardRef(a);const u=vue.computed(()=>d.value?n.id:void 0),c=vue.computed(()=>{if(o&&o.value==="tooltip")return n.open&&n.id?n.id:void 0}),d=vue.computed(()=>{if(o&&o.value!=="tooltip")return o.value}),f=vue.computed(()=>d.value?`${n.open}`:void 0);let h;const y=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return vue.onMounted(()=>{vue.watch(()=>n.virtualRef,g=>{g&&(a.value=unrefElement(g))},{immediate:!0}),vue.watch(a,(g,p)=>{h==null||h(),h=void 0,isElement(g)&&(y.forEach(v=>{var _;const b=n[v];b&&(g.addEventListener(v.slice(2).toLowerCase(),b),(_=p==null?void 0:p.removeEventListener)==null||_.call(p,v.slice(2).toLowerCase(),b))}),h=vue.watch([u,c,d,f],v=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((_,b)=>{lodashEs.isNil(v[b])?g.removeAttribute(_):g.setAttribute(_,v[b])})},{immediate:!0})),isElement(p)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(v=>p.removeAttribute(v))},{immediate:!0})}),vue.onBeforeUnmount(()=>{if(h==null||h(),h=void 0,a.value&&isElement(a.value)){const g=a.value;y.forEach(p=>{const v=n[p];v&&g.removeEventListener(p.slice(2).toLowerCase(),v)}),a.value=void 0}}),r({triggerRef:a}),(g,p)=>g.virtualTriggering?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createBlock(vue.unref(OnlyChild),vue.mergeProps({key:0},g.$attrs,{"aria-controls":vue.unref(u),"aria-describedby":vue.unref(c),"aria-expanded":vue.unref(f),"aria-haspopup":vue.unref(d)}),{default:vue.withCtx(()=>[vue.renderSlot(g.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var ElPopperTrigger=_export_sfc(_sfc_main$j,[["__file","trigger.vue"]]);const FOCUS_AFTER_TRAPPED="focus-trap.focus-after-trapped",FOCUS_AFTER_RELEASED="focus-trap.focus-after-released",FOCUSOUT_PREVENTED="focus-trap.focusout-prevented",FOCUS_AFTER_TRAPPED_OPTS={cancelable:!0,bubbles:!1},FOCUSOUT_PREVENTED_OPTS={cancelable:!0,bubbles:!1},ON_TRAP_FOCUS_EVT="focusAfterTrapped",ON_RELEASE_FOCUS_EVT="focusAfterReleased",FOCUS_TRAP_INJECTION_KEY=Symbol("elFocusTrap"),focusReason=vue.ref(),lastUserFocusTimestamp=vue.ref(0),lastAutomatedFocusTimestamp=vue.ref(0);let focusReasonUserCount=0;const obtainAllFocusableElements=i=>{const r=[],n=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const a=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||a?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)r.push(n.currentNode);return r},getVisibleElement=(i,r)=>{for(const n of i)if(!isHidden(n,r))return n},isHidden=(i,r)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(r&&i===r)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1},getEdges=i=>{const r=obtainAllFocusableElements(i),n=getVisibleElement(r,i),o=getVisibleElement(r.reverse(),i);return[n,o]},isSelectable=i=>i instanceof HTMLInputElement&&"select"in i,tryFocus=(i,r)=>{if(i&&i.focus){const n=document.activeElement;i.focus({preventScroll:!0}),lastAutomatedFocusTimestamp.value=window.performance.now(),i!==n&&isSelectable(i)&&r&&i.select()}};function removeFromStack(i,r){const n=[...i],o=i.indexOf(r);return o!==-1&&n.splice(o,1),n}const createFocusableStack=()=>{let i=[];return{push:o=>{const a=i[0];a&&o!==a&&a.pause(),i=removeFromStack(i,o),i.unshift(o)},remove:o=>{var a,u;i=removeFromStack(i,o),(u=(a=i[0])==null?void 0:a.resume)==null||u.call(a)}}},focusFirstDescendant=(i,r=!1)=>{const n=document.activeElement;for(const o of i)if(tryFocus(o,r),document.activeElement!==n)return},focusableStack=createFocusableStack(),isFocusCausedByUserEvent=()=>lastUserFocusTimestamp.value>lastAutomatedFocusTimestamp.value,notifyFocusReasonPointer=()=>{focusReason.value="pointer",lastUserFocusTimestamp.value=window.performance.now()},notifyFocusReasonKeydown=()=>{focusReason.value="keyboard",lastUserFocusTimestamp.value=window.performance.now()},useFocusReason=()=>(vue.onMounted(()=>{focusReasonUserCount===0&&(document.addEventListener("mousedown",notifyFocusReasonPointer),document.addEventListener("touchstart",notifyFocusReasonPointer),document.addEventListener("keydown",notifyFocusReasonKeydown)),focusReasonUserCount++}),vue.onBeforeUnmount(()=>{focusReasonUserCount--,focusReasonUserCount<=0&&(document.removeEventListener("mousedown",notifyFocusReasonPointer),document.removeEventListener("touchstart",notifyFocusReasonPointer),document.removeEventListener("keydown",notifyFocusReasonKeydown))}),{focusReason,lastUserFocusTimestamp,lastAutomatedFocusTimestamp}),createFocusOutPreventedEvent=i=>new CustomEvent(FOCUSOUT_PREVENTED,{...FOCUSOUT_PREVENTED_OPTS,detail:i}),_sfc_main$i=vue.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[ON_TRAP_FOCUS_EVT,ON_RELEASE_FOCUS_EVT,"focusin","focusout","focusout-prevented","release-requested"],setup(i,{emit:r}){const n=vue.ref();let o,a;const{focusReason:u}=useFocusReason();useEscapeKeydown(_=>{i.trapped&&!c.paused&&r("release-requested",_)});const c={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},d=_=>{if(!i.loop&&!i.trapped||c.paused)return;const{key:b,altKey:A,ctrlKey:w,metaKey:S,currentTarget:T,shiftKey:x}=_,{loop:M}=i,L=b===EVENT_CODE.tab&&!A&&!w&&!S,O=document.activeElement;if(L&&O){const re=T,[D,z]=getEdges(re);if(D&&z){if(!x&&O===z){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||(_.preventDefault(),M&&tryFocus(D,!0))}else if(x&&[D,re].includes(O)){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||(_.preventDefault(),M&&tryFocus(z,!0))}}else if(O===re){const j=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",j),j.defaultPrevented||_.preventDefault()}}};vue.provide(FOCUS_TRAP_INJECTION_KEY,{focusTrapRef:n,onKeydown:d}),vue.watch(()=>i.focusTrapEl,_=>{_&&(n.value=_)},{immediate:!0}),vue.watch([n],([_],[b])=>{_&&(_.addEventListener("keydown",d),_.addEventListener("focusin",y),_.addEventListener("focusout",g)),b&&(b.removeEventListener("keydown",d),b.removeEventListener("focusin",y),b.removeEventListener("focusout",g))});const f=_=>{r(ON_TRAP_FOCUS_EVT,_)},h=_=>r(ON_RELEASE_FOCUS_EVT,_),y=_=>{const b=vue.unref(n);if(!b)return;const A=_.target,w=_.relatedTarget,S=A&&b.contains(A);i.trapped||w&&b.contains(w)||(o=w),S&&r("focusin",_),!c.paused&&i.trapped&&(S?a=A:tryFocus(a,!0))},g=_=>{const b=vue.unref(n);if(!(c.paused||!b))if(i.trapped){const A=_.relatedTarget;!lodashEs.isNil(A)&&!b.contains(A)&&setTimeout(()=>{if(!c.paused&&i.trapped){const w=createFocusOutPreventedEvent({focusReason:u.value});r("focusout-prevented",w),w.defaultPrevented||tryFocus(a,!0)}},0)}else{const A=_.target;A&&b.contains(A)||r("focusout",_)}};async function p(){await vue.nextTick();const _=vue.unref(n);if(_){focusableStack.push(c);const b=_.contains(document.activeElement)?o:document.activeElement;if(o=b,!_.contains(b)){const w=new Event(FOCUS_AFTER_TRAPPED,FOCUS_AFTER_TRAPPED_OPTS);_.addEventListener(FOCUS_AFTER_TRAPPED,f),_.dispatchEvent(w),w.defaultPrevented||vue.nextTick(()=>{let S=i.focusStartEl;isString(S)||(tryFocus(S),document.activeElement!==S&&(S="first")),S==="first"&&focusFirstDescendant(obtainAllFocusableElements(_),!0),(document.activeElement===b||S==="container")&&tryFocus(_)})}}}function v(){const _=vue.unref(n);if(_){_.removeEventListener(FOCUS_AFTER_TRAPPED,f);const b=new CustomEvent(FOCUS_AFTER_RELEASED,{...FOCUS_AFTER_TRAPPED_OPTS,detail:{focusReason:u.value}});_.addEventListener(FOCUS_AFTER_RELEASED,h),_.dispatchEvent(b),!b.defaultPrevented&&(u.value=="keyboard"||!isFocusCausedByUserEvent()||_.contains(document.activeElement))&&tryFocus(o??document.body),_.removeEventListener(FOCUS_AFTER_RELEASED,h),focusableStack.remove(c)}}return vue.onMounted(()=>{i.trapped&&p(),vue.watch(()=>i.trapped,_=>{_?p():v()})}),vue.onBeforeUnmount(()=>{i.trapped&&v(),n.value&&(n.value.removeEventListener("keydown",d),n.value.removeEventListener("focusin",y),n.value.removeEventListener("focusout",g),n.value=void 0)}),{onKeydown:d}}});function _sfc_render$4(i,r,n,o,a,u){return vue.renderSlot(i.$slots,"default",{handleKeydown:i.onKeydown})}var ElFocusTrap=_export_sfc(_sfc_main$i,[["render",_sfc_render$4],["__file","focus-trap.vue"]]);const POSITIONING_STRATEGIES=["fixed","absolute"],popperCoreConfigProps=buildProps({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:definePropType(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Ee,default:"bottom"},popperOptions:{type:definePropType(Object),default:()=>({})},strategy:{type:String,values:POSITIONING_STRATEGIES,default:"absolute"}}),popperContentProps=buildProps({...popperCoreConfigProps,id:String,style:{type:definePropType([String,Array,Object])},className:{type:definePropType([String,Array,Object])},effect:{type:definePropType(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:definePropType([String,Array,Object])},popperStyle:{type:definePropType([String,Array,Object])},referenceEl:{type:definePropType(Object)},triggerTargetEl:{type:definePropType(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...useAriaProps(["ariaLabel"])}),popperContentEmits={mouseenter:i=>i instanceof MouseEvent,mouseleave:i=>i instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},buildPopperOptions=(i,r=[])=>{const{placement:n,strategy:o,popperOptions:a}=i,u={placement:n,strategy:o,...a,modifiers:[...genModifiers(i),...r]};return deriveExtraModifiers(u,a==null?void 0:a.modifiers),u},unwrapMeasurableEl=i=>{if(isClient)return unrefElement(i)};function genModifiers(i){const{offset:r,gpuAcceleration:n,fallbackPlacements:o}=i;return[{name:"offset",options:{offset:[0,r??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:o}},{name:"computeStyles",options:{gpuAcceleration:n}}]}function deriveExtraModifiers(i,r){r&&(i.modifiers=[...i.modifiers,...r??[]])}const DEFAULT_ARROW_OFFSET=0,usePopperContent=i=>{const{popperInstanceRef:r,contentRef:n,triggerRef:o,role:a}=vue.inject(POPPER_INJECTION_KEY,void 0),u=vue.ref(),c=vue.ref(),d=vue.computed(()=>({name:"eventListeners",enabled:!!i.visible})),f=vue.computed(()=>{var w;const S=vue.unref(u),T=(w=vue.unref(c))!=null?w:DEFAULT_ARROW_OFFSET;return{name:"arrow",enabled:!lodashEs.isUndefined(S),options:{element:S,padding:T}}}),h=vue.computed(()=>({onFirstUpdate:()=>{_()},...buildPopperOptions(i,[vue.unref(f),vue.unref(d)])})),y=vue.computed(()=>unwrapMeasurableEl(i.referenceEl)||vue.unref(o)),{attributes:g,state:p,styles:v,update:_,forceUpdate:b,instanceRef:A}=usePopper(y,n,h);return vue.watch(A,w=>r.value=w),vue.onMounted(()=>{vue.watch(()=>{var w;return(w=vue.unref(y))==null?void 0:w.getBoundingClientRect()},()=>{_()})}),{attributes:g,arrowRef:u,contentRef:n,instanceRef:A,state:p,styles:v,role:a,forceUpdate:b,update:_}},usePopperContentDOM=(i,{attributes:r,styles:n,role:o})=>{const{nextZIndex:a}=useZIndex(),u=useNamespace("popper"),c=vue.computed(()=>vue.unref(r).popper),d=vue.ref(isNumber(i.zIndex)?i.zIndex:a()),f=vue.computed(()=>[u.b(),u.is("pure",i.pure),u.is(i.effect),i.popperClass]),h=vue.computed(()=>[{zIndex:vue.unref(d)},vue.unref(n).popper,i.popperStyle||{}]),y=vue.computed(()=>o.value==="dialog"?"false":void 0),g=vue.computed(()=>vue.unref(n).arrow||{});return{ariaModal:y,arrowStyle:g,contentAttrs:c,contentClass:f,contentStyle:h,contentZIndex:d,updateZIndex:()=>{d.value=isNumber(i.zIndex)?i.zIndex:a()}}},usePopperContentFocusTrap=(i,r)=>{const n=vue.ref(!1),o=vue.ref();return{focusStartRef:o,trapped:n,onFocusAfterReleased:h=>{var y;((y=h.detail)==null?void 0:y.focusReason)!=="pointer"&&(o.value="first",r("blur"))},onFocusAfterTrapped:()=>{r("focus")},onFocusInTrap:h=>{i.visible&&!n.value&&(h.target&&(o.value=h.target),n.value=!0)},onFocusoutPrevented:h=>{i.trapping||(h.detail.focusReason==="pointer"&&h.preventDefault(),n.value=!1)},onReleaseRequested:()=>{n.value=!1,r("close")}}},__default__$4=vue.defineComponent({name:"ElPopperContent"}),_sfc_main$h=vue.defineComponent({...__default__$4,props:popperContentProps,emits:popperContentEmits,setup(i,{expose:r,emit:n}){const o=i,{focusStartRef:a,trapped:u,onFocusAfterReleased:c,onFocusAfterTrapped:d,onFocusInTrap:f,onFocusoutPrevented:h,onReleaseRequested:y}=usePopperContentFocusTrap(o,n),{attributes:g,arrowRef:p,contentRef:v,styles:_,instanceRef:b,role:A,update:w}=usePopperContent(o),{ariaModal:S,arrowStyle:T,contentAttrs:x,contentClass:M,contentStyle:L,updateZIndex:O}=usePopperContentDOM(o,{styles:_,attributes:g,role:A}),re=vue.inject(formItemContextKey,void 0),D=vue.ref();vue.provide(POPPER_CONTENT_INJECTION_KEY,{arrowStyle:T,arrowRef:p,arrowOffset:D}),re&&vue.provide(formItemContextKey,{...re,addInputId:NOOP,removeInputId:NOOP});let z;const V=(F=!0)=>{w(),F&&O()},j=()=>{V(!1),o.visible&&o.focusOnShow?u.value=!0:o.visible===!1&&(u.value=!1)};return vue.onMounted(()=>{vue.watch(()=>o.triggerTargetEl,(F,Ce)=>{z==null||z(),z=void 0;const le=vue.unref(F||v.value),pe=vue.unref(Ce||v.value);isElement(le)&&(z=vue.watch([A,()=>o.ariaLabel,S,()=>o.id],$e=>{["role","aria-label","aria-modal","id"].forEach((Fe,Oe)=>{lodashEs.isNil($e[Oe])?le.removeAttribute(Fe):le.setAttribute(Fe,$e[Oe])})},{immediate:!0})),pe!==le&&isElement(pe)&&["role","aria-label","aria-modal","id"].forEach($e=>{pe.removeAttribute($e)})},{immediate:!0}),vue.watch(()=>o.visible,j,{immediate:!0})}),vue.onBeforeUnmount(()=>{z==null||z(),z=void 0}),r({popperContentRef:v,popperInstanceRef:b,updatePopper:V,contentStyle:L}),(F,Ce)=>(vue.openBlock(),vue.createElementBlock("div",vue.mergeProps({ref_key:"contentRef",ref:v},vue.unref(x),{style:vue.unref(L),class:vue.unref(M),tabindex:"-1",onMouseenter:le=>F.$emit("mouseenter",le),onMouseleave:le=>F.$emit("mouseleave",le)}),[vue.createVNode(vue.unref(ElFocusTrap),{trapped:vue.unref(u),"trap-on-focus-in":!0,"focus-trap-el":vue.unref(v),"focus-start-el":vue.unref(a),onFocusAfterTrapped:vue.unref(d),onFocusAfterReleased:vue.unref(c),onFocusin:vue.unref(f),onFocusoutPrevented:vue.unref(h),onReleaseRequested:vue.unref(y)},{default:vue.withCtx(()=>[vue.renderSlot(F.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var ElPopperContent=_export_sfc(_sfc_main$h,[["__file","content.vue"]]);const ElPopper=withInstall(Popper),TOOLTIP_INJECTION_KEY=Symbol("elTooltip"),useTooltipContentProps=buildProps({...useDelayedToggleProps,...popperContentProps,appendTo:{type:definePropType([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:definePropType(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...useAriaProps(["ariaLabel"])}),useTooltipTriggerProps=buildProps({...popperTriggerProps,disabled:Boolean,trigger:{type:definePropType([String,Array]),default:"hover"},triggerKeys:{type:definePropType(Array),default:()=>[EVENT_CODE.enter,EVENT_CODE.space]}}),{useModelToggleProps:useTooltipModelToggleProps,useModelToggleEmits:useTooltipModelToggleEmits,useModelToggle:useTooltipModelToggle}=createModelToggleComposable("visible"),useTooltipProps=buildProps({...popperProps,...useTooltipModelToggleProps,...useTooltipContentProps,...useTooltipTriggerProps,...popperArrowProps,showArrow:{type:Boolean,default:!0}}),tooltipEmits=[...useTooltipModelToggleEmits,"before-show","before-hide","show","hide","open","close"],isTriggerType=(i,r)=>isArray(i)?i.includes(r):i===r,whenTrigger=(i,r,n)=>o=>{isTriggerType(vue.unref(i),r)&&n(o)},__default__$3=vue.defineComponent({name:"ElTooltipTrigger"}),_sfc_main$g=vue.defineComponent({...__default__$3,props:useTooltipTriggerProps,setup(i,{expose:r}){const n=i,o=useNamespace("tooltip"),{controlled:a,id:u,open:c,onOpen:d,onClose:f,onToggle:h}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),y=vue.ref(null),g=()=>{if(vue.unref(a)||n.disabled)return!0},p=vue.toRef(n,"trigger"),v=composeEventHandlers(g,whenTrigger(p,"hover",d)),_=composeEventHandlers(g,whenTrigger(p,"hover",f)),b=composeEventHandlers(g,whenTrigger(p,"click",x=>{x.button===0&&h(x)})),A=composeEventHandlers(g,whenTrigger(p,"focus",d)),w=composeEventHandlers(g,whenTrigger(p,"focus",f)),S=composeEventHandlers(g,whenTrigger(p,"contextmenu",x=>{x.preventDefault(),h(x)})),T=composeEventHandlers(g,x=>{const{code:M}=x;n.triggerKeys.includes(M)&&(x.preventDefault(),h(x))});return r({triggerRef:y}),(x,M)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopperTrigger),{id:vue.unref(u),"virtual-ref":x.virtualRef,open:vue.unref(c),"virtual-triggering":x.virtualTriggering,class:vue.normalizeClass(vue.unref(o).e("trigger")),onBlur:vue.unref(w),onClick:vue.unref(b),onContextmenu:vue.unref(S),onFocus:vue.unref(A),onMouseenter:vue.unref(v),onMouseleave:vue.unref(_),onKeydown:vue.unref(T)},{default:vue.withCtx(()=>[vue.renderSlot(x.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var ElTooltipTrigger=_export_sfc(_sfc_main$g,[["__file","trigger.vue"]]);const teleportProps=buildProps({to:{type:definePropType([String,Object]),required:!0},disabled:Boolean}),_sfc_main$f=vue.defineComponent({__name:"teleport",props:teleportProps,setup(i){return(r,n)=>r.disabled?vue.renderSlot(r.$slots,"default",{key:0}):(vue.openBlock(),vue.createBlock(vue.Teleport,{key:1,to:r.to},[vue.renderSlot(r.$slots,"default")],8,["to"]))}});var Teleport=_export_sfc(_sfc_main$f,[["__file","teleport.vue"]]);const ElTeleport=withInstall(Teleport),__default__$2=vue.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),_sfc_main$e=vue.defineComponent({...__default__$2,props:useTooltipContentProps,setup(i,{expose:r}){const n=i,{selector:o}=usePopperContainerId(),a=useNamespace("tooltip"),u=vue.ref(null);let c;const{controlled:d,id:f,open:h,trigger:y,onClose:g,onOpen:p,onShow:v,onHide:_,onBeforeShow:b,onBeforeHide:A}=vue.inject(TOOLTIP_INJECTION_KEY,void 0),w=vue.computed(()=>n.transition||`${a.namespace.value}-fade-in-linear`),S=vue.computed(()=>process.env.NODE_ENV==="test"?!0:n.persistent);vue.onBeforeUnmount(()=>{c==null||c()});const T=vue.computed(()=>vue.unref(S)?!0:vue.unref(h)),x=vue.computed(()=>n.disabled?!1:vue.unref(h)),M=vue.computed(()=>n.appendTo||o.value),L=vue.computed(()=>{var pe;return(pe=n.style)!=null?pe:{}}),O=vue.ref(!0),re=()=>{_(),O.value=!0},D=()=>{if(vue.unref(d))return!0},z=composeEventHandlers(D,()=>{n.enterable&&vue.unref(y)==="hover"&&p()}),V=composeEventHandlers(D,()=>{vue.unref(y)==="hover"&&g()}),j=()=>{var pe,$e;($e=(pe=u.value)==null?void 0:pe.updatePopper)==null||$e.call(pe),b==null||b()},F=()=>{A==null||A()},Ce=()=>{v(),c=onClickOutside(vue.computed(()=>{var pe;return(pe=u.value)==null?void 0:pe.popperContentRef}),()=>{if(vue.unref(d))return;vue.unref(y)!=="hover"&&g()})},le=()=>{n.virtualTriggering||g()};return vue.watch(()=>vue.unref(h),pe=>{pe?O.value=!1:c==null||c()},{flush:"post"}),vue.watch(()=>n.content,()=>{var pe,$e;($e=(pe=u.value)==null?void 0:pe.updatePopper)==null||$e.call(pe)}),r({contentRef:u}),(pe,$e)=>(vue.openBlock(),vue.createBlock(vue.unref(ElTeleport),{disabled:!pe.teleported,to:vue.unref(M)},{default:vue.withCtx(()=>[vue.createVNode(vue.Transition,{name:vue.unref(w),onAfterLeave:re,onBeforeEnter:j,onAfterEnter:Ce,onBeforeLeave:F},{default:vue.withCtx(()=>[vue.unref(T)?vue.withDirectives((vue.openBlock(),vue.createBlock(vue.unref(ElPopperContent),vue.mergeProps({key:0,id:vue.unref(f),ref_key:"contentRef",ref:u},pe.$attrs,{"aria-label":pe.ariaLabel,"aria-hidden":O.value,"boundaries-padding":pe.boundariesPadding,"fallback-placements":pe.fallbackPlacements,"gpu-acceleration":pe.gpuAcceleration,offset:pe.offset,placement:pe.placement,"popper-options":pe.popperOptions,strategy:pe.strategy,effect:pe.effect,enterable:pe.enterable,pure:pe.pure,"popper-class":pe.popperClass,"popper-style":[pe.popperStyle,vue.unref(L)],"reference-el":pe.referenceEl,"trigger-target-el":pe.triggerTargetEl,visible:vue.unref(x),"z-index":pe.zIndex,onMouseenter:vue.unref(z),onMouseleave:vue.unref(V),onBlur:le,onClose:vue.unref(g)}),{default:vue.withCtx(()=>[vue.renderSlot(pe.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[vue.vShow,vue.unref(x)]]):vue.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var ElTooltipContent=_export_sfc(_sfc_main$e,[["__file","content.vue"]]);const __default__$1=vue.defineComponent({name:"ElTooltip"}),_sfc_main$d=vue.defineComponent({...__default__$1,props:useTooltipProps,emits:tooltipEmits,setup(i,{expose:r,emit:n}){const o=i;usePopperContainer();const a=useId(),u=vue.ref(),c=vue.ref(),d=()=>{var w;const S=vue.unref(u);S&&((w=S.popperInstanceRef)==null||w.update())},f=vue.ref(!1),h=vue.ref(),{show:y,hide:g,hasUpdateHandler:p}=useTooltipModelToggle({indicator:f,toggleReason:h}),{onOpen:v,onClose:_}=useDelayedToggle({showAfter:vue.toRef(o,"showAfter"),hideAfter:vue.toRef(o,"hideAfter"),autoClose:vue.toRef(o,"autoClose"),open:y,close:g}),b=vue.computed(()=>isBoolean(o.visible)&&!p.value);vue.provide(TOOLTIP_INJECTION_KEY,{controlled:b,id:a,open:vue.readonly(f),trigger:vue.toRef(o,"trigger"),onOpen:w=>{v(w)},onClose:w=>{_(w)},onToggle:w=>{vue.unref(f)?_(w):v(w)},onShow:()=>{n("show",h.value)},onHide:()=>{n("hide",h.value)},onBeforeShow:()=>{n("before-show",h.value)},onBeforeHide:()=>{n("before-hide",h.value)},updatePopper:d}),vue.watch(()=>o.disabled,w=>{w&&f.value&&(f.value=!1)});const A=w=>{var S,T;const x=(T=(S=c.value)==null?void 0:S.contentRef)==null?void 0:T.popperContentRef,M=(w==null?void 0:w.relatedTarget)||document.activeElement;return x&&x.contains(M)};return vue.onDeactivated(()=>f.value&&g()),r({popperRef:u,contentRef:c,isFocusInsideContent:A,updatePopper:d,onOpen:v,onClose:_,hide:g}),(w,S)=>(vue.openBlock(),vue.createBlock(vue.unref(ElPopper),{ref_key:"popperRef",ref:u,role:w.role},{default:vue.withCtx(()=>[vue.createVNode(ElTooltipTrigger,{disabled:w.disabled,trigger:w.trigger,"trigger-keys":w.triggerKeys,"virtual-ref":w.virtualRef,"virtual-triggering":w.virtualTriggering},{default:vue.withCtx(()=>[w.$slots.default?vue.renderSlot(w.$slots,"default",{key:0}):vue.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),vue.createVNode(ElTooltipContent,{ref_key:"contentRef",ref:c,"aria-label":w.ariaLabel,"boundaries-padding":w.boundariesPadding,content:w.content,disabled:w.disabled,effect:w.effect,enterable:w.enterable,"fallback-placements":w.fallbackPlacements,"hide-after":w.hideAfter,"gpu-acceleration":w.gpuAcceleration,offset:w.offset,persistent:w.persistent,"popper-class":w.popperClass,"popper-style":w.popperStyle,placement:w.placement,"popper-options":w.popperOptions,pure:w.pure,"raw-content":w.rawContent,"reference-el":w.referenceEl,"trigger-target-el":w.triggerTargetEl,"show-after":w.showAfter,strategy:w.strategy,teleported:w.teleported,transition:w.transition,"virtual-triggering":w.virtualTriggering,"z-index":w.zIndex,"append-to":w.appendTo},{default:vue.withCtx(()=>[vue.renderSlot(w.$slots,"content",{},()=>[w.rawContent?(vue.openBlock(),vue.createElementBlock("span",{key:0,innerHTML:w.content},null,8,["innerHTML"])):(vue.openBlock(),vue.createElementBlock("span",{key:1},vue.toDisplayString(w.content),1))]),w.showArrow?(vue.openBlock(),vue.createBlock(vue.unref(ElPopperArrow),{key:0,"arrow-offset":w.arrowOffset},null,8,["arrow-offset"])):vue.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var Tooltip=_export_sfc(_sfc_main$d,[["__file","tooltip.vue"]]);const ElTooltip=withInstall(Tooltip);var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};const nodeList=new Map;if(isClient){let i;document.addEventListener("mousedown",r=>i=r),document.addEventListener("mouseup",r=>{if(i){for(const n of nodeList.values())for(const{documentHandler:o}of n)o(r,i);i=void 0}})}function createDocumentHandler(i,r){let n=[];return Array.isArray(r.arg)?n=r.arg:isElement(r.arg)&&n.push(r.arg),function(o,a){const u=r.instance.popperRef,c=o.target,d=a==null?void 0:a.target,f=!r||!r.instance,h=!c||!d,y=i.contains(c)||i.contains(d),g=i===c,p=n.length&&n.some(_=>_==null?void 0:_.contains(c))||n.length&&n.includes(d),v=u&&(u.contains(c)||u.contains(d));f||h||y||g||p||v||r.value(o,a)}}const ClickOutside={beforeMount(i,r){nodeList.has(i)||nodeList.set(i,[]),nodeList.get(i).push({documentHandler:createDocumentHandler(i,r),bindingFn:r.value})},updated(i,r){nodeList.has(i)||nodeList.set(i,[]);const n=nodeList.get(i),o=n.findIndex(u=>u.bindingFn===r.oldValue),a={documentHandler:createDocumentHandler(i,r),bindingFn:r.value};o>=0?n.splice(o,1,a):n.push(a)},unmounted(i){nodeList.delete(i)}},tagProps=buildProps({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:componentSizes},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),tagEmits={close:i=>i instanceof MouseEvent,click:i=>i instanceof MouseEvent},__default__=vue.defineComponent({name:"ElTag"}),_sfc_main$c=vue.defineComponent({...__default__,props:tagProps,emits:tagEmits,setup(i,{emit:r}){const n=i,o=useFormSize(),a=useNamespace("tag"),u=vue.computed(()=>{const{type:h,hit:y,effect:g,closable:p,round:v}=n;return[a.b(),a.is("closable",p),a.m(h||"primary"),a.m(o.value),a.m(g),a.is("hit",y),a.is("round",v)]}),c=h=>{r("close",h)},d=h=>{r("click",h)},f=h=>{h.component.subTree.component.bum=null};return(h,y)=>h.disableTransitions?(vue.openBlock(),vue.createElementBlock("span",{key:0,class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:h.color}),onClick:d},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(h.$slots,"default")],2),h.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)):(vue.openBlock(),vue.createBlock(vue.Transition,{key:1,name:`${vue.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:f},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(u)),style:vue.normalizeStyle({backgroundColor:h.color}),onClick:d},[vue.createElementVNode("span",{class:vue.normalizeClass(vue.unref(a).e("content"))},[vue.renderSlot(h.$slots,"default")],2),h.closable?(vue.openBlock(),vue.createBlock(vue.unref(ElIcon),{key:0,class:vue.normalizeClass(vue.unref(a).e("close")),onClick:vue.withModifiers(c,["stop"])},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(close_default))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var Tag=_export_sfc(_sfc_main$c,[["__file","tag.vue"]]);const ElTag=withInstall(Tag),selectGroupKey=Symbol("ElSelectGroup"),selectKey=Symbol("ElSelect");function useOption(i,r){const n=vue.inject(selectKey),o=vue.inject(selectGroupKey,{disabled:!1}),a=vue.computed(()=>y(lodashEs.castArray(n.props.modelValue),i.value)),u=vue.computed(()=>{var v;if(n.props.multiple){const _=lodashEs.castArray((v=n.props.modelValue)!=null?v:[]);return!a.value&&_.length>=n.props.multipleLimit&&n.props.multipleLimit>0}else return!1}),c=vue.computed(()=>i.label||(isObject(i.value)?"":i.value)),d=vue.computed(()=>i.value||i.label||""),f=vue.computed(()=>i.disabled||r.groupDisabled||u.value),h=vue.getCurrentInstance(),y=(v=[],_)=>{if(isObject(i.value)){const b=n.props.valueKey;return v&&v.some(A=>vue.toRaw(lodashEs.get(A,b))===lodashEs.get(_,b))}else return v&&v.includes(_)},g=()=>{!i.disabled&&!o.disabled&&(n.states.hoveringIndex=n.optionsArray.indexOf(h.proxy))},p=v=>{const _=new RegExp(escapeStringRegexp(v),"i");r.visible=_.test(c.value)||i.created};return vue.watch(()=>c.value,()=>{!i.created&&!n.props.remote&&n.setSelected()}),vue.watch(()=>i.value,(v,_)=>{const{remote:b,valueKey:A}=n.props;if(v!==_&&(n.onOptionDestroy(_,h.proxy),n.onOptionCreate(h.proxy)),!i.created&&!b){if(A&&isObject(v)&&isObject(_)&&v[A]===_[A])return;n.setSelected()}}),vue.watch(()=>o.disabled,()=>{r.groupDisabled=o.disabled},{immediate:!0}),{select:n,currentLabel:c,currentValue:d,itemSelected:a,isDisabled:f,hoverItem:g,updateOption:p}}const _sfc_main$b=vue.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(i){const r=useNamespace("select"),n=useId(),o=vue.computed(()=>[r.be("dropdown","item"),r.is("disabled",vue.unref(d)),r.is("selected",vue.unref(c)),r.is("hovering",vue.unref(p))]),a=vue.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:u,itemSelected:c,isDisabled:d,select:f,hoverItem:h,updateOption:y}=useOption(i,a),{visible:g,hover:p}=vue.toRefs(a),v=vue.getCurrentInstance().proxy;f.onOptionCreate(v),vue.onBeforeUnmount(()=>{const b=v.value,{selected:A}=f.states,S=(f.props.multiple?A:[A]).some(T=>T.value===v.value);vue.nextTick(()=>{f.states.cachedOptions.get(b)===v&&!S&&f.states.cachedOptions.delete(b)}),f.onOptionDestroy(b,v)});function _(){d.value||f.handleOptionSelect(v)}return{ns:r,id:n,containerKls:o,currentLabel:u,itemSelected:c,isDisabled:d,select:f,hoverItem:h,updateOption:y,visible:g,hover:p,selectOptionClick:_,states:a}}});function _sfc_render$3(i,r,n,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("li",{id:i.id,class:vue.normalizeClass(i.containerKls),role:"option","aria-disabled":i.isDisabled||void 0,"aria-selected":i.itemSelected,onMouseenter:i.hoverItem,onClick:vue.withModifiers(i.selectOptionClick,["stop"])},[vue.renderSlot(i.$slots,"default",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[vue.vShow,i.visible]])}var Option=_export_sfc(_sfc_main$b,[["render",_sfc_render$3],["__file","option.vue"]]);const _sfc_main$a=vue.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const i=vue.inject(selectKey),r=useNamespace("select"),n=vue.computed(()=>i.props.popperClass),o=vue.computed(()=>i.props.multiple),a=vue.computed(()=>i.props.fitInputWidth),u=vue.ref("");function c(){var d;u.value=`${(d=i.selectRef)==null?void 0:d.offsetWidth}px`}return vue.onMounted(()=>{c(),useResizeObserver(i.selectRef,c)}),{ns:r,minWidth:u,popperClass:n,isMultiple:o,isFitInputWidth:a}}});function _sfc_render$2(i,r,n,o,a,u){return vue.openBlock(),vue.createElementBlock("div",{class:vue.normalizeClass([i.ns.b("dropdown"),i.ns.is("multiple",i.isMultiple),i.popperClass]),style:vue.normalizeStyle({[i.isFitInputWidth?"width":"minWidth"]:i.minWidth})},[i.$slots.header?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.ns.be("dropdown","header"))},[vue.renderSlot(i.$slots,"header")],2)):vue.createCommentVNode("v-if",!0),vue.renderSlot(i.$slots,"default"),i.$slots.footer?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.ns.be("dropdown","footer"))},[vue.renderSlot(i.$slots,"footer")],2)):vue.createCommentVNode("v-if",!0)],6)}var ElSelectMenu=_export_sfc(_sfc_main$a,[["render",_sfc_render$2],["__file","select-dropdown.vue"]]);const MINIMUM_INPUT_WIDTH=11,useSelect=(i,r)=>{const{t:n}=useLocale(),o=useId(),a=useNamespace("select"),u=useNamespace("input"),c=vue.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),d=vue.ref(null),f=vue.ref(null),h=vue.ref(null),y=vue.ref(null),g=vue.ref(null),p=vue.ref(null),v=vue.ref(null),_=vue.ref(null),b=vue.ref(null),A=vue.ref(null),w=vue.ref(null),S=vue.ref(null),{isComposing:T,handleCompositionStart:x,handleCompositionUpdate:M,handleCompositionEnd:L}=useComposition({afterComposition:bn=>Tn(bn)}),{wrapperRef:O,isFocused:re,handleBlur:D}=useFocusController(g,{beforeFocus(){return $e.value},afterFocus(){i.automaticDropdown&&!z.value&&(z.value=!0,c.menuVisibleOnFocus=!0)},beforeBlur(bn){var En,Rn;return((En=h.value)==null?void 0:En.isFocusInsideContent(bn))||((Rn=y.value)==null?void 0:Rn.isFocusInsideContent(bn))},afterBlur(){z.value=!1,c.menuVisibleOnFocus=!1}}),z=vue.ref(!1),V=vue.ref(),{form:j,formItem:F}=useFormItem(),{inputId:Ce}=useFormItemInputId(i,{formItemContext:F}),{valueOnClear:le,isEmptyValue:pe}=useEmptyValues(i),$e=vue.computed(()=>i.disabled||(j==null?void 0:j.disabled)),Fe=vue.computed(()=>isArray(i.modelValue)?i.modelValue.length>0:!pe(i.modelValue)),Oe=vue.computed(()=>i.clearable&&!$e.value&&c.inputHovering&&Fe.value),Et=vue.computed(()=>i.remote&&i.filterable&&!i.remoteShowSuffix?"":i.suffixIcon),he=vue.computed(()=>a.is("reverse",Et.value&&z.value)),In=vue.computed(()=>(F==null?void 0:F.validateState)||""),vn=vue.computed(()=>ValidateComponentsMap[In.value]),kt=vue.computed(()=>i.remote?300:0),ue=vue.computed(()=>i.loading?i.loadingText||n("el.select.loading"):i.remote&&!c.inputValue&&c.options.size===0?!1:i.filterable&&c.inputValue&&c.options.size>0&&At.value===0?i.noMatchText||n("el.select.noMatch"):c.options.size===0?i.noDataText||n("el.select.noData"):null),At=vue.computed(()=>jt.value.filter(bn=>bn.visible).length),jt=vue.computed(()=>{const bn=Array.from(c.options.values()),En=[];return c.optionValues.forEach(Rn=>{const Pn=bn.findIndex(Dn=>Dn.value===Rn);Pn>-1&&En.push(bn[Pn])}),En.length>=bn.length?En:bn}),hn=vue.computed(()=>Array.from(c.cachedOptions.values())),Pt=vue.computed(()=>{const bn=jt.value.filter(En=>!En.created).some(En=>En.currentLabel===c.inputValue);return i.filterable&&i.allowCreate&&c.inputValue!==""&&!bn}),Ie=()=>{i.filterable&&isFunction(i.filterMethod)||i.filterable&&i.remote&&isFunction(i.remoteMethod)||jt.value.forEach(bn=>{var En;(En=bn.updateOption)==null||En.call(bn,c.inputValue)})},de=useFormSize(),ze=vue.computed(()=>["small"].includes(de.value)?"small":"default"),xe=vue.computed({get(){return z.value&&ue.value!==!1},set(bn){z.value=bn}}),Ne=vue.computed(()=>{if(i.multiple&&!isUndefined(i.modelValue))return lodashEs.castArray(i.modelValue).length===0&&!c.inputValue;const bn=isArray(i.modelValue)?i.modelValue[0]:i.modelValue;return i.filterable||isUndefined(bn)?!c.inputValue:!0}),Lt=vue.computed(()=>{var bn;const En=(bn=i.placeholder)!=null?bn:n("el.select.placeholder");return i.multiple||!Fe.value?En:c.selectedLabel}),Dt=vue.computed(()=>isIOS?null:"mouseenter");vue.watch(()=>i.modelValue,(bn,En)=>{i.multiple&&i.filterable&&!i.reserveKeyword&&(c.inputValue="",Cn("")),ae(),!lodashEs.isEqual(bn,En)&&i.validateEvent&&(F==null||F.validate("change").catch(Rn=>debugWarn(Rn)))},{flush:"post",deep:!0}),vue.watch(()=>z.value,bn=>{bn?Cn(c.inputValue):(c.inputValue="",c.previousQuery=null,c.isBeforeHide=!0),r("visible-change",bn)}),vue.watch(()=>c.options.entries(),()=>{var bn;if(!isClient)return;const En=((bn=d.value)==null?void 0:bn.querySelectorAll("input"))||[];(!i.filterable&&!i.defaultFirstOption&&!isUndefined(i.modelValue)||!Array.from(En).includes(document.activeElement))&&ae(),i.defaultFirstOption&&(i.filterable||i.remote)&&At.value&&ie()},{flush:"post"}),vue.watch(()=>c.hoveringIndex,bn=>{isNumber(bn)&&bn>-1?V.value=jt.value[bn]||{}:V.value={},jt.value.forEach(En=>{En.hover=V.value===En})}),vue.watchEffect(()=>{c.isBeforeHide||Ie()});const Cn=bn=>{c.previousQuery===bn||T.value||(c.previousQuery=bn,i.filterable&&isFunction(i.filterMethod)?i.filterMethod(bn):i.filterable&&i.remote&&isFunction(i.remoteMethod)&&i.remoteMethod(bn),i.defaultFirstOption&&(i.filterable||i.remote)&&At.value?vue.nextTick(ie):vue.nextTick(k))},ie=()=>{const bn=jt.value.filter(Pn=>Pn.visible&&!Pn.disabled&&!Pn.states.groupDisabled),En=bn.find(Pn=>Pn.created),Rn=bn[0];c.hoveringIndex=Mn(jt.value,En||Rn)},ae=()=>{if(i.multiple)c.selectedLabel="";else{const En=isArray(i.modelValue)?i.modelValue[0]:i.modelValue,Rn=Y(En);c.selectedLabel=Rn.currentLabel,c.selected=[Rn];return}const bn=[];isUndefined(i.modelValue)||lodashEs.castArray(i.modelValue).forEach(En=>{bn.push(Y(En))}),c.selected=bn},Y=bn=>{let En;const Rn=toRawType(bn).toLowerCase()==="object",Pn=toRawType(bn).toLowerCase()==="null",Dn=toRawType(bn).toLowerCase()==="undefined";for(let Zn=c.cachedOptions.size-1;Zn>=0;Zn--){const kn=hn.value[Zn];if(Rn?lodashEs.get(kn.value,i.valueKey)===lodashEs.get(bn,i.valueKey):kn.value===bn){En={value:bn,currentLabel:kn.currentLabel,get isDisabled(){return kn.isDisabled}};break}}if(En)return En;const $n=Rn?bn.label:!Pn&&!Dn?bn:"";return{value:bn,currentLabel:$n}},k=()=>{c.hoveringIndex=jt.value.findIndex(bn=>c.selected.some(En=>Jn(En)===Jn(bn)))},$=()=>{c.selectionWidth=f.value.getBoundingClientRect().width},oe=()=>{c.calculatorWidth=p.value.getBoundingClientRect().width},_e=()=>{c.collapseItemWidth=w.value.getBoundingClientRect().width},Ue=()=>{var bn,En;(En=(bn=h.value)==null?void 0:bn.updatePopper)==null||En.call(bn)},_n=()=>{var bn,En;(En=(bn=y.value)==null?void 0:bn.updatePopper)==null||En.call(bn)},wn=()=>{c.inputValue.length>0&&!z.value&&(z.value=!0),Cn(c.inputValue)},Tn=bn=>{if(c.inputValue=bn.target.value,i.remote)Ln();else return wn()},Ln=lodashEs.debounce(()=>{wn()},kt.value),Ve=bn=>{lodashEs.isEqual(i.modelValue,bn)||r(CHANGE_EVENT,bn)},qe=bn=>lodashEs.findLastIndex(bn,En=>!c.disabledOptions.has(En)),Sn=bn=>{if(i.multiple&&bn.code!==EVENT_CODE.delete&&bn.target.value.length<=0){const En=lodashEs.castArray(i.modelValue).slice(),Rn=qe(En);if(Rn<0)return;const Pn=En[Rn];En.splice(Rn,1),r(UPDATE_MODEL_EVENT,En),Ve(En),r("remove-tag",Pn)}},An=(bn,En)=>{const Rn=c.selected.indexOf(En);if(Rn>-1&&!$e.value){const Pn=lodashEs.castArray(i.modelValue).slice();Pn.splice(Rn,1),r(UPDATE_MODEL_EVENT,Pn),Ve(Pn),r("remove-tag",En.value)}bn.stopPropagation(),Fn()},xn=bn=>{bn.stopPropagation();const En=i.multiple?[]:le.value;if(i.multiple)for(const Rn of c.selected)Rn.isDisabled&&En.push(Rn.value);r(UPDATE_MODEL_EVENT,En),Ve(En),c.hoveringIndex=-1,z.value=!1,r("clear"),Fn()},Bn=bn=>{var En;if(i.multiple){const Rn=lodashEs.castArray((En=i.modelValue)!=null?En:[]).slice(),Pn=Mn(Rn,bn.value);Pn>-1?Rn.splice(Pn,1):(i.multipleLimit<=0||Rn.length<i.multipleLimit)&&Rn.push(bn.value),r(UPDATE_MODEL_EVENT,Rn),Ve(Rn),bn.created&&Cn(""),i.filterable&&!i.reserveKeyword&&(c.inputValue="")}else r(UPDATE_MODEL_EVENT,bn.value),Ve(bn.value),z.value=!1;Fn(),!z.value&&vue.nextTick(()=>{Gn(bn)})},Mn=(bn=[],En)=>{if(!isObject(En))return bn.indexOf(En);const Rn=i.valueKey;let Pn=-1;return bn.some((Dn,$n)=>vue.toRaw(lodashEs.get(Dn,Rn))===lodashEs.get(En,Rn)?(Pn=$n,!0):!1),Pn},Gn=bn=>{var En,Rn,Pn,Dn,$n;const Xn=isArray(bn)?bn[0]:bn;let Zn=null;if(Xn!=null&&Xn.value){const kn=jt.value.filter(qn=>qn.value===Xn.value);kn.length>0&&(Zn=kn[0].$el)}if(h.value&&Zn){const kn=(Dn=(Pn=(Rn=(En=h.value)==null?void 0:En.popperRef)==null?void 0:Rn.contentRef)==null?void 0:Pn.querySelector)==null?void 0:Dn.call(Pn,`.${a.be("dropdown","wrap")}`);kn&&scrollIntoView(kn,Zn)}($n=S.value)==null||$n.handleScroll()},Vn=bn=>{c.options.set(bn.value,bn),c.cachedOptions.set(bn.value,bn),bn.disabled&&c.disabledOptions.set(bn.value,bn)},Un=(bn,En)=>{c.options.get(bn)===En&&c.options.delete(bn)},jn=vue.computed(()=>{var bn,En;return(En=(bn=h.value)==null?void 0:bn.popperRef)==null?void 0:En.contentRef}),Kn=()=>{c.isBeforeHide=!1,vue.nextTick(()=>Gn(c.selected))},Fn=()=>{var bn;(bn=g.value)==null||bn.focus()},Hn=()=>{var bn;if(z.value){z.value=!1,vue.nextTick(()=>{var En;return(En=g.value)==null?void 0:En.blur()});return}(bn=g.value)==null||bn.blur()},zn=bn=>{xn(bn)},Yn=bn=>{if(z.value=!1,re.value){const En=new FocusEvent("focus",bn);vue.nextTick(()=>D(En))}},Wn=()=>{c.inputValue.length>0?c.inputValue="":z.value=!1},On=()=>{$e.value||(isIOS&&(c.inputHovering=!0),c.menuVisibleOnFocus?c.menuVisibleOnFocus=!1:z.value=!z.value)},Nn=()=>{z.value?jt.value[c.hoveringIndex]&&Bn(jt.value[c.hoveringIndex]):On()},Jn=bn=>isObject(bn.value)?lodashEs.get(bn.value,i.valueKey):bn.value,tr=vue.computed(()=>jt.value.filter(bn=>bn.visible).every(bn=>bn.disabled)),nr=vue.computed(()=>i.multiple?i.collapseTags?c.selected.slice(0,i.maxCollapseTags):c.selected:[]),rr=vue.computed(()=>i.multiple?i.collapseTags?c.selected.slice(i.maxCollapseTags):[]:[]),Qn=bn=>{if(!z.value){z.value=!0;return}if(!(c.options.size===0||c.filteredOptionsCount===0||T.value)&&!tr.value){bn==="next"?(c.hoveringIndex++,c.hoveringIndex===c.options.size&&(c.hoveringIndex=0)):bn==="prev"&&(c.hoveringIndex--,c.hoveringIndex<0&&(c.hoveringIndex=c.options.size-1));const En=jt.value[c.hoveringIndex];(En.disabled===!0||En.states.groupDisabled===!0||!En.visible)&&Qn(bn),vue.nextTick(()=>Gn(V.value))}},ir=()=>{if(!f.value)return 0;const bn=window.getComputedStyle(f.value);return Number.parseFloat(bn.gap||"6px")},or=vue.computed(()=>{const bn=ir();return{maxWidth:`${w.value&&i.maxCollapseTags===1?c.selectionWidth-c.collapseItemWidth-bn:c.selectionWidth}px`}}),ar=vue.computed(()=>({maxWidth:`${c.selectionWidth}px`})),sr=vue.computed(()=>({width:`${Math.max(c.calculatorWidth,MINIMUM_INPUT_WIDTH)}px`}));return useResizeObserver(f,$),useResizeObserver(p,oe),useResizeObserver(b,Ue),useResizeObserver(O,Ue),useResizeObserver(A,_n),useResizeObserver(w,_e),vue.onMounted(()=>{ae()}),{inputId:Ce,contentId:o,nsSelect:a,nsInput:u,states:c,isFocused:re,expanded:z,optionsArray:jt,hoverOption:V,selectSize:de,filteredOptionsCount:At,resetCalculatorWidth:oe,updateTooltip:Ue,updateTagTooltip:_n,debouncedOnInputChange:Ln,onInput:Tn,deletePrevTag:Sn,deleteTag:An,deleteSelected:xn,handleOptionSelect:Bn,scrollToOption:Gn,hasModelValue:Fe,shouldShowPlaceholder:Ne,currentPlaceholder:Lt,mouseEnterEventName:Dt,showClose:Oe,iconComponent:Et,iconReverse:he,validateState:In,validateIcon:vn,showNewOption:Pt,updateOptions:Ie,collapseTagSize:ze,setSelected:ae,selectDisabled:$e,emptyText:ue,handleCompositionStart:x,handleCompositionUpdate:M,handleCompositionEnd:L,onOptionCreate:Vn,onOptionDestroy:Un,handleMenuEnter:Kn,focus:Fn,blur:Hn,handleClearClick:zn,handleClickOutside:Yn,handleEsc:Wn,toggleMenu:On,selectOption:Nn,getValueKey:Jn,navigateOptions:Qn,dropdownMenuVisible:xe,showTagList:nr,collapseTagList:rr,tagStyle:or,collapseTagStyle:ar,inputStyle:sr,popperRef:jn,inputRef:g,tooltipRef:h,tagTooltipRef:y,calculatorRef:p,prefixRef:v,suffixRef:_,selectRef:d,wrapperRef:O,selectionRef:f,scrollbarRef:S,menuRef:b,tagMenuRef:A,collapseItemRef:w}};var ElOptions=vue.defineComponent({name:"ElOptions",setup(i,{slots:r}){const n=vue.inject(selectKey);let o=[];return()=>{var a,u;const c=(a=r.default)==null?void 0:a.call(r),d=[];function f(h){isArray(h)&&h.forEach(y=>{var g,p,v,_;const b=(g=(y==null?void 0:y.type)||{})==null?void 0:g.name;b==="ElOptionGroup"?f(!isString(y.children)&&!isArray(y.children)&&isFunction((p=y.children)==null?void 0:p.default)?(v=y.children)==null?void 0:v.default():y.children):b==="ElOption"?d.push((_=y.props)==null?void 0:_.value):isArray(y.children)&&f(y.children)})}return c.length&&f((u=c[0])==null?void 0:u.children),lodashEs.isEqual(d,o)||(o=d,n&&(n.states.optionValues=d)),c}}});const SelectProps=buildProps({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:useSizeProp,effect:{type:definePropType(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:definePropType(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:useTooltipContentProps.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:iconPropType,default:circle_close_default},fitInputWidth:Boolean,suffixIcon:{type:iconPropType,default:arrow_down_default},tagType:{...tagProps.type,default:"info"},tagEffect:{...tagProps.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:definePropType(String),values:Ee,default:"bottom-start"},fallbackPlacements:{type:definePropType(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...useEmptyValuesProps,...useAriaProps(["ariaLabel"])}),COMPONENT_NAME="ElSelect",_sfc_main$9=vue.defineComponent({name:COMPONENT_NAME,componentName:COMPONENT_NAME,components:{ElSelectMenu,ElOption:Option,ElOptions,ElTag,ElScrollbar,ElTooltip,ElIcon},directives:{ClickOutside},props:SelectProps,emits:[UPDATE_MODEL_EVENT,CHANGE_EVENT,"remove-tag","clear","visible-change","focus","blur"],setup(i,{emit:r}){const n=vue.computed(()=>{const{modelValue:c,multiple:d}=i,f=d?[]:void 0;return isArray(c)?d?c:f:d?f:c}),o=vue.reactive({...vue.toRefs(i),modelValue:n}),a=useSelect(o,r);vue.provide(selectKey,vue.reactive({props:o,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected}));const u=vue.computed(()=>i.multiple?a.states.selected.map(c=>c.currentLabel):a.states.selectedLabel);return{...a,modelValue:n,selectedLabel:u}}});function _sfc_render$1(i,r,n,o,a,u){const c=vue.resolveComponent("el-tag"),d=vue.resolveComponent("el-tooltip"),f=vue.resolveComponent("el-icon"),h=vue.resolveComponent("el-option"),y=vue.resolveComponent("el-options"),g=vue.resolveComponent("el-scrollbar"),p=vue.resolveComponent("el-select-menu"),v=vue.resolveDirective("click-outside");return vue.withDirectives((vue.openBlock(),vue.createElementBlock("div",{ref:"selectRef",class:vue.normalizeClass([i.nsSelect.b(),i.nsSelect.m(i.selectSize)]),[vue.toHandlerKey(i.mouseEnterEventName)]:_=>i.states.inputHovering=!0,onMouseleave:_=>i.states.inputHovering=!1},[vue.createVNode(d,{ref:"tooltipRef",visible:i.dropdownMenuVisible,placement:i.placement,teleported:i.teleported,"popper-class":[i.nsSelect.e("popper"),i.popperClass],"popper-options":i.popperOptions,"fallback-placements":i.fallbackPlacements,effect:i.effect,pure:"",trigger:"click",transition:`${i.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:i.persistent,"append-to":i.appendTo,onBeforeShow:i.handleMenuEnter,onHide:_=>i.states.isBeforeHide=!1},{default:vue.withCtx(()=>{var _;return[vue.createElementVNode("div",{ref:"wrapperRef",class:vue.normalizeClass([i.nsSelect.e("wrapper"),i.nsSelect.is("focused",i.isFocused),i.nsSelect.is("hovering",i.states.inputHovering),i.nsSelect.is("filterable",i.filterable),i.nsSelect.is("disabled",i.selectDisabled)]),onClick:vue.withModifiers(i.toggleMenu,["prevent"])},[i.$slots.prefix?(vue.openBlock(),vue.createElementBlock("div",{key:0,ref:"prefixRef",class:vue.normalizeClass(i.nsSelect.e("prefix"))},[vue.renderSlot(i.$slots,"prefix")],2)):vue.createCommentVNode("v-if",!0),vue.createElementVNode("div",{ref:"selectionRef",class:vue.normalizeClass([i.nsSelect.e("selection"),i.nsSelect.is("near",i.multiple&&!i.$slots.prefix&&!!i.states.selected.length)])},[i.multiple?vue.renderSlot(i.$slots,"tag",{key:0},()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.showTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:i.getValueKey(b),class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{closable:!i.selectDisabled&&!b.isDisabled,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",style:vue.normalizeStyle(i.tagStyle),onClose:A=>i.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))},[vue.renderSlot(i.$slots,"label",{label:b.currentLabel,value:b.value},()=>[vue.createTextVNode(vue.toDisplayString(b.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),i.collapseTags&&i.states.selected.length>i.maxCollapseTags?(vue.openBlock(),vue.createBlock(d,{key:0,ref:"tagTooltipRef",disabled:i.dropdownMenuVisible||!i.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:i.effect,placement:"bottom",teleported:i.teleported},{default:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"collapseItemRef",class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{closable:!1,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",style:vue.normalizeStyle(i.collapseTagStyle)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))}," + "+vue.toDisplayString(i.states.selected.length-i.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:vue.withCtx(()=>[vue.createElementVNode("div",{ref:"tagMenuRef",class:vue.normalizeClass(i.nsSelect.e("selection"))},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(i.collapseTagList,b=>(vue.openBlock(),vue.createElementBlock("div",{key:i.getValueKey(b),class:vue.normalizeClass(i.nsSelect.e("selected-item"))},[vue.createVNode(c,{class:"in-tooltip",closable:!i.selectDisabled&&!b.isDisabled,size:i.collapseTagSize,type:i.tagType,effect:i.tagEffect,"disable-transitions":"",onClose:A=>i.deleteTag(A,b)},{default:vue.withCtx(()=>[vue.createElementVNode("span",{class:vue.normalizeClass(i.nsSelect.e("tags-text"))},[vue.renderSlot(i.$slots,"label",{label:b.currentLabel,value:b.value},()=>[vue.createTextVNode(vue.toDisplayString(b.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):vue.createCommentVNode("v-if",!0)]):vue.createCommentVNode("v-if",!0),i.selectDisabled?vue.createCommentVNode("v-if",!0):(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass([i.nsSelect.e("selected-item"),i.nsSelect.e("input-wrapper"),i.nsSelect.is("hidden",!i.filterable)])},[vue.withDirectives(vue.createElementVNode("input",{id:i.inputId,ref:"inputRef","onUpdate:modelValue":b=>i.states.inputValue=b,type:"text",name:i.name,class:vue.normalizeClass([i.nsSelect.e("input"),i.nsSelect.is(i.selectSize)]),disabled:i.selectDisabled,autocomplete:i.autocomplete,style:vue.normalizeStyle(i.inputStyle),role:"combobox",readonly:!i.filterable,spellcheck:"false","aria-activedescendant":((_=i.hoverOption)==null?void 0:_.id)||"","aria-controls":i.contentId,"aria-expanded":i.dropdownMenuVisible,"aria-label":i.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[vue.withKeys(vue.withModifiers(b=>i.navigateOptions("next"),["stop","prevent"]),["down"]),vue.withKeys(vue.withModifiers(b=>i.navigateOptions("prev"),["stop","prevent"]),["up"]),vue.withKeys(vue.withModifiers(i.handleEsc,["stop","prevent"]),["esc"]),vue.withKeys(vue.withModifiers(i.selectOption,["stop","prevent"]),["enter"]),vue.withKeys(vue.withModifiers(i.deletePrevTag,["stop"]),["delete"])],onCompositionstart:i.handleCompositionStart,onCompositionupdate:i.handleCompositionUpdate,onCompositionend:i.handleCompositionEnd,onInput:i.onInput,onClick:vue.withModifiers(i.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[vue.vModelText,i.states.inputValue]]),i.filterable?(vue.openBlock(),vue.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:vue.normalizeClass(i.nsSelect.e("input-calculator")),textContent:vue.toDisplayString(i.states.inputValue)},null,10,["textContent"])):vue.createCommentVNode("v-if",!0)],2)),i.shouldShowPlaceholder?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass([i.nsSelect.e("selected-item"),i.nsSelect.e("placeholder"),i.nsSelect.is("transparent",!i.hasModelValue||i.expanded&&!i.states.inputValue)])},[i.hasModelValue?vue.renderSlot(i.$slots,"label",{key:0,label:i.currentPlaceholder,value:i.modelValue},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.currentPlaceholder),1)]):(vue.openBlock(),vue.createElementBlock("span",{key:1},vue.toDisplayString(i.currentPlaceholder),1))],2)):vue.createCommentVNode("v-if",!0)],2),vue.createElementVNode("div",{ref:"suffixRef",class:vue.normalizeClass(i.nsSelect.e("suffix"))},[i.iconComponent&&!i.showClose?(vue.openBlock(),vue.createBlock(f,{key:0,class:vue.normalizeClass([i.nsSelect.e("caret"),i.nsSelect.e("icon"),i.iconReverse])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0),i.showClose&&i.clearIcon?(vue.openBlock(),vue.createBlock(f,{key:1,class:vue.normalizeClass([i.nsSelect.e("caret"),i.nsSelect.e("icon"),i.nsSelect.e("clear")]),onClick:i.handleClearClick},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.clearIcon)))]),_:1},8,["class","onClick"])):vue.createCommentVNode("v-if",!0),i.validateState&&i.validateIcon?(vue.openBlock(),vue.createBlock(f,{key:2,class:vue.normalizeClass([i.nsInput.e("icon"),i.nsInput.e("validateIcon")])},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(i.validateIcon)))]),_:1},8,["class"])):vue.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:vue.withCtx(()=>[vue.createVNode(p,{ref:"menuRef"},{default:vue.withCtx(()=>[i.$slots.header?(vue.openBlock(),vue.createElementBlock("div",{key:0,class:vue.normalizeClass(i.nsSelect.be("dropdown","header")),onClick:vue.withModifiers(()=>{},["stop"])},[vue.renderSlot(i.$slots,"header")],10,["onClick"])):vue.createCommentVNode("v-if",!0),vue.withDirectives(vue.createVNode(g,{id:i.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":i.nsSelect.be("dropdown","wrap"),"view-class":i.nsSelect.be("dropdown","list"),class:vue.normalizeClass([i.nsSelect.is("empty",i.filteredOptionsCount===0)]),role:"listbox","aria-label":i.ariaLabel,"aria-orientation":"vertical"},{default:vue.withCtx(()=>[i.showNewOption?(vue.openBlock(),vue.createBlock(h,{key:0,value:i.states.inputValue,created:!0},null,8,["value"])):vue.createCommentVNode("v-if",!0),vue.createVNode(y,null,{default:vue.withCtx(()=>[vue.renderSlot(i.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[vue.vShow,i.states.options.size>0&&!i.loading]]),i.$slots.loading&&i.loading?(vue.openBlock(),vue.createElementBlock("div",{key:1,class:vue.normalizeClass(i.nsSelect.be("dropdown","loading"))},[vue.renderSlot(i.$slots,"loading")],2)):i.loading||i.filteredOptionsCount===0?(vue.openBlock(),vue.createElementBlock("div",{key:2,class:vue.normalizeClass(i.nsSelect.be("dropdown","empty"))},[vue.renderSlot(i.$slots,"empty",{},()=>[vue.createElementVNode("span",null,vue.toDisplayString(i.emptyText),1)])],2)):vue.createCommentVNode("v-if",!0),i.$slots.footer?(vue.openBlock(),vue.createElementBlock("div",{key:3,class:vue.normalizeClass(i.nsSelect.be("dropdown","footer")),onClick:vue.withModifiers(()=>{},["stop"])},[vue.renderSlot(i.$slots,"footer")],10,["onClick"])):vue.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[v,i.handleClickOutside,i.popperRef]])}var Select=_export_sfc(_sfc_main$9,[["render",_sfc_render$1],["__file","select.vue"]]);const _sfc_main$8=vue.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(i){const r=useNamespace("select"),n=vue.ref(null),o=vue.getCurrentInstance(),a=vue.ref([]);vue.provide(selectGroupKey,vue.reactive({...vue.toRefs(i)}));const u=vue.computed(()=>a.value.some(h=>h.visible===!0)),c=h=>{var y,g;return((y=h.type)==null?void 0:y.name)==="ElOption"&&!!((g=h.component)!=null&&g.proxy)},d=h=>{const y=lodashEs.castArray(h),g=[];return y.forEach(p=>{var v,_;c(p)?g.push(p.component.proxy):(v=p.children)!=null&&v.length?g.push(...d(p.children)):(_=p.component)!=null&&_.subTree&&g.push(...d(p.component.subTree))}),g},f=()=>{a.value=d(o.subTree)};return vue.onMounted(()=>{f()}),useMutationObserver(n,f,{attributes:!0,subtree:!0,childList:!0}),{groupRef:n,visible:u,ns:r}}});function _sfc_render(i,r,n,o,a,u){return vue.withDirectives((vue.openBlock(),vue.createElementBlock("ul",{ref:"groupRef",class:vue.normalizeClass(i.ns.be("group","wrap"))},[vue.createElementVNode("li",{class:vue.normalizeClass(i.ns.be("group","title"))},vue.toDisplayString(i.label),3),vue.createElementVNode("li",null,[vue.createElementVNode("ul",{class:vue.normalizeClass(i.ns.b("group"))},[vue.renderSlot(i.$slots,"default")],2)])],2)),[[vue.vShow,i.visible]])}var OptionGroup=_export_sfc(_sfc_main$8,[["render",_sfc_render],["__file","option-group.vue"]]);const ElSelect=withInstall(Select,{Option,OptionGroup}),ElOption=withNoopInstall(Option);withNoopInstall(OptionGroup);const _hoisted_1$4={class:"c-wall-d"},_sfc_main$7=vue.defineComponent({__name:"condition",props:{modelValue:{default:()=>({type:EConditionType.None})}},emits:["update:modelValue"],setup(i,{emit:r}){const n=i,o=r,a=vue.computed({get(){return n.modelValue},set(d){o("update:modelValue",d)}}),u=[{label:"大于",val:"greater"},{label:"大于等于",val:">="},{label:"小于",val:"<"},{label:"小于等于",val:"<="},{label:"等于",val:"=="},{label:"不等于",val:"!="},{label:"介于",val:">=,=<"},{label:"不介于",val:"<,>"}],c=d=>{d!=="None"&&(a.value.Relation={key:"",relation:"",val:"",val2:""}),o("update:modelValue",a)};return(d,f)=>{var h,y;return vue.openBlock(),vue.createElementBlock("div",_hoisted_1$4,[vue.createVNode(vue.unref(ElFormItem),{label:"条件",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(a).type,"onUpdate:modelValue":f[0]||(f[0]=g=>vue.unref(a).type=g),onChange:c},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElOption),{value:"None",label:"无"}),vue.createVNode(vue.unref(ElOption),{value:"Relation",label:"关系运算"})]),_:1},8,["modelValue"])]),_:1}),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:0,label:"属性",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.key,"onUpdate:modelValue":f[1]||(f[1]=g=>vue.unref(a).Relation.key=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:1,label:"关系",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElSelect),{modelValue:vue.unref(a).Relation.relation,"onUpdate:modelValue":f[2]||(f[2]=g=>vue.unref(a).Relation.relation=g)},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(u,(g,p)=>vue.createVNode(vue.unref(ElOption),{value:g.val,label:g.label,key:"rop"+p},null,8,["value","label"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:2,label:"值",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.val,"onUpdate:modelValue":f[3]||(f[3]=g=>vue.unref(a).Relation.val=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(a).type==="Relation"&&(((h=vue.unref(a).Relation)==null?void 0:h.relation)===">=,=<"||((y=vue.unref(a).Relation)==null?void 0:y.relation)==="<,>")?(vue.openBlock(),vue.createBlock(vue.unref(ElFormItem),{key:3,label:"值2",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(ElInput),{modelValue:vue.unref(a).Relation.val2,"onUpdate:modelValue":f[4]||(f[4]=g=>vue.unref(a).Relation.val2=g)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)])}}}),condition_vue_vue_type_style_index_0_scoped_f43f10e6_lang="",Condition=_export_sfc$1(_sfc_main$7,[["__scopeId","data-v-f43f10e6"]]),_sfc_main$6=vue.defineComponent({__name:"bind-anchor",props:{modelValue:{},title:{}},emits:["update:modelValue"],setup(i,{emit:r}){const n=useGlobalStore(pinia),o=r,a=i,u=vue.computed({get(){return a.modelValue!==null},set(g){let p=null;g&&(p={target_id:"",type:""}),o("update:modelValue",p)}}),c=vue.computed({get(){var g;return((g=a.modelValue)==null?void 0:g.target_id)??void 0},set(g){let p=null;u.value&&(p={target_id:g,type:d.value}),o("update:modelValue",p)}}),d=vue.computed({get(){var g;return((g=a.modelValue)==null?void 0:g.type)??void 0},set(g){let p=null;u.value&&(p={target_id:c.value,type:g}),o("update:modelValue",p)}}),f=vue.computed(()=>n.done_json.filter(g=>g.type!==EDoneJsonType.ConnectionLine).map(g=>({label:g.title,value:g.id}))),h=[{label:"上锚点",value:ELineBindAnchors.TopCenter},{label:"右锚点",value:ELineBindAnchors.Right},{label:"下锚点",value:ELineBindAnchors.BottomCenter},{label:"左锚点",value:ELineBindAnchors.Left}];function y(){vue.nextTick(function(){var g,p;if(u.value&&((g=a.modelValue)!=null&&g.target_id)&&((p=a.modelValue)!=null&&p.type)&&n.handle_svg_info){let v=null;for(let _ of n.done_json)_.id===a.modelValue.target_id&&(v=_);v&&(setSvgActualInfo(v),moveAnchors(v))}})}return(g,p)=>(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:a.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(u),"onUpdate:modelValue":p[0]||(p[0]=v=>vue.isRef(u)?u.value=v:null),onChange:y},null,8,["modelValue"])]),_:1},8,["label"]),vue.unref(u)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"绑定对象",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(c),"onUpdate:modelValue":p[1]||(p[1]=v=>vue.isRef(c)?c.value=v:null),onChange:y},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(f),v=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:v.value,label:v.label,value:v.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(u)?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"绑定位置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(d),"onUpdate:modelValue":p[2]||(p[2]=v=>vue.isRef(d)?d.value=v:null),onChange:y},{default:vue.withCtx(()=>[(vue.openBlock(),vue.createElementBlock(vue.Fragment,null,vue.renderList(h,v=>vue.createVNode(vue.unref(elementPlus.ElOption),{key:v.value,label:v.label,value:v.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)],64))}}),_withScopeId=i=>(vue.pushScopeId("data-v-501a0a37"),i=i(),vue.popScopeId(),i),_hoisted_1$3=_withScopeId(()=>vue.createElementVNode("span",{style:{"font-weight":"bold"}},"MQTT",-1)),_hoisted_2$2=_withScopeId(()=>vue.createElementVNode("span",{style:{color:"#999"}},"(开启后这里无需配置)",-1)),_hoisted_3$1={key:2},_hoisted_4$1={class:"events-title"},_sfc_main$5=vue.defineComponent({__name:"right-panel",setup(i){const r=useConfigStore(pinia),n=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=vue.ref("page"),u=vue.ref("style"),c=(_,b)=>{_!=null&&_.common_animations&&(_.common_animations.val=b)};r.$subscribe((_,b)=>{_.storeId==="config-store"&&localStorage.setItem("svg-editor-config",JSON.stringify(b))});const d=vue.ref(numberArray(20)),f=vue.ref(["MQTT"]),h=vue.ref();h.value=()=>{var b,A;let _={type:EEventType.Null,action:EEventAction.Null,target:"",scripts:"",condition:{type:EConditionType.None}};(A=(b=n.handle_svg_info)==null?void 0:b.info)==null||A.events.push(_)};const y=(_,b)=>{_==="ChangeAttr"?b.attrs=[{key:"",val:""}]:delete b.attrs},g=_=>{var b,A;(A=(b=n.handle_svg_info)==null?void 0:b.info)==null||A.events.splice(_,1)},p=()=>{o.center_offset={x:0,y:0}},v=(_,b,A)=>{vue.nextTick(function(){if(n.handle_svg_info){const w=n.done_json[n.handle_svg_info.index];A?setSvgActualInfo(w,A):setSvgActualInfo(w),moveAnchors(w)}})};return(_,b)=>vue.unref(n).intention!=vue.unref(EGlobalStoreIntention).Select?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:0,class:"mx-2 rightTabs",modelValue:vue.unref(a),"onUpdate:modelValue":b[14]||(b[14]=A=>vue.isRef(a)?a.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"图纸",name:"page"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"背景色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(r).svg.background_color,"onUpdate:modelValue":b[0]||(b[0]=A=>vue.unref(r).svg.background_color=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"画布",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{size:"small",onClick:p,icon:vue.unref(aim_default)},{default:vue.withCtx(()=>[vue.createTextVNode("重置位置")]),_:1},8,["icon"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.x,"onUpdate:modelValue":b[1]||(b[1]=A=>vue.unref(o).center_offset.x=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y轴偏移",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(o).center_offset.y,"onUpdate:modelValue":b[2]||(b[2]=A=>vue.unref(o).center_offset.y=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(r).svg.scale,"onUpdate:modelValue":b[3]||(b[3]=A=>vue.unref(r).svg.scale=A),step:.1,"step-strictly":""},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标尺",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).svg.ruler,"onUpdate:modelValue":b[4]||(b[4]=A=>vue.unref(r).svg.ruler=A)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"网格",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).svg.grid,"onUpdate:modelValue":b[5]||(b[5]=A=>vue.unref(r).svg.grid=A)},null,8,["modelValue"])]),_:1}),vue.unref(r).svg.grid?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"网格颜色",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElColorPicker),{modelValue:vue.unref(r).svg.grid_color,"onUpdate:modelValue":b[6]||(b[6]=A=>vue.unref(r).svg.grid_color=A)},null,8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0)]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"连线",name:"line"},{default:vue.withCtx(()=>[vue.unref(r).connection_line.props?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(r).connection_line.props,hide:["point_position"]},null,8,["obj-info"])]),_:1})):vue.createCommentVNode("",!0),vue.unref(r).connection_line.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:vue.unref(r).connection_line.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(r).connection_line.animations.type.val,"onUpdate:modelValue":b[7]||(b[7]=A=>vue.unref(r).connection_line.animations.type.val=A),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(r).connection_line.animations.type.options,A=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:A.value,label:A.label,value:A.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"]),vue.unref(r).connection_line.animations.type.val!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:0,"obj-info":vue.unref(r).connection_line.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0)]),_:1})):vue.createCommentVNode("",!0)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"通信",name:"net"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(f),"onUpdate:modelValue":b[13]||(b[13]=A=>vue.isRef(f)?f.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElCollapseItem),{name:"MQTT"},{title:vue.withCtx(()=>[_hoisted_1$3]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"外部配置",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(r).net.mqtt.useGlobalMqtt,"onUpdate:modelValue":b[8]||(b[8]=A=>vue.unref(r).net.mqtt.useGlobalMqtt=A)},null,8,["modelValue"]),_hoisted_2$2]),_:1}),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"URL",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.url,"onUpdate:modelValue":b[9]||(b[9]=A=>vue.unref(r).net.mqtt.url=A),placeholder:"如 ws://127.0.0.1:4500"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"用户名",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.user,"onUpdate:modelValue":b[10]||(b[10]=A=>vue.unref(r).net.mqtt.user=A),placeholder:"username"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"密码",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.pwd,"onUpdate:modelValue":b[11]||(b[11]=A=>vue.unref(r).net.mqtt.pwd=A),placeholder:"password"},null,8,["modelValue"])]),_:1})),vue.unref(r).net.mqtt.useGlobalMqtt?vue.createCommentVNode("",!0):(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:"Topics",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(r).net.mqtt.topics,"onUpdate:modelValue":b[12]||(b[12]=A=>vue.unref(r).net.mqtt.topics=A),placeholder:"topics"},null,8,["modelValue"])]),_:1}))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$u)]),_:1})]),_:1},8,["modelValue"])):vue.unref(n).intention==vue.unref(EGlobalStoreIntention).Select&&vue.unref(n).handle_svg_info?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElTabs),{key:1,class:"mx-2 rightTabs",modelValue:vue.unref(u),"onUpdate:modelValue":b[35]||(b[35]=A=>vue.isRef(u)?u.value=A:null)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"外观",name:"style"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,S,T;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"标题",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.title,"onUpdate:modelValue":b[15]||(b[15]=x=>vue.unref(n).handle_svg_info.info.title=x)},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.x,"onUpdate:modelValue":b[16]||(b[16]=x=>vue.unref(n).handle_svg_info.info.x=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y坐标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.y,"onUpdate:modelValue":b[17]||(b[17]=x=>vue.unref(n).handle_svg_info.info.y=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"X缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.scale_x,"onUpdate:modelValue":b[18]||(b[18]=x=>vue.unref(n).handle_svg_info.info.scale_x=x),onChange:v},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(w=(A=vue.unref(n).handle_svg_info)==null?void 0:A.info)==null?void 0:w.config.can_zoom]]),vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"Y缩放",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.scale_y,"onUpdate:modelValue":b[19]||(b[19]=x=>vue.unref(n).handle_svg_info.info.scale_y=x),onChange:v},null,8,["modelValue"])]),_:1},512),[[vue.vShow,(T=(S=vue.unref(n).handle_svg_info)==null?void 0:S.info)==null?void 0:T.config.can_zoom]]),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"旋转",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInputNumber),{modelValue:vue.unref(n).handle_svg_info.info.rotate,"onUpdate:modelValue":b[20]||(b[20]=x=>vue.unref(n).handle_svg_info.info.rotate=x),onChange:v},null,8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"显示",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSwitch),{modelValue:vue.unref(n).handle_svg_info.info.display,"onUpdate:modelValue":b[21]||(b[21]=x=>vue.unref(n).handle_svg_info.info.display=x)},null,8,["modelValue"])]),_:1})]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"数据",name:"data"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>{var A,w,S,T,x,M,L,O;return[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"ID",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.id,"onUpdate:modelValue":b[22]||(b[22]=re=>vue.unref(n).handle_svg_info.info.id=re)},null,8,["modelValue"])]),_:1}),(w=(A=vue.unref(n).handle_svg_info)==null?void 0:A.info)!=null&&w.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,class:"props-row",label:"state",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(n).handle_svg_info.info.defaultState),1)]),_:1})):vue.createCommentVNode("",!0),(T=(S=vue.unref(n).handle_svg_info)==null?void 0:S.info)!=null&&T.state?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:1,label:"状态",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.defaultState,"onUpdate:modelValue":b[23]||(b[23]=re=>vue.unref(n).handle_svg_info.info.defaultState=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.state,(re,D)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:"state"+String(D),label:re.label,value:D},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):vue.createCommentVNode("",!0),(x=vue.unref(n).handle_svg_info.info)!=null&&x.hasOwnProperty("tag_slot")?(vue.openBlock(),vue.createElementBlock("div",_hoisted_3$1,[vue.createVNode(vue.unref(elementPlus.ElFormItem),{class:"props-row",label:"tag_slot",size:"small"},{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(vue.unref(n).handle_svg_info.info.tag_slot),1)]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"文字插槽",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:vue.unref(n).handle_svg_info.info.tag_slot,"onUpdate:modelValue":b[24]||(b[24]=re=>vue.unref(n).handle_svg_info.info.tag_slot=re),onInput:b[25]||(b[25]=re=>v(re,null,!0))},null,8,["modelValue"])]),_:1})])):vue.createCommentVNode("",!0),vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).handle_svg_info.info.props,code:"",onChange:b[26]||(b[26]=re=>v(re,null,!0))},null,8,["obj-info"]),vue.unref(n).handle_svg_info.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:3,label:vue.unref(n).handle_svg_info.info.animations.type.title,size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.animations.type.val,"onUpdate:modelValue":b[27]||(b[27]=re=>vue.unref(n).handle_svg_info.info.animations.type.val=re),placeholder:"Select",size:"small"},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.animations.type.options,re=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElOption),{key:re.value,label:re.label,value:re.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label"])):vue.createCommentVNode("",!0),((M=vue.unref(n).handle_svg_info.info.animations)==null?void 0:M.type.val)!=="None"?(vue.openBlock(),vue.createBlock(DynamicElFormItem,{key:4,"obj-info":vue.unref(n).handle_svg_info.info.animations,hide:["type","repeatCount"]},null,8,["obj-info"])):vue.createCommentVNode("",!0),((L=vue.unref(n).handle_svg_info)==null?void 0:L.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:5,modelValue:vue.unref(n).handle_svg_info.info.bind_anchors.start,"onUpdate:modelValue":b[28]||(b[28]=re=>vue.unref(n).handle_svg_info.info.bind_anchors.start=re),title:"绑定起点"},null,8,["modelValue"])):vue.createCommentVNode("",!0),((O=vue.unref(n).handle_svg_info)==null?void 0:O.info.type)===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$6,{key:6,modelValue:vue.unref(n).handle_svg_info.info.bind_anchors.end,"onUpdate:modelValue":b[29]||(b[29]=re=>vue.unref(n).handle_svg_info.info.bind_anchors.end=re),title:"绑定终点"},null,8,["modelValue"])):vue.createCommentVNode("",!0)]}),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"事件",name:"event"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",style:{width:"100%"},onClick:vue.unref(h)},{default:vue.withCtx(()=>[vue.createTextVNode("添加事件")]),_:1},8,["onClick"]),vue.createVNode(vue.unref(elementPlus.ElCollapse),{modelValue:vue.unref(d),"onUpdate:modelValue":b[30]||(b[30]=A=>vue.isRef(d)?d.value=A:null)},{default:vue.withCtx(()=>[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(n).handle_svg_info.info.events,(A,w)=>(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElCollapseItem),{name:w,key:"event"+w},{title:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_4$1,[vue.createElementVNode("span",null,"事件"+vue.toDisplayString(w+1),1),vue.createVNode(vue.unref(elementPlus.ElIcon),{size:16,class:"bt-Icon",onClick:vue.withModifiers(S=>g(w),["stop"])},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$E,{name:"delete"})]),_:2},1032,["onClick"])])]),default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElForm),{"label-width":"90px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"类型",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.type,"onUpdate:modelValue":S=>A.type=S},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Click",label:"点击"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Change",label:"值改变"})]),_:2},1032,["modelValue","onUpdate:modelValue"])]),_:2},1024),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"行为",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:A.action,"onUpdate:modelValue":S=>A.action=S,onChange:S=>y(S,A)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"ChangeAttr",label:"改变属性"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"JavaScript",label:"执行 JavaScript"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"Emit",label:"emit 事件"})]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:2},1024),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:0,label:"目标",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElInput),{modelValue:A.target,"onUpdate:modelValue":S=>A.target=S,placeholder:"默认自身"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),A.action==="ChangeAttr"?(vue.openBlock(),vue.createBlock(List,{key:1,modelValue:A.attrs,"onUpdate:modelValue":S=>A.attrs=S},null,8,["modelValue","onUpdate:modelValue"])):vue.createCommentVNode("",!0),A.action==="JavaScript"?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElFormItem),{key:2,label:"JavaScript",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$x,{modelValue:A.scripts,"onUpdate:modelValue":S=>A.scripts=S,lang:"javascript"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):vue.createCommentVNode("",!0),vue.createVNode(Condition,{modelValue:A.condition,"onUpdate:modelValue":S=>A.condition=S},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)]),_:2},1032,["name"]))),128))]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"动效",name:"animation"},{default:vue.withCtx(()=>{var A;return[(A=vue.unref(n).handle_svg_info)!=null&&A.info.animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:0,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(DynamicElFormItem,{"obj-info":vue.unref(n).handle_svg_info.info.animations},null,8,["obj-info"])]),_:1})):vue.unref(n).handle_svg_info.info.common_animations?(vue.openBlock(),vue.createBlock(vue.unref(elementPlus.ElForm),{key:1,"label-width":"60px","label-position":"left"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画效果",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(CommonAnimate,{onUpdateCommonAniVal:b[31]||(b[31]=w=>{var S;return c((S=vue.unref(n).handle_svg_info)==null?void 0:S.info,w)}),val:vue.unref(n).handle_svg_info.info.common_animations.val},null,8,["val"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"延迟",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.delay,"onUpdate:modelValue":b[32]||(b[32]=w=>vue.unref(n).handle_svg_info.info.common_animations.delay=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-0s",label:"无"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-1s",label:"1秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-2s",label:"2秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-3s",label:"3秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-4s",label:"4秒"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"delay-5s",label:"5秒"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"动画速度",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.speed,"onUpdate:modelValue":b[33]||(b[33]=w=>vue.unref(n).handle_svg_info.info.common_animations.speed=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slow",label:"慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"slower",label:"最慢"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"fast",label:"快"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"faster",label:"最快"})]),_:1},8,["modelValue"])]),_:1}),vue.createVNode(vue.unref(elementPlus.ElFormItem),{label:"循环次数",size:"small"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElSelect),{modelValue:vue.unref(n).handle_svg_info.info.common_animations.repeat,"onUpdate:modelValue":b[34]||(b[34]=w=>vue.unref(n).handle_svg_info.info.common_animations.repeat=w)},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-1",label:"一次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-2",label:"两次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"repeat-3",label:"三次"}),vue.createVNode(vue.unref(elementPlus.ElOption),{value:"infinite",label:"无限次"})]),_:1},8,["modelValue"])]),_:1})]),_:1})):vue.createCommentVNode("",!0)]}),_:1}),vue.createVNode(vue.unref(elementPlus.ElTabPane),{label:"结构",name:"tree"},{default:vue.withCtx(()=>[vue.createVNode(_sfc_main$u)]),_:1})]),_:1},8,["modelValue"])):vue.createCommentVNode("",!0)}}),rightPanel_vue_vue_type_style_index_0_scoped_501a0a37_lang="",rightPanel_vue_vue_type_style_index_1_lang="",RightPanel=_export_sfc$1(_sfc_main$5,[["__scopeId","data-v-501a0a37"]]),_sfc_main$4=vue.defineComponent({__name:"export-json",setup(i){const r=vue.ref(""),n=useGlobalStore(pinia),o=useSvgEditLayoutStore(pinia),a=useConfigStore(pinia);return vue.onMounted(()=>{const u={layout_center:o.center_offset,config:a.$state,done_json:n.done_json};r.value=JSON.stringify(u,null,2)}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(r),"onUpdate:value":c[0]||(c[0]=d=>vue.isRef(r)?r.value=d:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_sfc_main$3=vue.defineComponent({__name:"import-json",setup(i,{expose:r}){const n=vue.ref("");return r({setVal:u=>{n.value=u},onImportJson:()=>{useImportDataModel(n.value)&&elementPlus.ElMessage.success("导入成功")}}),(u,c)=>(vue.openBlock(),vue.createBlock(vue.unref(VAceEditor),{value:vue.unref(n),"onUpdate:value":c[0]||(c[0]=d=>vue.isRef(n)?n.value=d:null),lang:"json",theme:"kr_theme",style:{height:"400px"},options:{useWorker:!0,enableBasicAutocompletion:!0,enableSnippets:!0,enableLiveAutocompletion:!0}},null,8,["value"]))}}),_hoisted_1$2=["title","onMousedown"],_hoisted_2$1={class:"vue-ruler-content-mask"},_sfc_main$2=vue.defineComponent({__name:"vue3-ruler-tool",props:{visible:{type:Boolean,default:!0},stepLength:{default:100}},emits:["onLineMouseUp"],setup(i,{emit:r}){const n=r,o=i,a=useSvgEditLayoutStore(pinia),u=useConfigStore(pinia),c=function(){return function(Ie,de,ze){Ie&&de&&ze&&Ie.addEventListener(de,ze,!1)}}(),d=function(){return function(Ie,de,ze){Ie&&de&&Ie.removeEventListener(de,ze,!1)}}();let f=18,h=vue.ref(0),y=vue.ref(0),g=vue.ref([]),p=vue.ref([]);const v=vue.ref([]);let _=vue.ref(!1),b="",A=vue.ref(-999),w=vue.ref(-999),S=18,T=18,x="";const M=vue.ref(null),L=vue.ref(null),O=vue.ref(null),re=vue.ref(null),D=vue.computed(()=>({width:h.value+"px",height:y.value+"px"})),z=vue.computed(()=>({padding:f+"px 0px 0px "+f+"px"})),V=vue.computed(()=>{let Ie=0,de=0;return v.value.map(ze=>{const xe=ze.type==="h";return{id:`${ze.type}_${xe?Ie++:de++}`,type:ze.type,title:ze.site.toFixed(0)+"px",[xe?"top":"left"]:ze.site*u.svg.scale+f+a.center_offset[xe?"y":"x"]*u.svg.scale}})});a.$subscribe(Ie=>{var de,ze,xe,Ne;((ze=(de=Ie.events)==null?void 0:de.target)!=null&&ze.hasOwnProperty("left_nav")||(Ne=(xe=Ie.events)==null?void 0:xe.target)!=null&&Ne.hasOwnProperty("right_nav"))&&window.setTimeout(j,420)}),u.$subscribe(Ie=>{var de,ze;(ze=(de=Ie.events)==null?void 0:de.target)!=null&&ze.hasOwnProperty("scale")&&$e()}),vue.onMounted(()=>{c(document,"mousemove",Oe),c(document,"mouseup",In),j(),c(window,"resize",F)}),vue.onBeforeUnmount(()=>{d(document,"mousemove",Oe),d(document,"mouseup",In),d(window,"resize",F)});const j=()=>{pe(),$e()},F=()=>{g.value=[],p.value=[],j()},Ce=({type:Ie,top:de,left:ze})=>Ie==="h"?{top:de+"px"}:{left:ze+"px"},le=({type:Ie,id:de})=>Ie==="h"?jt(de):hn(de),pe=()=>{const Ie=window.getComputedStyle(L.value.parentNode,null);h.value=parseInt(Ie.getPropertyValue("width")),y.value=parseInt(Ie.getPropertyValue("height")),S=O.value.clientWidth,T=re.value.clientHeight},$e=()=>{Fe(g.value,h.value,a.center_offset.x),Fe(p.value,y.value,a.center_offset.y)},Fe=(Ie,de,ze)=>{if(Ie.length===0)for(let xe=0;xe<de;xe+=o.stepLength)xe%o.stepLength===0&&Ie.push({id:myFixed(xe/u.svg.scale-ze,0)});else Ie.forEach((xe,Ne)=>{xe.id=myFixed(Ne*o.stepLength/u.svg.scale-ze,0)})},Oe=Ie=>{$e(),Et(Ie)},Et=Ie=>{if(!(Ie.layerX===Ie.x||Ie.layerY===Ie.y))switch(b){case"x":_.value&&(w.value=Ie.layerY);break;case"y":_.value&&(A.value=Ie.layerX);break;case"h":_.value&&(w.value=Ie.layerY);break;case"v":_.value&&(A.value=Ie.layerX);break}},he=Ie=>{_.value=!0,b=Ie},In=Ie=>{vn(Ie)},vn=Ie=>{if(_.value){switch(_.value=!1,b){case"x":const de=Math.round((Ie.layerY-f)/u.svg.scale-a.center_offset.y);if(de<=0){w.value=-999;return}v.value.push({type:"h",site:de});break;case"y":const ze=Math.round((Ie.layerX-f)/u.svg.scale-a.center_offset.x);if(ze<=0){A.value=-999;return}v.value.push({type:"v",site:ze});break;case"h":kt(v.value,Math.round((Ie.layerY-f)/u.svg.scale-a.center_offset.y),Math.round(T/u.svg.scale-a.center_offset.y),"h");break;case"v":kt(v.value,Math.round((Ie.layerX-f)/u.svg.scale-a.center_offset.x),Math.round(S/u.svg.scale-a.center_offset.x),"v");break}w.value=A.value=-999}},kt=(Ie,de,ze,xe)=>{if(de<ze){let Ne;V.value.forEach((Lt,Dt)=>{Lt.id===x&&(Ne=Dt)}),Ie.splice(Ne,1)}else{let Ne;V.value.forEach((Lt,Dt)=>{Lt.id===x&&(Ne=Dt)}),Ie.splice(Ne,1,{type:xe,site:de})}},ue=()=>{he("x")},At=()=>{he("y")},jt=Ie=>{_.value=!0,b="h",x=Ie},hn=Ie=>{_.value=!0,b="v",x=Ie},Pt=()=>{n("onLineMouseUp")};return(Ie,de)=>(vue.openBlock(),vue.createElementBlock("div",{style:vue.normalizeStyle(vue.unref(D)),class:"vue-ruler-wrapper",onselectStart:"return false;",ref_key:"el",ref:L},[vue.withDirectives(vue.createElementVNode("section",null,[vue.createElementVNode("div",{ref_key:"horizontalRuler",ref:re,class:"vue-ruler-h",onMousedown:vue.withModifiers(ue,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(g),(ze,xe)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({left:xe*Ie.stepLength+"px"}),class:"n"},vue.toDisplayString(ze.id),5))),256))],544),vue.createElementVNode("div",{ref_key:"verticalRuler",ref:O,class:"vue-ruler-v",onMousedown:vue.withModifiers(At,["stop"])},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(p),(ze,xe)=>(vue.openBlock(),vue.createElementBlock("span",{style:vue.normalizeStyle({top:xe*Ie.stepLength+"px"}),class:"n"},vue.toDisplayString(ze.id),5))),256))],544),vue.createElementVNode("div",{style:vue.normalizeStyle({top:vue.unref(w)+"px"}),class:"vue-ruler-ref-dot-h"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(w)-vue.unref(T))/vue.unref(u).svg.scale-vue.unref(a).center_offset.y)),1)],4),vue.createElementVNode("div",{style:vue.normalizeStyle({left:vue.unref(A)+"px"}),class:"vue-ruler-ref-dot-v"},[vue.createElementVNode("span",null,vue.toDisplayString(Math.round((vue.unref(A)-vue.unref(S))/vue.unref(u).svg.scale-vue.unref(a).center_offset.x)),1)],4),(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(V),ze=>(vue.openBlock(),vue.createElementBlock("div",{title:ze.title,style:vue.normalizeStyle(Ce(ze)),key:ze.id,class:vue.normalizeClass(`vue-ruler-ref-line-${ze.type}`),onMousedown:xe=>le(ze),onMouseup:Pt,onContextmenu:de[0]||(de[0]=(...xe)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...xe))},null,46,_hoisted_1$2))),128))],512),[[vue.vShow,o.visible]]),vue.createElementVNode("div",{ref_key:"content",ref:M,class:"vue-ruler-content",style:vue.normalizeStyle(vue.unref(z))},[vue.renderSlot(Ie.$slots,"default")],4),vue.withDirectives(vue.createElementVNode("div",_hoisted_2$1,null,512),[[vue.vShow,vue.unref(_)]])],4))}}),vue3RulerTool_vue_vue_type_style_index_0_lang="";function fileWrite(i,r=new Date(Date.now()).toLocaleString()){const n=JSON.stringify(i),o=new Blob([n]);let a=document.createElement("a");a.download=r+".json",a.style.display="none",a.href=URL.createObjectURL(o),document.body.appendChild(a),a.click(),document.body.removeChild(a)}function fileRead(i){return new Promise((r,n)=>{let o=new FileReader;o.readAsText(i,"UTF-8"),o.onload=function(a){a&&a.target?r(a.target.result):n("文件读取错误")}})}const _hoisted_1$1={class:"canvas-main-pc"},_sfc_main$1=vue.defineComponent({__name:"index",props:{customToolbar:{},vueComp:{},data:{},saveFile:{type:Boolean,default:!1},mqtt:{default:()=>({cover:!1,url:"",user:"",pwd:"",topics:""})}},emits:["onReturn","onPreview","onSave"],setup(i,{expose:r,emit:n}){setEditorLoadTime();const o=n,a=i,u=useGlobalStore(pinia),c=useSvgEditLayoutStore(pinia),d=useConfigStore(pinia),f=useEditPrivateStore(pinia),h=vue.ref(),y=vue.ref(),g=vue.reactive({[EVisibleConfKey.ExportJson]:!1,[EVisibleConfKey.ImportJson]:!1,[EVisibleConfKey.ImportFile]:!1}),p=(x,M)=>{g[x]=M},v=vue.ref();v.value=()=>{y.value.onImportJson(),p(EVisibleConfKey.ImportJson,!1)};const _=x=>["text/plain","application/json"].indexOf(x.type)<0?(elementPlus.ElMessage.error("仅支持的格式:txt、json"),!1):(fileRead(x).then(M=>{y.value.setVal(M),elementPlus.ElMessage.success("文件读取成功!")}),!1),b=x=>{u.setDoneJson(x)};vue.onMounted(()=>{f.history_doneComponent=[],f.history_now_index=0,a.data?useImportDataModel(a.data):u.setDoneJson([]),u.intention=EGlobalStoreIntention.None});const{appContext:A}=vue.getCurrentInstance();function w(x){o("onReturn",{data:x,isChange:f.getTopBtnUndoStatus})}function S(x){a.saveFile?elementPlus.ElMessageBox.prompt("请输入文件名","保存",{cancelButtonText:"取消",confirmButtonText:"保存"},A).then(M=>{fileWrite(x,M.value.trim()),o("onSave",x)}).catch(M=>{console.log(M)}):o("onSave",x)}function T(){h.value.onCanvasMouseUp()}return vue.onMounted(()=>{var x,M,L,O,re;d.net.mqtt.useGlobalMqtt=!!((x=a.mqtt)!=null&&x.cover),d.net.mqtt.global||(d.net.mqtt.global={url:"",user:"",pwd:"",topics:""}),d.net.mqtt.global.url=((M=a.mqtt)==null?void 0:M.url)||"",d.net.mqtt.global.user=((L=a.mqtt)==null?void 0:L.user)||"",d.net.mqtt.global.pwd=((O=a.mqtt)==null?void 0:O.pwd)||"",d.net.mqtt.global.topics=((re=a.mqtt)==null?void 0:re.topics)||""}),r({setGraphNodeJson:b}),(x,M)=>(vue.openBlock(),vue.createElementBlock("div",null,[vue.createVNode(vue.unref(elementPlus.ElContainer),null,{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElHeader),{class:"top-el-header"},{default:vue.withCtx(()=>[vue.createVNode(TopPanel,{onChangeVisible:p,onOnReturn:w,onOnPreview:M[0]||(M[0]=L=>o("onPreview",L)),onOnSave:S})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElContainer),{class:"middle"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(c).left_nav?"show-nav":"hide-nav"]),style:{"border-right":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(LeftPanel,{class:"content-left","custom-toolbar":a.customToolbar},null,8,["custom-toolbar"])]),_:1})]),_:1},8,["class"]),vue.createVNode(vue.unref(elementPlus.ElMain),{class:"middle main"},{default:vue.withCtx(()=>[vue.createElementVNode("div",_hoisted_1$1,[vue.createVNode(_sfc_main$2,{class:"canvas-main-pc",visible:vue.unref(d).svg.ruler,onOnLineMouseUp:T},{default:vue.withCtx(()=>[vue.createVNode(CenterPanel,{ref_key:"centerRef",ref:h,vueComp:a.vueComp},{background:vue.withCtx(()=>[vue.renderSlot(x.$slots,"background",{},void 0,!0)]),_:3},8,["vueComp"])]),_:3},8,["visible"])])]),_:3}),vue.createVNode(vue.unref(elementPlus.ElAside),{class:vue.normalizeClass(["side-nav",vue.unref(c).right_nav?"show-nav":"hide-nav"]),style:{"border-left":"1px solid #efefef"}},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElScrollbar),{class:"el-scroll-pc"},{default:vue.withCtx(()=>[vue.createVNode(RightPanel)]),_:1})]),_:1},8,["class"])]),_:3})]),_:3}),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(g).ImportJson,"onUpdate:modelValue":M[2]||(M[2]=L=>vue.unref(g).ImportJson=L),title:"导入数据",width:"60%","destroy-on-close":""},{footer:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElUpload),{beforeUpload:_,style:{display:"inline-flex","margin-right":"12px"},multiple:!1,"show-file-list":!1,limit:1},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(elementPlus.ElButton),{onClick:M[1]||(M[1]=L=>p(vue.unref(EVisibleConfKey).ImportFile,!0))},{default:vue.withCtx(()=>[vue.createTextVNode("读取文件")]),_:1})]),_:1}),vue.createVNode(vue.unref(elementPlus.ElButton),{type:"primary",onClick:vue.unref(v)},{default:vue.withCtx(()=>[vue.createTextVNode("导入数据")]),_:1},8,["onClick"])]),default:vue.withCtx(()=>[vue.createVNode(_sfc_main$3,{ref_key:"importJsonRef",ref:y},null,512)]),_:1},8,["modelValue"]),vue.createVNode(vue.unref(elementPlus.ElDialog),{class:"modal-full",modelValue:vue.unref(g).ExportJson,"onUpdate:modelValue":M[3]||(M[3]=L=>vue.unref(g).ExportJson=L),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_1f7d33b9_lang="",index=_export_sfc$1(_sfc_main$1,[["__scopeId","data-v-1f7d33b9"]]);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,r){(function(n){i.exports=n()})(function(){return function(){function n(o,a,u){function c(h,y){if(!a[h]){if(!o[h]){var g=typeof commonjsRequire=="function"&&commonjsRequire;if(!y&&g)return g(h,!0);if(d)return d(h,!0);var p=new Error("Cannot find module '"+h+"'");throw p.code="MODULE_NOT_FOUND",p}var v=a[h]={exports:{}};o[h][0].call(v.exports,function(_){var b=o[h][1][_];return c(b||_)},v,v.exports,n,o,a,u)}return a[h].exports}for(var d=typeof commonjsRequire=="function"&&commonjsRequire,f=0;f<u.length;f++)c(u[f]);return c}return n}()({1:[function(n,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0}),a.TypedEventEmitter=void 0;const c=u(n("events")),d=n("./shared");class f{}a.TypedEventEmitter=f,(0,d.applyMixin)(f,c.default)},{"./shared":17,events:49}],2:[function(n,o,a){(function(u,c){(function(){var d=this&&this.__createBinding||(Object.create?function(V,j,F,Ce){Ce===void 0&&(Ce=F);var le=Object.getOwnPropertyDescriptor(j,F);(!le||("get"in le?!j.__esModule:le.writable||le.configurable))&&(le={enumerable:!0,get:function(){return j[F]}}),Object.defineProperty(V,Ce,le)}:function(V,j,F,Ce){Ce===void 0&&(Ce=F),V[Ce]=j[F]}),f=this&&this.__setModuleDefault||(Object.create?function(V,j){Object.defineProperty(V,"default",{enumerable:!0,value:j})}:function(V,j){V.default=j}),h=this&&this.__importStar||function(V){if(V&&V.__esModule)return V;var j={};if(V!=null)for(var F in V)F!=="default"&&Object.prototype.hasOwnProperty.call(V,F)&&d(j,V,F);return f(j,V),j},y=this&&this.__importDefault||function(V){return V&&V.__esModule?V:{default:V}};Object.defineProperty(a,"__esModule",{value:!0});const g=y(n("./topic-alias-recv")),p=y(n("mqtt-packet")),v=y(n("./default-message-id-provider")),_=n("readable-stream"),b=y(n("reinterval")),A=y(n("rfdc/default")),w=h(n("./validations")),S=y(n("debug")),T=y(n("./store")),x=y(n("./handlers")),M=n("./TypedEmitter"),L=u?u.nextTick:V=>{setTimeout(V,0)},O=c.setImmediate||((...V)=>{const j=V.shift();L(()=>{j(...V)})}),re={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,writeCache:!0},D=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND","ETIMEDOUT"];class z extends M.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(j,F){super(),this.options=F||{};for(const Ce in re)typeof this.options[Ce]>"u"?this.options[Ce]=re[Ce]:this.options[Ce]=F[Ce];this.log=this.options.log||(0,S.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: options.protocol",F.protocol),this.log("MqttClient :: options.protocolVersion",F.protocolVersion),this.log("MqttClient :: options.username",F.username),this.log("MqttClient :: options.keepalive",F.keepalive),this.log("MqttClient :: options.reconnectPeriod",F.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",F.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",F.properties?F.properties.topicAliasMaximum:void 0),this.options.clientId=typeof F.clientId=="string"?F.clientId:z.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=F.protocolVersion===5&&F.customHandleAcks?F.customHandleAcks:(...Ce)=>{Ce[3](null,0)},this.options.writeCache||(p.default.writeToStream.cacheNumbers=!1),this.streamBuilder=j,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new v.default:this.options.messageIdProvider,this.outgoingStore=F.outgoingStore||new T.default,this.incomingStore=F.incomingStore||new T.default,this.queueQoSZero=F.queueQoSZero===void 0?!0:F.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,F.properties&&F.properties.topicAliasMaximum>0&&(F.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default(F.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:Ce}=this,le=()=>{const pe=Ce.shift();this.log("deliver :: entry %o",pe);let $e=null;if(!pe){this._resubscribe();return}$e=pe.packet,this.log("deliver :: call _sendPacket for %o",$e);let Fe=!0;$e.messageId&&$e.messageId!==0&&(this.messageIdProvider.register($e.messageId)||(Fe=!1)),Fe?this._sendPacket($e,Oe=>{pe.cb&&pe.cb(Oe),le()}):(this.log("messageId: %d has already used. The message is skipped and removed.",$e.messageId),le())};this.log("connect :: sending queued packets"),le()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer!==null&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(j,F){F()}handleMessage(j,F){F()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var j;const F=new _.Writable,Ce=p.default.parser(this.options);let le=null;const pe=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),Ce.on("packet",he=>{this.log("parser :: on packet push to packets array."),pe.push(he)});const $e=()=>{this.log("work :: getting next packet in queue");const he=pe.shift();if(he)this.log("work :: packet pulled from queue"),(0,x.default)(this,he,Fe);else{this.log("work :: no packets in queue");const In=le;le=null,this.log("work :: done flag is %s",!!In),In&&In()}},Fe=()=>{if(pe.length)L($e);else{const he=le;le=null,he()}};F._write=(he,In,vn)=>{le=vn,this.log("writable stream :: parsing buffer"),Ce.parse(he),$e()};const Oe=he=>{this.log("streamErrorHandler :: error",he.message),D.includes(he.code)?(this.log("streamErrorHandler :: emitting error"),this.emit("error",he)):this.noop(he)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(F),this.stream.on("error",Oe),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const Et={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(Et.will=Object.assign(Object.assign({},this.options.will),{payload:(j=this.options.will)===null||j===void 0?void 0:j.payload})),this.topicAliasRecv&&(Et.properties||(Et.properties={}),this.topicAliasRecv&&(Et.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(Et),Ce.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.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 he=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(he)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0)},this.options.connectTimeout),this}publish(j,F,Ce,le){this.log("publish :: message `%s` to topic `%s`",F,j);const{options:pe}=this;typeof Ce=="function"&&(le=Ce,Ce=null),Ce=Ce||{},Ce=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),Ce);const{qos:Fe,retain:Oe,dup:Et,properties:he,cbStorePut:In}=Ce;if(this._checkDisconnecting(le))return this;const vn=()=>{let kt=0;if((Fe===1||Fe===2)&&(kt=this._nextId(),kt===null))return this.log("No messageId left"),!1;const ue={cmd:"publish",topic:j,payload:F,qos:Fe,retain:Oe,messageId:kt,dup:Et};switch(pe.protocolVersion===5&&(ue.properties=he),this.log("publish :: qos",Fe),Fe){case 1:case 2:this.outgoing[ue.messageId]={volatile:!1,cb:le||this.noop},this.log("MqttClient:publish: packet cmd: %s",ue.cmd),this._sendPacket(ue,void 0,In);break;default:this.log("MqttClient:publish: packet cmd: %s",ue.cmd),this._sendPacket(ue,le,In);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,cbStorePut:Ce.cbStorePut,callback:le}),this}publishAsync(j,F,Ce){return new Promise((le,pe)=>{this.publish(j,F,Ce,($e,Fe)=>{$e?pe($e):le(Fe)})})}subscribe(j,F,Ce){const le=this.options.protocolVersion;typeof F=="function"&&(Ce=F),Ce=Ce||this.noop;let pe=!1,$e=[];typeof j=="string"?(j=[j],$e=j):Array.isArray(j)?$e=j:typeof j=="object"&&(pe=j.resubscribe,delete j.resubscribe,$e=Object.keys(j));const Fe=w.validateTopics($e);if(Fe!==null)return O(Ce,new Error(`Invalid topic ${Fe}`)),this;if(this._checkDisconnecting(Ce))return this.log("subscribe: discconecting true"),this;const Oe={qos:0};le===5&&(Oe.nl=!1,Oe.rap=!1,Oe.rh=0),F=Object.assign(Object.assign({},Oe),F);const Et=F.properties,he=[],In=(kt,ue)=>{if(ue=ue||F,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,kt)||this._resubscribeTopics[kt].qos<ue.qos||pe){const At={topic:kt,qos:ue.qos};le===5&&(At.nl=ue.nl,At.rap=ue.rap,At.rh=ue.rh,At.properties=Et),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",At.topic,At.qos),he.push(At)}};if(Array.isArray(j)?j.forEach(kt=>{this.log("subscribe: array topic %s",kt),In(kt)}):Object.keys(j).forEach(kt=>{this.log("subscribe: object topic %s, %o",kt,j[kt]),In(kt,j[kt])}),!he.length)return Ce(null,[]),this;const vn=()=>{const kt=this._nextId();if(kt===null)return this.log("No messageId left"),!1;const ue={cmd:"subscribe",subscriptions:he,messageId:kt};if(Et&&(ue.properties=Et),this.options.resubscribe){this.log("subscribe :: resubscribe true");const At=[];he.forEach(jt=>{if(this.options.reconnectPeriod>0){const hn={qos:jt.qos};le===5&&(hn.nl=jt.nl||!1,hn.rap=jt.rap||!1,hn.rh=jt.rh||0,hn.properties=jt.properties),this._resubscribeTopics[jt.topic]=hn,At.push(jt.topic)}}),this.messageIdToTopic[ue.messageId]=At}return this.outgoing[ue.messageId]={volatile:!0,cb(At,jt){if(!At){const{granted:hn}=jt;for(let Pt=0;Pt<hn.length;Pt+=1)he[Pt].qos=hn[Pt]}Ce(At,he)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(ue),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!vn())&&this._storeProcessingQueue.push({invoke:vn,callback:Ce}),this}subscribeAsync(j,F){return new Promise((Ce,le)=>{this.subscribe(j,F,(pe,$e)=>{pe?le(pe):Ce($e)})})}unsubscribe(j,F,Ce){typeof j=="string"&&(j=[j]),typeof F=="function"&&(Ce=F),Ce=Ce||this.noop;const le=w.validateTopics(j);if(le!==null)return O(Ce,new Error(`Invalid topic ${le}`)),this;if(this._checkDisconnecting(Ce))return this;const pe=()=>{const $e=this._nextId();if($e===null)return this.log("No messageId left"),!1;const Fe={cmd:"unsubscribe",messageId:$e,unsubscriptions:[]};return typeof j=="string"?Fe.unsubscriptions=[j]:Array.isArray(j)&&(Fe.unsubscriptions=j),this.options.resubscribe&&Fe.unsubscriptions.forEach(Oe=>{delete this._resubscribeTopics[Oe]}),typeof F=="object"&&F.properties&&(Fe.properties=F.properties),this.outgoing[Fe.messageId]={volatile:!0,cb:Ce},this.log("unsubscribe: call _sendPacket"),this._sendPacket(Fe),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!pe())&&this._storeProcessingQueue.push({invoke:pe,callback:Ce}),this}unsubscribeAsync(j,F){return new Promise((Ce,le)=>{this.unsubscribe(j,F,(pe,$e)=>{pe?le(pe):Ce($e)})})}end(j,F,Ce){this.log("end :: (%s)",this.options.clientId),(j==null||typeof j!="boolean")&&(Ce=Ce||F,F=j,j=!1),typeof F!="object"&&(Ce=Ce||F,F=null),this.log("end :: cb? %s",!!Ce),(!Ce||typeof Ce!="function")&&(Ce=this.noop);const le=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close($e=>{this.outgoingStore.close(Fe=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),Ce){const Oe=$e||Fe;this.log("end :: closeStores: invoking callback with args"),Ce(Oe)}})}),this._deferredReconnect&&this._deferredReconnect()},pe=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,j),this._cleanUp(j,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),L(le)},F)};return this.disconnecting?(Ce(),this):(this._clearReconnect(),this.disconnecting=!0,!j&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,pe,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),pe()),this)}endAsync(j,F){return new Promise((Ce,le)=>{this.end(j,F,pe=>{pe?le(pe):Ce()})})}removeOutgoingMessage(j){if(this.outgoing[j]){const{cb:F}=this.outgoing[j];this._removeOutgoingAndStoreMessage(j,()=>{F(new Error("Message removed"))})}return this}reconnect(j){this.log("client reconnect");const F=()=>{j?(this.options.incomingStore=j.incomingStore,this.options.outgoingStore=j.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new T.default,this.outgoingStore=this.options.outgoingStore||new T.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=F:F(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(j=>{this.outgoing[j].volatile&&typeof this.outgoing[j].cb=="function"&&(this.outgoing[j].cb(new Error("Connection closed")),delete this.outgoing[j])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(j=>{typeof this.outgoing[j].cb=="function"&&(this.outgoing[j].cb(new Error("Connection closed")),delete this.outgoing[j])}))}_removeTopicAliasAndRecoverTopicName(j){let F;j.properties&&(F=j.properties.topicAlias);let Ce=j.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",F,Ce),Ce.length===0){if(typeof F>"u")return new Error("Unregistered Topic Alias");if(Ce=this.topicAliasSend.getTopicByAlias(F),typeof Ce>"u")return new Error("Unregistered Topic Alias");j.topic=Ce}F&&delete j.properties.topicAlias}_checkDisconnecting(j){return this.disconnecting&&(j&&j!==this.noop?j(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(j,F,Ce={}){if(F&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",F)),this.log("_cleanUp :: forced? %s",j),j)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const le=Object.assign({cmd:"disconnect"},Ce);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(le,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),O(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||(this.log("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),F&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",F),F())}_storeAndSend(j,F,Ce){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",j.cmd);let le=j,pe;if(le.cmd==="publish"&&(le=(0,A.default)(j),pe=this._removeTopicAliasAndRecoverTopicName(le),pe))return F&&F(pe);this.outgoingStore.put(le,$e=>{if($e)return F&&F($e);Ce(),this._writePacket(j,F)})}_applyTopicAlias(j){if(this.options.protocolVersion===5&&j.cmd==="publish"){let F;j.properties&&(F=j.properties.topicAlias);const Ce=j.topic.toString();if(this.topicAliasSend)if(F){if(Ce.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",Ce,F),!this.topicAliasSend.put(Ce,F)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",Ce,F),new Error("Sending Topic Alias out of range")}else Ce.length!==0&&(this.options.autoAssignTopicAlias?(F=this.topicAliasSend.getAliasByTopic(Ce),F?(j.topic="",j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",Ce,F)):(F=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(Ce,F),j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",Ce,F))):this.options.autoUseTopicAlias&&(F=this.topicAliasSend.getAliasByTopic(Ce),F&&(j.topic="",j.properties=Object.assign(Object.assign({},j.properties),{topicAlias:F}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",Ce,F))));else if(F)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",Ce,F),new Error("Sending Topic Alias out of range")}}_noop(j){this.log("noop ::",j)}_writePacket(j,F){this.log("_writePacket :: packet: %O",j),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",j),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");const Ce=p.default.writeToStream(j,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",Ce),!Ce&&F&&F!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",F)):F&&(this.log("_writePacket :: invoking cb"),F())}_sendPacket(j,F,Ce,le){this.log("_sendPacket :: (%s) :: start",this.options.clientId),Ce=Ce||this.noop,F=F||this.noop;const pe=this._applyTopicAlias(j);if(pe){F(pe);return}if(!this.connected){if(j.cmd==="auth"){this._writePacket(j,F);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(j,F,Ce);return}if(le){this._writePacket(j,F);return}switch(j.cmd){case"publish":break;case"pubrel":this._storeAndSend(j,F,Ce);return;default:this._writePacket(j,F);return}switch(j.qos){case 2:case 1:this._storeAndSend(j,F,Ce);break;case 0:default:this._writePacket(j,F);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(j,F,Ce){this.log("_storePacket :: packet: %o",j),this.log("_storePacket :: cb? %s",!!F),Ce=Ce||this.noop;let le=j;if(le.cmd==="publish"){le=(0,A.default)(j);const $e=this._removeTopicAliasAndRecoverTopicName(le);if($e)return F&&F($e)}const pe=le.qos||0;pe===0&&this.queueQoSZero||le.cmd!=="publish"?this.queue.push({packet:le,cb:F}):pe>0?(F=this.outgoing[le.messageId]?this.outgoing[le.messageId].cb:null,this.outgoingStore.put(le,$e=>{if($e)return F&&F($e);Ce()})):F&&F(new Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=(0,b.default)(()=>{this._checkPing()},this.options.keepalive*1e3))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");const j=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&j.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let F=0;F<j.length;F++){const Ce={};Ce[j[F]]=this._resubscribeTopics[j[F]],Ce.resubscribe=!0,this.subscribe(Ce,{properties:Ce[j[F]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(j){if(this.disconnected){this.emit("connect",j);return}this.connackPacket=j,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;const F=()=>{let Ce=this.outgoingStore.createStream();const le=()=>{Ce.destroy(),Ce=null,this._flushStoreProcessingQueue(),pe()},pe=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",le),Ce.on("error",Fe=>{pe(),this._flushStoreProcessingQueue(),this.removeListener("close",le),this.emit("error",Fe)});const $e=()=>{if(!Ce)return;const Fe=Ce.read(1);let Oe;if(!Fe){Ce.once("readable",$e);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[Fe.messageId]){$e();return}!this.disconnecting&&!this.reconnectTimer?(Oe=this.outgoing[Fe.messageId]?this.outgoing[Fe.messageId].cb:null,this.outgoing[Fe.messageId]={volatile:!1,cb(Et,he){Oe&&Oe(Et,he),$e()}},this._packetIdsDuringStoreProcessing[Fe.messageId]=!0,this.messageIdProvider.register(Fe.messageId)?this._sendPacket(Fe,void 0,void 0,!0):this.log("messageId: %d has already used.",Fe.messageId)):Ce.destroy&&Ce.destroy()};Ce.on("end",()=>{let Fe=!0;for(const Oe in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[Oe]){Fe=!1;break}Fe?(pe(),this.removeListener("close",le),this._invokeAllStoreProcessingQueue(),this.emit("connect",j)):F()}),$e()};F()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const j=this._storeProcessingQueue[0];if(j&&j.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const j of this._storeProcessingQueue)j.cbStorePut&&j.cbStorePut(new Error("Connection closed")),j.callback&&j.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(j,F){delete this.outgoing[j],this.outgoingStore.del({messageId:j},(Ce,le)=>{F(Ce,le),this.messageIdProvider.deallocate(j),this._invokeStoreProcessingQueue()})}}a.default=z}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"./TypedEmitter":1,"./default-message-id-provider":9,"./handlers":13,"./store":18,"./topic-alias-recv":19,"./validations":22,_process:102,debug:30,"mqtt-packet":75,"readable-stream":125,reinterval:131,"rfdc/default":132}],3:[function(n,o,a){var u=this&&this.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=n("readable-stream"),f=u(n("duplexify"));let h,y,g,p=!1;function v(){const S=new d.Transform;return S._write=(T,x,M)=>{h.sendSocketMessage({data:T.buffer,success(){M()},fail(){M(new Error)}})},S._flush=T=>{h.closeSocket({success(){T()}})},S}function _(S){S.hostname||(S.hostname="localhost"),S.path||(S.path="/"),S.wsOptions||(S.wsOptions={})}function b(S,T){const x=S.protocol==="alis"?"wss":"ws";let M=`${x}://${S.hostname}${S.path}`;return S.port&&S.port!==80&&S.port!==443&&(M=`${x}://${S.hostname}:${S.port}${S.path}`),typeof S.transformWsUrl=="function"&&(M=S.transformWsUrl(M,S,T)),M}function A(){p||(p=!0,h.onSocketOpen(()=>{g.setReadable(y),g.setWritable(y),g.emit("connect")}),h.onSocketMessage(S=>{if(typeof S.data=="string"){const T=c.Buffer.from(S.data,"base64");y.push(T)}else{const T=new FileReader;T.addEventListener("load",()=>{let x=T.result;x instanceof ArrayBuffer?x=c.Buffer.from(x):x=c.Buffer.from(x,"utf8"),y.push(x)}),T.readAsArrayBuffer(S.data)}}),h.onSocketClose(()=>{g.end(),g.destroy()}),h.onSocketError(S=>{g.destroy(S)}))}const w=(S,T)=>{if(T.hostname=T.hostname||T.host,!T.hostname)throw new Error("Could not determine host. Specify host manually.");const x=T.protocolId==="MQIsdp"&&T.protocolVersion===3?"mqttv3.1":"mqtt";_(T);const M=b(T,S);return h=T.my,h.connectSocket({url:M,protocols:x}),y=v(),g=f.default.obj(),A(),g};a.default=w},{buffer:29,duplexify:32,"readable-stream":125}],4:[function(n,o,a){var u=this&&this.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(a,"__esModule",{value:!0}),a.connectAsync=void 0;const c=u(n("debug")),d=u(n("url")),f=u(n("../client")),h=u(n("../is-browser")),y=(0,c.default)("mqttjs"),g={};h.default?(g.wx=n("./wx").default,g.wxs=n("./wx").default,g.ali=n("./ali").default,g.alis=n("./ali").default):(g.mqtt=n("./tcp").default,g.tcp=n("./tcp").default,g.ssl=n("./tls").default,g.tls=g.ssl,g.mqtts=n("./tls").default),g.ws=n("./ws").default,g.wss=n("./ws").default;function p(b){let A;b.auth&&(A=b.auth.match(/^(.+):(.+)$/),A?(b.username=A[1],b.password=A[2]):b.username=b.auth)}function v(b,A){if(y("connecting to an MQTT broker..."),typeof b=="object"&&!A&&(A=b,b=""),A=A||{},b&&typeof b=="string"){const T=d.default.parse(b,!0);if(T.port!=null&&(T.port=Number(T.port)),A=Object.assign(Object.assign({},T),A),A.protocol===null)throw new Error("Missing protocol");A.protocol=A.protocol.replace(/:$/,"")}if(p(A),A.query&&typeof A.query.clientId=="string"&&(A.clientId=A.query.clientId),A.cert&&A.key)if(A.protocol){if(["mqtts","wss","wxs","alis"].indexOf(A.protocol)===-1)switch(A.protocol){case"mqtt":A.protocol="mqtts";break;case"ws":A.protocol="wss";break;case"wx":A.protocol="wxs";break;case"ali":A.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${A.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(!g[A.protocol]){const T=["mqtts","wss"].indexOf(A.protocol)!==-1;A.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((x,M)=>T&&M%2===0?!1:typeof g[x]=="function")[0]}if(A.clean===!1&&!A.clientId)throw new Error("Missing clientId for unclean clients");A.protocol&&(A.defaultProtocol=A.protocol);function w(T){return A.servers&&((!T._reconnectCount||T._reconnectCount===A.servers.length)&&(T._reconnectCount=0),A.host=A.servers[T._reconnectCount].host,A.port=A.servers[T._reconnectCount].port,A.protocol=A.servers[T._reconnectCount].protocol?A.servers[T._reconnectCount].protocol:A.defaultProtocol,A.hostname=A.host,T._reconnectCount++),y("calling streambuilder for",A.protocol),g[A.protocol](T,A)}const S=new f.default(w,A);return S.on("error",()=>{}),S}function _(b,A,w=!0){return new Promise((S,T)=>{const x=v(b,A),M={connect:O=>{L(),S(x)},end:()=>{L(),S(x)},error:O=>{L(),x.end(),T(O)}};w===!1&&(M.close=()=>{M.error(new Error("Couldn't connect to server"))});function L(){Object.keys(M).forEach(O=>{x.off(O,M[O])})}Object.keys(M).forEach(O=>{x.on(O,M[O])})})}a.connectAsync=_,a.default=v},{"../client":2,"../is-browser":16,"./ali":3,"./tcp":5,"./tls":6,"./ws":7,"./wx":8,debug:30,url:137}],5:[function(n,o,a){var u=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("net")),f=(0,u(n("debug")).default)("mqttjs:tcp"),h=(y,g)=>{g.port=g.port||1883,g.hostname=g.hostname||g.host||"localhost";const{port:p}=g,v=g.hostname;return f("port %d and host %s",p,v),c.default.createConnection(p,v)};a.default=h},{debug:30,net:26}],6:[function(n,o,a){var u=this&&this.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("tls")),d=u(n("net")),h=(0,u(n("debug")).default)("mqttjs:tls"),y=(g,p)=>{p.port=p.port||8883,p.host=p.hostname||p.host||"localhost",d.default.isIP(p.host)===0&&(p.servername=p.host),p.rejectUnauthorized=p.rejectUnauthorized!==!1,delete p.path,h("port %d host %s rejectUnauthorized %b",p.port,p.host,p.rejectUnauthorized);const v=c.default.connect(p);v.on("secureConnect",()=>{p.rejectUnauthorized&&!v.authorized?v.emit("error",new Error("TLS not authorized")):v.removeListener("error",_)});function _(b){p.rejectUnauthorized&&g.emit("error",b),v.end()}return v.on("error",_),v};a.default=y},{debug:30,net:26,tls:26}],7:[function(n,o,a){var u=this&&this.__importDefault||function(M){return M&&M.__esModule?M:{default:M}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=u(n("ws")),f=u(n("debug")),h=u(n("duplexify")),y=n("readable-stream"),g=u(n("../is-browser")),p=(0,f.default)("mqttjs:ws"),v=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function _(M,L){let O=`${M.protocol}://${M.hostname}:${M.port}${M.path}`;return typeof M.transformWsUrl=="function"&&(O=M.transformWsUrl(O,M,L)),O}function b(M){const L=M;return M.hostname||(L.hostname="localhost"),M.port||(M.protocol==="wss"?L.port=443:L.port=80),M.path||(L.path="/"),M.wsOptions||(L.wsOptions={}),!g.default&&M.protocol==="wss"&&v.forEach(O=>{Object.prototype.hasOwnProperty.call(M,O)&&!Object.prototype.hasOwnProperty.call(M.wsOptions,O)&&(L.wsOptions[O]=M[O])}),L}function A(M){const L=b(M);if(L.hostname||(L.hostname=L.host),!L.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");const O=new URL(document.URL);L.hostname=O.hostname,L.port||(L.port=Number(O.port))}return L.objectMode===void 0&&(L.objectMode=!(L.binary===!0||L.binary===void 0)),L}function w(M,L,O){p("createWebSocket"),p(`protocol: ${O.protocolId} ${O.protocolVersion}`);const re=O.protocolId==="MQIsdp"&&O.protocolVersion===3?"mqttv3.1":"mqtt";p(`creating new Websocket for url: ${L} and protocol: ${re}`);let D;return O.createWebsocket?D=O.createWebsocket(L,[re],O):D=new d.default(L,[re],O.wsOptions),D}function S(M,L){const O=L.protocolId==="MQIsdp"&&L.protocolVersion===3?"mqttv3.1":"mqtt",re=_(L,M);let D;return L.createWebsocket?D=L.createWebsocket(re,[O],L):D=new WebSocket(re,[O]),D.binaryType="arraybuffer",D}const T=(M,L)=>{p("streamBuilder");const O=b(L),re=_(O,M),D=w(M,re,O),z=d.default.createWebSocketStream(D,O.wsOptions);return z.url=re,D.on("close",()=>{z.destroy()}),z},x=(M,L)=>{p("browserStreamBuilder");let O;const D=A(L).browserBufferSize||1024*512,z=L.browserBufferTimeout||1e3,V=!L.objectMode,j=S(M,L),F=le(L,he,In);L.objectMode||(F._writev=Et),F.on("close",()=>{j.close()});const Ce=typeof j.addEventListener<"u";j.readyState===j.OPEN?O=F:(O=(0,h.default)(void 0,void 0,L),L.objectMode||(O._writev=Et),Ce?j.addEventListener("open",pe):j.onopen=pe),O.socket=j,Ce?(j.addEventListener("close",$e),j.addEventListener("error",Fe),j.addEventListener("message",Oe)):(j.onclose=$e,j.onerror=Fe,j.onmessage=Oe);function le(vn,kt,ue){const At=new y.Transform({objectMode:vn.objectMode});return At._write=kt,At._flush=ue,At}function pe(){O.setReadable(F),O.setWritable(F),O.emit("connect")}function $e(){O.end(),O.destroy()}function Fe(vn){O.destroy(vn)}function Oe(vn){let{data:kt}=vn;kt instanceof ArrayBuffer?kt=c.Buffer.from(kt):kt=c.Buffer.from(kt,"utf8"),F.push(kt)}function Et(vn,kt){const ue=new Array(vn.length);for(let At=0;At<vn.length;At++)typeof vn[At].chunk=="string"?ue[At]=c.Buffer.from(vn[At],"utf8"):ue[At]=vn[At].chunk;this._write(c.Buffer.concat(ue),"binary",kt)}function he(vn,kt,ue){j.bufferedAmount>D&&setTimeout(he,z,vn,kt,ue),V&&typeof vn=="string"&&(vn=c.Buffer.from(vn,"utf8"));try{j.send(vn)}catch(At){return ue(At)}ue()}function In(vn){j.close(),vn()}return O};a.default=g.default?x:T},{"../is-browser":16,buffer:29,debug:30,duplexify:32,"readable-stream":125,ws:141}],8:[function(n,o,a){var u=this&&this.__importDefault||function(w){return w&&w.__esModule?w:{default:w}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("buffer"),d=n("readable-stream"),f=u(n("duplexify"));let h,y,g;function p(){const w=new d.Transform;return w._write=(S,T,x)=>{h.send({data:S.buffer,success(){x()},fail(M){x(new Error(M))}})},w._flush=S=>{h.close({success(){S()}})},w}function v(w){w.hostname||(w.hostname="localhost"),w.path||(w.path="/"),w.wsOptions||(w.wsOptions={})}function _(w,S){const T=w.protocol==="wxs"?"wss":"ws";let x=`${T}://${w.hostname}${w.path}`;return w.port&&w.port!==80&&w.port!==443&&(x=`${T}://${w.hostname}:${w.port}${w.path}`),typeof w.transformWsUrl=="function"&&(x=w.transformWsUrl(x,w,S)),x}function b(){h.onOpen(()=>{g.setReadable(y),g.setWritable(y),g.emit("connect")}),h.onMessage(w=>{let{data:S}=w;S instanceof ArrayBuffer?S=c.Buffer.from(S):S=c.Buffer.from(S,"utf8"),y.push(S)}),h.onClose(()=>{g.emit("close"),g.end(),g.destroy()}),h.onError(w=>{g.destroy(new Error(w.errMsg))})}const A=(w,S)=>{if(S.hostname=S.hostname||S.host,!S.hostname)throw new Error("Could not determine host. Specify host manually.");const T=S.protocolId==="MQIsdp"&&S.protocolVersion===3?"mqttv3.1":"mqtt";v(S);const x=_(S,w);h=wx.connectSocket({url:x,protocols:[T]}),y=p(),g=f.default.obj(),g._destroy=(L,O)=>{h.close({success(){O&&O(L)}})};const M=g.destroy;return g.destroy=()=>{g.destroy=M,setTimeout(()=>{h.close({fail(){g._destroy(new Error)}})},0)},b(),g};a.default=A},{buffer:29,duplexify:32,"readable-stream":125}],9:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(){this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){const d=this.nextId++;return this.nextId===65536&&(this.nextId=1),d}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(d){return!0}deallocate(d){}clear(){}}a.default=u},{}],10:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=void 0,a.ReasonCodes={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"};const u=(c,d)=>{const{messageId:f}=d,h=d.cmd;let y=null;const g=c.outgoing[f]?c.outgoing[f].cb:null;let p;if(!g){c.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(c.log("_handleAck :: packet type",h),h){case"pubcomp":case"puback":{const v=d.reasonCode;v&&v>0&&v!==16?(p=new Error(`Publish error: ${a.ReasonCodes[v]}`),p.code=v,c._removeOutgoingAndStoreMessage(f,()=>{g(p,d)})):c._removeOutgoingAndStoreMessage(f,g);break}case"pubrec":{y={cmd:"pubrel",qos:2,messageId:f};const v=d.reasonCode;v&&v>0&&v!==16?(p=new Error(`Publish error: ${a.ReasonCodes[v]}`),p.code=v,c._removeOutgoingAndStoreMessage(f,()=>{g(p,d)})):c._sendPacket(y);break}case"suback":{delete c.outgoing[f],c.messageIdProvider.deallocate(f);const v=d.granted;for(let _=0;_<v.length;_++)if(v[_]&128){const b=c.messageIdToTopic[f];b&&b.forEach(A=>{delete c._resubscribeTopics[A]})}delete c.messageIdToTopic[f],c._invokeStoreProcessingQueue(),g(null,d);break}case"unsuback":{delete c.outgoing[f],c.messageIdProvider.deallocate(f),c._invokeStoreProcessingQueue(),g(null);break}default:c.emit("error",new Error("unrecognized packet type"))}c.disconnecting&&Object.keys(c.outgoing).length===0&&c.emit("outgoingEmpty")};a.default=u},{}],11:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("../shared"),c=n("./ack"),d=(f,h)=>{const{options:y}=f,g=y.protocolVersion,p=g===5?h.reasonCode:h.returnCode;if(g!==5){const v=new u.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${g}`,p);f.emit("error",v);return}f.handleAuth(h,(v,_)=>{if(v){f.emit("error",v);return}if(p===24)f.reconnecting=!1,f._sendPacket(_);else{const b=new u.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[p]}`,p);f.emit("error",b)}})};a.default=d},{"../shared":17,"./ack":10}],12:[function(n,o,a){var u=this&&this.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(a,"__esModule",{value:!0});const c=n("./ack"),d=u(n("../topic-alias-send")),f=n("../shared"),h=(y,g)=>{y.log("_handleConnack");const{options:p}=y,_=p.protocolVersion===5?g.reasonCode:g.returnCode;if(clearTimeout(y.connackTimer),delete y.topicAliasSend,g.properties){if(g.properties.topicAliasMaximum){if(g.properties.topicAliasMaximum>65535){y.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}g.properties.topicAliasMaximum>0&&(y.topicAliasSend=new d.default(g.properties.topicAliasMaximum))}g.properties.serverKeepAlive&&p.keepalive&&(p.keepalive=g.properties.serverKeepAlive,y._shiftPingInterval()),g.properties.maximumPacketSize&&(p.properties||(p.properties={}),p.properties.maximumPacketSize=g.properties.maximumPacketSize)}if(_===0)y.reconnecting=!1,y._onConnect(g);else if(_>0){const b=new f.ErrorWithReasonCode(`Connection refused: ${c.ReasonCodes[_]}`,_);y.emit("error",b)}};a.default=h},{"../shared":17,"../topic-alias-send":20,"./ack":10}],13:[function(n,o,a){var u=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("./publish")),d=u(n("./auth")),f=u(n("./connack")),h=u(n("./ack")),y=u(n("./pubrel")),g=(p,v,_)=>{const{options:b}=p;if(b.protocolVersion===5&&b.properties&&b.properties.maximumPacketSize&&b.properties.maximumPacketSize<v.length)return p.emit("error",new Error(`exceeding packets size ${v.cmd}`)),p.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),p;switch(p.log("_handlePacket :: emitting packetreceive"),p.emit("packetreceive",v),v.cmd){case"publish":(0,c.default)(p,v,_);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,h.default)(p,v),_();break;case"pubrel":(0,y.default)(p,v,_);break;case"connack":(0,f.default)(p,v),_();break;case"auth":(0,d.default)(p,v),_();break;case"pingresp":p.pingResp=!0,_();break;case"disconnect":p.emit("disconnect",v),_();break;default:p.log("_handlePacket :: unknown command"),_();break}};a.default=g},{"./ack":10,"./auth":11,"./connack":12,"./publish":14,"./pubrel":15}],14:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=[0,16,128,131,135,144,145,151,153],c=(d,f,h)=>{d.log("handlePublish: packet %o",f),h=typeof h<"u"?h:d.noop;let y=f.topic.toString();const g=f.payload,{qos:p}=f,{messageId:v}=f,{options:_}=d;if(d.options.protocolVersion===5){let b;if(f.properties&&(b=f.properties.topicAlias),typeof b<"u")if(y.length===0)if(b>0&&b<=65535){const A=d.topicAliasRecv.getTopicByAlias(b);if(A)y=A,d.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",y,b);else{d.log("handlePublish :: unregistered topic alias. alias: %d",b),d.emit("error",new Error("Received unregistered Topic Alias"));return}}else{d.log("handlePublish :: topic alias out of range. alias: %d",b),d.emit("error",new Error("Received Topic Alias is out of range"));return}else if(d.topicAliasRecv.put(y,b))d.log("handlePublish :: registered topic: %s - alias: %d",y,b);else{d.log("handlePublish :: topic alias out of range. alias: %d",b),d.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(d.log("handlePublish: qos %d",p),p){case 2:{_.customHandleAcks(y,g,f,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return d.emit("error",b);if(u.indexOf(A)===-1)return d.emit("error",new Error("Wrong reason code for pubrec"));A?d._sendPacket({cmd:"pubrec",messageId:v,reasonCode:A},h):d.incomingStore.put(f,()=>{d._sendPacket({cmd:"pubrec",messageId:v},h)})});break}case 1:{_.customHandleAcks(y,g,f,(b,A)=>{if(typeof b=="number"&&(A=b,b=null),b)return d.emit("error",b);if(u.indexOf(A)===-1)return d.emit("error",new Error("Wrong reason code for puback"));A||d.emit("message",y,g,f),d.handleMessage(f,w=>{if(w)return h&&h(w);d._sendPacket({cmd:"puback",messageId:v,reasonCode:A},h)})});break}case 0:d.emit("message",y,g,f),d.handleMessage(f,h);break;default:d.log("handlePublish: unknown QoS. Doing nothing.");break}};a.default=c},{}],15:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=(c,d,f)=>{c.log("handling pubrel packet");const h=typeof f<"u"?f:c.noop,{messageId:y}=d,g={cmd:"pubcomp",messageId:y};c.incomingStore.get(d,(p,v)=>{p?c._sendPacket(g,h):(c.emit("message",v.topic,v.payload,v),c.handleMessage(v,_=>{if(_)return h(_);c.incomingStore.del(v,c.noop),c._sendPacket(g,h)}))})};a.default=u},{}],16:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=typeof window<"u"&&typeof window.document<"u"||typeof self<"u"&&typeof self.postMessage=="function";a.default=u},{}],17:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.applyMixin=a.ErrorWithReasonCode=void 0;class u extends Error{constructor(f,h){super(f),this.code=h,Object.setPrototypeOf(this,u.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}a.ErrorWithReasonCode=u;function c(d,f,h=!1){var y;const g=[f];for(;;){const p=g[0],v=Object.getPrototypeOf(p);if(v!=null&&v.prototype)g.unshift(v);else break}for(const p of g)for(const v of Object.getOwnPropertyNames(p.prototype))(h||v!=="constructor")&&Object.defineProperty(d.prototype,v,(y=Object.getOwnPropertyDescriptor(p.prototype,v))!==null&&y!==void 0?y:Object.create(null))}a.applyMixin=c},{}],18:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("readable-stream"),c={objectMode:!0},d={clean:!0};class f{constructor(y){this.options=y||{},this.options=Object.assign(Object.assign({},d),y),this._inflights=new Map}put(y,g){return this._inflights.set(y.messageId,y),g&&g(),this}createStream(){const y=new u.Readable(c),g=[];let p=!1,v=0;return this._inflights.forEach((_,b)=>{g.push(_)}),y._read=()=>{!p&&v<g.length?y.push(g[v++]):y.push(null)},y.destroy=_=>{if(!p)return p=!0,setTimeout(()=>{y.emit("close")},0),y},y}del(y,g){const p=this._inflights.get(y.messageId);return p?(this._inflights.delete(y.messageId),g(null,p)):g&&g(new Error("missing packet")),this}get(y,g){const p=this._inflights.get(y.messageId);return p?g(null,p):g&&g(new Error("missing packet")),this}close(y){this.options.clean&&(this._inflights=null),y&&y()}}a.default=f},{"readable-stream":125}],19:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});class u{constructor(d){this.aliasToTopic={},this.max=d}put(d,f){return f===0||f>this.max?!1:(this.aliasToTopic[f]=d,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(d){return this.aliasToTopic[d]}clear(){this.aliasToTopic={}}}a.default=u},{}],20:[function(n,o,a){var u=this&&this.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(a,"__esModule",{value:!0});const c=u(n("lru-cache")),d=n("number-allocator");class f{constructor(y){y>0&&(this.aliasToTopic=new c.default({max:y}),this.topicToAlias={},this.numberAllocator=new d.NumberAllocator(1,y),this.max=y,this.length=0)}put(y,g){if(g===0||g>this.max)return!1;const p=this.aliasToTopic.get(g);return p&&delete this.topicToAlias[p],this.aliasToTopic.set(g,y),this.topicToAlias[y]=g,this.numberAllocator.use(g),this.length=this.aliasToTopic.size,!0}getTopicByAlias(y){return this.aliasToTopic.get(y)}getAliasByTopic(y){const g=this.topicToAlias[y];return typeof g<"u"&&this.aliasToTopic.get(g),g}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){const y=this.numberAllocator.firstVacant();return y||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}a.default=f},{"lru-cache":72,"number-allocator":98}],21:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0});const u=n("number-allocator");class c{constructor(){this.numberAllocator=new u.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(f){return this.numberAllocator.use(f)}deallocate(f){this.numberAllocator.free(f)}clear(){this.numberAllocator.clear()}}a.default=c},{"number-allocator":98}],22:[function(n,o,a){Object.defineProperty(a,"__esModule",{value:!0}),a.validateTopics=a.validateTopic=void 0;function u(d){const f=d.split("/");for(let h=0;h<f.length;h++)if(f[h]!=="+"){if(f[h]==="#")return h===f.length-1;if(f[h].indexOf("+")!==-1||f[h].indexOf("#")!==-1)return!1}return!0}a.validateTopic=u;function c(d){if(d.length===0)return"empty_topic_list";for(let f=0;f<d.length;f++)if(!u(d[f]))return d[f];return null}a.validateTopics=c},{}],23:[function(n,o,a){var u=this&&this.__createBinding||(Object.create?function(A,w,S,T){T===void 0&&(T=S);var x=Object.getOwnPropertyDescriptor(w,S);(!x||("get"in x?!w.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return w[S]}}),Object.defineProperty(A,T,x)}:function(A,w,S,T){T===void 0&&(T=S),A[T]=w[S]}),c=this&&this.__setModuleDefault||(Object.create?function(A,w){Object.defineProperty(A,"default",{enumerable:!0,value:w})}:function(A,w){A.default=w}),d=this&&this.__importStar||function(A){if(A&&A.__esModule)return A;var w={};if(A!=null)for(var S in A)S!=="default"&&Object.prototype.hasOwnProperty.call(A,S)&&u(w,A,S);return c(w,A),w},f=this&&this.__exportStar||function(A,w){for(var S in A)S!=="default"&&!Object.prototype.hasOwnProperty.call(w,S)&&u(w,A,S)},h=this&&this.__importDefault||function(A){return A&&A.__esModule?A:{default:A}};Object.defineProperty(a,"__esModule",{value:!0}),a.ReasonCodes=a.UniqueMessageIdProvider=a.DefaultMessageIdProvider=a.Store=a.MqttClient=a.connectAsync=a.connect=a.Client=void 0;const y=h(n("./lib/client"));a.MqttClient=y.default;const g=h(n("./lib/default-message-id-provider"));a.DefaultMessageIdProvider=g.default;const p=h(n("./lib/unique-message-id-provider"));a.UniqueMessageIdProvider=p.default;const v=h(n("./lib/store"));a.Store=v.default;const _=d(n("./lib/connect"));a.connect=_.default,Object.defineProperty(a,"connectAsync",{enumerable:!0,get:function(){return _.connectAsync}}),a.Client=y.default,f(n("./lib/client"),a),f(n("./lib/shared"),a);var b=n("./lib/handlers/ack");Object.defineProperty(a,"ReasonCodes",{enumerable:!0,get:function(){return b.ReasonCodes}})},{"./lib/client":2,"./lib/connect":4,"./lib/default-message-id-provider":9,"./lib/handlers/ack":10,"./lib/shared":17,"./lib/store":18,"./lib/unique-message-id-provider":21}],24:[function(n,o,a){const{AbortController:u,AbortSignal:c}=typeof self<"u"?self:typeof window<"u"?window:void 0;o.exports=u,o.exports.AbortSignal=c,o.exports.default=u},{}],25:[function(n,o,a){a.byteLength=p,a.toByteArray=_,a.fromByteArray=w;for(var u=[],c=[],d=typeof Uint8Array<"u"?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,y=f.length;h<y;++h)u[h]=f[h],c[f.charCodeAt(h)]=h;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63;function g(S){var T=S.length;if(T%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var x=S.indexOf("=");x===-1&&(x=T);var M=x===T?0:4-x%4;return[x,M]}function p(S){var T=g(S),x=T[0],M=T[1];return(x+M)*3/4-M}function v(S,T,x){return(T+x)*3/4-x}function _(S){var T,x=g(S),M=x[0],L=x[1],O=new d(v(S,M,L)),re=0,D=L>0?M-4:M,z;for(z=0;z<D;z+=4)T=c[S.charCodeAt(z)]<<18|c[S.charCodeAt(z+1)]<<12|c[S.charCodeAt(z+2)]<<6|c[S.charCodeAt(z+3)],O[re++]=T>>16&255,O[re++]=T>>8&255,O[re++]=T&255;return L===2&&(T=c[S.charCodeAt(z)]<<2|c[S.charCodeAt(z+1)]>>4,O[re++]=T&255),L===1&&(T=c[S.charCodeAt(z)]<<10|c[S.charCodeAt(z+1)]<<4|c[S.charCodeAt(z+2)]>>2,O[re++]=T>>8&255,O[re++]=T&255),O}function b(S){return u[S>>18&63]+u[S>>12&63]+u[S>>6&63]+u[S&63]}function A(S,T,x){for(var M,L=[],O=T;O<x;O+=3)M=(S[O]<<16&16711680)+(S[O+1]<<8&65280)+(S[O+2]&255),L.push(b(M));return L.join("")}function w(S){for(var T,x=S.length,M=x%3,L=[],O=16383,re=0,D=x-M;re<D;re+=O)L.push(A(S,re,re+O>D?D:re+O));return M===1?(T=S[x-1],L.push(u[T>>2]+u[T<<4&63]+"==")):M===2&&(T=(S[x-2]<<8)+S[x-1],L.push(u[T>>10]+u[T>>4&63]+u[T<<2&63]+"=")),L.join("")}},{}],26:[function(n,o,a){},{}],27:[function(n,o,a){var u=n("buffer"),c=u.Buffer;function d(h,y){for(var g in h)y[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(d(u,a),a.Buffer=f);function f(h,y,g){return c(h,y,g)}d(c,f),f.from=function(h,y,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,y,g)},f.alloc=function(h,y,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return y!==void 0?typeof g=="string"?p.fill(y,g):p.fill(y):p.fill(0),p},f.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},f.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],28:[function(n,o,a){var u=n("safe-buffer").Buffer,c=u.isEncoding||function(L){switch(L=""+L,L&&L.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 d(L){if(!L)return"utf8";for(var O;;)switch(L){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 L;default:if(O)return;L=(""+L).toLowerCase(),O=!0}}function f(L){var O=d(L);if(typeof O!="string"&&(u.isEncoding===c||!c(L)))throw new Error("Unknown encoding: "+L);return O||L}a.StringDecoder=h;function h(L){this.encoding=f(L);var O;switch(this.encoding){case"utf16le":this.text=A,this.end=w,O=4;break;case"utf8":this.fillLast=v,O=4;break;case"base64":this.text=S,this.end=T,O=3;break;default:this.write=x,this.end=M;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=u.allocUnsafe(O)}h.prototype.write=function(L){if(L.length===0)return"";var O,re;if(this.lastNeed){if(O=this.fillLast(L),O===void 0)return"";re=this.lastNeed,this.lastNeed=0}else re=0;return re<L.length?O?O+this.text(L,re):this.text(L,re):O||""},h.prototype.end=b,h.prototype.text=_,h.prototype.fillLast=function(L){if(this.lastNeed<=L.length)return L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,this.lastTotal-this.lastNeed,0,L.length),this.lastNeed-=L.length};function y(L){return L<=127?0:L>>5===6?2:L>>4===14?3:L>>3===30?4:L>>6===2?-1:-2}function g(L,O,re){var D=O.length-1;if(D<re)return 0;var z=y(O[D]);return z>=0?(z>0&&(L.lastNeed=z-1),z):--D<re||z===-2?0:(z=y(O[D]),z>=0?(z>0&&(L.lastNeed=z-2),z):--D<re||z===-2?0:(z=y(O[D]),z>=0?(z>0&&(z===2?z=0:L.lastNeed=z-3),z):0))}function p(L,O,re){if((O[0]&192)!==128)return L.lastNeed=0,"�";if(L.lastNeed>1&&O.length>1){if((O[1]&192)!==128)return L.lastNeed=1,"�";if(L.lastNeed>2&&O.length>2&&(O[2]&192)!==128)return L.lastNeed=2,"�"}}function v(L){var O=this.lastTotal-this.lastNeed,re=p(this,L);if(re!==void 0)return re;if(this.lastNeed<=L.length)return L.copy(this.lastChar,O,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);L.copy(this.lastChar,O,0,L.length),this.lastNeed-=L.length}function _(L,O){var re=g(this,L,O);if(!this.lastNeed)return L.toString("utf8",O);this.lastTotal=re;var D=L.length-(re-this.lastNeed);return L.copy(this.lastChar,0,D),L.toString("utf8",O,D)}function b(L){var O=L&&L.length?this.write(L):"";return this.lastNeed?O+"�":O}function A(L,O){if((L.length-O)%2===0){var re=L.toString("utf16le",O);if(re){var D=re.charCodeAt(re.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1],re.slice(0,-1)}return re}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=L[L.length-1],L.toString("utf16le",O,L.length-1)}function w(L){var O=L&&L.length?this.write(L):"";if(this.lastNeed){var re=this.lastTotal-this.lastNeed;return O+this.lastChar.toString("utf16le",0,re)}return O}function S(L,O){var re=(L.length-O)%3;return re===0?L.toString("base64",O):(this.lastNeed=3-re,this.lastTotal=3,re===1?this.lastChar[0]=L[L.length-1]:(this.lastChar[0]=L[L.length-2],this.lastChar[1]=L[L.length-1]),L.toString("base64",O,L.length-re))}function T(L){var O=L&&L.length?this.write(L):"";return this.lastNeed?O+this.lastChar.toString("base64",0,3-this.lastNeed):O}function x(L){return L.toString(this.encoding)}function M(L){return L&&L.length?this.write(L):""}},{"safe-buffer":27}],29:[function(n,o,a){(function(u){(function(){var c=n("base64-js"),d=n("ieee754");a.Buffer=g,a.SlowBuffer=M,a.INSPECT_MAX_BYTES=50;var f=2147483647;a.kMaxLength=f,g.TYPED_ARRAY_SUPPORT=h(),!g.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 h(){try{var Y=new Uint8Array(1);return Y.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},Y.foo()===42}catch{return!1}}Object.defineProperty(g.prototype,"parent",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.buffer}}),Object.defineProperty(g.prototype,"offset",{enumerable:!0,get:function(){if(g.isBuffer(this))return this.byteOffset}});function y(Y){if(Y>f)throw new RangeError('The value "'+Y+'" is invalid for option "size"');var k=new Uint8Array(Y);return k.__proto__=g.prototype,k}function g(Y,k,$){if(typeof Y=="number"){if(typeof k=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(Y)}return p(Y,k,$)}typeof Symbol<"u"&&Symbol.species!=null&&g[Symbol.species]===g&&Object.defineProperty(g,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),g.poolSize=8192;function p(Y,k,$){if(typeof Y=="string")return A(Y,k);if(ArrayBuffer.isView(Y))return w(Y);if(Y==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(ie(Y,ArrayBuffer)||Y&&ie(Y.buffer,ArrayBuffer))return S(Y,k,$);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var oe=Y.valueOf&&Y.valueOf();if(oe!=null&&oe!==Y)return g.from(oe,k,$);var _e=T(Y);if(_e)return _e;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return g.from(Y[Symbol.toPrimitive]("string"),k,$);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}g.from=function(Y,k,$){return p(Y,k,$)},g.prototype.__proto__=Uint8Array.prototype,g.__proto__=Uint8Array;function v(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function _(Y,k,$){return v(Y),Y<=0?y(Y):k!==void 0?typeof $=="string"?y(Y).fill(k,$):y(Y).fill(k):y(Y)}g.alloc=function(Y,k,$){return _(Y,k,$)};function b(Y){return v(Y),y(Y<0?0:x(Y)|0)}g.allocUnsafe=function(Y){return b(Y)},g.allocUnsafeSlow=function(Y){return b(Y)};function A(Y,k){if((typeof k!="string"||k==="")&&(k="utf8"),!g.isEncoding(k))throw new TypeError("Unknown encoding: "+k);var $=L(Y,k)|0,oe=y($),_e=oe.write(Y,k);return _e!==$&&(oe=oe.slice(0,_e)),oe}function w(Y){for(var k=Y.length<0?0:x(Y.length)|0,$=y(k),oe=0;oe<k;oe+=1)$[oe]=Y[oe]&255;return $}function S(Y,k,$){if(k<0||Y.byteLength<k)throw new RangeError('"offset" is outside of buffer bounds');if(Y.byteLength<k+($||0))throw new RangeError('"length" is outside of buffer bounds');var oe;return k===void 0&&$===void 0?oe=new Uint8Array(Y):$===void 0?oe=new Uint8Array(Y,k):oe=new Uint8Array(Y,k,$),oe.__proto__=g.prototype,oe}function T(Y){if(g.isBuffer(Y)){var k=x(Y.length)|0,$=y(k);return $.length===0||Y.copy($,0,0,k),$}if(Y.length!==void 0)return typeof Y.length!="number"||ae(Y.length)?y(0):w(Y);if(Y.type==="Buffer"&&Array.isArray(Y.data))return w(Y.data)}function x(Y){if(Y>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return Y|0}function M(Y){return+Y!=Y&&(Y=0),g.alloc(+Y)}g.isBuffer=function(k){return k!=null&&k._isBuffer===!0&&k!==g.prototype},g.compare=function(k,$){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),ie($,Uint8Array)&&($=g.from($,$.offset,$.byteLength)),!g.isBuffer(k)||!g.isBuffer($))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(k===$)return 0;for(var oe=k.length,_e=$.length,Ue=0,_n=Math.min(oe,_e);Ue<_n;++Ue)if(k[Ue]!==$[Ue]){oe=k[Ue],_e=$[Ue];break}return oe<_e?-1:_e<oe?1:0},g.isEncoding=function(k){switch(String(k).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}},g.concat=function(k,$){if(!Array.isArray(k))throw new TypeError('"list" argument must be an Array of Buffers');if(k.length===0)return g.alloc(0);var oe;if($===void 0)for($=0,oe=0;oe<k.length;++oe)$+=k[oe].length;var _e=g.allocUnsafe($),Ue=0;for(oe=0;oe<k.length;++oe){var _n=k[oe];if(ie(_n,Uint8Array)&&(_n=g.from(_n)),!g.isBuffer(_n))throw new TypeError('"list" argument must be an Array of Buffers');_n.copy(_e,Ue),Ue+=_n.length}return _e};function L(Y,k){if(g.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||ie(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);var $=Y.length,oe=arguments.length>2&&arguments[2]===!0;if(!oe&&$===0)return 0;for(var _e=!1;;)switch(k){case"ascii":case"latin1":case"binary":return $;case"utf8":case"utf-8":return xe(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $*2;case"hex":return $>>>1;case"base64":return Dt(Y).length;default:if(_e)return oe?-1:xe(Y).length;k=(""+k).toLowerCase(),_e=!0}}g.byteLength=L;function O(Y,k,$){var oe=!1;if((k===void 0||k<0)&&(k=0),k>this.length||(($===void 0||$>this.length)&&($=this.length),$<=0)||($>>>=0,k>>>=0,$<=k))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return vn(this,k,$);case"utf8":case"utf-8":return Fe(this,k,$);case"ascii":return he(this,k,$);case"latin1":case"binary":return In(this,k,$);case"base64":return $e(this,k,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,k,$);default:if(oe)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),oe=!0}}g.prototype._isBuffer=!0;function re(Y,k,$){var oe=Y[k];Y[k]=Y[$],Y[$]=oe}g.prototype.swap16=function(){var k=this.length;if(k%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var $=0;$<k;$+=2)re(this,$,$+1);return this},g.prototype.swap32=function(){var k=this.length;if(k%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var $=0;$<k;$+=4)re(this,$,$+3),re(this,$+1,$+2);return this},g.prototype.swap64=function(){var k=this.length;if(k%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var $=0;$<k;$+=8)re(this,$,$+7),re(this,$+1,$+6),re(this,$+2,$+5),re(this,$+3,$+4);return this},g.prototype.toString=function(){var k=this.length;return k===0?"":arguments.length===0?Fe(this,0,k):O.apply(this,arguments)},g.prototype.toLocaleString=g.prototype.toString,g.prototype.equals=function(k){if(!g.isBuffer(k))throw new TypeError("Argument must be a Buffer");return this===k?!0:g.compare(this,k)===0},g.prototype.inspect=function(){var k="",$=a.INSPECT_MAX_BYTES;return k=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$&&(k+=" ... "),"<Buffer "+k+">"},g.prototype.compare=function(k,$,oe,_e,Ue){if(ie(k,Uint8Array)&&(k=g.from(k,k.offset,k.byteLength)),!g.isBuffer(k))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof k);if($===void 0&&($=0),oe===void 0&&(oe=k?k.length:0),_e===void 0&&(_e=0),Ue===void 0&&(Ue=this.length),$<0||oe>k.length||_e<0||Ue>this.length)throw new RangeError("out of range index");if(_e>=Ue&&$>=oe)return 0;if(_e>=Ue)return-1;if($>=oe)return 1;if($>>>=0,oe>>>=0,_e>>>=0,Ue>>>=0,this===k)return 0;for(var _n=Ue-_e,wn=oe-$,Tn=Math.min(_n,wn),Ln=this.slice(_e,Ue),Ve=k.slice($,oe),qe=0;qe<Tn;++qe)if(Ln[qe]!==Ve[qe]){_n=Ln[qe],wn=Ve[qe];break}return _n<wn?-1:wn<_n?1:0};function D(Y,k,$,oe,_e){if(Y.length===0)return-1;if(typeof $=="string"?(oe=$,$=0):$>2147483647?$=2147483647:$<-2147483648&&($=-2147483648),$=+$,ae($)&&($=_e?0:Y.length-1),$<0&&($=Y.length+$),$>=Y.length){if(_e)return-1;$=Y.length-1}else if($<0)if(_e)$=0;else return-1;if(typeof k=="string"&&(k=g.from(k,oe)),g.isBuffer(k))return k.length===0?-1:z(Y,k,$,oe,_e);if(typeof k=="number")return k=k&255,typeof Uint8Array.prototype.indexOf=="function"?_e?Uint8Array.prototype.indexOf.call(Y,k,$):Uint8Array.prototype.lastIndexOf.call(Y,k,$):z(Y,[k],$,oe,_e);throw new TypeError("val must be string, number or Buffer")}function z(Y,k,$,oe,_e){var Ue=1,_n=Y.length,wn=k.length;if(oe!==void 0&&(oe=String(oe).toLowerCase(),oe==="ucs2"||oe==="ucs-2"||oe==="utf16le"||oe==="utf-16le")){if(Y.length<2||k.length<2)return-1;Ue=2,_n/=2,wn/=2,$/=2}function Tn(An,xn){return Ue===1?An[xn]:An.readUInt16BE(xn*Ue)}var Ln;if(_e){var Ve=-1;for(Ln=$;Ln<_n;Ln++)if(Tn(Y,Ln)===Tn(k,Ve===-1?0:Ln-Ve)){if(Ve===-1&&(Ve=Ln),Ln-Ve+1===wn)return Ve*Ue}else Ve!==-1&&(Ln-=Ln-Ve),Ve=-1}else for($+wn>_n&&($=_n-wn),Ln=$;Ln>=0;Ln--){for(var qe=!0,Sn=0;Sn<wn;Sn++)if(Tn(Y,Ln+Sn)!==Tn(k,Sn)){qe=!1;break}if(qe)return Ln}return-1}g.prototype.includes=function(k,$,oe){return this.indexOf(k,$,oe)!==-1},g.prototype.indexOf=function(k,$,oe){return D(this,k,$,oe,!0)},g.prototype.lastIndexOf=function(k,$,oe){return D(this,k,$,oe,!1)};function V(Y,k,$,oe){$=Number($)||0;var _e=Y.length-$;oe?(oe=Number(oe),oe>_e&&(oe=_e)):oe=_e;var Ue=k.length;oe>Ue/2&&(oe=Ue/2);for(var _n=0;_n<oe;++_n){var wn=parseInt(k.substr(_n*2,2),16);if(ae(wn))return _n;Y[$+_n]=wn}return _n}function j(Y,k,$,oe){return Cn(xe(k,Y.length-$),Y,$,oe)}function F(Y,k,$,oe){return Cn(Ne(k),Y,$,oe)}function Ce(Y,k,$,oe){return F(Y,k,$,oe)}function le(Y,k,$,oe){return Cn(Dt(k),Y,$,oe)}function pe(Y,k,$,oe){return Cn(Lt(k,Y.length-$),Y,$,oe)}g.prototype.write=function(k,$,oe,_e){if($===void 0)_e="utf8",oe=this.length,$=0;else if(oe===void 0&&typeof $=="string")_e=$,oe=this.length,$=0;else if(isFinite($))$=$>>>0,isFinite(oe)?(oe=oe>>>0,_e===void 0&&(_e="utf8")):(_e=oe,oe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var Ue=this.length-$;if((oe===void 0||oe>Ue)&&(oe=Ue),k.length>0&&(oe<0||$<0)||$>this.length)throw new RangeError("Attempt to write outside buffer bounds");_e||(_e="utf8");for(var _n=!1;;)switch(_e){case"hex":return V(this,k,$,oe);case"utf8":case"utf-8":return j(this,k,$,oe);case"ascii":return F(this,k,$,oe);case"latin1":case"binary":return Ce(this,k,$,oe);case"base64":return le(this,k,$,oe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pe(this,k,$,oe);default:if(_n)throw new TypeError("Unknown encoding: "+_e);_e=(""+_e).toLowerCase(),_n=!0}},g.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $e(Y,k,$){return k===0&&$===Y.length?c.fromByteArray(Y):c.fromByteArray(Y.slice(k,$))}function Fe(Y,k,$){$=Math.min(Y.length,$);for(var oe=[],_e=k;_e<$;){var Ue=Y[_e],_n=null,wn=Ue>239?4:Ue>223?3:Ue>191?2:1;if(_e+wn<=$){var Tn,Ln,Ve,qe;switch(wn){case 1:Ue<128&&(_n=Ue);break;case 2:Tn=Y[_e+1],(Tn&192)===128&&(qe=(Ue&31)<<6|Tn&63,qe>127&&(_n=qe));break;case 3:Tn=Y[_e+1],Ln=Y[_e+2],(Tn&192)===128&&(Ln&192)===128&&(qe=(Ue&15)<<12|(Tn&63)<<6|Ln&63,qe>2047&&(qe<55296||qe>57343)&&(_n=qe));break;case 4:Tn=Y[_e+1],Ln=Y[_e+2],Ve=Y[_e+3],(Tn&192)===128&&(Ln&192)===128&&(Ve&192)===128&&(qe=(Ue&15)<<18|(Tn&63)<<12|(Ln&63)<<6|Ve&63,qe>65535&&qe<1114112&&(_n=qe))}}_n===null?(_n=65533,wn=1):_n>65535&&(_n-=65536,oe.push(_n>>>10&1023|55296),_n=56320|_n&1023),oe.push(_n),_e+=wn}return Et(oe)}var Oe=4096;function Et(Y){var k=Y.length;if(k<=Oe)return String.fromCharCode.apply(String,Y);for(var $="",oe=0;oe<k;)$+=String.fromCharCode.apply(String,Y.slice(oe,oe+=Oe));return $}function he(Y,k,$){var oe="";$=Math.min(Y.length,$);for(var _e=k;_e<$;++_e)oe+=String.fromCharCode(Y[_e]&127);return oe}function In(Y,k,$){var oe="";$=Math.min(Y.length,$);for(var _e=k;_e<$;++_e)oe+=String.fromCharCode(Y[_e]);return oe}function vn(Y,k,$){var oe=Y.length;(!k||k<0)&&(k=0),(!$||$<0||$>oe)&&($=oe);for(var _e="",Ue=k;Ue<$;++Ue)_e+=ze(Y[Ue]);return _e}function kt(Y,k,$){for(var oe=Y.slice(k,$),_e="",Ue=0;Ue<oe.length;Ue+=2)_e+=String.fromCharCode(oe[Ue]+oe[Ue+1]*256);return _e}g.prototype.slice=function(k,$){var oe=this.length;k=~~k,$=$===void 0?oe:~~$,k<0?(k+=oe,k<0&&(k=0)):k>oe&&(k=oe),$<0?($+=oe,$<0&&($=0)):$>oe&&($=oe),$<k&&($=k);var _e=this.subarray(k,$);return _e.__proto__=g.prototype,_e};function ue(Y,k,$){if(Y%1!==0||Y<0)throw new RangeError("offset is not uint");if(Y+k>$)throw new RangeError("Trying to access beyond buffer length")}g.prototype.readUIntLE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k],Ue=1,_n=0;++_n<$&&(Ue*=256);)_e+=this[k+_n]*Ue;return _e},g.prototype.readUIntBE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k+--$],Ue=1;$>0&&(Ue*=256);)_e+=this[k+--$]*Ue;return _e},g.prototype.readUInt8=function(k,$){return k=k>>>0,$||ue(k,1,this.length),this[k]},g.prototype.readUInt16LE=function(k,$){return k=k>>>0,$||ue(k,2,this.length),this[k]|this[k+1]<<8},g.prototype.readUInt16BE=function(k,$){return k=k>>>0,$||ue(k,2,this.length),this[k]<<8|this[k+1]},g.prototype.readUInt32LE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),(this[k]|this[k+1]<<8|this[k+2]<<16)+this[k+3]*16777216},g.prototype.readUInt32BE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]*16777216+(this[k+1]<<16|this[k+2]<<8|this[k+3])},g.prototype.readIntLE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=this[k],Ue=1,_n=0;++_n<$&&(Ue*=256);)_e+=this[k+_n]*Ue;return Ue*=128,_e>=Ue&&(_e-=Math.pow(2,8*$)),_e},g.prototype.readIntBE=function(k,$,oe){k=k>>>0,$=$>>>0,oe||ue(k,$,this.length);for(var _e=$,Ue=1,_n=this[k+--_e];_e>0&&(Ue*=256);)_n+=this[k+--_e]*Ue;return Ue*=128,_n>=Ue&&(_n-=Math.pow(2,8*$)),_n},g.prototype.readInt8=function(k,$){return k=k>>>0,$||ue(k,1,this.length),this[k]&128?(255-this[k]+1)*-1:this[k]},g.prototype.readInt16LE=function(k,$){k=k>>>0,$||ue(k,2,this.length);var oe=this[k]|this[k+1]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt16BE=function(k,$){k=k>>>0,$||ue(k,2,this.length);var oe=this[k+1]|this[k]<<8;return oe&32768?oe|4294901760:oe},g.prototype.readInt32LE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]|this[k+1]<<8|this[k+2]<<16|this[k+3]<<24},g.prototype.readInt32BE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),this[k]<<24|this[k+1]<<16|this[k+2]<<8|this[k+3]},g.prototype.readFloatLE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),d.read(this,k,!0,23,4)},g.prototype.readFloatBE=function(k,$){return k=k>>>0,$||ue(k,4,this.length),d.read(this,k,!1,23,4)},g.prototype.readDoubleLE=function(k,$){return k=k>>>0,$||ue(k,8,this.length),d.read(this,k,!0,52,8)},g.prototype.readDoubleBE=function(k,$){return k=k>>>0,$||ue(k,8,this.length),d.read(this,k,!1,52,8)};function At(Y,k,$,oe,_e,Ue){if(!g.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(k>_e||k<Ue)throw new RangeError('"value" argument is out of bounds');if($+oe>Y.length)throw new RangeError("Index out of range")}g.prototype.writeUIntLE=function(k,$,oe,_e){if(k=+k,$=$>>>0,oe=oe>>>0,!_e){var Ue=Math.pow(2,8*oe)-1;At(this,k,$,oe,Ue,0)}var _n=1,wn=0;for(this[$]=k&255;++wn<oe&&(_n*=256);)this[$+wn]=k/_n&255;return $+oe},g.prototype.writeUIntBE=function(k,$,oe,_e){if(k=+k,$=$>>>0,oe=oe>>>0,!_e){var Ue=Math.pow(2,8*oe)-1;At(this,k,$,oe,Ue,0)}var _n=oe-1,wn=1;for(this[$+_n]=k&255;--_n>=0&&(wn*=256);)this[$+_n]=k/wn&255;return $+oe},g.prototype.writeUInt8=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,1,255,0),this[$]=k&255,$+1},g.prototype.writeUInt16LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,65535,0),this[$]=k&255,this[$+1]=k>>>8,$+2},g.prototype.writeUInt16BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,65535,0),this[$]=k>>>8,this[$+1]=k&255,$+2},g.prototype.writeUInt32LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,4294967295,0),this[$+3]=k>>>24,this[$+2]=k>>>16,this[$+1]=k>>>8,this[$]=k&255,$+4},g.prototype.writeUInt32BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,4294967295,0),this[$]=k>>>24,this[$+1]=k>>>16,this[$+2]=k>>>8,this[$+3]=k&255,$+4},g.prototype.writeIntLE=function(k,$,oe,_e){if(k=+k,$=$>>>0,!_e){var Ue=Math.pow(2,8*oe-1);At(this,k,$,oe,Ue-1,-Ue)}var _n=0,wn=1,Tn=0;for(this[$]=k&255;++_n<oe&&(wn*=256);)k<0&&Tn===0&&this[$+_n-1]!==0&&(Tn=1),this[$+_n]=(k/wn>>0)-Tn&255;return $+oe},g.prototype.writeIntBE=function(k,$,oe,_e){if(k=+k,$=$>>>0,!_e){var Ue=Math.pow(2,8*oe-1);At(this,k,$,oe,Ue-1,-Ue)}var _n=oe-1,wn=1,Tn=0;for(this[$+_n]=k&255;--_n>=0&&(wn*=256);)k<0&&Tn===0&&this[$+_n+1]!==0&&(Tn=1),this[$+_n]=(k/wn>>0)-Tn&255;return $+oe},g.prototype.writeInt8=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,1,127,-128),k<0&&(k=255+k+1),this[$]=k&255,$+1},g.prototype.writeInt16LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,32767,-32768),this[$]=k&255,this[$+1]=k>>>8,$+2},g.prototype.writeInt16BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,2,32767,-32768),this[$]=k>>>8,this[$+1]=k&255,$+2},g.prototype.writeInt32LE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,2147483647,-2147483648),this[$]=k&255,this[$+1]=k>>>8,this[$+2]=k>>>16,this[$+3]=k>>>24,$+4},g.prototype.writeInt32BE=function(k,$,oe){return k=+k,$=$>>>0,oe||At(this,k,$,4,2147483647,-2147483648),k<0&&(k=4294967295+k+1),this[$]=k>>>24,this[$+1]=k>>>16,this[$+2]=k>>>8,this[$+3]=k&255,$+4};function jt(Y,k,$,oe,_e,Ue){if($+oe>Y.length)throw new RangeError("Index out of range");if($<0)throw new RangeError("Index out of range")}function hn(Y,k,$,oe,_e){return k=+k,$=$>>>0,_e||jt(Y,k,$,4),d.write(Y,k,$,oe,23,4),$+4}g.prototype.writeFloatLE=function(k,$,oe){return hn(this,k,$,!0,oe)},g.prototype.writeFloatBE=function(k,$,oe){return hn(this,k,$,!1,oe)};function Pt(Y,k,$,oe,_e){return k=+k,$=$>>>0,_e||jt(Y,k,$,8),d.write(Y,k,$,oe,52,8),$+8}g.prototype.writeDoubleLE=function(k,$,oe){return Pt(this,k,$,!0,oe)},g.prototype.writeDoubleBE=function(k,$,oe){return Pt(this,k,$,!1,oe)},g.prototype.copy=function(k,$,oe,_e){if(!g.isBuffer(k))throw new TypeError("argument should be a Buffer");if(oe||(oe=0),!_e&&_e!==0&&(_e=this.length),$>=k.length&&($=k.length),$||($=0),_e>0&&_e<oe&&(_e=oe),_e===oe||k.length===0||this.length===0)return 0;if($<0)throw new RangeError("targetStart out of bounds");if(oe<0||oe>=this.length)throw new RangeError("Index out of range");if(_e<0)throw new RangeError("sourceEnd out of bounds");_e>this.length&&(_e=this.length),k.length-$<_e-oe&&(_e=k.length-$+oe);var Ue=_e-oe;if(this===k&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin($,oe,_e);else if(this===k&&oe<$&&$<_e)for(var _n=Ue-1;_n>=0;--_n)k[_n+$]=this[_n+oe];else Uint8Array.prototype.set.call(k,this.subarray(oe,_e),$);return Ue},g.prototype.fill=function(k,$,oe,_e){if(typeof k=="string"){if(typeof $=="string"?(_e=$,$=0,oe=this.length):typeof oe=="string"&&(_e=oe,oe=this.length),_e!==void 0&&typeof _e!="string")throw new TypeError("encoding must be a string");if(typeof _e=="string"&&!g.isEncoding(_e))throw new TypeError("Unknown encoding: "+_e);if(k.length===1){var Ue=k.charCodeAt(0);(_e==="utf8"&&Ue<128||_e==="latin1")&&(k=Ue)}}else typeof k=="number"&&(k=k&255);if($<0||this.length<$||this.length<oe)throw new RangeError("Out of range index");if(oe<=$)return this;$=$>>>0,oe=oe===void 0?this.length:oe>>>0,k||(k=0);var _n;if(typeof k=="number")for(_n=$;_n<oe;++_n)this[_n]=k;else{var wn=g.isBuffer(k)?k:g.from(k,_e),Tn=wn.length;if(Tn===0)throw new TypeError('The value "'+k+'" is invalid for argument "value"');for(_n=0;_n<oe-$;++_n)this[_n+$]=wn[_n%Tn]}return this};var Ie=/[^+/0-9A-Za-z-_]/g;function de(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(Ie,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function ze(Y){return Y<16?"0"+Y.toString(16):Y.toString(16)}function xe(Y,k){k=k||1/0;for(var $,oe=Y.length,_e=null,Ue=[],_n=0;_n<oe;++_n){if($=Y.charCodeAt(_n),$>55295&&$<57344){if(!_e){if($>56319){(k-=3)>-1&&Ue.push(239,191,189);continue}else if(_n+1===oe){(k-=3)>-1&&Ue.push(239,191,189);continue}_e=$;continue}if($<56320){(k-=3)>-1&&Ue.push(239,191,189),_e=$;continue}$=(_e-55296<<10|$-56320)+65536}else _e&&(k-=3)>-1&&Ue.push(239,191,189);if(_e=null,$<128){if((k-=1)<0)break;Ue.push($)}else if($<2048){if((k-=2)<0)break;Ue.push($>>6|192,$&63|128)}else if($<65536){if((k-=3)<0)break;Ue.push($>>12|224,$>>6&63|128,$&63|128)}else if($<1114112){if((k-=4)<0)break;Ue.push($>>18|240,$>>12&63|128,$>>6&63|128,$&63|128)}else throw new Error("Invalid code point")}return Ue}function Ne(Y){for(var k=[],$=0;$<Y.length;++$)k.push(Y.charCodeAt($)&255);return k}function Lt(Y,k){for(var $,oe,_e,Ue=[],_n=0;_n<Y.length&&!((k-=2)<0);++_n)$=Y.charCodeAt(_n),oe=$>>8,_e=$%256,Ue.push(_e),Ue.push(oe);return Ue}function Dt(Y){return c.toByteArray(de(Y))}function Cn(Y,k,$,oe){for(var _e=0;_e<oe&&!(_e+$>=k.length||_e>=Y.length);++_e)k[_e+$]=Y[_e];return _e}function ie(Y,k){return Y instanceof k||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===k.name}function ae(Y){return Y!==Y}}).call(this)}).call(this,n("buffer").Buffer)},{"base64-js":25,buffer:29,ieee754:50}],30:[function(n,o,a){(function(u){(function(){a.formatArgs=d,a.save=f,a.load=h,a.useColors=c,a.storage=y(),a.destroy=(()=>{let p=!1;return()=>{p||(p=!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`."))}})(),a.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 c(){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 d(p){if(p[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+p[0]+(this.useColors?"%c ":" ")+"+"+o.exports.humanize(this.diff),!this.useColors)return;const v="color: "+this.color;p.splice(1,0,v,"color: inherit");let _=0,b=0;p[0].replace(/%[a-zA-Z%]/g,A=>{A!=="%%"&&(_++,A==="%c"&&(b=_))}),p.splice(b,0,v)}a.log=console.debug||console.log||(()=>{});function f(p){try{p?a.storage.setItem("debug",p):a.storage.removeItem("debug")}catch{}}function h(){let p;try{p=a.storage.getItem("debug")}catch{}return!p&&typeof u<"u"&&"env"in u&&(p=u.env.DEBUG),p}function y(){try{return localStorage}catch{}}o.exports=n("./common")(a);const{formatters:g}=o.exports;g.j=function(p){try{return JSON.stringify(p)}catch(v){return"[UnexpectedJSONParseError]: "+v.message}}}).call(this)}).call(this,n("_process"))},{"./common":31,_process:102}],31:[function(n,o,a){function u(c){f.debug=f,f.default=f,f.coerce=_,f.disable=g,f.enable=y,f.enabled=p,f.humanize=n("ms"),f.destroy=b,Object.keys(c).forEach(A=>{f[A]=c[A]}),f.names=[],f.skips=[],f.formatters={};function d(A){let w=0;for(let S=0;S<A.length;S++)w=(w<<5)-w+A.charCodeAt(S),w|=0;return f.colors[Math.abs(w)%f.colors.length]}f.selectColor=d;function f(A){let w,S=null,T,x;function M(...L){if(!M.enabled)return;const O=M,re=Number(new Date),D=re-(w||re);O.diff=D,O.prev=w,O.curr=re,w=re,L[0]=f.coerce(L[0]),typeof L[0]!="string"&&L.unshift("%O");let z=0;L[0]=L[0].replace(/%([a-zA-Z%])/g,(j,F)=>{if(j==="%%")return"%";z++;const Ce=f.formatters[F];if(typeof Ce=="function"){const le=L[z];j=Ce.call(O,le),L.splice(z,1),z--}return j}),f.formatArgs.call(O,L),(O.log||f.log).apply(O,L)}return M.namespace=A,M.useColors=f.useColors(),M.color=f.selectColor(A),M.extend=h,M.destroy=f.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(T!==f.namespaces&&(T=f.namespaces,x=f.enabled(A)),x),set:L=>{S=L}}),typeof f.init=="function"&&f.init(M),M}function h(A,w){const S=f(this.namespace+(typeof w>"u"?":":w)+A);return S.log=this.log,S}function y(A){f.save(A),f.namespaces=A,f.names=[],f.skips=[];let w;const S=(typeof A=="string"?A:"").split(/[\s,]+/),T=S.length;for(w=0;w<T;w++)S[w]&&(A=S[w].replace(/\*/g,".*?"),A[0]==="-"?f.skips.push(new RegExp("^"+A.slice(1)+"$")):f.names.push(new RegExp("^"+A+"$")))}function g(){const A=[...f.names.map(v),...f.skips.map(v).map(w=>"-"+w)].join(",");return f.enable(""),A}function p(A){if(A[A.length-1]==="*")return!0;let w,S;for(w=0,S=f.skips.length;w<S;w++)if(f.skips[w].test(A))return!1;for(w=0,S=f.names.length;w<S;w++)if(f.names[w].test(A))return!0;return!1}function v(A){return A.toString().substring(2,A.toString().length-2).replace(/\.\*\?$/,"*")}function _(A){return A instanceof Error?A.stack||A.message:A}function b(){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 f.enable(f.load()),f}o.exports=u},{ms:97}],32:[function(n,o,a){(function(u,c){(function(){var d=n("readable-stream"),f=n("end-of-stream"),h=n("inherits"),y=n("stream-shift"),g=c.from&&c.from!==Uint8Array.from?c.from([0]):new c([0]),p=function(T,x){T._corked?T.once("uncork",x):x()},v=function(T,x){T._autoDestroy&&T.destroy(x)},_=function(T,x){return function(M){M?v(T,M.message==="premature close"?null:M):x&&!T._ended&&T.end()}},b=function(T,x){if(!T||T._writableState&&T._writableState.finished)return x();if(T._writableState)return T.end(x);T.end(),x()},A=function(){},w=function(T){return new d.Readable({objectMode:!0,highWaterMark:16}).wrap(T)},S=function(T,x,M){if(!(this instanceof S))return new S(T,x,M);d.Duplex.call(this,M),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!M||M.autoDestroy!==!1,this._forwardDestroy=!M||M.destroy!==!1,this._forwardEnd=!M||M.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,T&&this.setWritable(T),x&&this.setReadable(x)};h(S,d.Duplex),S.obj=function(T,x,M){return M||(M={}),M.objectMode=!0,M.highWaterMark=16,new S(T,x,M)},S.prototype.cork=function(){++this._corked===1&&this.emit("cork")},S.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},S.prototype.setWritable=function(T){if(this._unwrite&&this._unwrite(),this.destroyed){T&&T.destroy&&T.destroy();return}if(T===null||T===!1){this.end();return}var x=this,M=f(T,{writable:!0,readable:!1},_(this,this._forwardEnd)),L=function(){var re=x._ondrain;x._ondrain=null,re&&re()},O=function(){x._writable.removeListener("drain",L),M()};this._unwrite&&u.nextTick(L),this._writable=T,this._writable.on("drain",L),this._unwrite=O,this.uncork()},S.prototype.setReadable=function(T){if(this._unread&&this._unread(),this.destroyed){T&&T.destroy&&T.destroy();return}if(T===null||T===!1){this.push(null),this.resume();return}var x=this,M=f(T,{writable:!1,readable:!0},_(this)),L=function(){x._forward()},O=function(){x.push(null)},re=function(){x._readable2.removeListener("readable",L),x._readable2.removeListener("end",O),M()};this._drained=!0,this._readable=T,this._readable2=T._readableState?T:w(T),this._readable2.on("readable",L),this._readable2.on("end",O),this._unread=re,this._forward()},S.prototype._read=function(){this._drained=!0,this._forward()},S.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var T;this._drained&&(T=y(this._readable2))!==null;)this.destroyed||(this._drained=this.push(T));this._forwarding=!1}},S.prototype.destroy=function(T,x){if(x||(x=A),this.destroyed)return x(null);this.destroyed=!0;var M=this;u.nextTick(function(){M._destroy(T),x(null)})},S.prototype._destroy=function(T){if(T){var x=this._ondrain;this._ondrain=null,x?x(T):this.emit("error",T)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},S.prototype._write=function(T,x,M){if(!this.destroyed){if(this._corked)return p(this,this._write.bind(this,T,x,M));if(T===g)return this._finish(M);if(!this._writable)return M();this._writable.write(T)===!1?this._ondrain=M:this.destroyed||M()}},S.prototype._finish=function(T){var x=this;this.emit("preend"),p(this,function(){b(x._forwardEnd&&x._writable,function(){x._writableState.prefinished===!1&&(x._writableState.prefinished=!0),x.emit("prefinish"),p(x,T)})})},S.prototype.end=function(T,x,M){return typeof T=="function"?this.end(null,null,T):typeof x=="function"?this.end(T,null,x):(this._ended=!0,T&&this.write(T),!this._writableState.ending&&!this._writableState.destroyed&&this.write(g),d.Writable.prototype.end.call(this,M))},o.exports=S}).call(this)}).call(this,n("_process"),n("buffer").Buffer)},{_process:102,buffer:29,"end-of-stream":48,inherits:51,"readable-stream":47,"stream-shift":135}],33:[function(n,o,a){function u(p,v){p.prototype=Object.create(v.prototype),p.prototype.constructor=p,p.__proto__=v}var c={};function d(p,v,_){_||(_=Error);function b(w,S,T){return typeof v=="string"?v:v(w,S,T)}var A=function(w){u(S,w);function S(T,x,M){return w.call(this,b(T,x,M))||this}return S}(_);A.prototype.name=_.name,A.prototype.code=p,c[p]=A}function f(p,v){if(Array.isArray(p)){var _=p.length;return p=p.map(function(b){return String(b)}),_>2?"one of ".concat(v," ").concat(p.slice(0,_-1).join(", "),", or ")+p[_-1]:_===2?"one of ".concat(v," ").concat(p[0]," or ").concat(p[1]):"of ".concat(v," ").concat(p[0])}else return"of ".concat(v," ").concat(String(p))}function h(p,v,_){return p.substr(!_||_<0?0:+_,v.length)===v}function y(p,v,_){return(_===void 0||_>p.length)&&(_=p.length),p.substring(_-v.length,_)===v}function g(p,v,_){return typeof _!="number"&&(_=0),_+v.length>p.length?!1:p.indexOf(v,_)!==-1}d("ERR_INVALID_OPT_VALUE",function(p,v){return'The value "'+v+'" is invalid for option "'+p+'"'},TypeError),d("ERR_INVALID_ARG_TYPE",function(p,v,_){var b;typeof v=="string"&&h(v,"not ")?(b="must not be",v=v.replace(/^not /,"")):b="must be";var A;if(y(p," argument"))A="The ".concat(p," ").concat(b," ").concat(f(v,"type"));else{var w=g(p,".")?"property":"argument";A='The "'.concat(p,'" ').concat(w," ").concat(b," ").concat(f(v,"type"))}return A+=". Received type ".concat(typeof _),A},TypeError),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),d("ERR_METHOD_NOT_IMPLEMENTED",function(p){return"The "+p+" method is not implemented"}),d("ERR_STREAM_PREMATURE_CLOSE","Premature close"),d("ERR_STREAM_DESTROYED",function(p){return"Cannot call "+p+" after a stream was destroyed"}),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),d("ERR_STREAM_WRITE_AFTER_END","write after end"),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_UNKNOWN_ENCODING",function(p){return"Unknown encoding: "+p},TypeError),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),o.exports.codes=c},{}],34:[function(n,o,a){(function(u){(function(){var c=Object.keys||function(b){var A=[];for(var w in b)A.push(w);return A};o.exports=p;var d=n("./_stream_readable"),f=n("./_stream_writable");n("inherits")(p,d);for(var h=c(f.prototype),y=0;y<h.length;y++){var g=h[y];p.prototype[g]||(p.prototype[g]=f.prototype[g])}function p(b){if(!(this instanceof p))return new p(b);d.call(this,b),f.call(this,b),this.allowHalfOpen=!0,b&&(b.readable===!1&&(this.readable=!1),b.writable===!1&&(this.writable=!1),b.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",v)))}Object.defineProperty(p.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(p.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(p.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function v(){this._writableState.ended||u.nextTick(_,this)}function _(b){b.end()}Object.defineProperty(p.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(A){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=A,this._writableState.destroyed=A)}})}).call(this)}).call(this,n("_process"))},{"./_stream_readable":36,"./_stream_writable":38,_process:102,inherits:51}],35:[function(n,o,a){o.exports=c;var u=n("./_stream_transform");n("inherits")(c,u);function c(d){if(!(this instanceof c))return new c(d);u.call(this,d)}c.prototype._transform=function(d,f,h){h(null,d)}},{"./_stream_transform":37,inherits:51}],36:[function(n,o,a){(function(u,c){(function(){o.exports=pe;var d;pe.ReadableState=le,n("events").EventEmitter;var f=function(ae,Y){return ae.listeners(Y).length},h=n("./internal/streams/stream"),y=n("buffer").Buffer,g=c.Uint8Array||function(){};function p(ie){return y.from(ie)}function v(ie){return y.isBuffer(ie)||ie instanceof g}var _=n("util"),b;_&&_.debuglog?b=_.debuglog("stream"):b=function(){};var A=n("./internal/streams/buffer_list"),w=n("./internal/streams/destroy"),S=n("./internal/streams/state"),T=S.getHighWaterMark,x=n("../errors").codes,M=x.ERR_INVALID_ARG_TYPE,L=x.ERR_STREAM_PUSH_AFTER_EOF,O=x.ERR_METHOD_NOT_IMPLEMENTED,re=x.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,D,z,V;n("inherits")(pe,h);var j=w.errorOrDestroy,F=["error","close","destroy","pause","resume"];function Ce(ie,ae,Y){if(typeof ie.prependListener=="function")return ie.prependListener(ae,Y);!ie._events||!ie._events[ae]?ie.on(ae,Y):Array.isArray(ie._events[ae])?ie._events[ae].unshift(Y):ie._events[ae]=[Y,ie._events[ae]]}function le(ie,ae,Y){d=d||n("./_stream_duplex"),ie=ie||{},typeof Y!="boolean"&&(Y=ae instanceof d),this.objectMode=!!ie.objectMode,Y&&(this.objectMode=this.objectMode||!!ie.readableObjectMode),this.highWaterMark=T(this,ie,"readableHighWaterMark",Y),this.buffer=new A,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=ie.emitClose!==!1,this.autoDestroy=!!ie.autoDestroy,this.destroyed=!1,this.defaultEncoding=ie.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,ie.encoding&&(D||(D=n("string_decoder/").StringDecoder),this.decoder=new D(ie.encoding),this.encoding=ie.encoding)}function pe(ie){if(d=d||n("./_stream_duplex"),!(this instanceof pe))return new pe(ie);var ae=this instanceof d;this._readableState=new le(ie,this,ae),this.readable=!0,ie&&(typeof ie.read=="function"&&(this._read=ie.read),typeof ie.destroy=="function"&&(this._destroy=ie.destroy)),h.call(this)}Object.defineProperty(pe.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(ae){this._readableState&&(this._readableState.destroyed=ae)}}),pe.prototype.destroy=w.destroy,pe.prototype._undestroy=w.undestroy,pe.prototype._destroy=function(ie,ae){ae(ie)},pe.prototype.push=function(ie,ae){var Y=this._readableState,k;return Y.objectMode?k=!0:typeof ie=="string"&&(ae=ae||Y.defaultEncoding,ae!==Y.encoding&&(ie=y.from(ie,ae),ae=""),k=!0),$e(this,ie,ae,!1,k)},pe.prototype.unshift=function(ie){return $e(this,ie,null,!0,!1)};function $e(ie,ae,Y,k,$){b("readableAddChunk",ae);var oe=ie._readableState;if(ae===null)oe.reading=!1,vn(ie,oe);else{var _e;if($||(_e=Oe(oe,ae)),_e)j(ie,_e);else if(oe.objectMode||ae&&ae.length>0)if(typeof ae!="string"&&!oe.objectMode&&Object.getPrototypeOf(ae)!==y.prototype&&(ae=p(ae)),k)oe.endEmitted?j(ie,new re):Fe(ie,oe,ae,!0);else if(oe.ended)j(ie,new L);else{if(oe.destroyed)return!1;oe.reading=!1,oe.decoder&&!Y?(ae=oe.decoder.write(ae),oe.objectMode||ae.length!==0?Fe(ie,oe,ae,!1):At(ie,oe)):Fe(ie,oe,ae,!1)}else k||(oe.reading=!1,At(ie,oe))}return!oe.ended&&(oe.length<oe.highWaterMark||oe.length===0)}function Fe(ie,ae,Y,k){ae.flowing&&ae.length===0&&!ae.sync?(ae.awaitDrain=0,ie.emit("data",Y)):(ae.length+=ae.objectMode?1:Y.length,k?ae.buffer.unshift(Y):ae.buffer.push(Y),ae.needReadable&&kt(ie)),At(ie,ae)}function Oe(ie,ae){var Y;return!v(ae)&&typeof ae!="string"&&ae!==void 0&&!ie.objectMode&&(Y=new M("chunk",["string","Buffer","Uint8Array"],ae)),Y}pe.prototype.isPaused=function(){return this._readableState.flowing===!1},pe.prototype.setEncoding=function(ie){D||(D=n("string_decoder/").StringDecoder);var ae=new D(ie);this._readableState.decoder=ae,this._readableState.encoding=this._readableState.decoder.encoding;for(var Y=this._readableState.buffer.head,k="";Y!==null;)k+=ae.write(Y.data),Y=Y.next;return this._readableState.buffer.clear(),k!==""&&this._readableState.buffer.push(k),this._readableState.length=k.length,this};var Et=1073741824;function he(ie){return ie>=Et?ie=Et:(ie--,ie|=ie>>>1,ie|=ie>>>2,ie|=ie>>>4,ie|=ie>>>8,ie|=ie>>>16,ie++),ie}function In(ie,ae){return ie<=0||ae.length===0&&ae.ended?0:ae.objectMode?1:ie!==ie?ae.flowing&&ae.length?ae.buffer.head.data.length:ae.length:(ie>ae.highWaterMark&&(ae.highWaterMark=he(ie)),ie<=ae.length?ie:ae.ended?ae.length:(ae.needReadable=!0,0))}pe.prototype.read=function(ie){b("read",ie),ie=parseInt(ie,10);var ae=this._readableState,Y=ie;if(ie!==0&&(ae.emittedReadable=!1),ie===0&&ae.needReadable&&((ae.highWaterMark!==0?ae.length>=ae.highWaterMark:ae.length>0)||ae.ended))return b("read: emitReadable",ae.length,ae.ended),ae.length===0&&ae.ended?Lt(this):kt(this),null;if(ie=In(ie,ae),ie===0&&ae.ended)return ae.length===0&&Lt(this),null;var k=ae.needReadable;b("need readable",k),(ae.length===0||ae.length-ie<ae.highWaterMark)&&(k=!0,b("length less than watermark",k)),ae.ended||ae.reading?(k=!1,b("reading or ended",k)):k&&(b("do read"),ae.reading=!0,ae.sync=!0,ae.length===0&&(ae.needReadable=!0),this._read(ae.highWaterMark),ae.sync=!1,ae.reading||(ie=In(Y,ae)));var $;return ie>0?$=Ne(ie,ae):$=null,$===null?(ae.needReadable=ae.length<=ae.highWaterMark,ie=0):(ae.length-=ie,ae.awaitDrain=0),ae.length===0&&(ae.ended||(ae.needReadable=!0),Y!==ie&&ae.ended&&Lt(this)),$!==null&&this.emit("data",$),$};function vn(ie,ae){if(b("onEofChunk"),!ae.ended){if(ae.decoder){var Y=ae.decoder.end();Y&&Y.length&&(ae.buffer.push(Y),ae.length+=ae.objectMode?1:Y.length)}ae.ended=!0,ae.sync?kt(ie):(ae.needReadable=!1,ae.emittedReadable||(ae.emittedReadable=!0,ue(ie)))}}function kt(ie){var ae=ie._readableState;b("emitReadable",ae.needReadable,ae.emittedReadable),ae.needReadable=!1,ae.emittedReadable||(b("emitReadable",ae.flowing),ae.emittedReadable=!0,u.nextTick(ue,ie))}function ue(ie){var ae=ie._readableState;b("emitReadable_",ae.destroyed,ae.length,ae.ended),!ae.destroyed&&(ae.length||ae.ended)&&(ie.emit("readable"),ae.emittedReadable=!1),ae.needReadable=!ae.flowing&&!ae.ended&&ae.length<=ae.highWaterMark,xe(ie)}function At(ie,ae){ae.readingMore||(ae.readingMore=!0,u.nextTick(jt,ie,ae))}function jt(ie,ae){for(;!ae.reading&&!ae.ended&&(ae.length<ae.highWaterMark||ae.flowing&&ae.length===0);){var Y=ae.length;if(b("maybeReadMore read 0"),ie.read(0),Y===ae.length)break}ae.readingMore=!1}pe.prototype._read=function(ie){j(this,new O("_read()"))},pe.prototype.pipe=function(ie,ae){var Y=this,k=this._readableState;switch(k.pipesCount){case 0:k.pipes=ie;break;case 1:k.pipes=[k.pipes,ie];break;default:k.pipes.push(ie);break}k.pipesCount+=1,b("pipe count=%d opts=%j",k.pipesCount,ae);var $=(!ae||ae.end!==!1)&&ie!==u.stdout&&ie!==u.stderr,oe=$?Ue:An;k.endEmitted?u.nextTick(oe):Y.once("end",oe),ie.on("unpipe",_e);function _e(xn,Bn){b("onunpipe"),xn===Y&&Bn&&Bn.hasUnpiped===!1&&(Bn.hasUnpiped=!0,Tn())}function Ue(){b("onend"),ie.end()}var _n=hn(Y);ie.on("drain",_n);var wn=!1;function Tn(){b("cleanup"),ie.removeListener("close",qe),ie.removeListener("finish",Sn),ie.removeListener("drain",_n),ie.removeListener("error",Ve),ie.removeListener("unpipe",_e),Y.removeListener("end",Ue),Y.removeListener("end",An),Y.removeListener("data",Ln),wn=!0,k.awaitDrain&&(!ie._writableState||ie._writableState.needDrain)&&_n()}Y.on("data",Ln);function Ln(xn){b("ondata");var Bn=ie.write(xn);b("dest.write",Bn),Bn===!1&&((k.pipesCount===1&&k.pipes===ie||k.pipesCount>1&&Cn(k.pipes,ie)!==-1)&&!wn&&(b("false write response, pause",k.awaitDrain),k.awaitDrain++),Y.pause())}function Ve(xn){b("onerror",xn),An(),ie.removeListener("error",Ve),f(ie,"error")===0&&j(ie,xn)}Ce(ie,"error",Ve);function qe(){ie.removeListener("finish",Sn),An()}ie.once("close",qe);function Sn(){b("onfinish"),ie.removeListener("close",qe),An()}ie.once("finish",Sn);function An(){b("unpipe"),Y.unpipe(ie)}return ie.emit("pipe",Y),k.flowing||(b("pipe resume"),Y.resume()),ie};function hn(ie){return function(){var Y=ie._readableState;b("pipeOnDrain",Y.awaitDrain),Y.awaitDrain&&Y.awaitDrain--,Y.awaitDrain===0&&f(ie,"data")&&(Y.flowing=!0,xe(ie))}}pe.prototype.unpipe=function(ie){var ae=this._readableState,Y={hasUnpiped:!1};if(ae.pipesCount===0)return this;if(ae.pipesCount===1)return ie&&ie!==ae.pipes?this:(ie||(ie=ae.pipes),ae.pipes=null,ae.pipesCount=0,ae.flowing=!1,ie&&ie.emit("unpipe",this,Y),this);if(!ie){var k=ae.pipes,$=ae.pipesCount;ae.pipes=null,ae.pipesCount=0,ae.flowing=!1;for(var oe=0;oe<$;oe++)k[oe].emit("unpipe",this,{hasUnpiped:!1});return this}var _e=Cn(ae.pipes,ie);return _e===-1?this:(ae.pipes.splice(_e,1),ae.pipesCount-=1,ae.pipesCount===1&&(ae.pipes=ae.pipes[0]),ie.emit("unpipe",this,Y),this)},pe.prototype.on=function(ie,ae){var Y=h.prototype.on.call(this,ie,ae),k=this._readableState;return ie==="data"?(k.readableListening=this.listenerCount("readable")>0,k.flowing!==!1&&this.resume()):ie==="readable"&&!k.endEmitted&&!k.readableListening&&(k.readableListening=k.needReadable=!0,k.flowing=!1,k.emittedReadable=!1,b("on readable",k.length,k.reading),k.length?kt(this):k.reading||u.nextTick(Ie,this)),Y},pe.prototype.addListener=pe.prototype.on,pe.prototype.removeListener=function(ie,ae){var Y=h.prototype.removeListener.call(this,ie,ae);return ie==="readable"&&u.nextTick(Pt,this),Y},pe.prototype.removeAllListeners=function(ie){var ae=h.prototype.removeAllListeners.apply(this,arguments);return(ie==="readable"||ie===void 0)&&u.nextTick(Pt,this),ae};function Pt(ie){var ae=ie._readableState;ae.readableListening=ie.listenerCount("readable")>0,ae.resumeScheduled&&!ae.paused?ae.flowing=!0:ie.listenerCount("data")>0&&ie.resume()}function Ie(ie){b("readable nexttick read 0"),ie.read(0)}pe.prototype.resume=function(){var ie=this._readableState;return ie.flowing||(b("resume"),ie.flowing=!ie.readableListening,de(this,ie)),ie.paused=!1,this};function de(ie,ae){ae.resumeScheduled||(ae.resumeScheduled=!0,u.nextTick(ze,ie,ae))}function ze(ie,ae){b("resume",ae.reading),ae.reading||ie.read(0),ae.resumeScheduled=!1,ie.emit("resume"),xe(ie),ae.flowing&&!ae.reading&&ie.read(0)}pe.prototype.pause=function(){return b("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(b("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function xe(ie){var ae=ie._readableState;for(b("flow",ae.flowing);ae.flowing&&ie.read()!==null;);}pe.prototype.wrap=function(ie){var ae=this,Y=this._readableState,k=!1;ie.on("end",function(){if(b("wrapped end"),Y.decoder&&!Y.ended){var _e=Y.decoder.end();_e&&_e.length&&ae.push(_e)}ae.push(null)}),ie.on("data",function(_e){if(b("wrapped data"),Y.decoder&&(_e=Y.decoder.write(_e)),!(Y.objectMode&&_e==null)&&!(!Y.objectMode&&(!_e||!_e.length))){var Ue=ae.push(_e);Ue||(k=!0,ie.pause())}});for(var $ in ie)this[$]===void 0&&typeof ie[$]=="function"&&(this[$]=function(Ue){return function(){return ie[Ue].apply(ie,arguments)}}($));for(var oe=0;oe<F.length;oe++)ie.on(F[oe],this.emit.bind(this,F[oe]));return this._read=function(_e){b("wrapped _read",_e),k&&(k=!1,ie.resume())},this},typeof Symbol=="function"&&(pe.prototype[Symbol.asyncIterator]=function(){return z===void 0&&(z=n("./internal/streams/async_iterator")),z(this)}),Object.defineProperty(pe.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(pe.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(pe.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(ae){this._readableState&&(this._readableState.flowing=ae)}}),pe._fromList=Ne,Object.defineProperty(pe.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Ne(ie,ae){if(ae.length===0)return null;var Y;return ae.objectMode?Y=ae.buffer.shift():!ie||ie>=ae.length?(ae.decoder?Y=ae.buffer.join(""):ae.buffer.length===1?Y=ae.buffer.first():Y=ae.buffer.concat(ae.length),ae.buffer.clear()):Y=ae.buffer.consume(ie,ae.decoder),Y}function Lt(ie){var ae=ie._readableState;b("endReadable",ae.endEmitted),ae.endEmitted||(ae.ended=!0,u.nextTick(Dt,ae,ie))}function Dt(ie,ae){if(b("endReadableNT",ie.endEmitted,ie.length),!ie.endEmitted&&ie.length===0&&(ie.endEmitted=!0,ae.readable=!1,ae.emit("end"),ie.autoDestroy)){var Y=ae._writableState;(!Y||Y.autoDestroy&&Y.finished)&&ae.destroy()}}typeof Symbol=="function"&&(pe.from=function(ie,ae){return V===void 0&&(V=n("./internal/streams/from")),V(pe,ie,ae)});function Cn(ie,ae){for(var Y=0,k=ie.length;Y<k;Y++)if(ie[Y]===ae)return Y;return-1}}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/async_iterator":39,"./internal/streams/buffer_list":40,"./internal/streams/destroy":41,"./internal/streams/from":43,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,events:49,inherits:51,"string_decoder/":136,util:26}],37:[function(n,o,a){o.exports=p;var u=n("../errors").codes,c=u.ERR_METHOD_NOT_IMPLEMENTED,d=u.ERR_MULTIPLE_CALLBACK,f=u.ERR_TRANSFORM_ALREADY_TRANSFORMING,h=u.ERR_TRANSFORM_WITH_LENGTH_0,y=n("./_stream_duplex");n("inherits")(p,y);function g(b,A){var w=this._transformState;w.transforming=!1;var S=w.writecb;if(S===null)return this.emit("error",new d);w.writechunk=null,w.writecb=null,A!=null&&this.push(A),S(b);var T=this._readableState;T.reading=!1,(T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}function p(b){if(!(this instanceof p))return new p(b);y.call(this,b),this._transformState={afterTransform:g.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,b&&(typeof b.transform=="function"&&(this._transform=b.transform),typeof b.flush=="function"&&(this._flush=b.flush)),this.on("prefinish",v)}function v(){var b=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(A,w){_(b,A,w)}):_(this,null,null)}p.prototype.push=function(b,A){return this._transformState.needTransform=!1,y.prototype.push.call(this,b,A)},p.prototype._transform=function(b,A,w){w(new c("_transform()"))},p.prototype._write=function(b,A,w){var S=this._transformState;if(S.writecb=w,S.writechunk=b,S.writeencoding=A,!S.transforming){var T=this._readableState;(S.needTransform||T.needReadable||T.length<T.highWaterMark)&&this._read(T.highWaterMark)}},p.prototype._read=function(b){var A=this._transformState;A.writechunk!==null&&!A.transforming?(A.transforming=!0,this._transform(A.writechunk,A.writeencoding,A.afterTransform)):A.needTransform=!0},p.prototype._destroy=function(b,A){y.prototype._destroy.call(this,b,function(w){A(w)})};function _(b,A,w){if(A)return b.emit("error",A);if(w!=null&&b.push(w),b._writableState.length)throw new h;if(b._transformState.transforming)throw new f;return b.push(null)}},{"../errors":33,"./_stream_duplex":34,inherits:51}],38:[function(n,o,a){(function(u,c){(function(){o.exports=le;function d(xe){var Ne=this;this.next=null,this.entry=null,this.finish=function(){ze(Ne,xe)}}var f;le.WritableState=F;var h={deprecate:n("util-deprecate")},y=n("./internal/streams/stream"),g=n("buffer").Buffer,p=c.Uint8Array||function(){};function v(xe){return g.from(xe)}function _(xe){return g.isBuffer(xe)||xe instanceof p}var b=n("./internal/streams/destroy"),A=n("./internal/streams/state"),w=A.getHighWaterMark,S=n("../errors").codes,T=S.ERR_INVALID_ARG_TYPE,x=S.ERR_METHOD_NOT_IMPLEMENTED,M=S.ERR_MULTIPLE_CALLBACK,L=S.ERR_STREAM_CANNOT_PIPE,O=S.ERR_STREAM_DESTROYED,re=S.ERR_STREAM_NULL_VALUES,D=S.ERR_STREAM_WRITE_AFTER_END,z=S.ERR_UNKNOWN_ENCODING,V=b.errorOrDestroy;n("inherits")(le,y);function j(){}function F(xe,Ne,Lt){f=f||n("./_stream_duplex"),xe=xe||{},typeof Lt!="boolean"&&(Lt=Ne instanceof f),this.objectMode=!!xe.objectMode,Lt&&(this.objectMode=this.objectMode||!!xe.writableObjectMode),this.highWaterMark=w(this,xe,"writableHighWaterMark",Lt),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Dt=xe.decodeStrings===!1;this.decodeStrings=!Dt,this.defaultEncoding=xe.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Cn){vn(Ne,Cn)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=xe.emitClose!==!1,this.autoDestroy=!!xe.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new d(this)}F.prototype.getBuffer=function(){for(var Ne=this.bufferedRequest,Lt=[];Ne;)Lt.push(Ne),Ne=Ne.next;return Lt},function(){try{Object.defineProperty(F.prototype,"buffer",{get:h.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Ce;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Ce=Function.prototype[Symbol.hasInstance],Object.defineProperty(le,Symbol.hasInstance,{value:function(Ne){return Ce.call(this,Ne)?!0:this!==le?!1:Ne&&Ne._writableState instanceof F}})):Ce=function(Ne){return Ne instanceof this};function le(xe){f=f||n("./_stream_duplex");var Ne=this instanceof f;if(!Ne&&!Ce.call(le,this))return new le(xe);this._writableState=new F(xe,this,Ne),this.writable=!0,xe&&(typeof xe.write=="function"&&(this._write=xe.write),typeof xe.writev=="function"&&(this._writev=xe.writev),typeof xe.destroy=="function"&&(this._destroy=xe.destroy),typeof xe.final=="function"&&(this._final=xe.final)),y.call(this)}le.prototype.pipe=function(){V(this,new L)};function pe(xe,Ne){var Lt=new D;V(xe,Lt),u.nextTick(Ne,Lt)}function $e(xe,Ne,Lt,Dt){var Cn;return Lt===null?Cn=new re:typeof Lt!="string"&&!Ne.objectMode&&(Cn=new T("chunk",["string","Buffer"],Lt)),Cn?(V(xe,Cn),u.nextTick(Dt,Cn),!1):!0}le.prototype.write=function(xe,Ne,Lt){var Dt=this._writableState,Cn=!1,ie=!Dt.objectMode&&_(xe);return ie&&!g.isBuffer(xe)&&(xe=v(xe)),typeof Ne=="function"&&(Lt=Ne,Ne=null),ie?Ne="buffer":Ne||(Ne=Dt.defaultEncoding),typeof Lt!="function"&&(Lt=j),Dt.ending?pe(this,Lt):(ie||$e(this,Dt,xe,Lt))&&(Dt.pendingcb++,Cn=Oe(this,Dt,ie,xe,Ne,Lt)),Cn},le.prototype.cork=function(){this._writableState.corked++},le.prototype.uncork=function(){var xe=this._writableState;xe.corked&&(xe.corked--,!xe.writing&&!xe.corked&&!xe.bufferProcessing&&xe.bufferedRequest&&At(this,xe))},le.prototype.setDefaultEncoding=function(Ne){if(typeof Ne=="string"&&(Ne=Ne.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((Ne+"").toLowerCase())>-1))throw new z(Ne);return this._writableState.defaultEncoding=Ne,this},Object.defineProperty(le.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Fe(xe,Ne,Lt){return!xe.objectMode&&xe.decodeStrings!==!1&&typeof Ne=="string"&&(Ne=g.from(Ne,Lt)),Ne}Object.defineProperty(le.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Oe(xe,Ne,Lt,Dt,Cn,ie){if(!Lt){var ae=Fe(Ne,Dt,Cn);Dt!==ae&&(Lt=!0,Cn="buffer",Dt=ae)}var Y=Ne.objectMode?1:Dt.length;Ne.length+=Y;var k=Ne.length<Ne.highWaterMark;if(k||(Ne.needDrain=!0),Ne.writing||Ne.corked){var $=Ne.lastBufferedRequest;Ne.lastBufferedRequest={chunk:Dt,encoding:Cn,isBuf:Lt,callback:ie,next:null},$?$.next=Ne.lastBufferedRequest:Ne.bufferedRequest=Ne.lastBufferedRequest,Ne.bufferedRequestCount+=1}else Et(xe,Ne,!1,Y,Dt,Cn,ie);return k}function Et(xe,Ne,Lt,Dt,Cn,ie,ae){Ne.writelen=Dt,Ne.writecb=ae,Ne.writing=!0,Ne.sync=!0,Ne.destroyed?Ne.onwrite(new O("write")):Lt?xe._writev(Cn,Ne.onwrite):xe._write(Cn,ie,Ne.onwrite),Ne.sync=!1}function he(xe,Ne,Lt,Dt,Cn){--Ne.pendingcb,Lt?(u.nextTick(Cn,Dt),u.nextTick(Ie,xe,Ne),xe._writableState.errorEmitted=!0,V(xe,Dt)):(Cn(Dt),xe._writableState.errorEmitted=!0,V(xe,Dt),Ie(xe,Ne))}function In(xe){xe.writing=!1,xe.writecb=null,xe.length-=xe.writelen,xe.writelen=0}function vn(xe,Ne){var Lt=xe._writableState,Dt=Lt.sync,Cn=Lt.writecb;if(typeof Cn!="function")throw new M;if(In(Lt),Ne)he(xe,Lt,Dt,Ne,Cn);else{var ie=jt(Lt)||xe.destroyed;!ie&&!Lt.corked&&!Lt.bufferProcessing&&Lt.bufferedRequest&&At(xe,Lt),Dt?u.nextTick(kt,xe,Lt,ie,Cn):kt(xe,Lt,ie,Cn)}}function kt(xe,Ne,Lt,Dt){Lt||ue(xe,Ne),Ne.pendingcb--,Dt(),Ie(xe,Ne)}function ue(xe,Ne){Ne.length===0&&Ne.needDrain&&(Ne.needDrain=!1,xe.emit("drain"))}function At(xe,Ne){Ne.bufferProcessing=!0;var Lt=Ne.bufferedRequest;if(xe._writev&&Lt&&Lt.next){var Dt=Ne.bufferedRequestCount,Cn=new Array(Dt),ie=Ne.corkedRequestsFree;ie.entry=Lt;for(var ae=0,Y=!0;Lt;)Cn[ae]=Lt,Lt.isBuf||(Y=!1),Lt=Lt.next,ae+=1;Cn.allBuffers=Y,Et(xe,Ne,!0,Ne.length,Cn,"",ie.finish),Ne.pendingcb++,Ne.lastBufferedRequest=null,ie.next?(Ne.corkedRequestsFree=ie.next,ie.next=null):Ne.corkedRequestsFree=new d(Ne),Ne.bufferedRequestCount=0}else{for(;Lt;){var k=Lt.chunk,$=Lt.encoding,oe=Lt.callback,_e=Ne.objectMode?1:k.length;if(Et(xe,Ne,!1,_e,k,$,oe),Lt=Lt.next,Ne.bufferedRequestCount--,Ne.writing)break}Lt===null&&(Ne.lastBufferedRequest=null)}Ne.bufferedRequest=Lt,Ne.bufferProcessing=!1}le.prototype._write=function(xe,Ne,Lt){Lt(new x("_write()"))},le.prototype._writev=null,le.prototype.end=function(xe,Ne,Lt){var Dt=this._writableState;return typeof xe=="function"?(Lt=xe,xe=null,Ne=null):typeof Ne=="function"&&(Lt=Ne,Ne=null),xe!=null&&this.write(xe,Ne),Dt.corked&&(Dt.corked=1,this.uncork()),Dt.ending||de(this,Dt,Lt),this},Object.defineProperty(le.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function jt(xe){return xe.ending&&xe.length===0&&xe.bufferedRequest===null&&!xe.finished&&!xe.writing}function hn(xe,Ne){xe._final(function(Lt){Ne.pendingcb--,Lt&&V(xe,Lt),Ne.prefinished=!0,xe.emit("prefinish"),Ie(xe,Ne)})}function Pt(xe,Ne){!Ne.prefinished&&!Ne.finalCalled&&(typeof xe._final=="function"&&!Ne.destroyed?(Ne.pendingcb++,Ne.finalCalled=!0,u.nextTick(hn,xe,Ne)):(Ne.prefinished=!0,xe.emit("prefinish")))}function Ie(xe,Ne){var Lt=jt(Ne);if(Lt&&(Pt(xe,Ne),Ne.pendingcb===0&&(Ne.finished=!0,xe.emit("finish"),Ne.autoDestroy))){var Dt=xe._readableState;(!Dt||Dt.autoDestroy&&Dt.endEmitted)&&xe.destroy()}return Lt}function de(xe,Ne,Lt){Ne.ending=!0,Ie(xe,Ne),Lt&&(Ne.finished?u.nextTick(Lt):xe.once("finish",Lt)),Ne.ended=!0,xe.writable=!1}function ze(xe,Ne,Lt){var Dt=xe.entry;for(xe.entry=null;Dt;){var Cn=Dt.callback;Ne.pendingcb--,Cn(Lt),Dt=Dt.next}Ne.corkedRequestsFree.next=xe}Object.defineProperty(le.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Ne){this._writableState&&(this._writableState.destroyed=Ne)}}),le.prototype.destroy=b.destroy,le.prototype._undestroy=b.undestroy,le.prototype._destroy=function(xe,Ne){Ne(xe)}}).call(this)}).call(this,n("_process"),typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{"../errors":33,"./_stream_duplex":34,"./internal/streams/destroy":41,"./internal/streams/state":45,"./internal/streams/stream":46,_process:102,buffer:29,inherits:51,"util-deprecate":139}],39:[function(n,o,a){(function(u){(function(){var c;function d(O,re,D){return re in O?Object.defineProperty(O,re,{value:D,enumerable:!0,configurable:!0,writable:!0}):O[re]=D,O}var f=n("./end-of-stream"),h=Symbol("lastResolve"),y=Symbol("lastReject"),g=Symbol("error"),p=Symbol("ended"),v=Symbol("lastPromise"),_=Symbol("handlePromise"),b=Symbol("stream");function A(O,re){return{value:O,done:re}}function w(O){var re=O[h];if(re!==null){var D=O[b].read();D!==null&&(O[v]=null,O[h]=null,O[y]=null,re(A(D,!1)))}}function S(O){u.nextTick(w,O)}function T(O,re){return function(D,z){O.then(function(){if(re[p]){D(A(void 0,!0));return}re[_](D,z)},z)}}var x=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((c={get stream(){return this[b]},next:function(){var re=this,D=this[g];if(D!==null)return Promise.reject(D);if(this[p])return Promise.resolve(A(void 0,!0));if(this[b].destroyed)return new Promise(function(F,Ce){u.nextTick(function(){re[g]?Ce(re[g]):F(A(void 0,!0))})});var z=this[v],V;if(z)V=new Promise(T(z,this));else{var j=this[b].read();if(j!==null)return Promise.resolve(A(j,!1));V=new Promise(this[_])}return this[v]=V,V}},d(c,Symbol.asyncIterator,function(){return this}),d(c,"return",function(){var re=this;return new Promise(function(D,z){re[b].destroy(null,function(V){if(V){z(V);return}D(A(void 0,!0))})})}),c),x),L=function(re){var D,z=Object.create(M,(D={},d(D,b,{value:re,writable:!0}),d(D,h,{value:null,writable:!0}),d(D,y,{value:null,writable:!0}),d(D,g,{value:null,writable:!0}),d(D,p,{value:re._readableState.endEmitted,writable:!0}),d(D,_,{value:function(j,F){var Ce=z[b].read();Ce?(z[v]=null,z[h]=null,z[y]=null,j(A(Ce,!1))):(z[h]=j,z[y]=F)},writable:!0}),D));return z[v]=null,f(re,function(V){if(V&&V.code!=="ERR_STREAM_PREMATURE_CLOSE"){var j=z[y];j!==null&&(z[v]=null,z[h]=null,z[y]=null,j(V)),z[g]=V;return}var F=z[h];F!==null&&(z[v]=null,z[h]=null,z[y]=null,F(A(void 0,!0))),z[p]=!0}),re.on("readable",S.bind(null,z)),z};o.exports=L}).call(this)}).call(this,n("_process"))},{"./end-of-stream":42,_process:102}],40:[function(n,o,a){function u(w,S){var T=Object.keys(w);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(w);S&&(x=x.filter(function(M){return Object.getOwnPropertyDescriptor(w,M).enumerable})),T.push.apply(T,x)}return T}function c(w){for(var S=1;S<arguments.length;S++){var T=arguments[S]!=null?arguments[S]:{};S%2?u(Object(T),!0).forEach(function(x){d(w,x,T[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(T)):u(Object(T)).forEach(function(x){Object.defineProperty(w,x,Object.getOwnPropertyDescriptor(T,x))})}return w}function d(w,S,T){return S in w?Object.defineProperty(w,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):w[S]=T,w}function f(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")}function h(w,S){for(var T=0;T<S.length;T++){var x=S[T];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(w,x.key,x)}}function y(w,S,T){return S&&h(w.prototype,S),T&&h(w,T),w}var g=n("buffer"),p=g.Buffer,v=n("util"),_=v.inspect,b=_&&_.custom||"inspect";function A(w,S,T){p.prototype.copy.call(w,S,T)}o.exports=function(){function w(){f(this,w),this.head=null,this.tail=null,this.length=0}return y(w,[{key:"push",value:function(T){var x={data:T,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(T){var x={data:T,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var T=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,T}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(T){if(this.length===0)return"";for(var x=this.head,M=""+x.data;x=x.next;)M+=T+x.data;return M}},{key:"concat",value:function(T){if(this.length===0)return p.alloc(0);for(var x=p.allocUnsafe(T>>>0),M=this.head,L=0;M;)A(M.data,x,L),L+=M.data.length,M=M.next;return x}},{key:"consume",value:function(T,x){var M;return T<this.head.data.length?(M=this.head.data.slice(0,T),this.head.data=this.head.data.slice(T)):T===this.head.data.length?M=this.shift():M=x?this._getString(T):this._getBuffer(T),M}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(T){var x=this.head,M=1,L=x.data;for(T-=L.length;x=x.next;){var O=x.data,re=T>O.length?O.length:T;if(re===O.length?L+=O:L+=O.slice(0,T),T-=re,T===0){re===O.length?(++M,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=O.slice(re));break}++M}return this.length-=M,L}},{key:"_getBuffer",value:function(T){var x=p.allocUnsafe(T),M=this.head,L=1;for(M.data.copy(x),T-=M.data.length;M=M.next;){var O=M.data,re=T>O.length?O.length:T;if(O.copy(x,x.length-T,0,re),T-=re,T===0){re===O.length?(++L,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=O.slice(re));break}++L}return this.length-=L,x}},{key:b,value:function(T,x){return _(this,c({},x,{depth:0,customInspect:!1}))}}]),w}()},{buffer:29,util:26}],41:[function(n,o,a){(function(u){(function(){function c(p,v){var _=this,b=this._readableState&&this._readableState.destroyed,A=this._writableState&&this._writableState.destroyed;return b||A?(v?v(p):p&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,u.nextTick(y,this,p)):u.nextTick(y,this,p)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(p||null,function(w){!v&&w?_._writableState?_._writableState.errorEmitted?u.nextTick(f,_):(_._writableState.errorEmitted=!0,u.nextTick(d,_,w)):u.nextTick(d,_,w):v?(u.nextTick(f,_),v(w)):u.nextTick(f,_)}),this)}function d(p,v){y(p,v),f(p)}function f(p){p._writableState&&!p._writableState.emitClose||p._readableState&&!p._readableState.emitClose||p.emit("close")}function h(){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 y(p,v){p.emit("error",v)}function g(p,v){var _=p._readableState,b=p._writableState;_&&_.autoDestroy||b&&b.autoDestroy?p.destroy(v):p.emit("error",v)}o.exports={destroy:c,undestroy:h,errorOrDestroy:g}}).call(this)}).call(this,n("_process"))},{_process:102}],42:[function(n,o,a){var u=n("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function c(y){var g=!1;return function(){if(!g){g=!0;for(var p=arguments.length,v=new Array(p),_=0;_<p;_++)v[_]=arguments[_];y.apply(this,v)}}}function d(){}function f(y){return y.setHeader&&typeof y.abort=="function"}function h(y,g,p){if(typeof g=="function")return h(y,null,g);g||(g={}),p=c(p||d);var v=g.readable||g.readable!==!1&&y.readable,_=g.writable||g.writable!==!1&&y.writable,b=function(){y.writable||w()},A=y._writableState&&y._writableState.finished,w=function(){_=!1,A=!0,v||p.call(y)},S=y._readableState&&y._readableState.endEmitted,T=function(){v=!1,S=!0,_||p.call(y)},x=function(re){p.call(y,re)},M=function(){var re;if(v&&!S)return(!y._readableState||!y._readableState.ended)&&(re=new u),p.call(y,re);if(_&&!A)return(!y._writableState||!y._writableState.ended)&&(re=new u),p.call(y,re)},L=function(){y.req.on("finish",w)};return f(y)?(y.on("complete",w),y.on("abort",M),y.req?L():y.on("request",L)):_&&!y._writableState&&(y.on("end",b),y.on("close",b)),y.on("end",T),y.on("finish",w),g.error!==!1&&y.on("error",x),y.on("close",M),function(){y.removeListener("complete",w),y.removeListener("abort",M),y.removeListener("request",L),y.req&&y.req.removeListener("finish",w),y.removeListener("end",b),y.removeListener("close",b),y.removeListener("finish",w),y.removeListener("end",T),y.removeListener("error",x),y.removeListener("close",M)}}o.exports=h},{"../../../errors":33}],43:[function(n,o,a){o.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],44:[function(n,o,a){var u;function c(w){var S=!1;return function(){S||(S=!0,w.apply(void 0,arguments))}}var d=n("../../../errors").codes,f=d.ERR_MISSING_ARGS,h=d.ERR_STREAM_DESTROYED;function y(w){if(w)throw w}function g(w){return w.setHeader&&typeof w.abort=="function"}function p(w,S,T,x){x=c(x);var M=!1;w.on("close",function(){M=!0}),u===void 0&&(u=n("./end-of-stream")),u(w,{readable:S,writable:T},function(O){if(O)return x(O);M=!0,x()});var L=!1;return function(O){if(!M&&!L){if(L=!0,g(w))return w.abort();if(typeof w.destroy=="function")return w.destroy();x(O||new h("pipe"))}}}function v(w){w()}function _(w,S){return w.pipe(S)}function b(w){return!w.length||typeof w[w.length-1]!="function"?y:w.pop()}function A(){for(var w=arguments.length,S=new Array(w),T=0;T<w;T++)S[T]=arguments[T];var x=b(S);if(Array.isArray(S[0])&&(S=S[0]),S.length<2)throw new f("streams");var M,L=S.map(function(O,re){var D=re<S.length-1,z=re>0;return p(O,D,z,function(V){M||(M=V),V&&L.forEach(v),!D&&(L.forEach(v),x(M))})});return S.reduce(_)}o.exports=A},{"../../../errors":33,"./end-of-stream":42}],45:[function(n,o,a){var u=n("../../../errors").codes.ERR_INVALID_OPT_VALUE;function c(f,h,y){return f.highWaterMark!=null?f.highWaterMark:h?f[y]:null}function d(f,h,y,g){var p=c(h,g,y);if(p!=null){if(!(isFinite(p)&&Math.floor(p)===p)||p<0){var v=g?y:"highWaterMark";throw new u(v,p)}return Math.floor(p)}return f.objectMode?16:16*1024}o.exports={getHighWaterMark:d}},{"../../../errors":33}],46:[function(n,o,a){o.exports=n("events").EventEmitter},{events:49}],47:[function(n,o,a){a=o.exports=n("./lib/_stream_readable.js"),a.Stream=a,a.Readable=a,a.Writable=n("./lib/_stream_writable.js"),a.Duplex=n("./lib/_stream_duplex.js"),a.Transform=n("./lib/_stream_transform.js"),a.PassThrough=n("./lib/_stream_passthrough.js"),a.finished=n("./lib/internal/streams/end-of-stream.js"),a.pipeline=n("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":34,"./lib/_stream_passthrough.js":35,"./lib/_stream_readable.js":36,"./lib/_stream_transform.js":37,"./lib/_stream_writable.js":38,"./lib/internal/streams/end-of-stream.js":42,"./lib/internal/streams/pipeline.js":44}],48:[function(n,o,a){(function(u){(function(){var c=n("once"),d=function(){},f=function(g){return g.setHeader&&typeof g.abort=="function"},h=function(g){return g.stdio&&Array.isArray(g.stdio)&&g.stdio.length===3},y=function(g,p,v){if(typeof p=="function")return y(g,null,p);p||(p={}),v=c(v||d);var _=g._writableState,b=g._readableState,A=p.readable||p.readable!==!1&&g.readable,w=p.writable||p.writable!==!1&&g.writable,S=!1,T=function(){g.writable||x()},x=function(){w=!1,A||v.call(g)},M=function(){A=!1,w||v.call(g)},L=function(V){v.call(g,V?new Error("exited with error code: "+V):null)},O=function(V){v.call(g,V)},re=function(){u.nextTick(D)},D=function(){if(!S){if(A&&!(b&&b.ended&&!b.destroyed))return v.call(g,new Error("premature close"));if(w&&!(_&&_.ended&&!_.destroyed))return v.call(g,new Error("premature close"))}},z=function(){g.req.on("finish",x)};return f(g)?(g.on("complete",x),g.on("abort",re),g.req?z():g.on("request",z)):w&&!_&&(g.on("end",T),g.on("close",T)),h(g)&&g.on("exit",L),g.on("end",M),g.on("finish",x),p.error!==!1&&g.on("error",O),g.on("close",re),function(){S=!0,g.removeListener("complete",x),g.removeListener("abort",re),g.removeListener("request",z),g.req&&g.req.removeListener("finish",x),g.removeListener("end",T),g.removeListener("close",T),g.removeListener("finish",x),g.removeListener("exit",L),g.removeListener("end",M),g.removeListener("error",O),g.removeListener("close",re)}};o.exports=y}).call(this)}).call(this,n("_process"))},{_process:102,once:100}],49:[function(n,o,a){var u=typeof Reflect=="object"?Reflect:null,c=u&&typeof u.apply=="function"?u.apply:function(z,V,j){return Function.prototype.apply.call(z,V,j)},d;u&&typeof u.ownKeys=="function"?d=u.ownKeys:Object.getOwnPropertySymbols?d=function(z){return Object.getOwnPropertyNames(z).concat(Object.getOwnPropertySymbols(z))}:d=function(z){return Object.getOwnPropertyNames(z)};function f(D){console&&console.warn&&console.warn(D)}var h=Number.isNaN||function(z){return z!==z};function y(){y.init.call(this)}o.exports=y,o.exports.once=L,y.EventEmitter=y,y.prototype._events=void 0,y.prototype._eventsCount=0,y.prototype._maxListeners=void 0;var g=10;function p(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(y,"defaultMaxListeners",{enumerable:!0,get:function(){return g},set:function(D){if(typeof D!="number"||D<0||h(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");g=D}}),y.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},y.prototype.setMaxListeners=function(z){if(typeof z!="number"||z<0||h(z))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+z+".");return this._maxListeners=z,this};function v(D){return D._maxListeners===void 0?y.defaultMaxListeners:D._maxListeners}y.prototype.getMaxListeners=function(){return v(this)},y.prototype.emit=function(z){for(var V=[],j=1;j<arguments.length;j++)V.push(arguments[j]);var F=z==="error",Ce=this._events;if(Ce!==void 0)F=F&&Ce.error===void 0;else if(!F)return!1;if(F){var le;if(V.length>0&&(le=V[0]),le instanceof Error)throw le;var pe=new Error("Unhandled error."+(le?" ("+le.message+")":""));throw pe.context=le,pe}var $e=Ce[z];if($e===void 0)return!1;if(typeof $e=="function")c($e,this,V);else for(var Fe=$e.length,Oe=T($e,Fe),j=0;j<Fe;++j)c(Oe[j],this,V);return!0};function _(D,z,V,j){var F,Ce,le;if(p(V),Ce=D._events,Ce===void 0?(Ce=D._events=Object.create(null),D._eventsCount=0):(Ce.newListener!==void 0&&(D.emit("newListener",z,V.listener?V.listener:V),Ce=D._events),le=Ce[z]),le===void 0)le=Ce[z]=V,++D._eventsCount;else if(typeof le=="function"?le=Ce[z]=j?[V,le]:[le,V]:j?le.unshift(V):le.push(V),F=v(D),F>0&&le.length>F&&!le.warned){le.warned=!0;var pe=new Error("Possible EventEmitter memory leak detected. "+le.length+" "+String(z)+" listeners added. Use emitter.setMaxListeners() to increase limit");pe.name="MaxListenersExceededWarning",pe.emitter=D,pe.type=z,pe.count=le.length,f(pe)}return D}y.prototype.addListener=function(z,V){return _(this,z,V,!1)},y.prototype.on=y.prototype.addListener,y.prototype.prependListener=function(z,V){return _(this,z,V,!0)};function b(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function A(D,z,V){var j={fired:!1,wrapFn:void 0,target:D,type:z,listener:V},F=b.bind(j);return F.listener=V,j.wrapFn=F,F}y.prototype.once=function(z,V){return p(V),this.on(z,A(this,z,V)),this},y.prototype.prependOnceListener=function(z,V){return p(V),this.prependListener(z,A(this,z,V)),this},y.prototype.removeListener=function(z,V){var j,F,Ce,le,pe;if(p(V),F=this._events,F===void 0)return this;if(j=F[z],j===void 0)return this;if(j===V||j.listener===V)--this._eventsCount===0?this._events=Object.create(null):(delete F[z],F.removeListener&&this.emit("removeListener",z,j.listener||V));else if(typeof j!="function"){for(Ce=-1,le=j.length-1;le>=0;le--)if(j[le]===V||j[le].listener===V){pe=j[le].listener,Ce=le;break}if(Ce<0)return this;Ce===0?j.shift():x(j,Ce),j.length===1&&(F[z]=j[0]),F.removeListener!==void 0&&this.emit("removeListener",z,pe||V)}return this},y.prototype.off=y.prototype.removeListener,y.prototype.removeAllListeners=function(z){var V,j,F;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[z]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[z]),this;if(arguments.length===0){var Ce=Object.keys(j),le;for(F=0;F<Ce.length;++F)le=Ce[F],le!=="removeListener"&&this.removeAllListeners(le);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(V=j[z],typeof V=="function")this.removeListener(z,V);else if(V!==void 0)for(F=V.length-1;F>=0;F--)this.removeListener(z,V[F]);return this};function w(D,z,V){var j=D._events;if(j===void 0)return[];var F=j[z];return F===void 0?[]:typeof F=="function"?V?[F.listener||F]:[F]:V?M(F):T(F,F.length)}y.prototype.listeners=function(z){return w(this,z,!0)},y.prototype.rawListeners=function(z){return w(this,z,!1)},y.listenerCount=function(D,z){return typeof D.listenerCount=="function"?D.listenerCount(z):S.call(D,z)},y.prototype.listenerCount=S;function S(D){var z=this._events;if(z!==void 0){var V=z[D];if(typeof V=="function")return 1;if(V!==void 0)return V.length}return 0}y.prototype.eventNames=function(){return this._eventsCount>0?d(this._events):[]};function T(D,z){for(var V=new Array(z),j=0;j<z;++j)V[j]=D[j];return V}function x(D,z){for(;z+1<D.length;z++)D[z]=D[z+1];D.pop()}function M(D){for(var z=new Array(D.length),V=0;V<z.length;++V)z[V]=D[V].listener||D[V];return z}function L(D,z){return new Promise(function(V,j){function F(le){D.removeListener(z,Ce),j(le)}function Ce(){typeof D.removeListener=="function"&&D.removeListener("error",F),V([].slice.call(arguments))}re(D,z,Ce,{once:!0}),z!=="error"&&O(D,F,{once:!0})})}function O(D,z,V){typeof D.on=="function"&&re(D,"error",z,V)}function re(D,z,V,j){if(typeof D.on=="function")j.once?D.once(z,V):D.on(z,V);else if(typeof D.addEventListener=="function")D.addEventListener(z,function F(Ce){j.once&&D.removeEventListener(z,F),V(Ce)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}},{}],50:[function(n,o,a){/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */a.read=function(u,c,d,f,h){var y,g,p=h*8-f-1,v=(1<<p)-1,_=v>>1,b=-7,A=d?h-1:0,w=d?-1:1,S=u[c+A];for(A+=w,y=S&(1<<-b)-1,S>>=-b,b+=p;b>0;y=y*256+u[c+A],A+=w,b-=8);for(g=y&(1<<-b)-1,y>>=-b,b+=f;b>0;g=g*256+u[c+A],A+=w,b-=8);if(y===0)y=1-_;else{if(y===v)return g?NaN:(S?-1:1)*(1/0);g=g+Math.pow(2,f),y=y-_}return(S?-1:1)*g*Math.pow(2,y-f)},a.write=function(u,c,d,f,h,y){var g,p,v,_=y*8-h-1,b=(1<<_)-1,A=b>>1,w=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=f?0:y-1,T=f?1:-1,x=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(p=isNaN(c)?1:0,g=b):(g=Math.floor(Math.log(c)/Math.LN2),c*(v=Math.pow(2,-g))<1&&(g--,v*=2),g+A>=1?c+=w/v:c+=w*Math.pow(2,1-A),c*v>=2&&(g++,v/=2),g+A>=b?(p=0,g=b):g+A>=1?(p=(c*v-1)*Math.pow(2,h),g=g+A):(p=c*Math.pow(2,A-1)*Math.pow(2,h),g=0));h>=8;u[d+S]=p&255,S+=T,p/=256,h-=8);for(g=g<<h|p,_+=h;_>0;u[d+S]=g&255,S+=T,g/=256,_-=8);u[d+S-T]|=x*128}},{}],51:[function(n,o,a){typeof Object.create=="function"?o.exports=function(c,d){d&&(c.super_=d,c.prototype=Object.create(d.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}))}:o.exports=function(c,d){if(d){c.super_=d;var f=function(){};f.prototype=d.prototype,c.prototype=new f,c.prototype.constructor=c}}},{}],52:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.ContainerIterator=a.Container=a.Base=void 0;class u{constructor(h=0){this.iteratorType=h}equals(h){return this.o===h.o}}a.ContainerIterator=u;class c{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}a.Base=c;class d extends c{}a.Container=d},{}],53:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.HashContainerIterator=a.HashContainer=void 0;var u=n("../../ContainerBase"),c=f(n("../../../utils/checkObject")),d=n("../../../utils/throwError");function f(g){return g&&g.t?g:{default:g}}class h extends u.ContainerIterator{constructor(p,v,_){super(_),this.o=p,this.h=v,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this})}}a.HashContainerIterator=h;class y extends u.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(p){const{L:v,B:_}=p;v.B=_,_.L=v,p===this.p&&(this.p=_),p===this._&&(this._=v),this.i-=1}M(p,v,_){_===void 0&&(_=(0,c.default)(p));let b;if(_){const A=p[this.HASH_TAG];if(A!==void 0)return this.H[A].l=v,this.i;Object.defineProperty(p,this.HASH_TAG,{value:this.H.length,configurable:!0}),b={u:p,l:v,L:this._,B:this.h},this.H.push(b)}else{const A=this.g[p];if(A)return A.l=v,this.i;b={u:p,l:v,L:this._,B:this.h},this.g[p]=b}return this.i===0?(this.p=b,this.h.B=b):this._.B=b,this._=b,this.h.L=b,++this.i}I(p,v){if(v===void 0&&(v=(0,c.default)(p)),v){const _=p[this.HASH_TAG];return _===void 0?this.h:this.H[_]}else return this.g[p]||this.h}clear(){const p=this.HASH_TAG;this.H.forEach(function(v){delete v.u[p]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(p,v){let _;if(v===void 0&&(v=(0,c.default)(p)),v){const b=p[this.HASH_TAG];if(b===void 0)return!1;delete p[this.HASH_TAG],_=this.H[b],delete this.H[b]}else{if(_=this.g[p],_===void 0)return!1;delete this.g[p]}return this.V(_),!0}eraseElementByIterator(p){const v=p.o;return v===this.h&&(0,d.throwIteratorAccessError)(),this.V(v),p.next()}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;let v=this.p;for(;p--;)v=v.B;return this.V(v),this.i}}a.HashContainer=y},{"../../../utils/checkObject":70,"../../../utils/throwError":71,"../../ContainerBase":52}],54:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./Base"),c=f(n("../../utils/checkObject")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends u.HashContainerIterator{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){this.o===this.h&&(0,d.throwIteratorAccessError)();const v=this;return new Proxy([],{get(_,b){if(b==="0")return v.o.u;if(b==="1")return v.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return v.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.HashContainer{constructor(v=[]){super();const _=this;v.forEach(function(b){_.setElement(b[0],b[1])})}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(v,_,b){return this.M(v,_,b)}getElementByKey(v,_){if(_===void 0&&(_=(0,c.default)(v)),_){const A=v[this.HASH_TAG];return A!==void 0?this.H[A].l:void 0}const b=this.g[v];return b?b.l:void 0}getElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return[_.u,_.l]}find(v,_){const b=this.I(v,_);return new h(b,this.h,this)}forEach(v){let _=0,b=this.p;for(;b!==this.h;)v([b.u,b.l],_++,this),b=b.B}[Symbol.iterator](){return(function*(){let v=this.p;for(;v!==this.h;)yield[v.u,v.l],v=v.B}).bind(this)()}}var g=y;a.default=g},{"../../utils/checkObject":70,"../../utils/throwError":71,"./Base":53}],55:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./Base"),c=n("../../utils/throwError");class d extends u.HashContainerIterator{constructor(g,p,v,_){super(g,p,_),this.container=v}get pointer(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o.u}copy(){return new d(this.o,this.h,this.container,this.iteratorType)}}class f extends u.HashContainer{constructor(g=[]){super();const p=this;g.forEach(function(v){p.insert(v)})}begin(){return new d(this.p,this.h,this)}end(){return new d(this.h,this.h,this)}rBegin(){return new d(this._,this.h,this,1)}rEnd(){return new d(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(g,p){return this.M(g,void 0,p)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=this.p;for(;g--;)p=p.B;return p.u}find(g,p){const v=this.I(g,p);return new d(v,this.h,this)}forEach(g){let p=0,v=this.p;for(;v!==this.h;)g(v.u,p++,this),v=v.B}[Symbol.iterator](){return(function*(){let g=this.p;for(;g!==this.h;)yield g.u,g=g.B}).bind(this)()}}var h=f;a.default=h},{"../../utils/throwError":71,"./Base":53}],56:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[],y=function(p,v){return p>v?-1:p<v?1:0},g=!0){if(super(),this.v=y,Array.isArray(h))this.C=g?[...h]:h;else{this.C=[];const v=this;h.forEach(function(_){v.C.push(_)})}this.i=this.C.length;const p=this.i>>1;for(let v=this.i-1>>1;v>=0;--v)this.k(v,p)}m(h){const y=this.C[h];for(;h>0;){const g=h-1>>1,p=this.C[g];if(this.v(p,y)<=0)break;this.C[h]=p,h=g}this.C[h]=y}k(h,y){const g=this.C[h];for(;h<y;){let p=h<<1|1;const v=p+1;let _=this.C[p];if(v<this.i&&this.v(_,this.C[v])>0&&(p=v,_=this.C[v]),this.v(_,g)>=0)break;this.C[h]=_,h=p}this.C[h]=g}clear(){this.i=0,this.C.length=0}push(h){this.C.push(h),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;const h=this.C[0],y=this.C.pop();return this.i-=1,this.i&&(this.C[0]=y,this.k(0,this.i>>1)),h}top(){return this.C[0]}find(h){return this.C.indexOf(h)>=0}remove(h){const y=this.C.indexOf(h);return y<0?!1:(y===0?this.pop():y===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(y,1,this.C.pop()),this.i-=1,this.m(y),this.k(y,this.i>>1)),!0)}updateItem(h){const y=this.C.indexOf(h);return y<0?!1:(this.m(y),this.k(y,this.i>>1),!0)}toArray(){return[...this.C]}}var d=c;a.default=d},{"../ContainerBase":52}],57:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.j=0,this.q=[];const y=this;h.forEach(function(g){y.push(g)})}clear(){this.q=[],this.i=this.j=0}push(h){const y=this.q.length;if(this.j/y>.5&&this.j+this.i>=y&&y>4096){const g=this.i;for(let p=0;p<g;++p)this.q[p]=this.q[this.j+p];this.j=0,this.q[this.i]=h}else this.q[this.j+this.i]=h;return++this.i}pop(){if(this.i===0)return;const h=this.q[this.j++];return this.i-=1,h}front(){if(this.i!==0)return this.q[this.j]}}var d=c;a.default=d},{"../ContainerBase":52}],58:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../ContainerBase");class c extends u.Base{constructor(h=[]){super(),this.S=[];const y=this;h.forEach(function(g){y.push(g)})}clear(){this.i=0,this.S=[]}push(h){return this.S.push(h),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}}var d=c;a.default=d},{"../ContainerBase":52}],59:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.RandomIterator=void 0;var u=n("../../ContainerBase"),c=n("../../../utils/throwError");class d extends u.ContainerIterator{constructor(h,y){super(y),this.o=h,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,c.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,c.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,c.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,c.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(h){this.container.setElementByPos(this.o,h)}}a.RandomIterator=d},{"../../../utils/throwError":71,"../../ContainerBase":52}],60:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../../ContainerBase");class c extends u.Container{}var d=c;a.default=d},{"../../ContainerBase":52}],61:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(n("./Base")),c=n("./Base/RandomIterator");function d(g){return g&&g.t?g:{default:g}}class f extends c.RandomIterator{constructor(p,v,_){super(p,_),this.container=v}copy(){return new f(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],v=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];const _=(()=>{if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size;if(typeof p.size=="function")return p.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=v,this.P=Math.max(Math.ceil(_/this.F),1);for(let w=0;w<this.P;++w)this.A.push(new Array(this.F));const b=Math.ceil(_/this.F);this.j=this.R=(this.P>>1)-(b>>1),this.D=this.N=this.F-_%this.F>>1;const A=this;p.forEach(function(w){A.pushBack(w)})}T(){const p=[],v=Math.max(this.P>>1,1);for(let _=0;_<v;++_)p[_]=new Array(this.F);for(let _=this.j;_<this.P;++_)p[p.length]=this.A[_];for(let _=0;_<this.R;++_)p[p.length]=this.A[_];p[p.length]=[...this.A[this.R]],this.j=v,this.R=p.length-1;for(let _=0;_<v;++_)p[p.length]=new Array(this.F);this.A=p,this.P=p.length}O(p){const v=this.D+p+1,_=v%this.F;let b=_-1,A=this.j+(v-_)/this.F;return _===0&&(A-=1),A%=this.P,b<0&&(b+=this.F),{curNodeBucketIndex:A,curNodePointerIndex:b}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new f(0,this)}end(){return new f(this.i,this)}rBegin(){return new f(this.i-1,this,1)}rEnd(){return new f(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(p){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=p,this.i}popBack(){if(this.i===0)return;const p=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,p}pushFront(p){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=p,this.i}popFront(){if(this.i===0)return;const p=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,p}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:v,curNodePointerIndex:_}=this.O(p);return this.A[v][_]}setElementByPos(p,v){if(p<0||p>this.i-1)throw new RangeError;const{curNodeBucketIndex:_,curNodePointerIndex:b}=this.O(p);this.A[_][b]=v}insert(p,v,_=1){if(p<0||p>this.i)throw new RangeError;if(p===0)for(;_--;)this.pushFront(v);else if(p===this.i)for(;_--;)this.pushBack(v);else{const b=[];for(let A=p;A<this.i;++A)b.push(this.getElementByPos(A));this.cut(p-1);for(let A=0;A<_;++A)this.pushBack(v);for(let A=0;A<b.length;++A)this.pushBack(b[A])}return this.i}cut(p){if(p<0)return this.clear(),0;const{curNodeBucketIndex:v,curNodePointerIndex:_}=this.O(p);return this.R=v,this.N=_,this.i=p+1,this.i}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;if(p===0)this.popFront();else if(p===this.i-1)this.popBack();else{const v=[];for(let b=p+1;b<this.i;++b)v.push(this.getElementByPos(b));this.cut(p),this.popBack();const _=this;v.forEach(function(b){_.pushBack(b)})}return this.i}eraseElementByValue(p){if(this.i===0)return 0;const v=[];for(let b=0;b<this.i;++b){const A=this.getElementByPos(b);A!==p&&v.push(A)}const _=v.length;for(let b=0;b<_;++b)this.setElementByPos(b,v[b]);return this.cut(_-1)}eraseElementByIterator(p){const v=p.o;return this.eraseElementByPos(v),p=p.next(),p}find(p){for(let v=0;v<this.i;++v)if(this.getElementByPos(v)===p)return new f(v,this);return this.end()}reverse(){let p=0,v=this.i-1;for(;p<v;){const _=this.getElementByPos(p);this.setElementByPos(p,this.getElementByPos(v)),this.setElementByPos(v,_),p+=1,v-=1}}unique(){if(this.i<=1)return this.i;let p=1,v=this.getElementByPos(0);for(let _=1;_<this.i;++_){const b=this.getElementByPos(_);b!==v&&(v=b,this.setElementByPos(p++,b))}for(;this.i>p;)this.popBack();return this.i}sort(p){const v=[];for(let _=0;_<this.i;++_)v.push(this.getElementByPos(_));v.sort(p);for(let _=0;_<this.i;++_)this.setElementByPos(_,v[_])}shrinkToFit(){if(this.i===0)return;const p=[];this.forEach(function(v){p.push(v)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let v=0;v<this.P;++v)this.A.push(new Array(this.F));for(let v=0;v<p.length;++v)this.pushBack(p[v])}forEach(p){for(let v=0;v<this.i;++v)p(this.getElementByPos(v),v,this)}[Symbol.iterator](){return(function*(){for(let p=0;p<this.i;++p)yield this.getElementByPos(p)}).bind(this)()}}var y=h;a.default=y},{"./Base":60,"./Base/RandomIterator":59}],62:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=n("../ContainerBase"),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.ContainerIterator{constructor(v,_,b,A){super(A),this.o=v,this.h=_,this.container=b,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.l}set pointer(v){this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.l=v}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;const _=this;v.forEach(function(b){_.pushBack(b)})}V(v){const{L:_,B:b}=v;_.B=b,b.L=_,v===this.p&&(this.p=b),v===this._&&(this._=_),this.i-=1}G(v,_){const b=_.B,A={l:v,L:_,B:b};_.B=A,b.L=A,_===this.h&&(this.p=A),b===this.h&&(this._=A),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new h(this.p,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this._,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return _.l}eraseElementByPos(v){if(v<0||v>this.i-1)throw new RangeError;let _=this.p;for(;v--;)_=_.B;return this.V(_),this.i}eraseElementByValue(v){let _=this.p;for(;_!==this.h;)_.l===v&&this.V(_),_=_.B;return this.i}eraseElementByIterator(v){const _=v.o;return _===this.h&&(0,d.throwIteratorAccessError)(),v=v.next(),this.V(_),v}pushBack(v){return this.G(v,this._),this.i}popBack(){if(this.i===0)return;const v=this._.l;return this.V(this._),v}pushFront(v){return this.G(v,this.h),this.i}popFront(){if(this.i===0)return;const v=this.p.l;return this.V(this.p),v}setElementByPos(v,_){if(v<0||v>this.i-1)throw new RangeError;let b=this.p;for(;v--;)b=b.B;b.l=_}insert(v,_,b=1){if(v<0||v>this.i)throw new RangeError;if(b<=0)return this.i;if(v===0)for(;b--;)this.pushFront(_);else if(v===this.i)for(;b--;)this.pushBack(_);else{let A=this.p;for(let S=1;S<v;++S)A=A.B;const w=A.B;for(this.i+=b;b--;)A.B={l:_,L:A},A.B.L=A,A=A.B;A.B=w,w.L=A}return this.i}find(v){let _=this.p;for(;_!==this.h;){if(_.l===v)return new h(_,this.h,this);_=_.B}return this.end()}reverse(){if(this.i<=1)return;let v=this.p,_=this._,b=0;for(;b<<1<this.i;){const A=v.l;v.l=_.l,_.l=A,v=v.B,_=_.L,b+=1}}unique(){if(this.i<=1)return this.i;let v=this.p;for(;v!==this.h;){let _=v;for(;_.B!==this.h&&_.l===_.B.l;)_=_.B,this.i-=1;v.B=_.B,v.B.L=v,v=v.B}return this.i}sort(v){if(this.i<=1)return;const _=[];this.forEach(function(A){_.push(A)}),_.sort(v);let b=this.p;_.forEach(function(A){b.l=A,b=b.B})}merge(v){const _=this;if(this.i===0)v.forEach(function(b){_.pushBack(b)});else{let b=this.p;v.forEach(function(A){for(;b!==_.h&&b.l<=A;)b=b.B;_.G(A,b.L)})}return this.i}forEach(v){let _=this.p,b=0;for(;_!==this.h;)v(_.l,b++,this),_=_.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let v=this.p;for(;v!==this.h;)yield v.l,v=v.B}).bind(this)()}}var g=y;a.default=g},{"../../utils/throwError":71,"../ContainerBase":52,"./Base":60}],63:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=d(n("./Base")),c=n("./Base/RandomIterator");function d(g){return g&&g.t?g:{default:g}}class f extends c.RandomIterator{constructor(p,v,_){super(p,_),this.container=v}copy(){return new f(this.o,this.container,this.iteratorType)}}class h extends u.default{constructor(p=[],v=!0){if(super(),Array.isArray(p))this.J=v?[...p]:p,this.i=p.length;else{this.J=[];const _=this;p.forEach(function(b){_.pushBack(b)})}}clear(){this.i=0,this.J.length=0}begin(){return new f(0,this)}end(){return new f(this.i,this)}rBegin(){return new f(this.i-1,this,1)}rEnd(){return new f(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J[p]}eraseElementByPos(p){if(p<0||p>this.i-1)throw new RangeError;return this.J.splice(p,1),this.i-=1,this.i}eraseElementByValue(p){let v=0;for(let _=0;_<this.i;++_)this.J[_]!==p&&(this.J[v++]=this.J[_]);return this.i=this.J.length=v,this.i}eraseElementByIterator(p){const v=p.o;return p=p.next(),this.eraseElementByPos(v),p}pushBack(p){return this.J.push(p),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(p,v){if(p<0||p>this.i-1)throw new RangeError;this.J[p]=v}insert(p,v,_=1){if(p<0||p>this.i)throw new RangeError;return this.J.splice(p,0,...new Array(_).fill(v)),this.i+=_,this.i}find(p){for(let v=0;v<this.i;++v)if(this.J[v]===p)return new f(v,this);return this.end()}reverse(){this.J.reverse()}unique(){let p=1;for(let v=1;v<this.i;++v)this.J[v]!==this.J[v-1]&&(this.J[p++]=this.J[v]);return this.i=this.J.length=p,this.i}sort(p){this.J.sort(p)}forEach(p){for(let v=0;v<this.i;++v)p(this.J[v],v,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}}var y=h;a.default=y},{"./Base":60,"./Base/RandomIterator":59}],64:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("../../ContainerBase"),c=n("../../../utils/throwError");class d extends u.ContainerIterator{constructor(y,g,p){super(p),this.o=y,this.h=g,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,c.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,c.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let y=this.o;const g=this.h.tt;if(y===this.h)return g?g.rt-1:0;let p=0;for(y.U&&(p+=y.U.rt);y!==g;){const v=y.tt;y===v.W&&(p+=1,v.U&&(p+=v.U.rt)),y=v}return p}}var f=d;a.default=f},{"../../../utils/throwError":71,"../../ContainerBase":52}],65:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.TreeNodeEnableIndex=a.TreeNode=void 0;class u{constructor(f,h){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=f,this.l=h}L(){let f=this;if(f.ee===1&&f.tt.tt===f)f=f.W;else if(f.U)for(f=f.U;f.W;)f=f.W;else{let h=f.tt;for(;h.U===f;)f=h,h=f.tt;f=h}return f}B(){let f=this;if(f.W){for(f=f.W;f.U;)f=f.U;return f}else{let h=f.tt;for(;h.W===f;)f=h,h=f.tt;return f.W!==h?h:f}}te(){const f=this.tt,h=this.W,y=h.U;return f.tt===this?f.tt=h:f.U===this?f.U=h:f.W=h,h.tt=f,h.U=this,this.tt=h,this.W=y,y&&(y.tt=this),h}se(){const f=this.tt,h=this.U,y=h.W;return f.tt===this?f.tt=h:f.U===this?f.U=h:f.W=h,h.tt=f,h.W=this,this.tt=h,this.U=y,y&&(y.tt=this),h}}a.TreeNode=u;class c extends u{constructor(){super(...arguments),this.rt=1}te(){const f=super.te();return this.ie(),f.ie(),f}se(){const f=super.se();return this.ie(),f.ie(),f}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}a.TreeNodeEnableIndex=c},{}],66:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=n("./TreeNode"),c=n("../../ContainerBase"),d=n("../../../utils/throwError");class f extends c.Container{constructor(g=function(v,_){return v<_?-1:v>_?1:0},p=!1){super(),this.Y=void 0,this.v=g,p?(this.re=u.TreeNodeEnableIndex,this.M=function(v,_,b){const A=this.ne(v,_,b);if(A){let w=A.tt;for(;w!==this.h;)w.rt+=1,w=w.tt;const S=this.he(A);if(S){const{parentNode:T,grandParent:x,curNode:M}=S;T.ie(),x.ie(),M.ie()}}return this.i},this.V=function(v){let _=this.fe(v);for(;_!==this.h;)_.rt-=1,_=_.tt}):(this.re=u.TreeNode,this.M=function(v,_,b){const A=this.ne(v,_,b);return A&&this.he(A),this.i},this.V=this.fe),this.h=new this.re}X(g,p){let v=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)g=g.W;else if(_>0)v=g,g=g.U;else return g}return v}Z(g,p){let v=this.h;for(;g;)this.v(g.u,p)<=0?g=g.W:(v=g,g=g.U);return v}$(g,p){let v=this.h;for(;g;){const _=this.v(g.u,p);if(_<0)v=g,g=g.W;else if(_>0)g=g.U;else return g}return v}rr(g,p){let v=this.h;for(;g;)this.v(g.u,p)<0?(v=g,g=g.W):g=g.U;return v}ue(g){for(;;){const p=g.tt;if(p===this.h)return;if(g.ee===1){g.ee=0;return}if(g===p.U){const v=p.W;if(v.ee===1)v.ee=0,p.ee=1,p===this.Y?this.Y=p.te():p.te();else if(v.W&&v.W.ee===1){v.ee=p.ee,p.ee=0,v.W.ee=0,p===this.Y?this.Y=p.te():p.te();return}else v.U&&v.U.ee===1?(v.ee=1,v.U.ee=0,v.se()):(v.ee=1,g=p)}else{const v=p.U;if(v.ee===1)v.ee=0,p.ee=1,p===this.Y?this.Y=p.se():p.se();else if(v.U&&v.U.ee===1){v.ee=p.ee,p.ee=0,v.U.ee=0,p===this.Y?this.Y=p.se():p.se();return}else v.W&&v.W.ee===1?(v.ee=1,v.W.ee=0,v.te()):(v.ee=1,g=p)}}}fe(g){if(this.i===1)return this.clear(),this.h;let p=g;for(;p.U||p.W;){if(p.W)for(p=p.W;p.U;)p=p.U;else p=p.U;[g.u,p.u]=[p.u,g.u],[g.l,p.l]=[p.l,g.l],g=p}this.h.U===p?this.h.U=p.tt:this.h.W===p&&(this.h.W=p.tt),this.ue(p);const v=p.tt;return p===v.U?v.U=void 0:v.W=void 0,this.i-=1,this.Y.ee=0,v}oe(g,p){return g===void 0?!1:this.oe(g.U,p)||p(g)?!0:this.oe(g.W,p)}he(g){for(;;){const p=g.tt;if(p.ee===0)return;const v=p.tt;if(p===v.U){const _=v.W;if(_&&_.ee===1){if(_.ee=p.ee=0,v===this.Y)return;v.ee=1,g=v;continue}else if(g===p.W){if(g.ee=0,g.U&&(g.U.tt=p),g.W&&(g.W.tt=v),p.W=g.U,v.U=g.W,g.U=p,g.W=v,v===this.Y)this.Y=g,this.h.tt=g;else{const b=v.tt;b.U===v?b.U=g:b.W=g}return g.tt=v.tt,p.tt=g,v.tt=g,v.ee=1,{parentNode:p,grandParent:v,curNode:g}}else p.ee=0,v===this.Y?this.Y=v.se():v.se(),v.ee=1}else{const _=v.U;if(_&&_.ee===1){if(_.ee=p.ee=0,v===this.Y)return;v.ee=1,g=v;continue}else if(g===p.U){if(g.ee=0,g.U&&(g.U.tt=v),g.W&&(g.W.tt=p),v.W=g.U,p.U=g.W,g.U=v,g.W=p,v===this.Y)this.Y=g,this.h.tt=g;else{const b=v.tt;b.U===v?b.U=g:b.W=g}return g.tt=v.tt,p.tt=g,v.tt=g,v.ee=1,{parentNode:p,grandParent:v,curNode:g}}else p.ee=0,v===this.Y?this.Y=v.te():v.te(),v.ee=1}return}}ne(g,p,v){if(this.Y===void 0){this.i+=1,this.Y=new this.re(g,p),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let _;const b=this.h.U,A=this.v(b.u,g);if(A===0){b.l=p;return}else if(A>0)b.U=new this.re(g,p),b.U.tt=b,_=b.U,this.h.U=_;else{const w=this.h.W,S=this.v(w.u,g);if(S===0){w.l=p;return}else if(S<0)w.W=new this.re(g,p),w.W.tt=w,_=w.W,this.h.W=_;else{if(v!==void 0){const T=v.o;if(T!==this.h){const x=this.v(T.u,g);if(x===0){T.l=p;return}else if(x>0){const M=T.L(),L=this.v(M.u,g);if(L===0){M.l=p;return}else L<0&&(_=new this.re(g,p),M.W===void 0?(M.W=_,_.tt=M):(T.U=_,_.tt=T))}}}if(_===void 0)for(_=this.Y;;){const T=this.v(_.u,g);if(T>0){if(_.U===void 0){_.U=new this.re(g,p),_.U.tt=_,_=_.U;break}_=_.U}else if(T<0){if(_.W===void 0){_.W=new this.re(g,p),_.W.tt=_,_=_.W;break}_=_.W}else{_.l=p;return}}}}return this.i+=1,_}I(g,p){for(;g;){const v=this.v(g.u,p);if(v<0)g=g.W;else if(v>0)g=g.U;else return g}return g||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(g,p){const v=g.o;if(v===this.h&&(0,d.throwIteratorAccessError)(),this.i===1)return v.u=p,!0;if(v===this.h.U)return this.v(v.B().u,p)>0?(v.u=p,!0):!1;if(v===this.h.W)return this.v(v.L().u,p)<0?(v.u=p,!0):!1;const _=v.L().u;if(this.v(_,p)>=0)return!1;const b=v.B().u;return this.v(b,p)<=0?!1:(v.u=p,!0)}eraseElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p=0;const v=this;return this.oe(this.Y,function(_){return g===p?(v.V(_),!0):(p+=1,!1)}),this.i}eraseElementByKey(g){if(this.i===0)return!1;const p=this.I(this.Y,g);return p===this.h?!1:(this.V(p),!0)}eraseElementByIterator(g){const p=g.o;p===this.h&&(0,d.throwIteratorAccessError)();const v=p.W===void 0;return g.iteratorType===0?v&&g.next():(!v||p.U===void 0)&&g.next(),this.V(p),g}forEach(g){let p=0;for(const v of this)g(v,p++,this)}getElementByPos(g){if(g<0||g>this.i-1)throw new RangeError;let p,v=0;for(const _ of this){if(v===g){p=_;break}v+=1}return p}getHeight(){if(this.i===0)return 0;const g=function(p){return p?Math.max(g(p.U),g(p.W))+1:0};return g(this.Y)}}var h=f;a.default=h},{"../../../utils/throwError":71,"../../ContainerBase":52,"./TreeNode":65}],67:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=f(n("./Base/TreeIterator")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){this.o===this.h&&(0,d.throwIteratorAccessError)();const v=this;return new Proxy([],{get(_,b){if(b==="0")return v.o.u;if(b==="1")return v.o.l},set(_,b,A){if(b!=="1")throw new TypeError("props must be 1");return v.o.l=A,!0}})}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[],_,b){super(_,b);const A=this;v.forEach(function(w){A.setElement(w[0],w[1])})}*K(v){v!==void 0&&(yield*this.K(v.U),yield[v.u,v.l],yield*this.K(v.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){if(this.i===0)return;const v=this.h.U;return[v.u,v.l]}back(){if(this.i===0)return;const v=this.h.W;return[v.u,v.l]}lowerBound(v){const _=this.X(this.Y,v);return new h(_,this.h,this)}upperBound(v){const _=this.Z(this.Y,v);return new h(_,this.h,this)}reverseLowerBound(v){const _=this.$(this.Y,v);return new h(_,this.h,this)}reverseUpperBound(v){const _=this.rr(this.Y,v);return new h(_,this.h,this)}setElement(v,_,b){return this.M(v,_,b)}find(v){const _=this.I(this.Y,v);return new h(_,this.h,this)}getElementByKey(v){return this.I(this.Y,v).l}union(v){const _=this;return v.forEach(function(b){_.setElement(b[0],b[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=y;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],68:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=void 0;var u=f(n("./Base")),c=f(n("./Base/TreeIterator")),d=n("../../utils/throwError");function f(p){return p&&p.t?p:{default:p}}class h extends c.default{constructor(v,_,b,A){super(v,_,A),this.container=b}get pointer(){return this.o===this.h&&(0,d.throwIteratorAccessError)(),this.o.u}copy(){return new h(this.o,this.h,this.container,this.iteratorType)}}class y extends u.default{constructor(v=[],_,b){super(_,b);const A=this;v.forEach(function(w){A.insert(w)})}*K(v){v!==void 0&&(yield*this.K(v.U),yield v.u,yield*this.K(v.W))}begin(){return new h(this.h.U||this.h,this.h,this)}end(){return new h(this.h,this.h,this)}rBegin(){return new h(this.h.W||this.h,this.h,this,1)}rEnd(){return new h(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(v,_){return this.M(v,void 0,_)}find(v){const _=this.I(this.Y,v);return new h(_,this.h,this)}lowerBound(v){const _=this.X(this.Y,v);return new h(_,this.h,this)}upperBound(v){const _=this.Z(this.Y,v);return new h(_,this.h,this)}reverseLowerBound(v){const _=this.$(this.Y,v);return new h(_,this.h,this)}reverseUpperBound(v){const _=this.rr(this.Y,v);return new h(_,this.h,this)}union(v){const _=this;return v.forEach(function(b){_.insert(b)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var g=y;a.default=g},{"../../utils/throwError":71,"./Base":66,"./Base/TreeIterator":64}],69:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),Object.defineProperty(a,"Deque",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(a,"HashMap",{enumerable:!0,get:function(){return _.default}}),Object.defineProperty(a,"HashSet",{enumerable:!0,get:function(){return v.default}}),Object.defineProperty(a,"LinkList",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(a,"OrderedMap",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(a,"OrderedSet",{enumerable:!0,get:function(){return g.default}}),Object.defineProperty(a,"PriorityQueue",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(a,"Queue",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(a,"Stack",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(a,"Vector",{enumerable:!0,get:function(){return f.default}});var u=b(n("./container/OtherContainer/Stack")),c=b(n("./container/OtherContainer/Queue")),d=b(n("./container/OtherContainer/PriorityQueue")),f=b(n("./container/SequentialContainer/Vector")),h=b(n("./container/SequentialContainer/LinkList")),y=b(n("./container/SequentialContainer/Deque")),g=b(n("./container/TreeContainer/OrderedSet")),p=b(n("./container/TreeContainer/OrderedMap")),v=b(n("./container/HashContainer/HashSet")),_=b(n("./container/HashContainer/HashMap"));function b(A){return A&&A.t?A:{default:A}}},{"./container/HashContainer/HashMap":54,"./container/HashContainer/HashSet":55,"./container/OtherContainer/PriorityQueue":56,"./container/OtherContainer/Queue":57,"./container/OtherContainer/Stack":58,"./container/SequentialContainer/Deque":61,"./container/SequentialContainer/LinkList":62,"./container/SequentialContainer/Vector":63,"./container/TreeContainer/OrderedMap":67,"./container/TreeContainer/OrderedSet":68}],70:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.default=u;function u(c){const d=typeof c;return d==="object"&&c!==null||d==="function"}},{}],71:[function(n,o,a){Object.defineProperty(a,"t",{value:!0}),a.throwIteratorAccessError=u;function u(){throw new RangeError("Iterator access denied!")}},{}],72:[function(n,o,a){(function(u){(function(){const c=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,f=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new g}abort(D=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||D,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},h=typeof AbortSignal=="function",y=typeof f.AbortSignal=="function",g=h?AbortSignal:y?f.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(D){D.type==="abort"&&(this.aborted=!0,this.onabort(D),this._listeners.forEach(z=>z(D),this))}onabort(){}addEventListener(D,z){D==="abort"&&this._listeners.push(z)}removeEventListener(D,z){D==="abort"&&(this._listeners=this._listeners.filter(V=>V!==z))}},p=new Set,v=(re,D)=>{const z=`LRU_CACHE_OPTION_${re}`;w(z)&&S(z,`${re} option`,`options.${D}`,O)},_=(re,D)=>{const z=`LRU_CACHE_METHOD_${re}`;if(w(z)){const{prototype:V}=O,{get:j}=Object.getOwnPropertyDescriptor(V,re);S(z,`${re} method`,`cache.${D}()`,j)}},b=(re,D)=>{const z=`LRU_CACHE_PROPERTY_${re}`;if(w(z)){const{prototype:V}=O,{get:j}=Object.getOwnPropertyDescriptor(V,re);S(z,`${re} property`,`cache.${D}`,j)}},A=(...re)=>{typeof u=="object"&&u&&typeof u.emitWarning=="function"?u.emitWarning(...re):console.error(...re)},w=re=>!p.has(re),S=(re,D,z,V)=>{p.add(re);const j=`The ${D} is deprecated. Please use ${z} instead.`;A(j,"DeprecationWarning",re,V)},T=re=>re&&re===Math.floor(re)&&re>0&&isFinite(re),x=re=>T(re)?re<=Math.pow(2,8)?Uint8Array:re<=Math.pow(2,16)?Uint16Array:re<=Math.pow(2,32)?Uint32Array:re<=Number.MAX_SAFE_INTEGER?M:null:null;class M extends Array{constructor(D){super(D),this.fill(0)}}class L{constructor(D){if(D===0)return[];const z=x(D);this.heap=new z(D),this.length=0}push(D){this.heap[this.length++]=D}pop(){return this.heap[--this.length]}}class O{constructor(D={}){const{max:z=0,ttl:V,ttlResolution:j=1,ttlAutopurge:F,updateAgeOnGet:Ce,updateAgeOnHas:le,allowStale:pe,dispose:$e,disposeAfter:Fe,noDisposeOnSet:Oe,noUpdateTTL:Et,maxSize:he=0,maxEntrySize:In=0,sizeCalculation:vn,fetchMethod:kt,fetchContext:ue,noDeleteOnFetchRejection:At,noDeleteOnStaleGet:jt,allowStaleOnFetchRejection:hn,allowStaleOnFetchAbort:Pt,ignoreFetchAbort:Ie}=D,{length:de,maxAge:ze,stale:xe}=D instanceof O?{}:D;if(z!==0&&!T(z))throw new TypeError("max option must be a nonnegative integer");const Ne=z?x(z):Array;if(!Ne)throw new Error("invalid max value: "+z);if(this.max=z,this.maxSize=he,this.maxEntrySize=In||this.maxSize,this.sizeCalculation=vn||de,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=kt||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=ue,!this.fetchMethod&&ue!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(z).fill(null),this.valList=new Array(z).fill(null),this.next=new Ne(z),this.prev=new Ne(z),this.head=0,this.tail=0,this.free=new L(z),this.initialFill=1,this.size=0,typeof $e=="function"&&(this.dispose=$e),typeof Fe=="function"?(this.disposeAfter=Fe,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!Oe,this.noUpdateTTL=!!Et,this.noDeleteOnFetchRejection=!!At,this.allowStaleOnFetchRejection=!!hn,this.allowStaleOnFetchAbort=!!Pt,this.ignoreFetchAbort=!!Ie,this.maxEntrySize!==0){if(this.maxSize!==0&&!T(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!pe||!!xe,this.noDeleteOnStaleGet=!!jt,this.updateAgeOnGet=!!Ce,this.updateAgeOnHas=!!le,this.ttlResolution=T(j)||j===0?j:1,this.ttlAutopurge=!!F,this.ttl=V||ze||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const Lt="LRU_CACHE_UNBOUNDED";w(Lt)&&(p.add(Lt),A("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",Lt,O))}xe&&v("stale","allowStale"),ze&&v("maxAge","ttl"),de&&v("length","sizeCalculation")}getRemainingTTL(D){return this.has(D,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new M(this.max),this.starts=new M(this.max),this.setItemTTL=(V,j,F=c.now())=>{if(this.starts[V]=j!==0?F:0,this.ttls[V]=j,j!==0&&this.ttlAutopurge){const Ce=setTimeout(()=>{this.isStale(V)&&this.delete(this.keyList[V])},j+1);Ce.unref&&Ce.unref()}},this.updateItemAge=V=>{this.starts[V]=this.ttls[V]!==0?c.now():0},this.statusTTL=(V,j)=>{V&&(V.ttl=this.ttls[j],V.start=this.starts[j],V.now=D||z(),V.remainingTTL=V.now+V.ttl-V.start)};let D=0;const z=()=>{const V=c.now();if(this.ttlResolution>0){D=V;const j=setTimeout(()=>D=0,this.ttlResolution);j.unref&&j.unref()}return V};this.getRemainingTTL=V=>{const j=this.keyMap.get(V);return j===void 0?0:this.ttls[j]===0||this.starts[j]===0?1/0:this.starts[j]+this.ttls[j]-(D||z())},this.isStale=V=>this.ttls[V]!==0&&this.starts[V]!==0&&(D||z())-this.starts[V]>this.ttls[V]}updateItemAge(D){}statusTTL(D,z){}setItemTTL(D,z,V){}isStale(D){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new M(this.max),this.removeItemSize=D=>{this.calculatedSize-=this.sizes[D],this.sizes[D]=0},this.requireSize=(D,z,V,j)=>{if(this.isBackgroundFetch(z))return 0;if(!T(V))if(j){if(typeof j!="function")throw new TypeError("sizeCalculation must be a function");if(V=j(z,D),!T(V))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return V},this.addItemSize=(D,z,V)=>{if(this.sizes[D]=z,this.maxSize){const j=this.maxSize-this.sizes[D];for(;this.calculatedSize>j;)this.evict(!0)}this.calculatedSize+=this.sizes[D],V&&(V.entrySize=z,V.totalCalculatedSize=this.calculatedSize)}}removeItemSize(D){}addItemSize(D,z){}requireSize(D,z,V,j){if(V||j)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:D=this.allowStale}={}){if(this.size)for(let z=this.tail;!(!this.isValidIndex(z)||((D||!this.isStale(z))&&(yield z),z===this.head));)z=this.prev[z]}*rindexes({allowStale:D=this.allowStale}={}){if(this.size)for(let z=this.head;!(!this.isValidIndex(z)||((D||!this.isStale(z))&&(yield z),z===this.tail));)z=this.next[z]}isValidIndex(D){return D!==void 0&&this.keyMap.get(this.keyList[D])===D}*entries(){for(const D of this.indexes())this.valList[D]!==void 0&&this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield[this.keyList[D],this.valList[D]])}*rentries(){for(const D of this.rindexes())this.valList[D]!==void 0&&this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield[this.keyList[D],this.valList[D]])}*keys(){for(const D of this.indexes())this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.keyList[D])}*rkeys(){for(const D of this.rindexes())this.keyList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.keyList[D])}*values(){for(const D of this.indexes())this.valList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.valList[D])}*rvalues(){for(const D of this.rindexes())this.valList[D]!==void 0&&!this.isBackgroundFetch(this.valList[D])&&(yield this.valList[D])}[Symbol.iterator](){return this.entries()}find(D,z){for(const V of this.indexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;if(F!==void 0&&D(F,this.keyList[V],this))return this.get(this.keyList[V],z)}}forEach(D,z=this){for(const V of this.indexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;F!==void 0&&D.call(z,F,this.keyList[V],this)}}rforEach(D,z=this){for(const V of this.rindexes()){const j=this.valList[V],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;F!==void 0&&D.call(z,F,this.keyList[V],this)}}get prune(){return _("prune","purgeStale"),this.purgeStale}purgeStale(){let D=!1;for(const z of this.rindexes({allowStale:!0}))this.isStale(z)&&(this.delete(this.keyList[z]),D=!0);return D}dump(){const D=[];for(const z of this.indexes({allowStale:!0})){const V=this.keyList[z],j=this.valList[z],F=this.isBackgroundFetch(j)?j.__staleWhileFetching:j;if(F===void 0)continue;const Ce={value:F};if(this.ttls){Ce.ttl=this.ttls[z];const le=c.now()-this.starts[z];Ce.start=Math.floor(Date.now()-le)}this.sizes&&(Ce.size=this.sizes[z]),D.unshift([V,Ce])}return D}load(D){this.clear();for(const[z,V]of D){if(V.start){const j=Date.now()-V.start;V.start=c.now()-j}this.set(z,V.value,V)}}dispose(D,z,V){}set(D,z,{ttl:V=this.ttl,start:j,noDisposeOnSet:F=this.noDisposeOnSet,size:Ce=0,sizeCalculation:le=this.sizeCalculation,noUpdateTTL:pe=this.noUpdateTTL,status:$e}={}){if(Ce=this.requireSize(D,z,Ce,le),this.maxEntrySize&&Ce>this.maxEntrySize)return $e&&($e.set="miss",$e.maxEntrySizeExceeded=!0),this.delete(D),this;let Fe=this.size===0?void 0:this.keyMap.get(D);if(Fe===void 0)Fe=this.newIndex(),this.keyList[Fe]=D,this.valList[Fe]=z,this.keyMap.set(D,Fe),this.next[this.tail]=Fe,this.prev[Fe]=this.tail,this.tail=Fe,this.size++,this.addItemSize(Fe,Ce,$e),$e&&($e.set="add"),pe=!1;else{this.moveToTail(Fe);const Oe=this.valList[Fe];if(z!==Oe){if(this.isBackgroundFetch(Oe)?Oe.__abortController.abort(new Error("replaced")):F||(this.dispose(Oe,D,"set"),this.disposeAfter&&this.disposed.push([Oe,D,"set"])),this.removeItemSize(Fe),this.valList[Fe]=z,this.addItemSize(Fe,Ce,$e),$e){$e.set="replace";const Et=Oe&&this.isBackgroundFetch(Oe)?Oe.__staleWhileFetching:Oe;Et!==void 0&&($e.oldValue=Et)}}else $e&&($e.set="update")}if(V!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),pe||this.setItemTTL(Fe,V,j),this.statusTTL($e,Fe),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const D=this.valList[this.head];return this.evict(!0),D}}evict(D){const z=this.head,V=this.keyList[z],j=this.valList[z];return this.isBackgroundFetch(j)?j.__abortController.abort(new Error("evicted")):(this.dispose(j,V,"evict"),this.disposeAfter&&this.disposed.push([j,V,"evict"])),this.removeItemSize(z),D&&(this.keyList[z]=null,this.valList[z]=null,this.free.push(z)),this.head=this.next[z],this.keyMap.delete(V),this.size--,z}has(D,{updateAgeOnHas:z=this.updateAgeOnHas,status:V}={}){const j=this.keyMap.get(D);if(j!==void 0)if(this.isStale(j))V&&(V.has="stale",this.statusTTL(V,j));else return z&&this.updateItemAge(j),V&&(V.has="hit"),this.statusTTL(V,j),!0;else V&&(V.has="miss");return!1}peek(D,{allowStale:z=this.allowStale}={}){const V=this.keyMap.get(D);if(V!==void 0&&(z||!this.isStale(V))){const j=this.valList[V];return this.isBackgroundFetch(j)?j.__staleWhileFetching:j}}backgroundFetch(D,z,V,j){const F=z===void 0?void 0:this.valList[z];if(this.isBackgroundFetch(F))return F;const Ce=new f;V.signal&&V.signal.addEventListener("abort",()=>Ce.abort(V.signal.reason));const le={signal:Ce.signal,options:V,context:j},pe=(he,In=!1)=>{const{aborted:vn}=Ce.signal,kt=V.ignoreFetchAbort&&he!==void 0;return V.status&&(vn&&!In?(V.status.fetchAborted=!0,V.status.fetchError=Ce.signal.reason,kt&&(V.status.fetchAbortIgnored=!0)):V.status.fetchResolved=!0),vn&&!kt&&!In?Fe(Ce.signal.reason):(this.valList[z]===Et&&(he===void 0?Et.__staleWhileFetching?this.valList[z]=Et.__staleWhileFetching:this.delete(D):(V.status&&(V.status.fetchUpdated=!0),this.set(D,he,le.options))),he)},$e=he=>(V.status&&(V.status.fetchRejected=!0,V.status.fetchError=he),Fe(he)),Fe=he=>{const{aborted:In}=Ce.signal,vn=In&&V.allowStaleOnFetchAbort,kt=vn||V.allowStaleOnFetchRejection,ue=kt||V.noDeleteOnFetchRejection;if(this.valList[z]===Et&&(!ue||Et.__staleWhileFetching===void 0?this.delete(D):vn||(this.valList[z]=Et.__staleWhileFetching)),kt)return V.status&&Et.__staleWhileFetching!==void 0&&(V.status.returnedStale=!0),Et.__staleWhileFetching;if(Et.__returned===Et)throw he},Oe=(he,In)=>{this.fetchMethod(D,F,le).then(vn=>he(vn),In),Ce.signal.addEventListener("abort",()=>{(!V.ignoreFetchAbort||V.allowStaleOnFetchAbort)&&(he(),V.allowStaleOnFetchAbort&&(he=vn=>pe(vn,!0)))})};V.status&&(V.status.fetchDispatched=!0);const Et=new Promise(Oe).then(pe,$e);return Et.__abortController=Ce,Et.__staleWhileFetching=F,Et.__returned=null,z===void 0?(this.set(D,Et,{...le.options,status:void 0}),z=this.keyMap.get(D)):this.valList[z]=Et,Et}isBackgroundFetch(D){return D&&typeof D=="object"&&typeof D.then=="function"&&Object.prototype.hasOwnProperty.call(D,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(D,"__returned")&&(D.__returned===D||D.__returned===null)}async fetch(D,{allowStale:z=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:j=this.noDeleteOnStaleGet,ttl:F=this.ttl,noDisposeOnSet:Ce=this.noDisposeOnSet,size:le=0,sizeCalculation:pe=this.sizeCalculation,noUpdateTTL:$e=this.noUpdateTTL,noDeleteOnFetchRejection:Fe=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Oe=this.allowStaleOnFetchRejection,ignoreFetchAbort:Et=this.ignoreFetchAbort,allowStaleOnFetchAbort:he=this.allowStaleOnFetchAbort,fetchContext:In=this.fetchContext,forceRefresh:vn=!1,status:kt,signal:ue}={}){if(!this.fetchMethod)return kt&&(kt.fetch="get"),this.get(D,{allowStale:z,updateAgeOnGet:V,noDeleteOnStaleGet:j,status:kt});const At={allowStale:z,updateAgeOnGet:V,noDeleteOnStaleGet:j,ttl:F,noDisposeOnSet:Ce,size:le,sizeCalculation:pe,noUpdateTTL:$e,noDeleteOnFetchRejection:Fe,allowStaleOnFetchRejection:Oe,allowStaleOnFetchAbort:he,ignoreFetchAbort:Et,status:kt,signal:ue};let jt=this.keyMap.get(D);if(jt===void 0){kt&&(kt.fetch="miss");const hn=this.backgroundFetch(D,jt,At,In);return hn.__returned=hn}else{const hn=this.valList[jt];if(this.isBackgroundFetch(hn)){const xe=z&&hn.__staleWhileFetching!==void 0;return kt&&(kt.fetch="inflight",xe&&(kt.returnedStale=!0)),xe?hn.__staleWhileFetching:hn.__returned=hn}const Pt=this.isStale(jt);if(!vn&&!Pt)return kt&&(kt.fetch="hit"),this.moveToTail(jt),V&&this.updateItemAge(jt),this.statusTTL(kt,jt),hn;const Ie=this.backgroundFetch(D,jt,At,In),de=Ie.__staleWhileFetching!==void 0,ze=de&&z;return kt&&(kt.fetch=de&&Pt?"stale":"refresh",ze&&Pt&&(kt.returnedStale=!0)),ze?Ie.__staleWhileFetching:Ie.__returned=Ie}}get(D,{allowStale:z=this.allowStale,updateAgeOnGet:V=this.updateAgeOnGet,noDeleteOnStaleGet:j=this.noDeleteOnStaleGet,status:F}={}){const Ce=this.keyMap.get(D);if(Ce!==void 0){const le=this.valList[Ce],pe=this.isBackgroundFetch(le);return this.statusTTL(F,Ce),this.isStale(Ce)?(F&&(F.get="stale"),pe?(F&&(F.returnedStale=z&&le.__staleWhileFetching!==void 0),z?le.__staleWhileFetching:void 0):(j||this.delete(D),F&&(F.returnedStale=z),z?le:void 0)):(F&&(F.get="hit"),pe?le.__staleWhileFetching:(this.moveToTail(Ce),V&&this.updateItemAge(Ce),le))}else F&&(F.get="miss")}connect(D,z){this.prev[z]=D,this.next[D]=z}moveToTail(D){D!==this.tail&&(D===this.head?this.head=this.next[D]:this.connect(this.prev[D],this.next[D]),this.connect(this.tail,D),this.tail=D)}get del(){return _("del","delete"),this.delete}delete(D){let z=!1;if(this.size!==0){const V=this.keyMap.get(D);if(V!==void 0)if(z=!0,this.size===1)this.clear();else{this.removeItemSize(V);const j=this.valList[V];this.isBackgroundFetch(j)?j.__abortController.abort(new Error("deleted")):(this.dispose(j,D,"delete"),this.disposeAfter&&this.disposed.push([j,D,"delete"])),this.keyMap.delete(D),this.keyList[V]=null,this.valList[V]=null,V===this.tail?this.tail=this.prev[V]:V===this.head?this.head=this.next[V]:(this.next[this.prev[V]]=this.next[V],this.prev[this.next[V]]=this.prev[V]),this.size--,this.free.push(V)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return z}clear(){for(const D of this.rindexes({allowStale:!0})){const z=this.valList[D];if(this.isBackgroundFetch(z))z.__abortController.abort(new Error("deleted"));else{const V=this.keyList[D];this.dispose(z,V,"delete"),this.disposeAfter&&this.disposed.push([z,V,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return _("reset","clear"),this.clear}get length(){return b("length","size"),this.size}static get AbortController(){return f}static get AbortSignal(){return g}}o.exports=O}).call(this)}).call(this,n("_process"))},{_process:102}],73:[function(n,o,a){const u=o.exports,{Buffer:c}=n("buffer");u.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"},u.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},u.requiredHeaderFlagsErrors={};for(const f in u.requiredHeaderFlags){const h=u.requiredHeaderFlags[f];u.requiredHeaderFlagsErrors[f]="Invalid header flag bits, must be 0x"+h.toString(16)+" for "+u.types[f]+" packet"}u.codes={};for(const f in u.types){const h=u.types[f];u.codes[h]=f}u.CMD_SHIFT=4,u.CMD_MASK=240,u.DUP_MASK=8,u.QOS_MASK=3,u.QOS_SHIFT=1,u.RETAIN_MASK=1,u.VARBYTEINT_MASK=127,u.VARBYTEINT_FIN_MASK=128,u.VARBYTEINT_MAX=268435455,u.SESSIONPRESENT_MASK=1,u.SESSIONPRESENT_HEADER=c.from([u.SESSIONPRESENT_MASK]),u.CONNACK_HEADER=c.from([u.codes.connack<<u.CMD_SHIFT]),u.USERNAME_MASK=128,u.PASSWORD_MASK=64,u.WILL_RETAIN_MASK=32,u.WILL_QOS_MASK=24,u.WILL_QOS_SHIFT=3,u.WILL_FLAG_MASK=4,u.CLEAN_SESSION_MASK=2,u.CONNECT_HEADER=c.from([u.codes.connect<<u.CMD_SHIFT]),u.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},u.propertiesCodes={};for(const f in u.properties){const h=u.properties[f];u.propertiesCodes[h]=f}u.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 d(f){return[0,1,2].map(h=>[0,1].map(y=>[0,1].map(g=>{const p=c.alloc(1);return p.writeUInt8(u.codes[f]<<u.CMD_SHIFT|(y?u.DUP_MASK:0)|h<<u.QOS_SHIFT|g,0,!0),p})))}u.PUBLISH_HEADER=d("publish"),u.SUBSCRIBE_HEADER=d("subscribe"),u.SUBSCRIBE_OPTIONS_QOS_MASK=3,u.SUBSCRIBE_OPTIONS_NL_MASK=1,u.SUBSCRIBE_OPTIONS_NL_SHIFT=2,u.SUBSCRIBE_OPTIONS_RAP_MASK=1,u.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,u.SUBSCRIBE_OPTIONS_RH_MASK=3,u.SUBSCRIBE_OPTIONS_RH_SHIFT=4,u.SUBSCRIBE_OPTIONS_RH=[0,16,32],u.SUBSCRIBE_OPTIONS_NL=4,u.SUBSCRIBE_OPTIONS_RAP=8,u.SUBSCRIBE_OPTIONS_QOS=[0,1,2],u.UNSUBSCRIBE_HEADER=d("unsubscribe"),u.ACKS={unsuback:d("unsuback"),puback:d("puback"),pubcomp:d("pubcomp"),pubrel:d("pubrel"),pubrec:d("pubrec")},u.SUBACK_HEADER=c.from([u.codes.suback<<u.CMD_SHIFT]),u.VERSION3=c.from([3]),u.VERSION4=c.from([4]),u.VERSION5=c.from([5]),u.VERSION131=c.from([131]),u.VERSION132=c.from([132]),u.QOS=[0,1,2].map(f=>c.from([f])),u.EMPTY={pingreq:c.from([u.codes.pingreq<<4,0]),pingresp:c.from([u.codes.pingresp<<4,0]),disconnect:c.from([u.codes.disconnect<<4,0])},u.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},u.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},u.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},u.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},u.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",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"},u.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},{buffer:29}],74:[function(n,o,a){const u=n("./writeToStream"),c=n("events"),{Buffer:d}=n("buffer");function f(y,g){const p=new h;return u(y,p,g),p.concat()}class h extends c{constructor(){super(),this._array=new Array(20),this._i=0}write(g){return this._array[this._i++]=g,!0}concat(){let g=0;const p=new Array(this._array.length),v=this._array;let _=0,b;for(b=0;b<v.length&&v[b]!==void 0;b++)typeof v[b]!="string"?p[b]=v[b].length:p[b]=d.byteLength(v[b]),g+=p[b];const A=d.allocUnsafe(g);for(b=0;b<v.length&&v[b]!==void 0;b++)typeof v[b]!="string"?(v[b].copy(A,_),_+=p[b]):(A.write(v[b],_),_+=p[b]);return A}destroy(g){g&&this.emit("error",g)}}o.exports=f},{"./writeToStream":96,buffer:29,events:49}],75:[function(n,o,a){a.parser=n("./parser").parser,a.generate=n("./generate"),a.writeToStream=n("./writeToStream")},{"./generate":74,"./parser":95,"./writeToStream":96}],76:[function(n,o,a){const{Buffer:u}=n("buffer"),c=Symbol.for("BufferList");function d(f){if(!(this instanceof d))return new d(f);d._init.call(this,f)}d._init=function(h){Object.defineProperty(this,c,{value:!0}),this._bufs=[],this.length=0,h&&this.append(h)},d.prototype._new=function(h){return new d(h)},d.prototype._offset=function(h){if(h===0)return[0,0];let y=0;for(let g=0;g<this._bufs.length;g++){const p=y+this._bufs[g].length;if(h<p||g===this._bufs.length-1)return[g,h-y];y=p}},d.prototype._reverseOffset=function(f){const h=f[0];let y=f[1];for(let g=0;g<h;g++)y+=this._bufs[g].length;return y},d.prototype.get=function(h){if(h>this.length||h<0)return;const y=this._offset(h);return this._bufs[y[0]][y[1]]},d.prototype.slice=function(h,y){return typeof h=="number"&&h<0&&(h+=this.length),typeof y=="number"&&y<0&&(y+=this.length),this.copy(null,0,h,y)},d.prototype.copy=function(h,y,g,p){if((typeof g!="number"||g<0)&&(g=0),(typeof p!="number"||p>this.length)&&(p=this.length),g>=this.length||p<=0)return h||u.alloc(0);const v=!!h,_=this._offset(g),b=p-g;let A=b,w=v&&y||0,S=_[1];if(g===0&&p===this.length){if(!v)return this._bufs.length===1?this._bufs[0]:u.concat(this._bufs,this.length);for(let T=0;T<this._bufs.length;T++)this._bufs[T].copy(h,w),w+=this._bufs[T].length;return h}if(A<=this._bufs[_[0]].length-S)return v?this._bufs[_[0]].copy(h,y,S,S+A):this._bufs[_[0]].slice(S,S+A);v||(h=u.allocUnsafe(b));for(let T=_[0];T<this._bufs.length;T++){const x=this._bufs[T].length-S;if(A>x)this._bufs[T].copy(h,w,S),w+=x;else{this._bufs[T].copy(h,w,S,S+A),w+=x;break}A-=x,S&&(S=0)}return h.length>w?h.slice(0,w):h},d.prototype.shallowSlice=function(h,y){if(h=h||0,y=typeof y!="number"?this.length:y,h<0&&(h+=this.length),y<0&&(y+=this.length),h===y)return this._new();const g=this._offset(h),p=this._offset(y),v=this._bufs.slice(g[0],p[0]+1);return p[1]===0?v.pop():v[v.length-1]=v[v.length-1].slice(0,p[1]),g[1]!==0&&(v[0]=v[0].slice(g[1])),this._new(v)},d.prototype.toString=function(h,y,g){return this.slice(y,g).toString(h)},d.prototype.consume=function(h){if(h=Math.trunc(h),Number.isNaN(h)||h<=0)return this;for(;this._bufs.length;)if(h>=this._bufs[0].length)h-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(h),this.length-=h;break}return this},d.prototype.duplicate=function(){const h=this._new();for(let y=0;y<this._bufs.length;y++)h.append(this._bufs[y]);return h},d.prototype.append=function(h){if(h==null)return this;if(h.buffer)this._appendBuffer(u.from(h.buffer,h.byteOffset,h.byteLength));else if(Array.isArray(h))for(let y=0;y<h.length;y++)this.append(h[y]);else if(this._isBufferList(h))for(let y=0;y<h._bufs.length;y++)this.append(h._bufs[y]);else typeof h=="number"&&(h=h.toString()),this._appendBuffer(u.from(h));return this},d.prototype._appendBuffer=function(h){this._bufs.push(h),this.length+=h.length},d.prototype.indexOf=function(f,h,y){if(y===void 0&&typeof h=="string"&&(y=h,h=void 0),typeof f=="function"||Array.isArray(f))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof f=="number"?f=u.from([f]):typeof f=="string"?f=u.from(f,y):this._isBufferList(f)?f=f.slice():Array.isArray(f.buffer)?f=u.from(f.buffer,f.byteOffset,f.byteLength):u.isBuffer(f)||(f=u.from(f)),h=Number(h||0),isNaN(h)&&(h=0),h<0&&(h=this.length+h),h<0&&(h=0),f.length===0)return h>this.length?this.length:h;const g=this._offset(h);let p=g[0],v=g[1];for(;p<this._bufs.length;p++){const _=this._bufs[p];for(;v<_.length;)if(_.length-v>=f.length){const A=_.indexOf(f,v);if(A!==-1)return this._reverseOffset([p,A]);v=_.length-f.length+1}else{const A=this._reverseOffset([p,v]);if(this._match(A,f))return A;v++}v=0}return-1},d.prototype._match=function(f,h){if(this.length-f<h.length)return!1;for(let y=0;y<h.length;y++)if(this.get(f+y)!==h[y])return!1;return!0},function(){const f={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 h in f)(function(y){f[y]===null?d.prototype[y]=function(g,p){return this.slice(g,g+p)[y](0,p)}:d.prototype[y]=function(g=0){return this.slice(g,g+f[y])[y](0)}})(h)}(),d.prototype._isBufferList=function(h){return h instanceof d||d.isBufferList(h)},d.isBufferList=function(h){return h!=null&&h[c]},o.exports=d},{buffer:29}],77:[function(n,o,a){const u=n("readable-stream").Duplex,c=n("inherits"),d=n("./BufferList");function f(h){if(!(this instanceof f))return new f(h);if(typeof h=="function"){this._callback=h;const y=(function(p){this._callback&&(this._callback(p),this._callback=null)}).bind(this);this.on("pipe",function(p){p.on("error",y)}),this.on("unpipe",function(p){p.removeListener("error",y)}),h=null}d._init.call(this,h),u.call(this)}c(f,u),Object.assign(f.prototype,d.prototype),f.prototype._new=function(y){return new f(y)},f.prototype._write=function(y,g,p){this._appendBuffer(y),typeof p=="function"&&p()},f.prototype._read=function(y){if(!this.length)return this.push(null);y=Math.min(y,this.length),this.push(this.slice(0,y)),this.consume(y)},f.prototype.end=function(y){u.prototype.end.call(this,y),this._callback&&(this._callback(null,this.slice()),this._callback=null)},f.prototype._destroy=function(y,g){this._bufs.length=0,this.length=0,g(y)},f.prototype._isBufferList=function(y){return y instanceof f||y instanceof d||f.isBufferList(y)},f.isBufferList=d.isBufferList,o.exports=f,o.exports.BufferListStream=f,o.exports.BufferList=d},{"./BufferList":76,inherits:51,"readable-stream":92}],78:[function(n,o,a){arguments[4][33][0].apply(a,arguments)},{dup:33}],79:[function(n,o,a){arguments[4][34][0].apply(a,arguments)},{"./_stream_readable":81,"./_stream_writable":83,_process:102,dup:34,inherits:51}],80:[function(n,o,a){arguments[4][35][0].apply(a,arguments)},{"./_stream_transform":82,dup:35,inherits:51}],81:[function(n,o,a){arguments[4][36][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/async_iterator":84,"./internal/streams/buffer_list":85,"./internal/streams/destroy":86,"./internal/streams/from":88,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:36,events:49,inherits:51,"string_decoder/":136,util:26}],82:[function(n,o,a){arguments[4][37][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,dup:37,inherits:51}],83:[function(n,o,a){arguments[4][38][0].apply(a,arguments)},{"../errors":78,"./_stream_duplex":79,"./internal/streams/destroy":86,"./internal/streams/state":90,"./internal/streams/stream":91,_process:102,buffer:29,dup:38,inherits:51,"util-deprecate":139}],84:[function(n,o,a){arguments[4][39][0].apply(a,arguments)},{"./end-of-stream":87,_process:102,dup:39}],85:[function(n,o,a){arguments[4][40][0].apply(a,arguments)},{buffer:29,dup:40,util:26}],86:[function(n,o,a){arguments[4][41][0].apply(a,arguments)},{_process:102,dup:41}],87:[function(n,o,a){arguments[4][42][0].apply(a,arguments)},{"../../../errors":78,dup:42}],88:[function(n,o,a){arguments[4][43][0].apply(a,arguments)},{dup:43}],89:[function(n,o,a){arguments[4][44][0].apply(a,arguments)},{"../../../errors":78,"./end-of-stream":87,dup:44}],90:[function(n,o,a){arguments[4][45][0].apply(a,arguments)},{"../../../errors":78,dup:45}],91:[function(n,o,a){arguments[4][46][0].apply(a,arguments)},{dup:46,events:49}],92:[function(n,o,a){arguments[4][47][0].apply(a,arguments)},{"./lib/_stream_duplex.js":79,"./lib/_stream_passthrough.js":80,"./lib/_stream_readable.js":81,"./lib/_stream_transform.js":82,"./lib/_stream_writable.js":83,"./lib/internal/streams/end-of-stream.js":87,"./lib/internal/streams/pipeline.js":89,dup:47}],93:[function(n,o,a){const{Buffer:u}=n("buffer"),c=65536,d={},f=u.isBuffer(u.from([1,2]).subarray(0,1));function h(v){const _=u.allocUnsafe(2);return _.writeUInt8(v>>8,0),_.writeUInt8(v&255,0+1),_}function y(){for(let v=0;v<c;v++)d[v]=h(v)}function g(v){let b=0,A=0;const w=u.allocUnsafe(4);do b=v%128|0,v=v/128|0,v>0&&(b=b|128),w.writeUInt8(b,A++);while(v>0&&A<4);return v>0&&(A=0),f?w.subarray(0,A):w.slice(0,A)}function p(v){const _=u.allocUnsafe(4);return _.writeUInt32BE(v,0),_}o.exports={cache:d,generateCache:y,generateNumber:h,genBufVariableByteInt:g,generate4ByteBuffer:p}},{buffer:29}],94:[function(n,o,a){class u{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}o.exports=u},{}],95:[function(n,o,a){const u=n("bl"),c=n("events"),d=n("./packet"),f=n("./constants"),h=n("debug")("mqtt-packet:parser");class y extends c{constructor(){super(),this.parser=this.constructor.parser}static parser(p){return this instanceof y?(this.settings=p||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new y().parser(p)}_resetState(){h("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new d,this.error=null,this._list=u(),this._stateCounter=0}parse(p){for(this.error&&this._resetState(),this._list.append(p),h("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++,h("parse: state complete. _stateCounter is now: %d",this._stateCounter),h("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return h("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const p=this._list.readUInt8(0),v=p>>f.CMD_SHIFT;this.packet.cmd=f.types[v];const _=p&15,b=f.requiredHeaderFlags[v];return b!=null&&_!==b?this._emitError(new Error(f.requiredHeaderFlagsErrors[v])):(this.packet.retain=(p&f.RETAIN_MASK)!==0,this.packet.qos=p>>f.QOS_SHIFT&f.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(p&f.DUP_MASK)!==0,h("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const p=this._parseVarByteNum(!0);return p&&(this.packet.length=p.value,this._list.consume(p.bytes)),h("_parseLength %d",p.value),!!p}_parsePayload(){h("_parsePayload: payload %O",this._list);let p=!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"))}p=!0}return h("_parsePayload complete result: %s",p),p}_parseConnect(){h("_parseConnect");let p,v,_,b;const A={},w=this.packet,S=this._parseString();if(S===null)return this._emitError(new Error("Cannot parse protocolId"));if(S!=="MQTT"&&S!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(w.protocolId=S,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(w.protocolVersion=this._list.readUInt8(this._pos),w.protocolVersion>=128&&(w.bridgeMode=!0,w.protocolVersion=w.protocolVersion-128),w.protocolVersion!==3&&w.protocolVersion!==4&&w.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(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));A.username=this._list.readUInt8(this._pos)&f.USERNAME_MASK,A.password=this._list.readUInt8(this._pos)&f.PASSWORD_MASK,A.will=this._list.readUInt8(this._pos)&f.WILL_FLAG_MASK;const T=!!(this._list.readUInt8(this._pos)&f.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&f.WILL_QOS_MASK)>>f.WILL_QOS_SHIFT;if(A.will)w.will={},w.will.retain=T,w.will.qos=x;else{if(T)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(w.clean=(this._list.readUInt8(this._pos)&f.CLEAN_SESSION_MASK)!==0,this._pos++,w.keepalive=this._parseNum(),w.keepalive===-1)return this._emitError(new Error("Packet too short"));if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.properties=L)}const M=this._parseString();if(M===null)return this._emitError(new Error("Packet too short"));if(w.clientId=M,h("_parseConnect: packet.clientId: %s",w.clientId),A.will){if(w.protocolVersion===5){const L=this._parseProperties();Object.getOwnPropertyNames(L).length&&(w.will.properties=L)}if(p=this._parseString(),p===null)return this._emitError(new Error("Cannot parse will topic"));if(w.will.topic=p,h("_parseConnect: packet.will.topic: %s",w.will.topic),v=this._parseBuffer(),v===null)return this._emitError(new Error("Cannot parse will payload"));w.will.payload=v,h("_parseConnect: packet.will.paylaod: %s",w.will.payload)}if(A.username){if(b=this._parseString(),b===null)return this._emitError(new Error("Cannot parse username"));w.username=b,h("_parseConnect: packet.username: %s",w.username)}if(A.password){if(_=this._parseBuffer(),_===null)return this._emitError(new Error("Cannot parse password"));w.password=_}return this.settings=w,h("_parseConnect: complete"),w}_parseConnack(){h("_parseConnack");const p=this.packet;if(this._list.length<1)return null;const v=this._list.readUInt8(this._pos++);if(v>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(p.sessionPresent=!!(v&f.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?p.reasonCode=this._list.readUInt8(this._pos++):p.reasonCode=0;else{if(this._list.length<2)return null;p.returnCode=this._list.readUInt8(this._pos++)}if(p.returnCode===-1||p.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){const _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(p.properties=_)}h("_parseConnack: complete")}_parsePublish(){h("_parsePublish");const p=this.packet;if(p.topic=this._parseString(),p.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(p.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}p.payload=this._list.slice(this._pos,p.length),h("_parsePublish: payload from buffer list: %o",p.payload)}}_parseSubscribe(){h("_parseSubscribe");const p=this.packet;let v,_,b,A,w,S,T;if(p.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(p.properties=x)}if(p.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<p.length;){if(v=this._parseString(),v===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=p.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(_=this._parseByte(),this.settings.protocolVersion===5){if(_&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(_&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(b=_&f.SUBSCRIBE_OPTIONS_QOS_MASK,b>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(S=(_>>f.SUBSCRIBE_OPTIONS_NL_SHIFT&f.SUBSCRIBE_OPTIONS_NL_MASK)!==0,w=(_>>f.SUBSCRIBE_OPTIONS_RAP_SHIFT&f.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,A=_>>f.SUBSCRIBE_OPTIONS_RH_SHIFT&f.SUBSCRIBE_OPTIONS_RH_MASK,A>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));T={topic:v,qos:b},this.settings.protocolVersion===5?(T.nl=S,T.rap=w,T.rh=A):this.settings.bridgeMode&&(T.rh=0,T.rap=!0,T.nl=!0),h("_parseSubscribe: push subscription `%s` to subscription",T),p.subscriptions.push(T)}}}_parseSuback(){h("_parseSuback");const p=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}if(p.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const v=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!f.MQTT5_SUBACK_CODES[v])return this._emitError(new Error("Invalid suback code"))}else if(v>2&&v!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(v)}}}_parseUnsubscribe(){h("_parseUnsubscribe");const p=this.packet;if(p.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}if(p.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<p.length;){const v=this._parseString();if(v===null)return this._emitError(new Error("Cannot parse topic"));h("_parseUnsubscribe: push topic `%s` to unsubscriptions",v),p.unsubscriptions.push(v)}}}_parseUnsuback(){h("_parseUnsuback");const p=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&p.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(p.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){const v=this._parseProperties();for(Object.getOwnPropertyNames(v).length&&(p.properties=v),p.granted=[];this._pos<this.packet.length;){const _=this._list.readUInt8(this._pos++);if(!f.MQTT5_UNSUBACK_CODES[_])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(_)}}}_parseConfirmation(){h("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const p=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(p.length>2){switch(p.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!f.MQTT5_PUBACK_PUBREC_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!f.MQTT5_PUBREL_PUBCOMP_CODES[p.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}h("_parseConfirmation: packet.reasonCode `%d`",p.reasonCode)}else p.reasonCode=0;if(p.length>3){const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}}return!0}_parseDisconnect(){const p=this.packet;if(h("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(p.reasonCode=this._parseByte(),f.MQTT5_DISCONNECT_CODES[p.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):p.reasonCode=0;const v=this._parseProperties();Object.getOwnPropertyNames(v).length&&(p.properties=v)}return h("_parseDisconnect result: true"),!0}_parseAuth(){h("_parseAuth");const p=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(p.reasonCode=this._parseByte(),!f.MQTT5_AUTH_CODES[p.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const v=this._parseProperties();return Object.getOwnPropertyNames(v).length&&(p.properties=v),h("_parseAuth: result: true"),!0}_parseMessageId(){const p=this.packet;return p.messageId=this._parseNum(),p.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(h("_parseMessageId: packet.messageId %d",p.messageId),!0)}_parseString(p){const v=this._parseNum(),_=v+this._pos;if(v===-1||_>this._list.length||_>this.packet.length)return null;const b=this._list.toString("utf8",this._pos,_);return this._pos+=v,h("_parseString: result: %s",b),b}_parseStringPair(){return h("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const p=this._parseNum(),v=p+this._pos;if(p===-1||v>this._list.length||v>this.packet.length)return null;const _=this._list.slice(this._pos,v);return this._pos+=p,h("_parseBuffer: result: %o",_),_}_parseNum(){if(this._list.length-this._pos<2)return-1;const p=this._list.readUInt16BE(this._pos);return this._pos+=2,h("_parseNum: result: %s",p),p}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const p=this._list.readUInt32BE(this._pos);return this._pos+=4,h("_parse4ByteNum: result: %s",p),p}_parseVarByteNum(p){h("_parseVarByteNum");const v=4;let _=0,b=1,A=0,w=!1,S;const T=this._pos?this._pos:0;for(;_<v&&T+_<this._list.length;){if(S=this._list.readUInt8(T+_++),A+=b*(S&f.VARBYTEINT_MASK),b*=128,!(S&f.VARBYTEINT_FIN_MASK)){w=!0;break}if(this._list.length<=_)break}return!w&&_===v&&this._list.length>=_&&this._emitError(new Error("Invalid variable byte integer")),T&&(this._pos+=_),w?p?w={bytes:_,value:A}:w=A:w=!1,h("_parseVarByteNum: result: %o",w),w}_parseByte(){let p;return this._pos<this._list.length&&(p=this._list.readUInt8(this._pos),this._pos++),h("_parseByte: result: %o",p),p}_parseByType(p){switch(h("_parseByType: type: %s",p),p){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(){h("_parseProperties");const p=this._parseVarByteNum(),_=this._pos+p,b={};for(;this._pos<_;){const A=this._parseByte();if(!A)return this._emitError(new Error("Cannot parse property code type")),!1;const w=f.propertiesCodes[A];if(!w)return this._emitError(new Error("Unknown property")),!1;if(w==="userProperties"){b[w]||(b[w]=Object.create(null));const S=this._parseByType(f.propertiesTypes[w]);if(b[w][S.name])if(Array.isArray(b[w][S.name]))b[w][S.name].push(S.value);else{const T=b[w][S.name];b[w][S.name]=[T],b[w][S.name].push(S.value)}else b[w][S.name]=S.value;continue}b[w]?Array.isArray(b[w])?b[w].push(this._parseByType(f.propertiesTypes[w])):(b[w]=[b[w]],b[w].push(this._parseByType(f.propertiesTypes[w]))):b[w]=this._parseByType(f.propertiesTypes[w])}return b}_newPacket(){return h("_newPacket"),this.packet&&(this._list.consume(this.packet.length),h("_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)),h("_newPacket: new packet"),this.packet=new d,this._pos=0,!0}_emitError(p){h("_emitError",p),this.error=p,this.emit("error",p)}}o.exports=y},{"./constants":73,"./packet":94,bl:77,debug:30,events:49}],96:[function(n,o,a){const u=n("./constants"),{Buffer:c}=n("buffer"),d=c.allocUnsafe(0),f=c.from([0]),h=n("./numbers"),y=n("process-nextick-args").nextTick,g=n("debug")("mqtt-packet:writeToStream"),p=h.cache,v=h.generateNumber,_=h.generateCache,b=h.genBufVariableByteInt,A=h.generate4ByteBuffer;let w=Et,S=!0;function T(Ie,de,ze){switch(g("generate called"),de.cork&&(de.cork(),y(x,de)),S&&(S=!1,_()),g("generate: packet.cmd: %s",Ie.cmd),Ie.cmd){case"connect":return M(Ie,de);case"connack":return L(Ie,de,ze);case"publish":return O(Ie,de,ze);case"puback":case"pubrec":case"pubrel":case"pubcomp":return re(Ie,de,ze);case"subscribe":return D(Ie,de,ze);case"suback":return z(Ie,de,ze);case"unsubscribe":return V(Ie,de,ze);case"unsuback":return j(Ie,de,ze);case"pingreq":case"pingresp":return F(Ie,de);case"disconnect":return Ce(Ie,de,ze);case"auth":return le(Ie,de,ze);default:return de.destroy(new Error("Unknown command")),!1}}Object.defineProperty(T,"cacheNumbers",{get(){return w===Et},set(Ie){Ie?((!p||Object.keys(p).length===0)&&(S=!0),w=Et):(S=!1,w=he)}});function x(Ie){Ie.uncork()}function M(Ie,de,ze){const xe=Ie||{},Ne=xe.protocolId||"MQTT";let Lt=xe.protocolVersion||4;const Dt=xe.will;let Cn=xe.clean;const ie=xe.keepalive||0,ae=xe.clientId||"",Y=xe.username,k=xe.password,$=xe.properties;Cn===void 0&&(Cn=!0);let oe=0;if(!Ne||typeof Ne!="string"&&!c.isBuffer(Ne))return de.destroy(new Error("Invalid protocolId")),!1;if(oe+=Ne.length+2,Lt!==3&&Lt!==4&&Lt!==5)return de.destroy(new Error("Invalid protocol version")),!1;if(oe+=1,(typeof ae=="string"||c.isBuffer(ae))&&(ae||Lt>=4)&&(ae||Cn))oe+=c.byteLength(ae)+2;else{if(Lt<4)return de.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(Cn*1===0)return de.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof ie!="number"||ie<0||ie>65535||ie%1!==0)return de.destroy(new Error("Invalid keepalive")),!1;oe+=2,oe+=1;let _e,Ue;if(Lt===5){if(_e=kt(de,$),!_e)return!1;oe+=_e.length}if(Dt){if(typeof Dt!="object")return de.destroy(new Error("Invalid will")),!1;if(!Dt.topic||typeof Dt.topic!="string")return de.destroy(new Error("Invalid will topic")),!1;if(oe+=c.byteLength(Dt.topic)+2,oe+=2,Dt.payload)if(Dt.payload.length>=0)typeof Dt.payload=="string"?oe+=c.byteLength(Dt.payload):oe+=Dt.payload.length;else return de.destroy(new Error("Invalid will payload")),!1;if(Ue={},Lt===5){if(Ue=kt(de,Dt.properties),!Ue)return!1;oe+=Ue.length}}let _n=!1;if(Y!=null)if(Pt(Y))_n=!0,oe+=c.byteLength(Y)+2;else return de.destroy(new Error("Invalid username")),!1;if(k!=null){if(!_n)return de.destroy(new Error("Username is required to use password")),!1;if(Pt(k))oe+=hn(k)+2;else return de.destroy(new Error("Invalid password")),!1}de.write(u.CONNECT_HEADER),$e(de,oe),vn(de,Ne),xe.bridgeMode&&(Lt+=128),de.write(Lt===131?u.VERSION131:Lt===132?u.VERSION132:Lt===4?u.VERSION4:Lt===5?u.VERSION5:u.VERSION3);let wn=0;return wn|=Y!=null?u.USERNAME_MASK:0,wn|=k!=null?u.PASSWORD_MASK:0,wn|=Dt&&Dt.retain?u.WILL_RETAIN_MASK:0,wn|=Dt&&Dt.qos?Dt.qos<<u.WILL_QOS_SHIFT:0,wn|=Dt?u.WILL_FLAG_MASK:0,wn|=Cn?u.CLEAN_SESSION_MASK:0,de.write(c.from([wn])),w(de,ie),Lt===5&&_e.write(),vn(de,ae),Dt&&(Lt===5&&Ue.write(),Fe(de,Dt.topic),vn(de,Dt.payload)),Y!=null&&vn(de,Y),k!=null&&vn(de,k),!0}function L(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=xe===5?Ne.reasonCode:Ne.returnCode,Dt=Ne.properties;let Cn=2;if(typeof Lt!="number")return de.destroy(new Error("Invalid return code")),!1;let ie=null;if(xe===5){if(ie=kt(de,Dt),!ie)return!1;Cn+=ie.length}return de.write(u.CONNACK_HEADER),$e(de,Cn),de.write(Ne.sessionPresent?u.SESSIONPRESENT_HEADER:f),de.write(c.from([Lt])),ie!=null&&ie.write(),!0}function O(Ie,de,ze){g("publish: packet: %o",Ie);const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.qos||0,Dt=Ne.retain?u.RETAIN_MASK:0,Cn=Ne.topic,ie=Ne.payload||d,ae=Ne.messageId,Y=Ne.properties;let k=0;if(typeof Cn=="string")k+=c.byteLength(Cn)+2;else if(c.isBuffer(Cn))k+=Cn.length+2;else return de.destroy(new Error("Invalid topic")),!1;if(c.isBuffer(ie)?k+=ie.length:k+=c.byteLength(ie),Lt&&typeof ae!="number")return de.destroy(new Error("Invalid messageId")),!1;Lt&&(k+=2);let $=null;if(xe===5){if($=kt(de,Y),!$)return!1;k+=$.length}return de.write(u.PUBLISH_HEADER[Lt][Ne.dup?1:0][Dt?1:0]),$e(de,k),w(de,hn(Cn)),de.write(Cn),Lt>0&&w(de,ae),$!=null&&$.write(),g("publish: payload: %o",ie),de.write(ie)}function re(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.cmd||"puback",Dt=Ne.messageId,Cn=Ne.dup&&Lt==="pubrel"?u.DUP_MASK:0;let ie=0;const ae=Ne.reasonCode,Y=Ne.properties;let k=xe===5?3:2;if(Lt==="pubrel"&&(ie=1),typeof Dt!="number")return de.destroy(new Error("Invalid messageId")),!1;let $=null;if(xe===5&&typeof Y=="object"){if($=ue(de,Y,ze,k),!$)return!1;k+=$.length}return de.write(u.ACKS[Lt][ie][Cn][0]),k===3&&(k+=ae!==0?1:-1),$e(de,k),w(de,Dt),xe===5&&k!==2&&de.write(c.from([ae])),$!==null?$.write():k===4&&de.write(c.from([0])),!0}function D(Ie,de,ze){g("subscribe: packet: ");const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.dup?u.DUP_MASK:0,Dt=Ne.messageId,Cn=Ne.subscriptions,ie=Ne.properties;let ae=0;if(typeof Dt!="number")return de.destroy(new Error("Invalid messageId")),!1;ae+=2;let Y=null;if(xe===5){if(Y=kt(de,ie),!Y)return!1;ae+=Y.length}if(typeof Cn=="object"&&Cn.length)for(let $=0;$<Cn.length;$+=1){const oe=Cn[$].topic,_e=Cn[$].qos;if(typeof oe!="string")return de.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof _e!="number")return de.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(xe===5){if(typeof(Cn[$].nl||!1)!="boolean")return de.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(Cn[$].rap||!1)!="boolean")return de.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const wn=Cn[$].rh||0;if(typeof wn!="number"||wn>2)return de.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}ae+=c.byteLength(oe)+2+1}else return de.destroy(new Error("Invalid subscriptions")),!1;g("subscribe: writing to stream: %o",u.SUBSCRIBE_HEADER),de.write(u.SUBSCRIBE_HEADER[1][Lt?1:0][0]),$e(de,ae),w(de,Dt),Y!==null&&Y.write();let k=!0;for(const $ of Cn){const oe=$.topic,_e=$.qos,Ue=+$.nl,_n=+$.rap,wn=$.rh;let Tn;Fe(de,oe),Tn=u.SUBSCRIBE_OPTIONS_QOS[_e],xe===5&&(Tn|=Ue?u.SUBSCRIBE_OPTIONS_NL:0,Tn|=_n?u.SUBSCRIBE_OPTIONS_RAP:0,Tn|=wn?u.SUBSCRIBE_OPTIONS_RH[wn]:0),k=de.write(c.from([Tn]))}return k}function z(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.granted,Cn=Ne.properties;let ie=0;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(ie+=2,typeof Dt=="object"&&Dt.length)for(let Y=0;Y<Dt.length;Y+=1){if(typeof Dt[Y]!="number")return de.destroy(new Error("Invalid qos vector")),!1;ie+=1}else return de.destroy(new Error("Invalid qos vector")),!1;let ae=null;if(xe===5){if(ae=ue(de,Cn,ze,ie),!ae)return!1;ie+=ae.length}return de.write(u.SUBACK_HEADER),$e(de,ie),w(de,Lt),ae!==null&&ae.write(),de.write(c.from(Dt))}function V(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.dup?u.DUP_MASK:0,Cn=Ne.unsubscriptions,ie=Ne.properties;let ae=0;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(ae+=2,typeof Cn=="object"&&Cn.length)for(let $=0;$<Cn.length;$+=1){if(typeof Cn[$]!="string")return de.destroy(new Error("Invalid unsubscriptions")),!1;ae+=c.byteLength(Cn[$])+2}else return de.destroy(new Error("Invalid unsubscriptions")),!1;let Y=null;if(xe===5){if(Y=kt(de,ie),!Y)return!1;ae+=Y.length}de.write(u.UNSUBSCRIBE_HEADER[1][Dt?1:0][0]),$e(de,ae),w(de,Lt),Y!==null&&Y.write();let k=!0;for(let $=0;$<Cn.length;$++)k=Fe(de,Cn[$]);return k}function j(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.messageId,Dt=Ne.dup?u.DUP_MASK:0,Cn=Ne.granted,ie=Ne.properties,ae=Ne.cmd,Y=0;let k=2;if(typeof Lt!="number")return de.destroy(new Error("Invalid messageId")),!1;if(xe===5)if(typeof Cn=="object"&&Cn.length)for(let oe=0;oe<Cn.length;oe+=1){if(typeof Cn[oe]!="number")return de.destroy(new Error("Invalid qos vector")),!1;k+=1}else return de.destroy(new Error("Invalid qos vector")),!1;let $=null;if(xe===5){if($=ue(de,ie,ze,k),!$)return!1;k+=$.length}return de.write(u.ACKS[ae][Y][Dt][0]),$e(de,k),w(de,Lt),$!==null&&$.write(),xe===5&&de.write(c.from(Cn)),!0}function F(Ie,de,ze){return de.write(u.EMPTY[Ie.cmd])}function Ce(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.reasonCode,Dt=Ne.properties;let Cn=xe===5?1:0,ie=null;if(xe===5){if(ie=ue(de,Dt,ze,Cn),!ie)return!1;Cn+=ie.length}return de.write(c.from([u.codes.disconnect<<4])),$e(de,Cn),xe===5&&de.write(c.from([Lt])),ie!==null&&ie.write(),!0}function le(Ie,de,ze){const xe=ze?ze.protocolVersion:4,Ne=Ie||{},Lt=Ne.reasonCode,Dt=Ne.properties;let Cn=xe===5?1:0;xe!==5&&de.destroy(new Error("Invalid mqtt version for auth packet"));const ie=ue(de,Dt,ze,Cn);return ie?(Cn+=ie.length,de.write(c.from([u.codes.auth<<4])),$e(de,Cn),de.write(c.from([Lt])),ie!==null&&ie.write(),!0):!1}const pe={};function $e(Ie,de){if(de>u.VARBYTEINT_MAX)return Ie.destroy(new Error(`Invalid variable byte integer: ${de}`)),!1;let ze=pe[de];return ze||(ze=b(de),de<16384&&(pe[de]=ze)),g("writeVarByteInt: writing to stream: %o",ze),Ie.write(ze)}function Fe(Ie,de){const ze=c.byteLength(de);return w(Ie,ze),g("writeString: %s",de),Ie.write(de,"utf8")}function Oe(Ie,de,ze){Fe(Ie,de),Fe(Ie,ze)}function Et(Ie,de){return g("writeNumberCached: number: %d",de),g("writeNumberCached: %o",p[de]),Ie.write(p[de])}function he(Ie,de){const ze=v(de);return g("writeNumberGenerated: %o",ze),Ie.write(ze)}function In(Ie,de){const ze=A(de);return g("write4ByteNumber: %o",ze),Ie.write(ze)}function vn(Ie,de){typeof de=="string"?Fe(Ie,de):de?(w(Ie,de.length),Ie.write(de)):w(Ie,0)}function kt(Ie,de){if(typeof de!="object"||de.length!=null)return{length:1,write(){jt(Ie,{},0)}};let ze=0;function xe(Lt,Dt){const Cn=u.propertiesTypes[Lt];let ie=0;switch(Cn){case"byte":{if(typeof Dt!="boolean")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+1;break}case"int8":{if(typeof Dt!="number"||Dt<0||Dt>255)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+1;break}case"binary":{if(Dt&&Dt===null)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+c.byteLength(Dt)+2;break}case"int16":{if(typeof Dt!="number"||Dt<0||Dt>65535)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+2;break}case"int32":{if(typeof Dt!="number"||Dt<0||Dt>4294967295)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+4;break}case"var":{if(typeof Dt!="number"||Dt<0||Dt>268435455)return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+c.byteLength(b(Dt));break}case"string":{if(typeof Dt!="string")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=1+2+c.byteLength(Dt.toString());break}case"pair":{if(typeof Dt!="object")return Ie.destroy(new Error(`Invalid ${Lt}: ${Dt}`)),!1;ie+=Object.getOwnPropertyNames(Dt).reduce((ae,Y)=>{const k=Dt[Y];return Array.isArray(k)?ae+=k.reduce(($,oe)=>($+=1+2+c.byteLength(Y.toString())+2+c.byteLength(oe.toString()),$),0):ae+=1+2+c.byteLength(Y.toString())+2+c.byteLength(Dt[Y].toString()),ae},0);break}default:return Ie.destroy(new Error(`Invalid property ${Lt}: ${Dt}`)),!1}return ie}if(de)for(const Lt in de){let Dt=0,Cn=0;const ie=de[Lt];if(Array.isArray(ie))for(let ae=0;ae<ie.length;ae++){if(Cn=xe(Lt,ie[ae]),!Cn)return!1;Dt+=Cn}else{if(Cn=xe(Lt,ie),!Cn)return!1;Dt=Cn}if(!Dt)return!1;ze+=Dt}return{length:c.byteLength(b(ze))+ze,write(){jt(Ie,de,ze)}}}function ue(Ie,de,ze,xe){const Ne=["reasonString","userProperties"],Lt=ze&&ze.properties&&ze.properties.maximumPacketSize?ze.properties.maximumPacketSize:0;let Dt=kt(Ie,de);if(Lt)for(;xe+Dt.length>Lt;){const Cn=Ne.shift();if(Cn&&de[Cn])delete de[Cn],Dt=kt(Ie,de);else return!1}return Dt}function At(Ie,de,ze){switch(u.propertiesTypes[de]){case"byte":{Ie.write(c.from([u.properties[de]])),Ie.write(c.from([+ze]));break}case"int8":{Ie.write(c.from([u.properties[de]])),Ie.write(c.from([ze]));break}case"binary":{Ie.write(c.from([u.properties[de]])),vn(Ie,ze);break}case"int16":{Ie.write(c.from([u.properties[de]])),w(Ie,ze);break}case"int32":{Ie.write(c.from([u.properties[de]])),In(Ie,ze);break}case"var":{Ie.write(c.from([u.properties[de]])),$e(Ie,ze);break}case"string":{Ie.write(c.from([u.properties[de]])),Fe(Ie,ze);break}case"pair":{Object.getOwnPropertyNames(ze).forEach(Ne=>{const Lt=ze[Ne];Array.isArray(Lt)?Lt.forEach(Dt=>{Ie.write(c.from([u.properties[de]])),Oe(Ie,Ne.toString(),Dt.toString())}):(Ie.write(c.from([u.properties[de]])),Oe(Ie,Ne.toString(),Lt.toString()))});break}default:return Ie.destroy(new Error(`Invalid property ${de} value: ${ze}`)),!1}}function jt(Ie,de,ze){$e(Ie,ze);for(const xe in de)if(Object.prototype.hasOwnProperty.call(de,xe)&&de[xe]!==null){const Ne=de[xe];if(Array.isArray(Ne))for(let Lt=0;Lt<Ne.length;Lt++)At(Ie,xe,Ne[Lt]);else At(Ie,xe,Ne)}}function hn(Ie){return Ie?Ie instanceof c?Ie.length:c.byteLength(Ie):0}function Pt(Ie){return typeof Ie=="string"||Ie instanceof c}o.exports=T},{"./constants":73,"./numbers":93,buffer:29,debug:30,"process-nextick-args":101}],97:[function(n,o,a){var u=1e3,c=u*60,d=c*60,f=d*24,h=f*7,y=f*365.25;o.exports=function(b,A){A=A||{};var w=typeof b;if(w==="string"&&b.length>0)return g(b);if(w==="number"&&isFinite(b))return A.long?v(b):p(b);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(b))};function g(b){if(b=String(b),!(b.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(b);if(A){var w=parseFloat(A[1]),S=(A[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return w*y;case"weeks":case"week":case"w":return w*h;case"days":case"day":case"d":return w*f;case"hours":case"hour":case"hrs":case"hr":case"h":return w*d;case"minutes":case"minute":case"mins":case"min":case"m":return w*c;case"seconds":case"second":case"secs":case"sec":case"s":return w*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return w;default:return}}}}function p(b){var A=Math.abs(b);return A>=f?Math.round(b/f)+"d":A>=d?Math.round(b/d)+"h":A>=c?Math.round(b/c)+"m":A>=u?Math.round(b/u)+"s":b+"ms"}function v(b){var A=Math.abs(b);return A>=f?_(b,A,f,"day"):A>=d?_(b,A,d,"hour"):A>=c?_(b,A,c,"minute"):A>=u?_(b,A,u,"second"):b+" ms"}function _(b,A,w,S){var T=A>=w*1.5;return Math.round(b/w)+" "+S+(T?"s":"")}},{}],98:[function(n,o,a){const u=n("./lib/number-allocator.js");o.exports.NumberAllocator=u},{"./lib/number-allocator.js":99}],99:[function(n,o,a){const u=n("js-sdsl").OrderedSet,c=n("debug")("number-allocator:trace"),d=n("debug")("number-allocator:error");function f(y,g){this.low=y,this.high=g}f.prototype.equals=function(y){return this.low===y.low&&this.high===y.high},f.prototype.compare=function(y){return this.low<y.low&&this.high<y.low?-1:y.low<this.low&&y.high<this.low?1:0};function h(y,g){if(!(this instanceof h))return new h(y,g);this.min=y,this.max=g,this.ss=new u([],(p,v)=>p.compare(v)),c("Create"),this.clear()}h.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},h.prototype.alloc=function(){if(this.ss.size()===0)return c("alloc():empty"),null;const y=this.ss.begin(),g=y.pointer.low,p=y.pointer.high,v=g;return v+1<=p?this.ss.updateKeyByIterator(y,new f(g+1,p)):this.ss.eraseElementByPos(0),c("alloc():"+v),v},h.prototype.use=function(y){const g=new f(y,y),p=this.ss.lowerBound(g);if(!p.equals(this.ss.end())){const v=p.pointer.low,_=p.pointer.high;return p.pointer.equals(g)?(this.ss.eraseElementByIterator(p),c("use():"+y),!0):v>y?!1:v===y?(this.ss.updateKeyByIterator(p,new f(v+1,_)),c("use():"+y),!0):_===y?(this.ss.updateKeyByIterator(p,new f(v,_-1)),c("use():"+y),!0):(this.ss.updateKeyByIterator(p,new f(y+1,_)),this.ss.insert(new f(v,y-1)),c("use():"+y),!0)}return c("use():failed"),!1},h.prototype.free=function(y){if(y<this.min||y>this.max){d("free():"+y+" is out of range");return}const g=new f(y,y),p=this.ss.upperBound(g);if(p.equals(this.ss.end())){if(p.equals(this.ss.begin())){this.ss.insert(g);return}p.pre();const v=p.pointer.high;p.pointer.high+1===y?this.ss.updateKeyByIterator(p,new f(v,y)):this.ss.insert(g)}else if(p.equals(this.ss.begin()))if(y+1===p.pointer.low){const v=p.pointer.high;this.ss.updateKeyByIterator(p,new f(y,v))}else this.ss.insert(g);else{const v=p.pointer.low,_=p.pointer.high;p.pre();const b=p.pointer.low;p.pointer.high+1===y?y+1===v?(this.ss.eraseElementByIterator(p),this.ss.updateKeyByIterator(p,new f(b,_))):this.ss.updateKeyByIterator(p,new f(b,y)):y+1===v?(this.ss.eraseElementByIterator(p.next()),this.ss.insert(new f(y,_))):this.ss.insert(g)}c("free():"+y)},h.prototype.clear=function(){c("clear()"),this.ss.clear(),this.ss.insert(new f(this.min,this.max))},h.prototype.intervalCount=function(){return this.ss.size()},h.prototype.dump=function(){console.log("length:"+this.ss.size());for(const y of this.ss)console.log(y)},o.exports=h},{debug:30,"js-sdsl":69}],100:[function(n,o,a){var u=n("wrappy");o.exports=u(c),o.exports.strict=u(d),c.proto=c(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return c(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return d(this)},configurable:!0})});function c(f){var h=function(){return h.called?h.value:(h.called=!0,h.value=f.apply(this,arguments))};return h.called=!1,h}function d(f){var h=function(){if(h.called)throw new Error(h.onceError);return h.called=!0,h.value=f.apply(this,arguments)},y=f.name||"Function wrapped with `once`";return h.onceError=y+" shouldn't be called more than once",h.called=!1,h}},{wrappy:140}],101:[function(n,o,a){(function(u){(function(){typeof u>"u"||!u.version||u.version.indexOf("v0.")===0||u.version.indexOf("v1.")===0&&u.version.indexOf("v1.8.")!==0?o.exports={nextTick:c}:o.exports=u;function c(d,f,h,y){if(typeof d!="function")throw new TypeError('"callback" argument must be a function');var g=arguments.length,p,v;switch(g){case 0:case 1:return u.nextTick(d);case 2:return u.nextTick(function(){d.call(null,f)});case 3:return u.nextTick(function(){d.call(null,f,h)});case 4:return u.nextTick(function(){d.call(null,f,h,y)});default:for(p=new Array(g-1),v=0;v<p.length;)p[v++]=arguments[v];return u.nextTick(function(){d.apply(null,p)})}}}).call(this)}).call(this,n("_process"))},{_process:102}],102:[function(n,o,a){var u=o.exports={},c,d;function f(){throw new Error("setTimeout has not been defined")}function h(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?c=setTimeout:c=f}catch{c=f}try{typeof clearTimeout=="function"?d=clearTimeout:d=h}catch{d=h}})();function y(x){if(c===setTimeout)return setTimeout(x,0);if((c===f||!c)&&setTimeout)return c=setTimeout,setTimeout(x,0);try{return c(x,0)}catch{try{return c.call(null,x,0)}catch{return c.call(this,x,0)}}}function g(x){if(d===clearTimeout)return clearTimeout(x);if((d===h||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(x);try{return d(x)}catch{try{return d.call(null,x)}catch{return d.call(this,x)}}}var p=[],v=!1,_,b=-1;function A(){!v||!_||(v=!1,_.length?p=_.concat(p):b=-1,p.length&&w())}function w(){if(!v){var x=y(A);v=!0;for(var M=p.length;M;){for(_=p,p=[];++b<M;)_&&_[b].run();b=-1,M=p.length}_=null,v=!1,g(x)}}u.nextTick=function(x){var M=new Array(arguments.length-1);if(arguments.length>1)for(var L=1;L<arguments.length;L++)M[L-1]=arguments[L];p.push(new S(x,M)),p.length===1&&!v&&y(w)};function S(x,M){this.fun=x,this.array=M}S.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={};function T(){}u.on=T,u.addListener=T,u.once=T,u.off=T,u.removeListener=T,u.removeAllListeners=T,u.emit=T,u.prependListener=T,u.prependOnceListener=T,u.listeners=function(x){return[]},u.binding=function(x){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(x){throw new Error("process.chdir is not supported")},u.umask=function(){return 0}},{}],103:[function(n,o,a){(function(u){(function(){(function(c){var d=typeof a=="object"&&a&&!a.nodeType&&a,f=typeof o=="object"&&o&&!o.nodeType&&o,h=typeof u=="object"&&u;(h.global===h||h.window===h||h.self===h)&&(c=h);var y,g=2147483647,p=36,v=1,_=26,b=38,A=700,w=72,S=128,T="-",x=/^xn--/,M=/[^\x20-\x7E]/,L=/[\x2E\u3002\uFF0E\uFF61]/g,O={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},re=p-v,D=Math.floor,z=String.fromCharCode,V;function j(kt){throw new RangeError(O[kt])}function F(kt,ue){for(var At=kt.length,jt=[];At--;)jt[At]=ue(kt[At]);return jt}function Ce(kt,ue){var At=kt.split("@"),jt="";At.length>1&&(jt=At[0]+"@",kt=At[1]),kt=kt.replace(L,".");var hn=kt.split("."),Pt=F(hn,ue).join(".");return jt+Pt}function le(kt){for(var ue=[],At=0,jt=kt.length,hn,Pt;At<jt;)hn=kt.charCodeAt(At++),hn>=55296&&hn<=56319&&At<jt?(Pt=kt.charCodeAt(At++),(Pt&64512)==56320?ue.push(((hn&1023)<<10)+(Pt&1023)+65536):(ue.push(hn),At--)):ue.push(hn);return ue}function pe(kt){return F(kt,function(ue){var At="";return ue>65535&&(ue-=65536,At+=z(ue>>>10&1023|55296),ue=56320|ue&1023),At+=z(ue),At}).join("")}function $e(kt){return kt-48<10?kt-22:kt-65<26?kt-65:kt-97<26?kt-97:p}function Fe(kt,ue){return kt+22+75*(kt<26)-((ue!=0)<<5)}function Oe(kt,ue,At){var jt=0;for(kt=At?D(kt/A):kt>>1,kt+=D(kt/ue);kt>re*_>>1;jt+=p)kt=D(kt/re);return D(jt+(re+1)*kt/(kt+b))}function Et(kt){var ue=[],At=kt.length,jt,hn=0,Pt=S,Ie=w,de,ze,xe,Ne,Lt,Dt,Cn,ie,ae;for(de=kt.lastIndexOf(T),de<0&&(de=0),ze=0;ze<de;++ze)kt.charCodeAt(ze)>=128&&j("not-basic"),ue.push(kt.charCodeAt(ze));for(xe=de>0?de+1:0;xe<At;){for(Ne=hn,Lt=1,Dt=p;xe>=At&&j("invalid-input"),Cn=$e(kt.charCodeAt(xe++)),(Cn>=p||Cn>D((g-hn)/Lt))&&j("overflow"),hn+=Cn*Lt,ie=Dt<=Ie?v:Dt>=Ie+_?_:Dt-Ie,!(Cn<ie);Dt+=p)ae=p-ie,Lt>D(g/ae)&&j("overflow"),Lt*=ae;jt=ue.length+1,Ie=Oe(hn-Ne,jt,Ne==0),D(hn/jt)>g-Pt&&j("overflow"),Pt+=D(hn/jt),hn%=jt,ue.splice(hn++,0,Pt)}return pe(ue)}function he(kt){var ue,At,jt,hn,Pt,Ie,de,ze,xe,Ne,Lt,Dt=[],Cn,ie,ae,Y;for(kt=le(kt),Cn=kt.length,ue=S,At=0,Pt=w,Ie=0;Ie<Cn;++Ie)Lt=kt[Ie],Lt<128&&Dt.push(z(Lt));for(jt=hn=Dt.length,hn&&Dt.push(T);jt<Cn;){for(de=g,Ie=0;Ie<Cn;++Ie)Lt=kt[Ie],Lt>=ue&&Lt<de&&(de=Lt);for(ie=jt+1,de-ue>D((g-At)/ie)&&j("overflow"),At+=(de-ue)*ie,ue=de,Ie=0;Ie<Cn;++Ie)if(Lt=kt[Ie],Lt<ue&&++At>g&&j("overflow"),Lt==ue){for(ze=At,xe=p;Ne=xe<=Pt?v:xe>=Pt+_?_:xe-Pt,!(ze<Ne);xe+=p)Y=ze-Ne,ae=p-Ne,Dt.push(z(Fe(Ne+Y%ae,0))),ze=D(Y/ae);Dt.push(z(Fe(ze,0))),Pt=Oe(At,ie,jt==hn),At=0,++jt}++At,++ue}return Dt.join("")}function In(kt){return Ce(kt,function(ue){return x.test(ue)?Et(ue.slice(4).toLowerCase()):ue})}function vn(kt){return Ce(kt,function(ue){return M.test(ue)?"xn--"+he(ue):ue})}if(y={version:"1.4.1",ucs2:{decode:le,encode:pe},decode:Et,encode:he,toASCII:vn,toUnicode:In},d&&f)if(o.exports==d)f.exports=y;else for(V in y)y.hasOwnProperty(V)&&(d[V]=y[V]);else c.punycode=y})(this)}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],104:[function(n,o,a){function u(d,f){return Object.prototype.hasOwnProperty.call(d,f)}o.exports=function(d,f,h,y){f=f||"&",h=h||"=";var g={};if(typeof d!="string"||d.length===0)return g;var p=/\+/g;d=d.split(f);var v=1e3;y&&typeof y.maxKeys=="number"&&(v=y.maxKeys);var _=d.length;v>0&&_>v&&(_=v);for(var b=0;b<_;++b){var A=d[b].replace(p,"%20"),w=A.indexOf(h),S,T,x,M;w>=0?(S=A.substr(0,w),T=A.substr(w+1)):(S=A,T=""),x=decodeURIComponent(S),M=decodeURIComponent(T),u(g,x)?c(g[x])?g[x].push(M):g[x]=[g[x],M]:g[x]=M}return g};var c=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"}},{}],105:[function(n,o,a){var u=function(h){switch(typeof h){case"string":return h;case"boolean":return h?"true":"false";case"number":return isFinite(h)?h:"";default:return""}};o.exports=function(h,y,g,p){return y=y||"&",g=g||"=",h===null&&(h=void 0),typeof h=="object"?d(f(h),function(v){var _=encodeURIComponent(u(v))+g;return c(h[v])?d(h[v],function(b){return _+encodeURIComponent(u(b))}).join(y):_+encodeURIComponent(u(h[v]))}).join(y):p?encodeURIComponent(u(p))+g+encodeURIComponent(u(h)):""};var c=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function d(h,y){if(h.map)return h.map(y);for(var g=[],p=0;p<h.length;p++)g.push(y(h[p],p));return g}var f=Object.keys||function(h){var y=[];for(var g in h)Object.prototype.hasOwnProperty.call(h,g)&&y.push(g);return y}},{}],106:[function(n,o,a){a.decode=a.parse=n("./decode"),a.encode=a.stringify=n("./encode")},{"./decode":104,"./encode":105}],107:[function(n,o,a){const{AbortError:u,codes:c}=n("../../ours/errors"),{isNodeStream:d,isWebStream:f,kControllerErrorFunction:h}=n("./utils"),y=n("./end-of-stream"),{ERR_INVALID_ARG_TYPE:g}=c,p=(v,_)=>{if(typeof v!="object"||!("aborted"in v))throw new g(_,"AbortSignal",v)};o.exports.addAbortSignal=function(_,b){if(p(_,"signal"),!d(b)&&!f(b))throw new g("stream",["ReadableStream","WritableStream","Stream"],b);return o.exports.addAbortSignalNoValidate(_,b)},o.exports.addAbortSignalNoValidate=function(v,_){if(typeof v!="object"||!("aborted"in v))return _;const b=d(_)?()=>{_.destroy(new u(void 0,{cause:v.reason}))}:()=>{_[h](new u(void 0,{cause:v.reason}))};return v.aborted?b():(v.addEventListener("abort",b),y(_,()=>v.removeEventListener("abort",b))),_}},{"../../ours/errors":126,"./end-of-stream":113,"./utils":122}],108:[function(n,o,a){const{StringPrototypeSlice:u,SymbolIterator:c,TypedArrayPrototypeSet:d,Uint8Array:f}=n("../../ours/primordials"),{Buffer:h}=n("buffer"),{inspect:y}=n("../../ours/util");o.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(p){const v={data:p,next:null};this.length>0?this.tail.next=v:this.head=v,this.tail=v,++this.length}unshift(p){const v={data:p,next:this.head};this.length===0&&(this.tail=v),this.head=v,++this.length}shift(){if(this.length===0)return;const p=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,p}clear(){this.head=this.tail=null,this.length=0}join(p){if(this.length===0)return"";let v=this.head,_=""+v.data;for(;(v=v.next)!==null;)_+=p+v.data;return _}concat(p){if(this.length===0)return h.alloc(0);const v=h.allocUnsafe(p>>>0);let _=this.head,b=0;for(;_;)d(v,_.data,b),b+=_.data.length,_=_.next;return v}consume(p,v){const _=this.head.data;if(p<_.length){const b=_.slice(0,p);return this.head.data=_.slice(p),b}return p===_.length?this.shift():v?this._getString(p):this._getBuffer(p)}first(){return this.head.data}*[c](){for(let p=this.head;p;p=p.next)yield p.data}_getString(p){let v="",_=this.head,b=0;do{const A=_.data;if(p>A.length)v+=A,p-=A.length;else{p===A.length?(v+=A,++b,_.next?this.head=_.next:this.head=this.tail=null):(v+=u(A,0,p),this.head=_,_.data=u(A,p));break}++b}while((_=_.next)!==null);return this.length-=b,v}_getBuffer(p){const v=h.allocUnsafe(p),_=p;let b=this.head,A=0;do{const w=b.data;if(p>w.length)d(v,w,_-p),p-=w.length;else{p===w.length?(d(v,w,_-p),++A,b.next?this.head=b.next:this.head=this.tail=null):(d(v,new f(w.buffer,w.byteOffset,p),_-p),this.head=b,b.data=w.slice(p));break}++A}while((b=b.next)!==null);return this.length-=A,v}[Symbol.for("nodejs.util.inspect.custom")](p,v){return y(this,{...v,depth:0,customInspect:!1})}}},{"../../ours/primordials":127,"../../ours/util":128,buffer:29}],109:[function(n,o,a){const{pipeline:u}=n("./pipeline"),c=n("./duplex"),{destroyer:d}=n("./destroy"),{isNodeStream:f,isReadable:h,isWritable:y,isWebStream:g,isTransformStream:p,isWritableStream:v,isReadableStream:_}=n("./utils"),{AbortError:b,codes:{ERR_INVALID_ARG_VALUE:A,ERR_MISSING_ARGS:w}}=n("../../ours/errors"),S=n("./end-of-stream");o.exports=function(...x){if(x.length===0)throw new w("streams");if(x.length===1)return c.from(x[0]);const M=[...x];if(typeof x[0]=="function"&&(x[0]=c.from(x[0])),typeof x[x.length-1]=="function"){const pe=x.length-1;x[pe]=c.from(x[pe])}for(let pe=0;pe<x.length;++pe)if(!(!f(x[pe])&&!g(x[pe]))){if(pe<x.length-1&&!(h(x[pe])||_(x[pe])||p(x[pe])))throw new A(`streams[${pe}]`,M[pe],"must be readable");if(pe>0&&!(y(x[pe])||v(x[pe])||p(x[pe])))throw new A(`streams[${pe}]`,M[pe],"must be writable")}let L,O,re,D,z;function V(pe){const $e=D;D=null,$e?$e(pe):pe?z.destroy(pe):!le&&!Ce&&z.destroy()}const j=x[0],F=u(x,V),Ce=!!(y(j)||v(j)||p(j)),le=!!(h(F)||_(F)||p(F));if(z=new c({writableObjectMode:!!(j!=null&&j.writableObjectMode),readableObjectMode:!!(F!=null&&F.writableObjectMode),writable:Ce,readable:le}),Ce){if(f(j))z._write=function($e,Fe,Oe){j.write($e,Fe)?Oe():L=Oe},z._final=function($e){j.end(),O=$e},j.on("drain",function(){if(L){const $e=L;L=null,$e()}});else if(g(j)){const Fe=(p(j)?j.writable:j).getWriter();z._write=async function(Oe,Et,he){try{await Fe.ready,Fe.write(Oe).catch(()=>{}),he()}catch(In){he(In)}},z._final=async function(Oe){try{await Fe.ready,Fe.close().catch(()=>{}),O=Oe}catch(Et){Oe(Et)}}}const pe=p(F)?F.readable:F;S(pe,()=>{if(O){const $e=O;O=null,$e()}})}if(le){if(f(F))F.on("readable",function(){if(re){const pe=re;re=null,pe()}}),F.on("end",function(){z.push(null)}),z._read=function(){for(;;){const pe=F.read();if(pe===null){re=z._read;return}if(!z.push(pe))return}};else if(g(F)){const $e=(p(F)?F.readable:F).getReader();z._read=async function(){for(;;)try{const{value:Fe,done:Oe}=await $e.read();if(!z.push(Fe))return;if(Oe){z.push(null);return}}catch{return}}}}return z._destroy=function(pe,$e){!pe&&D!==null&&(pe=new b),re=null,L=null,O=null,D===null?$e(pe):(D=$e,f(F)&&d(F,pe))},z}},{"../../ours/errors":126,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./pipeline":118,"./utils":122}],110:[function(n,o,a){const u=n("process/"),{aggregateTwoErrors:c,codes:{ERR_MULTIPLE_CALLBACK:d},AbortError:f}=n("../../ours/errors"),{Symbol:h}=n("../../ours/primordials"),{kDestroyed:y,isDestroyed:g,isFinished:p,isServerRequest:v}=n("./utils"),_=h("kDestroy"),b=h("kConstruct");function A(le,pe,$e){le&&(le.stack,pe&&!pe.errored&&(pe.errored=le),$e&&!$e.errored&&($e.errored=le))}function w(le,pe){const $e=this._readableState,Fe=this._writableState,Oe=Fe||$e;return Fe!=null&&Fe.destroyed||$e!=null&&$e.destroyed?(typeof pe=="function"&&pe(),this):(A(le,Fe,$e),Fe&&(Fe.destroyed=!0),$e&&($e.destroyed=!0),Oe.constructed?S(this,le,pe):this.once(_,function(Et){S(this,c(Et,le),pe)}),this)}function S(le,pe,$e){let Fe=!1;function Oe(Et){if(Fe)return;Fe=!0;const he=le._readableState,In=le._writableState;A(Et,In,he),In&&(In.closed=!0),he&&(he.closed=!0),typeof $e=="function"&&$e(Et),Et?u.nextTick(T,le,Et):u.nextTick(x,le)}try{le._destroy(pe||null,Oe)}catch(Et){Oe(Et)}}function T(le,pe){M(le,pe),x(le)}function x(le){const pe=le._readableState,$e=le._writableState;$e&&($e.closeEmitted=!0),pe&&(pe.closeEmitted=!0),($e!=null&&$e.emitClose||pe!=null&&pe.emitClose)&&le.emit("close")}function M(le,pe){const $e=le._readableState,Fe=le._writableState;Fe!=null&&Fe.errorEmitted||$e!=null&&$e.errorEmitted||(Fe&&(Fe.errorEmitted=!0),$e&&($e.errorEmitted=!0),le.emit("error",pe))}function L(){const le=this._readableState,pe=this._writableState;le&&(le.constructed=!0,le.closed=!1,le.closeEmitted=!1,le.destroyed=!1,le.errored=null,le.errorEmitted=!1,le.reading=!1,le.ended=le.readable===!1,le.endEmitted=le.readable===!1),pe&&(pe.constructed=!0,pe.destroyed=!1,pe.closed=!1,pe.closeEmitted=!1,pe.errored=null,pe.errorEmitted=!1,pe.finalCalled=!1,pe.prefinished=!1,pe.ended=pe.writable===!1,pe.ending=pe.writable===!1,pe.finished=pe.writable===!1)}function O(le,pe,$e){const Fe=le._readableState,Oe=le._writableState;if(Oe!=null&&Oe.destroyed||Fe!=null&&Fe.destroyed)return this;Fe!=null&&Fe.autoDestroy||Oe!=null&&Oe.autoDestroy?le.destroy(pe):pe&&(pe.stack,Oe&&!Oe.errored&&(Oe.errored=pe),Fe&&!Fe.errored&&(Fe.errored=pe),$e?u.nextTick(M,le,pe):M(le,pe))}function re(le,pe){if(typeof le._construct!="function")return;const $e=le._readableState,Fe=le._writableState;$e&&($e.constructed=!1),Fe&&(Fe.constructed=!1),le.once(b,pe),!(le.listenerCount(b)>1)&&u.nextTick(D,le)}function D(le){let pe=!1;function $e(Fe){if(pe){O(le,Fe??new d);return}pe=!0;const Oe=le._readableState,Et=le._writableState,he=Et||Oe;Oe&&(Oe.constructed=!0),Et&&(Et.constructed=!0),he.destroyed?le.emit(_,Fe):Fe?O(le,Fe,!0):u.nextTick(z,le)}try{le._construct(Fe=>{u.nextTick($e,Fe)})}catch(Fe){u.nextTick($e,Fe)}}function z(le){le.emit(b)}function V(le){return(le==null?void 0:le.setHeader)&&typeof le.abort=="function"}function j(le){le.emit("close")}function F(le,pe){le.emit("error",pe),u.nextTick(j,le)}function Ce(le,pe){!le||g(le)||(!pe&&!p(le)&&(pe=new f),v(le)?(le.socket=null,le.destroy(pe)):V(le)?le.abort():V(le.req)?le.req.abort():typeof le.destroy=="function"?le.destroy(pe):typeof le.close=="function"?le.close():pe?u.nextTick(F,le,pe):u.nextTick(j,le),le.destroyed||(le[y]=!0))}o.exports={construct:re,destroyer:Ce,destroy:w,undestroy:L,errorOrDestroy:O}},{"../../ours/errors":126,"../../ours/primordials":127,"./utils":122,"process/":102}],111:[function(n,o,a){const{ObjectDefineProperties:u,ObjectGetOwnPropertyDescriptor:c,ObjectKeys:d,ObjectSetPrototypeOf:f}=n("../../ours/primordials");o.exports=g;const h=n("./readable"),y=n("./writable");f(g.prototype,h.prototype),f(g,h);{const b=d(y.prototype);for(let A=0;A<b.length;A++){const w=b[A];g.prototype[w]||(g.prototype[w]=y.prototype[w])}}function g(b){if(!(this instanceof g))return new g(b);h.call(this,b),y.call(this,b),b?(this.allowHalfOpen=b.allowHalfOpen!==!1,b.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),b.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}u(g.prototype,{writable:{__proto__:null,...c(y.prototype,"writable")},writableHighWaterMark:{__proto__:null,...c(y.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...c(y.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...c(y.prototype,"writableBuffer")},writableLength:{__proto__:null,...c(y.prototype,"writableLength")},writableFinished:{__proto__:null,...c(y.prototype,"writableFinished")},writableCorked:{__proto__:null,...c(y.prototype,"writableCorked")},writableEnded:{__proto__:null,...c(y.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...c(y.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(b){this._readableState&&this._writableState&&(this._readableState.destroyed=b,this._writableState.destroyed=b)}}});let p;function v(){return p===void 0&&(p={}),p}g.fromWeb=function(b,A){return v().newStreamDuplexFromReadableWritablePair(b,A)},g.toWeb=function(b){return v().newReadableWritablePairFromDuplex(b)};let _;g.from=function(b){return _||(_=n("./duplexify")),_(b,"body")}},{"../../ours/primordials":127,"./duplexify":112,"./readable":119,"./writable":123}],112:[function(n,o,a){const u=n("process/"),c=n("buffer"),{isReadable:d,isWritable:f,isIterable:h,isNodeStream:y,isReadableNodeStream:g,isWritableNodeStream:p,isDuplexNodeStream:v}=n("./utils"),_=n("./end-of-stream"),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:A,ERR_INVALID_RETURN_VALUE:w}}=n("../../ours/errors"),{destroyer:S}=n("./destroy"),T=n("./duplex"),x=n("./readable"),{createDeferredPromise:M}=n("../../ours/util"),L=n("./from"),O=globalThis.Blob||c.Blob,re=typeof O<"u"?function(le){return le instanceof O}:function(le){return!1},D=globalThis.AbortController||n("abort-controller").AbortController,{FunctionPrototypeCall:z}=n("../../ours/primordials");class V extends T{constructor(le){super(le),(le==null?void 0:le.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(le==null?void 0:le.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}o.exports=function Ce(le,pe){if(v(le))return le;if(g(le))return F({readable:le});if(p(le))return F({writable:le});if(y(le))return F({writable:!1,readable:!1});if(typeof le=="function"){const{value:Fe,write:Oe,final:Et,destroy:he}=j(le);if(h(Fe))return L(V,Fe,{objectMode:!0,write:Oe,final:Et,destroy:he});const In=Fe==null?void 0:Fe.then;if(typeof In=="function"){let vn;const kt=z(In,Fe,ue=>{if(ue!=null)throw new w("nully","body",ue)},ue=>{S(vn,ue)});return vn=new V({objectMode:!0,readable:!1,write:Oe,final(ue){Et(async()=>{try{await kt,u.nextTick(ue,null)}catch(At){u.nextTick(ue,At)}})},destroy:he})}throw new w("Iterable, AsyncIterable or AsyncFunction",pe,Fe)}if(re(le))return Ce(le.arrayBuffer());if(h(le))return L(V,le,{objectMode:!0,writable:!1});if(typeof(le==null?void 0:le.writable)=="object"||typeof(le==null?void 0:le.readable)=="object"){const Fe=le!=null&&le.readable?g(le==null?void 0:le.readable)?le==null?void 0:le.readable:Ce(le.readable):void 0,Oe=le!=null&&le.writable?p(le==null?void 0:le.writable)?le==null?void 0:le.writable:Ce(le.writable):void 0;return F({readable:Fe,writable:Oe})}const $e=le==null?void 0:le.then;if(typeof $e=="function"){let Fe;return z($e,le,Oe=>{Oe!=null&&Fe.push(Oe),Fe.push(null)},Oe=>{S(Fe,Oe)}),Fe=new V({objectMode:!0,writable:!1,read(){}})}throw new A(pe,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],le)};function j(Ce){let{promise:le,resolve:pe}=M();const $e=new D,Fe=$e.signal;return{value:Ce(async function*(){for(;;){const Et=le;le=null;const{chunk:he,done:In,cb:vn}=await Et;if(u.nextTick(vn),In)return;if(Fe.aborted)throw new b(void 0,{cause:Fe.reason});({promise:le,resolve:pe}=M()),yield he}}(),{signal:Fe}),write(Et,he,In){const vn=pe;pe=null,vn({chunk:Et,done:!1,cb:In})},final(Et){const he=pe;pe=null,he({done:!0,cb:Et})},destroy(Et,he){$e.abort(),he(Et)}}}function F(Ce){const le=Ce.readable&&typeof Ce.readable.read!="function"?x.wrap(Ce.readable):Ce.readable,pe=Ce.writable;let $e=!!d(le),Fe=!!f(pe),Oe,Et,he,In,vn;function kt(ue){const At=In;In=null,At?At(ue):ue&&vn.destroy(ue)}return vn=new V({readableObjectMode:!!(le!=null&&le.readableObjectMode),writableObjectMode:!!(pe!=null&&pe.writableObjectMode),readable:$e,writable:Fe}),Fe&&(_(pe,ue=>{Fe=!1,ue&&S(le,ue),kt(ue)}),vn._write=function(ue,At,jt){pe.write(ue,At)?jt():Oe=jt},vn._final=function(ue){pe.end(),Et=ue},pe.on("drain",function(){if(Oe){const ue=Oe;Oe=null,ue()}}),pe.on("finish",function(){if(Et){const ue=Et;Et=null,ue()}})),$e&&(_(le,ue=>{$e=!1,ue&&S(le,ue),kt(ue)}),le.on("readable",function(){if(he){const ue=he;he=null,ue()}}),le.on("end",function(){vn.push(null)}),vn._read=function(){for(;;){const ue=le.read();if(ue===null){he=vn._read;return}if(!vn.push(ue))return}}),vn._destroy=function(ue,At){!ue&&In!==null&&(ue=new b),he=null,Oe=null,Et=null,In===null?At(ue):(In=At,S(pe,ue),S(le,ue))},vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./readable":119,"./utils":122,"abort-controller":24,buffer:29,"process/":102}],113:[function(n,o,a){const u=n("process/"),{AbortError:c,codes:d}=n("../../ours/errors"),{ERR_INVALID_ARG_TYPE:f,ERR_STREAM_PREMATURE_CLOSE:h}=d,{kEmptyObject:y,once:g}=n("../../ours/util"),{validateAbortSignal:p,validateFunction:v,validateObject:_,validateBoolean:b}=n("../validators"),{Promise:A,PromisePrototypeThen:w}=n("../../ours/primordials"),{isClosed:S,isReadable:T,isReadableNodeStream:x,isReadableStream:M,isReadableFinished:L,isReadableErrored:O,isWritable:re,isWritableNodeStream:D,isWritableStream:z,isWritableFinished:V,isWritableErrored:j,isNodeStream:F,willEmitClose:Ce,kIsClosedPromise:le}=n("./utils");function pe(he){return he.setHeader&&typeof he.abort=="function"}const $e=()=>{};function Fe(he,In,vn){var kt,ue;if(arguments.length===2?(vn=In,In=y):In==null?In=y:_(In,"options"),v(vn,"callback"),p(In.signal,"options.signal"),vn=g(vn),M(he)||z(he))return Oe(he,In,vn);if(!F(he))throw new f("stream",["ReadableStream","WritableStream","Stream"],he);const At=(kt=In.readable)!==null&&kt!==void 0?kt:x(he),jt=(ue=In.writable)!==null&&ue!==void 0?ue:D(he),hn=he._writableState,Pt=he._readableState,Ie=()=>{he.writable||xe()};let de=Ce(he)&&x(he)===At&&D(he)===jt,ze=V(he,!1);const xe=()=>{ze=!0,he.destroyed&&(de=!1),!(de&&(!he.readable||At))&&(!At||Ne)&&vn.call(he)};let Ne=L(he,!1);const Lt=()=>{Ne=!0,he.destroyed&&(de=!1),!(de&&(!he.writable||jt))&&(!jt||ze)&&vn.call(he)},Dt=$=>{vn.call(he,$)};let Cn=S(he);const ie=()=>{Cn=!0;const $=j(he)||O(he);if($&&typeof $!="boolean")return vn.call(he,$);if(At&&!Ne&&x(he,!0)&&!L(he,!1))return vn.call(he,new h);if(jt&&!ze&&!V(he,!1))return vn.call(he,new h);vn.call(he)},ae=()=>{Cn=!0;const $=j(he)||O(he);if($&&typeof $!="boolean")return vn.call(he,$);vn.call(he)},Y=()=>{he.req.on("finish",xe)};pe(he)?(he.on("complete",xe),de||he.on("abort",ie),he.req?Y():he.on("request",Y)):jt&&!hn&&(he.on("end",Ie),he.on("close",Ie)),!de&&typeof he.aborted=="boolean"&&he.on("aborted",ie),he.on("end",Lt),he.on("finish",xe),In.error!==!1&&he.on("error",Dt),he.on("close",ie),Cn?u.nextTick(ie):hn!=null&&hn.errorEmitted||Pt!=null&&Pt.errorEmitted?de||u.nextTick(ae):(!At&&(!de||T(he))&&(ze||re(he)===!1)||!jt&&(!de||re(he))&&(Ne||T(he)===!1)||Pt&&he.req&&he.aborted)&&u.nextTick(ae);const k=()=>{vn=$e,he.removeListener("aborted",ie),he.removeListener("complete",xe),he.removeListener("abort",ie),he.removeListener("request",Y),he.req&&he.req.removeListener("finish",xe),he.removeListener("end",Ie),he.removeListener("close",Ie),he.removeListener("finish",xe),he.removeListener("end",Lt),he.removeListener("error",Dt),he.removeListener("close",ie)};if(In.signal&&!Cn){const $=()=>{const oe=vn;k(),oe.call(he,new c(void 0,{cause:In.signal.reason}))};if(In.signal.aborted)u.nextTick($);else{const oe=vn;vn=g((..._e)=>{In.signal.removeEventListener("abort",$),oe.apply(he,_e)}),In.signal.addEventListener("abort",$)}}return k}function Oe(he,In,vn){let kt=!1,ue=$e;if(In.signal)if(ue=()=>{kt=!0,vn.call(he,new c(void 0,{cause:In.signal.reason}))},In.signal.aborted)u.nextTick(ue);else{const jt=vn;vn=g((...hn)=>{In.signal.removeEventListener("abort",ue),jt.apply(he,hn)}),In.signal.addEventListener("abort",ue)}const At=(...jt)=>{kt||u.nextTick(()=>vn.apply(he,jt))};return w(he[le].promise,At,At),$e}function Et(he,In){var vn;let kt=!1;return In===null&&(In=y),(vn=In)!==null&&vn!==void 0&&vn.cleanup&&(b(In.cleanup,"cleanup"),kt=In.cleanup),new A((ue,At)=>{const jt=Fe(he,In,hn=>{kt&&jt(),hn?At(hn):ue()})})}o.exports=Fe,o.exports.finished=Et},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./utils":122,"process/":102}],114:[function(n,o,a){const u=n("process/"),{PromisePrototypeThen:c,SymbolAsyncIterator:d,SymbolIterator:f}=n("../../ours/primordials"),{Buffer:h}=n("buffer"),{ERR_INVALID_ARG_TYPE:y,ERR_STREAM_NULL_VALUES:g}=n("../../ours/errors").codes;function p(v,_,b){let A;if(typeof _=="string"||_ instanceof h)return new v({objectMode:!0,...b,read(){this.push(_),this.push(null)}});let w;if(_&&_[d])w=!0,A=_[d]();else if(_&&_[f])w=!1,A=_[f]();else throw new y("iterable",["Iterable"],_);const S=new v({objectMode:!0,highWaterMark:1,...b});let T=!1;S._read=function(){T||(T=!0,M())},S._destroy=function(L,O){c(x(L),()=>u.nextTick(O,L),re=>u.nextTick(O,re||L))};async function x(L){const O=L!=null,re=typeof A.throw=="function";if(O&&re){const{value:D,done:z}=await A.throw(L);if(await D,z)return}if(typeof A.return=="function"){const{value:D}=await A.return();await D}}async function M(){for(;;){try{const{value:L,done:O}=w?await A.next():A.next();if(O)S.push(null);else{const re=L&&typeof L.then=="function"?await L:L;if(re===null)throw T=!1,new g;if(S.push(re))continue;T=!1}}catch(L){S.destroy(L)}break}}return S}o.exports=p},{"../../ours/errors":126,"../../ours/primordials":127,buffer:29,"process/":102}],115:[function(n,o,a){const{ArrayIsArray:u,ObjectSetPrototypeOf:c}=n("../../ours/primordials"),{EventEmitter:d}=n("events");function f(y){d.call(this,y)}c(f.prototype,d.prototype),c(f,d),f.prototype.pipe=function(y,g){const p=this;function v(x){y.writable&&y.write(x)===!1&&p.pause&&p.pause()}p.on("data",v);function _(){p.readable&&p.resume&&p.resume()}y.on("drain",_),!y._isStdio&&(!g||g.end!==!1)&&(p.on("end",A),p.on("close",w));let b=!1;function A(){b||(b=!0,y.end())}function w(){b||(b=!0,typeof y.destroy=="function"&&y.destroy())}function S(x){T(),d.listenerCount(this,"error")===0&&this.emit("error",x)}h(p,"error",S),h(y,"error",S);function T(){p.removeListener("data",v),y.removeListener("drain",_),p.removeListener("end",A),p.removeListener("close",w),p.removeListener("error",S),y.removeListener("error",S),p.removeListener("end",T),p.removeListener("close",T),y.removeListener("close",T)}return p.on("end",T),p.on("close",T),y.on("close",T),y.emit("pipe",p),y};function h(y,g,p){if(typeof y.prependListener=="function")return y.prependListener(g,p);!y._events||!y._events[g]?y.on(g,p):u(y._events[g])?y._events[g].unshift(p):y._events[g]=[p,y._events[g]]}o.exports={Stream:f,prependListener:h}},{"../../ours/primordials":127,events:49}],116:[function(n,o,a){const u=globalThis.AbortController||n("abort-controller").AbortController,{codes:{ERR_INVALID_ARG_VALUE:c,ERR_INVALID_ARG_TYPE:d,ERR_MISSING_ARGS:f,ERR_OUT_OF_RANGE:h},AbortError:y}=n("../../ours/errors"),{validateAbortSignal:g,validateInteger:p,validateObject:v}=n("../validators"),_=n("../../ours/primordials").Symbol("kWeak"),{finished:b}=n("./end-of-stream"),A=n("./compose"),{addAbortSignalNoValidate:w}=n("./add-abort-signal"),{isWritable:S,isNodeStream:T}=n("./utils"),{ArrayPrototypePush:x,MathFloor:M,Number:L,NumberIsNaN:O,Promise:re,PromiseReject:D,PromisePrototypeThen:z,Symbol:V}=n("../../ours/primordials"),j=V("kEmpty"),F=V("kEof");function Ce(Pt,Ie){if(Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),T(Pt)&&!S(Pt))throw new c("stream",Pt,"must be writable");const de=A(this,Pt);return Ie!=null&&Ie.signal&&w(Ie.signal,de),de}function le(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal");let de=1;return(Ie==null?void 0:Ie.concurrency)!=null&&(de=M(Ie.concurrency)),p(de,"concurrency",1),(async function*(){var xe,Ne;const Lt=new u,Dt=this,Cn=[],ie=Lt.signal,ae={signal:ie},Y=()=>Lt.abort();Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted&&Y(),Ie==null||(Ne=Ie.signal)===null||Ne===void 0||Ne.addEventListener("abort",Y);let k,$,oe=!1;function _e(){oe=!0}async function Ue(){try{for await(let Tn of Dt){var _n;if(oe)return;if(ie.aborted)throw new y;try{Tn=Pt(Tn,ae)}catch(Ln){Tn=D(Ln)}Tn!==j&&(typeof((_n=Tn)===null||_n===void 0?void 0:_n.catch)=="function"&&Tn.catch(_e),Cn.push(Tn),k&&(k(),k=null),!oe&&Cn.length&&Cn.length>=de&&await new re(Ln=>{$=Ln}))}Cn.push(F)}catch(Tn){const Ln=D(Tn);z(Ln,void 0,_e),Cn.push(Ln)}finally{var wn;oe=!0,k&&(k(),k=null),Ie==null||(wn=Ie.signal)===null||wn===void 0||wn.removeEventListener("abort",Y)}}Ue();try{for(;;){for(;Cn.length>0;){const _n=await Cn[0];if(_n===F)return;if(ie.aborted)throw new y;_n!==j&&(yield _n),Cn.shift(),$&&($(),$=null)}await new re(_n=>{k=_n})}}finally{Lt.abort(),oe=!0,$&&($(),$=null)}}).call(this)}function pe(Pt=void 0){return Pt!=null&&v(Pt,"options"),(Pt==null?void 0:Pt.signal)!=null&&g(Pt.signal,"options.signal"),(async function*(){let de=0;for await(const xe of this){var ze;if(Pt!=null&&(ze=Pt.signal)!==null&&ze!==void 0&&ze.aborted)throw new y({cause:Pt.signal.reason});yield[de++,xe]}}).call(this)}async function $e(Pt,Ie=void 0){for await(const de of he.call(this,Pt,Ie))return!0;return!1}async function Fe(Pt,Ie=void 0){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);return!await $e.call(this,async(...de)=>!await Pt(...de),Ie)}async function Oe(Pt,Ie){for await(const de of he.call(this,Pt,Ie))return de}async function Et(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);async function de(ze,xe){return await Pt(ze,xe),j}for await(const ze of le.call(this,de,Ie));}function he(Pt,Ie){if(typeof Pt!="function")throw new d("fn",["Function","AsyncFunction"],Pt);async function de(ze,xe){return await Pt(ze,xe)?ze:j}return le.call(this,de,Ie)}class In extends f{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function vn(Pt,Ie,de){var ze;if(typeof Pt!="function")throw new d("reducer",["Function","AsyncFunction"],Pt);de!=null&&v(de,"options"),(de==null?void 0:de.signal)!=null&&g(de.signal,"options.signal");let xe=arguments.length>1;if(de!=null&&(ze=de.signal)!==null&&ze!==void 0&&ze.aborted){const ie=new y(void 0,{cause:de.signal.reason});throw this.once("error",()=>{}),await b(this.destroy(ie)),ie}const Ne=new u,Lt=Ne.signal;if(de!=null&&de.signal){const ie={once:!0,[_]:this};de.signal.addEventListener("abort",()=>Ne.abort(),ie)}let Dt=!1;try{for await(const ie of this){var Cn;if(Dt=!0,de!=null&&(Cn=de.signal)!==null&&Cn!==void 0&&Cn.aborted)throw new y;xe?Ie=await Pt(Ie,ie,{signal:Lt}):(Ie=ie,xe=!0)}if(!Dt&&!xe)throw new In}finally{Ne.abort()}return Ie}async function kt(Pt){Pt!=null&&v(Pt,"options"),(Pt==null?void 0:Pt.signal)!=null&&g(Pt.signal,"options.signal");const Ie=[];for await(const ze of this){var de;if(Pt!=null&&(de=Pt.signal)!==null&&de!==void 0&&de.aborted)throw new y(void 0,{cause:Pt.signal.reason});x(Ie,ze)}return Ie}function ue(Pt,Ie){const de=le.call(this,Pt,Ie);return(async function*(){for await(const xe of de)yield*xe}).call(this)}function At(Pt){if(Pt=L(Pt),O(Pt))return 0;if(Pt<0)throw new h("number",">= 0",Pt);return Pt}function jt(Pt,Ie=void 0){return Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),Pt=At(Pt),(async function*(){var ze;if(Ie!=null&&(ze=Ie.signal)!==null&&ze!==void 0&&ze.aborted)throw new y;for await(const Ne of this){var xe;if(Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted)throw new y;Pt--<=0&&(yield Ne)}}).call(this)}function hn(Pt,Ie=void 0){return Ie!=null&&v(Ie,"options"),(Ie==null?void 0:Ie.signal)!=null&&g(Ie.signal,"options.signal"),Pt=At(Pt),(async function*(){var ze;if(Ie!=null&&(ze=Ie.signal)!==null&&ze!==void 0&&ze.aborted)throw new y;for await(const Ne of this){var xe;if(Ie!=null&&(xe=Ie.signal)!==null&&xe!==void 0&&xe.aborted)throw new y;if(Pt-- >0)yield Ne;else return}}).call(this)}o.exports.streamReturningOperators={asIndexedPairs:pe,drop:jt,filter:he,flatMap:ue,map:le,take:hn,compose:Ce},o.exports.promiseReturningOperators={every:Fe,forEach:Et,reduce:vn,toArray:kt,some:$e,find:Oe}},{"../../ours/errors":126,"../../ours/primordials":127,"../validators":124,"./add-abort-signal":107,"./compose":109,"./end-of-stream":113,"./utils":122,"abort-controller":24}],117:[function(n,o,a){const{ObjectSetPrototypeOf:u}=n("../../ours/primordials");o.exports=d;const c=n("./transform");u(d.prototype,c.prototype),u(d,c);function d(f){if(!(this instanceof d))return new d(f);c.call(this,f)}d.prototype._transform=function(f,h,y){y(null,f)}},{"../../ours/primordials":127,"./transform":121}],118:[function(n,o,a){const u=n("process/"),{ArrayIsArray:c,Promise:d,SymbolAsyncIterator:f}=n("../../ours/primordials"),h=n("./end-of-stream"),{once:y}=n("../../ours/util"),g=n("./destroy"),p=n("./duplex"),{aggregateTwoErrors:v,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:A,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:S},AbortError:T}=n("../../ours/errors"),{validateFunction:x,validateAbortSignal:M}=n("../validators"),{isIterable:L,isReadable:O,isReadableNodeStream:re,isNodeStream:D,isTransformStream:z,isWebStream:V,isReadableStream:j,isReadableEnded:F}=n("./utils"),Ce=globalThis.AbortController||n("abort-controller").AbortController;let le,pe;function $e(At,jt,hn){let Pt=!1;At.on("close",()=>{Pt=!0});const Ie=h(At,{readable:jt,writable:hn},de=>{Pt=!de});return{destroy:de=>{Pt||(Pt=!0,g.destroyer(At,de||new w("pipe")))},cleanup:Ie}}function Fe(At){return x(At[At.length-1],"streams[stream.length - 1]"),At.pop()}function Oe(At){if(L(At))return At;if(re(At))return Et(At);throw new _("val",["Readable","Iterable","AsyncIterable"],At)}async function*Et(At){pe||(pe=n("./readable")),yield*pe.prototype[f].call(At)}async function he(At,jt,hn,{end:Pt}){let Ie,de=null;const ze=Lt=>{if(Lt&&(Ie=Lt),de){const Dt=de;de=null,Dt()}},xe=()=>new d((Lt,Dt)=>{Ie?Dt(Ie):de=()=>{Ie?Dt(Ie):Lt()}});jt.on("drain",ze);const Ne=h(jt,{readable:!1},ze);try{jt.writableNeedDrain&&await xe();for await(const Lt of At)jt.write(Lt)||await xe();Pt&&jt.end(),await xe(),hn()}catch(Lt){hn(Ie!==Lt?v(Ie,Lt):Lt)}finally{Ne(),jt.off("drain",ze)}}async function In(At,jt,hn,{end:Pt}){z(jt)&&(jt=jt.writable);const Ie=jt.getWriter();try{for await(const de of At)await Ie.ready,Ie.write(de).catch(()=>{});await Ie.ready,Pt&&await Ie.close(),hn()}catch(de){try{await Ie.abort(de),hn(de)}catch(ze){hn(ze)}}}function vn(...At){return kt(At,y(Fe(At)))}function kt(At,jt,hn){if(At.length===1&&c(At[0])&&(At=At[0]),At.length<2)throw new A("streams");const Pt=new Ce,Ie=Pt.signal,de=hn==null?void 0:hn.signal,ze=[];M(de,"options.signal");function xe(){ae(new T)}de==null||de.addEventListener("abort",xe);let Ne,Lt;const Dt=[];let Cn=0;function ie(oe){ae(oe,--Cn===0)}function ae(oe,_e){if(oe&&(!Ne||Ne.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Ne=oe),!(!Ne&&!_e)){for(;Dt.length;)Dt.shift()(Ne);de==null||de.removeEventListener("abort",xe),Pt.abort(),_e&&(Ne||ze.forEach(Ue=>Ue()),u.nextTick(jt,Ne,Lt))}}let Y;for(let oe=0;oe<At.length;oe++){const _e=At[oe],Ue=oe<At.length-1,_n=oe>0,wn=Ue||(hn==null?void 0:hn.end)!==!1,Tn=oe===At.length-1;if(D(_e)){let Ln=function(Ve){Ve&&Ve.name!=="AbortError"&&Ve.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ie(Ve)};if(wn){const{destroy:Ve,cleanup:qe}=$e(_e,Ue,_n);Dt.push(Ve),O(_e)&&Tn&&ze.push(qe)}_e.on("error",Ln),O(_e)&&Tn&&ze.push(()=>{_e.removeListener("error",Ln)})}if(oe===0)if(typeof _e=="function"){if(Y=_e({signal:Ie}),!L(Y))throw new b("Iterable, AsyncIterable or Stream","source",Y)}else L(_e)||re(_e)||z(_e)?Y=_e:Y=p.from(_e);else if(typeof _e=="function"){if(z(Y)){var k;Y=Oe((k=Y)===null||k===void 0?void 0:k.readable)}else Y=Oe(Y);if(Y=_e(Y,{signal:Ie}),Ue){if(!L(Y,!0))throw new b("AsyncIterable",`transform[${oe-1}]`,Y)}else{var $;le||(le=n("./passthrough"));const Ln=new le({objectMode:!0}),Ve=($=Y)===null||$===void 0?void 0:$.then;if(typeof Ve=="function")Cn++,Ve.call(Y,An=>{Lt=An,An!=null&&Ln.write(An),wn&&Ln.end(),u.nextTick(ie)},An=>{Ln.destroy(An),u.nextTick(ie,An)});else if(L(Y,!0))Cn++,he(Y,Ln,ie,{end:wn});else if(j(Y)||z(Y)){const An=Y.readable||Y;Cn++,he(An,Ln,ie,{end:wn})}else throw new b("AsyncIterable or Promise","destination",Y);Y=Ln;const{destroy:qe,cleanup:Sn}=$e(Y,!1,!0);Dt.push(qe),Tn&&ze.push(Sn)}}else if(D(_e)){if(re(Y)){Cn+=2;const Ln=ue(Y,_e,ie,{end:wn});O(_e)&&Tn&&ze.push(Ln)}else if(z(Y)||j(Y)){const Ln=Y.readable||Y;Cn++,he(Ln,_e,ie,{end:wn})}else if(L(Y))Cn++,he(Y,_e,ie,{end:wn});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=_e}else if(V(_e)){if(re(Y))Cn++,In(Oe(Y),_e,ie,{end:wn});else if(j(Y)||L(Y))Cn++,In(Y,_e,ie,{end:wn});else if(z(Y))Cn++,In(Y.readable,_e,ie,{end:wn});else throw new _("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Y);Y=_e}else Y=p.from(_e)}return(Ie!=null&&Ie.aborted||de!=null&&de.aborted)&&u.nextTick(xe),Y}function ue(At,jt,hn,{end:Pt}){let Ie=!1;if(jt.on("close",()=>{Ie||hn(new S)}),At.pipe(jt,{end:!1}),Pt){let de=function(){Ie=!0,jt.end()};F(At)?u.nextTick(de):At.once("end",de)}else hn();return h(At,{readable:!0,writable:!1},de=>{const ze=At._readableState;de&&de.code==="ERR_STREAM_PREMATURE_CLOSE"&&ze&&ze.ended&&!ze.errored&&!ze.errorEmitted?At.once("end",hn).once("error",hn):hn(de)}),h(jt,{readable:!1,writable:!0},hn)}o.exports={pipelineImpl:kt,pipeline:vn}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./passthrough":117,"./readable":119,"./utils":122,"abort-controller":24,"process/":102}],119:[function(n,o,a){const u=n("process/"),{ArrayPrototypeIndexOf:c,NumberIsInteger:d,NumberIsNaN:f,NumberParseInt:h,ObjectDefineProperties:y,ObjectKeys:g,ObjectSetPrototypeOf:p,Promise:v,SafeSet:_,SymbolAsyncIterator:b,Symbol:A}=n("../../ours/primordials");o.exports=ue,ue.ReadableState=kt;const{EventEmitter:w}=n("events"),{Stream:S,prependListener:T}=n("./legacy"),{Buffer:x}=n("buffer"),{addAbortSignal:M}=n("./add-abort-signal"),L=n("./end-of-stream");let O=n("../../ours/util").debuglog("stream",Ve=>{O=Ve});const re=n("./buffer_list"),D=n("./destroy"),{getHighWaterMark:z,getDefaultHighWaterMark:V}=n("./state"),{aggregateTwoErrors:j,codes:{ERR_INVALID_ARG_TYPE:F,ERR_METHOD_NOT_IMPLEMENTED:Ce,ERR_OUT_OF_RANGE:le,ERR_STREAM_PUSH_AFTER_EOF:pe,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:$e}}=n("../../ours/errors"),{validateObject:Fe}=n("../validators"),Oe=A("kPaused"),{StringDecoder:Et}=n("string_decoder"),he=n("./from");p(ue.prototype,S.prototype),p(ue,S);const In=()=>{},{errorOrDestroy:vn}=D;function kt(Ve,qe,Sn){typeof Sn!="boolean"&&(Sn=qe instanceof n("./duplex")),this.objectMode=!!(Ve&&Ve.objectMode),Sn&&(this.objectMode=this.objectMode||!!(Ve&&Ve.readableObjectMode)),this.highWaterMark=Ve?z(this,Ve,"readableHighWaterMark",Sn):V(!1),this.buffer=new re,this.length=0,this.pipes=[],this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.constructed=!0,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this[Oe]=null,this.errorEmitted=!1,this.emitClose=!Ve||Ve.emitClose!==!1,this.autoDestroy=!Ve||Ve.autoDestroy!==!1,this.destroyed=!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this.defaultEncoding=Ve&&Ve.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.multiAwaitDrain=!1,this.readingMore=!1,this.dataEmitted=!1,this.decoder=null,this.encoding=null,Ve&&Ve.encoding&&(this.decoder=new Et(Ve.encoding),this.encoding=Ve.encoding)}function ue(Ve){if(!(this instanceof ue))return new ue(Ve);const qe=this instanceof n("./duplex");this._readableState=new kt(Ve,this,qe),Ve&&(typeof Ve.read=="function"&&(this._read=Ve.read),typeof Ve.destroy=="function"&&(this._destroy=Ve.destroy),typeof Ve.construct=="function"&&(this._construct=Ve.construct),Ve.signal&&!qe&&M(Ve.signal,this)),S.call(this,Ve),D.construct(this,()=>{this._readableState.needReadable&&Ne(this,this._readableState)})}ue.prototype.destroy=D.destroy,ue.prototype._undestroy=D.undestroy,ue.prototype._destroy=function(Ve,qe){qe(Ve)},ue.prototype[w.captureRejectionSymbol]=function(Ve){this.destroy(Ve)},ue.prototype.push=function(Ve,qe){return At(this,Ve,qe,!1)},ue.prototype.unshift=function(Ve,qe){return At(this,Ve,qe,!0)};function At(Ve,qe,Sn,An){O("readableAddChunk",qe);const xn=Ve._readableState;let Bn;if(xn.objectMode||(typeof qe=="string"?(Sn=Sn||xn.defaultEncoding,xn.encoding!==Sn&&(An&&xn.encoding?qe=x.from(qe,Sn).toString(xn.encoding):(qe=x.from(qe,Sn),Sn=""))):qe instanceof x?Sn="":S._isUint8Array(qe)?(qe=S._uint8ArrayToBuffer(qe),Sn=""):qe!=null&&(Bn=new F("chunk",["string","Buffer","Uint8Array"],qe))),Bn)vn(Ve,Bn);else if(qe===null)xn.reading=!1,de(Ve,xn);else if(xn.objectMode||qe&&qe.length>0)if(An)if(xn.endEmitted)vn(Ve,new $e);else{if(xn.destroyed||xn.errored)return!1;jt(Ve,xn,qe,!0)}else if(xn.ended)vn(Ve,new pe);else{if(xn.destroyed||xn.errored)return!1;xn.reading=!1,xn.decoder&&!Sn?(qe=xn.decoder.write(qe),xn.objectMode||qe.length!==0?jt(Ve,xn,qe,!1):Ne(Ve,xn)):jt(Ve,xn,qe,!1)}else An||(xn.reading=!1,Ne(Ve,xn));return!xn.ended&&(xn.length<xn.highWaterMark||xn.length===0)}function jt(Ve,qe,Sn,An){qe.flowing&&qe.length===0&&!qe.sync&&Ve.listenerCount("data")>0?(qe.multiAwaitDrain?qe.awaitDrainWriters.clear():qe.awaitDrainWriters=null,qe.dataEmitted=!0,Ve.emit("data",Sn)):(qe.length+=qe.objectMode?1:Sn.length,An?qe.buffer.unshift(Sn):qe.buffer.push(Sn),qe.needReadable&&ze(Ve)),Ne(Ve,qe)}ue.prototype.isPaused=function(){const Ve=this._readableState;return Ve[Oe]===!0||Ve.flowing===!1},ue.prototype.setEncoding=function(Ve){const qe=new Et(Ve);this._readableState.decoder=qe,this._readableState.encoding=this._readableState.decoder.encoding;const Sn=this._readableState.buffer;let An="";for(const xn of Sn)An+=qe.write(xn);return Sn.clear(),An!==""&&Sn.push(An),this._readableState.length=An.length,this};const hn=1073741824;function Pt(Ve){if(Ve>hn)throw new le("size","<= 1GiB",Ve);return Ve--,Ve|=Ve>>>1,Ve|=Ve>>>2,Ve|=Ve>>>4,Ve|=Ve>>>8,Ve|=Ve>>>16,Ve++,Ve}function Ie(Ve,qe){return Ve<=0||qe.length===0&&qe.ended?0:qe.objectMode?1:f(Ve)?qe.flowing&&qe.length?qe.buffer.first().length:qe.length:Ve<=qe.length?Ve:qe.ended?qe.length:0}ue.prototype.read=function(Ve){O("read",Ve),Ve===void 0?Ve=NaN:d(Ve)||(Ve=h(Ve,10));const qe=this._readableState,Sn=Ve;if(Ve>qe.highWaterMark&&(qe.highWaterMark=Pt(Ve)),Ve!==0&&(qe.emittedReadable=!1),Ve===0&&qe.needReadable&&((qe.highWaterMark!==0?qe.length>=qe.highWaterMark:qe.length>0)||qe.ended))return O("read: emitReadable",qe.length,qe.ended),qe.length===0&&qe.ended?Ue(this):ze(this),null;if(Ve=Ie(Ve,qe),Ve===0&&qe.ended)return qe.length===0&&Ue(this),null;let An=qe.needReadable;if(O("need readable",An),(qe.length===0||qe.length-Ve<qe.highWaterMark)&&(An=!0,O("length less than watermark",An)),qe.ended||qe.reading||qe.destroyed||qe.errored||!qe.constructed)An=!1,O("reading, ended or constructing",An);else if(An){O("do read"),qe.reading=!0,qe.sync=!0,qe.length===0&&(qe.needReadable=!0);try{this._read(qe.highWaterMark)}catch(Bn){vn(this,Bn)}qe.sync=!1,qe.reading||(Ve=Ie(Sn,qe))}let xn;return Ve>0?xn=_e(Ve,qe):xn=null,xn===null?(qe.needReadable=qe.length<=qe.highWaterMark,Ve=0):(qe.length-=Ve,qe.multiAwaitDrain?qe.awaitDrainWriters.clear():qe.awaitDrainWriters=null),qe.length===0&&(qe.ended||(qe.needReadable=!0),Sn!==Ve&&qe.ended&&Ue(this)),xn!==null&&!qe.errorEmitted&&!qe.closeEmitted&&(qe.dataEmitted=!0,this.emit("data",xn)),xn};function de(Ve,qe){if(O("onEofChunk"),!qe.ended){if(qe.decoder){const Sn=qe.decoder.end();Sn&&Sn.length&&(qe.buffer.push(Sn),qe.length+=qe.objectMode?1:Sn.length)}qe.ended=!0,qe.sync?ze(Ve):(qe.needReadable=!1,qe.emittedReadable=!0,xe(Ve))}}function ze(Ve){const qe=Ve._readableState;O("emitReadable",qe.needReadable,qe.emittedReadable),qe.needReadable=!1,qe.emittedReadable||(O("emitReadable",qe.flowing),qe.emittedReadable=!0,u.nextTick(xe,Ve))}function xe(Ve){const qe=Ve._readableState;O("emitReadable_",qe.destroyed,qe.length,qe.ended),!qe.destroyed&&!qe.errored&&(qe.length||qe.ended)&&(Ve.emit("readable"),qe.emittedReadable=!1),qe.needReadable=!qe.flowing&&!qe.ended&&qe.length<=qe.highWaterMark,k(Ve)}function Ne(Ve,qe){!qe.readingMore&&qe.constructed&&(qe.readingMore=!0,u.nextTick(Lt,Ve,qe))}function Lt(Ve,qe){for(;!qe.reading&&!qe.ended&&(qe.length<qe.highWaterMark||qe.flowing&&qe.length===0);){const Sn=qe.length;if(O("maybeReadMore read 0"),Ve.read(0),Sn===qe.length)break}qe.readingMore=!1}ue.prototype._read=function(Ve){throw new Ce("_read()")},ue.prototype.pipe=function(Ve,qe){const Sn=this,An=this._readableState;An.pipes.length===1&&(An.multiAwaitDrain||(An.multiAwaitDrain=!0,An.awaitDrainWriters=new _(An.awaitDrainWriters?[An.awaitDrainWriters]:[]))),An.pipes.push(Ve),O("pipe count=%d opts=%j",An.pipes.length,qe);const Bn=(!qe||qe.end!==!1)&&Ve!==u.stdout&&Ve!==u.stderr?Gn:Wn;An.endEmitted?u.nextTick(Bn):Sn.once("end",Bn),Ve.on("unpipe",Mn);function Mn(On,Nn){O("onunpipe"),On===Sn&&Nn&&Nn.hasUnpiped===!1&&(Nn.hasUnpiped=!0,jn())}function Gn(){O("onend"),Ve.end()}let Vn,Un=!1;function jn(){O("cleanup"),Ve.removeListener("close",zn),Ve.removeListener("finish",Yn),Vn&&Ve.removeListener("drain",Vn),Ve.removeListener("error",Hn),Ve.removeListener("unpipe",Mn),Sn.removeListener("end",Gn),Sn.removeListener("end",Wn),Sn.removeListener("data",Fn),Un=!0,Vn&&An.awaitDrainWriters&&(!Ve._writableState||Ve._writableState.needDrain)&&Vn()}function Kn(){Un||(An.pipes.length===1&&An.pipes[0]===Ve?(O("false write response, pause",0),An.awaitDrainWriters=Ve,An.multiAwaitDrain=!1):An.pipes.length>1&&An.pipes.includes(Ve)&&(O("false write response, pause",An.awaitDrainWriters.size),An.awaitDrainWriters.add(Ve)),Sn.pause()),Vn||(Vn=Dt(Sn,Ve),Ve.on("drain",Vn))}Sn.on("data",Fn);function Fn(On){O("ondata");const Nn=Ve.write(On);O("dest.write",Nn),Nn===!1&&Kn()}function Hn(On){if(O("onerror",On),Wn(),Ve.removeListener("error",Hn),Ve.listenerCount("error")===0){const Nn=Ve._writableState||Ve._readableState;Nn&&!Nn.errorEmitted?vn(Ve,On):Ve.emit("error",On)}}T(Ve,"error",Hn);function zn(){Ve.removeListener("finish",Yn),Wn()}Ve.once("close",zn);function Yn(){O("onfinish"),Ve.removeListener("close",zn),Wn()}Ve.once("finish",Yn);function Wn(){O("unpipe"),Sn.unpipe(Ve)}return Ve.emit("pipe",Sn),Ve.writableNeedDrain===!0?An.flowing&&Kn():An.flowing||(O("pipe resume"),Sn.resume()),Ve};function Dt(Ve,qe){return function(){const An=Ve._readableState;An.awaitDrainWriters===qe?(O("pipeOnDrain",1),An.awaitDrainWriters=null):An.multiAwaitDrain&&(O("pipeOnDrain",An.awaitDrainWriters.size),An.awaitDrainWriters.delete(qe)),(!An.awaitDrainWriters||An.awaitDrainWriters.size===0)&&Ve.listenerCount("data")&&Ve.resume()}}ue.prototype.unpipe=function(Ve){const qe=this._readableState,Sn={hasUnpiped:!1};if(qe.pipes.length===0)return this;if(!Ve){const xn=qe.pipes;qe.pipes=[],this.pause();for(let Bn=0;Bn<xn.length;Bn++)xn[Bn].emit("unpipe",this,{hasUnpiped:!1});return this}const An=c(qe.pipes,Ve);return An===-1?this:(qe.pipes.splice(An,1),qe.pipes.length===0&&this.pause(),Ve.emit("unpipe",this,Sn),this)},ue.prototype.on=function(Ve,qe){const Sn=S.prototype.on.call(this,Ve,qe),An=this._readableState;return Ve==="data"?(An.readableListening=this.listenerCount("readable")>0,An.flowing!==!1&&this.resume()):Ve==="readable"&&!An.endEmitted&&!An.readableListening&&(An.readableListening=An.needReadable=!0,An.flowing=!1,An.emittedReadable=!1,O("on readable",An.length,An.reading),An.length?ze(this):An.reading||u.nextTick(ie,this)),Sn},ue.prototype.addListener=ue.prototype.on,ue.prototype.removeListener=function(Ve,qe){const Sn=S.prototype.removeListener.call(this,Ve,qe);return Ve==="readable"&&u.nextTick(Cn,this),Sn},ue.prototype.off=ue.prototype.removeListener,ue.prototype.removeAllListeners=function(Ve){const qe=S.prototype.removeAllListeners.apply(this,arguments);return(Ve==="readable"||Ve===void 0)&&u.nextTick(Cn,this),qe};function Cn(Ve){const qe=Ve._readableState;qe.readableListening=Ve.listenerCount("readable")>0,qe.resumeScheduled&&qe[Oe]===!1?qe.flowing=!0:Ve.listenerCount("data")>0?Ve.resume():qe.readableListening||(qe.flowing=null)}function ie(Ve){O("readable nexttick read 0"),Ve.read(0)}ue.prototype.resume=function(){const Ve=this._readableState;return Ve.flowing||(O("resume"),Ve.flowing=!Ve.readableListening,ae(this,Ve)),Ve[Oe]=!1,this};function ae(Ve,qe){qe.resumeScheduled||(qe.resumeScheduled=!0,u.nextTick(Y,Ve,qe))}function Y(Ve,qe){O("resume",qe.reading),qe.reading||Ve.read(0),qe.resumeScheduled=!1,Ve.emit("resume"),k(Ve),qe.flowing&&!qe.reading&&Ve.read(0)}ue.prototype.pause=function(){return O("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(O("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Oe]=!0,this};function k(Ve){const qe=Ve._readableState;for(O("flow",qe.flowing);qe.flowing&&Ve.read()!==null;);}ue.prototype.wrap=function(Ve){let qe=!1;Ve.on("data",An=>{!this.push(An)&&Ve.pause&&(qe=!0,Ve.pause())}),Ve.on("end",()=>{this.push(null)}),Ve.on("error",An=>{vn(this,An)}),Ve.on("close",()=>{this.destroy()}),Ve.on("destroy",()=>{this.destroy()}),this._read=()=>{qe&&Ve.resume&&(qe=!1,Ve.resume())};const Sn=g(Ve);for(let An=1;An<Sn.length;An++){const xn=Sn[An];this[xn]===void 0&&typeof Ve[xn]=="function"&&(this[xn]=Ve[xn].bind(Ve))}return this},ue.prototype[b]=function(){return $(this)},ue.prototype.iterator=function(Ve){return Ve!==void 0&&Fe(Ve,"options"),$(this,Ve)};function $(Ve,qe){typeof Ve.read!="function"&&(Ve=ue.wrap(Ve,{objectMode:!0}));const Sn=oe(Ve,qe);return Sn.stream=Ve,Sn}async function*oe(Ve,qe){let Sn=In;function An(Mn){this===Ve?(Sn(),Sn=In):Sn=Mn}Ve.on("readable",An);let xn;const Bn=L(Ve,{writable:!1},Mn=>{xn=Mn?j(xn,Mn):null,Sn(),Sn=In});try{for(;;){const Mn=Ve.destroyed?null:Ve.read();if(Mn!==null)yield Mn;else{if(xn)throw xn;if(xn===null)return;await new v(An)}}}catch(Mn){throw xn=j(xn,Mn),xn}finally{(xn||(qe==null?void 0:qe.destroyOnReturn)!==!1)&&(xn===void 0||Ve._readableState.autoDestroy)?D.destroyer(Ve,null):(Ve.off("readable",An),Bn())}}y(ue.prototype,{readable:{__proto__:null,get(){const Ve=this._readableState;return!!Ve&&Ve.readable!==!1&&!Ve.destroyed&&!Ve.errorEmitted&&!Ve.endEmitted},set(Ve){this._readableState&&(this._readableState.readable=!!Ve)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Ve){this._readableState&&(this._readableState.flowing=Ve)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Ve){this._readableState&&(this._readableState.destroyed=Ve)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),y(kt.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Oe]!==!1},set(Ve){this[Oe]=!!Ve}}}),ue._fromList=_e;function _e(Ve,qe){if(qe.length===0)return null;let Sn;return qe.objectMode?Sn=qe.buffer.shift():!Ve||Ve>=qe.length?(qe.decoder?Sn=qe.buffer.join(""):qe.buffer.length===1?Sn=qe.buffer.first():Sn=qe.buffer.concat(qe.length),qe.buffer.clear()):Sn=qe.buffer.consume(Ve,qe.decoder),Sn}function Ue(Ve){const qe=Ve._readableState;O("endReadable",qe.endEmitted),qe.endEmitted||(qe.ended=!0,u.nextTick(_n,qe,Ve))}function _n(Ve,qe){if(O("endReadableNT",Ve.endEmitted,Ve.length),!Ve.errored&&!Ve.closeEmitted&&!Ve.endEmitted&&Ve.length===0){if(Ve.endEmitted=!0,qe.emit("end"),qe.writable&&qe.allowHalfOpen===!1)u.nextTick(wn,qe);else if(Ve.autoDestroy){const Sn=qe._writableState;(!Sn||Sn.autoDestroy&&(Sn.finished||Sn.writable===!1))&&qe.destroy()}}}function wn(Ve){Ve.writable&&!Ve.writableEnded&&!Ve.destroyed&&Ve.end()}ue.from=function(Ve,qe){return he(ue,Ve,qe)};let Tn;function Ln(){return Tn===void 0&&(Tn={}),Tn}ue.fromWeb=function(Ve,qe){return Ln().newStreamReadableFromReadableStream(Ve,qe)},ue.toWeb=function(Ve,qe){return Ln().newReadableStreamFromStreamReadable(Ve,qe)},ue.wrap=function(Ve,qe){var Sn,An;return new ue({objectMode:(Sn=(An=Ve.readableObjectMode)!==null&&An!==void 0?An:Ve.objectMode)!==null&&Sn!==void 0?Sn:!0,...qe,destroy(xn,Bn){D.destroyer(Ve,xn),Bn(xn)}}).wrap(Ve)}},{"../../ours/errors":126,"../../ours/primordials":127,"../../ours/util":128,"../validators":124,"./add-abort-signal":107,"./buffer_list":108,"./destroy":110,"./duplex":111,"./end-of-stream":113,"./from":114,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102,string_decoder:28}],120:[function(n,o,a){const{MathFloor:u,NumberIsInteger:c}=n("../../ours/primordials"),{ERR_INVALID_ARG_VALUE:d}=n("../../ours/errors").codes;function f(g,p,v){return g.highWaterMark!=null?g.highWaterMark:p?g[v]:null}function h(g){return g?16:16*1024}function y(g,p,v,_){const b=f(p,_,v);if(b!=null){if(!c(b)||b<0){const A=_?`options.${v}`:"options.highWaterMark";throw new d(A,b)}return u(b)}return h(g.objectMode)}o.exports={getHighWaterMark:y,getDefaultHighWaterMark:h}},{"../../ours/errors":126,"../../ours/primordials":127}],121:[function(n,o,a){const{ObjectSetPrototypeOf:u,Symbol:c}=n("../../ours/primordials");o.exports=g;const{ERR_METHOD_NOT_IMPLEMENTED:d}=n("../../ours/errors").codes,f=n("./duplex"),{getHighWaterMark:h}=n("./state");u(g.prototype,f.prototype),u(g,f);const y=c("kCallback");function g(_){if(!(this instanceof g))return new g(_);const b=_?h(this,_,"readableHighWaterMark",!0):null;b===0&&(_={..._,highWaterMark:null,readableHighWaterMark:b,writableHighWaterMark:_.writableHighWaterMark||0}),f.call(this,_),this._readableState.sync=!1,this[y]=null,_&&(typeof _.transform=="function"&&(this._transform=_.transform),typeof _.flush=="function"&&(this._flush=_.flush)),this.on("prefinish",v)}function p(_){typeof this._flush=="function"&&!this.destroyed?this._flush((b,A)=>{if(b){_?_(b):this.destroy(b);return}A!=null&&this.push(A),this.push(null),_&&_()}):(this.push(null),_&&_())}function v(){this._final!==p&&p.call(this)}g.prototype._final=p,g.prototype._transform=function(_,b,A){throw new d("_transform()")},g.prototype._write=function(_,b,A){const w=this._readableState,S=this._writableState,T=w.length;this._transform(_,b,(x,M)=>{if(x){A(x);return}M!=null&&this.push(M),S.ended||T===w.length||w.length<w.highWaterMark?A():this[y]=A})},g.prototype._read=function(){if(this[y]){const _=this[y];this[y]=null,_()}}},{"../../ours/errors":126,"../../ours/primordials":127,"./duplex":111,"./state":120}],122:[function(n,o,a){const{Symbol:u,SymbolAsyncIterator:c,SymbolIterator:d,SymbolFor:f}=n("../../ours/primordials"),h=u("kDestroyed"),y=u("kIsErrored"),g=u("kIsReadable"),p=u("kIsDisturbed"),v=f("nodejs.webstream.isClosedPromise"),_=f("nodejs.webstream.controllerErrorFunction");function b(ue,At=!1){var jt;return!!(ue&&typeof ue.pipe=="function"&&typeof ue.on=="function"&&(!At||typeof ue.pause=="function"&&typeof ue.resume=="function")&&(!ue._writableState||((jt=ue._readableState)===null||jt===void 0?void 0:jt.readable)!==!1)&&(!ue._writableState||ue._readableState))}function A(ue){var At;return!!(ue&&typeof ue.write=="function"&&typeof ue.on=="function"&&(!ue._readableState||((At=ue._writableState)===null||At===void 0?void 0:At.writable)!==!1))}function w(ue){return!!(ue&&typeof ue.pipe=="function"&&ue._readableState&&typeof ue.on=="function"&&typeof ue.write=="function")}function S(ue){return ue&&(ue._readableState||ue._writableState||typeof ue.write=="function"&&typeof ue.on=="function"||typeof ue.pipe=="function"&&typeof ue.on=="function")}function T(ue){return!!(ue&&!S(ue)&&typeof ue.pipeThrough=="function"&&typeof ue.getReader=="function"&&typeof ue.cancel=="function")}function x(ue){return!!(ue&&!S(ue)&&typeof ue.getWriter=="function"&&typeof ue.abort=="function")}function M(ue){return!!(ue&&!S(ue)&&typeof ue.readable=="object"&&typeof ue.writable=="object")}function L(ue){return T(ue)||x(ue)||M(ue)}function O(ue,At){return ue==null?!1:At===!0?typeof ue[c]=="function":At===!1?typeof ue[d]=="function":typeof ue[c]=="function"||typeof ue[d]=="function"}function re(ue){if(!S(ue))return null;const At=ue._writableState,jt=ue._readableState,hn=At||jt;return!!(ue.destroyed||ue[h]||hn!=null&&hn.destroyed)}function D(ue){if(!A(ue))return null;if(ue.writableEnded===!0)return!0;const At=ue._writableState;return At!=null&&At.errored?!1:typeof(At==null?void 0:At.ended)!="boolean"?null:At.ended}function z(ue,At){if(!A(ue))return null;if(ue.writableFinished===!0)return!0;const jt=ue._writableState;return jt!=null&&jt.errored?!1:typeof(jt==null?void 0:jt.finished)!="boolean"?null:!!(jt.finished||At===!1&&jt.ended===!0&&jt.length===0)}function V(ue){if(!b(ue))return null;if(ue.readableEnded===!0)return!0;const At=ue._readableState;return!At||At.errored?!1:typeof(At==null?void 0:At.ended)!="boolean"?null:At.ended}function j(ue,At){if(!b(ue))return null;const jt=ue._readableState;return jt!=null&&jt.errored?!1:typeof(jt==null?void 0:jt.endEmitted)!="boolean"?null:!!(jt.endEmitted||At===!1&&jt.ended===!0&&jt.length===0)}function F(ue){return ue&&ue[g]!=null?ue[g]:typeof(ue==null?void 0:ue.readable)!="boolean"?null:re(ue)?!1:b(ue)&&ue.readable&&!j(ue)}function Ce(ue){return typeof(ue==null?void 0:ue.writable)!="boolean"?null:re(ue)?!1:A(ue)&&ue.writable&&!D(ue)}function le(ue,At){return S(ue)?re(ue)?!0:!((At==null?void 0:At.readable)!==!1&&F(ue)||(At==null?void 0:At.writable)!==!1&&Ce(ue)):null}function pe(ue){var At,jt;return S(ue)?ue.writableErrored?ue.writableErrored:(At=(jt=ue._writableState)===null||jt===void 0?void 0:jt.errored)!==null&&At!==void 0?At:null:null}function $e(ue){var At,jt;return S(ue)?ue.readableErrored?ue.readableErrored:(At=(jt=ue._readableState)===null||jt===void 0?void 0:jt.errored)!==null&&At!==void 0?At:null:null}function Fe(ue){if(!S(ue))return null;if(typeof ue.closed=="boolean")return ue.closed;const At=ue._writableState,jt=ue._readableState;return typeof(At==null?void 0:At.closed)=="boolean"||typeof(jt==null?void 0:jt.closed)=="boolean"?(At==null?void 0:At.closed)||(jt==null?void 0:jt.closed):typeof ue._closed=="boolean"&&Oe(ue)?ue._closed:null}function Oe(ue){return typeof ue._closed=="boolean"&&typeof ue._defaultKeepAlive=="boolean"&&typeof ue._removedConnection=="boolean"&&typeof ue._removedContLen=="boolean"}function Et(ue){return typeof ue._sent100=="boolean"&&Oe(ue)}function he(ue){var At;return typeof ue._consuming=="boolean"&&typeof ue._dumped=="boolean"&&((At=ue.req)===null||At===void 0?void 0:At.upgradeOrConnect)===void 0}function In(ue){if(!S(ue))return null;const At=ue._writableState,jt=ue._readableState,hn=At||jt;return!hn&&Et(ue)||!!(hn&&hn.autoDestroy&&hn.emitClose&&hn.closed===!1)}function vn(ue){var At;return!!(ue&&((At=ue[p])!==null&&At!==void 0?At:ue.readableDidRead||ue.readableAborted))}function kt(ue){var At,jt,hn,Pt,Ie,de,ze,xe,Ne,Lt;return!!(ue&&((At=(jt=(hn=(Pt=(Ie=(de=ue[y])!==null&&de!==void 0?de:ue.readableErrored)!==null&&Ie!==void 0?Ie:ue.writableErrored)!==null&&Pt!==void 0?Pt:(ze=ue._readableState)===null||ze===void 0?void 0:ze.errorEmitted)!==null&&hn!==void 0?hn:(xe=ue._writableState)===null||xe===void 0?void 0:xe.errorEmitted)!==null&&jt!==void 0?jt:(Ne=ue._readableState)===null||Ne===void 0?void 0:Ne.errored)!==null&&At!==void 0?At:!((Lt=ue._writableState)===null||Lt===void 0)&&Lt.errored))}o.exports={kDestroyed:h,isDisturbed:vn,kIsDisturbed:p,isErrored:kt,kIsErrored:y,isReadable:F,kIsReadable:g,kIsClosedPromise:v,kControllerErrorFunction:_,isClosed:Fe,isDestroyed:re,isDuplexNodeStream:w,isFinished:le,isIterable:O,isReadableNodeStream:b,isReadableStream:T,isReadableEnded:V,isReadableFinished:j,isReadableErrored:$e,isNodeStream:S,isWebStream:L,isWritable:Ce,isWritableNodeStream:A,isWritableStream:x,isWritableEnded:D,isWritableFinished:z,isWritableErrored:pe,isServerRequest:he,isServerResponse:Et,willEmitClose:In,isTransformStream:M}},{"../../ours/primordials":127}],123:[function(n,o,a){const u=n("process/"),{ArrayPrototypeSlice:c,Error:d,FunctionPrototypeSymbolHasInstance:f,ObjectDefineProperty:h,ObjectDefineProperties:y,ObjectSetPrototypeOf:g,StringPrototypeToLowerCase:p,Symbol:v,SymbolHasInstance:_}=n("../../ours/primordials");o.exports=Et,Et.WritableState=Fe;const{EventEmitter:b}=n("events"),A=n("./legacy").Stream,{Buffer:w}=n("buffer"),S=n("./destroy"),{addAbortSignal:T}=n("./add-abort-signal"),{getHighWaterMark:x,getDefaultHighWaterMark:M}=n("./state"),{ERR_INVALID_ARG_TYPE:L,ERR_METHOD_NOT_IMPLEMENTED:O,ERR_MULTIPLE_CALLBACK:re,ERR_STREAM_CANNOT_PIPE:D,ERR_STREAM_DESTROYED:z,ERR_STREAM_ALREADY_FINISHED:V,ERR_STREAM_NULL_VALUES:j,ERR_STREAM_WRITE_AFTER_END:F,ERR_UNKNOWN_ENCODING:Ce}=n("../../ours/errors").codes,{errorOrDestroy:le}=S;g(Et.prototype,A.prototype),g(Et,A);function pe(){}const $e=v("kOnFinished");function Fe(ie,ae,Y){typeof Y!="boolean"&&(Y=ae instanceof n("./duplex")),this.objectMode=!!(ie&&ie.objectMode),Y&&(this.objectMode=this.objectMode||!!(ie&&ie.writableObjectMode)),this.highWaterMark=ie?x(this,ie,"writableHighWaterMark",Y):M(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const k=!!(ie&&ie.decodeStrings===!1);this.decodeStrings=!k,this.defaultEncoding=ie&&ie.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=ue.bind(void 0,ae),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Oe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!ie||ie.emitClose!==!1,this.autoDestroy=!ie||ie.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[$e]=[]}function Oe(ie){ie.buffered=[],ie.bufferedIndex=0,ie.allBuffers=!0,ie.allNoop=!0}Fe.prototype.getBuffer=function(){return c(this.buffered,this.bufferedIndex)},h(Fe.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Et(ie){const ae=this instanceof n("./duplex");if(!ae&&!f(Et,this))return new Et(ie);this._writableState=new Fe(ie,this,ae),ie&&(typeof ie.write=="function"&&(this._write=ie.write),typeof ie.writev=="function"&&(this._writev=ie.writev),typeof ie.destroy=="function"&&(this._destroy=ie.destroy),typeof ie.final=="function"&&(this._final=ie.final),typeof ie.construct=="function"&&(this._construct=ie.construct),ie.signal&&T(ie.signal,this)),A.call(this,ie),S.construct(this,()=>{const Y=this._writableState;Y.writing||Pt(this,Y),xe(this,Y)})}h(Et,_,{__proto__:null,value:function(ie){return f(this,ie)?!0:this!==Et?!1:ie&&ie._writableState instanceof Fe}}),Et.prototype.pipe=function(){le(this,new D)};function he(ie,ae,Y,k){const $=ie._writableState;if(typeof Y=="function")k=Y,Y=$.defaultEncoding;else{if(!Y)Y=$.defaultEncoding;else if(Y!=="buffer"&&!w.isEncoding(Y))throw new Ce(Y);typeof k!="function"&&(k=pe)}if(ae===null)throw new j;if(!$.objectMode)if(typeof ae=="string")$.decodeStrings!==!1&&(ae=w.from(ae,Y),Y="buffer");else if(ae instanceof w)Y="buffer";else if(A._isUint8Array(ae))ae=A._uint8ArrayToBuffer(ae),Y="buffer";else throw new L("chunk",["string","Buffer","Uint8Array"],ae);let oe;return $.ending?oe=new F:$.destroyed&&(oe=new z("write")),oe?(u.nextTick(k,oe),le(ie,oe,!0),oe):($.pendingcb++,In(ie,$,ae,Y,k))}Et.prototype.write=function(ie,ae,Y){return he(this,ie,ae,Y)===!0},Et.prototype.cork=function(){this._writableState.corked++},Et.prototype.uncork=function(){const ie=this._writableState;ie.corked&&(ie.corked--,ie.writing||Pt(this,ie))},Et.prototype.setDefaultEncoding=function(ae){if(typeof ae=="string"&&(ae=p(ae)),!w.isEncoding(ae))throw new Ce(ae);return this._writableState.defaultEncoding=ae,this};function In(ie,ae,Y,k,$){const oe=ae.objectMode?1:Y.length;ae.length+=oe;const _e=ae.length<ae.highWaterMark;return _e||(ae.needDrain=!0),ae.writing||ae.corked||ae.errored||!ae.constructed?(ae.buffered.push({chunk:Y,encoding:k,callback:$}),ae.allBuffers&&k!=="buffer"&&(ae.allBuffers=!1),ae.allNoop&&$!==pe&&(ae.allNoop=!1)):(ae.writelen=oe,ae.writecb=$,ae.writing=!0,ae.sync=!0,ie._write(Y,k,ae.onwrite),ae.sync=!1),_e&&!ae.errored&&!ae.destroyed}function vn(ie,ae,Y,k,$,oe,_e){ae.writelen=k,ae.writecb=_e,ae.writing=!0,ae.sync=!0,ae.destroyed?ae.onwrite(new z("write")):Y?ie._writev($,ae.onwrite):ie._write($,oe,ae.onwrite),ae.sync=!1}function kt(ie,ae,Y,k){--ae.pendingcb,k(Y),hn(ae),le(ie,Y)}function ue(ie,ae){const Y=ie._writableState,k=Y.sync,$=Y.writecb;if(typeof $!="function"){le(ie,new re);return}Y.writing=!1,Y.writecb=null,Y.length-=Y.writelen,Y.writelen=0,ae?(ae.stack,Y.errored||(Y.errored=ae),ie._readableState&&!ie._readableState.errored&&(ie._readableState.errored=ae),k?u.nextTick(kt,ie,Y,ae,$):kt(ie,Y,ae,$)):(Y.buffered.length>Y.bufferedIndex&&Pt(ie,Y),k?Y.afterWriteTickInfo!==null&&Y.afterWriteTickInfo.cb===$?Y.afterWriteTickInfo.count++:(Y.afterWriteTickInfo={count:1,cb:$,stream:ie,state:Y},u.nextTick(At,Y.afterWriteTickInfo)):jt(ie,Y,1,$))}function At({stream:ie,state:ae,count:Y,cb:k}){return ae.afterWriteTickInfo=null,jt(ie,ae,Y,k)}function jt(ie,ae,Y,k){for(!ae.ending&&!ie.destroyed&&ae.length===0&&ae.needDrain&&(ae.needDrain=!1,ie.emit("drain"));Y-- >0;)ae.pendingcb--,k();ae.destroyed&&hn(ae),xe(ie,ae)}function hn(ie){if(ie.writing)return;for(let $=ie.bufferedIndex;$<ie.buffered.length;++$){var ae;const{chunk:oe,callback:_e}=ie.buffered[$],Ue=ie.objectMode?1:oe.length;ie.length-=Ue,_e((ae=ie.errored)!==null&&ae!==void 0?ae:new z("write"))}const Y=ie[$e].splice(0);for(let $=0;$<Y.length;$++){var k;Y[$]((k=ie.errored)!==null&&k!==void 0?k:new z("end"))}Oe(ie)}function Pt(ie,ae){if(ae.corked||ae.bufferProcessing||ae.destroyed||!ae.constructed)return;const{buffered:Y,bufferedIndex:k,objectMode:$}=ae,oe=Y.length-k;if(!oe)return;let _e=k;if(ae.bufferProcessing=!0,oe>1&&ie._writev){ae.pendingcb-=oe-1;const Ue=ae.allNoop?pe:wn=>{for(let Tn=_e;Tn<Y.length;++Tn)Y[Tn].callback(wn)},_n=ae.allNoop&&_e===0?Y:c(Y,_e);_n.allBuffers=ae.allBuffers,vn(ie,ae,!0,ae.length,_n,"",Ue),Oe(ae)}else{do{const{chunk:Ue,encoding:_n,callback:wn}=Y[_e];Y[_e++]=null;const Tn=$?1:Ue.length;vn(ie,ae,!1,Tn,Ue,_n,wn)}while(_e<Y.length&&!ae.writing);_e===Y.length?Oe(ae):_e>256?(Y.splice(0,_e),ae.bufferedIndex=0):ae.bufferedIndex=_e}ae.bufferProcessing=!1}Et.prototype._write=function(ie,ae,Y){if(this._writev)this._writev([{chunk:ie,encoding:ae}],Y);else throw new O("_write()")},Et.prototype._writev=null,Et.prototype.end=function(ie,ae,Y){const k=this._writableState;typeof ie=="function"?(Y=ie,ie=null,ae=null):typeof ae=="function"&&(Y=ae,ae=null);let $;if(ie!=null){const oe=he(this,ie,ae);oe instanceof d&&($=oe)}return k.corked&&(k.corked=1,this.uncork()),$||(!k.errored&&!k.ending?(k.ending=!0,xe(this,k,!0),k.ended=!0):k.finished?$=new V("end"):k.destroyed&&($=new z("end"))),typeof Y=="function"&&($||k.finished?u.nextTick(Y,$):k[$e].push(Y)),this};function Ie(ie){return ie.ending&&!ie.destroyed&&ie.constructed&&ie.length===0&&!ie.errored&&ie.buffered.length===0&&!ie.finished&&!ie.writing&&!ie.errorEmitted&&!ie.closeEmitted}function de(ie,ae){let Y=!1;function k($){if(Y){le(ie,$??re());return}if(Y=!0,ae.pendingcb--,$){const oe=ae[$e].splice(0);for(let _e=0;_e<oe.length;_e++)oe[_e]($);le(ie,$,ae.sync)}else Ie(ae)&&(ae.prefinished=!0,ie.emit("prefinish"),ae.pendingcb++,u.nextTick(Ne,ie,ae))}ae.sync=!0,ae.pendingcb++;try{ie._final(k)}catch($){k($)}ae.sync=!1}function ze(ie,ae){!ae.prefinished&&!ae.finalCalled&&(typeof ie._final=="function"&&!ae.destroyed?(ae.finalCalled=!0,de(ie,ae)):(ae.prefinished=!0,ie.emit("prefinish")))}function xe(ie,ae,Y){Ie(ae)&&(ze(ie,ae),ae.pendingcb===0&&(Y?(ae.pendingcb++,u.nextTick((k,$)=>{Ie($)?Ne(k,$):$.pendingcb--},ie,ae)):Ie(ae)&&(ae.pendingcb++,Ne(ie,ae))))}function Ne(ie,ae){ae.pendingcb--,ae.finished=!0;const Y=ae[$e].splice(0);for(let k=0;k<Y.length;k++)Y[k]();if(ie.emit("finish"),ae.autoDestroy){const k=ie._readableState;(!k||k.autoDestroy&&(k.endEmitted||k.readable===!1))&&ie.destroy()}}y(Et.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(ie){this._writableState&&(this._writableState.destroyed=ie)}},writable:{__proto__:null,get(){const ie=this._writableState;return!!ie&&ie.writable!==!1&&!ie.destroyed&&!ie.errored&&!ie.ending&&!ie.ended},set(ie){this._writableState&&(this._writableState.writable=!!ie)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const ie=this._writableState;return ie?!ie.destroyed&&!ie.ending&&ie.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const Lt=S.destroy;Et.prototype.destroy=function(ie,ae){const Y=this._writableState;return!Y.destroyed&&(Y.bufferedIndex<Y.buffered.length||Y[$e].length)&&u.nextTick(hn,Y),Lt.call(this,ie,ae),this},Et.prototype._undestroy=S.undestroy,Et.prototype._destroy=function(ie,ae){ae(ie)},Et.prototype[b.captureRejectionSymbol]=function(ie){this.destroy(ie)};let Dt;function Cn(){return Dt===void 0&&(Dt={}),Dt}Et.fromWeb=function(ie,ae){return Cn().newStreamWritableFromWritableStream(ie,ae)},Et.toWeb=function(ie){return Cn().newWritableStreamFromStreamWritable(ie)}},{"../../ours/errors":126,"../../ours/primordials":127,"./add-abort-signal":107,"./destroy":110,"./duplex":111,"./legacy":115,"./state":120,buffer:29,events:49,"process/":102}],124:[function(n,o,a){const{ArrayIsArray:u,ArrayPrototypeIncludes:c,ArrayPrototypeJoin:d,ArrayPrototypeMap:f,NumberIsInteger:h,NumberIsNaN:y,NumberMAX_SAFE_INTEGER:g,NumberMIN_SAFE_INTEGER:p,NumberParseInt:v,ObjectPrototypeHasOwnProperty:_,RegExpPrototypeExec:b,String:A,StringPrototypeToUpperCase:w,StringPrototypeTrim:S}=n("../ours/primordials"),{hideStackFrames:T,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:M,ERR_INVALID_ARG_VALUE:L,ERR_OUT_OF_RANGE:O,ERR_UNKNOWN_SIGNAL:re}}=n("../ours/errors"),{normalizeEncoding:D}=n("../ours/util"),{isAsyncFunction:z,isArrayBufferView:V}=n("../ours/util").types,j={};function F(oe){return oe===(oe|0)}function Ce(oe){return oe===oe>>>0}const le=/^[0-7]+$/,pe="must be a 32-bit unsigned integer or an octal string";function $e(oe,_e,Ue){if(typeof oe>"u"&&(oe=Ue),typeof oe=="string"){if(b(le,oe)===null)throw new L(_e,oe,pe);oe=v(oe,8)}return Et(oe,_e),oe}const Fe=T((oe,_e,Ue=p,_n=g)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);if(oe<Ue||oe>_n)throw new O(_e,`>= ${Ue} && <= ${_n}`,oe)}),Oe=T((oe,_e,Ue=-2147483648,_n=2147483647)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);if(oe<Ue||oe>_n)throw new O(_e,`>= ${Ue} && <= ${_n}`,oe)}),Et=T((oe,_e,Ue=!1)=>{if(typeof oe!="number")throw new M(_e,"number",oe);if(!h(oe))throw new O(_e,"an integer",oe);const _n=Ue?1:0,wn=4294967295;if(oe<_n||oe>wn)throw new O(_e,`>= ${_n} && <= ${wn}`,oe)});function he(oe,_e){if(typeof oe!="string")throw new M(_e,"string",oe)}function In(oe,_e,Ue=void 0,_n){if(typeof oe!="number")throw new M(_e,"number",oe);if(Ue!=null&&oe<Ue||_n!=null&&oe>_n||(Ue!=null||_n!=null)&&y(oe))throw new O(_e,`${Ue!=null?`>= ${Ue}`:""}${Ue!=null&&_n!=null?" && ":""}${_n!=null?`<= ${_n}`:""}`,oe)}const vn=T((oe,_e,Ue)=>{if(!c(Ue,oe)){const wn="must be one of: "+d(f(Ue,Tn=>typeof Tn=="string"?`'${Tn}'`:A(Tn)),", ");throw new L(_e,oe,wn)}});function kt(oe,_e){if(typeof oe!="boolean")throw new M(_e,"boolean",oe)}function ue(oe,_e,Ue){return oe==null||!_(oe,_e)?Ue:oe[_e]}const At=T((oe,_e,Ue=null)=>{const _n=ue(Ue,"allowArray",!1),wn=ue(Ue,"allowFunction",!1);if(!ue(Ue,"nullable",!1)&&oe===null||!_n&&u(oe)||typeof oe!="object"&&(!wn||typeof oe!="function"))throw new M(_e,"Object",oe)}),jt=T((oe,_e)=>{if(oe!=null&&typeof oe!="object"&&typeof oe!="function")throw new M(_e,"a dictionary",oe)}),hn=T((oe,_e,Ue=0)=>{if(!u(oe))throw new M(_e,"Array",oe);if(oe.length<Ue){const _n=`must be longer than ${Ue}`;throw new L(_e,oe,_n)}});function Pt(oe,_e){hn(oe,_e);for(let Ue=0;Ue<oe.length;Ue++)he(oe[Ue],`${_e}[${Ue}]`)}function Ie(oe,_e){hn(oe,_e);for(let Ue=0;Ue<oe.length;Ue++)kt(oe[Ue],`${_e}[${Ue}]`)}function de(oe,_e="signal"){if(he(oe,_e),j[oe]===void 0)throw j[w(oe)]!==void 0?new re(oe+" (signals must use all capital letters)"):new re(oe)}const ze=T((oe,_e="buffer")=>{if(!V(oe))throw new M(_e,["Buffer","TypedArray","DataView"],oe)});function xe(oe,_e){const Ue=D(_e),_n=oe.length;if(Ue==="hex"&&_n%2!==0)throw new L("encoding",_e,`is invalid for data of length ${_n}`)}function Ne(oe,_e="Port",Ue=!0){if(typeof oe!="number"&&typeof oe!="string"||typeof oe=="string"&&S(oe).length===0||+oe!==+oe>>>0||oe>65535||oe===0&&!Ue)throw new x(_e,oe,Ue);return oe|0}const Lt=T((oe,_e)=>{if(oe!==void 0&&(oe===null||typeof oe!="object"||!("aborted"in oe)))throw new M(_e,"AbortSignal",oe)}),Dt=T((oe,_e)=>{if(typeof oe!="function")throw new M(_e,"Function",oe)}),Cn=T((oe,_e)=>{if(typeof oe!="function"||z(oe))throw new M(_e,"Function",oe)}),ie=T((oe,_e)=>{if(oe!==void 0)throw new M(_e,"undefined",oe)});function ae(oe,_e,Ue){if(!c(Ue,oe))throw new M(_e,`('${d(Ue,"|")}')`,oe)}const Y=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function k(oe,_e){if(typeof oe>"u"||!b(Y,oe))throw new L(_e,oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function $(oe){if(typeof oe=="string")return k(oe,"hints"),oe;if(u(oe)){const _e=oe.length;let Ue="";if(_e===0)return Ue;for(let _n=0;_n<_e;_n++){const wn=oe[_n];k(wn,"hints"),Ue+=wn,_n!==_e-1&&(Ue+=", ")}return Ue}throw new L("hints",oe,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}o.exports={isInt32:F,isUint32:Ce,parseFileMode:$e,validateArray:hn,validateStringArray:Pt,validateBooleanArray:Ie,validateBoolean:kt,validateBuffer:ze,validateDictionary:jt,validateEncoding:xe,validateFunction:Dt,validateInt32:Oe,validateInteger:Fe,validateNumber:In,validateObject:At,validateOneOf:vn,validatePlainFunction:Cn,validatePort:Ne,validateSignalName:de,validateString:he,validateUint32:Et,validateUndefined:ie,validateUnion:ae,validateAbortSignal:Lt,validateLinkHeaderValue:$}},{"../ours/errors":126,"../ours/primordials":127,"../ours/util":128}],125:[function(n,o,a){const u=n("../stream"),c=n("../stream/promises"),d=u.Readable.destroy;o.exports=u.Readable,o.exports._uint8ArrayToBuffer=u._uint8ArrayToBuffer,o.exports._isUint8Array=u._isUint8Array,o.exports.isDisturbed=u.isDisturbed,o.exports.isErrored=u.isErrored,o.exports.isReadable=u.isReadable,o.exports.Readable=u.Readable,o.exports.Writable=u.Writable,o.exports.Duplex=u.Duplex,o.exports.Transform=u.Transform,o.exports.PassThrough=u.PassThrough,o.exports.addAbortSignal=u.addAbortSignal,o.exports.finished=u.finished,o.exports.destroy=u.destroy,o.exports.destroy=d,o.exports.pipeline=u.pipeline,o.exports.compose=u.compose,Object.defineProperty(u,"promises",{configurable:!0,enumerable:!0,get(){return c}}),o.exports.Stream=u.Stream,o.exports.default=o.exports},{"../stream":129,"../stream/promises":130}],126:[function(n,o,a){const{format:u,inspect:c,AggregateError:d}=n("./util"),f=globalThis.AggregateError||d,h=Symbol("kIsNodeError"),y=["string","function","number","object","Function","Object","boolean","bigint","symbol"],g=/^([A-Z][a-z0-9]*)+$/,p="__node_internal_",v={};function _(M,L){if(!M)throw new v.ERR_INTERNAL_ASSERTION(L)}function b(M){let L="",O=M.length;const re=M[0]==="-"?1:0;for(;O>=re+4;O-=3)L=`_${M.slice(O-3,O)}${L}`;return`${M.slice(0,O)}${L}`}function A(M,L,O){if(typeof L=="function")return _(L.length<=O.length,`Code: ${M}; The provided arguments length (${O.length}) does not match the required ones (${L.length}).`),L(...O);const re=(L.match(/%[dfijoOs]/g)||[]).length;return _(re===O.length,`Code: ${M}; The provided arguments length (${O.length}) does not match the required ones (${re}).`),O.length===0?L:u(L,...O)}function w(M,L,O){O||(O=Error);class re extends O{constructor(...z){super(A(M,L,z))}toString(){return`${this.name} [${M}]: ${this.message}`}}Object.defineProperties(re.prototype,{name:{value:O.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${M}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),re.prototype.code=M,re.prototype[h]=!0,v[M]=re}function S(M){const L=p+M.name;return Object.defineProperty(M,"name",{value:L}),M}function T(M,L){if(M&&L&&M!==L){if(Array.isArray(L.errors))return L.errors.push(M),L;const O=new f([L,M],L.message);return O.code=L.code,O}return M||L}class x extends Error{constructor(L="The operation was aborted",O=void 0){if(O!==void 0&&typeof O!="object")throw new v.ERR_INVALID_ARG_TYPE("options","Object",O);super(L,O),this.code="ABORT_ERR",this.name="AbortError"}}w("ERR_ASSERTION","%s",Error),w("ERR_INVALID_ARG_TYPE",(M,L,O)=>{_(typeof M=="string","'name' must be a string"),Array.isArray(L)||(L=[L]);let re="The ";M.endsWith(" argument")?re+=`${M} `:re+=`"${M}" ${M.includes(".")?"property":"argument"} `,re+="must be ";const D=[],z=[],V=[];for(const F of L)_(typeof F=="string","All expected entries have to be of type string"),y.includes(F)?D.push(F.toLowerCase()):g.test(F)?z.push(F):(_(F!=="object",'The value "object" should be written as "Object"'),V.push(F));if(z.length>0){const F=D.indexOf("object");F!==-1&&(D.splice(D,F,1),z.push("Object"))}if(D.length>0){switch(D.length){case 1:re+=`of type ${D[0]}`;break;case 2:re+=`one of type ${D[0]} or ${D[1]}`;break;default:{const F=D.pop();re+=`one of type ${D.join(", ")}, or ${F}`}}(z.length>0||V.length>0)&&(re+=" or ")}if(z.length>0){switch(z.length){case 1:re+=`an instance of ${z[0]}`;break;case 2:re+=`an instance of ${z[0]} or ${z[1]}`;break;default:{const F=z.pop();re+=`an instance of ${z.join(", ")}, or ${F}`}}V.length>0&&(re+=" or ")}switch(V.length){case 0:break;case 1:V[0].toLowerCase()!==V[0]&&(re+="an "),re+=`${V[0]}`;break;case 2:re+=`one of ${V[0]} or ${V[1]}`;break;default:{const F=V.pop();re+=`one of ${V.join(", ")}, or ${F}`}}if(O==null)re+=`. Received ${O}`;else if(typeof O=="function"&&O.name)re+=`. Received function ${O.name}`;else if(typeof O=="object"){var j;if((j=O.constructor)!==null&&j!==void 0&&j.name)re+=`. Received an instance of ${O.constructor.name}`;else{const F=c(O,{depth:-1});re+=`. Received ${F}`}}else{let F=c(O,{colors:!1});F.length>25&&(F=`${F.slice(0,25)}...`),re+=`. Received type ${typeof O} (${F})`}return re},TypeError),w("ERR_INVALID_ARG_VALUE",(M,L,O="is invalid")=>{let re=c(L);return re.length>128&&(re=re.slice(0,128)+"..."),`The ${M.includes(".")?"property":"argument"} '${M}' ${O}. Received ${re}`},TypeError),w("ERR_INVALID_RETURN_VALUE",(M,L,O)=>{var re;const D=O!=null&&(re=O.constructor)!==null&&re!==void 0&&re.name?`instance of ${O.constructor.name}`:`type ${typeof O}`;return`Expected ${M} to be returned from the "${L}" function but got ${D}.`},TypeError),w("ERR_MISSING_ARGS",(...M)=>{_(M.length>0,"At least one arg needs to be specified");let L;const O=M.length;switch(M=(Array.isArray(M)?M:[M]).map(re=>`"${re}"`).join(" or "),O){case 1:L+=`The ${M[0]} argument`;break;case 2:L+=`The ${M[0]} and ${M[1]} arguments`;break;default:{const re=M.pop();L+=`The ${M.join(", ")}, and ${re} arguments`}break}return`${L} must be specified`},TypeError),w("ERR_OUT_OF_RANGE",(M,L,O)=>{_(L,'Missing "range" argument');let re;return Number.isInteger(O)&&Math.abs(O)>2**32?re=b(String(O)):typeof O=="bigint"?(re=String(O),(O>2n**32n||O<-(2n**32n))&&(re=b(re)),re+="n"):re=c(O),`The value of "${M}" is out of range. It must be ${L}. Received ${re}`},RangeError),w("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),w("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),w("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),w("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),w("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),w("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),w("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),w("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),w("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),w("ERR_STREAM_WRITE_AFTER_END","write after end",Error),w("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),o.exports={AbortError:x,aggregateTwoErrors:S(T),hideStackFrames:S,codes:v}},{"./util":128}],127:[function(n,o,a){o.exports={ArrayIsArray(u){return Array.isArray(u)},ArrayPrototypeIncludes(u,c){return u.includes(c)},ArrayPrototypeIndexOf(u,c){return u.indexOf(c)},ArrayPrototypeJoin(u,c){return u.join(c)},ArrayPrototypeMap(u,c){return u.map(c)},ArrayPrototypePop(u,c){return u.pop(c)},ArrayPrototypePush(u,c){return u.push(c)},ArrayPrototypeSlice(u,c,d){return u.slice(c,d)},Error,FunctionPrototypeCall(u,c,...d){return u.call(c,...d)},FunctionPrototypeSymbolHasInstance(u,c){return Function.prototype[Symbol.hasInstance].call(u,c)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(u,c){return Object.defineProperties(u,c)},ObjectDefineProperty(u,c,d){return Object.defineProperty(u,c,d)},ObjectGetOwnPropertyDescriptor(u,c){return Object.getOwnPropertyDescriptor(u,c)},ObjectKeys(u){return Object.keys(u)},ObjectSetPrototypeOf(u,c){return Object.setPrototypeOf(u,c)},Promise,PromisePrototypeCatch(u,c){return u.catch(c)},PromisePrototypeThen(u,c,d){return u.then(c,d)},PromiseReject(u){return Promise.reject(u)},ReflectApply:Reflect.apply,RegExpPrototypeTest(u,c){return u.test(c)},SafeSet:Set,String,StringPrototypeSlice(u,c,d){return u.slice(c,d)},StringPrototypeToLowerCase(u){return u.toLowerCase()},StringPrototypeToUpperCase(u){return u.toUpperCase()},StringPrototypeTrim(u){return u.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,TypedArrayPrototypeSet(u,c,d){return u.set(c,d)},Uint8Array}},{}],128:[function(n,o,a){const u=n("buffer"),c=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||u.Blob,f=typeof d<"u"?function(g){return g instanceof d}:function(g){return!1};class h extends Error{constructor(g){if(!Array.isArray(g))throw new TypeError(`Expected input to be an Array, got ${typeof g}`);let p="";for(let v=0;v<g.length;v++)p+=` ${g[v].stack}
273
273
  `;super(p),this.name="AggregateError",this.errors=g}}o.exports={AggregateError:h,kEmptyObject:Object.freeze({}),once(y){let g=!1;return function(...p){g||(g=!0,y.apply(this,p))}},createDeferredPromise:function(){let y,g;return{promise:new Promise((v,_)=>{y=v,g=_}),resolve:y,reject:g}},promisify(y){return new Promise((g,p)=>{y((v,..._)=>v?p(v):g(..._))})},debuglog(){return function(){}},format(y,...g){return y.replace(/%([sdifj])/g,function(...[p,v]){const _=g.shift();return v==="f"?_.toFixed(6):v==="j"?JSON.stringify(_):v==="s"&&typeof _=="object"?`${_.constructor!==Object?_.constructor.name:""} {}`.trim():_.toString()})},inspect(y){switch(typeof y){case"string":if(y.includes("'"))if(y.includes('"')){if(!y.includes("`")&&!y.includes("${"))return`\`${y}\``}else return`"${y}"`;return`'${y}'`;case"number":return isNaN(y)?"NaN":Object.is(y,-0)?String(y):y;case"bigint":return`${String(y)}n`;case"boolean":case"undefined":return String(y);case"object":return"{}"}},types:{isAsyncFunction(y){return y instanceof c},isArrayBufferView(y){return ArrayBuffer.isView(y)}},isBlob:f},o.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},{buffer:29}],129:[function(n,o,a){const{Buffer:u}=n("buffer"),{ObjectDefineProperty:c,ObjectKeys:d,ReflectApply:f}=n("./ours/primordials"),{promisify:{custom:h}}=n("./ours/util"),{streamReturningOperators:y,promiseReturningOperators:g}=n("./internal/streams/operators"),{codes:{ERR_ILLEGAL_CONSTRUCTOR:p}}=n("./ours/errors"),v=n("./internal/streams/compose"),{pipeline:_}=n("./internal/streams/pipeline"),{destroyer:b}=n("./internal/streams/destroy"),A=n("./internal/streams/end-of-stream"),w=n("./stream/promises"),S=n("./internal/streams/utils"),T=o.exports=n("./internal/streams/legacy").Stream;T.isDisturbed=S.isDisturbed,T.isErrored=S.isErrored,T.isReadable=S.isReadable,T.Readable=n("./internal/streams/readable");for(const M of d(y)){let O=function(...re){if(new.target)throw p();return T.Readable.from(f(L,this,re))};const L=y[M];c(O,"name",{__proto__:null,value:L.name}),c(O,"length",{__proto__:null,value:L.length}),c(T.Readable.prototype,M,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}for(const M of d(g)){let O=function(...re){if(new.target)throw p();return f(L,this,re)};const L=g[M];c(O,"name",{__proto__:null,value:L.name}),c(O,"length",{__proto__:null,value:L.length}),c(T.Readable.prototype,M,{__proto__:null,value:O,enumerable:!1,configurable:!0,writable:!0})}T.Writable=n("./internal/streams/writable"),T.Duplex=n("./internal/streams/duplex"),T.Transform=n("./internal/streams/transform"),T.PassThrough=n("./internal/streams/passthrough"),T.pipeline=_;const{addAbortSignal:x}=n("./internal/streams/add-abort-signal");T.addAbortSignal=x,T.finished=A,T.destroy=b,T.compose=v,c(T,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),c(_,h,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),c(A,h,{__proto__:null,enumerable:!0,get(){return w.finished}}),T.Stream=T,T._isUint8Array=function(L){return L instanceof Uint8Array},T._uint8ArrayToBuffer=function(L){return u.from(L.buffer,L.byteOffset,L.byteLength)}},{"./internal/streams/add-abort-signal":107,"./internal/streams/compose":109,"./internal/streams/destroy":110,"./internal/streams/duplex":111,"./internal/streams/end-of-stream":113,"./internal/streams/legacy":115,"./internal/streams/operators":116,"./internal/streams/passthrough":117,"./internal/streams/pipeline":118,"./internal/streams/readable":119,"./internal/streams/transform":121,"./internal/streams/utils":122,"./internal/streams/writable":123,"./ours/errors":126,"./ours/primordials":127,"./ours/util":128,"./stream/promises":130,buffer:29}],130:[function(n,o,a){const{ArrayPrototypePop:u,Promise:c}=n("../ours/primordials"),{isIterable:d,isNodeStream:f,isWebStream:h}=n("../internal/streams/utils"),{pipelineImpl:y}=n("../internal/streams/pipeline"),{finished:g}=n("../internal/streams/end-of-stream");n("../../lib/stream.js");function p(...v){return new c((_,b)=>{let A,w;const S=v[v.length-1];if(S&&typeof S=="object"&&!f(S)&&!d(S)&&!h(S)){const T=u(v);A=T.signal,w=T.end}y(v,(T,x)=>{T?b(T):_(x)},{signal:A,end:w})})}o.exports={finished:g,pipeline:p}},{"../../lib/stream.js":129,"../internal/streams/end-of-stream":113,"../internal/streams/pipeline":118,"../internal/streams/utils":122,"../ours/primordials":127}],131:[function(n,o,a){function u(d,f,h){var y=this;this._callback=d,this._args=h,this._interval=setInterval(d,f,this._args),this.reschedule=function(g){g||(g=y._interval),y._interval&&clearInterval(y._interval),y._interval=setInterval(y._callback,g,y._args)},this.clear=function(){y._interval&&(clearInterval(y._interval),y._interval=void 0)},this.destroy=function(){y._interval&&clearInterval(y._interval),y._callback=void 0,y._interval=void 0,y._args=void 0}}function c(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var d;if(arguments.length>0){d=new Array(arguments.length-2);for(var f=0;f<d.length;f++)d[f]=arguments[f+2]}return new u(arguments[0],arguments[1],d)}o.exports=c},{}],132:[function(n,o,a){o.exports=n("./index.js")()},{"./index.js":133}],133:[function(n,o,a){(function(u){(function(){o.exports=d;function c(h){return h instanceof u?u.from(h):new h.constructor(h.buffer.slice(),h.byteOffset,h.length)}function d(h){if(h=h||{},h.circles)return f(h);return h.proto?p:g;function y(v,_){for(var b=Object.keys(v),A=new Array(b.length),w=0;w<b.length;w++){var S=b[w],T=v[S];typeof T!="object"||T===null?A[S]=T:T instanceof Date?A[S]=new Date(T):ArrayBuffer.isView(T)?A[S]=c(T):A[S]=_(T)}return A}function g(v){if(typeof v!="object"||v===null)return v;if(v instanceof Date)return new Date(v);if(Array.isArray(v))return y(v,g);if(v instanceof Map)return new Map(y(Array.from(v),g));if(v instanceof Set)return new Set(y(Array.from(v),g));var _={};for(var b in v)if(Object.hasOwnProperty.call(v,b)!==!1){var A=v[b];typeof A!="object"||A===null?_[b]=A:A instanceof Date?_[b]=new Date(A):A instanceof Map?_[b]=new Map(y(Array.from(A),g)):A instanceof Set?_[b]=new Set(y(Array.from(A),g)):ArrayBuffer.isView(A)?_[b]=c(A):_[b]=g(A)}return _}function p(v){if(typeof v!="object"||v===null)return v;if(v instanceof Date)return new Date(v);if(Array.isArray(v))return y(v,p);if(v instanceof Map)return new Map(y(Array.from(v),p));if(v instanceof Set)return new Set(y(Array.from(v),p));var _={};for(var b in v){var A=v[b];typeof A!="object"||A===null?_[b]=A:A instanceof Date?_[b]=new Date(A):A instanceof Map?_[b]=new Map(y(Array.from(A),p)):A instanceof Set?_[b]=new Set(y(Array.from(A),p)):ArrayBuffer.isView(A)?_[b]=c(A):_[b]=p(A)}return _}}function f(h){var y=[],g=[];return h.proto?_:v;function p(b,A){for(var w=Object.keys(b),S=new Array(w.length),T=0;T<w.length;T++){var x=w[T],M=b[x];if(typeof M!="object"||M===null)S[x]=M;else if(M instanceof Date)S[x]=new Date(M);else if(ArrayBuffer.isView(M))S[x]=c(M);else{var L=y.indexOf(M);L!==-1?S[x]=g[L]:S[x]=A(M)}}return S}function v(b){if(typeof b!="object"||b===null)return b;if(b instanceof Date)return new Date(b);if(Array.isArray(b))return p(b,v);if(b instanceof Map)return new Map(p(Array.from(b),v));if(b instanceof Set)return new Set(p(Array.from(b),v));var A={};y.push(b),g.push(A);for(var w in b)if(Object.hasOwnProperty.call(b,w)!==!1){var S=b[w];if(typeof S!="object"||S===null)A[w]=S;else if(S instanceof Date)A[w]=new Date(S);else if(S instanceof Map)A[w]=new Map(p(Array.from(S),v));else if(S instanceof Set)A[w]=new Set(p(Array.from(S),v));else if(ArrayBuffer.isView(S))A[w]=c(S);else{var T=y.indexOf(S);T!==-1?A[w]=g[T]:A[w]=v(S)}}return y.pop(),g.pop(),A}function _(b){if(typeof b!="object"||b===null)return b;if(b instanceof Date)return new Date(b);if(Array.isArray(b))return p(b,_);if(b instanceof Map)return new Map(p(Array.from(b),_));if(b instanceof Set)return new Set(p(Array.from(b),_));var A={};y.push(b),g.push(A);for(var w in b){var S=b[w];if(typeof S!="object"||S===null)A[w]=S;else if(S instanceof Date)A[w]=new Date(S);else if(S instanceof Map)A[w]=new Map(p(Array.from(S),_));else if(S instanceof Set)A[w]=new Set(p(Array.from(S),_));else if(ArrayBuffer.isView(S))A[w]=c(S);else{var T=y.indexOf(S);T!==-1?A[w]=g[T]:A[w]=_(S)}}return y.pop(),g.pop(),A}}}).call(this)}).call(this,n("buffer").Buffer)},{buffer:29}],134:[function(n,o,a){/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var u=n("buffer"),c=u.Buffer;function d(h,y){for(var g in h)y[g]=h[g]}c.from&&c.alloc&&c.allocUnsafe&&c.allocUnsafeSlow?o.exports=u:(d(u,a),a.Buffer=f);function f(h,y,g){return c(h,y,g)}f.prototype=Object.create(c.prototype),d(c,f),f.from=function(h,y,g){if(typeof h=="number")throw new TypeError("Argument must not be a number");return c(h,y,g)},f.alloc=function(h,y,g){if(typeof h!="number")throw new TypeError("Argument must be a number");var p=c(h);return y!==void 0?typeof g=="string"?p.fill(y,g):p.fill(y):p.fill(0),p},f.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return c(h)},f.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}},{buffer:29}],135:[function(n,o,a){o.exports=u;function u(d){var f=d._readableState;return f?f.objectMode||typeof d._duplexState=="number"?d.read():d.read(c(f)):null}function c(d){return d.buffer.length?d.buffer.head?d.buffer.head.data.length:d.buffer[0].length:d.length}},{}],136:[function(n,o,a){arguments[4][28][0].apply(a,arguments)},{dup:28,"safe-buffer":134}],137:[function(n,o,a){var u=n("punycode"),c=n("./util");a.parse=O,a.resolve=D,a.resolveObject=z,a.format=re,a.Url=d;function d(){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 f=/^([a-z0-9.+-]+:)/i,h=/:[0-9]*$/,y=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,g=["<",">",'"',"`"," ","\r",`
274
274
  `," "],p=["{","}","|","\\","^","`"].concat(g),v=["'"].concat(p),_=["%","/","?",";","#"].concat(v),b=["/","?","#"],A=255,w=/^[+a-z0-9A-Z_-]{0,63}$/,S=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,T={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},L=n("querystring");function O(V,j,F){if(V&&c.isObject(V)&&V instanceof d)return V;var Ce=new d;return Ce.parse(V,j,F),Ce}d.prototype.parse=function(V,j,F){if(!c.isString(V))throw new TypeError("Parameter 'url' must be a string, not "+typeof V);var Ce=V.indexOf("?"),le=Ce!==-1&&Ce<V.indexOf("#")?"?":"#",pe=V.split(le),$e=/\\/g;pe[0]=pe[0].replace($e,"/"),V=pe.join(le);var Fe=V;if(Fe=Fe.trim(),!F&&V.split("#").length===1){var Oe=y.exec(Fe);if(Oe)return this.path=Fe,this.href=Fe,this.pathname=Oe[1],Oe[2]?(this.search=Oe[2],j?this.query=L.parse(this.search.substr(1)):this.query=this.search.substr(1)):j&&(this.search="",this.query={}),this}var Et=f.exec(Fe);if(Et){Et=Et[0];var he=Et.toLowerCase();this.protocol=he,Fe=Fe.substr(Et.length)}if(F||Et||Fe.match(/^\/\/[^@\/]+@[^@\/]+/)){var In=Fe.substr(0,2)==="//";In&&!(Et&&x[Et])&&(Fe=Fe.substr(2),this.slashes=!0)}if(!x[Et]&&(In||Et&&!M[Et])){for(var vn=-1,kt=0;kt<b.length;kt++){var ue=Fe.indexOf(b[kt]);ue!==-1&&(vn===-1||ue<vn)&&(vn=ue)}var At,jt;vn===-1?jt=Fe.lastIndexOf("@"):jt=Fe.lastIndexOf("@",vn),jt!==-1&&(At=Fe.slice(0,jt),Fe=Fe.slice(jt+1),this.auth=decodeURIComponent(At)),vn=-1;for(var kt=0;kt<_.length;kt++){var ue=Fe.indexOf(_[kt]);ue!==-1&&(vn===-1||ue<vn)&&(vn=ue)}vn===-1&&(vn=Fe.length),this.host=Fe.slice(0,vn),Fe=Fe.slice(vn),this.parseHost(),this.hostname=this.hostname||"";var hn=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!hn)for(var Pt=this.hostname.split(/\./),kt=0,Ie=Pt.length;kt<Ie;kt++){var de=Pt[kt];if(de&&!de.match(w)){for(var ze="",xe=0,Ne=de.length;xe<Ne;xe++)de.charCodeAt(xe)>127?ze+="x":ze+=de[xe];if(!ze.match(w)){var Lt=Pt.slice(0,kt),Dt=Pt.slice(kt+1),Cn=de.match(S);Cn&&(Lt.push(Cn[1]),Dt.unshift(Cn[2])),Dt.length&&(Fe="/"+Dt.join(".")+Fe),this.hostname=Lt.join(".");break}}}this.hostname.length>A?this.hostname="":this.hostname=this.hostname.toLowerCase(),hn||(this.hostname=u.toASCII(this.hostname));var ie=this.port?":"+this.port:"",ae=this.hostname||"";this.host=ae+ie,this.href+=this.host,hn&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),Fe[0]!=="/"&&(Fe="/"+Fe))}if(!T[he])for(var kt=0,Ie=v.length;kt<Ie;kt++){var Y=v[kt];if(Fe.indexOf(Y)!==-1){var k=encodeURIComponent(Y);k===Y&&(k=escape(Y)),Fe=Fe.split(Y).join(k)}}var $=Fe.indexOf("#");$!==-1&&(this.hash=Fe.substr($),Fe=Fe.slice(0,$));var oe=Fe.indexOf("?");if(oe!==-1?(this.search=Fe.substr(oe),this.query=Fe.substr(oe+1),j&&(this.query=L.parse(this.query)),Fe=Fe.slice(0,oe)):j&&(this.search="",this.query={}),Fe&&(this.pathname=Fe),M[he]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ie=this.pathname||"",_e=this.search||"";this.path=ie+_e}return this.href=this.format(),this};function re(V){return c.isString(V)&&(V=O(V)),V instanceof d?V.format():d.prototype.format.call(V)}d.prototype.format=function(){var V=this.auth||"";V&&(V=encodeURIComponent(V),V=V.replace(/%3A/i,":"),V+="@");var j=this.protocol||"",F=this.pathname||"",Ce=this.hash||"",le=!1,pe="";this.host?le=V+this.host:this.hostname&&(le=V+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(le+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(pe=L.stringify(this.query));var $e=this.search||pe&&"?"+pe||"";return j&&j.substr(-1)!==":"&&(j+=":"),this.slashes||(!j||M[j])&&le!==!1?(le="//"+(le||""),F&&F.charAt(0)!=="/"&&(F="/"+F)):le||(le=""),Ce&&Ce.charAt(0)!=="#"&&(Ce="#"+Ce),$e&&$e.charAt(0)!=="?"&&($e="?"+$e),F=F.replace(/[?#]/g,function(Fe){return encodeURIComponent(Fe)}),$e=$e.replace("#","%23"),j+le+F+$e+Ce};function D(V,j){return O(V,!1,!0).resolve(j)}d.prototype.resolve=function(V){return this.resolveObject(O(V,!1,!0)).format()};function z(V,j){return V?O(V,!1,!0).resolveObject(j):j}d.prototype.resolveObject=function(V){if(c.isString(V)){var j=new d;j.parse(V,!1,!0),V=j}for(var F=new d,Ce=Object.keys(this),le=0;le<Ce.length;le++){var pe=Ce[le];F[pe]=this[pe]}if(F.hash=V.hash,V.href==="")return F.href=F.format(),F;if(V.slashes&&!V.protocol){for(var $e=Object.keys(V),Fe=0;Fe<$e.length;Fe++){var Oe=$e[Fe];Oe!=="protocol"&&(F[Oe]=V[Oe])}return M[F.protocol]&&F.hostname&&!F.pathname&&(F.path=F.pathname="/"),F.href=F.format(),F}if(V.protocol&&V.protocol!==F.protocol){if(!M[V.protocol]){for(var Et=Object.keys(V),he=0;he<Et.length;he++){var In=Et[he];F[In]=V[In]}return F.href=F.format(),F}if(F.protocol=V.protocol,!V.host&&!x[V.protocol]){for(var Ie=(V.pathname||"").split("/");Ie.length&&!(V.host=Ie.shift()););V.host||(V.host=""),V.hostname||(V.hostname=""),Ie[0]!==""&&Ie.unshift(""),Ie.length<2&&Ie.unshift(""),F.pathname=Ie.join("/")}else F.pathname=V.pathname;if(F.search=V.search,F.query=V.query,F.host=V.host||"",F.auth=V.auth,F.hostname=V.hostname||V.host,F.port=V.port,F.pathname||F.search){var vn=F.pathname||"",kt=F.search||"";F.path=vn+kt}return F.slashes=F.slashes||V.slashes,F.href=F.format(),F}var ue=F.pathname&&F.pathname.charAt(0)==="/",At=V.host||V.pathname&&V.pathname.charAt(0)==="/",jt=At||ue||F.host&&V.pathname,hn=jt,Pt=F.pathname&&F.pathname.split("/")||[],Ie=V.pathname&&V.pathname.split("/")||[],de=F.protocol&&!M[F.protocol];if(de&&(F.hostname="",F.port=null,F.host&&(Pt[0]===""?Pt[0]=F.host:Pt.unshift(F.host)),F.host="",V.protocol&&(V.hostname=null,V.port=null,V.host&&(Ie[0]===""?Ie[0]=V.host:Ie.unshift(V.host)),V.host=null),jt=jt&&(Ie[0]===""||Pt[0]==="")),At)F.host=V.host||V.host===""?V.host:F.host,F.hostname=V.hostname||V.hostname===""?V.hostname:F.hostname,F.search=V.search,F.query=V.query,Pt=Ie;else if(Ie.length)Pt||(Pt=[]),Pt.pop(),Pt=Pt.concat(Ie),F.search=V.search,F.query=V.query;else if(!c.isNullOrUndefined(V.search)){if(de){F.hostname=F.host=Pt.shift();var ze=F.host&&F.host.indexOf("@")>0?F.host.split("@"):!1;ze&&(F.auth=ze.shift(),F.host=F.hostname=ze.shift())}return F.search=V.search,F.query=V.query,(!c.isNull(F.pathname)||!c.isNull(F.search))&&(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.href=F.format(),F}if(!Pt.length)return F.pathname=null,F.search?F.path="/"+F.search:F.path=null,F.href=F.format(),F;for(var xe=Pt.slice(-1)[0],Ne=(F.host||V.host||Pt.length>1)&&(xe==="."||xe==="..")||xe==="",Lt=0,Dt=Pt.length;Dt>=0;Dt--)xe=Pt[Dt],xe==="."?Pt.splice(Dt,1):xe===".."?(Pt.splice(Dt,1),Lt++):Lt&&(Pt.splice(Dt,1),Lt--);if(!jt&&!hn)for(;Lt--;Lt)Pt.unshift("..");jt&&Pt[0]!==""&&(!Pt[0]||Pt[0].charAt(0)!=="/")&&Pt.unshift(""),Ne&&Pt.join("/").substr(-1)!=="/"&&Pt.push("");var Cn=Pt[0]===""||Pt[0]&&Pt[0].charAt(0)==="/";if(de){F.hostname=F.host=Cn?"":Pt.length?Pt.shift():"";var ze=F.host&&F.host.indexOf("@")>0?F.host.split("@"):!1;ze&&(F.auth=ze.shift(),F.host=F.hostname=ze.shift())}return jt=jt||F.host&&Pt.length,jt&&!Cn&&Pt.unshift(""),Pt.length?F.pathname=Pt.join("/"):(F.pathname=null,F.path=null),(!c.isNull(F.pathname)||!c.isNull(F.search))&&(F.path=(F.pathname?F.pathname:"")+(F.search?F.search:"")),F.auth=V.auth||F.auth,F.slashes=F.slashes||V.slashes,F.href=F.format(),F},d.prototype.parseHost=function(){var V=this.host,j=h.exec(V);j&&(j=j[0],j!==":"&&(this.port=j.substr(1)),V=V.substr(0,V.length-j.length)),V&&(this.hostname=V)}},{"./util":138,punycode:103,querystring:106}],138:[function(n,o,a){o.exports={isString:function(u){return typeof u=="string"},isObject:function(u){return typeof u=="object"&&u!==null},isNull:function(u){return u===null},isNullOrUndefined:function(u){return u==null}}},{}],139:[function(n,o,a){(function(u){(function(){o.exports=c;function c(f,h){if(d("noDeprecation"))return f;var y=!1;function g(){if(!y){if(d("throwDeprecation"))throw new Error(h);d("traceDeprecation")?console.trace(h):console.warn(h),y=!0}return f.apply(this,arguments)}return g}function d(f){try{if(!u.localStorage)return!1}catch{return!1}var h=u.localStorage[f];return h==null?!1:String(h).toLowerCase()==="true"}}).call(this)}).call(this,typeof commonjsGlobal<"u"?commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{})},{}],140:[function(n,o,a){o.exports=u;function u(c,d){if(c&&d)return u(c)(d);if(typeof c!="function")throw new TypeError("need wrapper function");return Object.keys(c).forEach(function(h){f[h]=c[h]}),f;function f(){for(var h=new Array(arguments.length),y=0;y<h.length;y++)h[y]=arguments[y];var g=c.apply(this,h),p=h[h.length-1];return typeof g=="function"&&g!==p&&Object.keys(p).forEach(function(v){g[v]=p[v]}),g}}},{}],141:[function(n,o,a){o.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},{}]},{},[23])(23)})})(mqtt);var mqttExports=mqtt.exports;class Link{constructor(){er(this,"client");this.client=null}sub(r,n,o,a,u){var d,f;const c=r.trim();if(!/^wss?:\/\/.*$/.test(c))return console.error('编辑器MQTT通信只支持ws协议 (url必须以"ws://"开头)'),!1;this.client=mqttExports.connect(c,{username:n.trim(),password:o.trim(),reconnectPeriod:12e4}),(d=this.client)==null||d.on("connect",()=>{var h,y;console.log("MQTT服务器连接成功"),console.log((h=this.client)==null?void 0:h.options.clientId),(y=this.client)==null||y.subscribe(a,{qos:1})}),(f=this.client)==null||f.on("message",u)}pub(r,n,o,a,u,c){var f;const d=r.trim();if(!/^wss?:\/\/.*$/.test(d))return console.error('编辑器MQTT通信只支持ws协议 (url必须以"ws://"开头)'),!1;this.client=mqttExports.connect(d,{username:n.trim(),password:o.trim()}),(f=this.client)==null||f.on("connect",()=>{var h,y;console.log("MQTT服务器连接成功"),console.log((h=this.client)==null?void 0:h.options.clientId),(y=this.client)==null||y.publish(a,JSON.stringify(u),{qos:0,retain:!0},c)})}close(r){var n,o;(o=(n=this.client)==null?void 0:n.end)==null||o.call(n,!0,{},()=>{console.log("MQTT服务连接关闭"),r==null||r()})}destroy(){this.client=null}}const t=function(){return new Link},_hoisted_1={class:"coverLayer"},_hoisted_2={xmlns:"http://www.w3.org/2000/svg",width:"100%",height:"100%"},_hoisted_3=["transform"],_hoisted_4=["transform","onClick"],_hoisted_5=["transform"],_hoisted_6=["xlink:href","width","height","id","transform"],_hoisted_7=["id"],_hoisted_8={class:"can-not-select canvasInfoTxt"},_sfc_main=vue.defineComponent({__name:"svg-viewer",props:{vueComp:{},data:{},canvasDrag:{type:Boolean,default:!0},showCanvasInfo:{type:Boolean,default:!0}},emits:["onMessage","onEvent"],setup(i,{expose:r,emit:n}){vue.useCssVars(x=>({"7b00adf4":vue.unref(f)})),setEditorLoadTime();const o=n,a=i;let u=t();const c=useGlobalStore(pinia);componentsRegister(a.vueComp);const d=vue.reactive(a.data??{layout_center:{x:0,y:0},config:{svg:{background_color:"#fff",scale:1,grid_color:"#ebebeb"},net:{mqtt:{useGlobalMqtt:!1,url:"",user:"",pwd:"",topics:"",global:{url:"",user:"",pwd:"",topics:""}}}},done_json:[]}),f=vue.computed(()=>c.intention==EGlobalStoreIntention.MoveCanvas?"grab":"default"),h=x=>{if(c.mouse_info.state!=EMouseInfoState.Down&&c.intention!==EGlobalStoreIntention.Connection||!a.canvasDrag)return;const{clientX:M,clientY:L}=x;c.mouse_info.new_position_x=Math.round(M/d.config.svg.scale),c.mouse_info.new_position_y=Math.round(L/d.config.svg.scale);const O=Math.round(c.mouse_info.new_position_x-c.mouse_info.position_x+c.mouse_info.now_position_x),re=Math.round(c.mouse_info.new_position_y-c.mouse_info.position_y+c.mouse_info.now_position_y);c.intention==EGlobalStoreIntention.MoveCanvas&&(d.layout_center.x=O,d.layout_center.y=re)},y=()=>{c.mouse_info.state==EMouseInfoState.Down&&(c.intention!=EGlobalStoreIntention.Select&&(c.intention=EGlobalStoreIntention.None),c.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})},g=x=>{const{clientX:M,clientY:L}=x;c.intention=EGlobalStoreIntention.MoveCanvas,c.mouse_info={state:EMouseInfoState.Down,position_x:Math.round(M/d.config.svg.scale),position_y:Math.round(L/d.config.svg.scale),now_position_x:d.layout_center.x,now_position_y:d.layout_center.y,new_position_x:0,new_position_y:0}};function p(x){x!=null&&x.wheelDelta&&(x.wheelDelta>0?(d.config.svg.scale=myFixed(d.config.svg.scale+.1,1),getZoomPosition(x,d.config.svg.scale,d.layout_center,!0)):d.config.svg.scale>.1&&(d.config.svg.scale=myFixed(d.config.svg.scale-.1,1),getZoomPosition(x,d.config.svg.scale,d.layout_center,!1)))}const v=(x,M,L)=>({x:x.x-x.width/2*M+x.width/2,y:x.y-x.height/2*L+x.height/2,width:x.width*M,height:x.height*L}),_=x=>{var L;let M=!1;if(((L=x.events)==null?void 0:L.length)>0){for(let O of x.events)if(O.type===EEventType.Click){M=!0;break}}return{cursor:M?"pointer":"default"}},b=(x,M)=>{var L;if(((L=x.events)==null?void 0:L.length)>0){for(let O of x.events)if(O.type===M){if(O.condition&&O.condition.type!=="None"&&O.condition.type==="Relation"&&O.condition.Relation&&O.condition.Relation.relation){const re=O.condition.Relation.key,D=O.condition.Relation.relation,z=valFormat(O.condition.Relation.val),V=valFormat(O.condition.Relation.val2);if(x.props.hasOwnProperty(re)){const j=x.props[re].val;if(!A(j,D,z,V))continue}}if(O.action===EEventAction.ChangeAttr){if(O.attrs&&O.attrs.length>0){let re;if(O.target){for(let D of d.done_json)if(D.id===O.target){re=D;break}}else re=x;if(!re)continue;for(let D of O.attrs)D.key==="state"?re.defaultState=valFormat(D.val):D.key==="display"?re.display=valFormat(D.val):re.props.hasOwnProperty(D.key)&&(re.props[D.key].val=valFormat(D.val))}}else if(O.action===EEventAction.JavaScript)new Function(O.scripts)();else if(O.action===EEventAction.Emit){const re=["id","name","common_animations","display","props","title","type","x","y"],D={};re.forEach(z=>{var V;(V=x==null?void 0:x.hasOwnProperty)!=null&&V.call(x,z)&&(D[z]=x[z])}),o("onEvent",{event:O,target:D})}}}},A=(x,M,L,O)=>{switch(M){case">":return x>L;case">=":return x>=L;case"<":return x<L;case"<=":return x<=L;case"==":return x==L;case"!=":return x!=L;case">=,=<":return x>=L&&x<=O;case"<,>":return x<L||x>O}},w=()=>{d.layout_center={x:0,y:0}},S=()=>{let x;d.config.net.mqtt.useGlobalMqtt?x=d.config.net.mqtt.global:x=d.config.net.mqtt,x&&x.url&&x.user&&x.pwd&&x.topics&&u.sub(x.url,x.user,x.pwd,x.topics,(M,L)=>{console.log(M),console.log(L.toString()),o("onMessage",{topics:M,message:L})})},T=(x,M,L)=>setArrItemByID(x,M,L,d.done_json);return vue.onMounted(()=>{S()}),vue.onBeforeUnmount(()=>{u.close(()=>{u.destroy(),u=null})}),r({setNodeAttrByID:T}),(x,M)=>(vue.openBlock(),vue.createElementBlock("div",{class:"canvas",style:vue.normalizeStyle({backgroundColor:vue.unref(d).config.svg.background_color,position:"relative"}),onMousedown:g,onMousemove:h,onMouseup:y,onMousewheel:p,onContextmenu:M[3]||(M[3]=(...L)=>vue.unref(preventDefault)&&vue.unref(preventDefault)(...L))},[vue.renderSlot(x.$slots,"background",{},void 0,!0),vue.createElementVNode("div",_hoisted_1,[(vue.openBlock(),vue.createElementBlock("svg",_hoisted_2,[vue.createElementVNode("g",{transform:`translate(${vue.unref(d).layout_center.x*vue.unref(d).config.svg.scale},${vue.unref(d).layout_center.y*vue.unref(d).config.svg.scale})rotate(0)scale(${vue.unref(d).config.svg.scale})`},[(vue.openBlock(!0),vue.createElementBlock(vue.Fragment,null,vue.renderList(vue.unref(d).done_json,L=>{var O,re,D,z,V,j,F,Ce;return vue.withDirectives((vue.openBlock(),vue.createElementBlock("g",{key:L.id,transform:`translate(${L.x},${L.y})rotate(0)scale(1)`,style:vue.normalizeStyle(_(L)),onClick:le=>b(L,vue.unref(EEventType).Click),onMousedown:M[0]||(M[0]=(...le)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...le)),onMousemove:M[1]||(M[1]=(...le)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...le)),onMouseup:M[2]||(M[2]=(...le)=>vue.unref(stopEvent)&&vue.unref(stopEvent)(...le))},[vue.createElementVNode("g",{class:vue.normalizeClass(`${vue.unref(getCommonClass)(L)}`)},[vue.createElementVNode("g",{transform:`translate(${L.actual_bound.x+L.actual_bound.width/2},${L.actual_bound.y+L.actual_bound.height/2})rotate(${L.rotate}) scale(1) translate(${-(L.actual_bound.x+L.actual_bound.width/2)},${-(L.actual_bound.y+L.actual_bound.height/2)})`},[L.type===vue.unref(EDoneJsonType).ConnectionLine?(vue.openBlock(),vue.createBlock(_sfc_main$z,{key:0,"item-info":L},null,8,["item-info"])):L.type===vue.unref(EDoneJsonType).File?(vue.openBlock(),vue.createElementBlock("use",vue.mergeProps({key:1,"xlink:href":`#svg-${L.name}`,ref_for:!0},vue.unref(prosToVBind)(L,["height","width"]),{width:((re=(O=L.props)==null?void 0:O.width)==null?void 0:re.val)??100,height:((z=(D=L.props)==null?void 0:D.height)==null?void 0:z.val)??100,id:L.id,transform:`translate(${L.actual_bound.x+L.actual_bound.width/2},${L.actual_bound.y+L.actual_bound.height/2}) scale(${L.scale_x},${L.scale_y}) translate(${-(L.actual_bound.x+L.actual_bound.width/2)},${-(L.actual_bound.y+L.actual_bound.height/2)})`}),null,16,_hoisted_6)):L.type===vue.unref(EDoneJsonType).CustomSvg?(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(L.tag),vue.mergeProps({key:2,ref_for:!0},vue.unref(prosToVBind)(L,["height","width"]),{width:((j=(V=L.props)==null?void 0:V.width)==null?void 0:j.val)??100,height:((Ce=(F=L.props)==null?void 0:F.height)==null?void 0:Ce.val)??100,id:L.id,onOnChange:le=>b(L,vue.unref(EEventType).Change),transform:`translate(${L.actual_bound.x+L.actual_bound.width/2},${L.actual_bound.y+L.actual_bound.height/2}) scale(${L.scale_x},${L.scale_y}) translate(${-(L.actual_bound.x+L.actual_bound.width/2)},${-(L.actual_bound.y+L.actual_bound.height/2)})`}),null,16,["width","height","id","onOnChange","transform"])):L.type===vue.unref(EDoneJsonType).Vue?(vue.openBlock(),vue.createElementBlock("foreignObject",vue.mergeProps({key:3,ref_for:!0},v(L.actual_bound,L.scale_x,L.scale_y),{id:`foreign-object${L.id}`,class:"foreignObject"}),[(vue.openBlock(),vue.createBlock(vue.resolveDynamicComponent(L.tag),vue.mergeProps({ref_for:!0},vue.unref(prosToVBind)(L),{id:L.id,onOnChange:le=>b(L,vue.unref(EEventType).Change),transform:`translate(${L.actual_bound.x+L.actual_bound.width/2},${L.actual_bound.y+L.actual_bound.height/2}) scale(${L.scale_x},${L.scale_y}) translate(${-(L.actual_bound.x+L.actual_bound.width/2)},${-(L.actual_bound.y+L.actual_bound.height/2)})`}),{default:vue.withCtx(()=>[vue.createTextVNode(vue.toDisplayString(L.tag_slot),1)]),_:2},1040,["id","onOnChange","transform"]))],16,_hoisted_7)):vue.createCommentVNode("",!0)],8,_hoisted_5)],2)],44,_hoisted_4)),[[vue.vShow,L.display]])}),128))],8,_hoisted_3)]))]),vue.withDirectives(vue.createElementVNode("div",_hoisted_8,[vue.createTextVNode("缩放倍数:"+vue.toDisplayString(vue.unref(d).config.svg.scale)+"倍,画布位置:"+vue.toDisplayString(vue.unref(myFixed)(vue.unref(d).layout_center.x,2))+","+vue.toDisplayString(vue.unref(myFixed)(vue.unref(d).layout_center.y,2))+" ",1),vue.createVNode(vue.unref(elementPlus.ElIcon),{class:"icoP",size:14,onClick:w,title:"重置位置"},{default:vue.withCtx(()=>[vue.createVNode(vue.unref(aim_default))]),_:1})],512),[[vue.vShow,x.showCanvasInfo]])],36))}}),svgViewer_vue_vue_type_style_index_0_scoped_6a4368ea_lang="",svgViewer=_export_sfc$1(_sfc_main,[["__scopeId","data-v-6a4368ea"]]);exports.SvgEditor=index,exports.SvgViewer=svgViewer,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});