xframelib 0.8.1 → 0.8.3
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 +4 -2
- package/dist/hprose/HproseIO.d.ts +53 -0
- package/dist/hprose/index.d.ts +3 -2
- package/dist/index.cjs +9 -7
- package/dist/index.css +43 -43
- package/dist/index.js +9 -7
- package/dist/utils/AxiosHelper.d.ts +2 -1
- package/dist/utils/FileDownload.d.ts +3 -2
- package/package.json +12 -7
- package/dist/public/WSynchro.js +0 -67
package/dist/index.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import{h as _n,openBlock as X,createElementBlock as gt,normalizeStyle as vt,renderSlot as ct,defineComponent as Rt,ref as K,withModifiers as or,getCurrentInstance as zs,computed as Xt,watch as Pt,onMounted as Sn,onBeforeUnmount as As,nextTick as rr,resolveComponent as Se,createBlock as nt,Transition as ir,withCtx as Ct,withDirectives as sr,createElementVNode as J,Fragment as zt,createTextVNode as Cn,toDisplayString as En,createCommentVNode as st,vShow as ar,markRaw as Ls,onErrorCaptured as Ds,Suspense as $s,createVNode as Ce,KeepAlive as cr,resolveDynamicComponent as Et,reactive as Ns,toRefs as Bs,renderList as Vt,normalizeClass as At,TransitionGroup as js,onUnmounted as Os,unref as xn}from"vue";import Ws from"axios";import Us from"qs";import{Client as Fs,ClientContext as kn}from"@hprose/rpc-core";import{ByteStream as Ee,Writer as Hs,Reader as qs}from"@hprose/io";import{HttpTransport as Xs}from"@hprose/rpc-html5";var Vs={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((e,t)=>(e[t.id]=t)&&e,{})}},methods:{updatePaneComponents(){this.panes.forEach(e=>{e.update&&e.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[e.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(e,t){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=t},onMouseMove(e){this.touch.mouseDown&&(e.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(e)),this.$emit("resize",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(e,t){"ontouchstart"in window&&(e.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===t?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(e,t),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=t,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[t])},onSplitterDblClick(e,t){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===t?o.max:o.min,r!==t&&(n+=o.min),o)),this.panes[t].size-=n,this.$emit("pane-maximize",this.panes[t])},onPaneClick(e,t){this.$emit("pane-click",this.indexedPanes[t])},getCurrentMouseDrag(e){const t=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&e.touches?e.touches[0]:e;return{x:n-t.left,y:o-t.top}},getCurrentDragPercentage(e){e=e[this.horizontal?"y":"x"];const t=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(e=t-e),100*e/t},calculatePanesSize(e){const t=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(t),nextPanesSize:this.sumNextPanesSize(t),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(e),r),o);let s=[t,t+1],a=this.panes[s[0]]||null,l=this.panes[s[1]]||null;const h=a.max<100&&i>=a.max+n.prevPanesSize,w=l.max<100&&i<=100-(l.max+this.sumNextPanesSize(t+1));if(h||w)h?(a.size=a.max,l.size=Math.max(100-a.max-n.prevPanesSize-n.nextPanesSize,0)):(a.size=Math.max(100-l.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),l.size=l.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,i);if(!_)return;({sums:n,panesToResize:s}=_),a=this.panes[s[0]]||null,l=this.panes[s[1]]||null}a!==null&&(a.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,a.min),a.max)),l!==null&&(l.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,l.min),l.max))}},doPushOtherPanes(e,t){const n=this.touch.activeSplitter,o=[n,n+1];return t<e.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,e.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),e.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(e.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,e.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-e.prevReachedMinPanes-this.panes[0].min-e.prevPanesSize-e.nextPanesSize,null):t>100-e.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,e.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),e.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(e.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,i)=>{i<this.panesCount-1&&i>=n+1&&(r.size=r.min,e.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-e.prevPanesSize-e.nextReachedMinPanes-this.panes[this.panesCount-1].min-e.nextPanesSize,null):{sums:e,panesToResize:o}},sumPrevPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o<e?n.size:0),0)},sumNextPanesSize(e){return this.panes.reduce((t,n,o)=>t+(o>e+1?n.size:0),0)},findPrevExpandedPane(e){return[...this.panes].reverse().find(t=>t.index<e&&t.size>t.min)||{}},findNextExpandedPane(e){return this.panes.find(t=>t.index>e+1&&t.size>t.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(e=>{const t=e.classList.contains("splitpanes__pane"),n=e.classList.contains("splitpanes__splitter");if(!t&&!n)return e.parentNode.removeChild(e),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(e,t,n=!1){const o=e-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(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)),t.parentNode.insertBefore(r,t)},removeSplitter(e){e.onmousedown=void 0,e.onclick=void 0,e.ondblclick=void 0,e.parentNode.removeChild(e)},redoSplitters(){const e=Array.from(this.container.children);e.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let t=0;e.forEach(n=>{n.className.includes("splitpanes__pane")&&(!t&&this.firstSplitter?this.addSplitter(t,n,!0):t&&this.addSplitter(t,n),t++)})},requestUpdate({target:e,...t}){const n=this.indexedPanes[e._.uid];Object.entries(t).forEach(([o,r])=>n[o]=r)},onPaneAdd(e){let t=-1;Array.from(e.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&t++,r===e.$el));const n=parseFloat(e.minSize),o=parseFloat(e.maxSize);this.panes.splice(t,0,{id:e._.uid,index:t,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:e.size===null?null:parseFloat(e.size),givenSize:e.size,update:e.update}),this.panes.forEach((r,i)=>r.index=i),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[t]}),this.$emit("pane-add",{index:t,panes:this.panes.map(r=>({min:r.min,max:r.max,size:r.size}))})})},onPaneRemove(e){const t=this.panes.findIndex(o=>o.id===e._.uid),n=this.panes.splice(t,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:t}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(e={}){e.addedPane||e.removedPane?this.panes.some(t=>t.givenSize!==null||t.min||t.max<100)?this.equalizeAfterAddOrRemove(e):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size})))},equalize(){const e=100/this.panesCount;let t=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(e,r.max),r.min),t-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),t>.1&&this.readjustSizes(t,n,o)},initialPanesSizing(){let e=100;const t=[],n=[];let o=0;this.panes.forEach(i=>{e-=i.size,i.size!==null&&o++,i.size>=i.max&&t.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;e>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(e/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(e,t,n))},equalizeAfterAddOrRemove({addedPane:e}={}){let t=100/this.panesCount,n=0;const o=[],r=[];e&&e.givenSize!==null&&(t=(100-e.givenSize)/(this.panesCount-1)),this.panes.forEach(i=>{n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(i=>{e&&e.givenSize!==null&&e.id===i.id||(i.size=Math.max(Math.min(t,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(e,t,n){let o;o=e>0?e/(this.panesCount-t.length):e/(this.panesCount-n.length),this.panes.forEach(r=>{if(e>0&&!t.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}else if(!n.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;e-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(e)>.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(e){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((t,n)=>{t.ondblclick=e?o=>this.onSplitterDblClick(o,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 _n("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},In={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(e){this.style=e}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(e){this.requestUpdate({target:this,size:e})},minSizeNumber(e){this.requestUpdate({target:this,min:e})},maxSizeNumber(e){this.requestUpdate({target:this,max:e})}}};function Tn(e){return window.TouchEvent&&e instanceof TouchEvent}In.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:vt(e.style)},[ct(e.$slots,"default")],4)},In.__file="src/controls/splitpanes/pane.vue";class pt{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Tn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Do(this.clientX,this.clientY)}static bindDown(t,n,o,r=!1){const i=a=>{n(new pt(a))},s=a=>{a.touches.length===1&&n(new pt(a)),a.touches.length>1&&o&&o(new pt(a))};return t.addEventListener("mousedown",i,r),t.addEventListener("touchstart",s,r),()=>{t.removeEventListener("mousedown",i,r),t.removeEventListener("touchstart",s,r)}}static bindMove(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===1&&n(new pt(s))};return t.addEventListener("mousemove",r,o),t.addEventListener("touchmove",i,o),()=>{t.removeEventListener("mousemove",r,o),t.removeEventListener("touchmove",i,o)}}static bindUp(t,n,o=!1){const r=s=>{n(new pt(s))},i=s=>{s.touches.length===0&&n(new pt(s))};return t.addEventListener("mouseup",r,o),t.addEventListener("touchend",i,o),()=>{t.removeEventListener("mouseup",r,o),t.removeEventListener("touchend",i,o)}}originalEvent({mouse:t,touch:n}){Tn(this.e)?n&&n(this.e):t&&t(this.e)}}class Do{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Do(this.x,this.y)}}class Gs{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,o={}){this.handle=t,this.container=n,this.options=o,t&&(this.unbindDown=pt.bindDown(t,this.mousedown),t.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=t=>{if(t.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=t.clientX-n,this.offsetY=t.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};mousemove=t=>{this.container&&(this.container.style.left=t.clientX-this.offsetX+"px",this.container.style.top=t.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()};mouseup=t=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0}}class Ks{_group;onChange;zIndex;constructor(t,n){this._group=t,this.onChange=n,this.a(o=>o.push(this))}set group(t){this._group=t;const n=ke(this._group),o=ke(t);n.splice(n.indexOf(this),1),o.push(this),ur()}get group(){return this._group}unregister(){this.a(t=>t.splice(t.indexOf(this),1))}raise(){this.a(t=>{t.splice(t.indexOf(this),1),t.push(this)})}a(t){t(ke(this._group)),ur()}}const xe=new Map;function ke(e){return xe.has(e)||xe.set(e,[]),xe.get(e)}function lr(e,t){return e>t?-lr(t,e):e<0&&t>=0?1:e-t}function ur(){let e=0;for(const t of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(xe).sort(lr))for(const n of ke(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function Rn(e){if(e){const{width:t,height:n}=e.style;e.style.width="auto",e.style.height="auto";const o=Ie(e);return e.style.width=t,e.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Ie(e){const t=e.getBoundingClientRect(),n=t.width,o=t.height,r=t.top,i=t.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Js{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=hr.map(l=>new l(t,this));const{width:o,height:r}=Rn(t),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let a=!1;(o<n.minWidth||o>i)&&(t.style.width=`${dr(o,n.minWidth,i)}px`,a=!0),(r<n.minHeight||r>s)&&(t.style.height=`${dr(r,n.minHeight,s)}px`,a=!0),a&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const hr=[];class Mt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=pt.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=t=>{t.preventDefault(),t.stopPropagation();const{left:n,top:o,width:r,height:i}=Ie(this.container);this.x0=t.clientX,this.y0=t.clientY,this.left0=n,this.top0=o,this.width0=r,this.height0=i,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=pt.bindMove(document,this.mousemove),this.unbindUp=pt.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:t,top:n,right:o,bottom:r}=Ie(this.container),i=this.helper.options,s=i.maxWidth||window.innerWidth,a=i.maxHeight||window.innerHeight;this.minLeft=Math.max(o-s,0),this.maxLeft=o-i.minWidth,this.minRight=t+i.minWidth,this.maxRight=Math.min(t+s,window.innerWidth),this.minTop=Math.max(r-a,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+a,window.innerHeight)}mousemove=t=>{t.preventDefault(),t.stopPropagation(),this.setPosition(t),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()};fixPosition(){const{width:t,height:n,left:o,top:r,right:i,bottom:s}=Ie(this.container),a=this.helper.options;a&&(o<this.minLeft?(this.container.style.width=t+o-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):o>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-o+"px"),r<this.minTop?(this.container.style.height=n+r-this.minTop+"px",this.container.style.top=`${this.minTop}px`):r>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-r+"px"))}mouseup=t=>{t.preventDefault(),t.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0};createHandleElement(){const t=document.createElement("div"),n=t.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(t),t}}function dr(e,t,n){return e<t?t:e>n?n:e}hr.push(class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.right=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.right=`${this.handleSize}px`,e.left=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.bottom=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.height=this.height0+e.clientY-this.y0+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.top=`${this.handleSize}px`,e.cursor="ew-resize"}},class extends Mt{setPosition(e){this.container.style.left=this.left0+e.clientX-this.x0+"px",this.container.style.width=this.width0-(e.clientX-this.x0)+"px",this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=-this.handleSize+"px",e.top=-this.handleSize+"px",e.width=2*this.handleSize+"px",e.height=2*this.handleSize+"px",e.cursor="nwse-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px"}applyStyle(e){e.left=`${this.handleSize}px`,e.right=`${this.handleSize}px`,e.height=2*this.handleSize+"px",e.top=-this.handleSize+"px",e.cursor="ns-resize"}},class extends Mt{setPosition(e){this.container.style.top=this.top0+e.clientY-this.y0+"px",this.container.style.height=this.height0-(e.clientY-this.y0)+"px",this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=-this.handleSize+"px",e.height=2*this.handleSize+"px",e.width=2*this.handleSize+"px",e.cursor="nesw-resize"}},class extends Mt{setPosition(e){this.container.style.width=this.width0+e.clientX-this.x0+"px"}applyStyle(e){e.right=-this.handleSize+"px",e.top=`${this.handleSize}px`,e.bottom=`${this.handleSize}px`,e.width=2*this.handleSize+"px",e.cursor="ew-resize"}});var Te=Rt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=K(!1),n=K(!1);return{hover:t,active:n,style:function(){let o=e.windowStyle.button;return t.value&&(o={...o,...this.windowStyle.buttonHover}),n.value&&(o={...o,...this.windowStyle.buttonActive}),o},mouseup:function(o){this.active&&this.$emit("click")},mousedown:function(o){o.preventDefault(),n.value=!0;const r=pt.bindUp(document,()=>{n.value=!1,r()})}}}});const Ys=["disabled"];Te.render=function(e,t,n,o,r,i){return X(),gt("div",{class:"btn",style:vt(e.style()),onMouseenter:t[0]||(t[0]=s=>e.hover=!0),onMouseleave:t[1]||(t[1]=s=>e.hover=!1),onMousedown:t[2]||(t[2]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=or((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onMouseup:t[4]||(t[4]=(...s)=>e.mouseup&&e.mouseup(...s)),onTouchend:t[5]||(t[5]=(...s)=>e.mouseup&&e.mouseup(...s)),disabled:e.disabled},[ct(e.$slots,"default")],44,Ys)},Te.__scopeId="data-v-71662210",Te.__file="src/controls/vuewindow/window/Button.vue";const Zs=Object.prototype.toString;function dt(e,t){return Zs.call(e)===`[object ${t}]`}function Re(e){return dt(e,"Function")}const fr=e=>typeof e<"u",Mn=e=>!fr(e);function Pn(e){return e===null}function Qs(e){return Mn(e)&&Pn(e)}function ta(e){return Mn(e)||Pn(e)}const Lt=e=>e!=null&&e!==null&&dt(e,"Object");function ea(e){return dt(e,"Date")}function zn(e){return dt(e,"Number")}function na(e){return dt(e,"AsyncFunction")}function oa(e){return dt(e,"Promise")&&Lt(e)&&Re(e.then)&&Re(e.catch)}function Me(e){return dt(e,"String")}function ra(e){return e===!0||e===!1||dt(e,"Boolean")}function An(e){return e&&Array.isArray(e)}const ia=()=>typeof window<"u",sa=e=>typeof window<"u"&&dt(e,"Window"),aa=e=>Lt(e)&&!!e.tagName,ca=typeof window>"u";function la(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function ua(e){return e==null||(Me(e)||An(e)?e.length===0:!!Lt(e)&&JSON.stringify(e)==="{}")}function ha(e){return dt(e,"Error")}function da(e){return dt(e,"WeakSet")}function fa(e){return dt(e,"WeakMap")}function pa(e){return dt(e,"Symbol")}function ga(e){return dt(e,"Map")}const ma=e=>/^(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(e);var Gt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Pe(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var pr,gr={exports:{}},va=pr?gr.exports:(pr=1,gr.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(p,u){var v=p[0],y=p[1],d=p[2],f=p[3];y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[0]-680876936|0)<<7|v>>>25)+y|0)&y|~v&d)+u[1]-389564586|0)<<12|f>>>20)+v|0)&v|~f&y)+u[2]+606105819|0)<<17|d>>>15)+f|0)&f|~d&v)+u[3]-1044525330|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[4]-176418897|0)<<7|v>>>25)+y|0)&y|~v&d)+u[5]+1200080426|0)<<12|f>>>20)+v|0)&v|~f&y)+u[6]-1473231341|0)<<17|d>>>15)+f|0)&f|~d&v)+u[7]-45705983|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[8]+1770035416|0)<<7|v>>>25)+y|0)&y|~v&d)+u[9]-1958414417|0)<<12|f>>>20)+v|0)&v|~f&y)+u[10]-42063|0)<<17|d>>>15)+f|0)&f|~d&v)+u[11]-1990404162|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&d|~y&f)+u[12]+1804603682|0)<<7|v>>>25)+y|0)&y|~v&d)+u[13]-40341101|0)<<12|f>>>20)+v|0)&v|~f&y)+u[14]-1502002290|0)<<17|d>>>15)+f|0)&f|~d&v)+u[15]+1236535329|0)<<22|y>>>10)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[1]-165796510|0)<<5|v>>>27)+y|0)&d|y&~d)+u[6]-1069501632|0)<<9|f>>>23)+v|0)&y|v&~y)+u[11]+643717713|0)<<14|d>>>18)+f|0)&v|f&~v)+u[0]-373897302|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[5]-701558691|0)<<5|v>>>27)+y|0)&d|y&~d)+u[10]+38016083|0)<<9|f>>>23)+v|0)&y|v&~y)+u[15]-660478335|0)<<14|d>>>18)+f|0)&v|f&~v)+u[4]-405537848|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[9]+568446438|0)<<5|v>>>27)+y|0)&d|y&~d)+u[14]-1019803690|0)<<9|f>>>23)+v|0)&y|v&~y)+u[3]-187363961|0)<<14|d>>>18)+f|0)&v|f&~v)+u[8]+1163531501|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y&f|d&~f)+u[13]-1444681467|0)<<5|v>>>27)+y|0)&d|y&~d)+u[2]-51403784|0)<<9|f>>>23)+v|0)&y|v&~y)+u[7]+1735328473|0)<<14|d>>>18)+f|0)&v|f&~v)+u[12]-1926607734|0)<<20|y>>>12)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[5]-378558|0)<<4|v>>>28)+y|0)^y^d)+u[8]-2022574463|0)<<11|f>>>21)+v|0)^v^y)+u[11]+1839030562|0)<<16|d>>>16)+f|0)^f^v)+u[14]-35309556|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[1]-1530992060|0)<<4|v>>>28)+y|0)^y^d)+u[4]+1272893353|0)<<11|f>>>21)+v|0)^v^y)+u[7]-155497632|0)<<16|d>>>16)+f|0)^f^v)+u[10]-1094730640|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[13]+681279174|0)<<4|v>>>28)+y|0)^y^d)+u[0]-358537222|0)<<11|f>>>21)+v|0)^v^y)+u[3]-722521979|0)<<16|d>>>16)+f|0)^f^v)+u[6]+76029189|0)<<23|y>>>9)+d|0,y=((y+=((d=((d+=((f=((f+=((v=((v+=(y^d^f)+u[9]-640364487|0)<<4|v>>>28)+y|0)^y^d)+u[12]-421815835|0)<<11|f>>>21)+v|0)^v^y)+u[15]+530742520|0)<<16|d>>>16)+f|0)^f^v)+u[2]-995338651|0)<<23|y>>>9)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[0]-198630844|0)<<6|v>>>26)+y|0)|~d))+u[7]+1126891415|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[14]-1416354905|0)<<15|d>>>17)+f|0)|~v))+u[5]-57434055|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[12]+1700485571|0)<<6|v>>>26)+y|0)|~d))+u[3]-1894986606|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[10]-1051523|0)<<15|d>>>17)+f|0)|~v))+u[1]-2054922799|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[8]+1873313359|0)<<6|v>>>26)+y|0)|~d))+u[15]-30611744|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[6]-1560198380|0)<<15|d>>>17)+f|0)|~v))+u[13]+1309151649|0)<<21|y>>>11)+d|0,y=((y+=((f=((f+=(y^((v=((v+=(d^(y|~f))+u[4]-145523070|0)<<6|v>>>26)+y|0)|~d))+u[11]-1120210379|0)<<10|f>>>22)+v|0)^((d=((d+=(v^(f|~y))+u[2]+718787259|0)<<15|d>>>17)+f|0)|~v))+u[9]-343485551|0)<<21|y>>>11)+d|0,p[0]=v+p[0]|0,p[1]=y+p[1]|0,p[2]=d+p[2]|0,p[3]=f+p[3]|0}function o(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p.charCodeAt(u)+(p.charCodeAt(u+1)<<8)+(p.charCodeAt(u+2)<<16)+(p.charCodeAt(u+3)<<24);return v}function r(p){var u,v=[];for(u=0;u<64;u+=4)v[u>>2]=p[u]+(p[u+1]<<8)+(p[u+2]<<16)+(p[u+3]<<24);return v}function i(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,o(p.substring(u-64,u)));for(v=(p=p.substring(u-64)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p.charCodeAt(u)<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function s(p){var u,v,y,d,f,z,L=p.length,D=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=L;u+=64)n(D,r(p.subarray(u-64,u)));for(v=(p=u-64<L?p.subarray(u-64):new Uint8Array(0)).length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<v;u+=1)y[u>>2]|=p[u]<<(u%4<<3);if(y[u>>2]|=128<<(u%4<<3),u>55)for(n(D,y),u=0;u<16;u+=1)y[u]=0;return d=(d=8*L).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(d[2],16),z=parseInt(d[1],16)||0,y[14]=f,y[15]=z,n(D,y),D}function a(p){var u,v="";for(u=0;u<4;u+=1)v+=t[p>>8*u+4&15]+t[p>>8*u&15];return v}function l(p){var u;for(u=0;u<p.length;u+=1)p[u]=a(p[u]);return p.join("")}function h(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function w(p,u){var v,y=p.length,d=new ArrayBuffer(y),f=new Uint8Array(d);for(v=0;v<y;v+=1)f[v]=p.charCodeAt(v);return u?f:d}function _(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function k(p,u,v){var y=new Uint8Array(p.byteLength+u.byteLength);return y.set(new Uint8Array(p)),y.set(new Uint8Array(u),p.byteLength),v?y:y.buffer}function $(p){var u,v=[],y=p.length;for(u=0;u<y-1;u+=2)v.push(parseInt(p.substr(u,2),16));return String.fromCharCode.apply(String,v)}function I(){this.reset()}return l(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(u,v){return(u=0|u||0)<0?Math.max(u+v,0):Math.min(u,v)}ArrayBuffer.prototype.slice=function(u,v){var y,d,f,z,L=this.byteLength,D=p(u,L),M=L;return v!==e&&(M=p(v,L)),D>M?new ArrayBuffer(0):(y=M-D,d=new ArrayBuffer(y),f=new Uint8Array(d),z=new Uint8Array(this,D,y),f.set(z),d)}}(),I.prototype.append=function(p){return this.appendBinary(h(p)),this},I.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var u,v=this._buff.length;for(u=64;u<=v;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},I.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y.charCodeAt(u)<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(p,u){var v,y,d,f=u;if(p[f>>2]|=128<<(f%4<<3),f>55)for(n(this._hash,p),f=0;f<16;f+=1)p[f]=0;v=(v=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(v[2],16),d=parseInt(v[1],16)||0,p[14]=y,p[15]=d,n(this._hash,p)},I.hash=function(p,u){return I.hashBinary(h(p),u)},I.hashBinary=function(p,u){var v=l(i(p));return u?$(v):v},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(p){var u,v=k(this._buff.buffer,p,!0),y=v.length;for(this._length+=p.byteLength,u=64;u<=y;u+=64)n(this._hash,r(v.subarray(u-64,u)));return this._buff=u-64<y?new Uint8Array(v.buffer.slice(u-64)):new Uint8Array(0),this},I.ArrayBuffer.prototype.end=function(p){var u,v,y=this._buff,d=y.length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<d;u+=1)f[u>>2]|=y[u]<<(u%4<<3);return this._finish(f,d),v=l(this._hash),p&&(v=$(v)),this.reset(),v},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var p=I.prototype.getState.call(this);return p.buff=_(p.buff),p},I.ArrayBuffer.prototype.setState=function(p){return p.buff=w(p.buff,!0),I.prototype.setState.call(this,p)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(p,u){var v=l(s(new Uint8Array(p)));return u?$(v):v},I}()),Ln=Pe(va);const Dn=[];class ft{static addHandler(t,n,o){t.addEventListener?t.addEventListener(n,o,!1):t.attachEvent?t.attachEvent("on"+n,o):t["on"+n]=o}static removeHandler(t,n,o){t.removeEventListener?t.removeEventListener(n,o,!1):t.detachEvent?t.detachEvent("on"+n,o):delete t["on"+n]}static windowResizeHandler(t){ft.addHandler(window,"resize",t)}static offWindowResizeHandler(t){ft.removeHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,n){if(n){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=t;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(t=window.document.documentElement){let n=t;var o=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(o)o.call(n);else if(typeof window.ActiveXObject<"u"){var r=new window.ActiveXObject("WScript.Shell");r!==null&&r.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var n=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(n)n.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!!ft.fullScreenElement()}static onFullScreenChanged(t){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 o=ft.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ft.isFullScreen();t(o)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(Dn.indexOf(n)!==-1)return;Dn.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ft.stringifyCircularHandler);return Dn.length=0,n}static jsonParse(t){const n=ft.jsonStringify(t);if(n.length>1)return JSON.parse(n)}static getObjectURL(t){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(t):window.URL!=null?n=window.URL.createObjectURL(t):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(t)),n}static getFileShortMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=new Ln.ArrayBuffer,l=new FileReader;l.onload=function(h){a.append(h.target?.result);const w=a.end();n({isOK:!0,data:w})},l.onerror=function(){const h="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(h),n({isOK:!1,data:h})},function(){const h=0+s>=i.size?i.size:0+s;l.readAsArrayBuffer(r.call(i,0,h))}()}static getFileMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,a=Math.ceil(i.size/s);let l=0;const h=new Ln.ArrayBuffer,w=new FileReader;function _(){const k=l*s,$=k+s>=i.size?i.size:k+s;w.readAsArrayBuffer(r.call(i,k,$))}w.onload=function(k){if(h.append(k.target?.result),l++,l<a)_();else{const $=h.end();n({isOK:!0,data:$})}},w.onerror=function(){const k=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(k),n({isOK:!1,data:k})},_()}static MD5(t,n=!1){return Ln.hash(t,n)}static copyTextByCommand(t){return new Promise((n,o)=>{const r=document.createElement("input");r.value=t,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=t=>navigator.clipboard?navigator.clipboard.writeText(t).then(function(){return!0},function(n){return!1}):ft.copyTextByCommand(t);static copyElementTextByCommand(t){const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();o.rangeCount>0&&o.removeAllRanges(),o.addRange(n);try{return document.execCommand("copy"),o.removeRange(n),!0}catch(r){return o.removeRange(n),console.error("Command\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1}}static copyElementText(t){if(!navigator.clipboard)return ft.copyElementTextByCommand(t);const n=document.createRange();n.selectNode(document.getElementById(t));const o=window.getSelection();return o.rangeCount>0&&o.removeAllRanges(),o.addRange(n),navigator.clipboard.writeText(o).then(function(){return o.removeRange(n),!0},function(r){return o.removeRange(n),console.error("Clipboard\u590D\u5236\u6587\u672C\u9519\u8BEF",r),!1})}static setGrayMode(t){ft.toggleClass(t,"grayMode",document.documentElement)}static toggleClass(t,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=t?`${i} ${n} `:i}static setCssVar(t,n,o=document.documentElement){o.style.setProperty(t,n)}static dispatchWindowResize(){const t=new Event("resize");window.dispatchEvent(t)}static dispatchElementEvent(t,n="click",o){let r;if(r=Me(t)?document.getElementById(t):t,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}static getRandomNum(t,n){var o=n-t,r=Math.random();return t+Math.round(r*o)}static merge(t={},n={}){let o,r,i,s;for(t||(t={}),r=0,i=n.length;r<i;r++)for(o in s=n[r],s)t[o]=s[o];return t}static setOptions(t,n){t.hasOwnProperty("options")||(t.options=t.options?Object.create(t.options):{});for(let o in n)t.options[o]=n[o];return t.options}static formatNum(t,n){let o=Math.pow(10,n===void 0?6:n);return Math.round(t*o)/o}static trim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}static splitWords(t){return this.trim(t).split(/\s+/)}static emptyImageUrl(){return"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="}static debounce(t,n){let o=null;return function(){o&&clearTimeout(o),o=setTimeout(t,n)}}static throttle(t,n){let o=!0;return function(){if(!o)return!1;o=!1,setTimeout(()=>{t(),o=!0},n)}}static dataURLtoBlob(t){let n=t.split(",");if(!n||n.length===0)return;let o=n[0].match(/:(.*?);/)[1],r=atob(n[1]),i=r.length,s=new Uint8Array(i);for(;i--;)s[i]=r.charCodeAt(i);return new Blob([s],{type:o})}static getElement(t){return typeof t=="string"?document.getElementById(t):t}static getStyle(t,n){let o=t.style[n]||t.currentStyle&&t.currentStyle[n];if((!o||o==="auto")&&document.defaultView){let r=document.defaultView.getComputedStyle(t,null);o=r?r[n]:null}return o==="auto"?null:o}static create(t,n,o){let r=document.createElement(t);return r.className=n||"",o&&o.appendChild(r),r}static removeElement(t){let n=t.parentNode;n&&n.removeChild(t)}static emptyElement(t){for(;t.firstChild;)t.removeChild(t.firstChild)}static hasClass(t,n){if(t.classList!==void 0)return t.classList.contains(n);let o=this.getClass(t);return o.length>0&&new RegExp("(^|\\s)"+n+"(\\s|$)").test(o)}static addClass(t,n){if(t.classList!==void 0){let o=this.splitWords(n);for(let r=0,i=o.length;r<i;r++)t.classList.add(o[r])}else if(!this.hasClass(t,n)){let o=this.getClass(t);this.setClass(t,(o?o+" ":"")+n)}}static removeClass(t,n){t.classList!==void 0?t.classList.remove(n):this.setClass(t,this.trim((" "+this.getClass(t)+" ").replace(" "+n+" "," ")))}static setClass(t,n){t.className.baseVal===void 0?t.className=n:t.className.baseVal=n}static getClass(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}static createSvgElement(t,n,o,r){let i=document.createElementNS("http://www.w3.org/2000/svg","svg:svg");i.setAttribute("class","svg-path"),i.setAttribute("width",t),i.setAttribute("height",n),i.setAttribute("viewBox",`0 0 ${t} ${n}`);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(t,n=!0,o=""){n=n??!1;let r=document.createElement("div");return r.className=o||"",r.innerHTML=t,n?r:r.childNodes}static createVideoHTML(t,n,o){let r=this.create("video",n,o),i=this.create("source","",r);i.setAttribute("src",t),i.setAttribute("type","video/map4");let s=this.create("source","",r);return s.setAttribute("src",t),s.setAttribute("type","video/quicktime"),r}}class ze{static isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0;static isNotEmpty=t=>!(t===null||t===""||t===void 0||t.length===0);static toHump(t){return t.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class Ae{prefixKey;storage;constructor(t="",n=localStorage){this.prefixKey=t,this.storage=n}getKey(t){return`${this.prefixKey}${t}`.toUpperCase()}set(t,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(t),r)}get(t,n=null){const o=this.storage.getItem(this.getKey(t));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(t))}catch{return n}return n}getJsonObject(t){const n=this.storage.getItem(this.getKey(t));if(n)try{const o=JSON.parse(n);if(o.expire===null||o.expire>=Date.now())return o;this.remove(this.getKey(t))}catch{return}}remove(t){this.storage.removeItem(this.getKey(t))}clear(){this.storage.clear()}setCookie(t,n,o=604800){document.cookie=`${this.getKey(t)}=${n}; Max-Age=${o}`}getCookie(t){const n=document.cookie.split("; ");for(let o=0,r=n.length;o<r;o++){const i=n[o].split("=");if(i[0]===this.getKey(t))return i[1]}return""}removeCookie(t){this.setCookie(t,1,-1)}clearCookie(){const t=document.cookie.match(/[^ =;]+(?==)/g);if(t)for(let n=t.length;n--;)document.cookie=t[n]+"=0;expire="+new Date(0).toUTCString()}}const ya=new Ae("",localStorage);function mr(){let e=[];const t="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());e[n]=t.substring(r,r+1)}e[14]="4";const o=3&Number(e[19])|8;return e[19]=t.substring(o,o+1),e[8]=e[13]=e[18]=e[23]="-",e.join("")}function wa(){var e=new Date().getTime(),t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(e+16*Math.random())%16|0;return e=Math.floor(e/16),(n==="x"?o:3&o|8).toString(16)});return t}function ba(e){const t=e.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(t[3]||"1"),o=Math.floor(n*parseInt(t[0])+255*(1-n)),r=Math.floor(n*parseInt(t[1])+255*(1-n)),i=Math.floor(n*parseInt(t[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function _a(e){var t=e.toLowerCase();if(Le(e)){if(t.length===4){for(var n="#",o=1;o<4;o+=1){const i=t.slice(o,o+1);n+=i.concat(i)}t=n}var r=[];for(o=1;o<7;o+=2)r.push(parseInt("0x"+t.slice(o,o+2)));return"rgb("+r.join(",")+")"}return t}function Sa(e){const t=e;if(t.length===4){let o="#";for(var n=1;n<4;n+=1){const r=t.slice(n,n+1);o+=r.concat(r)}return o}return t}var Dt;function Ca(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?Dt.Hex:t==="r"||t==="("?Dt.RGBA:t==="h"?Dt.Hsla:Dt.RGBA}function Ea(e){if(e){var t=e.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(t){var n,o,r,i=(parseFloat(t[1])%360+360)%360/360,s=parseFloat(t[2])/(/%$/.test(t[2])?100:1),a=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)n=o=r=a;else{var l=a<=.5?a*(s+1):a+s-a*s,h=2*a-l;n=$n(h,l,i+1/3),o=$n(h,l,i),r=$n(h,l,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${t[4]?parseFloat(t[4]):1})`}}}function $n(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Le(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function xa(e,t,n){const o=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function Nn(e){let t=e.toLowerCase();if(Le(e)){if(t.length===4){let o="#";for(let r=1;r<4;r+=1)o+=t.slice(r,r+1).concat(t.slice(r,r+1));t=o}const n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+t.slice(o,o+2)));return"RGB("+n.join(",")+")"}return t}function ka(e){if(!Le(e))return;const[t,n,o]=Nn(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*o<192}function Ia(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${jn(e.substring(0,2),t)}${jn(e.substring(2,4),t)}${jn(e.substring(4,6),t)}`}function Ta(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${Bn(e.substring(0,2),t)}${Bn(e.substring(2,4),t)}${Bn(e.substring(4,6),t)}`}function Bn(e,t){const n=parseInt(e,16)+t,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function vr(e,t,n){const o=[e,t,n].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 Ra(e){return function(t,n){return(vr(~~t[0],~~t[1],~~t[2])+.05)/(vr(n[0],n[1],n[2])+.05)}(Nn(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function jn(e,t){const n=parseInt(e,16)-t,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function On(e){return{all:e=e||new Map,on(t,n){const o=e?.get(t);o&&o.push(n)||e?.set(t,[n])},off(t,n){const o=e?.get(t);o&&o.splice(o.indexOf(n)>>>0,1)},emit(t,n){(e?.get(t)||[]).slice().map(o=>{o(n)}),(e?.get("*")||[]).slice().map(o=>{o(t,n)})}}}(function(e){e[e.RGBA=0]="RGBA",e[e.Hex=1]="Hex",e[e.Hsla=2]="Hsla"})(Dt||(Dt={}));const $t=On(),lt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},De=(e,t)=>{const n=document.createElement("a");n.download=t,n.style.display="none";const o=new Blob([e],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Ma(e,t){const n=window.URL||window.webkitURL||window,o=new Blob([e]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=t,r.click(),n.revokeObjectURL(r.href)}const yr=(e,t)=>{const n=JSON.stringify(e,null,2);t?De(n,t+".json"):$t.emit(lt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Pa=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(o){De(o.data,n)}).catch(o=>{console.warn(o),$t.emit(lt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function wr(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function za({url:e,target:t="_blank",fileName:n}){const o=new URL(e).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=e,s.target=t,s.download!==void 0&&(s.download=n||wr(e)),document.createEvent){const a=document.createEvent("MouseEvents");return a.initEvent("click",!0,!0),s.dispatchEvent(a),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const s=document.createElement("canvas"),a=document.createElement("img");a.setAttribute("crossOrigin","Anonymous"),a.src=e,a.onload=l=>{s.width=a.width,s.height=a.height,s.getContext("2d").drawImage(a,0,0,a.width,a.height),s.toBlob(h=>{if(h){const w=document.createElement("a");w.href=window.URL.createObjectURL(h),w.download=wr(e),w.click(),URL.revokeObjectURL(w.href),r(!0)}},"image/jpeg")},a.onerror=l=>i(l)}})}function Aa(e){const t=new Date().getTime();let n=new Date().getTime();for(;n-t<e;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${br}\u6BEB\u79D2`)}function br(e){return new Promise(t=>setTimeout(t,e))}var _r,Wn={exports:{}},Sr,Cr,Un,Fn=(_r||(_r=1,Cr=Wn.exports,Un=function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(I,p){var u=I[p];if(typeof u.bind=="function")return u.bind(I);try{return Function.prototype.bind.call(u,I)}catch{return function(){return Function.prototype.apply.apply(u,[I,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 l(I){return I==="debug"&&(I="log"),typeof console!==t&&(I==="trace"&&n?a:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e)}function h(){for(var I=this.getLevel(),p=0;p<o.length;p++){var u=o[p];this[u]=p<I?e:this.methodFactory(u,I,this.name)}if(this.log=this.debug,typeof console===t&&I<this.levels.SILENT)return"No console available for logging"}function w(I){return function(){typeof console!==t&&(h.call(this),this[I].apply(this,arguments))}}function _(I,p,u){return l(I)||w.apply(this,arguments)}function k(I,p){var u,v,y,d=this,f="loglevel";function z(){var M;if(typeof window!==t&&f){try{M=window.localStorage[f]}catch{}if(typeof M===t)try{var N=window.document.cookie,O=encodeURIComponent(f),T=N.indexOf(O+"=");T!==-1&&(M=/^([^;]+)/.exec(N.slice(T+O.length+1))[1])}catch{}return d.levels[M]===void 0&&(M=void 0),M}}function L(M){var N=M;if(typeof N=="string"&&d.levels[N.toUpperCase()]!==void 0&&(N=d.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=d.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+M)}typeof I=="string"?f+=":"+I:typeof I=="symbol"&&(f=void 0),d.name=I,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=p||_,d.getLevel=function(){return y??v??u},d.setLevel=function(M,N){return y=L(M),N!==!1&&function(O){var T=(o[O]||"silent").toUpperCase();if(typeof window!==t&&f){try{return void(window.localStorage[f]=T)}catch{}try{window.document.cookie=encodeURIComponent(f)+"="+T+";"}catch{}}}(y),h.call(d)},d.setDefaultLevel=function(M){v=L(M),z()||d.setLevel(M,!1)},d.resetLevel=function(){y=null,function(){if(typeof window!==t&&f){try{window.localStorage.removeItem(f)}catch{}try{window.document.cookie=encodeURIComponent(f)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),h.call(d)},d.enableAll=function(M){d.setLevel(d.levels.TRACE,M)},d.disableAll=function(M){d.setLevel(d.levels.SILENT,M)},d.rebuild=function(){if(i!==d&&(u=L(i.getLevel())),h.call(d),i===d)for(var M in r)r[M].rebuild()},u=L(i?i.getLevel():"WARN");var D=z();D!=null&&(y=L(D)),h.call(d)}(i=new k).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var p=r[I];return p||(p=r[I]=new k(I,i.methodFactory)),p};var $=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=$),i},i.getLoggers=function(){return r},i.default=i,i},(Sr=Wn).exports?Sr.exports=Un():Cr.log=Un()),Wn.exports);class Er{message;eventBus;constructor(t,n){t&&(this.message=t),n&&(this.eventBus=n)}msg(t,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:t,duration:n});else switch(o){case"info":this.message.info(t,n);break;case"success":this.message.success(t,n);break;case"warning":this.message.warn?this.message.warn(t,n):this.message.warning&&this.message.warning(t,n);break;case"error":this.message.error(t,n)}else{switch(o){case"info":case"success":console.log(t);break;case"warning":console.warn(t);break;case"error":o="dark",console.error(t)}this.eventBus&&this.eventBus.emit(lt.AlertInfoEvent,{type:o,info:t})}}info(t,n=3){this.msg(t,n,"info")}warn(t,n=3){this.msg(t,n,"warning")}err(t,n=3){this.msg(t,n,"error")}success(t,n=3){this.msg(t,n,"success")}}let xr=!1;const j={Config:SysConfig,EventBus:$t,DefaultProxyClient:null,Axios:Ws,Message:new Er(void 0,$t),LayoutMap:new Map,getLayoutManager:e=>{if(!j.WidgetConfigList||j.WidgetConfigList.length===0)return;const t=j.WidgetConfigList.find(n=>n.id===e);if(t){const n=t.layoutID;if(n&&j.LayoutMap.has(n))return j.LayoutMap.get(n)}},Logger:e=>{xr||(import.meta.env?.DEV||SysConfig.UI.ProductLog?Fn.enableAll():Fn.setDefaultLevel("warn"),xr=!0);const t=e||"default";return Fn.getLogger(t)}},kr="access_token",kt=new Ae("user",localStorage);function Nt(){return kt.get(kr)}function Hn(){kt.remove(kr)}function Ir(){return Nt()?.refresh}function qn(e,t,n,o="json",r){const i={baseURL:j.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,paramsSerializer:{serialize:function(s){return Us.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Nt()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return j.SystemID&&(i.headers.sysid=j.SystemID,j.SystemGroup&&(i.headers.sysgroup=j.SystemGroup)),t&&(i.baseURL=t),i}function It(e,t,n,o,r="json",i,s){const a=qn(n,t,o,r,i);return s&&s>=2e4&&(a.timeout=s),j.Axios?.get(e,a).catch(function(l){$e(l,t,e,"Get")})}function $e(e,t,n,o="Get"){const r=`${t}${n}`;if(e&&e.response){let i=!1;const s=e.response.status;switch(s){case 400:e.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:e.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:e.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:e.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:e.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:e.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const l=e.response.data;if(l){const h=l.indexOf(":"),w=l.indexOf(`
|
|
2
|
-
`);if(
|
|
3
|
-
`),i=0;i<r.length;i++){var s=r[i],a=s.indexOf(":"),l=e(s.slice(0,a)).toLowerCase(),h=e(s.slice(a+1));o[l]===void 0?o[l]=h:(n=o[l],Object.prototype.toString.call(n)==="[object Array]"?o[l].push(h):o[l]=[o[l],h])}return o},Vn}var Oa=function(){if($r)return Ne.exports;$r=1;var e=Na(),t=Ba(),n=ja(),o=function(){if(Dr)return Gn;Dr=1,Gn=function(){for(var l={},h=0;h<arguments.length;h++){var w=arguments[h];for(var _ in w)a.call(w,_)&&(l[_]=w[_])}return l};var a=Object.prototype.hasOwnProperty;return Gn}();function r(a,l,h){var w=a;return t(l)?(h=l,typeof a=="string"&&(w={uri:a})):w=o(l,{uri:a}),w.callback=h,w}function i(a,l,h){return s(l=r(a,l,h))}function s(a){if(a.callback===void 0)throw new Error("callback argument missing");var l=!1,h=function(M,N,O){l||(l=!0,a.callback(M,N,O))};function w(){var M=void 0;if(M=p.response?p.response:p.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var O=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!O)return N.responseXML}catch{}return null}(p),L)try{M=JSON.parse(M)}catch{}return M}function _(M){return clearTimeout(u),M instanceof Error||(M=new Error(""+(M||"Unknown XMLHttpRequest Error"))),M.statusCode=0,h(M,D)}function k(){if(!I){var M;clearTimeout(u),M=a.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var N=D,O=null;return M!==0?(N={body:w(),statusCode:M,method:y,headers:{},url:v,rawRequest:p},p.getAllResponseHeaders&&(N.headers=n(p.getAllResponseHeaders()))):O=new Error("Internal XMLHttpRequest Error"),h(O,N,N.body)}}var $,I,p=a.xhr||null;p||(p=a.cors||a.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var u,v=p.url=a.uri||a.url,y=p.method=a.method||"GET",d=a.body||a.data,f=p.headers=a.headers||{},z=!!a.sync,L=!1,D={body:void 0,headers:{},statusCode:0,method:y,url:v,rawRequest:p};if("json"in a&&a.json!==!1&&(L=!0,f.accept||f.Accept||(f.Accept="application/json"),y!=="GET"&&y!=="HEAD"&&(f["content-type"]||f["Content-Type"]||(f["Content-Type"]="application/json"),d=JSON.stringify(a.json===!0?d:a.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(k,0)},p.onload=k,p.onerror=_,p.onprogress=function(){},p.onabort=function(){I=!0},p.ontimeout=_,p.open(y,v,!z,a.username,a.password),z||(p.withCredentials=!!a.withCredentials),!z&&a.timeout>0&&(u=setTimeout(function(){if(!I){I=!0,p.abort("timeout");var M=new Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",_(M)}},a.timeout)),p.setRequestHeader)for($ in f)f.hasOwnProperty($)&&p.setRequestHeader($,f[$]);else if(a.headers&&!function(M){for(var N in M)if(M.hasOwnProperty(N))return!1;return!0}(a.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in a&&(p.responseType=a.responseType),"beforeSend"in a&&typeof a.beforeSend=="function"&&a.beforeSend(p),p.send(d||null),p}return Ne.exports=i,Ne.exports.default=i,i.XMLHttpRequest=e.XMLHttpRequest||function(){},i.XDomainRequest="withCredentials"in new i.XMLHttpRequest?i.XMLHttpRequest:e.XDomainRequest,function(a,l){for(var h=0;h<a.length;h++)l(a[h])}(["get","put","post","patch","head","delete"],function(a){i[a==="delete"?"del":a]=function(l,h,w){return(h=r(l,h,w)).method=a.toUpperCase(),s(h)}}),Ne.exports}(),Wa=Pe(Oa);const Ua=[200,201,202,204,308],Fa=[408,502,503,504];class Nr{endpoint;file;headers;method;chunkSize;attempts;delayBeforeAttempt;md5;chunk;chunkCount;chunkByteSize;maxFileBytes;endpointValue;totalChunks;attemptCount;offline;paused;success;currentXhr;reader;eventTarget;fileName;constructor(t){this.endpoint=t.endpoint,this.file=t.file,this.fileName=encodeURI(this.file.name),this.headers=t.headers||{},this.method=t.method||"PUT",this.chunkSize=t.chunkSize||5120,this.attempts=t.attempts||5,this.delayBeforeAttempt=t.delayBeforeAttempt||1,this.md5=t.md5||"",this.maxFileBytes=1024*(t.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=On(),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(t,n){this.eventTarget.on(t,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(t,n){this.eventTarget.emit(t,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(t=>(this.endpointValue=t,this.endpointValue))}getChunk(){return new Promise(t=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),t(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(t){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,a=i*this.chunkCount,l=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(a+l,100))}};return new Promise((o,r)=>{this.currentXhr=Wa({...t,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const t=this.chunkCount*this.chunkByteSize,n=t+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${t}-${n}/${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(t=>{if(this.attemptCount=this.attemptCount+1,t!=null&&Ua.includes(t.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:t}),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(t!=null&&Fa.includes(t.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;console.log(`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`),this.dispatch("error",{message:`\u670D\u52A1\u5668\u9519\u8BEF:${t?.statusCode}\uFF0C\u505C\u6B62\u4E0A\u4F20\u3002`,chunkNumber:this.chunkCount,attempts:this.attemptCount})}}).catch(t=>{this.paused||this.offline||this.manageRetries()})}}const Ha=e=>new Nr(e),qa=new class{hasClass(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))}addClass(e,t){this.hasClass(e,t)||(e.className+=" "+t)}removeClass(e,t){if(this.hasClass(e,t)){const n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}}toggleClass(e,t){this.hasClass(e,t)?this.removeClass(e,t):this.addClass(e,t)}setCSSProperty(e,t,n){e?.style.setProperty(t,n)}};class ge{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!ze.isNullOrEmpty(t)){if(ge.httpTransport||(ge.httpTransport=new Xs),this.client=new Fs(t),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=t,this.init()}}init(){this.client&&this.client.useServiceAsync().then(t=>{this.hproseProxy=t}).catch(t=>{String(t).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):$t.emit(lt.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(t)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(t){console.warn(t),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(t,n,o){if(this.client)return await this.client.invoke(t,n,o)}encode(t,n,o){if(this.client)return this.client.codec.encode(t,n,o)}decode(t,n){if(this.client)return this.client.codec.decode(t,n)}}class oe{hproseClient;hpProxyObj;defaultContext=new kn;constructor(t){this.hproseClient=new ge(t),this.hpProxyObj=null}getClientContext(t,n){const o={};n&&(o.requestHeaders=n);const r=Nt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),j.SystemID&&(i.sysid=j.SystemID,j.SystemGroup&&(i.sysgroup=j.SystemGroup)),new kn(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 t=await this.hproseClient.getProxy();this.hpProxyObj=t}return this.hpProxyObj||$t.emit(lt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(t,n,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(t,n,o)}async hproseInvokeContext(t,n,...o){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=Nt();return console.log(r,"userToken3"),r&&(n||(n=new kn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,n)}async hproseInvokeEncode(t){const n=new Ee(t).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(t,...n){const o=this.hproseClient.client?.codec?.encode(t,n,this.defaultContext);return Ee.toString(o)}}const Kn=new Map,Xa=function(e,t,n){!j.Config.DefaultHproseAPI&&j.Config.ServiceURL&&(j.Config.DefaultHproseAPI=j.Config.ServiceURL.DefaultHproseAPI),j.Config.DefaultHproseAPI&&ze.isNotEmpty(j.Config.DefaultHproseAPI)&&(j.DefaultProxyClient=new oe(j.Config.DefaultHproseAPI));const o=j.Config.UI.GrayMode;o&&ft.setGrayMode(o);const r=new Er(e,j.EventBus);j.Message=r,j.SystemID=t,j.SystemGroup=n,j.EventBus.on(lt.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),j.EventBus.on(lt.CommonWarnEvent,i=>{r.warn(i)})};function Br(e){if(e&&ze.isNotEmpty(e)){if(Kn.has(e))return Kn.get(e);{const t=new oe(e);return Kn.set(e,t),t}}}function Va(e){const t=Br(e);return t&&(j.DefaultProxyClient=t),t}const Jn="is_LockScreen",jr=kt.get(Jn,!1),re={isLock:jr,lockTime:jr=="true"?Wr():0};function Or(e){re.isLock=e,kt.set(Jn,e,10),e&&(Hn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ga(){return kt.get(Jn,!1)}function Wr(){let e=3600;return j.Config.UI?.LockTime&&j.Config.UI?.LockTime>=10&&(e=j.Config.UI.LockTime),e}let Yn;function Zn(){clearInterval(Yn),!(window.location.href.indexOf("/login")>0||re.isLock)&&(Or(!1),re.lockTime=Wr(),Yn=setInterval(()=>{if(re.lockTime--,re.lockTime<=0)return Or(!0),clearInterval(Yn)},1e3))}function Ka(){Zn(),document.addEventListener("mousedown",Zn)}function Ja(){document.removeEventListener("mousedown",Zn)}function Qn(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ur,Fr={exports:{}};/*!
|
|
1
|
+
import{h as Li,openBlock as F,createElementBlock as fe,normalizeStyle as ge,renderSlot as ie,defineComponent as Te,ref as G,withModifiers as bo,getCurrentInstance as $i,computed as je,watch as Re,onMounted as Jt,onBeforeUnmount as Ni,nextTick as _o,resolveComponent as lt,createBlock as Q,Transition as So,withCtx as we,withDirectives as Co,createElementVNode as J,Fragment as Pe,createTextVNode as Yt,toDisplayString as Zt,createCommentVNode as ne,vShow as Eo,markRaw as Bi,onErrorCaptured as Wi,Suspense as Ui,createVNode as ut,KeepAlive as ko,resolveDynamicComponent as be,reactive as Oi,toRefs as ji,renderList as He,normalizeClass as Me,TransitionGroup as Hi,onUnmounted as qi,unref as Qt}from"vue";import Fi from"axios";import Xi from"qs";import{Client as Vi,ClientContext as en}from"@hprose/rpc-core";import{ByteStream as xe,Writer as tn,Reader as nn,ValueReader as Ki}from"@hprose/io";import{HttpTransport as Gi}from"@hprose/rpc-html5";import{Icon as on}from"@iconify/vue";var Ji={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 E=this.doPushOtherPanes(t,i);if(!E)return;({sums:t,panesToResize:s}=E),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 Li("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},rn={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 sn(n){return window.TouchEvent&&n instanceof TouchEvent}rn.render=function(n,e,t,o,r,i){return F(),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)},rn.__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 sn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return sn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Gn(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}){sn(this.e)?t&&t(this.e):e&&e(this.e)}}class Gn{x;y;constructor(e,t){this.x=e,this.y=t}clone(){return new Gn(this.x,this.y)}}class Yi{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 Zi{_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=dt(this._group),o=dt(e);t.splice(t.indexOf(this),1),o.push(this),Io()}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(dt(this._group)),Io()}}const ht=new Map;function dt(n){return ht.has(n)||ht.set(n,[]),ht.get(n)}function xo(n,e){return n>e?-xo(e,n):n<0&&e>=0?1:n-e}function Io(){let n=0;for(const e of function(t){const o=[];return t.forEach((r,i)=>o.push(i)),o}(ht).sort(xo))for(const t of dt(e))n!=t.zIndex&&(t.zIndex=n,t.onChange(n)),n++}function an(n){if(n){const{width:e,height:t}=n.style;n.style.width="auto",n.style.height="auto";const o=ft(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 ft(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 Qi{container;options;handles;constructor(e,t){if(this.container=e,this.options=t,e&&t){this.handles=To.map(u=>new u(e,this));const{width:o,height:r}=an(e),i=t.maxWidth||window.innerWidth,s=t.maxHeight||window.innerHeight;let c=!1;(o<t.minWidth||o>i)&&(e.style.width=`${Ro(o,t.minWidth,i)}px`,c=!0),(r<t.minHeight||r>s)&&(e.style.height=`${Ro(r,t.minHeight,s)}px`,c=!0),c&&t.onResize&&t.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const To=[];class Ie{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}=ft(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}=ft(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}=ft(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 Ro(n,e,t){return n<e?e:n>t?t:n}To.push(class extends Ie{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 Ie{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 Ie{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 Ie{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 Ie{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 Ie{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 Ie{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 Ie{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 pt=Te({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(n){const e=G(!1),t=G(!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 es=["disabled"];pt.render=function(n,e,t,o,r,i){return F(),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]=bo((...s)=>n.mousedown&&n.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=bo((...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,es)},pt.__scopeId="data-v-71662210",pt.__file="src/controls/vuewindow/window/Button.vue";const ts=Object.prototype.toString;function ue(n,e){return ts.call(n)===`[object ${e}]`}function gt(n){return ue(n,"Function")}const Po=n=>typeof n<"u",cn=n=>!Po(n);function ln(n){return n===null}function ns(n){return cn(n)&&ln(n)}function os(n){return cn(n)||ln(n)}const ze=n=>n!=null&&n!==null&&ue(n,"Object");function rs(n){return ue(n,"Date")}function un(n){return ue(n,"Number")}function is(n){return ue(n,"AsyncFunction")}function ss(n){return ue(n,"Promise")&&ze(n)&>(n.then)&>(n.catch)}function mt(n){return ue(n,"String")}function as(n){return n===!0||n===!1||ue(n,"Boolean")}function hn(n){return n&&Array.isArray(n)}const cs=()=>typeof window<"u",ls=n=>typeof window<"u"&&ue(n,"Window"),us=n=>ze(n)&&!!n.tagName,hs=typeof window>"u";function ds(n){return n&&["IMAGE","IMG"].includes(n.tagName)}function fs(n){return n==null||(mt(n)||hn(n)?n.length===0:!!ze(n)&&JSON.stringify(n)==="{}")}function ps(n){return ue(n,"Error")}function gs(n){return ue(n,"WeakSet")}function ms(n){return ue(n,"WeakMap")}function vs(n){return ue(n,"Symbol")}function ys(n){return ue(n,"Map")}const ws=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 qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function vt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Mo,zo={exports:{}},bs=Mo?zo.exports:(Mo=1,zo.exports=function(n){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function t(p,l){var y=p[0],m=p[1],d=p[2],v=p[3];m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&d|~m&v)+l[0]-680876936|0)<<7|y>>>25)+m|0)&m|~y&d)+l[1]-389564586|0)<<12|v>>>20)+y|0)&y|~v&m)+l[2]+606105819|0)<<17|d>>>15)+v|0)&v|~d&y)+l[3]-1044525330|0)<<22|m>>>10)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&d|~m&v)+l[4]-176418897|0)<<7|y>>>25)+m|0)&m|~y&d)+l[5]+1200080426|0)<<12|v>>>20)+y|0)&y|~v&m)+l[6]-1473231341|0)<<17|d>>>15)+v|0)&v|~d&y)+l[7]-45705983|0)<<22|m>>>10)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&d|~m&v)+l[8]+1770035416|0)<<7|y>>>25)+m|0)&m|~y&d)+l[9]-1958414417|0)<<12|v>>>20)+y|0)&y|~v&m)+l[10]-42063|0)<<17|d>>>15)+v|0)&v|~d&y)+l[11]-1990404162|0)<<22|m>>>10)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&d|~m&v)+l[12]+1804603682|0)<<7|y>>>25)+m|0)&m|~y&d)+l[13]-40341101|0)<<12|v>>>20)+y|0)&y|~v&m)+l[14]-1502002290|0)<<17|d>>>15)+v|0)&v|~d&y)+l[15]+1236535329|0)<<22|m>>>10)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&v|d&~v)+l[1]-165796510|0)<<5|y>>>27)+m|0)&d|m&~d)+l[6]-1069501632|0)<<9|v>>>23)+y|0)&m|y&~m)+l[11]+643717713|0)<<14|d>>>18)+v|0)&y|v&~y)+l[0]-373897302|0)<<20|m>>>12)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&v|d&~v)+l[5]-701558691|0)<<5|y>>>27)+m|0)&d|m&~d)+l[10]+38016083|0)<<9|v>>>23)+y|0)&m|y&~m)+l[15]-660478335|0)<<14|d>>>18)+v|0)&y|v&~y)+l[4]-405537848|0)<<20|m>>>12)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&v|d&~v)+l[9]+568446438|0)<<5|y>>>27)+m|0)&d|m&~d)+l[14]-1019803690|0)<<9|v>>>23)+y|0)&m|y&~m)+l[3]-187363961|0)<<14|d>>>18)+v|0)&y|v&~y)+l[8]+1163531501|0)<<20|m>>>12)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m&v|d&~v)+l[13]-1444681467|0)<<5|y>>>27)+m|0)&d|m&~d)+l[2]-51403784|0)<<9|v>>>23)+y|0)&m|y&~m)+l[7]+1735328473|0)<<14|d>>>18)+v|0)&y|v&~y)+l[12]-1926607734|0)<<20|m>>>12)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m^d^v)+l[5]-378558|0)<<4|y>>>28)+m|0)^m^d)+l[8]-2022574463|0)<<11|v>>>21)+y|0)^y^m)+l[11]+1839030562|0)<<16|d>>>16)+v|0)^v^y)+l[14]-35309556|0)<<23|m>>>9)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m^d^v)+l[1]-1530992060|0)<<4|y>>>28)+m|0)^m^d)+l[4]+1272893353|0)<<11|v>>>21)+y|0)^y^m)+l[7]-155497632|0)<<16|d>>>16)+v|0)^v^y)+l[10]-1094730640|0)<<23|m>>>9)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m^d^v)+l[13]+681279174|0)<<4|y>>>28)+m|0)^m^d)+l[0]-358537222|0)<<11|v>>>21)+y|0)^y^m)+l[3]-722521979|0)<<16|d>>>16)+v|0)^v^y)+l[6]+76029189|0)<<23|m>>>9)+d|0,m=((m+=((d=((d+=((v=((v+=((y=((y+=(m^d^v)+l[9]-640364487|0)<<4|y>>>28)+m|0)^m^d)+l[12]-421815835|0)<<11|v>>>21)+y|0)^y^m)+l[15]+530742520|0)<<16|d>>>16)+v|0)^v^y)+l[2]-995338651|0)<<23|m>>>9)+d|0,m=((m+=((v=((v+=(m^((y=((y+=(d^(m|~v))+l[0]-198630844|0)<<6|y>>>26)+m|0)|~d))+l[7]+1126891415|0)<<10|v>>>22)+y|0)^((d=((d+=(y^(v|~m))+l[14]-1416354905|0)<<15|d>>>17)+v|0)|~y))+l[5]-57434055|0)<<21|m>>>11)+d|0,m=((m+=((v=((v+=(m^((y=((y+=(d^(m|~v))+l[12]+1700485571|0)<<6|y>>>26)+m|0)|~d))+l[3]-1894986606|0)<<10|v>>>22)+y|0)^((d=((d+=(y^(v|~m))+l[10]-1051523|0)<<15|d>>>17)+v|0)|~y))+l[1]-2054922799|0)<<21|m>>>11)+d|0,m=((m+=((v=((v+=(m^((y=((y+=(d^(m|~v))+l[8]+1873313359|0)<<6|y>>>26)+m|0)|~d))+l[15]-30611744|0)<<10|v>>>22)+y|0)^((d=((d+=(y^(v|~m))+l[6]-1560198380|0)<<15|d>>>17)+v|0)|~y))+l[13]+1309151649|0)<<21|m>>>11)+d|0,m=((m+=((v=((v+=(m^((y=((y+=(d^(m|~v))+l[4]-145523070|0)<<6|y>>>26)+m|0)|~d))+l[11]-1120210379|0)<<10|v>>>22)+y|0)^((d=((d+=(y^(v|~m))+l[2]+718787259|0)<<15|d>>>17)+v|0)|~y))+l[9]-343485551|0)<<21|m>>>11)+d|0,p[0]=y+p[0]|0,p[1]=m+p[1]|0,p[2]=d+p[2]|0,p[3]=v+p[3]|0}function o(p){var l,y=[];for(l=0;l<64;l+=4)y[l>>2]=p.charCodeAt(l)+(p.charCodeAt(l+1)<<8)+(p.charCodeAt(l+2)<<16)+(p.charCodeAt(l+3)<<24);return y}function r(p){var l,y=[];for(l=0;l<64;l+=4)y[l>>2]=p[l]+(p[l+1]<<8)+(p[l+2]<<16)+(p[l+3]<<24);return y}function i(p){var l,y,m,d,v,$,z=p.length,A=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=z;l+=64)t(A,o(p.substring(l-64,l)));for(y=(p=p.substring(l-64)).length,m=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<y;l+=1)m[l>>2]|=p.charCodeAt(l)<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(t(A,m),l=0;l<16;l+=1)m[l]=0;return d=(d=8*z).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(d[2],16),$=parseInt(d[1],16)||0,m[14]=v,m[15]=$,t(A,m),A}function s(p){var l,y,m,d,v,$,z=p.length,A=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=z;l+=64)t(A,r(p.subarray(l-64,l)));for(y=(p=l-64<z?p.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<y;l+=1)m[l>>2]|=p[l]<<(l%4<<3);if(m[l>>2]|=128<<(l%4<<3),l>55)for(t(A,m),l=0;l<16;l+=1)m[l]=0;return d=(d=8*z).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(d[2],16),$=parseInt(d[1],16)||0,m[14]=v,m[15]=$,t(A,m),A}function c(p){var l,y="";for(l=0;l<4;l+=1)y+=e[p>>8*l+4&15]+e[p>>8*l&15];return y}function u(p){var l;for(l=0;l<p.length;l+=1)p[l]=c(p[l]);return p.join("")}function g(p){return/[\u0080-\uFFFF]/.test(p)&&(p=unescape(encodeURIComponent(p))),p}function S(p,l){var y,m=p.length,d=new ArrayBuffer(m),v=new Uint8Array(d);for(y=0;y<m;y+=1)v[y]=p.charCodeAt(y);return l?v:d}function E(p){return String.fromCharCode.apply(null,new Uint8Array(p))}function L(p,l,y){var m=new Uint8Array(p.byteLength+l.byteLength);return m.set(new Uint8Array(p)),m.set(new Uint8Array(l),p.byteLength),y?m:m.buffer}function O(p){var l,y=[],m=p.length;for(l=0;l<m-1;l+=2)y.push(parseInt(p.substr(l,2),16));return String.fromCharCode.apply(String,y)}function I(){this.reset()}return u(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function p(l,y){return(l=0|l||0)<0?Math.max(l+y,0):Math.min(l,y)}ArrayBuffer.prototype.slice=function(l,y){var m,d,v,$,z=this.byteLength,A=p(l,z),M=z;return y!==n&&(M=p(y,z)),A>M?new ArrayBuffer(0):(m=M-A,d=new ArrayBuffer(m),v=new Uint8Array(d),$=new Uint8Array(this,A,m),v.set($),d)}}(),I.prototype.append=function(p){return this.appendBinary(g(p)),this},I.prototype.appendBinary=function(p){this._buff+=p,this._length+=p.length;var l,y=this._buff.length;for(l=64;l<=y;l+=64)t(this._hash,o(this._buff.substring(l-64,l)));return this._buff=this._buff.substring(l-64),this},I.prototype.end=function(p){var l,y,m=this._buff,d=m.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<d;l+=1)v[l>>2]|=m.charCodeAt(l)<<(l%4<<3);return this._finish(v,d),y=u(this._hash),p&&(y=O(y)),this.reset(),y},I.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},I.prototype.setState=function(p){return this._buff=p.buff,this._length=p.length,this._hash=p.hash,this},I.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},I.prototype._finish=function(p,l){var y,m,d,v=l;if(p[v>>2]|=128<<(v%4<<3),v>55)for(t(this._hash,p),v=0;v<16;v+=1)p[v]=0;y=(y=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),m=parseInt(y[2],16),d=parseInt(y[1],16)||0,p[14]=m,p[15]=d,t(this._hash,p)},I.hash=function(p,l){return I.hashBinary(g(p),l)},I.hashBinary=function(p,l){var y=u(i(p));return l?O(y):y},I.ArrayBuffer=function(){this.reset()},I.ArrayBuffer.prototype.append=function(p){var l,y=L(this._buff.buffer,p,!0),m=y.length;for(this._length+=p.byteLength,l=64;l<=m;l+=64)t(this._hash,r(y.subarray(l-64,l)));return this._buff=l-64<m?new Uint8Array(y.buffer.slice(l-64)):new Uint8Array(0),this},I.ArrayBuffer.prototype.end=function(p){var l,y,m=this._buff,d=m.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<d;l+=1)v[l>>2]|=m[l]<<(l%4<<3);return this._finish(v,d),y=u(this._hash),p&&(y=O(y)),this.reset(),y},I.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},I.ArrayBuffer.prototype.getState=function(){var p=I.prototype.getState.call(this);return p.buff=E(p.buff),p},I.ArrayBuffer.prototype.setState=function(p){return p.buff=S(p.buff,!0),I.prototype.setState.call(this,p)},I.ArrayBuffer.prototype.destroy=I.prototype.destroy,I.ArrayBuffer.prototype._finish=I.prototype._finish,I.ArrayBuffer.hash=function(p,l){var y=u(s(new Uint8Array(p)));return l?O(y):y},I}()),dn=vt(bs);const fn=[];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(fn.indexOf(t)!==-1)return;fn.push(t)}return t}static jsonStringify(e){if(!e)return"";const t=JSON.stringify(e,he.stringifyCircularHandler);return fn.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 dn.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 dn.ArrayBuffer,S=new FileReader;function E(){const L=u*s,O=L+s>=i.size?i.size:L+s;S.readAsArrayBuffer(r.call(i,L,O))}S.onload=function(L){if(g.append(L.target?.result),u++,u<c)E();else{const O=g.end();t({isOK:!0,data:O})}},S.onerror=function(){const L=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(L),t({isOK:!1,data:L})},E()}static MD5(e,t=!1){return dn.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=mt(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}}class yt{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","")}}class wt{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 _s=new wt("",localStorage);function Ao(){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 Ss(){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 Cs(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 Es(n){var e=n.toLowerCase();if(bt(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 ks(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 Ae;function xs(n){if(typeof n=="object"||!n)return;const e=n.toLowerCase().substring(0,1);return e==="#"?Ae.Hex:e==="r"||e==="("?Ae.RGBA:e==="h"?Ae.Hsla:Ae.RGBA}function Is(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=pn(g,u,i+1/3),o=pn(g,u,i),r=pn(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 pn(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 bt(n){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(n)}function Ts(n,e,t){const o=(n<<16|e<<8|t).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function gn(n){let e=n.toLowerCase();if(bt(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 Rs(n){if(!bt(n))return;const[e,t,o]=gn(n).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*t+.114*o<192}function Ps(n,e){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,e=Math.trunc(255*e/100),`#${vn(n.substring(0,2),e)}${vn(n.substring(2,4),e)}${vn(n.substring(4,6),e)}`}function Ms(n,e){return n=n.indexOf("#")>=0?n.substring(1,n.length):n,e=Math.trunc(255*e/100),`#${mn(n.substring(0,2),e)}${mn(n.substring(2,4),e)}${mn(n.substring(4,6),e)}`}function mn(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 Do(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 zs(n){return function(e,t){return(Do(~~e[0],~~e[1],~~e[2])+.05)/(Do(t[0],t[1],t[2])+.05)}(gn(n.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function vn(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 yn(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&&o.splice(o.indexOf(t)>>>0,1)},emit(e,t){(n?.get(e)||[]).slice().map(o=>{o(t)}),(n?.get("*")||[]).slice().map(o=>{o(e,t)})}}}(function(n){n[n.RGBA=0]="RGBA",n[n.Hex=1]="Hex",n[n.Hsla=2]="Hsla"})(Ae||(Ae={}));const De=yn(),se={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetLoaded:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent",LayoutContainerLoaded:"LayoutContainerLoaded"},_t=(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 As(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 Lo=(n,e)=>{const t=JSON.stringify(n,null,2);e?_t(t,e+".json"):De.emit(se.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Ds=(n,e,t)=>{n.get(e,{responseType:"blob"}).then(function(o){_t(o.data,t)}).catch(o=>{console.warn(o),De.emit(se.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function $o(n){const e=n.lastIndexOf("/")+1;let t=n.substring(e);return t=decodeURI(t.split("?")[0]),t}function Ls({url:n,target:e="_blank",fileName:t}){const o=new URL(n).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=n,s.target=e,s.download!==void 0&&(s.download=t||$o(n)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),s.dispatchEvent(c),r(!0)}return n.indexOf("?")===-1&&(n+="?download"),window.open(n,e),r(!0)}{const s=document.createElement("canvas"),c=document.createElement("img");c.setAttribute("crossOrigin","Anonymous"),c.src=n,c.onload=u=>{s.width=c.width,s.height=c.height,s.getContext("2d").drawImage(c,0,0,c.width,c.height),s.toBlob(g=>{if(g){const S=document.createElement("a");S.href=window.URL.createObjectURL(g),S.download=t??$o(n),S.click(),URL.revokeObjectURL(S.href),r(!0)}})},c.onerror=u=>i(u)}})}function $s(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${No}\u6BEB\u79D2`)}function No(n){return new Promise(e=>setTimeout(e,n))}var Bo,wn={exports:{}},Wo,Uo,bn,_n=(Bo||(Bo=1,Uo=wn.exports,bn=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(I,p){var l=I[p];if(typeof l.bind=="function")return l.bind(I);try{return Function.prototype.bind.call(l,I)}catch{return function(){return Function.prototype.apply.apply(l,[I,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(I){return I==="debug"&&(I="log"),typeof console!==e&&(I==="trace"&&t?c:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):n)}function g(){for(var I=this.getLevel(),p=0;p<o.length;p++){var l=o[p];this[l]=p<I?n:this.methodFactory(l,I,this.name)}if(this.log=this.debug,typeof console===e&&I<this.levels.SILENT)return"No console available for logging"}function S(I){return function(){typeof console!==e&&(g.call(this),this[I].apply(this,arguments))}}function E(I,p,l){return u(I)||S.apply(this,arguments)}function L(I,p){var l,y,m,d=this,v="loglevel";function $(){var M;if(typeof window!==e&&v){try{M=window.localStorage[v]}catch{}if(typeof M===e)try{var N=window.document.cookie,U=encodeURIComponent(v),R=N.indexOf(U+"=");R!==-1&&(M=/^([^;]+)/.exec(N.slice(R+U.length+1))[1])}catch{}return d.levels[M]===void 0&&(M=void 0),M}}function z(M){var N=M;if(typeof N=="string"&&d.levels[N.toUpperCase()]!==void 0&&(N=d.levels[N.toUpperCase()]),typeof N=="number"&&N>=0&&N<=d.levels.SILENT)return N;throw new TypeError("log.setLevel() called with invalid level: "+M)}typeof I=="string"?v+=":"+I:typeof I=="symbol"&&(v=void 0),d.name=I,d.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},d.methodFactory=p||E,d.getLevel=function(){return m??y??l},d.setLevel=function(M,N){return m=z(M),N!==!1&&function(U){var R=(o[U]||"silent").toUpperCase();if(typeof window!==e&&v){try{return void(window.localStorage[v]=R)}catch{}try{window.document.cookie=encodeURIComponent(v)+"="+R+";"}catch{}}}(m),g.call(d)},d.setDefaultLevel=function(M){y=z(M),$()||d.setLevel(M,!1)},d.resetLevel=function(){m=null,function(){if(typeof window!==e&&v){try{window.localStorage.removeItem(v)}catch{}try{window.document.cookie=encodeURIComponent(v)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),g.call(d)},d.enableAll=function(M){d.setLevel(d.levels.TRACE,M)},d.disableAll=function(M){d.setLevel(d.levels.SILENT,M)},d.rebuild=function(){if(i!==d&&(l=z(i.getLevel())),g.call(d),i===d)for(var M in r)r[M].rebuild()},l=z(i?i.getLevel():"WARN");var A=$();A!=null&&(m=z(A)),g.call(d)}(i=new L).getLogger=function(I){if(typeof I!="symbol"&&typeof I!="string"||I==="")throw new TypeError("You must supply a name when creating a logger.");var p=r[I];return p||(p=r[I]=new L(I,i.methodFactory)),p};var O=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=O),i},i.getLoggers=function(){return r},i.default=i,i},(Wo=wn).exports?Wo.exports=bn():Uo.log=bn()),wn.exports);class Oo{message;eventBus;constructor(e,t){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 jo=!1;const B={Config:SysConfig,EventBus:De,DefaultProxyClient:null,Axios:Fi,Message:new Oo(void 0,De),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=>{jo||(import.meta.env?.DEV||SysConfig.UI.ProductLog?_n.enableAll():_n.setDefaultLevel("warn"),jo=!0);const e=n||"default";return _n.getLogger(e)}},Ho="access_token",Se=new wt("user",localStorage);function Le(){return Se.get(Ho)}function Sn(){Se.remove(Ho)}function qo(){return Le()?.refresh}function Cn(n,e,t,o="json",r){const i={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:n,paramsSerializer:{serialize:function(s){return Xi.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Le()?.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&&(i.baseURL=e),i}function Ce(n,e,t,o,r="json",i,s){const c=Cn(t,e,o,r,i);return s&&s>=2e4&&(c.timeout=s),B.Axios?.get(n,c).catch(function(u){St(u,e,n,"Get")})}function St(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(g>0&&S-g>2){const E=u.substring(g+2,S);E.indexOf("System.Exception")>0?n.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,n.message=E)}else i=!0,n.message=u}else n.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:n.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:n.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:n.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:n.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:n.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:n.message=`\u8FDE\u63A5\u9519\u8BEF${n.response.status}`}let c={address:r,code:s,isExceptionInfo:i,message:n.message,result:n.response.data};if(B.EventBus.emit(se.AxiosRequestErrorEvent,c),i)throw new Error(n.message)}else{if(n?.message)throw new Error(n.message);console.error(n,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Fo(n,e,t,o,r,i="json",s){const c=Cn(o,e,r,i);s&&s>=2e4&&(c.timeout=s),c.headers["Content-Type"]="multipart/form-data";const u=function(g){let S=new FormData;return g&&Object.keys(g).forEach(E=>{if(!g)return;let L=g[E];L!=null&&(hn(L)?L.forEach(O=>{S.append(E,Vo(O))}):S.append(E,Vo(L)))}),S}(t);return B.Axios?.post(n,u,c).catch(function(g){St(g,e,n,"Post")})}function Xo(n,e,t,o,r,i="json",s){const c=Cn(o,e,r,i);return s&&s>=2e4&&(c.timeout=s),B.Axios?.post(n,t,c).catch(function(u){St(u,e,n,"Post")})}function Ns(n,e){return Ce(n,void 0,e)}function Bs(n,e){return Fo(n,void 0,e)}function Ws(n,e){return B.Axios?.get(n,{params:e}).catch(function(t){St(t,n,"","\u5916\u90E8Get")})}function Vo(n){return n instanceof Blob?n:n.toString()}var Ko,Go,En,Jo,kn,Yo,xn,Zo,Qo,Ct={exports:{}};function Us(){return Go?Ko:(Go=1,n=typeof window<"u"?window:qe!==void 0?qe:typeof self<"u"?self:{},Ko=n);var n}function Os(){if(Jo)return En;Jo=1,En=function(e){if(!e)return!1;var t=n.call(e);return t==="[object Function]"||typeof e=="function"&&t!=="[object RegExp]"||typeof window<"u"&&(e===window.setTimeout||e===window.alert||e===window.confirm||e===window.prompt)};var n=Object.prototype.toString;return En}function js(){if(Yo)return kn;Yo=1;var n=function(e){return e.replace(/^\s+|\s+$/g,"")};return kn=function(e){if(!e)return{};for(var t,o={},r=n(e).split(`
|
|
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},kn}var Hs=function(){if(Qo)return Ct.exports;Qo=1;var n=Us(),e=Os(),t=js(),o=function(){if(Zo)return xn;Zo=1,xn=function(){for(var u={},g=0;g<arguments.length;g++){var S=arguments[g];for(var E in S)c.call(S,E)&&(u[E]=S[E])}return u};var c=Object.prototype.hasOwnProperty;return xn}();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(M,N,U){u||(u=!0,c.callback(M,N,U))};function S(){var M=void 0;if(M=p.response?p.response:p.responseText||function(N){try{if(N.responseType==="document")return N.responseXML;var U=N.responseXML&&N.responseXML.documentElement.nodeName==="parsererror";if(N.responseType===""&&!U)return N.responseXML}catch{}return null}(p),z)try{M=JSON.parse(M)}catch{}return M}function E(M){return clearTimeout(l),M instanceof Error||(M=new Error(""+(M||"Unknown XMLHttpRequest Error"))),M.statusCode=0,g(M,A)}function L(){if(!I){var M;clearTimeout(l),M=c.useXDR&&p.status===void 0?200:p.status===1223?204:p.status;var N=A,U=null;return M!==0?(N={body:S(),statusCode:M,method:m,headers:{},url:y,rawRequest:p},p.getAllResponseHeaders&&(N.headers=t(p.getAllResponseHeaders()))):U=new Error("Internal XMLHttpRequest Error"),g(U,N,N.body)}}var O,I,p=c.xhr||null;p||(p=c.cors||c.useXDR?new i.XDomainRequest:new i.XMLHttpRequest);var l,y=p.url=c.uri||c.url,m=p.method=c.method||"GET",d=c.body||c.data,v=p.headers=c.headers||{},$=!!c.sync,z=!1,A={body:void 0,headers:{},statusCode:0,method:m,url:y,rawRequest:p};if("json"in c&&c.json!==!1&&(z=!0,v.accept||v.Accept||(v.Accept="application/json"),m!=="GET"&&m!=="HEAD"&&(v["content-type"]||v["Content-Type"]||(v["Content-Type"]="application/json"),d=JSON.stringify(c.json===!0?d:c.json))),p.onreadystatechange=function(){p.readyState===4&&setTimeout(L,0)},p.onload=L,p.onerror=E,p.onprogress=function(){},p.onabort=function(){I=!0},p.ontimeout=E,p.open(m,y,!$,c.username,c.password),$||(p.withCredentials=!!c.withCredentials),!$&&c.timeout>0&&(l=setTimeout(function(){if(!I){I=!0,p.abort("timeout");var M=new Error("XMLHttpRequest timeout");M.code="ETIMEDOUT",E(M)}},c.timeout)),p.setRequestHeader)for(O in v)v.hasOwnProperty(O)&&p.setRequestHeader(O,v[O]);else if(c.headers&&!function(M){for(var N in M)if(M.hasOwnProperty(N))return!1;return!0}(c.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in c&&(p.responseType=c.responseType),"beforeSend"in c&&typeof c.beforeSend=="function"&&c.beforeSend(p),p.send(d||null),p}return Ct.exports=i,Ct.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)}}),Ct.exports}(),qs=vt(Hs);const Fs=[200,201,202,204,308],Xs=[408,502,503,504];class er{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=yn(),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=qs({...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&&Xs.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 Vs=n=>new er(n),Ks=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 it{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!yt.isNullOrEmpty(e)){if(it.httpTransport||(it.httpTransport=new Gi),this.client=new Vi(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")):De.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 Ge{hproseClient;hpProxyObj;defaultContext=new en;constructor(e){this.hproseClient=new it(e),this.hpProxyObj=null}getClientContext(e,t){const o={};t&&(o.requestHeaders=t);const r=Le();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 en(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||De.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=Le();return console.log(r,"userToken3"),r&&(t||(t=new en({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,t)}async hproseInvokeEncode(e){const t=new xe(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 xe.toString(o)}}const In=new Map,Gs=function(n,e,t){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&yt.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new Ge(B.Config.DefaultHproseAPI));const o=B.Config.UI.GrayMode;o&&he.setGrayMode(o);const r=new Oo(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 tr(n){if(n&&yt.isNotEmpty(n)){if(In.has(n))return In.get(n);{const e=new Ge(n);return In.set(n,e),e}}}function Js(n){const e=tr(n);return e&&(B.DefaultProxyClient=e),e}const Tn="is_LockScreen",nr=Se.get(Tn,!1),Je={isLock:nr,lockTime:nr=="true"?rr():0};function or(n){Je.isLock=n,Se.set(Tn,n,10),n&&(Sn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ys(){return Se.get(Tn,!1)}function rr(){let n=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(n=B.Config.UI.LockTime),n}let Rn;function Pn(){clearInterval(Rn),!(window.location.href.indexOf("/login")>0||Je.isLock)&&(or(!1),Je.lockTime=rr(),Rn=setInterval(()=>{if(Je.lockTime--,Je.lockTime<=0)return or(!0),clearInterval(Rn)},1e3))}function Zs(){Pn(),document.addEventListener("mousedown",Pn)}function Qs(){document.removeEventListener("mousedown",Pn)}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 ir,sr={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 Hr,Ya=Ur?Fr.exports:(Ur=1,Fr.exports=function e(t,n,o){function r(a,l){if(!n[a]){if(!t[a]){if(!l&&Qn)return Qn(a);if(i)return i(a,!0);var h=new Error("Cannot find module '"+a+"'");throw h.code="MODULE_NOT_FOUND",h}var w=n[a]={exports:{}};t[a][0].call(w.exports,function(_){var k=t[a][1][_];return r(k||_)},w,w.exports,e,t,n,o)}return n[a].exports}for(var i=Qn,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(e,t,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var a=0,l=new s(k),h=o.document.createTextNode("");l.observe(h,{characterData:!0}),r=function(){h.data=a=++a%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var I=o.document.createElement("script");I.onreadystatechange=function(){k(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(k,0)};else{var w=new o.MessageChannel;w.port1.onmessage=k,r=function(){w.port2.postMessage(0)}}var _=[];function k(){var I,p;i=!0;for(var u=_.length;u;){for(p=_,_=[],I=-1;++I<u;)p[I]();u=_.length}i=!1}function $(I){_.push(I)!==1||i||r()}t.exports=$}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},s=["REJECTED"],a=["FULFILLED"],l=["PENDING"];function h(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,d!==r&&$(this,d)}function w(d,f,z){this.promise=d,typeof f=="function"&&(this.onFulfilled=f,this.callFulfilled=this.otherCallFulfilled),typeof z=="function"&&(this.onRejected=z,this.callRejected=this.otherCallRejected)}function _(d,f,z){o(function(){var L;try{L=f(z)}catch(D){return i.reject(d,D)}L===d?i.reject(d,new TypeError("Cannot resolve promise with itself")):i.resolve(d,L)})}function k(d){var f=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof f=="function")return function(){f.apply(d,arguments)}}function $(d,f){var z=!1;function L(O){z||(z=!0,i.reject(d,O))}function D(O){z||(z=!0,i.resolve(d,O))}function M(){f(D,L)}var N=I(M);N.status==="error"&&L(N.value)}function I(d,f){var z={};try{z.value=d(f),z.status="success"}catch(L){z.status="error",z.value=L}return z}function p(d){return d instanceof this?d:i.resolve(new this(r),d)}function u(d){var f=new this(r);return i.reject(f,d)}function v(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=new Array(z),M=0,N=-1,O=new this(r);++N<z;)T(d[N],N);return O;function T(W,q){function it(Z){D[q]=Z,++M!==z||L||(L=!0,i.resolve(O,D))}f.resolve(W).then(it,function(Z){L||(L=!0,i.reject(O,Z))})}}function y(d){var f=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var z=d.length,L=!1;if(!z)return this.resolve([]);for(var D=-1,M=new this(r);++D<z;)N(d[D]);return M;function N(O){f.resolve(O).then(function(T){L||(L=!0,i.resolve(M,T))},function(T){L||(L=!0,i.reject(M,T))})}}t.exports=h,h.prototype.catch=function(d){return this.then(null,d)},h.prototype.then=function(d,f){if(typeof d!="function"&&this.state===a||typeof f!="function"&&this.state===s)return this;var z=new this.constructor(r);return this.state!==l?_(z,this.state===a?d:f,this.outcome):this.queue.push(new w(z,d,f)),z},w.prototype.callFulfilled=function(d){i.resolve(this.promise,d)},w.prototype.otherCallFulfilled=function(d){_(this.promise,this.onFulfilled,d)},w.prototype.callRejected=function(d){i.reject(this.promise,d)},w.prototype.otherCallRejected=function(d){_(this.promise,this.onRejected,d)},i.resolve=function(d,f){var z=I(k,f);if(z.status==="error")return i.reject(d,z.value);var L=z.value;if(L)$(d,L);else{d.state=a,d.outcome=f;for(var D=-1,M=d.queue.length;++D<M;)d.queue[D].callFulfilled(f)}return d},i.reject=function(d,f){d.state=s,d.outcome=f;for(var z=-1,L=d.queue.length;++z<L;)d.queue[z].callRejected(f);return d},h.resolve=p,h.reject=u,h.all=v,h.race=y},{1:1}],3:[function(e,t,n){(function(o){typeof o.Promise!="function"&&(o.Promise=e(2))}).call(this,Gt!==void 0?Gt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function r(c,g){if(!(c 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 c=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(!c||g)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function l(c,g){c=c||[],g=g||{};try{return new Blob(c,g)}catch(b){if(b.name!=="TypeError")throw b;for(var m=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),S=0;S<c.length;S+=1)m.append(c[S]);return m.getBlob(g.type)}}typeof Promise>"u"&&e(3);var h=Promise;function w(c,g){g&&c.then(function(m){g(null,m)},function(m){g(m)})}function _(c,g,m){typeof g=="function"&&c.then(g),typeof m=="function"&&c.catch(m)}function k(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function $(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",p=void 0,u={},v=Object.prototype.toString,y="readonly",d="readwrite";function f(c){for(var g=c.length,m=new ArrayBuffer(g),S=new Uint8Array(m),b=0;b<g;b++)S[b]=c.charCodeAt(b);return m}function z(c){return new h(function(g){var m=c.transaction(I,d),S=l([""]);m.objectStore(I).put(S,"key"),m.onabort=function(b){b.preventDefault(),b.stopPropagation(),g(!1)},m.oncomplete=function(){var b=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);g(C||!b||parseInt(b[1],10)>=43)}}).catch(function(){return!1})}function L(c){return typeof p=="boolean"?h.resolve(p):z(c).then(function(g){return p=g})}function D(c){var g=u[c.name],m={};m.promise=new h(function(S,b){m.resolve=S,m.reject=b}),g.deferredOperations.push(m),g.dbReady?g.dbReady=g.dbReady.then(function(){return m.promise}):g.dbReady=m.promise}function M(c){var g=u[c.name].deferredOperations.pop();if(g)return g.resolve(),g.promise}function N(c,g){var m=u[c.name].deferredOperations.pop();if(m)return m.reject(g),m.promise}function O(c,g){return new h(function(m,S){if(u[c.name]=u[c.name]||St(),c.db){if(!g)return m(c.db);D(c),c.db.close()}var b=[c.name];g&&b.push(c.version);var C=s.open.apply(s,b);g&&(C.onupgradeneeded=function(E){var R=C.result;try{R.createObjectStore(c.storeName),E.oldVersion<=1&&R.createObjectStore(I)}catch(P){if(P.name!=="ConstraintError")throw P;console.warn('The database "'+c.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+c.storeName+'" already exists.')}}),C.onerror=function(E){E.preventDefault(),S(C.error)},C.onsuccess=function(){var E=C.result;E.onversionchange=function(R){R.target.close()},m(E),M(c)}})}function T(c){return O(c,!1)}function W(c){return O(c,!0)}function q(c,g){if(!c.db)return!0;var m=!c.db.objectStoreNames.contains(c.storeName),S=c.version<c.db.version,b=c.version>c.db.version;if(S&&(c.version!==g&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),b||m){if(m){var C=c.db.version+1;C>c.version&&(c.version=C)}return!0}return!1}function it(c){return new h(function(g,m){var S=new FileReader;S.onerror=m,S.onloadend=function(b){var C=btoa(b.target.result||"");g({__local_forage_encoded_blob:!0,data:C,type:c.type})},S.readAsBinaryString(c)})}function Z(c){return l([f(atob(c.data))],{type:c.type})}function Q(c){return c&&c.__local_forage_encoded_blob}function _t(c){var g=this,m=g._initReady().then(function(){var S=u[g._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return _(m,c,c),m}function Ht(c){D(c);for(var g=u[c.name],m=g.forages,S=0;S<m.length;S++){var b=m[S];b._dbInfo.db&&(b._dbInfo.db.close(),b._dbInfo.db=null)}return c.db=null,T(c).then(function(C){return c.db=C,q(c)?W(c):C}).then(function(C){c.db=g.db=C;for(var E=0;E<m.length;E++)m[E]._dbInfo.db=C}).catch(function(C){throw N(c,C),C})}function et(c,g,m,S){S===void 0&&(S=1);try{var b=c.db.transaction(c.storeName,g);m(null,b)}catch(C){if(S>0&&(!c.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return h.resolve().then(function(){if(!c.db||C.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),W(c)}).then(function(){return Ht(c).then(function(){et(c,g,m,S-1)})}).catch(m);m(C)}}function St(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ln(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=c[S];var b=u[m.name];b||(b=St(),u[m.name]=b),b.forages.push(g),g._initReady||(g._initReady=g.ready,g.ready=_t);var C=[];function E(){return h.resolve()}for(var R=0;R<b.forages.length;R++){var P=b.forages[R];P!==g&&C.push(P._initReady().catch(E))}var A=b.forages.slice(0);return h.all(C).then(function(){return m.db=b.db,T(m)}).then(function(B){return m.db=B,q(m,g._defaultConfig.version)?W(m):B}).then(function(B){m.db=b.db=B,g._dbInfo=m;for(var U=0;U<A.length;U++){var H=A[U];H!==g&&(H._dbInfo.db=m.db,H._dbInfo.version=m.version)}})}function un(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).get(c);P.onsuccess=function(){var A=P.result;A===void 0&&(A=null),Q(A)&&(A=Z(A)),b(A)},P.onerror=function(){C(P.error)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function hn(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).openCursor(),A=1;P.onsuccess=function(){var B=P.result;if(B){var U=B.value;Q(U)&&(U=Z(U));var H=c(U,B.key,A++);H!==void 0?b(H):B.continue()}else b()},P.onerror=function(){C(P.error)}}catch(B){C(B)}})}).catch(C)});return w(S,g),S}function me(c,g,m){var S=this;c=k(c);var b=new h(function(C,E){var R;S.ready().then(function(){return R=S._dbInfo,v.call(g)==="[object Blob]"?L(R.db).then(function(P){return P?g:it(g)}):g}).then(function(P){et(S._dbInfo,d,function(A,B){if(A)return E(A);try{var U=B.objectStore(S._dbInfo.storeName);P===null&&(P=void 0);var H=U.put(P,c);B.oncomplete=function(){P===void 0&&(P=null),C(P)},B.onabort=B.onerror=function(){var V=H.error?H.error:H.transaction.error;E(V)}}catch(V){E(V)}})}).catch(E)});return w(b,m),b}function Zt(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){et(m._dbInfo,d,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName).delete(c);R.oncomplete=function(){b()},R.onerror=function(){C(P.error)},R.onabort=function(){var A=P.error?P.error:P.transaction.error;C(A)}}catch(A){C(A)}})}).catch(C)});return w(S,g),S}function Qt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,d,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).clear();E.oncomplete=function(){S()},E.onabort=E.onerror=function(){var P=R.error?R.error:R.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function yt(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).count();R.onsuccess=function(){S(R.result)},R.onerror=function(){b(R.error)}}catch(P){b(P)}})}).catch(b)});return w(m,c),m}function ve(c,g){var m=this,S=new h(function(b,C){c<0?b(null):m.ready().then(function(){et(m._dbInfo,y,function(E,R){if(E)return C(E);try{var P=R.objectStore(m._dbInfo.storeName),A=!1,B=P.openKeyCursor();B.onsuccess=function(){var U=B.result;U?c===0||A?b(U.key):(A=!0,U.advance(c)):b(null)},B.onerror=function(){C(B.error)}}catch(U){C(U)}})}).catch(C)});return w(S,g),S}function ye(c){var g=this,m=new h(function(S,b){g.ready().then(function(){et(g._dbInfo,y,function(C,E){if(C)return b(C);try{var R=E.objectStore(g._dbInfo.storeName).openKeyCursor(),P=[];R.onsuccess=function(){var A=R.result;A?(P.push(A.key),A.continue()):S(P)},R.onerror=function(){b(R.error)}}catch(A){b(A)}})}).catch(b)});return w(m,c),m}function te(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;if(c.name){var C=c.name===m.name&&b._dbInfo.db?h.resolve(b._dbInfo.db):T(c).then(function(E){var R=u[c.name],P=R.forages;R.db=E;for(var A=0;A<P.length;A++)P[A]._dbInfo.db=E;return E});S=c.storeName?C.then(function(E){if(E.objectStoreNames.contains(c.storeName)){var R=E.version+1;D(c);var P=u[c.name],A=P.forages;E.close();for(var B=0;B<A.length;B++){var U=A[B];U._dbInfo.db=null,U._dbInfo.version=R}var H=new h(function(V,G){var at=s.open(c.name,R);at.onerror=function(xt){at.result.close(),G(xt)},at.onupgradeneeded=function(){at.result.deleteObjectStore(c.storeName)},at.onsuccess=function(){var xt=at.result;xt.close(),V(xt)}});return H.then(function(V){P.db=V;for(var G=0;G<A.length;G++){var at=A[G];at._dbInfo.db=V,M(at._dbInfo)}}).catch(function(V){throw(N(c,V)||h.resolve()).catch(function(){}),V})}}):C.then(function(E){D(c);var R=u[c.name],P=R.forages;E.close();for(var A=0;A<P.length;A++)P[A]._dbInfo.db=null;var B=new h(function(U,H){var V=s.deleteDatabase(c.name);V.onerror=function(){var G=V.result;G&&G.close(),H(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},V.onsuccess=function(){var G=V.result;G&&G.close(),U(G)}});return B.then(function(U){R.db=U;for(var H=0;H<P.length;H++)M(P[H]._dbInfo)}).catch(function(U){throw(N(c,U)||h.resolve()).catch(function(){}),U})})}else S=h.reject("Invalid arguments");return w(S,g),S}var we={_driver:"asyncStorage",_initStorage:ln,_support:a(),iterate:hn,getItem:un,setItem:me,removeItem:Zt,clear:Qt,length:yt,key:ve,keys:ye,dropInstance:te};function ee(){return typeof openDatabase=="function"}var wt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Gi="~~local_forage_type~",Bo=/^~~local_forage_type~([^~]+)~/,be="__lfsc__:",dn=be.length,fn="arbf",pn="blob",jo="si08",Oo="ui08",Wo="uic8",Uo="si16",Fo="si32",Ho="ur16",qo="ui32",Xo="fl32",Vo="fl64",Go=dn+fn.length,Ko=Object.prototype.toString;function Jo(c){var g,m,S,b,C,E=.75*c.length,R=c.length,P=0;c[c.length-1]==="="&&(E--,c[c.length-2]==="="&&E--);var A=new ArrayBuffer(E),B=new Uint8Array(A);for(g=0;g<R;g+=4)m=wt.indexOf(c[g]),S=wt.indexOf(c[g+1]),b=wt.indexOf(c[g+2]),C=wt.indexOf(c[g+3]),B[P++]=m<<2|S>>4,B[P++]=(15&S)<<4|b>>2,B[P++]=(3&b)<<6|63&C;return A}function gn(c){var g,m=new Uint8Array(c),S="";for(g=0;g<m.length;g+=3)S+=wt[m[g]>>2],S+=wt[(3&m[g])<<4|m[g+1]>>4],S+=wt[(15&m[g+1])<<2|m[g+2]>>6],S+=wt[63&m[g+2]];return m.length%3==2?S=S.substring(0,S.length-1)+"=":m.length%3==1&&(S=S.substring(0,S.length-2)+"=="),S}function Ki(c,g){var m="";if(c&&(m=Ko.call(c)),c&&(m==="[object ArrayBuffer]"||c.buffer&&Ko.call(c.buffer)==="[object ArrayBuffer]")){var S,b=be;c instanceof ArrayBuffer?(S=c,b+=fn):(S=c.buffer,m==="[object Int8Array]"?b+=jo:m==="[object Uint8Array]"?b+=Oo:m==="[object Uint8ClampedArray]"?b+=Wo:m==="[object Int16Array]"?b+=Uo:m==="[object Uint16Array]"?b+=Ho:m==="[object Int32Array]"?b+=Fo:m==="[object Uint32Array]"?b+=qo:m==="[object Float32Array]"?b+=Xo:m==="[object Float64Array]"?b+=Vo:g(new Error("Failed to get type for BinaryArray"))),g(b+gn(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var E=Gi+c.type+"~"+gn(this.result);g(be+pn+E)},C.readAsArrayBuffer(c)}else try{g(JSON.stringify(c))}catch(E){console.error("Couldn't convert value into a JSON string: ",c),g(null,E)}}function Ji(c){if(c.substring(0,dn)!==be)return JSON.parse(c);var g,m=c.substring(Go),S=c.substring(dn,Go);if(S===pn&&Bo.test(m)){var b=m.match(Bo);g=b[1],m=m.substring(b[0].length)}var C=Jo(m);switch(S){case fn:return C;case pn:return l([C],{type:g});case jo:return new Int8Array(C);case Oo:return new Uint8Array(C);case Wo:return new Uint8ClampedArray(C);case Uo:return new Int16Array(C);case Ho:return new Uint16Array(C);case Fo:return new Int32Array(C);case qo:return new Uint32Array(C);case Xo:return new Float32Array(C);case Vo:return new Float64Array(C);default:throw new Error("Unkown type: "+S)}}var mn={serialize:Ki,deserialize:Ji,stringToBuffer:Jo,bufferToString:gn};function Yo(c,g,m,S){c.executeSql("CREATE TABLE IF NOT EXISTS "+g.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Yi(c){var g=this,m={db:null};if(c)for(var S in c)m[S]=typeof c[S]!="string"?c[S].toString():c[S];var b=new h(function(C,E){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(R){return E(R)}m.db.transaction(function(R){Yo(R,m,function(){g._dbInfo=m,C()},function(P,A){E(A)})},E)});return m.serializer=mn,b}function Tt(c,g,m,S,b,C){c.executeSql(m,S,b,function(E,R){R.code===R.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[g.storeName],function(P,A){A.rows.length?C(P,R):Yo(P,g,function(){P.executeSql(m,S,b,C)},C)},C):C(E,R)},C)}function Zi(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[c],function(P,A){var B=A.rows.length?A.rows.item(0).value:null;B&&(B=E.serializer.deserialize(B)),b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Qi(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT * FROM "+E.storeName,[],function(P,A){for(var B=A.rows,U=B.length,H=0;H<U;H++){var V=B.item(H),G=V.value;if(G&&(G=E.serializer.deserialize(G)),(G=c(G,V.key,H+1))!==void 0)return void b(G)}b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function Zo(c,g,m,S){var b=this;c=k(c);var C=new h(function(E,R){b.ready().then(function(){g===void 0&&(g=null);var P=g,A=b._dbInfo;A.serializer.serialize(g,function(B,U){U?R(U):A.db.transaction(function(H){Tt(H,A,"INSERT OR REPLACE INTO "+A.storeName+" (key, value) VALUES (?, ?)",[c,B],function(){E(P)},function(V,G){R(G)})},function(H){if(H.code===H.QUOTA_ERR){if(S>0)return void E(Zo.apply(b,[c,P,m,S-1]));R(H)}})})}).catch(R)});return w(C,m),C}function ts(c,g,m){return Zo.apply(this,[c,g,m,1])}function es(c,g){var m=this;c=k(c);var S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[c],function(){b()},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function ns(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"DELETE FROM "+C.storeName,[],function(){S()},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function os(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(R,P){var A=P.rows.item(0).c;S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function rs(c,g){var m=this,S=new h(function(b,C){m.ready().then(function(){var E=m._dbInfo;E.db.transaction(function(R){Tt(R,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[c+1],function(P,A){var B=A.rows.length?A.rows.item(0).key:null;b(B)},function(P,A){C(A)})})}).catch(C)});return w(S,g),S}function is(c){var g=this,m=new h(function(S,b){g.ready().then(function(){var C=g._dbInfo;C.db.transaction(function(E){Tt(E,C,"SELECT key FROM "+C.storeName,[],function(R,P){for(var A=[],B=0;B<P.rows.length;B++)A.push(P.rows.item(B).key);S(A)},function(R,P){b(P)})})}).catch(b)});return w(m,c),m}function ss(c){return new h(function(g,m){c.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(b,C){for(var E=[],R=0;R<C.rows.length;R++)E.push(C.rows.item(R).name);g({db:c,storeNames:E})},function(b,C){m(C)})},function(S){m(S)})})}function as(c,g){g=$.apply(this,arguments);var m=this.config();(c=typeof c!="function"&&c||{}).name||(c.name=c.name||m.name,c.storeName=c.storeName||m.storeName);var S,b=this;return S=c.name?new h(function(C){var E;E=c.name===m.name?b._dbInfo.db:openDatabase(c.name,"","",0),c.storeName?C({db:E,storeNames:[c.storeName]}):C(ss(E))}).then(function(C){return new h(function(E,R){C.db.transaction(function(P){function A(V){return new h(function(G,at){P.executeSql("DROP TABLE IF EXISTS "+V,[],function(){G()},function(xt,wn){at(wn)})})}for(var B=[],U=0,H=C.storeNames.length;U<H;U++)B.push(A(C.storeNames[U]));h.all(B).then(function(){E()}).catch(function(V){R(V)})},function(P){R(P)})})}):h.reject("Invalid arguments"),w(S,g),S}var cs={_driver:"webSQLStorage",_initStorage:Yi,_support:ee(),iterate:Qi,getItem:Zi,setItem:ts,removeItem:es,clear:ns,length:os,key:rs,keys:is,dropInstance:as};function ls(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Qo(c,g){var m=c.name+"/";return c.storeName!==g.storeName&&(m+=c.storeName+"/"),m}function us(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function hs(){return!us()||localStorage.length>0}function ds(c){var g=this,m={};if(c)for(var S in c)m[S]=c[S];return m.keyPrefix=Qo(c,g._defaultConfig),hs()?(g._dbInfo=m,m.serializer=mn,h.resolve()):h.reject()}function fs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo.keyPrefix,b=localStorage.length-1;b>=0;b--){var C=localStorage.key(b);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,c),m}function ps(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo,C=localStorage.getItem(b.keyPrefix+c);return C&&(C=b.serializer.deserialize(C)),C});return w(S,g),S}function gs(c,g){var m=this,S=m.ready().then(function(){for(var b=m._dbInfo,C=b.keyPrefix,E=C.length,R=localStorage.length,P=1,A=0;A<R;A++){var B=localStorage.key(A);if(B.indexOf(C)===0){var U=localStorage.getItem(B);if(U&&(U=b.serializer.deserialize(U)),(U=c(U,B.substring(E),P++))!==void 0)return U}}});return w(S,g),S}function ms(c,g){var m=this,S=m.ready().then(function(){var b,C=m._dbInfo;try{b=localStorage.key(c)}catch{b=null}return b&&(b=b.substring(C.keyPrefix.length)),b});return w(S,g),S}function vs(c){var g=this,m=g.ready().then(function(){for(var S=g._dbInfo,b=localStorage.length,C=[],E=0;E<b;E++){var R=localStorage.key(E);R.indexOf(S.keyPrefix)===0&&C.push(R.substring(S.keyPrefix.length))}return C});return w(m,c),m}function ys(c){var g=this.keys().then(function(m){return m.length});return w(g,c),g}function ws(c,g){var m=this;c=k(c);var S=m.ready().then(function(){var b=m._dbInfo;localStorage.removeItem(b.keyPrefix+c)});return w(S,g),S}function bs(c,g,m){var S=this;c=k(c);var b=S.ready().then(function(){g===void 0&&(g=null);var C=g;return new h(function(E,R){var P=S._dbInfo;P.serializer.serialize(g,function(A,B){if(B)R(B);else try{localStorage.setItem(P.keyPrefix+c,A),E(C)}catch(U){U.name!=="QuotaExceededError"&&U.name!=="NS_ERROR_DOM_QUOTA_REACHED"||R(U),R(U)}})})});return w(b,m),b}function _s(c,g){if(g=$.apply(this,arguments),!(c=typeof c!="function"&&c||{}).name){var m=this.config();c.name=c.name||m.name,c.storeName=c.storeName||m.storeName}var S,b=this;return S=c.name?new h(function(C){c.storeName?C(Qo(c,b._defaultConfig)):C(c.name+"/")}).then(function(C){for(var E=localStorage.length-1;E>=0;E--){var R=localStorage.key(E);R.indexOf(C)===0&&localStorage.removeItem(R)}}):h.reject("Invalid arguments"),w(S,g),S}var Ss={_driver:"localStorageWrapper",_initStorage:ds,_support:ls(),iterate:gs,getItem:ps,setItem:bs,removeItem:ws,clear:fs,length:ys,key:ms,keys:vs,dropInstance:_s},Cs=function(c,g){return c===g||typeof c=="number"&&typeof g=="number"&&isNaN(c)&&isNaN(g)},Es=function(c,g){for(var m=c.length,S=0;S<m;){if(Cs(c[S],g))return!0;S++}return!1},tr=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},ne={},er={},qt={INDEXEDDB:we,WEBSQL:cs,LOCALSTORAGE:Ss},xs=[qt.INDEXEDDB._driver,qt.WEBSQL._driver,qt.LOCALSTORAGE._driver],_e=["dropInstance"],vn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_e),ks={description:"",driver:xs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Is(c,g){c[g]=function(){var m=arguments;return c.ready().then(function(){return c[g].apply(c,m)})}}function yn(){for(var c=1;c<arguments.length;c++){var g=arguments[c];if(g)for(var m in g)g.hasOwnProperty(m)&&(tr(g[m])?arguments[0][m]=g[m].slice():arguments[0][m]=g[m])}return arguments[0]}var Ts=function(){function c(g){for(var m in r(this,c),qt)if(qt.hasOwnProperty(m)){var S=qt[m],b=S._driver;this[m]=b,ne[b]||this.defineDriver(S)}this._defaultConfig=yn({},ks),this._config=yn({},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 c.prototype.config=function(g){if((g===void 0?"undefined":o(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in g){if(m==="storeName"&&(g[m]=g[m].replace(/\W/g,"_")),m==="version"&&typeof g[m]!="number")return new Error("Database version must be a number.");this._config[m]=g[m]}return!("driver"in g)||!g.driver||this.setDriver(this._config.driver)}return typeof g=="string"?this._config[g]:this._config},c.prototype.defineDriver=function(g,m,S){var b=new h(function(C,E){try{var R=g._driver,P=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver)return void E(P);for(var A=vn.concat("_initStorage"),B=0,U=A.length;B<U;B++){var H=A[B];if((!Es(_e,H)||g[H])&&typeof g[H]!="function")return void E(P)}var V=function(){for(var at=function(Ms){return function(){var Ps=new Error("Method "+Ms+" is not implemented by the current driver"),nr=h.reject(Ps);return w(nr,arguments[arguments.length-1]),nr}},xt=0,wn=_e.length;xt<wn;xt++){var bn=_e[xt];g[bn]||(g[bn]=at(bn))}};V();var G=function(at){ne[R]&&console.info("Redefining LocalForage driver: "+R),ne[R]=g,er[R]=at,C()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(G,E):G(!!g._support):G(!0)}catch(at){E(at)}});return _(b,m,S),b},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(g,m,S){var b=ne[g]?h.resolve(ne[g]):h.reject(new Error("Driver not found."));return _(b,m,S),b},c.prototype.getSerializer=function(g){var m=h.resolve(mn);return _(m,g),m},c.prototype.ready=function(g){var m=this,S=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return _(S,g,g),S},c.prototype.setDriver=function(g,m,S){var b=this;tr(g)||(g=[g]);var C=this._getSupportedDrivers(g);function E(){b._config.driver=b.driver()}function R(B){return b._extend(B),E(),b._ready=b._initStorage(b._config),b._ready}function P(B){return function(){var U=0;function H(){for(;U<B.length;){var V=B[U];return U++,b._dbInfo=null,b._ready=null,b.getDriver(V).then(R).catch(H)}E();var G=new Error("No available storage method found.");return b._driverSet=h.reject(G),b._driverSet}return H()}}var A=this._driverSet!==null?this._driverSet.catch(function(){return h.resolve()}):h.resolve();return this._driverSet=A.then(function(){var B=C[0];return b._dbInfo=null,b._ready=null,b.getDriver(B).then(function(U){b._driver=U._driver,E(),b._wrapLibraryMethodsWithReady(),b._initDriver=P(C)})}).catch(function(){E();var B=new Error("No available storage method found.");return b._driverSet=h.reject(B),b._driverSet}),_(this._driverSet,m,S),this._driverSet},c.prototype.supports=function(g){return!!er[g]},c.prototype._extend=function(g){yn(this,g)},c.prototype._getSupportedDrivers=function(g){for(var m=[],S=0,b=g.length;S<b;S++){var C=g[S];this.supports(C)&&m.push(C)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,m=vn.length;g<m;g++)Is(this,vn[g])},c.prototype.createInstance=function(g){return new c(g)},c}(),Rs=new Ts;t.exports=Rs},{3:3}]},{},[4])(4)),Be=Pe(Ya),qr={exports:{}},Za=(Hr||(Hr=1,function(e){((t,n)=>{e.exports=n()})(0,()=>{const t=typeof window=="object"?window:this;t.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,o=!1;const r=t.WebStreamsPolyfill||{},i=t.isSecureContext;let s=/constructor/i.test(t.HTMLElement)||!!t.safari||!!t.WebKitPoint;const a=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",l={createWriteStream:function(w,_,k){let $={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,p=null,u=null,v=null;if(Number.isFinite(_)?([k,_]=[_,k],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),$.size=k,$.writableStrategy=_):$=_||{},!s){n||(n=i?h(l.mitm):function(z){const L="width=200,height=100",D=document.createDocumentFragment(),M={frame:t.open(z,"popup",L),loaded:!1,isIframe:!1,isPopup:!0,remove(){M.frame.close()},addEventListener(...O){D.addEventListener(...O)},dispatchEvent(...O){D.dispatchEvent(...O)},removeEventListener(...O){D.removeEventListener(...O)},postMessage(...O){M.frame.postMessage(...O)}},N=O=>{O.source===M.frame&&(M.loaded=!0,t.removeEventListener("message",N),M.dispatchEvent(new Event("load")))};return t.addEventListener("message",N),M}(l.mitm)),u=new MessageChannel,w=encodeURIComponent(w.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const d={transferringReadable:o,pathname:$.pathname||Math.random().toString().slice(-6)+"/"+w,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+w}};$.size&&(d.headers["Content-Length"]=$.size);const f=[d,"*",[u.port2]];if(o){const z=a==="iframe"?void 0:{transform(D,M){if(!(D instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=D.length,M.enqueue(D),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};v=new l.TransformStream(z,$.writableStrategy,$.readableStrategy);const L=v.readable;u.port1.postMessage({readableStream:L},[L])}u.port1.onmessage=z=>{z.data.download?a==="navigate"?(n.remove(),n=null,I?location.href=z.data.download:p=z.data.download):(n.isPopup&&(n.remove(),n=null,a==="iframe"&&h(l.mitm)),h(z.data.download)):z.data.abort&&(y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...f):n.addEventListener("load",()=>{n.postMessage(...f)},{once:!0})}let y=[];return!s&&v&&v.writable||new l.WritableStream({write(d){if(!(d instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?y.push(d):(u.port1.postMessage(d),I+=d.length,p&&(location.href=p,p=null))},close(){if(s){const d=new Blob(y,{type:"application/octet-stream; charset=utf-8"}),f=document.createElement("a");f.href=URL.createObjectURL(d),f.download=w,f.click()}else u.port1.postMessage("end")},abort(){y=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},$.writableStrategy)},WritableStream:t.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 h(w){if(!w)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=w,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...k)=>_.contentWindow.postMessage(...k),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(w=>{try{w()}catch{}})(()=>{const{readable:w}=new TransformStream,_=new MessageChannel;_.port1.postMessage(w,[w]),_.port1.close(),_.port2.close(),o=!0,Object.defineProperty(l,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),l})}(qr)),qr.exports),Qa=Pe(Za);class tc{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(t,n,o=3,r=6,i=6e4){this.fileID=t,this.downloadURL=n,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=On(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(t,n){this.eventTarget.on(t,n)}dispatch(t,n){this.eventTarget.emit(t,n)}dispatchError(t){this.eventTarget.emit("error",t)}dispatchInfo(t){this.eventTarget.emit("info",t)}async queryDownloadFileMeta(t,n="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await It(n,t,o);let i=null;return r&&r.status===200&&(i=r.data),i}async getIFileMeta(){if(this.fileMetaData===null){const t=await this.currentDB?.getItem("fileinfo");this.fileMetaData=t||null}return this.fileMetaData}initIndexDB(){this.currentDB=Be.createInstance({name:this.fileID,driver:Be.INDEXEDDB})}async init(t){if(this.finishNum=0,t){const n="fileinfo";this.fileMetaData={id:t.id,name:t.name,length:t.length,downloadID:t.downloadID,chunkSize:this.chunkByteSize},this.fileName=t.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(),Be.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(t){return new Promise(n=>setTimeout(n,t))}async download(t,n){let o=t;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=j.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const a=this.cacheSize;let l=0;for(let h=0;h<this.totalChunks;h++){if(this.keys&&this.keys?.indexOf(h.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const w=h*this.chunkByteSize;let _=w+this.chunkByteSize-1;this.fileMetaData&&_>this.fileMetaData.length&&(_=this.fileMetaData.length-1);const k={range:`bytes=${w}-${_}`};for(;l>=a;)await this.sleep(200);const $=h.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${h+1}/${this.totalChunks}`),l++,It(o,n,i,k,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const p=I.data;l--,await this.currentDB?.setItem($,p),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const u=parseInt($)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(I=>{l--;const p=parseInt($)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${p}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const t=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",t)}outputProgress(t){const n=100*t/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 t=Qa.createWriteStream(this.fileName).getWriter();let n=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 a=s.getReader();for(;;){const{done:l,value:h}=await a.read();if(l)break;await t.write(h)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),Be.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function ec(e,t){let n="",o="";for(const r in t)n+=r+"="+encodeURIComponent(t[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(e)?e+n:e.replace(/\/?$/,"?")+n,o}function Xr(e={},t={}){let n;for(n in t)Lt(t[n])?e[n]=Xr(e[n],t[n]):e[n]=t[n];return e}function nc(e,t){const n=`${e}_${t}`;return ft.MD5(n)}function Vr(e){const t=function(a){if(!a)return;const l=a,h=[];if(l)for(let w of l){const _=Gr(w);_&&h.push(_)}return h}(e.bussinessRoutes),n=function(a){if(!a)return;const l=a;if(l&&l.length>0){const h=[];return l.forEach(w=>{const _=Kr(w);_&&h.push(_)}),h}}(e.widgetMenuConfig),o=function(a){if(a&&a.length>0){const l=[];return a.forEach(h=>{const w=function(_){return _?{id:_.id,label:_.label,container:_.container,preload:_.preload,afterid:_.afterid,bindid:_.bindid,group:_.group}:void 0}(h);w&&l.push(w)}),l}}(e.widgetConfig),r=function(a){if(a&&a.length>0)return a}(e.functionList),i=e.pkgObject.version,s=e.pkgObject.name;return{id:nc(s,i),name:j.Config.UI.SiteTitle,group:j.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:n,widgets:o,functions:r}}function Gr(e){if(e){let t=0;e.meta?.hidden&&(t=1);let n={path:e.path,name:e.name,title:e.meta?.title,type:t,index:e.meta?.index};if(e.children){const o=[];for(let r of e.children){const i=Gr(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Kr(e){if(!e)return;const t={name:e.name,index:e.index,path:e.path,type:e.type};return e.children&&e.children.length>0&&(t.children=[],e.children.forEach(n=>{const o=Kr(n);o&&t.children?.push(o)})),t}function oc(e,t="IconifyList.ts"){let n="",o=`const iconlist={
|
|
9
|
-
`,r=0;
|
|
10
|
-
`,o+=` '${i}':${
|
|
8
|
+
*/var ar,ea=ir?sr.exports:(ir=1,sr.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(E){var L=e[c][1][E];return r(L||E)},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(L),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 I=o.document.createElement("script");I.onreadystatechange=function(){L(),I.onreadystatechange=null,I.parentNode.removeChild(I),I=null},o.document.documentElement.appendChild(I)}:function(){setTimeout(L,0)};else{var S=new o.MessageChannel;S.port1.onmessage=L,r=function(){S.port2.postMessage(0)}}var E=[];function L(){var I,p;i=!0;for(var l=E.length;l;){for(p=E,E=[],I=-1;++I<l;)p[I]();l=E.length}i=!1}function O(I){E.push(I)!==1||i||r()}e.exports=O}).call(this,qe!==void 0?qe: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(d){if(typeof d!="function")throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,d!==r&&O(this,d)}function S(d,v,$){this.promise=d,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof $=="function"&&(this.onRejected=$,this.callRejected=this.otherCallRejected)}function E(d,v,$){o(function(){var z;try{z=v($)}catch(A){return i.reject(d,A)}z===d?i.reject(d,new TypeError("Cannot resolve promise with itself")):i.resolve(d,z)})}function L(d){var v=d&&d.then;if(d&&(typeof d=="object"||typeof d=="function")&&typeof v=="function")return function(){v.apply(d,arguments)}}function O(d,v){var $=!1;function z(U){$||($=!0,i.reject(d,U))}function A(U){$||($=!0,i.resolve(d,U))}function M(){v(A,z)}var N=I(M);N.status==="error"&&z(N.value)}function I(d,v){var $={};try{$.value=d(v),$.status="success"}catch(z){$.status="error",$.value=z}return $}function p(d){return d instanceof this?d:i.resolve(new this(r),d)}function l(d){var v=new this(r);return i.reject(v,d)}function y(d){var v=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=d.length,z=!1;if(!$)return this.resolve([]);for(var A=new Array($),M=0,N=-1,U=new this(r);++N<$;)R(d[N],N);return U;function R(j,X){function le(oe){A[X]=oe,++M!==$||z||(z=!0,i.resolve(U,A))}v.resolve(j).then(le,function(oe){z||(z=!0,i.reject(U,oe))})}}function m(d){var v=this;if(Object.prototype.toString.call(d)!=="[object Array]")return this.reject(new TypeError("must be an array"));var $=d.length,z=!1;if(!$)return this.resolve([]);for(var A=-1,M=new this(r);++A<$;)N(d[A]);return M;function N(U){v.resolve(U).then(function(R){z||(z=!0,i.resolve(M,R))},function(R){z||(z=!0,i.reject(M,R))})}}e.exports=g,g.prototype.catch=function(d){return this.then(null,d)},g.prototype.then=function(d,v){if(typeof d!="function"&&this.state===c||typeof v!="function"&&this.state===s)return this;var $=new this.constructor(r);return this.state!==u?E($,this.state===c?d:v,this.outcome):this.queue.push(new S($,d,v)),$},S.prototype.callFulfilled=function(d){i.resolve(this.promise,d)},S.prototype.otherCallFulfilled=function(d){E(this.promise,this.onFulfilled,d)},S.prototype.callRejected=function(d){i.reject(this.promise,d)},S.prototype.otherCallRejected=function(d){E(this.promise,this.onRejected,d)},i.resolve=function(d,v){var $=I(L,v);if($.status==="error")return i.reject(d,$.value);var z=$.value;if(z)O(d,z);else{d.state=c,d.outcome=v;for(var A=-1,M=d.queue.length;++A<M;)d.queue[A].callFulfilled(v)}return d},i.reject=function(d,v){d.state=s,d.outcome=v;for(var $=-1,z=d.queue.length;++$<z;)d.queue[$].callRejected(v);return d},g.resolve=p,g.reject=l,g.all=y,g.race=m},{1:1}],3:[function(n,e,t){(function(o){typeof o.Promise!="function"&&(o.Promise=n(2))}).call(this,qe!==void 0?qe: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 f=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),b=0;b<a.length;b+=1)f.append(a[b]);return f.getBlob(h.type)}}typeof Promise>"u"&&n(3);var g=Promise;function S(a,h){h&&a.then(function(f){h(null,f)},function(f){h(f)})}function E(a,h,f){typeof h=="function"&&a.then(h),typeof f=="function"&&a.catch(f)}function L(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var I="local-forage-detect-blob-support",p=void 0,l={},y=Object.prototype.toString,m="readonly",d="readwrite";function v(a){for(var h=a.length,f=new ArrayBuffer(h),b=new Uint8Array(f),w=0;w<h;w++)b[w]=a.charCodeAt(w);return f}function $(a){return new g(function(h){var f=a.transaction(I,d),b=u([""]);f.objectStore(I).put(b,"key"),f.onabort=function(w){w.preventDefault(),w.stopPropagation(),h(!1)},f.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 z(a){return typeof p=="boolean"?g.resolve(p):$(a).then(function(h){return p=h})}function A(a){var h=l[a.name],f={};f.promise=new g(function(b,w){f.resolve=b,f.reject=w}),h.deferredOperations.push(f),h.dbReady?h.dbReady=h.dbReady.then(function(){return f.promise}):h.dbReady=f.promise}function M(a){var h=l[a.name].deferredOperations.pop();if(h)return h.resolve(),h.promise}function N(a,h){var f=l[a.name].deferredOperations.pop();if(f)return f.reject(h),f.promise}function U(a,h){return new g(function(f,b){if(l[a.name]=l[a.name]||Qn(),a.db){if(!h)return f(a.db);A(a),a.db.close()}var w=[a.name];h&&w.push(a.version);var _=s.open.apply(s,w);h&&(_.onupgradeneeded=function(C){var x=_.result;try{x.createObjectStore(a.storeName),C.oldVersion<=1&&x.createObjectStore(I)}catch(T){if(T.name!=="ConstraintError")throw T;console.warn('The database "'+a.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),_.onerror=function(C){C.preventDefault(),b(_.error)},_.onsuccess=function(){var C=_.result;C.onversionchange=function(x){x.target.close()},f(C),M(a)}})}function R(a){return U(a,!1)}function j(a){return U(a,!0)}function X(a,h){if(!a.db)return!0;var f=!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||f){if(f){var _=a.db.version+1;_>a.version&&(a.version=_)}return!0}return!1}function le(a){return new g(function(h,f){var b=new FileReader;b.onerror=f,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([v(atob(a.data))],{type:a.type})}function ye(a){return a&&a.__local_forage_encoded_blob}function st(a){var h=this,f=h._initReady().then(function(){var b=l[h._dbInfo.name];if(b&&b.dbReady)return b.dbReady});return E(f,a,a),f}function Ut(a){A(a);for(var h=l[a.name],f=h.forages,b=0;b<f.length;b++){var w=f[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)?j(a):_}).then(function(_){a.db=h.db=_;for(var C=0;C<f.length;C++)f[C]._dbInfo.db=_}).catch(function(_){throw N(a,_),_})}function me(a,h,f,b){b===void 0&&(b=1);try{var w=a.db.transaction(a.storeName,h);f(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),j(a)}).then(function(){return Ut(a).then(function(){me(a,h,f,b-1)})}).catch(f);f(_)}}function Qn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Wr(a){var h=this,f={db:null};if(a)for(var b in a)f[b]=a[b];var w=l[f.name];w||(w=Qn(),l[f.name]=w),w.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=st);var _=[];function C(){return g.resolve()}for(var x=0;x<w.forages.length;x++){var T=w.forages[x];T!==h&&_.push(T._initReady().catch(C))}var P=w.forages.slice(0);return g.all(_).then(function(){return f.db=w.db,R(f)}).then(function(D){return f.db=D,X(f,h._defaultConfig.version)?j(f):D}).then(function(D){f.db=w.db=D,h._dbInfo=f;for(var W=0;W<P.length;W++){var q=P[W];q!==h&&(q._dbInfo.db=f.db,q._dbInfo.version=f.version)}})}function Ur(a,h){var f=this;a=L(a);var b=new g(function(w,_){f.ready().then(function(){me(f._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(f._dbInfo.storeName).get(a);T.onsuccess=function(){var P=T.result;P===void 0&&(P=null),ye(P)&&(P=oe(P)),w(P)},T.onerror=function(){_(T.error)}}catch(P){_(P)}})}).catch(_)});return S(b,h),b}function Or(a,h){var f=this,b=new g(function(w,_){f.ready().then(function(){me(f._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(f._dbInfo.storeName).openCursor(),P=1;T.onsuccess=function(){var D=T.result;if(D){var W=D.value;ye(W)&&(W=oe(W));var q=a(W,D.key,P++);q!==void 0?w(q):D.continue()}else w()},T.onerror=function(){_(T.error)}}catch(D){_(D)}})}).catch(_)});return S(b,h),b}function jr(a,h,f){var b=this;a=L(a);var w=new g(function(_,C){var x;b.ready().then(function(){return x=b._dbInfo,y.call(h)==="[object Blob]"?z(x.db).then(function(T){return T?h:le(h)}):h}).then(function(T){me(b._dbInfo,d,function(P,D){if(P)return C(P);try{var W=D.objectStore(b._dbInfo.storeName);T===null&&(T=void 0);var q=W.put(T,a);D.oncomplete=function(){T===void 0&&(T=null),_(T)},D.onabort=D.onerror=function(){var V=q.error?q.error:q.transaction.error;C(V)}}catch(V){C(V)}})}).catch(C)});return S(w,f),w}function Hr(a,h){var f=this;a=L(a);var b=new g(function(w,_){f.ready().then(function(){me(f._dbInfo,d,function(C,x){if(C)return _(C);try{var T=x.objectStore(f._dbInfo.storeName).delete(a);x.oncomplete=function(){w()},x.onerror=function(){_(T.error)},x.onabort=function(){var P=T.error?T.error:T.transaction.error;_(P)}}catch(P){_(P)}})}).catch(_)});return S(b,h),b}function qr(a){var h=this,f=new g(function(b,w){h.ready().then(function(){me(h._dbInfo,d,function(_,C){if(_)return w(_);try{var x=C.objectStore(h._dbInfo.storeName).clear();C.oncomplete=function(){b()},C.onabort=C.onerror=function(){var T=x.error?x.error:x.transaction.error;w(T)}}catch(T){w(T)}})}).catch(w)});return S(f,a),f}function Fr(a){var h=this,f=new g(function(b,w){h.ready().then(function(){me(h._dbInfo,m,function(_,C){if(_)return w(_);try{var x=C.objectStore(h._dbInfo.storeName).count();x.onsuccess=function(){b(x.result)},x.onerror=function(){w(x.error)}}catch(T){w(T)}})}).catch(w)});return S(f,a),f}function Xr(a,h){var f=this,b=new g(function(w,_){a<0?w(null):f.ready().then(function(){me(f._dbInfo,m,function(C,x){if(C)return _(C);try{var T=x.objectStore(f._dbInfo.storeName),P=!1,D=T.openKeyCursor();D.onsuccess=function(){var W=D.result;W?a===0||P?w(W.key):(P=!0,W.advance(a)):w(null)},D.onerror=function(){_(D.error)}}catch(W){_(W)}})}).catch(_)});return S(b,h),b}function Vr(a){var h=this,f=new g(function(b,w){h.ready().then(function(){me(h._dbInfo,m,function(_,C){if(_)return w(_);try{var x=C.objectStore(h._dbInfo.storeName).openKeyCursor(),T=[];x.onsuccess=function(){var P=x.result;P?(T.push(P.key),P.continue()):b(T)},x.onerror=function(){w(x.error)}}catch(P){w(P)}})}).catch(w)});return S(f,a),f}function Kr(a,h){h=O.apply(this,arguments);var f=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||f.name,a.storeName=a.storeName||f.storeName);var b,w=this;if(a.name){var _=a.name===f.name&&w._dbInfo.db?g.resolve(w._dbInfo.db):R(a).then(function(C){var x=l[a.name],T=x.forages;x.db=C;for(var P=0;P<T.length;P++)T[P]._dbInfo.db=C;return C});b=a.storeName?_.then(function(C){if(C.objectStoreNames.contains(a.storeName)){var x=C.version+1;A(a);var T=l[a.name],P=T.forages;C.close();for(var D=0;D<P.length;D++){var W=P[D];W._dbInfo.db=null,W._dbInfo.version=x}var q=new g(function(V,K){var re=s.open(a.name,x);re.onerror=function(_e){re.result.close(),K(_e)},re.onupgradeneeded=function(){re.result.deleteObjectStore(a.storeName)},re.onsuccess=function(){var _e=re.result;_e.close(),V(_e)}});return q.then(function(V){T.db=V;for(var K=0;K<P.length;K++){var re=P[K];re._dbInfo.db=V,M(re._dbInfo)}}).catch(function(V){throw(N(a,V)||g.resolve()).catch(function(){}),V})}}):_.then(function(C){A(a);var x=l[a.name],T=x.forages;C.close();for(var P=0;P<T.length;P++)T[P]._dbInfo.db=null;var D=new g(function(W,q){var V=s.deleteDatabase(a.name);V.onerror=function(){var K=V.result;K&&K.close(),q(V.error)},V.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},V.onsuccess=function(){var K=V.result;K&&K.close(),W(K)}});return D.then(function(W){x.db=W;for(var q=0;q<T.length;q++)M(T[q]._dbInfo)}).catch(function(W){throw(N(a,W)||g.resolve()).catch(function(){}),W})})}else b=g.reject("Invalid arguments");return S(b,h),b}var Gr={_driver:"asyncStorage",_initStorage:Wr,_support:c(),iterate:Or,getItem:Ur,setItem:jr,removeItem:Hr,clear:qr,length:Fr,key:Xr,keys:Vr,dropInstance:Kr};function Jr(){return typeof openDatabase=="function"}var Ee="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yr="~~local_forage_type~",eo=/^~~local_forage_type~([^~]+)~/,at="__lfsc__:",Ot=at.length,jt="arbf",Ht="blob",to="si08",no="ui08",oo="uic8",ro="si16",io="si32",so="ur16",ao="ui32",co="fl32",lo="fl64",uo=Ot+jt.length,ho=Object.prototype.toString;function fo(a){var h,f,b,w,_,C=.75*a.length,x=a.length,T=0;a[a.length-1]==="="&&(C--,a[a.length-2]==="="&&C--);var P=new ArrayBuffer(C),D=new Uint8Array(P);for(h=0;h<x;h+=4)f=Ee.indexOf(a[h]),b=Ee.indexOf(a[h+1]),w=Ee.indexOf(a[h+2]),_=Ee.indexOf(a[h+3]),D[T++]=f<<2|b>>4,D[T++]=(15&b)<<4|w>>2,D[T++]=(3&w)<<6|63&_;return P}function qt(a){var h,f=new Uint8Array(a),b="";for(h=0;h<f.length;h+=3)b+=Ee[f[h]>>2],b+=Ee[(3&f[h])<<4|f[h+1]>>4],b+=Ee[(15&f[h+1])<<2|f[h+2]>>6],b+=Ee[63&f[h+2]];return f.length%3==2?b=b.substring(0,b.length-1)+"=":f.length%3==1&&(b=b.substring(0,b.length-2)+"=="),b}function Zr(a,h){var f="";if(a&&(f=ho.call(a)),a&&(f==="[object ArrayBuffer]"||a.buffer&&ho.call(a.buffer)==="[object ArrayBuffer]")){var b,w=at;a instanceof ArrayBuffer?(b=a,w+=jt):(b=a.buffer,f==="[object Int8Array]"?w+=to:f==="[object Uint8Array]"?w+=no:f==="[object Uint8ClampedArray]"?w+=oo:f==="[object Int16Array]"?w+=ro:f==="[object Uint16Array]"?w+=so:f==="[object Int32Array]"?w+=io:f==="[object Uint32Array]"?w+=ao:f==="[object Float32Array]"?w+=co:f==="[object Float64Array]"?w+=lo:h(new Error("Failed to get type for BinaryArray"))),h(w+qt(b))}else if(f==="[object Blob]"){var _=new FileReader;_.onload=function(){var C=Yr+a.type+"~"+qt(this.result);h(at+Ht+C)},_.readAsArrayBuffer(a)}else try{h(JSON.stringify(a))}catch(C){console.error("Couldn't convert value into a JSON string: ",a),h(null,C)}}function Qr(a){if(a.substring(0,Ot)!==at)return JSON.parse(a);var h,f=a.substring(uo),b=a.substring(Ot,uo);if(b===Ht&&eo.test(f)){var w=f.match(eo);h=w[1],f=f.substring(w[0].length)}var _=fo(f);switch(b){case jt:return _;case Ht:return u([_],{type:h});case to:return new Int8Array(_);case no:return new Uint8Array(_);case oo:return new Uint8ClampedArray(_);case ro:return new Int16Array(_);case so:return new Uint16Array(_);case io:return new Int32Array(_);case ao:return new Uint32Array(_);case co:return new Float32Array(_);case lo:return new Float64Array(_);default:throw new Error("Unkown type: "+b)}}var Ft={serialize:Zr,deserialize:Qr,stringToBuffer:fo,bufferToString:qt};function po(a,h,f,b){a.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],f,b)}function ei(a){var h=this,f={db:null};if(a)for(var b in a)f[b]=typeof a[b]!="string"?a[b].toString():a[b];var w=new g(function(_,C){try{f.db=openDatabase(f.name,String(f.version),f.description,f.size)}catch(x){return C(x)}f.db.transaction(function(x){po(x,f,function(){h._dbInfo=f,_()},function(T,P){C(P)})},C)});return f.serializer=Ft,w}function ke(a,h,f,b,w,_){a.executeSql(f,b,w,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(T,P){P.rows.length?_(T,x):po(T,h,function(){T.executeSql(f,b,w,_)},_)},_):_(C,x)},_)}function ti(a,h){var f=this;a=L(a);var b=new g(function(w,_){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(x){ke(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[a],function(T,P){var D=P.rows.length?P.rows.item(0).value:null;D&&(D=C.serializer.deserialize(D)),w(D)},function(T,P){_(P)})})}).catch(_)});return S(b,h),b}function ni(a,h){var f=this,b=new g(function(w,_){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(x){ke(x,C,"SELECT * FROM "+C.storeName,[],function(T,P){for(var D=P.rows,W=D.length,q=0;q<W;q++){var V=D.item(q),K=V.value;if(K&&(K=C.serializer.deserialize(K)),(K=a(K,V.key,q+1))!==void 0)return void w(K)}w()},function(T,P){_(P)})})}).catch(_)});return S(b,h),b}function go(a,h,f,b){var w=this;a=L(a);var _=new g(function(C,x){w.ready().then(function(){h===void 0&&(h=null);var T=h,P=w._dbInfo;P.serializer.serialize(h,function(D,W){W?x(W):P.db.transaction(function(q){ke(q,P,"INSERT OR REPLACE INTO "+P.storeName+" (key, value) VALUES (?, ?)",[a,D],function(){C(T)},function(V,K){x(K)})},function(q){if(q.code===q.QUOTA_ERR){if(b>0)return void C(go.apply(w,[a,T,f,b-1]));x(q)}})})}).catch(x)});return S(_,f),_}function oi(a,h,f){return go.apply(this,[a,h,f,1])}function ri(a,h){var f=this;a=L(a);var b=new g(function(w,_){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(x){ke(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[a],function(){w()},function(T,P){_(P)})})}).catch(_)});return S(b,h),b}function ii(a){var h=this,f=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(C){ke(C,_,"DELETE FROM "+_.storeName,[],function(){b()},function(x,T){w(T)})})}).catch(w)});return S(f,a),f}function si(a){var h=this,f=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(C){ke(C,_,"SELECT COUNT(key) as c FROM "+_.storeName,[],function(x,T){var P=T.rows.item(0).c;b(P)},function(x,T){w(T)})})}).catch(w)});return S(f,a),f}function ai(a,h){var f=this,b=new g(function(w,_){f.ready().then(function(){var C=f._dbInfo;C.db.transaction(function(x){ke(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[a+1],function(T,P){var D=P.rows.length?P.rows.item(0).key:null;w(D)},function(T,P){_(P)})})}).catch(_)});return S(b,h),b}function ci(a){var h=this,f=new g(function(b,w){h.ready().then(function(){var _=h._dbInfo;_.db.transaction(function(C){ke(C,_,"SELECT key FROM "+_.storeName,[],function(x,T){for(var P=[],D=0;D<T.rows.length;D++)P.push(T.rows.item(D).key);b(P)},function(x,T){w(T)})})}).catch(w)});return S(f,a),f}function li(a){return new g(function(h,f){a.transaction(function(b){b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(w,_){for(var C=[],x=0;x<_.rows.length;x++)C.push(_.rows.item(x).name);h({db:a,storeNames:C})},function(w,_){f(_)})},function(b){f(b)})})}function ui(a,h){h=O.apply(this,arguments);var f=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||f.name,a.storeName=a.storeName||f.storeName);var b,w=this;return b=a.name?new g(function(_){var C;C=a.name===f.name?w._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?_({db:C,storeNames:[a.storeName]}):_(li(C))}).then(function(_){return new g(function(C,x){_.db.transaction(function(T){function P(V){return new g(function(K,re){T.executeSql("DROP TABLE IF EXISTS "+V,[],function(){K()},function(_e,Kt){re(Kt)})})}for(var D=[],W=0,q=_.storeNames.length;W<q;W++)D.push(P(_.storeNames[W]));g.all(D).then(function(){C()}).catch(function(V){x(V)})},function(T){x(T)})})}):g.reject("Invalid arguments"),S(b,h),b}var hi={_driver:"webSQLStorage",_initStorage:ei,_support:Jr(),iterate:ni,getItem:ti,setItem:oi,removeItem:ri,clear:ii,length:si,key:ai,keys:ci,dropInstance:ui};function di(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function mo(a,h){var f=a.name+"/";return a.storeName!==h.storeName&&(f+=a.storeName+"/"),f}function fi(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function pi(){return!fi()||localStorage.length>0}function gi(a){var h=this,f={};if(a)for(var b in a)f[b]=a[b];return f.keyPrefix=mo(a,h._defaultConfig),pi()?(h._dbInfo=f,f.serializer=Ft,g.resolve()):g.reject()}function mi(a){var h=this,f=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(f,a),f}function vi(a,h){var f=this;a=L(a);var b=f.ready().then(function(){var w=f._dbInfo,_=localStorage.getItem(w.keyPrefix+a);return _&&(_=w.serializer.deserialize(_)),_});return S(b,h),b}function yi(a,h){var f=this,b=f.ready().then(function(){for(var w=f._dbInfo,_=w.keyPrefix,C=_.length,x=localStorage.length,T=1,P=0;P<x;P++){var D=localStorage.key(P);if(D.indexOf(_)===0){var W=localStorage.getItem(D);if(W&&(W=w.serializer.deserialize(W)),(W=a(W,D.substring(C),T++))!==void 0)return W}}});return S(b,h),b}function wi(a,h){var f=this,b=f.ready().then(function(){var w,_=f._dbInfo;try{w=localStorage.key(a)}catch{w=null}return w&&(w=w.substring(_.keyPrefix.length)),w});return S(b,h),b}function bi(a){var h=this,f=h.ready().then(function(){for(var b=h._dbInfo,w=localStorage.length,_=[],C=0;C<w;C++){var x=localStorage.key(C);x.indexOf(b.keyPrefix)===0&&_.push(x.substring(b.keyPrefix.length))}return _});return S(f,a),f}function _i(a){var h=this.keys().then(function(f){return f.length});return S(h,a),h}function Si(a,h){var f=this;a=L(a);var b=f.ready().then(function(){var w=f._dbInfo;localStorage.removeItem(w.keyPrefix+a)});return S(b,h),b}function Ci(a,h,f){var b=this;a=L(a);var w=b.ready().then(function(){h===void 0&&(h=null);var _=h;return new g(function(C,x){var T=b._dbInfo;T.serializer.serialize(h,function(P,D){if(D)x(D);else try{localStorage.setItem(T.keyPrefix+a,P),C(_)}catch(W){W.name!=="QuotaExceededError"&&W.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(W),x(W)}})})});return S(w,f),w}function Ei(a,h){if(h=O.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var f=this.config();a.name=a.name||f.name,a.storeName=a.storeName||f.storeName}var b,w=this;return b=a.name?new g(function(_){a.storeName?_(mo(a,w._defaultConfig)):_(a.name+"/")}).then(function(_){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(_)===0&&localStorage.removeItem(x)}}):g.reject("Invalid arguments"),S(b,h),b}var ki={_driver:"localStorageWrapper",_initStorage:gi,_support:di(),iterate:yi,getItem:vi,setItem:Ci,removeItem:Si,clear:mi,length:_i,key:wi,keys:bi,dropInstance:Ei},xi=function(a,h){return a===h||typeof a=="number"&&typeof h=="number"&&isNaN(a)&&isNaN(h)},Ii=function(a,h){for(var f=a.length,b=0;b<f;){if(xi(a[b],h))return!0;b++}return!1},vo=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Ke={},yo={},Oe={INDEXEDDB:Gr,WEBSQL:hi,LOCALSTORAGE:ki},Ti=[Oe.INDEXEDDB._driver,Oe.WEBSQL._driver,Oe.LOCALSTORAGE._driver],ct=["dropInstance"],Xt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ct),Ri={description:"",driver:Ti.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Pi(a,h){a[h]=function(){var f=arguments;return a.ready().then(function(){return a[h].apply(a,f)})}}function Vt(){for(var a=1;a<arguments.length;a++){var h=arguments[a];if(h)for(var f in h)h.hasOwnProperty(f)&&(vo(h[f])?arguments[0][f]=h[f].slice():arguments[0][f]=h[f])}return arguments[0]}var Mi=function(){function a(h){for(var f in r(this,a),Oe)if(Oe.hasOwnProperty(f)){var b=Oe[f],w=b._driver;this[f]=w,Ke[w]||this.defineDriver(b)}this._defaultConfig=Vt({},Ri),this._config=Vt({},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 f in h){if(f==="storeName"&&(h[f]=h[f].replace(/\W/g,"_")),f==="version"&&typeof h[f]!="number")return new Error("Database version must be a number.");this._config[f]=h[f]}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,f,b){var w=new g(function(_,C){try{var x=h._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!h._driver)return void C(T);for(var P=Xt.concat("_initStorage"),D=0,W=P.length;D<W;D++){var q=P[D];if((!Ii(ct,q)||h[q])&&typeof h[q]!="function")return void C(T)}var V=function(){for(var re=function(Ai){return function(){var Di=new Error("Method "+Ai+" is not implemented by the current driver"),wo=g.reject(Di);return S(wo,arguments[arguments.length-1]),wo}},_e=0,Kt=ct.length;_e<Kt;_e++){var Gt=ct[_e];h[Gt]||(h[Gt]=re(Gt))}};V();var K=function(re){Ke[x]&&console.info("Redefining LocalForage driver: "+x),Ke[x]=h,yo[x]=re,_()};"_support"in h?h._support&&typeof h._support=="function"?h._support().then(K,C):K(!!h._support):K(!0)}catch(re){C(re)}});return E(w,f,b),w},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(h,f,b){var w=Ke[h]?g.resolve(Ke[h]):g.reject(new Error("Driver not found."));return E(w,f,b),w},a.prototype.getSerializer=function(h){var f=g.resolve(Ft);return E(f,h),f},a.prototype.ready=function(h){var f=this,b=f._driverSet.then(function(){return f._ready===null&&(f._ready=f._initDriver()),f._ready});return E(b,h,h),b},a.prototype.setDriver=function(h,f,b){var w=this;vo(h)||(h=[h]);var _=this._getSupportedDrivers(h);function C(){w._config.driver=w.driver()}function x(D){return w._extend(D),C(),w._ready=w._initStorage(w._config),w._ready}function T(D){return function(){var W=0;function q(){for(;W<D.length;){var V=D[W];return W++,w._dbInfo=null,w._ready=null,w.getDriver(V).then(x).catch(q)}C();var K=new Error("No available storage method found.");return w._driverSet=g.reject(K),w._driverSet}return q()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=P.then(function(){var D=_[0];return w._dbInfo=null,w._ready=null,w.getDriver(D).then(function(W){w._driver=W._driver,C(),w._wrapLibraryMethodsWithReady(),w._initDriver=T(_)})}).catch(function(){C();var D=new Error("No available storage method found.");return w._driverSet=g.reject(D),w._driverSet}),E(this._driverSet,f,b),this._driverSet},a.prototype.supports=function(h){return!!yo[h]},a.prototype._extend=function(h){Vt(this,h)},a.prototype._getSupportedDrivers=function(h){for(var f=[],b=0,w=h.length;b<w;b++){var _=h[b];this.supports(_)&&f.push(_)}return f},a.prototype._wrapLibraryMethodsWithReady=function(){for(var h=0,f=Xt.length;h<f;h++)Pi(this,Xt[h])},a.prototype.createInstance=function(h){return new a(h)},a}(),zi=new Mi;e.exports=zi},{3:3}]},{},[4])(4)),Et=vt(ea),cr={exports:{}},ta=(ar||(ar=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,E,L){let O={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},I=0,p=null,l=null,y=null;if(Number.isFinite(E)?([L,E]=[E,L],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),O.size=L,O.writableStrategy=E):E&&E.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),O.size=L,O.writableStrategy=E):O=E||{},!s){t||(t=i?g(u.mitm):function($){const z="width=200,height=100",A=document.createDocumentFragment(),M={frame:e.open($,"popup",z),loaded:!1,isIframe:!1,isPopup:!0,remove(){M.frame.close()},addEventListener(...U){A.addEventListener(...U)},dispatchEvent(...U){A.dispatchEvent(...U)},removeEventListener(...U){A.removeEventListener(...U)},postMessage(...U){M.frame.postMessage(...U)}},N=U=>{U.source===M.frame&&(M.loaded=!0,e.removeEventListener("message",N),M.dispatchEvent(new Event("load")))};return e.addEventListener("message",N),M}(u.mitm)),l=new MessageChannel,S=encodeURIComponent(S.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const d={transferringReadable:o,pathname:O.pathname||Math.random().toString().slice(-6)+"/"+S,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+S}};O.size&&(d.headers["Content-Length"]=O.size);const v=[d,"*",[l.port2]];if(o){const $=c==="iframe"?void 0:{transform(A,M){if(!(A instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");I+=A.length,M.enqueue(A),p&&(location.href=p,p=null)},flush(){p&&(location.href=p)}};y=new u.TransformStream($,O.writableStrategy,O.readableStrategy);const z=y.readable;l.port1.postMessage({readableStream:z},[z])}l.port1.onmessage=$=>{$.data.download?c==="navigate"?(t.remove(),t=null,I?location.href=$.data.download:p=$.data.download):(t.isPopup&&(t.remove(),t=null,c==="iframe"&&g(u.mitm)),g($.data.download)):$.data.abort&&(m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null)},t.loaded?t.postMessage(...v):t.addEventListener("load",()=>{t.postMessage(...v)},{once:!0})}let m=[];return!s&&y&&y.writable||new u.WritableStream({write(d){if(!(d instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?m.push(d):(l.port1.postMessage(d),I+=d.length,p&&(location.href=p,p=null))},close(){if(s){const d=new Blob(m,{type:"application/octet-stream; charset=utf-8"}),v=document.createElement("a");v.href=URL.createObjectURL(d),v.download=S,v.click()}else l.port1.postMessage("end")},abort(){m=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null}},O.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 E=document.createElement("iframe");return E.hidden=!0,E.src=S,E.loaded=!1,E.name="iframe",E.isIframe=!0,E.postMessage=(...L)=>E.contentWindow.postMessage(...L),E.addEventListener("load",()=>{E.loaded=!0},{once:!0}),document.body.appendChild(E),E}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(S=>{try{S()}catch{}})(()=>{const{readable:S}=new TransformStream,E=new MessageChannel;E.port1.postMessage(S,[S]),E.port1.close(),E.port2.close(),o=!0,Object.defineProperty(u,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),u})}(cr)),cr.exports),na=vt(ta);class oa{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=yn(),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 Ce(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=Et.createInstance({name:this.fileID,driver:Et.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(),Et.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 E=S+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const L={range:`bytes=${S}-${E}`};for(;u>=c;)await this.sleep(200);const O=g.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${g+1}/${this.totalChunks}`),u++,Ce(o,t,i,L,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async I=>{const p=I.data;u--,await this.currentDB?.setItem(O,p),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const l=parseInt(O)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${l}/${this.totalChunks}`),this.savefile()}).catch(I=>{u--;const p=parseInt(O)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${p}\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=na.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(),Et.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function ra(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 lr(n={},e={}){let t;for(t in e)ze(e[t])?n[t]=lr(n[t],e[t]):n[t]=e[t];return n}function ia(n,e){const t=`${n}_${e}`;return he.MD5(t)}function ur(n){const e=function(c){if(!c)return;const u=c,g=[];if(u)for(let S of u){const E=hr(S);E&&g.push(E)}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 E=dr(S);E&&g.push(E)}),g}}(n.widgetMenuConfig),o=function(c){if(c&&c.length>0){const u=[];return c.forEach(g=>{const S=function(E){return E?{id:E.id,label:E.label,container:E.container,preload:E.preload,afterid:E.afterid,bindid:E.bindid,group:E.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:ia(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 hr(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=hr(r);i&&o.push(i)}o.length>0&&(t.children=o)}return t}}function dr(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=dr(t);o&&e.children?.push(o)})),e}function sa(n,e="IconifyList.ts"){let t="",o=`const iconlist={
|
|
9
|
+
`,r=0;n.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const c="icon"+r;t+=`import ${c} from '~icons/${s[0]}/${s[1]}'
|
|
10
|
+
`,o+=` '${i}':${c},
|
|
11
11
|
`,r++}}),r>0&&(o+=`};
|
|
12
|
-
`,De(n+o+"export default iconlist;","IconifyList.ts"))}function rc(e,t){const n=Vr(e);yr(n,t),j.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function ic(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d]/g,""),t=t.replace(/^0/g,""),t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t}function sc(e){let t=to(e);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function to(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[^\d.]/g,""),t=t.replace(/^0{2}$/g,"0"),t=t.replace(/^\./g,""),t=t.replace(".","$#$").replace(/\./g,"").replace("$#$","."),t=t.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),t}function ac(e){let t=e.replace(/(^\s*)|(\s*$)/g,"");return t=t.replace(/[\.]*/g,""),t=t.replace(/(^0[\d]*)$/g,"0"),t=t.replace(/^0\d$/g,"0"),t=t.replace(/[^\d]/g,""),t}function cc(e){let t=e.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function lc(e){let t=e.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function uc(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function hc(e){let t=to(e);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function dc(e,t="",n="red"){return t.replace(new RegExp(e,"gi"),`<span style='color: ${n}'>${e}</span>`)}function fc(e,t="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(e+="00").indexOf(".");o>=0&&(e=e.substring(0,o)+e.substr(o+1,2)),t=t.substr(t.length-e.length);for(let r=0;r<e.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(e.substr(r,1),1)+t.substr(r,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 pc(e){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(e)}function gc(e){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(e)}function mc(e){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(e)}function vc(e){return!!/^[a-zA-Z]\w{5,15}$/.test(e)}function yc(e){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)}function wc(e){let t="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(e)&&(t="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)&&(t="\u5F3A"),t}function bc(e){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(e)}function _c(e){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(e)}function Sc(e){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(e)}function Cc(e){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(e)}function Ec(e){return!!/^[1-9][0-9]{5}$/.test(e)}function xc(e){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(e)}function kc(e){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(e)}let Jr=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Jr=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var eo=2654435769;function Yr(e,t){var n=e.length,o=n<<2;if(t){var r=e[n-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]=e[s>>2]>>((3&s)<<3);return i}function je(e,t){var n,o=e.length,r=o>>2;3&o&&++r,t?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=e[i]<<((3&i)<<3);return n}function Bt(e){return 4294967295&e}function Oe(e,t,n,o,r,i){return(n>>>5^t<<2)+(t>>>3^n<<4)^(e^t)+(i[3&o^r]^n)}function Zr(e){if(e.length<16){var t=new Uint8Array(16);t.set(e),e=t}return e}function We(e){for(var t=e.length,n=new Uint8Array(3*t),o=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(i<128)n[o++]=i;else if(i<2048)n[o++]=192|i>>6,n[o++]=128|63&i;else{if(!(i<55296||i>57343)){if(r+1<t){var s=e.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var a=65536+((1023&i)<<10|1023&s);n[o++]=240|a>>18,n[o++]=128|a>>12&63,n[o++]=128|a>>6&63,n[o++]=128|63&a,r++;continue}}throw new Error("Malformed string")}n[o++]=224|i>>12,n[o++]=128|i>>6&63,n[o++]=128|63&i}}return n.subarray(0,o)}function Qr(e){var t=e.length;return t===0?"":t<32767?function(n,o){for(var r=new Array(o),i=0,s=0,a=n.length;i<o&&s<a;i++){var l=n[s++];switch(l>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=l;break;case 12:case 13:if(!(s<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&l)<<6|63&n[s++];break;case 14:if(!(s+1<a))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&l)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<a))throw new Error("Unfinished UTF-8 octet sequence");var h=((7&l)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=h&&h<=1048575))throw new Error("Character outside valid Unicode range: 0x"+h.toString(16));r[i++]=h>>10&1023|55296,r[i]=1023&h|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+l.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(e,t):function(n,o){for(var r=[],i=new Array(32768),s=0,a=0,l=n.length;s<o&&a<l;s++){var h=n[a++];switch(h>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=h;break;case 12:case 13:if(!(a<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&h)<<6|63&n[a++];break;case 14:if(!(a+1<l))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&h)<<12|(63&n[a++])<<6|63&n[a++];break;case 15:if(!(a+2<l))throw new Error("Unfinished UTF-8 octet sequence");var w=((7&h)<<18|(63&n[a++])<<12|(63&n[a++])<<6|63&n[a++])-65536;if(!(0<=w&&w<=1048575))throw new Error("Character outside valid Unicode range: 0x"+w.toString(16));i[s++]=w>>10&1023|55296,i[s]=1023&w|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+h.toString(16))}if(s>=32766){var _=s+1;i.length=_,r.push(String.fromCharCode.apply(String,i)),o-=_,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(e,t)}function Ic(e){var t=e.length;if(t===0)return"";var n=Jr?e:function(a){for(var l=a.length,h=new Array(a.length),w=0;w<l;++w)h[w]=a[w];return h}(e);if(t<65535)return String.fromCharCode.apply(String,n);for(var o=32767&t,r=t>>15,i=new Array(o?r+1:r),s=0;s<r;++s)i[s]=String.fromCharCode.apply(String,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,t))),i.join("")}function ti(e,t){return typeof e=="string"&&(e=We(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h,w=n.length,_=w-1;for(i=n[_],s=0,h=0|Math.floor(6+52/w);h>0;--h){for(a=(s=Bt(s+eo))>>>2&3,l=0;l<_;++l)r=n[l+1],i=n[l]=Bt(n[l]+Oe(s,r,i,l,a,o));r=n[0],i=n[_]=Bt(n[_]+Oe(s,r,i,_,a,o))}return n}(je(e,!0),je(Zr(t),!1)),!1)}function ei(e,t){return typeof e=="string"&&(e=function(n){for(var o=window.atob(n),r=o.length,i=new Uint8Array(r),s=0;s<r;s++)i[s]=o.charCodeAt(s);return i}(e)),typeof t=="string"&&(t=We(t)),e==null||e.length===0?e:Yr(function(n,o){var r,i,s,a,l,h=n.length,w=h-1;for(r=n[0],s=Bt(Math.floor(6+52/h)*eo);s!==0;s=Bt(s-eo)){for(a=s>>>2&3,l=w;l>0;--l)i=n[l-1],r=n[l]=Bt(n[l]-Oe(s,r,i,l,a,o));i=n[w],r=n[0]=Bt(n[0]-Oe(s,r,i,0,a,o))}return n}(je(e,!1),je(Zr(t),!1)),!0)}const ie={toBytes:We,toString:Qr,encrypt:ti,encryptToString:function(e,t){return window.btoa(Ic(ti(e,t)))},decrypt:ei,decryptToString:function(e,t){return Qr(ei(e,t))}},ni=e=>{const t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const n=document.createElement("canvas");n.width=200,n.height=130;const o=n.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(e,n.width/10,n.height/2);const r=document.createElement("div");return r.id=t,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(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),t},Tc={set:e=>{let t=ni(e);document.getElementById(t)===null&&(t=ni(e))},del:()=>{let e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e))}};class jt extends Error{constructor(t,n){const o=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class no extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class bt extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class Rc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Mc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class Pc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class oi extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class zc extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=o}}class ri{constructor(t,n,o){this.statusCode=t,this.statusText=n,this.content=o}}class Ue{get(t,n){return this.send({...n,method:"GET",url:t})}post(t,n){return this.send({...n,method:"POST",url:t})}delete(t,n){return this.send({...n,method:"DELETE",url:t})}getCookieString(t){return""}}var x;(function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Information=2]="Information",e[e.Warning=3]="Warning",e[e.Error=4]="Error",e[e.Critical=5]="Critical",e[e.None=6]="None"})(x||(x={}));class se{constructor(){}log(t,n){}}se.instance=new se;class ot{static isRequired(t,n){if(t==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(t,n){if(!t||t.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(t,n,o){if(!(t in n))throw new Error(`Unknown ${o} value: ${t}.`)}}class tt{static get isBrowser(){return!tt.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!tt.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!tt.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function ae(e,t){let n="";return Ot(e)?(n=`Binary data of length ${e.byteLength}`,t&&(n+=`. 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)}(e)}'`)):typeof e=="string"&&(n=`String data of length ${e.length}`,t&&(n+=`. Content: '${e}'`)),n}function Ot(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function ii(e,t,n,o,r,i){const s={},[a,l]=Kt();s[a]=l,e.log(x.Trace,`(${t} transport) sending data. ${ae(r,i.logMessageContent)}.`);const h=Ot(r)?"arraybuffer":"text",w=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:h,timeout:i.timeout,withCredentials:i.withCredentials});e.log(x.Trace,`(${t} transport) request complete. Response status: ${w.statusCode}.`)}class Ac{constructor(t,n){this._subject=t,this._observer=n}dispose(){const t=this._subject.observers.indexOf(this._observer);t>-1&&this._subject.observers.splice(t,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class Fe{constructor(t){this._minLevel=t,this.out=console}log(t,n){if(t>=this._minLevel){const o=`[${new Date().toISOString()}] ${x[t]}: ${n}`;switch(t){case x.Critical:case x.Error:this.out.error(o);break;case x.Warning:this.out.warn(o);break;case x.Information:this.out.info(o);break;default:this.out.log(o)}}}}function Kt(){let e="X-SignalR-User-Agent";return tt.isNode&&(e="User-Agent"),[e,Lc("8.0.7",Dc(),Nc(),$c())]}function Lc(e,t,n,o){let r="Microsoft SignalR/";const i=e.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${e}; `,r+=t&&t!==""?`${t}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Dc(){if(!tt.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function $c(){if(tt.isNode)return process.versions.node}function Nc(){return tt.isNode?"NodeJS":"Browser"}function oo(e){return e.stack?e.stack:e.message?e.message:`${e}`}class Bc extends Ue{constructor(t){if(super(),this._logger=t,typeof fetch>"u"||tt.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(t){if(t.abortSignal&&t.abortSignal.aborted)throw new bt;if(!t.method)throw new Error("No method defined.");if(!t.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;t.abortSignal&&(t.abortSignal.onabort=()=>{n.abort(),o=new bt});let r,i=null;if(t.timeout){const l=t.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(x.Warning,"Timeout from HTTP request."),o=new no},l)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Ot(t.content)?t.headers["Content-Type"]="application/octet-stream":t.headers["Content-Type"]="text/plain;charset=UTF-8");try{r=await this._fetchType(t.url,{body:t.content,cache:"no-cache",credentials:t.withCredentials===!0?"include":"same-origin",headers:{"X-Requested-With":"XMLHttpRequest",...t.headers},method:t.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(l){throw o||(this._logger.log(x.Warning,`Error from HTTP request. ${l}.`),l)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const l=await si(r,"text");throw new jt(l||r.statusText,r.status)}const s=si(r,t.responseType),a=await s;return new ri(r.status,r.statusText,a)}getCookieString(t){let n="";return tt.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>n=r.join("; ")),n}}function si(e,t){let n;switch(t){case"arraybuffer":n=e.arrayBuffer();break;case"text":default:n=e.text();break;case"blob":case"document":case"json":throw new Error(`${t} is not supported.`)}return n}class jc extends Ue{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?new Promise((n,o)=>{const r=new XMLHttpRequest;r.open(t.method,t.url,!0),r.withCredentials=t.withCredentials===void 0||t.withCredentials,r.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.content===""&&(t.content=void 0),t.content&&(Ot(t.content)?r.setRequestHeader("Content-Type","application/octet-stream"):r.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const i=t.headers;i&&Object.keys(i).forEach(s=>{r.setRequestHeader(s,i[s])}),t.responseType&&(r.responseType=t.responseType),t.abortSignal&&(t.abortSignal.onabort=()=>{r.abort(),o(new bt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new ri(r.status,r.statusText,r.response||r.responseText)):o(new jt(r.response||r.responseText||r.statusText,r.status))},r.onerror=()=>{this._logger.log(x.Warning,`Error from HTTP request. ${r.status}: ${r.statusText}.`),o(new jt(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(x.Warning,"Timeout from HTTP request."),o(new no)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Oc extends Ue{constructor(t){if(super(),typeof fetch<"u"||tt.isNode)this._httpClient=new Bc(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new jc(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new bt):t.method?t.url?this._httpClient.send(t):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(t){return this._httpClient.getCookieString(t)}}class mt{static write(t){return`${t}${mt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==mt.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(mt.RecordSeparator);return n.pop(),n}}mt.RecordSeparatorCode=30,mt.RecordSeparator=String.fromCharCode(mt.RecordSeparatorCode);class Wc{writeHandshakeRequest(t){return mt.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,o;if(Ot(t)){const s=new Uint8Array(t),a=s.indexOf(mt.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,l))),o=s.byteLength>l?s.slice(l).buffer:null}else{const s=t,a=s.indexOf(mt.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const l=a+1;n=s.substring(0,l),o=s.length>l?s.substring(l):null}const r=mt.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var F;(function(e){e[e.Invocation=1]="Invocation",e[e.StreamItem=2]="StreamItem",e[e.Completion=3]="Completion",e[e.StreamInvocation=4]="StreamInvocation",e[e.CancelInvocation=5]="CancelInvocation",e[e.Ping=6]="Ping",e[e.Close=7]="Close",e[e.Ack=8]="Ack",e[e.Sequence=9]="Sequence"})(F||(F={}));class Uc{constructor(){this.observers=[]}next(t){for(const n of this.observers)n.next(t)}error(t){for(const n of this.observers)n.error&&n.error(t)}complete(){for(const t of this.observers)t.complete&&t.complete()}subscribe(t){return this.observers.push(t),new Ac(this,t)}}class Fc{constructor(t,n,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=t,this._connection=n,this._bufferSize=o}async _send(t){const n=this._protocol.writeMessage(t);let o=Promise.resolve();if(this._isInvocationMessage(t)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ot(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,a)=>{r=s,i=a})),this._messages.push(new Hc(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(t){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=t.sequenceId)n=o,Ot(r._message)?this._bufferedByteCount-=r._message.byteLength:this._bufferedByteCount-=r._message.length,r._resolver();else{if(!(this._bufferedByteCount<this._bufferSize))break;r._resolver()}}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(t){if(this._waitForSequenceMessage)return t.type===F.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(t))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(t){t.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=t.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const t=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:F.Sequence,sequenceId:t}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(t){t!=null||(t=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(t)}_isInvocationMessage(t){switch(t.type){case F.Invocation:case F.StreamItem:case F.Completion:case F.StreamInvocation:case F.CancelInvocation:return!0;case F.Close:case F.Sequence:case F.Ping:case F.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:F.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Hc{constructor(t,n,o,r){this._message=t,this._id=n,this._resolver=o,this._rejector=r}}var Y;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(Y||(Y={}));class $o{static create(t,n,o,r,i,s,a){return new $o(t,n,o,r,i,s,a)}constructor(t,n,o,r,i,s,a){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(x.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")},ot.isRequired(t,"connection"),ot.isRequired(n,"logger"),ot.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=a??1e5,this._logger=n,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new Wc,this.connection.onreceive=l=>this._processIncomingData(l),this.connection.onclose=l=>this._connectionClosed(l),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:F.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(t){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(!t)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=t}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(x.Debug,"Starting HubConnection.");try{await this._startInternal(),tt.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Y.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=Y.Disconnected,this._logger.log(x.Debug,`HubConnection failed to start successfully because of error '${t}'.`),Promise.reject(t)}}async _startInternal(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const t=new Promise((n,o)=>{this._handshakeResolver=n,this._handshakeRejecter=o});await this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const o={protocol:this._protocol.name,version:n};if(this._logger.log(x.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(o)),this._logger.log(x.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),await t,this._stopDuringStartError)throw this._stopDuringStartError;this.connection.features.reconnect&&(this._messageBuffer=new Fc(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(x.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const t=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){if(this._connectionState===Y.Disconnected)return this._logger.log(x.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Y.Disconnecting)return this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Y.Disconnecting,this._logger.log(x.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(x.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Y.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new bt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(t,n,r);let s;const a=new Uc;return a.cancelCallback=()=>{const l=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(l))},this._callbacks[i.invocationId]=(l,h)=>{h?a.error(h):l&&(l.type===F.Completion?l.error?a.error(new Error(l.error)):a.complete():a.next(l.item))},s=this._sendWithProtocol(i).catch(l=>{a.error(l),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),a}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return this._messageBuffer?this._messageBuffer._send(t):this._sendMessage(this._protocol.writeMessage(t))}send(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(t,n,!0,r));return this._launchStreams(o,i),i}invoke(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(t,n,!1,r);return new Promise((a,l)=>{this._callbacks[i.invocationId]=(w,_)=>{_?l(_):w&&(w.type===F.Completion?w.error?l(new Error(w.error)):a(w.result):l(new Error(`Unexpected message type: ${w.type}`)))};const h=this._sendWithProtocol(i).catch(w=>{l(w),delete this._callbacks[i.invocationId]});this._launchStreams(o,h)})}on(t,n){t&&n&&(t=t.toLowerCase(),this._methods[t]||(this._methods[t]=[]),this._methods[t].indexOf(n)===-1&&this._methods[t].push(n))}off(t,n){if(!t)return;t=t.toLowerCase();const o=this._methods[t];if(o)if(n){const r=o.indexOf(n);r!==-1&&(o.splice(r,1),o.length===0&&delete this._methods[t])}else delete this._methods[t]}onclose(t){t&&this._closedCallbacks.push(t)}onreconnecting(t){t&&this._reconnectingCallbacks.push(t)}onreconnected(t){t&&this._reconnectedCallbacks.push(t)}_processIncomingData(t){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(t=this._processHandshakeResponse(t),this._receivedHandshakeResponse=!0),t){const n=this._protocol.parseMessages(t,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case F.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(x.Error,`Invoke client method threw error: ${oo(r)}`)});break;case F.StreamItem:case F.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===F.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${oo(i)}`)}}break}case F.Ping:break;case F.Close:{this._logger.log(x.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 F.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case F.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(x.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(t){let n,o;try{[o,n]=this._handshakeProtocol.parseHandshakeResponse(t)}catch(r){const i="Error parsing handshake response: "+r;this._logger.log(x.Error,i);const s=new Error(i);throw this._handshakeRejecter(s),s}if(n.error){const r="Server returned handshake error: "+n.error;this._logger.log(x.Error,r);const i=new Error(r);throw this._handshakeRejecter(i),i}return this._logger.log(x.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 t=this._nextKeepAlive-new Date().getTime();t<0&&(t=0),this._pingServerHandle=setTimeout(async()=>{if(this._connectionState===Y.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},t)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(t){const n=t.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(x.Warning,`No client method with the name '${n}' found.`),void(t.invocationId&&(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!t.invocationId;let s,a,l;for(const h of r)try{const w=s;s=await h.apply(this,t.arguments),i&&s&&w&&(this._logger.log(x.Error,`Multiple results provided for '${n}'. Sending error to server.`),l=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),a=void 0}catch(w){a=w,this._logger.log(x.Error,`A callback for the method '${n}' threw error '${w}'.`)}l?await this._sendWithProtocol(l):i?(a?l=this._createCompletionMessage(t.invocationId,`${a}`,null):s!==void 0?l=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),l=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(l)):s&&this._logger.log(x.Error,`Result given for '${n}' method but server is not expecting a result.`)}_connectionClosed(t){this._logger.log(x.Debug,`HubConnection.connectionClosed(${t}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||t||new bt("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(t||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Y.Disconnecting?this._completeClose(t):this._connectionState===Y.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===Y.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=Y.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(t??new Error("Connection closed.")),this._messageBuffer=void 0),tt.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[t]))}catch(n){this._logger.log(x.Error,`An onclose callback called with error '${t}' threw error '${n}'.`)}}}async _reconnect(t){const n=Date.now();let o=0,r=t!==void 0?t:new Error("Attempting to reconnect due to a unknown error."),i=this._getNextRetryDelay(o++,0,r);if(i===null)return this._logger.log(x.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),void this._completeClose(t);if(this._connectionState=Y.Reconnecting,t?this._logger.log(x.Information,`Connection reconnecting because of error '${t}'.`):this._logger.log(x.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(s=>s.apply(this,[t]))}catch(s){this._logger.log(x.Error,`An onreconnecting callback called with error '${t}' threw error '${s}'.`)}if(this._connectionState!==Y.Reconnecting)return void this._logger.log(x.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.")}for(;i!==null;){if(this._logger.log(x.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(x.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");try{if(await this._startInternal(),this._connectionState=Y.Connected,this._logger.log(x.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(s=>s.apply(this,[this.connection.connectionId]))}catch(s){this._logger.log(x.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${s}'.`)}return}catch(s){if(this._logger.log(x.Information,`Reconnect attempt failed because of error '${s}'.`),this._connectionState!==Y.Reconnecting)return this._logger.log(x.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()-n,r)}}this._logger.log(x.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(t,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:t,retryReason:o})}catch(r){return this._logger.log(x.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${t}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(t){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,t)}catch(i){this._logger.log(x.Error,`Stream 'error' callback called with '${t}' threw error: ${oo(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(t,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:t,type:F.Invocation}:{arguments:n,target:t,type:F.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:t,type:F.Invocation}:{arguments:n,invocationId:i.toString(),target:t,type:F.Invocation}}}_launchStreams(t,n){if(t.length!==0){n||(n=Promise.resolve());for(const o in t)t[o].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o)))},error:r=>{let i;i=r instanceof Error?r.message:r&&r.toString?r.toString():"Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(o,i)))},next:r=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(o,r)))}})}}_replaceStreamingParams(t){const n=[],o=[];for(let r=0;r<t.length;r++){const i=t[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),t.splice(r,1)}}return[n,o]}_isObservable(t){return t&&t.subscribe&&typeof t.subscribe=="function"}_createStreamInvocation(t,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:t,type:F.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:t,type:F.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:F.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:F.StreamItem}}_createCompletionMessage(t,n,o){return n?{error:n,invocationId:t,type:F.Completion}:{invocationId:t,result:o,type:F.Completion}}_createCloseMessage(){return{type:F.Close}}}const qc=[0,2e3,1e4,3e4,null];class ai{constructor(t){this._retryDelays=t!==void 0?[...t,null]:qc}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class Wt{}Wt.Authorization="Authorization",Wt.Cookie="Cookie";class Xc extends Ue{constructor(t,n){super(),this._innerClient=t,this._accessTokenFactory=n}async send(t){let n=!0;this._accessTokenFactory&&(!this._accessToken||t.url&&t.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(t);const o=await this._innerClient.send(t);return n&&o.statusCode===401&&this._accessTokenFactory?(this._accessToken=await this._accessTokenFactory(),this._setAuthorizationHeader(t),await this._innerClient.send(t)):o}_setAuthorizationHeader(t){t.headers||(t.headers={}),this._accessToken?t.headers[Wt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[Wt.Authorization]&&delete t.headers[Wt.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var rt,ut;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})(rt||(rt={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(ut||(ut={}));class Vc{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 ci{get pollAborted(){return this._pollAbort.aborted}constructor(t,n,o){this._httpClient=t,this._logger=n,this._pollAbort=new Vc,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(t,n){if(ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._url=t,this._logger.log(x.Trace,"(LongPolling transport) Connecting."),n===ut.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]=Kt(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===ut.Binary&&(s.responseType="arraybuffer");const a=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${a}.`);const l=await this._httpClient.get(a,s);l.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${l.statusCode}.`),this._closeError=new jt(l.statusText||"",l.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(t,n){try{for(;this._running;)try{const o=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${o}.`);const r=await this._httpClient.get(o,n);r.statusCode===204?(this._logger.log(x.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):r.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${r.statusCode}.`),this._closeError=new jt(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(x.Trace,`(LongPolling transport) data received. ${ae(r.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(r.content)):this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(o){this._running?o instanceof no?this._logger.log(x.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=o,this._running=!1):this._logger.log(x.Trace,`(LongPolling transport) Poll errored after shutdown: ${o.message}`)}}finally{this._logger.log(x.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}}async send(t){return this._running?ii(this._logger,"LongPolling",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}async stop(){this._logger.log(x.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{await this._receiving,this._logger.log(x.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const t={},[n,o]=Kt();t[n]=o;const r={headers:{...t,...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 jt&&(i.statusCode===404?this._logger.log(x.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(x.Trace,`(LongPolling transport) Error sending a DELETE request: ${i}`)):this._logger.log(x.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(x.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}}_raiseOnClose(){if(this.onclose){let t="(LongPolling transport) Firing onclose event.";this._closeError&&(t+=" Error: "+this._closeError),this._logger.log(x.Trace,t),this.onclose(this._closeError)}}}class Gc{constructor(t,n,o,r){this._httpClient=t,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(t,n){return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(SSE transport) Connecting."),this._url=t,this._accessToken&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((o,r)=>{let i,s=!1;if(n===ut.Text){if(tt.isBrowser||tt.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const a=this._httpClient.getCookieString(t),l={};l.Cookie=a;const[h,w]=Kt();l[h]=w,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...l,...this._options.headers}})}try{i.onmessage=a=>{if(this.onreceive)try{this._logger.log(x.Trace,`(SSE transport) data received. ${ae(a.data,this._options.logMessageContent)}.`),this.onreceive(a.data)}catch(l){return void this._close(l)}},i.onerror=a=>{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(x.Information,`SSE connected to ${this._url}`),this._eventSource=i,s=!0,o()}}catch(a){return void r(a)}}else r(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"))})}async send(t){return this._eventSource?ii(this._logger,"SSE",this._httpClient,this._url,t,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))}stop(){return this._close(),Promise.resolve()}_close(t){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(t))}}class Kc{constructor(t,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=t,this.onreceive=null,this.onclose=null,this._headers=s}async connect(t,n){let o;return ot.isRequired(t,"url"),ot.isRequired(n,"transferFormat"),ot.isIn(n,ut,"transferFormat"),this._logger.log(x.Trace,"(WebSockets transport) Connecting."),this._accessTokenFactory&&(o=await this._accessTokenFactory()),new Promise((r,i)=>{let s;t=t.replace(/^http/,"ws");const a=this._httpClient.getCookieString(t);let l=!1;if(tt.isNode||tt.isReactNative){const h={},[w,_]=Kt();h[w]=_,o&&(h[Wt.Authorization]=`Bearer ${o}`),a&&(h[Wt.Cookie]=a),s=new this._webSocketConstructor(t,void 0,{headers:{...h,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),n===ut.Binary&&(s.binaryType="arraybuffer"),s.onopen=h=>{this._logger.log(x.Information,`WebSocket connected to ${t}.`),this._webSocket=s,l=!0,r()},s.onerror=h=>{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.error:"There was an error with the transport",this._logger.log(x.Information,`(WebSockets transport) ${w}.`)},s.onmessage=h=>{if(this._logger.log(x.Trace,`(WebSockets transport) data received. ${ae(h.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(h.data)}catch(w){return void this._close(w)}},s.onclose=h=>{if(l)this._close(h);else{let w=null;w=typeof ErrorEvent<"u"&&h instanceof ErrorEvent?h.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(w))}}})}send(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(x.Trace,`(WebSockets transport) sending data. ${ae(t,this._logMessageContent)}.`),this._webSocket.send(t),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(t){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(x.Trace,"(WebSockets transport) socket closed."),this.onclose&&(!this._isCloseEvent(t)||t.wasClean!==!1&&t.code===1e3?t instanceof Error?this.onclose(t):this.onclose():this.onclose(new Error(`WebSocket closed with status code: ${t.code} (${t.reason||"no reason given"}).`)))}_isCloseEvent(t){return t&&typeof t.wasClean=="boolean"&&typeof t.code=="number"}}class Jc{constructor(t,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,ot.isRequired(t,"url"),this._logger=(o=n.logger)===void 0?new Fe(x.Information):o===null?se.instance:o.log!==void 0?o:new Fe(o),this.baseUrl=this._resolveUrl(t),(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 r=null,i=null;if(tt.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}tt.isNode||typeof WebSocket>"u"||n.WebSocket?tt.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,tt.isNode||typeof EventSource>"u"||n.EventSource?tt.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Xc(n.httpClient||new Oc(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(t){if(t=t||ut.Binary,ot.isIn(t,ut,"transferFormat"),this._logger.log(x.Debug,`Starting connection with transfer format '${ut[t]}'.`),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(t),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(x.Error,n),await this._stopPromise,Promise.reject(new bt(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(x.Error,n),Promise.reject(new bt(n))}this._connectionStarted=!0}send(t){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 No(this.transport)),this._sendQueue.send(t))}async stop(t){return this._connectionState==="Disconnected"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) ignored because the connection is already in the disconnected state.`),Promise.resolve()):this._connectionState==="Disconnecting"?(this._logger.log(x.Debug,`Call to HttpConnection.stop(${t}) 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(t),void await this._stopPromise)}async _stopInternal(t){this._stopError=t;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(x.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(x.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")}async _startInternal(t){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==rt.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(rt.WebSockets),await this._startTransport(n,t)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new bt("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&&(n=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(n,this._options.transport,o,t)}this.transport instanceof ci&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(x.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(o){return this._logger.log(x.Error,"Failed to start the connection: "+o),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(o)}}async _getNegotiationResponse(t){const n={},[o,r]=Kt();n[o]=r;const i=this._resolveNegotiateUrl(t);this._logger.log(x.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 oi("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 jt&&s.statusCode===404&&(a+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(x.Error,a),Promise.reject(new oi(a))}}_createConnectUrl(t,n){return n?t+(t.indexOf("?")===-1?"?":"&")+`id=${n}`:t}async _createTransport(t,n,o,r){let i=this._createConnectUrl(t,o.connectionToken);if(this._isITransport(n))return this._logger.log(x.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,await this._startTransport(i,r),void(this.connectionId=o.connectionId);const s=[],a=o.availableTransports||[];let l=o;for(const h of a){const w=this._resolveTransportOrError(h,n,r,l?.useStatefulReconnect===!0);if(w instanceof Error)s.push(`${h.transport} failed:`),s.push(w);else if(this._isITransport(w)){if(this.transport=w,!l){try{l=await this._getNegotiationResponse(t)}catch(_){return Promise.reject(_)}i=this._createConnectUrl(t,l.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=l.connectionId)}catch(_){if(this._logger.log(x.Error,`Failed to start the transport '${h.transport}': ${_}`),l=void 0,s.push(new Pc(`${h.transport} failed: ${_}`,rt[h.transport])),this._connectionState!=="Connecting"){const k="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,k),Promise.reject(new bt(k))}}}}return s.length>0?Promise.reject(new zc(`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(t){switch(t){case rt.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Kc(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case rt.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Gc(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case rt.LongPolling:return new ci(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){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(t,n),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(t,n)}_resolveTransportOrError(t,n,o,r){const i=rt[t.transport];if(i==null)return this._logger.log(x.Debug,`Skipping transport '${t.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${t.transport}' because it is not supported by this client.`);if(!function(s,a){return!s||(a&s)!=0}(n,i))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it was disabled by the client.`),new Mc(`'${rt[i]}' is disabled by the client.`,i);{if(!(t.transferFormats.map(a=>ut[a]).indexOf(o)>=0))return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it does not support the requested transfer format '${ut[o]}'.`),new Error(`'${rt[i]}' does not support ${ut[o]}.`);if(i===rt.WebSockets&&!this._options.WebSocket||i===rt.ServerSentEvents&&!this._options.EventSource)return this._logger.log(x.Debug,`Skipping transport '${rt[i]}' because it is not supported in your environment.'`),new Rc(`'${rt[i]}' is not supported in your environment.`,i);this._logger.log(x.Debug,`Selecting transport '${rt[i]}'.`);try{return this.features.reconnect=i===rt.WebSockets?r:void 0,this._constructTransport(i)}catch(a){return a}}}_isITransport(t){return t&&typeof t=="object"&&"connect"in t}_stopConnection(t){if(this._logger.log(x.Debug,`HttpConnection.stopConnection(${t}) called while in state ${this._connectionState}.`),this.transport=void 0,t=this._stopError||t,this._stopError=void 0,this._connectionState!=="Disconnected"){if(this._connectionState==="Connecting")throw this._logger.log(x.Warning,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${t}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),t?this._logger.log(x.Error,`Connection disconnected with error '${t}'.`):this._logger.log(x.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(x.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(t)}catch(n){this._logger.log(x.Error,`HttpConnection.onclose(${t}) threw error '${n}'.`)}}}else this._logger.log(x.Debug,`Call to HttpConnection.stopConnection(${t}) was ignored because the connection is already in the disconnected state.`)}_resolveUrl(t){if(t.lastIndexOf("https://",0)===0||t.lastIndexOf("http://",0)===0)return t;if(!tt.isBrowser)throw new Error(`Cannot resolve '${t}'.`);const n=window.document.createElement("a");return n.href=t,this._logger.log(x.Information,`Normalizing '${t}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(t){const n=new URL(t);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const o=new URLSearchParams(n.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"),n.search=o.toString(),n.toString()}}class No{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new He,this._transportResult=new He,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new He),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(t){if(this._buffer.length&&typeof this._buffer[0]!=typeof t)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof t}`);this._buffer.push(t),this._sendBufferedData.resolve()}async _sendLoop(){for(;;){if(await this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new He;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):No._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),t.resolve()}catch(o){t.reject(o)}}}static _concatBuffers(t){const n=t.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of t)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class He{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Yc{constructor(){this.name="json",this.version=2,this.transferFormat=ut.Text}parseMessages(t,n){if(typeof t!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!t)return[];n===null&&(n=se.instance);const o=mt.parse(t),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 F.Invocation:this._isInvocationMessage(s);break;case F.StreamItem:this._isStreamItemMessage(s);break;case F.Completion:this._isCompletionMessage(s);break;case F.Ping:case F.Close:break;case F.Ack:this._isAckMessage(s);break;case F.Sequence:this._isSequenceMessage(s);break;default:n.log(x.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return mt.write(JSON.stringify(t))}_isInvocationMessage(t){this._assertNotEmptyString(t.target,"Invalid payload for Invocation message."),t.invocationId!==void 0&&this._assertNotEmptyString(t.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(t){if(this._assertNotEmptyString(t.invocationId,"Invalid payload for StreamItem message."),t.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(t){if(t.result&&t.error)throw new Error("Invalid payload for Completion message.");!t.result&&t.error&&this._assertNotEmptyString(t.error,"Invalid payload for Completion message."),this._assertNotEmptyString(t.invocationId,"Invalid payload for Completion message.")}_isAckMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(t){if(typeof t.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const Zc={trace:x.Trace,debug:x.Debug,info:x.Information,information:x.Information,warn:x.Warning,warning:x.Warning,error:x.Error,critical:x.Critical,none:x.None};class Qc{configureLogging(t){if(ot.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const n=function(o){const r=Zc[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new Fe(n)}else this.logger=new Fe(t);return this}withUrl(t,n){return ot.isRequired(t,"url"),ot.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return ot.isRequired(t,"protocol"),this.protocol=t,this}withAutomaticReconnect(t){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return t?Array.isArray(t)?this.reconnectPolicy=new ai(t):this.reconnectPolicy=t:this.reconnectPolicy=new ai,this}withServerTimeout(t){return ot.isRequired(t,"milliseconds"),this._serverTimeoutInMilliseconds=t,this}withKeepAliveInterval(t){return ot.isRequired(t,"milliseconds"),this._keepAliveIntervalInMilliseconds=t,this}withStatefulReconnect(t){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=t?.bufferSize,this}build(){const t=this.httpConnectionOptions||{};if(t.logger===void 0&&(t.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Jc(this.url,t);return $o.create(n,this.logger||se.instance,this.protocol||new Yc,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let qe;function tl(e){if(!e){if(qe)return qe;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new Qc().configureLogging(x.Information).withUrl(e).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{j.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{j.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{j.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{j.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),qe||(qe=t),t}const ro=new Set;function li(e){return e!==null?parseFloat(e):0}function Xe(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(li).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(li).reduce((r,i)=>r+i));return{width:n,height:o}}class ui{width;height;constructor(t,n){this.width=t,this.height=n}}function el(e){const t=e.windowEl;if(t){const n=parseFloat(t.style.left||"NaN"),o=parseFloat(t.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function nl(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}window.addEventListener("resize",e=>{ro.forEach(t=>{t&&Re(t.fixPosition)&&t.fixPosition()})});const Ve=[];var Ge=Rt({name:"Window",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:Te},setup(e,{emit:t}){const n=zs();if(!n)return;const{proxy:o}=n;let r=0,i,s,a;const l=K(e.isOpen),h=()=>{Ve.push(o),a=new Ks(e.zGroup,w),e.isOpen&&function(L){L&&(rr(()=>{r++==0&&(y(o),function(){const D=_.value,{width:M,height:N}=Rn(D);let O,T;if(e.left!==void 0!=(e.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof e.left=="number")O=e.left,T=e.top;else{const W=e.positionHint||"auto";switch(W){case"auto":{let q=20,it=50,Z=0;do{if(Ve.every(Q=>{if(!Q.isOpen||o==Q)return!0;const _t=el(Q);if(_t==null)return!0;const{left:Ht,top:et}=_t;return nl(Ht,et,q,it)>16}))break;q=(q+40)%(window.innerWidth-200),it=(it+40)%(window.innerHeight-200)}while(++Z<100);O=q,T=it}break;case"center":O=(window.innerWidth-M)/2,T=(window.innerHeight-N)/2,console.log(O,T,window.innerWidth,window.innerHeight,"111111");break;default:try{const q=W.split("/").map(Number);if(q.length!=2)throw null;const[it,Z]=q;if(!isFinite(it)||!isFinite(Z))throw null;O=it>=0?it:window.innerWidth-M+it,T=Z>=0?Z:window.innerHeight-N+Z}catch{throw new Error(`invalid position string: ${W}`)}}}D&&(D.style.left=`${O}px`,D.style.top=`${T}px`)}()),e.resizable&&d(),z(),i=new Gs(k.value,_.value,{onMove:()=>z(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:D}=Rn(k.value);s=new Js(_.value,{onResize:()=>d(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+D,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+D:void 0})}()}),e.activateWhenOpen&&I())}(!0),ro.add(o)};function w(L){p.value.zIndex=`${L}`}const _=K(null),k=K(null),$=K(null);function I(){a.raise(),t("activate")}const p=K({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=Xt(()=>e.windowStyle.titlebar),v=Xt(()=>{const L={...e.windowStyle.content};return e.resizable?L.padding="0":e.padding!=null&&(L.padding=`${e.padding}px`),e.isScrollable&&(L.overflow="auto"),L});function y(L){const{width:D,height:M,top:N,left:O}=L,T=_;if(T&&D!=null&&(T.value.style.width=`${D}px`),M!=null){const W=k.value;if(W){const q=Xe(W).height;T.value.style.height=`${M+q}px`}}T&&O!=null&&(T.value.style.left=`${O}px`),T&&N!=null&&(T.value.style.top=`${N}px`)}function d(L=!0){const D=_.value,M=k.value,N=$.value;if(N&&D&&M){const{width:O,height:T}=Xe(N),{width:W,height:q}=Xe(D),it=Xe(M).height,Z=W-(N.offsetWidth-O),Q=q-it-(N.offsetHeight-T);N.style.width=`${Z}px`,N.style.height=`${Q}px`,f(),t("resize",new ui(Z,Q)),L&&(t("update:width",Z),t("update:height",Q))}}function f(){const L=_.value;if(L){const D=L.getBoundingClientRect();D.left<0&&(p.value.left="0px"),D.top<0&&(p.value.top="0px"),D.right>window.innerWidth&&(p.value.left=window.innerWidth-D.width+"px"),D.bottom>window.innerHeight&&(p.value.top=window.innerHeight-D.height+"px")}}function z(L=!0){f();const D=_.value;if(D){const{left:M,top:N}=D.getBoundingClientRect();L&&(t("update:left",M),t("update:top",N))}}return Pt(()=>e.isOpen,L=>{l.value=L}),Pt(()=>e.zGroup,L=>{a.group=L}),Pt(()=>e.width,L=>{y({width:L}),d(!1)}),Pt(()=>e.height,L=>{y({height:L}),d(!1)}),Sn(()=>{h()}),As(()=>{ro.delete(this),a.unregister(),s&&s.teardown(),i&&i.teardown(),Ve.splice(Ve.indexOf(o),1)}),{isOpen:l,windowEl:_,titlebar:k,content:$,activate:I,styleWindow:p,styleTitlebar:u,styleContent:v,closeButtonClick:function(){l.value=!1,t("closebuttonclick")},fixPosition:f}}});const ol={class:"title"};var hi;Ge.render=function(e,t,n,o,r,i){const s=Se("myButton");return X(),nt(ir,{name:"fade",onAfterLeave:t[2]||(t[2]=a=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=a=>e.$emit("open")),persisted:""},{default:Ct(()=>[sr(J("div",{class:"window",style:vt(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...a)=>e.activate&&e.activate(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.activate&&e.activate(...a))},[J("div",{class:"titlebar",style:vt(e.styleTitlebar),ref:"titlebar"},[J("div",ol,[e.$slots.title?ct(e.$slots,"title",{key:0}):(X(),gt(zt,{key:1},[Cn(En(e.title),1)],64))]),e.closeButton?(X(),nt(s,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:Ct(()=>t[4]||(t[4]=[Cn("\xD7")])),_:1},8,["windowStyle","onClick"])):st("v-if",!0)],4),J("div",{class:"content",style:vt(e.styleContent),ref:"content"},[ct(e.$slots,"default")],4)],36),[[ar,e.isOpen]])]),_:3})},Ge.__file="src/controls/vuewindow/window/index.vue",function(e){e[e.StyleBlack=0]="StyleBlack",e[e.StyleWhite=1]="StyleWhite",e[e.StyleMetal=2]="StyleMetal",e[e.StyleGrayblue=3]="StyleGrayblue"}(hi||(hi={}));const rl={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)"}},il={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)"}},sl={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)"}},al={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)"}},cl=Ge;var ht;(function(e){e[e.top=0]="top",e[e.bottom=1]="bottom",e[e.centerBack=2]="centerBack",e[e.centerMain=3]="centerMain",e[e.centerFront=4]="centerFront",e[e.left=5]="left",e[e.right=6]="right"})(ht||(ht={}));class di{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(t,n,o,r){this.layoutState=t,this._LayoutID=o,this._mapItemRefs=r,n.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(t=>t.preload&&!t.afterid).forEach(t=>{this._loadWidget(t)})}async loadWidget(t){if(!t)return;let n;if(Lt(t)?n=t:Me(t)&&(n=this.widgetConfig.find(o=>o.id===t)),n){if(n.afterid){if(this.isWidgetLoaded(n.afterid))return this._loadWidget(n);{let o=function(a){a.layoutID===r._LayoutID&&a.widgetID===i&&(r._loadWidget(s),j.EventBus.off(lt.WidgetLoadedEvent,o))};const r=this,i=n.afterid,s=n;return j.EventBus.on(lt.WidgetLoadedEvent,o),this.loadWidget(n.afterid)}}return this._loadWidget(n)}}loadOtherDependenceWidgets(t){this.preConditionMap.has(t)&&this.preConditionMap.get(t)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(t){if(!this.widgetsLoadedSet.has(t.id))return t.component?t.component().then(n=>{if(n.default){const o=Ls(n.default);t.layout&&(o.style=t.layout),t.cssClass&&(o.cssClass=t.cssClass),this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),rr().then(()=>{j.EventBus.emit(lt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(n=>{j.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),j.EventBus.emit(lt.WidgetLoadedErrorEvent,t)}):void 0;this.changeWidgetVisible(t.id,!0)}hasDependentWidgets(t){let n=!1;if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(t){if(!t||!this.isWidgetLoaded(t))return;const n=this.widgetConfig.find(o=>o.id===t);if(n){if(this.preConditionMap.has(t)){const o=this.preConditionMap.get(t);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(t),this.widgetsLoadedSet.delete(t),this._mapItemRefs&&this._mapItemRefs.delete(t),j.EventBus.emit(lt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:t})}}isWidgetLoaded(t){return this.widgetsLoadedSet.has(t)}splitTwoContainer(t=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;t?(n&&(n.style.left="0",n.style.width="100%"),o&&(o.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),o&&(o.style.width="50%"))}getLayoutContainer(t){switch(t){case ht.top:return this.layoutState.topContainer;case ht.bottom:return this.layoutState.bottomContainer;case ht.left:return this.layoutState.leftContainer;case ht.right:return this.layoutState.rightContainer;case ht.centerBack:return this.layoutState.centerBackContainer;case ht.centerMain:return this.layoutState.centerMainContainer;case ht.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(t,n=!1){const o=this.getLayoutContainer(t);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(t,n=!1){const o=this.getWidgetComponent(t);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(t){const n=this.getWidgetComponent(t);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(t){if(this.widgetsLoadedSet.has(t)&&this._mapItemRefs)return this._mapItemRefs.get(t)}getWigetItem(t){return this.widgetConfig.find(n=>n.id===t)}getGroupWigetItems(t){return this.widgetConfig.filter(n=>n.group===t)}getContainerComponents(t){if(this.layoutMap.has(t))return this.layoutMap.get(t);{const n=K(new Map);return this.layoutMap.set(t,n),n}}getWidgetLoadedIDList(){const t=[];return this.widgetsLoadedSet.forEach(n=>{t.push(n)}),t}unloadAllWidgets(t){const n=[];this.widgetsLoadedSet.forEach(o=>{t&&t.length>0?t.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(t){t&&t.length>0&&t.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(t,n){if(n){const o=n.find(r=>r.id===t);if(o&&o.layoutID)return j.LayoutMap.get(o.layoutID)}}}var ce=Rt({name:"SuspenseWithError",setup(){const e=K(null);return Ds(t=>(e.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",t),!0)),{error:e}}});ce.render=function(e,t,n,o,r,i){return e.error?ct(e.$slots,"error",{key:0},()=>[Cn(En(e.error),1)]):(X(),nt($s,{key:1},{default:Ct(()=>[ct(e.$slots,"default")]),fallback:Ct(()=>[ct(e.$slots,"fallback")]),_:3}))},ce.__file="src/controls/routertransition/SuspenseWithError.vue";var io=Rt({name:"RouterTransition",__name:"RouterTransition",setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[st(" <transition> "),(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name})),st(" </transition> ")]),_:1})]),_:1})}});io.__file="src/controls/routertransition/RouterTransition.vue";var Ke=Rt({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:io},setup(e,{attrs:t,slots:n,emit:o}){const r=e.layoutID,i=K(e.enableRouterView);Pt(()=>e.enableRouterView,()=>{i.value=e.enableRouterView});const s=Ns({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),a=new Map,l=new di(s,e.widgetConfig,r,a),h=p(ht.top),w=p(ht.centerBack),_=p(ht.centerFront),k=p(ht.left),$=p(ht.right),I=p(ht.bottom);function p(v){return l?.getContainerComponents(v)}const u=Xt(()=>e.layoutStyle);return Sn(()=>{l&&(r?j.LayoutMap.set(r,l):(j.LayoutManager=l,j.LayoutMap.set("",l)),l.preloadWidgets(),o("containerLoaded",{layoutID:r,layoutManager:l}),j.EventBus.emit(lt.LayoutContainerLoaded,{layoutID:r,layoutManager:l}))}),{...Bs(s),topContainerComponents:h,centerbackComponents:w,centerfrontComponents:_,leftContainerComponents:k,rightContainerComponents:$,bottomContainerComponents:I,containerStyle:u,isEnableRouterView:i,setItemRef:(v,y)=>{v&&a.set(y,v)}}}});const ll={ref:"topContainer",class:"topContainer"},ul={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},hl={ref:"centerBackContainer",class:"centerdiv backContainer"},dl={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},fl={ref:"leftContainer",class:"leftContainer"},pl={ref:"rightContainer",class:"rightContainer"},gl={ref:"bottomContainer",class:"bottomContainer"};Ke.render=function(e,t,n,o,r,i){const s=Se("router-transition");return X(),gt("div",{class:"layoutContainer",style:vt(e.containerStyle)},[J("div",ll,[ct(e.$slots,"top"),(X(!0),gt(zt,null,Vt(e.topContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",null,[st(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(X(),gt("div",ul,[ct(e.$slots,"main",{},()=>[Ce(s)])],512)):st("v-if",!0),st(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",hl,[ct(e.$slots,"back"),(X(!0),gt(zt,null,Vt(e.centerbackComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",dl,[ct(e.$slots,"front"),(X(!0),gt(zt,null,Vt(e.centerfrontComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",fl,[ct(e.$slots,"left"),(X(!0),gt(zt,null,Vt(e.leftContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),J("div",pl,[ct(e.$slots,"right"),(X(!0),gt(zt,null,Vt(e.rightContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512)]),J("div",gl,[ct(e.$slots,"bottom"),(X(!0),gt(zt,null,Vt(e.bottomContainerComponents,([a,l])=>(X(),nt(Et(l),{ref_for:!0,ref:h=>e.setItemRef(h,a),key:a,style:vt(l.style),class:At(l.cssClass)},null,8,["style","class"]))),128))],512),st(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),ct(e.$slots,"default")],4)},Ke.__scopeId="data-v-4d081e5c",Ke.__file="src/controls/layoutcontainer/layout.vue";var fi=Rt({name:"RouterTransition",__name:"RouterTransitionAnimate",props:{enterActive:{type:String,required:!1,default:"animated fadeIn"},leaveActive:{type:String,required:!1,default:"animated fadeOut"}},setup:e=>(t,n)=>{const o=Se("router-view");return X(),nt(ce,null,{default:Ct(()=>[Ce(o,null,{default:Ct(({Component:r,route:i})=>[Ce(js,{appear:"","enter-active-class":t.enterActive,"leave-active-class":t.leaveActive},{default:Ct(()=>[(X(),nt(cr,null,[i.meta.keepAlive?(X(),nt(Et(r),{key:i.name})):st("v-if",!0)],1024)),i.meta.keepAlive?st("v-if",!0):(X(),nt(Et(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});fi.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const le=/^[a-z0-9]+(-[a-z0-9]+)*$/,Je=(e,t,n,o="")=>{const r=e.split(":");if(e.slice(0,1)==="@"){if(r.length<2||r.length>3)return null;o=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){const a=r.pop(),l=r.pop(),h={provider:r.length>0?r[0]:o,prefix:l,name:a};return t&&!Ye(h)?null:h}const i=r[0],s=i.split("-");if(s.length>1){const a={provider:o,prefix:s.shift(),name:s.join("-")};return t&&!Ye(a)?null:a}if(n&&o===""){const a={provider:o,prefix:"",name:i};return t&&!Ye(a,n)?null:a}return null},Ye=(e,t)=>!!e&&!(e.provider!==""&&!e.provider.match(le)||!(t&&e.prefix===""||e.prefix.match(le))||!e.name.match(le)),pi=Object.freeze({left:0,top:0,width:16,height:16}),Ze=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Qe=Object.freeze({...pi,...Ze}),so=Object.freeze({...Qe,body:"",hidden:!1});function gi(e,t){const n=function(o,r){const i={};!o.hFlip!=!r.hFlip&&(i.hFlip=!0),!o.vFlip!=!r.vFlip&&(i.vFlip=!0);const s=((o.rotate||0)+(r.rotate||0))%4;return s&&(i.rotate=s),i}(e,t);for(const o in so)o in Ze?o in e&&!(o in n)&&(n[o]=Ze[o]):o in t?n[o]=t[o]:o in e&&(n[o]=e[o]);return n}function ml(e,t,n){const o=e.icons,r=e.aliases||Object.create(null);let i={};function s(a){i=gi(o[a]||r[a],i)}return s(t),n.forEach(s),gi(e,i)}function mi(e,t){const n=[];if(typeof e!="object"||typeof e.icons!="object")return n;e.not_found instanceof Array&&e.not_found.forEach(r=>{t(r,null),n.push(r)});const o=function(r,i){const s=r.icons,a=r.aliases||Object.create(null),l=Object.create(null);return(i||Object.keys(s).concat(Object.keys(a))).forEach(function h(w){if(s[w])return l[w]=[];if(!(w in l)){l[w]=null;const _=a[w]&&a[w].parent,k=_&&h(_);k&&(l[w]=[_].concat(k))}return l[w]}),l}(e);for(const r in o){const i=o[r];i&&(t(r,ml(e,r,i)),n.push(r))}return n}const vl={provider:"",aliases:{},not_found:{},...pi};function ao(e,t){for(const n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function vi(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!ao(e,vl))return null;const n=t.icons;for(const r in n){const i=n[r];if(!r.match(le)||typeof i.body!="string"||!ao(i,so))return null}const o=t.aliases||Object.create(null);for(const r in o){const i=o[r],s=i.parent;if(!r.match(le)||typeof s!="string"||!n[s]&&!o[s]||!ao(i,so))return null}return t}const yi=Object.create(null);function Ut(e,t){const n=yi[e]||(yi[e]=Object.create(null));return n[t]||(n[t]=function(o,r){return{provider:o,prefix:r,icons:Object.create(null),missing:new Set}}(e,t))}function co(e,t){return vi(t)?mi(t,(n,o)=>{o?e.icons[n]=o:e.missing.add(n)}):[]}let ue=!1;function wi(e){return typeof e=="boolean"&&(ue=e),ue}function yl(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),ue&&!t&&!e.prefix){let o=!1;return vi(e)&&(e.prefix="",mi(e,(r,i)=>{i&&function(s,a){const l=Je(s,!0,ue);return!!l&&function(h,w,_){try{if(typeof _.body=="string")return h.icons[w]={..._},!0}catch{}return!1}(Ut(l.provider,l.prefix),l.name,a)}(r,i)&&(o=!0)})),o}const n=e.prefix;return Ye({provider:t,prefix:n,name:"a"})?!!co(Ut(t,n),e):!1}const bi=Object.freeze({width:null,height:null}),_i=Object.freeze({...bi,...Ze}),wl=/(-?[0-9.]*[0-9]+[0-9.]*)/g,bl=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function Si(e,t,n){if(t===1)return e;if(n=n||100,typeof e=="number")return Math.ceil(e*t*n)/n;if(typeof e!="string")return e;const o=e.split(wl);if(o===null||!o.length)return e;const r=[];let i=o.shift(),s=bl.test(i);for(;;){if(s){const a=parseFloat(i);isNaN(a)?r.push(i):r.push(Math.ceil(a*t*n)/n)}else r.push(i);if(i=o.shift(),i===void 0)return r.join("");s=!s}}const _l=/\sid="(\S+)"/g,Sl="IconifyId"+Date.now().toString(16)+(16777216*Math.random()|0).toString(16);let Cl=0;const lo=Object.create(null);function uo(e){return lo[e]||lo[""]}function ho(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array&&t.length))return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const fo=Object.create(null),tn=["https://api.simplesvg.com","https://api.unisvg.com"],po=[];for(;tn.length>0;)tn.length===1||Math.random()>.5?po.push(tn.shift()):po.push(tn.pop());function El(e,t){const n=ho(t);return n!==null&&(fo[e]=n,!0)}function go(e){return fo[e]}fo[""]=ho({resources:["https://api.iconify.design"].concat(po)});let Ci=(()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}})();const xl={prepare:(e,t,n)=>{const o=[],r=function(l,h){const w=go(l);if(!w)return 0;let _;if(w.maxURL){let k=0;w.resources.forEach(I=>{k=Math.max(k,I.length)});const $=h+".json?icons=";_=w.maxURL-k-w.path.length-$.length}else _=0;return _}(e,t),i="icons";let s={type:i,provider:e,prefix:t,icons:[]},a=0;return n.forEach((l,h)=>{a+=l.length+1,a>=r&&h>0&&(o.push(s),s={type:i,provider:e,prefix:t,icons:[]},a=l.length),s.icons.push(l)}),o.push(s),o},send:(e,t,n)=>{if(!Ci)return void n("abort",424);let o=function(i){if(typeof i=="string"){const s=go(i);if(s)return s.path}return"/"}(t.provider);switch(t.type){case"icons":{const i=t.prefix,s=t.icons.join(",");o+=i+".json?"+new URLSearchParams({icons:s}).toString();break}case"custom":{const i=t.uri;o+=i.slice(0,1)==="/"?i.slice(1):i;break}default:return void n("abort",400)}let r=503;Ci(e+o).then(i=>{const s=i.status;if(s===200)return r=501,i.json();setTimeout(()=>{n(function(a){return a===404}(s)?"abort":"next",s)})}).then(i=>{setTimeout(typeof i=="object"&&i!==null?()=>{n("success",i)}:()=>{i===404?n("abort",i):n("next",r)})}).catch(()=>{n("next",r)})}};function Ei(e,t){e.forEach(n=>{const o=n.loaderCallbacks;o&&(n.loaderCallbacks=o.filter(r=>r.id!==t))})}let kl=0;var Il={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Tl(e,t,n,o){const r=e.resources.length,i=e.random?Math.floor(Math.random()*r):e.index;let s;if(e.random){let f=e.resources.slice(0);for(s=[];f.length>1;){const z=Math.floor(Math.random()*f.length);s.push(f[z]),f=f.slice(0,z).concat(f.slice(z+1))}s=s.concat(f)}else s=e.resources.slice(i).concat(e.resources.slice(0,i));const a=Date.now();let l,h="pending",w=0,_=null,k=[],$=[];function I(){_&&(clearTimeout(_),_=null)}function p(){h==="pending"&&(h="aborted"),I(),k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function u(f,z){z&&($=[]),typeof f=="function"&&$.push(f)}function v(){h="failed",$.forEach(f=>{f(void 0,l)})}function y(){k.forEach(f=>{f.status==="pending"&&(f.status="aborted")}),k=[]}function d(){if(h!=="pending")return;I();const f=s.shift();if(f===void 0)return k.length?void(_=setTimeout(()=>{I(),h==="pending"&&(y(),v())},e.timeout)):void v();const z={status:"pending",resource:f,callback:(L,D)=>{(function(M,N,O){const T=N!=="success";switch(k=k.filter(W=>W!==M),h){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if(N==="abort")return l=O,void v();if(T)return l=O,void(k.length||(s.length?d():v()));if(I(),y(),!e.random){const W=e.resources.indexOf(M.resource);W!==-1&&W!==e.index&&(e.index=W)}h="completed",$.forEach(W=>{W(O)})})(z,L,D)}};k.push(z),w++,_=setTimeout(d,e.rotate),n(f,t,z.callback)}return typeof o=="function"&&$.push(o),setTimeout(d),function(){return{startTime:a,payload:t,status:h,queriesSent:w,queriesPending:k.length,subscribe:u,abort:p}}}function xi(e){const t={...Il,...e};let n=[];function o(){n=n.filter(r=>r().status==="pending")}return{query:function(r,i,s){const a=Tl(t,r,i,(l,h)=>{o(),s&&s(l,h)});return n.push(a),a},find:function(r){return n.find(i=>r(i))||null},setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:o}}function ki(){}const mo=Object.create(null);function Rl(e,t,n){let o,r;if(typeof e=="string"){const i=uo(e);if(!i)return n(void 0,424),ki;r=i.send;const s=function(a){if(!mo[a]){const l=go(a);if(!l)return;const h={config:l,redundancy:xi(l)};mo[a]=h}return mo[a]}(e);s&&(o=s.redundancy)}else{const i=ho(e);if(i){o=xi(i);const s=uo(e.resources?e.resources[0]:"");s&&(r=s.send)}}return o&&r?o.query(t,r,n)().abort:(n(void 0,424),ki)}function vo(e,t){try{return e.getItem(t)}catch{}}function yo(e,t,n){try{return e.setItem(t,n),!0}catch{}}function Ii(e,t){try{e.removeItem(t)}catch{}}function wo(e,t){return yo(e,"iconify-count",t.toString())}function bo(e){return parseInt(vo(e,"iconify-count"))||0}const en={local:!0,session:!0},Ti={local:new Set,session:new Set};let _o=!1,nn=typeof window>"u"?{}:window;function Ri(e){const t=e+"Storage";try{if(nn&&nn[t]&&typeof nn[t].length=="number")return nn[t]}catch{}en[e]=!1}function Mi(e,t){const n=Ri(e);if(!n)return;const o=vo(n,"iconify-version");if(o!=="iconify2"){if(o){const a=bo(n);for(let l=0;l<a;l++)Ii(n,"iconify"+l.toString())}return yo(n,"iconify-version","iconify2"),void wo(n,0)}const r=Math.floor(Date.now()/36e5)-168,i=a=>{const l="iconify"+a.toString(),h=vo(n,l);if(typeof h=="string"){try{const w=JSON.parse(h);if(typeof w=="object"&&typeof w.cached=="number"&&w.cached>r&&typeof w.provider=="string"&&typeof w.data=="object"&&typeof w.data.prefix=="string"&&t(w,a))return!0}catch{}Ii(n,l)}};let s=bo(n);for(let a=s-1;a>=0;a--)i(a)||(a===s-1?(s--,wo(n,s)):Ti[e].add(a))}function Pi(){if(!_o){_o=!0;for(const e in en)Mi(e,t=>{const n=t.data,o=Ut(t.provider,n.prefix);if(!co(o,n).length)return!1;const r=n.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function Ml(e,t){function n(o){let r;if(!en[o]||!(r=Ri(o)))return;const i=Ti[o];let s;if(i.size)i.delete(s=Array.from(i).shift());else if(s=bo(r),s>=50||!wo(r,s+1))return;const a={cached:Math.floor(Date.now()/36e5),provider:e.provider,data:t};return yo(r,"iconify"+s.toString(),JSON.stringify(a))}_o||Pi(),t.lastModified&&!function(o,r){const i=o.lastModifiedCached;if(i&&i>=r)return i===r;if(o.lastModifiedCached=r,i)for(const s in en)Mi(s,a=>{const l=a.data;return a.provider!==o.provider||l.prefix!==o.prefix||l.lastModified===r});return!0}(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&delete(t=Object.assign({},t)).not_found,n("local")||n("session"))}function zi(){}function Pl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,function(t){t.pendingCallbacksFlag||(t.pendingCallbacksFlag=!0,setTimeout(()=>{t.pendingCallbacksFlag=!1;const n=t.loaderCallbacks?t.loaderCallbacks.slice(0):[];if(!n.length)return;let o=!1;const r=t.provider,i=t.prefix;n.forEach(s=>{const a=s.icons,l=a.pending.length;a.pending=a.pending.filter(h=>{if(h.prefix!==i)return!0;const w=h.name;if(t.icons[w])a.loaded.push({provider:r,prefix:i,name:w});else{if(!t.missing.has(w))return o=!0,!0;a.missing.push({provider:r,prefix:i,name:w})}return!1}),a.pending.length!==l&&(o||Ei([t],s.id),s.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),s.abort))})}))}(e)}))}const zl=(e,t)=>{const n=function(l,h=!0,w=!1){const _=[];return l.forEach(k=>{const $=typeof k=="string"?Je(k,h,w):k;$&&_.push($)}),_}(e,!0,wi()),o=function(l){const h={loaded:[],missing:[],pending:[]},w=Object.create(null);l.sort((k,$)=>k.provider!==$.provider?k.provider.localeCompare($.provider):k.prefix!==$.prefix?k.prefix.localeCompare($.prefix):k.name.localeCompare($.name));let _={provider:"",prefix:"",name:""};return l.forEach(k=>{if(_.name===k.name&&_.prefix===k.prefix&&_.provider===k.provider)return;_=k;const $=k.provider,I=k.prefix,p=k.name,u=w[$]||(w[$]=Object.create(null)),v=u[I]||(u[I]=Ut($,I));let y;y=p in v.icons?h.loaded:I===""||v.missing.has(p)?h.missing:h.pending;const d={provider:$,prefix:I,name:p};y.push(d)}),h}(n);if(!o.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(o.loaded,o.missing,o.pending,zi)}),()=>{l=!1}}const r=Object.create(null),i=[];let s,a;return o.pending.forEach(l=>{const{provider:h,prefix:w}=l;if(w===a&&h===s)return;s=h,a=w,i.push(Ut(h,w));const _=r[h]||(r[h]=Object.create(null));_[w]||(_[w]=[])}),o.pending.forEach(l=>{const{provider:h,prefix:w,name:_}=l,k=Ut(h,w),$=k.pendingIcons||(k.pendingIcons=new Set);$.has(_)||($.add(_),r[h][w].push(_))}),i.forEach(l=>{const{provider:h,prefix:w}=l;r[h][w].length&&function(_,k){_.iconsToLoad?_.iconsToLoad=_.iconsToLoad.concat(k).sort():_.iconsToLoad=k,_.iconsQueueFlag||(_.iconsQueueFlag=!0,setTimeout(()=>{_.iconsQueueFlag=!1;const{provider:$,prefix:I}=_,p=_.iconsToLoad;let u;delete _.iconsToLoad,p&&(u=uo($))&&u.prepare($,I,p).forEach(v=>{Rl($,v,y=>{if(typeof y!="object")v.icons.forEach(d=>{_.missing.add(d)});else try{const d=co(_,y);if(!d.length)return;const f=_.pendingIcons;f&&d.forEach(z=>{f.delete(z)}),Ml(_,y)}catch(d){console.error(d)}Pl(_)})})}))}(l,r[h][w])}),t?function(l,h,w){const _=kl++,k=Ei.bind(null,w,_);if(!h.pending.length)return k;const $={id:_,icons:h,callback:l,abort:k};return w.forEach(I=>{(I.loaderCallbacks||(I.loaderCallbacks=[])).push($)}),k}(t,o,i):zi},Al=/[\s,]+/;function Ll(e,t){t.split(Al).forEach(n=>{switch(n.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}function Dl(e,t=0){const n=e.replace(/^-?[0-9.]*/,"");function o(r){for(;r<0;)r+=4;return r%4}if(n===""){const r=parseInt(e);return isNaN(r)?0:o(r)}if(n!==e){let r=0;switch(n){case"%":r=25;break;case"deg":r=90}if(r){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=r,i%1==0?o(i):0)}}return t}const Ai={..._i,inline:!1},$l={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},Nl={display:"inline-block"},So={backgroundColor:"currentColor"},Li={backgroundColor:"transparent"},Di={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},$i={webkitMask:So,mask:So,background:Li};for(const e in $i){const t=$i[e];for(const n in Di)t[e+n]=Di[n]}const on={};function Ni(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}["horizontal","vertical"].forEach(e=>{const t=e.slice(0,1)+"Flip";on[e+"-flip"]=t,on[e.slice(0,1)+"-flip"]=t,on[e+"Flip"]=t});const Bi=(e,t)=>{const n=function(u,v){const y={...u};for(const d in v){const f=v[d],z=typeof f;d in bi?(f===null||f&&(z==="string"||z==="number"))&&(y[d]=f):z===typeof y[d]&&(y[d]=d==="rotate"?f%4:f)}return y}(Ai,t),o={...$l},r=t.mode||"svg",i={},s=t.style,a=typeof s!="object"||s instanceof Array?{}:s;for(let u in t){const v=t[u];if(v!==void 0)switch(u){case"icon":case"style":case"onLoad":case"mode":break;case"inline":case"hFlip":case"vFlip":n[u]=v===!0||v==="true"||v===1;break;case"flip":typeof v=="string"&&Ll(n,v);break;case"color":i.color=v;break;case"rotate":typeof v=="string"?n[u]=Dl(v):typeof v=="number"&&(n[u]=v);break;case"ariaHidden":case"aria-hidden":v!==!0&&v!=="true"&&delete o["aria-hidden"];break;default:{const y=on[u];y?v!==!0&&v!=="true"&&v!==1||(n[y]=!0):Ai[u]===void 0&&(o[u]=v)}}}const l=function(u,v){const y={...Qe,...u},d={..._i,...v},f={left:y.left,top:y.top,width:y.width,height:y.height};let z=y.body;[y,d].forEach(Z=>{const Q=[],_t=Z.hFlip,Ht=Z.vFlip;let et,St=Z.rotate;switch(_t?Ht?St+=2:(Q.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),Q.push("scale(-1 1)"),f.top=f.left=0):Ht&&(Q.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),Q.push("scale(1 -1)"),f.top=f.left=0),St<0&&(St-=4*Math.floor(St/4)),St%=4,St){case 1:et=f.height/2+f.top,Q.unshift("rotate(90 "+et.toString()+" "+et.toString()+")");break;case 2:Q.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:et=f.width/2+f.left,Q.unshift("rotate(-90 "+et.toString()+" "+et.toString()+")")}St%2==1&&(f.left!==f.top&&(et=f.left,f.left=f.top,f.top=et),f.width!==f.height&&(et=f.width,f.width=f.height,f.height=et)),Q.length&&(z=function(ln,un,hn){const me=function(yt,ve="defs"){let ye="";const te=yt.indexOf("<"+ve);for(;te>=0;){const we=yt.indexOf(">",te),ee=yt.indexOf("</"+ve);if(we===-1||ee===-1)break;const wt=yt.indexOf(">",ee);if(wt===-1)break;ye+=yt.slice(we+1,ee).trim(),yt=yt.slice(0,te).trim()+yt.slice(wt+1)}return{defs:ye,content:yt}}(ln);return Zt=me.defs,Qt=un+me.content+hn,Zt?"<defs>"+Zt+"</defs>"+Qt:Qt;var Zt,Qt}(z,'<g transform="'+Q.join(" ")+'">',"</g>"))});const L=d.width,D=d.height,M=f.width,N=f.height;let O,T;L===null?(T=D===null?"1em":D==="auto"?N:D,O=Si(T,M/N)):(O=L==="auto"?M:L,T=D===null?Si(O,N/M):D==="auto"?N:D);const W={},q=(Z,Q)=>{(_t=>_t==="unset"||_t==="undefined"||_t==="none")(Q)||(W[Z]=Q.toString())};q("width",O),q("height",T);const it=[f.left,f.top,M,N];return W.viewBox=it.join(" "),{attributes:W,viewBox:it,body:z}}(e,n),h=l.attributes;if(n.inline&&(i.verticalAlign="-0.125em"),r==="svg"){o.style={...i,...a},Object.assign(o,h);let u=0,v=t.id;return typeof v=="string"&&(v=v.replace(/-/g,"_")),o.innerHTML=function(y,d=Sl){const f=[];let z;for(;z=_l.exec(y);)f.push(z[1]);if(!f.length)return y;const L="suffix"+(16777216*Math.random()|Date.now()).toString(16);return f.forEach(D=>{const M=typeof d=="function"?d(D):d+(Cl++).toString(),N=D.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");y=y.replace(new RegExp('([#;"])('+N+')([")]|\\.[a-z])',"g"),"$1"+M+L+"$3")}),y=y.replace(new RegExp(L,"g"),"")}(l.body,v?()=>v+"ID"+u++:"iconifyVue"),_n("svg",o)}const{body:w,width:_,height:k}=e,$=r==="mask"||r!=="bg"&&w.indexOf("currentColor")!==-1,I=function(u,v){let y=u.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const d in v)y+=" "+d+'="'+v[d]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+y+">"+u+"</svg>"}(w,{...h,width:_+"",height:k+""});var p;return o.style={...i,"--svg":(p=I,'url("'+function(u){return"data:image/svg+xml,"+function(v){return v.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")}(u)}(p)+'")'),width:Ni(h.width),height:Ni(h.height),...Nl,...$?So:Li,...a},_n("span",o)};var ji;if(wi(!0),ji=xl,lo[""]=ji,typeof document<"u"&&typeof window<"u"){Pi();const e=window;if(e.IconifyPreload!==void 0){const t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(o=>{try{(typeof o!="object"||o===null||o instanceof Array||typeof o.icons!="object"||typeof o.prefix!="string"||!yl(o))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(let n in t){const o="IconifyProviders["+n+"] is invalid.";try{const r=t[n];if(typeof r!="object"||!r||r.resources===void 0)continue;El(n,r)||console.error(o)}catch{console.error(o)}}}}const Bl={...Qe,body:""},Co=Rt({inheritAttrs:!1,data:()=>({_name:"",_loadingIcon:null,iconMounted:!1,counter:0}),mounted(){this.iconMounted=!0},unmounted(){this.abortLoading()},methods:{abortLoading(){this._loadingIcon&&(this._loadingIcon.abort(),this._loadingIcon=null)},getIcon(e,t){if(typeof e=="object"&&e!==null&&typeof e.body=="string")return this._name="",this.abortLoading(),{data:e};let n;if(typeof e!="string"||(n=Je(e,!1,!0))===null)return this.abortLoading(),null;const o=function(i){const s=typeof i=="string"?Je(i,!0,ue):i;if(s){const a=Ut(s.provider,s.prefix),l=s.name;return a.icons[l]||(a.missing.has(l)?null:void 0)}}(n);if(!o)return this._loadingIcon&&this._loadingIcon.name===e||(this.abortLoading(),this._name="",o!==null&&(this._loadingIcon={name:e,abort:zl([n],()=>{this.counter++})})),null;this.abortLoading(),this._name!==e&&(this._name=e,t&&t(e));const r=["iconify"];return n.prefix!==""&&r.push("iconify--"+n.prefix),n.provider!==""&&r.push("iconify--"+n.provider),{data:o,classes:r}}},render(){this.counter;const e=this.$attrs,t=this.iconMounted||e.ssr?this.getIcon(e.icon,e.onLoad):null;if(!t)return Bi(Bl,e);let n=e;return t.classes&&(n={...e,class:(typeof e.class=="string"?e.class+" ":"")+t.classes.join(" ")}),Bi({...Qe,...t.data},n)}}),Jt=new Map,he=K(new Map);class de{static addWindowPanel(t){Jt.set(t.id,t)}static removeWindowPanel(t){Jt.has(t)&&(Jt.delete(t),he.value.delete(t))}static minimizeWindowPanel(t){Jt.has(t)&&he.value.set(t,-1)}static openWindowPanel(t){Jt.has(t)&&he.value.set(t,1)}}const jl=["src"],Ol={key:1,class:"paneltitle"},Wl={class:"dragPanelBar"},Ul={class:"dragPanelContent"},Fl={class:"drag-pointer-group"};var Eo=Rt({__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(e,{expose:t,emit:n}){const o=mr(),r=e,i=n,s=K(),a=K(),l=Xt(()=>r.isDark),h=K({x:0,y:0}),w=250,_=100,k=K({width:0,height:0}),$=T=>{s.value&&(s.value.style.left=`${T.x}px`,s.value.style.top=`${T.y}px`)};Pt(()=>h.value,T=>{$(T)});const I=T=>{s.value&&(s.value.style.width=`${T.width}px`,s.value.style.height=`${T.height}px`)};Pt(()=>k.value,T=>{I(T)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([T,W])=>{W.value&&W.value.addEventListener("mousedown",q=>{p.mouseDown(q,T)})})},mouseDown:(T,W)=>{T.button==0&&(T.preventDefault(),p.startingEdges={left:h.value.x,top:h.value.y,right:h.value.x+k.value.width,bottom:h.value.y+k.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:T.clientX,y:T.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",q=>{p.mouseMove(q,W)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",q=>{p.mouseUp(q,W)},{signal:p.eventListenerController.signal}))},mouseMove:(T,W)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[W].value){if(T.preventDefault(),console.log("mouseMove",W),W.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+T.clientY-p.clickStart.y,0);const q=p.newEdges.bottom-p.newEdges.top-_;q<0&&(p.newEdges.top+=q)}else W.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+T.clientY-p.clickStart.y,document.body.clientHeight));if(W.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+T.clientX-p.clickStart.x,0);const q=p.newEdges.right-p.newEdges.left-w;q<0&&(p.newEdges.left+=q)}else W.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+T.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(h.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},k.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,w),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,_),document.body.clientHeight)})},mouseUp:(T,W)=>{T.button!=0||p.startingEdges==null||(console.log("mouseUp",W),T.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.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)}},u={startingMouse:null,startingPosition:null,mouseDown:T=>{T.button==0&&(T.preventDefault(),console.log("mouseDown"),u.startingMouse={x:T.clientX,y:T.clientY},u.startingPosition=h.value,document.addEventListener("mousemove",u.mouseMove),document.addEventListener("mouseup",u.mouseUp))},mouseMove:T=>{!u.startingMouse||!u.startingPosition||(T.preventDefault(),h.value={x:Math.min(Math.max(u.startingPosition.x+T.clientX-u.startingMouse.x,0),document.body.clientWidth-k.value.width),y:Math.min(Math.max(u.startingPosition.y+T.clientY-u.startingMouse.y,0),document.body.clientHeight-k.value.height)})},mouseUp:T=>{T.button!=0||!u.startingMouse||!u.startingPosition||(T.preventDefault(),u.startingMouse=null,u.startingPosition=null,console.log("mouseUp"),document.removeEventListener("mousemove",u.mouseMove),document.removeEventListener("mouseup",u.mouseUp))}};function v(T){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:T??r.tag}}const y=Xt(()=>he.value.get(o)!==-1),d=K(!1),f=K(!0);function z(){i("minimize",v()),de.minimizeWindowPanel(o)}function L(){d.value=!d.value}function D(){i("close",v(!1)),de.removeWindowPanel(o),f.value=!1}const M=Xt(()=>d.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:y,close:D,open:function(){i("open",v(!0)),f.value=!0},showHidePanel:z};function O(T){if(zn(T))return T;{const W=Number(T);if(W==W)return W;if(T.endsWith("px")){const q=T.substring(0,T.length-2);return Number(q)}if(T.endsWith("%")){const q=T.substring(0,T.length-1);return Number(q)/100*document.body.clientWidth}return 300}}return t(N),Sn(()=>{(function(){let T=90;if(r.hasMin||(T-=30),r.hasMax||(T-=30),r.hasClose||(T-=30),ft.setCssVar("--right-bar-width",T+"px",a.value),!a.value)return;const W=zn(r.titleHeight)?r.titleHeight+"px":r.titleHeight;a.value.style.height=W,a.value.style.lineHeight=W})(),function(){const T=v(N);de.addWindowPanel(T),i("loaded",T)}(),h.value.x=O(r.left),h.value.y=O(r.top),$(h.value),k.value={width:O(r.nWidth),height:O(r.nHeight)},I(k.value),p.mount()}),Os(()=>{de.removeWindowPanel(o)}),(T,W)=>(X(),nt(ir,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:Ct(()=>[f.value?sr((X(),gt("div",{key:0,ref_key:"dragPanelRef",ref:s,class:At(["dragWindowPanel",{maxPanel:d.value,dragWindowPanel_dark:l.value}])},[J("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:a,onMousedown:W[0]||(W[0]=(...q)=>u.mouseDown&&u.mouseDown(...q))},[ct(T.$slots,"title",{},()=>[r.icon?(X(),gt("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,jl)):st("v-if",!0),r.title?(X(),gt("span",Ol,En(r.title),1)):st("v-if",!0)]),J("div",Wl,[e.hasMin?(X(),nt(xn(Co),{key:0,icon:"ant-design:minus-outlined",onClick:z})):st("v-if",!0),e.hasMax?(X(),nt(xn(Co),{key:1,icon:M.value,onClick:L},null,8,["icon"])):st("v-if",!0),e.hasClose?(X(),nt(xn(Co),{key:2,icon:"ant-design:close-outlined",onClick:D})):st("v-if",!0)])],544),J("div",Ul,[ct(T.$slots,"default")]),J("div",Fl,[J("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),J("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),J("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),J("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),W[1]||(W[1]=J("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),J("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),J("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),J("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),J("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[ar,y.value]]):st("v-if",!0)]),_:3}))}});function Hl(e){const t=new Hs(new Ee);return t.serialize(e),t.stream.toString()}function ql(e){return e==null||e===""?e:new qs(new Ee(e)).deserialize()}Eo.__scopeId="data-v-39ea9741",Eo.__file="src/controls/xwindow/XWindow.vue";const rn=new Map,xo=new Map;let sn;const Xl={getDefaultClient(){if(sn||(sn=new oe(SysConfig.DefaultHproseAPI)),!sn)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return sn},registerHprose(e,t){const n=xo.get(e);if(!n){const o=new oe(t);rn.set(e,o)}return n},getHprose:e=>xo?.get(e),getProxyHprose:e=>rn.get(e),unregisterHprose(e){rn.get(e)&&(xo.delete(e),rn.delete(e))}},Vl=5e3,Gl=36e5,Ft={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},ko="access_token",Kl=j.Config.ServiceURL.LoginAuthURL;function Io(){const e=Ir();e&&It(Ft.RefreshToken,Kl,{refreshToken:e}).then(t=>{To(t.data)})}function Oi(){const e=kt.getJsonObject(ko);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?Io():setTimeout(Io,n-5e3))}function To(e){const t=new Date().getTime();let n=new Date(e.accessToken.expires).getTime()-t;if(n>=36e5?(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 o=Nt();o?(o.token=e.accessToken.tokenContent,o.expire=e.accessToken.expires,o.refresh=e.refreshToken.tokenContent):o={token:e.accessToken.tokenContent,expire:e.accessToken.expires,refresh:e.refreshToken.tokenContent},kt.set(ko,o,n/1e3),Oi()}else kt.remove(ko)}const an="Wm314243",cn=j.Config.ServiceURL.LoginAuthURL;async function Jl(e){const t={username:e.username,pwd:ie.encryptToString(e.pwd,an)},n=(await It(Ft.Login,cn,t))?.data;return n&&To(n.doubletoken),n}function Yl(e){const t={oldpwd:ie.encryptToString(e.oldpwd,an),newpwd:ie.encryptToString(e.newpwd,an)};return It(Ft.ChangeMyPwd,cn,t)}function Zl(e){return ie.encryptToString(e,an)}function Ql(){const e=Nt();e&&(Rr(Ft.Logout,cn,{token:e.token,reftoken:e.refresh}),Hn())}function tu(e){return It(Ft.CheckToken,cn,{token:e})}const Ro="ROLE_SYSTEM_RIGHT",Mo=new Ae("",sessionStorage);function Wi(){return Mo.get(Ro)}function Po(e){Mo.set(Ro,e)}function Ui(){Mo.remove(Ro)}function Yt(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(Yt(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function Fi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Fi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Hi(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&Hi(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function fe(e,t,n,o="name"){const r=e[n],i=t[n];r?i&&Hi(r,i,o):i&&(e[n]=i)}function qi(e){if(e&&e.length>0){const t=e.length;let n,o=!1;if(t>0){o=Lt(e[0]);const r=o?e[0]:JSON.parse(e[0]);if(t>1)for(let i=1;i<e.length;i++){const s=e[i],a=o?s:JSON.parse(s);fe(r,a,"routes","name"),fe(r,a,"widgetMenu","name"),fe(r,a,"widgets","id"),fe(r,a,"functions","id")}n=r}return n&&(Yt(n.routes),Yt(n.widgetMenu),Yt(n.widgets),Yt(n.functions)),n}}const zo=[],Ao=[],Lo=[];function pe(){return Wi()}async function eu(e,t=!1){Ui();const n=Ft.GetSystemRights,o=j.Config.ServiceURL.LoginAuthURL,r=await It(n,o,{systemid:e});if(!r||!r.data)return void j.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(t){const s=JSON.parse(i[0]);return Po(s),s}{const s=qi(i);return Po(s),s}}}function Xi(e,t){const n={...e};return n.meta||(n.meta={}),t.index!=null&&(n.meta.index=t.index),t.title!=null&&(n.meta.title=t.title),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.path===o.path);if(r){const i=Xi(r,o);i&&n.children?.push(i)}})),n}function nu(e,t=2){if(t===0)return e;const n=pe();return n&&n.routes?(Lo.length>0||e.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=Xi(o,r);i&&Lo.push(i)}}),Lo):void 0}function Vi(e,t){const n={...e};return t.index!=null&&(n.index=t.index),e.children&&(n.children=[],t.children&&t.children.forEach(o=>{const r=e.children?.find(i=>i.name===o.name);if(r){const i=Vi(r,o);i&&n.children?.push(i)}})),n}function ou(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgetMenu?(Ao.length>0||e.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Vi(o,r);i&&Ao.push(i)}}),Ao):void 0}function ru(e,t=2){if(t===0)return e;const n=pe();return n&&n.widgets?(zo.length>0||e?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&zo.push(o)}),zo):void 0}function iu(e,t=2){if(t===0)return e;const n=pe();return n?n.functions:void 0}export{tc as BigFileDownload,De as Download,za as DownloadByUrl,Dt as EnumColor,Nr as FileUpload,tl as GetSignalRClient,j as Global,Xl as GlobalHprose,$t as GlobalMitt,ft as H5Tool,ge as HproseClient,Pa as HttpDownload,yr as JsonDownload,Ke as LayoutContainer,ht as LayoutContainerEnum,di as LayoutManager,he as MinWindowMap,ec as ObjToUrlParams,In as Pane,oe as ProxyClient,io as RouterTransition,fi as RouterTransitionAnimate,Ma as SaveAs,Vs as Splitpanes,Ae as Storage,ze as StringUtils,rl as StyleBlack,al as StyleGrayblue,sl as StyleMetal,il as StyleWhite,ce as SuspenseWithError,lt as SysEvents,Vl as TOKEN_REFRESH_TIME,Gl as TOKEN_VALID_TIMESPAN,Ft as USER_TOKEN_API,Ge as VWindow,Tc as WaterMark,ui as WindowResizeEvent,cl as WindowType,Jt as WindowsMap,Eo as XWindow,de as XWindowManager,ie as XXTEA,Ra as calculateBestTextColor,Yl as changeMyPWD,Oi as checkDoRefreshToken,tu as checkToken,Hn as clearLocalToken,Ui as clearRight,ka as colorIsDark,Ha as createFileUpload,Ia as darken,Xr as deepMerge,br as delay,ql as deserialize,Io as doRefreshToken,Vr as exportSystemRights,La as get,pe as getCurrentSystemRight,$a as getData,Zl as getEncryptPWD,iu as getFunctions,ba as getHexColor,Nt as getLocalToken,Ga as getLockState,Sa as getLongHexColor,Br as getProxyClient,_a as getRGBColor,Ea as getRGBColorFromHSLA,Ir as getRefreshToken,Wi as getRight,nu as getRoutes,eu as getSystemRoleRight,ru as getWidgetConfig,ou as getWidgetMenus,Yt as handleNodes,Nn as hexToRGB,Xa as init,Va as initDefaultProxyClient,dt as is,An as isArray,na as isAsyncFunction,ra as isBoolean,ia as isClient,ea as isDate,fr as isDef,aa as isElement,ua as isEmpty,Ca as isEnumColor,ha as isError,Re as isFunction,Le as isHexColor,la as isImageDom,ga as isMap,Pn as isNull,Qs as isNullAndUnDef,ta as isNullOrUnDef,zn as isNumber,Lt as isObjectX,oa as isPromise,ca as isServer,Me as isString,pa as isSymbol,Mn as isUnDef,ma as isValidURL,fa as isWeakMap,da as isWeakSet,sa as isWindow,qa as jquery,Ta as lighten,Jl as login,Ql as logout,qi as mergeFilterRoleSysRight,Fi as mergeNodes,fe as mergeNodesAll,wa as newGuid,Ka as onLockListener,Da as post,It as requestGet,Tr as requestPost,Rr as requestPostBody,xa as rgbToHex,Hl as serialize,To as setLocalToken,Po as setRight,Aa as sleep,ya as storage,kt as storageHelper,Ja as unLockListener,mr as uuid,ac as verifiyNumberInteger,mc as verifyAccount,uc as verifyAndSpace,kc as verifyCarNum,cc as verifyCnAndSpace,_c as verifyEmail,lc as verifyEnAndSpace,Cc as verifyFullName,bc as verifyIPAddress,Sc as verifyIdCard,fc as verifyNumberCnUppercase,hc as verifyNumberComma,to as verifyNumberIntegerAndFloat,ic as verifyNumberPercentage,sc as verifyNumberPercentageFloat,vc as verifyPassword,yc as verifyPasswordPowerful,wc as verifyPasswordStrength,pc as verifyPhone,Ec as verifyPostalCode,gc as verifyTelPhone,dc as verifyTextColor,xc as verifyUrl,oc as writeIconifyList,rc as writeSysRoleRight};
|
|
12
|
+
`,_t(t+o+"export default iconlist;","IconifyList.ts"))}function aa(n,e){const t=ur(n);Lo(t,e),B.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function ca(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 la(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 ua(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 ha(n){let e=n.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function da(n){let e=n.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function fa(n){return n.replace(/(^\s*)|(\s*$)/g,"")}function pa(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 ga(n,e="",t="red"){return e.replace(new RegExp(n,"gi"),`<span style='color: ${t}'>${n}</span>`)}function ma(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 va(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 ya(n){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(n)}function wa(n){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(n)}function ba(n){return!!/^[a-zA-Z]\w{5,15}$/.test(n)}function _a(n){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(n)}function Sa(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 Ca(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 Ea(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 ka(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 xa(n){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(n)}function Ia(n){return!!/^[1-9][0-9]{5}$/.test(n)}function Ta(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 Ra(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 fr=!0;try{String.fromCharCode.apply(String,[1,2])}catch{fr=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var An=2654435769;function pr(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 kt(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 xt(n,e,t,o,r,i){return(t>>>5^e<<2)+(e>>>3^t<<4)^(n^e)+(i[3&o^r]^t)}function gr(n){if(n.length<16){var e=new Uint8Array(16);e.set(n),n=e}return n}function It(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 mr(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 E=s+1;i.length=E,r.push(String.fromCharCode.apply(String,i)),o-=E,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(n,e)}function Pa(n){var e=n.length;if(e===0)return"";var t=fr?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 vr(n,e){return typeof n=="string"&&(n=It(n)),typeof e=="string"&&(e=It(e)),n==null||n.length===0?n:pr(function(t,o){var r,i,s,c,u,g,S=t.length,E=S-1;for(i=t[E],s=0,g=0|Math.floor(6+52/S);g>0;--g){for(c=(s=$e(s+An))>>>2&3,u=0;u<E;++u)r=t[u+1],i=t[u]=$e(t[u]+xt(s,r,i,u,c,o));r=t[0],i=t[E]=$e(t[E]+xt(s,r,i,E,c,o))}return t}(kt(n,!0),kt(gr(e),!1)),!1)}function yr(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=It(e)),n==null||n.length===0?n:pr(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]-xt(s,r,i,u,c,o));i=t[S],r=t[0]=$e(t[0]-xt(s,r,i,0,c,o))}return t}(kt(n,!1),kt(gr(e),!1)),!0)}const Ye={toBytes:It,toString:mr,encrypt:vr,encryptToString:function(n,e){return window.btoa(Pa(vr(n,e)))},decrypt:yr,decryptToString:function(n,e){return mr(yr(n,e))}},wr=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},Ma={set:n=>{let e=wr(n);document.getElementById(e)===null&&(e=wr(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 ve extends Error{constructor(e="An abort occurred."){const t=new.target.prototype;super(e),this.__proto__=t}}class za extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="UnsupportedTransportError",this.__proto__=o}}class Aa extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="DisabledTransportError",this.__proto__=o}}class Da extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.transport=t,this.errorType="FailedToStartTransportError",this.__proto__=o}}class br extends Error{constructor(e){const t=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=t}}class La extends Error{constructor(e,t){const o=new.target.prototype;super(e),this.innerErrors=t,this.__proto__=o}}class _r{constructor(e,t,o){this.statusCode=e,this.statusText=t,this.content=o}}class Tt{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 Ze{constructor(){}log(e,t){}}Ze.instance=new Ze;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 Qe(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 Sr(n,e,t,o,r,i){const s={},[c,u]=Fe();s[c]=u,n.log(k.Trace,`(${e} transport) sending data. ${Qe(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 $a{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 Rt{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 Fe(){let n="X-SignalR-User-Agent";return Z.isNode&&(n="User-Agent"),[n,Na("8.0.7",Ba(),Ua(),Wa())]}function Na(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 Ba(){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 Wa(){if(Z.isNode)return process.versions.node}function Ua(){return Z.isNode?"NodeJS":"Browser"}function Ln(n){return n.stack?n.stack:n.message?n.message:`${n}`}class Oa extends Tt{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 ve;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 ve});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 Cr(r,"text");throw new Ne(u||r.statusText,r.status)}const s=Cr(r,e.responseType),c=await s;return new _r(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 Cr(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 ja extends Tt{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ve):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 ve)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?t(new _r(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 Ha extends Tt{constructor(e){if(super(),typeof fetch<"u"||Z.isNode)this._httpClient=new Oa(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new ja(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new ve):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 qa{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 H;(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"})(H||(H={}));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 $a(this,e)}}class Xa{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 Va(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===H.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:H.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 H.Invocation:case H.StreamItem:case H.Completion:case H.StreamInvocation:case H.CancelInvocation:return!0;case H.Close:case H.Sequence:case H.Ping:case H.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:H.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Va{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 Jn{static create(e,t,o,r,i,s,c){return new Jn(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 qa,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:H.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 Xa(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 ve("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===H.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,E)=>{E?u(E):S&&(S.type===H.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 H.Invocation:this._invokeClientMethod(o).catch(r=>{this._logger.log(k.Error,`Invoke client method threw error: ${Ln(r)}`)});break;case H.StreamItem:case H.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===H.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(k.Error,`Stream callback threw error: ${Ln(i)}`)}}break}case H.Ping:break;case H.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 H.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case H.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 ve("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:H.Invocation}:{arguments:t,target:e,type:H.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:t,invocationId:i.toString(),streamIds:r,target:e,type:H.Invocation}:{arguments:t,invocationId:i.toString(),target:e,type:H.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:H.StreamInvocation}:{arguments:t,invocationId:r.toString(),target:e,type:H.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:H.CancelInvocation}}_createStreamItemMessage(e,t){return{invocationId:e,item:t,type:H.StreamItem}}_createCompletionMessage(e,t,o){return t?{error:t,invocationId:e,type:H.Completion}:{invocationId:e,result:o,type:H.Completion}}_createCloseMessage(){return{type:H.Close}}}const Ka=[0,2e3,1e4,3e4,null];class Er{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Ka}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class We{}We.Authorization="Authorization",We.Cookie="Cookie";class Ga extends Tt{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 Ja{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 kr{get pollAborted(){return this._pollAbort.aborted}constructor(e,t,o){this._httpClient=e,this._logger=t,this._pollAbort=new Ja,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]=Fe(),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. ${Qe(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?Sr(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]=Fe();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 Ya{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]=Fe();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. ${Qe(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?Sr(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 Za{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,E]=Fe();g[S]=E,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. ${Qe(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. ${Qe(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 Qa{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 Rt(k.Information):o===null?Ze.instance:o.log!==void 0?o:new Rt(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 Ha(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 ve(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 ve(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 Yn(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 ve("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 kr&&(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]=Fe();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 br("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 br(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(E){return Promise.reject(E)}i=this._createConnectUrl(e,u.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=u.connectionId)}catch(E){if(this._logger.log(k.Error,`Failed to start the transport '${g.transport}': ${E}`),u=void 0,s.push(new Da(`${g.transport} failed: ${E}`,te[g.transport])),this._connectionState!=="Connecting"){const L="Failed to select transport before stop() was called.";return this._logger.log(k.Debug,L),Promise.reject(new ve(L))}}}}return s.length>0?Promise.reject(new La(`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 Za(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 Ya(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case te.LongPolling:return new kr(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)!=0}(t,i))return this._logger.log(k.Debug,`Skipping transport '${te[i]}' because it was disabled by the client.`),new Aa(`'${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 za(`'${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 Yn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new Pt,this._transportResult=new Pt,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new Pt),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 Pt;const e=this._transportResult;this._transportResult=void 0;const t=typeof this._buffer[0]=="string"?this._buffer.join(""):Yn._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 Pt{constructor(){this.promise=new Promise((e,t)=>[this._resolver,this._rejecter]=[e,t])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class ec{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=Ze.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 H.Invocation:this._isInvocationMessage(s);break;case H.StreamItem:this._isStreamItemMessage(s);break;case H.Completion:this._isCompletionMessage(s);break;case H.Ping:case H.Close:break;case H.Ack:this._isAckMessage(s);break;case H.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 tc={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 nc{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=tc[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new Rt(t)}else this.logger=new Rt(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 Er(e):this.reconnectPolicy=e:this.reconnectPolicy=new Er,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 Qa(this.url,e);return Jn.create(t,this.logger||Ze.instance,this.protocol||new ec,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let Mt;function oc(n){if(!n){if(Mt)return Mt;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new nc().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!")}),Mt||(Mt=e),e}const $n=new Set;function xr(n){return n!==null?parseFloat(n):0}function zt(n){const e=window.getComputedStyle(n),t=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(xr).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(xr).reduce((r,i)=>r+i));return{width:t,height:o}}class Ir{width;height;constructor(e,t){this.width=e,this.height=t}}function rc(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 ic(n,e,t,o){const r=n-t,i=e-o;return r*r+i*i}window.addEventListener("resize",n=>{$n.forEach(e=>{e&>(e.fixPosition)&&e.fixPosition()})});const At=[];var Dt=Te({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:pt},setup(n,{emit:e}){const t=$i();if(!t)return;const{proxy:o}=t;let r=0,i,s,c;const u=G(n.isOpen),g=()=>{At.push(o),c=new Zi(n.zGroup,S),n.isOpen&&function(z){z&&(_o(()=>{r++==0&&(m(o),function(){const A=E.value,{width:M,height:N}=an(A);let U,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")U=n.left,R=n.top;else{const j=n.positionHint||"auto";switch(j){case"auto":{let X=20,le=50,oe=0;do{if(At.every(ye=>{if(!ye.isOpen||o==ye)return!0;const st=rc(ye);if(st==null)return!0;const{left:Ut,top:me}=st;return ic(Ut,me,X,le)>16}))break;X=(X+40)%(window.innerWidth-200),le=(le+40)%(window.innerHeight-200)}while(++oe<100);U=X,R=le}break;case"center":U=(window.innerWidth-M)/2,R=(window.innerHeight-N)/2,console.log(U,R,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=j.split("/").map(Number);if(X.length!=2)throw null;const[le,oe]=X;if(!isFinite(le)||!isFinite(oe))throw null;U=le>=0?le:window.innerWidth-M+le,R=oe>=0?oe:window.innerHeight-N+oe}catch{throw new Error(`invalid position string: ${j}`)}}}A&&(A.style.left=`${U}px`,A.style.top=`${R}px`)}()),n.resizable&&d(),$(),i=new Yi(L.value,E.value,{onMove:()=>$(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),n.resizable&&function(){const{height:A}=an(L.value);s=new Qi(E.value,{onResize:()=>d(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:n.minWidth,minHeight:n.minHeight+A,maxWidth:n.maxWidth,maxHeight:n.maxHeight?n.maxHeight+A:void 0})}()}),n.activateWhenOpen&&I())}(!0),$n.add(o)};function S(z){p.value.zIndex=`${z}`}const E=G(null),L=G(null),O=G(null);function I(){c.raise(),e("activate")}const p=G({...n.windowStyle.window,zIndex:"auto",overflow:n.overflow}),l=je(()=>n.windowStyle.titlebar),y=je(()=>{const z={...n.windowStyle.content};return n.resizable?z.padding="0":n.padding!=null&&(z.padding=`${n.padding}px`),n.isScrollable&&(z.overflow="auto"),z});function m(z){const{width:A,height:M,top:N,left:U}=z,R=E;if(R&&A!=null&&(R.value.style.width=`${A}px`),M!=null){const j=L.value;if(j){const X=zt(j).height;R.value.style.height=`${M+X}px`}}R&&U!=null&&(R.value.style.left=`${U}px`),R&&N!=null&&(R.value.style.top=`${N}px`)}function d(z=!0){const A=E.value,M=L.value,N=O.value;if(N&&A&&M){const{width:U,height:R}=zt(N),{width:j,height:X}=zt(A),le=zt(M).height,oe=j-(N.offsetWidth-U),ye=X-le-(N.offsetHeight-R);N.style.width=`${oe}px`,N.style.height=`${ye}px`,v(),e("resize",new Ir(oe,ye)),z&&(e("update:width",oe),e("update:height",ye))}}function v(){const z=E.value;if(z){const A=z.getBoundingClientRect();A.left<0&&(p.value.left="0px"),A.top<0&&(p.value.top="0px"),A.right>window.innerWidth&&(p.value.left=window.innerWidth-A.width+"px"),A.bottom>window.innerHeight&&(p.value.top=window.innerHeight-A.height+"px")}}function $(z=!0){v();const A=E.value;if(A){const{left:M,top:N}=A.getBoundingClientRect();z&&(e("update:left",M),e("update:top",N))}}return Re(()=>n.isOpen,z=>{u.value=z}),Re(()=>n.zGroup,z=>{c.group=z}),Re(()=>n.width,z=>{m({width:z}),d(!1)}),Re(()=>n.height,z=>{m({height:z}),d(!1)}),Jt(()=>{g()}),Ni(()=>{$n.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),At.splice(At.indexOf(o),1)}),{isOpen:u,windowEl:E,titlebar:L,content:O,activate:I,styleWindow:p,styleTitlebar:l,styleContent:y,closeButtonClick:function(){u.value=!1,e("closebuttonclick")},fixPosition:v}}});const sc={class:"title"};var Tr;Dt.render=function(n,e,t,o,r,i){const s=lt("myButton");return F(),Q(So,{name:"fade",onAfterLeave:e[2]||(e[2]=c=>n.$emit("close")),onAfterEnter:e[3]||(e[3]=c=>n.$emit("open")),persisted:""},{default:we(()=>[Co(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",sc,[n.$slots.title?ie(n.$slots,"title",{key:0}):(F(),fe(Pe,{key:1},[Yt(Zt(n.title),1)],64))]),n.closeButton?(F(),Q(s,{key:0,windowStyle:n.windowStyle,onClick:n.closeButtonClick},{default:we(()=>e[4]||(e[4]=[Yt("\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),[[Eo,n.isOpen]])]),_:3})},Dt.__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"}(Tr||(Tr={}));const ac={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)"}},cc={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)"}},lc={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)"}},uc={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)"}},hc=Dt;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 Rr{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(ze(e)?t=e:mt(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=Bi(t.default);e.layout&&(o.style=e.layout),e.cssClass&&(o.cssClass=e.cssClass),this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),_o().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),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=G(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 et=Te({name:"SuspenseWithError",setup(){const n=G(null);return Wi(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}}});et.render=function(n,e,t,o,r,i){return n.error?ie(n.$slots,"error",{key:0},()=>[Yt(Zt(n.error),1)]):(F(),Q(Ui,{key:1},{default:we(()=>[ie(n.$slots,"default")]),fallback:we(()=>[ie(n.$slots,"fallback")]),_:3}))},et.__file="src/controls/routertransition/SuspenseWithError.vue";var Nn=Te({name:"RouterTransition",__name:"RouterTransition",setup:n=>(e,t)=>{const o=lt("router-view");return F(),Q(et,null,{default:we(()=>[ut(o,null,{default:we(({Component:r,route:i})=>[ne(" <transition> "),(F(),Q(ko,null,[i.meta.keepAlive?(F(),Q(be(r),{key:i.name})):ne("v-if",!0)],1024)),i.meta.keepAlive?ne("v-if",!0):(F(),Q(be(r),{key:i.name})),ne(" </transition> ")]),_:1})]),_:1})}});Nn.__file="src/controls/routertransition/RouterTransition.vue";var Lt=Te({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=G(n.enableRouterView);Re(()=>n.enableRouterView,()=>{i.value=n.enableRouterView});const s=Oi({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 Rr(s,n.widgetConfig,r,c),g=p(ce.top),S=p(ce.centerBack),E=p(ce.centerFront),L=p(ce.left),O=p(ce.right),I=p(ce.bottom);function p(y){return u?.getContainerComponents(y)}const l=je(()=>n.layoutStyle);return Jt(()=>{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}))}),{...ji(s),topContainerComponents:g,centerbackComponents:S,centerfrontComponents:E,leftContainerComponents:L,rightContainerComponents:O,bottomContainerComponents:I,containerStyle:l,isEnableRouterView:i,setItemRef:(y,m)=>{y&&c.set(m,y)}}}});const dc={ref:"topContainer",class:"topContainer"},fc={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},pc={ref:"centerBackContainer",class:"centerdiv backContainer"},gc={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},mc={ref:"leftContainer",class:"leftContainer"},vc={ref:"rightContainer",class:"rightContainer"},yc={ref:"bottomContainer",class:"bottomContainer"};Lt.render=function(n,e,t,o,r,i){const s=lt("router-transition");return F(),fe("div",{class:"layoutContainer",style:ge(n.containerStyle)},[J("div",dc,[ie(n.$slots,"top"),(F(!0),fe(Pe,null,He(n.topContainerComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",null,[ne(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),n.isEnableRouterView?(F(),fe("div",fc,[ie(n.$slots,"main",{},()=>[ut(s)])],512)):ne("v-if",!0),ne(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),J("div",pc,[ie(n.$slots,"back"),(F(!0),fe(Pe,null,He(n.centerbackComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512),ne(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),J("div",gc,[ie(n.$slots,"front"),(F(!0),fe(Pe,null,He(n.centerfrontComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",mc,[ie(n.$slots,"left"),(F(!0),fe(Pe,null,He(n.leftContainerComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512),J("div",vc,[ie(n.$slots,"right"),(F(!0),fe(Pe,null,He(n.rightContainerComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512)]),J("div",yc,[ie(n.$slots,"bottom"),(F(!0),fe(Pe,null,He(n.bottomContainerComponents,([c,u])=>(F(),Q(be(u),{ref_for:!0,ref:g=>n.setItemRef(g,c),key:c,style:ge(u.style),class:Me(u.cssClass)},null,8,["style","class"]))),128))],512),ne(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),ie(n.$slots,"default")],4)},Lt.__scopeId="data-v-4d081e5c",Lt.__file="src/controls/layoutcontainer/layout.vue";var Pr=Te({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=lt("router-view");return F(),Q(et,null,{default:we(()=>[ut(o,null,{default:we(({Component:r,route:i})=>[ut(Hi,{appear:"","enter-active-class":e.enterActive,"leave-active-class":e.leaveActive},{default:we(()=>[(F(),Q(ko,null,[i.meta.keepAlive?(F(),Q(be(r),{key:i.name})):ne("v-if",!0)],1024)),i.meta.keepAlive?ne("v-if",!0):(F(),Q(be(r),{key:i.name}))]),_:2},1032,["enter-active-class","leave-active-class"])]),_:1})]),_:1})}});Pr.__file="src/controls/routertransition/RouterTransitionAnimate.vue";const Xe=new Map,tt=G(new Map);class nt{static addWindowPanel(e){Xe.set(e.id,e)}static removeWindowPanel(e){Xe.has(e)&&(Xe.delete(e),tt.value.delete(e))}static minimizeWindowPanel(e){Xe.has(e)&&tt.value.set(e,-1)}static openWindowPanel(e){Xe.has(e)&&tt.value.set(e,1)}}const wc=["src"],bc={key:1,class:"paneltitle"},_c={class:"dragPanelBar"},Sc={class:"dragPanelContent"},Cc={class:"drag-pointer-group"};var Bn=Te({__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=Ao(),r=n,i=t,s=G(),c=G(),u=je(()=>r.isDark),g=G({x:0,y:0}),S=250,E=100,L=G({width:0,height:0}),O=R=>{s.value&&(s.value.style.left=`${R.x}px`,s.value.style.top=`${R.y}px`)};Re(()=>g.value,R=>{O(R)});const I=R=>{s.value&&(s.value.style.width=`${R.width}px`,s.value.style.height=`${R.height}px`)};Re(()=>L.value,R=>{I(R)});const p={eventListenerController:null,startingEdges:null,newEdges:null,clickStart:null,mount:()=>{Object.entries(p.refs).forEach(([R,j])=>{j.value&&j.value.addEventListener("mousedown",X=>{p.mouseDown(X,R)})})},mouseDown:(R,j)=>{R.button==0&&(R.preventDefault(),p.startingEdges={left:g.value.x,top:g.value.y,right:g.value.x+L.value.width,bottom:g.value.y+L.value.height},p.newEdges={...p.startingEdges},p.clickStart={x:R.clientX,y:R.clientY},p.eventListenerController=new AbortController,document.addEventListener("mousemove",X=>{p.mouseMove(X,j)},{signal:p.eventListenerController.signal}),document.addEventListener("mouseup",X=>{p.mouseUp(X,j)},{signal:p.eventListenerController.signal}))},mouseMove:(R,j)=>{if(p.startingEdges!=null&&p.newEdges!=null&&p.clickStart!=null&&p.refs[j].value){if(R.preventDefault(),console.log("mouseMove",j),j.toLowerCase().includes("north")){p.newEdges.top=Math.max(p.startingEdges.top+R.clientY-p.clickStart.y,0);const X=p.newEdges.bottom-p.newEdges.top-E;X<0&&(p.newEdges.top+=X)}else j.toLowerCase().includes("south")&&(p.newEdges.bottom=Math.min(p.startingEdges.bottom+R.clientY-p.clickStart.y,document.body.clientHeight));if(j.toLowerCase().includes("west")){p.newEdges.left=Math.max(p.startingEdges.left+R.clientX-p.clickStart.x,0);const X=p.newEdges.right-p.newEdges.left-S;X<0&&(p.newEdges.left+=X)}else j.toLowerCase().includes("east")&&(p.newEdges.right=Math.min(p.startingEdges.right+R.clientX-p.clickStart.x,document.body.clientWidth));p.update()}},update:()=>{p.newEdges==null||p.startingEdges==null||(g.value={x:Math.max(p.newEdges.left,0),y:Math.max(p.newEdges.top,0)},L.value={width:Math.min(Math.max(p.newEdges.right-p.newEdges.left,S),document.body.clientWidth),height:Math.min(Math.max(p.newEdges.bottom-p.newEdges.top,E),document.body.clientHeight)})},mouseUp:(R,j)=>{R.button!=0||p.startingEdges==null||(console.log("mouseUp",j),R.preventDefault(),p.startingEdges=null,p.newEdges=null,p.clickStart=null,p.eventListenerController&&(p.eventListenerController.abort(),p.eventListenerController=null))},refs:{northWest:G(null),north:G(null),northEast:G(null),west:G(null),east:G(null),southWest:G(null),south:G(null),southEast:G(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-L.value.width),y:Math.min(Math.max(l.startingPosition.y+R.clientY-l.startingMouse.y,0),document.body.clientHeight-L.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 y(R){return{id:o,icon:r.icon,title:r.title,pid:r.pid,data:R??r.tag}}const m=je(()=>tt.value.get(o)!==-1),d=G(!1),v=G(!0);function $(){i("minimize",y()),nt.minimizeWindowPanel(o)}function z(){d.value=!d.value}function A(){i("close",y(!1)),nt.removeWindowPanel(o),v.value=!1}const M=je(()=>d.value?"heroicons-outline:square-2-stack":"ant-design:border-outlined"),N={id:o,isShow:m,close:A,open:function(){i("open",y(!0)),v.value=!0},showHidePanel:$};function U(R){if(un(R))return R;{const j=Number(R);if(j==j)return j;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(N),Jt(()=>{(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 j=un(r.titleHeight)?r.titleHeight+"px":r.titleHeight;c.value.style.height=j,c.value.style.lineHeight=j})(),function(){const R=y(N);nt.addWindowPanel(R),i("loaded",R)}(),g.value.x=U(r.left),g.value.y=U(r.top),O(g.value),L.value={width:U(r.nWidth),height:U(r.nHeight)},I(L.value),p.mount()}),qi(()=>{nt.removeWindowPanel(o)}),(R,j)=>(F(),Q(So,{appear:"","enter-active-class":"animated zoomIn","leave-active-class":"animated zoomOut"},{default:we(()=>[v.value?Co((F(),fe("div",{key:0,ref_key:"dragPanelRef",ref:s,class:Me(["dragWindowPanel",{maxPanel:d.value,dragWindowPanel_dark:u.value}])},[J("div",{class:"dragPanelTitle",ref_key:"dragPanelTitleRef",ref:c,onMousedown:j[0]||(j[0]=(...X)=>l.mouseDown&&l.mouseDown(...X))},[ie(R.$slots,"title",{},()=>[r.icon?(F(),fe("img",{key:0,src:r.icon,width:"24",height:"24"},null,8,wc)):ne("v-if",!0),r.title?(F(),fe("span",bc,Zt(r.title),1)):ne("v-if",!0)]),J("div",_c,[n.hasMin?(F(),Q(Qt(on),{key:0,icon:"ant-design:minus-outlined",onClick:$})):ne("v-if",!0),n.hasMax?(F(),Q(Qt(on),{key:1,icon:M.value,onClick:z},null,8,["icon"])):ne("v-if",!0),n.hasClose?(F(),Q(Qt(on),{key:2,icon:"ant-design:close-outlined",onClick:A})):ne("v-if",!0)])],544),J("div",Sc,[ie(R.$slots,"default")]),J("div",Cc,[J("div",{class:"cursor-nw-resize",ref:p.refs.northWest},null,512),J("div",{class:"cursor-n-resize",ref:p.refs.north},null,512),J("div",{class:"cursor-ne-resize",ref:p.refs.northEast},null,512),J("div",{class:"cursor-w-resize",ref:p.refs.west},null,512),j[1]||(j[1]=J("span",{style:{"pointer-events":"all",visibility:"hidden"}},null,-1)),J("div",{class:"cursor-e-resize",ref:p.refs.east},null,512),J("div",{class:"cursor-sw-resize",ref:p.refs.southWest},null,512),J("div",{class:"cursor-s-resize",ref:p.refs.south},null,512),J("div",{class:"cursor-se-resize",ref:p.refs.southEast},null,512)])],2)),[[Eo,m.value]]):ne("v-if",!0)]),_:3}))}});function Ec(n){const e=new tn(new xe);return e.serialize(n),e.stream.toString()}function kc(n){return n==null||n===""?n:new nn(new xe(n)).deserialize()}Bn.__scopeId="data-v-39ea9741",Bn.__file="src/controls/xwindow/XWindow.vue";class Zn{debug=!1;simple=!1;utc=!1;longType="number";dictType="object";nullType=void 0;static Instance=new Zn;textEncoder=new TextEncoder;textDecoder=new TextDecoder;constructor(){}encodeResponse(e,t={}){var o=new xe,r=new tn(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 xe(o),i=new nn(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
|
+
`+r.toString())}}decodeArguments(e){var t=e.stream;let o=[];if(t.readByte()===97){e.reset();var r=Ki.readCount(t);const s=new Array(r).fill(this.nullType);o=new Array(r),e.addReference(o);for(var i=0;i<r;++i)o[i]=e.deserialize(s[i]);t.readByte()}return o}encodeRequest(e,t,o={}){var r=new xe,i=new tn(r,this.simple,this.utc),s=o;this.simple&&(s.simple=!0);var c=0;for(var u in s)c++;c>0&&(r.writeByte(72),i.serialize(s),i.reset()),r.writeByte(67),i.serialize(e),t.length>0&&(i.reset(),i.serialize(t)),r.writeByte(122);const g=r.takeBytes();return this.textDecoder.decode(g)}decodeResponse(e,t={}){const o=this.textEncoder.encode(e);var r=new xe(o),i=new nn(r,!1);i.longType=this.longType,i.dictType=this.dictType;var s=r.readByte();if(s===72){var c=i.deserialize();for(var u in c)t[u]=c[u];i.reset(),s=r.readByte()}switch(s){case 82:return t.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
|
+
`+r.toString())}}}const $t=new Map,Wn=new Map;let Nt;const xc={getDefaultClient(){if(Nt||(Nt=new Ge(SysConfig.DefaultHproseAPI)),!Nt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Nt},registerHprose(n,e){const t=Wn.get(n);if(!t){const o=new Ge(e);$t.set(n,o)}return t},getHprose:n=>Wn?.get(n),getProxyHprose:n=>$t.get(n),unregisterHprose(n){$t.get(n)&&(Wn.delete(n),$t.delete(n))}},Ic=5e3,Tc=36e5,Ue={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},Un="access_token",Rc=B.Config.ServiceURL.LoginAuthURL;function On(){const n=qo();n&&Ce(Ue.RefreshToken,Rc,{refreshToken:n}).then(e=>{jn(e.data)})}function Mr(){const n=Se.getJsonObject(Un);if(!n)return;const e=new Date().getTime(),t=new Date(n.expire).getTime()-e;t>0&&(t<=5e3?On():setTimeout(On,t-5e3))}function jn(n){const e=new Date().getTime();let t=new Date(n.accessToken.expires).getTime()-e;if(t>=36e5?(t=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):t<-6e5&&(t=18e5,console.warn("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),t>0){let o=Le();o?(o.token=n.accessToken.tokenContent,o.expire=n.accessToken.expires,o.refresh=n.refreshToken.tokenContent):o={token:n.accessToken.tokenContent,expire:n.accessToken.expires,refresh:n.refreshToken.tokenContent},Se.set(Un,o,t/1e3),Mr()}else Se.remove(Un)}const Bt="Wm314243",Wt=B.Config.ServiceURL.LoginAuthURL;async function Pc(n){const e={username:n.username,pwd:Ye.encryptToString(n.pwd,Bt)},t=(await Ce(Ue.Login,Wt,e))?.data;return t&&jn(t.doubletoken),t}function Mc(n){const e={oldpwd:Ye.encryptToString(n.oldpwd,Bt),newpwd:Ye.encryptToString(n.newpwd,Bt)};return Ce(Ue.ChangeMyPwd,Wt,e)}function zc(n){return Ye.encryptToString(n,Bt)}function Ac(){const n=Le();n&&(Xo(Ue.Logout,Wt,{token:n.token,reftoken:n.refresh}),Sn())}function Dc(n){return Ce(Ue.CheckToken,Wt,{token:n})}const Hn="ROLE_SYSTEM_RIGHT",qn=new wt("",sessionStorage);function zr(){return qn.get(Hn)}function Fn(n){qn.set(Hn,n)}function Ar(){qn.remove(Hn)}function Ve(n){if(n)for(let e=0;e<n.length;e++){const t=n[e];t.children&&t.children.length>0?(Ve(t.children),t.children.length===0&&(n.splice(e,1),e--)):t.selected||(n.splice(e,1),e--)}}function Dr(n,e,t="name"){n&&e&&n.forEach(o=>{const r=e.find(i=>i[t]===o[t]);r&&(o.children?r.children&&Dr(o.children,r.children,t):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Lr(n,e,t="name"){n&&e&&n.forEach(o=>{const r=e.find(i=>i[t]===o[t]);r&&(o.children?r.children&&Lr(o.children,r.children,t):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function ot(n,e,t,o="name"){const r=n[t],i=e[t];r?i&&Lr(r,i,o):i&&(n[t]=i)}function $r(n){if(n&&n.length>0){const e=n.length;let t,o=!1;if(e>0){o=ze(n[0]);const r=o?n[0]:JSON.parse(n[0]);if(e>1)for(let i=1;i<n.length;i++){const s=n[i],c=o?s:JSON.parse(s);ot(r,c,"routes","name"),ot(r,c,"widgetMenu","name"),ot(r,c,"widgets","id"),ot(r,c,"functions","id")}t=r}return t&&(Ve(t.routes),Ve(t.widgetMenu),Ve(t.widgets),Ve(t.functions)),t}}const Xn=[],Vn=[],Kn=[];function rt(){return zr()}async function Lc(n,e=!1){Ar();const t=Ue.GetSystemRights,o=B.Config.ServiceURL.LoginAuthURL,r=await Ce(t,o,{systemid:n});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const i=r.data;if(i&&i.length>0){if(e){const s=JSON.parse(i[0]);return Fn(s),s}{const s=$r(i);return Fn(s),s}}}function Nr(n,e){const t={...n};return t.meta||(t.meta={}),e.index!=null&&(t.meta.index=e.index),e.title!=null&&(t.meta.title=e.title),n.children&&(t.children=[],e.children&&e.children.forEach(o=>{const r=n.children?.find(i=>i.path===o.path);if(r){const i=Nr(r,o);i&&t.children?.push(i)}})),t}function $c(n,e=2){if(e===0)return n;const t=rt();return t&&t.routes?(Kn.length>0||n.forEach(o=>{const r=t.routes?.find(i=>i.name===o.name);if(r){const i=Nr(o,r);i&&Kn.push(i)}}),Kn):void 0}function Br(n,e){const t={...n};return e.index!=null&&(t.index=e.index),n.children&&(t.children=[],e.children&&e.children.forEach(o=>{const r=n.children?.find(i=>i.name===o.name);if(r){const i=Br(r,o);i&&t.children?.push(i)}})),t}function Nc(n,e=2){if(e===0)return n;const t=rt();return t&&t.widgetMenu?(Vn.length>0||n.forEach(o=>{const r=t.widgetMenu?.find(i=>i.name===o.name);if(r){const i=Br(o,r);i&&Vn.push(i)}}),Vn):void 0}function Bc(n,e=2){if(e===0)return n;const t=rt();return t&&t.widgets?(Xn.length>0||n?.forEach(o=>{t.widgets?.find(r=>r.id===o.id)&&Xn.push(o)}),Xn):void 0}function Wc(n,e=2){if(e===0)return n;const t=rt();return t?t.functions:void 0}export{oa as BigFileDownload,_t as Download,Ls as DownloadByUrl,Ae as EnumColor,er as FileUpload,oc as GetSignalRClient,B as Global,xc as GlobalHprose,De as GlobalMitt,he as H5Tool,it as HproseClient,Zn as HproseRPCCodec,Ds as HttpDownload,Lo as JsonDownload,Lt as LayoutContainer,ce as LayoutContainerEnum,Rr as LayoutManager,tt as MinWindowMap,ra as ObjToUrlParams,rn as Pane,Ge as ProxyClient,Nn as RouterTransition,Pr as RouterTransitionAnimate,As as SaveAs,Ji as Splitpanes,wt as Storage,yt as StringUtils,ac as StyleBlack,uc as StyleGrayblue,lc as StyleMetal,cc as StyleWhite,et as SuspenseWithError,se as SysEvents,Ic as TOKEN_REFRESH_TIME,Tc as TOKEN_VALID_TIMESPAN,Ue as USER_TOKEN_API,Dt as VWindow,Ma as WaterMark,Ir as WindowResizeEvent,hc as WindowType,Xe as WindowsMap,Bn as XWindow,nt as XWindowManager,Ye as XXTEA,zs as calculateBestTextColor,Mc as changeMyPWD,Mr as checkDoRefreshToken,Dc as checkToken,Sn as clearLocalToken,Ar as clearRight,Rs as colorIsDark,Vs as createFileUpload,Ps as darken,lr as deepMerge,No as delay,kc as deserialize,On as doRefreshToken,ur as exportSystemRights,Ns as get,rt as getCurrentSystemRight,Ws as getData,zc as getEncryptPWD,Wc as getFunctions,Cs as getHexColor,Le as getLocalToken,Ys as getLockState,ks as getLongHexColor,tr as getProxyClient,Es as getRGBColor,Is as getRGBColorFromHSLA,qo as getRefreshToken,zr as getRight,$c as getRoutes,Lc as getSystemRoleRight,Bc as getWidgetConfig,Nc as getWidgetMenus,Ve as handleNodes,gn as hexToRGB,Gs as init,Js as initDefaultProxyClient,ue as is,hn as isArray,is as isAsyncFunction,as as isBoolean,cs as isClient,rs as isDate,Po as isDef,us as isElement,fs as isEmpty,xs as isEnumColor,ps as isError,gt as isFunction,bt as isHexColor,ds as isImageDom,ys as isMap,ln as isNull,ns as isNullAndUnDef,os as isNullOrUnDef,un as isNumber,ze as isObjectX,ss as isPromise,hs as isServer,mt as isString,vs as isSymbol,cn as isUnDef,ws as isValidURL,ms as isWeakMap,gs as isWeakSet,ls as isWindow,Ks as jquery,Ms as lighten,Pc as login,Ac as logout,$r as mergeFilterRoleSysRight,Dr as mergeNodes,ot as mergeNodesAll,Ss as newGuid,Zs as onLockListener,Bs as post,Ce as requestGet,Fo as requestPost,Xo as requestPostBody,Ts as rgbToHex,Ec as serialize,jn as setLocalToken,Fn as setRight,$s as sleep,_s as storage,Se as storageHelper,Qs as unLockListener,Ao as uuid,ua as verifiyNumberInteger,wa as verifyAccount,fa as verifyAndSpace,Ra as verifyCarNum,ha as verifyCnAndSpace,Ea as verifyEmail,da as verifyEnAndSpace,xa as verifyFullName,Ca as verifyIPAddress,ka as verifyIdCard,ma as verifyNumberCnUppercase,pa as verifyNumberComma,zn as verifyNumberIntegerAndFloat,ca as verifyNumberPercentage,la as verifyNumberPercentageFloat,ba as verifyPassword,_a as verifyPasswordPowerful,Sa as verifyPasswordStrength,va as verifyPhone,Ia as verifyPostalCode,ya as verifyTelPhone,ga as verifyTextColor,Ta as verifyUrl,sa as writeIconifyList,aa as writeSysRoleRight};
|