xframelib 0.7.6 → 0.7.7

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/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import{h as di,openBlock as G,createElementBlock as rt,normalizeStyle as It,renderSlot as tt,reactive as io,computed as Et,defineComponent as Ft,ref as dt,onMounted as Xe,onUpdated as pi,nextTick as Ve,normalizeClass as fi,createElementVNode as it,createCommentVNode as xt,createVNode as so,Transition as ao,withCtx as re,withModifiers as co,getCurrentInstance as gi,watch as qt,onBeforeUnmount as mi,resolveComponent as lo,createBlock as yt,withDirectives as vi,Fragment as Tt,createTextVNode as ho,toDisplayString as yi,vShow as wi,markRaw as bi,toRefs as _i,renderList as Bt,resolveDynamicComponent as Rt}from"vue";import Si from"axios";import Ci from"qs";import{Client as Ei,ClientContext as Ke}from"@hprose/rpc-core";import{ByteStream as uo}from"@hprose/io";import{HttpTransport as xi}from"@hprose/rpc-html5";var ki={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],c=this.panes[s[0]]||null,d=this.panes[s[1]]||null;const m=c.max<100&&i>=c.max+n.prevPanesSize,S=d.max<100&&i<=100-(d.max+this.sumNextPanesSize(t+1));if(m||S)m?(c.size=c.max,d.size=Math.max(100-c.max-n.prevPanesSize-n.nextPanesSize,0)):(c.size=Math.max(100-d.max-n.prevPanesSize-this.sumNextPanesSize(t+1),0),d.size=d.max);else{if(this.pushOtherPanes){const C=this.doPushOtherPanes(n,i);if(!C)return;({sums:n,panesToResize:s}=C),c=this.panes[s[0]]||null,d=this.panes[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,c.min),c.max)),d!==null&&(d.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,d.min),d.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 di("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},Je={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})}}};Je.render=function(e,t,n,o,r,i){return G(),rt("div",{class:"splitpanes__pane",onClick:t[0]||(t[0]=s=>i.onPaneClick(s,e._.uid)),style:It(e.style)},[tt(e.$slots,"default")],4)},Je.__file="src/controls/splitpanes/pane.vue";const Ii=Object.prototype.toString;function st(e,t){return Ii.call(e)===`[object ${t}]`}function ie(e){return st(e,"Function")}const po=e=>typeof e<"u",Ye=e=>!po(e);function Ze(e){return e===null}function Ti(e){return Ye(e)&&Ze(e)}function Ri(e){return Ye(e)||Ze(e)}const Pt=e=>e!=null&&e!==null&&st(e,"Object");function Pi(e){return st(e,"Date")}function zi(e){return st(e,"Number")}function $i(e){return st(e,"AsyncFunction")}function Di(e){return st(e,"Promise")&&Pt(e)&&ie(e.then)&&ie(e.catch)}function se(e){return st(e,"String")}function Mi(e){return e===!0||e===!1||st(e,"Boolean")}function Qe(e){return e&&Array.isArray(e)}const Ai=()=>typeof window<"u",Li=e=>typeof window<"u"&&st(e,"Window"),Ni=e=>Pt(e)&&!!e.tagName,Bi=typeof window>"u";function Ui(e){return e&&["IMAGE","IMG"].includes(e.tagName)}function Oi(e){return e==null||(se(e)||Qe(e)?e.length===0:!!Pt(e)&&JSON.stringify(e)==="{}")}function ji(e){return st(e,"Error")}function Wi(e){return st(e,"WeakSet")}function Hi(e){return st(e,"WeakMap")}function Fi(e){return st(e,"Symbol")}function qi(e){return st(e,"Map")}const Gi=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 zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ae(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Xi={exports:{}},tn=ae(Xi.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(_,u){var g=_[0],f=_[1],p=_[2],y=_[3];f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&p|~f&y)+u[0]-680876936|0)<<7|g>>>25)+f|0)&f|~g&p)+u[1]-389564586|0)<<12|y>>>20)+g|0)&g|~y&f)+u[2]+606105819|0)<<17|p>>>15)+y|0)&y|~p&g)+u[3]-1044525330|0)<<22|f>>>10)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&p|~f&y)+u[4]-176418897|0)<<7|g>>>25)+f|0)&f|~g&p)+u[5]+1200080426|0)<<12|y>>>20)+g|0)&g|~y&f)+u[6]-1473231341|0)<<17|p>>>15)+y|0)&y|~p&g)+u[7]-45705983|0)<<22|f>>>10)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&p|~f&y)+u[8]+1770035416|0)<<7|g>>>25)+f|0)&f|~g&p)+u[9]-1958414417|0)<<12|y>>>20)+g|0)&g|~y&f)+u[10]-42063|0)<<17|p>>>15)+y|0)&y|~p&g)+u[11]-1990404162|0)<<22|f>>>10)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&p|~f&y)+u[12]+1804603682|0)<<7|g>>>25)+f|0)&f|~g&p)+u[13]-40341101|0)<<12|y>>>20)+g|0)&g|~y&f)+u[14]-1502002290|0)<<17|p>>>15)+y|0)&y|~p&g)+u[15]+1236535329|0)<<22|f>>>10)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&y|p&~y)+u[1]-165796510|0)<<5|g>>>27)+f|0)&p|f&~p)+u[6]-1069501632|0)<<9|y>>>23)+g|0)&f|g&~f)+u[11]+643717713|0)<<14|p>>>18)+y|0)&g|y&~g)+u[0]-373897302|0)<<20|f>>>12)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&y|p&~y)+u[5]-701558691|0)<<5|g>>>27)+f|0)&p|f&~p)+u[10]+38016083|0)<<9|y>>>23)+g|0)&f|g&~f)+u[15]-660478335|0)<<14|p>>>18)+y|0)&g|y&~g)+u[4]-405537848|0)<<20|f>>>12)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&y|p&~y)+u[9]+568446438|0)<<5|g>>>27)+f|0)&p|f&~p)+u[14]-1019803690|0)<<9|y>>>23)+g|0)&f|g&~f)+u[3]-187363961|0)<<14|p>>>18)+y|0)&g|y&~g)+u[8]+1163531501|0)<<20|f>>>12)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f&y|p&~y)+u[13]-1444681467|0)<<5|g>>>27)+f|0)&p|f&~p)+u[2]-51403784|0)<<9|y>>>23)+g|0)&f|g&~f)+u[7]+1735328473|0)<<14|p>>>18)+y|0)&g|y&~g)+u[12]-1926607734|0)<<20|f>>>12)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f^p^y)+u[5]-378558|0)<<4|g>>>28)+f|0)^f^p)+u[8]-2022574463|0)<<11|y>>>21)+g|0)^g^f)+u[11]+1839030562|0)<<16|p>>>16)+y|0)^y^g)+u[14]-35309556|0)<<23|f>>>9)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f^p^y)+u[1]-1530992060|0)<<4|g>>>28)+f|0)^f^p)+u[4]+1272893353|0)<<11|y>>>21)+g|0)^g^f)+u[7]-155497632|0)<<16|p>>>16)+y|0)^y^g)+u[10]-1094730640|0)<<23|f>>>9)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f^p^y)+u[13]+681279174|0)<<4|g>>>28)+f|0)^f^p)+u[0]-358537222|0)<<11|y>>>21)+g|0)^g^f)+u[3]-722521979|0)<<16|p>>>16)+y|0)^y^g)+u[6]+76029189|0)<<23|f>>>9)+p|0,f=((f+=((p=((p+=((y=((y+=((g=((g+=(f^p^y)+u[9]-640364487|0)<<4|g>>>28)+f|0)^f^p)+u[12]-421815835|0)<<11|y>>>21)+g|0)^g^f)+u[15]+530742520|0)<<16|p>>>16)+y|0)^y^g)+u[2]-995338651|0)<<23|f>>>9)+p|0,f=((f+=((y=((y+=(f^((g=((g+=(p^(f|~y))+u[0]-198630844|0)<<6|g>>>26)+f|0)|~p))+u[7]+1126891415|0)<<10|y>>>22)+g|0)^((p=((p+=(g^(y|~f))+u[14]-1416354905|0)<<15|p>>>17)+y|0)|~g))+u[5]-57434055|0)<<21|f>>>11)+p|0,f=((f+=((y=((y+=(f^((g=((g+=(p^(f|~y))+u[12]+1700485571|0)<<6|g>>>26)+f|0)|~p))+u[3]-1894986606|0)<<10|y>>>22)+g|0)^((p=((p+=(g^(y|~f))+u[10]-1051523|0)<<15|p>>>17)+y|0)|~g))+u[1]-2054922799|0)<<21|f>>>11)+p|0,f=((f+=((y=((y+=(f^((g=((g+=(p^(f|~y))+u[8]+1873313359|0)<<6|g>>>26)+f|0)|~p))+u[15]-30611744|0)<<10|y>>>22)+g|0)^((p=((p+=(g^(y|~f))+u[6]-1560198380|0)<<15|p>>>17)+y|0)|~g))+u[13]+1309151649|0)<<21|f>>>11)+p|0,f=((f+=((y=((y+=(f^((g=((g+=(p^(f|~y))+u[4]-145523070|0)<<6|g>>>26)+f|0)|~p))+u[11]-1120210379|0)<<10|y>>>22)+g|0)^((p=((p+=(g^(y|~f))+u[2]+718787259|0)<<15|p>>>17)+y|0)|~g))+u[9]-343485551|0)<<21|f>>>11)+p|0,_[0]=g+_[0]|0,_[1]=f+_[1]|0,_[2]=p+_[2]|0,_[3]=y+_[3]|0}function o(_){var u,g=[];for(u=0;u<64;u+=4)g[u>>2]=_.charCodeAt(u)+(_.charCodeAt(u+1)<<8)+(_.charCodeAt(u+2)<<16)+(_.charCodeAt(u+3)<<24);return g}function r(_){var u,g=[];for(u=0;u<64;u+=4)g[u>>2]=_[u]+(_[u+1]<<8)+(_[u+2]<<16)+(_[u+3]<<24);return g}function i(_){var u,g,f,p,y,M,I=_.length,$=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n($,o(_.substring(u-64,u)));for(g=(_=_.substring(u-64)).length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<g;u+=1)f[u>>2]|=_.charCodeAt(u)<<(u%4<<3);if(f[u>>2]|=128<<(u%4<<3),u>55)for(n($,f),u=0;u<16;u+=1)f[u]=0;return p=(p=8*I).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(p[2],16),M=parseInt(p[1],16)||0,f[14]=y,f[15]=M,n($,f),$}function s(_){var u,g,f,p,y,M,I=_.length,$=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n($,r(_.subarray(u-64,u)));for(g=(_=u-64<I?_.subarray(u-64):new Uint8Array(0)).length,f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<g;u+=1)f[u>>2]|=_[u]<<(u%4<<3);if(f[u>>2]|=128<<(u%4<<3),u>55)for(n($,f),u=0;u<16;u+=1)f[u]=0;return p=(p=8*I).toString(16).match(/(.*?)(.{0,8})$/),y=parseInt(p[2],16),M=parseInt(p[1],16)||0,f[14]=y,f[15]=M,n($,f),$}function c(_){var u,g="";for(u=0;u<4;u+=1)g+=t[_>>8*u+4&15]+t[_>>8*u&15];return g}function d(_){var u;for(u=0;u<_.length;u+=1)_[u]=c(_[u]);return _.join("")}function m(_){return/[\u0080-\uFFFF]/.test(_)&&(_=unescape(encodeURIComponent(_))),_}function S(_,u){var g,f=_.length,p=new ArrayBuffer(f),y=new Uint8Array(p);for(g=0;g<f;g+=1)y[g]=_.charCodeAt(g);return u?y:p}function C(_){return String.fromCharCode.apply(null,new Uint8Array(_))}function D(_,u,g){var f=new Uint8Array(_.byteLength+u.byteLength);return f.set(new Uint8Array(_)),f.set(new Uint8Array(u),_.byteLength),g?f:f.buffer}function N(_){var u,g=[],f=_.length;for(u=0;u<f-1;u+=2)g.push(parseInt(_.substr(u,2),16));return String.fromCharCode.apply(String,g)}function R(){this.reset()}return d(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function _(u,g){return(u=0|u||0)<0?Math.max(u+g,0):Math.min(u,g)}ArrayBuffer.prototype.slice=function(u,g){var f,p,y,M,I=this.byteLength,$=_(u,I),B=I;return g!==e&&(B=_(g,I)),$>B?new ArrayBuffer(0):(f=B-$,p=new ArrayBuffer(f),y=new Uint8Array(p),M=new Uint8Array(this,$,f),y.set(M),p)}}(),R.prototype.append=function(_){return this.appendBinary(m(_)),this},R.prototype.appendBinary=function(_){this._buff+=_,this._length+=_.length;var u,g=this._buff.length;for(u=64;u<=g;u+=64)n(this._hash,o(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},R.prototype.end=function(_){var u,g,f=this._buff,p=f.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<p;u+=1)y[u>>2]|=f.charCodeAt(u)<<(u%4<<3);return this._finish(y,p),g=d(this._hash),_&&(g=N(g)),this.reset(),g},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(_){return this._buff=_.buff,this._length=_.length,this._hash=_.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(_,u){var g,f,p,y=u;if(_[y>>2]|=128<<(y%4<<3),y>55)for(n(this._hash,_),y=0;y<16;y+=1)_[y]=0;g=(g=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),f=parseInt(g[2],16),p=parseInt(g[1],16)||0,_[14]=f,_[15]=p,n(this._hash,_)},R.hash=function(_,u){return R.hashBinary(m(_),u)},R.hashBinary=function(_,u){var g=d(i(_));return u?N(g):g},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(_){var u,g=D(this._buff.buffer,_,!0),f=g.length;for(this._length+=_.byteLength,u=64;u<=f;u+=64)n(this._hash,r(g.subarray(u-64,u)));return this._buff=u-64<f?new Uint8Array(g.buffer.slice(u-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(_){var u,g,f=this._buff,p=f.length,y=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<p;u+=1)y[u>>2]|=f[u]<<(u%4<<3);return this._finish(y,p),g=d(this._hash),_&&(g=N(g)),this.reset(),g},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var _=R.prototype.getState.call(this);return _.buff=C(_.buff),_},R.ArrayBuffer.prototype.setState=function(_){return _.buff=S(_.buff,!0),R.prototype.setState.call(this,_)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(_,u){var g=d(s(new Uint8Array(_)));return u?N(g):g},R}());const en=[];class ut{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){ut.addHandler(window,"resize",t)}static offWindowResizeHandler(t){ut.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!!ut.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=ut.isFullScreen();t(o)}):document.addEventListener("MSFullscreenChange",function(){const o=ut.isFullScreen();t(o)})}static stringifyCircularHandler(t,n){if(typeof n=="object"&&n!==null){if(en.indexOf(n)!==-1)return;en.push(n)}return n}static jsonStringify(t){if(!t)return"";const n=JSON.stringify(t,ut.stringifyCircularHandler);return en.length=0,n}static jsonParse(t){const n=ut.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,c=new tn.ArrayBuffer,d=new FileReader;d.onload=function(m){c.append(m.target?.result);const S=c.end();n({isOK:!0,data:S})},d.onerror=function(){const m="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(m),n({isOK:!1,data:m})},function(){const m=0+s>=i.size?i.size:0+s;d.readAsArrayBuffer(r.call(i,0,m))}()}static getFileMD5(t,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=t,s=2097152,c=Math.ceil(i.size/s);let d=0;const m=new tn.ArrayBuffer,S=new FileReader;function C(){const D=d*s,N=D+s>=i.size?i.size:D+s;S.readAsArrayBuffer(r.call(i,D,N))}S.onload=function(D){if(m.append(D.target?.result),d++,d<c)C();else{const N=m.end();n({isOK:!0,data:N})}},S.onerror=function(){const D=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(D),n({isOK:!1,data:D})},C()}static MD5(t,n=!1){return tn.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}):ut.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 ut.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){ut.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=se(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)}}}class ce{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 le{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 Vi=new le("",localStorage);function he(){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 Ki(){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 Ji(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 Yi(e){var t=e.toLowerCase();if(ue(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 Zi(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 $t;function Qi(e){if(typeof e=="object"||!e)return;const t=e.toLowerCase().substring(0,1);return t==="#"?$t.Hex:t==="r"||t==="("?$t.RGBA:t==="h"?$t.Hsla:$t.RGBA}function ts(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),c=parseFloat(t[3])/(/%$/.test(t[3])?100:1);if(s===0)n=o=r=c;else{var d=c<=.5?c*(s+1):c+s-c*s,m=2*c-d;n=nn(m,d,i+1/3),o=nn(m,d,i),r=nn(m,d,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 nn(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 ue(e){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(e)}function es(e,t,n){const o=(e<<16|t<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function on(e){let t=e.toLowerCase();if(ue(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 ns(e){if(!ue(e))return;const[t,n,o]=on(e).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*t+.578*n+.114*o<192}function os(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${sn(e.substring(0,2),t)}${sn(e.substring(2,4),t)}${sn(e.substring(4,6),t)}`}function rs(e,t){return e=e.indexOf("#")>=0?e.substring(1,e.length):e,t=Math.trunc(255*t/100),`#${rn(e.substring(0,2),t)}${rn(e.substring(2,4),t)}${rn(e.substring(4,6),t)}`}function rn(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 fo(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 is(e){return function(t,n){return(fo(~~t[0],~~t[1],~~t[2])+.05)/(fo(n[0],n[1],n[2])+.05)}(on(e.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function sn(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 an(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"})($t||($t={}));const Ut=an(),ht={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},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 ss(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 go=(e,t)=>{const n=JSON.stringify(e,null,2);t?de(n,t+".json"):Ut.emit(ht.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},as=(e,t,n)=>{e.get(t,{responseType:"blob"}).then(function(o){de(o.data,n)}).catch(o=>{console.warn(o),Ut.emit(ht.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function mo(e){const t=e.lastIndexOf("/")+1;let n=e.substring(t);return n=decodeURI(n.split("?")[0]),n}function cs({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||mo(e)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),s.dispatchEvent(c),r(!0)}return e.indexOf("?")===-1&&(e+="?download"),window.open(e,t),r(!0)}{const s=document.createElement("canvas"),c=document.createElement("img");c.setAttribute("crossOrigin","Anonymous"),c.src=e,c.onload=d=>{s.width=c.width,s.height=c.height,s.getContext("2d").drawImage(c,0,0,c.width,c.height),s.toBlob(m=>{if(m){const S=document.createElement("a");S.href=window.URL.createObjectURL(m),S.download=mo(e),S.click(),URL.revokeObjectURL(S.href),r(!0)}},"image/jpeg")},c.onerror=d=>i(d)}})}function ls(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${vo}\u6BEB\u79D2`)}function vo(e){return new Promise(t=>setTimeout(t,e))}var yo,wo,cn,bo={exports:{}};wo=zt,cn=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"];function r(R,_){var u=R[_];if(typeof u.bind=="function")return u.bind(R);try{return Function.prototype.bind.call(u,R)}catch{return function(){return Function.prototype.apply.apply(u,[R,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(R){return R==="debug"&&(R="log"),typeof console!==t&&(R==="trace"&&n?i:console[R]!==void 0?r(console,R):console.log!==void 0?r(console,"log"):e)}function c(R,_){for(var u=0;u<o.length;u++){var g=o[u];this[g]=u<R?e:this.methodFactory(g,R,_)}this.log=this.debug}function d(R,_,u){return function(){typeof console!==t&&(c.call(this,_,u),this[R].apply(this,arguments))}}function m(R,_,u){return s(R)||d.apply(this,arguments)}function S(R,_,u){var g,f=this;_=_??"WARN";var p="loglevel";function y(){var I;if(typeof window!==t&&p){try{I=window.localStorage[p]}catch{}if(typeof I===t)try{var $=window.document.cookie,B=$.indexOf(encodeURIComponent(p)+"=");B!==-1&&(I=/^([^;]+)/.exec($.slice(B))[1])}catch{}return f.levels[I]===void 0&&(I=void 0),I}}typeof R=="string"?p+=":"+R:typeof R=="symbol"&&(p=void 0),f.name=R,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=u||m,f.getLevel=function(){return g},f.setLevel=function(I,$){if(typeof I=="string"&&f.levels[I.toUpperCase()]!==void 0&&(I=f.levels[I.toUpperCase()]),!(typeof I=="number"&&I>=0&&I<=f.levels.SILENT))throw"log.setLevel() called with invalid level: "+I;if(g=I,$!==!1&&function(B){var j=(o[B]||"silent").toUpperCase();if(typeof window!==t&&p){try{return void(window.localStorage[p]=j)}catch{}try{window.document.cookie=encodeURIComponent(p)+"="+j+";"}catch{}}}(I),c.call(f,I,R),typeof console===t&&I<f.levels.SILENT)return"No console available for logging"},f.setDefaultLevel=function(I){_=I,y()||f.setLevel(I,!1)},f.resetLevel=function(){f.setLevel(_,!1),function(){if(typeof window!==t&&p){try{return void window.localStorage.removeItem(p)}catch{}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}()},f.enableAll=function(I){f.setLevel(f.levels.TRACE,I)},f.disableAll=function(I){f.setLevel(f.levels.SILENT,I)};var M=y();M==null&&(M=_),f.setLevel(M,!1)}var C=new S,D={};C.getLogger=function(R){if(typeof R!="symbol"&&typeof R!="string"||R==="")throw new TypeError("You must supply a name when creating a logger.");var _=D[R];return _||(_=D[R]=new S(R,C.getLevel(),C.methodFactory)),_};var N=typeof window!==t?window.log:void 0;return C.noConflict=function(){return typeof window!==t&&window.log===C&&(window.log=N),C},C.getLoggers=function(){return D},C.default=C,C},(yo=bo).exports?yo.exports=cn():wo.log=cn();var ln=bo.exports;let _o=!1;const L={Config:SysConfig,EventBus:Ut,DefaultProxyClient:null,Axios:Si,Logger:e=>{_o||(import.meta.env?.DEV||SysConfig.UI.ProductLog?ln.enableAll():ln.setDefaultLevel("warn"),_o=!0);const t=e||"default";return ln.getLogger(t)}},So="access_token",wt=new le("user",localStorage);function Dt(){return wt.get(So)}function hn(){wt.remove(So)}function Co(){return Dt()?.refresh}function un(e,t,n,o="json",r){const i={baseURL:L.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:e,paramsSerializer:{serialize:function(s){return Ci.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Dt()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return L.SystemID&&(i.headers.sysid=L.SystemID,L.SystemGroup&&(i.headers.sysgroup=L.SystemGroup)),t&&(i.baseURL=t),i}function bt(e,t,n,o,r="json",i,s){const c=un(n,t,o,r,i);return s&&s>=2e4&&(c.timeout=s),L.Axios?.get(e,c).catch(function(d){pe(d,t,e,"Get")})}function pe(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 d=e.response.data;if(d){const m=d.indexOf(":"),S=d.indexOf(`
2
- `);if(m>0&&S-m>2){const C=d.substring(m+2,S);C.indexOf("System.Exception")>0?e.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,e.message=C)}else i=!0,e.message=d}else e.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:e.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:e.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:e.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:e.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:e.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:e.message=`\u8FDE\u63A5\u9519\u8BEF${e.response.status}`}let c={address:r,code:s,isExceptionInfo:i,message:e.message,result:e.response.data};if(L.EventBus.emit(ht.AxiosRequestErrorEvent,c),i)throw new Error(e.message)}else{if(e?.message)throw new Error(e.message);console.error(e,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function Eo(e,t,n,o,r,i="json",s){const c=un(o,t,r,i);s&&s>=2e4&&(c.timeout=s),c.headers["Content-Type"]="multipart/form-data";const d=function(m){let S=new FormData;return m&&Object.keys(m).forEach(C=>{if(!m)return;let D=m[C];D!=null&&(Qe(D)?D.forEach(N=>{S.append(C,ko(N))}):S.append(C,ko(D)))}),S}(n);return L.Axios?.post(e,d,c).catch(function(m){pe(m,t,e,"Post")})}function xo(e,t,n,o,r,i="json",s){const c=un(o,t,r,i);return s&&s>=2e4&&(c.timeout=s),L.Axios?.post(e,n,c).catch(function(d){pe(d,t,e,"Post")})}function hs(e,t){return bt(e,void 0,t)}function us(e,t){return Eo(e,void 0,t)}function ds(e,t){return L.Axios?.get(e,{params:t}).catch(function(n){pe(n,e,"","\u5916\u90E8Get")})}function ko(e){return e instanceof Blob?e:e.toString()}var dn={exports:{}},ps=typeof window<"u"?window:zt!==void 0?zt:typeof self<"u"?self:{},fs=function(e){if(!e)return!1;var t=gs.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)},gs=Object.prototype.toString,pn=function(e){return e.replace(/^\s+|\s+$/g,"")},ms=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var o in n)vs.call(n,o)&&(e[o]=n[o])}return e},vs=Object.prototype.hasOwnProperty,Io=ps,ys=fs,ws=function(e){if(!e)return{};for(var t,n={},o=pn(e).split(`
3
- `),r=0;r<o.length;r++){var i=o[r],s=i.indexOf(":"),c=pn(i.slice(0,s)).toLowerCase(),d=pn(i.slice(s+1));n[c]===void 0?n[c]=d:(t=n[c],Object.prototype.toString.call(t)==="[object Array]"?n[c].push(d):n[c]=[n[c],d])}return n},bs=ms;function To(e,t,n){var o=e;return ys(t)?(n=t,typeof e=="string"&&(o={uri:e})):o=bs(t,{uri:e}),o.callback=n,o}function _t(e,t,n){return Ro(t=To(e,t,n))}function Ro(e){if(e.callback===void 0)throw new Error("callback argument missing");var t=!1,n=function(g,f,p){t||(t=!0,e.callback(g,f,p))};function o(){var g=void 0;if(g=d.response?d.response:d.responseText||function(f){try{if(f.responseType==="document")return f.responseXML;var p=f.responseXML&&f.responseXML.documentElement.nodeName==="parsererror";if(f.responseType===""&&!p)return f.responseXML}catch{}return null}(d),_)try{g=JSON.parse(g)}catch{}return g}function r(g){return clearTimeout(m),g instanceof Error||(g=new Error(""+(g||"Unknown XMLHttpRequest Error"))),g.statusCode=0,n(g,u)}function i(){if(!c){var g;clearTimeout(m),g=e.useXDR&&d.status===void 0?200:d.status===1223?204:d.status;var f=u,p=null;return g!==0?(f={body:o(),statusCode:g,method:C,headers:{},url:S,rawRequest:d},d.getAllResponseHeaders&&(f.headers=ws(d.getAllResponseHeaders()))):p=new Error("Internal XMLHttpRequest Error"),n(p,f,f.body)}}var s,c,d=e.xhr||null;d||(d=e.cors||e.useXDR?new _t.XDomainRequest:new _t.XMLHttpRequest);var m,S=d.url=e.uri||e.url,C=d.method=e.method||"GET",D=e.body||e.data,N=d.headers=e.headers||{},R=!!e.sync,_=!1,u={body:void 0,headers:{},statusCode:0,method:C,url:S,rawRequest:d};if("json"in e&&e.json!==!1&&(_=!0,N.accept||N.Accept||(N.Accept="application/json"),C!=="GET"&&C!=="HEAD"&&(N["content-type"]||N["Content-Type"]||(N["Content-Type"]="application/json"),D=JSON.stringify(e.json===!0?D:e.json))),d.onreadystatechange=function(){d.readyState===4&&setTimeout(i,0)},d.onload=i,d.onerror=r,d.onprogress=function(){},d.onabort=function(){c=!0},d.ontimeout=r,d.open(C,S,!R,e.username,e.password),R||(d.withCredentials=!!e.withCredentials),!R&&e.timeout>0&&(m=setTimeout(function(){if(!c){c=!0,d.abort("timeout");var g=new Error("XMLHttpRequest timeout");g.code="ETIMEDOUT",r(g)}},e.timeout)),d.setRequestHeader)for(s in N)N.hasOwnProperty(s)&&d.setRequestHeader(s,N[s]);else if(e.headers&&!function(g){for(var f in g)if(g.hasOwnProperty(f))return!1;return!0}(e.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in e&&(d.responseType=e.responseType),"beforeSend"in e&&typeof e.beforeSend=="function"&&e.beforeSend(d),d.send(D||null),d}dn.exports=_t,dn.exports.default=_t,_t.XMLHttpRequest=Io.XMLHttpRequest||function(){},_t.XDomainRequest="withCredentials"in new _t.XMLHttpRequest?_t.XMLHttpRequest:Io.XDomainRequest,function(e,t){for(var n=0;n<e.length;n++)t(e[n])}(["get","put","post","patch","head","delete"],function(e){_t[e==="delete"?"del":e]=function(t,n,o){return(n=To(t,n,o)).method=e.toUpperCase(),Ro(n)}});var _s=ae(dn.exports);const Ss=[200,201,202,204,308],Cs=[408,502,503,504];class Po{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=an(),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,c=i*this.chunkCount,d=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(c+d,100))}};return new Promise((o,r)=>{this.currentXhr=_s({...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&&Ss.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&&Cs.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 Es=e=>new Po(e),xs=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 te{hproseURL;client;hproseProxy;static httpTransport;constructor(t){if(t&&!ce.isNullOrEmpty(t)){if(te.httpTransport||(te.httpTransport=new xi),this.client=new Ei(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")):Ut.emit(ht.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 Gt{hproseClient;hpProxyObj;defaultContext=new Ke;constructor(t){this.hproseClient=new te(t),this.hpProxyObj=null}getClientContext(t,n){const o={};n&&(o.requestHeaders=n);const r=Dt();o.httpRequestHeaders=t||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),L.SystemID&&(i.sysid=L.SystemID,L.SystemGroup&&(i.sysgroup=L.SystemGroup)),new Ke(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||Ut.emit(ht.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=Dt();return console.log(r,"userToken3"),r&&(n||(n=new Ke({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(t,o,n)}async hproseInvokeEncode(t){const n=new uo(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 uo.toString(o)}}class ks{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(ht.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")}}const fn=new Map,Is=function(e,t,n){!L.Config.DefaultHproseAPI&&L.Config.ServiceURL&&(L.Config.DefaultHproseAPI=L.Config.ServiceURL.DefaultHproseAPI),L.Config.DefaultHproseAPI&&ce.isNotEmpty(L.Config.DefaultHproseAPI)&&(L.DefaultProxyClient=new Gt(L.Config.DefaultHproseAPI));const o=L.Config.UI.GrayMode;o&&ut.setGrayMode(o);const r=new ks(e,L.EventBus);L.Message=r,L.SystemID=t,L.SystemGroup=n,L.EventBus.on(ht.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),L.EventBus.on(ht.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),L.EventBus.on(ht.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),L.EventBus.on(ht.CommonWarnEvent,i=>{r.warn(i)})};function zo(e){if(e&&ce.isNotEmpty(e)){if(fn.has(e))return fn.get(e);{const t=new Gt(e);return fn.set(e,t),t}}}function Ts(e){const t=zo(e);return t&&(L.DefaultProxyClient=t),t}const gn="is_LockScreen",$o=wt.get(gn,!1),Xt={isLock:$o,lockTime:$o=="true"?Mo():0};function Do(e){Xt.isLock=e,wt.set(gn,e,10),e&&(hn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Rs(){return wt.get(gn,!1)}function Mo(){let e=3600;return L.Config.UI?.LockTime&&L.Config.UI?.LockTime>=10&&(e=L.Config.UI.LockTime),e}let mn;function vn(){clearInterval(mn),!(window.location.href.indexOf("/login")>0||Xt.isLock)&&(Do(!1),Xt.lockTime=Mo(),mn=setInterval(()=>{if(Xt.lockTime--,Xt.lockTime<=0)return Do(!0),clearInterval(mn)},1e3))}function Ps(){vn(),document.addEventListener("mousedown",vn)}function zs(){document.removeEventListener("mousedown",vn)}function yn(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 $s={exports:{}},fe=ae($s.exports=function e(t,n,o){function r(c,d){if(!n[c]){if(!t[c]){if(!d&&yn)return yn(c);if(i)return i(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var S=n[c]={exports:{}};t[c][0].call(S.exports,function(C){var D=t[c][1][C];return r(D||C)},S,S.exports,e,t,n,o)}return n[c].exports}for(var i=yn,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 c=0,d=new s(D),m=o.document.createTextNode("");d.observe(m,{characterData:!0}),r=function(){m.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var R=o.document.createElement("script");R.onreadystatechange=function(){D(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},o.document.documentElement.appendChild(R)}:function(){setTimeout(D,0)};else{var S=new o.MessageChannel;S.port1.onmessage=D,r=function(){S.port2.postMessage(0)}}var C=[];function D(){var R,_;i=!0;for(var u=C.length;u;){for(_=C,C=[],R=-1;++R<u;)_[R]();u=C.length}i=!1}function N(R){C.push(R)!==1||i||r()}t.exports=N}).call(this,zt!==void 0?zt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var o=e(1);function r(){}var i={},s=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function m(p){if(typeof p!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,p!==r&&N(this,p)}function S(p,y,M){this.promise=p,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}function C(p,y,M){o(function(){var I;try{I=y(M)}catch($){return i.reject(p,$)}I===p?i.reject(p,new TypeError("Cannot resolve promise with itself")):i.resolve(p,I)})}function D(p){var y=p&&p.then;if(p&&(typeof p=="object"||typeof p=="function")&&typeof y=="function")return function(){y.apply(p,arguments)}}function N(p,y){var M=!1;function I(O){M||(M=!0,i.reject(p,O))}function $(O){M||(M=!0,i.resolve(p,O))}function B(){y($,I)}var j=R(B);j.status==="error"&&I(j.value)}function R(p,y){var M={};try{M.value=p(y),M.status="success"}catch(I){M.status="error",M.value=I}return M}function _(p){return p instanceof this?p:i.resolve(new this(r),p)}function u(p){var y=new this(r);return i.reject(y,p)}function g(p){var y=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=p.length,I=!1;if(!M)return this.resolve([]);for(var $=new Array(M),B=0,j=-1,O=new this(r);++j<M;)F(p[j],j);return O;function F(lt,Q){function ot(Y){$[Q]=Y,++B!==M||I||(I=!0,i.resolve(O,$))}y.resolve(lt).then(ot,function(Y){I||(I=!0,i.reject(O,Y))})}}function f(p){var y=this;if(Object.prototype.toString.call(p)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=p.length,I=!1;if(!M)return this.resolve([]);for(var $=-1,B=new this(r);++$<M;)j(p[$]);return B;function j(O){y.resolve(O).then(function(F){I||(I=!0,i.resolve(B,F))},function(F){I||(I=!0,i.reject(B,F))})}}t.exports=m,m.prototype.catch=function(p){return this.then(null,p)},m.prototype.then=function(p,y){if(typeof p!="function"&&this.state===c||typeof y!="function"&&this.state===s)return this;var M=new this.constructor(r);return this.state!==d?C(M,this.state===c?p:y,this.outcome):this.queue.push(new S(M,p,y)),M},S.prototype.callFulfilled=function(p){i.resolve(this.promise,p)},S.prototype.otherCallFulfilled=function(p){C(this.promise,this.onFulfilled,p)},S.prototype.callRejected=function(p){i.reject(this.promise,p)},S.prototype.otherCallRejected=function(p){C(this.promise,this.onRejected,p)},i.resolve=function(p,y){var M=R(D,y);if(M.status==="error")return i.reject(p,M.value);var I=M.value;if(I)N(p,I);else{p.state=c,p.outcome=y;for(var $=-1,B=p.queue.length;++$<B;)p.queue[$].callFulfilled(y)}return p},i.reject=function(p,y){p.state=s,p.outcome=y;for(var M=-1,I=p.queue.length;++M<I;)p.queue[M].callRejected(y);return p},m.resolve=_,m.reject=u,m.all=g,m.race=f},{1:1}],3:[function(e,t,n){(function(o){typeof o.Promise!="function"&&(o.Promise=e(2))}).call(this,zt!==void 0?zt: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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function r(a,l){if(!(a instanceof l))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),l=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||l)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function d(a,l){a=a||[],l=l||{};try{return new Blob(a,l)}catch(v){if(v.name!=="TypeError")throw v;for(var h=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),w=0;w<a.length;w+=1)h.append(a[w]);return h.getBlob(l.type)}}typeof Promise>"u"&&e(3);var m=Promise;function S(a,l){l&&a.then(function(h){l(null,h)},function(h){l(h)})}function C(a,l,h){typeof l=="function"&&a.then(l),typeof h=="function"&&a.catch(h)}function D(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function N(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",_=void 0,u={},g=Object.prototype.toString,f="readonly",p="readwrite";function y(a){for(var l=a.length,h=new ArrayBuffer(l),w=new Uint8Array(h),v=0;v<l;v++)w[v]=a.charCodeAt(v);return h}function M(a){return new m(function(l){var h=a.transaction(R,p),w=d([""]);h.objectStore(R).put(w,"key"),h.onabort=function(v){v.preventDefault(),v.stopPropagation(),l(!1)},h.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);l(b||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function I(a){return typeof _=="boolean"?m.resolve(_):M(a).then(function(l){return _=l})}function $(a){var l=u[a.name],h={};h.promise=new m(function(w,v){h.resolve=w,h.reject=v}),l.deferredOperations.push(h),l.dbReady?l.dbReady=l.dbReady.then(function(){return h.promise}):l.dbReady=h.promise}function B(a){var l=u[a.name].deferredOperations.pop();if(l)return l.resolve(),l.promise}function j(a,l){var h=u[a.name].deferredOperations.pop();if(h)return h.reject(l),h.promise}function O(a,l){return new m(function(h,w){if(u[a.name]=u[a.name]||Un(),a.db){if(!l)return h(a.db);$(a),a.db.close()}var v=[a.name];l&&v.push(a.version);var b=s.open.apply(s,v);l&&(b.onupgradeneeded=function(E){var k=b.result;try{k.createObjectStore(a.storeName),E.oldVersion<=1&&k.createObjectStore(R)}catch(T){if(T.name!=="ConstraintError")throw T;console.warn('The database "'+a.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),b.onerror=function(E){E.preventDefault(),w(b.error)},b.onsuccess=function(){var E=b.result;E.onversionchange=function(k){k.target.close()},h(E),B(a)}})}function F(a){return O(a,!1)}function lt(a){return O(a,!0)}function Q(a,l){if(!a.db)return!0;var h=!a.db.objectStoreNames.contains(a.storeName),w=a.version<a.db.version,v=a.version>a.db.version;if(w&&(a.version!==l&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),v||h){if(h){var b=a.db.version+1;b>a.version&&(a.version=b)}return!0}return!1}function ot(a){return new m(function(l,h){var w=new FileReader;w.onerror=h,w.onloadend=function(v){var b=btoa(v.target.result||"");l({__local_forage_encoded_blob:!0,data:b,type:a.type})},w.readAsBinaryString(a)})}function Y(a){return d([y(atob(a.data))],{type:a.type})}function mt(a){return a&&a.__local_forage_encoded_blob}function ee(a){var l=this,h=l._initReady().then(function(){var w=u[l._dbInfo.name];if(w&&w.dbReady)return w.dbReady});return C(h,a,a),h}function Ne(a){$(a);for(var l=u[a.name],h=l.forages,w=0;w<h.length;w++){var v=h[w];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return a.db=null,F(a).then(function(b){return a.db=b,Q(a)?lt(a):b}).then(function(b){a.db=l.db=b;for(var E=0;E<h.length;E++)h[E]._dbInfo.db=b}).catch(function(b){throw j(a,b),b})}function ft(a,l,h,w){w===void 0&&(w=1);try{var v=a.db.transaction(a.storeName,l);h(null,v)}catch(b){if(w>0&&(!a.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return m.resolve().then(function(){if(!a.db||b.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),lt(a)}).then(function(){return Ne(a).then(function(){ft(a,l,h,w-1)})}).catch(h);h(b)}}function Un(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function mr(a){var l=this,h={db:null};if(a)for(var w in a)h[w]=a[w];var v=u[h.name];v||(v=Un(),u[h.name]=v),v.forages.push(l),l._initReady||(l._initReady=l.ready,l.ready=ee);var b=[];function E(){return m.resolve()}for(var k=0;k<v.forages.length;k++){var T=v.forages[k];T!==l&&b.push(T._initReady().catch(E))}var P=v.forages.slice(0);return m.all(b).then(function(){return h.db=v.db,F(h)}).then(function(z){return h.db=z,Q(h,l._defaultConfig.version)?lt(h):z}).then(function(z){h.db=v.db=z,l._dbInfo=h;for(var A=0;A<P.length;A++){var U=P[A];U!==l&&(U._dbInfo.db=h.db,U._dbInfo.version=h.version)}})}function vr(a,l){var h=this;a=D(a);var w=new m(function(v,b){h.ready().then(function(){ft(h._dbInfo,f,function(E,k){if(E)return b(E);try{var T=k.objectStore(h._dbInfo.storeName).get(a);T.onsuccess=function(){var P=T.result;P===void 0&&(P=null),mt(P)&&(P=Y(P)),v(P)},T.onerror=function(){b(T.error)}}catch(P){b(P)}})}).catch(b)});return S(w,l),w}function yr(a,l){var h=this,w=new m(function(v,b){h.ready().then(function(){ft(h._dbInfo,f,function(E,k){if(E)return b(E);try{var T=k.objectStore(h._dbInfo.storeName).openCursor(),P=1;T.onsuccess=function(){var z=T.result;if(z){var A=z.value;mt(A)&&(A=Y(A));var U=a(A,z.key,P++);U!==void 0?v(U):z.continue()}else v()},T.onerror=function(){b(T.error)}}catch(z){b(z)}})}).catch(b)});return S(w,l),w}function wr(a,l,h){var w=this;a=D(a);var v=new m(function(b,E){var k;w.ready().then(function(){return k=w._dbInfo,g.call(l)==="[object Blob]"?I(k.db).then(function(T){return T?l:ot(l)}):l}).then(function(T){ft(w._dbInfo,p,function(P,z){if(P)return E(P);try{var A=z.objectStore(w._dbInfo.storeName);T===null&&(T=void 0);var U=A.put(T,a);z.oncomplete=function(){T===void 0&&(T=null),b(T)},z.onabort=z.onerror=function(){var W=U.error?U.error:U.transaction.error;E(W)}}catch(W){E(W)}})}).catch(E)});return S(v,h),v}function br(a,l){var h=this;a=D(a);var w=new m(function(v,b){h.ready().then(function(){ft(h._dbInfo,p,function(E,k){if(E)return b(E);try{var T=k.objectStore(h._dbInfo.storeName).delete(a);k.oncomplete=function(){v()},k.onerror=function(){b(T.error)},k.onabort=function(){var P=T.error?T.error:T.transaction.error;b(P)}}catch(P){b(P)}})}).catch(b)});return S(w,l),w}function _r(a){var l=this,h=new m(function(w,v){l.ready().then(function(){ft(l._dbInfo,p,function(b,E){if(b)return v(b);try{var k=E.objectStore(l._dbInfo.storeName).clear();E.oncomplete=function(){w()},E.onabort=E.onerror=function(){var T=k.error?k.error:k.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return S(h,a),h}function Sr(a){var l=this,h=new m(function(w,v){l.ready().then(function(){ft(l._dbInfo,f,function(b,E){if(b)return v(b);try{var k=E.objectStore(l._dbInfo.storeName).count();k.onsuccess=function(){w(k.result)},k.onerror=function(){v(k.error)}}catch(T){v(T)}})}).catch(v)});return S(h,a),h}function Cr(a,l){var h=this,w=new m(function(v,b){a<0?v(null):h.ready().then(function(){ft(h._dbInfo,f,function(E,k){if(E)return b(E);try{var T=k.objectStore(h._dbInfo.storeName),P=!1,z=T.openKeyCursor();z.onsuccess=function(){var A=z.result;A?a===0||P?v(A.key):(P=!0,A.advance(a)):v(null)},z.onerror=function(){b(z.error)}}catch(A){b(A)}})}).catch(b)});return S(w,l),w}function Er(a){var l=this,h=new m(function(w,v){l.ready().then(function(){ft(l._dbInfo,f,function(b,E){if(b)return v(b);try{var k=E.objectStore(l._dbInfo.storeName).openKeyCursor(),T=[];k.onsuccess=function(){var P=k.result;P?(T.push(P.key),P.continue()):w(T)},k.onerror=function(){v(k.error)}}catch(P){v(P)}})}).catch(v)});return S(h,a),h}function xr(a,l){l=N.apply(this,arguments);var h=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||h.name,a.storeName=a.storeName||h.storeName);var w,v=this;if(a.name){var b=a.name===h.name&&v._dbInfo.db?m.resolve(v._dbInfo.db):F(a).then(function(E){var k=u[a.name],T=k.forages;k.db=E;for(var P=0;P<T.length;P++)T[P]._dbInfo.db=E;return E});w=a.storeName?b.then(function(E){if(E.objectStoreNames.contains(a.storeName)){var k=E.version+1;$(a);var T=u[a.name],P=T.forages;E.close();for(var z=0;z<P.length;z++){var A=P[z];A._dbInfo.db=null,A._dbInfo.version=k}var U=new m(function(W,H){var Z=s.open(a.name,k);Z.onerror=function(vt){Z.result.close(),H(vt)},Z.onupgradeneeded=function(){Z.result.deleteObjectStore(a.storeName)},Z.onsuccess=function(){var vt=Z.result;vt.close(),W(vt)}});return U.then(function(W){T.db=W;for(var H=0;H<P.length;H++){var Z=P[H];Z._dbInfo.db=W,B(Z._dbInfo)}}).catch(function(W){throw(j(a,W)||m.resolve()).catch(function(){}),W})}}):b.then(function(E){$(a);var k=u[a.name],T=k.forages;E.close();for(var P=0;P<T.length;P++)T[P]._dbInfo.db=null;var z=new m(function(A,U){var W=s.deleteDatabase(a.name);W.onerror=function(){var H=W.result;H&&H.close(),U(W.error)},W.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},W.onsuccess=function(){var H=W.result;H&&H.close(),A(H)}});return z.then(function(A){k.db=A;for(var U=0;U<T.length;U++)B(T[U]._dbInfo)}).catch(function(A){throw(j(a,A)||m.resolve()).catch(function(){}),A})})}else w=m.reject("Invalid arguments");return S(w,l),w}var kr={_driver:"asyncStorage",_initStorage:mr,_support:c(),iterate:yr,getItem:vr,setItem:wr,removeItem:br,clear:_r,length:Sr,key:Cr,keys:Er,dropInstance:xr};function Ir(){return typeof openDatabase=="function"}var St="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tr="~~local_forage_type~",On=/^~~local_forage_type~([^~]+)~/,ne="__lfsc__:",Be=ne.length,Ue="arbf",Oe="blob",jn="si08",Wn="ui08",Hn="uic8",Fn="si16",qn="si32",Gn="ur16",Xn="ui32",Vn="fl32",Kn="fl64",Jn=Be+Ue.length,Yn=Object.prototype.toString;function Zn(a){var l,h,w,v,b,E=.75*a.length,k=a.length,T=0;a[a.length-1]==="="&&(E--,a[a.length-2]==="="&&E--);var P=new ArrayBuffer(E),z=new Uint8Array(P);for(l=0;l<k;l+=4)h=St.indexOf(a[l]),w=St.indexOf(a[l+1]),v=St.indexOf(a[l+2]),b=St.indexOf(a[l+3]),z[T++]=h<<2|w>>4,z[T++]=(15&w)<<4|v>>2,z[T++]=(3&v)<<6|63&b;return P}function je(a){var l,h=new Uint8Array(a),w="";for(l=0;l<h.length;l+=3)w+=St[h[l]>>2],w+=St[(3&h[l])<<4|h[l+1]>>4],w+=St[(15&h[l+1])<<2|h[l+2]>>6],w+=St[63&h[l+2]];return h.length%3==2?w=w.substring(0,w.length-1)+"=":h.length%3==1&&(w=w.substring(0,w.length-2)+"=="),w}function Rr(a,l){var h="";if(a&&(h=Yn.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&Yn.call(a.buffer)==="[object ArrayBuffer]")){var w,v=ne;a instanceof ArrayBuffer?(w=a,v+=Ue):(w=a.buffer,h==="[object Int8Array]"?v+=jn:h==="[object Uint8Array]"?v+=Wn:h==="[object Uint8ClampedArray]"?v+=Hn:h==="[object Int16Array]"?v+=Fn:h==="[object Uint16Array]"?v+=Gn:h==="[object Int32Array]"?v+=qn:h==="[object Uint32Array]"?v+=Xn:h==="[object Float32Array]"?v+=Vn:h==="[object Float64Array]"?v+=Kn:l(new Error("Failed to get type for BinaryArray"))),l(v+je(w))}else if(h==="[object Blob]"){var b=new FileReader;b.onload=function(){var E=Tr+a.type+"~"+je(this.result);l(ne+Oe+E)},b.readAsArrayBuffer(a)}else try{l(JSON.stringify(a))}catch(E){console.error("Couldn't convert value into a JSON string: ",a),l(null,E)}}function Pr(a){if(a.substring(0,Be)!==ne)return JSON.parse(a);var l,h=a.substring(Jn),w=a.substring(Be,Jn);if(w===Oe&&On.test(h)){var v=h.match(On);l=v[1],h=h.substring(v[0].length)}var b=Zn(h);switch(w){case Ue:return b;case Oe:return d([b],{type:l});case jn:return new Int8Array(b);case Wn:return new Uint8Array(b);case Hn:return new Uint8ClampedArray(b);case Fn:return new Int16Array(b);case Gn:return new Uint16Array(b);case qn:return new Int32Array(b);case Xn:return new Uint32Array(b);case Vn:return new Float32Array(b);case Kn:return new Float64Array(b);default:throw new Error("Unkown type: "+w)}}var We={serialize:Rr,deserialize:Pr,stringToBuffer:Zn,bufferToString:je};function Qn(a,l,h,w){a.executeSql("CREATE TABLE IF NOT EXISTS "+l.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],h,w)}function zr(a){var l=this,h={db:null};if(a)for(var w in a)h[w]=typeof a[w]!="string"?a[w].toString():a[w];var v=new m(function(b,E){try{h.db=openDatabase(h.name,String(h.version),h.description,h.size)}catch(k){return E(k)}h.db.transaction(function(k){Qn(k,h,function(){l._dbInfo=h,b()},function(T,P){E(P)})},E)});return h.serializer=We,v}function Ct(a,l,h,w,v,b){a.executeSql(h,w,v,function(E,k){k.code===k.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[l.storeName],function(T,P){P.rows.length?b(T,k):Qn(T,l,function(){T.executeSql(h,w,v,b)},b)},b):b(E,k)},b)}function $r(a,l){var h=this;a=D(a);var w=new m(function(v,b){h.ready().then(function(){var E=h._dbInfo;E.db.transaction(function(k){Ct(k,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[a],function(T,P){var z=P.rows.length?P.rows.item(0).value:null;z&&(z=E.serializer.deserialize(z)),v(z)},function(T,P){b(P)})})}).catch(b)});return S(w,l),w}function Dr(a,l){var h=this,w=new m(function(v,b){h.ready().then(function(){var E=h._dbInfo;E.db.transaction(function(k){Ct(k,E,"SELECT * FROM "+E.storeName,[],function(T,P){for(var z=P.rows,A=z.length,U=0;U<A;U++){var W=z.item(U),H=W.value;if(H&&(H=E.serializer.deserialize(H)),(H=a(H,W.key,U+1))!==void 0)return void v(H)}v()},function(T,P){b(P)})})}).catch(b)});return S(w,l),w}function to(a,l,h,w){var v=this;a=D(a);var b=new m(function(E,k){v.ready().then(function(){l===void 0&&(l=null);var T=l,P=v._dbInfo;P.serializer.serialize(l,function(z,A){A?k(A):P.db.transaction(function(U){Ct(U,P,"INSERT OR REPLACE INTO "+P.storeName+" (key, value) VALUES (?, ?)",[a,z],function(){E(T)},function(W,H){k(H)})},function(U){if(U.code===U.QUOTA_ERR){if(w>0)return void E(to.apply(v,[a,T,h,w-1]));k(U)}})})}).catch(k)});return S(b,h),b}function Mr(a,l,h){return to.apply(this,[a,l,h,1])}function Ar(a,l){var h=this;a=D(a);var w=new m(function(v,b){h.ready().then(function(){var E=h._dbInfo;E.db.transaction(function(k){Ct(k,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[a],function(){v()},function(T,P){b(P)})})}).catch(b)});return S(w,l),w}function Lr(a){var l=this,h=new m(function(w,v){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(E){Ct(E,b,"DELETE FROM "+b.storeName,[],function(){w()},function(k,T){v(T)})})}).catch(v)});return S(h,a),h}function Nr(a){var l=this,h=new m(function(w,v){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(E){Ct(E,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(k,T){var P=T.rows.item(0).c;w(P)},function(k,T){v(T)})})}).catch(v)});return S(h,a),h}function Br(a,l){var h=this,w=new m(function(v,b){h.ready().then(function(){var E=h._dbInfo;E.db.transaction(function(k){Ct(k,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[a+1],function(T,P){var z=P.rows.length?P.rows.item(0).key:null;v(z)},function(T,P){b(P)})})}).catch(b)});return S(w,l),w}function Ur(a){var l=this,h=new m(function(w,v){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(E){Ct(E,b,"SELECT key FROM "+b.storeName,[],function(k,T){for(var P=[],z=0;z<T.rows.length;z++)P.push(T.rows.item(z).key);w(P)},function(k,T){v(T)})})}).catch(v)});return S(h,a),h}function Or(a){return new m(function(l,h){a.transaction(function(w){w.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,b){for(var E=[],k=0;k<b.rows.length;k++)E.push(b.rows.item(k).name);l({db:a,storeNames:E})},function(v,b){h(b)})},function(w){h(w)})})}function jr(a,l){l=N.apply(this,arguments);var h=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||h.name,a.storeName=a.storeName||h.storeName);var w,v=this;return w=a.name?new m(function(b){var E;E=a.name===h.name?v._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?b({db:E,storeNames:[a.storeName]}):b(Or(E))}).then(function(b){return new m(function(E,k){b.db.transaction(function(T){function P(W){return new m(function(H,Z){T.executeSql("DROP TABLE IF EXISTS "+W,[],function(){H()},function(vt,qe){Z(qe)})})}for(var z=[],A=0,U=b.storeNames.length;A<U;A++)z.push(P(b.storeNames[A]));m.all(z).then(function(){E()}).catch(function(W){k(W)})},function(T){k(T)})})}):m.reject("Invalid arguments"),S(w,l),w}var Wr={_driver:"webSQLStorage",_initStorage:zr,_support:Ir(),iterate:Dr,getItem:$r,setItem:Mr,removeItem:Ar,clear:Lr,length:Nr,key:Br,keys:Ur,dropInstance:jr};function Hr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function eo(a,l){var h=a.name+"/";return a.storeName!==l.storeName&&(h+=a.storeName+"/"),h}function Fr(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function qr(){return!Fr()||localStorage.length>0}function Gr(a){var l=this,h={};if(a)for(var w in a)h[w]=a[w];return h.keyPrefix=eo(a,l._defaultConfig),qr()?(l._dbInfo=h,h.serializer=We,m.resolve()):m.reject()}function Xr(a){var l=this,h=l.ready().then(function(){for(var w=l._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var b=localStorage.key(v);b.indexOf(w)===0&&localStorage.removeItem(b)}});return S(h,a),h}function Vr(a,l){var h=this;a=D(a);var w=h.ready().then(function(){var v=h._dbInfo,b=localStorage.getItem(v.keyPrefix+a);return b&&(b=v.serializer.deserialize(b)),b});return S(w,l),w}function Kr(a,l){var h=this,w=h.ready().then(function(){for(var v=h._dbInfo,b=v.keyPrefix,E=b.length,k=localStorage.length,T=1,P=0;P<k;P++){var z=localStorage.key(P);if(z.indexOf(b)===0){var A=localStorage.getItem(z);if(A&&(A=v.serializer.deserialize(A)),(A=a(A,z.substring(E),T++))!==void 0)return A}}});return S(w,l),w}function Jr(a,l){var h=this,w=h.ready().then(function(){var v,b=h._dbInfo;try{v=localStorage.key(a)}catch{v=null}return v&&(v=v.substring(b.keyPrefix.length)),v});return S(w,l),w}function Yr(a){var l=this,h=l.ready().then(function(){for(var w=l._dbInfo,v=localStorage.length,b=[],E=0;E<v;E++){var k=localStorage.key(E);k.indexOf(w.keyPrefix)===0&&b.push(k.substring(w.keyPrefix.length))}return b});return S(h,a),h}function Zr(a){var l=this.keys().then(function(h){return h.length});return S(l,a),l}function Qr(a,l){var h=this;a=D(a);var w=h.ready().then(function(){var v=h._dbInfo;localStorage.removeItem(v.keyPrefix+a)});return S(w,l),w}function ti(a,l,h){var w=this;a=D(a);var v=w.ready().then(function(){l===void 0&&(l=null);var b=l;return new m(function(E,k){var T=w._dbInfo;T.serializer.serialize(l,function(P,z){if(z)k(z);else try{localStorage.setItem(T.keyPrefix+a,P),E(b)}catch(A){A.name!=="QuotaExceededError"&&A.name!=="NS_ERROR_DOM_QUOTA_REACHED"||k(A),k(A)}})})});return S(v,h),v}function ei(a,l){if(l=N.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var h=this.config();a.name=a.name||h.name,a.storeName=a.storeName||h.storeName}var w,v=this;return w=a.name?new m(function(b){a.storeName?b(eo(a,v._defaultConfig)):b(a.name+"/")}).then(function(b){for(var E=localStorage.length-1;E>=0;E--){var k=localStorage.key(E);k.indexOf(b)===0&&localStorage.removeItem(k)}}):m.reject("Invalid arguments"),S(w,l),w}var ni={_driver:"localStorageWrapper",_initStorage:Gr,_support:Hr(),iterate:Kr,getItem:Vr,setItem:ti,removeItem:Qr,clear:Xr,length:Zr,key:Jr,keys:Yr,dropInstance:ei},oi=function(a,l){return a===l||typeof a=="number"&&typeof l=="number"&&isNaN(a)&&isNaN(l)},ri=function(a,l){for(var h=a.length,w=0;w<h;){if(oi(a[w],l))return!0;w++}return!1},no=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Ht={},oo={},Nt={INDEXEDDB:kr,WEBSQL:Wr,LOCALSTORAGE:ni},ii=[Nt.INDEXEDDB._driver,Nt.WEBSQL._driver,Nt.LOCALSTORAGE._driver],oe=["dropInstance"],He=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(oe),si={description:"",driver:ii.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ai(a,l){a[l]=function(){var h=arguments;return a.ready().then(function(){return a[l].apply(a,h)})}}function Fe(){for(var a=1;a<arguments.length;a++){var l=arguments[a];if(l)for(var h in l)l.hasOwnProperty(h)&&(no(l[h])?arguments[0][h]=l[h].slice():arguments[0][h]=l[h])}return arguments[0]}var ci=function(){function a(l){for(var h in r(this,a),Nt)if(Nt.hasOwnProperty(h)){var w=Nt[h],v=w._driver;this[h]=v,Ht[v]||this.defineDriver(w)}this._defaultConfig=Fe({},si),this._config=Fe({},this._defaultConfig,l),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(l){if((l===void 0?"undefined":o(l))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var h in l){if(h==="storeName"&&(l[h]=l[h].replace(/\W/g,"_")),h==="version"&&typeof l[h]!="number")return new Error("Database version must be a number.");this._config[h]=l[h]}return!("driver"in l)||!l.driver||this.setDriver(this._config.driver)}return typeof l=="string"?this._config[l]:this._config},a.prototype.defineDriver=function(l,h,w){var v=new m(function(b,E){try{var k=l._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!l._driver)return void E(T);for(var P=He.concat("_initStorage"),z=0,A=P.length;z<A;z++){var U=P[z];if((!ri(oe,U)||l[U])&&typeof l[U]!="function")return void E(T)}var W=function(){for(var Z=function(hi){return function(){var ui=new Error("Method "+hi+" is not implemented by the current driver"),ro=m.reject(ui);return S(ro,arguments[arguments.length-1]),ro}},vt=0,qe=oe.length;vt<qe;vt++){var Ge=oe[vt];l[Ge]||(l[Ge]=Z(Ge))}};W();var H=function(Z){Ht[k]&&console.info("Redefining LocalForage driver: "+k),Ht[k]=l,oo[k]=Z,b()};"_support"in l?l._support&&typeof l._support=="function"?l._support().then(H,E):H(!!l._support):H(!0)}catch(Z){E(Z)}});return C(v,h,w),v},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(l,h,w){var v=Ht[l]?m.resolve(Ht[l]):m.reject(new Error("Driver not found."));return C(v,h,w),v},a.prototype.getSerializer=function(l){var h=m.resolve(We);return C(h,l),h},a.prototype.ready=function(l){var h=this,w=h._driverSet.then(function(){return h._ready===null&&(h._ready=h._initDriver()),h._ready});return C(w,l,l),w},a.prototype.setDriver=function(l,h,w){var v=this;no(l)||(l=[l]);var b=this._getSupportedDrivers(l);function E(){v._config.driver=v.driver()}function k(z){return v._extend(z),E(),v._ready=v._initStorage(v._config),v._ready}function T(z){return function(){var A=0;function U(){for(;A<z.length;){var W=z[A];return A++,v._dbInfo=null,v._ready=null,v.getDriver(W).then(k).catch(U)}E();var H=new Error("No available storage method found.");return v._driverSet=m.reject(H),v._driverSet}return U()}}var P=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=P.then(function(){var z=b[0];return v._dbInfo=null,v._ready=null,v.getDriver(z).then(function(A){v._driver=A._driver,E(),v._wrapLibraryMethodsWithReady(),v._initDriver=T(b)})}).catch(function(){E();var z=new Error("No available storage method found.");return v._driverSet=m.reject(z),v._driverSet}),C(this._driverSet,h,w),this._driverSet},a.prototype.supports=function(l){return!!oo[l]},a.prototype._extend=function(l){Fe(this,l)},a.prototype._getSupportedDrivers=function(l){for(var h=[],w=0,v=l.length;w<v;w++){var b=l[w];this.supports(b)&&h.push(b)}return h},a.prototype._wrapLibraryMethodsWithReady=function(){for(var l=0,h=He.length;l<h;l++)ai(this,He[l])},a.prototype.createInstance=function(l){return new a(l)},a}(),li=new ci;t.exports=li},{3:3}]},{},[4])(4)),Ao={exports:{}};/*!
1
+ import{h as vi,openBlock as G,createElementBlock as ie,normalizeStyle as Re,renderSlot as J,reactive as fo,computed as Ee,defineComponent as Pe,ref as he,onMounted as Jt,onUpdated as yi,nextTick as Yt,normalizeClass as wi,createElementVNode as se,createCommentVNode as ke,createVNode as it,Transition as Zt,withCtx as xe,withModifiers as po,getCurrentInstance as bi,watch as Xe,onBeforeUnmount as _i,resolveComponent as Qt,createBlock as fe,withDirectives as Si,Fragment as ze,createTextVNode as en,toDisplayString as go,vShow as Ci,markRaw as Ei,onErrorCaptured as ki,Suspense as xi,KeepAlive as Ii,resolveDynamicComponent as Ie,toRefs as Ti,renderList as He}from"vue";import Ri from"axios";import Pi from"qs";import{Client as zi,ClientContext as tn}from"@hprose/rpc-core";import{ByteStream as st,Writer as Mi,Reader as $i}from"@hprose/io";import{HttpTransport as Ai}from"@hprose/rpc-html5";var Di={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((t,e)=>(t[e.id]=e)&&t,{})}},methods:{updatePaneComponents(){this.panes.forEach(t=>{t.update&&t.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[t.id].size}%`})})},bindEvents(){document.addEventListener("mousemove",this.onMouseMove,{passive:!1}),document.addEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.addEventListener("touchmove",this.onMouseMove,{passive:!1}),document.addEventListener("touchend",this.onMouseUp))},unbindEvents(){document.removeEventListener("mousemove",this.onMouseMove,{passive:!1}),document.removeEventListener("mouseup",this.onMouseUp),"ontouchstart"in window&&(document.removeEventListener("touchmove",this.onMouseMove,{passive:!1}),document.removeEventListener("touchend",this.onMouseUp))},onMouseDown(t,e){this.bindEvents(),this.touch.mouseDown=!0,this.touch.activeSplitter=e},onMouseMove(t){this.touch.mouseDown&&(t.preventDefault(),this.touch.dragging=!0,this.calculatePanesSize(this.getCurrentMouseDrag(t)),this.$emit("resize",this.panes.map(e=>({min:e.min,max:e.max,size:e.size}))))},onMouseUp(){this.touch.dragging&&this.$emit("resized",this.panes.map(t=>({min:t.min,max:t.max,size:t.size}))),this.touch.mouseDown=!1,setTimeout(()=>{this.touch.dragging=!1,this.unbindEvents()},100)},onSplitterClick(t,e){"ontouchstart"in window&&(t.preventDefault(),this.dblClickSplitter&&(this.splitterTaps.splitter===e?(clearTimeout(this.splitterTaps.timeoutId),this.splitterTaps.timeoutId=null,this.onSplitterDblClick(t,e),this.splitterTaps.splitter=null):(this.splitterTaps.splitter=e,this.splitterTaps.timeoutId=setTimeout(()=>{this.splitterTaps.splitter=null},500)))),this.touch.dragging||this.$emit("splitter-click",this.panes[e])},onSplitterDblClick(t,e){let n=0;this.panes=this.panes.map((o,r)=>(o.size=r===e?o.max:o.min,r!==e&&(n+=o.min),o)),this.panes[e].size-=n,this.$emit("pane-maximize",this.panes[e])},onPaneClick(t,e){this.$emit("pane-click",this.indexedPanes[e])},getCurrentMouseDrag(t){const e=this.container.getBoundingClientRect(),{clientX:n,clientY:o}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:o-e.top}},getCurrentDragPercentage(t){t=t[this.horizontal?"y":"x"];const e=this.container[this.horizontal?"clientHeight":"clientWidth"];return this.rtl&&!this.horizontal&&(t=e-t),100*t/e},calculatePanesSize(t){const e=this.touch.activeSplitter;let n={prevPanesSize:this.sumPrevPanesSize(e),nextPanesSize:this.sumNextPanesSize(e),prevReachedMinPanes:0,nextReachedMinPanes:0};const o=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),i=Math.max(Math.min(this.getCurrentDragPercentage(t),r),o);let s=[e,e+1],c=this.panes[s[0]]||null,f=this.panes[s[1]]||null;const m=c.max<100&&i>=c.max+n.prevPanesSize,S=f.max<100&&i<=100-(f.max+this.sumNextPanesSize(e+1));if(m||S)m?(c.size=c.max,f.size=Math.max(100-c.max-n.prevPanesSize-n.nextPanesSize,0)):(c.size=Math.max(100-f.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),f.size=f.max);else{if(this.pushOtherPanes){const E=this.doPushOtherPanes(n,i);if(!E)return;({sums:n,panesToResize:s}=E),c=this.panes[s[0]]||null,f=this.panes[s[1]]||null}c!==null&&(c.size=Math.min(Math.max(i-n.prevPanesSize-n.prevReachedMinPanes,c.min),c.max)),f!==null&&(f.size=Math.min(Math.max(100-i-n.nextPanesSize-n.nextReachedMinPanes,f.min),f.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,o=[n,n+1];return e<t.prevPanesSize+this.panes[o[0]].min&&(o[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,o[0]<n&&this.panes.forEach((r,i)=>{i>o[0]&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(o[0]),o[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,i)=>{i>0&&i<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[o[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[o[1]].min&&(o[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,o[1]>n+1&&this.panes.forEach((r,i)=>{i>n&&i<o[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(o[1]-1),o[1]===void 0)?(t.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,t.nextReachedMinPanes+=r.min)}),this.panes[o[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:o}},sumPrevPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,o)=>e+(o>t+1?n.size:0),0)},findPrevExpandedPane(t){return[...this.panes].reverse().find(e=>e.index<t&&e.size>e.min)||{}},findNextExpandedPane(t){return this.panes.find(e=>e.index>t+1&&e.size>e.min)||{}},checkSplitpanesNodes(){Array.from(this.container.children).forEach(t=>{const e=t.classList.contains("splitpanes__pane"),n=t.classList.contains("splitpanes__splitter");if(!e&&!n)return t.parentNode.removeChild(t),void console.warn("Splitpanes: Only <pane> elements are allowed at the root of <splitpanes>. One of your DOM nodes was removed.")})},addSplitter(t,e,n=!1){const o=t-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)),e.parentNode.insertBefore(r,e)},removeSplitter(t){t.onmousedown=void 0,t.onclick=void 0,t.ondblclick=void 0,t.parentNode.removeChild(t)},redoSplitters(){const t=Array.from(this.container.children);t.forEach(n=>{n.className.includes("splitpanes__splitter")&&this.removeSplitter(n)});let e=0;t.forEach(n=>{n.className.includes("splitpanes__pane")&&(!e&&this.firstSplitter?this.addSplitter(e,n,!0):e&&this.addSplitter(e,n),e++)})},requestUpdate({target:t,...e}){const n=this.indexedPanes[t._.uid];Object.entries(e).forEach(([o,r])=>n[o]=r)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(r=>(r.className.includes("splitpanes__pane")&&e++,r===t.$el));const n=parseFloat(t.minSize),o=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(o)?100:o,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.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(t){const e=this.panes.findIndex(o=>o.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((o,r)=>o.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(o=>({min:o.min,max:o.max,size:o.size}))})})},resetPaneSizes(t={}){t.addedPane||t.removedPane?this.panes.some(e=>e.givenSize!==null||e.min||e.max<100)?this.equalizeAfterAddOrRemove(t):this.equalize():this.initialPanesSizing(),this.ready&&this.$emit("resized",this.panes.map(e=>({min:e.min,max:e.max,size:e.size})))},equalize(){const t=100/this.panesCount;let e=0;const n=[],o=[];this.panes.forEach(r=>{r.size=Math.max(Math.min(t,r.max),r.min),e-=r.size,r.size>=r.max&&n.push(r.id),r.size<=r.min&&o.push(r.id)}),e>.1&&this.readjustSizes(e,n,o)},initialPanesSizing(){let t=100;const e=[],n=[];let o=0;this.panes.forEach(i=>{t-=i.size,i.size!==null&&o++,i.size>=i.max&&e.push(i.id),i.size<=i.min&&n.push(i.id)});let r=100;t>.1&&(this.panes.forEach(i=>{i.size===null&&(i.size=Math.max(Math.min(t/(this.panesCount-o),i.max),i.min)),r-=i.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const o=[],r=[];t&&t.givenSize!==null&&(e=(100-t.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=>{t&&t.givenSize!==null&&t.id===i.id||(i.size=Math.max(Math.min(e,i.max),i.min)),n-=i.size,i.size>=i.max&&o.push(i.id),i.size<=i.min&&r.push(i.id)}),n>.1&&this.readjustSizes(n,o,r))},readjustSizes(t,e,n){let o;o=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const i=Math.max(Math.min(r.size+o,r.max),r.min),s=i-r.size;t-=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;t-=s,r.size=i}r.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[r.id].size}%`})}),Math.abs(t)>.1&&this.$nextTick(()=>{this.ready&&console.warn("Splitpanes: Could not resize panes correctly due to their constraints.")})}},watch:{panes:{deep:!0,immediate:!1,handler(){this.updatePaneComponents()}},horizontal(){this.updatePaneComponents()},firstSplitter(){this.redoSplitters()},dblClickSplitter(t){[...this.container.querySelectorAll(".splitpanes__splitter")].forEach((e,n)=>{e.ondblclick=t?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 vi("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},nn={name:"pane",inject:["requestUpdate","onPaneAdd","onPaneRemove","onPaneClick"],props:{size:{type:[Number,String],default:10},minSize:{type:[Number,String],default:0},maxSize:{type:[Number,String],default:100}},data:()=>({style:{}}),mounted(){this.onPaneAdd(this)},beforeUnmount(){this.onPaneRemove(this)},methods:{update(t){this.style=t}},computed:{sizeNumber(){return this.size||this.size===0?parseFloat(this.size):null},minSizeNumber(){return parseFloat(this.minSize)},maxSizeNumber(){return parseFloat(this.maxSize)}},watch:{sizeNumber(t){this.requestUpdate({target:this,size:t})},minSizeNumber(t){this.requestUpdate({target:this,min:t})},maxSizeNumber(t){this.requestUpdate({target:this,max:t})}}};nn.render=function(t,e,n,o,r,i){return G(),ie("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=s=>i.onPaneClick(s,t._.uid)),style:Re(t.style)},[J(t.$slots,"default")],4)},nn.__file="src/controls/splitpanes/pane.vue";const Li=Object.prototype.toString;function ae(t,e){return Li.call(t)===`[object ${e}]`}function at(t){return ae(t,"Function")}const mo=t=>typeof t<"u",on=t=>!mo(t);function rn(t){return t===null}function Ni(t){return on(t)&&rn(t)}function Bi(t){return on(t)||rn(t)}const Me=t=>t!=null&&t!==null&&ae(t,"Object");function Ui(t){return ae(t,"Date")}function ji(t){return ae(t,"Number")}function Oi(t){return ae(t,"AsyncFunction")}function Wi(t){return ae(t,"Promise")&&Me(t)&&at(t.then)&&at(t.catch)}function ct(t){return ae(t,"String")}function Hi(t){return t===!0||t===!1||ae(t,"Boolean")}function sn(t){return t&&Array.isArray(t)}const Fi=()=>typeof window<"u",qi=t=>typeof window<"u"&&ae(t,"Window"),Gi=t=>Me(t)&&!!t.tagName,Xi=typeof window>"u";function Vi(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function Ki(t){return t==null||(ct(t)||sn(t)?t.length===0:!!Me(t)&&JSON.stringify(t)==="{}")}function Ji(t){return ae(t,"Error")}function Yi(t){return ae(t,"WeakSet")}function Zi(t){return ae(t,"WeakMap")}function Qi(t){return ae(t,"Symbol")}function es(t){return ae(t,"Map")}const ts=t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t);var $e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ns={exports:{}},an=lt(ns.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(_,d){var p=_[0],g=_[1],u=_[2],v=_[3];g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&u|~g&v)+d[0]-680876936|0)<<7|p>>>25)+g|0)&g|~p&u)+d[1]-389564586|0)<<12|v>>>20)+p|0)&p|~v&g)+d[2]+606105819|0)<<17|u>>>15)+v|0)&v|~u&p)+d[3]-1044525330|0)<<22|g>>>10)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&u|~g&v)+d[4]-176418897|0)<<7|p>>>25)+g|0)&g|~p&u)+d[5]+1200080426|0)<<12|v>>>20)+p|0)&p|~v&g)+d[6]-1473231341|0)<<17|u>>>15)+v|0)&v|~u&p)+d[7]-45705983|0)<<22|g>>>10)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&u|~g&v)+d[8]+1770035416|0)<<7|p>>>25)+g|0)&g|~p&u)+d[9]-1958414417|0)<<12|v>>>20)+p|0)&p|~v&g)+d[10]-42063|0)<<17|u>>>15)+v|0)&v|~u&p)+d[11]-1990404162|0)<<22|g>>>10)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&u|~g&v)+d[12]+1804603682|0)<<7|p>>>25)+g|0)&g|~p&u)+d[13]-40341101|0)<<12|v>>>20)+p|0)&p|~v&g)+d[14]-1502002290|0)<<17|u>>>15)+v|0)&v|~u&p)+d[15]+1236535329|0)<<22|g>>>10)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&v|u&~v)+d[1]-165796510|0)<<5|p>>>27)+g|0)&u|g&~u)+d[6]-1069501632|0)<<9|v>>>23)+p|0)&g|p&~g)+d[11]+643717713|0)<<14|u>>>18)+v|0)&p|v&~p)+d[0]-373897302|0)<<20|g>>>12)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&v|u&~v)+d[5]-701558691|0)<<5|p>>>27)+g|0)&u|g&~u)+d[10]+38016083|0)<<9|v>>>23)+p|0)&g|p&~g)+d[15]-660478335|0)<<14|u>>>18)+v|0)&p|v&~p)+d[4]-405537848|0)<<20|g>>>12)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&v|u&~v)+d[9]+568446438|0)<<5|p>>>27)+g|0)&u|g&~u)+d[14]-1019803690|0)<<9|v>>>23)+p|0)&g|p&~g)+d[3]-187363961|0)<<14|u>>>18)+v|0)&p|v&~p)+d[8]+1163531501|0)<<20|g>>>12)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g&v|u&~v)+d[13]-1444681467|0)<<5|p>>>27)+g|0)&u|g&~u)+d[2]-51403784|0)<<9|v>>>23)+p|0)&g|p&~g)+d[7]+1735328473|0)<<14|u>>>18)+v|0)&p|v&~p)+d[12]-1926607734|0)<<20|g>>>12)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g^u^v)+d[5]-378558|0)<<4|p>>>28)+g|0)^g^u)+d[8]-2022574463|0)<<11|v>>>21)+p|0)^p^g)+d[11]+1839030562|0)<<16|u>>>16)+v|0)^v^p)+d[14]-35309556|0)<<23|g>>>9)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g^u^v)+d[1]-1530992060|0)<<4|p>>>28)+g|0)^g^u)+d[4]+1272893353|0)<<11|v>>>21)+p|0)^p^g)+d[7]-155497632|0)<<16|u>>>16)+v|0)^v^p)+d[10]-1094730640|0)<<23|g>>>9)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g^u^v)+d[13]+681279174|0)<<4|p>>>28)+g|0)^g^u)+d[0]-358537222|0)<<11|v>>>21)+p|0)^p^g)+d[3]-722521979|0)<<16|u>>>16)+v|0)^v^p)+d[6]+76029189|0)<<23|g>>>9)+u|0,g=((g+=((u=((u+=((v=((v+=((p=((p+=(g^u^v)+d[9]-640364487|0)<<4|p>>>28)+g|0)^g^u)+d[12]-421815835|0)<<11|v>>>21)+p|0)^p^g)+d[15]+530742520|0)<<16|u>>>16)+v|0)^v^p)+d[2]-995338651|0)<<23|g>>>9)+u|0,g=((g+=((v=((v+=(g^((p=((p+=(u^(g|~v))+d[0]-198630844|0)<<6|p>>>26)+g|0)|~u))+d[7]+1126891415|0)<<10|v>>>22)+p|0)^((u=((u+=(p^(v|~g))+d[14]-1416354905|0)<<15|u>>>17)+v|0)|~p))+d[5]-57434055|0)<<21|g>>>11)+u|0,g=((g+=((v=((v+=(g^((p=((p+=(u^(g|~v))+d[12]+1700485571|0)<<6|p>>>26)+g|0)|~u))+d[3]-1894986606|0)<<10|v>>>22)+p|0)^((u=((u+=(p^(v|~g))+d[10]-1051523|0)<<15|u>>>17)+v|0)|~p))+d[1]-2054922799|0)<<21|g>>>11)+u|0,g=((g+=((v=((v+=(g^((p=((p+=(u^(g|~v))+d[8]+1873313359|0)<<6|p>>>26)+g|0)|~u))+d[15]-30611744|0)<<10|v>>>22)+p|0)^((u=((u+=(p^(v|~g))+d[6]-1560198380|0)<<15|u>>>17)+v|0)|~p))+d[13]+1309151649|0)<<21|g>>>11)+u|0,g=((g+=((v=((v+=(g^((p=((p+=(u^(g|~v))+d[4]-145523070|0)<<6|p>>>26)+g|0)|~u))+d[11]-1120210379|0)<<10|v>>>22)+p|0)^((u=((u+=(p^(v|~g))+d[2]+718787259|0)<<15|u>>>17)+v|0)|~p))+d[9]-343485551|0)<<21|g>>>11)+u|0,_[0]=p+_[0]|0,_[1]=g+_[1]|0,_[2]=u+_[2]|0,_[3]=v+_[3]|0}function o(_){var d,p=[];for(d=0;d<64;d+=4)p[d>>2]=_.charCodeAt(d)+(_.charCodeAt(d+1)<<8)+(_.charCodeAt(d+2)<<16)+(_.charCodeAt(d+3)<<24);return p}function r(_){var d,p=[];for(d=0;d<64;d+=4)p[d>>2]=_[d]+(_[d+1]<<8)+(_[d+2]<<16)+(_[d+3]<<24);return p}function i(_){var d,p,g,u,v,A,P=_.length,$=[1732584193,-271733879,-1732584194,271733878];for(d=64;d<=P;d+=64)n($,o(_.substring(d-64,d)));for(p=(_=_.substring(d-64)).length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0;d<p;d+=1)g[d>>2]|=_.charCodeAt(d)<<(d%4<<3);if(g[d>>2]|=128<<(d%4<<3),d>55)for(n($,g),d=0;d<16;d+=1)g[d]=0;return u=(u=8*P).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(u[2],16),A=parseInt(u[1],16)||0,g[14]=v,g[15]=A,n($,g),$}function s(_){var d,p,g,u,v,A,P=_.length,$=[1732584193,-271733879,-1732584194,271733878];for(d=64;d<=P;d+=64)n($,r(_.subarray(d-64,d)));for(p=(_=d-64<P?_.subarray(d-64):new Uint8Array(0)).length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d=0;d<p;d+=1)g[d>>2]|=_[d]<<(d%4<<3);if(g[d>>2]|=128<<(d%4<<3),d>55)for(n($,g),d=0;d<16;d+=1)g[d]=0;return u=(u=8*P).toString(16).match(/(.*?)(.{0,8})$/),v=parseInt(u[2],16),A=parseInt(u[1],16)||0,g[14]=v,g[15]=A,n($,g),$}function c(_){var d,p="";for(d=0;d<4;d+=1)p+=e[_>>8*d+4&15]+e[_>>8*d&15];return p}function f(_){var d;for(d=0;d<_.length;d+=1)_[d]=c(_[d]);return _.join("")}function m(_){return/[\u0080-\uFFFF]/.test(_)&&(_=unescape(encodeURIComponent(_))),_}function S(_,d){var p,g=_.length,u=new ArrayBuffer(g),v=new Uint8Array(u);for(p=0;p<g;p+=1)v[p]=_.charCodeAt(p);return d?v:u}function E(_){return String.fromCharCode.apply(null,new Uint8Array(_))}function M(_,d,p){var g=new Uint8Array(_.byteLength+d.byteLength);return g.set(new Uint8Array(_)),g.set(new Uint8Array(d),_.byteLength),p?g:g.buffer}function B(_){var d,p=[],g=_.length;for(d=0;d<g-1;d+=2)p.push(parseInt(_.substr(d,2),16));return String.fromCharCode.apply(String,p)}function T(){this.reset()}return f(i("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function _(d,p){return(d=0|d||0)<0?Math.max(d+p,0):Math.min(d,p)}ArrayBuffer.prototype.slice=function(d,p){var g,u,v,A,P=this.byteLength,$=_(d,P),D=P;return p!==t&&(D=_(p,P)),$>D?new ArrayBuffer(0):(g=D-$,u=new ArrayBuffer(g),v=new Uint8Array(u),A=new Uint8Array(this,$,g),v.set(A),u)}}(),T.prototype.append=function(_){return this.appendBinary(m(_)),this},T.prototype.appendBinary=function(_){this._buff+=_,this._length+=_.length;var d,p=this._buff.length;for(d=64;d<=p;d+=64)n(this._hash,o(this._buff.substring(d-64,d)));return this._buff=this._buff.substring(d-64),this},T.prototype.end=function(_){var d,p,g=this._buff,u=g.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d<u;d+=1)v[d>>2]|=g.charCodeAt(d)<<(d%4<<3);return this._finish(v,u),p=f(this._hash),_&&(p=B(p)),this.reset(),p},T.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},T.prototype.setState=function(_){return this._buff=_.buff,this._length=_.length,this._hash=_.hash,this},T.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},T.prototype._finish=function(_,d){var p,g,u,v=d;if(_[v>>2]|=128<<(v%4<<3),v>55)for(n(this._hash,_),v=0;v<16;v+=1)_[v]=0;p=(p=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),g=parseInt(p[2],16),u=parseInt(p[1],16)||0,_[14]=g,_[15]=u,n(this._hash,_)},T.hash=function(_,d){return T.hashBinary(m(_),d)},T.hashBinary=function(_,d){var p=f(i(_));return d?B(p):p},T.ArrayBuffer=function(){this.reset()},T.ArrayBuffer.prototype.append=function(_){var d,p=M(this._buff.buffer,_,!0),g=p.length;for(this._length+=_.byteLength,d=64;d<=g;d+=64)n(this._hash,r(p.subarray(d-64,d)));return this._buff=d-64<g?new Uint8Array(p.buffer.slice(d-64)):new Uint8Array(0),this},T.ArrayBuffer.prototype.end=function(_){var d,p,g=this._buff,u=g.length,v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(d=0;d<u;d+=1)v[d>>2]|=g[d]<<(d%4<<3);return this._finish(v,u),p=f(this._hash),_&&(p=B(p)),this.reset(),p},T.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},T.ArrayBuffer.prototype.getState=function(){var _=T.prototype.getState.call(this);return _.buff=E(_.buff),_},T.ArrayBuffer.prototype.setState=function(_){return _.buff=S(_.buff,!0),T.prototype.setState.call(this,_)},T.ArrayBuffer.prototype.destroy=T.prototype.destroy,T.ArrayBuffer.prototype._finish=T.prototype._finish,T.ArrayBuffer.hash=function(_,d){var p=f(s(new Uint8Array(_)));return d?B(p):p},T}());const cn=[];class de{static addHandler(e,n,o){e.addEventListener?e.addEventListener(n,o,!1):e.attachEvent?e.attachEvent("on"+n,o):e["on"+n]=o}static removeHandler(e,n,o){e.removeEventListener?e.removeEventListener(n,o,!1):e.detachEvent?e.detachEvent("on"+n,o):delete e["on"+n]}static windowResizeHandler(e){de.addHandler(window,"resize",e)}static offWindowResizeHandler(e){de.removeHandler(window,"resize",e)}static fullscreenEnabled(){const e=window.document;return document.fullscreenEnabled||window.fullScreen||e.mozFullscreenEnabled||e.webkitIsFullScreen}static fullScreen(e,n){if(n){const 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 n=e;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 e=window.document;var n=document.exitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen||e.webkitExitFullscreen;if(n)n.call(document);else if(typeof window.ActiveXObject<"u"){var 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!!de.fullScreenElement()}static onFullScreenChanged(e){let n;"onfullscreenchange"in window.document?n="fullscreenchange":"onwebkitfullscreenchange"in window.document?n="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(n="mozfullscreenchange"),n?document.addEventListener(n,function(){const o=de.isFullScreen();e(o)}):document.addEventListener("MSFullscreenChange",function(){const o=de.isFullScreen();e(o)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(cn.indexOf(n)!==-1)return;cn.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,de.stringifyCircularHandler);return cn.length=0,n}static jsonParse(e){const n=de.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const o=window;return o.createObjcectURL!=null?n=o.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=new an.ArrayBuffer,f=new FileReader;f.onload=function(m){c.append(m.target?.result);const S=c.end();n({isOK:!0,data:S})},f.onerror=function(){const m="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(m),n({isOK:!1,data:m})},function(){const m=0+s>=i.size?i.size:0+s;f.readAsArrayBuffer(r.call(i,0,m))}()}static getFileMD5(e,n){const o=File.prototype,r=o.slice||o.mozSlice||o.webkitSlice,i=e,s=2097152,c=Math.ceil(i.size/s);let f=0;const m=new an.ArrayBuffer,S=new FileReader;function E(){const M=f*s,B=M+s>=i.size?i.size:M+s;S.readAsArrayBuffer(r.call(i,M,B))}S.onload=function(M){if(m.append(M.target?.result),f++,f<c)E();else{const B=m.end();n({isOK:!0,data:B})}},S.onerror=function(){const M=`${i.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(M),n({isOK:!1,data:M})},E()}static MD5(e,n=!1){return an.hash(e,n)}static copyTextByCommand(e){return new Promise((n,o)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)})}static copyText=e=>navigator.clipboard?navigator.clipboard.writeText(e).then(function(){return!0},function(n){return!1}):de.copyTextByCommand(e);static copyElementTextByCommand(e){const n=document.createRange();n.selectNode(document.getElementById(e));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(e){if(!navigator.clipboard)return de.copyElementTextByCommand(e);const n=document.createRange();n.selectNode(document.getElementById(e));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(e){de.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,o){const r=o||document.body;let{className:i}=r;i=i.replace(n,""),r.className=e?`${i} ${n} `:i}static setCssVar(e,n,o=document.documentElement){o.style.setProperty(e,n)}static dispatchWindowResize(){const e=new Event("resize");window.dispatchEvent(e)}static dispatchElementEvent(e,n="click",o){let r;if(r=ct(e)?document.getElementById(e):e,r){const i=new Event(n,{bubbles:!0,cancelable:!0});o&&r.addEventListener("ev",s=>{o(s)},!1),r.dispatchEvent(i)}}}class ht{static isNullOrEmpty=e=>e===null||e===""||e===void 0||e.length===0;static isNotEmpty=e=>!(e===null||e===""||e===void 0||e.length===0);static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,o)=>o.toUpperCase()).replace("views","")}}class ut{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,o=604800){const r=JSON.stringify({value:n,expire:o!==null?new Date().getTime()+1e3*o:null});this.storage.setItem(this.getKey(e),r)}get(e,n=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 n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const o=JSON.parse(n);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,n,o=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${o}`}getCookie(e){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(e))return i[1]}return""}removeCookie(e){this.setCookie(e,1,-1)}clearCookie(){const e=document.cookie.match(/[^ =;]+(?==)/g);if(e)for(let n=e.length;n--;)document.cookie=e[n]+"=0;expire="+new Date(0).toUTCString()}}const os=new ut("",localStorage);function dt(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++){const r=Math.floor(16*Math.random());t[n]=e.substring(r,r+1)}t[14]="4";const o=3&Number(t[19])|8;return t[19]=e.substring(o,o+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function rs(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var o=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?o:3&o|8).toString(16)});return e}function is(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),o=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),i=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+o.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+i.toString(16)).slice(-2)}function ss(t){var e=t.toLowerCase();if(ft(t)){if(e.length===4){for(var n="#",o=1;o<4;o+=1){const i=e.slice(o,o+1);n+=i.concat(i)}e=n}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 as(t){const e=t;if(e.length===4){let o="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);o+=r.concat(r)}return o}return e}var Ae;function cs(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?Ae.Hex:e==="r"||e==="("?Ae.RGBA:e==="h"?Ae.Hsla:Ae.RGBA}function ls(t){if(t){var e=t.toLowerCase().match(/^hsla?\(\s*(\d{1,3})\s*,\s*(\d{1,3}\%)\s*,\s*(\d{1,3}\%)\s*(?:\s*,\s*(\d+(?:\.\d+)?)\s*)?\)$/i);if(e){var n,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)n=o=r=c;else{var f=c<=.5?c*(s+1):c+s-c*s,m=2*c-f;n=ln(m,f,i+1/3),o=ln(m,f,i),r=ln(m,f,i-1/3)}return`rgba(${n=Math.round(255*n)},${o=Math.round(255*o)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}}function ln(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ft(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function hs(t,e,n){const o=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(o.length-7)).join("0")+o}function hn(t){let e=t.toLowerCase();if(ft(t)){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 n=[];for(let o=1;o<7;o+=2)n.push(parseInt("0x"+e.slice(o,o+2)));return"RGB("+n.join(",")+")"}return e}function us(t){if(!ft(t))return;const[e,n,o]=hn(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*o<192}function ds(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${dn(t.substring(0,2),e)}${dn(t.substring(2,4),e)}${dn(t.substring(4,6),e)}`}function fs(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${un(t.substring(0,2),e)}${un(t.substring(2,4),e)}${un(t.substring(4,6),e)}`}function un(t,e){const n=parseInt(t,16)+e,o=n>255?255:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function vo(t,e,n){const o=[t,e,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 ps(t){return function(e,n){return(vo(~~e[0],~~e[1],~~e[2])+.05)/(vo(n[0],n[1],n[2])+.05)}(hn(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function dn(t,e){const n=parseInt(t,16)-e,o=n<0?0:n;return o.toString(16).length>1?o.toString(16):`0${o.toString(16)}`}function fn(t){return{all:t=t||new Map,on(e,n){const o=t?.get(e);o&&o.push(n)||t?.set(e,[n])},off(e,n){const o=t?.get(e);o&&o.splice(o.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(o=>{o(n)}),(t?.get("*")||[]).slice().map(o=>{o(e,n)})}}}(function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"})(Ae||(Ae={}));const De=fn(),ue={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetLoadedErrorEvent:"WidgetLoadedError",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},pt=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const o=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(o),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function gs(t,e){const n=window.URL||window.webkitURL||window,o=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(o),r.download=e,r.click(),n.revokeObjectURL(r.href)}const yo=(t,e)=>{const n=JSON.stringify(t,null,2);e?pt(n,e+".json"):De.emit(ue.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},ms=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(o){pt(o.data,n)}).catch(o=>{console.warn(o),De.emit(ue.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function wo(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function vs({url:t,target:e="_blank",fileName:n}){const o=new URL(t).host==location.host;return new Promise((r,i)=>{if(o){const s=document.createElement("a");if(s.href=t,s.target=e,s.download!==void 0&&(s.download=n||wo(t)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),s.dispatchEvent(c),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const s=document.createElement("canvas"),c=document.createElement("img");c.setAttribute("crossOrigin","Anonymous"),c.src=t,c.onload=f=>{s.width=c.width,s.height=c.height,s.getContext("2d").drawImage(c,0,0,c.width,c.height),s.toBlob(m=>{if(m){const S=document.createElement("a");S.href=window.URL.createObjectURL(m),S.download=wo(t),S.click(),URL.revokeObjectURL(S.href),r(!0)}},"image/jpeg")},c.onerror=f=>i(f)}})}function ys(t){const e=new Date().getTime();let n=new Date().getTime();for(;n-e<t;)n=new Date().getTime();console.log(`\u5F3A\u5236\u7B49\u5F85${bo}\u6BEB\u79D2`)}function bo(t){return new Promise(e=>setTimeout(e,t))}var _o,So,pn,Co={exports:{}};So=$e,pn=function(){var t=function(){},e="undefined",n=typeof window!==e&&typeof window.navigator!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"],r={},i=null;function s(T,_){var d=T[_];if(typeof d.bind=="function")return d.bind(T);try{return Function.prototype.bind.call(d,T)}catch{return function(){return Function.prototype.apply.apply(d,[T,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 f(T){return T==="debug"&&(T="log"),typeof console!==e&&(T==="trace"&&n?c:console[T]!==void 0?s(console,T):console.log!==void 0?s(console,"log"):t)}function m(){for(var T=this.getLevel(),_=0;_<o.length;_++){var d=o[_];this[d]=_<T?t:this.methodFactory(d,T,this.name)}if(this.log=this.debug,typeof console===e&&T<this.levels.SILENT)return"No console available for logging"}function S(T){return function(){typeof console!==e&&(m.call(this),this[T].apply(this,arguments))}}function E(T,_,d){return f(T)||S.apply(this,arguments)}function M(T,_){var d,p,g,u=this,v="loglevel";function A(){var D;if(typeof window!==e&&v){try{D=window.localStorage[v]}catch{}if(typeof D===e)try{var U=window.document.cookie,O=encodeURIComponent(v),H=U.indexOf(O+"=");H!==-1&&(D=/^([^;]+)/.exec(U.slice(H+O.length+1))[1])}catch{}return u.levels[D]===void 0&&(D=void 0),D}}function P(D){var U=D;if(typeof U=="string"&&u.levels[U.toUpperCase()]!==void 0&&(U=u.levels[U.toUpperCase()]),typeof U=="number"&&U>=0&&U<=u.levels.SILENT)return U;throw new TypeError("log.setLevel() called with invalid level: "+D)}typeof T=="string"?v+=":"+T:typeof T=="symbol"&&(v=void 0),u.name=T,u.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},u.methodFactory=_||E,u.getLevel=function(){return g??p??d},u.setLevel=function(D,U){return g=P(D),U!==!1&&function(O){var H=(o[O]||"silent").toUpperCase();if(typeof window!==e&&v){try{return void(window.localStorage[v]=H)}catch{}try{window.document.cookie=encodeURIComponent(v)+"="+H+";"}catch{}}}(g),m.call(u)},u.setDefaultLevel=function(D){p=P(D),A()||u.setLevel(D,!1)},u.resetLevel=function(){g=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{}}}(),m.call(u)},u.enableAll=function(D){u.setLevel(u.levels.TRACE,D)},u.disableAll=function(D){u.setLevel(u.levels.SILENT,D)},u.rebuild=function(){if(i!==u&&(d=P(i.getLevel())),m.call(u),i===u)for(var D in r)r[D].rebuild()},d=P(i?i.getLevel():"WARN");var $=A();$!=null&&(g=P($)),m.call(u)}(i=new M).getLogger=function(T){if(typeof T!="symbol"&&typeof T!="string"||T==="")throw new TypeError("You must supply a name when creating a logger.");var _=r[T];return _||(_=r[T]=new M(T,i.methodFactory)),_};var B=typeof window!==e?window.log:void 0;return i.noConflict=function(){return typeof window!==e&&window.log===i&&(window.log=B),i},i.getLoggers=function(){return r},i.default=i,i},(_o=Co).exports?_o.exports=pn():So.log=pn();var gn=Co.exports;class Eo{message;eventBus;constructor(e,n){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,o="success"){if(this.message)if(typeof this.message=="function")this.message({type:o,message:e,duration:n});else switch(o){case"info":this.message.info(e,n);break;case"success":this.message.success(e,n);break;case"warning":this.message.warn?this.message.warn(e,n):this.message.warning&&this.message.warning(e,n);break;case"error":this.message.error(e,n)}else{switch(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(ue.AlertInfoEvent,{type:o,info:e})}}info(e,n=3){this.msg(e,n,"info")}warn(e,n=3){this.msg(e,n,"warning")}err(e,n=3){this.msg(e,n,"error")}success(e,n=3){this.msg(e,n,"success")}}let ko=!1;const N={Config:SysConfig,EventBus:De,DefaultProxyClient:null,Axios:Ri,Message:new Eo(void 0,De),LayoutMap:new Map,Logger:t=>{ko||(import.meta.env?.DEV||SysConfig.UI.ProductLog?gn.enableAll():gn.setDefaultLevel("warn"),ko=!0);const e=t||"default";return gn.getLogger(e)}},xo="access_token",we=new ut("user",localStorage);function Le(){return we.get(xo)}function mn(){we.remove(xo)}function Io(){return Le()?.refresh}function vn(t,e,n,o="json",r){const i={baseURL:N.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,paramsSerializer:{serialize:function(s){return Pi.stringify(s,{indices:!1,arrayFormat:"repeat"})}},headers:{"Content-Type":"application/json",Authorization:"bearer "+Le()?.token},responseType:o,cancelToken:r};if(n)for(let s in n)i.headers[s]=n[s];return N.SystemID&&(i.headers.sysid=N.SystemID,N.SystemGroup&&(i.headers.sysgroup=N.SystemGroup)),e&&(i.baseURL=e),i}function be(t,e,n,o,r="json",i,s){const c=vn(n,e,o,r,i);return s&&s>=2e4&&(c.timeout=s),N.Axios?.get(t,c).catch(function(f){gt(f,e,t,"Get")})}function gt(t,e,n,o="Get"){const r=`${e}${n}`;if(t&&t.response){let i=!1;const s=t.response.status;switch(s){case 400:t.message="\u9519\u8BEF\u8BF7\u6C42";break;case 401:t.message="\u672A\u6388\u6743\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55";break;case 403:t.message="\u62D2\u7EDD\u8BBF\u95EE";break;case 404:t.message="\u8BF7\u6C42\u9519\u8BEF,\u672A\u627E\u5230\u8BE5\u8D44\u6E90";break;case 405:t.message="\u8BF7\u6C42\u65B9\u6CD5\u672A\u5141\u8BB8";break;case 408:t.message="\u8BF7\u6C42\u8D85\u65F6";break;case 500:const f=t.response.data;if(f){const m=f.indexOf(":"),S=f.indexOf(`
2
+ `);if(m>0&&S-m>2){const E=f.substring(m+2,S);E.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(i=!0,t.message=E)}else i=!0,t.message=f}else t.message="\u670D\u52A1\u5668\u7AEF\u51FA\u9519";break;case 501:t.message="\u7F51\u7EDC\u672A\u5B9E\u73B0";break;case 502:t.message="\u7F51\u7EDC\u9519\u8BEF";break;case 503:t.message="\u670D\u52A1\u4E0D\u53EF\u7528";break;case 504:t.message="\u7F51\u7EDC\u8D85\u65F6";break;case 505:t.message="http\u7248\u672C\u4E0D\u652F\u6301\u8BE5\u8BF7\u6C42";break;default:t.message=`\u8FDE\u63A5\u9519\u8BEF${t.response.status}`}let c={address:r,code:s,isExceptionInfo:i,message:t.message,result:t.response.data};if(N.EventBus.emit(ue.AxiosRequestErrorEvent,c),i)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function To(t,e,n,o,r,i="json",s){const c=vn(o,e,r,i);s&&s>=2e4&&(c.timeout=s),c.headers["Content-Type"]="multipart/form-data";const f=function(m){let S=new FormData;return m&&Object.keys(m).forEach(E=>{if(!m)return;let M=m[E];M!=null&&(sn(M)?M.forEach(B=>{S.append(E,Po(B))}):S.append(E,Po(M)))}),S}(n);return N.Axios?.post(t,f,c).catch(function(m){gt(m,e,t,"Post")})}function Ro(t,e,n,o,r,i="json",s){const c=vn(o,e,r,i);return s&&s>=2e4&&(c.timeout=s),N.Axios?.post(t,n,c).catch(function(f){gt(f,e,t,"Post")})}function ws(t,e){return be(t,void 0,e)}function bs(t,e){return To(t,void 0,e)}function _s(t,e){return N.Axios?.get(t,{params:e}).catch(function(n){gt(n,t,"","\u5916\u90E8Get")})}function Po(t){return t instanceof Blob?t:t.toString()}var yn={exports:{}},Ss=typeof window<"u"?window:$e!==void 0?$e:typeof self<"u"?self:{},Cs=function(t){if(!t)return!1;var e=Es.call(t);return e==="[object Function]"||typeof t=="function"&&e!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},Es=Object.prototype.toString,wn=function(t){return t.replace(/^\s+|\s+$/g,"")},ks=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var o in n)xs.call(n,o)&&(t[o]=n[o])}return t},xs=Object.prototype.hasOwnProperty,zo=Ss,Is=Cs,Ts=function(t){if(!t)return{};for(var e,n={},o=wn(t).split(`
3
+ `),r=0;r<o.length;r++){var i=o[r],s=i.indexOf(":"),c=wn(i.slice(0,s)).toLowerCase(),f=wn(i.slice(s+1));n[c]===void 0?n[c]=f:(e=n[c],Object.prototype.toString.call(e)==="[object Array]"?n[c].push(f):n[c]=[n[c],f])}return n},Rs=ks;function Mo(t,e,n){var o=t;return Is(e)?(n=e,typeof t=="string"&&(o={uri:t})):o=Rs(e,{uri:t}),o.callback=n,o}function _e(t,e,n){return $o(e=Mo(t,e,n))}function $o(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(p,g,u){e||(e=!0,t.callback(p,g,u))};function o(){var p=void 0;if(p=f.response?f.response:f.responseText||function(g){try{if(g.responseType==="document")return g.responseXML;var u=g.responseXML&&g.responseXML.documentElement.nodeName==="parsererror";if(g.responseType===""&&!u)return g.responseXML}catch{}return null}(f),_)try{p=JSON.parse(p)}catch{}return p}function r(p){return clearTimeout(m),p instanceof Error||(p=new Error(""+(p||"Unknown XMLHttpRequest Error"))),p.statusCode=0,n(p,d)}function i(){if(!c){var p;clearTimeout(m),p=t.useXDR&&f.status===void 0?200:f.status===1223?204:f.status;var g=d,u=null;return p!==0?(g={body:o(),statusCode:p,method:E,headers:{},url:S,rawRequest:f},f.getAllResponseHeaders&&(g.headers=Ts(f.getAllResponseHeaders()))):u=new Error("Internal XMLHttpRequest Error"),n(u,g,g.body)}}var s,c,f=t.xhr||null;f||(f=t.cors||t.useXDR?new _e.XDomainRequest:new _e.XMLHttpRequest);var m,S=f.url=t.uri||t.url,E=f.method=t.method||"GET",M=t.body||t.data,B=f.headers=t.headers||{},T=!!t.sync,_=!1,d={body:void 0,headers:{},statusCode:0,method:E,url:S,rawRequest:f};if("json"in t&&t.json!==!1&&(_=!0,B.accept||B.Accept||(B.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(B["content-type"]||B["Content-Type"]||(B["Content-Type"]="application/json"),M=JSON.stringify(t.json===!0?M:t.json))),f.onreadystatechange=function(){f.readyState===4&&setTimeout(i,0)},f.onload=i,f.onerror=r,f.onprogress=function(){},f.onabort=function(){c=!0},f.ontimeout=r,f.open(E,S,!T,t.username,t.password),T||(f.withCredentials=!!t.withCredentials),!T&&t.timeout>0&&(m=setTimeout(function(){if(!c){c=!0,f.abort("timeout");var p=new Error("XMLHttpRequest timeout");p.code="ETIMEDOUT",r(p)}},t.timeout)),f.setRequestHeader)for(s in B)B.hasOwnProperty(s)&&f.setRequestHeader(s,B[s]);else if(t.headers&&!function(p){for(var g in p)if(p.hasOwnProperty(g))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(f.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(f),f.send(M||null),f}yn.exports=_e,yn.exports.default=_e,_e.XMLHttpRequest=zo.XMLHttpRequest||function(){},_e.XDomainRequest="withCredentials"in new _e.XMLHttpRequest?_e.XMLHttpRequest:zo.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){_e[t==="delete"?"del":t]=function(e,n,o){return(n=Mo(e,n,o)).method=t.toUpperCase(),$o(n)}});var Ps=lt(yn.exports);const zs=[200,201,202,204,308],Ms=[408,502,503,504];class Ao{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=fn(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window<"u"&&(window.addEventListener("online",()=>{this.offline&&(this.offline=!1,this.dispatch("online"),this.sendChunks())}),window.addEventListener("offline",()=>{this.offline=!0,this.dispatch("offline")}))}on(e,n){this.eventTarget.on(e,n)}abort(){this.pause(),this.currentXhr?.abort()}pause(){this.paused=!0}resume(){this.paused&&(this.paused=!1,this.sendChunks())}dispatch(e,n){this.eventTarget.emit(e,n)}validateOptions(){if(!this.endpoint||typeof this.endpoint!="function"&&typeof this.endpoint!="string")throw new TypeError("endpoint\u5FC5\u987B\u4E3A\uFF1A\u6587\u4EF6\u4E0A\u4F20URL\u5B57\u7B26\u4E32\uFF0C\u6216\u8FD4\u56DE\u5730\u5740\u7684\u51FD\u6570\uFF01");if(!(this.file instanceof File))throw new TypeError("file\u5FC5\u987B\u4E3A\u6587\u4EF6\u5BF9\u8C61");if(this.headers&&typeof this.headers!="object")throw new TypeError("\u6587\u4EF6\u5934\u5FC5\u987B\u4E3A\u5BF9\u8C61\u6216\u7A7A\uFF01");if(this.chunkSize&&(typeof this.chunkSize!="number"||this.chunkSize<=0||this.chunkSize%256!=0))throw new TypeError("chunkSize\u5FC5\u987B\u5927\u4E8E0,\u5E76\u662F256\u7684\u6574\u6570\u500D");if(this.maxFileBytes>0&&this.maxFileBytes<this.file.size)throw new Error(`\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u6700\u5927\u5141\u8BB8\u503C\uFF1A(${this.file.size} > ${this.maxFileBytes})`);if(this.attempts&&(typeof this.attempts!="number"||this.attempts<=0))throw new TypeError("\u91CD\u8BD5\u6B21\u6570\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01");if(this.delayBeforeAttempt&&(typeof this.delayBeforeAttempt!="number"||this.delayBeforeAttempt<0))throw new TypeError("\u5EF6\u65F6\u91CD\u8BD5\u65F6\u95F4\u5FC5\u987B\u4E3A\u6B63\u6570\uFF01\u9ED8\u8BA4\u4E3A1")}getEndpoint(){return typeof this.endpoint=="string"?(this.endpointValue=this.endpoint,Promise.resolve(this.endpoint)):this.endpoint(this.file).then(e=>(this.endpointValue=e,this.endpointValue))}getChunk(){return new Promise(e=>{const n=this.totalChunks===1?this.file.size:this.chunkByteSize,o=n*this.chunkCount;this.reader.onload=()=>{this.reader.result!==null&&(this.chunk=new Blob([this.reader.result],{type:"application/octet-stream"})),e(()=>{})},this.reader.readAsArrayBuffer(this.file.slice(o,o+n))})}xhrPromise(e){const n=o=>{o.upload.onprogress=r=>{const i=100/this.totalChunks,s=i*this.file.size,c=i*this.chunkCount,f=r.loaded/(r.total??s)*i;this.dispatch("progress",Math.min(c+f,100))}};return new Promise((o,r)=>{this.currentXhr=Ps({...e,beforeSend:n},(i,s)=>(this.currentXhr=void 0,i?r(i):o(s)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,o={...this.headers,FileName:this.fileName,FileMD5:this.md5,"Content-Type":this.file.type,"Content-Range":`bytes ${e}-${n}/${this.file.size}`};if(this.dispatch("attempt",{chunkNumber:this.chunkCount,chunkSize:this.chunk.size}),this.endpointValue)return this.xhrPromise({headers: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&&zs.includes(e.statusCode)){this.dispatch("chunkSuccess",{chunk:this.chunkCount,attempts:this.attemptCount,response:e}),this.attemptCount=0,this.chunkCount=this.chunkCount+1,this.chunkCount<this.totalChunks?this.sendChunks():(this.success=!0,this.dispatch("success"));const n=this.chunkCount/this.totalChunks*this.file.size*100/this.file.size;this.dispatch("progress",n)}else if(e!=null&&Ms.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 $s=t=>new Ao(t),As=new class{hasClass(t,e){return t.className.match(new RegExp("(\\s|^)"+e+"(\\s|$)"))}addClass(t,e){this.hasClass(t,e)||(t.className+=" "+e)}removeClass(t,e){if(this.hasClass(t,e)){const n=new RegExp("(\\s|^)"+e+"(\\s|$)");t.className=t.className.replace(n," ")}}toggleClass(t,e){this.hasClass(t,e)?this.removeClass(t,e):this.addClass(t,e)}setCSSProperty(t,e,n){t?.style.setProperty(e,n)}};class tt{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!ht.isNullOrEmpty(e)){if(tt.httpTransport||(tt.httpTransport=new Ai),this.client=new zi(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(ue.HproseServiceErrorEvent,"\u521D\u59CB\u5316\u9ED8\u8BA4Hprose!"),console.warn(e)})}async getProxy(){if(!this.hproseProxy)try{this.client&&(this.hproseProxy=await this.client.useServiceAsync())}catch(e){console.warn(e),this.hproseProxy=this.client?.useService()}return this.hproseProxy}async invoke(e,n,o){if(this.client)return await this.client.invoke(e,n,o)}encode(e,n,o){if(this.client)return this.client.codec.encode(e,n,o)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Ve{hproseClient;hpProxyObj;defaultContext=new tn;constructor(e){this.hproseClient=new tt(e),this.hpProxyObj=null}getClientContext(e,n){const o={};n&&(o.requestHeaders=n);const r=Le();o.httpRequestHeaders=e||{};const i=o.httpRequestHeaders;return r&&(i.token=r.token),N.SystemID&&(i.sysid=N.SystemID,N.SystemGroup&&(i.sysgroup=N.SystemGroup)),new tn(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(ue.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,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(e,n,o)}async hproseInvokeContext(e,n,...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&&(n||(n=new tn({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,o,n)}async hproseInvokeEncode(e){const n=new st(e).toBytes(),o=await this.hproseClient.client?.request(n,this.defaultContext);return o&&this.hproseClient.client?.codec.decode(o,this.defaultContext)}encodeRequest(e,...n){const o=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return st.toString(o)}}const bn=new Map,Ds=function(t,e,n){!N.Config.DefaultHproseAPI&&N.Config.ServiceURL&&(N.Config.DefaultHproseAPI=N.Config.ServiceURL.DefaultHproseAPI),N.Config.DefaultHproseAPI&&ht.isNotEmpty(N.Config.DefaultHproseAPI)&&(N.DefaultProxyClient=new Ve(N.Config.DefaultHproseAPI));const o=N.Config.UI.GrayMode;o&&de.setGrayMode(o);const r=new Eo(t,N.EventBus);N.Message=r,N.SystemID=e,N.SystemGroup=n,N.EventBus.on(ue.HproseServiceErrorEvent,i=>{const s=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("Hprose\u8BF7\u6C42\u9519\u8BEF",s)}),N.EventBus.on(ue.WebAPIErrorEvent,i=>{const s=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${i}`;console.warn("WebAPI\u8BF7\u6C42\u9519\u8BEF",s)}),N.EventBus.on(ue.AxiosRequestErrorEvent,i=>{const s=`Http\u8BF7\u6C42'${i.code}'\u9519\u8BEF: ${i.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",s)}),N.EventBus.on(ue.CommonWarnEvent,i=>{r.warn(i)})};function Do(t){if(t&&ht.isNotEmpty(t)){if(bn.has(t))return bn.get(t);{const e=new Ve(t);return bn.set(t,e),e}}}function Ls(t){const e=Do(t);return e&&(N.DefaultProxyClient=e),e}const _n="is_LockScreen",Lo=we.get(_n,!1),Ke={isLock:Lo,lockTime:Lo=="true"?Bo():0};function No(t){Ke.isLock=t,we.set(_n,t,10),t&&(mn(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ns(){return we.get(_n,!1)}function Bo(){let t=3600;return N.Config.UI?.LockTime&&N.Config.UI?.LockTime>=10&&(t=N.Config.UI.LockTime),t}let Sn;function Cn(){clearInterval(Sn),!(window.location.href.indexOf("/login")>0||Ke.isLock)&&(No(!1),Ke.lockTime=Bo(),Sn=setInterval(()=>{if(Ke.lockTime--,Ke.lockTime<=0)return No(!0),clearInterval(Sn)},1e3))}function Bs(){Cn(),document.addEventListener("mousedown",Cn)}function Us(){document.removeEventListener("mousedown",Cn)}function En(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var js={exports:{}},mt=lt(js.exports=function t(e,n,o){function r(c,f){if(!n[c]){if(!e[c]){if(!f&&En)return En(c);if(i)return i(c,!0);var m=new Error("Cannot find module '"+c+"'");throw m.code="MODULE_NOT_FOUND",m}var S=n[c]={exports:{}};e[c][0].call(S.exports,function(E){var M=e[c][1][E];return r(M||E)},S,S.exports,t,e,n,o)}return n[c].exports}for(var i=En,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(t,e,n){(function(o){var r,i,s=o.MutationObserver||o.WebKitMutationObserver;if(s){var c=0,f=new s(M),m=o.document.createTextNode("");f.observe(m,{characterData:!0}),r=function(){m.data=c=++c%2}}else if(o.setImmediate||o.MessageChannel===void 0)r="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var T=o.document.createElement("script");T.onreadystatechange=function(){M(),T.onreadystatechange=null,T.parentNode.removeChild(T),T=null},o.document.documentElement.appendChild(T)}:function(){setTimeout(M,0)};else{var S=new o.MessageChannel;S.port1.onmessage=M,r=function(){S.port2.postMessage(0)}}var E=[];function M(){var T,_;i=!0;for(var d=E.length;d;){for(_=E,E=[],T=-1;++T<d;)_[T]();d=E.length}i=!1}function B(T){E.push(T)!==1||i||r()}e.exports=B}).call(this,$e!==void 0?$e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var o=t(1);function r(){}var i={},s=["REJECTED"],c=["FULFILLED"],f=["PENDING"];function m(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,u!==r&&B(this,u)}function S(u,v,A){this.promise=u,typeof v=="function"&&(this.onFulfilled=v,this.callFulfilled=this.otherCallFulfilled),typeof A=="function"&&(this.onRejected=A,this.callRejected=this.otherCallRejected)}function E(u,v,A){o(function(){var P;try{P=v(A)}catch($){return i.reject(u,$)}P===u?i.reject(u,new TypeError("Cannot resolve promise with itself")):i.resolve(u,P)})}function M(u){var v=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof v=="function")return function(){v.apply(u,arguments)}}function B(u,v){var A=!1;function P(O){A||(A=!0,i.reject(u,O))}function $(O){A||(A=!0,i.resolve(u,O))}function D(){v($,P)}var U=T(D);U.status==="error"&&P(U.value)}function T(u,v){var A={};try{A.value=u(v),A.status="success"}catch(P){A.status="error",A.value=P}return A}function _(u){return u instanceof this?u:i.resolve(new this(r),u)}function d(u){var v=new this(r);return i.reject(v,u)}function p(u){var v=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=u.length,P=!1;if(!A)return this.resolve([]);for(var $=new Array(A),D=0,U=-1,O=new this(r);++U<A;)H(u[U],U);return O;function H(Z,te){function re(Q){$[te]=Q,++D!==A||P||(P=!0,i.resolve(O,$))}v.resolve(Z).then(re,function(Q){P||(P=!0,i.reject(O,Q))})}}function g(u){var v=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var A=u.length,P=!1;if(!A)return this.resolve([]);for(var $=-1,D=new this(r);++$<A;)U(u[$]);return D;function U(O){v.resolve(O).then(function(H){P||(P=!0,i.resolve(D,H))},function(H){P||(P=!0,i.reject(D,H))})}}e.exports=m,m.prototype.catch=function(u){return this.then(null,u)},m.prototype.then=function(u,v){if(typeof u!="function"&&this.state===c||typeof v!="function"&&this.state===s)return this;var A=new this.constructor(r);return this.state!==f?E(A,this.state===c?u:v,this.outcome):this.queue.push(new S(A,u,v)),A},S.prototype.callFulfilled=function(u){i.resolve(this.promise,u)},S.prototype.otherCallFulfilled=function(u){E(this.promise,this.onFulfilled,u)},S.prototype.callRejected=function(u){i.reject(this.promise,u)},S.prototype.otherCallRejected=function(u){E(this.promise,this.onRejected,u)},i.resolve=function(u,v){var A=T(M,v);if(A.status==="error")return i.reject(u,A.value);var P=A.value;if(P)B(u,P);else{u.state=c,u.outcome=v;for(var $=-1,D=u.queue.length;++$<D;)u.queue[$].callFulfilled(v)}return u},i.reject=function(u,v){u.state=s,u.outcome=v;for(var A=-1,P=u.queue.length;++A<P;)u.queue[A].callRejected(v);return u},m.resolve=_,m.reject=d,m.all=p,m.race=g},{1:1}],3:[function(t,e,n){(function(o){typeof o.Promise!="function"&&(o.Promise=t(2))}).call(this,$e!==void 0?$e:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){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,l){if(!(a instanceof l))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),l=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||l)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(a,l){a=a||[],l=l||{};try{return new Blob(a,l)}catch(y){if(y.name!=="TypeError")throw y;for(var h=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),w=0;w<a.length;w+=1)h.append(a[w]);return h.getBlob(l.type)}}typeof Promise>"u"&&t(3);var m=Promise;function S(a,l){l&&a.then(function(h){l(null,h)},function(h){l(h)})}function E(a,l,h){typeof l=="function"&&a.then(l),typeof h=="function"&&a.catch(h)}function M(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function B(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var T="local-forage-detect-blob-support",_=void 0,d={},p=Object.prototype.toString,g="readonly",u="readwrite";function v(a){for(var l=a.length,h=new ArrayBuffer(l),w=new Uint8Array(h),y=0;y<l;y++)w[y]=a.charCodeAt(y);return h}function A(a){return new m(function(l){var h=a.transaction(T,u),w=f([""]);h.objectStore(T).put(w,"key"),h.onabort=function(y){y.preventDefault(),y.stopPropagation(),l(!1)},h.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),b=navigator.userAgent.match(/Edge\//);l(b||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function P(a){return typeof _=="boolean"?m.resolve(_):A(a).then(function(l){return _=l})}function $(a){var l=d[a.name],h={};h.promise=new m(function(w,y){h.resolve=w,h.reject=y}),l.deferredOperations.push(h),l.dbReady?l.dbReady=l.dbReady.then(function(){return h.promise}):l.dbReady=h.promise}function D(a){var l=d[a.name].deferredOperations.pop();if(l)return l.resolve(),l.promise}function U(a,l){var h=d[a.name].deferredOperations.pop();if(h)return h.reject(l),h.promise}function O(a,l){return new m(function(h,w){if(d[a.name]=d[a.name]||Gn(),a.db){if(!l)return h(a.db);$(a),a.db.close()}var y=[a.name];l&&y.push(a.version);var b=s.open.apply(s,y);l&&(b.onupgradeneeded=function(C){var x=b.result;try{x.createObjectStore(a.storeName),C.oldVersion<=1&&x.createObjectStore(T)}catch(I){if(I.name!=="ConstraintError")throw I;console.warn('The database "'+a.name+'" has been upgraded from version '+C.oldVersion+" to version "+C.newVersion+', but the storage "'+a.storeName+'" already exists.')}}),b.onerror=function(C){C.preventDefault(),w(b.error)},b.onsuccess=function(){var C=b.result;C.onversionchange=function(x){x.target.close()},h(C),D(a)}})}function H(a){return O(a,!1)}function Z(a){return O(a,!0)}function te(a,l){if(!a.db)return!0;var h=!a.db.objectStoreNames.contains(a.storeName),w=a.version<a.db.version,y=a.version>a.db.version;if(w&&(a.version!==l&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),y||h){if(h){var b=a.db.version+1;b>a.version&&(a.version=b)}return!0}return!1}function re(a){return new m(function(l,h){var w=new FileReader;w.onerror=h,w.onloadend=function(y){var b=btoa(y.target.result||"");l({__local_forage_encoded_blob:!0,data:b,type:a.type})},w.readAsBinaryString(a)})}function Q(a){return f([v(atob(a.data))],{type:a.type})}function ve(a){return a&&a.__local_forage_encoded_blob}function nt(a){var l=this,h=l._initReady().then(function(){var w=d[l._dbInfo.name];if(w&&w.dbReady)return w.dbReady});return E(h,a,a),h}function jt(a){$(a);for(var l=d[a.name],h=l.forages,w=0;w<h.length;w++){var y=h[w];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return a.db=null,H(a).then(function(b){return a.db=b,te(a)?Z(a):b}).then(function(b){a.db=l.db=b;for(var C=0;C<h.length;C++)h[C]._dbInfo.db=b}).catch(function(b){throw U(a,b),b})}function ge(a,l,h,w){w===void 0&&(w=1);try{var y=a.db.transaction(a.storeName,l);h(null,y)}catch(b){if(w>0&&(!a.db||b.name==="InvalidStateError"||b.name==="NotFoundError"))return m.resolve().then(function(){if(!a.db||b.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),Z(a)}).then(function(){return jt(a).then(function(){ge(a,l,h,w-1)})}).catch(h);h(b)}}function Gn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function _r(a){var l=this,h={db:null};if(a)for(var w in a)h[w]=a[w];var y=d[h.name];y||(y=Gn(),d[h.name]=y),y.forages.push(l),l._initReady||(l._initReady=l.ready,l.ready=nt);var b=[];function C(){return m.resolve()}for(var x=0;x<y.forages.length;x++){var I=y.forages[x];I!==l&&b.push(I._initReady().catch(C))}var R=y.forages.slice(0);return m.all(b).then(function(){return h.db=y.db,H(h)}).then(function(z){return h.db=z,te(h,l._defaultConfig.version)?Z(h):z}).then(function(z){h.db=y.db=z,l._dbInfo=h;for(var L=0;L<R.length;L++){var W=R[L];W!==l&&(W._dbInfo.db=h.db,W._dbInfo.version=h.version)}})}function Sr(a,l){var h=this;a=M(a);var w=new m(function(y,b){h.ready().then(function(){ge(h._dbInfo,g,function(C,x){if(C)return b(C);try{var I=x.objectStore(h._dbInfo.storeName).get(a);I.onsuccess=function(){var R=I.result;R===void 0&&(R=null),ve(R)&&(R=Q(R)),y(R)},I.onerror=function(){b(I.error)}}catch(R){b(R)}})}).catch(b)});return S(w,l),w}function Cr(a,l){var h=this,w=new m(function(y,b){h.ready().then(function(){ge(h._dbInfo,g,function(C,x){if(C)return b(C);try{var I=x.objectStore(h._dbInfo.storeName).openCursor(),R=1;I.onsuccess=function(){var z=I.result;if(z){var L=z.value;ve(L)&&(L=Q(L));var W=a(L,z.key,R++);W!==void 0?y(W):z.continue()}else y()},I.onerror=function(){b(I.error)}}catch(z){b(z)}})}).catch(b)});return S(w,l),w}function Er(a,l,h){var w=this;a=M(a);var y=new m(function(b,C){var x;w.ready().then(function(){return x=w._dbInfo,p.call(l)==="[object Blob]"?P(x.db).then(function(I){return I?l:re(l)}):l}).then(function(I){ge(w._dbInfo,u,function(R,z){if(R)return C(R);try{var L=z.objectStore(w._dbInfo.storeName);I===null&&(I=void 0);var W=L.put(I,a);z.oncomplete=function(){I===void 0&&(I=null),b(I)},z.onabort=z.onerror=function(){var F=W.error?W.error:W.transaction.error;C(F)}}catch(F){C(F)}})}).catch(C)});return S(y,h),y}function kr(a,l){var h=this;a=M(a);var w=new m(function(y,b){h.ready().then(function(){ge(h._dbInfo,u,function(C,x){if(C)return b(C);try{var I=x.objectStore(h._dbInfo.storeName).delete(a);x.oncomplete=function(){y()},x.onerror=function(){b(I.error)},x.onabort=function(){var R=I.error?I.error:I.transaction.error;b(R)}}catch(R){b(R)}})}).catch(b)});return S(w,l),w}function xr(a){var l=this,h=new m(function(w,y){l.ready().then(function(){ge(l._dbInfo,u,function(b,C){if(b)return y(b);try{var x=C.objectStore(l._dbInfo.storeName).clear();C.oncomplete=function(){w()},C.onabort=C.onerror=function(){var I=x.error?x.error:x.transaction.error;y(I)}}catch(I){y(I)}})}).catch(y)});return S(h,a),h}function Ir(a){var l=this,h=new m(function(w,y){l.ready().then(function(){ge(l._dbInfo,g,function(b,C){if(b)return y(b);try{var x=C.objectStore(l._dbInfo.storeName).count();x.onsuccess=function(){w(x.result)},x.onerror=function(){y(x.error)}}catch(I){y(I)}})}).catch(y)});return S(h,a),h}function Tr(a,l){var h=this,w=new m(function(y,b){a<0?y(null):h.ready().then(function(){ge(h._dbInfo,g,function(C,x){if(C)return b(C);try{var I=x.objectStore(h._dbInfo.storeName),R=!1,z=I.openKeyCursor();z.onsuccess=function(){var L=z.result;L?a===0||R?y(L.key):(R=!0,L.advance(a)):y(null)},z.onerror=function(){b(z.error)}}catch(L){b(L)}})}).catch(b)});return S(w,l),w}function Rr(a){var l=this,h=new m(function(w,y){l.ready().then(function(){ge(l._dbInfo,g,function(b,C){if(b)return y(b);try{var x=C.objectStore(l._dbInfo.storeName).openKeyCursor(),I=[];x.onsuccess=function(){var R=x.result;R?(I.push(R.key),R.continue()):w(I)},x.onerror=function(){y(x.error)}}catch(R){y(R)}})}).catch(y)});return S(h,a),h}function Pr(a,l){l=B.apply(this,arguments);var h=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||h.name,a.storeName=a.storeName||h.storeName);var w,y=this;if(a.name){var b=a.name===h.name&&y._dbInfo.db?m.resolve(y._dbInfo.db):H(a).then(function(C){var x=d[a.name],I=x.forages;x.db=C;for(var R=0;R<I.length;R++)I[R]._dbInfo.db=C;return C});w=a.storeName?b.then(function(C){if(C.objectStoreNames.contains(a.storeName)){var x=C.version+1;$(a);var I=d[a.name],R=I.forages;C.close();for(var z=0;z<R.length;z++){var L=R[z];L._dbInfo.db=null,L._dbInfo.version=x}var W=new m(function(F,q){var ee=s.open(a.name,x);ee.onerror=function(ye){ee.result.close(),q(ye)},ee.onupgradeneeded=function(){ee.result.deleteObjectStore(a.storeName)},ee.onsuccess=function(){var ye=ee.result;ye.close(),F(ye)}});return W.then(function(F){I.db=F;for(var q=0;q<R.length;q++){var ee=R[q];ee._dbInfo.db=F,D(ee._dbInfo)}}).catch(function(F){throw(U(a,F)||m.resolve()).catch(function(){}),F})}}):b.then(function(C){$(a);var x=d[a.name],I=x.forages;C.close();for(var R=0;R<I.length;R++)I[R]._dbInfo.db=null;var z=new m(function(L,W){var F=s.deleteDatabase(a.name);F.onerror=function(){var q=F.result;q&&q.close(),W(F.error)},F.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},F.onsuccess=function(){var q=F.result;q&&q.close(),L(q)}});return z.then(function(L){x.db=L;for(var W=0;W<I.length;W++)D(I[W]._dbInfo)}).catch(function(L){throw(U(a,L)||m.resolve()).catch(function(){}),L})})}else w=m.reject("Invalid arguments");return S(w,l),w}var zr={_driver:"asyncStorage",_initStorage:_r,_support:c(),iterate:Cr,getItem:Sr,setItem:Er,removeItem:kr,clear:xr,length:Ir,key:Tr,keys:Rr,dropInstance:Pr};function Mr(){return typeof openDatabase=="function"}var Se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$r="~~local_forage_type~",Xn=/^~~local_forage_type~([^~]+)~/,ot="__lfsc__:",Ot=ot.length,Wt="arbf",Ht="blob",Vn="si08",Kn="ui08",Jn="uic8",Yn="si16",Zn="si32",Qn="ur16",eo="ui32",to="fl32",no="fl64",oo=Ot+Wt.length,ro=Object.prototype.toString;function io(a){var l,h,w,y,b,C=.75*a.length,x=a.length,I=0;a[a.length-1]==="="&&(C--,a[a.length-2]==="="&&C--);var R=new ArrayBuffer(C),z=new Uint8Array(R);for(l=0;l<x;l+=4)h=Se.indexOf(a[l]),w=Se.indexOf(a[l+1]),y=Se.indexOf(a[l+2]),b=Se.indexOf(a[l+3]),z[I++]=h<<2|w>>4,z[I++]=(15&w)<<4|y>>2,z[I++]=(3&y)<<6|63&b;return R}function Ft(a){var l,h=new Uint8Array(a),w="";for(l=0;l<h.length;l+=3)w+=Se[h[l]>>2],w+=Se[(3&h[l])<<4|h[l+1]>>4],w+=Se[(15&h[l+1])<<2|h[l+2]>>6],w+=Se[63&h[l+2]];return h.length%3==2?w=w.substring(0,w.length-1)+"=":h.length%3==1&&(w=w.substring(0,w.length-2)+"=="),w}function Ar(a,l){var h="";if(a&&(h=ro.call(a)),a&&(h==="[object ArrayBuffer]"||a.buffer&&ro.call(a.buffer)==="[object ArrayBuffer]")){var w,y=ot;a instanceof ArrayBuffer?(w=a,y+=Wt):(w=a.buffer,h==="[object Int8Array]"?y+=Vn:h==="[object Uint8Array]"?y+=Kn:h==="[object Uint8ClampedArray]"?y+=Jn:h==="[object Int16Array]"?y+=Yn:h==="[object Uint16Array]"?y+=Qn:h==="[object Int32Array]"?y+=Zn:h==="[object Uint32Array]"?y+=eo:h==="[object Float32Array]"?y+=to:h==="[object Float64Array]"?y+=no:l(new Error("Failed to get type for BinaryArray"))),l(y+Ft(w))}else if(h==="[object Blob]"){var b=new FileReader;b.onload=function(){var C=$r+a.type+"~"+Ft(this.result);l(ot+Ht+C)},b.readAsArrayBuffer(a)}else try{l(JSON.stringify(a))}catch(C){console.error("Couldn't convert value into a JSON string: ",a),l(null,C)}}function Dr(a){if(a.substring(0,Ot)!==ot)return JSON.parse(a);var l,h=a.substring(oo),w=a.substring(Ot,oo);if(w===Ht&&Xn.test(h)){var y=h.match(Xn);l=y[1],h=h.substring(y[0].length)}var b=io(h);switch(w){case Wt:return b;case Ht:return f([b],{type:l});case Vn:return new Int8Array(b);case Kn:return new Uint8Array(b);case Jn:return new Uint8ClampedArray(b);case Yn:return new Int16Array(b);case Qn:return new Uint16Array(b);case Zn:return new Int32Array(b);case eo:return new Uint32Array(b);case to:return new Float32Array(b);case no:return new Float64Array(b);default:throw new Error("Unkown type: "+w)}}var qt={serialize:Ar,deserialize:Dr,stringToBuffer:io,bufferToString:Ft};function so(a,l,h,w){a.executeSql("CREATE TABLE IF NOT EXISTS "+l.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],h,w)}function Lr(a){var l=this,h={db:null};if(a)for(var w in a)h[w]=typeof a[w]!="string"?a[w].toString():a[w];var y=new m(function(b,C){try{h.db=openDatabase(h.name,String(h.version),h.description,h.size)}catch(x){return C(x)}h.db.transaction(function(x){so(x,h,function(){l._dbInfo=h,b()},function(I,R){C(R)})},C)});return h.serializer=qt,y}function Ce(a,l,h,w,y,b){a.executeSql(h,w,y,function(C,x){x.code===x.SYNTAX_ERR?C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[l.storeName],function(I,R){R.rows.length?b(I,x):so(I,l,function(){I.executeSql(h,w,y,b)},b)},b):b(C,x)},b)}function Nr(a,l){var h=this;a=M(a);var w=new m(function(y,b){h.ready().then(function(){var C=h._dbInfo;C.db.transaction(function(x){Ce(x,C,"SELECT * FROM "+C.storeName+" WHERE key = ? LIMIT 1",[a],function(I,R){var z=R.rows.length?R.rows.item(0).value:null;z&&(z=C.serializer.deserialize(z)),y(z)},function(I,R){b(R)})})}).catch(b)});return S(w,l),w}function Br(a,l){var h=this,w=new m(function(y,b){h.ready().then(function(){var C=h._dbInfo;C.db.transaction(function(x){Ce(x,C,"SELECT * FROM "+C.storeName,[],function(I,R){for(var z=R.rows,L=z.length,W=0;W<L;W++){var F=z.item(W),q=F.value;if(q&&(q=C.serializer.deserialize(q)),(q=a(q,F.key,W+1))!==void 0)return void y(q)}y()},function(I,R){b(R)})})}).catch(b)});return S(w,l),w}function ao(a,l,h,w){var y=this;a=M(a);var b=new m(function(C,x){y.ready().then(function(){l===void 0&&(l=null);var I=l,R=y._dbInfo;R.serializer.serialize(l,function(z,L){L?x(L):R.db.transaction(function(W){Ce(W,R,"INSERT OR REPLACE INTO "+R.storeName+" (key, value) VALUES (?, ?)",[a,z],function(){C(I)},function(F,q){x(q)})},function(W){if(W.code===W.QUOTA_ERR){if(w>0)return void C(ao.apply(y,[a,I,h,w-1]));x(W)}})})}).catch(x)});return S(b,h),b}function Ur(a,l,h){return ao.apply(this,[a,l,h,1])}function jr(a,l){var h=this;a=M(a);var w=new m(function(y,b){h.ready().then(function(){var C=h._dbInfo;C.db.transaction(function(x){Ce(x,C,"DELETE FROM "+C.storeName+" WHERE key = ?",[a],function(){y()},function(I,R){b(R)})})}).catch(b)});return S(w,l),w}function Or(a){var l=this,h=new m(function(w,y){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(C){Ce(C,b,"DELETE FROM "+b.storeName,[],function(){w()},function(x,I){y(I)})})}).catch(y)});return S(h,a),h}function Wr(a){var l=this,h=new m(function(w,y){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(C){Ce(C,b,"SELECT COUNT(key) as c FROM "+b.storeName,[],function(x,I){var R=I.rows.item(0).c;w(R)},function(x,I){y(I)})})}).catch(y)});return S(h,a),h}function Hr(a,l){var h=this,w=new m(function(y,b){h.ready().then(function(){var C=h._dbInfo;C.db.transaction(function(x){Ce(x,C,"SELECT key FROM "+C.storeName+" WHERE id = ? LIMIT 1",[a+1],function(I,R){var z=R.rows.length?R.rows.item(0).key:null;y(z)},function(I,R){b(R)})})}).catch(b)});return S(w,l),w}function Fr(a){var l=this,h=new m(function(w,y){l.ready().then(function(){var b=l._dbInfo;b.db.transaction(function(C){Ce(C,b,"SELECT key FROM "+b.storeName,[],function(x,I){for(var R=[],z=0;z<I.rows.length;z++)R.push(I.rows.item(z).key);w(R)},function(x,I){y(I)})})}).catch(y)});return S(h,a),h}function qr(a){return new m(function(l,h){a.transaction(function(w){w.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,b){for(var C=[],x=0;x<b.rows.length;x++)C.push(b.rows.item(x).name);l({db:a,storeNames:C})},function(y,b){h(b)})},function(w){h(w)})})}function Gr(a,l){l=B.apply(this,arguments);var h=this.config();(a=typeof a!="function"&&a||{}).name||(a.name=a.name||h.name,a.storeName=a.storeName||h.storeName);var w,y=this;return w=a.name?new m(function(b){var C;C=a.name===h.name?y._dbInfo.db:openDatabase(a.name,"","",0),a.storeName?b({db:C,storeNames:[a.storeName]}):b(qr(C))}).then(function(b){return new m(function(C,x){b.db.transaction(function(I){function R(F){return new m(function(q,ee){I.executeSql("DROP TABLE IF EXISTS "+F,[],function(){q()},function(ye,Vt){ee(Vt)})})}for(var z=[],L=0,W=b.storeNames.length;L<W;L++)z.push(R(b.storeNames[L]));m.all(z).then(function(){C()}).catch(function(F){x(F)})},function(I){x(I)})})}):m.reject("Invalid arguments"),S(w,l),w}var Xr={_driver:"webSQLStorage",_initStorage:Lr,_support:Mr(),iterate:Br,getItem:Nr,setItem:Ur,removeItem:jr,clear:Or,length:Wr,key:Hr,keys:Fr,dropInstance:Gr};function Vr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function co(a,l){var h=a.name+"/";return a.storeName!==l.storeName&&(h+=a.storeName+"/"),h}function Kr(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function Jr(){return!Kr()||localStorage.length>0}function Yr(a){var l=this,h={};if(a)for(var w in a)h[w]=a[w];return h.keyPrefix=co(a,l._defaultConfig),Jr()?(l._dbInfo=h,h.serializer=qt,m.resolve()):m.reject()}function Zr(a){var l=this,h=l.ready().then(function(){for(var w=l._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var b=localStorage.key(y);b.indexOf(w)===0&&localStorage.removeItem(b)}});return S(h,a),h}function Qr(a,l){var h=this;a=M(a);var w=h.ready().then(function(){var y=h._dbInfo,b=localStorage.getItem(y.keyPrefix+a);return b&&(b=y.serializer.deserialize(b)),b});return S(w,l),w}function ei(a,l){var h=this,w=h.ready().then(function(){for(var y=h._dbInfo,b=y.keyPrefix,C=b.length,x=localStorage.length,I=1,R=0;R<x;R++){var z=localStorage.key(R);if(z.indexOf(b)===0){var L=localStorage.getItem(z);if(L&&(L=y.serializer.deserialize(L)),(L=a(L,z.substring(C),I++))!==void 0)return L}}});return S(w,l),w}function ti(a,l){var h=this,w=h.ready().then(function(){var y,b=h._dbInfo;try{y=localStorage.key(a)}catch{y=null}return y&&(y=y.substring(b.keyPrefix.length)),y});return S(w,l),w}function ni(a){var l=this,h=l.ready().then(function(){for(var w=l._dbInfo,y=localStorage.length,b=[],C=0;C<y;C++){var x=localStorage.key(C);x.indexOf(w.keyPrefix)===0&&b.push(x.substring(w.keyPrefix.length))}return b});return S(h,a),h}function oi(a){var l=this.keys().then(function(h){return h.length});return S(l,a),l}function ri(a,l){var h=this;a=M(a);var w=h.ready().then(function(){var y=h._dbInfo;localStorage.removeItem(y.keyPrefix+a)});return S(w,l),w}function ii(a,l,h){var w=this;a=M(a);var y=w.ready().then(function(){l===void 0&&(l=null);var b=l;return new m(function(C,x){var I=w._dbInfo;I.serializer.serialize(l,function(R,z){if(z)x(z);else try{localStorage.setItem(I.keyPrefix+a,R),C(b)}catch(L){L.name!=="QuotaExceededError"&&L.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(L),x(L)}})})});return S(y,h),y}function si(a,l){if(l=B.apply(this,arguments),!(a=typeof a!="function"&&a||{}).name){var h=this.config();a.name=a.name||h.name,a.storeName=a.storeName||h.storeName}var w,y=this;return w=a.name?new m(function(b){a.storeName?b(co(a,y._defaultConfig)):b(a.name+"/")}).then(function(b){for(var C=localStorage.length-1;C>=0;C--){var x=localStorage.key(C);x.indexOf(b)===0&&localStorage.removeItem(x)}}):m.reject("Invalid arguments"),S(w,l),w}var ai={_driver:"localStorageWrapper",_initStorage:Yr,_support:Vr(),iterate:ei,getItem:Qr,setItem:ii,removeItem:ri,clear:Zr,length:oi,key:ti,keys:ni,dropInstance:si},ci=function(a,l){return a===l||typeof a=="number"&&typeof l=="number"&&isNaN(a)&&isNaN(l)},li=function(a,l){for(var h=a.length,w=0;w<h;){if(ci(a[w],l))return!0;w++}return!1},lo=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},Ge={},ho={},We={INDEXEDDB:zr,WEBSQL:Xr,LOCALSTORAGE:ai},hi=[We.INDEXEDDB._driver,We.WEBSQL._driver,We.LOCALSTORAGE._driver],rt=["dropInstance"],Gt=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(rt),ui={description:"",driver:hi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function di(a,l){a[l]=function(){var h=arguments;return a.ready().then(function(){return a[l].apply(a,h)})}}function Xt(){for(var a=1;a<arguments.length;a++){var l=arguments[a];if(l)for(var h in l)l.hasOwnProperty(h)&&(lo(l[h])?arguments[0][h]=l[h].slice():arguments[0][h]=l[h])}return arguments[0]}var fi=function(){function a(l){for(var h in r(this,a),We)if(We.hasOwnProperty(h)){var w=We[h],y=w._driver;this[h]=y,Ge[y]||this.defineDriver(w)}this._defaultConfig=Xt({},ui),this._config=Xt({},this._defaultConfig,l),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(l){if((l===void 0?"undefined":o(l))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var h in l){if(h==="storeName"&&(l[h]=l[h].replace(/\W/g,"_")),h==="version"&&typeof l[h]!="number")return new Error("Database version must be a number.");this._config[h]=l[h]}return!("driver"in l)||!l.driver||this.setDriver(this._config.driver)}return typeof l=="string"?this._config[l]:this._config},a.prototype.defineDriver=function(l,h,w){var y=new m(function(b,C){try{var x=l._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!l._driver)return void C(I);for(var R=Gt.concat("_initStorage"),z=0,L=R.length;z<L;z++){var W=R[z];if((!li(rt,W)||l[W])&&typeof l[W]!="function")return void C(I)}var F=function(){for(var ee=function(gi){return function(){var mi=new Error("Method "+gi+" is not implemented by the current driver"),uo=m.reject(mi);return S(uo,arguments[arguments.length-1]),uo}},ye=0,Vt=rt.length;ye<Vt;ye++){var Kt=rt[ye];l[Kt]||(l[Kt]=ee(Kt))}};F();var q=function(ee){Ge[x]&&console.info("Redefining LocalForage driver: "+x),Ge[x]=l,ho[x]=ee,b()};"_support"in l?l._support&&typeof l._support=="function"?l._support().then(q,C):q(!!l._support):q(!0)}catch(ee){C(ee)}});return E(y,h,w),y},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(l,h,w){var y=Ge[l]?m.resolve(Ge[l]):m.reject(new Error("Driver not found."));return E(y,h,w),y},a.prototype.getSerializer=function(l){var h=m.resolve(qt);return E(h,l),h},a.prototype.ready=function(l){var h=this,w=h._driverSet.then(function(){return h._ready===null&&(h._ready=h._initDriver()),h._ready});return E(w,l,l),w},a.prototype.setDriver=function(l,h,w){var y=this;lo(l)||(l=[l]);var b=this._getSupportedDrivers(l);function C(){y._config.driver=y.driver()}function x(z){return y._extend(z),C(),y._ready=y._initStorage(y._config),y._ready}function I(z){return function(){var L=0;function W(){for(;L<z.length;){var F=z[L];return L++,y._dbInfo=null,y._ready=null,y.getDriver(F).then(x).catch(W)}C();var q=new Error("No available storage method found.");return y._driverSet=m.reject(q),y._driverSet}return W()}}var R=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=R.then(function(){var z=b[0];return y._dbInfo=null,y._ready=null,y.getDriver(z).then(function(L){y._driver=L._driver,C(),y._wrapLibraryMethodsWithReady(),y._initDriver=I(b)})}).catch(function(){C();var z=new Error("No available storage method found.");return y._driverSet=m.reject(z),y._driverSet}),E(this._driverSet,h,w),this._driverSet},a.prototype.supports=function(l){return!!ho[l]},a.prototype._extend=function(l){Xt(this,l)},a.prototype._getSupportedDrivers=function(l){for(var h=[],w=0,y=l.length;w<y;w++){var b=l[w];this.supports(b)&&h.push(b)}return h},a.prototype._wrapLibraryMethodsWithReady=function(){for(var l=0,h=Gt.length;l<h;l++)di(this,Gt[l])},a.prototype.createInstance=function(l){return new a(l)},a}(),pi=new fi;e.exports=pi},{3:3}]},{},[4])(4)),Uo={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
- */(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 c=i||"MozAppearance"in document.documentElement.style?"iframe":"navigate",d={createWriteStream:function(S,C,D){let N={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},R=0,_=null,u=null,g=null;if(Number.isFinite(C)?([D,C]=[C,D],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),N.size=D,N.writableStrategy=C):C&&C.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),N.size=D,N.writableStrategy=C):N=C||{},!s){n||(n=i?m(d.mitm):function(M){const I="width=200,height=100",$=document.createDocumentFragment(),B={frame:t.open(M,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){B.frame.close()},addEventListener(...O){$.addEventListener(...O)},dispatchEvent(...O){$.dispatchEvent(...O)},removeEventListener(...O){$.removeEventListener(...O)},postMessage(...O){B.frame.postMessage(...O)}},j=O=>{O.source===B.frame&&(B.loaded=!0,t.removeEventListener("message",j),B.dispatchEvent(new Event("load")))};return t.addEventListener("message",j),B}(d.mitm)),u=new MessageChannel,S=encodeURIComponent(S.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const p={transferringReadable:o,pathname:N.pathname||Math.random().toString().slice(-6)+"/"+S,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+S}};N.size&&(p.headers["Content-Length"]=N.size);const y=[p,"*",[u.port2]];if(o){const M=c==="iframe"?void 0:{transform($,B){if(!($ instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");R+=$.length,B.enqueue($),_&&(location.href=_,_=null)},flush(){_&&(location.href=_)}};g=new d.TransformStream(M,N.writableStrategy,N.readableStrategy);const I=g.readable;u.port1.postMessage({readableStream:I},[I])}u.port1.onmessage=M=>{M.data.download?c==="navigate"?(n.remove(),n=null,R?location.href=M.data.download:_=M.data.download):(n.isPopup&&(n.remove(),n=null,c==="iframe"&&m(d.mitm)),m(M.data.download)):M.data.abort&&(f=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...y):n.addEventListener("load",()=>{n.postMessage(...y)},{once:!0})}let f=[];return!s&&g&&g.writable||new d.WritableStream({write(p){if(!(p instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?f.push(p):(u.port1.postMessage(p),R+=p.length,_&&(location.href=_,_=null))},close(){if(s){const p=new Blob(f,{type:"application/octet-stream; charset=utf-8"}),y=document.createElement("a");y.href=URL.createObjectURL(p),y.download=S,y.click()}else u.port1.postMessage("end")},abort(){f=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},N.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 m(S){if(!S)throw new Error("meh");const C=document.createElement("iframe");return C.hidden=!0,C.src=S,C.loaded=!1,C.name="iframe",C.isIframe=!0,C.postMessage=(...D)=>C.contentWindow.postMessage(...D),C.addEventListener("load",()=>{C.loaded=!0},{once:!0}),document.body.appendChild(C),C}try{new Response(new ReadableStream),i&&!("serviceWorker"in navigator)&&(s=!0)}catch{s=!0}return(S=>{try{S()}catch{}})(()=>{const{readable:S}=new TransformStream,C=new MessageChannel;C.port1.postMessage(S,[S]),C.port1.close(),C.port2.close(),o=!0,Object.defineProperty(d,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),d})})(Ao);var Ds=ae(Ao.exports);class Ms{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=an(),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 bt(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=fe.createInstance({name:this.fileID,driver:fe.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(),fe.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=L.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const c=this.cacheSize;let d=0;for(let m=0;m<this.totalChunks;m++){if(this.keys&&this.keys?.indexOf(m.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const S=m*this.chunkByteSize;let C=S+this.chunkByteSize-1;this.fileMetaData&&C>this.fileMetaData.length&&(C=this.fileMetaData.length-1);const D={range:`bytes=${S}-${C}`};for(;d>=c;)await this.sleep(200);const N=m.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${m+1}/${this.totalChunks}`),d++,bt(o,n,i,D,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async R=>{const _=R.data;d--,await this.currentDB?.setItem(N,_),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const u=parseInt(N)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(R=>{d--;const _=parseInt(N)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${_}\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=Ds.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 c=s.getReader();for(;;){const{done:d,value:m}=await c.read();if(d)break;await t.write(m)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}t.close(),fe.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function As(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 Lo(e={},t={}){let n;for(n in t)Pt(t[n])?e[n]=Lo(e[n],t[n]):e[n]=t[n];return e}function Ls(e,t){const n=`${e}_${t}`;return ut.MD5(n)}function No(e){const t=function(c){if(!c)return;const d=c,m=[];if(d)for(let S of d){const C=Bo(S);C&&m.push(C)}return m}(e.bussinessRoutes),n=function(c){if(!c)return;const d=c;if(d&&d.length>0){const m=[];return d.forEach(S=>{const C=Uo(S);C&&m.push(C)}),m}}(e.widgetMenuConfig),o=function(c){if(c&&c.length>0){const d=[];return c.forEach(m=>{const S=function(C){return C?{id:C.id,label:C.label,container:C.container,preload:C.preload,afterid:C.afterid,bindid:C.bindid,group:C.group}:void 0}(m);S&&d.push(S)}),d}}(e.widgetConfig),r=function(c){if(c&&c.length>0)return c}(e.functionList),i=e.pkgObject.version,s=e.pkgObject.name;return{id:Ls(s,i),name:L.Config.UI.SiteTitle,group:L.Config.UI.Group,product:s,version:i,routes:t,widgetMenu:n,widgets:o,functions:r}}function Bo(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=Bo(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Uo(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=Uo(n);o&&t.children?.push(o)})),t}function Ns(e,t="IconifyList.ts"){let n="",o=`const iconlist={
9
- `,r=0;e.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const c="icon"+r;n+=`import ${c} from '~icons/${s[0]}/${s[1]}'
8
+ */(function(t){((e,n)=>{t.exports=n()})(0,()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,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",f={createWriteStream:function(S,E,M){let B={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},T=0,_=null,d=null,p=null;if(Number.isFinite(E)?([M,E]=[E,M],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),B.size=M,B.writableStrategy=E):E&&E.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),B.size=M,B.writableStrategy=E):B=E||{},!s){n||(n=i?m(f.mitm):function(A){const P="width=200,height=100",$=document.createDocumentFragment(),D={frame:e.open(A,"popup",P),loaded:!1,isIframe:!1,isPopup:!0,remove(){D.frame.close()},addEventListener(...O){$.addEventListener(...O)},dispatchEvent(...O){$.dispatchEvent(...O)},removeEventListener(...O){$.removeEventListener(...O)},postMessage(...O){D.frame.postMessage(...O)}},U=O=>{O.source===D.frame&&(D.loaded=!0,e.removeEventListener("message",U),D.dispatchEvent(new Event("load")))};return e.addEventListener("message",U),D}(f.mitm)),d=new MessageChannel,S=encodeURIComponent(S.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const u={transferringReadable:o,pathname:B.pathname||Math.random().toString().slice(-6)+"/"+S,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+S}};B.size&&(u.headers["Content-Length"]=B.size);const v=[u,"*",[d.port2]];if(o){const A=c==="iframe"?void 0:{transform($,D){if(!($ instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");T+=$.length,D.enqueue($),_&&(location.href=_,_=null)},flush(){_&&(location.href=_)}};p=new f.TransformStream(A,B.writableStrategy,B.readableStrategy);const P=p.readable;d.port1.postMessage({readableStream:P},[P])}d.port1.onmessage=A=>{A.data.download?c==="navigate"?(n.remove(),n=null,T?location.href=A.data.download:_=A.data.download):(n.isPopup&&(n.remove(),n=null,c==="iframe"&&m(f.mitm)),m(A.data.download)):A.data.abort&&(g=[],d.port1.postMessage("abort"),d.port1.onmessage=null,d.port1.close(),d.port2.close(),d=null)},n.loaded?n.postMessage(...v):n.addEventListener("load",()=>{n.postMessage(...v)},{once:!0})}let g=[];return!s&&p&&p.writable||new f.WritableStream({write(u){if(!(u instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");s?g.push(u):(d.port1.postMessage(u),T+=u.length,_&&(location.href=_,_=null))},close(){if(s){const u=new Blob(g,{type:"application/octet-stream; charset=utf-8"}),v=document.createElement("a");v.href=URL.createObjectURL(u),v.download=S,v.click()}else d.port1.postMessage("end")},abort(){g=[],d.port1.postMessage("abort"),d.port1.onmessage=null,d.port1.close(),d.port2.close(),d=null}},B.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 m(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=(...M)=>E.contentWindow.postMessage(...M),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(f,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),f})})(Uo);var Os=lt(Uo.exports);class Ws{fileID;downloadURL;ChunkUnitM=1048576;chunkByteSize;totalChunks=1;currentDB;keys;fileMetaData=null;finishNum=0;eventTarget;cancelSource;isStarting=!1;fileName;cacheSize=6;requestTimeout=6e4;constructor(e,n,o=3,r=6,i=6e4){this.fileID=e,this.downloadURL=n,this.chunkByteSize=o*this.ChunkUnitM,this.eventTarget=fn(),this.initIndexDB(),r>=3&&(this.cacheSize=r),i>this.requestTimeout&&(this.requestTimeout=i)}on(e,n){this.eventTarget.on(e,n)}dispatch(e,n){this.eventTarget.emit(e,n)}dispatchError(e){this.eventTarget.emit("error",e)}dispatchInfo(e){this.eventTarget.emit("info",e)}async queryDownloadFileMeta(e,n="",o){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await be(n,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=mt.createInstance({name:this.fileID,driver:mt.INDEXEDDB})}async init(e){if(this.finishNum=0,e){const n="fileinfo";this.fileMetaData={id:e.id,name:e.name,length:e.length,downloadID:e.downloadID,chunkSize:this.chunkByteSize},this.fileName=e.name,this.currentDB?.setItem(n,this.fileMetaData)}if(this.fileMetaData!=null){const n=this.fileMetaData.chunkSize;n!=null&&n>0&&(this.chunkByteSize=n)}this.fileMetaData&&(this.totalChunks=Math.ceil(this.fileMetaData.length/this.chunkByteSize)),this.dispatchInfo("\u5B8C\u6210\u521D\u59CB\u5316\u6587\u4EF6\u4FE1\u606F\uFF0C\u603B\u5206\u7247\uFF1A"+this.totalChunks),this.currentDB&&(this.keys=await this.currentDB.keys())}getTotalChunks(){return this.totalChunks}pause(){this.cancelSource&&this.isStarting&&(this.cancelSource.cancel(),this.isStarting=!1),this.dispatchInfo("\u5DF2\u6682\u505C\u4E0B\u8F7D\u4EFB\u52A1")}restart(){this.dispatchInfo("\u6B63\u5728\u91CD\u542F\u4E0B\u8F7D\u4EFB\u52A1"),this.download()}delete(){this.cancelSource&&this.cancelSource.cancel(),mt.dropInstance({name:this.fileID}),this.currentDB=void 0,this.keys&&(this.keys.length=0,this.keys=void 0),this.finishNum=0,this.downloadProgress(),this.outputProgress(0),this.dispatchInfo("\u5DF2\u5220\u9664\u4E0B\u8F7D\u4EFB\u52A1")}sleep(e){return new Promise(n=>setTimeout(n,e))}async download(e,n){let o=e;if(!o&&this.downloadURL&&(o=this.downloadURL),!o)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=N.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const i={key:this.fileMetaData?.downloadID};let s=0;const c=this.cacheSize;let f=0;for(let m=0;m<this.totalChunks;m++){if(this.keys&&this.keys?.indexOf(m.toString())>=0){s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());continue}const S=m*this.chunkByteSize;let E=S+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const M={range:`bytes=${S}-${E}`};for(;f>=c;)await this.sleep(200);const B=m.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${m+1}/${this.totalChunks}`),f++,be(o,n,i,M,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async T=>{const _=T.data;f--,await this.currentDB?.setItem(B,_),s++,s>this.finishNum&&(this.finishNum=s,this.downloadProgress());const d=parseInt(B)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${d}/${this.totalChunks}`),this.savefile()}).catch(T=>{f--;const _=parseInt(B)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${_}\uFF09\u4E2A\u5206\u7247\u5185\u5BB9\u5931\u8D25\uFF01`)})}this.finishNum===this.totalChunks&&this.savefile()}downloadProgress(){const e=100*this.finishNum/this.totalChunks;this.dispatch("downloadProgress",e)}outputProgress(e){const n=100*e/this.totalChunks;this.dispatch("saveProgress",n)}async savefile(){if(this.finishNum===this.totalChunks){if(!this.fileName)return void this.dispatchError("\u4E0B\u8F7D\u9519\u8BEF\uFF1A\u6587\u4EF6\u540D\u4E3A\u7A7A!");this.dispatchInfo("\u5F00\u59CB\u4FDD\u5B58\u4E0B\u8F7D\u6587\u4EF6:"+this.fileName);const e=Os.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 c=s.getReader();for(;;){const{done:f,value:m}=await c.read();if(f)break;await e.write(m)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${o+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),mt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function Hs(t,e){let n="",o="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),o=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,o}function jo(t={},e={}){let n;for(n in e)Me(e[n])?t[n]=jo(t[n],e[n]):t[n]=e[n];return t}function Fs(t,e){const n=`${t}_${e}`;return de.MD5(n)}function Oo(t){const e=function(c){if(!c)return;const f=c,m=[];if(f)for(let S of f){const E=Wo(S);E&&m.push(E)}return m}(t.bussinessRoutes),n=function(c){if(!c)return;const f=c;if(f&&f.length>0){const m=[];return f.forEach(S=>{const E=Ho(S);E&&m.push(E)}),m}}(t.widgetMenuConfig),o=function(c){if(c&&c.length>0){const f=[];return c.forEach(m=>{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}(m);S&&f.push(S)}),f}}(t.widgetConfig),r=function(c){if(c&&c.length>0)return c}(t.functionList),i=t.pkgObject.version,s=t.pkgObject.name;return{id:Fs(s,i),name:N.Config.UI.SiteTitle,group:N.Config.UI.Group,product:s,version:i,routes:e,widgetMenu:n,widgets:o,functions:r}}function Wo(t){if(t){let e=0;t.meta?.hidden&&(e=1);let n={path:t.path,name:t.name,title:t.meta?.title,type:e,index:t.meta?.index};if(t.children){const o=[];for(let r of t.children){const i=Wo(r);i&&o.push(i)}o.length>0&&(n.children=o)}return n}}function Ho(t){if(!t)return;const e={name:t.name,index:t.index,path:t.path,type:t.type};return t.children&&t.children.length>0&&(e.children=[],t.children.forEach(n=>{const o=Ho(n);o&&e.children?.push(o)})),e}function qs(t,e="IconifyList.ts"){let n="",o=`const iconlist={
9
+ `,r=0;t.forEach(i=>{const s=i.split(":");if(s&&s.length===2){const c="icon"+r;n+=`import ${c} from '~icons/${s[0]}/${s[1]}'
10
10
  `,o+=` '${i}':${c},
11
11
  `,r++}}),r>0&&(o+=`};
12
- `,de(n+o+"export default iconlist;","IconifyList.ts"))}function Bs(e,t){const n=No(e);go(n,t),L.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function Us(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 Os(e){let t=wn(e);return t=t.replace(/^[1-9]\d\d{1,3}$/,"100"),t=t.replace(/^100\.$/,"100"),t}function wn(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 js(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 Ws(e){let t=e.replace(/[\u4e00-\u9fa5\s]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function Hs(e){let t=e.replace(/[a-zA-Z]+/g,"");return t=t.replace(/(^\s*)|(\s*$)/g,""),t}function Fs(e){return e.replace(/(^\s*)|(\s*$)/g,"")}function qs(e){let t=wn(e);return t=t.toString().split("."),t[0]=t[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),t=t.join("."),t}function Gs(e,t="",n="red"){return t.replace(new RegExp(e,"gi"),`<span style='color: ${n}'>${e}</span>`)}function Xs(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 Vs(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 Ks(e){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(e)}function Js(e){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(e)}function Ys(e){return!!/^[a-zA-Z]\w{5,15}$/.test(e)}function Zs(e){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(e)}function Qs(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 ta(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 ea(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 na(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 oa(e){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(e)}function ra(e){return!!/^[1-9][0-9]{5}$/.test(e)}function ia(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 sa(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 Oo=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Oo=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var bn=2654435769;function jo(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 ge(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 Mt(e){return 4294967295&e}function me(e,t,n,o,r,i){return(n>>>5^t<<2)+(t>>>3^n<<4)^(e^t)+(i[3&o^r]^n)}function Wo(e){if(e.length<16){var t=new Uint8Array(16);t.set(e),e=t}return e}function ve(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 c=65536+((1023&i)<<10|1023&s);n[o++]=240|c>>18,n[o++]=128|c>>12&63,n[o++]=128|c>>6&63,n[o++]=128|63&c,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 Ho(e){var t=e.length;return t===0?"":t<32767?function(n,o){for(var r=new Array(o),i=0,s=0,c=n.length;i<o&&s<c;i++){var d=n[s++];switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=d;break;case 12:case 13:if(!(s<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&d)<<6|63&n[s++];break;case 14:if(!(s+1<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&d)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<c))throw new Error("Unfinished UTF-8 octet sequence");var m=((7&d)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=m&&m<=1048575))throw new Error("Character outside valid Unicode range: 0x"+m.toString(16));r[i++]=m>>10&1023|55296,r[i]=1023&m|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+d.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,c=0,d=n.length;s<o&&c<d;s++){var m=n[c++];switch(m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=m;break;case 12:case 13:if(!(c<d))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&m)<<6|63&n[c++];break;case 14:if(!(c+1<d))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&m)<<12|(63&n[c++])<<6|63&n[c++];break;case 15:if(!(c+2<d))throw new Error("Unfinished UTF-8 octet sequence");var S=((7&m)<<18|(63&n[c++])<<12|(63&n[c++])<<6|63&n[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"+m.toString(16))}if(s>=32766){var C=s+1;i.length=C,r.push(String.fromCharCode.apply(String,i)),o-=C,s=-1}}return s>0&&(i.length=s,r.push(String.fromCharCode.apply(String,i))),r.join("")}(e,t)}function aa(e){var t=e.length;if(t===0)return"";var n=Oo?e:function(c){for(var d=c.length,m=new Array(c.length),S=0;S<d;++S)m[S]=c[S];return m}(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 Fo(e,t){return typeof e=="string"&&(e=ve(e)),typeof t=="string"&&(t=ve(t)),e==null||e.length===0?e:jo(function(n,o){var r,i,s,c,d,m,S=n.length,C=S-1;for(i=n[C],s=0,m=0|Math.floor(6+52/S);m>0;--m){for(c=(s=Mt(s+bn))>>>2&3,d=0;d<C;++d)r=n[d+1],i=n[d]=Mt(n[d]+me(s,r,i,d,c,o));r=n[0],i=n[C]=Mt(n[C]+me(s,r,i,C,c,o))}return n}(ge(e,!0),ge(Wo(t),!1)),!1)}function qo(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=ve(t)),e==null||e.length===0?e:jo(function(n,o){var r,i,s,c,d,m=n.length,S=m-1;for(r=n[0],s=Mt(Math.floor(6+52/m)*bn);s!==0;s=Mt(s-bn)){for(c=s>>>2&3,d=S;d>0;--d)i=n[d-1],r=n[d]=Mt(n[d]-me(s,r,i,d,c,o));i=n[S],r=n[0]=Mt(n[0]-me(s,r,i,0,c,o))}return n}(ge(e,!1),ge(Wo(t),!1)),!0)}const Vt={toBytes:ve,toString:Ho,encrypt:Fo,encryptToString:function(e,t){return window.btoa(aa(Fo(e,t)))},decrypt:qo,decryptToString:function(e,t){return Ho(qo(e,t))}},Go=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},ca={set:e=>{let t=Go(e);document.getElementById(t)===null&&(t=Go(e))},del:()=>{let e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e))}};class Ot extends Error{constructor(t,n){const o=new.target.prototype;super(`${t}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class _n extends Error{constructor(t="A timeout occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class gt extends Error{constructor(t="An abort occurred."){const n=new.target.prototype;super(t),this.__proto__=n}}class la extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class ha extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class ua extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class da extends Error{constructor(t){const n=new.target.prototype;super(t),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class pa extends Error{constructor(t,n){const o=new.target.prototype;super(t),this.innerErrors=n,this.__proto__=o}}class Xo{constructor(t,n,o){this.statusCode=t,this.statusText=n,this.content=o}}class ye{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 Kt{constructor(){}log(t,n){}}Kt.instance=new Kt;class V{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 K{static get isBrowser(){return typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return typeof self=="object"&&"importScripts"in self}static get isReactNative(){return typeof window=="object"&&window.document===void 0}static get isNode(){return!this.isBrowser&&!this.isWebWorker&&!this.isReactNative}}function Jt(e,t){let n="";return Yt(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 Yt(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}async function Vo(e,t,n,o,r,i){const s={},[c,d]=jt();s[c]=d,e.log(x.Trace,`(${t} transport) sending data. ${Jt(r,i.logMessageContent)}.`);const m=Yt(r)?"arraybuffer":"text",S=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:m,timeout:i.timeout,withCredentials:i.withCredentials});e.log(x.Trace,`(${t} transport) request complete. Response status: ${S.statusCode}.`)}class fa{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 we{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 jt(){let e="X-SignalR-User-Agent";return K.isNode&&(e="User-Agent"),[e,ga("7.0.5",ma(),ya(),va())]}function ga(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 ma(){if(!K.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function va(){if(K.isNode)return process.versions.node}function ya(){return K.isNode?"NodeJS":"Browser"}function Ko(e){return e.stack?e.stack:e.message?e.message:`${e}`}class wa extends ye{constructor(t){if(super(),this._logger=t,typeof fetch>"u"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,this._fetchType=n("node-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 gt;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 gt});let r,i=null;if(t.timeout){const d=t.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(x.Warning,"Timeout from HTTP request."),o=new _n},d)}t.content===""&&(t.content=void 0),t.content&&(t.headers=t.headers||{},Yt(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(d){throw o||(this._logger.log(x.Warning,`Error from HTTP request. ${d}.`),d)}finally{i&&clearTimeout(i),t.abortSignal&&(t.abortSignal.onabort=null)}if(!r.ok){const d=await Jo(r,"text");throw new Ot(d||r.statusText,r.status)}const s=Jo(r,t.responseType),c=await s;return new Xo(r.status,r.statusText,c)}getCookieString(t){let n="";return K.isNode&&this._jar&&this._jar.getCookies(t,(o,r)=>n=r.join("; ")),n}}function Jo(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 ba extends ye{constructor(t){super(),this._logger=t}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new gt):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&&(Yt(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 gt)}),t.timeout&&(r.timeout=t.timeout),r.onload=()=>{t.abortSignal&&(t.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new Xo(r.status,r.statusText,r.response||r.responseText)):o(new Ot(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 Ot(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(x.Warning,"Timeout from HTTP request."),o(new _n)},r.send(t.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class _a extends ye{constructor(t){if(super(),typeof fetch<"u"||K.isNode)this._httpClient=new wa(t);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new ba(t)}}send(t){return t.abortSignal&&t.abortSignal.aborted?Promise.reject(new gt):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 pt{static write(t){return`${t}${pt.RecordSeparator}`}static parse(t){if(t[t.length-1]!==pt.RecordSeparator)throw new Error("Message is incomplete.");const n=t.split(pt.RecordSeparator);return n.pop(),n}}pt.RecordSeparatorCode=30,pt.RecordSeparator=String.fromCharCode(pt.RecordSeparatorCode);class Sa{writeHandshakeRequest(t){return pt.write(JSON.stringify(t))}parseHandshakeResponse(t){let n,o;if(Yt(t)){const s=new Uint8Array(t),c=s.indexOf(pt.RecordSeparatorCode);if(c===-1)throw new Error("Message is incomplete.");const d=c+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,d))),o=s.byteLength>d?s.slice(d).buffer:null}else{const s=t,c=s.indexOf(pt.RecordSeparator);if(c===-1)throw new Error("Message is incomplete.");const d=c+1;n=s.substring(0,d),o=s.length>d?s.substring(d):null}const r=pt.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var q;(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"})(q||(q={}));class Ca{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 fa(this,t)}}var X;(function(e){e.Disconnected="Disconnected",e.Connecting="Connecting",e.Connected="Connected",e.Disconnecting="Disconnecting",e.Reconnecting="Reconnecting"})(X||(X={}));class Ln{constructor(t,n,o,r){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://docs.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},V.isRequired(t,"connection"),V.isRequired(n,"logger"),V.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=3e4,this.keepAliveIntervalInMilliseconds=15e3,this._logger=n,this._protocol=o,this.connection=t,this._reconnectPolicy=r,this._handshakeProtocol=new Sa,this.connection.onreceive=i=>this._processIncomingData(i),this.connection.onclose=i=>this._connectionClosed(i),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=X.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:q.Ping})}static create(t,n,o,r){return new Ln(t,n,o,r)}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!==X.Disconnected&&this._connectionState!==X.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!==X.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=X.Connecting,this._logger.log(x.Debug,"Starting HubConnection.");try{await this._startInternal(),K.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=X.Connected,this._connectionStarted=!0,this._logger.log(x.Debug,"HubConnection connected successfully.")}catch(t){return this._connectionState=X.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{const n={protocol:this._protocol.name,version:this._protocol.version};if(this._logger.log(x.Debug,"Sending handshake request."),await this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(n)),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.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._stopPromise=this._stopInternal(),await this._stopPromise;try{await t}catch{}}_stopInternal(t){return this._connectionState===X.Disconnected?(this._logger.log(x.Debug,`Call to HubConnection.stop(${t}) ignored because it is already in the disconnected state.`),Promise.resolve()):this._connectionState===X.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=X.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()):(this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=t||new gt("The connection was stopped before the hub handshake could complete."),this.connection.stop(t)))}stream(t,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(t,n,r);let s;const c=new Ca;return c.cancelCallback=()=>{const d=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(d))},this._callbacks[i.invocationId]=(d,m)=>{m?c.error(m):d&&(d.type===q.Completion?d.error?c.error(new Error(d.error)):c.complete():c.next(d.item))},s=this._sendWithProtocol(i).catch(d=>{c.error(d),delete this._callbacks[i.invocationId]}),this._launchStreams(o,s),c}_sendMessage(t){return this._resetKeepAliveInterval(),this.connection.send(t)}_sendWithProtocol(t){return 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((c,d)=>{this._callbacks[i.invocationId]=(S,C)=>{C?d(C):S&&(S.type===q.Completion?S.error?d(new Error(S.error)):c(S.result):d(new Error(`Unexpected message type: ${S.type}`)))};const m=this._sendWithProtocol(i).catch(S=>{d(S),delete this._callbacks[i.invocationId]});this._launchStreams(o,m)})}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)switch(o.type){case q.Invocation:this._invokeClientMethod(o);break;case q.StreamItem:case q.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===q.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(x.Error,`Stream callback threw error: ${Ko(i)}`)}}break}case q.Ping:break;case q.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}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===X.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,c,d;for(const m of r)try{const S=s;s=await m.apply(this,t.arguments),i&&s&&S&&(this._logger.log(x.Error,`Multiple results provided for '${n}'. Sending error to server.`),d=this._createCompletionMessage(t.invocationId,"Client provided multiple results.",null)),c=void 0}catch(S){c=S,this._logger.log(x.Error,`A callback for the method '${n}' threw error '${S}'.`)}d?await this._sendWithProtocol(d):i?(c?d=this._createCompletionMessage(t.invocationId,`${c}`,null):s!==void 0?d=this._createCompletionMessage(t.invocationId,null,s):(this._logger.log(x.Warning,`No result given for '${n}' method and invocation ID '${t.invocationId}'.`),d=this._createCompletionMessage(t.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(d)):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 gt("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===X.Disconnecting?this._completeClose(t):this._connectionState===X.Connected&&this._reconnectPolicy?this._reconnect(t):this._connectionState===X.Connected&&this._completeClose(t)}_completeClose(t){if(this._connectionStarted){this._connectionState=X.Disconnected,this._connectionStarted=!1,K.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=X.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!==X.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!==X.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=X.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!==X.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===X.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: ${Ko(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:q.Invocation}:{arguments:n,target:t,type:q.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:t,type:q.Invocation}:{arguments:n,invocationId:i.toString(),target:t,type:q.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:q.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:t,type:q.StreamInvocation}}_createCancelInvocation(t){return{invocationId:t,type:q.CancelInvocation}}_createStreamItemMessage(t,n){return{invocationId:t,item:n,type:q.StreamItem}}_createCompletionMessage(t,n,o){return n?{error:n,invocationId:t,type:q.Completion}:{invocationId:t,result:o,type:q.Completion}}}const Ea=[0,2e3,1e4,3e4,null];class Yo{constructor(t){this._retryDelays=t!==void 0?[...t,null]:Ea}nextRetryDelayInMilliseconds(t){return this._retryDelays[t.previousRetryCount]}}class At{}At.Authorization="Authorization",At.Cookie="Cookie";class xa extends ye{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[At.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&t.headers[At.Authorization]&&delete t.headers[At.Authorization]}getCookieString(t){return this._innerClient.getCookieString(t)}}var J,et;(function(e){e[e.None=0]="None",e[e.WebSockets=1]="WebSockets",e[e.ServerSentEvents=2]="ServerSentEvents",e[e.LongPolling=4]="LongPolling"})(J||(J={})),function(e){e[e.Text=1]="Text",e[e.Binary=2]="Binary"}(et||(et={}));class ka{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}}class Zo{constructor(t,n,o){this._httpClient=t,this._logger=n,this._pollAbort=new ka,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}get pollAborted(){return this._pollAbort.aborted}async connect(t,n){if(V.isRequired(t,"url"),V.isRequired(n,"transferFormat"),V.isIn(n,et,"transferFormat"),this._url=t,this._logger.log(x.Trace,"(LongPolling transport) Connecting."),n===et.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]=jt(),i={[o]:r,...this._options.headers},s={abortSignal:this._pollAbort.signal,headers:i,timeout:1e5,withCredentials:this._options.withCredentials};n===et.Binary&&(s.responseType="arraybuffer");const c=`${t}&_=${Date.now()}`;this._logger.log(x.Trace,`(LongPolling transport) polling: ${c}.`);const d=await this._httpClient.get(c,s);d.statusCode!==200?(this._logger.log(x.Error,`(LongPolling transport) Unexpected response code: ${d.statusCode}.`),this._closeError=new Ot(d.statusText||"",d.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 Ot(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(x.Trace,`(LongPolling transport) data received. ${Jt(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 _n?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?Vo(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]=jt();t[n]=o;const r={headers:{...t,...this._options.headers},timeout:this._options.timeout,withCredentials:this._options.withCredentials};await this._httpClient.delete(this._url,r),this._logger.log(x.Trace,"(LongPolling transport) DELETE request sent.")}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 Ia{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 V.isRequired(t,"url"),V.isRequired(n,"transferFormat"),V.isIn(n,et,"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===et.Text){if(K.isBrowser||K.isWebWorker)i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(t),d={};d.Cookie=c;const[m,S]=jt();d[m]=S,i=new this._options.EventSource(t,{withCredentials:this._options.withCredentials,headers:{...d,...this._options.headers}})}try{i.onmessage=c=>{if(this.onreceive)try{this._logger.log(x.Trace,`(SSE transport) data received. ${Jt(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(d){return void this._close(d)}},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(x.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(t){return this._eventSource?Vo(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 Ta{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 V.isRequired(t,"url"),V.isRequired(n,"transferFormat"),V.isIn(n,et,"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 c=this._httpClient.getCookieString(t);let d=!1;if(K.isNode||K.isReactNative){const m={},[S,C]=jt();m[S]=C,o&&(m[At.Authorization]=`Bearer ${o}`),c&&(m[At.Cookie]=c),s=new this._webSocketConstructor(t,void 0,{headers:{...m,...this._headers}})}else o&&(t+=(t.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(t)),n===et.Binary&&(s.binaryType="arraybuffer"),s.onopen=m=>{this._logger.log(x.Information,`WebSocket connected to ${t}.`),this._webSocket=s,d=!0,r()},s.onerror=m=>{let S=null;S=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.error:"There was an error with the transport",this._logger.log(x.Information,`(WebSockets transport) ${S}.`)},s.onmessage=m=>{if(this._logger.log(x.Trace,`(WebSockets transport) data received. ${Jt(m.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(m.data)}catch(S){return void this._close(S)}},s.onclose=m=>{if(d)this._close(m);else{let S=null;S=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.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(t){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(x.Trace,`(WebSockets transport) sending data. ${Jt(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 Ra{constructor(t,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,V.isRequired(t,"url"),this._logger=(o=n.logger)===void 0?new we(x.Information):o===null?Kt.instance:o.log!==void 0?o:new we(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(K.isNode&&typeof require<"u"){const s=typeof __webpack_require__=="function"?__non_webpack_require__:require;r=s("ws"),i=s("eventsource")}K.isNode||typeof WebSocket>"u"||n.WebSocket?K.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,K.isNode||typeof EventSource>"u"||n.EventSource?K.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new xa(n.httpClient||new _a(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||et.Binary,V.isIn(t,et,"transferFormat"),this._logger.log(x.Debug,`Starting connection with transfer format '${et[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 gt(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 gt(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 Nn(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!==J.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(J.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 gt("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 Zo&&(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]=jt();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 c=JSON.parse(s.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c}catch(s){let c="Failed to complete negotiation with the server: "+s;return s instanceof Ot&&s.statusCode===404&&(c+=" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(x.Error,c),Promise.reject(new da(c))}}_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=[],c=o.availableTransports||[];let d=o;for(const m of c){const S=this._resolveTransportOrError(m,n,r);if(S instanceof Error)s.push(`${m.transport} failed:`),s.push(S);else if(this._isITransport(S)){if(this.transport=S,!d){try{d=await this._getNegotiationResponse(t)}catch(C){return Promise.reject(C)}i=this._createConnectUrl(t,d.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=d.connectionId)}catch(C){if(this._logger.log(x.Error,`Failed to start the transport '${m.transport}': ${C}`),d=void 0,s.push(new ua(`${m.transport} failed: ${C}`,J[m.transport])),this._connectionState!=="Connecting"){const D="Failed to select transport before stop() was called.";return this._logger.log(x.Debug,D),Promise.reject(new gt(D))}}}}return s.length>0?Promise.reject(new pa(`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 J.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Ta(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case J.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Ia(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case J.LongPolling:return new Zo(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${t}.`)}}_startTransport(t,n){return this.transport.onreceive=this.onreceive,this.transport.onclose=o=>this._stopConnection(o),this.transport.connect(t,n)}_resolveTransportOrError(t,n,o){const r=J[t.transport];if(r==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(i,s){return!i||(s&i)!=0}(n,r))return this._logger.log(x.Debug,`Skipping transport '${J[r]}' because it was disabled by the client.`),new ha(`'${J[r]}' is disabled by the client.`,r);{if(!(t.transferFormats.map(s=>et[s]).indexOf(o)>=0))return this._logger.log(x.Debug,`Skipping transport '${J[r]}' because it does not support the requested transfer format '${et[o]}'.`),new Error(`'${J[r]}' does not support ${et[o]}.`);if(r===J.WebSockets&&!this._options.WebSocket||r===J.ServerSentEvents&&!this._options.EventSource)return this._logger.log(x.Debug,`Skipping transport '${J[r]}' because it is not supported in your environment.'`),new la(`'${J[r]}' is not supported in your environment.`,r);this._logger.log(x.Debug,`Selecting transport '${J[r]}'.`);try{return this._constructTransport(r)}catch(s){return s}}}_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(!K.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=t.indexOf("?");let o=t.substring(0,n===-1?t.length:n);return o[o.length-1]!=="/"&&(o+="/"),o+="negotiate",o+=n===-1?"":t.substring(n),o.indexOf("negotiateVersion")===-1&&(o+=n===-1?"?":"&",o+="negotiateVersion="+this._negotiateVersion),o}}class Nn{constructor(t){this._transport=t,this._buffer=[],this._executing=!0,this._sendBufferedData=new be,this._transportResult=new be,this._sendLoopPromise=this._sendLoop()}send(t){return this._bufferData(t),this._transportResult||(this._transportResult=new be),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 be;const t=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):Nn._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 be{constructor(){this.promise=new Promise((t,n)=>[this._resolver,this._rejecter]=[t,n])}resolve(){this._resolver()}reject(t){this._rejecter(t)}}class Pa{constructor(){this.name="json",this.version=1,this.transferFormat=et.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=Kt.instance);const o=pt.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 q.Invocation:this._isInvocationMessage(s);break;case q.StreamItem:this._isStreamItemMessage(s);break;case q.Completion:this._isCompletionMessage(s);break;case q.Ping:case q.Close:break;default:n.log(x.Information,"Unknown message type '"+s.type+"' ignored.");continue}r.push(s)}return r}writeMessage(t){return pt.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.")}_assertNotEmptyString(t,n){if(typeof t!="string"||t==="")throw new Error(n)}}const za={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 $a{configureLogging(t){if(V.isRequired(t,"logging"),t.log!==void 0)this.logger=t;else if(typeof t=="string"){const n=function(o){const r=za[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(t);this.logger=new we(n)}else this.logger=new we(t);return this}withUrl(t,n){return V.isRequired(t,"url"),V.isNotEmpty(t,"url"),this.url=t,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(t){return V.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 Yo(t):this.reconnectPolicy=t:this.reconnectPolicy=new Yo,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 Ra(this.url,t);return Ln.create(n,this.logger||Kt.instance,this.protocol||new Pa,this.reconnectPolicy)}}let _e;function Da(e){if(!e){if(_e)return _e;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const t=new $a().configureLogging(x.Information).withUrl(e).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return t.keepAliveIntervalInMilliseconds=15e3,t.serverTimeoutInMilliseconds=18e5,t.start().then(()=>{L.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),t.onclose(async()=>{L.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),t.onreconnecting(()=>{L.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),t.onreconnected(()=>{L.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),_e||(_e=t),t}const at=io({panelGroups:{}}),Qo=()=>({useGroupAccordion:e=>Et(()=>at.panelGroups[e].accordion),setGroupAccordionStatus:(e,t)=>{at.panelGroups[e]={...at.panelGroups[e],accordion:t}},panelExpanded:(e,t)=>Et(()=>at.panelGroups[e]?.panelExpandStatus?.[t]||!1),setPanelExpandedStatus:(e,t,n)=>{at.panelGroups[e]={...at.panelGroups[e],panelExpandStatus:{...at.panelGroups[e]?.panelExpandStatus||{},[t]:n}}},togglePanelExpandedStatus:(e,t)=>{at.panelGroups[e].accordion&&(at.panelGroups[e].panelExpandStatus[t]||Object.keys(at.panelGroups[e].panelExpandStatus).forEach(n=>{at.panelGroups[e].panelExpandStatus[n]=!1})),at.panelGroups[e].panelExpandStatus[t]=!at.panelGroups[e].panelExpandStatus[t]}}),Sn=e=>e>255?255:e<0?0:e,Se=(e,t)=>{const n=e.replace("#",""),o=parseInt(n,16),r=Sn((o>>16)+t),i=Sn((o>>8&255)+t);return"#"+(Sn((255&o)+t)|i<<8|r<<16).toString(16)};var Ce=Ft({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(e){const t=dt(`group-${he()}`),{setGroupAccordionStatus:n}=Qo(),o={"--base-color":e.baseColor,"--border-color":Se(e.baseColor,180),"--bg-color-header":Se(e.baseColor,140),"--bg-color-header-hover":Se(e.baseColor,190),"--bg-color-header-active":Se(e.baseColor,200),"--bg-color-body":"#fff"};return n(t.value,e.accordion),{idGroup:t,cssColorVars:o}}});const Ma=["data-id-group"];Ce.render=function(e,t,n,o,r,i){return G(),rt("div",{"data-id-group":e.idGroup,style:It(e.cssColorVars),class:"vcpg"},[tt(e.$slots,"default")],12,Ma)},Ce.__scopeId="data-v-23ab5317",Ce.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Ee=Ft({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(e,t){const n=`panel-${he()}`,o=dt(),r=dt(),i=dt(),{panelExpanded:s,togglePanelExpandedStatus:c,setPanelExpandedStatus:d}=Qo(),m=Et(()=>({hasContent:t.slots.content&&t.slots.content()[0].children.length>0,dataKey:he()})),S=Et(()=>o.value?.parentElement?.getAttribute("data-id-group")||""),C=Et(()=>s(S.value,n).value&&m.value.hasContent);return Xe(()=>{d(S.value,n,e.expanded)}),pi(()=>{(async()=>(await Ve(),r.value&&i.value&&(r.value.style.height=`${Math.min(i.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:m,panelRef:o,bodyRef:r,bodyContentRef:i,isExpanded:C,collapse:D=>{D.style.height="0"},expand:D=>{D.style.height=`${D.scrollHeight}px`},toggle:()=>{m.value.hasContent&&c(S.value,n)},toggleIcon:`
12
+ `,pt(n+o+"export default iconlist;","IconifyList.ts"))}function Gs(t,e){const n=Oo(t);yo(n,e),N.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}function Xs(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d]/g,""),e=e.replace(/^0/g,""),e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e}function Vs(t){let e=kn(t);return e=e.replace(/^[1-9]\d\d{1,3}$/,"100"),e=e.replace(/^100\.$/,"100"),e}function kn(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[^\d.]/g,""),e=e.replace(/^0{2}$/g,"0"),e=e.replace(/^\./g,""),e=e.replace(".","$#$").replace(/\./g,"").replace("$#$","."),e=e.replace(/^(\-)*(\d+)\.(\d\d).*$/,"$1$2.$3"),e}function Ks(t){let e=t.replace(/(^\s*)|(\s*$)/g,"");return e=e.replace(/[\.]*/g,""),e=e.replace(/(^0[\d]*)$/g,"0"),e=e.replace(/^0\d$/g,"0"),e=e.replace(/[^\d]/g,""),e}function Js(t){let e=t.replace(/[\u4e00-\u9fa5\s]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function Ys(t){let e=t.replace(/[a-zA-Z]+/g,"");return e=e.replace(/(^\s*)|(\s*$)/g,""),e}function Zs(t){return t.replace(/(^\s*)|(\s*$)/g,"")}function Qs(t){let e=kn(t);return e=e.toString().split("."),e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e=e.join("."),e}function ea(t,e="",n="red"){return e.replace(new RegExp(t,"gi"),`<span style='color: ${n}'>${t}</span>`)}function ta(t,e="\u4EDF\u4F70\u62FE\u4EBF\u4EDF\u4F70\u62FE\u4E07\u4EDF\u4F70\u62FE\u5143\u89D2\u5206",n=""){let o=(t+="00").indexOf(".");o>=0&&(t=t.substring(0,o)+t.substr(o+1,2)),e=e.substr(e.length-t.length);for(let r=0;r<t.length;r++)n+="\u96F6\u58F9\u8D30\u53C1\u8086\u4F0D\u9646\u67D2\u634C\u7396".substr(t.substr(r,1),1)+e.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 na(t){return!!/^((12[0-9])|(13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0|1,5-9]))\d{8}$/.test(t)}function oa(t){return!!/\d{3}-\d{8}|\d{4}-\d{7}/.test(t)}function ra(t){return!!/^[a-zA-Z][a-zA-Z0-9_]{4,15}$/.test(t)}function ia(t){return!!/^[a-zA-Z]\w{5,15}$/.test(t)}function sa(t){return!!/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)}function aa(t){let e="";return/^(?:\d+|[a-zA-Z]+|[!@#$%^&\.*]+){6,16}$/.test(t)&&(e="\u5F31"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u4E2D"),/^(?![a-zA-z]+$)(?!\d+$)(?![!@#$%^&\.*]+$)(?![a-zA-z\d]+$)(?![a-zA-z!@#$%^&\.*]+$)(?![\d!@#$%^&\.*]+$)[a-zA-Z\d!@#$%^&\.*]{6,16}$/.test(t)&&(e="\u5F3A"),e}function ca(t){return!!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(t)}function la(t){return!!/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t)}function ha(t){return!!/^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/.test(t)}function ua(t){return!!/^[\u4e00-\u9fa5]{1,6}(·[\u4e00-\u9fa5]{1,6}){0,2}$/.test(t)}function da(t){return!!/^[1-9][0-9]{5}$/.test(t)}function fa(t){return!!/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(t)}function pa(t){return!!/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/.test(t)}let Fo=!0;try{String.fromCharCode.apply(String,[1,2])}catch{Fo=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var xn=2654435769;function qo(t,e){var n=t.length,o=n<<2;if(e){var r=t[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]=t[s>>2]>>((3&s)<<3);return i}function vt(t,e){var n,o=t.length,r=o>>2;3&o&&++r,e?(n=new Uint32Array(r+1))[r]=o:n=new Uint32Array(r);for(var i=0;i<o;++i)n[i>>2]|=t[i]<<((3&i)<<3);return n}function Ne(t){return 4294967295&t}function yt(t,e,n,o,r,i){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(i[3&o^r]^n)}function Go(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function wt(t){for(var e=t.length,n=new Uint8Array(3*e),o=0,r=0;r<e;r++){var i=t.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<e){var s=t.charCodeAt(r+1);if(i<56320&&56320<=s&&s<=57343){var c=65536+((1023&i)<<10|1023&s);n[o++]=240|c>>18,n[o++]=128|c>>12&63,n[o++]=128|c>>6&63,n[o++]=128|63&c,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 Xo(t){var e=t.length;return e===0?"":e<32767?function(n,o){for(var r=new Array(o),i=0,s=0,c=n.length;i<o&&s<c;i++){var f=n[s++];switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[i]=f;break;case 12:case 13:if(!(s<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(31&f)<<6|63&n[s++];break;case 14:if(!(s+1<c))throw new Error("Unfinished UTF-8 octet sequence");r[i]=(15&f)<<12|(63&n[s++])<<6|63&n[s++];break;case 15:if(!(s+2<c))throw new Error("Unfinished UTF-8 octet sequence");var m=((7&f)<<18|(63&n[s++])<<12|(63&n[s++])<<6|63&n[s++])-65536;if(!(0<=m&&m<=1048575))throw new Error("Character outside valid Unicode range: 0x"+m.toString(16));r[i++]=m>>10&1023|55296,r[i]=1023&m|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+f.toString(16))}}return i<o&&(r.length=i),String.fromCharCode.apply(String,r)}(t,e):function(n,o){for(var r=[],i=new Array(32768),s=0,c=0,f=n.length;s<o&&c<f;s++){var m=n[c++];switch(m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:i[s]=m;break;case 12:case 13:if(!(c<f))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(31&m)<<6|63&n[c++];break;case 14:if(!(c+1<f))throw new Error("Unfinished UTF-8 octet sequence");i[s]=(15&m)<<12|(63&n[c++])<<6|63&n[c++];break;case 15:if(!(c+2<f))throw new Error("Unfinished UTF-8 octet sequence");var S=((7&m)<<18|(63&n[c++])<<12|(63&n[c++])<<6|63&n[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"+m.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("")}(t,e)}function ga(t){var e=t.length;if(e===0)return"";var n=Fo?t:function(c){for(var f=c.length,m=new Array(c.length),S=0;S<f;++S)m[S]=c[S];return m}(t);if(e<65535)return String.fromCharCode.apply(String,n);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,n.subarray(s<<15,s+1<<15));return o&&(i[r]=String.fromCharCode.apply(String,n.subarray(r<<15,e))),i.join("")}function Vo(t,e){return typeof t=="string"&&(t=wt(t)),typeof e=="string"&&(e=wt(e)),t==null||t.length===0?t:qo(function(n,o){var r,i,s,c,f,m,S=n.length,E=S-1;for(i=n[E],s=0,m=0|Math.floor(6+52/S);m>0;--m){for(c=(s=Ne(s+xn))>>>2&3,f=0;f<E;++f)r=n[f+1],i=n[f]=Ne(n[f]+yt(s,r,i,f,c,o));r=n[0],i=n[E]=Ne(n[E]+yt(s,r,i,E,c,o))}return n}(vt(t,!0),vt(Go(e),!1)),!1)}function Ko(t,e){return typeof t=="string"&&(t=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}(t)),typeof e=="string"&&(e=wt(e)),t==null||t.length===0?t:qo(function(n,o){var r,i,s,c,f,m=n.length,S=m-1;for(r=n[0],s=Ne(Math.floor(6+52/m)*xn);s!==0;s=Ne(s-xn)){for(c=s>>>2&3,f=S;f>0;--f)i=n[f-1],r=n[f]=Ne(n[f]-yt(s,r,i,f,c,o));i=n[S],r=n[0]=Ne(n[0]-yt(s,r,i,0,c,o))}return n}(vt(t,!1),vt(Go(e),!1)),!0)}const Je={toBytes:wt,toString:Xo,encrypt:Vo,encryptToString:function(t,e){return window.btoa(ga(Vo(t,e)))},decrypt:Ko,decryptToString:function(t,e){return Xo(Ko(t,e))}},Jo=t=>{const e="1.23452384164.123412416";document.getElementById(e)!==null&&document.body.removeChild(document.getElementById(e));const n=document.createElement("canvas");n.width=200,n.height=130;const 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(t,n.width/10,n.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(${n.toDataURL("image/png")}) left top repeat`,document.body.appendChild(r),e},ma={set:t=>{let e=Jo(t);document.getElementById(e)===null&&(e=Jo(t))},del:()=>{let t="1.23452384164.123412416";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t))}};class Be extends Error{constructor(e,n){const o=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=o}}class In extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class me extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class va extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=o}}class ya extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=o}}class wa extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=o}}class Yo extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class ba extends Error{constructor(e,n){const o=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=o}}class Zo{constructor(e,n,o){this.statusCode=e,this.statusText=n,this.content=o}}class bt{get(e,n){return this.send({...n,method:"GET",url:e})}post(e,n){return this.send({...n,method:"POST",url:e})}delete(e,n){return this.send({...n,method:"DELETE",url:e})}getCookieString(e){return""}}var k;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(k||(k={}));class Ye{constructor(){}log(e,n){}}Ye.instance=new Ye;class K{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,o){if(!(e in n))throw new Error(`Unknown ${o} value: ${e}.`)}}class V{static get isBrowser(){return!V.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!V.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!V.isNode&&typeof window=="object"&&window.document===void 0}static get isNode(){return typeof process<"u"&&process.release&&process.release.name==="node"}}function Ze(t,e){let n="";return Ue(t)?(n=`Binary data of length ${t.byteLength}`,e&&(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)}(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ue(t){return t&&typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}async function Qo(t,e,n,o,r,i){const s={},[c,f]=Fe();s[c]=f,t.log(k.Trace,`(${e} transport) sending data. ${Ze(r,i.logMessageContent)}.`);const m=Ue(r)?"arraybuffer":"text",S=await n.post(o,{content:r,headers:{...s,...i.headers},responseType:m,timeout:i.timeout,withCredentials:i.withCredentials});t.log(k.Trace,`(${e} transport) request complete. Response status: ${S.statusCode}.`)}class _a{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class _t{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const o=`[${new Date().toISOString()}] ${k[e]}: ${n}`;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 t="X-SignalR-User-Agent";return V.isNode&&(t="User-Agent"),[t,Sa("8.0.0",Ca(),ka(),Ea())]}function Sa(t,e,n,o){let r="Microsoft SignalR/";const i=t.split(".");return r+=`${i[0]}.${i[1]}`,r+=` (${t}; `,r+=e&&e!==""?`${e}; `:"Unknown OS; ",r+=`${n}`,r+=o?`; ${o}`:"; Unknown Runtime Version",r+=")",r}function Ca(){if(!V.isNode)return"";switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}}function Ea(){if(V.isNode)return process.versions.node}function ka(){return V.isNode?"NodeJS":"Browser"}function er(t){return t.stack?t.stack:t.message?t.message:`${t}`}class xa extends bt{constructor(e){super(),this._logger=e;const n={_fetchType:void 0,_jar:void 0};var o;o=n,(typeof fetch>"u"||V.isNode)&&(o._jar=new(require("tough-cookie")).CookieJar,typeof fetch>"u"?o._fetchType=require("node-fetch"):o._fetchType=fetch,o._fetchType=require("fetch-cookie")(o._fetchType,o._jar),1)?(this._fetchType=n._fetchType,this._jar=n._jar):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")}()),this._abortControllerType=AbortController;const r={_abortControllerType:this._abortControllerType};(function(i){return typeof AbortController>"u"&&(i._abortControllerType=require("abort-controller"),!0)})(r)&&(this._abortControllerType=r._abortControllerType)}async send(e){if(e.abortSignal&&e.abortSignal.aborted)throw new me;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let o;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),o=new me});let r,i=null;if(e.timeout){const f=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(k.Warning,"Timeout from HTTP request."),o=new In},f)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ue(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:n.signal})}catch(f){throw o||(this._logger.log(k.Warning,`Error from HTTP request. ${f}.`),f)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!r.ok){const f=await tr(r,"text");throw new Be(f||r.statusText,r.status)}const s=tr(r,e.responseType),c=await s;return new Zo(r.status,r.statusText,c)}getCookieString(e){let n="";return V.isNode&&this._jar&&this._jar.getCookies(e,(o,r)=>n=r.join("; ")),n}}function tr(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":default:n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`)}return n}class Ia extends bt{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new me):e.method?e.url?new Promise((n,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&&(Ue(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 me)}),e.timeout&&(r.timeout=e.timeout),r.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),r.status>=200&&r.status<300?n(new Zo(r.status,r.statusText,r.response||r.responseText)):o(new Be(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 Be(r.statusText,r.status))},r.ontimeout=()=>{this._logger.log(k.Warning,"Timeout from HTTP request."),o(new In)},r.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Ta extends bt{constructor(e){if(super(),typeof fetch<"u"||V.isNode)this._httpClient=new xa(e);else{if(typeof XMLHttpRequest>"u")throw new Error("No usable HttpClient found.");this._httpClient=new Ia(e)}}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new me):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 n=e.split(pe.RecordSeparator);return n.pop(),n}}pe.RecordSeparatorCode=30,pe.RecordSeparator=String.fromCharCode(pe.RecordSeparatorCode);class Ra{writeHandshakeRequest(e){return pe.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,o;if(Ue(e)){const s=new Uint8Array(e),c=s.indexOf(pe.RecordSeparatorCode);if(c===-1)throw new Error("Message is incomplete.");const f=c+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(s.slice(0,f))),o=s.byteLength>f?s.slice(f).buffer:null}else{const s=e,c=s.indexOf(pe.RecordSeparator);if(c===-1)throw new Error("Message is incomplete.");const f=c+1;n=s.substring(0,f),o=s.length>f?s.substring(f):null}const r=pe.parse(n),i=JSON.parse(r[0]);if(i.type)throw new Error("Expected a handshake response from the server.");return[o,i]}}var j;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(j||(j={}));class Pa{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new _a(this,e)}}class za{constructor(e,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=e,this._connection=n,this._bufferSize=o}async _send(e){const n=this._protocol.writeMessage(e);let o=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let r=()=>{},i=()=>{};Ue(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(o=new Promise((s,c)=>{r=s,i=c})),this._messages.push(new Ma(n,this._totalMessageCount,r,i))}try{this._reconnectInProgress||await this._connection.send(n)}catch{this._disconnected()}await o}_ack(e){let n=-1;for(let o=0;o<this._messages.length;o++){const r=this._messages[o];if(r._id<=e.sequenceId)n=o,Ue(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(e){if(this._waitForSequenceMessage)return e.type===j.Sequence&&(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){e.sequenceId>this._nextReceivingSequenceId?this._connection.stop(new Error("Sequence ID greater than amount of messages we've received.")):this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}async _resend(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;await this._connection.send(this._protocol.writeMessage({type:j.Sequence,sequenceId:e}));const n=this._messages;for(const o of n)await this._connection.send(o._message);this._reconnectInProgress=!1}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case j.Invocation:case j.StreamItem:case j.Completion:case j.StreamInvocation:case j.CancelInvocation:return!0;case j.Close:case j.Sequence:case j.Ping:case j.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(async()=>{try{this._reconnectInProgress||await this._connection.send(this._protocol.writeMessage({type:j.Ack,sequenceId:this._latestReceivedSequenceId}))}catch{}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0},1e3))}}class Ma{constructor(e,n,o,r){this._message=e,this._id=n,this._resolver=o,this._rejector=r}}var X;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(X||(X={}));class Hn{static create(e,n,o,r,i,s,c){return new Hn(e,n,o,r,i,s,c)}constructor(e,n,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")},K.isRequired(e,"connection"),K.isRequired(n,"logger"),K.isRequired(o,"protocol"),this.serverTimeoutInMilliseconds=i??3e4,this.keepAliveIntervalInMilliseconds=s??15e3,this._statefulReconnectBufferSize=c??1e5,this._logger=n,this._protocol=o,this.connection=e,this._reconnectPolicy=r,this._handshakeProtocol=new Ra,this.connection.onreceive=f=>this._processIncomingData(f),this.connection.onclose=f=>this._connectionClosed(f),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=X.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:j.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==X.Disconnected&&this._connectionState!==X.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!==X.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=X.Connecting,this._logger.log(k.Debug,"Starting HubConnection.");try{await this._startInternal(),V.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=X.Connected,this._connectionStarted=!0,this._logger.log(k.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=X.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((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(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 za(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(k.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),await this.connection.stop(n),n}}async stop(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),await this._stopPromise;try{await e}catch{}}_stopInternal(e){if(this._connectionState===X.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===X.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 n=this._connectionState;return this._connectionState=X.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()):(n===X.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new me("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}async _sendCloseMessage(){try{await this._sendWithProtocol(this._createCloseMessage())}catch{}}stream(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createStreamInvocation(e,n,r);let s;const c=new Pa;return c.cancelCallback=()=>{const f=this._createCancelInvocation(i.invocationId);return delete this._callbacks[i.invocationId],s.then(()=>this._sendWithProtocol(f))},this._callbacks[i.invocationId]=(f,m)=>{m?c.error(m):f&&(f.type===j.Completion?f.error?c.error(new Error(f.error)):c.complete():c.next(f.item))},s=this._sendWithProtocol(i).catch(f=>{c.error(f),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,...n){const[o,r]=this._replaceStreamingParams(n),i=this._sendWithProtocol(this._createInvocation(e,n,!0,r));return this._launchStreams(o,i),i}invoke(e,...n){const[o,r]=this._replaceStreamingParams(n),i=this._createInvocation(e,n,!1,r);return new Promise((c,f)=>{this._callbacks[i.invocationId]=(S,E)=>{E?f(E):S&&(S.type===j.Completion?S.error?f(new Error(S.error)):c(S.result):f(new Error(`Unexpected message type: ${S.type}`)))};const m=this._sendWithProtocol(i).catch(S=>{f(S),delete this._callbacks[i.invocationId]});this._launchStreams(o,m)})}on(e,n){e&&n&&(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const o=this._methods[e];if(o)if(n){const r=o.indexOf(n);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 n=this._protocol.parseMessages(e,this._logger);for(const o of n)if(!this._messageBuffer||this._messageBuffer._shouldProcessMessage(o))switch(o.type){case j.Invocation:this._invokeClientMethod(o);break;case j.StreamItem:case j.Completion:{const r=this._callbacks[o.invocationId];if(r){o.type===j.Completion&&delete this._callbacks[o.invocationId];try{r(o)}catch(i){this._logger.log(k.Error,`Stream callback threw error: ${er(i)}`)}}break}case j.Ping:break;case j.Close:{this._logger.log(k.Information,"Close message received from server.");const r=o.error?new Error("Server returned an error on close: "+o.error):void 0;o.allowReconnect===!0?this.connection.stop(r):this._stopPromise=this._stopInternal(r);break}case j.Ack:this._messageBuffer&&this._messageBuffer._ack(o);break;case j.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(o);break;default:this._logger.log(k.Warning,`Invalid message type: ${o.type}.`)}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,o;try{[o,n]=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(n.error){const r="Server returned handshake error: "+n.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===X.Connected)try{await this._sendMessage(this._cachedPingMessage)}catch{this._cleanupPingTimer()}},e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}async _invokeClientMethod(e){const n=e.target.toLowerCase(),o=this._methods[n];if(!o)return this._logger.log(k.Warning,`No client method with the name '${n}' found.`),void(e.invocationId&&(this._logger.log(k.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),await this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null))));const r=o.slice(),i=!!e.invocationId;let s,c,f;for(const m of r)try{const S=s;s=await m.apply(this,e.arguments),i&&s&&S&&(this._logger.log(k.Error,`Multiple results provided for '${n}'. Sending error to server.`),f=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 '${n}' threw error '${S}'.`)}f?await this._sendWithProtocol(f):i?(c?f=this._createCompletionMessage(e.invocationId,`${c}`,null):s!==void 0?f=this._createCompletionMessage(e.invocationId,null,s):(this._logger.log(k.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),f=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),await this._sendWithProtocol(f)):s&&this._logger.log(k.Error,`Result given for '${n}' 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 me("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===X.Disconnecting?this._completeClose(e):this._connectionState===X.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===X.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=X.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e??new Error("Connection closed.")),this._messageBuffer=void 0),V.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(k.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}async _reconnect(e){const n=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=X.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!==X.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!==X.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=X.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!==X.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===X.Disconnecting&&this._completeClose());r=s instanceof Error?s:new Error(s.toString()),i=this._getNextRetryDelay(o++,Date.now()-n,r)}}this._logger.log(k.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${o} failed attempts. Connection disconnecting.`),this._completeClose()}_getNextRetryDelay(e,n,o){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:o})}catch(r){return this._logger.log(k.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${r}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(o=>{const r=n[o];try{r(null,e)}catch(i){this._logger.log(k.Error,`Stream 'error' callback called with '${e}' threw error: ${er(i)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,o,r){if(o)return r.length!==0?{arguments:n,streamIds:r,target:e,type:j.Invocation}:{arguments:n,target:e,type:j.Invocation};{const i=this._invocationId;return this._invocationId++,r.length!==0?{arguments:n,invocationId:i.toString(),streamIds:r,target:e,type:j.Invocation}:{arguments:n,invocationId:i.toString(),target:e,type:j.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const o in e)e[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(e){const n=[],o=[];for(let r=0;r<e.length;r++){const i=e[r];if(this._isObservable(i)){const s=this._invocationId;this._invocationId++,n[s]=i,o.push(s.toString()),e.splice(r,1)}}return[n,o]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,o){const r=this._invocationId;return this._invocationId++,o.length!==0?{arguments:n,invocationId:r.toString(),streamIds:o,target:e,type:j.StreamInvocation}:{arguments:n,invocationId:r.toString(),target:e,type:j.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:j.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:j.StreamItem}}_createCompletionMessage(e,n,o){return n?{error:n,invocationId:e,type:j.Completion}:{invocationId:e,result:o,type:j.Completion}}_createCloseMessage(){return{type:j.Close}}}const $a=[0,2e3,1e4,3e4,null];class nr{constructor(e){this._retryDelays=e!==void 0?[...e,null]:$a}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class je{}je.Authorization="Authorization",je.Cookie="Cookie";class Aa extends bt{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}async send(e){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=await this._accessTokenFactory()),this._setAuthorizationHeader(e);const o=await this._innerClient.send(e);return n&&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[je.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[je.Authorization]&&delete e.headers[je.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var Y,ne;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(Y||(Y={})),function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"}(ne||(ne={}));class Da{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 or{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,o){this._httpClient=e,this._logger=n,this._pollAbort=new Da,this._options=o,this._running=!1,this.onreceive=null,this.onclose=null}async connect(e,n){if(K.isRequired(e,"url"),K.isRequired(n,"transferFormat"),K.isIn(n,ne,"transferFormat"),this._url=e,this._logger.log(k.Trace,"(LongPolling transport) Connecting."),n===ne.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};n===ne.Binary&&(s.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(k.Trace,`(LongPolling transport) polling: ${c}.`);const f=await this._httpClient.get(c,s);f.statusCode!==200?(this._logger.log(k.Error,`(LongPolling transport) Unexpected response code: ${f.statusCode}.`),this._closeError=new Be(f.statusText||"",f.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,s)}async _poll(e,n){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,n);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 Be(r.statusText||"",r.statusCode),this._running=!1):r.content?(this._logger.log(k.Trace,`(LongPolling transport) data received. ${Ze(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 In?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?Qo(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={},[n,o]=Fe();e[n]=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 Be&&(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 La{constructor(e,n,o,r){this._httpClient=e,this._accessToken=n,this._logger=o,this._options=r,this.onreceive=null,this.onclose=null}async connect(e,n){return K.isRequired(e,"url"),K.isRequired(n,"transferFormat"),K.isIn(n,ne,"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(n===ne.Text){if(V.isBrowser||V.isWebWorker)i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),f={};f.Cookie=c;const[m,S]=Fe();f[m]=S,i=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:{...f,...this._options.headers}})}try{i.onmessage=c=>{if(this.onreceive)try{this._logger.log(k.Trace,`(SSE transport) data received. ${Ze(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(f){return void this._close(f)}},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?Qo(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 Na{constructor(e,n,o,r,i,s){this._logger=o,this._accessTokenFactory=n,this._logMessageContent=r,this._webSocketConstructor=i,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=s}async connect(e,n){let o;return K.isRequired(e,"url"),K.isRequired(n,"transferFormat"),K.isIn(n,ne,"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 f=!1;if(V.isNode||V.isReactNative){const m={},[S,E]=Fe();m[S]=E,o&&(m[je.Authorization]=`Bearer ${o}`),c&&(m[je.Cookie]=c),s=new this._webSocketConstructor(e,void 0,{headers:{...m,...this._headers}})}else o&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(o)}`);s||(s=new this._webSocketConstructor(e)),n===ne.Binary&&(s.binaryType="arraybuffer"),s.onopen=m=>{this._logger.log(k.Information,`WebSocket connected to ${e}.`),this._webSocket=s,f=!0,r()},s.onerror=m=>{let S=null;S=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.error:"There was an error with the transport",this._logger.log(k.Information,`(WebSockets transport) ${S}.`)},s.onmessage=m=>{if(this._logger.log(k.Trace,`(WebSockets transport) data received. ${Ze(m.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(m.data)}catch(S){return void this._close(S)}},s.onclose=m=>{if(f)this._close(m);else{let S=null;S=typeof ErrorEvent<"u"&&m instanceof ErrorEvent?m.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. ${Ze(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 Ba{constructor(e,n={}){var o;if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,K.isRequired(e,"url"),this._logger=(o=n.logger)===void 0?new _t(k.Information):o===null?Ye.instance:o.log!==void 0?o:new _t(o),this.baseUrl=this._resolveUrl(e),(n=n||{}).logMessageContent=n.logMessageContent!==void 0&&n.logMessageContent,typeof n.withCredentials!="boolean"&&n.withCredentials!==void 0)throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.withCredentials=n.withCredentials===void 0||n.withCredentials,n.timeout=n.timeout===void 0?1e5:n.timeout;let r=null,i=null;V.isNode&&typeof require<"u"&&(r=require("ws"),i=require("eventsource")),V.isNode||typeof WebSocket>"u"||n.WebSocket?V.isNode&&!n.WebSocket&&r&&(n.WebSocket=r):n.WebSocket=WebSocket,V.isNode||typeof EventSource>"u"||n.EventSource?V.isNode&&!n.EventSource&&i!==void 0&&(n.EventSource=i):n.EventSource=EventSource,this._httpClient=new Aa(n.httpClient||new Ta(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}async start(e){if(e=e||ne.Binary,K.isIn(e,ne,"transferFormat"),this._logger.log(k.Debug,`Starting connection with transfer format '${ne[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),await this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(k.Error,n),await this._stopPromise,Promise.reject(new me(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(k.Error,n),Promise.reject(new me(n))}this._connectionStarted=!0}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new Fn(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(n=>{this._stopPromiseResolver=n}),await this._stopInternal(e),void await this._stopPromise)}async _stopInternal(e){this._stopError=e;try{await this._startInternalPromise}catch{}if(this.transport){try{await this.transport.stop()}catch(n){this._logger.log(k.Error,`HttpConnection.transport.stop() threw error '${n}'.`),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 n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation){if(this._options.transport!==Y.WebSockets)throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");this.transport=this._constructTransport(Y.WebSockets),await this._startTransport(n,e)}else{let o=null,r=0;do{if(o=await this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new me("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,e)}this.transport instanceof or&&(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 n={},[o,r]=Fe();n[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:{...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 c=JSON.parse(s.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Yo("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 Be&&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 Yo(c))}}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}async _createTransport(e,n,o,r){let i=this._createConnectUrl(e,o.connectionToken);if(this._isITransport(n))return this._logger.log(k.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=[],c=o.availableTransports||[];let f=o;for(const m of c){const S=this._resolveTransportOrError(m,n,r,f?.useStatefulReconnect===!0);if(S instanceof Error)s.push(`${m.transport} failed:`),s.push(S);else if(this._isITransport(S)){if(this.transport=S,!f){try{f=await this._getNegotiationResponse(e)}catch(E){return Promise.reject(E)}i=this._createConnectUrl(e,f.connectionToken)}try{return await this._startTransport(i,r),void(this.connectionId=f.connectionId)}catch(E){if(this._logger.log(k.Error,`Failed to start the transport '${m.transport}': ${E}`),f=void 0,s.push(new wa(`${m.transport} failed: ${E}`,Y[m.transport])),this._connectionState!=="Connecting"){const M="Failed to select transport before stop() was called.";return this._logger.log(k.Debug,M),Promise.reject(new me(M))}}}}return s.length>0?Promise.reject(new ba(`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 Y.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Na(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case Y.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new La(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case Y.LongPolling:return new or(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=async o=>{let r=!1;if(this.features.reconnect){try{this.features.disconnected(),await this.transport.connect(e,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(e,n)}_resolveTransportOrError(e,n,o,r){const i=Y[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}(n,i))return this._logger.log(k.Debug,`Skipping transport '${Y[i]}' because it was disabled by the client.`),new ya(`'${Y[i]}' is disabled by the client.`,i);{if(!(e.transferFormats.map(c=>ne[c]).indexOf(o)>=0))return this._logger.log(k.Debug,`Skipping transport '${Y[i]}' because it does not support the requested transfer format '${ne[o]}'.`),new Error(`'${Y[i]}' does not support ${ne[o]}.`);if(i===Y.WebSockets&&!this._options.WebSocket||i===Y.ServerSentEvents&&!this._options.EventSource)return this._logger.log(k.Debug,`Skipping transport '${Y[i]}' because it is not supported in your environment.'`),new va(`'${Y[i]}' is not supported in your environment.`,i);this._logger.log(k.Debug,`Selecting transport '${Y[i]}'.`);try{return this.features.reconnect=i===Y.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(n=>{this._logger.log(k.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(k.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}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(!V.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(k.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const 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 Fn{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new St,this._transportResult=new St,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new St),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 St;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):Fn._concatBuffers(this._buffer);this._buffer.length=0;try{await this._transport.send(n),e.resolve()}catch(o){e.reject(o)}}}static _concatBuffers(e){const n=e.map(i=>i.byteLength).reduce((i,s)=>i+s),o=new Uint8Array(n);let r=0;for(const i of e)o.set(new Uint8Array(i),r),r+=i.byteLength;return o.buffer}}class St{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}class Ua{constructor(){this.name="json",this.version=2,this.transferFormat=ne.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ye.instance);const o=pe.parse(e),r=[];for(const i of o){const s=JSON.parse(i);if(typeof s.type!="number")throw new Error("Invalid payload.");switch(s.type){case j.Invocation:this._isInvocationMessage(s);break;case j.StreamItem:this._isStreamItemMessage(s);break;case j.Completion:this._isCompletionMessage(s);break;case j.Ping:case j.Close:break;case j.Ack:this._isAckMessage(s);break;case j.Sequence:this._isSequenceMessage(s);break;default:n.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,n){if(typeof e!="string"||e==="")throw new Error(n)}}const ja={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 Oa{configureLogging(e){if(K.isRequired(e,"logging"),e.log!==void 0)this.logger=e;else if(typeof e=="string"){const n=function(o){const r=ja[o.toLowerCase()];if(r!==void 0)return r;throw new Error(`Unknown log level: ${o}`)}(e);this.logger=new _t(n)}else this.logger=new _t(e);return this}withUrl(e,n){return K.isRequired(e,"url"),K.isNotEmpty(e,"url"),this.url=e,this.httpConnectionOptions=typeof n=="object"?{...this.httpConnectionOptions,...n}:{...this.httpConnectionOptions,transport:n},this}withHubProtocol(e){return K.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 nr(e):this.reconnectPolicy=e:this.reconnectPolicy=new nr,this}withServerTimeout(e){return K.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return K.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e?.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new Ba(this.url,e);return Hn.create(n,this.logger||Ye.instance,this.protocol||new Ua,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}let Ct;function Wa(t){if(!t){if(Ct)return Ct;throw new Error("\u9996\u6B21\u6784\u5EFA\uFF0CsignalrURL\u53C2\u6570\u4E0D\u80FD\u4E3A\u7A7A\uFF01")}const e=new Oa().configureLogging(k.Information).withUrl(t).withAutomaticReconnect({nextRetryDelayInMilliseconds:()=>5e3}).build();return e.keepAliveIntervalInMilliseconds=15e3,e.serverTimeoutInMilliseconds=18e5,e.start().then(()=>{N.Logger().info("\u542F\u52A8SignalR\u8FDE\u63A5\uFF01")}),e.onclose(async()=>{N.Logger().info("\u65AD\u5F00SignalR\u8FDE\u63A5!")}),e.onreconnecting(()=>{N.Logger().warn("SignalR\u670D\u52A1\u5DF2\u65AD\u7EBF\uFF0C\u91CD\u8FDE\u4E2D...\uFF01")}),e.onreconnected(()=>{N.Logger().warn("SignalR\u91CD\u8FDE\u6210\u529F!")}),Ct||(Ct=e),e}const ce=fo({panelGroups:{}}),rr=()=>({useGroupAccordion:t=>Ee(()=>ce.panelGroups[t].accordion),setGroupAccordionStatus:(t,e)=>{ce.panelGroups[t]={...ce.panelGroups[t],accordion:e}},panelExpanded:(t,e)=>Ee(()=>ce.panelGroups[t]?.panelExpandStatus?.[e]||!1),setPanelExpandedStatus:(t,e,n)=>{ce.panelGroups[t]={...ce.panelGroups[t],panelExpandStatus:{...ce.panelGroups[t]?.panelExpandStatus||{},[e]:n}}},togglePanelExpandedStatus:(t,e)=>{ce.panelGroups[t].accordion&&(ce.panelGroups[t].panelExpandStatus[e]||Object.keys(ce.panelGroups[t].panelExpandStatus).forEach(n=>{ce.panelGroups[t].panelExpandStatus[n]=!1})),ce.panelGroups[t].panelExpandStatus[e]=!ce.panelGroups[t].panelExpandStatus[e]}}),Tn=t=>t>255?255:t<0?0:t,Et=(t,e)=>{const n=t.replace("#",""),o=parseInt(n,16),r=Tn((o>>16)+e),i=Tn((o>>8&255)+e);return"#"+(Tn((255&o)+e)|i<<8|r<<16).toString(16)};var kt=Pe({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(t){const e=he(`group-${dt()}`),{setGroupAccordionStatus:n}=rr(),o={"--base-color":t.baseColor,"--border-color":Et(t.baseColor,180),"--bg-color-header":Et(t.baseColor,140),"--bg-color-header-hover":Et(t.baseColor,190),"--bg-color-header-active":Et(t.baseColor,200),"--bg-color-body":"#fff"};return n(e.value,t.accordion),{idGroup:e,cssColorVars:o}}});const Ha=["data-id-group"];kt.render=function(t,e,n,o,r,i){return G(),ie("div",{"data-id-group":t.idGroup,style:Re(t.cssColorVars),class:"vcpg"},[J(t.$slots,"default")],12,Ha)},kt.__scopeId="data-v-23ab5317",kt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var xt=Pe({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(t,e){const n=`panel-${dt()}`,o=he(),r=he(),i=he(),{panelExpanded:s,togglePanelExpandedStatus:c,setPanelExpandedStatus:f}=rr(),m=Ee(()=>({hasContent:e.slots.content&&e.slots.content()[0].children.length>0,dataKey:dt()})),S=Ee(()=>o.value?.parentElement?.getAttribute("data-id-group")||""),E=Ee(()=>s(S.value,n).value&&m.value.hasContent);return Jt(()=>{f(S.value,n,t.expanded)}),yi(()=>{(async()=>(await Yt(),r.value&&i.value&&(r.value.style.height=`${Math.min(i.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:m,panelRef:o,bodyRef:r,bodyContentRef:i,isExpanded:E,collapse:M=>{M.style.height="0"},expand:M=>{M.style.height=`${M.scrollHeight}px`},toggle:()=>{m.value.hasContent&&c(S.value,n)},toggleIcon:`
13
13
  <svg
14
14
  width="24px"
15
15
  height="24px"
@@ -19,4 +19,4 @@ import{h as di,openBlock as G,createElementBlock as rt,normalizeStyle as It,rend
19
19
  >
20
20
  <path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
21
21
  </svg>
22
- `}}});const Aa={class:"vcp__header-title"},La={key:0,class:"vcp__header-icon"},Na=["innerHTML"],Ba={key:0,ref:"bodyRef",class:"vcp__body"},Ua={ref:"bodyContentRef",class:"vcp__body-content"};function Cn(e){return window.TouchEvent&&e instanceof TouchEvent}Ee.render=function(e,t,n,o,r,i){return G(),rt("section",{ref:"panelRef",class:fi(["vcp",{"vcp--expanded":e.isExpanded,"vcp--expandable":e.body.hasContent}])},[it("header",{class:"vcp__header",onClick:t[0]||(t[0]=(...s)=>e.toggle&&e.toggle(...s))},[it("div",Aa,[tt(e.$slots,"title")]),e.body.hasContent?(G(),rt("div",La,[tt(e.$slots,"icon",{},()=>[it("span",{innerHTML:e.toggleIcon},null,8,Na)])])):xt("v-if",!0)]),so(ao,{"data-key":e.body.dataKey,name:"slide",onBeforeEnter:e.collapse,onEnter:e.expand,onBeforeLeave:e.expand,onLeave:e.collapse},{default:re(()=>[e.isExpanded?(G(),rt("div",Ba,[it("div",Ua,[tt(e.$slots,"content")],512)],512)):xt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Ee.__scopeId="data-v-08c94cf8",Ee.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class ct{e;constructor(t){this.e=t}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Cn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Cn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Bn(this.clientX,this.clientY)}static bindDown(t,n,o,r=!1){const i=c=>{n(new ct(c))},s=c=>{c.touches.length===1&&n(new ct(c)),c.touches.length>1&&o&&o(new ct(c))};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 ct(s))},i=s=>{s.touches.length===1&&n(new ct(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 ct(s))},i=s=>{s.touches.length===0&&n(new ct(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}){Cn(this.e)?n&&n(this.e):t&&t(this.e)}}class Bn{x;y;constructor(t,n){this.x=t,this.y=n}clone(){return new Bn(this.x,this.y)}}class Oa{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(t,n,o={}){this.handle=t,this.container=n,this.options=o,t&&(this.unbindDown=ct.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=ct.bindMove(document,this.mousemove),this.unbindUp=ct.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 ja{_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),er()}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)),er()}}const xe=new Map;function ke(e){return xe.has(e)||xe.set(e,[]),xe.get(e)}function tr(e,t){return e>t?-tr(t,e):e<0&&t>=0?1:e-t}function er(){let e=0;for(const t of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(xe).sort(tr))for(const n of ke(t))e!=n.zIndex&&(n.zIndex=e,n.onChange(e)),e++}function En(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 Wa{container;options;handles;constructor(t,n){if(this.container=t,this.options=n,t&&n){this.handles=nr.map(d=>new d(t,this));const{width:o,height:r}=En(t),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let c=!1;(o<n.minWidth||o>i)&&(t.style.width=`${or(o,n.minWidth,i)}px`,c=!0),(r<n.minHeight||r>s)&&(t.style.height=`${or(r,n.minHeight,s)}px`,c=!0),c&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(t=>t.teardown())}}const nr=[];class kt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(t,n){this.container=t,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=ct.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=ct.bindMove(document,this.mousemove),this.unbindUp=ct.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,c=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-c,0),this.maxTop=r-i.minHeight,this.minBottom=n+i.minHeight,this.maxBottom=Math.min(n+c,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),c=this.helper.options;c&&(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=`${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=n+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=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 or(e,t,n){return e<t?t:e>n?n:e}nr.push(class extends kt{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 kt{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 kt{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 kt{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 kt{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 kt{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 kt{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 kt{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=Ft({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(e){const t=dt(!1),n=dt(!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=ct.bindUp(document,()=>{n.value=!1,r()})}}}});const Ha=["disabled"];Te.render=function(e,t,n,o,r,i){return G(),rt("div",{class:"btn",style:It(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]=co((...s)=>e.mousedown&&e.mousedown(...s),["stop"])),onTouchstart:t[3]||(t[3]=co((...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},[tt(e.$slots,"default")],44,Ha)},Te.__scopeId="data-v-71662210",Te.__file="src/controls/vuewindow/window/Button.vue";const xn=new Set;function rr(e){return e!==null?parseFloat(e):0}function Re(e){const t=window.getComputedStyle(e),n=Math.ceil([t.paddingLeft,t.width,t.paddingRight].map(rr).reduce((r,i)=>r+i)),o=Math.ceil([t.paddingTop,t.height,t.paddingBottom].map(rr).reduce((r,i)=>r+i));return{width:n,height:o}}class ir{width;height;constructor(t,n){this.width=t,this.height=n}}function Fa(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 qa(e,t,n,o){const r=e-n,i=t-o;return r*r+i*i}window.addEventListener("resize",e=>{xn.forEach(t=>{t&&ie(t.fixPosition)&&t.fixPosition()})});const Pe=[];var ze=Ft({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=gi();if(!n)return;const{proxy:o}=n;let r=0,i,s,c;const d=dt(e.isOpen),m=()=>{Pe.push(o),c=new ja(e.zGroup,S),e.isOpen&&function(I){I&&(Ve(()=>{r++==0&&(f(o),function(){const $=C.value,{width:B,height:j}=En($);let O,F;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,F=e.top;else{const lt=e.positionHint||"auto";switch(lt){case"auto":{let Q=20,ot=50,Y=0;do{if(Pe.every(mt=>{if(!mt.isOpen||o==mt)return!0;const ee=Fa(mt);if(ee==null)return!0;const{left:Ne,top:ft}=ee;return qa(Ne,ft,Q,ot)>16}))break;Q=(Q+40)%(window.innerWidth-200),ot=(ot+40)%(window.innerHeight-200)}while(++Y<100);O=Q,F=ot}break;case"center":O=(window.innerWidth-B)/2,F=(window.innerHeight-j)/2,console.log(O,F,window.innerWidth,window.innerHeight,"111111");break;default:try{const Q=lt.split("/").map(Number);if(Q.length!=2)throw null;const[ot,Y]=Q;if(!isFinite(ot)||!isFinite(Y))throw null;O=ot>=0?ot:window.innerWidth-B+ot,F=Y>=0?Y:window.innerHeight-j+Y}catch{throw new Error(`invalid position string: ${lt}`)}}}$&&($.style.left=`${O}px`,$.style.top=`${F}px`)}()),e.resizable&&p(),M(),i=new Oa(D.value,C.value,{onMove:()=>M(),onMoveStart:()=>t("move-start"),onMoveEnd:()=>t("move-end")}),e.resizable&&function(){const{height:$}=En(D.value);s=new Wa(C.value,{onResize:()=>p(),onResizeStart:()=>t("resize-start"),onResizeEnd:()=>t("resize-end"),minWidth:e.minWidth,minHeight:e.minHeight+$,maxWidth:e.maxWidth,maxHeight:e.maxHeight?e.maxHeight+$:void 0})}()}),e.activateWhenOpen&&R())}(!0),xn.add(o)};function S(I){_.value.zIndex=`${I}`}const C=dt(null),D=dt(null),N=dt(null);function R(){c.raise(),t("activate")}const _=dt({...e.windowStyle.window,zIndex:"auto",overflow:e.overflow}),u=Et(()=>e.windowStyle.titlebar),g=Et(()=>{const I={...e.windowStyle.content};return e.resizable?I.padding="0":e.padding!=null&&(I.padding=`${e.padding}px`),e.isScrollable&&(I.overflow="auto"),I});function f(I){const{width:$,height:B,top:j,left:O}=I,F=C;if(F&&$!=null&&(F.value.style.width=`${$}px`),B!=null){const lt=D.value;if(lt){const Q=Re(lt).height;F.value.style.height=`${B+Q}px`}}F&&O!=null&&(F.value.style.left=`${O}px`),F&&j!=null&&(F.value.style.top=`${j}px`)}function p(I=!0){const $=C.value,B=D.value,j=N.value;if(j&&$&&B){const{width:O,height:F}=Re(j),{width:lt,height:Q}=Re($),ot=Re(B).height,Y=lt-(j.offsetWidth-O),mt=Q-ot-(j.offsetHeight-F);j.style.width=`${Y}px`,j.style.height=`${mt}px`,y(),t("resize",new ir(Y,mt)),I&&(t("update:width",Y),t("update:height",mt))}}function y(){const I=C.value;if(I){const $=I.getBoundingClientRect();$.left<0&&(_.value.left="0px"),$.top<0&&(_.value.top="0px"),$.right>window.innerWidth&&(_.value.left=window.innerWidth-$.width+"px"),$.bottom>window.innerHeight&&(_.value.top=window.innerHeight-$.height+"px")}}function M(I=!0){y();const $=C.value;if($){const{left:B,top:j}=$.getBoundingClientRect();I&&(t("update:left",B),t("update:top",j))}}return qt(()=>e.isOpen,I=>{d.value=I}),qt(()=>e.zGroup,I=>{c.group=I}),qt(()=>e.width,I=>{f({width:I}),p(!1)}),qt(()=>e.height,I=>{f({height:I}),p(!1)}),Xe(()=>{m()}),mi(()=>{xn.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),Pe.splice(Pe.indexOf(o),1)}),{isOpen:d,windowEl:C,titlebar:D,content:N,activate:R,styleWindow:_,styleTitlebar:u,styleContent:g,closeButtonClick:function(){d.value=!1,t("closebuttonclick")},fixPosition:y}}});const Ga={class:"title"};var sr;ze.render=function(e,t,n,o,r,i){const s=lo("myButton");return G(),yt(ao,{name:"fade",onAfterLeave:t[2]||(t[2]=c=>e.$emit("close")),onAfterEnter:t[3]||(t[3]=c=>e.$emit("open")),persisted:""},{default:re(()=>[vi(it("div",{class:"window",style:It(e.styleWindow),ref:"windowEl",onMousedown:t[0]||(t[0]=(...c)=>e.activate&&e.activate(...c)),onTouchstart:t[1]||(t[1]=(...c)=>e.activate&&e.activate(...c))},[it("div",{class:"titlebar",style:It(e.styleTitlebar),ref:"titlebar"},[it("div",Ga,[e.$slots.title?tt(e.$slots,"title",{key:0}):(G(),rt(Tt,{key:1},[ho(yi(e.title),1)],64))]),e.closeButton?(G(),yt(s,{key:0,windowStyle:e.windowStyle,onClick:e.closeButtonClick},{default:re(()=>[ho("\xD7")]),_:1},8,["windowStyle","onClick"])):xt("v-if",!0)],4),it("div",{class:"content",style:It(e.styleContent),ref:"content"},[tt(e.$slots,"default")],4)],36),[[wi,e.isOpen]])]),_:3})},ze.__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"}(sr||(sr={}));const Xa={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)"}},Va={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)"}},Ka={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)"}},Ja={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)"}},Ya=ze;var nt;(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"})(nt||(nt={}));class ar{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;return Pt(t)?n=t:se(t)&&(n=this.widgetConfig.find(o=>o.id===t)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}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().then(n=>{if(n.default){const o=bi(n.default);this.getContainerComponents(t.container).value.set(t.id,o),this.widgetsLoadedSet.add(t.id),Ve().then(()=>{L.EventBus.emit(ht.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:t.id}),this.loadOtherDependenceWidgets(t.id)})}}).catch(n=>{L.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",t),L.EventBus.emit(ht.WidgetLoadedErrorEvent,t)})}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),L.EventBus.emit(ht.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 nt.top:return this.layoutState.topContainer;case nt.bottom:return this.layoutState.bottomContainer;case nt.left:return this.layoutState.leftContainer;case nt.right:return this.layoutState.rightContainer;case nt.centerBack:return this.layoutState.centerBackContainer;case nt.centerMain:return this.layoutState.centerMainContainer;case nt.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=dt(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)})}}var $e=Ft({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"],setup(e,{attrs:t,slots:n,emit:o}){const r=e.layoutID,i=dt(e.enableRouterView);qt(()=>e.enableRouterView,()=>{i.value=e.enableRouterView});const s=io({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),c=new Map,d=new ar(s,e.widgetConfig,r,c),m=_(nt.top),S=_(nt.centerBack),C=_(nt.centerFront),D=_(nt.left),N=_(nt.right),R=_(nt.bottom);function _(g){return d?.getContainerComponents(g)}const u=Et(()=>e.layoutStyle);return Xe(()=>{d&&(d.preloadWidgets(),r===void 0&&(L.LayoutManager=d),o("containerLoaded",{layoutID:r,layoutManager:d}))}),{..._i(s),topContainerComponents:m,centerbackComponents:S,centerfrontComponents:C,leftContainerComponents:D,rightContainerComponents:N,bottomContainerComponents:R,containerStyle:u,isEnableRouterView:i,setItemRef:(g,f)=>{g&&c.set(f,g)}}}});const Za={ref:"topContainer",class:"topContainer"},Qa={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},tc={ref:"centerBackContainer",class:"centerdiv backContainer"},ec={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},nc={ref:"leftContainer",class:"leftContainer"},oc={ref:"rightContainer",class:"rightContainer"},rc={ref:"bottomContainer",class:"bottomContainer"};$e.render=function(e,t,n,o,r,i){const s=lo("router-view");return G(),rt("div",{class:"layoutContainer",style:It(e.containerStyle)},[it("div",Za,[tt(e.$slots,"top"),(G(!0),rt(Tt,null,Bt(e.topContainerComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512),it("div",null,[xt(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),e.isEnableRouterView?(G(),rt("div",Qa,[so(s,null,{default:re(({Component:c})=>[(G(),yt(Rt(c)))]),_:1}),tt(e.$slots,"main")],512)):xt("v-if",!0),xt(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),it("div",tc,[tt(e.$slots,"back"),(G(!0),rt(Tt,null,Bt(e.centerbackComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512),xt(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),it("div",ec,[tt(e.$slots,"front"),(G(!0),rt(Tt,null,Bt(e.centerfrontComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512),it("div",nc,[tt(e.$slots,"left"),(G(!0),rt(Tt,null,Bt(e.leftContainerComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512),it("div",oc,[tt(e.$slots,"right"),(G(!0),rt(Tt,null,Bt(e.rightContainerComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512)]),it("div",rc,[tt(e.$slots,"bottom"),(G(!0),rt(Tt,null,Bt(e.bottomContainerComponents,([c,d])=>(G(),yt(Rt(d),{ref_for:!0,ref:m=>e.setItemRef(m,c),key:c}))),128))],512),xt(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),tt(e.$slots,"default")],4)},$e.__scopeId="data-v-4d081e5c",$e.__file="src/controls/layoutcontainer/layout.vue";const De=new Map,kn=new Map;let Me;const ic={getDefaultClient(){if(Me||(Me=new Gt(SysConfig.DefaultHproseAPI)),!Me)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Me},registerHprose(e,t){const n=kn.get(e);if(!n){const o=new Gt(t);De.set(e,o)}return n},getHprose:e=>kn?.get(e),getProxyHprose:e=>De.get(e),unregisterHprose(e){De.get(e)&&(kn.delete(e),De.delete(e))}},sc=5e3,ac=36e5,Lt={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},In="access_token",cc=L.Config.ServiceURL.LoginAuthURL;function Tn(){const e=Co();e&&bt(Lt.RefreshToken,cc,{refreshToken:e}).then(t=>{Rn(t.data)})}function cr(){const e=wt.getJsonObject(In);if(!e)return;const t=new Date().getTime(),n=new Date(e.expire).getTime()-t;n>0&&(n<=5e3?Tn():setTimeout(Tn,n-5e3))}function Rn(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=Dt();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},wt.set(In,o,n/1e3),cr()}else wt.remove(In)}const Ae="Wm314243",Le=L.Config.ServiceURL.LoginAuthURL;async function lc(e){const t={username:e.username,pwd:Vt.encryptToString(e.pwd,Ae)},n=(await bt(Lt.Login,Le,t))?.data;return n&&Rn(n.doubletoken),n}function hc(e){const t={oldpwd:Vt.encryptToString(e.oldpwd,Ae),newpwd:Vt.encryptToString(e.newpwd,Ae)};return bt(Lt.ChangeMyPwd,Le,t)}function uc(e){return Vt.encryptToString(e,Ae)}function dc(){const e=Dt();e&&(xo(Lt.Logout,Le,{token:e.token,reftoken:e.refresh}),hn())}function pc(e){return bt(Lt.CheckToken,Le,{token:e})}const Pn="ROLE_SYSTEM_RIGHT",zn=new le("",sessionStorage);function lr(){return zn.get(Pn)}function $n(e){zn.set(Pn,e)}function hr(){zn.remove(Pn)}function Wt(e){if(e)for(let t=0;t<e.length;t++){const n=e[t];n.children&&n.children.length>0?(Wt(n.children),n.children.length===0&&(e.splice(t,1),t--)):n.selected||(e.splice(t,1),t--)}}function ur(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&ur(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function dr(e,t,n="name"){e&&t&&e.forEach(o=>{const r=t.find(i=>i[n]===o[n]);r&&(o.children?r.children&&dr(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Zt(e,t,n,o="name"){const r=e[n],i=t[n];r?i&&dr(r,i,o):i&&(e[n]=i)}function pr(e){if(e&&e.length>0){const t=e.length;let n,o=!1;if(t>0){o=Pt(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],c=o?s:JSON.parse(s);Zt(r,c,"routes","name"),Zt(r,c,"widgetMenu","name"),Zt(r,c,"widgets","id"),Zt(r,c,"functions","id")}n=r}return n&&(Wt(n.routes),Wt(n.widgetMenu),Wt(n.widgets),Wt(n.functions)),n}}const Dn=[],Mn=[],An=[];function Qt(){return lr()}async function fc(e,t=!1){hr();const n=Lt.GetSystemRights,o=L.Config.ServiceURL.LoginAuthURL,r=await bt(n,o,{systemid:e});if(!r||!r.data)return void L.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 $n(s),s}{const s=pr(i);return $n(s),s}}}function fr(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=fr(r,o);i&&n.children?.push(i)}})),n}function gc(e,t=2){if(t===0)return e;const n=Qt();return n&&n.routes?(An.length>0||e.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=fr(o,r);i&&An.push(i)}}),An):void 0}function gr(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=gr(r,o);i&&n.children?.push(i)}})),n}function mc(e,t=2){if(t===0)return e;const n=Qt();return n&&n.widgetMenu?(Mn.length>0||e.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=gr(o,r);i&&Mn.push(i)}}),Mn):void 0}function vc(e,t=2){if(t===0)return e;const n=Qt();return n&&n.widgets?(Dn.length>0||e?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&Dn.push(o)}),Dn):void 0}function yc(e,t=2){if(t===0)return e;const n=Qt();return n?n.functions:void 0}export{Ms as BigFileDownload,de as Download,cs as DownloadByUrl,$t as EnumColor,Po as FileUpload,Da as GetSignalRClient,L as Global,ic as GlobalHprose,Ut as GlobalMitt,ut as H5Tool,te as HproseClient,as as HttpDownload,go as JsonDownload,$e as LayoutContainer,nt as LayoutContainerEnum,ar as LayoutManager,As as ObjToUrlParams,Je as Pane,Gt as ProxyClient,ss as SaveAs,ki as Splitpanes,le as Storage,ce as StringUtils,Xa as StyleBlack,Ja as StyleGrayblue,Ka as StyleMetal,Va as StyleWhite,ht as SysEvents,sc as TOKEN_REFRESH_TIME,ac as TOKEN_VALID_TIMESPAN,Lt as USER_TOKEN_API,Ee as VCollapsiblePanel,Ce as VCollapsiblePanelGroup,ze as VWindow,ca as WaterMark,ir as WindowResizeEvent,Ya as WindowType,Vt as XXTEA,is as calculateBestTextColor,hc as changeMyPWD,cr as checkDoRefreshToken,pc as checkToken,hn as clearLocalToken,hr as clearRight,ns as colorIsDark,Es as createFileUpload,os as darken,Lo as deepMerge,vo as delay,Tn as doRefreshToken,No as exportSystemRights,hs as get,Qt as getCurrentSystemRight,ds as getData,uc as getEncryptPWD,yc as getFunctions,Ji as getHexColor,Dt as getLocalToken,Rs as getLockState,Zi as getLongHexColor,zo as getProxyClient,Yi as getRGBColor,ts as getRGBColorFromHSLA,Co as getRefreshToken,lr as getRight,gc as getRoutes,fc as getSystemRoleRight,vc as getWidgetConfig,mc as getWidgetMenus,Wt as handleNodes,on as hexToRGB,Is as init,Ts as initDefaultProxyClient,st as is,Qe as isArray,$i as isAsyncFunction,Mi as isBoolean,Ai as isClient,Pi as isDate,po as isDef,Ni as isElement,Oi as isEmpty,Qi as isEnumColor,ji as isError,ie as isFunction,ue as isHexColor,Ui as isImageDom,qi as isMap,Ze as isNull,Ti as isNullAndUnDef,Ri as isNullOrUnDef,zi as isNumber,Pt as isObjectX,Di as isPromise,Bi as isServer,se as isString,Fi as isSymbol,Ye as isUnDef,Gi as isValidURL,Hi as isWeakMap,Wi as isWeakSet,Li as isWindow,xs as jquery,rs as lighten,lc as login,dc as logout,pr as mergeFilterRoleSysRight,ur as mergeNodes,Zt as mergeNodesAll,Ki as newGuid,Ps as onLockListener,us as post,bt as requestGet,Eo as requestPost,xo as requestPostBody,es as rgbToHex,Rn as setLocalToken,$n as setRight,ls as sleep,Vi as storage,wt as storageHelper,zs as unLockListener,he as uuid,js as verifiyNumberInteger,Js as verifyAccount,Fs as verifyAndSpace,sa as verifyCarNum,Ws as verifyCnAndSpace,ea as verifyEmail,Hs as verifyEnAndSpace,oa as verifyFullName,ta as verifyIPAddress,na as verifyIdCard,Xs as verifyNumberCnUppercase,qs as verifyNumberComma,wn as verifyNumberIntegerAndFloat,Us as verifyNumberPercentage,Os as verifyNumberPercentageFloat,Ys as verifyPassword,Zs as verifyPasswordPowerful,Qs as verifyPasswordStrength,Vs as verifyPhone,ra as verifyPostalCode,Ks as verifyTelPhone,Gs as verifyTextColor,ia as verifyUrl,Ns as writeIconifyList,Bs as writeSysRoleRight};
22
+ `}}});const Fa={class:"vcp__header-title"},qa={key:0,class:"vcp__header-icon"},Ga=["innerHTML"],Xa={key:0,ref:"bodyRef",class:"vcp__body"},Va={ref:"bodyContentRef",class:"vcp__body-content"};function Rn(t){return window.TouchEvent&&t instanceof TouchEvent}xt.render=function(t,e,n,o,r,i){return G(),ie("section",{ref:"panelRef",class:wi(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[se("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...s)=>t.toggle&&t.toggle(...s))},[se("div",Fa,[J(t.$slots,"title")]),t.body.hasContent?(G(),ie("div",qa,[J(t.$slots,"icon",{},()=>[se("span",{innerHTML:t.toggleIcon},null,8,Ga)])])):ke("v-if",!0)]),it(Zt,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:xe(()=>[t.isExpanded?(G(),ie("div",Xa,[se("div",Va,[J(t.$slots,"content")],512)],512)):ke("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},xt.__scopeId="data-v-08c94cf8",xt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class le{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Rn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Rn(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new qn(this.clientX,this.clientY)}static bindDown(e,n,o,r=!1){const i=c=>{n(new le(c))},s=c=>{c.touches.length===1&&n(new le(c)),c.touches.length>1&&o&&o(new le(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,n,o=!1){const r=s=>{n(new le(s))},i=s=>{s.touches.length===1&&n(new le(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,n,o=!1){const r=s=>{n(new le(s))},i=s=>{s.touches.length===0&&n(new le(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:n}){Rn(this.e)?n&&n(this.e):e&&e(this.e)}}class qn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new qn(this.x,this.y)}}class Ka{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,o={}){this.handle=e,this.container=n,this.options=o,e&&(this.unbindDown=le.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=>{if(e.preventDefault(),this.handle){const{left:n,top:o}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-o}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=le.bindMove(document,this.mousemove),this.unbindUp=le.bindUp(document,this.mouseup)};mousemove=e=>{this.container&&(this.container.style.left=e.clientX-this.offsetX+"px",this.container.style.top=e.clientY-this.offsetY+"px"),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 Ja{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(o=>o.push(this))}set group(e){this._group=e;const n=Tt(this._group),o=Tt(e);n.splice(n.indexOf(this),1),o.push(this),sr()}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(Tt(this._group)),sr()}}const It=new Map;function Tt(t){return It.has(t)||It.set(t,[]),It.get(t)}function ir(t,e){return t>e?-ir(e,t):t<0&&e>=0?1:t-e}function sr(){let t=0;for(const e of function(n){const o=[];return n.forEach((r,i)=>o.push(i)),o}(It).sort(ir))for(const n of Tt(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Pn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const o=Rt(t);return t.style.width=e,t.style.height=n,o}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function Rt(t){const e=t.getBoundingClientRect(),n=e.width,o=e.height,r=e.top,i=e.left;return{width:n,height:o,top:r,left:i,bottom:r+o,right:i+n}}class Ya{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=ar.map(f=>new f(e,this));const{width:o,height:r}=Pn(e),i=n.maxWidth||window.innerWidth,s=n.maxHeight||window.innerHeight;let c=!1;(o<n.minWidth||o>i)&&(e.style.width=`${cr(o,n.minWidth,i)}px`,c=!0),(r<n.minHeight||r>s)&&(e.style.height=`${cr(r,n.minHeight,s)}px`,c=!0),c&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const ar=[];class Te{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=le.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}x0;y0;left0;top0;width0;height0;mousedown=e=>{e.preventDefault(),e.stopPropagation();const{left:n,top:o,width:r,height:i}=Rt(this.container);this.x0=e.clientX,this.y0=e.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=le.bindMove(document,this.mousemove),this.unbindUp=le.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:o,bottom:r}=Rt(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=n+i.minHeight,this.maxBottom=Math.min(n+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:n,left:o,top:r,right:i,bottom:s}=Rt(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=n+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"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function cr(t,e,n){return t<e?e:t>n?n:t}ar.push(class extends Te{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.right=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="nwse-resize"}},class extends Te{setPosition(t){this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.right=`${this.handleSize}px`,t.left=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.bottom=-this.handleSize+"px",t.cursor="ns-resize"}},class extends Te{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.height=this.height0+t.clientY-this.y0+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends Te{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.top=`${this.handleSize}px`,t.cursor="ew-resize"}},class extends Te{setPosition(t){this.container.style.left=this.left0+t.clientX-this.x0+"px",this.container.style.width=this.width0-(t.clientX-this.x0)+"px",this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=-this.handleSize+"px",t.top=-this.handleSize+"px",t.width=2*this.handleSize+"px",t.height=2*this.handleSize+"px",t.cursor="nwse-resize"}},class extends Te{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px"}applyStyle(t){t.left=`${this.handleSize}px`,t.right=`${this.handleSize}px`,t.height=2*this.handleSize+"px",t.top=-this.handleSize+"px",t.cursor="ns-resize"}},class extends Te{setPosition(t){this.container.style.top=this.top0+t.clientY-this.y0+"px",this.container.style.height=this.height0-(t.clientY-this.y0)+"px",this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=-this.handleSize+"px",t.height=2*this.handleSize+"px",t.width=2*this.handleSize+"px",t.cursor="nesw-resize"}},class extends Te{setPosition(t){this.container.style.width=this.width0+t.clientX-this.x0+"px"}applyStyle(t){t.right=-this.handleSize+"px",t.top=`${this.handleSize}px`,t.bottom=`${this.handleSize}px`,t.width=2*this.handleSize+"px",t.cursor="ew-resize"}});var Pt=Pe({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=he(!1),n=he(!1);return{hover:e,active:n,style:function(){let o=t.windowStyle.button;return e.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=le.bindUp(document,()=>{n.value=!1,r()})}}}});const Za=["disabled"];Pt.render=function(t,e,n,o,r,i){return G(),ie("div",{class:"btn",style:Re(t.style()),onMouseenter:e[0]||(e[0]=s=>t.hover=!0),onMouseleave:e[1]||(e[1]=s=>t.hover=!1),onMousedown:e[2]||(e[2]=po((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onTouchstart:e[3]||(e[3]=po((...s)=>t.mousedown&&t.mousedown(...s),["stop"])),onMouseup:e[4]||(e[4]=(...s)=>t.mouseup&&t.mouseup(...s)),onTouchend:e[5]||(e[5]=(...s)=>t.mouseup&&t.mouseup(...s)),disabled:t.disabled},[J(t.$slots,"default")],44,Za)},Pt.__scopeId="data-v-71662210",Pt.__file="src/controls/vuewindow/window/Button.vue";const zn=new Set;function lr(t){return t!==null?parseFloat(t):0}function zt(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(lr).reduce((r,i)=>r+i)),o=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(lr).reduce((r,i)=>r+i));return{width:n,height:o}}class hr{width;height;constructor(e,n){this.width=e,this.height=n}}function Qa(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),o=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(o))return{left:n,top:o}}return null}function ec(t,e,n,o){const r=t-n,i=e-o;return r*r+i*i}window.addEventListener("resize",t=>{zn.forEach(e=>{e&&at(e.fixPosition)&&e.fixPosition()})});const Mt=[];var $t=Pe({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:Pt},setup(t,{emit:e}){const n=bi();if(!n)return;const{proxy:o}=n;let r=0,i,s,c;const f=he(t.isOpen),m=()=>{Mt.push(o),c=new Ja(t.zGroup,S),t.isOpen&&function(P){P&&(Yt(()=>{r++==0&&(g(o),function(){const $=E.value,{width:D,height:U}=Pn($);let O,H;if(t.left!==void 0!=(t.top!==void 0))throw new Error("Either of left or top is specified. Both must be set or not set.");if(typeof t.left=="number")O=t.left,H=t.top;else{const Z=t.positionHint||"auto";switch(Z){case"auto":{let te=20,re=50,Q=0;do{if(Mt.every(ve=>{if(!ve.isOpen||o==ve)return!0;const nt=Qa(ve);if(nt==null)return!0;const{left:jt,top:ge}=nt;return ec(jt,ge,te,re)>16}))break;te=(te+40)%(window.innerWidth-200),re=(re+40)%(window.innerHeight-200)}while(++Q<100);O=te,H=re}break;case"center":O=(window.innerWidth-D)/2,H=(window.innerHeight-U)/2,console.log(O,H,window.innerWidth,window.innerHeight,"111111");break;default:try{const te=Z.split("/").map(Number);if(te.length!=2)throw null;const[re,Q]=te;if(!isFinite(re)||!isFinite(Q))throw null;O=re>=0?re:window.innerWidth-D+re,H=Q>=0?Q:window.innerHeight-U+Q}catch{throw new Error(`invalid position string: ${Z}`)}}}$&&($.style.left=`${O}px`,$.style.top=`${H}px`)}()),t.resizable&&u(),A(),i=new Ka(M.value,E.value,{onMove:()=>A(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:$}=Pn(M.value);s=new Ya(E.value,{onResize:()=>u(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+$,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+$:void 0})}()}),t.activateWhenOpen&&T())}(!0),zn.add(o)};function S(P){_.value.zIndex=`${P}`}const E=he(null),M=he(null),B=he(null);function T(){c.raise(),e("activate")}const _=he({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),d=Ee(()=>t.windowStyle.titlebar),p=Ee(()=>{const P={...t.windowStyle.content};return t.resizable?P.padding="0":t.padding!=null&&(P.padding=`${t.padding}px`),t.isScrollable&&(P.overflow="auto"),P});function g(P){const{width:$,height:D,top:U,left:O}=P,H=E;if(H&&$!=null&&(H.value.style.width=`${$}px`),D!=null){const Z=M.value;if(Z){const te=zt(Z).height;H.value.style.height=`${D+te}px`}}H&&O!=null&&(H.value.style.left=`${O}px`),H&&U!=null&&(H.value.style.top=`${U}px`)}function u(P=!0){const $=E.value,D=M.value,U=B.value;if(U&&$&&D){const{width:O,height:H}=zt(U),{width:Z,height:te}=zt($),re=zt(D).height,Q=Z-(U.offsetWidth-O),ve=te-re-(U.offsetHeight-H);U.style.width=`${Q}px`,U.style.height=`${ve}px`,v(),e("resize",new hr(Q,ve)),P&&(e("update:width",Q),e("update:height",ve))}}function v(){const P=E.value;if(P){const $=P.getBoundingClientRect();$.left<0&&(_.value.left="0px"),$.top<0&&(_.value.top="0px"),$.right>window.innerWidth&&(_.value.left=window.innerWidth-$.width+"px"),$.bottom>window.innerHeight&&(_.value.top=window.innerHeight-$.height+"px")}}function A(P=!0){v();const $=E.value;if($){const{left:D,top:U}=$.getBoundingClientRect();P&&(e("update:left",D),e("update:top",U))}}return Xe(()=>t.isOpen,P=>{f.value=P}),Xe(()=>t.zGroup,P=>{c.group=P}),Xe(()=>t.width,P=>{g({width:P}),u(!1)}),Xe(()=>t.height,P=>{g({height:P}),u(!1)}),Jt(()=>{m()}),_i(()=>{zn.delete(this),c.unregister(),s&&s.teardown(),i&&i.teardown(),Mt.splice(Mt.indexOf(o),1)}),{isOpen:f,windowEl:E,titlebar:M,content:B,activate:T,styleWindow:_,styleTitlebar:d,styleContent:p,closeButtonClick:function(){f.value=!1,e("closebuttonclick")},fixPosition:v}}});const tc={class:"title"};var ur;$t.render=function(t,e,n,o,r,i){const s=Qt("myButton");return G(),fe(Zt,{name:"fade",onAfterLeave:e[2]||(e[2]=c=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=c=>t.$emit("open")),persisted:""},{default:xe(()=>[Si(se("div",{class:"window",style:Re(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...c)=>t.activate&&t.activate(...c)),onTouchstart:e[1]||(e[1]=(...c)=>t.activate&&t.activate(...c))},[se("div",{class:"titlebar",style:Re(t.styleTitlebar),ref:"titlebar"},[se("div",tc,[t.$slots.title?J(t.$slots,"title",{key:0}):(G(),ie(ze,{key:1},[en(go(t.title),1)],64))]),t.closeButton?(G(),fe(s,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:xe(()=>[en("\xD7")]),_:1},8,["windowStyle","onClick"])):ke("v-if",!0)],4),se("div",{class:"content",style:Re(t.styleContent),ref:"content"},[J(t.$slots,"default")],4)],36),[[Ci,t.isOpen]])]),_:3})},$t.__file="src/controls/vuewindow/window/index.vue",function(t){t[t.StyleBlack=0]="StyleBlack",t[t.StyleWhite=1]="StyleWhite",t[t.StyleMetal=2]="StyleMetal",t[t.StyleGrayblue=3]="StyleGrayblue"}(ur||(ur={}));const nc={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)"}},oc={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)"}},rc={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)"}},ic={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)"}},sc=$t;var oe;(function(t){t[t.top=0]="top",t[t.bottom=1]="bottom",t[t.centerBack=2]="centerBack",t[t.centerMain=3]="centerMain",t[t.centerFront=4]="centerFront",t[t.left=5]="left",t[t.right=6]="right"})(oe||(oe={}));class dr{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;_mapItemRefs;constructor(e,n,o,r){this.layoutState=e,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(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e)})}async loadWidget(e){if(!e)return;let n;return Me(e)?n=e:ct(e)&&(n=this.widgetConfig.find(o=>o.id===e)),n?n.afterid?(this.isWidgetLoaded(n.afterid)||await this.loadWidget(n.afterid),this._loadWidget(n)):this._loadWidget(n):void 0}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(n=>{if(n.default){const o=Ei(n.default);this.getContainerComponents(e.container).value.set(e.id,o),this.widgetsLoadedSet.add(e.id),Yt().then(()=>{N.EventBus.emit(ue.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}}).catch(n=>{N.Logger().error("\u52A0\u8F7DWidget\u5931\u8D25\uFF01",e),N.EventBus.emit(ue.WidgetLoadedErrorEvent,e)})}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o){for(const r of o)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(o=>o.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const r of o)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),this._mapItemRefs&&this._mapItemRefs.delete(e),N.EventBus.emit(ue.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,o=this.layoutState.centerBackContainer;e?(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(e){switch(e){case oe.top:return this.layoutState.topContainer;case oe.bottom:return this.layoutState.bottomContainer;case oe.left:return this.layoutState.leftContainer;case oe.right:return this.layoutState.rightContainer;case oe.centerBack:return this.layoutState.centerBackContainer;case oe.centerMain:return this.layoutState.centerMainContainer;case oe.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const o=this.getLayoutContainer(e);o&&(o.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const o=this.getWidgetComponent(e);o&&o.changeVisible&&o.changeVisible(n)}isWidgetVisible(e){const n=this.getWidgetComponent(e);return!!n&&(!n.isShow||n.isShow.value)}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)&&this._mapItemRefs)return this._mapItemRefs.get(e)}getWigetItem(e){return this.widgetConfig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetConfig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=he(new Map);return this.layoutMap.set(e,n),n}}getWidgetLoadedIDList(){const e=[];return this.widgetsLoadedSet.forEach(n=>{e.push(n)}),e}unloadAllWidgets(e){const n=[];this.widgetsLoadedSet.forEach(o=>{e&&e.length>0?e.findIndex(r=>r===o)<0&&n.push(o):n.push(o)}),n.forEach(o=>this.unloadWidget(o))}unloadWidgets(e){e&&e.length>0&&e.forEach(n=>{this.unloadWidget(n)})}static getLayoutManager(e,n){if(n){const o=n.find(r=>r.id===e);if(o&&o.layoutID)return N.LayoutMap.get(o.layoutID)}}}var At=Pe({name:"SuspenseWithError",setup(){const t=he(null);return ki(e=>(t.value="\u5F53\u524D\u9875\u9762\u5B58\u5728\u95EE\u9898\uFF0C\u65E0\u6CD5\u6E32\u67D3\u2026\u2026",console.error("onErrorCaptured",e),!0)),{error:t}}});At.render=function(t,e,n,o,r,i){return t.error?J(t.$slots,"error",{key:0},()=>[en(go(t.error),1)]):(G(),fe(xi,{key:1},{default:xe(()=>[J(t.$slots,"default")]),fallback:xe(()=>[J(t.$slots,"fallback")]),_:3}))},At.__file="src/controls/routertransition/SuspenseWithError.vue";var Mn=Pe({name:"RouterTransition",__name:"RouterTransition",setup:t=>(e,n)=>{const o=Qt("router-view");return G(),fe(At,null,{default:xe(()=>[it(o,null,{default:xe(({Component:r,route:i})=>[it(Zt,null,{default:xe(()=>[i.meta.keepAlive?(G(),fe(Ii,{key:0},[(G(),fe(Ie(r),{key:i.name}))],1024)):(G(),fe(Ie(r),{key:i.name}))]),_:2},1024)]),_:1})]),_:1})}});Mn.__file="src/controls/routertransition/RouterTransition.vue";var Dt=Pe({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:Mn},setup(t,{attrs:e,slots:n,emit:o}){const r=t.layoutID,i=he(t.enableRouterView);Xe(()=>t.enableRouterView,()=>{i.value=t.enableRouterView});const s=fo({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),c=new Map,f=new dr(s,t.widgetConfig,r,c),m=_(oe.top),S=_(oe.centerBack),E=_(oe.centerFront),M=_(oe.left),B=_(oe.right),T=_(oe.bottom);function _(p){return f?.getContainerComponents(p)}const d=Ee(()=>t.layoutStyle);return Jt(()=>{f&&(f.preloadWidgets(),r===void 0&&(N.LayoutManager=f),o("containerLoaded",{layoutID:r,layoutManager:f}))}),{...Ti(s),topContainerComponents:m,centerbackComponents:S,centerfrontComponents:E,leftContainerComponents:M,rightContainerComponents:B,bottomContainerComponents:T,containerStyle:d,isEnableRouterView:i,setItemRef:(p,g)=>{p&&c.set(g,p)}}}});const ac={ref:"topContainer",class:"topContainer"},cc={key:0,ref:"centerMainContainer",class:"centerdiv mainContainer"},lc={ref:"centerBackContainer",class:"centerdiv backContainer"},hc={ref:"centerFrontContainer",class:"centerdiv centerFrontContainer"},uc={ref:"leftContainer",class:"leftContainer"},dc={ref:"rightContainer",class:"rightContainer"},fc={ref:"bottomContainer",class:"bottomContainer"};function pc(t){const e=new Mi(new st);return e.serialize(t),e.stream.toString()}function gc(t){return t==null||t===""?t:new $i(new st(t)).deserialize()}Dt.render=function(t,e,n,o,r,i){const s=Qt("router-transition");return G(),ie("div",{class:"layoutContainer",style:Re(t.containerStyle)},[se("div",ac,[J(t.$slots,"top"),(G(!0),ie(ze,null,He(t.topContainerComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512),se("div",null,[ke(" \u4E3B\u8981\u5BB9\u5668-\u5E95\u90E8 "),t.isEnableRouterView?(G(),ie("div",cc,[J(t.$slots,"main",{},()=>[it(s)])],512)):ke("v-if",!0),ke(" \u4E0A\u4E00\u5C42-\u4E3B\u5BB9\u5668 "),se("div",lc,[J(t.$slots,"back"),(G(!0),ie(ze,null,He(t.centerbackComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512),ke(" \u6700\u4E0A\u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),se("div",hc,[J(t.$slots,"front"),(G(!0),ie(ze,null,He(t.centerfrontComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512),se("div",uc,[J(t.$slots,"left"),(G(!0),ie(ze,null,He(t.leftContainerComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512),se("div",dc,[J(t.$slots,"right"),(G(!0),ie(ze,null,He(t.rightContainerComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512)]),se("div",fc,[J(t.$slots,"bottom"),(G(!0),ie(ze,null,He(t.bottomContainerComponents,([c,f])=>(G(),fe(Ie(f),{ref_for:!0,ref:m=>t.setItemRef(m,c),key:c}))),128))],512),ke(" \u589E\u52A0\u9ED8\u8BA4\u63D2\u69FD "),J(t.$slots,"default")],4)},Dt.__scopeId="data-v-4d081e5c",Dt.__file="src/controls/layoutcontainer/layout.vue";const Lt=new Map,$n=new Map;let Nt;const mc={getDefaultClient(){if(Nt||(Nt=new Ve(SysConfig.DefaultHproseAPI)),!Nt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Nt},registerHprose(t,e){const n=$n.get(t);if(!n){const o=new Ve(e);Lt.set(t,o)}return n},getHprose:t=>$n?.get(t),getProxyHprose:t=>Lt.get(t),unregisterHprose(t){Lt.get(t)&&($n.delete(t),Lt.delete(t))}},vc=5e3,yc=36e5,Oe={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},An="access_token",wc=N.Config.ServiceURL.LoginAuthURL;function Dn(){const t=Io();t&&be(Oe.RefreshToken,wc,{refreshToken:t}).then(e=>{Ln(e.data)})}function fr(){const t=we.getJsonObject(An);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?Dn():setTimeout(Dn,n-5e3))}function Ln(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;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=Le();o?(o.token=t.accessToken.tokenContent,o.expire=t.accessToken.expires,o.refresh=t.refreshToken.tokenContent):o={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},we.set(An,o,n/1e3),fr()}else we.remove(An)}const Bt="Wm314243",Ut=N.Config.ServiceURL.LoginAuthURL;async function bc(t){const e={username:t.username,pwd:Je.encryptToString(t.pwd,Bt)},n=(await be(Oe.Login,Ut,e))?.data;return n&&Ln(n.doubletoken),n}function _c(t){const e={oldpwd:Je.encryptToString(t.oldpwd,Bt),newpwd:Je.encryptToString(t.newpwd,Bt)};return be(Oe.ChangeMyPwd,Ut,e)}function Sc(t){return Je.encryptToString(t,Bt)}function Cc(){const t=Le();t&&(Ro(Oe.Logout,Ut,{token:t.token,reftoken:t.refresh}),mn())}function Ec(t){return be(Oe.CheckToken,Ut,{token:t})}const Nn="ROLE_SYSTEM_RIGHT",Bn=new ut("",sessionStorage);function pr(){return Bn.get(Nn)}function Un(t){Bn.set(Nn,t)}function gr(){Bn.remove(Nn)}function qe(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(qe(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function mr(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&mr(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function vr(t,e,n="name"){t&&e&&t.forEach(o=>{const r=e.find(i=>i[n]===o[n]);r&&(o.children?r.children&&vr(o.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(o.selected=r.selected))})}function Qe(t,e,n,o="name"){const r=t[n],i=e[n];r?i&&vr(r,i,o):i&&(t[n]=i)}function yr(t){if(t&&t.length>0){const e=t.length;let n,o=!1;if(e>0){o=Me(t[0]);const r=o?t[0]:JSON.parse(t[0]);if(e>1)for(let i=1;i<t.length;i++){const s=t[i],c=o?s:JSON.parse(s);Qe(r,c,"routes","name"),Qe(r,c,"widgetMenu","name"),Qe(r,c,"widgets","id"),Qe(r,c,"functions","id")}n=r}return n&&(qe(n.routes),qe(n.widgetMenu),qe(n.widgets),qe(n.functions)),n}}const jn=[],On=[],Wn=[];function et(){return pr()}async function kc(t,e=!1){gr();const n=Oe.GetSystemRights,o=N.Config.ServiceURL.LoginAuthURL,r=await be(n,o,{systemid:t});if(!r||!r.data)return void N.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 Un(s),s}{const s=yr(i);return Un(s),s}}}function wr(t,e){const n={...t};return n.meta||(n.meta={}),e.index!=null&&(n.meta.index=e.index),e.title!=null&&(n.meta.title=e.title),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.path===o.path);if(r){const i=wr(r,o);i&&n.children?.push(i)}})),n}function xc(t,e=2){if(e===0)return t;const n=et();return n&&n.routes?(Wn.length>0||t.forEach(o=>{const r=n.routes?.find(i=>i.name===o.name);if(r){const i=wr(o,r);i&&Wn.push(i)}}),Wn):void 0}function br(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(o=>{const r=t.children?.find(i=>i.name===o.name);if(r){const i=br(r,o);i&&n.children?.push(i)}})),n}function Ic(t,e=2){if(e===0)return t;const n=et();return n&&n.widgetMenu?(On.length>0||t.forEach(o=>{const r=n.widgetMenu?.find(i=>i.name===o.name);if(r){const i=br(o,r);i&&On.push(i)}}),On):void 0}function Tc(t,e=2){if(e===0)return t;const n=et();return n&&n.widgets?(jn.length>0||t?.forEach(o=>{n.widgets?.find(r=>r.id===o.id)&&jn.push(o)}),jn):void 0}function Rc(t,e=2){if(e===0)return t;const n=et();return n?n.functions:void 0}export{Ws as BigFileDownload,pt as Download,vs as DownloadByUrl,Ae as EnumColor,Ao as FileUpload,Wa as GetSignalRClient,N as Global,mc as GlobalHprose,De as GlobalMitt,de as H5Tool,tt as HproseClient,ms as HttpDownload,yo as JsonDownload,Dt as LayoutContainer,oe as LayoutContainerEnum,dr as LayoutManager,Hs as ObjToUrlParams,nn as Pane,Ve as ProxyClient,Mn as RouterTransition,gs as SaveAs,Di as Splitpanes,ut as Storage,ht as StringUtils,nc as StyleBlack,ic as StyleGrayblue,rc as StyleMetal,oc as StyleWhite,At as SuspenseWithError,ue as SysEvents,vc as TOKEN_REFRESH_TIME,yc as TOKEN_VALID_TIMESPAN,Oe as USER_TOKEN_API,xt as VCollapsiblePanel,kt as VCollapsiblePanelGroup,$t as VWindow,ma as WaterMark,hr as WindowResizeEvent,sc as WindowType,Je as XXTEA,ps as calculateBestTextColor,_c as changeMyPWD,fr as checkDoRefreshToken,Ec as checkToken,mn as clearLocalToken,gr as clearRight,us as colorIsDark,$s as createFileUpload,ds as darken,jo as deepMerge,bo as delay,gc as deserialize,Dn as doRefreshToken,Oo as exportSystemRights,ws as get,et as getCurrentSystemRight,_s as getData,Sc as getEncryptPWD,Rc as getFunctions,is as getHexColor,Le as getLocalToken,Ns as getLockState,as as getLongHexColor,Do as getProxyClient,ss as getRGBColor,ls as getRGBColorFromHSLA,Io as getRefreshToken,pr as getRight,xc as getRoutes,kc as getSystemRoleRight,Tc as getWidgetConfig,Ic as getWidgetMenus,qe as handleNodes,hn as hexToRGB,Ds as init,Ls as initDefaultProxyClient,ae as is,sn as isArray,Oi as isAsyncFunction,Hi as isBoolean,Fi as isClient,Ui as isDate,mo as isDef,Gi as isElement,Ki as isEmpty,cs as isEnumColor,Ji as isError,at as isFunction,ft as isHexColor,Vi as isImageDom,es as isMap,rn as isNull,Ni as isNullAndUnDef,Bi as isNullOrUnDef,ji as isNumber,Me as isObjectX,Wi as isPromise,Xi as isServer,ct as isString,Qi as isSymbol,on as isUnDef,ts as isValidURL,Zi as isWeakMap,Yi as isWeakSet,qi as isWindow,As as jquery,fs as lighten,bc as login,Cc as logout,yr as mergeFilterRoleSysRight,mr as mergeNodes,Qe as mergeNodesAll,rs as newGuid,Bs as onLockListener,bs as post,be as requestGet,To as requestPost,Ro as requestPostBody,hs as rgbToHex,pc as serialize,Ln as setLocalToken,Un as setRight,ys as sleep,os as storage,we as storageHelper,Us as unLockListener,dt as uuid,Ks as verifiyNumberInteger,ra as verifyAccount,Zs as verifyAndSpace,pa as verifyCarNum,Js as verifyCnAndSpace,la as verifyEmail,Ys as verifyEnAndSpace,ua as verifyFullName,ca as verifyIPAddress,ha as verifyIdCard,ta as verifyNumberCnUppercase,Qs as verifyNumberComma,kn as verifyNumberIntegerAndFloat,Xs as verifyNumberPercentage,Vs as verifyNumberPercentageFloat,ia as verifyPassword,sa as verifyPasswordPowerful,aa as verifyPasswordStrength,na as verifyPhone,da as verifyPostalCode,oa as verifyTelPhone,ea as verifyTextColor,fa as verifyUrl,qs as writeIconifyList,Gs as writeSysRoleRight};