xframelib 0.8.7 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/core/Global.d.ts +5 -0
- package/dist/index.cjs +10 -10
- package/dist/index.js +10 -10
- package/dist/utils/FileDownload.d.ts +12 -4
- package/dist/utils/FilenameUtils.d.ts +14 -0
- package/dist/utils/GzipTool.d.ts +27 -0
- package/dist/utils/H5Tool.d.ts +56 -0
- package/dist/utils/IsTool.d.ts +12 -0
- package/dist/utils/ZipTool.d.ts +60 -0
- package/dist/utils/index.d.ts +4 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{h as Di,openBlock as q,createElementBlock as fe,normalizeStyle as ge,renderSlot as ie,defineComponent as Ie,ref as K,withModifiers as _o,reactive as So,getCurrentInstance as Li,computed as je,watch as Te,onMounted as Zt,onBeforeUnmount as $i,nextTick as Co,resolveComponent as dt,createBlock as Q,Transition as Eo,withCtx as be,withDirectives as ko,createElementVNode as J,Fragment as Re,createTextVNode as Qt,toDisplayString as en,createCommentVNode as ne,vShow as xo,markRaw as Ni,onErrorCaptured as Bi,Suspense as Wi,createVNode as ft,KeepAlive as Io,resolveDynamicComponent as _e,toRefs as Ui,renderList as He,normalizeClass as Pe,TransitionGroup as Oi,onUnmounted as ji,unref as tn}from"vue";import Hi from"axios";import Fi from"qs";import{Client as qi,ClientContext as nn}from"@hprose/rpc-core";import{ByteStream as ke,Writer as on,Reader as rn,ValueReader as Xi}from"@hprose/io";import{HttpTransport as Vi}from"@hprose/rpc-html5";import{Icon as sn}from"@iconify/vue";var Gi={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((n,e)=>(n[e.id]=e)&&n,{})}},methods:{updatePaneComponents(){this.panes.forEach(n=>{n.update&&n.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[n.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(n,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(n){this.touch.mouseDown&&(n.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(n)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(n=>({min:n.min,max:n.max,size:n.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(n,e){"ontouchstart"in window&&(n.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(n,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(n,e){let t=0;this.panes=this.panes.map((o,r)=>(o.size=r===e?o.max:o.min,r!==e&&(t+=o.min),o)),this.panes[e].size-=t,this.$emit("pane-maximize",this.panes[e])},onPaneClick(n,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(n){const e=this.container.getBoundingClientRect(),{clientX:t,clientY:o}="ontouchstart"in window&&n.touches?n.touches[0]:n;return{x:t-e.left,y:o-e.top}},getCurrentDragPercentage(n){n=n[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(n=e-n),100*n/e},calculatePanesSize(n){const e=this.touch.activeSplitter;let t={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:t.prevPanesSize),r=100-(this.pushOtherPanes?0:t.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(n),r),o);let s=[e,e+1],c=this.panes[s[0]]||null,u=this.panes[s[1]]||null;const g=c.max<100&&i>=c.max+t.prevPanesSize,S=u.max<100&&i<=100-(u.max+this.sumNextPanesSize(e+1));if(g||S)g?(c.size=c.max,u.size=Math.max(100-c.max-t.prevPanesSize-t.nextPanesSize,0)):(c.size=Math.max(100-u.max-t.prevPanesSize-this.sumNextPanesSize(e+1),0),u.size=u.max);else{if(this.pushOtherPanes){const C=this.doPushOtherPanes(t,i);if(!C)return;({sums:t,panesToResize:s}=C),c=this.panes[s[0]]||null,u=this.panes[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(i-t.prevPanesSize-t.prevReachedMinPanes,c.min),c.max)),u!==null&&(u.size=Math.min(Math.max(100-i-t.nextPanesSize-t.nextReachedMinPanes,u.min),u.max))}},doPushOtherPanes(n,e){const t=this.touch.activeSplitter,o=[t,t+1];return e<n.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(t).index,n.prevReachedMinPanes=0,o[0]<t&&this.panes.forEach((r,i)=>{i>o[0]&&i<=t&&(r.size=r.min,n.prevReachedMinPanes+=r.min)}),n.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(n.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=t&&(r.size=r.min,n.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-n.prevReachedMinPanes-this.panes[0].min-n.prevPanesSize-n.nextPanesSize,null):e>100-n.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(t).index,n.nextReachedMinPanes=0,o[1]>t+1&&this.panes.forEach((r,i)=>{i>t&&i<o[1]&&(r.size=r.min,n.nextReachedMinPanes+=r.min)}),n.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(n.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=t+1&&(r.size=r.min,n.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-n.prevPanesSize-n.nextReachedMinPanes-this.panes[this.panesCount-1].min-n.nextPanesSize,null):{sums:n,panesToResize:o}},sumPrevPanesSize(n){return this.panes.reduce((e,t,o)=>e+(o<n?t.size:0),0)},sumNextPanesSize(n){return this.panes.reduce((e,t,o)=>e+(o>n+1?t.size:0),0)},findPrevExpandedPane(n){return[...this.panes].reverse().find(e=>e.index<n&&e.size>e.min)||{}},findNextExpandedPane(n){return this.panes.find(e=>e.index>n+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(n=>{const e=n.classList.contains("splitpanes__pane"),t=n.classList.contains("splitpanes__splitter");if(!e&&!t)return n.parentNode.removeChild(n),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(n,e,t=!1){const o=n-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),t||(r.onmousedown=i=>this.onMouseDown(i,o),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=i=>this.onMouseDown(i,o)),r.onclick=i=>this.onSplitterClick(i,o+1)),this.dblClickSplitter&&(r.ondblclick=i=>this.onSplitterDblClick(i,o+1)),e.parentNode.insertBefore(r,e)},removeSplitter(n){n.onmousedown=void 0,n.onclick=void 0,n.ondblclick=void 0,n.parentNode.removeChild(n)},redoSplitters(){const n=Array.from(this.container.children);n.forEach(t=>{t.className.includes("splitpanes__splitter")&&this.removeSplitter(t)});let e=0;n.forEach(t=>{t.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,t,!0):e&&this.addSplitter(e,t),e++)})},requestUpdate({target:n,...e}){const t=this.indexedPanes[n._.uid];Object.entries(e).forEach(([o,r])=>t[o]=r)},onPaneAdd(n){let e=-1;Array.from(n.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&e++,r===n.$el));const t=parseFloat(n.minSize),o=parseFloat(n.maxSize);this.panes.splice(e,0,{id:n._.uid,index:e,min:isNaN(t)?0:t,max:isNaN(o)?100:o,size:n.size===null?null:parseFloat(n.size),givenSize:n.size,update:n.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(n){const e=this.panes.findIndex(o=>o.id===n._.uid),t=this.panes.splice(e,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...t,index:e}}),this.$emit("pane-remove",{removed:t,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(n={}){n.addedPane||n.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(n):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const n=100/this.panesCount;let e=0;const t=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(n,r.max),r.min),e-=r.size,r.size>=r.max&&t.push(r.id),r.size<=r.min&&o.push(r.id)}),e>.1&&this.readjustSizes(e,t,o)},initialPanesSizing(){let n=100;const e=[],t=[];let o=0;this.panes.forEach(i=>{n-=i.size,i.size!==null&&o++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&t.push(i.id)});let r=100;n>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(n/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(n,e,t))},equalizeAfterAddOrRemove({addedPane:n}={}){let e=100/this.panesCount,t=0;const o=[],r=[];n&&n.givenSize!==null&&(e=(100-n.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{t-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(t)<.1)&&(this.panes.forEach(i=>{n&&n.givenSize!==null&&n.id===i.id||(i.size=Math.max(Math.min(e,i.max),i.min)),t-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),t>.1&&this.readjustSizes(t,o,r))},readjustSizes(n,e,t){let o;o=n>0?n/(this.panesCount-e.length):n/(this.panesCount-t.length),this.panes.forEach(r=>{if(n>0&&!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;n-=s,r.size=i}else if(!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;n-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(n)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(n){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,t)=>{e.ondblclick=n?o=>this.onSplitterDblClick(o,t):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return Di("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},an={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(n){this.style=n}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(n){this.requestUpdate({target:this,size:n})},minSizeNumber(n){this.requestUpdate({target:this,min:n})},maxSizeNumber(n){this.requestUpdate({target:this,max:n})}}};function cn(n){return window.TouchEvent&&n instanceof TouchEvent}an.render=function(n,e,t,o,r,i){return q(),fe("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,n._.uid)),style:ge(n.style)},[ie(n.$slots,"default")],4)},an.__file="src/controls/splitpanes/pane.vue";class de{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return cn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return cn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Jn(this.clientX,this.clientY)}static bindDown(e,t,o,r=!1){const i=c=>{t(new de(c))},s=c=>{c.touches.length===1&&t(new de(c)),c.touches.length>1&&o&&o(new de(c))};return e.addEventListener("mousedown",i,r),e.addEventListener("touchstart",s,r),()=>{e.removeEventListener("mousedown",i,r),e.removeEventListener("touchstart",s,r)}}static bindMove(e,t,o=!1){const r=s=>{t(new de(s))},i=s=>{s.touches.length===1&&t(new de(s))};return e.addEventListener("mousemove",r,o),e.addEventListener("touchmove",i,o),()=>{e.removeEventListener("mousemove",r,o),e.removeEventListener("touchmove",i,o)}}static bindUp(e,t,o=!1){const r=s=>{t(new de(s))},i=s=>{s.touches.length===0&&t(new de(s))};return e.addEventListener("mouseup",r,o),e.addEventListener("touchend",i,o),()=>{e.removeEventListener("mouseup",r,o),e.removeEventListener("touchend",i,o)}}originalEvent({mouse:e,touch:t}){cn(this.e)?t&&t(this.e):e&&e(this.e)}}class Jn{x;y;constructor(e,t){this.x=e,this.y=t}clone(){return new Jn(this.x,this.y)}}class Ki{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,t,o={}){this.handle=e,this.container=t,this.options=o,e&&(this.unbindDown=de.bindDown(e,this.mousedown),e.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=e=>{e.preventDefault(),this.handle&&(this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=de.bindMove(document,this.mousemove),this.unbindUp=de.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=`calc(${e.clientX-this.offsetX}px + ${this.container.style.left})`,this.container.style.top=`calc(${e.clientY-this.offsetY}px + ${this.container.style.top})`,this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ji{_group;onChange;zIndex;constructor(e,t){this._group=e,this.onChange=t,this.a(o=>o.push(this))}set group(e){this._group=e;const t=gt(this._group),o=gt(e);t.splice(t.indexOf(this),1),o.push(this),Ro()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(gt(this._group)),Ro()}}const pt=new Map,Yi=0;function gt(n){return pt.has(n)||pt.set(n,[]),pt.get(n)}function To(n,e){return n>e?-To(e,n):n<0&&e>=0?1:n-e}function Ro(){let n=Yi;for(const e of function(t){const o=[];return t.forEach((r,i)=>o.push(i)),o}(pt).sort(To))for(const t of gt(e))n!=t.zIndex&&(t.zIndex=n,t.onChange(n)),n++}function ln(n){if(n){const{width:e,height:t}=n.style;n.style.width="auto",n.style.height="auto";const o=mt(n);return n.style.width=e,n.style.height=t,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function mt(n){const e=n.getBoundingClientRect(),t=e.width,o=e.height,r=e.top,i=e.left;return{width:t,height:o,top:r,left:i,bottom:r+o,right:i+t}}class Zi{container;options;handles;constructor(e,t){if(this.container=e,this.options=t,e&&t){this.handles=Po.map(u=>new u(e,this));const{width:o,height:r}=ln(e),i=t.maxWidth||window.innerWidth,s=t.maxHeight||window.innerHeight;let c=!1;(o<t.minWidth||o>i)&&(e.style.width=`${Mo(o,t.minWidth,i)}px`,c=!0),(r<t.minHeight||r>s)&&(e.style.height=`${Mo(r,t.minHeight,s)}px`,c=!0),c&&t.onResize&&t.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Po=[];class xe{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,t){this.container=e,this.helper=t,this.handle=this.createHandleElement(),this.unbindDown=de.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=e=>{e.preventDefault(),e.stopPropagation();const{left:t,top:o,width:r,height:i}=mt(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=t,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=de.bindMove(document,this.mousemove),this.unbindUp=de.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:t,right:o,bottom:r}=mt(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,c=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=e+i.minWidth,this.maxRight=Math.min(e+s,window.innerWidth),this.minTop=Math.max(r-c,0),this.maxTop=r-i.minHeight,this.minBottom=t+i.minHeight,this.maxBottom=Math.min(t+c,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:t,left:o,top:r,right:i,bottom:s}=mt(this.container),c=this.helper.options;c&&(o<this.minLeft?(this.container.style.width=e+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>this.maxLeft?(this.container.style.width=`${c.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${c.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-o+"px"),r<this.minTop?(this.container.style.height=t+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>this.maxTop?(this.container.style.height=`${c.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${c.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),t=e.style;return t.position="absolute",this.applyStyle(t),this.container.appendChild(e),e}}function Mo(n,e,t){return n<e?e:n>t?t:n}Po.push(class extends xe{setPosition(n){this.container.style.width=this.width0+n.clientX-this.x0+"px",this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.right=-this.handleSize+"px",n.bottom=-this.handleSize+"px",n.cursor="nwse-resize"}},class extends xe{setPosition(n){this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.right=`${this.handleSize}px`,n.left=`${this.handleSize}px`,n.height=2*this.handleSize+"px",n.bottom=-this.handleSize+"px",n.cursor="ns-resize"}},class extends xe{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px",this.container.style.height=this.height0+n.clientY-this.y0+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.bottom=-this.handleSize+"px",n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.cursor="nesw-resize"}},class extends xe{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.bottom=`${this.handleSize}px`,n.width=2*this.handleSize+"px",n.top=`${this.handleSize}px`,n.cursor="ew-resize"}},class extends xe{setPosition(n){this.container.style.left=this.left0+n.clientX-this.x0+"px",this.container.style.width=this.width0-(n.clientX-this.x0)+"px",this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px"}applyStyle(n){n.left=-this.handleSize+"px",n.top=-this.handleSize+"px",n.width=2*this.handleSize+"px",n.height=2*this.handleSize+"px",n.cursor="nwse-resize"}},class extends xe{setPosition(n){this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px"}applyStyle(n){n.left=`${this.handleSize}px`,n.right=`${this.handleSize}px`,n.height=2*this.handleSize+"px",n.top=-this.handleSize+"px",n.cursor="ns-resize"}},class extends xe{setPosition(n){this.container.style.top=this.top0+n.clientY-this.y0+"px",this.container.style.height=this.height0-(n.clientY-this.y0)+"px",this.container.style.width=this.width0+n.clientX-this.x0+"px"}applyStyle(n){n.right=-this.handleSize+"px",n.top=-this.handleSize+"px",n.height=2*this.handleSize+"px",n.width=2*this.handleSize+"px",n.cursor="nesw-resize"}},class extends xe{setPosition(n){this.container.style.width=this.width0+n.clientX-this.x0+"px"}applyStyle(n){n.right=-this.handleSize+"px",n.top=`${this.handleSize}px`,n.bottom=`${this.handleSize}px`,n.width=2*this.handleSize+"px",n.cursor="ew-resize"}});var vt=Ie({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(n){const e=K(!1),t=K(!1);return{hover:e,active:t,style:function(){let o=n.windowStyle.button;return e.value&&(o={...o,...this.windowStyle.buttonHover}),t.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),t.value=!0;const r=de.bindUp(document,()=>{t.value=!1,r()})}}}});const Qi=["disabled"];vt.render=function(n,e,t,o,r,i){return q(),fe("div",{class:"btn",style:ge(n.style()),onMouseenter:e[0]||(e[0]=s=>n.hover=!0),onMouseleave:e[1]||(e[1]=s=>n.hover=!1),onMousedown:e[2]||(e[2]=_o((...s)=>n.mousedown&&n.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=_o((...s)=>n.mousedown&&n.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>n.mouseup&&n.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>n.mouseup&&n.mouseup(...s)),disabled:n.disabled},[ie(n.$slots,"default")],44,Qi)},vt.__scopeId="data-v-71662210",vt.__file="src/controls/vuewindow/window/Button.vue";const es=Object.prototype.toString;function ue(n,e){return es.call(n)===`[object ${e}]`}function yt(n){return ue(n,"Function")}const zo=n=>typeof n<"u",un=n=>!zo(n);function hn(n){return n===null}function ts(n){return un(n)&&hn(n)}function ns(n){return un(n)||hn(n)}const Me=n=>n!=null&&n!==null&&ue(n,"Object");function os(n){return ue(n,"Date")}function dn(n){return ue(n,"Number")}function rs(n){return ue(n,"AsyncFunction")}function is(n){return ue(n,"Promise")&&Me(n)&&yt(n.then)&&yt(n.catch)}function wt(n){return ue(n,"String")}function ss(n){return n===!0||n===!1||ue(n,"Boolean")}function fn(n){return n&&Array.isArray(n)}const as=()=>typeof window<"u",cs=n=>typeof window<"u"&&ue(n,"Window"),ls=n=>Me(n)&&!!n.tagName,us=typeof window>"u";function hs(n){return n&&["IMAGE","IMG"].includes(n.tagName)}function ds(n){return n==null||(wt(n)||fn(n)?n.length===0:!!Me(n)&&JSON.stringify(n)==="{}")}function fs(n){return ue(n,"Error")}function ps(n){return ue(n,"WeakSet")}function gs(n){return ue(n,"WeakMap")}function ms(n){return ue(n,"Symbol")}function vs(n){return ue(n,"Map")}const ys=n=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(n);var Fe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ao,Do={exports:{}},ws=(Ao||(Ao=1,Do.exports=function(n){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(f,l){var v=f[0],m=f[1],p=f[2],y=f[3];m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&p|~m&y)+l[0]-680876936|0)<<7|v>>>25)+m|0)&m|~v&p)+l[1]-389564586|0)<<12|y>>>20)+v|0)&v|~y&m)+l[2]+606105819|0)<<17|p>>>15)+y|0)&y|~p&v)+l[3]-1044525330|0)<<22|m>>>10)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&p|~m&y)+l[4]-176418897|0)<<7|v>>>25)+m|0)&m|~v&p)+l[5]+1200080426|0)<<12|y>>>20)+v|0)&v|~y&m)+l[6]-1473231341|0)<<17|p>>>15)+y|0)&y|~p&v)+l[7]-45705983|0)<<22|m>>>10)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&p|~m&y)+l[8]+1770035416|0)<<7|v>>>25)+m|0)&m|~v&p)+l[9]-1958414417|0)<<12|y>>>20)+v|0)&v|~y&m)+l[10]-42063|0)<<17|p>>>15)+y|0)&y|~p&v)+l[11]-1990404162|0)<<22|m>>>10)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&p|~m&y)+l[12]+1804603682|0)<<7|v>>>25)+m|0)&m|~v&p)+l[13]-40341101|0)<<12|y>>>20)+v|0)&v|~y&m)+l[14]-1502002290|0)<<17|p>>>15)+y|0)&y|~p&v)+l[15]+1236535329|0)<<22|m>>>10)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&y|p&~y)+l[1]-165796510|0)<<5|v>>>27)+m|0)&p|m&~p)+l[6]-1069501632|0)<<9|y>>>23)+v|0)&m|v&~m)+l[11]+643717713|0)<<14|p>>>18)+y|0)&v|y&~v)+l[0]-373897302|0)<<20|m>>>12)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&y|p&~y)+l[5]-701558691|0)<<5|v>>>27)+m|0)&p|m&~p)+l[10]+38016083|0)<<9|y>>>23)+v|0)&m|v&~m)+l[15]-660478335|0)<<14|p>>>18)+y|0)&v|y&~v)+l[4]-405537848|0)<<20|m>>>12)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&y|p&~y)+l[9]+568446438|0)<<5|v>>>27)+m|0)&p|m&~p)+l[14]-1019803690|0)<<9|y>>>23)+v|0)&m|v&~m)+l[3]-187363961|0)<<14|p>>>18)+y|0)&v|y&~v)+l[8]+1163531501|0)<<20|m>>>12)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m&y|p&~y)+l[13]-1444681467|0)<<5|v>>>27)+m|0)&p|m&~p)+l[2]-51403784|0)<<9|y>>>23)+v|0)&m|v&~m)+l[7]+1735328473|0)<<14|p>>>18)+y|0)&v|y&~v)+l[12]-1926607734|0)<<20|m>>>12)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m^p^y)+l[5]-378558|0)<<4|v>>>28)+m|0)^m^p)+l[8]-2022574463|0)<<11|y>>>21)+v|0)^v^m)+l[11]+1839030562|0)<<16|p>>>16)+y|0)^y^v)+l[14]-35309556|0)<<23|m>>>9)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m^p^y)+l[1]-1530992060|0)<<4|v>>>28)+m|0)^m^p)+l[4]+1272893353|0)<<11|y>>>21)+v|0)^v^m)+l[7]-155497632|0)<<16|p>>>16)+y|0)^y^v)+l[10]-1094730640|0)<<23|m>>>9)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m^p^y)+l[13]+681279174|0)<<4|v>>>28)+m|0)^m^p)+l[0]-358537222|0)<<11|y>>>21)+v|0)^v^m)+l[3]-722521979|0)<<16|p>>>16)+y|0)^y^v)+l[6]+76029189|0)<<23|m>>>9)+p|0,m=((m+=((p=((p+=((y=((y+=((v=((v+=(m^p^y)+l[9]-640364487|0)<<4|v>>>28)+m|0)^m^p)+l[12]-421815835|0)<<11|y>>>21)+v|0)^v^m)+l[15]+530742520|0)<<16|p>>>16)+y|0)^y^v)+l[2]-995338651|0)<<23|m>>>9)+p|0,m=((m+=((y=((y+=(m^((v=((v+=(p^(m|~y))+l[0]-198630844|0)<<6|v>>>26)+m|0)|~p))+l[7]+1126891415|0)<<10|y>>>22)+v|0)^((p=((p+=(v^(y|~m))+l[14]-1416354905|0)<<15|p>>>17)+y|0)|~v))+l[5]-57434055|0)<<21|m>>>11)+p|0,m=((m+=((y=((y+=(m^((v=((v+=(p^(m|~y))+l[12]+1700485571|0)<<6|v>>>26)+m|0)|~p))+l[3]-1894986606|0)<<10|y>>>22)+v|0)^((p=((p+=(v^(y|~m))+l[10]-1051523|0)<<15|p>>>17)+y|0)|~v))+l[1]-2054922799|0)<<21|m>>>11)+p|0,m=((m+=((y=((y+=(m^((v=((v+=(p^(m|~y))+l[8]+1873313359|0)<<6|v>>>26)+m|0)|~p))+l[15]-30611744|0)<<10|y>>>22)+v|0)^((p=((p+=(v^(y|~m))+l[6]-1560198380|0)<<15|p>>>17)+y|0)|~v))+l[13]+1309151649|0)<<21|m>>>11)+p|0,m=((m+=((y=((y+=(m^((v=((v+=(p^(m|~y))+l[4]-145523070|0)<<6|v>>>26)+m|0)|~p))+l[11]-1120210379|0)<<10|y>>>22)+v|0)^((p=((p+=(v^(y|~m))+l[2]+718787259|0)<<15|p>>>17)+y|0)|~v))+l[9]-343485551|0)<<21|m>>>11)+p|0,f[0]=v+f[0]|0,f[1]=m+f[1]|0,f[2]=p+f[2]|0,f[3]=y+f[3]|0}function o(f){var l,v=[];for(l=0;l<64;l+=4)v[l>>2]=f.charCodeAt(l)+(f.charCodeAt(l+1)<<8)+(f.charCodeAt(l+2)<<16)+(f.charCodeAt(l+3)<<24);return v}function r(f){var l,v=[];for(l=0;l<64;l+=4)v[l>>2]=f[l]+(f[l+1]<<8)+(f[l+2]<<16)+(f[l+3]<<24);return v}function i(f){var l,v,m,p,y,L,A=f.length,T=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=A;l+=64)t(T,o(f.substring(l-64,l)));for(v=(f=f.substring(l-64)).length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<v;l+=1)m[l>>2]|=f.charCodeAt(l)<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(t(T,m),l=0;l<16;l+=1)m[l]=0;return p=(p=8*A).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(p[2],16),L=parseInt(p[1],16)||0,m[14]=y,m[15]=L,t(T,m),T}function s(f){var l,v,m,p,y,L,A=f.length,T=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=A;l+=64)t(T,r(f.subarray(l-64,l)));for(v=(f=l-64<A?f.subarray(l-64):new Uint8Array(0)).length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<v;l+=1)m[l>>2]|=f[l]<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(t(T,m),l=0;l<16;l+=1)m[l]=0;return p=(p=8*A).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(p[2],16),L=parseInt(p[1],16)||0,m[14]=y,m[15]=L,t(T,m),T}function c(f){var l,v="";for(l=0;l<4;l+=1)v+=e[f>>8*l+4&15]+e[f>>8*l&15];return v}function u(f){var l;for(l=0;l<f.length;l+=1)f[l]=c(f[l]);return f.join("")}function g(f){return/[\u0080-\uFFFF]/.test(f)&&(f=unescape(encodeURIComponent(f))),f}function S(f,l){var v,m=f.length,p=new ArrayBuffer(m),y=new Uint8Array(p);for(v=0;v<m;v+=1)y[v]=f.charCodeAt(v);return l?y:p}function C(f){return String.fromCharCode.apply(null,new Uint8Array(f))}function N(f,l,v){var m=new Uint8Array(f.byteLength+l.byteLength);return m.set(new Uint8Array(f)),m.set(new Uint8Array(l),f.byteLength),v?m:m.buffer}function D(f){var l,v=[],m=f.length;for(l=0;l<m-1;l+=2)v.push(parseInt(f.substr(l,2),16));return String.fromCharCode.apply(String,v)}function M(){this.reset()}return u(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function f(l,v){return(l=0|l||0)<0?Math.max(l+v,0):Math.min(l,v)}ArrayBuffer.prototype.slice=function(l,v){var m,p,y,L,A=this.byteLength,T=f(l,A),z=A;return v!==n&&(z=f(v,A)),T>z?new ArrayBuffer(0):(m=z-T,p=new ArrayBuffer(m),y=new Uint8Array(p),L=new Uint8Array(this,T,m),y.set(L),p)}}(),M.prototype.append=function(f){return this.appendBinary(g(f)),this},M.prototype.appendBinary=function(f){this._buff+=f,this._length+=f.length;var l,v=this._buff.length;for(l=64;l<=v;l+=64)t(this._hash,o(this._buff.substring(l-64,l)));return this._buff=this._buff.substring(l-64),this},M.prototype.end=function(f){var l,v,m=this._buff,p=m.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<p;l+=1)y[l>>2]|=m.charCodeAt(l)<<(l%4<<3);return this._finish(y,p),v=u(this._hash),f&&(v=D(v)),this.reset(),v},M.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},M.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},M.prototype.setState=function(f){return this._buff=f.buff,this._length=f.length,this._hash=f.hash,this},M.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},M.prototype._finish=function(f,l){var v,m,p,y=l;if(f[y>>2]|=128<<(y%4<<3),y>55)for(t(this._hash,f),y=0;y<16;y+=1)f[y]=0;v=(v=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),m=parseInt(v[2],16),p=parseInt(v[1],16)||0,f[14]=m,f[15]=p,t(this._hash,f)},M.hash=function(f,l){return M.hashBinary(g(f),l)},M.hashBinary=function(f,l){var v=u(i(f));return l?D(v):v},M.ArrayBuffer=function(){this.reset()},M.ArrayBuffer.prototype.append=function(f){var l,v=N(this._buff.buffer,f,!0),m=v.length;for(this._length+=f.byteLength,l=64;l<=m;l+=64)t(this._hash,r(v.subarray(l-64,l)));return this._buff=l-64<m?new Uint8Array(v.buffer.slice(l-64)):new Uint8Array(0),this},M.ArrayBuffer.prototype.end=function(f){var l,v,m=this._buff,p=m.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<p;l+=1)y[l>>2]|=m[l]<<(l%4<<3);return this._finish(y,p),v=u(this._hash),f&&(v=D(v)),this.reset(),v},M.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},M.ArrayBuffer.prototype.getState=function(){var f=M.prototype.getState.call(this);return f.buff=C(f.buff),f},M.ArrayBuffer.prototype.setState=function(f){return f.buff=S(f.buff,!0),M.prototype.setState.call(this,f)},M.ArrayBuffer.prototype.destroy=M.prototype.destroy,M.ArrayBuffer.prototype._finish=M.prototype._finish,M.ArrayBuffer.hash=function(f,l){var v=u(s(new Uint8Array(f)));return l?D(v):v},M}()),Do.exports),pn=bt(ws);const gn=[];class he{static addHandler(e,t,o){e.addEventListener?e.addEventListener(t,o,!1):e.attachEvent?e.attachEvent("on"+t,o):e["on"+t]=o}static removeHandler(e,t,o){e.removeEventListener?e.removeEventListener(t,o,!1):e.detachEvent?e.detachEvent("on"+t,o):delete e["on"+t]}static windowResizeHandler(e){he.addHandler(window,"resize",e)}static offWindowResizeHandler(e){he.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,t){if(t){const o=window.document;let r=window.document.exitFullscreen||o.msExitFullscreen||o.mozCancelFullScreen||o.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let o=e;o||(o=window.document.documentElement);let r=o.requestFullScreen||o.webkitRequestFullScreen||o.mozRequestFullScreen||o.msRequestFullScreen;typeof r<"u"&&r?r.call(o):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let t=e;var o=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(o)o.call(t);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const e=window.document;var t=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.webkitExitFullscreen;if(t)t.call(document);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!he.fullScreenElement()}static onFullScreenChanged(e){let t;"onfullscreenchange"in window.document?t="fullscreenchange":"onwebkitfullscreenchange"in window.document?t="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(t="mozfullscreenchange"),t?document.addEventListener(t,function(){const o=he.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=he.isFullScreen();e(o)})}static stringifyCircularHandler(e,t){if(typeof t=="object"&&t!==null){if(gn.indexOf(t)!==-1)return;gn.push(t)}return t}static jsonStringify(e){if(!e)return"";const t=JSON.stringify(e,he.stringifyCircularHandler);return gn.length=0,t}static jsonParse(e){const t=he.jsonStringify(e);if(t.length>1)return JSON.parse(t)}static getObjectURL(e){let t;const o=window;return o.createObjcectURL!=null?t=o.createOjcectURL(e):window.URL!=null?t=window.URL.createObjectURL(e):window.webkitURL!=null&&(t=window.webkitURL.createObjectURL(e)),t}static getFileShortMD5(e,t){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=new pn.ArrayBuffer,u=new FileReader;u.onload=function(g){c.append(g.target?.result);const S=c.end();t({isOK:!0,data:S})},u.onerror=function(){const g="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(g),t({isOK:!1,data:g})},function(){const g=0+s>=i.size?i.size:0+s;u.readAsArrayBuffer(r.call(i,0,g))}()}static getFileMD5(e,t){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=Math.ceil(i.size/s);let u=0;const g=new pn.ArrayBuffer,S=new FileReader;function C(){const N=u*s,D=N+s>=i.size?i.size:N+s;S.readAsArrayBuffer(r.call(i,N,D))}S.onload=function(N){if(g.append(N.target?.result),u++,u<c)C();else{const D=g.end();t({isOK:!0,data:D})}},S.onerror=function(){const N=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(N),t({isOK:!1,data:N})},C()}static MD5(e,t=!1){return pn.hash(e,t)}static copyTextByCommand(e){return new Promise((t,o)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),t(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(t){return!1}):he.copyTextByCommand(e);static copyElementTextByCommand(e){const t=document.createRange();t.selectNode(document.getElementById(e));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(t);try{return document.execCommand("copy"),o.removeRange(t),!0}catch(r){return o.removeRange(t),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(e){if(!navigator.clipboard)return he.copyElementTextByCommand(e);const t=document.createRange();t.selectNode(document.getElementById(e));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(t),navigator.clipboard.writeText(o).then(function(){return o.removeRange(t),!0},function(r){return o.removeRange(t),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(e){he.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,t,o){const r=o||document.body;let{className:i}=r;i=i.replace(t,""),r.className=e?`${i} ${t} `:i}static setCssVar(e,t,o=document.documentElement){o.style.setProperty(e,t)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,t="click",o){let r;if(r=wt(e)?document.getElementById(e):e,r){const i=new Event(t,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(e,t){var o=t-e,r=Math.random();return e+Math.round(r*o)}static merge(e={},t={}){let o,r,i,s;for(e||(e={}),r=0,i=t.length;r<i;r++)for(o in s=t[r],s)e[o]=s[o];return e}static setOptions(e,t){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let o in t)e.options[o]=t[o];return e.options}static formatNum(e,t){let o=Math.pow(10,t===void 0?6:t);return Math.round(e*o)/o}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static splitWords(e){return this.trim(e).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(e,t){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(e,t)}}static throttle(e,t){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{e(),o=!0},t)}}static dataURLtoBlob(e){let t=e.split(",");if(!t||t.length===0)return;let o=t[0].match(/:(.*?);/)[1],r=atob(t[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,t){let o=e.style[t]||e.currentStyle&&e.currentStyle[t];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(e,null);o=r?r[t]:null}return o==="auto"?null:o}static create(e,t,o){let r=document.createElement(e);return r.className=t||"",o&&o.appendChild(r),r}static removeElement(e){let t=e.parentNode;t&&t.removeChild(e)}static emptyElement(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,t){if(e.classList!==void 0)return e.classList.contains(t);let o=this.getClass(e);return o.length>0&&new RegExp("(^|\\s)"+t+"(\\s|$)").test(o)}static addClass(e,t){if(e.classList!==void 0){let o=this.splitWords(t);for(let r=0,i=o.length;r<i;r++)e.classList.add(o[r])}else if(!this.hasClass(e,t)){let o=this.getClass(e);this.setClass(e,(o?o+" ":"")+t)}}static removeClass(e,t){e.classList!==void 0?e.classList.remove(t):this.setClass(e,this.trim((" "+this.getClass(e)+" ").replace(" "+t+" "," ")))}static setClass(e,t){e.className.baseVal===void 0?e.className=t:e.className.baseVal=t}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvgElement(e,t,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",e),i.setAttribute("height",t),i.setAttribute("viewBox",`0 0 ${e} ${t}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",o),i.appendChild(s),r&&r.appendChild(i),i}static parseDom(e,t=!0,o=""){t=t??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=e,t?r:r.childNodes}static createVideoHTML(e,t,o){let r=this.create("video",t,o),i=this.create("source","",r);i.setAttribute("src",e),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",e),s.setAttribute("type","video/quicktime"),r}static readFileBytes(e){return new Promise((t,o)=>{const r=new FileReader;r.onload=function(i){const s=r.result,c=s.indexOf("64,"),u=s.substring(c+3);t(u)},r.readAsDataURL(e)})}}class Je{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(t,o)=>o.toUpperCase()).replace("views","")}static getFileName(e){const t=e.lastIndexOf("/")+1;let o=e.substring(t);return o=decodeURI(o.split("?")[0]),o}}class _t{prefixKey;storage;constructor(e="",t=localStorage){this.prefixKey=e,this.storage=t}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,t,o=604800){const r=JSON.stringify({value:t,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(e),r)}get(e,t=null){const o=this.storage.getItem(this.getKey(e));if(o)try{const r=JSON.parse(o),{value:i,expire:s}=r;if(s===null||s>=Date.now())return i;this.remove(this.getKey(e))}catch{return t}return t}getJsonObject(e){const t=this.storage.getItem(this.getKey(e));if(t)try{const o=JSON.parse(t);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,t,o=604800){document.cookie=`${this.getKey(e)}=${t}; Max-Age=${o}`}getCookie(e){const t=document.cookie.split("; ");for(let o=0,r=t.length;o<r;o++){const i=t[o].split("=");if(i[0]===this.getKey(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let t=e.length;t--;)document.cookie=e[t]+"=0;expire="+new Date(0).toUTCString()}}const bs=new _t("",localStorage);function Lo(){let n=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var t=0;t<36;t++){const r=Math.floor(16*Math.random());n[t]=e.substring(r,r+1)}n[14]="4";const o=3&Number(n[19])|8;return n[19]=e.substring(o,o+1),n[8]=n[13]=n[18]=n[23]="-",n.join("")}function _s(){var n=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var o=(n+16*Math.random())%16|0;return n=Math.floor(n/16),(t==="x"?o:3&o|8).toString(16)});return e}function Ss(n){const e=n.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),t=parseFloat(e[3]||"1"),o=Math.floor(t*parseInt(e[0])+255*(1-t)),r=Math.floor(t*parseInt(e[1])+255*(1-t)),i=Math.floor(t*parseInt(e[2])+255*(1-t));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function Cs(n){var e=n.toLowerCase();if(St(n)){if(e.length===4){for(var t="#",o=1;o<4;o+=1){const i=e.slice(o,o+1);t+=i.concat(i)}e=t}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+e.slice(o,o+2)));return"rgb("+r.join(",")+")"}return e}function Es(n){const e=n;if(e.length===4){let o="#";for(var t=1;t<4;t+=1){const r=e.slice(t,t+1);o+=r.concat(r)}return o}return e}var ze;function ks(n){if(typeof n=="object"||!n)return;const e=n.toLowerCase().substring(0,1);return e==="#"?ze.Hex:e==="r"||e==="("?ze.RGBA:e==="h"?ze.Hsla:ze.RGBA}function xs(n){if(n){var e=n.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(e){var t,o,r,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),c=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)t=o=r=c;else{var u=c<=.5?c*(s+1):c+s-c*s,g=2*c-u;t=mn(g,u,i+1/3),o=mn(g,u,i),r=mn(g,u,i-1/3)}return`rgba(${t=Math.round(255*t)},${o=Math.round(255*o)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}}function mn(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function St(n){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(n)}function Is(n,e,t){const o=(n<<16|e<<8|t).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function vn(n){let e=n.toLowerCase();if(St(n)){if(e.length===4){let o="#";for(let r=1;r<4;r+=1)o+=e.slice(r,r+1).concat(e.slice(r,r+1));e=o}const t=[];for(let o=1;o<7;o+=2)t.push(parseInt("0x"+e.slice(o,o+2)));return"RGB("+t.join(",")+")"}return e}function Ts(n){if(!St(n))return;const[e,t,o]=vn(n).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*t+.114*o<192}function Rs(n,e){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,e=Math.trunc(255*e/100),`#${wn(n.substring(0,2),e)}${wn(n.substring(2,4),e)}${wn(n.substring(4,6),e)}`}function Ps(n,e){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,e=Math.trunc(255*e/100),`#${yn(n.substring(0,2),e)}${yn(n.substring(2,4),e)}${yn(n.substring(4,6),e)}`}function yn(n,e){const t=parseInt(n,16)+e,o=t>255?255:t;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function $o(n,e,t){const o=[n,e,t].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*o[0]+.7152*o[1]+.0722*o[2]}function Ms(n){return function(e,t){return($o(~~e[0],~~e[1],~~e[2])+.05)/($o(t[0],t[1],t[2])+.05)}(vn(n.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function wn(n,e){const t=parseInt(n,16)-e,o=t<0?0:t;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function bn(n){return{all:n=n||new Map,on(e,t){const o=n.get(e);o?o.push(t):n.set(e,[t])},off(e,t){const o=n.get(e);o&&(t?o.splice(o.indexOf(t)>>>0,1):n.set(e,[]))},emit(e,t){let o=n.get(e);o&&o.slice().map(r=>{r(t)}),o=n.get("*"),o&&o.slice().map(r=>{r(e,t)})}}}(function(n){n[n.RGBA=0]="RGBA",n[n.Hex=1]="Hex",n[n.Hsla=2]="Hsla"})(ze||(ze={}));const Ae=bn(),se={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetToUnloadEvent:"WidgetToUnloadEvent",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},Ye=(n,e)=>{const t=document.createElement("a");t.download=e,t.style.display="none";const o=new Blob([n],{type:"application/octet-stream"});t.href=URL.createObjectURL(o),document.body.appendChild(t),t.click(),document.body.removeChild(t)};function zs(n,e){const t=window.URL||window.webkitURL||window,o=new Blob([n]),r=document.createElement("a");r.href=t.createObjectURL(o),r.download=e,r.click(),t.revokeObjectURL(r.href)}const No=(n,e)=>{const t=JSON.stringify(n,null,2);e?Ye(t,e+".json"):Ae.emit(se.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},As=(n,e,t)=>{n.get(e,{responseType:"blob"}).then(function(o){Ye(o.data,t)}).catch(o=>{console.warn(o),Ae.emit(se.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Ds(n){const e=new Date().getTime();let t=new Date().getTime();for(;t-e<n;)t=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${Bo}\u6BEB\u79D2`)}function Bo(n){return new Promise(e=>setTimeout(e,n))}var Wo,_n={exports:{}},Uo,Oo,Sn,Cn=(Wo||(Wo=1,Oo=_n.exports,Sn=function(){var n=function(){},e="undefined",t=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(D,M){var f=D[M];if(typeof f.bind=="function")return f.bind(D);try{return Function.prototype.bind.call(f,D)}catch{return function(){return Function.prototype.apply.apply(f,[D,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var D=this.getLevel(),M=0;M<o.length;M++){var f=o[M];this[f]=M<D?n:this.methodFactory(f,D,this.name)}if(this.log=this.debug,typeof console===e&&D<this.levels.SILENT)return"No console available for logging"}function g(D){return function(){typeof console!==e&&(u.call(this),this[D].apply(this,arguments))}}function S(D,M,f){return function(l){return l==="debug"&&(l="log"),typeof console!==e&&(l==="trace"&&t?c:console[l]!==void 0?s(console,l):console.log!==void 0?s(console,"log"):n)}(D)||g.apply(this,arguments)}function C(D,M){var f,l,v,m=this,p="loglevel";function y(){var T;if(typeof window!==e&&p){try{T=window.localStorage[p]}catch{}if(typeof T===e)try{var z=window.document.cookie,W=encodeURIComponent(p),O=z.indexOf(W+"=");O!==-1&&(T=/^([^;]+)/.exec(z.slice(O+W.length+1))[1])}catch{}return m.levels[T]===void 0&&(T=void 0),T}}function L(T){var z=T;if(typeof z=="string"&&m.levels[z.toUpperCase()]!==void 0&&(z=m.levels[z.toUpperCase()]),typeof z=="number"&&z>=0&&z<=m.levels.SILENT)return z;throw new TypeError("log.setLevel() called with invalid level: "+T)}typeof D=="string"?p+=":"+D:typeof D=="symbol"&&(p=void 0),m.name=D,m.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},m.methodFactory=M||S,m.getLevel=function(){return v??l??f},m.setLevel=function(T,z){return v=L(T),z!==!1&&function(W){var O=(o[W]||"silent").toUpperCase();if(typeof window!==e&&p){try{return void(window.localStorage[p]=O)}catch{}try{window.document.cookie=encodeURIComponent(p)+"="+O+";"}catch{}}}(v),u.call(m)},m.setDefaultLevel=function(T){l=L(T),y()||m.setLevel(T,!1)},m.resetLevel=function(){v=null,function(){if(typeof window!==e&&p){try{window.localStorage.removeItem(p)}catch{}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),u.call(m)},m.enableAll=function(T){m.setLevel(m.levels.TRACE,T)},m.disableAll=function(T){m.setLevel(m.levels.SILENT,T)},m.rebuild=function(){if(i!==m&&(f=L(i.getLevel())),u.call(m),i===m)for(var T in r)r[T].rebuild()},f=L(i?i.getLevel():"WARN");var A=y();A!=null&&(v=L(A)),u.call(m)}(i=new C).getLogger=function(D){if(typeof D!="symbol"&&typeof D!="string"||D==="")throw new TypeError("You must supply a name when creating a logger.");var M=r[D];return M||(M=r[D]=new C(D,i.methodFactory)),M};var N=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=N),i},i.getLoggers=function(){return r},i.default=i,i},(Uo=_n).exports?Uo.exports=Sn():Oo.log=Sn()),_n.exports);class jo{message;eventBus;constructor(e,t=void 0){e&&(this.message=e),t&&(this.eventBus=t)}msg(e,t=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:e,duration:t});else switch(o){case"info":this.message.info(e,t);break;case"success":this.message.success(e,t);break;case"warning":this.message.warn?this.message.warn(e,t):this.message.warning&&this.message.warning(e,t);break;case"error":this.message.error(e,t)}else{switch(o){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":o="dark",console.error(e)}this.eventBus&&this.eventBus.emit(se.AlertInfoEvent,{type:o,info:e})}}info(e,t=3){this.msg(e,t,"info")}warn(e,t=3){this.msg(e,t,"warning")}err(e,t=3){this.msg(e,t,"error")}success(e,t=3){this.msg(e,t,"success")}}let Ho=!1;const B={Config:SysConfig,EventBus:Ae,DefaultProxyClient:null,Axios:Hi,Message:new jo(void 0,Ae),LayoutMap:new Map,getLayoutManager:n=>{if(!B.WidgetConfigList||B.WidgetConfigList.length===0)return;const e=B.WidgetConfigList.find(t=>t.id===n);if(e){const t=e.layoutID;if(t&&B.LayoutMap.has(t))return B.LayoutMap.get(t)}},Logger:n=>{Ho||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Cn.enableAll():Cn.setDefaultLevel("warn"),Ho=!0);const e=n||"default";return Cn.getLogger(e)}},Fo="access_token",qe=new _t("user",localStorage);function De(){return qe.get(Fo)}function En(){qe.remove(Fo)}function qo(){return De()?.refresh}function kn(n,e,t,o="json",r){const i={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:n,paramsSerializer:{serialize:function(s){return Fi.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+De()?.token},responseType:o,cancelToken:r};if(t)for(let s in t)i.headers[s]=t[s];return B.SystemID&&(i.headers.sysid=B.SystemID,B.SystemGroup&&(i.headers.sysgroup=B.SystemGroup)),e!==void 0&&(i.baseURL=e),i}function me(n,e,t,o,r="json",i,s){const c=kn(t,e,o,r,i);return s&&s>=2e4&&(c.timeout=s),B.Axios?.get(n,c).catch(function(u){Ct(u,c.baseURL,n,"Get")})}function Ct(n,e,t,o="Get"){const r=`${e}${t}`;if(n&&n.response){let i=!1;const s=n.response.status;switch(s){case 400:n.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:n.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:n.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:n.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:n.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:n.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const u=n.response.data;if(u){const g=u.indexOf(":"),S=u.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`),i=0;i<r.length;i++){var s=r[i],c=s.indexOf(":"),u=n(s.slice(0,c)).toLowerCase(),g=n(s.slice(c+1));o[u]===void 0?o[u]=g:(t=o[u],Object.prototype.toString.call(t)==="[object Array]"?o[u].push(g):o[u]=[o[u],g])}return o},In}var js=function(){if(er)return Et.exports;er=1;var n=Ws(),e=Us(),t=Os(),o=function(){if(Qo)return Tn;Qo=1,Tn=function(){for(var u={},g=0;g<arguments.length;g++){var S=arguments[g];for(var C in S)c.call(S,C)&&(u[C]=S[C])}return u};var c=Object.prototype.hasOwnProperty;return Tn}();function r(c,u,g){var S=c;return e(u)?(g=u,typeof c=="string"&&(S={uri:c})):S=o(u,{uri:c}),S.callback=g,S}function i(c,u,g){return s(u=r(c,u,g))}function s(c){if(c.callback===void 0)throw new Error("callback argument missing");var u=!1,g=function(z,W,O){u||(u=!0,c.callback(z,W,O))};function S(){var z=void 0;if(z=f.response?f.response:f.responseText||function(W){try{if(W.responseType==="document")return W.responseXML;var O=W.responseXML&&W.responseXML.documentElement.nodeName==="parsererror";if(W.responseType===""&&!O)return W.responseXML}catch{}return null}(f),A)try{z=JSON.parse(z)}catch{}return z}function C(z){return clearTimeout(l),z instanceof Error||(z=new Error(""+(z||"Unknown XMLHttpRequest Error"))),z.statusCode=0,g(z,T)}function N(){if(!M){var z;clearTimeout(l),z=c.useXDR&&f.status===void 0?200:f.status===1223?204:f.status;var W=T,O=null;return z!==0?(W={body:S(),statusCode:z,method:m,headers:{},url:v,rawRequest:f},f.getAllResponseHeaders&&(W.headers=t(f.getAllResponseHeaders()))):O=new Error("Internal XMLHttpRequest Error"),g(O,W,W.body)}}var D,M,f=c.xhr||null;f||(f=c.cors||c.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var l,v=f.url=c.uri||c.url,m=f.method=c.method||"GET",p=c.body||c.data,y=f.headers=c.headers||{},L=!!c.sync,A=!1,T={body:void 0,headers:{},statusCode:0,method:m,url:v,rawRequest:f};if("json"in c&&c.json!==!1&&(A=!0,y.accept||y.Accept||(y.Accept="application/json"),m!=="GET"&&m!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),p=JSON.stringify(c.json===!0?p:c.json))),f.onreadystatechange=function(){f.readyState===4&&setTimeout(N,0)},f.onload=N,f.onerror=C,f.onprogress=function(){},f.onabort=function(){M=!0},f.ontimeout=C,f.open(m,v,!L,c.username,c.password),L||(f.withCredentials=!!c.withCredentials),!L&&c.timeout>0&&(l=setTimeout(function(){if(!M){M=!0,f.abort("timeout");var z=new Error("XMLHttpRequest timeout");z.code="ETIMEDOUT",C(z)}},c.timeout)),f.setRequestHeader)for(D in y)y.hasOwnProperty(D)&&f.setRequestHeader(D,y[D]);else if(c.headers&&!function(z){for(var W in z)if(z.hasOwnProperty(W))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(f.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(f),f.send(p||null),f}return Et.exports=i,Et.exports.default=i,i.XMLHttpRequest=n.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:n.XDomainRequest,function(c,u){for(var g=0;g<c.length;g++)u(c[g])}(["get","put","post","patch","head","delete"],function(c){i[c==="delete"?"del":c]=function(u,g,S){return(g=r(u,g,S)).method=c.toUpperCase(),s(g)}}),Et.exports}(),Hs=bt(js);const Fs=[200,201,202,204,308],qs=[408,502,503,504];class tr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=bn(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(e,t){this.eventTarget.on(e,t)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,t){this.eventTarget.emit(e,t)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{const t=this.totalChunks===1?this.file.size:this.chunkByteSize,o=t*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+t))})}xhrPromise(e){const t=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,c=i*this.chunkCount,u=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(c+u,100))}};return new Promise((o,r)=>{this.currentXhr=Hs({...e,beforeSend:t},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,t=e+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${t}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:o,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&Fs.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const t=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",t)}else if(e!=null&&qs.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const Xs=n=>new tr(n),Vs=new class{hasClass(n,e){return n.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(n,e){this.hasClass(n,e)||(n.className+=" "+e)}removeClass(n,e){if(this.hasClass(n,e)){const t=new RegExp("(\\s|^)"+e+"(\\s|$)");n.className=n.className.replace(t," ")}}toggleClass(n,e){this.hasClass(n,e)?this.removeClass(n,e):this.addClass(n,e)}setCSSProperty(n,e,t){n?.style.setProperty(e,t)}};class ct{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!Je.isNullOrEmpty(e)){if(ct.httpTransport||(ct.httpTransport=new Vi),this.client=new qi(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):Ae.emit(se.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,t,o){if(this.client)return await this.client.invoke(e,t,o)}encode(e,t,o){if(this.client)return this.client.codec.encode(e,t,o)}decode(e,t){if(this.client)return this.client.codec.decode(e,t)}}class Ze{hproseClient;hpProxyObj;defaultContext=new nn;constructor(e){this.hproseClient=new ct(e),this.hpProxyObj=null}getClientContext(e,t){const o={};t&&(o.requestHeaders=t);const r=De();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),B.SystemID&&(i.sysid=B.SystemID,B.SystemGroup&&(i.sysgroup=B.SystemGroup)),new nn(o)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||Ae.emit(se.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,t,o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(e,t,o)}async hproseInvokeContext(e,t,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=De();return console.log(r,"userToken3"),r&&(t||(t=new nn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,t)}async hproseInvokeEncode(e){const t=new ke(e).toBytes(),o=await this.hproseClient.client?.request(t,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(e,...t){const o=this.hproseClient.client?.codec?.encode(e,t,this.defaultContext);return ke.toString(o)}}const Rn=new Map,Gs=function(n,e,t){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&Je.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new Ze(B.Config.DefaultHproseAPI));const o=B.Config.UI.GrayMode;o&&he.setGrayMode(o);const r=new jo(n,B.EventBus);B.Message=r,B.SystemID=e,B.SystemGroup=t,B.EventBus.on(se.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(se.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(se.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),B.EventBus.on(se.CommonWarnEvent,i=>{r.warn(i)})};function nr(n){if(n&&Je.isNotEmpty(n)){if(Rn.has(n))return Rn.get(n);{const e=new Ze(n);return Rn.set(n,e),e}}}function Ks(n){const e=nr(n);return e&&(B.DefaultProxyClient=e),e}const Le=So({isLock:!1,lockTime:0});function kt(n){Le.isLock=n,n&&(En(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Js(){return Le.isLock}let Pn;function Qe(){clearInterval(Pn),!(window.location.href.indexOf("/login")>0||Le.isLock)&&(kt(!1),Le.lockTime=function(){let n=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(n=B.Config.UI.LockTime),n}(),Pn=setInterval(()=>{if(Le.lockTime--,Le.lockTime<=0)return kt(!0),clearInterval(Pn)},1e3))}function Ys(){Qe(),document.addEventListener("mousedown",Qe),document.addEventListener("mousemove",Qe)}function Zs(){document.removeEventListener("mousedown",Qe),document.removeEventListener("mousemove",Qe)}function Mn(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var or,rr={exports:{}};/*!
|
|
1
|
+
import{h as ma,openBlock as V,createElementBlock as Te,normalizeStyle as ze,renderSlot as me,defineComponent as Ze,ref as ne,withModifiers as $o,reactive as Bo,getCurrentInstance as va,computed as vt,watch as et,onMounted as er,onBeforeUnmount as ya,nextTick as No,resolveComponent as Zt,createBlock as ue,Transition as Wo,withCtx as Ne,withDirectives as Uo,createElementVNode as ie,Fragment as tt,createTextVNode as tr,toDisplayString as nr,createCommentVNode as pe,vShow as Fo,markRaw as wa,onErrorCaptured as ba,Suspense as _a,createVNode as en,KeepAlive as Oo,resolveDynamicComponent as We,toRefs as Sa,renderList as yt,normalizeClass as nt,TransitionGroup as Ca,onUnmounted as Ea,unref as rr}from"vue";import ka from"axios";import xa from"qs";import{Client as Ia,ClientContext as or}from"@hprose/rpc-core";import{ByteStream as Ve,Writer as ir,Reader as sr,ValueReader as Ta}from"@hprose/io";import{HttpTransport as Ra}from"@hprose/rpc-html5";import{Icon as ar}from"@iconify/vue";var Pa={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((r,o)=>(r.size=o===e?r.max:r.min,o!==e&&(n+=r.min),r)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:r}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:r-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const r=0+(this.pushOtherPanes?0:n.prevPanesSize),o=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),o),r);let s=[e,e+1],a=this.panes[s[0]]||null,c=this.panes[s[1]]||null;const u=a.max<100&&i>=a.max+n.prevPanesSize,m=c.max<100&&i<=100-(c.max+this.sumNextPanesSize(e+1));if(u||m)u?(a.size=a.max,c.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-c.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),c.size=c.max);else{if(this.pushOtherPanes){const b=this.doPushOtherPanes(n,i);if(!b)return;({sums:n,panesToResize:s}=b),a=this.panes[s[0]]||null,c=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),c!==null&&(c.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,c.min),c.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,r=[n,n+1];return e<t.prevPanesSize+this.panes[r[0]].min&&(r[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,r[0]<n&&this.panes.forEach((o,i)=>{i>r[0]&&i<=n&&(o.size=o.min,t.prevReachedMinPanes+=o.min)}),t.prevPanesSize=this.sumPrevPanesSize(r[0]),r[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((o,i)=>{i>0&&i<=n&&(o.size=o.min,t.prevReachedMinPanes+=o.min)}),this.panes[r[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[r[1]].min&&(r[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,r[1]>n+1&&this.panes.forEach((o,i)=>{i>n&&i<r[1]&&(o.size=o.min,t.nextReachedMinPanes+=o.min)}),t.nextPanesSize=this.sumNextPanesSize(r[1]-1),r[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((o,i)=>{i<this.panesCount-1&&i>=n+1&&(o.size=o.min,t.nextReachedMinPanes+=o.min)}),this.panes[r[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:r}},sumPrevPanesSize(t){return this.panes.reduce((e,n,r)=>e+(r<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,r)=>e+(r>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const r=t-1,o=document.createElement("div");o.classList.add("splitpanes__splitter"),n||(o.onmousedown=i=>this.onMouseDown(i,r),typeof window<"u"&&"ontouchstart"in window&&(o.ontouchstart=i=>this.onMouseDown(i,r)),o.onclick=i=>this.onSplitterClick(i,r+1)),this.dblClickSplitter&&(o.ondblclick=i=>this.onSplitterDblClick(i,r+1)),e.parentNode.insertBefore(o,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([r,o])=>n[r]=o)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(o=>(o.className.includes("splitpanes__pane")&&e++,o===t.$el));const n=parseFloat(t.minSize),r=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(r)?100:r,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((o,i)=>o.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(r=>r.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((r,o)=>r.index=o),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],r=[];this.panes.forEach(o=>{o.size=Math.max(Math.min(t,o.max),o.min),e-=o.size,o.size>=o.max&&n.push(o.id),o.size<=o.min&&r.push(o.id)}),e>.1&&this.readjustSizes(e,n,r)},initialPanesSizing(){let t=100;const e=[],n=[];let r=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&r++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let o=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-r),i.max),i.min)),o-=i.size}),o>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const r=[],o=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&o.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,i.max),i.min)),n-=i.size,i.size>=i.max&&r.push(i.id),i.size<=i.min&&o.push(i.id)}),n>.1&&this.readjustSizes(n,r,o))},readjustSizes(t,e,n){let r;r=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(o=>{if(t>0&&!e.includes(o.id)){const i=Math.max(Math.min(o.size+r,o.max),o.min),s=i-o.size;t-=s,o.size=i}else if(!n.includes(o.id)){const i=Math.max(Math.min(o.size+r,o.max),o.min),s=i-o.size;t-=s,o.size=i}o.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[o.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?r=>this.onSplitterDblClick(r,n):void 0})}},beforeUnmount(){this.ready=!1},mounted(){this.container=this.$refs.container,this.checkSplitpanesNodes(),this.redoSplitters(),this.resetPaneSizes(),this.updatePaneComponents(),this.$emit("ready"),this.ready=!0},render(){return ma("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},cr={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};function lr(t){return window.TouchEvent&&t instanceof TouchEvent}cr.render=function(t,e,n,r,o,i){return V(),Te("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:ze(t.style)},[me(t.$slots,"default")],4)},cr.__file="src/controls/splitpanes/pane.vue";class ke{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return lr(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return lr(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new fo(this.clientX,this.clientY)}static bindDown(e,n,r,o=!1){const i=a=>{n(new ke(a))},s=a=>{a.touches.length===1&&n(new ke(a)),a.touches.length>1&&r&&r(new ke(a))};return e.addEventListener("mousedown",i,o),e.addEventListener("touchstart",s,o),()=>{e.removeEventListener("mousedown",i,o),e.removeEventListener("touchstart",s,o)}}static bindMove(e,n,r=!1){const o=s=>{n(new ke(s))},i=s=>{s.touches.length===1&&n(new ke(s))};return e.addEventListener("mousemove",o,r),e.addEventListener("touchmove",i,r),()=>{e.removeEventListener("mousemove",o,r),e.removeEventListener("touchmove",i,r)}}static bindUp(e,n,r=!1){const o=s=>{n(new ke(s))},i=s=>{s.touches.length===0&&n(new ke(s))};return e.addEventListener("mouseup",o,r),e.addEventListener("touchend",i,r),()=>{e.removeEventListener("mouseup",o,r),e.removeEventListener("touchend",i,r)}}originalEvent({mouse:e,touch:n}){lr(this.e)?n&&n(this.e):e&&e(this.e)}}class fo{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new fo(this.x,this.y)}}class za{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,r={}){this.handle=e,this.container=n,this.options=r,e&&(this.unbindDown=ke.bindDown(e,this.mousedown),e.classList.add("draggable-handle"))}teardown(){this.handle?.classList.remove("draggable-handle"),this.unbindDown&&this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove()}offsetX;offsetY;mousedown=e=>{e.preventDefault(),this.handle&&(this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=ke.bindMove(document,this.mousemove),this.unbindUp=ke.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=`calc(${e.clientX-this.offsetX}px + ${this.container.style.left})`,this.container.style.top=`calc(${e.clientY-this.offsetY}px + ${this.container.style.top})`,this.offsetX=e.clientX,this.offsetY=e.clientY),this.options.onMove&&this.options.onMove()};mouseup=e=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ma{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(r=>r.push(this))}set group(e){this._group=e;const n=nn(this._group),r=nn(e);n.splice(n.indexOf(this),1),r.push(this),jo()}get group(){return this._group}unregister(){this.a(e=>e.splice(e.indexOf(this),1))}raise(){this.a(e=>{e.splice(e.indexOf(this),1),e.push(this)})}a(e){e(nn(this._group)),jo()}}const tn=new Map,Aa=0;function nn(t){return tn.has(t)||tn.set(t,[]),tn.get(t)}function Ho(t,e){return t>e?-Ho(e,t):t<0&&e>=0?1:t-e}function jo(){let t=Aa;for(const e of function(n){const r=[];return n.forEach((o,i)=>r.push(i)),r}(tn).sort(Ho))for(const n of nn(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function ur(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const r=rn(t);return t.style.width=e,t.style.height=n,r}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function rn(t){const e=t.getBoundingClientRect(),n=e.width,r=e.height,o=e.top,i=e.left;return{width:n,height:r,top:o,left:i,bottom:o+r,right:i+n}}class Da{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=qo.map(c=>new c(e,this));const{width:r,height:o}=ur(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(r<n.minWidth||r>i)&&(e.style.width=`${Xo(r,n.minWidth,i)}px`,a=!0),(o<n.minHeight||o>s)&&(e.style.height=`${Xo(o,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const qo=[];class Ke{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ke.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:r,width:o,height:i}=rn(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=r,this.width0=o,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=ke.bindMove(document,this.mousemove),this.unbindUp=ke.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:r,bottom:o}=rn(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(r-s,0),this.maxLeft=r-i.minWidth,this.minRight=e+i.minWidth,this.maxRight=Math.min(e+s,window.innerWidth),this.minTop=Math.max(o-a,0),this.maxTop=o-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=e=>{e.preventDefault(),e.stopPropagation(),this.setPosition(e),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:e,height:n,left:r,top:o,right:i,bottom:s}=rn(this.container),a=this.helper.options;a&&(r<this.minLeft?(this.container.style.width=e+r-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):r>this.maxLeft?(this.container.style.width=`${a.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):i<this.minRight?this.container.style.width=`${a.minWidth}px`:i>this.maxRight&&(this.container.style.width=this.maxRight-r+"px"),o<this.minTop?(this.container.style.height=n+o-this.minTop+"px",this.container.style.top=`${this.minTop}px`):o>this.maxTop?(this.container.style.height=`${a.minHeight}px`,this.container.style.top=`${this.maxTop}px`):s<this.minBottom?this.container.style.height=`${a.minHeight}px`:s>this.maxBottom&&(this.container.style.height=this.maxBottom-o+"px"))}mouseup=e=>{e.preventDefault(),e.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function Xo(t,e,n){return t<e?e:t>n?n:t}qo.push(class extends Ke{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends Ke{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends Ke{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends Ke{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends Ke{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends Ke{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends Ke{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends Ke{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var on=Ze({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=ne(!1),n=ne(!1);return{hover:e,active:n,style:function(){let r=t.windowStyle.button;return e.value&&(r={...r,...this.windowStyle.buttonHover}),n.value&&(r={...r,...this.windowStyle.buttonActive}),r},mouseup:function(r){this.active&&this.$emit("click")},mousedown:function(r){r.preventDefault(),n.value=!0;const o=ke.bindUp(document,()=>{n.value=!1,o()})}}}});const La=["disabled"];on.render=function(t,e,n,r,o,i){return V(),Te("div",{class:"btn",style:ze(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=$o((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=$o((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[me(t.$slots,"default")],44,La)},on.__scopeId="data-v-71662210",on.__file="src/controls/vuewindow/window/Button.vue";var wt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sn(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Go,Vo={exports:{}},$a=(Go||(Go=1,Vo.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(d,h){var w=d[0],p=d[1],f=d[2],y=d[3];p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&f|~p&y)+h[0]-680876936|0)<<7|w>>>25)+p|0)&p|~w&f)+h[1]-389564586|0)<<12|y>>>20)+w|0)&w|~y&p)+h[2]+606105819|0)<<17|f>>>15)+y|0)&y|~f&w)+h[3]-1044525330|0)<<22|p>>>10)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&f|~p&y)+h[4]-176418897|0)<<7|w>>>25)+p|0)&p|~w&f)+h[5]+1200080426|0)<<12|y>>>20)+w|0)&w|~y&p)+h[6]-1473231341|0)<<17|f>>>15)+y|0)&y|~f&w)+h[7]-45705983|0)<<22|p>>>10)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&f|~p&y)+h[8]+1770035416|0)<<7|w>>>25)+p|0)&p|~w&f)+h[9]-1958414417|0)<<12|y>>>20)+w|0)&w|~y&p)+h[10]-42063|0)<<17|f>>>15)+y|0)&y|~f&w)+h[11]-1990404162|0)<<22|p>>>10)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&f|~p&y)+h[12]+1804603682|0)<<7|w>>>25)+p|0)&p|~w&f)+h[13]-40341101|0)<<12|y>>>20)+w|0)&w|~y&p)+h[14]-1502002290|0)<<17|f>>>15)+y|0)&y|~f&w)+h[15]+1236535329|0)<<22|p>>>10)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&y|f&~y)+h[1]-165796510|0)<<5|w>>>27)+p|0)&f|p&~f)+h[6]-1069501632|0)<<9|y>>>23)+w|0)&p|w&~p)+h[11]+643717713|0)<<14|f>>>18)+y|0)&w|y&~w)+h[0]-373897302|0)<<20|p>>>12)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&y|f&~y)+h[5]-701558691|0)<<5|w>>>27)+p|0)&f|p&~f)+h[10]+38016083|0)<<9|y>>>23)+w|0)&p|w&~p)+h[15]-660478335|0)<<14|f>>>18)+y|0)&w|y&~w)+h[4]-405537848|0)<<20|p>>>12)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&y|f&~y)+h[9]+568446438|0)<<5|w>>>27)+p|0)&f|p&~f)+h[14]-1019803690|0)<<9|y>>>23)+w|0)&p|w&~p)+h[3]-187363961|0)<<14|f>>>18)+y|0)&w|y&~w)+h[8]+1163531501|0)<<20|p>>>12)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p&y|f&~y)+h[13]-1444681467|0)<<5|w>>>27)+p|0)&f|p&~f)+h[2]-51403784|0)<<9|y>>>23)+w|0)&p|w&~p)+h[7]+1735328473|0)<<14|f>>>18)+y|0)&w|y&~w)+h[12]-1926607734|0)<<20|p>>>12)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p^f^y)+h[5]-378558|0)<<4|w>>>28)+p|0)^p^f)+h[8]-2022574463|0)<<11|y>>>21)+w|0)^w^p)+h[11]+1839030562|0)<<16|f>>>16)+y|0)^y^w)+h[14]-35309556|0)<<23|p>>>9)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p^f^y)+h[1]-1530992060|0)<<4|w>>>28)+p|0)^p^f)+h[4]+1272893353|0)<<11|y>>>21)+w|0)^w^p)+h[7]-155497632|0)<<16|f>>>16)+y|0)^y^w)+h[10]-1094730640|0)<<23|p>>>9)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p^f^y)+h[13]+681279174|0)<<4|w>>>28)+p|0)^p^f)+h[0]-358537222|0)<<11|y>>>21)+w|0)^w^p)+h[3]-722521979|0)<<16|f>>>16)+y|0)^y^w)+h[6]+76029189|0)<<23|p>>>9)+f|0,p=((p+=((f=((f+=((y=((y+=((w=((w+=(p^f^y)+h[9]-640364487|0)<<4|w>>>28)+p|0)^p^f)+h[12]-421815835|0)<<11|y>>>21)+w|0)^w^p)+h[15]+530742520|0)<<16|f>>>16)+y|0)^y^w)+h[2]-995338651|0)<<23|p>>>9)+f|0,p=((p+=((y=((y+=(p^((w=((w+=(f^(p|~y))+h[0]-198630844|0)<<6|w>>>26)+p|0)|~f))+h[7]+1126891415|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~p))+h[14]-1416354905|0)<<15|f>>>17)+y|0)|~w))+h[5]-57434055|0)<<21|p>>>11)+f|0,p=((p+=((y=((y+=(p^((w=((w+=(f^(p|~y))+h[12]+1700485571|0)<<6|w>>>26)+p|0)|~f))+h[3]-1894986606|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~p))+h[10]-1051523|0)<<15|f>>>17)+y|0)|~w))+h[1]-2054922799|0)<<21|p>>>11)+f|0,p=((p+=((y=((y+=(p^((w=((w+=(f^(p|~y))+h[8]+1873313359|0)<<6|w>>>26)+p|0)|~f))+h[15]-30611744|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~p))+h[6]-1560198380|0)<<15|f>>>17)+y|0)|~w))+h[13]+1309151649|0)<<21|p>>>11)+f|0,p=((p+=((y=((y+=(p^((w=((w+=(f^(p|~y))+h[4]-145523070|0)<<6|w>>>26)+p|0)|~f))+h[11]-1120210379|0)<<10|y>>>22)+w|0)^((f=((f+=(w^(y|~p))+h[2]+718787259|0)<<15|f>>>17)+y|0)|~w))+h[9]-343485551|0)<<21|p>>>11)+f|0,d[0]=w+d[0]|0,d[1]=p+d[1]|0,d[2]=f+d[2]|0,d[3]=y+d[3]|0}function r(d){var h,w=[];for(h=0;h<64;h+=4)w[h>>2]=d.charCodeAt(h)+(d.charCodeAt(h+1)<<8)+(d.charCodeAt(h+2)<<16)+(d.charCodeAt(h+3)<<24);return w}function o(d){var h,w=[];for(h=0;h<64;h+=4)w[h>>2]=d[h]+(d[h+1]<<8)+(d[h+2]<<16)+(d[h+3]<<24);return w}function i(d){var h,w,p,f,y,M,D=d.length,z=[1732584193,-271733879,-1732584194,271733878];for(h=64;h<=D;h+=64)n(z,r(d.substring(h-64,h)));for(w=(d=d.substring(h-64)).length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0;h<w;h+=1)p[h>>2]|=d.charCodeAt(h)<<(h%4<<3);if(p[h>>2]|=128<<(h%4<<3),h>55)for(n(z,p),h=0;h<16;h+=1)p[h]=0;return f=(f=8*D).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(f[2],16),M=parseInt(f[1],16)||0,p[14]=y,p[15]=M,n(z,p),z}function s(d){var h,w,p,f,y,M,D=d.length,z=[1732584193,-271733879,-1732584194,271733878];for(h=64;h<=D;h+=64)n(z,o(d.subarray(h-64,h)));for(w=(d=h-64<D?d.subarray(h-64):new Uint8Array(0)).length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h=0;h<w;h+=1)p[h>>2]|=d[h]<<(h%4<<3);if(p[h>>2]|=128<<(h%4<<3),h>55)for(n(z,p),h=0;h<16;h+=1)p[h]=0;return f=(f=8*D).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(f[2],16),M=parseInt(f[1],16)||0,p[14]=y,p[15]=M,n(z,p),z}function a(d){var h,w="";for(h=0;h<4;h+=1)w+=e[d>>8*h+4&15]+e[d>>8*h&15];return w}function c(d){var h;for(h=0;h<d.length;h+=1)d[h]=a(d[h]);return d.join("")}function u(d){return/[\u0080-\uFFFF]/.test(d)&&(d=unescape(encodeURIComponent(d))),d}function m(d,h){var w,p=d.length,f=new ArrayBuffer(p),y=new Uint8Array(f);for(w=0;w<p;w+=1)y[w]=d.charCodeAt(w);return h?y:f}function b(d){return String.fromCharCode.apply(null,new Uint8Array(d))}function E(d,h,w){var p=new Uint8Array(d.byteLength+h.byteLength);return p.set(new Uint8Array(d)),p.set(new Uint8Array(h),d.byteLength),w?p:p.buffer}function R(d){var h,w=[],p=d.length;for(h=0;h<p-1;h+=2)w.push(parseInt(d.substr(h,2),16));return String.fromCharCode.apply(String,w)}function P(){this.reset()}return c(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function d(h,w){return(h=0|h||0)<0?Math.max(h+w,0):Math.min(h,w)}ArrayBuffer.prototype.slice=function(h,w){var p,f,y,M,D=this.byteLength,z=d(h,D),k=D;return w!==t&&(k=d(w,D)),z>k?new ArrayBuffer(0):(p=k-z,f=new ArrayBuffer(p),y=new Uint8Array(f),M=new Uint8Array(this,z,p),y.set(M),f)}}(),P.prototype.append=function(d){return this.appendBinary(u(d)),this},P.prototype.appendBinary=function(d){this._buff+=d,this._length+=d.length;var h,w=this._buff.length;for(h=64;h<=w;h+=64)n(this._hash,r(this._buff.substring(h-64,h)));return this._buff=this._buff.substring(h-64),this},P.prototype.end=function(d){var h,w,p=this._buff,f=p.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(h=0;h<f;h+=1)y[h>>2]|=p.charCodeAt(h)<<(h%4<<3);return this._finish(y,f),w=c(this._hash),d&&(w=R(w)),this.reset(),w},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(d){return this._buff=d.buff,this._length=d.length,this._hash=d.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(d,h){var w,p,f,y=h;if(d[y>>2]|=128<<(y%4<<3),y>55)for(n(this._hash,d),y=0;y<16;y+=1)d[y]=0;w=(w=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(w[2],16),f=parseInt(w[1],16)||0,d[14]=p,d[15]=f,n(this._hash,d)},P.hash=function(d,h){return P.hashBinary(u(d),h)},P.hashBinary=function(d,h){var w=c(i(d));return h?R(w):w},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(d){var h,w=E(this._buff.buffer,d,!0),p=w.length;for(this._length+=d.byteLength,h=64;h<=p;h+=64)n(this._hash,o(w.subarray(h-64,h)));return this._buff=h-64<p?new Uint8Array(w.buffer.slice(h-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(d){var h,w,p=this._buff,f=p.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(h=0;h<f;h+=1)y[h>>2]|=p[h]<<(h%4<<3);return this._finish(y,f),w=c(this._hash),d&&(w=R(w)),this.reset(),w},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var d=P.prototype.getState.call(this);return d.buff=b(d.buff),d},P.ArrayBuffer.prototype.setState=function(d){return d.buff=m(d.buff,!0),P.prototype.setState.call(this,d)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(d,h){var w=c(s(new Uint8Array(d)));return h?R(w):w},P}()),Vo.exports),hr=sn($a);const Ko=Object.prototype.toString;function Ce(t,e){return Ko.call(t)===`[object ${e}]`}function an(t){return Ce(t,"Function")}const Yo=t=>typeof t<"u",dr=t=>!Yo(t);function fr(t){return t===null}function Ba(t){return dr(t)&&fr(t)}function Na(t){return dr(t)||fr(t)}const rt=t=>t!=null&&t!==null&&Ce(t,"Object");function Wa(t){return Ce(t,"Date")}function pr(t){return Ce(t,"Number")}function Ua(t){return Ce(t,"AsyncFunction")}function Fa(t){return Ce(t,"Promise")&&rt(t)&&an(t.then)&&an(t.catch)}function bt(t){return Ce(t,"String")}function Oa(t){return t===!0||t===!1||Ce(t,"Boolean")}function cn(t){return t&&Array.isArray(t)}const Ha=()=>typeof window<"u",ja=t=>typeof window<"u"&&Ce(t,"Window"),Jo=t=>Ko.call(t).startsWith("[object HTML")&&!!t.tagName,qa=typeof window>"u";function Xa(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function Ga(t){return t==null||(bt(t)||cn(t)?t.length===0:!!rt(t)&&JSON.stringify(t)==="{}")}function Va(t){return Ce(t,"Error")}function Ka(t){return Ce(t,"WeakSet")}function Ya(t){return Ce(t,"WeakMap")}function Ja(t){return Ce(t,"Symbol")}function Qa(t){return Ce(t,"Map")}const Qo=t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t);function Zo(t){return/^\s*[{[]/.test(String(t))}function ei(t){return t.includes("<kml ")&&t.includes('xmlns="http://www.opengis.net/kml/')}const gr=[];let ln;class ce{static addHandler(e,n,r){e.addEventListener?e.addEventListener(n,r,!1):e.attachEvent?e.attachEvent("on"+n,r):e["on"+n]=r}static removeHandler(e,n,r){e.removeEventListener?e.removeEventListener(n,r,!1):e.detachEvent?e.detachEvent("on"+n,r):delete e["on"+n]}static windowResizeHandler(e){ce.addHandler(window,"resize",e)}static offWindowResizeHandler(e){ce.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,n){if(n){const r=window.document;let o=window.document.exitFullscreen||r.msExitFullscreen||r.mozCancelFullScreen||r.webkitCancelFullScreen;typeof o<"u"&&o?o.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let r=e;r||(r=window.document.documentElement);let o=r.requestFullScreen||r.webkitRequestFullScreen||r.mozRequestFullScreen||r.msRequestFullScreen;typeof o<"u"&&o?o.call(r):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let n=e;var r=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(r)r.call(n);else if(typeof window.ActiveXObject<"u"){var o=new window.ActiveXObject("WScript.Shell");o!==null&&o.SendKeys("{F11}")}}static exitFullScreen(){const e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ce.fullScreenElement()}static onFullScreenChanged(e){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const r=ce.isFullScreen();e(r)}):document.addEventListener("MSFullscreenChange",function(){const r=ce.isFullScreen();e(r)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(gr.indexOf(n)!==-1)return;gr.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,ce.stringifyCircularHandler);return gr.length=0,n}static jsonParse(e){const n=ce.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const r=window;return r.createObjcectURL!=null?n=r.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const r=File.prototype,o=r.slice||r.mozSlice||r.webkitSlice,i=e,s=2097152,a=new hr.ArrayBuffer,c=new FileReader;c.onload=function(u){a.append(u.target?.result);const m=a.end();n({isOK:!0,data:m})},c.onerror=function(){const u="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(u),n({isOK:!1,data:u})},function(){const u=0+s>=i.size?i.size:0+s;c.readAsArrayBuffer(o.call(i,0,u))}()}static getFileMD5(e,n){const r=File.prototype,o=r.slice||r.mozSlice||r.webkitSlice,i=e,s=2097152,a=Math.ceil(i.size/s);let c=0;const u=new hr.ArrayBuffer,m=new FileReader;function b(){const E=c*s,R=E+s>=i.size?i.size:E+s;m.readAsArrayBuffer(o.call(i,E,R))}m.onload=function(E){if(u.append(E.target?.result),c++,c<a)b();else{const R=u.end();n({isOK:!0,data:R})}},m.onerror=function(){const E=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(E),n({isOK:!1,data:E})},b()}static MD5(e,n=!1){return hr.hash(e,n)}static copyTextByCommand(e){return new Promise((n,r)=>{const o=document.createElement("input");o.value=e,document.body.appendChild(o),o.select(),document.execCommand("copy"),o.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):ce.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));const r=window.getSelection();r.rangeCount>0&&r.removeAllRanges(),r.addRange(n);try{return document.execCommand("copy"),r.removeRange(n),!0}catch(o){return r.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",o),!1}}static copyElementText(e){if(!navigator.clipboard)return ce.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));const r=window.getSelection();return r.rangeCount>0&&r.removeAllRanges(),r.addRange(n),navigator.clipboard.writeText(r).then(function(){return r.removeRange(n),!0},function(o){return r.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",o),!1})}static setGrayMode(e){ce.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,r){const o=r||document.body;let{className:i}=o;i=i.replace(n,""),o.className=e?`${i} ${n} `:i}static setCssVar(e,n,r=document.documentElement){r.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",r){let o;if(o=bt(e)?document.getElementById(e):e,o){const i=new Event(n,{bubbles:!0,cancelable:!0});r&&o.addEventListener("ev",s=>{r(s)},!1),o.dispatchEvent(i)}}static getRandomNum(e,n){var r=n-e,o=Math.random();return e+Math.round(o*r)}static merge(e={},n={}){let r,o,i,s;for(e||(e={}),o=0,i=n.length;o<i;o++)for(r in s=n[o],s)e[r]=s[r];return e}static setOptions(e,n){e.hasOwnProperty("options")||(e.options=e.options?Object.create(e.options):{});for(let r in n)e.options[r]=n[r];return e.options}static formatNum(e,n){let r=Math.pow(10,n===void 0?6:n);return Math.round(e*r)/r}static trim(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}static splitWords(e){return this.trim(e).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(e,n){let r=null;return function(){r&&clearTimeout(r),r=setTimeout(e,n)}}static throttle(e,n){let r=!0;return function(){if(!r)return!1;r=!1,setTimeout(()=>{e(),r=!0},n)}}static dataURLtoBlob(e){let n=e.split(",");if(!n||n.length===0)return;let r=n[0].match(/:(.*?);/)[1],o=atob(n[1]),i=o.length,s=new Uint8Array(i);for(;i--;)s[i]=o.charCodeAt(i);return new Blob([s],{type:r})}static getElement(e){return typeof e=="string"?document.getElementById(e):e}static getStyle(e,n){let r=e.style[n]||e.currentStyle&&e.currentStyle[n];if((!r||r==="auto")&&document.defaultView){let o=document.defaultView.getComputedStyle(e,null);r=o?o[n]:null}return r==="auto"?null:r}static create(e,n,r){let o=document.createElement(e);return o.className=n||"",r&&r.appendChild(o),o}static removeElement(e){let n=e.parentNode;n&&n.removeChild(e)}static emptyElement(e){for(;e.firstChild;)e.removeChild(e.firstChild)}static hasClass(e,n){if(e.classList!==void 0)return e.classList.contains(n);let r=this.getClass(e);return r.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(r)}static addClass(e,n){if(e.classList!==void 0){let r=this.splitWords(n);for(let o=0,i=r.length;o<i;o++)e.classList.add(r[o])}else if(!this.hasClass(e,n)){let r=this.getClass(e);this.setClass(e,(r?r+" ":"")+n)}}static removeClass(e,n){e.classList!==void 0?e.classList.remove(n):this.setClass(e,this.trim((" "+this.getClass(e)+" ").replace(" "+n+" "," ")))}static setClass(e,n){e.className.baseVal===void 0?e.className=n:e.className.baseVal=n}static getClass(e){return e.correspondingElement&&(e=e.correspondingElement),e.className.baseVal===void 0?e.className:e.className.baseVal}static createSvgElement(e,n,r,o){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",e),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${e} ${n}`);let s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",r),i.appendChild(s),o&&o.appendChild(i),i}static parseDom(e,n=!0,r=""){n=n??!1;let o=document.createElement("div");return o.className=r||"",o.innerHTML=e,n?o:o.childNodes}static createVideoHTML(e,n,r){let o=this.create("video",n,r),i=this.create("source","",o);i.setAttribute("src",e),i.setAttribute("type","video/map4");let s=this.create("source","",o);return s.setAttribute("src",e),s.setAttribute("type","video/quicktime"),o}static readFilePromise(e,n="ArrayBuffer",r="UTF-8"){return new Promise((o,i)=>{const s=new FileReader;switch(n){case"ArrayBuffer":s.readAsArrayBuffer(e);break;case"Text":s.readAsText(e,r);break;case"BinaryString":s.readAsBinaryString(e);break;case"DataURL":case"FileBytes":s.readAsDataURL(e)}s.onload=function(){if(s.result)if(n==="FileBytes"){const a=s.result,c=a.indexOf("64,"),u=a.substring(c+3);o(u)}else o(s.result);else i(s)},s.onerror=function(){i(s)}})}static readFileBytes(e){return this.readFilePromise(e,"FileBytes")}static promisify(e,...n){return function(){return new Promise((r,o)=>{n.push(function(i,s){i?o(i):r(s)}),e.apply(this,n)})}}static wait(e){return new Promise(n=>setTimeout(n,e))}static blockEvent(e){e.preventDefault(),e.stopPropagation()}static bindDropFileHanlder(e,n){if(!e)throw Error("\u4F20\u5165Element\u5BF9\u8C61\u4E0D\u80FD\u4E3A\u7A7A\uFF01");let r;if(bt(e)){let o=document.getElementById(e);if(o)r=o;else{const i=document.getElementsByClassName(e);if(!i||i.length==0)throw Error("\u672A\u627E\u5230\u5BF9\u5E94id\u6216\u7C7B\u540D\u7684HtmlElement\u5BF9\u8C61\uFF01");o=i[0],r=o}}else{if(!Jo(e))throw Error("ele\u53C2\u6570\u53EA\u80FD\u4E3Astring \u6216 Element\u5BF9\u8C61\uFF01");r=e}r&&(r.addEventListener("dragenter",this.blockEvent,!1),r.addEventListener("dragover",this.blockEvent,!1),r.addEventListener("drop",function(o){ce.blockEvent(o),n(o.dataTransfer.files)},!1))}static getInputElement(){var e=document.activeElement;return!e||e.tagName!="INPUT"&&e.contentEditable!="true"?null:e}static guessPasteTextToFileName(e,n){let r,o=n;return bt(e)?o=(Zo(e)?"json":ei(e)&&"kml")||"text":(rt(e)&&e.type||cn(e))&&(o="json"),o=="text"?r="pasted.txt":o=="kml"?r="pasted.kml":o=="json"&&(r="pasted.json"),r}static pasteEventHanlder(e,n){const r=this;if(r.getInputElement())return;r.blockEvent(e);const o=e.clipboardData,i=Array.from(o.types||[]).join(","),s=Array.from(o.items||[]);let a;if(i.includes("text/plain")){const c=o.getData("text/plain");if(c[1]===":"||Qo(c))return n(c);const u=r.guessPasteTextToFileName(c);if(!u||u==="pasted.txt")return n(c);{const m=new Blob([c]);a=[new File([m],u)]}}else a=s.map(function(c){return c.kind=="file"?c.getAsFile():null});a=a.filter(Boolean),a.length?n(a):n(void 0)}static onPasteHandler(e){const n=this;ln=r=>{n.pasteEventHanlder(r,e)},ce.addHandler(document,"paste",ln)}static offPasteHandler(){ln&&ce.removeHandler(document,"paste",ln)}}class At{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,r)=>r.toUpperCase()).replace("views","")}static getFileName(e){const n=e.lastIndexOf("/")+1;let r=e.substring(n);return r=decodeURI(r.split("?")[0]),r}}class un{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,r=604800){const o=JSON.stringify({value:n,expire:r!==null?new Date().getTime()+1e3*r:null});this.storage.setItem(this.getKey(e),o)}get(e,n=null){const r=this.storage.getItem(this.getKey(e));if(r)try{const o=JSON.parse(r),{value:i,expire:s}=o;if(s===null||s>=Date.now())return i;this.remove(this.getKey(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const r=JSON.parse(n);if(r.expire===null||r.expire>=Date.now())return r;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,r=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${r}`}getCookie(e){const n=document.cookie.split("; ");for(let r=0,o=n.length;r<o;r++){const i=n[r].split("=");if(i[0]===this.getKey(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const Za=new un("",localStorage);function ti(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const o=Math.floor(16*Math.random());t[n]=e.substring(o,o+1)}t[14]="4";const r=3&Number(t[19])|8;return t[19]=e.substring(r,r+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function ec(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?r:3&r|8).toString(16)});return e}var ni={},ee=Uint8Array,Ee=Uint16Array,Dt=Int32Array,_t=new ee([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),St=new ee([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Lt=new ee([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ri=function(t,e){for(var n=new Ee(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];var o=new Dt(n[30]);for(r=1;r<30;++r)for(var i=n[r];i<n[r+1];++i)o[i]=i-n[r]<<5|r;return{b:n,r:o}},oi=ri(_t,2),mr=oi.b,hn=oi.r;mr[28]=258,hn[258]=28;for(var ii=ri(St,0),si=ii.b,vr=ii.r,$t=new Ee(32768),re=0;re<32768;++re){var ot=(43690&re)>>1|(21845&re)<<1;ot=(61680&(ot=(52428&ot)>>2|(13107&ot)<<2))>>4|(3855&ot)<<4,$t[re]=((65280&ot)>>8|(255&ot)<<8)>>1}var Me=function(t,e,n){for(var r=t.length,o=0,i=new Ee(e);o<r;++o)t[o]&&++i[t[o]-1];var s,a=new Ee(e);for(o=1;o<e;++o)a[o]=a[o-1]+i[o-1]<<1;if(n){s=new Ee(1<<e);var c=15-e;for(o=0;o<r;++o)if(t[o])for(var u=o<<4|t[o],m=e-t[o],b=a[t[o]-1]++<<m,E=b|(1<<m)-1;b<=E;++b)s[$t[b]>>c]=u}else for(s=new Ee(r),o=0;o<r;++o)t[o]&&(s[o]=$t[a[t[o]-1]++]>>15-t[o]);return s},Oe=new ee(288);for(re=0;re<144;++re)Oe[re]=8;for(re=144;re<256;++re)Oe[re]=9;for(re=256;re<280;++re)Oe[re]=7;for(re=280;re<288;++re)Oe[re]=8;var Ct=new ee(32);for(re=0;re<32;++re)Ct[re]=5;var ai=Me(Oe,9,0),ci=Me(Oe,9,1),li=Me(Ct,5,0),ui=Me(Ct,5,1),dn=function(t){for(var e=t[0],n=1;n<t.length;++n)t[n]>e&&(e=t[n]);return e},Ae=function(t,e,n){var r=e/8|0;return(t[r]|t[r+1]<<8)>>(7&e)&n},fn=function(t,e){var n=e/8|0;return(t[n]|t[n+1]<<8|t[n+2]<<16)>>(7&e)},Bt=function(t){return(t+7)/8|0},Ye=function(t,e,n){return(e==null||e<0)&&(e=0),(n==null||n>t.length)&&(n=t.length),new ee(t.subarray(e,n))},hi=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],te=function(t,e,n){var r=new Error(e||hi[t]);if(r.code=t,Error.captureStackTrace&&Error.captureStackTrace(r,te),!n)throw r;return r},yr=function(t,e,n,r){var o=t.length,i=r?r.length:0;if(!o||e.f&&!e.l)return n||new ee(0);var s=!n,a=s||e.i!=2,c=e.i;s&&(n=new ee(3*o));var u=function(Qe){var Xe=n.length;if(Qe>Xe){var Se=new ee(Math.max(2*Xe,Qe));Se.set(n),n=Se}},m=e.f||0,b=e.p||0,E=e.b||0,R=e.l,P=e.d,d=e.m,h=e.n,w=8*o;do{if(!R){m=Ae(t,b,1);var p=Ae(t,b+1,3);if(b+=3,!p){var f=t[(j=Bt(b)+4)-4]|t[j-3]<<8,y=j+f;if(y>o){c&&te(0);break}a&&u(E+f),n.set(t.subarray(j,y),E),e.b=E+=f,e.p=b=8*y,e.f=m;continue}if(p==1)R=ci,P=ui,d=9,h=5;else if(p==2){var M=Ae(t,b,31)+257,D=Ae(t,b+10,15)+4,z=M+Ae(t,b+5,31)+1;b+=14;for(var k=new ee(z),x=new ee(19),B=0;B<D;++B)x[Lt[B]]=Ae(t,b+3*B,7);b+=3*D;var A=dn(x),U=(1<<A)-1,H=Me(x,A,1);for(B=0;B<z;){var j,X=H[Ae(t,b,U)];if(b+=15&X,(j=X>>4)<16)k[B++]=j;else{var K=0,Y=0;for(j==16?(Y=3+Ae(t,b,3),b+=2,K=k[B-1]):j==17?(Y=3+Ae(t,b,7),b+=3):j==18&&(Y=11+Ae(t,b,127),b+=7);Y--;)k[B++]=K}}var le=k.subarray(0,M),Q=k.subarray(M);d=dn(le),h=dn(Q),R=Me(le,d,1),P=Me(Q,h,1)}else te(1);if(b>w){c&&te(0);break}}a&&u(E+131072);for(var He=(1<<d)-1,xe=(1<<h)-1,Le=b;;Le=b){var _e=(K=R[fn(t,b)&He])>>4;if((b+=15&K)>w){c&&te(0);break}if(K||te(2),_e<256)n[E++]=_e;else{if(_e==256){Le=b,R=null;break}var Ie=_e-254;if(_e>264){var oe=_t[B=_e-257];Ie=Ae(t,b,(1<<oe)-1)+mr[B],b+=oe}var Pe=P[fn(t,b)&xe],je=Pe>>4;if(Pe||te(3),b+=15&Pe,Q=si[je],je>3&&(oe=St[je],Q+=fn(t,b)&(1<<oe)-1,b+=oe),b>w){c&&te(0);break}a&&u(E+131072);var qe=E+Ie;if(E<Q){var Je=i-Q,gt=Math.min(Q,qe);for(Je+E<0&&te(3);E<gt;++E)n[E]=r[Je+E]}for(;E<qe;++E)n[E]=n[E-Q]}}e.l=R,e.p=Le,e.b=E,e.f=m,R&&(m=1,e.m=d,e.d=P,e.n=h)}while(!m);return E!=n.length&&s?Ye(n,0,E):n.subarray(0,E)},Ue=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},Et=function(t,e,n){n<<=7&e;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},pn=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var o=n.length,i=n.slice();if(!o)return{t:Sr,l:0};if(o==1){var s=new ee(n[0].s+1);return s[n[0].s]=1,{t:s,l:1}}n.sort(function(M,D){return M.f-D.f}),n.push({s:-1,f:25001});var a=n[0],c=n[1],u=0,m=1,b=2;for(n[0]={s:-1,f:a.f+c.f,l:a,r:c};m!=o-1;)a=n[n[u].f<n[b].f?u++:b++],c=n[u!=m&&n[u].f<n[b].f?u++:b++],n[m++]={s:-1,f:a.f+c.f,l:a,r:c};var E=i[0].s;for(r=1;r<o;++r)i[r].s>E&&(E=i[r].s);var R=new Ee(E+1),P=gn(n[m-1],R,0);if(P>e){r=0;var d=0,h=P-e,w=1<<h;for(i.sort(function(M,D){return R[D.s]-R[M.s]||M.f-D.f});r<o;++r){var p=i[r].s;if(!(R[p]>e))break;d+=w-(1<<P-R[p]),R[p]=e}for(d>>=h;d>0;){var f=i[r].s;R[f]<e?d-=1<<e-R[f]++-1:++r}for(;r>=0&&d;--r){var y=i[r].s;R[y]==e&&(--R[y],++d)}P=e}return{t:new ee(R),l:P}},gn=function(t,e,n){return t.s==-1?Math.max(gn(t.l,e,n+1),gn(t.r,e,n+1)):e[t.s]=n},wr=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new Ee(++e),r=0,o=t[0],i=1,s=function(c){n[r++]=c},a=1;a<=e;++a)if(t[a]==o&&a!=e)++i;else{if(!o&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(o),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(o);i=1,o=t[a]}return{c:n.subarray(0,r),n:e}},kt=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},br=function(t,e,n){var r=n.length,o=Bt(e+2);t[o]=255&r,t[o+1]=r>>8,t[o+2]=255^t[o],t[o+3]=255^t[o+1];for(var i=0;i<r;++i)t[o+i+4]=n[i];return 8*(o+4+r)},_r=function(t,e,n,r,o,i,s,a,c,u,m){Ue(e,m++,n),++o[256];for(var b=pn(o,15),E=b.t,R=b.l,P=pn(i,15),d=P.t,h=P.l,w=wr(E),p=w.c,f=w.n,y=wr(d),M=y.c,D=y.n,z=new Ee(19),k=0;k<p.length;++k)++z[31&p[k]];for(k=0;k<M.length;++k)++z[31&M[k]];for(var x=pn(z,7),B=x.t,A=x.l,U=19;U>4&&!B[Lt[U-1]];--U);var H,j,X,K,Y=u+5<<3,le=kt(o,Oe)+kt(i,Ct)+s,Q=kt(o,E)+kt(i,d)+s+14+3*U+kt(z,B)+2*z[16]+3*z[17]+7*z[18];if(c>=0&&Y<=le&&Y<=Q)return br(e,m,t.subarray(c,c+u));if(Ue(e,m,1+(Q<le)),m+=2,Q<le){H=Me(E,R,0),j=E,X=Me(d,h,0),K=d;var He=Me(B,A,0);for(Ue(e,m,f-257),Ue(e,m+5,D-1),Ue(e,m+10,U-4),m+=14,k=0;k<U;++k)Ue(e,m+3*k,B[Lt[k]]);m+=3*U;for(var xe=[p,M],Le=0;Le<2;++Le){var _e=xe[Le];for(k=0;k<_e.length;++k){var Ie=31&_e[k];Ue(e,m,He[Ie]),m+=B[Ie],Ie>15&&(Ue(e,m,_e[k]>>5&127),m+=_e[k]>>12)}}}else H=ai,j=Oe,X=li,K=Ct;for(k=0;k<a;++k){var oe=r[k];if(oe>255){Et(e,m,H[(Ie=oe>>18&31)+257]),m+=j[Ie+257],Ie>7&&(Ue(e,m,oe>>23&31),m+=_t[Ie]);var Pe=31&oe;Et(e,m,X[Pe]),m+=K[Pe],Pe>3&&(Et(e,m,oe>>5&8191),m+=St[Pe])}else Et(e,m,H[oe]),m+=j[oe]}return Et(e,m,H[256]),m+j[256]},di=new Dt([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Sr=new ee(0),fi=function(t,e,n,r,o,i){var s=i.z||t.length,a=new ee(r+s+5*(1+Math.ceil(s/7e3))+o),c=a.subarray(r,a.length-o),u=i.l,m=7&(i.r||0);if(e){m&&(c[0]=i.r>>3);for(var b=di[e-1],E=b>>13,R=8191&b,P=(1<<n)-1,d=i.p||new Ee(32768),h=i.h||new Ee(P+1),w=Math.ceil(n/3),p=2*w,f=function(Se){return(t[Se]^t[Se+1]<<w^t[Se+2]<<p)&P},y=new Dt(25e3),M=new Ee(288),D=new Ee(32),z=0,k=0,x=i.i||0,B=0,A=i.w||0,U=0;x+2<s;++x){var H=f(x),j=32767&x,X=h[H];if(d[j]=X,h[H]=j,A<=x){var K=s-x;if((z>7e3||B>24576)&&(K>423||!u)){m=_r(t,c,0,y,M,D,k,B,U,x-U,m),B=z=k=0,U=x;for(var Y=0;Y<286;++Y)M[Y]=0;for(Y=0;Y<30;++Y)D[Y]=0}var le=2,Q=0,He=R,xe=j-X&32767;if(K>2&&H==f(x-xe))for(var Le=Math.min(E,K)-1,_e=Math.min(32767,x),Ie=Math.min(258,K);xe<=_e&&--He&&j!=X;){if(t[x+le]==t[x+le-xe]){for(var oe=0;oe<Ie&&t[x+oe]==t[x+oe-xe];++oe);if(oe>le){if(le=oe,Q=xe,oe>Le)break;var Pe=Math.min(xe,oe-2),je=0;for(Y=0;Y<Pe;++Y){var qe=x-xe+Y&32767,Je=qe-d[qe]&32767;Je>je&&(je=Je,X=qe)}}}xe+=(j=X)-(X=d[j])&32767}if(Q){y[B++]=268435456|hn[le]<<18|vr[Q];var gt=31&hn[le],Qe=31&vr[Q];k+=_t[gt]+St[Qe],++M[257+gt],++D[Qe],A=x+le,++z}else y[B++]=t[x],++M[t[x]]}}for(x=Math.max(x,A);x<s;++x)y[B++]=t[x],++M[t[x]];m=_r(t,c,u,y,M,D,k,B,U,x-U,m),u||(i.r=7&m|c[m/8|0]<<3,m-=7,i.h=h,i.p=d,i.i=x,i.w=A)}else{for(x=i.w||0;x<s+u;x+=65535){var Xe=x+65535;Xe>=s&&(c[m/8|0]=u,Xe=s),m=br(c,m+1,t.subarray(x,Xe))}i.i=s}return Ye(a,0,r+Bt(m)+o)},pi=function(){for(var t=new Int32Array(256),e=0;e<256;++e){for(var n=e,r=9;--r;)n=(1&n&&-306674912)^n>>>1;t[e]=n}return t}(),mn=function(){var t=-1;return{p:function(e){for(var n=t,r=0;r<e.length;++r)n=pi[255&n^e[r]]^n>>>8;t=n},d:function(){return~t}}},Cr=function(t,e,n,r,o){if(!o&&(o={l:1},e.dictionary)){var i=e.dictionary.subarray(-32768),s=new ee(i.length+t.length);s.set(i),s.set(t,i.length),t=s,o.w=i.length}return fi(t,e.level==null?6:e.level,e.mem==null?o.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):20:12+e.mem,n,r,o)},vn=function(t,e){var n={};for(var r in t)n[r]=t[r];for(var r in e)n[r]=e[r];return n},gi=function(t,e,n){for(var r=t(),o=t.toString(),i=o.slice(o.indexOf("[")+1,o.lastIndexOf("]")).replace(/\s+/g,"").split(","),s=0;s<r.length;++s){var a=r[s],c=i[s];if(typeof a=="function"){e+=";"+c+"=";var u=a.toString();if(a.prototype)if(u.indexOf("[native code]")!=-1){var m=u.indexOf(" ",8)+1;e+=u.slice(m,u.indexOf("(",m))}else for(var b in e+=u,a.prototype)e+=";"+c+".prototype."+b+"="+a.prototype[b].toString();else e+=u}else n[c]=a}return e},yn=[],tc=function(t,e,n,r){if(!yn[n]){for(var o="",i={},s=t.length-1,a=0;a<s;++a)o=gi(t[a],o,i);yn[n]={c:gi(t[s],o,i),e:i}}var c=vn({},yn[n].e);return function(u,m,b,E,R){var P=new Worker(ni[m]||(ni[m]=URL.createObjectURL(new Blob([u+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return P.onmessage=function(d){var h=d.data,w=h.$e$;if(w){var p=new Error(w[0]);p.code=w[1],p.stack=w[2],R(p,null)}else R(null,h)},P.postMessage(b,E),P}(yn[n].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+e.toString()+"}",n,c,function(u){var m=[];for(var b in u)u[b].buffer&&m.push((u[b]=new u[b].constructor(u[b])).buffer);return m}(c),r)},mi=function(){return[ee,Ee,Dt,_t,St,Lt,mr,si,ci,ui,$t,hi,Me,dn,Ae,fn,Bt,Ye,te,yr,_n,xt,yi]},vi=function(){return[ee,Ee,Dt,_t,St,Lt,hn,vr,ai,Oe,li,Ct,$t,di,Sr,Me,Ue,Et,pn,gn,wr,kt,br,_r,Bt,Ye,fi,Cr,bn,xt]},nc=function(){return[wi,Si,he,mn,pi]},rc=function(){return[bi,_i]},xt=function(t){return postMessage(t,[t.buffer])},yi=function(t){return t&&{out:t.size&&new ee(t.size),dictionary:t.dictionary}},wn=function(t,e,n,r,o,i){var s=tc(n,r,o,function(a,c){s.terminate(),i(a,c)});return s.postMessage([t,e],e.consume?[t.buffer]:[]),function(){s.terminate()}},$e=function(t,e){return t[e]|t[e+1]<<8},ve=function(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0},Er=function(t,e){return ve(t,e)+4294967296*ve(t,e+4)},he=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},wi=function(t,e){var n=e.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=e.level<2?4:e.level==9?2:0,t[9]=3,e.mtime!=0&&he(t,4,Math.floor(new Date(e.mtime||Date.now())/1e3)),n){t[3]=8;for(var r=0;r<=n.length;++r)t[r+10]=n.charCodeAt(r)}},bi=function(t){t[0]==31&&t[1]==139&&t[2]==8||te(6,"invalid gzip data");var e=t[3],n=10;4&e&&(n+=2+(t[10]|t[11]<<8));for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!t[n++]);return n+(2&e)},_i=function(t){var e=t.length;return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0},Si=function(t){return 10+(t.filename?t.filename.length+1:0)};function bn(t,e){return Cr(t,e||{},0,0)}function _n(t,e){return yr(t,{i:2},e&&e.out,e&&e.dictionary)}function oc(t,e,n){return n||(n=e,e={}),typeof n!="function"&&te(7),wn(t,e,[vi,nc,function(){return[kr]}],function(r){return xt(kr(r.data[0],r.data[1]))},2,n)}function kr(t,e){e||(e={});var n=mn(),r=t.length;n.p(t);var o=Cr(t,e,Si(e),8),i=o.length;return wi(o,e),he(o,i-8,n.d()),he(o,i-4,r),o}function ic(t,e,n){return n||(n=e,e={}),typeof n!="function"&&te(7),wn(t,e,[mi,rc,function(){return[xr]}],function(r){return xt(xr(r.data[0],r.data[1]))},3,n)}function xr(t,e){var n=bi(t);return n+8>t.length&&te(6,"invalid gzip data"),yr(t.subarray(n,-8),{i:2},e&&e.out||new ee(_i(t)),e&&e.dictionary)}var Ir=function(t,e,n,r){for(var o in t){var i=t[o],s=e+o,a=r;Array.isArray(i)&&(a=vn(r,i[1]),i=i[0]),i instanceof ee?n[s]=[i,a]:(n[s+="/"]=[new ee(0),a],Ir(i,s,n,r))}},Ci=typeof TextEncoder<"u"&&new TextEncoder,Tr=typeof TextDecoder<"u"&&new TextDecoder;try{Tr.decode(Sr,{stream:!0})}catch{}function it(t,e){if(e){for(var n=new ee(t.length),r=0;r<t.length;++r)n[r]=t.charCodeAt(r);return n}if(Ci)return Ci.encode(t);var o=t.length,i=new ee(t.length+(t.length>>1)),s=0,a=function(m){i[s++]=m};for(r=0;r<o;++r){if(s+5>i.length){var c=new ee(s+8+(o-r<<1));c.set(i),i=c}var u=t.charCodeAt(r);u<128||e?a(u):u<2048?(a(192|u>>6),a(128|63&u)):u>55295&&u<57344?(a(240|(u=65536+(1047552&u)|1023&t.charCodeAt(++r))>>18),a(128|u>>12&63),a(128|u>>6&63),a(128|63&u)):(a(224|u>>12),a(128|u>>6&63),a(128|63&u))}return Ye(i,0,s)}function Rr(t,e){if(e){for(var n="",r=0;r<t.length;r+=16384)n+=String.fromCharCode.apply(null,t.subarray(r,r+16384));return n}if(Tr)return Tr.decode(t);var o=function(s){for(var a="",c=0;;){var u=s[c++],m=(u>127)+(u>223)+(u>239);if(c+m>s.length)return{s:a,r:Ye(s,c-1)};m?m==3?(u=((15&u)<<18|(63&s[c++])<<12|(63&s[c++])<<6|63&s[c++])-65536,a+=String.fromCharCode(55296|u>>10,56320|1023&u)):a+=1&m?String.fromCharCode((31&u)<<6|63&s[c++]):String.fromCharCode((15&u)<<12|(63&s[c++])<<6|63&s[c++]):a+=String.fromCharCode(u)}}(t),i=o.s;return(n=o.r).length&&te(8),i}var Ei=function(t,e){return e+30+$e(t,e+26)+$e(t,e+28)},ki=function(t,e,n){var r=$e(t,e+28),o=Rr(t.subarray(e+46,e+46+r),!(2048&$e(t,e+8))),i=e+46+r,s=ve(t,e+20),a=n&&s==4294967295?sc(t,i):[s,ve(t,e+24),ve(t,e+42)],c=a[0],u=a[1],m=a[2];return[$e(t,e+10),c,u,o,i+$e(t,e+30)+$e(t,e+32),m]},sc=function(t,e){for(;$e(t,e)!=1;e+=4+$e(t,e+2));return[Er(t,e+12),Er(t,e+4),Er(t,e+20)]},Nt=function(t){var e=0;if(t)for(var n in t){var r=t[n].length;r>65535&&te(9),e+=r+4}return e},Sn=function(t,e,n,r,o,i,s,a){var c=r.length,u=n.extra,m=a&&a.length,b=Nt(u);he(t,e,s!=null?33639248:67324752),e+=4,s!=null&&(t[e++]=20,t[e++]=n.os),t[e]=20,e+=2,t[e++]=n.flag<<1|(i<0&&8),t[e++]=o&&8,t[e++]=255&n.compression,t[e++]=n.compression>>8;var E=new Date(n.mtime==null?Date.now():n.mtime),R=E.getFullYear()-1980;if((R<0||R>119)&&te(10),he(t,e,R<<25|E.getMonth()+1<<21|E.getDate()<<16|E.getHours()<<11|E.getMinutes()<<5|E.getSeconds()>>1),e+=4,i!=-1&&(he(t,e,n.crc),he(t,e+4,i<0?-i-2:i),he(t,e+8,n.size)),he(t,e+12,c),he(t,e+14,b),e+=16,s!=null&&(he(t,e,m),he(t,e+6,n.attrs),he(t,e+10,s),e+=14),t.set(r,e),e+=c,b)for(var P in u){var d=u[P],h=d.length;he(t,e,+P),he(t,e+2,h),t.set(d,e+4),e+=4+h}return m&&(t.set(a,e),e+=m),e},xi=function(t,e,n,r,o){he(t,e,101010256),he(t,e+8,n),he(t,e+10,n),he(t,e+12,r),he(t,e+16,o)};function ac(t,e,n){n||(n=e,e={}),typeof n!="function"&&te(7);var r={};Ir(t,"",r,e);var o=Object.keys(r),i=o.length,s=0,a=0,c=i,u=new Array(i),m=[],b=function(){for(var h=0;h<m.length;++h)m[h]()},E=function(h,w){Cn(function(){n(h,w)})};Cn(function(){E=n});var R=function(){var h=new ee(a+22),w=s,p=a-s;a=0;for(var f=0;f<c;++f){var y=u[f];try{var M=y.c.length;Sn(h,a,y,y.f,y.u,M);var D=30+y.f.length+Nt(y.extra),z=a+D;h.set(y.c,z),Sn(h,s,y,y.f,y.u,M,a,y.m),s+=16+D+(y.m?y.m.length:0),a=z+M}catch(k){return E(k,null)}}xi(h,s,u.length,p,w),E(null,h)};i||R();for(var P=function(h){var w=o[h],p=r[w],f=p[0],y=p[1],M=mn(),D=f.length;M.p(f);var z=it(w),k=z.length,x=y.comment,B=x&&it(x),A=B&&B.length,U=Nt(y.extra),H=y.level==0?0:8,j=function(X,K){if(X)b(),E(X,null);else{var Y=K.length;u[h]=vn(y,{size:D,crc:M.d(),c:K,f:z,m:B,u:k!=w.length||B&&x.length!=A,compression:H}),s+=30+k+U+Y,a+=76+2*(k+U)+(A||0)+Y,--i||R()}};if(k>65535&&j(te(11,0,1),null),H)if(D<16e4)try{j(null,bn(f,y))}catch(X){j(X,null)}else m.push(function(X,K,Y){return Y||(Y=K,K={}),typeof Y!="function"&&te(7),wn(X,K,[vi],function(le){return xt(bn(le.data[0],le.data[1]))},0,Y)}(f,y,j));else j(null,f)},d=0;d<c;++d)P(d);return b}var Cn=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(t){t()};function cc(t,e,n){n||(n=e,e={}),typeof n!="function"&&te(7);var r=[],o=function(){for(var h=0;h<r.length;++h)r[h]()},i={},s=function(h,w){Cn(function(){n(h,w)})};Cn(function(){s=n});for(var a=t.length-22;ve(t,a)!=101010256;--a)if(!a||t.length-a>65558)return s(te(13,0,1),null),o;var c=$e(t,a+8);if(c){var u=c,m=ve(t,a+16),b=m==4294967295||u==65535;if(b){var E=ve(t,a-12);(b=ve(t,E)==101075792)&&(u=c=ve(t,E+32),m=ve(t,E+48))}for(var R=e&&e.filter,P=function(h){var w=ki(t,m,b),p=w[0],f=w[1],y=w[2],M=w[3],D=w[4],z=w[5],k=Ei(t,z);m=D;var x=function(A,U){A?(o(),s(A,null)):(U&&(i[M]=U),--c||s(null,i))};if(!R||R({name:M,size:f,originalSize:y,compression:p}))if(p)if(p==8){var B=t.subarray(k,k+f);if(y<524288||f>.8*y)try{x(null,_n(B,{out:new ee(y)}))}catch(A){x(A,null)}else r.push(function(A,U,H){return H||(H=U,U={}),typeof H!="function"&&te(7),wn(A,U,[mi],function(j){return xt(_n(j.data[0],yi(j.data[1])))},1,H)}(B,{size:y},x))}else x(te(14,"unknown compression type "+p,1),null);else x(null,Ye(t,k,k+f));else x(null,null)},d=0;d<u;++d)P()}else s(null,{});return o}function It(t){var e={filename:"",directory:"",basename:"",extension:""},n=function(a){return a.indexOf("/")==-1&&a.indexOf("\\")!=-1?"\\":"/"}(t),r=t.split(n),o=r.pop(),i=/\.([a-z][a-z0-9]*)$/i,s=i.test(o)?i.exec(o)[0]:"";return s||o.includes("*")?(e.filename=o,e.extension=s?s.slice(1):"",e.basename=o.slice(0,o.length-s.length),e.directory=r.join(n)):e.directory=o?t:r.join(n),e}function Ii(t){return It(t).basename}function En(t){return It(t).extension}function Pr(t){var e=It(t);return e.extension?t.slice(0,t.length-e.extension.length-1):t}function lc(t,e){var n=Pr(t);return e?n+"."+e:n}function uc(t){var e=En(t);return e?Pr(t)+"."+e.toLowerCase():t}function hc(t){return t.reduce(function(e,n,r){return e=r===0?Ii(n):Ti(e,n)},"")}function Ti(t,e){var n;return t&&e&&(n=Ri(t,e).replace(/[-_]$/,"")),n||""}function Ri(t,e){for(var n=0,r=t.length;n<r&&t[n]===e[n];n++);return t.substr(0,n)}function zr(t){return{all:t=t||new Map,on(e,n){const r=t.get(e);r?r.push(n):t.set(e,[n])},off(e,n){const r=t.get(e);r&&(n?r.splice(r.indexOf(n)>>>0,1):t.set(e,[]))},emit(e,n){let r=t.get(e);r&&r.slice().map(o=>{o(n)}),r=t.get("*"),r&&r.slice().map(o=>{o(e,n)})}}}const st=zr(),ye={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetToUnloadEvent:"WidgetToUnloadEvent",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},Wt=(t,e)=>{Mr(t,e)};function Mr(t,e){const n=window.URL||window.webkitURL||window,r=new Blob([t]),o=n.createObjectURL(r),i=document.createElement("a");i.href=o,i.download=e,document.body.appendChild(i),i.click(),n.revokeObjectURL(o),setTimeout(function(){n.revokeObjectURL(o),document.body.removeChild(i)},400)}const Pi=(t,e)=>{const n=JSON.stringify(t,null,2);e?Wt(n,e+".json"):st.emit(ye.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},dc=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(r){Wt(r.data,n)}).catch(r=>{console.warn(r),st.emit(ye.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};async function fc(t,e,n){var r,o=function(s){var a=En(s).toLowerCase(),c={};return a=="kml"?c["application/vnd.google-earth.kml+xml"]=[".kml"]:a==="svg"?c["image/svg+xml"]=[".svg"]:a==="zip"?c["application/zip"]=[".zip"]:a==="txt"||a==="csv"||a==="tsv"||a==="tab"?c["text/csv"]=[".csv",".tsv",".tab",".txt"]:a==="json"||a==="geojson"||a==="topojson"?c["application/json"]=[".json",".geojson",".topojson"]:c["application/octet-stream"]=["."+a],{suggestedName:s,types:[{description:"Files",accept:c}]}}(t);try{r=await window.showSaveFilePicker(o);var i=await r.createWritable();await i.write(e),await i.close()}catch(s){return void(s.name=="SecurityError"?(console.warn(s.message),n(s.message)):s.name=="AbortError"?n():(console.error(s.name,s.message,s),n("Save failed for an unknown reason")))}n()}class pc{static runningInBrowser(){return typeof window<"u"&&typeof window.document<"u"}static saveZipFile(e,n){this.zipAsync(n,function(r,o){if(r)throw r;Mr(new Blob([o]),e)})}static unzipSync(e){let n;if(n=e instanceof ArrayBuffer?new Uint8Array(e):e,!this.runningInBrowser())return;const r=function(o,i){for(var s={},a=o.length-22;ve(o,a)!=101010256;--a)(!a||o.length-a>65558)&&te(13);var c=$e(o,a+8);if(!c)return{};var u=ve(o,a+16),m=u==4294967295||c==65535;if(m){var b=ve(o,a-12);(m=ve(o,b)==101075792)&&(c=ve(o,b+32),u=ve(o,b+48))}for(var E=i&&i.filter,R=0;R<c;++R){var P=ki(o,u,m),d=P[0],h=P[1],w=P[2],p=P[3],f=P[4],y=P[5],M=Ei(o,y);u=f,E&&!E({name:p,size:h,originalSize:w,compression:d})||(d?d==8?s[p]=_n(o.subarray(M,M+h),{out:new ee(w)}):te(14,"unknown compression type "+d):s[p]=Ye(o,M,M+h))}return s}(n,{filter:this.fflateFilter});return this.fflatePostprocess(r)}static async readZipFromFile(e){const n={content:await ce.readFilePromise(e,"ArrayBuffer"),name:e.name};return this.readZipFile(n)}static async readZipFile(e){const n=await this.unzipAsync.promise(e.content);return Object.keys(n).reduce(function(r,o){return r.push({name:o,content:n[o]}),r},[])}static unzipAsync(e,n){if(!this.runningInBrowser())throw new Error("Async unzipping only supported in the browser");let r;r=e instanceof ArrayBuffer?new Uint8Array(e):e,cc(r,{filter:this.fflateFilter},function(o,i){o&&n(o),n(null,this.fflatePostprocess(i))})}static zipSync(e){if(!this.runningInBrowser())throw new Error("Async zipping only supported in the browser");return function(n,r){r||(r={});var o={},i=[];Ir(n,"",o,r);var s=0,a=0;for(var c in o){var u=o[c],m=u[0],b=u[1],E=b.level==0?0:8,R=(x=it(c)).length,P=b.comment,d=P&&it(P),h=d&&d.length,w=Nt(b.extra);R>65535&&te(11);var p=E?bn(m,b):m,f=p.length,y=mn();y.p(m),i.push(vn(b,{size:m.length,crc:y.d(),c:p,f:x,m:d,u:R!=c.length||d&&P.length!=h,o:s,compression:E})),s+=30+R+w+f,a+=76+2*(R+w)+(h||0)+f}for(var M=new ee(a+22),D=s,z=a-s,k=0;k<i.length;++k){var x=i[k];Sn(M,x.o,x,x.f,x.u,x.c.length);var B=30+x.f.length+Nt(x.extra);M.set(x.c,x.o+B),Sn(M,s,x,x.f,x.u,x.c.length,x.o,x.m),s+=16+B+(x.m?x.m.length:0)}return xi(M,s,i.length,z,D),M}(this.fflatePreprocess(e))}static zipAsync(e,n){ac(this.fflatePreprocess(e),{},n)}static fflateFilter(e){return this.isImportableZipPath(e.name)}static fflatePostprocess(e){return Object.keys(e).reduce(function(n,r){const o=It(r).filename;let i=e[r];return n[o]=i,n},{})}static isImportableZipPath(e){const n=It(e),r=En(e).toLowerCase();return r!="gz"&&r!="zip"&&!/^__MACOSX/.test(e)&&n.filename[0]!="."}static fflatePreprocess(e){const n={};return e.forEach(function(r){typeof r.content=="string"?r.content=it(r.content):r.content instanceof ArrayBuffer&&(r.content=new Uint8Array(r.content)),n[r.filename]=r.content}),n}}class gc{static runningInBrowser(){return typeof window<"u"&&typeof window.document<"u"}static isGzipped(e){return e.length>2&&e.buffer instanceof ArrayBuffer&&e[0]==31&&e[1]==139}static gzipSync(e,n){if(typeof e=="string"&&(e=it(e)),this.runningInBrowser())return kr(e,n)}static async gzipAsync(e,n){let r;return typeof e=="string"&&(r=it(e)),this.runningInBrowser()?ce.promisify(oc)(r,n):void 0}static async readGzipFromFile(e){const n={content:await ce.readFilePromise(e,"ArrayBuffer"),name:e.name};return this.readGzipFile(n)}static readGzipFile(e){var n=e.name.replace(/\.gz$/,"");return[{name:n,content:this.gunzipSync(e.content,n)}]}static async gunzipAsync(e,n){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),n=n||{},!this.runningInBrowser())return;var r=ce.promisify(ic);let o=await r(e,n);return n.filename&&(o=Rr(o)),o}static gunzipSync(e,n){e instanceof ArrayBuffer&&(e=new Uint8Array(e));let r=xr(e);return n&&(r=Rr(r)),r}}function mc(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),r=Math.floor(n*parseInt(e[0])+255*(1-n)),o=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+r.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function vc(t){var e=t.toLowerCase();if(kn(t)){if(e.length===4){for(var n="#",r=1;r<4;r+=1){const i=e.slice(r,r+1);n+=i.concat(i)}e=n}var o=[];for(r=1;r<7;r+=2)o.push(parseInt("0x"+e.slice(r,r+2)));return"rgb("+o.join(",")+")"}return e}function yc(t){const e=t;if(e.length===4){let r="#";for(var n=1;n<4;n+=1){const o=e.slice(n,n+1);r+=o.concat(o)}return r}return e}var at;function wc(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?at.Hex:e==="r"||e==="("?at.RGBA:e==="h"?at.Hsla:at.RGBA}function bc(t){if(t){var e=t.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(e){var n,r,o,i=(parseFloat(e[1])%360+360)%360/360,s=parseFloat(e[2])/(/%$/.test(e[2])?100:1),a=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(s===0)n=r=o=a;else{var c=a<=.5?a*(s+1):a+s-a*s,u=2*a-c;n=Ar(u,c,i+1/3),r=Ar(u,c,i),o=Ar(u,c,i-1/3)}return`rgba(${n=Math.round(255*n)},${r=Math.round(255*r)},${o=Math.round(255*o)},${e[4]?parseFloat(e[4]):1})`}}}function Ar(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function kn(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function _c(t,e,n){const r=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(r.length-7)).join("0")+r}function Dr(t){let e=t.toLowerCase();if(kn(t)){if(e.length===4){let r="#";for(let o=1;o<4;o+=1)r+=e.slice(o,o+1).concat(e.slice(o,o+1));e=r}const n=[];for(let r=1;r<7;r+=2)n.push(parseInt("0x"+e.slice(r,r+2)));return"RGB("+n.join(",")+")"}return e}function Sc(t){if(!kn(t))return;const[e,n,r]=Dr(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(o=>Number(o));return .299*e+.578*n+.114*r<192}function Cc(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${$r(t.substring(0,2),e)}${$r(t.substring(2,4),e)}${$r(t.substring(4,6),e)}`}function Ec(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Lr(t.substring(0,2),e)}${Lr(t.substring(2,4),e)}${Lr(t.substring(4,6),e)}`}function Lr(t,e){const n=parseInt(t,16)+e,r=n>255?255:n;return r.toString(16).length>1?r.toString(16):`0${r.toString(16)}`}function zi(t,e,n){const r=[t,e,n].map(o=>(o/=255)<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4));return .2126*r[0]+.7152*r[1]+.0722*r[2]}function kc(t){return function(e,n){return(zi(~~e[0],~~e[1],~~e[2])+.05)/(zi(n[0],n[1],n[2])+.05)}(Dr(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function $r(t,e){const n=parseInt(t,16)-e,r=n<0?0:n;return r.toString(16).length>1?r.toString(16):`0${r.toString(16)}`}function xc(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${Mi}\u6BEB\u79D2`)}function Mi(t){return new Promise(e=>setTimeout(e,t))}(function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"})(at||(at={}));var Ai,Br={exports:{}},Di,Li,Nr,Wr=(Ai||(Ai=1,Li=Br.exports,Nr=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],o={},i=null;function s(R,P){var d=R[P];if(typeof d.bind=="function")return d.bind(R);try{return Function.prototype.bind.call(d,R)}catch{return function(){return Function.prototype.apply.apply(d,[R,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(){for(var R=this.getLevel(),P=0;P<r.length;P++){var d=r[P];this[d]=P<R?t:this.methodFactory(d,R,this.name)}if(this.log=this.debug,typeof console===e&&R<this.levels.SILENT)return"No console available for logging"}function u(R){return function(){typeof console!==e&&(c.call(this),this[R].apply(this,arguments))}}function m(R,P,d){return function(h){return h==="debug"&&(h="log"),typeof console!==e&&(h==="trace"&&n?a:console[h]!==void 0?s(console,h):console.log!==void 0?s(console,"log"):t)}(R)||u.apply(this,arguments)}function b(R,P){var d,h,w,p=this,f="loglevel";function y(){var z;if(typeof window!==e&&f){try{z=window.localStorage[f]}catch{}if(typeof z===e)try{var k=window.document.cookie,x=encodeURIComponent(f),B=k.indexOf(x+"=");B!==-1&&(z=/^([^;]+)/.exec(k.slice(B+x.length+1))[1])}catch{}return p.levels[z]===void 0&&(z=void 0),z}}function M(z){var k=z;if(typeof k=="string"&&p.levels[k.toUpperCase()]!==void 0&&(k=p.levels[k.toUpperCase()]),typeof k=="number"&&k>=0&&k<=p.levels.SILENT)return k;throw new TypeError("log.setLevel() called with invalid level: "+z)}typeof R=="string"?f+=":"+R:typeof R=="symbol"&&(f=void 0),p.name=R,p.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},p.methodFactory=P||m,p.getLevel=function(){return w??h??d},p.setLevel=function(z,k){return w=M(z),k!==!1&&function(x){var B=(r[x]||"silent").toUpperCase();if(typeof window!==e&&f){try{return void(window.localStorage[f]=B)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+B+";"}catch{}}}(w),c.call(p)},p.setDefaultLevel=function(z){h=M(z),y()||p.setLevel(z,!1)},p.resetLevel=function(){w=null,function(){if(typeof window!==e&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),c.call(p)},p.enableAll=function(z){p.setLevel(p.levels.TRACE,z)},p.disableAll=function(z){p.setLevel(p.levels.SILENT,z)},p.rebuild=function(){if(i!==p&&(d=M(i.getLevel())),c.call(p),i===p)for(var z in o)o[z].rebuild()},d=M(i?i.getLevel():"WARN");var D=y();D!=null&&(w=M(D)),c.call(p)}(i=new b).getLogger=function(R){if(typeof R!="symbol"&&typeof R!="string"||R==="")throw new TypeError("You must supply a name when creating a logger.");var P=o[R];return P||(P=o[R]=new b(R,i.methodFactory)),P};var E=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=E),i},i.getLoggers=function(){return o},i.default=i,i},(Di=Br).exports?Di.exports=Nr():Li.log=Nr()),Br.exports);class $i{message;eventBus;constructor(e,n=void 0){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,r="success"){if(this.message)if(typeof this.message=="function")this.message({type:r,message:e,duration:n});else switch(r){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(r){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":r="dark",console.error(e)}this.eventBus&&this.eventBus.emit(ye.AlertInfoEvent,{type:r,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let Bi=!1;Function.prototype.promise=function(...t){const e=this;return function(){const n=t||[];return new Promise((r,o)=>{n.push(function(i,s){i?o(i):r(s)}),e.apply(e,t)})}()};const F={Config:SysConfig,EventBus:st,DefaultProxyClient:null,Axios:ka,Message:new $i(void 0,st),LayoutMap:new Map,getLayoutManager:t=>{if(!F.WidgetConfigList||F.WidgetConfigList.length===0)return;const e=F.WidgetConfigList.find(n=>n.id===t);if(e){const n=e.layoutID;if(n&&F.LayoutMap.has(n))return F.LayoutMap.get(n)}},Logger:t=>{Bi||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Wr.enableAll():Wr.setDefaultLevel("warn"),Bi=!0);const e=t||"default";return Wr.getLogger(e)}},Ni="access_token",Tt=new un("user",localStorage);function ct(){return Tt.get(Ni)}function Ur(){Tt.remove(Ni)}function Wi(){return ct()?.refresh}function Fr(t,e,n,r="json",o){const i={baseURL:F.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return xa.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+ct()?.token},responseType:r,cancelToken:o};if(n)for(let s in n)i.headers[s]=n[s];return F.SystemID&&(i.headers.sysid=F.SystemID,F.SystemGroup&&(i.headers.sysgroup=F.SystemGroup)),e!==void 0&&(i.baseURL=e),i}function De(t,e,n,r,o="json",i,s){const a=Fr(n,e,r,o,i);return s&&s>=2e4&&(a.timeout=s),F.Axios?.get(t,a).catch(function(c){xn(c,a.baseURL,t,"Get")})}function xn(t,e,n,r="Get"){const o=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const c=t.response.data;if(c){const u=c.indexOf(":"),m=c.indexOf(`
|
|
2
|
+
`);if(u>0&&m-u>2){const b=c.substring(u+2,m);b.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=b)}else i=!0,t.message=c}else t.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:t.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:t.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:t.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:t.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:t.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:t.message=`\u8FDE\u63A5\u9519\u8BEF${t.response.status}`}let a={address:o,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(F.EventBus.emit(ye.AxiosRequestErrorEvent,a),i)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Ui(t,e,n,r,o,i="json",s){const a=Fr(r,e,o,i);s&&s>=2e4&&(a.timeout=s),a.headers["Content-Type"]="multipart/form-data";const c=function(u){let m=new FormData;return u&&Object.keys(u).forEach(b=>{if(!u)return;let E=u[b];E!=null&&(cn(E)?E.forEach(R=>{m.append(b,Oi(R))}):m.append(b,Oi(E)))}),m}(n);return F.Axios?.post(t,c,a).catch(function(u){xn(u,e,a.baseURL,"Post")})}function Fi(t,e,n,r,o,i="json",s){const a=Fr(r,e,o,i);return s&&s>=2e4&&(a.timeout=s),F.Axios?.post(t,n,a).catch(function(c){xn(c,e,t,"Post")})}function Ic(t,e,n=!1){return t.startsWith("http")?De("",t,e):n||e?De(t,void 0,e):De(t,"",void 0)}function Tc(t,e){return Ui(t,void 0,e)}function Rc(t,e){return F.Axios?.get(t,{params:e}).catch(function(n){xn(n,t,"","\u5916\u90E8Get")})}function Oi(t){return t instanceof Blob?t:t.toString()}function Pc(t,e,n){const r=e??At.getFileName(t);De("",t,n,void 0,"blob").then(o=>{o.data&&Wt(o.data,r)})}var Hi,ji,Or,qi,Hr,Xi,jr,Gi,Vi,In={exports:{}};function zc(){return ji?Hi:(ji=1,t=typeof window<"u"?window:wt!==void 0?wt:typeof self<"u"?self:{},Hi=t);var t}function Mc(){if(qi)return Or;qi=1,Or=function(e){if(!e)return!1;var n=t.call(e);return n==="[object Function]"||typeof e=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var t=Object.prototype.toString;return Or}function Ac(){if(Xi)return Hr;Xi=1;var t=function(e){return e.replace(/^\s+|\s+$/g,"")};return Hr=function(e){if(!e)return{};for(var n,r={},o=t(e).split(`
|
|
3
|
+
`),i=0;i<o.length;i++){var s=o[i],a=s.indexOf(":"),c=t(s.slice(0,a)).toLowerCase(),u=t(s.slice(a+1));r[c]===void 0?r[c]=u:(n=r[c],Object.prototype.toString.call(n)==="[object Array]"?r[c].push(u):r[c]=[r[c],u])}return r},Hr}var Dc=function(){if(Vi)return In.exports;Vi=1;var t=zc(),e=Mc(),n=Ac(),r=function(){if(Gi)return jr;Gi=1,jr=function(){for(var c={},u=0;u<arguments.length;u++){var m=arguments[u];for(var b in m)a.call(m,b)&&(c[b]=m[b])}return c};var a=Object.prototype.hasOwnProperty;return jr}();function o(a,c,u){var m=a;return e(c)?(u=c,typeof a=="string"&&(m={uri:a})):m=r(c,{uri:a}),m.callback=u,m}function i(a,c,u){return s(c=o(a,c,u))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var c=!1,u=function(k,x,B){c||(c=!0,a.callback(k,x,B))};function m(){var k=void 0;if(k=d.response?d.response:d.responseText||function(x){try{if(x.responseType==="document")return x.responseXML;var B=x.responseXML&&x.responseXML.documentElement.nodeName==="parsererror";if(x.responseType===""&&!B)return x.responseXML}catch{}return null}(d),D)try{k=JSON.parse(k)}catch{}return k}function b(k){return clearTimeout(h),k instanceof Error||(k=new Error(""+(k||"Unknown XMLHttpRequest Error"))),k.statusCode=0,u(k,z)}function E(){if(!P){var k;clearTimeout(h),k=a.useXDR&&d.status===void 0?200:d.status===1223?204:d.status;var x=z,B=null;return k!==0?(x={body:m(),statusCode:k,method:p,headers:{},url:w,rawRequest:d},d.getAllResponseHeaders&&(x.headers=n(d.getAllResponseHeaders()))):B=new Error("Internal XMLHttpRequest Error"),u(B,x,x.body)}}var R,P,d=a.xhr||null;d||(d=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var h,w=d.url=a.uri||a.url,p=d.method=a.method||"GET",f=a.body||a.data,y=d.headers=a.headers||{},M=!!a.sync,D=!1,z={body:void 0,headers:{},statusCode:0,method:p,url:w,rawRequest:d};if("json"in a&&a.json!==!1&&(D=!0,y.accept||y.Accept||(y.Accept="application/json"),p!=="GET"&&p!=="HEAD"&&(y["content-type"]||y["Content-Type"]||(y["Content-Type"]="application/json"),f=JSON.stringify(a.json===!0?f:a.json))),d.onreadystatechange=function(){d.readyState===4&&setTimeout(E,0)},d.onload=E,d.onerror=b,d.onprogress=function(){},d.onabort=function(){P=!0},d.ontimeout=b,d.open(p,w,!M,a.username,a.password),M||(d.withCredentials=!!a.withCredentials),!M&&a.timeout>0&&(h=setTimeout(function(){if(!P){P=!0,d.abort("timeout");var k=new Error("XMLHttpRequest timeout");k.code="ETIMEDOUT",b(k)}},a.timeout)),d.setRequestHeader)for(R in y)y.hasOwnProperty(R)&&d.setRequestHeader(R,y[R]);else if(a.headers&&!function(k){for(var x in k)if(k.hasOwnProperty(x))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(d.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(d),d.send(f||null),d}return In.exports=i,In.exports.default=i,i.XMLHttpRequest=t.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:t.XDomainRequest,function(a,c){for(var u=0;u<a.length;u++)c(a[u])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(c,u,m){return(u=o(c,u,m)).method=a.toUpperCase(),s(u)}}),In.exports}(),Lc=sn(Dc);const $c=[200,201,202,204,308],Bc=[408,502,503,504];class Ki{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(e){this.endpoint=e.endpoint,this.file=e.file,this.fileName=encodeURI(this.file.name),this.headers=e.headers||{},this.method=e.method||"PUT",this.chunkSize=e.chunkSize||5120,this.attempts=e.attempts||5,this.delayBeforeAttempt=e.delayBeforeAttempt||1,this.md5=e.md5||"",this.maxFileBytes=1024*(e.maxFileSize||0),this.chunkCount=0,this.chunkByteSize=1024*this.chunkSize,this.totalChunks=Math.ceil(this.file.size/this.chunkByteSize),this.attemptCount=0,this.offline=!1,this.paused=!1,this.success=!1,this.reader=new FileReader,this.eventTarget=zr(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,r=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(r,r+n))})}xhrPromise(e){const n=r=>{r.upload.onprogress=o=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,c=o.loaded/(o.total??s)*i;this.dispatch("progress",Math.min(a+c,100))}};return new Promise((r,o)=>{this.currentXhr=Lc({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?o(i):r(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,r={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers:r,url:this.endpointValue,method:this.method,body:this.chunk});console.warn("\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01"),this.dispatch("error",{message:"\u6587\u4EF6\u4E0A\u4F20endpointValue\u4E0D\u80FD\u4E3A\u7A7A\uFF01\u53D6\u6D88\u4E0A\u4F20\uFF01",chunk:this.chunkCount,attempts:this.attemptCount})}manageRetries(){if(this.attemptCount<this.attempts)return setTimeout(()=>this.sendChunks(),1e3*this.delayBeforeAttempt),void this.dispatch("attemptFailure",{message:`\u4E0A\u4F20\u5206\u7247\uFF1A${this.chunkCount}\u5931\u8D25\u3002\u8FD8\u4F1A\u518D\u5C1D\u8BD5 ${this.attempts-this.attemptCount}\u6B21\uFF01`,chunkNumber:this.chunkCount,attemptsLeft:this.attempts-this.attemptCount});this.dispatch("error",{message:`\u4E0A\u4F20\u5206\u7247\u9519\u8BEF\uFF1A ${this.chunkCount}\u3002\u505C\u6B62\u5C1D\u8BD5\uFF0C\u53D6\u6D88\u4E0A\u4F20\uFF01`,chunk:this.chunkCount,attempts:this.attemptCount})}sendChunks(){console.log(this.paused,this.offline,this.success,"sendChunks this.paused || this.offline || this.success"),!(this.paused||this.offline||this.success)&&this.getChunk().then(()=>this.sendChunk()).then(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&$c.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(e!=null&&Bc.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${e?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(e=>{this.paused||this.offline||this.manageRetries()})}}const Nc=t=>new Ki(t),Wc=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class Yt{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!At.isNullOrEmpty(e)){if(Yt.httpTransport||(Yt.httpTransport=new Ra),this.client=new Ia(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):st.emit(ye.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,r){if(this.client)return await this.client.invoke(e,n,r)}encode(e,n,r){if(this.client)return this.client.codec.encode(e,n,r)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ut{hproseClient;hpProxyObj;defaultContext=new or;constructor(e){this.hproseClient=new Yt(e),this.hpProxyObj=null}getClientContext(e,n){const r={};n&&(r.requestHeaders=n);const o=ct();r.httpRequestHeaders=e||{};const i=r.httpRequestHeaders;return o&&(i.token=o.token),F.SystemID&&(i.sysid=F.SystemID,F.SystemGroup&&(i.sysgroup=F.SystemGroup)),new or(r)}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||st.emit(ye.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n,r){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");return await this.hproseClient.invoke(e,n,r)}async hproseInvokeContext(e,n,...r){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const o=ct();return console.log(o,"userToken3"),o&&(n||(n=new or({httpRequestHeaders:{token:o.token}}))),await this.hproseClient.invoke(e,r,n)}async hproseInvokeEncode(e){const n=new Ve(e).toBytes(),r=await this.hproseClient.client?.request(n,this.defaultContext);return r&&this.hproseClient.client?.codec.decode(r,this.defaultContext)}encodeRequest(e,...n){const r=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return Ve.toString(r)}}const qr=new Map,Uc=function(t,e,n){!F.Config.DefaultHproseAPI&&F.Config.ServiceURL&&(F.Config.DefaultHproseAPI=F.Config.ServiceURL.DefaultHproseAPI),F.Config.DefaultHproseAPI&&At.isNotEmpty(F.Config.DefaultHproseAPI)&&(F.DefaultProxyClient=new Ut(F.Config.DefaultHproseAPI));const r=F.Config.UI.GrayMode;r&&ce.setGrayMode(r);const o=new $i(t,F.EventBus);F.Message=o,F.SystemID=e,F.SystemGroup=n,F.EventBus.on(ye.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),F.EventBus.on(ye.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),F.EventBus.on(ye.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),F.EventBus.on(ye.CommonWarnEvent,i=>{o.warn(i)})};function Yi(t){if(t&&At.isNotEmpty(t)){if(qr.has(t))return qr.get(t);{const e=new Ut(t);return qr.set(t,e),e}}}function Fc(t){const e=Yi(t);return e&&(F.DefaultProxyClient=e),e}const lt=Bo({isLock:!1,lockTime:0});function Tn(t){lt.isLock=t,t&&(Ur(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Oc(){return lt.isLock}let Xr;function Ft(){clearInterval(Xr),!(window.location.href.indexOf("/login")>0||lt.isLock)&&(Tn(!1),lt.lockTime=function(){let t=3600;return F.Config.UI?.LockTime&&F.Config.UI?.LockTime>=10&&(t=F.Config.UI.LockTime),t}(),Xr=setInterval(()=>{if(lt.lockTime--,lt.lockTime<=0)return Tn(!0),clearInterval(Xr)},1e3))}function Hc(){Ft(),document.addEventListener("mousedown",Ft),document.addEventListener("mousemove",Ft)}function jc(){document.removeEventListener("mousedown",Ft),document.removeEventListener("mousemove",Ft)}function Gr(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ji,Qi={exports:{}};/*!
|
|
4
4
|
localForage -- Offline Storage, Improved
|
|
5
5
|
Version 1.10.0
|
|
6
6
|
https://localforage.github.io/localForage
|
|
7
7
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
8
|
-
*/var ir,Qs=(or||(or=1,rr.exports=function n(e,t,o){function r(c,u){if(!t[c]){if(!e[c]){if(!u&&Mn)return Mn(c);if(i)return i(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var S=t[c]={exports:{}};e[c][0].call(S.exports,function(C){var N=e[c][1][C];return r(N||C)},S,S.exports,n,e,t,o)}return t[c].exports}for(var i=Mn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(n,e,t){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var c=0,u=new s(N),g=o.document.createTextNode("");u.observe(g,{characterData:!0}),r=function(){g.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var M=o.document.createElement("script");M.onreadystatechange=function(){N(),M.onreadystatechange=null,M.parentNode.removeChild(M),M=null},o.document.documentElement.appendChild(M)}:function(){setTimeout(N,0)};else{var S=new o.MessageChannel;S.port1.onmessage=N,r=function(){S.port2.postMessage(0)}}var C=[];function N(){var M,f;i=!0;for(var l=C.length;l;){for(f=C,C=[],M=-1;++M<l;)f[M]();l=C.length}i=!1}function D(M){C.push(M)!==1||i||r()}e.exports=D}).call(this,Fe!==void 0?Fe:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,e,t){var o=n(1);function r(){}var i={},s=["REJECTED"],c=["FULFILLED"],u=["PENDING"];function g(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,p!==r&&D(this,p)}function S(p,y,L){this.promise=p,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}function C(p,y,L){o(function(){var A;try{A=y(L)}catch(T){return i.reject(p,T)}A===p?i.reject(p,new TypeError("Cannot resolve promise with itself")):i.resolve(p,A)})}function N(p){var y=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof y=="function")return function(){y.apply(p,arguments)}}function D(p,y){var L=!1;function A(O){L||(L=!0,i.reject(p,O))}function T(O){L||(L=!0,i.resolve(p,O))}function z(){y(T,A)}var W=M(z);W.status==="error"&&A(W.value)}function M(p,y){var L={};try{L.value=p(y),L.status="success"}catch(A){L.status="error",L.value=A}return L}function f(p){return p instanceof this?p:i.resolve(new this(r),p)}function l(p){var y=new this(r);return i.reject(y,p)}function v(p){var y=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=p.length,A=!1;if(!L)return this.resolve([]);for(var T=new Array(L),z=0,W=-1,O=new this(r);++W<L;)R(p[W],W);return O;function R(H,X){function le(oe){T[X]=oe,++z!==L||A||(A=!0,i.resolve(O,T))}y.resolve(H).then(le,function(oe){A||(A=!0,i.reject(O,oe))})}}function m(p){var y=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=p.length,A=!1;if(!L)return this.resolve([]);for(var T=-1,z=new this(r);++T<L;)W(p[T]);return z;function W(O){y.resolve(O).then(function(R){A||(A=!0,i.resolve(z,R))},function(R){A||(A=!0,i.reject(z,R))})}}e.exports=g,g.prototype.catch=function(p){return this.then(null,p)},g.prototype.then=function(p,y){if(typeof p!="function"&&this.state===c||typeof y!="function"&&this.state===s)return this;var L=new this.constructor(r);return this.state!==u?C(L,this.state===c?p:y,this.outcome):this.queue.push(new S(L,p,y)),L},S.prototype.callFulfilled=function(p){i.resolve(this.promise,p)},S.prototype.otherCallFulfilled=function(p){C(this.promise,this.onFulfilled,p)},S.prototype.callRejected=function(p){i.reject(this.promise,p)},S.prototype.otherCallRejected=function(p){C(this.promise,this.onRejected,p)},i.resolve=function(p,y){var L=M(N,y);if(L.status==="error")return i.reject(p,L.value);var A=L.value;if(A)D(p,A);else{p.state=c,p.outcome=y;for(var T=-1,z=p.queue.length;++T<z;)p.queue[T].callFulfilled(y)}return p},i.reject=function(p,y){p.state=s,p.outcome=y;for(var L=-1,A=p.queue.length;++L<A;)p.queue[L].callRejected(y);return p},g.resolve=f,g.reject=l,g.all=v,g.race=m},{1:1}],3:[function(n,e,t){(function(o){typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,Fe!==void 0?Fe:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,e,t){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function r(a,h){if(!(a instanceof h))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function c(){try{if(!s||!s.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||h)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function u(a,h){a=a||[],h=h||{};try{return new Blob(a,h)}catch(w){if(w.name!=="TypeError")throw w;for(var d=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),b=0;b<a.length;b+=1)d.append(a[b]);return d.getBlob(h.type)}}typeof Promise>"u"&&n(3);var g=Promise;function S(a,h){h&&a.then(function(d){h(null,d)},function(d){h(d)})}function C(a,h,d){typeof h=="function"&&a.then(h),typeof d=="function"&&a.catch(d)}function N(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function D(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var M="local-forage-detect-blob-support",f=void 0,l={},v=Object.prototype.toString,m="readonly",p="readwrite";function y(a){for(var h=a.length,d=new ArrayBuffer(h),b=new Uint8Array(d),w=0;w<h;w++)b[w]=a.charCodeAt(w);return d}function L(a){return new g(function(h){var d=a.transaction(M,p),b=u([""]);d.objectStore(M).put(b,"key"),d.onabort=function(w){w.preventDefault(),w.stopPropagation(),h(!1)},d.oncomplete=function(){var w=navigator.userAgent.match(/Chrome\/(\d+)/),_=navigator.userAgent.match(/Edge\//);h(_||!w||parseInt(w[1],10)>=43)}}).catch(function(){return!1})}function A(a){return typeof f=="boolean"?g.resolve(f):L(a).then(function(h){return f=h})}function T(a){var h=l[a.name],d={};d.promise=new g(function(b,w){d.resolve=b,d.reject=w}),h.deferredOperations.push(d),h.dbReady?h.dbReady=h.dbReady.then(function(){return d.promise}):h.dbReady=d.promise}function z(a){var h=l[a.name].deferredOperations.pop();if(h)return h.resolve(),h.promise}function W(a,h){var d=l[a.name].deferredOperations.pop();if(d)return d.reject(h),d.promise}function O(a,h){return new g(function(d,b){if(l[a.name]=l[a.name]||eo(),a.db){if(!h)return d(a.db);T(a),a.db.close()}var w=[a.name];h&&w.push(a.version);var _=s.open.apply(s,w);h&&(_.onupgradeneeded=function(E){var x=_.result;try{x.createObjectStore(a.storeName),E.oldVersion<=1&&x.createObjectStore(M)}catch(I){if(I.name!=="ConstraintError")throw I;console.warn('The database "'+a.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),_.onerror=function(E){E.preventDefault(),b(_.error)},_.onsuccess=function(){var E=_.result;E.onversionchange=function(x){x.target.close()},d(E),z(a)}})}function R(a){return O(a,!1)}function H(a){return O(a,!0)}function X(a,h){if(!a.db)return!0;var d=!a.db.objectStoreNames.contains(a.storeName),b=a.version<a.db.version,w=a.version>a.db.version;if(b&&(a.version!==h&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),w||d){if(d){var _=a.db.version+1;_>a.version&&(a.version=_)}return!0}return!1}function le(a){return new g(function(h,d){var b=new FileReader;b.onerror=d,b.onloadend=function(w){var _=btoa(w.target.result||"");h({__local_forage_encoded_blob:!0,data:_,type:a.type})},b.readAsBinaryString(a)})}function oe(a){return u([y(atob(a.data))],{type:a.type})}function we(a){return a&&a.__local_forage_encoded_blob}function lt(a){var h=this,d=h._initReady().then(function(){var b=l[h._dbInfo.name];if(b&&b.dbReady)return b.dbReady});return C(d,a,a),d}function jt(a){T(a);for(var h=l[a.name],d=h.forages,b=0;b<d.length;b++){var w=d[b];w._dbInfo.db&&(w._dbInfo.db.close(),w._dbInfo.db=null)}return a.db=null,R(a).then(function(_){return a.db=_,X(a)?H(a):_}).then(function(_){a.db=h.db=_;for(var E=0;E<d.length;E++)d[E]._dbInfo.db=_}).catch(function(_){throw W(a,_),_})}function ve(a,h,d,b){b===void 0&&(b=1);try{var w=a.db.transaction(a.storeName,h);d(null,w)}catch(_){if(b>0&&(!a.db||_.name==="InvalidStateError"||_.name==="NotFoundError"))return g.resolve().then(function(){if(!a.db||_.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),H(a)}).then(function(){return jt(a).then(function(){ve(a,h,d,b-1)})}).catch(d);d(_)}}function eo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Br(a){var h=this,d={db:null};if(a)for(var b in a)d[b]=a[b];var w=l[d.name];w||(w=eo(),l[d.name]=w),w.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=lt);var _=[];function E(){return g.resolve()}for(var x=0;x<w.forages.length;x++){var I=w.forages[x];I!==h&&_.push(I._initReady().catch(E))}var P=w.forages.slice(0);return g.all(_).then(function(){return d.db=w.db,R(d)}).then(function($){return d.db=$,X(d,h._defaultConfig.version)?H(d):$}).then(function($){d.db=w.db=$,h._dbInfo=d;for(var U=0;U<P.length;U++){var F=P[U];F!==h&&(F._dbInfo.db=d.db,F._dbInfo.version=d.version)}})}function Wr(a,h){var d=this;a=N(a);var b=new g(function(w,_){d.ready().then(function(){ve(d._dbInfo,m,function(E,x){if(E)return _(E);try{var I=x.objectStore(d._dbInfo.storeName).get(a);I.onsuccess=function(){var P=I.result;P===void 0&&(P=null),we(P)&&(P=oe(P)),w(P)},I.onerror=function(){_(I.error)}}catch(P){_(P)}})}).catch(_)});return S(b,h),b}function Ur(a,h){var d=this,b=new g(function(w,_){d.ready().then(function(){ve(d._dbInfo,m,function(E,x){if(E)return _(E);try{var I=x.objectStore(d._dbInfo.storeName).openCursor(),P=1;I.onsuccess=function(){var $=I.result;if($){var U=$.value;we(U)&&(U=oe(U));var F=a(U,$.key,P++);F!==void 0?w(F):$.continue()}else w()},I.onerror=function(){_(I.error)}}catch($){_($)}})}).catch(_)});return S(b,h),b}function Or(a,h,d){var b=this;a=N(a);var w=new g(function(_,E){var x;b.ready().then(function(){return x=b._dbInfo,v.call(h)==="[object Blob]"?A(x.db).then(function(I){return I?h:le(h)}):h}).then(function(I){ve(b._dbInfo,p,function(P,$){if(P)return E(P);try{var U=$.objectStore(b._dbInfo.storeName);I===null&&(I=void 0);var F=U.put(I,a);$.oncomplete=function(){I===void 0&&(I=null),_(I)},$.onabort=$.onerror=function(){var V=F.error?F.error:F.transaction.error;E(V)}}catch(V){E(V)}})}).catch(E)});return S(w,d),w}function jr(a,h){var d=this;a=N(a);var b=new g(function(w,_){d.ready().then(function(){ve(d._dbInfo,p,function(E,x){if(E)return _(E);try{var I=x.objectStore(d._dbInfo.storeName).delete(a);x.oncomplete=function(){w()},x.onerror=function(){_(I.error)},x.onabort=function(){var P=I.error?I.error:I.transaction.error;_(P)}}catch(P){_(P)}})}).catch(_)});return S(b,h),b}function Hr(a){var h=this,d=new g(function(b,w){h.ready().then(function(){ve(h._dbInfo,p,function(_,E){if(_)return w(_);try{var x=E.objectStore(h._dbInfo.storeName).clear();E.oncomplete=function(){b()},E.onabort=E.onerror=function(){var I=x.error?x.error:x.transaction.error;w(I)}}catch(I){w(I)}})}).catch(w)});return S(d,a),d}function Fr(a){var h=this,d=new g(function(b,w){h.ready().then(function(){ve(h._dbInfo,m,function(_,E){if(_)return w(_);try{var x=E.objectStore(h._dbInfo.storeName).count();x.onsuccess=function(){b(x.result)},x.onerror=function(){w(x.error)}}catch(I){w(I)}})}).catch(w)});return S(d,a),d}function qr(a,h){var d=this,b=new g(function(w,_){a<0?w(null):d.ready().then(function(){ve(d._dbInfo,m,function(E,x){if(E)return _(E);try{var I=x.objectStore(d._dbInfo.storeName),P=!1,$=I.openKeyCursor();$.onsuccess=function(){var U=$.result;U?a===0||P?w(U.key):(P=!0,U.advance(a)):w(null)},$.onerror=function(){_($.error)}}catch(U){_(U)}})}).catch(_)});return S(b,h),b}function Xr(a){var h=this,d=new g(function(b,w){h.ready().then(function(){ve(h._dbInfo,m,function(_,E){if(_)return w(_);try{var x=E.objectStore(h._dbInfo.storeName).openKeyCursor(),I=[];x.onsuccess=function(){var P=x.result;P?(I.push(P.key),P.continue()):b(I)},x.onerror=function(){w(x.error)}}catch(P){w(P)}})}).catch(w)});return S(d,a),d}function Vr(a,h){h=D.apply(this,arguments);var d=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||d.name,a.storeName=a.storeName||d.storeName);var b,w=this;if(a.name){var _=a.name===d.name&&w._dbInfo.db?g.resolve(w._dbInfo.db):R(a).then(function(E){var x=l[a.name],I=x.forages;x.db=E;for(var P=0;P<I.length;P++)I[P]._dbInfo.db=E;return E});b=a.storeName?_.then(function(E){if(E.objectStoreNames.contains(a.storeName)){var x=E.version+1;T(a);var I=l[a.name],P=I.forages;E.close();for(var $=0;$<P.length;$++){var U=P[$];U._dbInfo.db=null,U._dbInfo.version=x}var F=new g(function(V,G){var re=s.open(a.name,x);re.onerror=function(Se){re.result.close(),G(Se)},re.onupgradeneeded=function(){re.result.deleteObjectStore(a.storeName)},re.onsuccess=function(){var Se=re.result;Se.close(),V(Se)}});return F.then(function(V){I.db=V;for(var G=0;G<P.length;G++){var re=P[G];re._dbInfo.db=V,z(re._dbInfo)}}).catch(function(V){throw(W(a,V)||g.resolve()).catch(function(){}),V})}}):_.then(function(E){T(a);var x=l[a.name],I=x.forages;E.close();for(var P=0;P<I.length;P++)I[P]._dbInfo.db=null;var $=new g(function(U,F){var V=s.deleteDatabase(a.name);V.onerror=function(){var G=V.result;G&&G.close(),F(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},V.onsuccess=function(){var G=V.result;G&&G.close(),U(G)}});return $.then(function(U){x.db=U;for(var F=0;F<I.length;F++)z(I[F]._dbInfo)}).catch(function(U){throw(W(a,U)||g.resolve()).catch(function(){}),U})})}else b=g.reject("Invalid arguments");return S(b,h),b}var Gr={_driver:"asyncStorage",_initStorage:Br,_support:c(),iterate:Ur,getItem:Wr,setItem:Or,removeItem:jr,clear:Hr,length:Fr,key:qr,keys:Xr,dropInstance:Vr};function Kr(){return typeof openDatabase=="function"}var Ce="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jr="~~local_forage_type~",to=/^~~local_forage_type~([^~]+)~/,ut="__lfsc__:",Ht=ut.length,Ft="arbf",qt="blob",no="si08",oo="ui08",ro="uic8",io="si16",so="si32",ao="ur16",co="ui32",lo="fl32",uo="fl64",ho=Ht+Ft.length,fo=Object.prototype.toString;function po(a){var h,d,b,w,_,E=.75*a.length,x=a.length,I=0;a[a.length-1]==="="&&(E--,a[a.length-2]==="="&&E--);var P=new ArrayBuffer(E),$=new Uint8Array(P);for(h=0;h<x;h+=4)d=Ce.indexOf(a[h]),b=Ce.indexOf(a[h+1]),w=Ce.indexOf(a[h+2]),_=Ce.indexOf(a[h+3]),$[I++]=d<<2|b>>4,$[I++]=(15&b)<<4|w>>2,$[I++]=(3&w)<<6|63&_;return P}function Xt(a){var h,d=new Uint8Array(a),b="";for(h=0;h<d.length;h+=3)b+=Ce[d[h]>>2],b+=Ce[(3&d[h])<<4|d[h+1]>>4],b+=Ce[(15&d[h+1])<<2|d[h+2]>>6],b+=Ce[63&d[h+2]];return d.length%3==2?b=b.substring(0,b.length-1)+"=":d.length%3==1&&(b=b.substring(0,b.length-2)+"=="),b}function Yr(a,h){var d="";if(a&&(d=fo.call(a)),a&&(d==="[object ArrayBuffer]"||a.buffer&&fo.call(a.buffer)==="[object ArrayBuffer]")){var b,w=ut;a instanceof ArrayBuffer?(b=a,w+=Ft):(b=a.buffer,d==="[object Int8Array]"?w+=no:d==="[object Uint8Array]"?w+=oo:d==="[object Uint8ClampedArray]"?w+=ro:d==="[object Int16Array]"?w+=io:d==="[object Uint16Array]"?w+=ao:d==="[object Int32Array]"?w+=so:d==="[object Uint32Array]"?w+=co:d==="[object Float32Array]"?w+=lo:d==="[object Float64Array]"?w+=uo:h(new Error("Failed to get type for BinaryArray"))),h(w+Xt(b))}else if(d==="[object Blob]"){var _=new FileReader;_.onload=function(){var E=Jr+a.type+"~"+Xt(this.result);h(ut+qt+E)},_.readAsArrayBuffer(a)}else try{h(JSON.stringify(a))}catch(E){console.error("Couldn't convert value into a JSON string: ",a),h(null,E)}}function Zr(a){if(a.substring(0,Ht)!==ut)return JSON.parse(a);var h,d=a.substring(ho),b=a.substring(Ht,ho);if(b===qt&&to.test(d)){var w=d.match(to);h=w[1],d=d.substring(w[0].length)}var _=po(d);switch(b){case Ft:return _;case qt:return u([_],{type:h});case no:return new Int8Array(_);case oo:return new Uint8Array(_);case ro:return new Uint8ClampedArray(_);case io:return new Int16Array(_);case ao:return new Uint16Array(_);case so:return new Int32Array(_);case co:return new Uint32Array(_);case lo:return new Float32Array(_);case uo:return new Float64Array(_);default:throw new Error("Unkown type: "+b)}}var Vt={serialize:Yr,deserialize:Zr,stringToBuffer:po,bufferToString:Xt};function go(a,h,d,b){a.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],d,b)}function Qr(a){var h=this,d={db:null};if(a)for(var b in a)d[b]=typeof a[b]!="string"?a[b].toString():a[b];var w=new g(function(_,E){try{d.db=openDatabase(d.name,String(d.version),d.description,d.size)}catch(x){return E(x)}d.db.transaction(function(x){go(x,d,function(){h._dbInfo=d,_()},function(I,P){E(P)})},E)});return d.serializer=Vt,w}function Ee(a,h,d,b,w,_){a.executeSql(d,b,w,function(E,x){x.code===x.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(I,P){P.rows.length?_(I,x):go(I,h,function(){I.executeSql(d,b,w,_)},_)},_):_(E,x)},_)}function ei(a,h){var d=this;a=N(a);var b=new g(function(w,_){d.ready().then(function(){var E=d._dbInfo;E.db.transaction(function(x){Ee(x,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[a],function(I,P){var $=P.rows.length?P.rows.item(0).value:null;$&&($=E.serializer.deserialize($)),w($)},function(I,P){_(P)})})}).catch(_)});return S(b,h),b}function ti(a,h){var d=this,b=new g(function(w,_){d.ready().then(function(){var E=d._dbInfo;E.db.transaction(function(x){Ee(x,E,"SELECT * FROM "+E.storeName,[],function(I,P){for(var $=P.rows,U=$.length,F=0;F<U;F++){var V=$.item(F),G=V.value;if(G&&(G=E.serializer.deserialize(G)),(G=a(G,V.key,F+1))!==void 0)return void w(G)}w()},function(I,P){_(P)})})}).catch(_)});return S(b,h),b}function mo(a,h,d,b){var w=this;a=N(a);var _=new g(function(E,x){w.ready().then(function(){h===void 0&&(h=null);var I=h,P=w._dbInfo;P.serializer.serialize(h,function($,U){U?x(U):P.db.transaction(function(F){Ee(F,P,"INSERT OR REPLACE INTO "+P.storeName+" (key, value) VALUES (?, ?)",[a,$],function(){E(I)},function(V,G){x(G)})},function(F){if(F.code===F.QUOTA_ERR){if(b>0)return void E(mo.apply(w,[a,I,d,b-1]));x(F)}})})}).catch(x)});return S(_,d),_}function ni(a,h,d){return mo.apply(this,[a,h,d,1])}function oi(a,h){var d=this;a=N(a);var b=new g(function(w,_){d.ready().then(function(){var E=d._dbInfo;E.db.transaction(function(x){Ee(x,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[a],function(){w()},function(I,P){_(P)})})}).catch(_)});return S(b,h),b}function ri(a){var h=this,d=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(E){Ee(E,_,"DELETE FROM "+_.storeName,[],function(){b()},function(x,I){w(I)})})}).catch(w)});return S(d,a),d}function ii(a){var h=this,d=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(E){Ee(E,_,"SELECT COUNT(key) as c FROM "+_.storeName,[],function(x,I){var P=I.rows.item(0).c;b(P)},function(x,I){w(I)})})}).catch(w)});return S(d,a),d}function si(a,h){var d=this,b=new g(function(w,_){d.ready().then(function(){var E=d._dbInfo;E.db.transaction(function(x){Ee(x,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[a+1],function(I,P){var $=P.rows.length?P.rows.item(0).key:null;w($)},function(I,P){_(P)})})}).catch(_)});return S(b,h),b}function ai(a){var h=this,d=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(E){Ee(E,_,"SELECT key FROM "+_.storeName,[],function(x,I){for(var P=[],$=0;$<I.rows.length;$++)P.push(I.rows.item($).key);b(P)},function(x,I){w(I)})})}).catch(w)});return S(d,a),d}function ci(a){return new g(function(h,d){a.transaction(function(b){b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(w,_){for(var E=[],x=0;x<_.rows.length;x++)E.push(_.rows.item(x).name);h({db:a,storeNames:E})},function(w,_){d(_)})},function(b){d(b)})})}function li(a,h){h=D.apply(this,arguments);var d=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||d.name,a.storeName=a.storeName||d.storeName);var b,w=this;return b=a.name?new g(function(_){var E;E=a.name===d.name?w._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?_({db:E,storeNames:[a.storeName]}):_(ci(E))}).then(function(_){return new g(function(E,x){_.db.transaction(function(I){function P(V){return new g(function(G,re){I.executeSql("DROP TABLE IF EXISTS "+V,[],function(){G()},function(Se,Jt){re(Jt)})})}for(var $=[],U=0,F=_.storeNames.length;U<F;U++)$.push(P(_.storeNames[U]));g.all($).then(function(){E()}).catch(function(V){x(V)})},function(I){x(I)})})}):g.reject("Invalid arguments"),S(b,h),b}var ui={_driver:"webSQLStorage",_initStorage:Qr,_support:Kr(),iterate:ti,getItem:ei,setItem:ni,removeItem:oi,clear:ri,length:ii,key:si,keys:ai,dropInstance:li};function hi(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function vo(a,h){var d=a.name+"/";return a.storeName!==h.storeName&&(d+=a.storeName+"/"),d}function di(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function fi(){return!di()||localStorage.length>0}function pi(a){var h=this,d={};if(a)for(var b in a)d[b]=a[b];return d.keyPrefix=vo(a,h._defaultConfig),fi()?(h._dbInfo=d,d.serializer=Vt,g.resolve()):g.reject()}function gi(a){var h=this,d=h.ready().then(function(){for(var b=h._dbInfo.keyPrefix,w=localStorage.length-1;w>=0;w--){var _=localStorage.key(w);_.indexOf(b)===0&&localStorage.removeItem(_)}});return S(d,a),d}function mi(a,h){var d=this;a=N(a);var b=d.ready().then(function(){var w=d._dbInfo,_=localStorage.getItem(w.keyPrefix+a);return _&&(_=w.serializer.deserialize(_)),_});return S(b,h),b}function vi(a,h){var d=this,b=d.ready().then(function(){for(var w=d._dbInfo,_=w.keyPrefix,E=_.length,x=localStorage.length,I=1,P=0;P<x;P++){var $=localStorage.key(P);if($.indexOf(_)===0){var U=localStorage.getItem($);if(U&&(U=w.serializer.deserialize(U)),(U=a(U,$.substring(E),I++))!==void 0)return U}}});return S(b,h),b}function yi(a,h){var d=this,b=d.ready().then(function(){var w,_=d._dbInfo;try{w=localStorage.key(a)}catch{w=null}return w&&(w=w.substring(_.keyPrefix.length)),w});return S(b,h),b}function wi(a){var h=this,d=h.ready().then(function(){for(var b=h._dbInfo,w=localStorage.length,_=[],E=0;E<w;E++){var x=localStorage.key(E);x.indexOf(b.keyPrefix)===0&&_.push(x.substring(b.keyPrefix.length))}return _});return S(d,a),d}function bi(a){var h=this.keys().then(function(d){return d.length});return S(h,a),h}function _i(a,h){var d=this;a=N(a);var b=d.ready().then(function(){var w=d._dbInfo;localStorage.removeItem(w.keyPrefix+a)});return S(b,h),b}function Si(a,h,d){var b=this;a=N(a);var w=b.ready().then(function(){h===void 0&&(h=null);var _=h;return new g(function(E,x){var I=b._dbInfo;I.serializer.serialize(h,function(P,$){if($)x($);else try{localStorage.setItem(I.keyPrefix+a,P),E(_)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(U),x(U)}})})});return S(w,d),w}function Ci(a,h){if(h=D.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var d=this.config();a.name=a.name||d.name,a.storeName=a.storeName||d.storeName}var b,w=this;return b=a.name?new g(function(_){a.storeName?_(vo(a,w._defaultConfig)):_(a.name+"/")}).then(function(_){for(var E=localStorage.length-1;E>=0;E--){var x=localStorage.key(E);x.indexOf(_)===0&&localStorage.removeItem(x)}}):g.reject("Invalid arguments"),S(b,h),b}var Ei={_driver:"localStorageWrapper",_initStorage:pi,_support:hi(),iterate:vi,getItem:mi,setItem:Si,removeItem:_i,clear:gi,length:bi,key:yi,keys:wi,dropInstance:Ci},ki=function(a,h){return a===h||typeof a=="number"&&typeof h=="number"&&isNaN(a)&&isNaN(h)},xi=function(a,h){for(var d=a.length,b=0;b<d;){if(ki(a[b],h))return!0;b++}return!1},yo=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Ke={},wo={},Oe={INDEXEDDB:Gr,WEBSQL:ui,LOCALSTORAGE:Ei},Ii=[Oe.INDEXEDDB._driver,Oe.WEBSQL._driver,Oe.LOCALSTORAGE._driver],ht=["dropInstance"],Gt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ht),Ti={description:"",driver:Ii.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ri(a,h){a[h]=function(){var d=arguments;return a.ready().then(function(){return a[h].apply(a,d)})}}function Kt(){for(var a=1;a<arguments.length;a++){var h=arguments[a];if(h)for(var d in h)h.hasOwnProperty(d)&&(yo(h[d])?arguments[0][d]=h[d].slice():arguments[0][d]=h[d])}return arguments[0]}var Pi=function(){function a(h){for(var d in r(this,a),Oe)if(Oe.hasOwnProperty(d)){var b=Oe[d],w=b._driver;this[d]=w,Ke[w]||this.defineDriver(b)}this._defaultConfig=Kt({},Ti),this._config=Kt({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.prototype.config=function(h){if((h===void 0?"undefined":o(h))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var d in h){if(d==="storeName"&&(h[d]=h[d].replace(/\W/g,"_")),d==="version"&&typeof h[d]!="number")return new Error("Database version must be a number.");this._config[d]=h[d]}return!("driver"in h)||!h.driver||this.setDriver(this._config.driver)}return typeof h=="string"?this._config[h]:this._config},a.prototype.defineDriver=function(h,d,b){var w=new g(function(_,E){try{var x=h._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!h._driver)return void E(I);for(var P=Gt.concat("_initStorage"),$=0,U=P.length;$<U;$++){var F=P[$];if((!xi(ht,F)||h[F])&&typeof h[F]!="function")return void E(I)}var V=function(){for(var re=function(zi){return function(){var Ai=new Error("Method "+zi+" is not implemented by the current driver"),bo=g.reject(Ai);return S(bo,arguments[arguments.length-1]),bo}},Se=0,Jt=ht.length;Se<Jt;Se++){var Yt=ht[Se];h[Yt]||(h[Yt]=re(Yt))}};V();var G=function(re){Ke[x]&&console.info("Redefining LocalForage driver: "+x),Ke[x]=h,wo[x]=re,_()};"_support"in h?h._support&&typeof h._support=="function"?h._support().then(G,E):G(!!h._support):G(!0)}catch(re){E(re)}});return C(w,d,b),w},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(h,d,b){var w=Ke[h]?g.resolve(Ke[h]):g.reject(new Error("Driver not found."));return C(w,d,b),w},a.prototype.getSerializer=function(h){var d=g.resolve(Vt);return C(d,h),d},a.prototype.ready=function(h){var d=this,b=d._driverSet.then(function(){return d._ready===null&&(d._ready=d._initDriver()),d._ready});return C(b,h,h),b},a.prototype.setDriver=function(h,d,b){var w=this;yo(h)||(h=[h]);var _=this._getSupportedDrivers(h);function E(){w._config.driver=w.driver()}function x($){return w._extend($),E(),w._ready=w._initStorage(w._config),w._ready}function I($){return function(){var U=0;function F(){for(;U<$.length;){var V=$[U];return U++,w._dbInfo=null,w._ready=null,w.getDriver(V).then(x).catch(F)}E();var G=new Error("No available storage method found.");return w._driverSet=g.reject(G),w._driverSet}return F()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=P.then(function(){var $=_[0];return w._dbInfo=null,w._ready=null,w.getDriver($).then(function(U){w._driver=U._driver,E(),w._wrapLibraryMethodsWithReady(),w._initDriver=I(_)})}).catch(function(){E();var $=new Error("No available storage method found.");return w._driverSet=g.reject($),w._driverSet}),C(this._driverSet,d,b),this._driverSet},a.prototype.supports=function(h){return!!wo[h]},a.prototype._extend=function(h){Kt(this,h)},a.prototype._getSupportedDrivers=function(h){for(var d=[],b=0,w=h.length;b<w;b++){var _=h[b];this.supports(_)&&d.push(_)}return d},a.prototype._wrapLibraryMethodsWithReady=function(){for(var h=0,d=Gt.length;h<d;h++)Ri(this,Gt[h])},a.prototype.createInstance=function(h){return new a(h)},a}(),Mi=new Pi;e.exports=Mi},{3:3}]},{},[4])(4)),rr.exports),xt=bt(Qs),sr={exports:{}},ea=(ir||(ir=1,function(n){((e,t)=>{n.exports=t()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let t=null,o=!1;const r=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const c=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",u={createWriteStream:function(S,C,N){let D={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},M=0,f=null,l=null,v=null;if(Number.isFinite(C)?([N,C]=[C,N],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=N,D.writableStrategy=C):C&&C.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=N,D.writableStrategy=C):D=C||{},!s){t||(t=i?g(u.mitm):function(L){const A="width=200,height=100",T=document.createDocumentFragment(),z={frame:e.open(L,"popup",A),loaded:!1,isIframe:!1,isPopup:!0,remove(){z.frame.close()},addEventListener(...O){T.addEventListener(...O)},dispatchEvent(...O){T.dispatchEvent(...O)},removeEventListener(...O){T.removeEventListener(...O)},postMessage(...O){z.frame.postMessage(...O)}},W=O=>{O.source===z.frame&&(z.loaded=!0,e.removeEventListener("message",W),z.dispatchEvent(new Event("load")))};return e.addEventListener("message",W),z}(u.mitm)),l=new MessageChannel,S=encodeURIComponent(S.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const p={transferringReadable:o,pathname:D.pathname||Math.random().toString().slice(-6)+"/"+S,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+S}};D.size&&(p.headers["Content-Length"]=D.size);const y=[p,"*",[l.port2]];if(o){const L=c==="iframe"?void 0:{transform(T,z){if(!(T instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");M+=T.length,z.enqueue(T),f&&(location.href=f,f=null)},flush(){f&&(location.href=f)}};v=new u.TransformStream(L,D.writableStrategy,D.readableStrategy);const A=v.readable;l.port1.postMessage({readableStream:A},[A])}l.port1.onmessage=L=>{L.data.download?c==="navigate"?(t.remove(),t=null,M?location.href=L.data.download:f=L.data.download):(t.isPopup&&(t.remove(),t=null,c==="iframe"&&g(u.mitm)),g(L.data.download)):L.data.abort&&(m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null)},t.loaded?t.postMessage(...y):t.addEventListener("load",()=>{t.postMessage(...y)},{once:!0})}let m=[];return!s&&v&&v.writable||new u.WritableStream({write(p){if(!(p instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?m.push(p):(l.port1.postMessage(p),M+=p.length,f&&(location.href=f,f=null))},close(){if(s){const p=new Blob(m,{type:"application/octet-stream; charset=utf-8"}),y=document.createElement("a");y.href=URL.createObjectURL(p),y.download=S,y.click()}else l.port1.postMessage("end")},abort(){m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null}},D.writableStrategy)},WritableStream:e.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function g(S){if(!S)throw new Error("meh");const C=document.createElement("iframe");return C.hidden=!0,C.src=S,C.loaded=!1,C.name="iframe",C.isIframe=!0,C.postMessage=(...N)=>C.contentWindow.postMessage(...N),C.addEventListener("load",()=>{C.loaded=!0},{once:!0}),document.body.appendChild(C),C}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(S=>{try{S()}catch{}})(()=>{const{readable:S}=new TransformStream,C=new MessageChannel;C.port1.postMessage(S,[S]),C.port1.close(),C.port2.close(),o=!0,Object.defineProperty(u,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),u})}(sr)),sr.exports),ta=bt(ea);class na{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(e,t,o=3,r=6,i=6e4){this.fileID=e,this.downloadURL=t,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=bn(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(e,t){this.eventTarget.on(e,t)}dispatch(e,t){this.eventTarget.emit(e,t)}dispatchError(e){this.eventTarget.emit("error",e)}dispatchInfo(e){this.eventTarget.emit("info",e)}async queryDownloadFileMeta(e,t="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await me(t,e,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=xt.createInstance({name:this.fileID,driver:xt.INDEXEDDB})}async init(e){if(this.finishNum=0,e){const t="fileinfo";this.fileMetaData={id:e.id,name:e.name,length:e.length,downloadID:e.downloadID,chunkSize:this.chunkByteSize},this.fileName=e.name,this.currentDB?.setItem(t,this.fileMetaData)}if(this.fileMetaData!=null){const t=this.fileMetaData.chunkSize;t!=null&&t>0&&(this.chunkByteSize=t)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),xt.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(e){return new Promise(t=>setTimeout(t,e))}async download(e,t){let o=e;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=B.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const c=this.cacheSize;let u=0;for(let g=0;g<this.totalChunks;g++){if(this.keys&&this.keys?.indexOf(g.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const S=g*this.chunkByteSize;let C=S+this.chunkByteSize-1;this.fileMetaData&&C>this.fileMetaData.length&&(C=this.fileMetaData.length-1);const N={range:`bytes=${S}-${C}`};for(;u>=c;)await this.sleep(200);const D=g.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${g+1}/${this.totalChunks}`),u++,me(o,t,i,N,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async M=>{const f=M.data;u--,await this.currentDB?.setItem(D,f),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const l=parseInt(D)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${l}/${this.totalChunks}`),this.savefile()}).catch(M=>{u--;const f=parseInt(D)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${f}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const e=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",e)}outputProgress(e){const t=100*e/this.totalChunks;this.dispatch("saveProgress",t)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const e=ta.createWriteStream(this.fileName).getWriter();let t=0;for(let o=0;o<this.totalChunks;o++){const r=o.toString();let i=await this.currentDB?.getItem(r);if(i||(i=await this.currentDB?.getItem(r)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${o+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const c=s.getReader();for(;;){const{done:u,value:g}=await c.read();if(u)break;await e.write(g)}t++,this.outputProgress(t),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),xt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function oa(n,e){let t="",o="";for(const r in e)t+=r+"="+encodeURIComponent(e[r])+"&";return t=t.replace(/&$/,""),o=/\?$/.test(n)?n+t:n.replace(/\/?$/,"?")+t,o}function ar(n={},e={}){let t;for(t in e)Me(e[t])?n[t]=ar(n[t],e[t]):n[t]=e[t];return n}function ra(n,e){const t=`${n}_${e}`;return he.MD5(t)}function cr(n){const e=function(c){if(!c)return;const u=c,g=[];if(u)for(let S of u){const C=lr(S);C&&g.push(C)}return g}(n.bussinessRoutes),t=function(c){if(!c)return;const u=c;if(u&&u.length>0){const g=[];return u.forEach(S=>{const C=ur(S);C&&g.push(C)}),g}}(n.widgetMenuConfig),o=function(c){if(c&&c.length>0){const u=[];return c.forEach(g=>{const S=function(C){return C?{id:C.id,label:C.label,layoutID:C.layoutID,container:C.container,preload:C.preload,afterid:C.afterid,bindid:C.bindid,group:C.group}:void 0}(g);S&&u.push(S)}),u}}(n.widgetConfig),r=function(c){if(c&&c.length>0)return c}(n.functionList),i=n.pkgObject.version,s=n.pkgObject.name;return{id:ra(s,i),name:B.Config.UI.SiteTitle,group:B.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:t,widgets:o,functions:r}}function lr(n){if(n){let e=0;n.meta?.hidden&&(e=1);let t={path:n.path,name:n.name,title:n.meta?.title,type:e,index:n.meta?.index};if(n.children){const o=[];for(let r of n.children){const i=lr(r);i&&o.push(i)}o.length>0&&(t.children=o)}return t}}function ur(n){if(!n)return;const e={name:n.name,index:n.index,path:n.path,type:n.type};return n.children&&n.children.length>0&&(e.children=[],n.children.forEach(t=>{const o=ur(t);o&&e.children?.push(o)})),e}function ia(n,e="IconifyList.ts"){let t="",o=`const iconlist={
|
|
9
|
-
`,
|
|
10
|
-
`,
|
|
11
|
-
`,
|
|
12
|
-
`,Ye(t+o+"export default iconlist;","IconifyList.ts"))}function sa(n,e){const t=cr(n);No(t,e),B.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function aa(n){let e=n.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e}function ca(n){let e=zn(n);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e}function zn(n){let e=n.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}function la(n){let e=n.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e}function ua(n){let e=n.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function ha(n){let e=n.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function da(n){return n.replace(/(^\s*)|(\s*$)/g,"")}function fa(n){let e=zn(n);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e}function pa(n,e="",t="red"){return e.replace(new RegExp(n,"gi"),`<span style='color: ${t}'>${n}</span>`)}function ga(n,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",t=""){let o=(n+="00").indexOf(".");o>=0&&(n=n.substring(0,o)+n.substr(o+1,2)),e=e.substr(e.length-n.length);for(let r=0;r<n.length;r++)t+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(n.substr(r,1),1)+e.substr(r,1);return t=t.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function ma(n){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(n)}function va(n){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(n)}function ya(n){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(n)}function wa(n){return!!/^[a-zA-Z]\w{5,15}$/.test(n)}function ba(n){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)}function _a(n){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(n)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)&&(e="\u5F3A"),e}function Sa(n){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(n)}function Ca(n){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)}function Ea(n){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(n)}function ka(n){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(n)}function xa(n){return!!/^[1-9][0-9]{5}$/.test(n)}function Ia(n){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(n)}function Ta(n){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(n)}let hr=!0;try{String.fromCharCode.apply(String,[1,2])}catch{hr=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var An=2654435769;function dr(n,e){var t=n.length,o=t<<2;if(e){var r=n[t-1];if(r<(o-=4)-3||r>o)return null;o=r}for(var i=new Uint8Array(o),s=0;s<o;++s)i[s]=n[s>>2]>>((3&s)<<3);return i}function It(n,e){var t,o=n.length,r=o>>2;3&o&&++r,e?(t=new Uint32Array(r+1))[r]=o:t=new Uint32Array(r);for(var i=0;i<o;++i)t[i>>2]|=n[i]<<((3&i)<<3);return t}function $e(n){return 4294967295&n}function Tt(n,e,t,o,r,i){return(t>>>5^e<<2)+(e>>>3^t<<4)^(n^e)+(i[3&o^r]^t)}function fr(n){if(n.length<16){var e=new Uint8Array(16);e.set(n),n=e}return n}function Rt(n){for(var e=n.length,t=new Uint8Array(3*e),o=0,r=0;r<e;r++){var i=n.charCodeAt(r);if(i<128)t[o++]=i;else if(i<2048)t[o++]=192|i>>6,t[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<e){var s=n.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var c=65536+((1023&i)<<10|1023&s);t[o++]=240|c>>18,t[o++]=128|c>>12&63,t[o++]=128|c>>6&63,t[o++]=128|63&c,r++;continue}}throw new Error("Malformed string")}t[o++]=224|i>>12,t[o++]=128|i>>6&63,t[o++]=128|63&i}}return t.subarray(0,o)}function pr(n){var e=n.length;return e===0?"":e<32767?function(t,o){for(var r=new Array(o),i=0,s=0,c=t.length;i<o&&s<c;i++){var u=t[s++];switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=u;break;case 12:case 13:if(!(s<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&u)<<6|63&t[s++];break;case 14:if(!(s+1<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&u)<<12|(63&t[s++])<<6|63&t[s++];break;case 15:if(!(s+2<c))throw new Error("Unfinished UTF-8 octet sequence");var g=((7&u)<<18|(63&t[s++])<<12|(63&t[s++])<<6|63&t[s++])-65536;if(!(0<=g&&g<=1048575))throw new Error("Character outside valid Unicode range: 0x"+g.toString(16));r[i++]=g>>10&1023|55296,r[i]=1023&g|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+u.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(n,e):function(t,o){for(var r=[],i=new Array(32768),s=0,c=0,u=t.length;s<o&&c<u;s++){var g=t[c++];switch(g>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=g;break;case 12:case 13:if(!(c<u))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&g)<<6|63&t[c++];break;case 14:if(!(c+1<u))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&g)<<12|(63&t[c++])<<6|63&t[c++];break;case 15:if(!(c+2<u))throw new Error("Unfinished UTF-8 octet sequence");var S=((7&g)<<18|(63&t[c++])<<12|(63&t[c++])<<6|63&t[c++])-65536;if(!(0<=S&&S<=1048575))throw new Error("Character outside valid Unicode range: 0x"+S.toString(16));i[s++]=S>>10&1023|55296,i[s]=1023&S|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+g.toString(16))}if(s>=32766){var C=s+1;i.length=C,r.push(String.fromCharCode.apply(String,i)),o-=C,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(n,e)}function Ra(n){var e=n.length;if(e===0)return"";var t=hr?n:function(c){for(var u=c.length,g=new Array(c.length),S=0;S<u;++S)g[S]=c[S];return g}(n);if(e<65535)return String.fromCharCode.apply(String,t);for(var o=32767&e,r=e>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,t.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,t.subarray(r<<15,e))),i.join("")}function gr(n,e){return typeof n=="string"&&(n=Rt(n)),typeof e=="string"&&(e=Rt(e)),n==null||n.length===0?n:dr(function(t,o){var r,i,s,c,u,g,S=t.length,C=S-1;for(i=t[C],s=0,g=0|Math.floor(6+52/S);g>0;--g){for(c=(s=$e(s+An))>>>2&3,u=0;u<C;++u)r=t[u+1],i=t[u]=$e(t[u]+Tt(s,r,i,u,c,o));r=t[0],i=t[C]=$e(t[C]+Tt(s,r,i,C,c,o))}return t}(It(n,!0),It(fr(e),!1)),!1)}function mr(n,e){return typeof n=="string"&&(n=function(t){for(var o=window.atob(t),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(n)),typeof e=="string"&&(e=Rt(e)),n==null||n.length===0?n:dr(function(t,o){var r,i,s,c,u,g=t.length,S=g-1;for(r=t[0],s=$e(Math.floor(6+52/g)*An);s!==0;s=$e(s-An)){for(c=s>>>2&3,u=S;u>0;--u)i=t[u-1],r=t[u]=$e(t[u]-Tt(s,r,i,u,c,o));i=t[S],r=t[0]=$e(t[0]-Tt(s,r,i,0,c,o))}return t}(It(n,!1),It(fr(e),!1)),!0)}const et={toBytes:Rt,toString:pr,encrypt:gr,encryptToString:function(n,e){return window.btoa(Ra(gr(n,e)))},decrypt:mr,decryptToString:function(n,e){return pr(mr(n,e))}},vr=n=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));const t=document.createElement("canvas");t.width=200,t.height=130;const o=t.getContext("2d");o.rotate(-20*Math.PI/180),o.font="12px Vedana",o.fillStyle="rgba(200, 200, 200, 0.30)",o.textBaseline="middle",o.fillText(n,t.width/10,t.height/2);const r=document.createElement("div");return r.id=e,r.style.pointerEvents="none",r.style.top="0px",r.style.left="0px",r.style.position="fixed",r.style.zIndex="10000000",r.style.width=`${document.documentElement.clientWidth}px`,r.style.height=`${document.documentElement.clientHeight}px`,r.style.background=`url(${t.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),e},Pa={set:n=>{let e=vr(n);document.getElementById(e)===null&&(e=vr(n))},del:()=>{let n="1.23452384164.123412416";document.getElementById(n)!==null&&document.body.removeChild(document.getElementById(n))}};class Ne extends Error{constructor(e,t){const o=new.target.prototype;super(`${e}: Status code '${t}'`),this.statusCode=t,this.__proto__=o}}class Dn extends Error{constructor(e="A timeout occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class ye extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class Ma extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}}class za extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}}class Aa extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}}class yr extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class Da extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}}class wr{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}}class Pt{get(e,t){return this.send({...t,method:"GET",url:e})}post(e,t){return this.send({...t,method:"POST",url:e})}delete(e,t){return this.send({...t,method:"DELETE",url:e})}getCookieString(e){return""}}var k;(function(n){n[n.Trace=0]="Trace",n[n.Debug=1]="Debug",n[n.Information=2]="Information",n[n.Warning=3]="Warning",n[n.Error=4]="Error",n[n.Critical=5]="Critical",n[n.None=6]="None"})(k||(k={}));class tt{constructor(){}log(e,t){}}tt.instance=new tt;class ee{static isRequired(e,t){if(e==null)throw new Error(`The '${t}' argument is required.`)}static isNotEmpty(e,t){if(!e||e.match(/^\s*$/))throw new Error(`The '${t}' argument should not be empty.`)}static isIn(e,t,o){if(!(e in t))throw new Error(`Unknown ${o} value: ${e}.`)}}class Z{static get isBrowser(){return!Z.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Z.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Z.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function nt(n,e){let t="";return Be(n)?(t=`Binary data of length ${n.byteLength}`,e&&(t+=`. Content: '${function(o){const r=new Uint8Array(o);let i="";return r.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(n)}'`)):typeof n=="string"&&(t=`String data of length ${n.length}`,e&&(t+=`. Content: '${n}'`)),t}function Be(n){return n&&typeof ArrayBuffer<"u"&&(n instanceof ArrayBuffer||n.constructor&&n.constructor.name==="ArrayBuffer")}async function br(n,e,t,o,r,i){const s={},[c,u]=Xe();s[c]=u,n.log(k.Trace,`(${e} transport) sending data. ${nt(r,i.logMessageContent)}.`);const g=Be(r)?"arraybuffer":"text",S=await t.post(o,{content:r,headers:{...s,...i.headers},responseType:g,timeout:i.timeout,withCredentials:i.withCredentials});n.log(k.Trace,`(${e} transport) request complete. Response status: ${S.statusCode}.`)}class La{constructor(e,t){this._subject=e,this._observer=t}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(t=>{})}}class Mt{constructor(e){this._minLevel=e,this.out=console}log(e,t){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${k[e]}: ${t}`;switch(e){case k.Critical:case k.Error:this.out.error(o);break;case k.Warning:this.out.warn(o);break;case k.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Xe(){let n="X-SignalR-User-Agent";return Z.isNode&&(n="User-Agent"),[n,$a("8.0.7",Na(),Wa(),Ba())]}function $a(n,e,t,o){let r="Microsoft SignalR/";const i=n.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${n}; `,r+=e&&e!==""?`${e}; `:"Unknown OS; ",r+=`${t}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Na(){if(!Z.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Ba(){if(Z.isNode)return process.versions.node}function Wa(){return Z.isNode?"NodeJS":"Browser"}function Ln(n){return n.stack?n.stack:n.message?n.message:`${n}`}class Ua extends Pt{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||Z.isNode){const t=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(t("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=t("node-fetch"):this._fetchType=fetch,this._fetchType=t("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const t=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=t("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new ye;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const t=new this._abortControllerType;let o;e.abortSignal&&(e.abortSignal.onabort=()=>{t.abort(),o=new ye});let r,i=null;if(e.timeout){const u=e.timeout;i=setTimeout(()=>{t.abort(),this._logger.log(k.Warning,"Timeout from HTTP request."),o=new Dn},u)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Be(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:t.signal})}catch(u){throw o||(this._logger.log(k.Warning,`Error from HTTP request. ${u}.`),u)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const u=await _r(r,"text");throw new Ne(u||r.statusText,r.status)}const s=_r(r,e.responseType),c=await s;return new wr(r.status,r.statusText,c)}getCookieString(e){let t="";return Z.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>t=r.join("; ")),t}}function _r(n,e){let t;switch(e){case"arraybuffer":t=n.arrayBuffer();break;case"text":default:t=n.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return t}class Oa extends Pt{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ye):e.method?e.url?new Promise((t,o)=>{const r=new XMLHttpRequest;r.open(e.method,e.url,!0),r.withCredentials=e.withCredentials===void 0||e.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Be(e.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),e.responseType&&(r.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{r.abort(),o(new ye)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new wr(r.status,r.statusText,r.response||r.responseText)):o(new Ne(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(k.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new Ne(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(k.Warning,"Timeout from HTTP request."),o(new Dn)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class ja extends Pt{constructor(e){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Ua(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Oa(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ye):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class pe{static write(e){return`${e}${pe.RecordSeparator}`}static parse(e){if(e[e.length-1]!==pe.RecordSeparator)throw new Error("Message is incomplete.");const t=e.split(pe.RecordSeparator);return t.pop(),t}}pe.RecordSeparatorCode=30,pe.RecordSeparator=String.fromCharCode(pe.RecordSeparatorCode);class Ha{writeHandshakeRequest(e){return pe.write(JSON.stringify(e))}parseHandshakeResponse(e){let t,o;if(Be(e)){const s=new Uint8Array(e),c=s.indexOf(pe.RecordSeparatorCode);if(c===-1)throw new Error("Message is incomplete.");const u=c+1;t=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,u))),o=s.byteLength>u?s.slice(u).buffer:null}else{const s=e,c=s.indexOf(pe.RecordSeparator);if(c===-1)throw new Error("Message is incomplete.");const u=c+1;t=s.substring(0,u),o=s.length>u?s.substring(u):null}const r=pe.parse(t),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var j;(function(n){n[n.Invocation=1]="Invocation",n[n.StreamItem=2]="StreamItem",n[n.Completion=3]="Completion",n[n.StreamInvocation=4]="StreamInvocation",n[n.CancelInvocation=5]="CancelInvocation",n[n.Ping=6]="Ping",n[n.Close=7]="Close",n[n.Ack=8]="Ack",n[n.Sequence=9]="Sequence"})(j||(j={}));class Fa{constructor(){this.observers=[]}next(e){for(const t of this.observers)t.next(e)}error(e){for(const t of this.observers)t.error&&t.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new La(this,e)}}class qa{constructor(e,t,o){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=t,this._bufferSize=o}async _send(e){const t=this._protocol.writeMessage(e);let o=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let r=()=>{},i=()=>{};Be(t)?this._bufferedByteCount+=t.byteLength:this._bufferedByteCount+=t.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,c)=>{r=s,i=c})),this._messages.push(new Xa(t,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(t)}catch{this._disconnected()}await o}_ack(e){let t=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=e.sequenceId)t=o,Be(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}t!==-1&&(this._messages=this._messages.slice(t+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===j.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const t=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,t<=this._latestReceivedSequenceId?(t===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=t,this._ackTimer(),!0)}_resetSequence(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:j.Sequence,sequenceId:e}));const t=this._messages;for(const o of t)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const t of this._messages)t._rejector(e)}_isInvocationMessage(e){switch(e.type){case j.Invocation:case j.StreamItem:case j.Completion:case j.StreamInvocation:case j.CancelInvocation:return!0;case j.Close:case j.Sequence:case j.Ping:case j.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:j.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Xa{constructor(e,t,o,r){this._message=e,this._id=t,this._resolver=o,this._rejector=r}}var Y;(function(n){n.Disconnected="Disconnected",n.Connecting="Connecting",n.Connected="Connected",n.Disconnecting="Disconnecting",n.Reconnecting="Reconnecting"})(Y||(Y={}));class Yn{static create(e,t,o,r,i,s,c){return new Yn(e,t,o,r,i,s,c)}constructor(e,t,o,r,i,s,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(k.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},ee.isRequired(e,"connection"),ee.isRequired(t,"logger"),ee.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=c??1e5,this._logger=t,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Ha,this.connection.onreceive=u=>this._processIncomingData(u),this.connection.onclose=u=>this._connectionClosed(u),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:j.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==Y.Disconnected&&this._connectionState!==Y.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==Y.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Y.Connecting,this._logger.log(k.Debug,"Starting HubConnection.");try{await this._startInternal(),Z.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Y.Connected,this._connectionStarted=!0,this._logger.log(k.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Y.Disconnected,this._logger.log(k.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((t,o)=>{this._handshakeResolver=t,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let t=this._protocol.version;this.connection.features.reconnect||(t=1);const o={protocol:this._protocol.name,version:t};if(this._logger.log(k.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(k.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new qa(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(t){throw this._logger.log(k.Debug,`Hub handshake failed with error '${t}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(t),t}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===Y.Disconnected)return this._logger.log(k.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Y.Disconnecting)return this._logger.log(k.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const t=this._connectionState;return this._connectionState=Y.Disconnecting,this._logger.log(k.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(k.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(t===Y.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new ye("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...t){const[o,r]=this._replaceStreamingParams(t),i=this._createStreamInvocation(e,t,r);let s;const c=new Fa;return c.cancelCallback=()=>{const u=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(u))},this._callbacks[i.invocationId]=(u,g)=>{g?c.error(g):u&&(u.type===j.Completion?u.error?c.error(new Error(u.error)):c.complete():c.next(u.item))},s=this._sendWithProtocol(i).catch(u=>{c.error(u),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...t){const[o,r]=this._replaceStreamingParams(t),i=this._sendWithProtocol(this._createInvocation(e,t,!0,r));return this._launchStreams(o,i),i}invoke(e,...t){const[o,r]=this._replaceStreamingParams(t),i=this._createInvocation(e,t,!1,r);return new Promise((c,u)=>{this._callbacks[i.invocationId]=(S,C)=>{C?u(C):S&&(S.type===j.Completion?S.error?u(new Error(S.error)):c(S.result):u(new Error(`Unexpected message type: ${S.type}`)))};const g=this._sendWithProtocol(i).catch(S=>{u(S),delete this._callbacks[i.invocationId]});this._launchStreams(o,g)})}on(e,t){e&&t&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(t)===-1&&this._methods[e].push(t))}off(e,t){if(!e)return;e=e.toLowerCase();const o=this._methods[e];if(o)if(t){const r=o.indexOf(t);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const t=this._protocol.parseMessages(e,this._logger);for(const o of t)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case j.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(k.Error,`Invoke client method threw error: ${Ln(r)}`)});break;case j.StreamItem:case j.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===j.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(k.Error,`Stream callback threw error: ${Ln(i)}`)}}break}case j.Ping:break;case j.Close:{this._logger.log(k.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case j.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case j.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(k.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let t,o;try{[o,t]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(k.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(t.error){const r="Server returned handshake error: "+t.error;this._logger.log(k.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(k.Debug,"Server handshake complete."),this._handshakeResolver(),o}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===Y.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const t=e.target.toLowerCase(),o=this._methods[t];if(!o)return this._logger.log(k.Warning,`No client method with the name '${t}' found.`),void(e.invocationId&&(this._logger.log(k.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!e.invocationId;let s,c,u;for(const g of r)try{const S=s;s=await g.apply(this,e.arguments),i&&s&&S&&(this._logger.log(k.Error,`Multiple results provided for '${t}'. Sending error to server.`),u=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(S){c=S,this._logger.log(k.Error,`A callback for the method '${t}' threw error '${S}'.`)}u?await this._sendWithProtocol(u):i?(c?u=this._createCompletionMessage(e.invocationId,`${c}`,null):s!==void 0?u=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(k.Warning,`No result given for '${t}' method and invocation ID '${e.invocationId}'.`),u=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(u)):s&&this._logger.log(k.Error,`Result given for '${t}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(k.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new ye("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Y.Disconnecting?this._completeClose(e):this._connectionState===Y.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===Y.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),Z.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(t=>t.apply(this,[e]))}catch(t){this._logger.log(k.Error,`An onclose callback called with error '${e}' threw error '${t}'.`)}}}async _reconnect(e){const t=Date.now();let o=0,r=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(k.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=Y.Reconnecting,e?this._logger.log(k.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(k.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(k.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==Y.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(k.Information,`Reconnect attempt number ${o} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==Y.Reconnecting)return void this._logger.log(k.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Y.Connected,this._logger.log(k.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(k.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(k.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==Y.Reconnecting)return this._logger.log(k.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===Y.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-t,r)}}this._logger.log(k.Information,`Reconnect retries have been exhausted after ${Date.now()-t} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,t,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:t,previousRetryCount:e,retryReason:o})}catch(r){return this._logger.log(k.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${t}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const t=this._callbacks;this._callbacks={},Object.keys(t).forEach(o=>{const r=t[o];try{r(null,e)}catch(i){this._logger.log(k.Error,`Stream 'error' callback called with '${e}' threw error: ${Ln(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,t,o,r){if(o)return r.length!==0?{arguments:t,streamIds:r,target:e,type:j.Invocation}:{arguments:t,target:e,type:j.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:t,invocationId:i.toString(),streamIds:r,target:e,type:j.Invocation}:{arguments:t,invocationId:i.toString(),target:e,type:j.Invocation}}}_launchStreams(e,t){if(e.length!==0){t||(t=Promise.resolve());for(const o in e)e[o].subscribe({complete:()=>{t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",t=t.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{t=t.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(e){const t=[],o=[];for(let r=0;r<e.length;r++){const i=e[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,t[s]=i,o.push(s.toString()),e.splice(r,1)}}return[t,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,t,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:t,invocationId:r.toString(),streamIds:o,target:e,type:j.StreamInvocation}:{arguments:t,invocationId:r.toString(),target:e,type:j.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:j.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:j.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:j.Completion}:{invocationId:e,result:o,type:j.Completion}}_createCloseMessage(){return{type:j.Close}}}const Va=[0,2e3,1e4,3e4,null];class Sr{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Va}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class We{}We.Authorization="Authorization",We.Cookie="Cookie";class Ga extends Pt{constructor(e,t){super(),this._innerClient=e,this._accessTokenFactory=t}async send(e){let t=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(t=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const o=await this._innerClient.send(e);return t&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):o}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[We.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[We.Authorization]&&delete e.headers[We.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var te,ae;(function(n){n[n.None=0]="None",n[n.WebSockets=1]="WebSockets",n[n.ServerSentEvents=2]="ServerSentEvents",n[n.LongPolling=4]="LongPolling"})(te||(te={})),function(n){n[n.Text=1]="Text",n[n.Binary=2]="Binary"}(ae||(ae={}));class Ka{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class Cr{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new Ka,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,t){if(ee.isRequired(e,"url"),ee.isRequired(t,"transferFormat"),ee.isIn(t,ae,"transferFormat"),this._url=e,this._logger.log(k.Trace,"(LongPolling transport) Connecting."),t===ae.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[o,r]=Xe(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};t===ae.Binary&&(s.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${c}.`);const u=await this._httpClient.get(c,s);u.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${u.statusCode}.`),this._closeError=new Ne(u.statusText||"",u.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,t){try{for(;this._running;)try{const o=`${e}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,t);r.statusCode===204?(this._logger.log(k.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new Ne(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(k.Trace,`(LongPolling transport) data received. ${nt(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof Dn?this._logger.log(k.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(k.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(k.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?br(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(k.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(k.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[t,o]=Xe();e[t]=o;const r={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,r)}catch(s){i=s}i?i instanceof Ne&&(i.statusCode===404?this._logger.log(k.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(k.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(k.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(k.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(k.Trace,e),this.onclose(this._closeError)}}}class Ja{constructor(e,t,o,r){this._httpClient=e,this._accessToken=t,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,t){return ee.isRequired(e,"url"),ee.isRequired(t,"transferFormat"),ee.isIn(t,ae,"transferFormat"),this._logger.log(k.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(t===ae.Text){if(Z.isBrowser||Z.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),u={};u.Cookie=c;const[g,S]=Xe();u[g]=S,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...u,...this._options.headers}})}try{i.onmessage=c=>{if(this.onreceive)try{this._logger.log(k.Trace,`(SSE transport) data received. ${nt(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(u){return void this._close(u)}},i.onerror=c=>{s?this._close():r(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(k.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(c){return void r(c)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?br(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Ya{constructor(e,t,o,r,i,s){this._logger=o,this._accessTokenFactory=t,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,t){let o;return ee.isRequired(e,"url"),ee.isRequired(t,"transferFormat"),ee.isIn(t,ae,"transferFormat"),this._logger.log(k.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;e=e.replace(/^http/,"ws");const c=this._httpClient.getCookieString(e);let u=!1;if(Z.isNode||Z.isReactNative){const g={},[S,C]=Xe();g[S]=C,o&&(g[We.Authorization]=`Bearer ${o}`),c&&(g[We.Cookie]=c),s=new this._webSocketConstructor(e,void 0,{headers:{...g,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),t===ae.Binary&&(s.binaryType="arraybuffer"),s.onopen=g=>{this._logger.log(k.Information,`WebSocket connected to ${e}.`),this._webSocket=s,u=!0,r()},s.onerror=g=>{let S=null;S=typeof ErrorEvent<"u"&&g instanceof ErrorEvent?g.error:"There was an error with the transport",this._logger.log(k.Information,`(WebSockets transport) ${S}.`)},s.onmessage=g=>{if(this._logger.log(k.Trace,`(WebSockets transport) data received. ${nt(g.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(g.data)}catch(S){return void this._close(S)}},s.onclose=g=>{if(u)this._close(g);else{let S=null;S=typeof ErrorEvent<"u"&&g instanceof ErrorEvent?g.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(S))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(k.Trace,`(WebSockets transport) sending data. ${nt(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(k.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class Za{constructor(e,t={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ee.isRequired(e,"url"),this._logger=(o=t.logger)===void 0?new Mt(k.Information):o===null?tt.instance:o.log!==void 0?o:new Mt(o),this.baseUrl=this._resolveUrl(e),(t=t||{}).logMessageContent=t.logMessageContent!==void 0&&t.logMessageContent,typeof t.withCredentials!="boolean"&&t.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");t.withCredentials=t.withCredentials===void 0||t.withCredentials,t.timeout=t.timeout===void 0?1e5:t.timeout;let r=null,i=null;if(Z.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}Z.isNode||typeof WebSocket>"u"||t.WebSocket?Z.isNode&&!t.WebSocket&&r&&(t.WebSocket=r):t.WebSocket=WebSocket,Z.isNode||typeof EventSource>"u"||t.EventSource?Z.isNode&&!t.EventSource&&i!==void 0&&(t.EventSource=i):t.EventSource=EventSource,this._httpClient=new Ga(t.httpClient||new ja(this._logger),t.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=t,this.onreceive=null,this.onclose=null}async start(e){if(e=e||ae.Binary,ee.isIn(e,ae,"transferFormat"),this._logger.log(k.Debug,`Starting connection with transfer format '${ae[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const t="Failed to start the HttpConnection before stop() was called.";return this._logger.log(k.Error,t),await this._stopPromise,Promise.reject(new ye(t))}if(this._connectionState!=="Connected"){const t="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(k.Error,t),Promise.reject(new ye(t))}this._connectionStarted=!0}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Zn(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(k.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(t=>{this._stopPromiseResolver=t}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(t){this._logger.log(k.Error,`HttpConnection.transport.stop() threw error '${t}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(k.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let t=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==te.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(te.WebSockets),await this._startTransport(t,e)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(t),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new ye("The connection was stopped during negotiation.");if(o.error)throw new Error(o.error);if(o.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(o.url&&(t=o.url),o.accessToken){const i=o.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}r++}while(o.url&&r<100);if(r===100&&o.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(t,this._options.transport,o,e)}this.transport instanceof Cr&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(k.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(k.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(e){const t={},[o,r]=Xe();t[o]=r;const i=this._resolveNegotiateUrl(e);this._logger.log(k.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const c=JSON.parse(s.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new yr("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(s){let c="Failed to complete negotiation with the server: "+s;return s instanceof Ne&&s.statusCode===404&&(c+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(k.Error,c),Promise.reject(new yr(c))}}_createConnectUrl(e,t){return t?e+(e.indexOf("?")===-1?"?":"&")+`id=${t}`:e}async _createTransport(e,t,o,r){let i=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(t))return this._logger.log(k.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=t,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],c=o.availableTransports||[];let u=o;for(const g of c){const S=this._resolveTransportOrError(g,t,r,u?.useStatefulReconnect===!0);if(S instanceof Error)s.push(`${g.transport} failed:`),s.push(S);else if(this._isITransport(S)){if(this.transport=S,!u){try{u=await this._getNegotiationResponse(e)}catch(C){return Promise.reject(C)}i=this._createConnectUrl(e,u.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=u.connectionId)}catch(C){if(this._logger.log(k.Error,`Failed to start the transport '${g.transport}': ${C}`),u=void 0,s.push(new Aa(`${g.transport} failed: ${C}`,te[g.transport])),this._connectionState!=="Connecting"){const N="Failed to select transport before stop() was called.";return this._logger.log(k.Debug,N),Promise.reject(new ye(N))}}}}return s.length>0?Promise.reject(new Da(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case te.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ya(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case te.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Ja(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case te.LongPolling:return new Cr(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,t){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,t),await this.features.resend()}catch{r=!0}r&&this._stopConnection(o)}else this._stopConnection(o)}:this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(e,t)}_resolveTransportOrError(e,t,o,r){const i=te[e.transport];if(i==null)return this._logger.log(k.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,c){return!s||!!(c&s)}(t,i))return this._logger.log(k.Debug,`Skipping transport '${te[i]}' because it was disabled by the client.`),new za(`'${te[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(c=>ae[c]).indexOf(o)>=0))return this._logger.log(k.Debug,`Skipping transport '${te[i]}' because it does not support the requested transfer format '${ae[o]}'.`),new Error(`'${te[i]}' does not support ${ae[o]}.`);if(i===te.WebSockets&&!this._options.WebSocket||i===te.ServerSentEvents&&!this._options.EventSource)return this._logger.log(k.Debug,`Skipping transport '${te[i]}' because it is not supported in your environment.'`),new Ma(`'${te[i]}' is not supported in your environment.`,i);this._logger.log(k.Debug,`Selecting transport '${te[i]}'.`);try{return this.features.reconnect=i===te.WebSockets?r:void 0,this._constructTransport(i)}catch(c){return c}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(k.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(k.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(k.Error,`Connection disconnected with error '${e}'.`):this._logger.log(k.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(t=>{this._logger.log(k.Error,`TransportSendQueue.stop() threw error '${t}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(t){this._logger.log(k.Error,`HttpConnection.onclose(${e}) threw error '${t}'.`)}}}else this._logger.log(k.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Z.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const t=window.document.createElement("a");return t.href=e,this._logger.log(k.Information,`Normalizing '${e}' to '${t.href}'.`),t.href}_resolveNegotiateUrl(e){const t=new URL(e);t.pathname.endsWith("/")?t.pathname+="negotiate":t.pathname+="/negotiate";const o=new URLSearchParams(t.searchParams);return o.has("negotiateVersion")||o.append("negotiateVersion",this._negotiateVersion.toString()),o.has("useStatefulReconnect")?o.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&o.append("useStatefulReconnect","true"),t.search=o.toString(),t.toString()}}class Zn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new zt,this._transportResult=new zt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new zt),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new zt;const e=this._transportResult;this._transportResult=void 0;const t=typeof this._buffer[0]=="string"?this._buffer.join(""):Zn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(t),e.resolve()}catch(o){e.reject(o)}}}static _concatBuffers(e){const t=e.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(t);let r=0;for(const i of e)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class zt{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Qa{constructor(){this.name="json",this.version=2,this.transferFormat=ae.Text}parseMessages(e,t){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];t===null&&(t=tt.instance);const o=pe.parse(e),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case j.Invocation:this._isInvocationMessage(s);break;case j.StreamItem:this._isStreamItemMessage(s);break;case j.Completion:this._isCompletionMessage(s);break;case j.Ping:case j.Close:break;case j.Ack:this._isAckMessage(s);break;case j.Sequence:this._isSequenceMessage(s);break;default:t.log(k.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(e){return pe.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,t){if(typeof e!="string"||e==="")throw new Error(t)}}const ec={trace:k.Trace,debug:k.Debug,info:k.Information,information:k.Information,warn:k.Warning,warning:k.Warning,error:k.Error,critical:k.Critical,none:k.None};class tc{configureLogging(e){if(ee.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const t=function(o){const r=ec[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new Mt(t)}else this.logger=new Mt(e);return this}withUrl(e,t){return ee.isRequired(e,"url"),ee.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof t=="object"?{...this.httpConnectionOptions,...t}:{...this.httpConnectionOptions,transport:t},this}withHubProtocol(e){return ee.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Sr(e):this.reconnectPolicy=e:this.reconnectPolicy=new Sr,this}withServerTimeout(e){return ee.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return ee.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const t=new Za(this.url,e);return Yn.create(t,this.logger||tt.instance,this.protocol||new Qa,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let At;function nc(n){if(!n){if(At)return At;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new tc().configureLogging(k.Information).withUrl(n).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{B.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{B.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{B.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{B.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),At||(At=e),e}const $n=new Set;function Er(n){return n!==null?parseFloat(n):0}function Dt(n){const e=window.getComputedStyle(n),t=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Er).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Er).reduce((r,i)=>r+i));return{width:t,height:o}}class kr{width;height;constructor(e,t){this.width=e,this.height=t}}function oc(n){const e=n.windowEl;if(e){const t=parseFloat(e.style.left||"NaN"),o=parseFloat(e.style.top||"NaN");if(!isNaN(t)&&!isNaN(o))return{left:t,top:o}}return null}function rc(n,e,t,o){const r=n-t,i=e-o;return r*r+i*i}window.addEventListener("resize",n=>{$n.forEach(e=>{e&&yt(e.fixPosition)&&e.fixPosition()})});const Lt=[];var $t=Ie({name:"VWindow",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:vt},setup(n,{emit:e}){const t=Li();if(!t)return;const{proxy:o}=t;let r=0,i,s,c;const u=K(n.isOpen),g=()=>{Lt.push(o),c=new Ji(n.zGroup,S),n.isOpen&&function(A){A&&(Co(()=>{r++==0&&(m(o),function(){const T=C.value,{width:z,height:W}=ln(T);let O,R;if(n.left!==void 0!=(n.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof n.left=="number")O=n.left,R=n.top;else{const H=n.positionHint||"auto";switch(H){case"auto":{let X=20,le=50,oe=0;do{if(Lt.every(we=>{if(!we.isOpen||o==we)return!0;const lt=oc(we);if(lt==null)return!0;const{left:jt,top:ve}=lt;return rc(jt,ve,X,le)>16}))break;X=(X+40)%(window.innerWidth-200),le=(le+40)%(window.innerHeight-200)}while(++oe<100);O=X,R=le}break;case"center":O=(window.innerWidth-z)/2,R=(window.innerHeight-W)/2,console.log(O,R,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=H.split("/").map(Number);if(X.length!=2)throw null;const[le,oe]=X;if(!isFinite(le)||!isFinite(oe))throw null;O=le>=0?le:window.innerWidth-z+le,R=oe>=0?oe:window.innerHeight-W+oe}catch{throw new Error(`invalid position string: ${H}`)}}}T&&(T.style.left=`${O}px`,T.style.top=`${R}px`)}()),n.resizable&&p(),L(),i=new Ki(N.value,C.value,{onMove:()=>L(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),n.resizable&&function(){const{height:T}=ln(N.value);s=new Zi(C.value,{onResize:()=>p(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:n.minWidth,minHeight:n.minHeight+T,maxWidth:n.maxWidth,maxHeight:n.maxHeight?n.maxHeight+T:void 0})}()}),n.activateWhenOpen&&M())}(!0),$n.add(o)};function S(A){f.value.zIndex=`${A}`}const C=K(null),N=K(null),D=K(null);function M(){c.raise(),e("activate")}const f=K({...n.windowStyle.window,zIndex:"auto",overflow:n.overflow}),l=je(()=>n.windowStyle.titlebar),v=je(()=>{const A={...n.windowStyle.content};return n.resizable?A.padding="0":n.padding!=null&&(A.padding=`${n.padding}px`),n.isScrollable&&(A.overflow="auto"),A});function m(A){const{width:T,height:z,top:W,left:O}=A,R=C;if(R&&T!=null&&(R.value.style.width=`${T}px`),z!=null){const H=N.value;if(H){const X=Dt(H).height;R.value.style.height=`${z+X}px`}}R&&O!=null&&(R.value.style.left=`${O}px`),R&&W!=null&&(R.value.style.top=`${W}px`)}function p(A=!0){const T=C.value,z=N.value,W=D.value;if(W&&T&&z){const{width:O,height:R}=Dt(W),{width:H,height:X}=Dt(T),le=Dt(z).height,oe=H-(W.offsetWidth-O),we=X-le-(W.offsetHeight-R);W.style.width=`${oe}px`,W.style.height=`${we}px`,y(),e("resize",new kr(oe,we)),A&&(e("update:width",oe),e("update:height",we))}}function y(){const A=C.value;if(A){const T=A.getBoundingClientRect();T.left<0&&(f.value.left="0px"),T.top<0&&(f.value.top="0px"),T.right>window.innerWidth&&(f.value.left=window.innerWidth-T.width+"px"),T.bottom>window.innerHeight&&(f.value.top=window.innerHeight-T.height+"px")}}function L(A=!0){y();const T=C.value;if(T){const{left:z,top:W}=T.getBoundingClientRect();A&&(e("update:left",z),e("update:top",W))}}return Te(()=>n.isOpen,A=>{u.value=A}),Te(()=>n.zGroup,A=>{c.group=A}),Te(()=>n.width,A=>{m({width:A}),p(!1)}),Te(()=>n.height,A=>{m({height:A}),p(!1)}),Zt(()=>{g()}),$i(()=>{$n.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),Lt.splice(Lt.indexOf(o),1)}),{isOpen:u,windowEl:C,titlebar:N,content:D,activate:M,styleWindow:f,styleTitlebar:l,styleContent:v,closeButtonClick:function(){u.value=!1,e("closebuttonclick")},fixPosition:y}}});const ic={class:"title"};var xr;$t.render=function(n,e,t,o,r,i){const s=dt("myButton");return q(),Q(Eo,{name:"fade",onAfterLeave:e[2]||(e[2]=c=>n.$emit("close")),onAfterEnter:e[3]||(e[3]=c=>n.$emit("open")),persisted:""},{default:be(()=>[ko(J("div",{class:"window",style:ge(n.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...c)=>n.activate&&n.activate(...c)),onTouchstart:e[1]||(e[1]=(...c)=>n.activate&&n.activate(...c))},[J("div",{class:"titlebar",style:ge(n.styleTitlebar),ref:"titlebar"},[J("div",ic,[n.$slots.title?ie(n.$slots,"title",{key:0}):(q(),fe(Re,{key:1},[Qt(en(n.title),1)],64))]),n.closeButton?(q(),Q(s,{key:0,windowStyle:n.windowStyle,onClick:n.closeButtonClick},{default:be(()=>e[4]||(e[4]=[Qt("\xD7")])),_:1},8,["windowStyle","onClick"])):ne("v-if",!0)],4),J("div",{class:"content",style:ge(n.styleContent),ref:"content"},[ie(n.$slots,"default")],4)],36),[[xo,n.isOpen]])]),_:3})},$t.__file="src/controls/vuewindow/window/index.vue",function(n){n[n.StyleBlack=0]="StyleBlack",n[n.StyleWhite=1]="StyleWhite",n[n.StyleMetal=2]="StyleMetal",n[n.StyleGrayblue=3]="StyleGrayblue"}(xr||(xr={}));const sc={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},ac={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},cc={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},lc={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},uc=$t;var ce;(function(n){n[n.top=0]="top",n[n.bottom=1]="bottom",n[n.centerBack=2]="centerBack",n[n.centerMain=3]="centerMain",n[n.centerFront=4]="centerFront",n[n.left=5]="left",n[n.right=6]="right"})(ce||(ce={}));class Ir{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,t,o,r){this.layoutState=e,this._LayoutID=o,this._mapItemRefs=r,t.forEach(i=>{if(i.layoutID===o&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let t;if(Me(e)?t=e:wt(e)&&(t=this.widgetConfig.find(o=>o.id===e)),t){if(t.afterid){if(this.isWidgetLoaded(t.afterid))return this._loadWidget(t);{let o=function(c){c.layoutID===r._LayoutID&&c.widgetID===i&&(r._loadWidget(s),B.EventBus.off(se.WidgetLoadedEvent,o))};const r=this,i=t.afterid,s=t;return B.EventBus.on(se.WidgetLoadedEvent,o),this.loadWidget(t.afterid)}}return this._loadWidget(t)}}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(t=>{t.preload&&this._loadWidget(t)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component?e.component().then(t=>{if(t.default){const o=Ni(t.default);o.id=e.id,e.layout&&(o.style=e.layout),e.cssClass&&(o.cssClass=e.cssClass),e.layoutID&&(o.layoutID=e.layoutID),e.label&&(o.label=e.label),e.jsURL&&(o.jsURL=e.jsURL),e.cssURL&&(o.cssURL=e.cssURL),this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),Co().then(()=>{B.EventBus.emit(se.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(t=>{B.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e,t),B.EventBus.emit(se.WidgetLoadedErrorEvent,e)}):void 0;this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let t=!1;if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){t=!0;break}}}return t}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const t=this.widgetConfig.find(o=>o.id===e);if(t){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(t.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),B.EventBus.emit(se.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const t=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;e?(t&&(t.style.left="0",t.style.width="100%"),o&&(o.style.width="100%")):(t&&(t.style.left="50%",t.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(e){switch(e){case ce.top:return this.layoutState.topContainer;case ce.bottom:return this.layoutState.bottomContainer;case ce.left:return this.layoutState.leftContainer;case ce.right:return this.layoutState.rightContainer;case ce.centerBack:return this.layoutState.centerBackContainer;case ce.centerMain:return this.layoutState.centerMainContainer;case ce.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,t=!1){const o=this.getLayoutContainer(e);o&&(o.style.visibility=t?"visible":"hidden")}changeWidgetVisible(e,t=!1){const o=this.getWidgetComponent(e);o&&o.changeVisible&&o.changeVisible(t)}isWidgetVisible(e){const t=this.getWidgetComponent(e);return!!t&&(!t.isShow||t.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(t=>t.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(t=>t.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const t=K(new Map);return this.layoutMap.set(e,t),t}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(t=>{e.push(t)}),e}unloadAllWidgets(e){const t=[];this.widgetsLoadedSet.forEach(o=>{e&&e.length>0?e.findIndex(r=>r===o)<0&&t.push(o):t.push(o)}),t.forEach(o=>this.unloadWidget(o))}unloadWidgets(e){e&&e.length>0&&e.forEach(t=>{this.unloadWidget(t)})}static getLayoutManager(e,t){if(t){const o=t.find(r=>r.id===e);if(o&&o.layoutID)return B.LayoutMap.get(o.layoutID)}}}var ot=Ie({name:"SuspenseWithError",setup(){const n=K(null);return Bi(e=>(n.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:n}}});ot.render=function(n,e,t,o,r,i){return n.error?ie(n.$slots,"error",{key:0},()=>[Qt(en(n.error),1)]):(q(),Q(Wi,{key:1},{default:be(()=>[ie(n.$slots,"default")]),fallback:be(()=>[ie(n.$slots,"fallback")]),_:3}))},ot.__file="src/controls/routertransition/SuspenseWithError.vue";var Nn=Ie({name:"RouterTransition",__name:"RouterTransition",setup:n=>(e,t)=>{const o=dt("router-view");return q(),Q(ot,null,{default:be(()=>[ft(o,null,{default:be(({Component:r,route:i})=>[ne(" <transition> "),(q(),Q(Io,null,[i.meta.keepAlive?(q(),Q(_e(r),{key:i.name})):ne("v-if",!0)],1024)),i.meta.keepAlive?ne("v-if",!0):(q(),Q(_e(r),{key:i.name})),ne(" </transition> ")]),_:1})]),_:1})}});Nn.__file="src/controls/routertransition/RouterTransition.vue";var Nt=Ie({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:Nn},setup(n,{attrs:e,slots:t,emit:o}){const r=n.layoutID,i=K(n.enableRouterView);Te(()=>n.enableRouterView,()=>{i.value=n.enableRouterView});const s=So({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),c=new Map,u=new Ir(s,n.widgetConfig,r,c),g=f(ce.top),S=f(ce.centerBack),C=f(ce.centerFront),N=f(ce.left),D=f(ce.right),M=f(ce.bottom);function f(v){return u?.getContainerComponents(v)}const l=je(()=>n.layoutStyle);return Zt(()=>{u&&(r?B.LayoutMap.set(r,u):(B.LayoutManager=u,B.LayoutMap.set("",u)),u.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:u}),B.EventBus.emit(se.LayoutContainerLoaded,{layoutID:r,layoutManager:u}))}),{...Ui(s),topContainerComponents:g,centerbackComponents:S,centerfrontComponents:C,leftContainerComponents:N,rightContainerComponents:D,bottomContainerComponents:M,containerStyle:l,isEnableRouterView:i,setItemRef:(v,m)=>{v&&c.set(m,v)}}}});const hc={ref:"topContainer",class:"topContainer"},dc={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},fc={ref:"centerBackContainer",class:"centerdiv backContainer"},pc={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},gc={ref:"leftContainer",class:"leftContainer"},mc={ref:"rightContainer",class:"rightContainer"},vc={ref:"bottomContainer",class:"bottomContainer"};Nt.render=function(n,e,t,o,r,i){const s=dt("router-transition");return q(),fe("div",{class:"layoutContainer",style:ge(n.containerStyle)},[J("div",hc,[ie(n.$slots,"top"),(q(!0),fe(Re,null,He(n.topContainerComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",null,[ne(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),n.isEnableRouterView?(q(),fe("div",dc,[ie(n.$slots,"main",{},()=>[ft(s)])],512)):ne("v-if",!0),ne(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",fc,[ie(n.$slots,"back"),(q(!0),fe(Re,null,He(n.centerbackComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512),ne(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",pc,[ie(n.$slots,"front"),(q(!0),fe(Re,null,He(n.centerfrontComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",gc,[ie(n.$slots,"left"),(q(!0),fe(Re,null,He(n.leftContainerComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",mc,[ie(n.$slots,"right"),(q(!0),fe(Re,null,He(n.rightContainerComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512)]),J("div",vc,[ie(n.$slots,"bottom"),(q(!0),fe(Re,null,He(n.bottomContainerComponents,([c,u])=>(q(),Q(_e(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Pe(u.cssClass)},null,8,["style","class"]))),128))],512),ne(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),ie(n.$slots,"default")],4)},Nt.__scopeId="data-v-4d081e5c",Nt.__file="src/controls/layoutcontainer/layout.vue";var Tr=Ie({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:n=>(e,t)=>{const o=dt("router-view");return q(),Q(ot,null,{default:be(()=>[ft(o,null,{default:be(({Component:r,route:i})=>[ft(Oi,{appear:"","enter-active-class":e.enterActive,"leave-active-class":e.leaveActive},{default:be(()=>[(q(),Q(Io,null,[i.meta.keepAlive?(q(),Q(_e(r),{key:i.name})):ne("v-if",!0)],1024)),i.meta.keepAlive?ne("v-if",!0):(q(),Q(_e(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Tr.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Ve=new Map,rt=K(new Map);class it{static addWindowPanel(e){Ve.set(e.id,e)}static removeWindowPanel(e){Ve.has(e)&&(Ve.delete(e),rt.value.delete(e))}static minimizeWindowPanel(e){Ve.has(e)&&rt.value.set(e,-1)}static openWindowPanel(e){Ve.has(e)&&rt.value.set(e,1)}}const yc=["src"],wc={key:1,class:"paneltitle"},bc={class:"dragPanelBar"},_c={class:"dragPanelContent"},Sc={class:"drag-pointer-group"};var Bn=Ie({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(n,{expose:e,emit:t}){const o=Lo(),r=n,i=t,s=K(),c=K(),u=je(()=>r.isDark),g=K({x:0,y:0}),S=250,C=100,N=K({width:0,height:0}),D=R=>{s.value&&(s.value.style.left=`${R.x}px`,s.value.style.top=`${R.y}px`)};Te(()=>g.value,R=>{D(R)});const M=R=>{s.value&&(s.value.style.width=`${R.width}px`,s.value.style.height=`${R.height}px`)};Te(()=>N.value,R=>{M(R)});const f={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(f.refs).forEach(([R,H])=>{H.value&&H.value.addEventListener("mousedown",X=>{f.mouseDown(X,R)})})},mouseDown:(R,H)=>{R.button==0&&(R.preventDefault(),f.startingEdges={left:g.value.x,top:g.value.y,right:g.value.x+N.value.width,bottom:g.value.y+N.value.height},f.newEdges={...f.startingEdges},f.clickStart={x:R.clientX,y:R.clientY},f.eventListenerController=new AbortController,document.addEventListener("mousemove",X=>{f.mouseMove(X,H)},{signal:f.eventListenerController.signal}),document.addEventListener("mouseup",X=>{f.mouseUp(X,H)},{signal:f.eventListenerController.signal}))},mouseMove:(R,H)=>{if(f.startingEdges!=null&&f.newEdges!=null&&f.clickStart!=null&&f.refs[H].value){if(R.preventDefault(),console.log("mouseMove",H),H.toLowerCase().includes("north")){f.newEdges.top=Math.max(f.startingEdges.top+R.clientY-f.clickStart.y,0);const X=f.newEdges.bottom-f.newEdges.top-C;X<0&&(f.newEdges.top+=X)}else H.toLowerCase().includes("south")&&(f.newEdges.bottom=Math.min(f.startingEdges.bottom+R.clientY-f.clickStart.y,document.body.clientHeight));if(H.toLowerCase().includes("west")){f.newEdges.left=Math.max(f.startingEdges.left+R.clientX-f.clickStart.x,0);const X=f.newEdges.right-f.newEdges.left-S;X<0&&(f.newEdges.left+=X)}else H.toLowerCase().includes("east")&&(f.newEdges.right=Math.min(f.startingEdges.right+R.clientX-f.clickStart.x,document.body.clientWidth));f.update()}},update:()=>{f.newEdges==null||f.startingEdges==null||(g.value={x:Math.max(f.newEdges.left,0),y:Math.max(f.newEdges.top,0)},N.value={width:Math.min(Math.max(f.newEdges.right-f.newEdges.left,S),document.body.clientWidth),height:Math.min(Math.max(f.newEdges.bottom-f.newEdges.top,C),document.body.clientHeight)})},mouseUp:(R,H)=>{R.button!=0||f.startingEdges==null||(console.log("mouseUp",H),R.preventDefault(),f.startingEdges=null,f.newEdges=null,f.clickStart=null,f.eventListenerController&&(f.eventListenerController.abort(),f.eventListenerController=null))},refs:{northWest:K(null),north:K(null),northEast:K(null),west:K(null),east:K(null),southWest:K(null),south:K(null),southEast:K(null)}},l={startingMouse:null,startingPosition:null,mouseDown:R=>{R.button==0&&(R.preventDefault(),console.log("mouseDown"),l.startingMouse={x:R.clientX,y:R.clientY},l.startingPosition=g.value,document.addEventListener("mousemove",l.mouseMove),document.addEventListener("mouseup",l.mouseUp))},mouseMove:R=>{!l.startingMouse||!l.startingPosition||(R.preventDefault(),g.value={x:Math.min(Math.max(l.startingPosition.x+R.clientX-l.startingMouse.x,0),document.body.clientWidth-N.value.width),y:Math.min(Math.max(l.startingPosition.y+R.clientY-l.startingMouse.y,0),document.body.clientHeight-N.value.height)})},mouseUp:R=>{R.button!=0||!l.startingMouse||!l.startingPosition||(R.preventDefault(),l.startingMouse=null,l.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",l.mouseMove),document.removeEventListener("mouseup",l.mouseUp))}};function v(R){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:R??r.tag}}const m=je(()=>rt.value.get(o)!==-1),p=K(!1),y=K(!0);function L(){i("minimize",v()),it.minimizeWindowPanel(o)}function A(){p.value=!p.value}function T(){i("close",v(!1)),it.removeWindowPanel(o),y.value=!1}const z=je(()=>p.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),W={id:o,isShow:m,close:T,open:function(){i("open",v(!0)),y.value=!0},showHidePanel:L};function O(R){if(dn(R))return R;{const H=Number(R);if(H==H)return H;if(R.endsWith("px")){const X=R.substring(0,R.length-2);return Number(X)}if(R.endsWith("%")){const X=R.substring(0,R.length-1);return Number(X)/100*document.body.clientWidth}return 300}}return e(W),Zt(()=>{(function(){let R=90;if(r.hasMin||(R-=30),r.hasMax||(R-=30),r.hasClose||(R-=30),he.setCssVar("--right-bar-width",R+"px",c.value),!c.value)return;const H=dn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;c.value.style.height=H,c.value.style.lineHeight=H})(),function(){const R=v(W);it.addWindowPanel(R),i("loaded",R)}(),g.value.x=O(r.left),g.value.y=O(r.top),D(g.value),N.value={width:O(r.nWidth),height:O(r.nHeight)},M(N.value),f.mount()}),ji(()=>{it.removeWindowPanel(o)}),(R,H)=>(q(),Q(Eo,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:be(()=>[y.value?ko((q(),fe("div",{key:0,ref_key:"dragPanelRef",ref:s,class:Pe(["dragWindowPanel",{maxPanel:p.value,dragWindowPanel_dark:u.value}])},[J("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:c,onMousedown:H[0]||(H[0]=(...X)=>l.mouseDown&&l.mouseDown(...X))},[ie(R.$slots,"title",{},()=>[r.icon?(q(),fe("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,yc)):ne("v-if",!0),r.title?(q(),fe("span",wc,en(r.title),1)):ne("v-if",!0)]),J("div",bc,[n.hasMin?(q(),Q(tn(sn),{key:0,icon:"ant-design:minus-outlined",onClick:L})):ne("v-if",!0),n.hasMax?(q(),Q(tn(sn),{key:1,icon:z.value,onClick:A},null,8,["icon"])):ne("v-if",!0),n.hasClose?(q(),Q(tn(sn),{key:2,icon:"ant-design:close-outlined",onClick:T})):ne("v-if",!0)])],544),J("div",_c,[ie(R.$slots,"default")]),J("div",Sc,[J("div",{class:"cursor-nw-resize",ref:f.refs.northWest},null,512),J("div",{class:"cursor-n-resize",ref:f.refs.north},null,512),J("div",{class:"cursor-ne-resize",ref:f.refs.northEast},null,512),J("div",{class:"cursor-w-resize",ref:f.refs.west},null,512),H[1]||(H[1]=J("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),J("div",{class:"cursor-e-resize",ref:f.refs.east},null,512),J("div",{class:"cursor-sw-resize",ref:f.refs.southWest},null,512),J("div",{class:"cursor-s-resize",ref:f.refs.south},null,512),J("div",{class:"cursor-se-resize",ref:f.refs.southEast},null,512)])],2)),[[xo,m.value]]):ne("v-if",!0)]),_:3}))}});function Cc(n){const e=new on(new ke);return e.serialize(n),e.stream.toString()}function Ec(n){return n==null||n===""?n:new rn(new ke(n)).deserialize()}Bn.__scopeId="data-v-39ea9741",Bn.__file="src/controls/xwindow/XWindow.vue";class Qn{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new Qn;textEncoder=new TextEncoder;textDecoder=new TextDecoder;constructor(){}encodeResponse(e,t={}){var o=new ke,r=new on(o,this.simple,this.utc),i=t;this.simple;var s=0;for(var c in i)s++;s>0&&(o.writeByte(72),r.serialize(i),r.reset()),e instanceof Error?(o.writeByte(69),r.serialize(this.debug&&e.stack?e.stack:e.message)):(o.writeByte(82),r.serialize(e)),o.writeByte(122);const u=o.takeBytes();return this.textDecoder.decode(u)}decodeRequest(e,t={}){const o=this.textEncoder.encode(e);if(o.length===0)return["~",[]];var r=new ke(o),i=new rn(r,!1);i.longType=this.longType,i.dictType=this.dictType;var s=r.readByte();if(console.log("tag",s),s===72){var c=i.deserialize(this.nullType);for(var u in c)t[u]=c[u];i.reset(),s=r.readByte()}switch(s){case 67:return[i.deserialize(String),this.decodeArguments(i)];case 122:return["~",[]];default:throw new Error(`Invalid request:\r
|
|
13
|
-
`+
|
|
14
|
-
`+
|
|
8
|
+
*/var Zi,qc=(Ji||(Ji=1,Qi.exports=function t(e,n,r){function o(a,c){if(!n[a]){if(!e[a]){if(!c&&Gr)return Gr(a);if(i)return i(a,!0);var u=new Error("Cannot find module '"+a+"'");throw u.code="MODULE_NOT_FOUND",u}var m=n[a]={exports:{}};e[a][0].call(m.exports,function(b){var E=e[a][1][b];return o(E||b)},m,m.exports,t,e,n,r)}return n[a].exports}for(var i=Gr,s=0;s<r.length;s++)o(r[s]);return o}({1:[function(t,e,n){(function(r){var o,i,s=r.MutationObserver||r.WebKitMutationObserver;if(s){var a=0,c=new s(E),u=r.document.createTextNode("");c.observe(u,{characterData:!0}),o=function(){u.data=a=++a%2}}else if(r.setImmediate||r.MessageChannel===void 0)o="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var P=r.document.createElement("script");P.onreadystatechange=function(){E(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},r.document.documentElement.appendChild(P)}:function(){setTimeout(E,0)};else{var m=new r.MessageChannel;m.port1.onmessage=E,o=function(){m.port2.postMessage(0)}}var b=[];function E(){var P,d;i=!0;for(var h=b.length;h;){for(d=b,b=[],P=-1;++P<h;)d[P]();h=b.length}i=!1}function R(P){b.push(P)!==1||i||o()}e.exports=R}).call(this,wt!==void 0?wt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var r=t(1);function o(){}var i={},s=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function u(f){if(typeof f!="function")throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,f!==o&&R(this,f)}function m(f,y,M){this.promise=f,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}function b(f,y,M){r(function(){var D;try{D=y(M)}catch(z){return i.reject(f,z)}D===f?i.reject(f,new TypeError("Cannot resolve promise with itself")):i.resolve(f,D)})}function E(f){var y=f&&f.then;if(f&&(typeof f=="object"||typeof f=="function")&&typeof y=="function")return function(){y.apply(f,arguments)}}function R(f,y){var M=!1;function D(B){M||(M=!0,i.reject(f,B))}function z(B){M||(M=!0,i.resolve(f,B))}function k(){y(z,D)}var x=P(k);x.status==="error"&&D(x.value)}function P(f,y){var M={};try{M.value=f(y),M.status="success"}catch(D){M.status="error",M.value=D}return M}function d(f){return f instanceof this?f:i.resolve(new this(o),f)}function h(f){var y=new this(o);return i.reject(y,f)}function w(f){var y=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=f.length,D=!1;if(!M)return this.resolve([]);for(var z=new Array(M),k=0,x=-1,B=new this(o);++x<M;)A(f[x],x);return B;function A(U,H){function j(X){z[H]=X,++k!==M||D||(D=!0,i.resolve(B,z))}y.resolve(U).then(j,function(X){D||(D=!0,i.reject(B,X))})}}function p(f){var y=this;if(Object.prototype.toString.call(f)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=f.length,D=!1;if(!M)return this.resolve([]);for(var z=-1,k=new this(o);++z<M;)x(f[z]);return k;function x(B){y.resolve(B).then(function(A){D||(D=!0,i.resolve(k,A))},function(A){D||(D=!0,i.reject(k,A))})}}e.exports=u,u.prototype.catch=function(f){return this.then(null,f)},u.prototype.then=function(f,y){if(typeof f!="function"&&this.state===a||typeof y!="function"&&this.state===s)return this;var M=new this.constructor(o);return this.state!==c?b(M,this.state===a?f:y,this.outcome):this.queue.push(new m(M,f,y)),M},m.prototype.callFulfilled=function(f){i.resolve(this.promise,f)},m.prototype.otherCallFulfilled=function(f){b(this.promise,this.onFulfilled,f)},m.prototype.callRejected=function(f){i.reject(this.promise,f)},m.prototype.otherCallRejected=function(f){b(this.promise,this.onRejected,f)},i.resolve=function(f,y){var M=P(E,y);if(M.status==="error")return i.reject(f,M.value);var D=M.value;if(D)R(f,D);else{f.state=a,f.outcome=y;for(var z=-1,k=f.queue.length;++z<k;)f.queue[z].callFulfilled(y)}return f},i.reject=function(f,y){f.state=s,f.outcome=y;for(var M=-1,D=f.queue.length;++M<D;)f.queue[M].callRejected(y);return f},u.resolve=d,u.reject=h,u.all=w,u.race=p},{1:1}],3:[function(t,e,n){(function(r){typeof r.Promise!="function"&&(r.Promise=t(2))}).call(this,wt!==void 0?wt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){var r=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function o(l,g){if(!(l instanceof g))throw new TypeError("Cannot call a class as a function")}function i(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var s=i();function a(){try{if(!s||!s.open)return!1;var l=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),g=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||g)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function c(l,g){l=l||[],g=g||{};try{return new Blob(l,g)}catch(_){if(_.name!=="TypeError")throw _;for(var v=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),S=0;S<l.length;S+=1)v.append(l[S]);return v.getBlob(g.type)}}typeof Promise>"u"&&t(3);var u=Promise;function m(l,g){g&&l.then(function(v){g(null,v)},function(v){g(v)})}function b(l,g,v){typeof g=="function"&&l.then(g),typeof v=="function"&&l.catch(v)}function E(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",d=void 0,h={},w=Object.prototype.toString,p="readonly",f="readwrite";function y(l){for(var g=l.length,v=new ArrayBuffer(g),S=new Uint8Array(v),_=0;_<g;_++)S[_]=l.charCodeAt(_);return v}function M(l){return new u(function(g){var v=l.transaction(P,f),S=c([""]);v.objectStore(P).put(S,"key"),v.onabort=function(_){_.preventDefault(),_.stopPropagation(),g(!1)},v.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);g(C||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function D(l){return typeof d=="boolean"?u.resolve(d):M(l).then(function(g){return d=g})}function z(l){var g=h[l.name],v={};v.promise=new u(function(S,_){v.resolve=S,v.reject=_}),g.deferredOperations.push(v),g.dbReady?g.dbReady=g.dbReady.then(function(){return v.promise}):g.dbReady=v.promise}function k(l){var g=h[l.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function x(l,g){var v=h[l.name].deferredOperations.pop();if(v)return v.reject(g),v.promise}function B(l,g){return new u(function(v,S){if(h[l.name]=h[l.name]||He(),l.db){if(!g)return v(l.db);z(l),l.db.close()}var _=[l.name];g&&_.push(l.version);var C=s.open.apply(s,_);g&&(C.onupgradeneeded=function(I){var L=C.result;try{L.createObjectStore(l.storeName),I.oldVersion<=1&&L.createObjectStore(P)}catch($){if($.name!=="ConstraintError")throw $;console.warn('The database "'+l.name+'" has been upgraded from version '+I.oldVersion+" to version "+I.newVersion+', but the storage "'+l.storeName+'" already exists.')}}),C.onerror=function(I){I.preventDefault(),S(C.error)},C.onsuccess=function(){var I=C.result;I.onversionchange=function(L){L.target.close()},v(I),k(l)}})}function A(l){return B(l,!1)}function U(l){return B(l,!0)}function H(l,g){if(!l.db)return!0;var v=!l.db.objectStoreNames.contains(l.storeName),S=l.version<l.db.version,_=l.version>l.db.version;if(S&&(l.version!==g&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),_||v){if(v){var C=l.db.version+1;C>l.version&&(l.version=C)}return!0}return!1}function j(l){return new u(function(g,v){var S=new FileReader;S.onerror=v,S.onloadend=function(_){var C=btoa(_.target.result||"");g({__local_forage_encoded_blob:!0,data:C,type:l.type})},S.readAsBinaryString(l)})}function X(l){return c([y(atob(l.data))],{type:l.type})}function K(l){return l&&l.__local_forage_encoded_blob}function Y(l){var g=this,v=g._initReady().then(function(){var S=h[g._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return b(v,l,l),v}function le(l){z(l);for(var g=h[l.name],v=g.forages,S=0;S<v.length;S++){var _=v[S];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return l.db=null,A(l).then(function(C){return l.db=C,H(l)?U(l):C}).then(function(C){l.db=g.db=C;for(var I=0;I<v.length;I++)v[I]._dbInfo.db=C}).catch(function(C){throw x(l,C),C})}function Q(l,g,v,S){S===void 0&&(S=1);try{var _=l.db.transaction(l.storeName,g);v(null,_)}catch(C){if(S>0&&(!l.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return u.resolve().then(function(){if(!l.db||C.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),U(l)}).then(function(){return le(l).then(function(){Q(l,g,v,S-1)})}).catch(v);v(C)}}function He(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function xe(l){var g=this,v={db:null};if(l)for(var S in l)v[S]=l[S];var _=h[v.name];_||(_=He(),h[v.name]=_),_.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=Y);var C=[];function I(){return u.resolve()}for(var L=0;L<_.forages.length;L++){var $=_.forages[L];$!==g&&C.push($._initReady().catch(I))}var N=_.forages.slice(0);return u.all(C).then(function(){return v.db=_.db,A(v)}).then(function(W){return v.db=W,H(v,g._defaultConfig.version)?U(v):W}).then(function(W){v.db=_.db=W,g._dbInfo=v;for(var O=0;O<N.length;O++){var G=N[O];G!==g&&(G._dbInfo.db=v.db,G._dbInfo.version=v.version)}})}function Le(l,g){var v=this;l=E(l);var S=new u(function(_,C){v.ready().then(function(){Q(v._dbInfo,p,function(I,L){if(I)return C(I);try{var $=L.objectStore(v._dbInfo.storeName).get(l);$.onsuccess=function(){var N=$.result;N===void 0&&(N=null),K(N)&&(N=X(N)),_(N)},$.onerror=function(){C($.error)}}catch(N){C(N)}})}).catch(C)});return m(S,g),S}function _e(l,g){var v=this,S=new u(function(_,C){v.ready().then(function(){Q(v._dbInfo,p,function(I,L){if(I)return C(I);try{var $=L.objectStore(v._dbInfo.storeName).openCursor(),N=1;$.onsuccess=function(){var W=$.result;if(W){var O=W.value;K(O)&&(O=X(O));var G=l(O,W.key,N++);G!==void 0?_(G):W.continue()}else _()},$.onerror=function(){C($.error)}}catch(W){C(W)}})}).catch(C)});return m(S,g),S}function Ie(l,g,v){var S=this;l=E(l);var _=new u(function(C,I){var L;S.ready().then(function(){return L=S._dbInfo,w.call(g)==="[object Blob]"?D(L.db).then(function($){return $?g:j(g)}):g}).then(function($){Q(S._dbInfo,f,function(N,W){if(N)return I(N);try{var O=W.objectStore(S._dbInfo.storeName);$===null&&($=void 0);var G=O.put($,l);W.oncomplete=function(){$===void 0&&($=null),C($)},W.onabort=W.onerror=function(){var J=G.error?G.error:G.transaction.error;I(J)}}catch(J){I(J)}})}).catch(I)});return m(_,v),_}function oe(l,g){var v=this;l=E(l);var S=new u(function(_,C){v.ready().then(function(){Q(v._dbInfo,f,function(I,L){if(I)return C(I);try{var $=L.objectStore(v._dbInfo.storeName).delete(l);L.oncomplete=function(){_()},L.onerror=function(){C($.error)},L.onabort=function(){var N=$.error?$.error:$.transaction.error;C(N)}}catch(N){C(N)}})}).catch(C)});return m(S,g),S}function Pe(l){var g=this,v=new u(function(S,_){g.ready().then(function(){Q(g._dbInfo,f,function(C,I){if(C)return _(C);try{var L=I.objectStore(g._dbInfo.storeName).clear();I.oncomplete=function(){S()},I.onabort=I.onerror=function(){var $=L.error?L.error:L.transaction.error;_($)}}catch($){_($)}})}).catch(_)});return m(v,l),v}function je(l){var g=this,v=new u(function(S,_){g.ready().then(function(){Q(g._dbInfo,p,function(C,I){if(C)return _(C);try{var L=I.objectStore(g._dbInfo.storeName).count();L.onsuccess=function(){S(L.result)},L.onerror=function(){_(L.error)}}catch($){_($)}})}).catch(_)});return m(v,l),v}function qe(l,g){var v=this,S=new u(function(_,C){l<0?_(null):v.ready().then(function(){Q(v._dbInfo,p,function(I,L){if(I)return C(I);try{var $=L.objectStore(v._dbInfo.storeName),N=!1,W=$.openKeyCursor();W.onsuccess=function(){var O=W.result;O?l===0||N?_(O.key):(N=!0,O.advance(l)):_(null)},W.onerror=function(){C(W.error)}}catch(O){C(O)}})}).catch(C)});return m(S,g),S}function Je(l){var g=this,v=new u(function(S,_){g.ready().then(function(){Q(g._dbInfo,p,function(C,I){if(C)return _(C);try{var L=I.objectStore(g._dbInfo.storeName).openKeyCursor(),$=[];L.onsuccess=function(){var N=L.result;N?($.push(N.key),N.continue()):S($)},L.onerror=function(){_(L.error)}}catch(N){_(N)}})}).catch(_)});return m(v,l),v}function gt(l,g){g=R.apply(this,arguments);var v=this.config();(l=typeof l!="function"&&l||{}).name||(l.name=l.name||v.name,l.storeName=l.storeName||v.storeName);var S,_=this;if(l.name){var C=l.name===v.name&&_._dbInfo.db?u.resolve(_._dbInfo.db):A(l).then(function(I){var L=h[l.name],$=L.forages;L.db=I;for(var N=0;N<$.length;N++)$[N]._dbInfo.db=I;return I});S=l.storeName?C.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var L=I.version+1;z(l);var $=h[l.name],N=$.forages;I.close();for(var W=0;W<N.length;W++){var O=N[W];O._dbInfo.db=null,O._dbInfo.version=L}var G=new u(function(J,Z){var ge=s.open(l.name,L);ge.onerror=function(Fe){ge.result.close(),Z(Fe)},ge.onupgradeneeded=function(){ge.result.deleteObjectStore(l.storeName)},ge.onsuccess=function(){var Fe=ge.result;Fe.close(),J(Fe)}});return G.then(function(J){$.db=J;for(var Z=0;Z<N.length;Z++){var ge=N[Z];ge._dbInfo.db=J,k(ge._dbInfo)}}).catch(function(J){throw(x(l,J)||u.resolve()).catch(function(){}),J})}}):C.then(function(I){z(l);var L=h[l.name],$=L.forages;I.close();for(var N=0;N<$.length;N++)$[N]._dbInfo.db=null;var W=new u(function(O,G){var J=s.deleteDatabase(l.name);J.onerror=function(){var Z=J.result;Z&&Z.close(),G(J.error)},J.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},J.onsuccess=function(){var Z=J.result;Z&&Z.close(),O(Z)}});return W.then(function(O){L.db=O;for(var G=0;G<$.length;G++)k($[G]._dbInfo)}).catch(function(O){throw(x(l,O)||u.resolve()).catch(function(){}),O})})}else S=u.reject("Invalid arguments");return m(S,g),S}var Qe={_driver:"asyncStorage",_initStorage:xe,_support:a(),iterate:_e,getItem:Le,setItem:Ie,removeItem:oe,clear:Pe,length:je,key:qe,keys:Je,dropInstance:gt};function Xe(){return typeof openDatabase=="function"}var Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ms="~~local_forage_type~",vo=/^~~local_forage_type~([^~]+)~/,Jt="__lfsc__:",qn=Jt.length,Xn="arbf",Gn="blob",yo="si08",wo="ui08",bo="uic8",_o="si16",So="si32",Co="ur16",Eo="ui32",ko="fl32",xo="fl64",Io=qn+Xn.length,To=Object.prototype.toString;function Ro(l){var g,v,S,_,C,I=.75*l.length,L=l.length,$=0;l[l.length-1]==="="&&(I--,l[l.length-2]==="="&&I--);var N=new ArrayBuffer(I),W=new Uint8Array(N);for(g=0;g<L;g+=4)v=Se.indexOf(l[g]),S=Se.indexOf(l[g+1]),_=Se.indexOf(l[g+2]),C=Se.indexOf(l[g+3]),W[$++]=v<<2|S>>4,W[$++]=(15&S)<<4|_>>2,W[$++]=(3&_)<<6|63&C;return N}function Vn(l){var g,v=new Uint8Array(l),S="";for(g=0;g<v.length;g+=3)S+=Se[v[g]>>2],S+=Se[(3&v[g])<<4|v[g+1]>>4],S+=Se[(15&v[g+1])<<2|v[g+2]>>6],S+=Se[63&v[g+2]];return v.length%3==2?S=S.substring(0,S.length-1)+"=":v.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function As(l,g){var v="";if(l&&(v=To.call(l)),l&&(v==="[object ArrayBuffer]"||l.buffer&&To.call(l.buffer)==="[object ArrayBuffer]")){var S,_=Jt;l instanceof ArrayBuffer?(S=l,_+=Xn):(S=l.buffer,v==="[object Int8Array]"?_+=yo:v==="[object Uint8Array]"?_+=wo:v==="[object Uint8ClampedArray]"?_+=bo:v==="[object Int16Array]"?_+=_o:v==="[object Uint16Array]"?_+=Co:v==="[object Int32Array]"?_+=So:v==="[object Uint32Array]"?_+=Eo:v==="[object Float32Array]"?_+=ko:v==="[object Float64Array]"?_+=xo:g(new Error("Failed to get type for BinaryArray"))),g(_+Vn(S))}else if(v==="[object Blob]"){var C=new FileReader;C.onload=function(){var I=Ms+l.type+"~"+Vn(this.result);g(Jt+Gn+I)},C.readAsArrayBuffer(l)}else try{g(JSON.stringify(l))}catch(I){console.error("Couldn't convert value into a JSON string: ",l),g(null,I)}}function Ds(l){if(l.substring(0,qn)!==Jt)return JSON.parse(l);var g,v=l.substring(Io),S=l.substring(qn,Io);if(S===Gn&&vo.test(v)){var _=v.match(vo);g=_[1],v=v.substring(_[0].length)}var C=Ro(v);switch(S){case Xn:return C;case Gn:return c([C],{type:g});case yo:return new Int8Array(C);case wo:return new Uint8Array(C);case bo:return new Uint8ClampedArray(C);case _o:return new Int16Array(C);case Co:return new Uint16Array(C);case So:return new Int32Array(C);case Eo:return new Uint32Array(C);case ko:return new Float32Array(C);case xo:return new Float64Array(C);default:throw new Error("Unkown type: "+S)}}var Kn={serialize:As,deserialize:Ds,stringToBuffer:Ro,bufferToString:Vn};function Po(l,g,v,S){l.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,S)}function Ls(l){var g=this,v={db:null};if(l)for(var S in l)v[S]=typeof l[S]!="string"?l[S].toString():l[S];var _=new u(function(C,I){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(L){return I(L)}v.db.transaction(function(L){Po(L,v,function(){g._dbInfo=v,C()},function($,N){I(N)})},I)});return v.serializer=Kn,_}function Ge(l,g,v,S,_,C){l.executeSql(v,S,_,function(I,L){L.code===L.SYNTAX_ERR?I.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function($,N){N.rows.length?C($,L):Po($,g,function(){$.executeSql(v,S,_,C)},C)},C):C(I,L)},C)}function $s(l,g){var v=this;l=E(l);var S=new u(function(_,C){v.ready().then(function(){var I=v._dbInfo;I.db.transaction(function(L){Ge(L,I,"SELECT * FROM "+I.storeName+" WHERE key = ? LIMIT 1",[l],function($,N){var W=N.rows.length?N.rows.item(0).value:null;W&&(W=I.serializer.deserialize(W)),_(W)},function($,N){C(N)})})}).catch(C)});return m(S,g),S}function Bs(l,g){var v=this,S=new u(function(_,C){v.ready().then(function(){var I=v._dbInfo;I.db.transaction(function(L){Ge(L,I,"SELECT * FROM "+I.storeName,[],function($,N){for(var W=N.rows,O=W.length,G=0;G<O;G++){var J=W.item(G),Z=J.value;if(Z&&(Z=I.serializer.deserialize(Z)),(Z=l(Z,J.key,G+1))!==void 0)return void _(Z)}_()},function($,N){C(N)})})}).catch(C)});return m(S,g),S}function zo(l,g,v,S){var _=this;l=E(l);var C=new u(function(I,L){_.ready().then(function(){g===void 0&&(g=null);var $=g,N=_._dbInfo;N.serializer.serialize(g,function(W,O){O?L(O):N.db.transaction(function(G){Ge(G,N,"INSERT OR REPLACE INTO "+N.storeName+" (key, value) VALUES (?, ?)",[l,W],function(){I($)},function(J,Z){L(Z)})},function(G){if(G.code===G.QUOTA_ERR){if(S>0)return void I(zo.apply(_,[l,$,v,S-1]));L(G)}})})}).catch(L)});return m(C,v),C}function Ns(l,g,v){return zo.apply(this,[l,g,v,1])}function Ws(l,g){var v=this;l=E(l);var S=new u(function(_,C){v.ready().then(function(){var I=v._dbInfo;I.db.transaction(function(L){Ge(L,I,"DELETE FROM "+I.storeName+" WHERE key = ?",[l],function(){_()},function($,N){C(N)})})}).catch(C)});return m(S,g),S}function Us(l){var g=this,v=new u(function(S,_){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(I){Ge(I,C,"DELETE FROM "+C.storeName,[],function(){S()},function(L,$){_($)})})}).catch(_)});return m(v,l),v}function Fs(l){var g=this,v=new u(function(S,_){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(I){Ge(I,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(L,$){var N=$.rows.item(0).c;S(N)},function(L,$){_($)})})}).catch(_)});return m(v,l),v}function Os(l,g){var v=this,S=new u(function(_,C){v.ready().then(function(){var I=v._dbInfo;I.db.transaction(function(L){Ge(L,I,"SELECT key FROM "+I.storeName+" WHERE id = ? LIMIT 1",[l+1],function($,N){var W=N.rows.length?N.rows.item(0).key:null;_(W)},function($,N){C(N)})})}).catch(C)});return m(S,g),S}function Hs(l){var g=this,v=new u(function(S,_){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(I){Ge(I,C,"SELECT key FROM "+C.storeName,[],function(L,$){for(var N=[],W=0;W<$.rows.length;W++)N.push($.rows.item(W).key);S(N)},function(L,$){_($)})})}).catch(_)});return m(v,l),v}function js(l){return new u(function(g,v){l.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,C){for(var I=[],L=0;L<C.rows.length;L++)I.push(C.rows.item(L).name);g({db:l,storeNames:I})},function(_,C){v(C)})},function(S){v(S)})})}function qs(l,g){g=R.apply(this,arguments);var v=this.config();(l=typeof l!="function"&&l||{}).name||(l.name=l.name||v.name,l.storeName=l.storeName||v.storeName);var S,_=this;return S=l.name?new u(function(C){var I;I=l.name===v.name?_._dbInfo.db:openDatabase(l.name,"","",0),l.storeName?C({db:I,storeNames:[l.storeName]}):C(js(I))}).then(function(C){return new u(function(I,L){C.db.transaction(function($){function N(J){return new u(function(Z,ge){$.executeSql("DROP TABLE IF EXISTS "+J,[],function(){Z()},function(Fe,Qn){ge(Qn)})})}for(var W=[],O=0,G=C.storeNames.length;O<G;O++)W.push(N(C.storeNames[O]));u.all(W).then(function(){I()}).catch(function(J){L(J)})},function($){L($)})})}):u.reject("Invalid arguments"),m(S,g),S}var Xs={_driver:"webSQLStorage",_initStorage:Ls,_support:Xe(),iterate:Bs,getItem:$s,setItem:Ns,removeItem:Ws,clear:Us,length:Fs,key:Os,keys:Hs,dropInstance:qs};function Gs(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Mo(l,g){var v=l.name+"/";return l.storeName!==g.storeName&&(v+=l.storeName+"/"),v}function Vs(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch{return!0}}function Ks(){return!Vs()||localStorage.length>0}function Ys(l){var g=this,v={};if(l)for(var S in l)v[S]=l[S];return v.keyPrefix=Mo(l,g._defaultConfig),Ks()?(g._dbInfo=v,v.serializer=Kn,u.resolve()):u.reject()}function Js(l){var g=this,v=g.ready().then(function(){for(var S=g._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var C=localStorage.key(_);C.indexOf(S)===0&&localStorage.removeItem(C)}});return m(v,l),v}function Qs(l,g){var v=this;l=E(l);var S=v.ready().then(function(){var _=v._dbInfo,C=localStorage.getItem(_.keyPrefix+l);return C&&(C=_.serializer.deserialize(C)),C});return m(S,g),S}function Zs(l,g){var v=this,S=v.ready().then(function(){for(var _=v._dbInfo,C=_.keyPrefix,I=C.length,L=localStorage.length,$=1,N=0;N<L;N++){var W=localStorage.key(N);if(W.indexOf(C)===0){var O=localStorage.getItem(W);if(O&&(O=_.serializer.deserialize(O)),(O=l(O,W.substring(I),$++))!==void 0)return O}}});return m(S,g),S}function ea(l,g){var v=this,S=v.ready().then(function(){var _,C=v._dbInfo;try{_=localStorage.key(l)}catch{_=null}return _&&(_=_.substring(C.keyPrefix.length)),_});return m(S,g),S}function ta(l){var g=this,v=g.ready().then(function(){for(var S=g._dbInfo,_=localStorage.length,C=[],I=0;I<_;I++){var L=localStorage.key(I);L.indexOf(S.keyPrefix)===0&&C.push(L.substring(S.keyPrefix.length))}return C});return m(v,l),v}function na(l){var g=this.keys().then(function(v){return v.length});return m(g,l),g}function ra(l,g){var v=this;l=E(l);var S=v.ready().then(function(){var _=v._dbInfo;localStorage.removeItem(_.keyPrefix+l)});return m(S,g),S}function oa(l,g,v){var S=this;l=E(l);var _=S.ready().then(function(){g===void 0&&(g=null);var C=g;return new u(function(I,L){var $=S._dbInfo;$.serializer.serialize(g,function(N,W){if(W)L(W);else try{localStorage.setItem($.keyPrefix+l,N),I(C)}catch(O){O.name!=="QuotaExceededError"&&O.name!=="NS_ERROR_DOM_QUOTA_REACHED"||L(O),L(O)}})})});return m(_,v),_}function ia(l,g){if(g=R.apply(this,arguments),!(l=typeof l!="function"&&l||{}).name){var v=this.config();l.name=l.name||v.name,l.storeName=l.storeName||v.storeName}var S,_=this;return S=l.name?new u(function(C){l.storeName?C(Mo(l,_._defaultConfig)):C(l.name+"/")}).then(function(C){for(var I=localStorage.length-1;I>=0;I--){var L=localStorage.key(I);L.indexOf(C)===0&&localStorage.removeItem(L)}}):u.reject("Invalid arguments"),m(S,g),S}var sa={_driver:"localStorageWrapper",_initStorage:Ys,_support:Gs(),iterate:Zs,getItem:Qs,setItem:oa,removeItem:ra,clear:Js,length:na,key:ea,keys:ta,dropInstance:ia},aa=function(l,g){return l===g||typeof l=="number"&&typeof g=="number"&&isNaN(l)&&isNaN(g)},ca=function(l,g){for(var v=l.length,S=0;S<v;){if(aa(l[S],g))return!0;S++}return!1},Ao=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Mt={},Do={},mt={INDEXEDDB:Qe,WEBSQL:Xs,LOCALSTORAGE:sa},la=[mt.INDEXEDDB._driver,mt.WEBSQL._driver,mt.LOCALSTORAGE._driver],Qt=["dropInstance"],Yn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Qt),ua={description:"",driver:la.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ha(l,g){l[g]=function(){var v=arguments;return l.ready().then(function(){return l[g].apply(l,v)})}}function Jn(){for(var l=1;l<arguments.length;l++){var g=arguments[l];if(g)for(var v in g)g.hasOwnProperty(v)&&(Ao(g[v])?arguments[0][v]=g[v].slice():arguments[0][v]=g[v])}return arguments[0]}var da=function(){function l(g){for(var v in o(this,l),mt)if(mt.hasOwnProperty(v)){var S=mt[v],_=S._driver;this[v]=_,Mt[_]||this.defineDriver(S)}this._defaultConfig=Jn({},ua),this._config=Jn({},this._defaultConfig,g),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(g){if((g===void 0?"undefined":r(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var v in g){if(v==="storeName"&&(g[v]=g[v].replace(/\W/g,"_")),v==="version"&&typeof g[v]!="number")return new Error("Database version must be a number.");this._config[v]=g[v]}return!("driver"in g)||!g.driver||this.setDriver(this._config.driver)}return typeof g=="string"?this._config[g]:this._config},l.prototype.defineDriver=function(g,v,S){var _=new u(function(C,I){try{var L=g._driver,$=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void I($);for(var N=Yn.concat("_initStorage"),W=0,O=N.length;W<O;W++){var G=N[W];if((!ca(Qt,G)||g[G])&&typeof g[G]!="function")return void I($)}var J=function(){for(var ge=function(pa){return function(){var ga=new Error("Method "+pa+" is not implemented by the current driver"),Lo=u.reject(ga);return m(Lo,arguments[arguments.length-1]),Lo}},Fe=0,Qn=Qt.length;Fe<Qn;Fe++){var Zn=Qt[Fe];g[Zn]||(g[Zn]=ge(Zn))}};J();var Z=function(ge){Mt[L]&&console.info("Redefining LocalForage driver: "+L),Mt[L]=g,Do[L]=ge,C()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(Z,I):Z(!!g._support):Z(!0)}catch(ge){I(ge)}});return b(_,v,S),_},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(g,v,S){var _=Mt[g]?u.resolve(Mt[g]):u.reject(new Error("Driver not found."));return b(_,v,S),_},l.prototype.getSerializer=function(g){var v=u.resolve(Kn);return b(v,g),v},l.prototype.ready=function(g){var v=this,S=v._driverSet.then(function(){return v._ready===null&&(v._ready=v._initDriver()),v._ready});return b(S,g,g),S},l.prototype.setDriver=function(g,v,S){var _=this;Ao(g)||(g=[g]);var C=this._getSupportedDrivers(g);function I(){_._config.driver=_.driver()}function L(W){return _._extend(W),I(),_._ready=_._initStorage(_._config),_._ready}function $(W){return function(){var O=0;function G(){for(;O<W.length;){var J=W[O];return O++,_._dbInfo=null,_._ready=null,_.getDriver(J).then(L).catch(G)}I();var Z=new Error("No available storage method found.");return _._driverSet=u.reject(Z),_._driverSet}return G()}}var N=this._driverSet!==null?this._driverSet.catch(function(){return u.resolve()}):u.resolve();return this._driverSet=N.then(function(){var W=C[0];return _._dbInfo=null,_._ready=null,_.getDriver(W).then(function(O){_._driver=O._driver,I(),_._wrapLibraryMethodsWithReady(),_._initDriver=$(C)})}).catch(function(){I();var W=new Error("No available storage method found.");return _._driverSet=u.reject(W),_._driverSet}),b(this._driverSet,v,S),this._driverSet},l.prototype.supports=function(g){return!!Do[g]},l.prototype._extend=function(g){Jn(this,g)},l.prototype._getSupportedDrivers=function(g){for(var v=[],S=0,_=g.length;S<_;S++){var C=g[S];this.supports(C)&&v.push(C)}return v},l.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,v=Yn.length;g<v;g++)ha(this,Yn[g])},l.prototype.createInstance=function(g){return new l(g)},l}(),fa=new da;e.exports=fa},{3:3}]},{},[4])(4)),Qi.exports),Rn=sn(qc),es={exports:{}},Xc=(Zi||(Zi=1,function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,r=!1;const o=e.WebStreamsPolyfill||{},i=e.isSecureContext;let s=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",c={createWriteStream:function(m,b,E){let R={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,d=null,h=null,w=null;if(Number.isFinite(b)?([E,b]=[b,E],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),R.size=E,R.writableStrategy=b):b&&b.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),R.size=E,R.writableStrategy=b):R=b||{},!s){n||(n=i?u(c.mitm):function(M){const D="width=200,height=100",z=document.createDocumentFragment(),k={frame:e.open(M,"popup",D),loaded:!1,isIframe:!1,isPopup:!0,remove(){k.frame.close()},addEventListener(...B){z.addEventListener(...B)},dispatchEvent(...B){z.dispatchEvent(...B)},removeEventListener(...B){z.removeEventListener(...B)},postMessage(...B){k.frame.postMessage(...B)}},x=B=>{B.source===k.frame&&(k.loaded=!0,e.removeEventListener("message",x),k.dispatchEvent(new Event("load")))};return e.addEventListener("message",x),k}(c.mitm)),h=new MessageChannel,m=encodeURIComponent(m.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const f={transferringReadable:r,pathname:R.pathname||Math.random().toString().slice(-6)+"/"+m,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+m}};R.size&&(f.headers["Content-Length"]=R.size);const y=[f,"*",[h.port2]];if(r){const M=a==="iframe"?void 0:{transform(z,k){if(!(z instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=z.length,k.enqueue(z),d&&(location.href=d,d=null)},flush(){d&&(location.href=d)}};w=new c.TransformStream(M,R.writableStrategy,R.readableStrategy);const D=w.readable;h.port1.postMessage({readableStream:D},[D])}h.port1.onmessage=M=>{M.data.download?a==="navigate"?(n.remove(),n=null,P?location.href=M.data.download:d=M.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&u(c.mitm)),u(M.data.download)):M.data.abort&&(p=[],h.port1.postMessage("abort"),h.port1.onmessage=null,h.port1.close(),h.port2.close(),h=null)},n.loaded?n.postMessage(...y):n.addEventListener("load",()=>{n.postMessage(...y)},{once:!0})}let p=[];return!s&&w&&w.writable||new c.WritableStream({write(f){if(!(f instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?p.push(f):(h.port1.postMessage(f),P+=f.length,d&&(location.href=d,d=null))},close(){if(s){const f=new Blob(p,{type:"application/octet-stream; charset=utf-8"}),y=document.createElement("a");y.href=URL.createObjectURL(f),y.download=m,y.click()}else h.port1.postMessage("end")},abort(){p=[],h.port1.postMessage("abort"),h.port1.onmessage=null,h.port1.close(),h.port2.close(),h=null}},R.writableStrategy)},WritableStream:e.WritableStream||o.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function u(m){if(!m)throw new Error("meh");const b=document.createElement("iframe");return b.hidden=!0,b.src=m,b.loaded=!1,b.name="iframe",b.isIframe=!0,b.postMessage=(...E)=>b.contentWindow.postMessage(...E),b.addEventListener("load",()=>{b.loaded=!0},{once:!0}),document.body.appendChild(b),b}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(m=>{try{m()}catch{}})(()=>{const{readable:m}=new TransformStream,b=new MessageChannel;b.port1.postMessage(m,[m]),b.port1.close(),b.port2.close(),r=!0,Object.defineProperty(c,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),c})}(es)),es.exports),Gc=sn(Xc);class Vc{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(e,n,r=3,o=6,i=6e4){this.fileID=e,this.downloadURL=n,this.chunkByteSize=r*this.ChunkUnitM,this.eventTarget=zr(),this.initIndexDB(),o>=3&&(this.cacheSize=o),i>this.requestTimeout&&(this.requestTimeout=i)}on(e,n){this.eventTarget.on(e,n)}dispatch(e,n){this.eventTarget.emit(e,n)}dispatchError(e){this.eventTarget.emit("error",e)}dispatchInfo(e){this.eventTarget.emit("info",e)}async queryDownloadFileMeta(e,n="",r){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const o=await De(n,e,r);let i=null;return o&&o.status===200&&(i=o.data),i}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Rn.createInstance({name:this.fileID,driver:Rn.INDEXEDDB})}async init(e){if(this.finishNum=0,e){const n="fileinfo";this.fileMetaData={id:e.id,name:e.name,length:e.length,downloadID:e.downloadID,chunkSize:this.chunkByteSize},this.fileName=e.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),Rn.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(e){return new Promise(n=>setTimeout(n,e))}async download(e,n){let r=e;if(!r&&this.downloadURL&&(r=this.downloadURL),!r)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const o=F.Axios.CancelToken;this.cancelSource=o.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const a=this.cacheSize;let c=0;for(let u=0;u<this.totalChunks;u++){if(this.keys&&this.keys?.indexOf(u.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const m=u*this.chunkByteSize;let b=m+this.chunkByteSize-1;this.fileMetaData&&b>this.fileMetaData.length&&(b=this.fileMetaData.length-1);const E={range:`bytes=${m}-${b}`};for(;c>=a;)await this.sleep(200);const R=u.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${u+1}/${this.totalChunks}`),c++,De(r,n,i,E,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const d=P.data;c--,await this.currentDB?.setItem(R,d),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const h=parseInt(R)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${h}/${this.totalChunks}`),this.savefile()}).catch(P=>{c--;const d=parseInt(R)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${d}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const e=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",e)}outputProgress(e){const n=100*e/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const e=Gc.createWriteStream(this.fileName).getWriter();let n=0;for(let r=0;r<this.totalChunks;r++){const o=r.toString();let i=await this.currentDB?.getItem(o);if(i||(i=await this.currentDB?.getItem(o)),!i)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${r+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let s=new Response(i).body;if(s===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${r+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const a=s.getReader();for(;;){const{done:c,value:u}=await a.read();if(c)break;await e.write(u)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${r+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Rn.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function Kc(t,e){let n="",r="";for(const o in e)n+=o+"="+encodeURIComponent(e[o])+"&";return n=n.replace(/&$/,""),r=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,r}function ts(t={},e={}){let n;for(n in e)rt(e[n])?t[n]=ts(t[n],e[n]):t[n]=e[n];return t}function Yc(t,e){const n=`${t}_${e}`;return ce.MD5(n)}function ns(t){const e=function(a){if(!a)return;const c=a,u=[];if(c)for(let m of c){const b=rs(m);b&&u.push(b)}return u}(t.bussinessRoutes),n=function(a){if(!a)return;const c=a;if(c&&c.length>0){const u=[];return c.forEach(m=>{const b=os(m);b&&u.push(b)}),u}}(t.widgetMenuConfig),r=function(a){if(a&&a.length>0){const c=[];return a.forEach(u=>{const m=function(b){return b?{id:b.id,label:b.label,layoutID:b.layoutID,container:b.container,preload:b.preload,afterid:b.afterid,bindid:b.bindid,group:b.group}:void 0}(u);m&&c.push(m)}),c}}(t.widgetConfig),o=function(a){if(a&&a.length>0)return a}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:Yc(s,i),name:F.Config.UI.SiteTitle,group:F.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:r,functions:o}}function rs(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const r=[];for(let o of t.children){const i=rs(o);i&&r.push(i)}r.length>0&&(n.children=r)}return n}}function os(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const r=os(n);r&&e.children?.push(r)})),e}function Jc(t,e="IconifyList.ts"){let n="",r=`const iconlist={
|
|
9
|
+
`,o=0;t.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const a="icon"+o;n+=`import ${a} from '~icons/${s[0]}/${s[1]}'
|
|
10
|
+
`,r+=` '${i}':${a},
|
|
11
|
+
`,o++}}),o>0&&(r+=`};
|
|
12
|
+
`,Wt(n+r+"export default iconlist;","IconifyList.ts"))}function Qc(t,e){const n=ns(t);Pi(n,e),F.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function Zc(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e}function el(t){let e=Vr(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e}function Vr(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}function tl(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e}function nl(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function rl(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function ol(t){return t.replace(/(^\s*)|(\s*$)/g,"")}function il(t){let e=Vr(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e}function sl(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)}function al(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let r=(t+="00").indexOf(".");r>=0&&(t=t.substring(0,r)+t.substr(r+1,2)),e=e.substr(e.length-t.length);for(let o=0;o<t.length;o++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(o,1),1)+e.substr(o,1);return n=n.replace(/零角零分$/,"\u6574").replace(/零[仟佰拾]/g,"\u96F6").replace(/零{2,}/g,"\u96F6").replace(/零([亿|万])/g,"$1").replace(/零+元/,"\u5143").replace(/亿零{0,3}万/,"\u4EBF").replace(/^元/,"\u96F6\u5143")}function cl(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)}function ll(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)}function ul(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)}function hl(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)}function dl(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)}function fl(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e}function pl(t){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t)}function gl(t){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function ml(t){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(t)}function vl(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)}function yl(t){return!!/^[1-9][0-9]{5}$/.test(t)}function wl(t){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)}function bl(t){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(t)}let is=!0;try{String.fromCharCode.apply(String,[1,2])}catch{is=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Kr=2654435769;function ss(t,e){var n=t.length,r=n<<2;if(e){var o=t[n-1];if(o<(r-=4)-3||o>r)return null;r=o}for(var i=new Uint8Array(r),s=0;s<r;++s)i[s]=t[s>>2]>>((3&s)<<3);return i}function Pn(t,e){var n,r=t.length,o=r>>2;3&r&&++o,e?(n=new Uint32Array(o+1))[o]=r:n=new Uint32Array(o);for(var i=0;i<r;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function ut(t){return 4294967295&t}function zn(t,e,n,r,o,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&r^o]^n)}function as(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function Mn(t){for(var e=t.length,n=new Uint8Array(3*e),r=0,o=0;o<e;o++){var i=t.charCodeAt(o);if(i<128)n[r++]=i;else if(i<2048)n[r++]=192|i>>6,n[r++]=128|63&i;else{if(!(i<55296||i>57343)){if(o+1<e){var s=t.charCodeAt(o+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[r++]=240|a>>18,n[r++]=128|a>>12&63,n[r++]=128|a>>6&63,n[r++]=128|63&a,o++;continue}}throw new Error("Malformed string")}n[r++]=224|i>>12,n[r++]=128|i>>6&63,n[r++]=128|63&i}}return n.subarray(0,r)}function cs(t){var e=t.length;return e===0?"":e<32767?function(n,r){for(var o=new Array(r),i=0,s=0,a=n.length;i<r&&s<a;i++){var c=n[s++];switch(c>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o[i]=c;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");o[i]=(31&c)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");o[i]=(15&c)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var u=((7&c)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=u&&u<=1048575))throw new Error("Character outside valid Unicode range: 0x"+u.toString(16));o[i++]=u>>10&1023|55296,o[i]=1023&u|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+c.toString(16))}}return i<r&&(o.length=i),String.fromCharCode.apply(String,o)}(t,e):function(n,r){for(var o=[],i=new Array(32768),s=0,a=0,c=n.length;s<r&&a<c;s++){var u=n[a++];switch(u>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=u;break;case 12:case 13:if(!(a<c))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&u)<<6|63&n[a++];break;case 14:if(!(a+1<c))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&u)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<c))throw new Error("Unfinished UTF-8 octet sequence");var m=((7&u)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=m&&m<=1048575))throw new Error("Character outside valid Unicode range: 0x"+m.toString(16));i[s++]=m>>10&1023|55296,i[s]=1023&m|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+u.toString(16))}if(s>=32766){var b=s+1;i.length=b,o.push(String.fromCharCode.apply(String,i)),r-=b,s=-1}}return s>0&&(i.length=s,o.push(String.fromCharCode.apply(String,i))),o.join("")}(t,e)}function _l(t){var e=t.length;if(e===0)return"";var n=is?t:function(a){for(var c=a.length,u=new Array(a.length),m=0;m<c;++m)u[m]=a[m];return u}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var r=32767&e,o=e>>15,i=new Array(r?o+1:o),s=0;s<o;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return r&&(i[o]=String.fromCharCode.apply(String,n.subarray(o<<15,e))),i.join("")}function ls(t,e){return typeof t=="string"&&(t=Mn(t)),typeof e=="string"&&(e=Mn(e)),t==null||t.length===0?t:ss(function(n,r){var o,i,s,a,c,u,m=n.length,b=m-1;for(i=n[b],s=0,u=0|Math.floor(6+52/m);u>0;--u){for(a=(s=ut(s+Kr))>>>2&3,c=0;c<b;++c)o=n[c+1],i=n[c]=ut(n[c]+zn(s,o,i,c,a,r));o=n[0],i=n[b]=ut(n[b]+zn(s,o,i,b,a,r))}return n}(Pn(t,!0),Pn(as(e),!1)),!1)}function us(t,e){return typeof t=="string"&&(t=function(n){for(var r=window.atob(n),o=r.length,i=new Uint8Array(o),s=0;s<o;s++)i[s]=r.charCodeAt(s);return i}(t)),typeof e=="string"&&(e=Mn(e)),t==null||t.length===0?t:ss(function(n,r){var o,i,s,a,c,u=n.length,m=u-1;for(o=n[0],s=ut(Math.floor(6+52/u)*Kr);s!==0;s=ut(s-Kr)){for(a=s>>>2&3,c=m;c>0;--c)i=n[c-1],o=n[c]=ut(n[c]-zn(s,o,i,c,a,r));i=n[m],o=n[0]=ut(n[0]-zn(s,o,i,0,a,r))}return n}(Pn(t,!1),Pn(as(e),!1)),!0)}const Ot={toBytes:Mn,toString:cs,encrypt:ls,encryptToString:function(t,e){return window.btoa(_l(ls(t,e)))},decrypt:us,decryptToString:function(t,e){return cs(us(t,e))}},hs=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));const n=document.createElement("canvas");n.width=200,n.height=130;const r=n.getContext("2d");r.rotate(-20*Math.PI/180),r.font="12px Vedana",r.fillStyle="rgba(200, 200, 200, 0.30)",r.textBaseline="middle",r.fillText(t,n.width/10,n.height/2);const o=document.createElement("div");return o.id=e,o.style.pointerEvents="none",o.style.top="0px",o.style.left="0px",o.style.position="fixed",o.style.zIndex="10000000",o.style.width=`${document.documentElement.clientWidth}px`,o.style.height=`${document.documentElement.clientHeight}px`,o.style.background=`url(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(o),e},Sl={set:t=>{let e=hs(t);document.getElementById(e)===null&&(e=hs(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class ht extends Error{constructor(e,n){const r=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=r}}class Yr extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Be extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Cl extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=r}}class El extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=r}}class kl extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=r}}class ds extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class xl extends Error{constructor(e,n){const r=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=r}}class fs{constructor(e,n,r){this.statusCode=e,this.statusText=n,this.content=r}}class An{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var T;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(T||(T={}));class Ht{constructor(){}log(e,n){}}Ht.instance=new Ht;class de{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,r){if(!(e in n))throw new Error(`Unknown ${r} value: ${e}.`)}}class ae{static get isBrowser(){return!ae.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!ae.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!ae.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function jt(t,e){let n="";return dt(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${function(r){const o=new Uint8Array(r);let i="";return o.forEach(s=>{i+=`0x${s<16?"0":""}${s.toString(16)} `}),i.substr(0,i.length-1)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function dt(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function ps(t,e,n,r,o,i){const s={},[a,c]=Rt();s[a]=c,t.log(T.Trace,`(${e} transport) sending data. ${jt(o,i.logMessageContent)}.`);const u=dt(o)?"arraybuffer":"text",m=await n.post(r,{content:o,headers:{...s,...i.headers},responseType:u,timeout:i.timeout,withCredentials:i.withCredentials});t.log(T.Trace,`(${e} transport) request complete. Response status: ${m.statusCode}.`)}class Il{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Dn{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const r=`[${new Date().toISOString()}] ${T[e]}: ${n}`;switch(e){case T.Critical:case T.Error:this.out.error(r);break;case T.Warning:this.out.warn(r);break;case T.Information:this.out.info(r);break;default:this.out.log(r)}}}}function Rt(){let t="X-SignalR-User-Agent";return ae.isNode&&(t="User-Agent"),[t,Tl("8.0.7",Rl(),zl(),Pl())]}function Tl(t,e,n,r){let o="Microsoft SignalR/";const i=t.split(".");return o+=`${i[0]}.${i[1]}`,o+=` (${t}; `,o+=e&&e!==""?`${e}; `:"Unknown OS; ",o+=`${n}`,o+=r?`; ${r}`:"; Unknown Runtime Version",o+=")",o}function Rl(){if(!ae.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Pl(){if(ae.isNode)return process.versions.node}function zl(){return ae.isNode?"NodeJS":"Browser"}function Jr(t){return t.stack?t.stack:t.message?t.message:`${t}`}class Ml extends An{constructor(e){if(super(),this._logger=e,typeof fetch>"u"||ae.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch>"u"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("could not find global")}());if(typeof AbortController>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new Be;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let r;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),r=new Be});let o,i=null;if(e.timeout){const c=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(T.Warning,"Timeout from HTTP request."),r=new Yr},c)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},dt(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");try{o=await this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...e.headers},method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(c){throw r||(this._logger.log(T.Warning,`Error from HTTP request. ${c}.`),c)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const c=await gs(o,"text");throw new ht(c||o.statusText,o.status)}const s=gs(o,e.responseType),a=await s;return new fs(o.status,o.statusText,a)}getCookieString(e){let n="";return ae.isNode&&this._jar&&this._jar.getCookies(e,(r,o)=>n=o.join("; ")),n}}function gs(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Al extends An{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Be):e.method?e.url?new Promise((n,r)=>{const o=new XMLHttpRequest;o.open(e.method,e.url,!0),o.withCredentials=e.withCredentials===void 0||e.withCredentials,o.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(dt(e.content)?o.setRequestHeader("Content-Type","application/octet-stream"):o.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=e.headers;i&&Object.keys(i).forEach(s=>{o.setRequestHeader(s,i[s])}),e.responseType&&(o.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{o.abort(),r(new Be)}),e.timeout&&(o.timeout=e.timeout),o.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),o.status>=200&&o.status<300?n(new fs(o.status,o.statusText,o.response||o.responseText)):r(new ht(o.response||o.responseText||o.statusText,o.status))},o.onerror=()=>{this._logger.log(T.Warning,`Error from HTTP request. ${o.status}: ${o.statusText}.`),r(new ht(o.statusText,o.status))},o.ontimeout=()=>{this._logger.log(T.Warning,"Timeout from HTTP request."),r(new Yr)},o.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Dl extends An{constructor(e){if(super(),typeof fetch<"u"||ae.isNode)this._httpClient=new Ml(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Al(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Be):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class Re{static write(e){return`${e}${Re.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Re.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(Re.RecordSeparator);return n.pop(),n}}Re.RecordSeparatorCode=30,Re.RecordSeparator=String.fromCharCode(Re.RecordSeparatorCode);class Ll{writeHandshakeRequest(e){return Re.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,r;if(dt(e)){const s=new Uint8Array(e),a=s.indexOf(Re.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const c=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,c))),r=s.byteLength>c?s.slice(c).buffer:null}else{const s=e,a=s.indexOf(Re.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const c=a+1;n=s.substring(0,c),r=s.length>c?s.substring(c):null}const o=Re.parse(n),i=JSON.parse(o[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[r,i]}}var q;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(q||(q={}));class $l{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Il(this,e)}}class Bl{constructor(e,n,r){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=r}async _send(e){const n=this._protocol.writeMessage(e);let r=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let o=()=>{},i=()=>{};dt(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(r=new Promise((s,a)=>{o=s,i=a})),this._messages.push(new Nl(n,this._totalMessageCount,o,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await r}_ack(e){let n=-1;for(let r=0;r<this._messages.length;r++){const o=this._messages[r];if(o._id<=e.sequenceId)n=r,dt(o._message)?this._bufferedByteCount-=o._message.byteLength:this._bufferedByteCount-=o._message.length,o._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;o._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type===q.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:q.Sequence,sequenceId:e}));const n=this._messages;for(const r of n)await this._connection.send(r._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case q.Invocation:case q.StreamItem:case q.Completion:case q.StreamInvocation:case q.CancelInvocation:return!0;case q.Close:case q.Sequence:case q.Ping:case q.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:q.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Nl{constructor(e,n,r,o){this._message=e,this._id=n,this._resolver=r,this._rejector=o}}var se;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(se||(se={}));class po{static create(e,n,r,o,i,s,a){return new po(e,n,r,o,i,s,a)}constructor(e,n,r,o,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(T.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},de.isRequired(e,"connection"),de.isRequired(n,"logger"),de.isRequired(r,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=r,this.connection=e,this._reconnectPolicy=o,this._handshakeProtocol=new Ll,this.connection.onreceive=c=>this._processIncomingData(c),this.connection.onclose=c=>this._connectionClosed(c),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=se.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:q.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==se.Disconnected&&this._connectionState!==se.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}async _startWithStateTransitions(){if(this._connectionState!==se.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=se.Connecting,this._logger.log(T.Debug,"Starting HubConnection.");try{await this._startInternal(),ae.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=se.Connected,this._connectionStarted=!0,this._logger.log(T.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=se.Disconnected,this._logger.log(T.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,r)=>{this._handshakeResolver=n,this._handshakeRejecter=r});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const r={protocol:this._protocol.name,version:n};if(this._logger.log(T.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(r)),this._logger.log(T.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await e,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Bl(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||await this._sendMessage(this._cachedPingMessage)}catch(n){throw this._logger.log(T.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===se.Disconnected)return this._logger.log(T.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===se.Disconnecting)return this._logger.log(T.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=se.Disconnecting,this._logger.log(T.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(T.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===se.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Be("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,o);let s;const a=new $l;return a.cancelCallback=()=>{const c=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(c))},this._callbacks[i.invocationId]=(c,u)=>{u?a.error(u):c&&(c.type===q.Completion?c.error?a.error(new Error(c.error)):a.complete():a.next(c.item))},s=this._sendWithProtocol(i).catch(c=>{a.error(c),delete this._callbacks[i.invocationId]}),this._launchStreams(r,s),a}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,o));return this._launchStreams(r,i),i}invoke(e,...n){const[r,o]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,o);return new Promise((a,c)=>{this._callbacks[i.invocationId]=(m,b)=>{b?c(b):m&&(m.type===q.Completion?m.error?c(new Error(m.error)):a(m.result):c(new Error(`Unexpected message type: ${m.type}`)))};const u=this._sendWithProtocol(i).catch(m=>{c(m),delete this._callbacks[i.invocationId]});this._launchStreams(r,u)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const r=this._methods[e];if(r)if(n){const o=r.indexOf(n);o!==-1&&(r.splice(o,1),r.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const r of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(r))switch(r.type){case q.Invocation:this._invokeClientMethod(r).catch(o=>{this._logger.log(T.Error,`Invoke client method threw error: ${Jr(o)}`)});break;case q.StreamItem:case q.Completion:{const o=this._callbacks[r.invocationId];if(o){r.type===q.Completion&&delete this._callbacks[r.invocationId];try{o(r)}catch(i){this._logger.log(T.Error,`Stream callback threw error: ${Jr(i)}`)}}break}case q.Ping:break;case q.Close:{this._logger.log(T.Information,"Close message received from server.");const o=r.error?new Error("Server returned an error on close: "+r.error):void 0;r.allowReconnect===!0?this.connection.stop(o):this._stopPromise=this._stopInternal(o);break}case q.Ack:this._messageBuffer&&this._messageBuffer._ack(r);break;case q.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(r);break;default:this._logger.log(T.Warning,`Invalid message type: ${r.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,r;try{[r,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(o){const i="Error parsing handshake response: "+o;this._logger.log(T.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const o="Server returned handshake error: "+n.error;this._logger.log(T.Error,o);const i=new Error(o);throw this._handshakeRejecter(i),i}return this._logger.log(T.Debug,"Server handshake complete."),this._handshakeResolver(),r}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if(!(this.connection.features&&this.connection.features.inherentKeepAlive||(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle!==void 0))){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===se.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),r=this._methods[n];if(!r)return this._logger.log(T.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(T.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const o=r.slice(),i=!!e.invocationId;let s,a,c;for(const u of o)try{const m=s;s=await u.apply(this,e.arguments),i&&s&&m&&(this._logger.log(T.Error,`Multiple results provided for '${n}'. Sending error to server.`),c=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),a=void 0}catch(m){a=m,this._logger.log(T.Error,`A callback for the method '${n}' threw error '${m}'.`)}c?await this._sendWithProtocol(c):i?(a?c=this._createCompletionMessage(e.invocationId,`${a}`,null):s!==void 0?c=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(T.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),c=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(c)):s&&this._logger.log(T.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(e){this._logger.log(T.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Be("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===se.Disconnecting?this._completeClose(e):this._connectionState===se.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===se.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=se.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),ae.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(T.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=Date.now();let r=0,o=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(r++,0,o);if(i===null)return this._logger.log(T.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(e);if(this._connectionState=se.Reconnecting,e?this._logger.log(T.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(T.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[e]))}catch(s){this._logger.log(T.Error,`An onreconnecting callback called with error '${e}' threw error '${s}'.`)}if(this._connectionState!==se.Reconnecting)return void this._logger.log(T.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(T.Information,`Reconnect attempt number ${r} will start in ${i} ms.`),await new Promise(s=>{this._reconnectDelayHandle=setTimeout(s,i)}),this._reconnectDelayHandle=void 0,this._connectionState!==se.Reconnecting)return void this._logger.log(T.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=se.Connected,this._logger.log(T.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(T.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(T.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==se.Reconnecting)return this._logger.log(T.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),void(this._connectionState===se.Disconnecting&&this._completeClose());o=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(r++,Date.now()-n,o)}}this._logger.log(T.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${r} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,r){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:r})}catch(o){return this._logger.log(T.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${o}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(r=>{const o=n[r];try{o(null,e)}catch(i){this._logger.log(T.Error,`Stream 'error' callback called with '${e}' threw error: ${Jr(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,r,o){if(r)return o.length!==0?{arguments:n,streamIds:o,target:e,type:q.Invocation}:{arguments:n,target:e,type:q.Invocation};{const i=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:i.toString(),streamIds:o,target:e,type:q.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:q.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const r in e)e[r].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r)))},error:o=>{let i;i=o instanceof Error?o.message:o&&o.toString?o.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(r,i)))},next:o=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(r,o)))}})}}_replaceStreamingParams(e){const n=[],r=[];for(let o=0;o<e.length;o++){const i=e[o];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,r.push(s.toString()),e.splice(o,1)}}return[n,r]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,r){const o=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:o.toString(),streamIds:r,target:e,type:q.StreamInvocation}:{arguments:n,invocationId:o.toString(),target:e,type:q.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:q.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:q.StreamItem}}_createCompletionMessage(e,n,r){return n?{error:n,invocationId:e,type:q.Completion}:{invocationId:e,result:r,type:q.Completion}}_createCloseMessage(){return{type:q.Close}}}const Wl=[0,2e3,1e4,3e4,null];class ms{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Wl}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class ft{}ft.Authorization="Authorization",ft.Cookie="Cookie";class Ul extends An{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const r=await this._innerClient.send(e);return n&&r.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(e),await this._innerClient.send(e)):r}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[ft.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[ft.Authorization]&&delete e.headers[ft.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var fe,we;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(fe||(fe={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(we||(we={}));class Fl{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class vs{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,r){this._httpClient=e,this._logger=n,this._pollAbort=new Fl,this._options=r,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(de.isRequired(e,"url"),de.isRequired(n,"transferFormat"),de.isIn(n,we,"transferFormat"),this._url=e,this._logger.log(T.Trace,"(LongPolling transport) Connecting."),n===we.Binary&&typeof XMLHttpRequest<"u"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[r,o]=Rt(),i={[r]:o,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===we.Binary&&(s.responseType="arraybuffer");const a=`${e}&_=${Date.now()}`;this._logger.log(T.Trace,`(LongPolling transport) polling: ${a}.`);const c=await this._httpClient.get(a,s);c.statusCode!==200?(this._logger.log(T.Error,`(LongPolling transport) Unexpected response code: ${c.statusCode}.`),this._closeError=new ht(c.statusText||"",c.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){try{for(;this._running;)try{const r=`${e}&_=${Date.now()}`;this._logger.log(T.Trace,`(LongPolling transport) polling: ${r}.`);const o=await this._httpClient.get(r,n);o.statusCode===204?(this._logger.log(T.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):o.statusCode!==200?(this._logger.log(T.Error,`(LongPolling transport) Unexpected response code: ${o.statusCode}.`),this._closeError=new ht(o.statusText||"",o.statusCode),this._running=!1):o.content?(this._logger.log(T.Trace,`(LongPolling transport) data received. ${jt(o.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(o.content)):this._logger.log(T.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(r){this._running?r instanceof Yr?this._logger.log(T.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=r,this._running=!1):this._logger.log(T.Trace,`(LongPolling transport) Poll errored after shutdown: ${r.message}`)}}finally{this._logger.log(T.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(e){return this._running?ps(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(T.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(T.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,r]=Rt();e[n]=r;const o={headers:{...e,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};let i;try{await this._httpClient.delete(this._url,o)}catch(s){i=s}i?i instanceof ht&&(i.statusCode===404?this._logger.log(T.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(T.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(T.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(T.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(T.Trace,e),this.onclose(this._closeError)}}}class Ol{constructor(e,n,r,o){this._httpClient=e,this._accessToken=n,this._logger=r,this._options=o,this.onreceive=null,this.onclose=null}async connect(e,n){return de.isRequired(e,"url"),de.isRequired(n,"transferFormat"),de.isIn(n,we,"transferFormat"),this._logger.log(T.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((r,o)=>{let i,s=!1;if(n===we.Text){if(ae.isBrowser||ae.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(e),c={};c.Cookie=a;const[u,m]=Rt();c[u]=m,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...c,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(T.Trace,`(SSE transport) data received. ${jt(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(c){return void this._close(c)}},i.onerror=a=>{s?this._close():o(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},i.onopen=()=>{this._logger.log(T.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,r()}}catch(a){return void o(a)}}else o(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(e){return this._eventSource?ps(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Hl{constructor(e,n,r,o,i,s){this._logger=r,this._accessTokenFactory=n,this._logMessageContent=o,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let r;return de.isRequired(e,"url"),de.isRequired(n,"transferFormat"),de.isIn(n,we,"transferFormat"),this._logger.log(T.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(r=await this._accessTokenFactory()),new Promise((o,i)=>{let s;e=e.replace(/^http/,"ws");const a=this._httpClient.getCookieString(e);let c=!1;if(ae.isNode||ae.isReactNative){const u={},[m,b]=Rt();u[m]=b,r&&(u[ft.Authorization]=`Bearer ${r}`),a&&(u[ft.Cookie]=a),s=new this._webSocketConstructor(e,void 0,{headers:{...u,...this._headers}})}else r&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(r)}`);s||(s=new this._webSocketConstructor(e)),n===we.Binary&&(s.binaryType="arraybuffer"),s.onopen=u=>{this._logger.log(T.Information,`WebSocket connected to ${e}.`),this._webSocket=s,c=!0,o()},s.onerror=u=>{let m=null;m=typeof ErrorEvent<"u"&&u instanceof ErrorEvent?u.error:"There was an error with the transport",this._logger.log(T.Information,`(WebSockets transport) ${m}.`)},s.onmessage=u=>{if(this._logger.log(T.Trace,`(WebSockets transport) data received. ${jt(u.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(u.data)}catch(m){return void this._close(m)}},s.onclose=u=>{if(c)this._close(u);else{let m=null;m=typeof ErrorEvent<"u"&&u instanceof ErrorEvent?u.error:"WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",i(new Error(m))}}})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(T.Trace,`(WebSockets transport) sending data. ${jt(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(T.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(e)||e.wasClean!==!1&&e.code===1e3?e instanceof Error?this.onclose(e):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)))}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}class jl{constructor(e,n={}){var r;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,de.isRequired(e,"url"),this._logger=(r=n.logger)===void 0?new Dn(T.Information):r===null?Ht.instance:r.log!==void 0?r:new Dn(r),this.baseUrl=this._resolveUrl(e),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let o=null,i=null;if(ae.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;o=s("ws"),i=s("eventsource")}ae.isNode||typeof WebSocket>"u"||n.WebSocket?ae.isNode&&!n.WebSocket&&o&&(n.WebSocket=o):n.WebSocket=WebSocket,ae.isNode||typeof EventSource>"u"||n.EventSource?ae.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Ul(n.httpClient||new Dl(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||we.Binary,de.isIn(e,we,"transferFormat"),this._logger.log(T.Debug,`Starting connection with transfer format '${we[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(T.Error,n),await this._stopPromise,Promise.reject(new Be(n))}if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(T.Error,n),Promise.reject(new Be(n))}this._connectionStarted=!0}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new go(this.transport)),this._sendQueue.send(e))}async stop(e){return this._connectionState==="Disconnected"?(this._logger.log(T.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(T.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise):(this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(T.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(T.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(e){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==fe.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(fe.WebSockets),await this._startTransport(n,e)}else{let r=null,o=0;do{if(r=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Be("The connection was stopped during negotiation.");if(r.error)throw new Error(r.error);if(r.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(r.url&&(n=r.url),r.accessToken){const i=r.accessToken;this._accessTokenFactory=()=>i,this._httpClient._accessToken=i,this._httpClient._accessTokenFactory=void 0}o++}while(r.url&&o<100);if(o===100&&r.url)throw new Error("Negotiate redirection limit exceeded.");await this._createTransport(n,this._options.transport,r,e)}this.transport instanceof vs&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(T.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(r){return this._logger.log(T.Error,"Failed to start the connection: "+r),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(r)}}async _getNegotiationResponse(e){const n={},[r,o]=Rt();n[r]=o;const i=this._resolveNegotiateUrl(e);this._logger.log(T.Debug,`Sending negotiation request: ${i}.`);try{const s=await this._httpClient.post(i,{content:"",headers:{...n,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(s.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${s.statusCode}'`));const a=JSON.parse(s.content);return(!a.negotiateVersion||a.negotiateVersion<1)&&(a.connectionToken=a.connectionId),a.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new ds("Client didn't negotiate Stateful Reconnect but the server did.")):a}catch(s){let a="Failed to complete negotiation with the server: "+s;return s instanceof ht&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(T.Error,a),Promise.reject(new ds(a))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,r,o){let i=this._createConnectUrl(e,r.connectionToken);if(this._isITransport(n))return this._logger.log(T.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,o),void(this.connectionId=r.connectionId);const s=[],a=r.availableTransports||[];let c=r;for(const u of a){const m=this._resolveTransportOrError(u,n,o,c?.useStatefulReconnect===!0);if(m instanceof Error)s.push(`${u.transport} failed:`),s.push(m);else if(this._isITransport(m)){if(this.transport=m,!c){try{c=await this._getNegotiationResponse(e)}catch(b){return Promise.reject(b)}i=this._createConnectUrl(e,c.connectionToken)}try{return await this._startTransport(i,o),void(this.connectionId=c.connectionId)}catch(b){if(this._logger.log(T.Error,`Failed to start the transport '${u.transport}': ${b}`),c=void 0,s.push(new kl(`${u.transport} failed: ${b}`,fe[u.transport])),this._connectionState!=="Connecting"){const E="Failed to select transport before stop() was called.";return this._logger.log(T.Debug,E),Promise.reject(new Be(E))}}}}return s.length>0?Promise.reject(new xl(`Unable to connect to the server with any of the available transports. ${s.join(" ")}`,s)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))}_constructTransport(e){switch(e){case fe.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Hl(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case fe.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Ol(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case fe.LongPolling:return new vs(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async r=>{let o=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,n),await this.features.resend()}catch{o=!0}o&&this._stopConnection(r)}else this._stopConnection(r)}:this.transport.onclose=r=>this._stopConnection(r),this.transport.connect(e,n)}_resolveTransportOrError(e,n,r,o){const i=fe[e.transport];if(i==null)return this._logger.log(T.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||!!(a&s)}(n,i))return this._logger.log(T.Debug,`Skipping transport '${fe[i]}' because it was disabled by the client.`),new El(`'${fe[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(a=>we[a]).indexOf(r)>=0))return this._logger.log(T.Debug,`Skipping transport '${fe[i]}' because it does not support the requested transfer format '${we[r]}'.`),new Error(`'${fe[i]}' does not support ${we[r]}.`);if(i===fe.WebSockets&&!this._options.WebSocket||i===fe.ServerSentEvents&&!this._options.EventSource)return this._logger.log(T.Debug,`Skipping transport '${fe[i]}' because it is not supported in your environment.'`),new Cl(`'${fe[i]}' is not supported in your environment.`,i);this._logger.log(T.Debug,`Selecting transport '${fe[i]}'.`);try{return this.features.reconnect=i===fe.WebSockets?o:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(T.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(T.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(T.Error,`Connection disconnected with error '${e}'.`):this._logger.log(T.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(T.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(T.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}else this._logger.log(T.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!ae.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(T.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const r=new URLSearchParams(n.searchParams);return r.has("negotiateVersion")||r.append("negotiateVersion",this._negotiateVersion.toString()),r.has("useStatefulReconnect")?r.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&r.append("useStatefulReconnect","true"),n.search=r.toString(),n.toString()}}class go{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Ln,this._transportResult=new Ln,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Ln),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new Ln;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):go._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(r){e.reject(r)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),r=new Uint8Array(n);let o=0;for(const i of e)r.set(new Uint8Array(i),o),o+=i.byteLength;return r.buffer}}class Ln{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class ql{constructor(){this.name="json",this.version=2,this.transferFormat=we.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ht.instance);const r=Re.parse(e),o=[];for(const i of r){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case q.Invocation:this._isInvocationMessage(s);break;case q.StreamItem:this._isStreamItemMessage(s);break;case q.Completion:this._isCompletionMessage(s);break;case q.Ping:case q.Close:break;case q.Ack:this._isAckMessage(s);break;case q.Sequence:this._isSequenceMessage(s);break;default:n.log(T.Information,"Unknown message type '"+s.type+"' ignored.");continue}o.push(s)}return o}writeMessage(e){return Re.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Xl={trace:T.Trace,debug:T.Debug,info:T.Information,information:T.Information,warn:T.Warning,warning:T.Warning,error:T.Error,critical:T.Critical,none:T.None};class Gl{configureLogging(e){if(de.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(r){const o=Xl[r.toLowerCase()];if(o!==void 0)return o;throw new Error(`Unknown log level: ${r}`)}(e);this.logger=new Dn(n)}else this.logger=new Dn(e);return this}withUrl(e,n){return de.isRequired(e,"url"),de.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return de.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new ms(e):this.reconnectPolicy=e:this.reconnectPolicy=new ms,this}withServerTimeout(e){return de.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return de.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new jl(this.url,e);return po.create(n,this.logger||Ht.instance,this.protocol||new ql,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let $n;function Vl(t){if(!t){if($n)return $n;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new Gl().configureLogging(T.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{F.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{F.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{F.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{F.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),$n||($n=e),e}const Qr=new Set;function ys(t){return t!==null?parseFloat(t):0}function Bn(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(ys).reduce((o,i)=>o+i)),r=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(ys).reduce((o,i)=>o+i));return{width:n,height:r}}class ws{width;height;constructor(e,n){this.width=e,this.height=n}}function Kl(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),r=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(r))return{left:n,top:r}}return null}function Yl(t,e,n,r){const o=t-n,i=e-r;return o*o+i*i}window.addEventListener("resize",t=>{Qr.forEach(e=>{e&&an(e.fixPosition)&&e.fixPosition()})});const Nn=[];var Wn=Ze({name:"VWindow",props:{windowStyle:{type:Object,required:!0},isOpen:{type:Boolean,required:!1,default:!0},title:{type:String,required:!0,default:""},closeButton:{type:Boolean,required:!1,default:!0},resizable:{type:Boolean,required:!1,default:!1},isScrollable:{type:Boolean,required:!1,default:!1},padding:{type:Number,required:!1,default:8},activateWhenOpen:{type:Boolean,required:!1,default:!0},positionHint:{type:String,required:!1,default:""},zGroup:{type:Number,required:!1,default:1},overflow:{type:String,required:!1,default:"visible"},minWidth:{type:Number,required:!1,default:1},minHeight:{type:Number,required:!1,default:0},maxWidth:{type:Number,required:!1,default:0},maxHeight:{type:Number,required:!1,default:0},height:{type:Number,required:!1},width:{type:Number,required:!1},top:{type:Number,required:!1},left:{type:Number,required:!1}},components:{myButton:on},setup(t,{emit:e}){const n=va();if(!n)return;const{proxy:r}=n;let o=0,i,s,a;const c=ne(t.isOpen),u=()=>{Nn.push(r),a=new Ma(t.zGroup,m),t.isOpen&&function(D){D&&(No(()=>{o++==0&&(p(r),function(){const z=b.value,{width:k,height:x}=ur(z);let B,A;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")B=t.left,A=t.top;else{const U=t.positionHint||"auto";switch(U){case"auto":{let H=20,j=50,X=0;do{if(Nn.every(K=>{if(!K.isOpen||r==K)return!0;const Y=Kl(K);if(Y==null)return!0;const{left:le,top:Q}=Y;return Yl(le,Q,H,j)>16}))break;H=(H+40)%(window.innerWidth-200),j=(j+40)%(window.innerHeight-200)}while(++X<100);B=H,A=j}break;case"center":B=(window.innerWidth-k)/2,A=(window.innerHeight-x)/2,console.log(B,A,window.innerWidth,window.innerHeight,"111111");break;default:try{const H=U.split("/").map(Number);if(H.length!=2)throw null;const[j,X]=H;if(!isFinite(j)||!isFinite(X))throw null;B=j>=0?j:window.innerWidth-k+j,A=X>=0?X:window.innerHeight-x+X}catch{throw new Error(`invalid position string: ${U}`)}}}z&&(z.style.left=`${B}px`,z.style.top=`${A}px`)}()),t.resizable&&f(),M(),i=new za(E.value,b.value,{onMove:()=>M(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:z}=ur(E.value);s=new Da(b.value,{onResize:()=>f(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+z,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+z:void 0})}()}),t.activateWhenOpen&&P())}(!0),Qr.add(r)};function m(D){d.value.zIndex=`${D}`}const b=ne(null),E=ne(null),R=ne(null);function P(){a.raise(),e("activate")}const d=ne({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),h=vt(()=>t.windowStyle.titlebar),w=vt(()=>{const D={...t.windowStyle.content};return t.resizable?D.padding="0":t.padding!=null&&(D.padding=`${t.padding}px`),t.isScrollable&&(D.overflow="auto"),D});function p(D){const{width:z,height:k,top:x,left:B}=D,A=b;if(A&&z!=null&&(A.value.style.width=`${z}px`),k!=null){const U=E.value;if(U){const H=Bn(U).height;A.value.style.height=`${k+H}px`}}A&&B!=null&&(A.value.style.left=`${B}px`),A&&x!=null&&(A.value.style.top=`${x}px`)}function f(D=!0){const z=b.value,k=E.value,x=R.value;if(x&&z&&k){const{width:B,height:A}=Bn(x),{width:U,height:H}=Bn(z),j=Bn(k).height,X=U-(x.offsetWidth-B),K=H-j-(x.offsetHeight-A);x.style.width=`${X}px`,x.style.height=`${K}px`,y(),e("resize",new ws(X,K)),D&&(e("update:width",X),e("update:height",K))}}function y(){const D=b.value;if(D){const z=D.getBoundingClientRect();z.left<0&&(d.value.left="0px"),z.top<0&&(d.value.top="0px"),z.right>window.innerWidth&&(d.value.left=window.innerWidth-z.width+"px"),z.bottom>window.innerHeight&&(d.value.top=window.innerHeight-z.height+"px")}}function M(D=!0){y();const z=b.value;if(z){const{left:k,top:x}=z.getBoundingClientRect();D&&(e("update:left",k),e("update:top",x))}}return et(()=>t.isOpen,D=>{c.value=D}),et(()=>t.zGroup,D=>{a.group=D}),et(()=>t.width,D=>{p({width:D}),f(!1)}),et(()=>t.height,D=>{p({height:D}),f(!1)}),er(()=>{u()}),ya(()=>{Qr.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Nn.splice(Nn.indexOf(r),1)}),{isOpen:c,windowEl:b,titlebar:E,content:R,activate:P,styleWindow:d,styleTitlebar:h,styleContent:w,closeButtonClick:function(){c.value=!1,e("closebuttonclick")},fixPosition:y}}});const Jl={class:"title"};var bs;Wn.render=function(t,e,n,r,o,i){const s=Zt("myButton");return V(),ue(Wo,{name:"fade",onAfterLeave:e[2]||(e[2]=a=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=a=>t.$emit("open")),persisted:""},{default:Ne(()=>[Uo(ie("div",{class:"window",style:ze(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...a)=>t.activate&&t.activate(...a)),onTouchstart:e[1]||(e[1]=(...a)=>t.activate&&t.activate(...a))},[ie("div",{class:"titlebar",style:ze(t.styleTitlebar),ref:"titlebar"},[ie("div",Jl,[t.$slots.title?me(t.$slots,"title",{key:0}):(V(),Te(tt,{key:1},[tr(nr(t.title),1)],64))]),t.closeButton?(V(),ue(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:Ne(()=>e[4]||(e[4]=[tr("\xD7")])),_:1},8,["windowStyle","onClick"])):pe("v-if",!0)],4),ie("div",{class:"content",style:ze(t.styleContent),ref:"content"},[me(t.$slots,"default")],4)],36),[[Fo,t.isOpen]])]),_:3})},Wn.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(bs||(bs={}));const Ql={window:{color:"#fff",boxShadow:"0 0 6pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(31, 31, 31, 0.9)"},titlebar:{backgroundColor:"rgba(63, 63, 63, 0.9)"},content:{},button:{color:"white"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},Zl={window:{color:"#000",boxShadow:"0 2pt 4pt rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(239, 239, 239, 0.95)"},titlebar:{backgroundColor:"rgba(191, 191, 191, 0.9)"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},eu={window:{color:"#000",boxShadow:"0 4pt 8pt rgba(0, 0, 0, 0.5)",background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},titlebar:{background:"linear-gradient(to bottom, rgb(215, 215, 215), rgb(191, 191, 191))"},content:{},button:{color:"#000"},buttonHover:{backgroundColor:"rgba(0, 0, 0, 0.25)"},buttonActive:{color:"#fff",backgroundColor:"rgba(0, 0, 0, 0.5)"}},tu={window:{color:"#fff",fontSize:"14px",boxShadow:"0 0 3pt rgba(255, 255, 255, 0.75)",backgroundColor:"rgba(4,51,81,0.6)",borderRadius:"5px"},titlebar:{backgroundColor:"rgba(4,51,81,0.8)",border:"1px solid rgba(153, 153, 153, 0.5)",borderRadius:"5px",fontSize:"16px",fontWeight:400,color:"#fff"},content:{},button:{color:"white",fontSize:"18px"},buttonHover:{backgroundColor:"rgba(255, 255, 255, 0.25)"},buttonActive:{color:"black",backgroundColor:"rgba(255, 255, 255, 0.5)"}},nu=Wn;var be;(function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"})(be||(be={}));class _s{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,r,o){this.layoutState=e,this._LayoutID=r,this._mapItemRefs=o,n.forEach(i=>{if(i.layoutID===r&&(this.widgetConfig.push(i),i.afterid))if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const s=new Set;s.add(i),this.preConditionMap.set(i.afterid,s)}})}getLayoutID(){return this._LayoutID}getWidgetConfig(){return this.widgetConfig}preloadWidgets(){this.widgetConfig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;if(rt(e)?n=e:bt(e)&&(n=this.widgetConfig.find(r=>r.id===e)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let r=function(a){a.layoutID===o._LayoutID&&a.widgetID===i&&(o._loadWidget(s),F.EventBus.off(ye.WidgetLoadedEvent,r))};const o=this,i=n.afterid,s=n;return F.EventBus.on(ye.WidgetLoadedEvent,r),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component?e.component().then(n=>{if(n.default){const r=wa(n.default);r.id=e.id,e.layout&&(r.style=e.layout),e.cssClass&&(r.cssClass=e.cssClass),e.layoutID&&(r.layoutID=e.layoutID),e.label&&(r.label=e.label),e.jsURL&&(r.jsURL=e.jsURL),e.cssURL&&(r.cssURL=e.cssURL),this.getContainerComponents(e.container).value.set(e.id,r),this.widgetsLoadedSet.add(e.id),No().then(()=>{F.EventBus.emit(ye.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{F.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e,n),F.EventBus.emit(ye.WidgetLoadedErrorEvent,e)}):void 0;this.changeWidgetVisible(e.id,!0)}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const r=this.preConditionMap.get(e);if(r){for(const o of r)if(this.isWidgetLoaded(o.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(r=>r.id===e);if(n){if(this.preConditionMap.has(e)){const r=this.preConditionMap.get(e);if(r)for(const o of r)this.unloadWidget(o.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),F.EventBus.emit(ye.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,r=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),r&&(r.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),r&&(r.style.width="50%"))}getLayoutContainer(e){switch(e){case be.top:return this.layoutState.topContainer;case be.bottom:return this.layoutState.bottomContainer;case be.left:return this.layoutState.leftContainer;case be.right:return this.layoutState.rightContainer;case be.centerBack:return this.layoutState.centerBackContainer;case be.centerMain:return this.layoutState.centerMainContainer;case be.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const r=this.getLayoutContainer(e);r&&(r.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const r=this.getWidgetComponent(e);r&&r.changeVisible&&r.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=ne(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(r=>{e&&e.length>0?e.findIndex(o=>o===r)<0&&n.push(r):n.push(r)}),n.forEach(r=>this.unloadWidget(r))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const r=n.find(o=>o.id===e);if(r&&r.layoutID)return F.LayoutMap.get(r.layoutID)}}}var qt=Ze({name:"SuspenseWithError",setup(){const t=ne(null);return ba(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});qt.render=function(t,e,n,r,o,i){return t.error?me(t.$slots,"error",{key:0},()=>[tr(nr(t.error),1)]):(V(),ue(_a,{key:1},{default:Ne(()=>[me(t.$slots,"default")]),fallback:Ne(()=>[me(t.$slots,"fallback")]),_:3}))},qt.__file="src/controls/routertransition/SuspenseWithError.vue";var Zr=Ze({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const r=Zt("router-view");return V(),ue(qt,null,{default:Ne(()=>[en(r,null,{default:Ne(({Component:o,route:i})=>[pe(" <transition> "),(V(),ue(Oo,null,[i.meta.keepAlive?(V(),ue(We(o),{key:i.name})):pe("v-if",!0)],1024)),i.meta.keepAlive?pe("v-if",!0):(V(),ue(We(o),{key:i.name})),pe(" </transition> ")]),_:1})]),_:1})}});Zr.__file="src/controls/routertransition/RouterTransition.vue";var Un=Ze({name:"LayoutContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object},enableRouterView:{type:Boolean,default:!0}},emits:["containerLoaded"],components:{RouterTransition:Zr},setup(t,{attrs:e,slots:n,emit:r}){const o=t.layoutID,i=ne(t.enableRouterView);et(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=Bo({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),a=new Map,c=new _s(s,t.widgetConfig,o,a),u=d(be.top),m=d(be.centerBack),b=d(be.centerFront),E=d(be.left),R=d(be.right),P=d(be.bottom);function d(w){return c?.getContainerComponents(w)}const h=vt(()=>t.layoutStyle);return er(()=>{c&&(o?F.LayoutMap.set(o,c):(F.LayoutManager=c,F.LayoutMap.set("",c)),c.preloadWidgets(),r("containerLoaded",{layoutID:o,layoutManager:c}),F.EventBus.emit(ye.LayoutContainerLoaded,{layoutID:o,layoutManager:c}))}),{...Sa(s),topContainerComponents:u,centerbackComponents:m,centerfrontComponents:b,leftContainerComponents:E,rightContainerComponents:R,bottomContainerComponents:P,containerStyle:h,isEnableRouterView:i,setItemRef:(w,p)=>{w&&a.set(p,w)}}}});const ru={ref:"topContainer",class:"topContainer"},ou={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},iu={ref:"centerBackContainer",class:"centerdiv backContainer"},su={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},au={ref:"leftContainer",class:"leftContainer"},cu={ref:"rightContainer",class:"rightContainer"},lu={ref:"bottomContainer",class:"bottomContainer"};Un.render=function(t,e,n,r,o,i){const s=Zt("router-transition");return V(),Te("div",{class:"layoutContainer",style:ze(t.containerStyle)},[ie("div",ru,[me(t.$slots,"top"),(V(!0),Te(tt,null,yt(t.topContainerComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512),ie("div",null,[pe(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(V(),Te("div",ou,[me(t.$slots,"main",{},()=>[en(s)])],512)):pe("v-if",!0),pe(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),ie("div",iu,[me(t.$slots,"back"),(V(!0),Te(tt,null,yt(t.centerbackComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512),pe(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),ie("div",su,[me(t.$slots,"front"),(V(!0),Te(tt,null,yt(t.centerfrontComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512),ie("div",au,[me(t.$slots,"left"),(V(!0),Te(tt,null,yt(t.leftContainerComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512),ie("div",cu,[me(t.$slots,"right"),(V(!0),Te(tt,null,yt(t.rightContainerComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512)]),ie("div",lu,[me(t.$slots,"bottom"),(V(!0),Te(tt,null,yt(t.bottomContainerComponents,([a,c])=>(V(),ue(We(c),{ref_for:!0,ref:u=>t.setItemRef(u,a),key:a,style:ze(c.style),class:nt(c.cssClass)},null,8,["style","class"]))),128))],512),pe(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),me(t.$slots,"default")],4)},Un.__scopeId="data-v-4d081e5c",Un.__file="src/controls/layoutcontainer/layout.vue";var Ss=Ze({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:t=>(e,n)=>{const r=Zt("router-view");return V(),ue(qt,null,{default:Ne(()=>[en(r,null,{default:Ne(({Component:o,route:i})=>[en(Ca,{appear:"","enter-active-class":e.enterActive,"leave-active-class":e.leaveActive},{default:Ne(()=>[(V(),ue(Oo,null,[i.meta.keepAlive?(V(),ue(We(o),{key:i.name})):pe("v-if",!0)],1024)),i.meta.keepAlive?pe("v-if",!0):(V(),ue(We(o),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Ss.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Pt=new Map,Xt=ne(new Map);class Gt{static addWindowPanel(e){Pt.set(e.id,e)}static removeWindowPanel(e){Pt.has(e)&&(Pt.delete(e),Xt.value.delete(e))}static minimizeWindowPanel(e){Pt.has(e)&&Xt.value.set(e,-1)}static openWindowPanel(e){Pt.has(e)&&Xt.value.set(e,1)}}const uu=["src"],hu={key:1,class:"paneltitle"},du={class:"dragPanelBar"},fu={class:"dragPanelContent"},pu={class:"drag-pointer-group"};var eo=Ze({__name:"XWindow",props:{top:{type:[String,Number],default:0},left:{type:[String,Number],default:0},nWidth:{type:[String,Number],default:"300px"},nHeight:{type:[String,Number],default:"400px"},icon:{type:String,default:"img/logo.png"},title:{type:String,default:""},titleHeight:{type:[String,Number],default:"40px"},hasMin:{type:Boolean,default:!0},hasMax:{type:Boolean,default:!1},hasClose:{type:Boolean,default:!0},isDark:{type:Boolean,default:!1},pid:{type:String,default:""},tag:{type:[String,Array,Object,Number],default:""}},emits:["close","open","loaded","minimize"],setup(t,{expose:e,emit:n}){const r=ti(),o=t,i=n,s=ne(),a=ne(),c=vt(()=>o.isDark),u=ne({x:0,y:0}),m=250,b=100,E=ne({width:0,height:0}),R=A=>{s.value&&(s.value.style.left=`${A.x}px`,s.value.style.top=`${A.y}px`)};et(()=>u.value,A=>{R(A)});const P=A=>{s.value&&(s.value.style.width=`${A.width}px`,s.value.style.height=`${A.height}px`)};et(()=>E.value,A=>{P(A)});const d={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(d.refs).forEach(([A,U])=>{U.value&&U.value.addEventListener("mousedown",H=>{d.mouseDown(H,A)})})},mouseDown:(A,U)=>{A.button==0&&(A.preventDefault(),d.startingEdges={left:u.value.x,top:u.value.y,right:u.value.x+E.value.width,bottom:u.value.y+E.value.height},d.newEdges={...d.startingEdges},d.clickStart={x:A.clientX,y:A.clientY},d.eventListenerController=new AbortController,document.addEventListener("mousemove",H=>{d.mouseMove(H,U)},{signal:d.eventListenerController.signal}),document.addEventListener("mouseup",H=>{d.mouseUp(H,U)},{signal:d.eventListenerController.signal}))},mouseMove:(A,U)=>{if(d.startingEdges!=null&&d.newEdges!=null&&d.clickStart!=null&&d.refs[U].value){if(A.preventDefault(),console.log("mouseMove",U),U.toLowerCase().includes("north")){d.newEdges.top=Math.max(d.startingEdges.top+A.clientY-d.clickStart.y,0);const H=d.newEdges.bottom-d.newEdges.top-b;H<0&&(d.newEdges.top+=H)}else U.toLowerCase().includes("south")&&(d.newEdges.bottom=Math.min(d.startingEdges.bottom+A.clientY-d.clickStart.y,document.body.clientHeight));if(U.toLowerCase().includes("west")){d.newEdges.left=Math.max(d.startingEdges.left+A.clientX-d.clickStart.x,0);const H=d.newEdges.right-d.newEdges.left-m;H<0&&(d.newEdges.left+=H)}else U.toLowerCase().includes("east")&&(d.newEdges.right=Math.min(d.startingEdges.right+A.clientX-d.clickStart.x,document.body.clientWidth));d.update()}},update:()=>{d.newEdges==null||d.startingEdges==null||(u.value={x:Math.max(d.newEdges.left,0),y:Math.max(d.newEdges.top,0)},E.value={width:Math.min(Math.max(d.newEdges.right-d.newEdges.left,m),document.body.clientWidth),height:Math.min(Math.max(d.newEdges.bottom-d.newEdges.top,b),document.body.clientHeight)})},mouseUp:(A,U)=>{A.button!=0||d.startingEdges==null||(console.log("mouseUp",U),A.preventDefault(),d.startingEdges=null,d.newEdges=null,d.clickStart=null,d.eventListenerController&&(d.eventListenerController.abort(),d.eventListenerController=null))},refs:{northWest:ne(null),north:ne(null),northEast:ne(null),west:ne(null),east:ne(null),southWest:ne(null),south:ne(null),southEast:ne(null)}},h={startingMouse:null,startingPosition:null,mouseDown:A=>{A.button==0&&(A.preventDefault(),console.log("mouseDown"),h.startingMouse={x:A.clientX,y:A.clientY},h.startingPosition=u.value,document.addEventListener("mousemove",h.mouseMove),document.addEventListener("mouseup",h.mouseUp))},mouseMove:A=>{!h.startingMouse||!h.startingPosition||(A.preventDefault(),u.value={x:Math.min(Math.max(h.startingPosition.x+A.clientX-h.startingMouse.x,0),document.body.clientWidth-E.value.width),y:Math.min(Math.max(h.startingPosition.y+A.clientY-h.startingMouse.y,0),document.body.clientHeight-E.value.height)})},mouseUp:A=>{A.button!=0||!h.startingMouse||!h.startingPosition||(A.preventDefault(),h.startingMouse=null,h.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",h.mouseMove),document.removeEventListener("mouseup",h.mouseUp))}};function w(A){return{id:r,icon:o.icon,title:o.title,pid:o.pid,data:A??o.tag}}const p=vt(()=>Xt.value.get(r)!==-1),f=ne(!1),y=ne(!0);function M(){i("minimize",w()),Gt.minimizeWindowPanel(r)}function D(){f.value=!f.value}function z(){i("close",w(!1)),Gt.removeWindowPanel(r),y.value=!1}const k=vt(()=>f.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),x={id:r,isShow:p,close:z,open:function(){i("open",w(!0)),y.value=!0},showHidePanel:M};function B(A){if(pr(A))return A;{const U=Number(A);if(U==U)return U;if(A.endsWith("px")){const H=A.substring(0,A.length-2);return Number(H)}if(A.endsWith("%")){const H=A.substring(0,A.length-1);return Number(H)/100*document.body.clientWidth}return 300}}return e(x),er(()=>{(function(){let A=90;if(o.hasMin||(A-=30),o.hasMax||(A-=30),o.hasClose||(A-=30),ce.setCssVar("--right-bar-width",A+"px",a.value),!a.value)return;const U=pr(o.titleHeight)?o.titleHeight+"px":o.titleHeight;a.value.style.height=U,a.value.style.lineHeight=U})(),function(){const A=w(x);Gt.addWindowPanel(A),i("loaded",A)}(),u.value.x=B(o.left),u.value.y=B(o.top),R(u.value),E.value={width:B(o.nWidth),height:B(o.nHeight)},P(E.value),d.mount()}),Ea(()=>{Gt.removeWindowPanel(r)}),(A,U)=>(V(),ue(Wo,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:Ne(()=>[y.value?Uo((V(),Te("div",{key:0,ref_key:"dragPanelRef",ref:s,class:nt(["dragWindowPanel",{maxPanel:f.value,dragWindowPanel_dark:c.value}])},[ie("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:U[0]||(U[0]=(...H)=>h.mouseDown&&h.mouseDown(...H))},[me(A.$slots,"title",{},()=>[o.icon?(V(),Te("img",{key:0,src:o.icon,width:"24",height:"24"},null,8,uu)):pe("v-if",!0),o.title?(V(),Te("span",hu,nr(o.title),1)):pe("v-if",!0)]),ie("div",du,[t.hasMin?(V(),ue(rr(ar),{key:0,icon:"ant-design:minus-outlined",onClick:M})):pe("v-if",!0),t.hasMax?(V(),ue(rr(ar),{key:1,icon:k.value,onClick:D},null,8,["icon"])):pe("v-if",!0),t.hasClose?(V(),ue(rr(ar),{key:2,icon:"ant-design:close-outlined",onClick:z})):pe("v-if",!0)])],544),ie("div",fu,[me(A.$slots,"default")]),ie("div",pu,[ie("div",{class:"cursor-nw-resize",ref:d.refs.northWest},null,512),ie("div",{class:"cursor-n-resize",ref:d.refs.north},null,512),ie("div",{class:"cursor-ne-resize",ref:d.refs.northEast},null,512),ie("div",{class:"cursor-w-resize",ref:d.refs.west},null,512),U[1]||(U[1]=ie("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),ie("div",{class:"cursor-e-resize",ref:d.refs.east},null,512),ie("div",{class:"cursor-sw-resize",ref:d.refs.southWest},null,512),ie("div",{class:"cursor-s-resize",ref:d.refs.south},null,512),ie("div",{class:"cursor-se-resize",ref:d.refs.southEast},null,512)])],2)),[[Fo,p.value]]):pe("v-if",!0)]),_:3}))}});function gu(t){const e=new ir(new Ve);return e.serialize(t),e.stream.toString()}function mu(t){return t==null||t===""?t:new sr(new Ve(t)).deserialize()}eo.__scopeId="data-v-39ea9741",eo.__file="src/controls/xwindow/XWindow.vue";class mo{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new mo;textEncoder=new TextEncoder;textDecoder=new TextDecoder;constructor(){}encodeResponse(e,n={}){var r=new Ve,o=new ir(r,this.simple,this.utc),i=n;this.simple;var s=0;for(var a in i)s++;s>0&&(r.writeByte(72),o.serialize(i),o.reset()),e instanceof Error?(r.writeByte(69),o.serialize(this.debug&&e.stack?e.stack:e.message)):(r.writeByte(82),o.serialize(e)),r.writeByte(122);const c=r.takeBytes();return this.textDecoder.decode(c)}decodeRequest(e,n={}){const r=this.textEncoder.encode(e);if(r.length===0)return["~",[]];var o=new Ve(r),i=new sr(o,!1);i.longType=this.longType,i.dictType=this.dictType;var s=o.readByte();if(console.log("tag",s),s===72){var a=i.deserialize(this.nullType);for(var c in a)n[c]=a[c];i.reset(),s=o.readByte()}switch(s){case 67:return[i.deserialize(String),this.decodeArguments(i)];case 122:return["~",[]];default:throw new Error(`Invalid request:\r
|
|
13
|
+
`+o.toString())}}decodeArguments(e){var n=e.stream;let r=[];if(n.readByte()===97){e.reset();var o=Ta.readCount(n);const s=new Array(o).fill(this.nullType);r=new Array(o),e.addReference(r);for(var i=0;i<o;++i)r[i]=e.deserialize(s[i]);n.readByte()}return r}encodeRequest(e,n,r={}){var o=new Ve,i=new ir(o,this.simple,this.utc),s=r;this.simple&&(s.simple=!0);var a=0;for(var c in s)a++;a>0&&(o.writeByte(72),i.serialize(s),i.reset()),o.writeByte(67),i.serialize(e),n.length>0&&(i.reset(),i.serialize(n)),o.writeByte(122);const u=o.takeBytes();return this.textDecoder.decode(u)}decodeResponse(e,n={}){const r=this.textEncoder.encode(e);var o=new Ve(r),i=new sr(o,!1);i.longType=this.longType,i.dictType=this.dictType;var s=o.readByte();if(s===72){var a=i.deserialize();for(var c in a)n[c]=a[c];i.reset(),s=o.readByte()}switch(s){case 82:return n.simple&&(i.simple=!0),console.log(s,"9999999999"),i.deserialize();case 69:throw new Error(i.deserialize(String));case 122:return;default:throw new Error(`Invalid response:\r
|
|
14
|
+
`+o.toString())}}}const Fn=new Map,to=new Map;let On;const vu={getDefaultClient(){if(On||(On=new Ut(SysConfig.DefaultHproseAPI)),!On)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return On},registerHprose(t,e){const n=to.get(t);if(!n){const r=new Ut(e);Fn.set(t,r)}return n},getHprose:t=>to?.get(t),getProxyHprose:t=>Fn.get(t),unregisterHprose(t){Fn.get(t)&&(to.delete(t),Fn.delete(t))}},no=5e3,Cs=36e5,pt={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},ro="access_token",yu=F.Config.ServiceURL.LoginAuthURL;function oo(){const t=Wi();t&&De(pt.RefreshToken,yu,{refreshToken:t}).then(e=>{io(e.data)})}function Es(){const t=Tt.getJsonObject(ro);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=no?oo():setTimeout(oo,n-no))}function io(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=Cs?(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let r=ct();r?(r.token=t.accessToken.tokenContent,r.expire=t.accessToken.expires,r.refresh=t.refreshToken.tokenContent):r={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},Tt.set(ro,r,n/1e3),Es()}else Tt.remove(ro)}const Hn="Wm314243",jn=F.Config.ServiceURL.LoginAuthURL;async function wu(t){const e={username:t.username,pwd:Ot.encryptToString(t.pwd,Hn)},n=(await De(pt.Login,jn,e))?.data;return n&&(io(n.doubletoken),Tn(!1)),n}function bu(t){const e={oldpwd:Ot.encryptToString(t.oldpwd,Hn),newpwd:Ot.encryptToString(t.newpwd,Hn)};return De(pt.ChangeMyPwd,jn,e)}function _u(t){return Ot.encryptToString(t,Hn)}function Su(){const t=ct();t&&(Fi(pt.Logout,jn,{token:t.token,reftoken:t.refresh}),Ur())}function Cu(t){return De(pt.CheckToken,jn,{token:t})}const so="ROLE_SYSTEM_RIGHT",ao=new un("",sessionStorage);function ks(){return ao.get(so)}function co(t){ao.set(so,t)}function xs(){ao.remove(so)}function zt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(zt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function Is(t,e,n="name"){t&&e&&t.forEach(r=>{const o=e.find(i=>i[n]===r[n]);o&&(r.children?o.children&&Is(r.children,o.children,n):(!o.children||o.children.length===0)&&o.selected&&(r.selected=o.selected))})}function Ts(t,e,n="name"){t&&e&&t.forEach(r=>{const o=e.find(i=>i[n]===r[n]);o&&(r.children?o.children&&Ts(r.children,o.children,n):(!o.children||o.children.length===0)&&o.selected&&(r.selected=o.selected))})}function Vt(t,e,n,r="name"){const o=t[n],i=e[n];o?i&&Ts(o,i,r):i&&(t[n]=i)}function Rs(t){if(t&&t.length>0){const e=t.length;let n,r=!1;if(e>0){r=rt(t[0]);const o=r?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],a=r?s:JSON.parse(s);Vt(o,a,"routes","name"),Vt(o,a,"widgetMenu","name"),Vt(o,a,"widgets","id"),Vt(o,a,"functions","id")}n=o}return n&&(zt(n.routes),zt(n.widgetMenu),zt(n.widgets),zt(n.functions)),n}}const lo=[],uo=[],ho=[];function Kt(){return ks()}async function Eu(t,e=!1){xs();const n=pt.GetSystemRights,r=F.Config.ServiceURL.LoginAuthURL,o=await De(n,r,{systemid:t});if(!o||!o.data)return void F.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=o.data;if(i&&i.length>0){if(e){const s=JSON.parse(i[0]);return co(s),s}{const s=Rs(i);return co(s),s}}}function Ps(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(r=>{const o=t.children?.find(i=>i.path===r.path);if(o){const i=Ps(o,r);i&&n.children?.push(i)}})),n}function ku(t,e=2){if(e===0)return t;const n=Kt();return n&&n.routes?(ho.length>0||t.forEach(r=>{const o=n.routes?.find(i=>i.name===r.name);if(o){const i=Ps(r,o);i&&ho.push(i)}}),ho):void 0}function zs(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(r=>{const o=t.children?.find(i=>i.name===r.name);if(o){const i=zs(o,r);i&&n.children?.push(i)}})),n}function xu(t,e=2){if(e===0)return t;const n=Kt();return n&&n.widgetMenu?(uo.length>0||t.forEach(r=>{const o=n.widgetMenu?.find(i=>i.name===r.name);if(o){const i=zs(r,o);i&&uo.push(i)}}),uo):void 0}function Iu(t,e=2){if(e===0)return t;const n=Kt();return n&&n.widgets?(lo.length>0||t?.forEach(r=>{n.widgets?.find(o=>o.id===r.id)&&lo.push(r)}),lo):void 0}function Tu(t,e=2){if(e===0)return t;const n=Kt();return n?n.functions:void 0}export{Vc as BigFileDownload,Wt as Download,at as EnumColor,Ki as FileUpload,Vl as GetSignalRClient,F as Global,vu as GlobalHprose,st as GlobalMitt,gc as GzipTool,ce as H5Tool,Yt as HproseClient,mo as HproseRPCCodec,dc as HttpDownload,Pi as JsonDownload,Un as LayoutContainer,be as LayoutContainerEnum,_s as LayoutManager,lt as LockState,Xt as MinWindowMap,Kc as ObjToUrlParams,cr as Pane,Ut as ProxyClient,Zr as RouterTransition,Ss as RouterTransitionAnimate,Mr as SaveAs,fc as SaveToSelectedFile,Pa as Splitpanes,un as Storage,At as StringUtils,Ql as StyleBlack,tu as StyleGrayblue,eu as StyleMetal,Zl as StyleWhite,qt as SuspenseWithError,ye as SysEvents,no as TOKEN_REFRESH_TIME,Cs as TOKEN_VALID_TIMESPAN,pt as USER_TOKEN_API,Wn as VWindow,Sl as WaterMark,ws as WindowResizeEvent,nu as WindowType,Pt as WindowsMap,eo as XWindow,Gt as XWindowManager,Ot as XXTEA,pc as ZipTool,kc as calculateBestTextColor,bu as changeMyPWD,Es as checkDoRefreshToken,Cu as checkToken,Ur as clearLocalToken,xs as clearRight,Sc as colorIsDark,Nc as createFileUpload,Cc as darken,ts as deepMerge,Mi as delay,mu as deserialize,oo as doRefreshToken,Tn as doSetLock,ns as exportSystemRights,Ri as findStringPrefix,Ic as get,hc as getCommonFileBase,Kt as getCurrentSystemRight,Rc as getData,Pc as getDownload,_u as getEncryptPWD,Ii as getFileBase,En as getFileExtension,Tu as getFunctions,mc as getHexColor,ct as getLocalToken,Oc as getLockState,yc as getLongHexColor,Pr as getPathBase,Yi as getProxyClient,vc as getRGBColor,bc as getRGBColorFromHSLA,Wi as getRefreshToken,ks as getRight,ku as getRoutes,Eu as getSystemRoleRight,Iu as getWidgetConfig,xu as getWidgetMenus,zt as handleNodes,Dr as hexToRGB,Uc as init,Fc as initDefaultProxyClient,Ce as is,cn as isArray,Ua as isAsyncFunction,Oa as isBoolean,Ha as isClient,Wa as isDate,Yo as isDef,Jo as isElement,Ga as isEmpty,wc as isEnumColor,Va as isError,an as isFunction,kn as isHexColor,Xa as isImageDom,Qa as isMap,fr as isNull,Ba as isNullAndUnDef,Na as isNullOrUnDef,pr as isNumber,rt as isObjectX,Fa as isPromise,qa as isServer,bt as isString,Zo as isStringLikeJson,ei as isStringLikeKml,Ja as isSymbol,dr as isUnDef,Qo as isValidURL,Ya as isWeakMap,Ka as isWeakSet,ja as isWindow,Wc as jquery,Ec as lighten,wu as login,Su as logout,Rs as mergeFilterRoleSysRight,Ti as mergeNames,Is as mergeNodes,Vt as mergeNodesAll,ec as newGuid,Hc as onLockListener,It as parseLocalPath,Tc as post,lc as replaceFileExtension,De as requestGet,Ui as requestPost,Fi as requestPostBody,_c as rgbToHex,gu as serialize,io as setLocalToken,co as setRight,xc as sleep,Za as storage,Tt as storageHelper,uc as toLowerCaseExtension,jc as unLockListener,ti as uuid,tl as verifiyNumberInteger,ul as verifyAccount,ol as verifyAndSpace,bl as verifyCarNum,nl as verifyCnAndSpace,gl as verifyEmail,rl as verifyEnAndSpace,vl as verifyFullName,pl as verifyIPAddress,ml as verifyIdCard,al as verifyNumberCnUppercase,il as verifyNumberComma,Vr as verifyNumberIntegerAndFloat,Zc as verifyNumberPercentage,el as verifyNumberPercentageFloat,hl as verifyPassword,dl as verifyPasswordPowerful,fl as verifyPasswordStrength,cl as verifyPhone,yl as verifyPostalCode,ll as verifyTelPhone,sl as verifyTextColor,wl as verifyUrl,Jc as writeIconifyList,Qc as writeSysRoleRight};
|