xframelib 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +8 -8
- package/dist/index.js +7 -7
- package/dist/public/WSynchro.js +67 -0
- package/dist/utils/FileUpload.d.ts +1 -1
- package/dist/utils/H5Tool.d.ts +10 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{h as kr,openBlock as W,createElementBlock as et,normalizeStyle as vt,renderSlot as pt,reactive as An,computed as mt,defineComponent as Lt,ref as it,onMounted as ze,onUpdated as zr,nextTick as _e,normalizeClass as _r,createElementVNode as V,createCommentVNode as zt,createVNode as Dn,Transition as Tn,withCtx as Ft,withModifiers as Bn,getCurrentInstance as Mr,watch as $t,onBeforeUnmount as Ir,createTextVNode as Nn,resolveComponent as On,createBlock as ct,withDirectives as Rr,Fragment as yt,toDisplayString as Pr,vShow as Lr,markRaw as Ar,toRefs as Dr,renderList as _t,resolveDynamicComponent as wt}from"vue";import Tr from"axios";import{Client as Br,ClientContext as Me}from"@hprose/rpc-core";import{ByteStream as Un}from"@hprose/io";import{HttpTransport as Nr}from"@hprose/rpc-html5";var Or={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((i,r)=>(i.size=r===e?i.max:i.min,r!==e&&(n+=i.min),i)),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:i}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:i-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 i=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),o=Math.max(Math.min(this.getCurrentDragPercentage(t),r),i);let l=[e,e+1],p=this.panes[l[0]]||null,y=this.panes[l[1]]||null;const b=p.max<100&&o>=p.max+n.prevPanesSize,C=y.max<100&&o<=100-(y.max+this.sumNextPanesSize(e+1));if(b||C)b?(p.size=p.max,y.size=Math.max(100-p.max-n.prevPanesSize-n.nextPanesSize,0)):(p.size=Math.max(100-y.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),y.size=y.max);else{if(this.pushOtherPanes){const E=this.doPushOtherPanes(n,o);if(!E)return;({sums:n,panesToResize:l}=E),p=this.panes[l[0]]||null,y=this.panes[l[1]]||null}p!==null&&(p.size=Math.min(Math.max(o-n.prevPanesSize-n.prevReachedMinPanes,p.min),p.max)),y!==null&&(y.size=Math.min(Math.max(100-o-n.nextPanesSize-n.nextReachedMinPanes,y.min),y.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,i=[n,n+1];return e<t.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((r,o)=>{o>i[0]&&o<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,o)=>{o>0&&o<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[i[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((r,o)=>{o>n&&o<i[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,o)=>{o<this.panesCount-1&&o>=n+1&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),this.panes[i[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:i}},sumPrevPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i>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 i=t-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=o=>this.onMouseDown(o,i),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=o=>this.onMouseDown(o,i)),r.onclick=o=>this.onSplitterClick(o,i+1)),this.dblClickSplitter&&(r.ondblclick=o=>this.onSplitterDblClick(o,i+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(([i,r])=>n[i]=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),i=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((r,o)=>r.index=o),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(i=>i.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((i,r)=>i.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.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=[],i=[];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&&i.push(r.id)}),e>.1&&this.readjustSizes(e,n,i)},initialPanesSizing(){let t=100;const e=[],n=[];let i=0;this.panes.forEach(o=>{t-=o.size,o.size!==null&&i++,o.size>=o.max&&e.push(o.id),o.size<=o.min&&n.push(o.id)});let r=100;t>.1&&(this.panes.forEach(o=>{o.size===null&&(o.size=Math.max(Math.min(t/(this.panesCount-i),o.max),o.min)),r-=o.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const i=[],r=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(e,o.max),o.min)),n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),n>.1&&this.readjustSizes(n,i,r))},readjustSizes(t,e,n){let i;i=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const o=Math.max(Math.min(r.size+i,r.max),r.min);t-=o-r.size,r.size=o}else if(!n.includes(r.id)){const o=Math.max(Math.min(r.size+i,r.max),r.min);t-=o-r.size,r.size=o}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?i=>this.onSplitterDblClick(i,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 kr("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},Ie={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})}}};Ie.render=function(t,e,n,i,r,o){return W(),et("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=l=>o.onPaneClick(l,t._.uid)),style:vt(t.style)},[pt(t.$slots,"default")],4)},Ie.__file="src/controls/splitpanes/pane.vue";var Mt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ur={exports:{}},jn=Ur.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(S,u){var f=S[0],d=S[1],h=S[2],g=S[3];d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+u[0]-680876936|0)<<7|f>>>25)+d|0)&d|~f&h)+u[1]-389564586|0)<<12|g>>>20)+f|0)&f|~g&d)+u[2]+606105819|0)<<17|h>>>15)+g|0)&g|~h&f)+u[3]-1044525330|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+u[4]-176418897|0)<<7|f>>>25)+d|0)&d|~f&h)+u[5]+1200080426|0)<<12|g>>>20)+f|0)&f|~g&d)+u[6]-1473231341|0)<<17|h>>>15)+g|0)&g|~h&f)+u[7]-45705983|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+u[8]+1770035416|0)<<7|f>>>25)+d|0)&d|~f&h)+u[9]-1958414417|0)<<12|g>>>20)+f|0)&f|~g&d)+u[10]-42063|0)<<17|h>>>15)+g|0)&g|~h&f)+u[11]-1990404162|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+u[12]+1804603682|0)<<7|f>>>25)+d|0)&d|~f&h)+u[13]-40341101|0)<<12|g>>>20)+f|0)&f|~g&d)+u[14]-1502002290|0)<<17|h>>>15)+g|0)&g|~h&f)+u[15]+1236535329|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+u[1]-165796510|0)<<5|f>>>27)+d|0)&h|d&~h)+u[6]-1069501632|0)<<9|g>>>23)+f|0)&d|f&~d)+u[11]+643717713|0)<<14|h>>>18)+g|0)&f|g&~f)+u[0]-373897302|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+u[5]-701558691|0)<<5|f>>>27)+d|0)&h|d&~h)+u[10]+38016083|0)<<9|g>>>23)+f|0)&d|f&~d)+u[15]-660478335|0)<<14|h>>>18)+g|0)&f|g&~f)+u[4]-405537848|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+u[9]+568446438|0)<<5|f>>>27)+d|0)&h|d&~h)+u[14]-1019803690|0)<<9|g>>>23)+f|0)&d|f&~d)+u[3]-187363961|0)<<14|h>>>18)+g|0)&f|g&~f)+u[8]+1163531501|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+u[13]-1444681467|0)<<5|f>>>27)+d|0)&h|d&~h)+u[2]-51403784|0)<<9|g>>>23)+f|0)&d|f&~d)+u[7]+1735328473|0)<<14|h>>>18)+g|0)&f|g&~f)+u[12]-1926607734|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+u[5]-378558|0)<<4|f>>>28)+d|0)^d^h)+u[8]-2022574463|0)<<11|g>>>21)+f|0)^f^d)+u[11]+1839030562|0)<<16|h>>>16)+g|0)^g^f)+u[14]-35309556|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+u[1]-1530992060|0)<<4|f>>>28)+d|0)^d^h)+u[4]+1272893353|0)<<11|g>>>21)+f|0)^f^d)+u[7]-155497632|0)<<16|h>>>16)+g|0)^g^f)+u[10]-1094730640|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+u[13]+681279174|0)<<4|f>>>28)+d|0)^d^h)+u[0]-358537222|0)<<11|g>>>21)+f|0)^f^d)+u[3]-722521979|0)<<16|h>>>16)+g|0)^g^f)+u[6]+76029189|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+u[9]-640364487|0)<<4|f>>>28)+d|0)^d^h)+u[12]-421815835|0)<<11|g>>>21)+f|0)^f^d)+u[15]+530742520|0)<<16|h>>>16)+g|0)^g^f)+u[2]-995338651|0)<<23|d>>>9)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+u[0]-198630844|0)<<6|f>>>26)+d|0)|~h))+u[7]+1126891415|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+u[14]-1416354905|0)<<15|h>>>17)+g|0)|~f))+u[5]-57434055|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+u[12]+1700485571|0)<<6|f>>>26)+d|0)|~h))+u[3]-1894986606|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+u[10]-1051523|0)<<15|h>>>17)+g|0)|~f))+u[1]-2054922799|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+u[8]+1873313359|0)<<6|f>>>26)+d|0)|~h))+u[15]-30611744|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+u[6]-1560198380|0)<<15|h>>>17)+g|0)|~f))+u[13]+1309151649|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+u[4]-145523070|0)<<6|f>>>26)+d|0)|~h))+u[11]-1120210379|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+u[2]+718787259|0)<<15|h>>>17)+g|0)|~f))+u[9]-343485551|0)<<21|d>>>11)+h|0,S[0]=f+S[0]|0,S[1]=d+S[1]|0,S[2]=h+S[2]|0,S[3]=g+S[3]|0}function i(S){var u,f=[];for(u=0;u<64;u+=4)f[u>>2]=S.charCodeAt(u)+(S.charCodeAt(u+1)<<8)+(S.charCodeAt(u+2)<<16)+(S.charCodeAt(u+3)<<24);return f}function r(S){var u,f=[];for(u=0;u<64;u+=4)f[u>>2]=S[u]+(S[u+1]<<8)+(S[u+2]<<16)+(S[u+3]<<24);return f}function o(S){var u,f,d,h,g,L,I=S.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n(R,i(S.substring(u-64,u)));for(f=(S=S.substring(u-64)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<f;u+=1)d[u>>2]|=S.charCodeAt(u)<<(u%4<<3);if(d[u>>2]|=128<<(u%4<<3),u>55)for(n(R,d),u=0;u<16;u+=1)d[u]=0;return h=(h=8*I).toString(16).match(/(.*?)(.{0,8})$/),g=parseInt(h[2],16),L=parseInt(h[1],16)||0,d[14]=g,d[15]=L,n(R,d),R}function l(S){var u,f,d,h,g,L,I=S.length,R=[1732584193,-271733879,-1732584194,271733878];for(u=64;u<=I;u+=64)n(R,r(S.subarray(u-64,u)));for(f=(S=u-64<I?S.subarray(u-64):new Uint8Array(0)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],u=0;u<f;u+=1)d[u>>2]|=S[u]<<(u%4<<3);if(d[u>>2]|=128<<(u%4<<3),u>55)for(n(R,d),u=0;u<16;u+=1)d[u]=0;return h=(h=8*I).toString(16).match(/(.*?)(.{0,8})$/),g=parseInt(h[2],16),L=parseInt(h[1],16)||0,d[14]=g,d[15]=L,n(R,d),R}function p(S){var u,f="";for(u=0;u<4;u+=1)f+=e[S>>8*u+4&15]+e[S>>8*u&15];return f}function y(S){var u;for(u=0;u<S.length;u+=1)S[u]=p(S[u]);return S.join("")}function b(S){return/[\u0080-\uFFFF]/.test(S)&&(S=unescape(encodeURIComponent(S))),S}function C(S,u){var f,d=S.length,h=new ArrayBuffer(d),g=new Uint8Array(h);for(f=0;f<d;f+=1)g[f]=S.charCodeAt(f);return u?g:h}function E(S){return String.fromCharCode.apply(null,new Uint8Array(S))}function D(S,u,f){var d=new Uint8Array(S.byteLength+u.byteLength);return d.set(new Uint8Array(S)),d.set(new Uint8Array(u),S.byteLength),f?d:d.buffer}function T(S){var u,f=[],d=S.length;for(u=0;u<d-1;u+=2)f.push(parseInt(S.substr(u,2),16));return String.fromCharCode.apply(String,f)}function P(){this.reset()}return y(o("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function S(u,f){return(u=0|u||0)<0?Math.max(u+f,0):Math.min(u,f)}ArrayBuffer.prototype.slice=function(u,f){var d,h,g,L,I=this.byteLength,R=S(u,I),O=I;return f!==t&&(O=S(f,I)),R>O?new ArrayBuffer(0):(d=O-R,h=new ArrayBuffer(d),g=new Uint8Array(h),L=new Uint8Array(this,R,d),g.set(L),h)}}(),P.prototype.append=function(S){return this.appendBinary(b(S)),this},P.prototype.appendBinary=function(S){this._buff+=S,this._length+=S.length;var u,f=this._buff.length;for(u=64;u<=f;u+=64)n(this._hash,i(this._buff.substring(u-64,u)));return this._buff=this._buff.substring(u-64),this},P.prototype.end=function(S){var u,f,d=this._buff,h=d.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)g[u>>2]|=d.charCodeAt(u)<<(u%4<<3);return this._finish(g,h),f=y(this._hash),S&&(f=T(f)),this.reset(),f},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(S){return this._buff=S.buff,this._length=S.length,this._hash=S.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(S,u){var f,d,h,g=u;if(S[g>>2]|=128<<(g%4<<3),g>55)for(n(this._hash,S),g=0;g<16;g+=1)S[g]=0;f=(f=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(f[2],16),h=parseInt(f[1],16)||0,S[14]=d,S[15]=h,n(this._hash,S)},P.hash=function(S,u){return P.hashBinary(b(S),u)},P.hashBinary=function(S,u){var f=y(o(S));return u?T(f):f},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(S){var u,f=D(this._buff.buffer,S,!0),d=f.length;for(this._length+=S.byteLength,u=64;u<=d;u+=64)n(this._hash,r(f.subarray(u-64,u)));return this._buff=u-64<d?new Uint8Array(f.buffer.slice(u-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(S){var u,f,d=this._buff,h=d.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(u=0;u<h;u+=1)g[u>>2]|=d[u]<<(u%4<<3);return this._finish(g,h),f=y(this._hash),S&&(f=T(f)),this.reset(),f},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var S=P.prototype.getState.call(this);return S.buff=E(S.buff),S},P.ArrayBuffer.prototype.setState=function(S){return S.buff=C(S.buff,!0),P.prototype.setState.call(this,S)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(S,u){var f=y(l(new Uint8Array(S)));return u?T(f):f},P}();const Re=[];class ot{static addHandler(e,n,i){e.addEventListener?e.addEventListener(n,i,!1):e.attachEvent?e.attachEvent("on"+n,i):e["on"+n]=i}static windowResizeHandler(e){ot.addHandler(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 i=window.document;let r=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let i=e;i||(i=window.document.documentElement);let r=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;typeof r<"u"&&r?r.call(i):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let n=e;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.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 i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ot.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 i=ot.isFullScreen();e(i)}):document.addEventListener("MSFullscreenChange",function(){const i=ot.isFullScreen();e(i)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(Re.indexOf(n)!==-1)return;Re.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,ot.stringifyCircularHandler);return Re.length=0,n}static jsonParse(e){const n=ot.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,o=e,l=2097152,p=new jn.ArrayBuffer,y=new FileReader;y.onload=function(b){p.append(b.target?.result);const C=p.end();n({isOK:!0,data:C})},y.onerror=function(){const b="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(b),n({isOK:!1,data:b})},function(){const b=0+l>=o.size?o.size:0+l;y.readAsArrayBuffer(r.call(o,0,b))}()}static MD5(e,n=!1){return jn.hash(e,n)}static copyText=e=>new Promise((n,i)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)});static setGrayMode(e){ot.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,i){const r=i||document.body;let{className:o}=r;o=o.replace(n,""),r.className=e?`${o} ${n} `:o}static setCssVar(e,n,i=document.documentElement){i.style.setProperty(e,n)}}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,i)=>i.toUpperCase()).replace("views","")}}class Wt{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,i=604800){const r=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(e),r)}get(e,n=null){const i=this.storage.getItem(this.getKey(e));if(i)try{const r=JSON.parse(i),{value:o,expire:l}=r;if(l===null||l>=Date.now())return o;this.remove(this.getKey(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const i=JSON.parse(n);if(i.expire===null||i.expire>=Date.now())return i;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,i=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${i}`}getCookie(e){const n=document.cookie.split("; ");for(let i=0,r=n.length;i<r;i++){const o=n[i].split("=");if(o[0]===this.getKey(e))return o[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 jr=new Wt("",localStorage);function qt(){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 i=3&Number(t[19])|8;return t[19]=e.substring(i,i+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function Fr(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?i:3&i|8).toString(16)});return e}function $r(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),i=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),o=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)}function Hr(t){var e=t.toLowerCase();if(Gt(t)){if(e.length===4){for(var n="#",i=1;i<4;i+=1){const o=e.slice(i,i+1);n+=o.concat(o)}e=n}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+e.slice(i,i+2)));return"rgb("+r.join(",")+")"}return e}function Wr(t){const e=t;if(e.length===4){let i="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);i+=r.concat(r)}return i}return e}var bt;function qr(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?bt.Hex:e==="r"||e==="("?bt.RGBA:e==="h"?bt.Hsla:bt.RGBA}function Gr(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,i,r,o=(parseFloat(e[1])%360+360)%360/360,l=parseFloat(e[2])/(/%$/.test(e[2])?100:1),p=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(l===0)n=i=r=p;else{var y=p<=.5?p*(l+1):p+l-p*l,b=2*p-y;n=Pe(b,y,o+1/3),i=Pe(b,y,o),r=Pe(b,y,o-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}}function Pe(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 Gt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function Xr(t,e,n){const i=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function Le(t){let e=t.toLowerCase();if(Gt(t)){if(e.length===4){let i="#";for(let r=1;r<4;r+=1)i+=e.slice(r,r+1).concat(e.slice(r,r+1));e=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+e.slice(i,i+2)));return"RGB("+n.join(",")+")"}return e}function Vr(t){if(!Gt(t))return;const[e,n,i]=Le(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*i<192}function Kr(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${De(t.substring(0,2),e)}${De(t.substring(2,4),e)}${De(t.substring(4,6),e)}`}function Yr(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Ae(t.substring(0,2),e)}${Ae(t.substring(2,4),e)}${Ae(t.substring(4,6),e)}`}function Ae(t,e){const n=parseInt(t,16)+e,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Fn(t,e,n){const i=[t,e,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Jr(t){return function(e,n){return(Fn(~~e[0],~~e[1],~~e[2])+.05)/(Fn(n[0],n[1],n[2])+.05)}(Le(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function De(t,e){const n=parseInt(t,16)-e,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Te(t){return{all:t=t||new Map,on(e,n){const i=t?.get(e);i&&i.push(n)||t?.set(e,[n])},off(e,n){const i=t?.get(e);i&&i.splice(i.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(i=>{i(n)}),(t?.get("*")||[]).slice().map(i=>{i(e,n)})}}}(function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"})(bt||(bt={}));const It=Te(),nt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Xt=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const i=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Zr(t,e){const n=window.URL||window.webkitURL||window,i=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=e,r.click(),n.revokeObjectURL(r.href)}const $n=(t,e)=>{const n=JSON.stringify(t,null,2);e?Xt(n,e+".json"):It.emit(nt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},Qr=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(i){Xt(i.data,n)}).catch(i=>{console.warn(i),It.emit(nt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Hn(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function to({url:t,target:e="_blank",fileName:n}){const i=new URL(t).host==location.host;return new Promise((r,o)=>{if(i){const l=document.createElement("a");if(l.href=t,l.target=e,l.download!==void 0&&(l.download=n||Hn(t)),document.createEvent){const p=document.createEvent("MouseEvents");return p.initEvent("click",!0,!0),l.dispatchEvent(p),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const l=document.createElement("canvas"),p=document.createElement("img");p.setAttribute("crossOrigin","Anonymous"),p.src=t,p.onload=y=>{l.width=p.width,l.height=p.height,l.getContext("2d").drawImage(p,0,0,p.width,p.height),l.toBlob(b=>{if(b){const C=document.createElement("a");C.href=window.URL.createObjectURL(b),C.download=Hn(t),C.click(),URL.revokeObjectURL(C.href),r(!0)}},"image/jpeg")},p.onerror=y=>o(y)}})}function eo(t){for(var e=new Date().getTime();new Date().getTime()-e<t;);console.log(`\u5F3A\u5236\u7B49\u5F85${t}\u6BEB\u79D2`)}const B={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:Tr},Wn="access_token",ut=new Wt("user",localStorage);function St(){return ut.get(Wn)}function Be(){ut.remove(Wn)}function qn(){return St()?.refresh}const no=Object.prototype.toString;function J(t,e){return no.call(t)===`[object ${e}]`}function Vt(t){return J(t,"Function")}const Gn=t=>typeof t<"u",Ne=t=>!Gn(t);function Oe(t){return t===null}function io(t){return Ne(t)&&Oe(t)}function ro(t){return Ne(t)||Oe(t)}const xt=t=>t!==null&&J(t,"Object");function oo(t){return J(t,"Date")}function so(t){return J(t,"Number")}function ao(t){return J(t,"AsyncFunction")}function co(t){return J(t,"Promise")&&xt(t)&&Vt(t.then)&&Vt(t.catch)}function Ue(t){return J(t,"String")}function uo(t){return t===!0||t===!1||J(t,"Boolean")}function je(t){return t&&Array.isArray(t)}const lo=()=>typeof window<"u",ho=t=>typeof window<"u"&&J(t,"Window"),fo=t=>xt(t)&&!!t.tagName,po=typeof window>"u";function mo(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function go(t){return t==null||(Ue(t)||je(t)?t.length===0:!!xt(t)&&JSON.stringify(t)==="{}")}function vo(t){return J(t,"Error")}function yo(t){return J(t,"WeakSet")}function wo(t){return J(t,"WeakMap")}function bo(t){return J(t,"Symbol")}function So(t){return J(t,"Map")}const xo=t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t);function Fe(t,e,n,i="json",r){const o={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,headers:{"Content-Type":"application/json",Authorization:"bearer "+St()?.token},responseType:i,cancelToken:r};if(n)for(let l in n)o.headers[l]=n[l];return B.SystemID&&(o.headers.sysid=B.SystemID,B.SystemGroup&&(o.headers.sysgroup=B.SystemGroup)),e&&(o.baseURL=e),o}function lt(t,e,n,i,r="json",o,l){const p=Fe(n,e,i,r,o);return l&&l>=2e4&&(p.timeout=l),B.Axios?.get(t,p).catch(function(y){Kt(y,e,t,"Get")})}function Kt(t,e,n,i="Get"){const r=`${e}${n}`;if(t&&t.response){let o=!1;const l=t.response.status;switch(l){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 y=t.response.data;if(y){const b=y.indexOf(":"),C=y.indexOf(`
|
|
2
|
-
`);if(b>0&&C-b>2){const E=
|
|
3
|
-
`),r=0;r<i.length;r++){var o=i[r],l=o.indexOf(":"),p=We(o.slice(0,l)).toLowerCase(),y=We(o.slice(l+1));n[p]===void 0?n[p]=y:(e=n[p],Object.prototype.toString.call(e)==="[object Array]"?n[p].push(y):n[p]=[n[p],y])}return n},Do=Ro;function Kn(t,e,n){var i=t;return Lo(e)?(n=e,typeof t=="string"&&(i={uri:t})):i=Do(e,{uri:t}),i.callback=n,i}function ht(t,e,n){return Yn(e=Kn(t,e,n))}function Yn(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(f,d,h){e||(e=!0,t.callback(f,d,h))};function i(){var f=void 0;if(f=y.response?y.response:y.responseText||function(d){try{if(d.responseType==="document")return d.responseXML;var h=d.responseXML&&d.responseXML.documentElement.nodeName==="parsererror";if(d.responseType===""&&!h)return d.responseXML}catch{}return null}(y),S)try{f=JSON.parse(f)}catch{}return f}function r(f){return clearTimeout(b),f instanceof Error||(f=new Error(""+(f||"Unknown XMLHttpRequest Error"))),f.statusCode=0,n(f,u)}function o(){if(!p){var f;clearTimeout(b),f=t.useXDR&&y.status===void 0?200:y.status===1223?204:y.status;var d=u,h=null;return f!==0?(d={body:i(),statusCode:f,method:E,headers:{},url:C,rawRequest:y},y.getAllResponseHeaders&&(d.headers=Ao(y.getAllResponseHeaders()))):h=new Error("Internal XMLHttpRequest Error"),n(h,d,d.body)}}var l,p,y=t.xhr||null;y||(y=t.cors||t.useXDR?new ht.XDomainRequest:new ht.XMLHttpRequest);var b,C=y.url=t.uri||t.url,E=y.method=t.method||"GET",D=t.body||t.data,T=y.headers=t.headers||{},P=!!t.sync,S=!1,u={body:void 0,headers:{},statusCode:0,method:E,url:C,rawRequest:y};if("json"in t&&t.json!==!1&&(S=!0,T.accept||T.Accept||(T.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(T["content-type"]||T["Content-Type"]||(T["Content-Type"]="application/json"),D=JSON.stringify(t.json===!0?D:t.json))),y.onreadystatechange=function(){y.readyState===4&&setTimeout(o,0)},y.onload=o,y.onerror=r,y.onprogress=function(){},y.onabort=function(){p=!0},y.ontimeout=r,y.open(E,C,!P,t.username,t.password),P||(y.withCredentials=!!t.withCredentials),!P&&t.timeout>0&&(b=setTimeout(function(){if(!p){p=!0,y.abort("timeout");var f=new Error("XMLHttpRequest timeout");f.code="ETIMEDOUT",r(f)}},t.timeout)),y.setRequestHeader)for(l in T)T.hasOwnProperty(l)&&y.setRequestHeader(l,T[l]);else if(t.headers&&!function(f){for(var d in f)if(f.hasOwnProperty(d))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(y.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(y),y.send(D||null),y}He.exports=ht,He.exports.default=ht,ht.XMLHttpRequest=Vn.XMLHttpRequest||function(){},ht.XDomainRequest="withCredentials"in new ht.XMLHttpRequest?ht.XMLHttpRequest:Vn.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){ht[t==="delete"?"del":t]=function(e,n,i){return(n=Kn(e,n,i)).method=t.toUpperCase(),Yn(n)}});const To=[200,201,202,204,308],Bo=[408,502,503,504];class No{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=Te(),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,i=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(i,i+n))})}xhrPromise(e){const n=i=>{i.upload.onprogress=r=>{const o=100/this.totalChunks,l=o*this.file.size,p=o*this.chunkCount,y=r.loaded/(r.total??l)*o;this.dispatch("progress",Math.min(p+y,100))}};return new Promise((i,r)=>{this.currentXhr=He.exports({...e,beforeSend:n},(o,l)=>(this.currentXhr=void 0,o?r(o):i(l)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,i={...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:i,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(){this.paused||this.offline||this.success||this.getChunk().then(()=>this.sendChunk()).then(e=>{if(this.attemptCount=this.attemptCount+1,e!=null&&To.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=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(e!=null&&Bo.includes(e.statusCode)){if(this.paused||this.offline)return;this.manageRetries()}else{if(this.paused||this.offline)return;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 Oo=t=>new No(t),Uo=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 Nt{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!Ht.isNullOrEmpty(e)){if(Nt.httpTransport||(Nt.httpTransport=new Nr),this.client=new Br(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")):It.emit(nt.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,i){if(this.client)return await this.client.invoke(e,n,i)}encode(e,n,i){if(this.client)return this.client.codec.encode(e,n,i)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class At{hproseClient;hpProxyObj;defaultContext=new Me;constructor(e){this.hproseClient=new Nt(e),this.hpProxyObj=null}getClientContext(e,n){const i={};n&&(i.requestHeaders=n);const r=St();i.httpRequestHeaders=e||{};const o=i.httpRequestHeaders;return r&&(o.token=r.token),B.SystemID&&(o.sysid=B.SystemID,B.SystemGroup&&(o.sysgroup=B.SystemGroup)),new Me(i)}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||It.emit(nt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n,i){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,i)}async hproseInvokeContext(e,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=St();return console.log(r,"userToken3"),r&&(n||(n=new Me({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,i,n)}async hproseInvokeEncode(e){const n=new Un(e).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(e,...n){const i=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return Un.toString(i)}}class jo{message;eventBus;constructor(e,n){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:e,duration:n});else switch(i){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(i){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":i="dark",console.error(e)}this.eventBus&&this.eventBus.emit(nt.AlertInfoEvent,{type:i,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")}}const qe=new Map,Fo=function(t,e,n){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&Ht.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new At(B.Config.DefaultHproseAPI));const i=B.Config.UI.GrayMode;i&&ot.setGrayMode(i);const r=new jo(t,B.EventBus);B.Message=r,B.SystemID=e,B.SystemGroup=n,B.EventBus.on(nt.HproseServiceErrorEvent,o=>{const l=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;r.warn(l)}),B.EventBus.on(nt.WebAPIErrorEvent,o=>{const l=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;r.warn(l)}),B.EventBus.on(nt.AxiosRequestErrorEvent,o=>{const l=`Http\u8BF7\u6C42'${o.code}'\u9519\u8BEF: ${o.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",o),r.warn(l)}),B.EventBus.on(nt.CommonWarnEvent,o=>{r.warn(o)})};function Jn(t){if(t&&Ht.isNotEmpty(t)){if(qe.has(t))return qe.get(t);{const e=new At(t);return qe.set(t,e),e}}}function $o(t){const e=Jn(t);return e&&(B.DefaultProxyClient=e),e}const Ge="is_LockScreen",Zn=ut.get(Ge,!1),Dt={isLock:Zn,lockTime:Zn=="true"?ti():0};function Qn(t){Dt.isLock=t,ut.set(Ge,t,10),t&&(Be(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ho(){return ut.get(Ge,!1)}function ti(){let t=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(t=B.Config.UI.LockTime),t}let Xe;function Ve(){clearInterval(Xe),!(window.location.href.indexOf("/login")>0||Dt.isLock)&&(Qn(!1),Dt.lockTime=ti(),Xe=setInterval(()=>{if(Dt.lockTime--,Dt.lockTime<=0)return Qn(!0),clearInterval(Xe)},1e3))}function Wo(){Ve(),document.addEventListener("mousedown",Ve)}function qo(){document.removeEventListener("mousedown",Ve)}function Ke(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 Go={exports:{}},Yt=Go.exports=function t(e,n,i){function r(p,y){if(!n[p]){if(!e[p]){if(!y&&Ke)return Ke(p);if(o)return o(p,!0);var b=new Error("Cannot find module '"+p+"'");throw b.code="MODULE_NOT_FOUND",b}var C=n[p]={exports:{}};e[p][0].call(C.exports,function(E){var D=e[p][1][E];return r(D||E)},C,C.exports,t,e,n,i)}return n[p].exports}for(var o=Ke,l=0;l<i.length;l++)r(i[l]);return r}({1:[function(t,e,n){(function(i){var r,o,l=i.MutationObserver||i.WebKitMutationObserver;if(l){var p=0,y=new l(D),b=i.document.createTextNode("");y.observe(b,{characterData:!0}),r=function(){b.data=p=++p%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var P=i.document.createElement("script");P.onreadystatechange=function(){D(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},i.document.documentElement.appendChild(P)}:function(){setTimeout(D,0)};else{var C=new i.MessageChannel;C.port1.onmessage=D,r=function(){C.port2.postMessage(0)}}var E=[];function D(){var P,S;o=!0;for(var u=E.length;u;){for(S=E,E=[],P=-1;++P<u;)S[P]();u=E.length}o=!1}function T(P){E.push(P)!==1||o||r()}e.exports=T}).call(this,Mt!==void 0?Mt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var i=t(1);function r(){}var o={},l=["REJECTED"],p=["FULFILLED"],y=["PENDING"];function b(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,h!==r&&T(this,h)}function C(h,g,L){this.promise=h,typeof g=="function"&&(this.onFulfilled=g,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}function E(h,g,L){i(function(){var I;try{I=g(L)}catch(R){return o.reject(h,R)}I===h?o.reject(h,new TypeError("Cannot resolve promise with itself")):o.resolve(h,I)})}function D(h){var g=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof g=="function")return function(){g.apply(h,arguments)}}function T(h,g){var L=!1;function I(U){L||(L=!0,o.reject(h,U))}function R(U){L||(L=!0,o.resolve(h,U))}function O(){g(R,I)}var j=P(O);j.status==="error"&&I(j.value)}function P(h,g){var L={};try{L.value=h(g),L.status="success"}catch(I){L.status="error",L.value=I}return L}function S(h){return h instanceof this?h:o.resolve(new this(r),h)}function u(h){var g=new this(r);return o.reject(g,h)}function f(h){var g=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=h.length,I=!1;if(!L)return this.resolve([]);for(var R=new Array(L),O=0,j=-1,U=new this(r);++j<L;)H(h[j],j);return U;function H(tt,X){function Y(q){R[X]=q,++O!==L||I||(I=!0,o.resolve(U,R))}g.resolve(tt).then(Y,function(q){I||(I=!0,o.reject(U,q))})}}function d(h){var g=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=h.length,I=!1;if(!L)return this.resolve([]);for(var R=-1,O=new this(r);++R<L;)j(h[R]);return O;function j(U){g.resolve(U).then(function(H){I||(I=!0,o.resolve(O,H))},function(H){I||(I=!0,o.reject(O,H))})}}e.exports=b,b.prototype.catch=function(h){return this.then(null,h)},b.prototype.then=function(h,g){if(typeof h!="function"&&this.state===p||typeof g!="function"&&this.state===l)return this;var L=new this.constructor(r);return this.state!==y?E(L,this.state===p?h:g,this.outcome):this.queue.push(new C(L,h,g)),L},C.prototype.callFulfilled=function(h){o.resolve(this.promise,h)},C.prototype.otherCallFulfilled=function(h){E(this.promise,this.onFulfilled,h)},C.prototype.callRejected=function(h){o.reject(this.promise,h)},C.prototype.otherCallRejected=function(h){E(this.promise,this.onRejected,h)},o.resolve=function(h,g){var L=P(D,g);if(L.status==="error")return o.reject(h,L.value);var I=L.value;if(I)T(h,I);else{h.state=p,h.outcome=g;for(var R=-1,O=h.queue.length;++R<O;)h.queue[R].callFulfilled(g)}return h},o.reject=function(h,g){h.state=l,h.outcome=g;for(var L=-1,I=h.queue.length;++L<I;)h.queue[L].callRejected(g);return h},b.resolve=S,b.reject=u,b.all=f,b.race=d},{1:1}],3:[function(t,e,n){(function(i){typeof i.Promise!="function"&&(i.Promise=t(2))}).call(this,Mt!==void 0?Mt:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function r(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")}function o(){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 l=o();function p(){try{if(!l||!l.open)return!1;var s=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function y(s,a){s=s||[],a=a||{};try{return new Blob(s,a)}catch(m){if(m.name!=="TypeError")throw m;for(var c=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),v=0;v<s.length;v+=1)c.append(s[v]);return c.getBlob(a.type)}}typeof Promise>"u"&&t(3);var b=Promise;function C(s,a){a&&s.then(function(c){a(null,c)},function(c){a(c)})}function E(s,a,c){typeof a=="function"&&s.then(a),typeof c=="function"&&s.catch(c)}function D(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function T(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",S=void 0,u={},f=Object.prototype.toString,d="readonly",h="readwrite";function g(s){for(var a=s.length,c=new ArrayBuffer(a),v=new Uint8Array(c),m=0;m<a;m++)v[m]=s.charCodeAt(m);return c}function L(s){return new b(function(a){var c=s.transaction(P,h),v=y([""]);c.objectStore(P).put(v,"key"),c.onabort=function(m){m.preventDefault(),m.stopPropagation(),a(!1)},c.oncomplete=function(){var m=navigator.userAgent.match(/Chrome\/(\d+)/),w=navigator.userAgent.match(/Edge\//);a(w||!m||parseInt(m[1],10)>=43)}}).catch(function(){return!1})}function I(s){return typeof S=="boolean"?b.resolve(S):L(s).then(function(a){return S=a})}function R(s){var a=u[s.name],c={};c.promise=new b(function(v,m){c.resolve=v,c.reject=m}),a.deferredOperations.push(c),a.dbReady?a.dbReady=a.dbReady.then(function(){return c.promise}):a.dbReady=c.promise}function O(s){var a=u[s.name].deferredOperations.pop();if(a)return a.resolve(),a.promise}function j(s,a){var c=u[s.name].deferredOperations.pop();if(c)return c.reject(a),c.promise}function U(s,a){return new b(function(c,v){if(u[s.name]=u[s.name]||fn(),s.db){if(!a)return c(s.db);R(s),s.db.close()}var m=[s.name];a&&m.push(s.version);var w=l.open.apply(l,m);a&&(w.onupgradeneeded=function(x){var k=w.result;try{k.createObjectStore(s.storeName),x.oldVersion<=1&&k.createObjectStore(P)}catch(z){if(z.name!=="ConstraintError")throw z;console.warn('The database "'+s.name+'" has been upgraded from version '+x.oldVersion+" to version "+x.newVersion+', but the storage "'+s.storeName+'" already exists.')}}),w.onerror=function(x){x.preventDefault(),v(w.error)},w.onsuccess=function(){var x=w.result;x.onversionchange=function(k){k.target.close()},c(x),O(s)}})}function H(s){return U(s,!1)}function tt(s){return U(s,!0)}function X(s,a){if(!s.db)return!0;var c=!s.db.objectStoreNames.contains(s.storeName),v=s.version<s.db.version,m=s.version>s.db.version;if(v&&(s.version!==a&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),m||c){if(c){var w=s.db.version+1;w>s.version&&(s.version=w)}return!0}return!1}function Y(s){return new b(function(a,c){var v=new FileReader;v.onerror=c,v.onloadend=function(m){var w=btoa(m.target.result||"");a({__local_forage_encoded_blob:!0,data:w,type:s.type})},v.readAsBinaryString(s)})}function q(s){return y([g(atob(s.data))],{type:s.type})}function st(s){return s&&s.__local_forage_encoded_blob}function Ot(s){var a=this,c=a._initReady().then(function(){var v=u[a._dbInfo.name];if(v&&v.dbReady)return v.dbReady});return E(c,s,s),c}function ge(s){R(s);for(var a=u[s.name],c=a.forages,v=0;v<c.length;v++){var m=c[v];m._dbInfo.db&&(m._dbInfo.db.close(),m._dbInfo.db=null)}return s.db=null,H(s).then(function(w){return s.db=w,X(s)?tt(s):w}).then(function(w){s.db=a.db=w;for(var x=0;x<c.length;x++)c[x]._dbInfo.db=w}).catch(function(w){throw j(s,w),w})}function rt(s,a,c,v){v===void 0&&(v=1);try{var m=s.db.transaction(s.storeName,a);c(null,m)}catch(w){if(v>0&&(!s.db||w.name==="InvalidStateError"||w.name==="NotFoundError"))return b.resolve().then(function(){if(!s.db||w.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),tt(s)}).then(function(){return ge(s).then(function(){rt(s,a,c,v-1)})}).catch(c);c(w)}}function fn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ii(s){var a=this,c={db:null};if(s)for(var v in s)c[v]=s[v];var m=u[c.name];m||(m=fn(),u[c.name]=m),m.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=Ot);var w=[];function x(){return b.resolve()}for(var k=0;k<m.forages.length;k++){var z=m.forages[k];z!==a&&w.push(z._initReady().catch(x))}var _=m.forages.slice(0);return b.all(w).then(function(){return c.db=m.db,H(c)}).then(function(M){return c.db=M,X(c,a._defaultConfig.version)?tt(c):M}).then(function(M){c.db=m.db=M,a._dbInfo=c;for(var A=0;A<_.length;A++){var N=_[A];N!==a&&(N._dbInfo.db=c.db,N._dbInfo.version=c.version)}})}function Ri(s,a){var c=this;s=D(s);var v=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).get(s);z.onsuccess=function(){var _=z.result;_===void 0&&(_=null),st(_)&&(_=q(_)),m(_)},z.onerror=function(){w(z.error)}}catch(_){w(_)}})}).catch(w)});return C(v,a),v}function Pi(s,a){var c=this,v=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).openCursor(),_=1;z.onsuccess=function(){var M=z.result;if(M){var A=M.value;st(A)&&(A=q(A));var N=s(A,M.key,_++);N!==void 0?m(N):M.continue()}else m()},z.onerror=function(){w(z.error)}}catch(M){w(M)}})}).catch(w)});return C(v,a),v}function Li(s,a,c){var v=this;s=D(s);var m=new b(function(w,x){var k;v.ready().then(function(){return k=v._dbInfo,f.call(a)==="[object Blob]"?I(k.db).then(function(z){return z?a:Y(a)}):a}).then(function(z){rt(v._dbInfo,h,function(_,M){if(_)return x(_);try{var A=M.objectStore(v._dbInfo.storeName);z===null&&(z=void 0);var N=A.put(z,s);M.oncomplete=function(){z===void 0&&(z=null),w(z)},M.onabort=M.onerror=function(){var F=N.error?N.error:N.transaction.error;x(F)}}catch(F){x(F)}})}).catch(x)});return C(m,c),m}function Ai(s,a){var c=this;s=D(s);var v=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,h,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).delete(s);k.oncomplete=function(){m()},k.onerror=function(){w(z.error)},k.onabort=function(){var _=z.error?z.error:z.transaction.error;w(_)}}catch(_){w(_)}})}).catch(w)});return C(v,a),v}function Di(s){var a=this,c=new b(function(v,m){a.ready().then(function(){rt(a._dbInfo,h,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).clear();x.oncomplete=function(){v()},x.onabort=x.onerror=function(){var z=k.error?k.error:k.transaction.error;m(z)}}catch(z){m(z)}})}).catch(m)});return C(c,s),c}function Ti(s){var a=this,c=new b(function(v,m){a.ready().then(function(){rt(a._dbInfo,d,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).count();k.onsuccess=function(){v(k.result)},k.onerror=function(){m(k.error)}}catch(z){m(z)}})}).catch(m)});return C(c,s),c}function Bi(s,a){var c=this,v=new b(function(m,w){s<0?m(null):c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName),_=!1,M=z.openKeyCursor();M.onsuccess=function(){var A=M.result;A?s===0||_?m(A.key):(_=!0,A.advance(s)):m(null)},M.onerror=function(){w(M.error)}}catch(A){w(A)}})}).catch(w)});return C(v,a),v}function Ni(s){var a=this,c=new b(function(v,m){a.ready().then(function(){rt(a._dbInfo,d,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).openKeyCursor(),z=[];k.onsuccess=function(){var _=k.result;_?(z.push(_.key),_.continue()):v(z)},k.onerror=function(){m(k.error)}}catch(_){m(_)}})}).catch(m)});return C(c,s),c}function Oi(s,a){a=T.apply(this,arguments);var c=this.config();(s=typeof s!="function"&&s||{}).name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var v,m=this;if(s.name){var w=s.name===c.name&&m._dbInfo.db?b.resolve(m._dbInfo.db):H(s).then(function(x){var k=u[s.name],z=k.forages;k.db=x;for(var _=0;_<z.length;_++)z[_]._dbInfo.db=x;return x});v=s.storeName?w.then(function(x){if(x.objectStoreNames.contains(s.storeName)){var k=x.version+1;R(s);var z=u[s.name],_=z.forages;x.close();for(var M=0;M<_.length;M++){var A=_[M];A._dbInfo.db=null,A._dbInfo.version=k}var N=new b(function(F,$){var G=l.open(s.name,k);G.onerror=function(at){G.result.close(),$(at)},G.onupgradeneeded=function(){G.result.deleteObjectStore(s.storeName)},G.onsuccess=function(){var at=G.result;at.close(),F(at)}});return N.then(function(F){z.db=F;for(var $=0;$<_.length;$++){var G=_[$];G._dbInfo.db=F,O(G._dbInfo)}}).catch(function(F){throw(j(s,F)||b.resolve()).catch(function(){}),F})}}):w.then(function(x){R(s);var k=u[s.name],z=k.forages;x.close();for(var _=0;_<z.length;_++)z[_]._dbInfo.db=null;var M=new b(function(A,N){var F=l.deleteDatabase(s.name);F.onerror=function(){var $=F.result;$&&$.close(),N(F.error)},F.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},F.onsuccess=function(){var $=F.result;$&&$.close(),A($)}});return M.then(function(A){k.db=A;for(var N=0;N<z.length;N++)O(z[N]._dbInfo)}).catch(function(A){throw(j(s,A)||b.resolve()).catch(function(){}),A})})}else v=b.reject("Invalid arguments");return C(v,a),v}var Ui={_driver:"asyncStorage",_initStorage:Ii,_support:p(),iterate:Pi,getItem:Ri,setItem:Li,removeItem:Ai,clear:Di,length:Ti,key:Bi,keys:Ni,dropInstance:Oi};function ji(){return typeof openDatabase=="function"}var dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fi="~~local_forage_type~",pn=/^~~local_forage_type~([^~]+)~/,Ut="__lfsc__:",ve=Ut.length,ye="arbf",we="blob",mn="si08",gn="ui08",vn="uic8",yn="si16",wn="si32",bn="ur16",Sn="ui32",xn="fl32",Cn="fl64",En=ve+ye.length,kn=Object.prototype.toString;function zn(s){var a,c,v,m,w,x=.75*s.length,k=s.length,z=0;s[s.length-1]==="="&&(x--,s[s.length-2]==="="&&x--);var _=new ArrayBuffer(x),M=new Uint8Array(_);for(a=0;a<k;a+=4)c=dt.indexOf(s[a]),v=dt.indexOf(s[a+1]),m=dt.indexOf(s[a+2]),w=dt.indexOf(s[a+3]),M[z++]=c<<2|v>>4,M[z++]=(15&v)<<4|m>>2,M[z++]=(3&m)<<6|63&w;return _}function be(s){var a,c=new Uint8Array(s),v="";for(a=0;a<c.length;a+=3)v+=dt[c[a]>>2],v+=dt[(3&c[a])<<4|c[a+1]>>4],v+=dt[(15&c[a+1])<<2|c[a+2]>>6],v+=dt[63&c[a+2]];return c.length%3==2?v=v.substring(0,v.length-1)+"=":c.length%3==1&&(v=v.substring(0,v.length-2)+"=="),v}function $i(s,a){var c="";if(s&&(c=kn.call(s)),s&&(c==="[object ArrayBuffer]"||s.buffer&&kn.call(s.buffer)==="[object ArrayBuffer]")){var v,m=Ut;s instanceof ArrayBuffer?(v=s,m+=ye):(v=s.buffer,c==="[object Int8Array]"?m+=mn:c==="[object Uint8Array]"?m+=gn:c==="[object Uint8ClampedArray]"?m+=vn:c==="[object Int16Array]"?m+=yn:c==="[object Uint16Array]"?m+=bn:c==="[object Int32Array]"?m+=wn:c==="[object Uint32Array]"?m+=Sn:c==="[object Float32Array]"?m+=xn:c==="[object Float64Array]"?m+=Cn:a(new Error("Failed to get type for BinaryArray"))),a(m+be(v))}else if(c==="[object Blob]"){var w=new FileReader;w.onload=function(){var x=Fi+s.type+"~"+be(this.result);a(Ut+we+x)},w.readAsArrayBuffer(s)}else try{a(JSON.stringify(s))}catch(x){console.error("Couldn't convert value into a JSON string: ",s),a(null,x)}}function Hi(s){if(s.substring(0,ve)!==Ut)return JSON.parse(s);var a,c=s.substring(En),v=s.substring(ve,En);if(v===we&&pn.test(c)){var m=c.match(pn);a=m[1],c=c.substring(m[0].length)}var w=zn(c);switch(v){case ye:return w;case we:return y([w],{type:a});case mn:return new Int8Array(w);case gn:return new Uint8Array(w);case vn:return new Uint8ClampedArray(w);case yn:return new Int16Array(w);case bn:return new Uint16Array(w);case wn:return new Int32Array(w);case Sn:return new Uint32Array(w);case xn:return new Float32Array(w);case Cn:return new Float64Array(w);default:throw new Error("Unkown type: "+v)}}var Se={serialize:$i,deserialize:Hi,stringToBuffer:zn,bufferToString:be};function _n(s,a,c,v){s.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,v)}function Wi(s){var a=this,c={db:null};if(s)for(var v in s)c[v]=typeof s[v]!="string"?s[v].toString():s[v];var m=new b(function(w,x){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(k){return x(k)}c.db.transaction(function(k){_n(k,c,function(){a._dbInfo=c,w()},function(z,_){x(_)})},x)});return c.serializer=Se,m}function ft(s,a,c,v,m,w){s.executeSql(c,v,m,function(x,k){k.code===k.SYNTAX_ERR?x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(z,_){_.rows.length?w(z,k):_n(z,a,function(){z.executeSql(c,v,m,w)},w)},w):w(x,k)},w)}function qi(s,a){var c=this;s=D(s);var v=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT * FROM "+x.storeName+" WHERE key = ? LIMIT 1",[s],function(z,_){var M=_.rows.length?_.rows.item(0).value:null;M&&(M=x.serializer.deserialize(M)),m(M)},function(z,_){w(_)})})}).catch(w)});return C(v,a),v}function Gi(s,a){var c=this,v=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT * FROM "+x.storeName,[],function(z,_){for(var M=_.rows,A=M.length,N=0;N<A;N++){var F=M.item(N),$=F.value;if($&&($=x.serializer.deserialize($)),($=s($,F.key,N+1))!==void 0)return void m($)}m()},function(z,_){w(_)})})}).catch(w)});return C(v,a),v}function Mn(s,a,c,v){var m=this;s=D(s);var w=new b(function(x,k){m.ready().then(function(){a===void 0&&(a=null);var z=a,_=m._dbInfo;_.serializer.serialize(a,function(M,A){A?k(A):_.db.transaction(function(N){ft(N,_,"INSERT OR REPLACE INTO "+_.storeName+" (key, value) VALUES (?, ?)",[s,M],function(){x(z)},function(F,$){k($)})},function(N){if(N.code===N.QUOTA_ERR){if(v>0)return void x(Mn.apply(m,[s,z,c,v-1]));k(N)}})})}).catch(k)});return C(w,c),w}function Xi(s,a,c){return Mn.apply(this,[s,a,c,1])}function Vi(s,a){var c=this;s=D(s);var v=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"DELETE FROM "+x.storeName+" WHERE key = ?",[s],function(){m()},function(z,_){w(_)})})}).catch(w)});return C(v,a),v}function Ki(s){var a=this,c=new b(function(v,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"DELETE FROM "+w.storeName,[],function(){v()},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function Yi(s){var a=this,c=new b(function(v,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"SELECT COUNT(key) as c FROM "+w.storeName,[],function(k,z){var _=z.rows.item(0).c;v(_)},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function Ji(s,a){var c=this,v=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT key FROM "+x.storeName+" WHERE id = ? LIMIT 1",[s+1],function(z,_){var M=_.rows.length?_.rows.item(0).key:null;m(M)},function(z,_){w(_)})})}).catch(w)});return C(v,a),v}function Zi(s){var a=this,c=new b(function(v,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"SELECT key FROM "+w.storeName,[],function(k,z){for(var _=[],M=0;M<z.rows.length;M++)_.push(z.rows.item(M).key);v(_)},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function Qi(s){return new b(function(a,c){s.transaction(function(v){v.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(m,w){for(var x=[],k=0;k<w.rows.length;k++)x.push(w.rows.item(k).name);a({db:s,storeNames:x})},function(m,w){c(w)})},function(v){c(v)})})}function tr(s,a){a=T.apply(this,arguments);var c=this.config();(s=typeof s!="function"&&s||{}).name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var v,m=this;return v=s.name?new b(function(w){var x;x=s.name===c.name?m._dbInfo.db:openDatabase(s.name,"","",0),s.storeName?w({db:x,storeNames:[s.storeName]}):w(Qi(x))}).then(function(w){return new b(function(x,k){w.db.transaction(function(z){function _(F){return new b(function($,G){z.executeSql("DROP TABLE IF EXISTS "+F,[],function(){$()},function(at,Ee){G(Ee)})})}for(var M=[],A=0,N=w.storeNames.length;A<N;A++)M.push(_(w.storeNames[A]));b.all(M).then(function(){x()}).catch(function(F){k(F)})},function(z){k(z)})})}):b.reject("Invalid arguments"),C(v,a),v}var er={_driver:"webSQLStorage",_initStorage:Wi,_support:ji(),iterate:Gi,getItem:qi,setItem:Xi,removeItem:Vi,clear:Ki,length:Yi,key:Ji,keys:Zi,dropInstance:tr};function nr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function In(s,a){var c=s.name+"/";return s.storeName!==a.storeName&&(c+=s.storeName+"/"),c}function ir(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch{return!0}}function rr(){return!ir()||localStorage.length>0}function or(s){var a=this,c={};if(s)for(var v in s)c[v]=s[v];return c.keyPrefix=In(s,a._defaultConfig),rr()?(a._dbInfo=c,c.serializer=Se,b.resolve()):b.reject()}function sr(s){var a=this,c=a.ready().then(function(){for(var v=a._dbInfo.keyPrefix,m=localStorage.length-1;m>=0;m--){var w=localStorage.key(m);w.indexOf(v)===0&&localStorage.removeItem(w)}});return C(c,s),c}function ar(s,a){var c=this;s=D(s);var v=c.ready().then(function(){var m=c._dbInfo,w=localStorage.getItem(m.keyPrefix+s);return w&&(w=m.serializer.deserialize(w)),w});return C(v,a),v}function cr(s,a){var c=this,v=c.ready().then(function(){for(var m=c._dbInfo,w=m.keyPrefix,x=w.length,k=localStorage.length,z=1,_=0;_<k;_++){var M=localStorage.key(_);if(M.indexOf(w)===0){var A=localStorage.getItem(M);if(A&&(A=m.serializer.deserialize(A)),(A=s(A,M.substring(x),z++))!==void 0)return A}}});return C(v,a),v}function ur(s,a){var c=this,v=c.ready().then(function(){var m,w=c._dbInfo;try{m=localStorage.key(s)}catch{m=null}return m&&(m=m.substring(w.keyPrefix.length)),m});return C(v,a),v}function lr(s){var a=this,c=a.ready().then(function(){for(var v=a._dbInfo,m=localStorage.length,w=[],x=0;x<m;x++){var k=localStorage.key(x);k.indexOf(v.keyPrefix)===0&&w.push(k.substring(v.keyPrefix.length))}return w});return C(c,s),c}function hr(s){var a=this.keys().then(function(c){return c.length});return C(a,s),a}function dr(s,a){var c=this;s=D(s);var v=c.ready().then(function(){var m=c._dbInfo;localStorage.removeItem(m.keyPrefix+s)});return C(v,a),v}function fr(s,a,c){var v=this;s=D(s);var m=v.ready().then(function(){a===void 0&&(a=null);var w=a;return new b(function(x,k){var z=v._dbInfo;z.serializer.serialize(a,function(_,M){if(M)k(M);else try{localStorage.setItem(z.keyPrefix+s,_),x(w)}catch(A){A.name!=="QuotaExceededError"&&A.name!=="NS_ERROR_DOM_QUOTA_REACHED"||k(A),k(A)}})})});return C(m,c),m}function pr(s,a){if(a=T.apply(this,arguments),!(s=typeof s!="function"&&s||{}).name){var c=this.config();s.name=s.name||c.name,s.storeName=s.storeName||c.storeName}var v,m=this;return v=s.name?new b(function(w){s.storeName?w(In(s,m._defaultConfig)):w(s.name+"/")}).then(function(w){for(var x=localStorage.length-1;x>=0;x--){var k=localStorage.key(x);k.indexOf(w)===0&&localStorage.removeItem(k)}}):b.reject("Invalid arguments"),C(v,a),v}var mr={_driver:"localStorageWrapper",_initStorage:or,_support:nr(),iterate:cr,getItem:ar,setItem:fr,removeItem:dr,clear:sr,length:hr,key:ur,keys:lr,dropInstance:pr},gr=function(s,a){return s===a||typeof s=="number"&&typeof a=="number"&&isNaN(s)&&isNaN(a)},vr=function(s,a){for(var c=s.length,v=0;v<c;){if(gr(s[v],a))return!0;v++}return!1},Rn=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},Pt={},Pn={},kt={INDEXEDDB:Ui,WEBSQL:er,LOCALSTORAGE:mr},yr=[kt.INDEXEDDB._driver,kt.WEBSQL._driver,kt.LOCALSTORAGE._driver],jt=["dropInstance"],xe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(jt),wr={description:"",driver:yr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function br(s,a){s[a]=function(){var c=arguments;return s.ready().then(function(){return s[a].apply(s,c)})}}function Ce(){for(var s=1;s<arguments.length;s++){var a=arguments[s];if(a)for(var c in a)a.hasOwnProperty(c)&&(Rn(a[c])?arguments[0][c]=a[c].slice():arguments[0][c]=a[c])}return arguments[0]}var Sr=function(){function s(a){for(var c in r(this,s),kt)if(kt.hasOwnProperty(c)){var v=kt[c],m=v._driver;this[c]=m,Pt[m]||this.defineDriver(v)}this._defaultConfig=Ce({},wr),this._config=Ce({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(a){if((a===void 0?"undefined":i(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var c in a){if(c==="storeName"&&(a[c]=a[c].replace(/\W/g,"_")),c==="version"&&typeof a[c]!="number")return new Error("Database version must be a number.");this._config[c]=a[c]}return!("driver"in a)||!a.driver||this.setDriver(this._config.driver)}return typeof a=="string"?this._config[a]:this._config},s.prototype.defineDriver=function(a,c,v){var m=new b(function(w,x){try{var k=a._driver,z=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void x(z);for(var _=xe.concat("_initStorage"),M=0,A=_.length;M<A;M++){var N=_[M];if((!vr(jt,N)||a[N])&&typeof a[N]!="function")return void x(z)}var F=function(){for(var G=function(Cr){return function(){var Er=new Error("Method "+Cr+" is not implemented by the current driver"),Ln=b.reject(Er);return C(Ln,arguments[arguments.length-1]),Ln}},at=0,Ee=jt.length;at<Ee;at++){var ke=jt[at];a[ke]||(a[ke]=G(ke))}};F();var $=function(G){Pt[k]&&console.info("Redefining LocalForage driver: "+k),Pt[k]=a,Pn[k]=G,w()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then($,x):$(!!a._support):$(!0)}catch(G){x(G)}});return E(m,c,v),m},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(a,c,v){var m=Pt[a]?b.resolve(Pt[a]):b.reject(new Error("Driver not found."));return E(m,c,v),m},s.prototype.getSerializer=function(a){var c=b.resolve(Se);return E(c,a),c},s.prototype.ready=function(a){var c=this,v=c._driverSet.then(function(){return c._ready===null&&(c._ready=c._initDriver()),c._ready});return E(v,a,a),v},s.prototype.setDriver=function(a,c,v){var m=this;Rn(a)||(a=[a]);var w=this._getSupportedDrivers(a);function x(){m._config.driver=m.driver()}function k(M){return m._extend(M),x(),m._ready=m._initStorage(m._config),m._ready}function z(M){return function(){var A=0;function N(){for(;A<M.length;){var F=M[A];return A++,m._dbInfo=null,m._ready=null,m.getDriver(F).then(k).catch(N)}x();var $=new Error("No available storage method found.");return m._driverSet=b.reject($),m._driverSet}return N()}}var _=this._driverSet!==null?this._driverSet.catch(function(){return b.resolve()}):b.resolve();return this._driverSet=_.then(function(){var M=w[0];return m._dbInfo=null,m._ready=null,m.getDriver(M).then(function(A){m._driver=A._driver,x(),m._wrapLibraryMethodsWithReady(),m._initDriver=z(w)})}).catch(function(){x();var M=new Error("No available storage method found.");return m._driverSet=b.reject(M),m._driverSet}),E(this._driverSet,c,v),this._driverSet},s.prototype.supports=function(a){return!!Pn[a]},s.prototype._extend=function(a){Ce(this,a)},s.prototype._getSupportedDrivers=function(a){for(var c=[],v=0,m=a.length;v<m;v++){var w=a[v];this.supports(w)&&c.push(w)}return c},s.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,c=xe.length;a<c;a++)br(this,xe[a])},s.prototype.createInstance=function(a){return new s(a)},s}(),xr=new Sr;e.exports=xr},{3:3}]},{},[4])(4),ei={exports:{}};/*!
|
|
1
|
+
import{h as zr,openBlock as W,createElementBlock as et,normalizeStyle as vt,renderSlot as pt,reactive as Dn,computed as mt,defineComponent as At,ref as it,onMounted as ze,onUpdated as Mr,nextTick as Me,normalizeClass as _r,createElementVNode as K,createCommentVNode as zt,createVNode as Tn,Transition as Bn,withCtx as Ft,withModifiers as Nn,getCurrentInstance as Ir,watch as $t,onBeforeUnmount as Rr,createTextVNode as On,resolveComponent as Un,createBlock as ct,withDirectives as Pr,Fragment as yt,toDisplayString as Ar,vShow as Lr,markRaw as Dr,toRefs as Tr,renderList as Mt,resolveDynamicComponent as wt}from"vue";import Br from"axios";import{Client as Nr,ClientContext as _e}from"@hprose/rpc-core";import{ByteStream as jn}from"@hprose/io";import{HttpTransport as Or}from"@hprose/rpc-html5";var Ur={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((i,r)=>(i.size=r===e?i.max:i.min,r!==e&&(n+=i.min),i)),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:i}="ontouchstart"in window&&t.touches?t.touches[0]:t;return{x:n-e.left,y:i-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 i=0+(this.pushOtherPanes?0:n.prevPanesSize),r=100-(this.pushOtherPanes?0:n.nextPanesSize),o=Math.max(Math.min(this.getCurrentDragPercentage(t),r),i);let u=[e,e+1],p=this.panes[u[0]]||null,v=this.panes[u[1]]||null;const b=p.max<100&&o>=p.max+n.prevPanesSize,C=v.max<100&&o<=100-(v.max+this.sumNextPanesSize(e+1));if(b||C)b?(p.size=p.max,v.size=Math.max(100-p.max-n.prevPanesSize-n.nextPanesSize,0)):(p.size=Math.max(100-v.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),v.size=v.max);else{if(this.pushOtherPanes){const E=this.doPushOtherPanes(n,o);if(!E)return;({sums:n,panesToResize:u}=E),p=this.panes[u[0]]||null,v=this.panes[u[1]]||null}p!==null&&(p.size=Math.min(Math.max(o-n.prevPanesSize-n.prevReachedMinPanes,p.min),p.max)),v!==null&&(v.size=Math.min(Math.max(100-o-n.nextPanesSize-n.nextReachedMinPanes,v.min),v.max))}},doPushOtherPanes(t,e){const n=this.touch.activeSplitter,i=[n,n+1];return e<t.prevPanesSize+this.panes[i[0]].min&&(i[0]=this.findPrevExpandedPane(n).index,t.prevReachedMinPanes=0,i[0]<n&&this.panes.forEach((r,o)=>{o>i[0]&&o<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),t.prevPanesSize=this.sumPrevPanesSize(i[0]),i[0]===void 0)?(t.prevReachedMinPanes=0,this.panes[0].size=this.panes[0].min,this.panes.forEach((r,o)=>{o>0&&o<=n&&(r.size=r.min,t.prevReachedMinPanes+=r.min)}),this.panes[i[1]].size=100-t.prevReachedMinPanes-this.panes[0].min-t.prevPanesSize-t.nextPanesSize,null):e>100-t.nextPanesSize-this.panes[i[1]].min&&(i[1]=this.findNextExpandedPane(n).index,t.nextReachedMinPanes=0,i[1]>n+1&&this.panes.forEach((r,o)=>{o>n&&o<i[1]&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),t.nextPanesSize=this.sumNextPanesSize(i[1]-1),i[1]===void 0)?(t.nextReachedMinPanes=0,this.panes[this.panesCount-1].size=this.panes[this.panesCount-1].min,this.panes.forEach((r,o)=>{o<this.panesCount-1&&o>=n+1&&(r.size=r.min,t.nextReachedMinPanes+=r.min)}),this.panes[i[0]].size=100-t.prevPanesSize-t.nextReachedMinPanes-this.panes[this.panesCount-1].min-t.nextPanesSize,null):{sums:t,panesToResize:i}},sumPrevPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i<t?n.size:0),0)},sumNextPanesSize(t){return this.panes.reduce((e,n,i)=>e+(i>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 i=t-1,r=document.createElement("div");r.classList.add("splitpanes__splitter"),n||(r.onmousedown=o=>this.onMouseDown(o,i),typeof window<"u"&&"ontouchstart"in window&&(r.ontouchstart=o=>this.onMouseDown(o,i)),r.onclick=o=>this.onSplitterClick(o,i+1)),this.dblClickSplitter&&(r.ondblclick=o=>this.onSplitterDblClick(o,i+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(([i,r])=>n[i]=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),i=parseFloat(t.maxSize);this.panes.splice(e,0,{id:t._.uid,index:e,min:isNaN(n)?0:n,max:isNaN(i)?100:i,size:t.size===null?null:parseFloat(t.size),givenSize:t.size,update:t.update}),this.panes.forEach((r,o)=>r.index=o),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(i=>i.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((i,r)=>i.index=r),this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({removedPane:{...n,index:e}}),this.$emit("pane-remove",{removed:n,panes:this.panes.map(i=>({min:i.min,max:i.max,size:i.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=[],i=[];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&&i.push(r.id)}),e>.1&&this.readjustSizes(e,n,i)},initialPanesSizing(){let t=100;const e=[],n=[];let i=0;this.panes.forEach(o=>{t-=o.size,o.size!==null&&i++,o.size>=o.max&&e.push(o.id),o.size<=o.min&&n.push(o.id)});let r=100;t>.1&&(this.panes.forEach(o=>{o.size===null&&(o.size=Math.max(Math.min(t/(this.panesCount-i),o.max),o.min)),r-=o.size}),r>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const i=[],r=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(o=>{n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),!(Math.abs(n)<.1)&&(this.panes.forEach(o=>{t&&t.givenSize!==null&&t.id===o.id||(o.size=Math.max(Math.min(e,o.max),o.min)),n-=o.size,o.size>=o.max&&i.push(o.id),o.size<=o.min&&r.push(o.id)}),n>.1&&this.readjustSizes(n,i,r))},readjustSizes(t,e,n){let i;i=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(r=>{if(t>0&&!e.includes(r.id)){const o=Math.max(Math.min(r.size+i,r.max),r.min);t-=o-r.size,r.size=o}else if(!n.includes(r.id)){const o=Math.max(Math.min(r.size+i,r.max),r.min);t-=o-r.size,r.size=o}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?i=>this.onSplitterDblClick(i,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 zr("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},Ie={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})}}};Ie.render=function(t,e,n,i,r,o){return W(),et("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=u=>o.onPaneClick(u,t._.uid)),style:vt(t.style)},[pt(t.$slots,"default")],4)},Ie.__file="src/controls/splitpanes/pane.vue";var _t=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},jr={exports:{}},Re=jr.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(S,l){var f=S[0],d=S[1],h=S[2],g=S[3];d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+l[0]-680876936|0)<<7|f>>>25)+d|0)&d|~f&h)+l[1]-389564586|0)<<12|g>>>20)+f|0)&f|~g&d)+l[2]+606105819|0)<<17|h>>>15)+g|0)&g|~h&f)+l[3]-1044525330|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+l[4]-176418897|0)<<7|f>>>25)+d|0)&d|~f&h)+l[5]+1200080426|0)<<12|g>>>20)+f|0)&f|~g&d)+l[6]-1473231341|0)<<17|h>>>15)+g|0)&g|~h&f)+l[7]-45705983|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+l[8]+1770035416|0)<<7|f>>>25)+d|0)&d|~f&h)+l[9]-1958414417|0)<<12|g>>>20)+f|0)&f|~g&d)+l[10]-42063|0)<<17|h>>>15)+g|0)&g|~h&f)+l[11]-1990404162|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&h|~d&g)+l[12]+1804603682|0)<<7|f>>>25)+d|0)&d|~f&h)+l[13]-40341101|0)<<12|g>>>20)+f|0)&f|~g&d)+l[14]-1502002290|0)<<17|h>>>15)+g|0)&g|~h&f)+l[15]+1236535329|0)<<22|d>>>10)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+l[1]-165796510|0)<<5|f>>>27)+d|0)&h|d&~h)+l[6]-1069501632|0)<<9|g>>>23)+f|0)&d|f&~d)+l[11]+643717713|0)<<14|h>>>18)+g|0)&f|g&~f)+l[0]-373897302|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+l[5]-701558691|0)<<5|f>>>27)+d|0)&h|d&~h)+l[10]+38016083|0)<<9|g>>>23)+f|0)&d|f&~d)+l[15]-660478335|0)<<14|h>>>18)+g|0)&f|g&~f)+l[4]-405537848|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+l[9]+568446438|0)<<5|f>>>27)+d|0)&h|d&~h)+l[14]-1019803690|0)<<9|g>>>23)+f|0)&d|f&~d)+l[3]-187363961|0)<<14|h>>>18)+g|0)&f|g&~f)+l[8]+1163531501|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d&g|h&~g)+l[13]-1444681467|0)<<5|f>>>27)+d|0)&h|d&~h)+l[2]-51403784|0)<<9|g>>>23)+f|0)&d|f&~d)+l[7]+1735328473|0)<<14|h>>>18)+g|0)&f|g&~f)+l[12]-1926607734|0)<<20|d>>>12)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+l[5]-378558|0)<<4|f>>>28)+d|0)^d^h)+l[8]-2022574463|0)<<11|g>>>21)+f|0)^f^d)+l[11]+1839030562|0)<<16|h>>>16)+g|0)^g^f)+l[14]-35309556|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+l[1]-1530992060|0)<<4|f>>>28)+d|0)^d^h)+l[4]+1272893353|0)<<11|g>>>21)+f|0)^f^d)+l[7]-155497632|0)<<16|h>>>16)+g|0)^g^f)+l[10]-1094730640|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+l[13]+681279174|0)<<4|f>>>28)+d|0)^d^h)+l[0]-358537222|0)<<11|g>>>21)+f|0)^f^d)+l[3]-722521979|0)<<16|h>>>16)+g|0)^g^f)+l[6]+76029189|0)<<23|d>>>9)+h|0,d=((d+=((h=((h+=((g=((g+=((f=((f+=(d^h^g)+l[9]-640364487|0)<<4|f>>>28)+d|0)^d^h)+l[12]-421815835|0)<<11|g>>>21)+f|0)^f^d)+l[15]+530742520|0)<<16|h>>>16)+g|0)^g^f)+l[2]-995338651|0)<<23|d>>>9)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+l[0]-198630844|0)<<6|f>>>26)+d|0)|~h))+l[7]+1126891415|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+l[14]-1416354905|0)<<15|h>>>17)+g|0)|~f))+l[5]-57434055|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+l[12]+1700485571|0)<<6|f>>>26)+d|0)|~h))+l[3]-1894986606|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+l[10]-1051523|0)<<15|h>>>17)+g|0)|~f))+l[1]-2054922799|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+l[8]+1873313359|0)<<6|f>>>26)+d|0)|~h))+l[15]-30611744|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+l[6]-1560198380|0)<<15|h>>>17)+g|0)|~f))+l[13]+1309151649|0)<<21|d>>>11)+h|0,d=((d+=((g=((g+=(d^((f=((f+=(h^(d|~g))+l[4]-145523070|0)<<6|f>>>26)+d|0)|~h))+l[11]-1120210379|0)<<10|g>>>22)+f|0)^((h=((h+=(f^(g|~d))+l[2]+718787259|0)<<15|h>>>17)+g|0)|~f))+l[9]-343485551|0)<<21|d>>>11)+h|0,S[0]=f+S[0]|0,S[1]=d+S[1]|0,S[2]=h+S[2]|0,S[3]=g+S[3]|0}function i(S){var l,f=[];for(l=0;l<64;l+=4)f[l>>2]=S.charCodeAt(l)+(S.charCodeAt(l+1)<<8)+(S.charCodeAt(l+2)<<16)+(S.charCodeAt(l+3)<<24);return f}function r(S){var l,f=[];for(l=0;l<64;l+=4)f[l>>2]=S[l]+(S[l+1]<<8)+(S[l+2]<<16)+(S[l+3]<<24);return f}function o(S){var l,f,d,h,g,L,I=S.length,R=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=I;l+=64)n(R,i(S.substring(l-64,l)));for(f=(S=S.substring(l-64)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<f;l+=1)d[l>>2]|=S.charCodeAt(l)<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(n(R,d),l=0;l<16;l+=1)d[l]=0;return h=(h=8*I).toString(16).match(/(.*?)(.{0,8})$/),g=parseInt(h[2],16),L=parseInt(h[1],16)||0,d[14]=g,d[15]=L,n(R,d),R}function u(S){var l,f,d,h,g,L,I=S.length,R=[1732584193,-271733879,-1732584194,271733878];for(l=64;l<=I;l+=64)n(R,r(S.subarray(l-64,l)));for(f=(S=l-64<I?S.subarray(l-64):new Uint8Array(0)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],l=0;l<f;l+=1)d[l>>2]|=S[l]<<(l%4<<3);if(d[l>>2]|=128<<(l%4<<3),l>55)for(n(R,d),l=0;l<16;l+=1)d[l]=0;return h=(h=8*I).toString(16).match(/(.*?)(.{0,8})$/),g=parseInt(h[2],16),L=parseInt(h[1],16)||0,d[14]=g,d[15]=L,n(R,d),R}function p(S){var l,f="";for(l=0;l<4;l+=1)f+=e[S>>8*l+4&15]+e[S>>8*l&15];return f}function v(S){var l;for(l=0;l<S.length;l+=1)S[l]=p(S[l]);return S.join("")}function b(S){return/[\u0080-\uFFFF]/.test(S)&&(S=unescape(encodeURIComponent(S))),S}function C(S,l){var f,d=S.length,h=new ArrayBuffer(d),g=new Uint8Array(h);for(f=0;f<d;f+=1)g[f]=S.charCodeAt(f);return l?g:h}function E(S){return String.fromCharCode.apply(null,new Uint8Array(S))}function A(S,l,f){var d=new Uint8Array(S.byteLength+l.byteLength);return d.set(new Uint8Array(S)),d.set(new Uint8Array(l),S.byteLength),f?d:d.buffer}function D(S){var l,f=[],d=S.length;for(l=0;l<d-1;l+=2)f.push(parseInt(S.substr(l,2),16));return String.fromCharCode.apply(String,f)}function P(){this.reset()}return v(o("hello")),typeof ArrayBuffer>"u"||ArrayBuffer.prototype.slice||function(){function S(l,f){return(l=0|l||0)<0?Math.max(l+f,0):Math.min(l,f)}ArrayBuffer.prototype.slice=function(l,f){var d,h,g,L,I=this.byteLength,R=S(l,I),O=I;return f!==t&&(O=S(f,I)),R>O?new ArrayBuffer(0):(d=O-R,h=new ArrayBuffer(d),g=new Uint8Array(h),L=new Uint8Array(this,R,d),g.set(L),h)}}(),P.prototype.append=function(S){return this.appendBinary(b(S)),this},P.prototype.appendBinary=function(S){this._buff+=S,this._length+=S.length;var l,f=this._buff.length;for(l=64;l<=f;l+=64)n(this._hash,i(this._buff.substring(l-64,l)));return this._buff=this._buff.substring(l-64),this},P.prototype.end=function(S){var l,f,d=this._buff,h=d.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<h;l+=1)g[l>>2]|=d.charCodeAt(l)<<(l%4<<3);return this._finish(g,h),f=v(this._hash),S&&(f=D(f)),this.reset(),f},P.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},P.prototype.setState=function(S){return this._buff=S.buff,this._length=S.length,this._hash=S.hash,this},P.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},P.prototype._finish=function(S,l){var f,d,h,g=l;if(S[g>>2]|=128<<(g%4<<3),g>55)for(n(this._hash,S),g=0;g<16;g+=1)S[g]=0;f=(f=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(f[2],16),h=parseInt(f[1],16)||0,S[14]=d,S[15]=h,n(this._hash,S)},P.hash=function(S,l){return P.hashBinary(b(S),l)},P.hashBinary=function(S,l){var f=v(o(S));return l?D(f):f},P.ArrayBuffer=function(){this.reset()},P.ArrayBuffer.prototype.append=function(S){var l,f=A(this._buff.buffer,S,!0),d=f.length;for(this._length+=S.byteLength,l=64;l<=d;l+=64)n(this._hash,r(f.subarray(l-64,l)));return this._buff=l-64<d?new Uint8Array(f.buffer.slice(l-64)):new Uint8Array(0),this},P.ArrayBuffer.prototype.end=function(S){var l,f,d=this._buff,h=d.length,g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(l=0;l<h;l+=1)g[l>>2]|=d[l]<<(l%4<<3);return this._finish(g,h),f=v(this._hash),S&&(f=D(f)),this.reset(),f},P.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},P.ArrayBuffer.prototype.getState=function(){var S=P.prototype.getState.call(this);return S.buff=E(S.buff),S},P.ArrayBuffer.prototype.setState=function(S){return S.buff=C(S.buff,!0),P.prototype.setState.call(this,S)},P.ArrayBuffer.prototype.destroy=P.prototype.destroy,P.ArrayBuffer.prototype._finish=P.prototype._finish,P.ArrayBuffer.hash=function(S,l){var f=v(u(new Uint8Array(S)));return l?D(f):f},P}();const Pe=[];class ot{static addHandler(e,n,i){e.addEventListener?e.addEventListener(n,i,!1):e.attachEvent?e.attachEvent("on"+n,i):e["on"+n]=i}static windowResizeHandler(e){ot.addHandler(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 i=window.document;let r=window.document.exitFullscreen||i.msExitFullscreen||i.mozCancelFullScreen||i.webkitCancelFullScreen;typeof r<"u"&&r?r.call(window.document):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}else{let i=e;i||(i=window.document.documentElement);let r=i.requestFullScreen||i.webkitRequestFullScreen||i.mozRequestFullScreen||i.msRequestFullScreen;typeof r<"u"&&r?r.call(i):typeof window.ActiveXObject<"u"&&new window.ActiveXObject("WScript.Shell")?.SendKeys("{F11}")}}static requestFullScreen(e=window.document.documentElement){let n=e;var i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i)i.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 i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ot.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 i=ot.isFullScreen();e(i)}):document.addEventListener("MSFullscreenChange",function(){const i=ot.isFullScreen();e(i)})}static stringifyCircularHandler(e,n){if(typeof n=="object"&&n!==null){if(Pe.indexOf(n)!==-1)return;Pe.push(n)}return n}static jsonStringify(e){if(!e)return"";const n=JSON.stringify(e,ot.stringifyCircularHandler);return Pe.length=0,n}static jsonParse(e){const n=ot.jsonStringify(e);if(n.length>1)return JSON.parse(n)}static getObjectURL(e){let n;const i=window;return i.createObjcectURL!=null?n=i.createOjcectURL(e):window.URL!=null?n=window.URL.createObjectURL(e):window.webkitURL!=null&&(n=window.webkitURL.createObjectURL(e)),n}static getFileShortMD5(e,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,o=e,u=2097152,p=new Re.ArrayBuffer,v=new FileReader;v.onload=function(b){p.append(b.target?.result);const C=p.end();n({isOK:!0,data:C})},v.onerror=function(){const b="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(b),n({isOK:!1,data:b})},function(){const b=0+u>=o.size?o.size:0+u;v.readAsArrayBuffer(r.call(o,0,b))}()}static getFileMD5(e,n){const i=File.prototype,r=i.slice||i.mozSlice||i.webkitSlice,o=e,u=2097152,p=Math.ceil(o.size/u);let v=0;const b=new Re.ArrayBuffer,C=new FileReader;function E(){const A=v*u,D=A+u>=o.size?o.size:A+u;C.readAsArrayBuffer(r.call(o,A,D))}C.onload=function(A){if(b.append(A.target?.result),v++,v<p)E();else{const D=b.end();n({isOK:!0,data:D})}},C.onerror=function(){const A=`${o.name}:\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01`;console.warn(A),n({isOK:!1,data:A})},E()}static MD5(e,n=!1){return Re.hash(e,n)}static copyText=e=>new Promise((n,i)=>{const r=document.createElement("input");r.value=e,document.body.appendChild(r),r.select(),document.execCommand("copy"),r.remove(),n(!0)});static setGrayMode(e){ot.toggleClass(e,"grayMode",document.documentElement)}static toggleClass(e,n,i){const r=i||document.body;let{className:o}=r;o=o.replace(n,""),r.className=e?`${o} ${n} `:o}static setCssVar(e,n,i=document.documentElement){i.style.setProperty(e,n)}}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,i)=>i.toUpperCase()).replace("views","")}}class Wt{prefixKey;storage;constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,i=604800){const r=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(e),r)}get(e,n=null){const i=this.storage.getItem(this.getKey(e));if(i)try{const r=JSON.parse(i),{value:o,expire:u}=r;if(u===null||u>=Date.now())return o;this.remove(this.getKey(e))}catch{return n}return n}getJsonObject(e){const n=this.storage.getItem(this.getKey(e));if(n)try{const i=JSON.parse(n);if(i.expire===null||i.expire>=Date.now())return i;this.remove(this.getKey(e))}catch{return}}remove(e){this.storage.removeItem(this.getKey(e))}clear(){this.storage.clear()}setCookie(e,n,i=604800){document.cookie=`${this.getKey(e)}=${n}; Max-Age=${i}`}getCookie(e){const n=document.cookie.split("; ");for(let i=0,r=n.length;i<r;i++){const o=n[i].split("=");if(o[0]===this.getKey(e))return o[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 Fr=new Wt("",localStorage);function qt(){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 i=3&Number(t[19])|8;return t[19]=e.substring(i,i+1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function $r(){var t=new Date().getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var i=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(n==="x"?i:3&i|8).toString(16)});return e}function Hr(t){const e=t.toLowerCase().replace(/rgb?a?\(/,"").replace(/\)/,"").replace(/[\s+]/g,"").split(","),n=parseFloat(e[3]||"1"),i=Math.floor(n*parseInt(e[0])+255*(1-n)),r=Math.floor(n*parseInt(e[1])+255*(1-n)),o=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+o.toString(16)).slice(-2)}function Wr(t){var e=t.toLowerCase();if(Gt(t)){if(e.length===4){for(var n="#",i=1;i<4;i+=1){const o=e.slice(i,i+1);n+=o.concat(o)}e=n}var r=[];for(i=1;i<7;i+=2)r.push(parseInt("0x"+e.slice(i,i+2)));return"rgb("+r.join(",")+")"}return e}function qr(t){const e=t;if(e.length===4){let i="#";for(var n=1;n<4;n+=1){const r=e.slice(n,n+1);i+=r.concat(r)}return i}return e}var bt;function Gr(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substring(0,1);return e==="#"?bt.Hex:e==="r"||e==="("?bt.RGBA:e==="h"?bt.Hsla:bt.RGBA}function Xr(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,i,r,o=(parseFloat(e[1])%360+360)%360/360,u=parseFloat(e[2])/(/%$/.test(e[2])?100:1),p=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(u===0)n=i=r=p;else{var v=p<=.5?p*(u+1):p+u-p*u,b=2*p-v;n=Ae(b,v,o+1/3),i=Ae(b,v,o),r=Ae(b,v,o-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${r=Math.round(255*r)},${e[4]?parseFloat(e[4]):1})`}}}function Ae(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 Gt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function Kr(t,e,n){const i=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function Le(t){let e=t.toLowerCase();if(Gt(t)){if(e.length===4){let i="#";for(let r=1;r<4;r+=1)i+=e.slice(r,r+1).concat(e.slice(r,r+1));e=i}const n=[];for(let i=1;i<7;i+=2)n.push(parseInt("0x"+e.slice(i,i+2)));return"RGB("+n.join(",")+")"}return e}function Vr(t){if(!Gt(t))return;const[e,n,i]=Le(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*i<192}function Yr(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Te(t.substring(0,2),e)}${Te(t.substring(2,4),e)}${Te(t.substring(4,6),e)}`}function Jr(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${De(t.substring(0,2),e)}${De(t.substring(2,4),e)}${De(t.substring(4,6),e)}`}function De(t,e){const n=parseInt(t,16)+e,i=n>255?255:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Fn(t,e,n){const i=[t,e,n].map(r=>(r/=255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function Zr(t){return function(e,n){return(Fn(~~e[0],~~e[1],~~e[2])+.05)/(Fn(n[0],n[1],n[2])+.05)}(Le(t.substring(1)).split(","),[0,0,0])>=12?"#000000":"#FFFFFF"}function Te(t,e){const n=parseInt(t,16)-e,i=n<0?0:n;return i.toString(16).length>1?i.toString(16):`0${i.toString(16)}`}function Be(t){return{all:t=t||new Map,on(e,n){const i=t?.get(e);i&&i.push(n)||t?.set(e,[n])},off(e,n){const i=t?.get(e);i&&i.splice(i.indexOf(n)>>>0,1)},emit(e,n){(t?.get(e)||[]).slice().map(i=>{i(n)}),(t?.get("*")||[]).slice().map(i=>{i(e,n)})}}}(function(t){t[t.RGBA=0]="RGBA",t[t.Hex=1]="Hex",t[t.Hsla=2]="Hsla"})(bt||(bt={}));const It=Be(),nt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetUnLoaded",WidgetVisibleChanged:"WidgetVisibleChanged",AxiosRequestErrorEvent:"AxiosRequestErrorEvent"},Xt=(t,e)=>{const n=document.createElement("a");n.download=e,n.style.display="none";const i=new Blob([t],{type:"application/octet-stream"});n.href=URL.createObjectURL(i),document.body.appendChild(n),n.click(),document.body.removeChild(n)};function Qr(t,e){const n=window.URL||window.webkitURL||window,i=new Blob([t]),r=document.createElement("a");r.href=n.createObjectURL(i),r.download=e,r.click(),n.revokeObjectURL(r.href)}const $n=(t,e)=>{const n=JSON.stringify(t,null,2);e?Xt(n,e+".json"):It.emit(nt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},to=(t,e,n)=>{t.get(e,{responseType:"blob"}).then(function(i){Xt(i.data,n)}).catch(i=>{console.warn(i),It.emit(nt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function Hn(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function eo({url:t,target:e="_blank",fileName:n}){const i=new URL(t).host==location.host;return new Promise((r,o)=>{if(i){const u=document.createElement("a");if(u.href=t,u.target=e,u.download!==void 0&&(u.download=n||Hn(t)),document.createEvent){const p=document.createEvent("MouseEvents");return p.initEvent("click",!0,!0),u.dispatchEvent(p),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const u=document.createElement("canvas"),p=document.createElement("img");p.setAttribute("crossOrigin","Anonymous"),p.src=t,p.onload=v=>{u.width=p.width,u.height=p.height,u.getContext("2d").drawImage(p,0,0,p.width,p.height),u.toBlob(b=>{if(b){const C=document.createElement("a");C.href=window.URL.createObjectURL(b),C.download=Hn(t),C.click(),URL.revokeObjectURL(C.href),r(!0)}},"image/jpeg")},p.onerror=v=>o(v)}})}function no(t){for(var e=new Date().getTime();new Date().getTime()-e<t;);console.log(`\u5F3A\u5236\u7B49\u5F85${t}\u6BEB\u79D2`)}const B={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:Br},Wn="access_token",ut=new Wt("user",localStorage);function St(){return ut.get(Wn)}function Ne(){ut.remove(Wn)}function qn(){return St()?.refresh}const io=Object.prototype.toString;function J(t,e){return io.call(t)===`[object ${e}]`}function Kt(t){return J(t,"Function")}const Gn=t=>typeof t<"u",Oe=t=>!Gn(t);function Ue(t){return t===null}function ro(t){return Oe(t)&&Ue(t)}function oo(t){return Oe(t)||Ue(t)}const xt=t=>t!==null&&J(t,"Object");function so(t){return J(t,"Date")}function ao(t){return J(t,"Number")}function co(t){return J(t,"AsyncFunction")}function uo(t){return J(t,"Promise")&&xt(t)&&Kt(t.then)&&Kt(t.catch)}function je(t){return J(t,"String")}function lo(t){return t===!0||t===!1||J(t,"Boolean")}function Fe(t){return t&&Array.isArray(t)}const ho=()=>typeof window<"u",fo=t=>typeof window<"u"&&J(t,"Window"),po=t=>xt(t)&&!!t.tagName,mo=typeof window>"u";function go(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function vo(t){return t==null||(je(t)||Fe(t)?t.length===0:!!xt(t)&&JSON.stringify(t)==="{}")}function yo(t){return J(t,"Error")}function wo(t){return J(t,"WeakSet")}function bo(t){return J(t,"WeakMap")}function So(t){return J(t,"Symbol")}function xo(t){return J(t,"Map")}const Co=t=>/^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/.test(t);function $e(t,e,n,i="json",r){const o={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,headers:{"Content-Type":"application/json",Authorization:"bearer "+St()?.token},responseType:i,cancelToken:r};if(n)for(let u in n)o.headers[u]=n[u];return B.SystemID&&(o.headers.sysid=B.SystemID,B.SystemGroup&&(o.headers.sysgroup=B.SystemGroup)),e&&(o.baseURL=e),o}function lt(t,e,n,i,r="json",o,u){const p=$e(n,e,i,r,o);return u&&u>=2e4&&(p.timeout=u),B.Axios?.get(t,p).catch(function(v){Vt(v,e,t,"Get")})}function Vt(t,e,n,i="Get"){const r=`${e}${n}`;if(t&&t.response){let o=!1;const u=t.response.status;switch(u){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 v=t.response.data;if(v){const b=v.indexOf(":"),C=v.indexOf(`
|
|
2
|
+
`);if(b>0&&C-b>2){const E=v.substring(b+2,C);E.indexOf("System.Exception")>0?t.message="\u540E\u53F0\u670D\u52A1\u5185\u90E8\u51FA\u9519\uFF01":(o=!0,t.message=E)}}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 p={address:r,code:u,isExceptionInfo:o,message:t.message,result:t.response.data};if(B.EventBus.emit(nt.AxiosRequestErrorEvent,p),o)throw new Error(t.message)}else{if(t?.message)throw new Error(t.message);console.error(t,"Http\u8BF7\u6C42\u9519\u8BEF!")}}function He(t,e,n,i,r,o="json",u){const p=$e(i,e,r,o);u&&u>=2e4&&(p.timeout=u);const v=function(b){let C=new FormData;return b&&Object.keys(b).forEach(E=>{if(!b)return;let A=b[E];A!=null&&(Fe(A)?A.forEach(D=>{C.append(E,Xn(D))}):C.append(E,Xn(A)))}),C}(n);return B.Axios?.post(t,v,p).catch(function(b){Vt(b,e,t,"Post")})}function Eo(t,e,n,i,r,o="json",u){const p=$e(i,e,r,o);return u&&u>=2e4&&(p.timeout=u),B.Axios?.post(t,n,p).catch(function(v){Vt(v,e,t,"Post")})}function ko(t,e){return lt(t,void 0,e)}function zo(t,e){return He(t,void 0,e)}function Mo(t,e){return B.Axios?.get(t,{params:e}).catch(function(n){Vt(n,t,"","\u5916\u90E8Get")})}function Xn(t){return t instanceof Blob?t:t.toString()}var We={exports:{}},_o=typeof window<"u"?window:_t!==void 0?_t:typeof self<"u"?self:{},Io=function(t){if(!t)return!1;var e=Ro.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)},Ro=Object.prototype.toString,qe=function(t){return t.replace(/^\s+|\s+$/g,"")},Po=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)Ao.call(n,i)&&(t[i]=n[i])}return t},Ao=Object.prototype.hasOwnProperty,Kn=_o,Lo=Io,Do=function(t){if(!t)return{};for(var e,n={},i=qe(t).split(`
|
|
3
|
+
`),r=0;r<i.length;r++){var o=i[r],u=o.indexOf(":"),p=qe(o.slice(0,u)).toLowerCase(),v=qe(o.slice(u+1));n[p]===void 0?n[p]=v:(e=n[p],Object.prototype.toString.call(e)==="[object Array]"?n[p].push(v):n[p]=[n[p],v])}return n},To=Po;function Vn(t,e,n){var i=t;return Lo(e)?(n=e,typeof t=="string"&&(i={uri:t})):i=To(e,{uri:t}),i.callback=n,i}function ht(t,e,n){return Yn(e=Vn(t,e,n))}function Yn(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(f,d,h){e||(e=!0,t.callback(f,d,h))};function i(){var f=void 0;if(f=v.response?v.response:v.responseText||function(d){try{if(d.responseType==="document")return d.responseXML;var h=d.responseXML&&d.responseXML.documentElement.nodeName==="parsererror";if(d.responseType===""&&!h)return d.responseXML}catch{}return null}(v),S)try{f=JSON.parse(f)}catch{}return f}function r(f){return clearTimeout(b),f instanceof Error||(f=new Error(""+(f||"Unknown XMLHttpRequest Error"))),f.statusCode=0,n(f,l)}function o(){if(!p){var f;clearTimeout(b),f=t.useXDR&&v.status===void 0?200:v.status===1223?204:v.status;var d=l,h=null;return f!==0?(d={body:i(),statusCode:f,method:E,headers:{},url:C,rawRequest:v},v.getAllResponseHeaders&&(d.headers=Do(v.getAllResponseHeaders()))):h=new Error("Internal XMLHttpRequest Error"),n(h,d,d.body)}}var u,p,v=t.xhr||null;v||(v=t.cors||t.useXDR?new ht.XDomainRequest:new ht.XMLHttpRequest);var b,C=v.url=t.uri||t.url,E=v.method=t.method||"GET",A=t.body||t.data,D=v.headers=t.headers||{},P=!!t.sync,S=!1,l={body:void 0,headers:{},statusCode:0,method:E,url:C,rawRequest:v};if("json"in t&&t.json!==!1&&(S=!0,D.accept||D.Accept||(D.Accept="application/json"),E!=="GET"&&E!=="HEAD"&&(D["content-type"]||D["Content-Type"]||(D["Content-Type"]="application/json"),A=JSON.stringify(t.json===!0?A:t.json))),v.onreadystatechange=function(){v.readyState===4&&setTimeout(o,0)},v.onload=o,v.onerror=r,v.onprogress=function(){},v.onabort=function(){p=!0},v.ontimeout=r,v.open(E,C,!P,t.username,t.password),P||(v.withCredentials=!!t.withCredentials),!P&&t.timeout>0&&(b=setTimeout(function(){if(!p){p=!0,v.abort("timeout");var f=new Error("XMLHttpRequest timeout");f.code="ETIMEDOUT",r(f)}},t.timeout)),v.setRequestHeader)for(u in D)D.hasOwnProperty(u)&&v.setRequestHeader(u,D[u]);else if(t.headers&&!function(f){for(var d in f)if(f.hasOwnProperty(d))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(v.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(v),v.send(A||null),v}We.exports=ht,We.exports.default=ht,ht.XMLHttpRequest=Kn.XMLHttpRequest||function(){},ht.XDomainRequest="withCredentials"in new ht.XMLHttpRequest?ht.XMLHttpRequest:Kn.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){ht[t==="delete"?"del":t]=function(e,n,i){return(n=Vn(e,n,i)).method=t.toUpperCase(),Yn(n)}});const Bo=[200,201,202,204,308],No=[408,502,503,504];class Jn{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=Be(),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,i=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(i,i+n))})}xhrPromise(e){const n=i=>{i.upload.onprogress=r=>{const o=100/this.totalChunks,u=o*this.file.size,p=o*this.chunkCount,v=r.loaded/(r.total??u)*o;this.dispatch("progress",Math.min(p+v,100))}};return new Promise((i,r)=>{this.currentXhr=We.exports({...e,beforeSend:n},(o,u)=>(this.currentXhr=void 0,o?r(o):i(u)))})}sendChunk(){if(!this.chunk)return;const e=this.chunkCount*this.chunkByteSize,n=e+this.chunk.size-1,i={...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:i,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&&Bo.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=100*(this.chunkCount/this.totalChunks*this.file.size)/this.file.size;this.dispatch("progress",n)}else if(e!=null&&No.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 Oo=t=>new Jn(t),Uo=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 Nt{hproseURL;client;hproseProxy;static httpTransport;constructor(e){if(e&&!Ht.isNullOrEmpty(e)){if(Nt.httpTransport||(Nt.httpTransport=new Or),this.client=new Nr(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")):It.emit(nt.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,i){if(this.client)return await this.client.invoke(e,n,i)}encode(e,n,i){if(this.client)return this.client.codec.encode(e,n,i)}decode(e,n){if(this.client)return this.client.codec.decode(e,n)}}class Lt{hproseClient;hpProxyObj;defaultContext=new _e;constructor(e){this.hproseClient=new Nt(e),this.hpProxyObj=null}getClientContext(e,n){const i={};n&&(i.requestHeaders=n);const r=St();i.httpRequestHeaders=e||{};const o=i.httpRequestHeaders;return r&&(o.token=r.token),B.SystemID&&(o.sysid=B.SystemID,B.SystemGroup&&(o.sysgroup=B.SystemGroup)),new _e(i)}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||It.emit(nt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n,i){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,i)}async hproseInvokeContext(e,n,...i){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");const r=St();return console.log(r,"userToken3"),r&&(n||(n=new _e({httpRequestHeaders:{token:r.token}}))),await this.hproseClient.invoke(e,i,n)}async hproseInvokeEncode(e){const n=new jn(e).toBytes(),i=await this.hproseClient.client?.request(n,this.defaultContext);return i&&this.hproseClient.client?.codec.decode(i,this.defaultContext)}encodeRequest(e,...n){const i=this.hproseClient.client?.codec?.encode(e,n,this.defaultContext);return jn.toString(i)}}class jo{message;eventBus;constructor(e,n){e&&(this.message=e),n&&(this.eventBus=n)}msg(e,n=3,i="success"){if(this.message)if(typeof this.message=="function")this.message({type:i,message:e,duration:n});else switch(i){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(i){case"info":case"success":console.log(e);break;case"warning":console.warn(e);break;case"error":i="dark",console.error(e)}this.eventBus&&this.eventBus.emit(nt.AlertInfoEvent,{type:i,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")}}const Ge=new Map,Fo=function(t,e,n){!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),B.Config.DefaultHproseAPI&&Ht.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new Lt(B.Config.DefaultHproseAPI));const i=B.Config.UI.GrayMode;i&&ot.setGrayMode(i);const r=new jo(t,B.EventBus);B.Message=r,B.SystemID=e,B.SystemGroup=n,B.EventBus.on(nt.HproseServiceErrorEvent,o=>{const u=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;r.warn(u)}),B.EventBus.on(nt.WebAPIErrorEvent,o=>{const u=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${o}`;r.warn(u)}),B.EventBus.on(nt.AxiosRequestErrorEvent,o=>{const u=`Http\u8BF7\u6C42'${o.code}'\u9519\u8BEF: ${o.message}`;console.warn("Http\u8BF7\u6C42\u9519\u8BEF",o),r.warn(u)}),B.EventBus.on(nt.CommonWarnEvent,o=>{r.warn(o)})};function Zn(t){if(t&&Ht.isNotEmpty(t)){if(Ge.has(t))return Ge.get(t);{const e=new Lt(t);return Ge.set(t,e),e}}}function $o(t){const e=Zn(t);return e&&(B.DefaultProxyClient=e),e}const Xe="is_LockScreen",Qn=ut.get(Xe,!1),Dt={isLock:Qn,lockTime:Qn=="true"?ei():0};function ti(t){Dt.isLock=t,ut.set(Xe,t,10),t&&(Ne(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Ho(){return ut.get(Xe,!1)}function ei(){let t=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(t=B.Config.UI.LockTime),t}let Ke;function Ve(){clearInterval(Ke),!(window.location.href.indexOf("/login")>0||Dt.isLock)&&(ti(!1),Dt.lockTime=ei(),Ke=setInterval(()=>{if(Dt.lockTime--,Dt.lockTime<=0)return ti(!0),clearInterval(Ke)},1e3))}function Wo(){Ve(),document.addEventListener("mousedown",Ve)}function qo(){document.removeEventListener("mousedown",Ve)}function Ye(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 Go={exports:{}},Yt=Go.exports=function t(e,n,i){function r(p,v){if(!n[p]){if(!e[p]){if(!v&&Ye)return Ye(p);if(o)return o(p,!0);var b=new Error("Cannot find module '"+p+"'");throw b.code="MODULE_NOT_FOUND",b}var C=n[p]={exports:{}};e[p][0].call(C.exports,function(E){var A=e[p][1][E];return r(A||E)},C,C.exports,t,e,n,i)}return n[p].exports}for(var o=Ye,u=0;u<i.length;u++)r(i[u]);return r}({1:[function(t,e,n){(function(i){var r,o,u=i.MutationObserver||i.WebKitMutationObserver;if(u){var p=0,v=new u(A),b=i.document.createTextNode("");v.observe(b,{characterData:!0}),r=function(){b.data=p=++p%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var P=i.document.createElement("script");P.onreadystatechange=function(){A(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},i.document.documentElement.appendChild(P)}:function(){setTimeout(A,0)};else{var C=new i.MessageChannel;C.port1.onmessage=A,r=function(){C.port2.postMessage(0)}}var E=[];function A(){var P,S;o=!0;for(var l=E.length;l;){for(S=E,E=[],P=-1;++P<l;)S[P]();l=E.length}o=!1}function D(P){E.push(P)!==1||o||r()}e.exports=D}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(t,e,n){var i=t(1);function r(){}var o={},u=["REJECTED"],p=["FULFILLED"],v=["PENDING"];function b(h){if(typeof h!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,h!==r&&D(this,h)}function C(h,g,L){this.promise=h,typeof g=="function"&&(this.onFulfilled=g,this.callFulfilled=this.otherCallFulfilled),typeof L=="function"&&(this.onRejected=L,this.callRejected=this.otherCallRejected)}function E(h,g,L){i(function(){var I;try{I=g(L)}catch(R){return o.reject(h,R)}I===h?o.reject(h,new TypeError("Cannot resolve promise with itself")):o.resolve(h,I)})}function A(h){var g=h&&h.then;if(h&&(typeof h=="object"||typeof h=="function")&&typeof g=="function")return function(){g.apply(h,arguments)}}function D(h,g){var L=!1;function I(U){L||(L=!0,o.reject(h,U))}function R(U){L||(L=!0,o.resolve(h,U))}function O(){g(R,I)}var j=P(O);j.status==="error"&&I(j.value)}function P(h,g){var L={};try{L.value=h(g),L.status="success"}catch(I){L.status="error",L.value=I}return L}function S(h){return h instanceof this?h:o.resolve(new this(r),h)}function l(h){var g=new this(r);return o.reject(g,h)}function f(h){var g=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=h.length,I=!1;if(!L)return this.resolve([]);for(var R=new Array(L),O=0,j=-1,U=new this(r);++j<L;)H(h[j],j);return U;function H(tt,X){function Y(q){R[X]=q,++O!==L||I||(I=!0,o.resolve(U,R))}g.resolve(tt).then(Y,function(q){I||(I=!0,o.reject(U,q))})}}function d(h){var g=this;if(Object.prototype.toString.call(h)!=="[object Array]")return this.reject(new TypeError("must be an array"));var L=h.length,I=!1;if(!L)return this.resolve([]);for(var R=-1,O=new this(r);++R<L;)j(h[R]);return O;function j(U){g.resolve(U).then(function(H){I||(I=!0,o.resolve(O,H))},function(H){I||(I=!0,o.reject(O,H))})}}e.exports=b,b.prototype.catch=function(h){return this.then(null,h)},b.prototype.then=function(h,g){if(typeof h!="function"&&this.state===p||typeof g!="function"&&this.state===u)return this;var L=new this.constructor(r);return this.state!==v?E(L,this.state===p?h:g,this.outcome):this.queue.push(new C(L,h,g)),L},C.prototype.callFulfilled=function(h){o.resolve(this.promise,h)},C.prototype.otherCallFulfilled=function(h){E(this.promise,this.onFulfilled,h)},C.prototype.callRejected=function(h){o.reject(this.promise,h)},C.prototype.otherCallRejected=function(h){E(this.promise,this.onRejected,h)},o.resolve=function(h,g){var L=P(A,g);if(L.status==="error")return o.reject(h,L.value);var I=L.value;if(I)D(h,I);else{h.state=p,h.outcome=g;for(var R=-1,O=h.queue.length;++R<O;)h.queue[R].callFulfilled(g)}return h},o.reject=function(h,g){h.state=u,h.outcome=g;for(var L=-1,I=h.queue.length;++L<I;)h.queue[L].callRejected(g);return h},b.resolve=S,b.reject=l,b.all=f,b.race=d},{1:1}],3:[function(t,e,n){(function(i){typeof i.Promise!="function"&&(i.Promise=t(2))}).call(this,_t!==void 0?_t:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(t,e,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function r(s,a){if(!(s instanceof a))throw new TypeError("Cannot call a class as a function")}function o(){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 u=o();function p(){try{if(!u||!u.open)return!1;var s=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),a=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||a)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function v(s,a){s=s||[],a=a||{};try{return new Blob(s,a)}catch(m){if(m.name!=="TypeError")throw m;for(var c=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),y=0;y<s.length;y+=1)c.append(s[y]);return c.getBlob(a.type)}}typeof Promise>"u"&&t(3);var b=Promise;function C(s,a){a&&s.then(function(c){a(null,c)},function(c){a(c)})}function E(s,a,c){typeof a=="function"&&s.then(a),typeof c=="function"&&s.catch(c)}function A(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function D(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",S=void 0,l={},f=Object.prototype.toString,d="readonly",h="readwrite";function g(s){for(var a=s.length,c=new ArrayBuffer(a),y=new Uint8Array(c),m=0;m<a;m++)y[m]=s.charCodeAt(m);return c}function L(s){return new b(function(a){var c=s.transaction(P,h),y=v([""]);c.objectStore(P).put(y,"key"),c.onabort=function(m){m.preventDefault(),m.stopPropagation(),a(!1)},c.oncomplete=function(){var m=navigator.userAgent.match(/Chrome\/(\d+)/),w=navigator.userAgent.match(/Edge\//);a(w||!m||parseInt(m[1],10)>=43)}}).catch(function(){return!1})}function I(s){return typeof S=="boolean"?b.resolve(S):L(s).then(function(a){return S=a})}function R(s){var a=l[s.name],c={};c.promise=new b(function(y,m){c.resolve=y,c.reject=m}),a.deferredOperations.push(c),a.dbReady?a.dbReady=a.dbReady.then(function(){return c.promise}):a.dbReady=c.promise}function O(s){var a=l[s.name].deferredOperations.pop();if(a)return a.resolve(),a.promise}function j(s,a){var c=l[s.name].deferredOperations.pop();if(c)return c.reject(a),c.promise}function U(s,a){return new b(function(c,y){if(l[s.name]=l[s.name]||pn(),s.db){if(!a)return c(s.db);R(s),s.db.close()}var m=[s.name];a&&m.push(s.version);var w=u.open.apply(u,m);a&&(w.onupgradeneeded=function(x){var k=w.result;try{k.createObjectStore(s.storeName),x.oldVersion<=1&&k.createObjectStore(P)}catch(z){if(z.name!=="ConstraintError")throw z;console.warn('The database "'+s.name+'" has been upgraded from version '+x.oldVersion+" to version "+x.newVersion+', but the storage "'+s.storeName+'" already exists.')}}),w.onerror=function(x){x.preventDefault(),y(w.error)},w.onsuccess=function(){var x=w.result;x.onversionchange=function(k){k.target.close()},c(x),O(s)}})}function H(s){return U(s,!1)}function tt(s){return U(s,!0)}function X(s,a){if(!s.db)return!0;var c=!s.db.objectStoreNames.contains(s.storeName),y=s.version<s.db.version,m=s.version>s.db.version;if(y&&(s.version!==a&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),m||c){if(c){var w=s.db.version+1;w>s.version&&(s.version=w)}return!0}return!1}function Y(s){return new b(function(a,c){var y=new FileReader;y.onerror=c,y.onloadend=function(m){var w=btoa(m.target.result||"");a({__local_forage_encoded_blob:!0,data:w,type:s.type})},y.readAsBinaryString(s)})}function q(s){return v([g(atob(s.data))],{type:s.type})}function st(s){return s&&s.__local_forage_encoded_blob}function Ot(s){var a=this,c=a._initReady().then(function(){var y=l[a._dbInfo.name];if(y&&y.dbReady)return y.dbReady});return E(c,s,s),c}function ge(s){R(s);for(var a=l[s.name],c=a.forages,y=0;y<c.length;y++){var m=c[y];m._dbInfo.db&&(m._dbInfo.db.close(),m._dbInfo.db=null)}return s.db=null,H(s).then(function(w){return s.db=w,X(s)?tt(s):w}).then(function(w){s.db=a.db=w;for(var x=0;x<c.length;x++)c[x]._dbInfo.db=w}).catch(function(w){throw j(s,w),w})}function rt(s,a,c,y){y===void 0&&(y=1);try{var m=s.db.transaction(s.storeName,a);c(null,m)}catch(w){if(y>0&&(!s.db||w.name==="InvalidStateError"||w.name==="NotFoundError"))return b.resolve().then(function(){if(!s.db||w.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),tt(s)}).then(function(){return ge(s).then(function(){rt(s,a,c,y-1)})}).catch(c);c(w)}}function pn(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ri(s){var a=this,c={db:null};if(s)for(var y in s)c[y]=s[y];var m=l[c.name];m||(m=pn(),l[c.name]=m),m.forages.push(a),a._initReady||(a._initReady=a.ready,a.ready=Ot);var w=[];function x(){return b.resolve()}for(var k=0;k<m.forages.length;k++){var z=m.forages[k];z!==a&&w.push(z._initReady().catch(x))}var M=m.forages.slice(0);return b.all(w).then(function(){return c.db=m.db,H(c)}).then(function(_){return c.db=_,X(c,a._defaultConfig.version)?tt(c):_}).then(function(_){c.db=m.db=_,a._dbInfo=c;for(var T=0;T<M.length;T++){var N=M[T];N!==a&&(N._dbInfo.db=c.db,N._dbInfo.version=c.version)}})}function Pi(s,a){var c=this;s=A(s);var y=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).get(s);z.onsuccess=function(){var M=z.result;M===void 0&&(M=null),st(M)&&(M=q(M)),m(M)},z.onerror=function(){w(z.error)}}catch(M){w(M)}})}).catch(w)});return C(y,a),y}function Ai(s,a){var c=this,y=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).openCursor(),M=1;z.onsuccess=function(){var _=z.result;if(_){var T=_.value;st(T)&&(T=q(T));var N=s(T,_.key,M++);N!==void 0?m(N):_.continue()}else m()},z.onerror=function(){w(z.error)}}catch(_){w(_)}})}).catch(w)});return C(y,a),y}function Li(s,a,c){var y=this;s=A(s);var m=new b(function(w,x){var k;y.ready().then(function(){return k=y._dbInfo,f.call(a)==="[object Blob]"?I(k.db).then(function(z){return z?a:Y(a)}):a}).then(function(z){rt(y._dbInfo,h,function(M,_){if(M)return x(M);try{var T=_.objectStore(y._dbInfo.storeName);z===null&&(z=void 0);var N=T.put(z,s);_.oncomplete=function(){z===void 0&&(z=null),w(z)},_.onabort=_.onerror=function(){var F=N.error?N.error:N.transaction.error;x(F)}}catch(F){x(F)}})}).catch(x)});return C(m,c),m}function Di(s,a){var c=this;s=A(s);var y=new b(function(m,w){c.ready().then(function(){rt(c._dbInfo,h,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName).delete(s);k.oncomplete=function(){m()},k.onerror=function(){w(z.error)},k.onabort=function(){var M=z.error?z.error:z.transaction.error;w(M)}}catch(M){w(M)}})}).catch(w)});return C(y,a),y}function Ti(s){var a=this,c=new b(function(y,m){a.ready().then(function(){rt(a._dbInfo,h,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).clear();x.oncomplete=function(){y()},x.onabort=x.onerror=function(){var z=k.error?k.error:k.transaction.error;m(z)}}catch(z){m(z)}})}).catch(m)});return C(c,s),c}function Bi(s){var a=this,c=new b(function(y,m){a.ready().then(function(){rt(a._dbInfo,d,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).count();k.onsuccess=function(){y(k.result)},k.onerror=function(){m(k.error)}}catch(z){m(z)}})}).catch(m)});return C(c,s),c}function Ni(s,a){var c=this,y=new b(function(m,w){s<0?m(null):c.ready().then(function(){rt(c._dbInfo,d,function(x,k){if(x)return w(x);try{var z=k.objectStore(c._dbInfo.storeName),M=!1,_=z.openKeyCursor();_.onsuccess=function(){var T=_.result;T?s===0||M?m(T.key):(M=!0,T.advance(s)):m(null)},_.onerror=function(){w(_.error)}}catch(T){w(T)}})}).catch(w)});return C(y,a),y}function Oi(s){var a=this,c=new b(function(y,m){a.ready().then(function(){rt(a._dbInfo,d,function(w,x){if(w)return m(w);try{var k=x.objectStore(a._dbInfo.storeName).openKeyCursor(),z=[];k.onsuccess=function(){var M=k.result;M?(z.push(M.key),M.continue()):y(z)},k.onerror=function(){m(k.error)}}catch(M){m(M)}})}).catch(m)});return C(c,s),c}function Ui(s,a){a=D.apply(this,arguments);var c=this.config();(s=typeof s!="function"&&s||{}).name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var y,m=this;if(s.name){var w=s.name===c.name&&m._dbInfo.db?b.resolve(m._dbInfo.db):H(s).then(function(x){var k=l[s.name],z=k.forages;k.db=x;for(var M=0;M<z.length;M++)z[M]._dbInfo.db=x;return x});y=s.storeName?w.then(function(x){if(x.objectStoreNames.contains(s.storeName)){var k=x.version+1;R(s);var z=l[s.name],M=z.forages;x.close();for(var _=0;_<M.length;_++){var T=M[_];T._dbInfo.db=null,T._dbInfo.version=k}var N=new b(function(F,$){var G=u.open(s.name,k);G.onerror=function(at){G.result.close(),$(at)},G.onupgradeneeded=function(){G.result.deleteObjectStore(s.storeName)},G.onsuccess=function(){var at=G.result;at.close(),F(at)}});return N.then(function(F){z.db=F;for(var $=0;$<M.length;$++){var G=M[$];G._dbInfo.db=F,O(G._dbInfo)}}).catch(function(F){throw(j(s,F)||b.resolve()).catch(function(){}),F})}}):w.then(function(x){R(s);var k=l[s.name],z=k.forages;x.close();for(var M=0;M<z.length;M++)z[M]._dbInfo.db=null;var _=new b(function(T,N){var F=u.deleteDatabase(s.name);F.onerror=function(){var $=F.result;$&&$.close(),N(F.error)},F.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},F.onsuccess=function(){var $=F.result;$&&$.close(),T($)}});return _.then(function(T){k.db=T;for(var N=0;N<z.length;N++)O(z[N]._dbInfo)}).catch(function(T){throw(j(s,T)||b.resolve()).catch(function(){}),T})})}else y=b.reject("Invalid arguments");return C(y,a),y}var ji={_driver:"asyncStorage",_initStorage:Ri,_support:p(),iterate:Ai,getItem:Pi,setItem:Li,removeItem:Di,clear:Ti,length:Bi,key:Ni,keys:Oi,dropInstance:Ui};function Fi(){return typeof openDatabase=="function"}var dt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$i="~~local_forage_type~",mn=/^~~local_forage_type~([^~]+)~/,Ut="__lfsc__:",ve=Ut.length,ye="arbf",we="blob",gn="si08",vn="ui08",yn="uic8",wn="si16",bn="si32",Sn="ur16",xn="ui32",Cn="fl32",En="fl64",kn=ve+ye.length,zn=Object.prototype.toString;function Mn(s){var a,c,y,m,w,x=.75*s.length,k=s.length,z=0;s[s.length-1]==="="&&(x--,s[s.length-2]==="="&&x--);var M=new ArrayBuffer(x),_=new Uint8Array(M);for(a=0;a<k;a+=4)c=dt.indexOf(s[a]),y=dt.indexOf(s[a+1]),m=dt.indexOf(s[a+2]),w=dt.indexOf(s[a+3]),_[z++]=c<<2|y>>4,_[z++]=(15&y)<<4|m>>2,_[z++]=(3&m)<<6|63&w;return M}function be(s){var a,c=new Uint8Array(s),y="";for(a=0;a<c.length;a+=3)y+=dt[c[a]>>2],y+=dt[(3&c[a])<<4|c[a+1]>>4],y+=dt[(15&c[a+1])<<2|c[a+2]>>6],y+=dt[63&c[a+2]];return c.length%3==2?y=y.substring(0,y.length-1)+"=":c.length%3==1&&(y=y.substring(0,y.length-2)+"=="),y}function Hi(s,a){var c="";if(s&&(c=zn.call(s)),s&&(c==="[object ArrayBuffer]"||s.buffer&&zn.call(s.buffer)==="[object ArrayBuffer]")){var y,m=Ut;s instanceof ArrayBuffer?(y=s,m+=ye):(y=s.buffer,c==="[object Int8Array]"?m+=gn:c==="[object Uint8Array]"?m+=vn:c==="[object Uint8ClampedArray]"?m+=yn:c==="[object Int16Array]"?m+=wn:c==="[object Uint16Array]"?m+=Sn:c==="[object Int32Array]"?m+=bn:c==="[object Uint32Array]"?m+=xn:c==="[object Float32Array]"?m+=Cn:c==="[object Float64Array]"?m+=En:a(new Error("Failed to get type for BinaryArray"))),a(m+be(y))}else if(c==="[object Blob]"){var w=new FileReader;w.onload=function(){var x=$i+s.type+"~"+be(this.result);a(Ut+we+x)},w.readAsArrayBuffer(s)}else try{a(JSON.stringify(s))}catch(x){console.error("Couldn't convert value into a JSON string: ",s),a(null,x)}}function Wi(s){if(s.substring(0,ve)!==Ut)return JSON.parse(s);var a,c=s.substring(kn),y=s.substring(ve,kn);if(y===we&&mn.test(c)){var m=c.match(mn);a=m[1],c=c.substring(m[0].length)}var w=Mn(c);switch(y){case ye:return w;case we:return v([w],{type:a});case gn:return new Int8Array(w);case vn:return new Uint8Array(w);case yn:return new Uint8ClampedArray(w);case wn:return new Int16Array(w);case Sn:return new Uint16Array(w);case bn:return new Int32Array(w);case xn:return new Uint32Array(w);case Cn:return new Float32Array(w);case En:return new Float64Array(w);default:throw new Error("Unkown type: "+y)}}var Se={serialize:Hi,deserialize:Wi,stringToBuffer:Mn,bufferToString:be};function _n(s,a,c,y){s.executeSql("CREATE TABLE IF NOT EXISTS "+a.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,y)}function qi(s){var a=this,c={db:null};if(s)for(var y in s)c[y]=typeof s[y]!="string"?s[y].toString():s[y];var m=new b(function(w,x){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(k){return x(k)}c.db.transaction(function(k){_n(k,c,function(){a._dbInfo=c,w()},function(z,M){x(M)})},x)});return c.serializer=Se,m}function ft(s,a,c,y,m,w){s.executeSql(c,y,m,function(x,k){k.code===k.SYNTAX_ERR?x.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[a.storeName],function(z,M){M.rows.length?w(z,k):_n(z,a,function(){z.executeSql(c,y,m,w)},w)},w):w(x,k)},w)}function Gi(s,a){var c=this;s=A(s);var y=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT * FROM "+x.storeName+" WHERE key = ? LIMIT 1",[s],function(z,M){var _=M.rows.length?M.rows.item(0).value:null;_&&(_=x.serializer.deserialize(_)),m(_)},function(z,M){w(M)})})}).catch(w)});return C(y,a),y}function Xi(s,a){var c=this,y=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT * FROM "+x.storeName,[],function(z,M){for(var _=M.rows,T=_.length,N=0;N<T;N++){var F=_.item(N),$=F.value;if($&&($=x.serializer.deserialize($)),($=s($,F.key,N+1))!==void 0)return void m($)}m()},function(z,M){w(M)})})}).catch(w)});return C(y,a),y}function In(s,a,c,y){var m=this;s=A(s);var w=new b(function(x,k){m.ready().then(function(){a===void 0&&(a=null);var z=a,M=m._dbInfo;M.serializer.serialize(a,function(_,T){T?k(T):M.db.transaction(function(N){ft(N,M,"INSERT OR REPLACE INTO "+M.storeName+" (key, value) VALUES (?, ?)",[s,_],function(){x(z)},function(F,$){k($)})},function(N){if(N.code===N.QUOTA_ERR){if(y>0)return void x(In.apply(m,[s,z,c,y-1]));k(N)}})})}).catch(k)});return C(w,c),w}function Ki(s,a,c){return In.apply(this,[s,a,c,1])}function Vi(s,a){var c=this;s=A(s);var y=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"DELETE FROM "+x.storeName+" WHERE key = ?",[s],function(){m()},function(z,M){w(M)})})}).catch(w)});return C(y,a),y}function Yi(s){var a=this,c=new b(function(y,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"DELETE FROM "+w.storeName,[],function(){y()},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function Ji(s){var a=this,c=new b(function(y,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"SELECT COUNT(key) as c FROM "+w.storeName,[],function(k,z){var M=z.rows.item(0).c;y(M)},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function Zi(s,a){var c=this,y=new b(function(m,w){c.ready().then(function(){var x=c._dbInfo;x.db.transaction(function(k){ft(k,x,"SELECT key FROM "+x.storeName+" WHERE id = ? LIMIT 1",[s+1],function(z,M){var _=M.rows.length?M.rows.item(0).key:null;m(_)},function(z,M){w(M)})})}).catch(w)});return C(y,a),y}function Qi(s){var a=this,c=new b(function(y,m){a.ready().then(function(){var w=a._dbInfo;w.db.transaction(function(x){ft(x,w,"SELECT key FROM "+w.storeName,[],function(k,z){for(var M=[],_=0;_<z.rows.length;_++)M.push(z.rows.item(_).key);y(M)},function(k,z){m(z)})})}).catch(m)});return C(c,s),c}function tr(s){return new b(function(a,c){s.transaction(function(y){y.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(m,w){for(var x=[],k=0;k<w.rows.length;k++)x.push(w.rows.item(k).name);a({db:s,storeNames:x})},function(m,w){c(w)})},function(y){c(y)})})}function er(s,a){a=D.apply(this,arguments);var c=this.config();(s=typeof s!="function"&&s||{}).name||(s.name=s.name||c.name,s.storeName=s.storeName||c.storeName);var y,m=this;return y=s.name?new b(function(w){var x;x=s.name===c.name?m._dbInfo.db:openDatabase(s.name,"","",0),s.storeName?w({db:x,storeNames:[s.storeName]}):w(tr(x))}).then(function(w){return new b(function(x,k){w.db.transaction(function(z){function M(F){return new b(function($,G){z.executeSql("DROP TABLE IF EXISTS "+F,[],function(){$()},function(at,Ee){G(Ee)})})}for(var _=[],T=0,N=w.storeNames.length;T<N;T++)_.push(M(w.storeNames[T]));b.all(_).then(function(){x()}).catch(function(F){k(F)})},function(z){k(z)})})}):b.reject("Invalid arguments"),C(y,a),y}var nr={_driver:"webSQLStorage",_initStorage:qi,_support:Fi(),iterate:Xi,getItem:Gi,setItem:Ki,removeItem:Vi,clear:Yi,length:Ji,key:Zi,keys:Qi,dropInstance:er};function ir(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Rn(s,a){var c=s.name+"/";return s.storeName!==a.storeName&&(c+=s.storeName+"/"),c}function rr(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch{return!0}}function or(){return!rr()||localStorage.length>0}function sr(s){var a=this,c={};if(s)for(var y in s)c[y]=s[y];return c.keyPrefix=Rn(s,a._defaultConfig),or()?(a._dbInfo=c,c.serializer=Se,b.resolve()):b.reject()}function ar(s){var a=this,c=a.ready().then(function(){for(var y=a._dbInfo.keyPrefix,m=localStorage.length-1;m>=0;m--){var w=localStorage.key(m);w.indexOf(y)===0&&localStorage.removeItem(w)}});return C(c,s),c}function cr(s,a){var c=this;s=A(s);var y=c.ready().then(function(){var m=c._dbInfo,w=localStorage.getItem(m.keyPrefix+s);return w&&(w=m.serializer.deserialize(w)),w});return C(y,a),y}function ur(s,a){var c=this,y=c.ready().then(function(){for(var m=c._dbInfo,w=m.keyPrefix,x=w.length,k=localStorage.length,z=1,M=0;M<k;M++){var _=localStorage.key(M);if(_.indexOf(w)===0){var T=localStorage.getItem(_);if(T&&(T=m.serializer.deserialize(T)),(T=s(T,_.substring(x),z++))!==void 0)return T}}});return C(y,a),y}function lr(s,a){var c=this,y=c.ready().then(function(){var m,w=c._dbInfo;try{m=localStorage.key(s)}catch{m=null}return m&&(m=m.substring(w.keyPrefix.length)),m});return C(y,a),y}function hr(s){var a=this,c=a.ready().then(function(){for(var y=a._dbInfo,m=localStorage.length,w=[],x=0;x<m;x++){var k=localStorage.key(x);k.indexOf(y.keyPrefix)===0&&w.push(k.substring(y.keyPrefix.length))}return w});return C(c,s),c}function dr(s){var a=this.keys().then(function(c){return c.length});return C(a,s),a}function fr(s,a){var c=this;s=A(s);var y=c.ready().then(function(){var m=c._dbInfo;localStorage.removeItem(m.keyPrefix+s)});return C(y,a),y}function pr(s,a,c){var y=this;s=A(s);var m=y.ready().then(function(){a===void 0&&(a=null);var w=a;return new b(function(x,k){var z=y._dbInfo;z.serializer.serialize(a,function(M,_){if(_)k(_);else try{localStorage.setItem(z.keyPrefix+s,M),x(w)}catch(T){T.name!=="QuotaExceededError"&&T.name!=="NS_ERROR_DOM_QUOTA_REACHED"||k(T),k(T)}})})});return C(m,c),m}function mr(s,a){if(a=D.apply(this,arguments),!(s=typeof s!="function"&&s||{}).name){var c=this.config();s.name=s.name||c.name,s.storeName=s.storeName||c.storeName}var y,m=this;return y=s.name?new b(function(w){s.storeName?w(Rn(s,m._defaultConfig)):w(s.name+"/")}).then(function(w){for(var x=localStorage.length-1;x>=0;x--){var k=localStorage.key(x);k.indexOf(w)===0&&localStorage.removeItem(k)}}):b.reject("Invalid arguments"),C(y,a),y}var gr={_driver:"localStorageWrapper",_initStorage:sr,_support:ir(),iterate:ur,getItem:cr,setItem:pr,removeItem:fr,clear:ar,length:dr,key:lr,keys:hr,dropInstance:mr},vr=function(s,a){return s===a||typeof s=="number"&&typeof a=="number"&&isNaN(s)&&isNaN(a)},yr=function(s,a){for(var c=s.length,y=0;y<c;){if(vr(s[y],a))return!0;y++}return!1},Pn=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},Pt={},An={},kt={INDEXEDDB:ji,WEBSQL:nr,LOCALSTORAGE:gr},wr=[kt.INDEXEDDB._driver,kt.WEBSQL._driver,kt.LOCALSTORAGE._driver],jt=["dropInstance"],xe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(jt),br={description:"",driver:wr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Sr(s,a){s[a]=function(){var c=arguments;return s.ready().then(function(){return s[a].apply(s,c)})}}function Ce(){for(var s=1;s<arguments.length;s++){var a=arguments[s];if(a)for(var c in a)a.hasOwnProperty(c)&&(Pn(a[c])?arguments[0][c]=a[c].slice():arguments[0][c]=a[c])}return arguments[0]}var xr=function(){function s(a){for(var c in r(this,s),kt)if(kt.hasOwnProperty(c)){var y=kt[c],m=y._driver;this[c]=m,Pt[m]||this.defineDriver(y)}this._defaultConfig=Ce({},br),this._config=Ce({},this._defaultConfig,a),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(a){if((a===void 0?"undefined":i(a))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var c in a){if(c==="storeName"&&(a[c]=a[c].replace(/\W/g,"_")),c==="version"&&typeof a[c]!="number")return new Error("Database version must be a number.");this._config[c]=a[c]}return!("driver"in a)||!a.driver||this.setDriver(this._config.driver)}return typeof a=="string"?this._config[a]:this._config},s.prototype.defineDriver=function(a,c,y){var m=new b(function(w,x){try{var k=a._driver,z=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!a._driver)return void x(z);for(var M=xe.concat("_initStorage"),_=0,T=M.length;_<T;_++){var N=M[_];if((!yr(jt,N)||a[N])&&typeof a[N]!="function")return void x(z)}var F=function(){for(var G=function(Er){return function(){var kr=new Error("Method "+Er+" is not implemented by the current driver"),Ln=b.reject(kr);return C(Ln,arguments[arguments.length-1]),Ln}},at=0,Ee=jt.length;at<Ee;at++){var ke=jt[at];a[ke]||(a[ke]=G(ke))}};F();var $=function(G){Pt[k]&&console.info("Redefining LocalForage driver: "+k),Pt[k]=a,An[k]=G,w()};"_support"in a?a._support&&typeof a._support=="function"?a._support().then($,x):$(!!a._support):$(!0)}catch(G){x(G)}});return E(m,c,y),m},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(a,c,y){var m=Pt[a]?b.resolve(Pt[a]):b.reject(new Error("Driver not found."));return E(m,c,y),m},s.prototype.getSerializer=function(a){var c=b.resolve(Se);return E(c,a),c},s.prototype.ready=function(a){var c=this,y=c._driverSet.then(function(){return c._ready===null&&(c._ready=c._initDriver()),c._ready});return E(y,a,a),y},s.prototype.setDriver=function(a,c,y){var m=this;Pn(a)||(a=[a]);var w=this._getSupportedDrivers(a);function x(){m._config.driver=m.driver()}function k(_){return m._extend(_),x(),m._ready=m._initStorage(m._config),m._ready}function z(_){return function(){var T=0;function N(){for(;T<_.length;){var F=_[T];return T++,m._dbInfo=null,m._ready=null,m.getDriver(F).then(k).catch(N)}x();var $=new Error("No available storage method found.");return m._driverSet=b.reject($),m._driverSet}return N()}}var M=this._driverSet!==null?this._driverSet.catch(function(){return b.resolve()}):b.resolve();return this._driverSet=M.then(function(){var _=w[0];return m._dbInfo=null,m._ready=null,m.getDriver(_).then(function(T){m._driver=T._driver,x(),m._wrapLibraryMethodsWithReady(),m._initDriver=z(w)})}).catch(function(){x();var _=new Error("No available storage method found.");return m._driverSet=b.reject(_),m._driverSet}),E(this._driverSet,c,y),this._driverSet},s.prototype.supports=function(a){return!!An[a]},s.prototype._extend=function(a){Ce(this,a)},s.prototype._getSupportedDrivers=function(a){for(var c=[],y=0,m=a.length;y<m;y++){var w=a[y];this.supports(w)&&c.push(w)}return c},s.prototype._wrapLibraryMethodsWithReady=function(){for(var a=0,c=xe.length;a<c;a++)Sr(this,xe[a])},s.prototype.createInstance=function(a){return new s(a)},s}(),Cr=new xr;e.exports=Cr},{3:3}]},{},[4])(4),ni={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
|
-
*//*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(t){ei.exports=(()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const r=e.WebStreamsPolyfill||{},o=e.isSecureContext;let l=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const p=o||"MozAppearance"in document.documentElement.style?"iframe":"navigate",y={createWriteStream:function(C,E,D){let T={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,S=null,u=null,f=null;if(Number.isFinite(E)?([D,E]=[E,D],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),T.size=D,T.writableStrategy=E):E&&E.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),T.size=D,T.writableStrategy=E):T=E||{},!l){n||(n=o?b(y.mitm):function(L){const I="width=200,height=100",R=document.createDocumentFragment(),O={frame:e.open(L,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){O.frame.close()},addEventListener(...U){R.addEventListener(...U)},dispatchEvent(...U){R.dispatchEvent(...U)},removeEventListener(...U){R.removeEventListener(...U)},postMessage(...U){O.frame.postMessage(...U)}},j=U=>{U.source===O.frame&&(O.loaded=!0,e.removeEventListener("message",j),O.dispatchEvent(new Event("load")))};return e.addEventListener("message",j),O}(y.mitm)),u=new MessageChannel,C=encodeURIComponent(C.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:i,pathname:T.pathname||Math.random().toString().slice(-6)+"/"+C,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+C}};T.size&&(h.headers["Content-Length"]=T.size);const g=[h,"*",[u.port2]];if(i){const L=p==="iframe"?void 0:{transform(R,O){if(!(R instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=R.length,O.enqueue(R),S&&(location.href=S,S=null)},flush(){S&&(location.href=S)}};f=new y.TransformStream(L,T.writableStrategy,T.readableStrategy);const I=f.readable;u.port1.postMessage({readableStream:I},[I])}u.port1.onmessage=L=>{L.data.download?p==="navigate"?(n.remove(),n=null,P?location.href=L.data.download:S=L.data.download):(n.isPopup&&(n.remove(),n=null,p==="iframe"&&b(y.mitm)),b(L.data.download)):L.data.abort&&(d=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null)},n.loaded?n.postMessage(...g):n.addEventListener("load",()=>{n.postMessage(...g)},{once:!0})}let d=[];return!l&&f&&f.writable||new y.WritableStream({write(h){if(!(h instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");l?d.push(h):(u.port1.postMessage(h),P+=h.length,S&&(location.href=S,S=null))},close(){if(l){const h=new Blob(d,{type:"application/octet-stream; charset=utf-8"}),g=document.createElement("a");g.href=URL.createObjectURL(h),g.download=C,g.click()}else u.port1.postMessage("end")},abort(){d=[],u.port1.postMessage("abort"),u.port1.onmessage=null,u.port1.close(),u.port2.close(),u=null}},T.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 b(C){if(!C)throw new Error("meh");const E=document.createElement("iframe");return E.hidden=!0,E.src=C,E.loaded=!1,E.name="iframe",E.isIframe=!0,E.postMessage=(...D)=>E.contentWindow.postMessage(...D),E.addEventListener("load",()=>{E.loaded=!0},{once:!0}),document.body.appendChild(E),E}try{new Response(new ReadableStream),o&&!("serviceWorker"in navigator)&&(l=!0)}catch{l=!0}return(C=>{try{C()}catch{}})(()=>{const{readable:C}=new TransformStream,E=new MessageChannel;E.port1.postMessage(C,[C]),E.port1.close(),E.port2.close(),i=!0,Object.defineProperty(y,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),y})()})();var Xo=ei.exports;class Vo{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,i=3,r=6,o=6e4){this.fileID=e,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Te(),this.initIndexDB(),r>=3&&(this.cacheSize=r),o>this.requestTimeout&&(this.requestTimeout=o)}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="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await lt(n,e,i);let o=null;return r&&r.status===200&&(o=r.data),o}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Yt.createInstance({name:this.fileID,driver:Yt.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(),Yt.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 i=e;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=B.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const o={key:this.fileMetaData?.downloadID};let l=0;const p=this.cacheSize;let y=0;for(let b=0;b<this.totalChunks;b++){if(this.keys&&this.keys?.indexOf(b.toString())>=0){l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());continue}const C=b*this.chunkByteSize;let E=C+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const D={range:`bytes=${C}-${E}`};for(;y>=p;)await this.sleep(200);const T=b.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${b+1}/${this.totalChunks}`),y++,lt(i,n,o,D,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const S=P.data;y--,await this.currentDB?.setItem(T,S),l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());const u=parseInt(T)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${u}/${this.totalChunks}`),this.savefile()}).catch(P=>{y--;const S=parseInt(T)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${S}\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=Xo.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString();let o=await this.currentDB?.getItem(r);if(o||(o=await this.currentDB?.getItem(r)),!o)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let l=new Response(o).body;if(l===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const p=l.getReader();for(;;){const{done:y,value:b}=await p.read();if(y)break;await e.write(b)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Yt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function Ko(t,e){let n="",i="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,i}function ni(t={},e={}){let n;for(n in e)t[n]=xt(t[n])?ni(t[n],e[n]):t[n]=e[n];return t}function Yo(t,e){const n=`${t}_${e}`;return ot.MD5(n)}function ii(t){const e=function(p){if(!p)return;const y=p,b=[];if(y)for(let C of y){const E=ri(C);E&&b.push(E)}return b}(t.bussinessRoutes),n=function(p){if(!p)return;const y=p;if(y&&y.length>0){const b=[];return y.forEach(C=>{const E=oi(C);E&&b.push(E)}),b}}(t.widgetMenuConfig),i=function(p){if(p&&p.length>0){const y=[];return p.forEach(b=>{const C=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}(b);C&&y.push(C)}),y}}(t.widgetConfig),r=function(p){if(p&&p.length>0)return p}(t.functionList),o=t.pkgObject.version,l=t.pkgObject.name;return{id:Yo(l,o),name:B.Config.UI.SiteTitle,group:B.Config.UI.Group,product:l,version:o,routes:e,widgetMenu:n,widgets:i,functions:r}}function ri(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 i=[];for(let r of t.children){const o=ri(r);o&&i.push(o)}i.length>0&&(n.children=i)}return n}}function oi(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 i=oi(n);i&&e.children?.push(i)})),e}function Jo(t,e="IconifyList.ts"){let n="",i=`const iconlist={
|
|
9
|
-
`,r=0;t.forEach(o=>{const
|
|
8
|
+
*//*! streamsaver. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */(function(t){ni.exports=(()=>{const e=typeof window=="object"?window:this;e.HTMLElement||console.warn("streamsaver is meant to run on browsers main thread");let n=null,i=!1;const r=e.WebStreamsPolyfill||{},o=e.isSecureContext;let u=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const p=o||"MozAppearance"in document.documentElement.style?"iframe":"navigate",v={createWriteStream:function(C,E,A){let D={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},P=0,S=null,l=null,f=null;if(Number.isFinite(E)?([A,E]=[E,A],console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=A,D.writableStrategy=E):E&&E.highWaterMark?(console.warn("[StreamSaver] Deprecated pass an object as 2nd argument when creating a write stream"),D.size=A,D.writableStrategy=E):D=E||{},!u){n||(n=o?b(v.mitm):function(L){const I="width=200,height=100",R=document.createDocumentFragment(),O={frame:e.open(L,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){O.frame.close()},addEventListener(...U){R.addEventListener(...U)},dispatchEvent(...U){R.dispatchEvent(...U)},removeEventListener(...U){R.removeEventListener(...U)},postMessage(...U){O.frame.postMessage(...U)}},j=U=>{U.source===O.frame&&(O.loaded=!0,e.removeEventListener("message",j),O.dispatchEvent(new Event("load")))};return e.addEventListener("message",j),O}(v.mitm)),l=new MessageChannel,C=encodeURIComponent(C.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const h={transferringReadable:i,pathname:D.pathname||Math.random().toString().slice(-6)+"/"+C,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+C}};D.size&&(h.headers["Content-Length"]=D.size);const g=[h,"*",[l.port2]];if(i){const L=p==="iframe"?void 0:{transform(R,O){if(!(R instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");P+=R.length,O.enqueue(R),S&&(location.href=S,S=null)},flush(){S&&(location.href=S)}};f=new v.TransformStream(L,D.writableStrategy,D.readableStrategy);const I=f.readable;l.port1.postMessage({readableStream:I},[I])}l.port1.onmessage=L=>{L.data.download?p==="navigate"?(n.remove(),n=null,P?location.href=L.data.download:S=L.data.download):(n.isPopup&&(n.remove(),n=null,p==="iframe"&&b(v.mitm)),b(L.data.download)):L.data.abort&&(d=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null)},n.loaded?n.postMessage(...g):n.addEventListener("load",()=>{n.postMessage(...g)},{once:!0})}let d=[];return!u&&f&&f.writable||new v.WritableStream({write(h){if(!(h instanceof Uint8Array))throw new TypeError("Can only write Uint8Arrays");u?d.push(h):(l.port1.postMessage(h),P+=h.length,S&&(location.href=S,S=null))},close(){if(u){const h=new Blob(d,{type:"application/octet-stream; charset=utf-8"}),g=document.createElement("a");g.href=URL.createObjectURL(h),g.download=C,g.click()}else l.port1.postMessage("end")},abort(){d=[],l.port1.postMessage("abort"),l.port1.onmessage=null,l.port1.close(),l.port2.close(),l=null}},D.writableStrategy)},WritableStream:e.WritableStream||r.WritableStream,supported:!0,version:{full:"2.0.5",major:2,minor:0,dot:5},mitm:"https://jimmywarting.github.io/StreamSaver.js/mitm.html?version=2.0.0"};function b(C){if(!C)throw new Error("meh");const E=document.createElement("iframe");return E.hidden=!0,E.src=C,E.loaded=!1,E.name="iframe",E.isIframe=!0,E.postMessage=(...A)=>E.contentWindow.postMessage(...A),E.addEventListener("load",()=>{E.loaded=!0},{once:!0}),document.body.appendChild(E),E}try{new Response(new ReadableStream),o&&!("serviceWorker"in navigator)&&(u=!0)}catch{u=!0}return(C=>{try{C()}catch{}})(()=>{const{readable:C}=new TransformStream,E=new MessageChannel;E.port1.postMessage(C,[C]),E.port1.close(),E.port2.close(),i=!0,Object.defineProperty(v,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),v})()})();var Xo=ni.exports;class Ko{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,i=3,r=6,o=6e4){this.fileID=e,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=Be(),this.initIndexDB(),r>=3&&(this.cacheSize=r),o>this.requestTimeout&&(this.requestTimeout=o)}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="",i){this.dispatchInfo("\u5F00\u59CB\u83B7\u53D6\u6587\u4EF6\u4FE1\u606F");const r=await lt(n,e,i);let o=null;return r&&r.status===200&&(o=r.data),o}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Yt.createInstance({name:this.fileID,driver:Yt.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(),Yt.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 i=e;if(!i&&this.downloadURL&&(i=this.downloadURL),!i)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const r=B.Axios.CancelToken;this.cancelSource=r.source(),this.isStarting=!0;const o={key:this.fileMetaData?.downloadID};let u=0;const p=this.cacheSize;let v=0;for(let b=0;b<this.totalChunks;b++){if(this.keys&&this.keys?.indexOf(b.toString())>=0){u++,u>this.finishNum&&(this.finishNum=u,this.downloadProgress());continue}const C=b*this.chunkByteSize;let E=C+this.chunkByteSize-1;this.fileMetaData&&E>this.fileMetaData.length&&(E=this.fileMetaData.length-1);const A={range:`bytes=${C}-${E}`};for(;v>=p;)await this.sleep(200);const D=b.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${b+1}/${this.totalChunks}`),v++,lt(i,n,o,A,"arraybuffer",this.cancelSource?.token,this.requestTimeout).then(async P=>{const S=P.data;v--,await this.currentDB?.setItem(D,S),u++,u>this.finishNum&&(this.finishNum=u,this.downloadProgress());const l=parseInt(D)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${l}/${this.totalChunks}`),this.savefile()}).catch(P=>{v--;const S=parseInt(D)+1;this.dispatchError(`\u4E0B\u8F7D\u7B2C${S}\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=Xo.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString();let o=await this.currentDB?.getItem(r);if(o||(o=await this.currentDB?.getItem(r)),!o)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);let u=new Response(o).body;if(u===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u9519\u8BEF\u9000\u51FA\uFF01`);const p=u.getReader();for(;;){const{done:v,value:b}=await p.read();if(v)break;await e.write(b)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Yt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}function Vo(t,e){let n="",i="";for(const r in e)n+=r+"="+encodeURIComponent(e[r])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,i}function ii(t={},e={}){let n;for(n in e)t[n]=xt(t[n])?ii(t[n],e[n]):t[n]=e[n];return t}function Yo(t,e){const n=`${t}_${e}`;return ot.MD5(n)}function ri(t){const e=function(p){if(!p)return;const v=p,b=[];if(v)for(let C of v){const E=oi(C);E&&b.push(E)}return b}(t.bussinessRoutes),n=function(p){if(!p)return;const v=p;if(v&&v.length>0){const b=[];return v.forEach(C=>{const E=si(C);E&&b.push(E)}),b}}(t.widgetMenuConfig),i=function(p){if(p&&p.length>0){const v=[];return p.forEach(b=>{const C=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}(b);C&&v.push(C)}),v}}(t.widgetConfig),r=function(p){if(p&&p.length>0)return p}(t.functionList),o=t.pkgObject.version,u=t.pkgObject.name;return{id:Yo(u,o),name:B.Config.UI.SiteTitle,group:B.Config.UI.Group,product:u,version:o,routes:e,widgetMenu:n,widgets:i,functions:r}}function oi(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 i=[];for(let r of t.children){const o=oi(r);o&&i.push(o)}i.length>0&&(n.children=i)}return n}}function si(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 i=si(n);i&&e.children?.push(i)})),e}function Jo(t,e="IconifyList.ts"){let n="",i=`const iconlist={
|
|
9
|
+
`,r=0;t.forEach(o=>{const u=o.split(":");if(u&&u.length===2){const p="icon"+r;n+=`import ${p} from '~icons/${u[0]}/${u[1]}'
|
|
10
10
|
`,i+=` '${o}':${p},
|
|
11
11
|
`,r++}}),r>0&&(i+=`};
|
|
12
|
-
`,Xt(n+i+"export default iconlist;","IconifyList.ts"))}function Zo(t,e){const n=
|
|
12
|
+
`,Xt(n+i+"export default iconlist;","IconifyList.ts"))}function Zo(t,e){const n=ri(t);$n(n,e),B.Message?.msg("\u5BFC\u51FA\u7CFB\u7EDF\u529F\u80FD\u6743\u9650\u6587\u4EF6\u6210\u529F\uFF01")}let ai=!0;try{String.fromCharCode.apply(String,[1,2])}catch{ai=!1,Object.defineProperty(Array.prototype,"subarray",{value:Array.prototype.slice})}var Je=2654435769;function ci(t,e){var n=t.length,i=n<<2;if(e){var r=t[n-1];if(r<(i-=4)-3||r>i)return null;i=r}for(var o=new Uint8Array(i),u=0;u<i;++u)o[u]=t[u>>2]>>((3&u)<<3);return o}function Jt(t,e){var n,i=t.length,r=i>>2;(3&i)!=0&&++r,e?(n=new Uint32Array(r+1))[r]=i:n=new Uint32Array(r);for(var o=0;o<i;++o)n[o>>2]|=t[o]<<((3&o)<<3);return n}function Ct(t){return 4294967295&t}function Zt(t,e,n,i,r,o){return(n>>>5^e<<2)+(e>>>3^n<<4)^(t^e)+(o[3&i^r]^n)}function ui(t){if(t.length<16){var e=new Uint8Array(16);e.set(t),t=e}return t}function Qt(t){for(var e=t.length,n=new Uint8Array(3*e),i=0,r=0;r<e;r++){var o=t.charCodeAt(r);if(o<128)n[i++]=o;else if(o<2048)n[i++]=192|o>>6,n[i++]=128|63&o;else{if(!(o<55296||o>57343)){if(r+1<e){var u=t.charCodeAt(r+1);if(o<56320&&56320<=u&&u<=57343){var p=65536+((1023&o)<<10|1023&u);n[i++]=240|p>>18,n[i++]=128|p>>12&63,n[i++]=128|p>>6&63,n[i++]=128|63&p,r++;continue}}throw new Error("Malformed string")}n[i++]=224|o>>12,n[i++]=128|o>>6&63,n[i++]=128|63&o}}return n.subarray(0,i)}function li(t){var e=t.length;return e===0?"":e<32767?function(n,i){for(var r=new Array(i),o=0,u=0,p=n.length;o<i&&u<p;o++){var v=n[u++];switch(v>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:r[o]=v;break;case 12:case 13:if(!(u<p))throw new Error("Unfinished UTF-8 octet sequence");r[o]=(31&v)<<6|63&n[u++];break;case 14:if(!(u+1<p))throw new Error("Unfinished UTF-8 octet sequence");r[o]=(15&v)<<12|(63&n[u++])<<6|63&n[u++];break;case 15:if(!(u+2<p))throw new Error("Unfinished UTF-8 octet sequence");var b=((7&v)<<18|(63&n[u++])<<12|(63&n[u++])<<6|63&n[u++])-65536;if(!(0<=b&&b<=1048575))throw new Error("Character outside valid Unicode range: 0x"+b.toString(16));r[o++]=b>>10&1023|55296,r[o]=1023&b|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+v.toString(16))}}return o<i&&(r.length=o),String.fromCharCode.apply(String,r)}(t,e):function(n,i){for(var r=[],o=new Array(32768),u=0,p=0,v=n.length;u<i&&p<v;u++){var b=n[p++];switch(b>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o[u]=b;break;case 12:case 13:if(!(p<v))throw new Error("Unfinished UTF-8 octet sequence");o[u]=(31&b)<<6|63&n[p++];break;case 14:if(!(p+1<v))throw new Error("Unfinished UTF-8 octet sequence");o[u]=(15&b)<<12|(63&n[p++])<<6|63&n[p++];break;case 15:if(!(p+2<v))throw new Error("Unfinished UTF-8 octet sequence");var C=((7&b)<<18|(63&n[p++])<<12|(63&n[p++])<<6|63&n[p++])-65536;if(!(0<=C&&C<=1048575))throw new Error("Character outside valid Unicode range: 0x"+C.toString(16));o[u++]=C>>10&1023|55296,o[u]=1023&C|56320;break;default:throw new Error("Bad UTF-8 encoding 0x"+b.toString(16))}if(u>=32766){var E=u+1;o.length=E,r.push(String.fromCharCode.apply(String,o)),i-=E,u=-1}}return u>0&&(o.length=u,r.push(String.fromCharCode.apply(String,o))),r.join("")}(t,e)}function Qo(t){var e=t.length;if(e===0)return"";var n=ai?t:function(p){for(var v=p.length,b=new Array(p.length),C=0;C<v;++C)b[C]=p[C];return b}(t);if(e<65535)return String.fromCharCode.apply(String,n);for(var i=32767&e,r=e>>15,o=new Array(i?r+1:r),u=0;u<r;++u)o[u]=String.fromCharCode.apply(String,n.subarray(u<<15,u+1<<15));return i&&(o[r]=String.fromCharCode.apply(String,n.subarray(r<<15,e))),o.join("")}function hi(t,e){return typeof t=="string"&&(t=Qt(t)),typeof e=="string"&&(e=Qt(e)),t==null||t.length===0?t:ci(function(n,i){var r,o,u,p,v,b,C=n.length,E=C-1;for(o=n[E],u=0,b=0|Math.floor(6+52/C);b>0;--b){for(p=(u=Ct(u+Je))>>>2&3,v=0;v<E;++v)r=n[v+1],o=n[v]=Ct(n[v]+Zt(u,r,o,v,p,i));r=n[0],o=n[E]=Ct(n[E]+Zt(u,r,o,E,p,i))}return n}(Jt(t,!0),Jt(ui(e),!1)),!1)}function di(t,e){return typeof t=="string"&&(t=function(n){for(var i=window.atob(n),r=i.length,o=new Uint8Array(r),u=0;u<r;u++)o[u]=i.charCodeAt(u);return o}(t)),typeof e=="string"&&(e=Qt(e)),t==null||t.length===0?t:ci(function(n,i){var r,o,u,p,v,b=n.length,C=b-1;for(r=n[0],u=Ct(Math.floor(6+52/b)*Je);u!==0;u=Ct(u-Je)){for(p=u>>>2&3,v=C;v>0;--v)o=n[v-1],r=n[v]=Ct(n[v]-Zt(u,r,o,v,p,i));o=n[C],r=n[0]=Ct(n[0]-Zt(u,r,o,0,p,i))}return n}(Jt(t,!1),Jt(ui(e),!1)),!0)}const te={toBytes:Qt,toString:li,encrypt:hi,encryptToString:function(t,e){return window.btoa(Qo(hi(t,e)))},decrypt:di,decryptToString:function(t,e){return li(di(t,e))}},Z=Dn({panelGroups:{}}),fi=()=>({useGroupAccordion:t=>mt(()=>Z.panelGroups[t].accordion),setGroupAccordionStatus:(t,e)=>{Z.panelGroups[t]={...Z.panelGroups[t],accordion:e}},panelExpanded:(t,e)=>mt(()=>Z.panelGroups[t]?.panelExpandStatus?.[e]||!1),setPanelExpandedStatus:(t,e,n)=>{Z.panelGroups[t]={...Z.panelGroups[t],panelExpandStatus:{...Z.panelGroups[t]?.panelExpandStatus||{},[e]:n}}},togglePanelExpandedStatus:(t,e)=>{Z.panelGroups[t].accordion&&(Z.panelGroups[t].panelExpandStatus[e]||Object.keys(Z.panelGroups[t].panelExpandStatus).forEach(n=>{Z.panelGroups[t].panelExpandStatus[n]=!1})),Z.panelGroups[t].panelExpandStatus[e]=!Z.panelGroups[t].panelExpandStatus[e]}}),Ze=t=>t>255?255:t<0?0:t,ee=(t,e)=>{const n=t.replace("#",""),i=parseInt(n,16),r=Ze((i>>16)+e),o=Ze((i>>8&255)+e);return"#"+(Ze((255&i)+e)|o<<8|r<<16).toString(16)};var ne=At({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(t){const e=it(`group-${qt()}`),{setGroupAccordionStatus:n}=fi(),i={"--base-color":t.baseColor,"--border-color":ee(t.baseColor,180),"--bg-color-header":ee(t.baseColor,140),"--bg-color-header-hover":ee(t.baseColor,190),"--bg-color-header-active":ee(t.baseColor,200),"--bg-color-body":"#fff"};return n(e.value,t.accordion),{idGroup:e,cssColorVars:i}}});const ts=["data-id-group"];ne.render=function(t,e,n,i,r,o){return W(),et("div",{"data-id-group":t.idGroup,style:vt(t.cssColorVars),class:"vcpg"},[pt(t.$slots,"default")],12,ts)},ne.__scopeId="data-v-23ab5317",ne.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var ie=At({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(t,e){const n=`panel-${qt()}`,i=it(),r=it(),o=it(),{panelExpanded:u,togglePanelExpandedStatus:p,setPanelExpandedStatus:v}=fi(),b=mt(()=>({hasContent:e.slots.content&&e.slots.content()[0].children.length>0,dataKey:qt()})),C=mt(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),E=mt(()=>u(C.value,n).value&&b.value.hasContent);return ze(()=>{v(C.value,n,t.expanded)}),Mr(()=>{(async()=>(await Me(),r.value&&o.value&&(r.value.style.height=`${Math.min(o.value.scrollHeight,r.value.scrollHeight)}px`)))()}),{body:b,panelRef:i,bodyRef:r,bodyContentRef:o,isExpanded:E,collapse:A=>{A.style.height="0"},expand:A=>{A.style.height=`${A.scrollHeight}px`},toggle:()=>{!b.value.hasContent||p(C.value,n)},toggleIcon:`
|
|
13
13
|
<svg
|
|
14
14
|
width="24px"
|
|
15
15
|
height="24px"
|
|
@@ -19,4 +19,4 @@ import{h as kr,openBlock as W,createElementBlock as et,normalizeStyle as vt,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 es={class:"vcp__header-title"},ns={key:0,class:"vcp__header-icon"},is=["innerHTML"],rs={key:0,ref:"bodyRef",class:"vcp__body"},os={ref:"bodyContentRef",class:"vcp__body-content"};function Ze(t){return window.TouchEvent&&t instanceof TouchEvent}ie.render=function(t,e,n,i,r,o){return W(),et("section",{ref:"panelRef",class:_r(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[V("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...l)=>t.toggle&&t.toggle(...l))},[V("div",es,[pt(t.$slots,"title")]),t.body.hasContent?(W(),et("div",ns,[pt(t.$slots,"icon",{},()=>[V("span",{innerHTML:t.toggleIcon},null,8,is)])])):zt("v-if",!0)]),Dn(Tn,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:Ft(()=>[t.isExpanded?(W(),et("div",rs,[V("div",os,[pt(t.$slots,"content")],512)],512)):zt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},ie.__scopeId="data-v-08c94cf8",ie.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Q{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Ze(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Ze(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new dn(this.clientX,this.clientY)}static bindDown(e,n,i,r=!1){const o=p=>{n(new Q(p))},l=p=>{p.touches.length===1&&n(new Q(p)),p.touches.length>1&&i&&i(new Q(p))};return e.addEventListener("mousedown",o,r),e.addEventListener("touchstart",l,r),()=>{e.removeEventListener("mousedown",o,r),e.removeEventListener("touchstart",l,r)}}static bindMove(e,n,i=!1){const r=l=>{n(new Q(l))},o=l=>{l.touches.length===1&&n(new Q(l))};return e.addEventListener("mousemove",r,i),e.addEventListener("touchmove",o,i),()=>{e.removeEventListener("mousemove",r,i),e.removeEventListener("touchmove",o,i)}}static bindUp(e,n,i=!1){const r=l=>{n(new Q(l))},o=l=>{l.touches.length===0&&n(new Q(l))};return e.addEventListener("mouseup",r,i),e.addEventListener("touchend",o,i),()=>{e.removeEventListener("mouseup",r,i),e.removeEventListener("touchend",o,i)}}originalEvent({mouse:e,touch:n}){Ze(this.e)?n&&n(this.e):e&&e(this.e)}}class dn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new dn(this.x,this.y)}}class ss{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,i={}){this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=Q.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:i}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.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 as{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=oe(this._group),i=oe(e);n.splice(n.indexOf(this),1),i.push(this),pi()}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(oe(this._group)),pi()}}const re=new Map;function oe(t){return re.has(t)||re.set(t,[]),re.get(t)}function fi(t,e){return t>e?-fi(e,t):t<0&&e>=0?1:t-e}function pi(){let t=0;for(const e of function(n){const i=[];return n.forEach((r,o)=>i.push(o)),i}(re).sort(fi))for(const n of oe(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Qe(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=se(t);return t.style.width=e,t.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function se(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,r=e.top,o=e.left;return{width:n,height:i,top:r,left:o,bottom:r+i,right:o+n}}class cs{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=mi.map(y=>new y(e,this));const{width:i,height:r}=Qe(e),o=n.maxWidth||window.innerWidth,l=n.maxHeight||window.innerHeight;let p=!1;(i<n.minWidth||i>o)&&(e.style.width=`${gi(i,n.minWidth,o)}px`,p=!0),(r<n.minHeight||r>l)&&(e.style.height=`${gi(r,n.minHeight,l)}px`,p=!0),p&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const mi=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Q.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:i,width:r,height:o}=se(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:r}=se(this.container),o=this.helper.options,l=o.maxWidth||window.innerWidth,p=o.maxHeight||window.innerHeight;this.minLeft=Math.max(i-l,0),this.maxLeft=i-o.minWidth,this.minRight=e+o.minWidth,this.maxRight=Math.min(e+l,window.innerWidth),this.minTop=Math.max(r-p,0),this.maxTop=r-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+p,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:i,top:r,right:o,bottom:l}=se(this.container),p=this.helper.options;!p||(i<this.minLeft?(this.container.style.width=e+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${p.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${p.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-i+"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=`${p.minHeight}px`,this.container.style.top=`${this.maxTop}px`):l<this.minBottom?this.container.style.height=`${p.minHeight}px`:l>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 gi(t,e,n){return t<e?e:t>n?n:t}mi.push(class extends gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 ae=Lt({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=it(!1),n=it(!1);return{hover:e,active:n,style:function(){let i=t.windowStyle.button;return e.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=Q.bindUp(document,()=>{n.value=!1,r()})}}}});const us=["disabled"];ae.render=function(t,e,n,i,r,o){return W(),et("div",{class:"btn",style:vt(t.style()),onMouseenter:e[0]||(e[0]=l=>t.hover=!0),onMouseleave:e[1]||(e[1]=l=>t.hover=!1),onMousedown:e[2]||(e[2]=Bn((...l)=>t.mousedown&&t.mousedown(...l),["stop"])),onTouchstart:e[3]||(e[3]=Bn((...l)=>t.mousedown&&t.mousedown(...l),["stop"])),onMouseup:e[4]||(e[4]=(...l)=>t.mouseup&&t.mouseup(...l)),onTouchend:e[5]||(e[5]=(...l)=>t.mouseup&&t.mouseup(...l)),disabled:t.disabled},[pt(t.$slots,"default")],44,us)},ae.__scopeId="data-v-71662210",ae.__file="src/controls/vuewindow/window/Button.vue";const tn=new Set;function vi(t){return t!==null?parseFloat(t):0}function ce(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(vi).reduce((r,o)=>r+o)),i=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(vi).reduce((r,o)=>r+o));return{width:n,height:i}}class yi{width;height;constructor(e,n){this.width=e,this.height=n}}function ls(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),i=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function hs(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}window.addEventListener("resize",t=>{tn.forEach(e=>{e&&Vt(e.fixPosition)&&e.fixPosition()})});const ue=[];var le=Lt({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:ae},setup(t,{emit:e}){const n=Mr();if(!n)return;const{proxy:i}=n;let r=0,o,l,p;const y=it(t.isOpen),b=()=>{ue.push(i),p=new as(t.zGroup,C),t.isOpen&&function(I){I&&(_e(()=>{r++==0&&(d(i),function(){const R=E.value,{width:O,height:j}=Qe(R);let U,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")U=t.left,H=t.top;else{const tt=t.positionHint||"auto";switch(tt){case"auto":{let X=20,Y=50,q=0;do{if(ue.every(st=>{if(!st.isOpen||i==st)return!0;const Ot=ls(st);if(Ot==null)return!0;const{left:ge,top:rt}=Ot;return hs(ge,rt,X,Y)>16}))break;X=(X+40)%(window.innerWidth-200),Y=(Y+40)%(window.innerHeight-200)}while(++q<100);U=X,H=Y}break;case"center":U=(window.innerWidth-O)/2,H=(window.innerHeight-j)/2,console.log(U,H,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=tt.split("/").map(Number);if(X.length!=2)throw null;const[Y,q]=X;if(!isFinite(Y)||!isFinite(q))throw null;U=Y>=0?Y:window.innerWidth-O+Y,H=q>=0?q:window.innerHeight-j+q}catch{throw new Error(`invalid position string: ${tt}`)}}}R&&(R.style.left=`${U}px`,R.style.top=`${H}px`)}()),t.resizable&&h(),L(),o=new ss(D.value,E.value,{onMove:()=>L(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:R}=Qe(D.value);l=new cs(E.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+R,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+R:void 0})}()}),t.activateWhenOpen&&P())}(!0),tn.add(i)};function C(I){S.value.zIndex=`${I}`}const E=it(null),D=it(null),T=it(null);function P(){p.raise(),e("activate")}const S=it({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),u=mt(()=>t.windowStyle.titlebar),f=mt(()=>{const I={...t.windowStyle.content};return t.resizable?I.padding="0":t.padding!=null&&(I.padding=`${t.padding}px`),t.isScrollable&&(I.overflow="auto"),I});function d(I){const{width:R,height:O,top:j,left:U}=I,H=E;if(H&&R!=null&&(H.value.style.width=`${R}px`),O!=null){const tt=D.value;if(tt){const X=ce(tt).height;H.value.style.height=`${O+X}px`}}H&&U!=null&&(H.value.style.left=`${U}px`),H&&j!=null&&(H.value.style.top=`${j}px`)}function h(I=!0){const R=E.value,O=D.value,j=T.value;if(j&&R&&O){const{width:U,height:H}=ce(j),{width:tt,height:X}=ce(R),Y=ce(O).height,q=tt-(j.offsetWidth-U),st=X-Y-(j.offsetHeight-H);j.style.width=`${q}px`,j.style.height=`${st}px`,g(),e("resize",new yi(q,st)),I&&(e("update:width",q),e("update:height",st))}}function g(){const I=E.value;if(I){const R=I.getBoundingClientRect();R.left<0&&(S.value.left="0px"),R.top<0&&(S.value.top="0px"),R.right>window.innerWidth&&(S.value.left=window.innerWidth-R.width+"px"),R.bottom>window.innerHeight&&(S.value.top=window.innerHeight-R.height+"px")}}function L(I=!0){g();const R=E.value;if(R){const{left:O,top:j}=R.getBoundingClientRect();I&&(e("update:left",O),e("update:top",j))}}return $t(()=>t.isOpen,I=>{y.value=I}),$t(()=>t.zGroup,I=>{p.group=I}),$t(()=>t.width,I=>{d({width:I}),h(!1)}),$t(()=>t.height,I=>{d({height:I}),h(!1)}),ze(()=>{b()}),Ir(()=>{tn.delete(this),p.unregister(),l&&l.teardown(),o&&o.teardown(),ue.splice(ue.indexOf(i),1)}),{isOpen:y,windowEl:E,titlebar:D,content:T,activate:P,styleWindow:S,styleTitlebar:u,styleContent:f,closeButtonClick:function(){y.value=!1,e("closebuttonclick")},fixPosition:g}}});const ds={class:"title"},fs=Nn("\xD7");var wi;le.render=function(t,e,n,i,r,o){const l=On("myButton");return W(),ct(Tn,{name:"fade",onAfterLeave:e[2]||(e[2]=p=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=p=>t.$emit("open"))},{default:Ft(()=>[Rr(V("div",{class:"window",style:vt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...p)=>t.activate&&t.activate(...p)),onTouchstart:e[1]||(e[1]=(...p)=>t.activate&&t.activate(...p))},[V("div",{class:"titlebar",style:vt(t.styleTitlebar),ref:"titlebar"},[V("div",ds,[t.$slots.title?pt(t.$slots,"title",{key:0}):(W(),et(yt,{key:1},[Nn(Pr(t.title),1)],2112))]),t.closeButton?(W(),ct(l,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:Ft(()=>[fs]),_:1},8,["windowStyle","onClick"])):zt("v-if",!0)],4),V("div",{class:"content",style:vt(t.styleContent),ref:"content"},[pt(t.$slots,"default")],4)],36),[[Lr,t.isOpen]])]),_:3})},le.__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"}(wi||(wi={}));const ps={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)"}},ms={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)"}},gs={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)"}},vs={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)"}},ys=le;var K;(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"})(K||(K={}));class bi{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(e,n,i){this.layoutState=e,this._LayoutID=i,n.forEach(r=>{if(r.layoutID===i&&(this.widgetConfig.push(r),r.afterid))if(this.preConditionMap.has(r.afterid))this.preConditionMap.get(r.afterid)?.add(r);else{const o=new Set;o.add(r),this.preConditionMap.set(r.afterid,o)}})}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 xt(e)?n=e:Ue(e)&&(n=this.widgetConfig.find(i=>i.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 i=Ar(n.default);this.getContainerComponents(e.container).value.set(e.id,i),this.widgetsLoadedSet.add(e.id),_e().then(()=>{B.EventBus.emit(nt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}})}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const l of o)this.unloadWidget(l.id)}const i=this.getContainerComponents(n.container),r=i.value.get(e);r&&r.unmounted&&r.unmounted(),i.value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(nt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(e){switch(e){case K.top:return this.layoutState.topContainer;case K.bottom:return this.layoutState.bottomContainer;case K.left:return this.layoutState.leftContainer;case K.right:return this.layoutState.rightContainer;case K.centerBack:return this.layoutState.centerBackContainer;case K.centerMain:return this.layoutState.centerMainContainer;case K.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const i=this.getLayoutContainer(e);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const i=this.getWidgetComponent(e);i&&B.EventBus.emit(nt.WidgetVisibleChanged,{id:e,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetConfig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.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=it(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}var he=Lt({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object}},emits:["containerLoaded"],setup(t,{attrs:e,slots:n,emit:i}){const r=t.layoutID,o=An({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),l=new bi(o,t.widgetConfig,r),p=T(K.top),y=T(K.centerBack),b=T(K.centerFront),C=T(K.left),E=T(K.right),D=T(K.bottom);function T(S){return l?.getContainerComponents(S)}const P=mt(()=>t.layoutStyle);return ze(()=>{l&&(l.preloadWidgets(),r===void 0&&(B.LayoutManager=l),i("containerLoaded",{layoutID:r,layoutManager:l}))}),{...Dr(o),topContainerComponents:p,centerbackComponents:y,centerfrontComponents:b,leftContainerComponents:C,rightContainerComponents:E,bottomContainerComponents:D,containerStyle:P}}});const ws={ref:"topContainer",class:"topContainer"},bs={ref:"centerBackContainer",class:"centerdiv backContainer"},Ss={ref:"centerMainContainer",class:"centerdiv mainContainer"},xs={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Cs={ref:"leftContainer",class:"leftContainer"},Es={ref:"rightContainer",class:"rightContainer"},ks={ref:"bottomContainer",class:"bottomContainer"};he.render=function(t,e,n,i,r,o){const l=On("router-view");return W(),et("div",{class:"layoutContainer",style:vt(t.containerStyle)},[V("div",ws,[(W(!0),et(yt,null,_t(t.topContainerComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512),V("div",null,[zt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",bs,[(W(!0),et(yt,null,_t(t.centerbackComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512),zt(" \u4E3B\u8981\u5BB9\u5668 "),V("div",Ss,[Dn(l,null,{default:Ft(({Component:p})=>[(W(),ct(wt(p)))]),_:1})],512),zt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",xs,[(W(!0),et(yt,null,_t(t.centerfrontComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512),V("div",Cs,[(W(!0),et(yt,null,_t(t.leftContainerComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512),V("div",Es,[(W(!0),et(yt,null,_t(t.rightContainerComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512)]),V("div",ks,[(W(!0),et(yt,null,_t(t.bottomContainerComponents,([p,y])=>(W(),ct(wt(y),{key:p}))),128))],512)],4)},he.__scopeId="data-v-4d081e5c",he.__file="src/controls/layoutcontainer/layout.vue";const de=new Map,en=new Map;let fe;const zs={getDefaultClient(){if(fe||(fe=new At(SysConfig.DefaultHproseAPI)),!fe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return fe},registerHprose(t,e){const n=en.get(t);if(!n){const i=new At(e);de.set(t,i)}return n},getHprose:t=>en?.get(t),getProxyHprose:t=>de.get(t),unregisterHprose(t){de.get(t)&&(en.delete(t),de.delete(t))}},_s=5e3,Ms=36e5,Et={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},nn="access_token",Is=B.Config.ServiceURL.LoginAuthURL;function rn(){const t=qn();t&<(Et.RefreshToken,Is,{refreshToken:t}).then(e=>{on(e.data)})}function Si(){const t=ut.getJsonObject(nn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?rn():setTimeout(rn,n-5e3))}function on(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let i=St();i?(i.token=t.accessToken.tokenContent,i.expire=t.accessToken.expires,i.refresh=t.refreshToken.tokenContent):i={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},ut.set(nn,i,n/1e3),Si()}else ut.remove(nn)}const pe="Wm314243",me=B.Config.ServiceURL.LoginAuthURL;async function Rs(t){const e={username:t.username,pwd:te.encryptToString(t.pwd,pe)},n=(await lt(Et.Login,me,e))?.data;return n&&on(n.doubletoken),n}function Ps(t){const e={oldpwd:te.encryptToString(t.oldpwd,pe),newpwd:te.encryptToString(t.newpwd,pe)};return lt(Et.ChangeMyPwd,me,e)}function Ls(t){return te.encryptToString(t,pe)}function As(){const t=St();t&&($e(Et.Logout,me,{token:t.token,reftoken:t.refresh}),Be())}function Ds(t){return lt(Et.CheckToken,me,{token:t})}const sn="ROLE_SYSTEM_RIGHT",an=new Wt("",sessionStorage);function xi(){return an.get(sn)}function cn(t){an.set(sn,t)}function Ci(){an.remove(sn)}function Rt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Rt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function Ei(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&Ei(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function ki(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&ki(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function Tt(t,e,n,i="name"){const r=t[n],o=e[n];r?o&&ki(r,o,i):o&&(t[n]=o)}function zi(t){if(t&&t.length>0){const e=t.length;let n,i=!1;if(e>0){i=xt(t[0]);const r=i?t[0]:JSON.parse(t[0]);if(e>1)for(let o=1;o<t.length;o++){const l=t[o],p=i?l:JSON.parse(l);Tt(r,p,"routes","name"),Tt(r,p,"widgetMenu","name"),Tt(r,p,"widgets","id"),Tt(r,p,"functions","id")}n=r}return n&&(Rt(n.routes),Rt(n.widgetMenu),Rt(n.widgets),Rt(n.functions)),n}}const un=[],ln=[],hn=[];function Bt(){return xi()}async function Ts(t,e=!1){Ci();const n=Et.GetSystemRights,i=B.Config.ServiceURL.LoginAuthURL,r=await lt(n,i,{systemid:t});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=r.data;if(o&&o.length>0){if(e){const l=JSON.parse(o[0]);return cn(l),l}{const l=zi(o);return cn(l),l}}}function _i(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(i=>{const r=t.children?.find(o=>o.path===i.path);if(r){const o=_i(r,i);o&&n.children?.push(o)}})),n}function Bs(t,e=2){if(e===0)return t;const n=Bt();return n&&n.routes?(hn.length>0||t.forEach(i=>{const r=n.routes?.find(o=>o.name===i.name);if(r){const o=_i(i,r);o&&hn.push(o)}}),hn):void 0}function Mi(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.name===i.name);if(r){const o=Mi(r,i);o&&n.children?.push(o)}})),n}function Ns(t,e=2){if(e===0)return t;const n=Bt();return n&&n.widgetMenu?(ln.length>0||t.forEach(i=>{const r=n.widgetMenu?.find(o=>o.name===i.name);if(r){const o=Mi(i,r);o&&ln.push(o)}}),ln):void 0}function Os(t,e=2){if(e===0)return t;const n=Bt();return n&&n.widgets?(un.length>0||t?.forEach(i=>{n.widgets?.find(r=>r.id===i.id)&&un.push(i)}),un):void 0}function Us(t,e=2){if(e===0)return t;const n=Bt();return n?n.functions:void 0}export{Vo as BigFileDownload,Xt as Download,to as DownloadByUrl,bt as EnumColor,B as Global,zs as GlobalHprose,It as GlobalMitt,ot as H5Tool,Nt as HproseClient,Qr as HttpDownload,$n as JsonDownload,he as LayoutContainer,K as LayoutContainerEnum,bi as LayoutManager,Ko as ObjToUrlParams,Ie as Pane,At as ProxyClient,Zr as SaveAs,Or as Splitpanes,Wt as Storage,Ht as StringUtils,ps as StyleBlack,vs as StyleGrayblue,gs as StyleMetal,ms as StyleWhite,nt as SysEvents,_s as TOKEN_REFRESH_TIME,Ms as TOKEN_VALID_TIMESPAN,Et as USER_TOKEN_API,ie as VCollapsiblePanel,ne as VCollapsiblePanelGroup,le as VWindow,yi as WindowResizeEvent,ys as WindowType,Jr as calculateBestTextColor,Ps as changeMyPWD,Si as checkDoRefreshToken,Ds as checkToken,Be as clearLocalToken,Ci as clearRight,Vr as colorIsDark,Oo as createFileUpload,Kr as darken,ni as deepMerge,rn as doRefreshToken,ii as exportSystemRights,Eo as get,Bt as getCurrentSystemRight,zo as getData,Ls as getEncryptPWD,Us as getFunctions,$r as getHexColor,St as getLocalToken,Ho as getLockState,Wr as getLongHexColor,Jn as getProxyClient,Hr as getRGBColor,Gr as getRGBColorFromHSLA,qn as getRefreshToken,xi as getRight,Bs as getRoutes,Ts as getSystemRoleRight,Os as getWidgetConfig,Ns as getWidgetMenus,Rt as handleNodes,Le as hexToRGB,Fo as init,$o as initDefaultProxyClient,J as is,je as isArray,ao as isAsyncFunction,uo as isBoolean,lo as isClient,oo as isDate,Gn as isDef,fo as isElement,go as isEmpty,qr as isEnumColor,vo as isError,Vt as isFunction,Gt as isHexColor,mo as isImageDom,So as isMap,Oe as isNull,io as isNullAndUnDef,ro as isNullOrUnDef,so as isNumber,xt as isObject,co as isPromise,po as isServer,Ue as isString,bo as isSymbol,Ne as isUnDef,xo as isValidURL,wo as isWeakMap,yo as isWeakSet,ho as isWindow,Uo as jquery,Yr as lighten,Rs as login,As as logout,zi as mergeFilterRoleSysRight,Ei as mergeNodes,Tt as mergeNodesAll,Fr as newGuid,Wo as onLockListener,ko as post,lt as requestGet,$e as requestPost,Co as requestPostBody,Xr as rgbToHex,on as setLocalToken,cn as setRight,eo as sleep,jr as storage,ut as storageHelper,qo as unLockListener,qt as uuid,Jo as writeIconifyList,Zo as writeSysRoleRight};
|
|
22
|
+
`}}});const es={class:"vcp__header-title"},ns={key:0,class:"vcp__header-icon"},is=["innerHTML"],rs={key:0,ref:"bodyRef",class:"vcp__body"},os={ref:"bodyContentRef",class:"vcp__body-content"};function Qe(t){return window.TouchEvent&&t instanceof TouchEvent}ie.render=function(t,e,n,i,r,o){return W(),et("section",{ref:"panelRef",class:_r(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[K("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...u)=>t.toggle&&t.toggle(...u))},[K("div",es,[pt(t.$slots,"title")]),t.body.hasContent?(W(),et("div",ns,[pt(t.$slots,"icon",{},()=>[K("span",{innerHTML:t.toggleIcon},null,8,is)])])):zt("v-if",!0)]),Tn(Bn,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:Ft(()=>[t.isExpanded?(W(),et("div",rs,[K("div",os,[pt(t.$slots,"content")],512)],512)):zt("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},ie.__scopeId="data-v-08c94cf8",ie.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Q{e;constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Qe(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new fn(this.clientX,this.clientY)}static bindDown(e,n,i,r=!1){const o=p=>{n(new Q(p))},u=p=>{p.touches.length===1&&n(new Q(p)),p.touches.length>1&&i&&i(new Q(p))};return e.addEventListener("mousedown",o,r),e.addEventListener("touchstart",u,r),()=>{e.removeEventListener("mousedown",o,r),e.removeEventListener("touchstart",u,r)}}static bindMove(e,n,i=!1){const r=u=>{n(new Q(u))},o=u=>{u.touches.length===1&&n(new Q(u))};return e.addEventListener("mousemove",r,i),e.addEventListener("touchmove",o,i),()=>{e.removeEventListener("mousemove",r,i),e.removeEventListener("touchmove",o,i)}}static bindUp(e,n,i=!1){const r=u=>{n(new Q(u))},o=u=>{u.touches.length===0&&n(new Q(u))};return e.addEventListener("mouseup",r,i),e.addEventListener("touchend",o,i),()=>{e.removeEventListener("mouseup",r,i),e.removeEventListener("touchend",o,i)}}originalEvent({mouse:e,touch:n}){Qe(this.e)?n&&n(this.e):e&&e(this.e)}}class fn{x;y;constructor(e,n){this.x=e,this.y=n}clone(){return new fn(this.x,this.y)}}class ss{handle;container;options;unbindDown;unbindMove;unbindUp;constructor(e,n,i={}){this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=Q.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:i}=this.handle.getBoundingClientRect();this.offsetX=e.clientX-n,this.offsetY=e.clientY-i}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.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 as{_group;onChange;zIndex;constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=oe(this._group),i=oe(e);n.splice(n.indexOf(this),1),i.push(this),mi()}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(oe(this._group)),mi()}}const re=new Map;function oe(t){return re.has(t)||re.set(t,[]),re.get(t)}function pi(t,e){return t>e?-pi(e,t):t<0&&e>=0?1:t-e}function mi(){let t=0;for(const e of function(n){const i=[];return n.forEach((r,o)=>i.push(o)),i}(re).sort(pi))for(const n of oe(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function tn(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=se(t);return t.style.width=e,t.style.height=n,i}return{width:0,height:0,top:0,left:0,bottom:0,right:0}}function se(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,r=e.top,o=e.left;return{width:n,height:i,top:r,left:o,bottom:r+i,right:o+n}}class cs{container;options;handles;constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=gi.map(v=>new v(e,this));const{width:i,height:r}=tn(e),o=n.maxWidth||window.innerWidth,u=n.maxHeight||window.innerHeight;let p=!1;(i<n.minWidth||i>o)&&(e.style.width=`${vi(i,n.minWidth,o)}px`,p=!0),(r<n.minHeight||r>u)&&(e.style.height=`${vi(r,n.minHeight,u)}px`,p=!0),p&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const gi=[];class gt{container;helper;handle;handleSize=8;unbindDown;unbindMove;unbindUp;constructor(e,n){this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Q.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:i,width:r,height:o}=se(this.container);this.x0=e.clientX,this.y0=e.clientY,this.left0=n,this.top0=i,this.width0=r,this.height0=o,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Q.bindMove(document,this.mousemove),this.unbindUp=Q.bindUp(document,this.mouseup)};minLeft;maxLeft;minRight;maxRight;minTop;maxTop;minBottom;maxBottom;calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:r}=se(this.container),o=this.helper.options,u=o.maxWidth||window.innerWidth,p=o.maxHeight||window.innerHeight;this.minLeft=Math.max(i-u,0),this.maxLeft=i-o.minWidth,this.minRight=e+o.minWidth,this.maxRight=Math.min(e+u,window.innerWidth),this.minTop=Math.max(r-p,0),this.maxTop=r-o.minHeight,this.minBottom=n+o.minHeight,this.maxBottom=Math.min(n+p,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:i,top:r,right:o,bottom:u}=se(this.container),p=this.helper.options;!p||(i<this.minLeft?(this.container.style.width=e+i-this.minLeft+"px",this.container.style.left=`${this.minLeft}px`):i>this.maxLeft?(this.container.style.width=`${p.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):o<this.minRight?this.container.style.width=`${p.minWidth}px`:o>this.maxRight&&(this.container.style.width=this.maxRight-i+"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=`${p.minHeight}px`,this.container.style.top=`${this.maxTop}px`):u<this.minBottom?this.container.style.height=`${p.minHeight}px`:u>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 vi(t,e,n){return t<e?e:t>n?n:t}gi.push(class extends gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 gt{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 ae=At({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=it(!1),n=it(!1);return{hover:e,active:n,style:function(){let i=t.windowStyle.button;return e.value&&(i={...i,...this.windowStyle.buttonHover}),n.value&&(i={...i,...this.windowStyle.buttonActive}),i},mouseup:function(i){this.active&&this.$emit("click")},mousedown:function(i){i.preventDefault(),n.value=!0;const r=Q.bindUp(document,()=>{n.value=!1,r()})}}}});const us=["disabled"];ae.render=function(t,e,n,i,r,o){return W(),et("div",{class:"btn",style:vt(t.style()),onMouseenter:e[0]||(e[0]=u=>t.hover=!0),onMouseleave:e[1]||(e[1]=u=>t.hover=!1),onMousedown:e[2]||(e[2]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onTouchstart:e[3]||(e[3]=Nn((...u)=>t.mousedown&&t.mousedown(...u),["stop"])),onMouseup:e[4]||(e[4]=(...u)=>t.mouseup&&t.mouseup(...u)),onTouchend:e[5]||(e[5]=(...u)=>t.mouseup&&t.mouseup(...u)),disabled:t.disabled},[pt(t.$slots,"default")],44,us)},ae.__scopeId="data-v-71662210",ae.__file="src/controls/vuewindow/window/Button.vue";const en=new Set;function yi(t){return t!==null?parseFloat(t):0}function ce(t){const e=window.getComputedStyle(t),n=Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(yi).reduce((r,o)=>r+o)),i=Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(yi).reduce((r,o)=>r+o));return{width:n,height:i}}class wi{width;height;constructor(e,n){this.width=e,this.height=n}}function ls(t){const e=t.windowEl;if(e){const n=parseFloat(e.style.left||"NaN"),i=parseFloat(e.style.top||"NaN");if(!isNaN(n)&&!isNaN(i))return{left:n,top:i}}return null}function hs(t,e,n,i){const r=t-n,o=e-i;return r*r+o*o}window.addEventListener("resize",t=>{en.forEach(e=>{e&&Kt(e.fixPosition)&&e.fixPosition()})});const ue=[];var le=At({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:ae},setup(t,{emit:e}){const n=Ir();if(!n)return;const{proxy:i}=n;let r=0,o,u,p;const v=it(t.isOpen),b=()=>{ue.push(i),p=new as(t.zGroup,C),t.isOpen&&function(I){I&&(Me(()=>{r++==0&&(d(i),function(){const R=E.value,{width:O,height:j}=tn(R);let U,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")U=t.left,H=t.top;else{const tt=t.positionHint||"auto";switch(tt){case"auto":{let X=20,Y=50,q=0;do{if(ue.every(st=>{if(!st.isOpen||i==st)return!0;const Ot=ls(st);if(Ot==null)return!0;const{left:ge,top:rt}=Ot;return hs(ge,rt,X,Y)>16}))break;X=(X+40)%(window.innerWidth-200),Y=(Y+40)%(window.innerHeight-200)}while(++q<100);U=X,H=Y}break;case"center":U=(window.innerWidth-O)/2,H=(window.innerHeight-j)/2,console.log(U,H,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=tt.split("/").map(Number);if(X.length!=2)throw null;const[Y,q]=X;if(!isFinite(Y)||!isFinite(q))throw null;U=Y>=0?Y:window.innerWidth-O+Y,H=q>=0?q:window.innerHeight-j+q}catch{throw new Error(`invalid position string: ${tt}`)}}}R&&(R.style.left=`${U}px`,R.style.top=`${H}px`)}()),t.resizable&&h(),L(),o=new ss(A.value,E.value,{onMove:()=>L(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:R}=tn(A.value);u=new cs(E.value,{onResize:()=>h(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+R,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+R:void 0})}()}),t.activateWhenOpen&&P())}(!0),en.add(i)};function C(I){S.value.zIndex=`${I}`}const E=it(null),A=it(null),D=it(null);function P(){p.raise(),e("activate")}const S=it({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),l=mt(()=>t.windowStyle.titlebar),f=mt(()=>{const I={...t.windowStyle.content};return t.resizable?I.padding="0":t.padding!=null&&(I.padding=`${t.padding}px`),t.isScrollable&&(I.overflow="auto"),I});function d(I){const{width:R,height:O,top:j,left:U}=I,H=E;if(H&&R!=null&&(H.value.style.width=`${R}px`),O!=null){const tt=A.value;if(tt){const X=ce(tt).height;H.value.style.height=`${O+X}px`}}H&&U!=null&&(H.value.style.left=`${U}px`),H&&j!=null&&(H.value.style.top=`${j}px`)}function h(I=!0){const R=E.value,O=A.value,j=D.value;if(j&&R&&O){const{width:U,height:H}=ce(j),{width:tt,height:X}=ce(R),Y=ce(O).height,q=tt-(j.offsetWidth-U),st=X-Y-(j.offsetHeight-H);j.style.width=`${q}px`,j.style.height=`${st}px`,g(),e("resize",new wi(q,st)),I&&(e("update:width",q),e("update:height",st))}}function g(){const I=E.value;if(I){const R=I.getBoundingClientRect();R.left<0&&(S.value.left="0px"),R.top<0&&(S.value.top="0px"),R.right>window.innerWidth&&(S.value.left=window.innerWidth-R.width+"px"),R.bottom>window.innerHeight&&(S.value.top=window.innerHeight-R.height+"px")}}function L(I=!0){g();const R=E.value;if(R){const{left:O,top:j}=R.getBoundingClientRect();I&&(e("update:left",O),e("update:top",j))}}return $t(()=>t.isOpen,I=>{v.value=I}),$t(()=>t.zGroup,I=>{p.group=I}),$t(()=>t.width,I=>{d({width:I}),h(!1)}),$t(()=>t.height,I=>{d({height:I}),h(!1)}),ze(()=>{b()}),Rr(()=>{en.delete(this),p.unregister(),u&&u.teardown(),o&&o.teardown(),ue.splice(ue.indexOf(i),1)}),{isOpen:v,windowEl:E,titlebar:A,content:D,activate:P,styleWindow:S,styleTitlebar:l,styleContent:f,closeButtonClick:function(){v.value=!1,e("closebuttonclick")},fixPosition:g}}});const ds={class:"title"},fs=On("\xD7");var bi;le.render=function(t,e,n,i,r,o){const u=Un("myButton");return W(),ct(Bn,{name:"fade",onAfterLeave:e[2]||(e[2]=p=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=p=>t.$emit("open"))},{default:Ft(()=>[Pr(K("div",{class:"window",style:vt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...p)=>t.activate&&t.activate(...p)),onTouchstart:e[1]||(e[1]=(...p)=>t.activate&&t.activate(...p))},[K("div",{class:"titlebar",style:vt(t.styleTitlebar),ref:"titlebar"},[K("div",ds,[t.$slots.title?pt(t.$slots,"title",{key:0}):(W(),et(yt,{key:1},[On(Ar(t.title),1)],2112))]),t.closeButton?(W(),ct(u,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:Ft(()=>[fs]),_:1},8,["windowStyle","onClick"])):zt("v-if",!0)],4),K("div",{class:"content",style:vt(t.styleContent),ref:"content"},[pt(t.$slots,"default")],4)],36),[[Lr,t.isOpen]])]),_:3})},le.__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"}(bi||(bi={}));const ps={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)"}},ms={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)"}},gs={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)"}},vs={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)"}},ys=le;var V;(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"})(V||(V={}));class Si{layoutState;layoutMap=new Map;preConditionMap=new Map;widgetsLoadedSet=new Set;widgetConfig=new Array;_LayoutID;constructor(e,n,i){this.layoutState=e,this._LayoutID=i,n.forEach(r=>{if(r.layoutID===i&&(this.widgetConfig.push(r),r.afterid))if(this.preConditionMap.has(r.afterid))this.preConditionMap.get(r.afterid)?.add(r);else{const o=new Set;o.add(r),this.preConditionMap.set(r.afterid,o)}})}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 xt(e)?n=e:je(e)&&(n=this.widgetConfig.find(i=>i.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 i=Dr(n.default);this.getContainerComponents(e.container).value.set(e.id,i),this.widgetsLoadedSet.add(e.id),Me().then(()=>{B.EventBus.emit(nt.WidgetLoadedEvent,{layoutID:this._LayoutID,widgetID:e.id}),this.loadOtherDependenceWidgets(e.id)})}})}hasDependentWidgets(e){let n=!1;if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i){for(const r of i)if(this.isWidgetLoaded(r.id)){n=!0;break}}}return n}unloadWidget(e){if(!e||!this.isWidgetLoaded(e))return;const n=this.widgetConfig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const o=this.preConditionMap.get(e);if(o)for(const u of o)this.unloadWidget(u.id)}const i=this.getContainerComponents(n.container),r=i.value.get(e);r&&r.unmounted&&r.unmounted(),i.value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(nt.WidgetUnLoadedEvent,{layoutID:this._LayoutID,widgetID:e})}}isWidgetLoaded(e){return this.widgetsLoadedSet.has(e)}splitTwoContainer(e=!1){const n=this.layoutState.centerMainContainer,i=this.layoutState.centerBackContainer;e?(n&&(n.style.left="0",n.style.width="100%"),i&&(i.style.width="100%")):(n&&(n.style.left="50%",n.style.width="50%"),i&&(i.style.width="50%"))}getLayoutContainer(e){switch(e){case V.top:return this.layoutState.topContainer;case V.bottom:return this.layoutState.bottomContainer;case V.left:return this.layoutState.leftContainer;case V.right:return this.layoutState.rightContainer;case V.centerBack:return this.layoutState.centerBackContainer;case V.centerMain:return this.layoutState.centerMainContainer;case V.centerFront:return this.layoutState.centerFrontContainer}}changeContainerVisible(e,n=!1){const i=this.getLayoutContainer(e);i&&(i.style.visibility=n?"visible":"hidden")}changeWidgetVisible(e,n=!1){const i=this.getWidgetComponent(e);i&&B.EventBus.emit(nt.WidgetVisibleChanged,{id:e,layoutID:this._LayoutID,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetConfig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.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=it(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}var he=At({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutID:{type:String,default:void 0},layoutStyle:{type:Object}},emits:["containerLoaded"],setup(t,{attrs:e,slots:n,emit:i}){const r=t.layoutID,o=Dn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0}),u=new Si(o,t.widgetConfig,r),p=D(V.top),v=D(V.centerBack),b=D(V.centerFront),C=D(V.left),E=D(V.right),A=D(V.bottom);function D(S){return u?.getContainerComponents(S)}const P=mt(()=>t.layoutStyle);return ze(()=>{u&&(u.preloadWidgets(),r===void 0&&(B.LayoutManager=u),i("containerLoaded",{layoutID:r,layoutManager:u}))}),{...Tr(o),topContainerComponents:p,centerbackComponents:v,centerfrontComponents:b,leftContainerComponents:C,rightContainerComponents:E,bottomContainerComponents:A,containerStyle:P}}});const ws={ref:"topContainer",class:"topContainer"},bs={ref:"centerBackContainer",class:"centerdiv backContainer"},Ss={ref:"centerMainContainer",class:"centerdiv mainContainer"},xs={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Cs={ref:"leftContainer",class:"leftContainer"},Es={ref:"rightContainer",class:"rightContainer"},ks={ref:"bottomContainer",class:"bottomContainer"};he.render=function(t,e,n,i,r,o){const u=Un("router-view");return W(),et("div",{class:"layoutContainer",style:vt(t.containerStyle)},[K("div",ws,[(W(!0),et(yt,null,Mt(t.topContainerComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512),K("div",null,[zt(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),K("div",bs,[(W(!0),et(yt,null,Mt(t.centerbackComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512),zt(" \u4E3B\u8981\u5BB9\u5668 "),K("div",Ss,[Tn(u,null,{default:Ft(({Component:p})=>[(W(),ct(wt(p)))]),_:1})],512),zt(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),K("div",xs,[(W(!0),et(yt,null,Mt(t.centerfrontComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512),K("div",Cs,[(W(!0),et(yt,null,Mt(t.leftContainerComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512),K("div",Es,[(W(!0),et(yt,null,Mt(t.rightContainerComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512)]),K("div",ks,[(W(!0),et(yt,null,Mt(t.bottomContainerComponents,([p,v])=>(W(),ct(wt(v),{key:p}))),128))],512)],4)},he.__scopeId="data-v-4d081e5c",he.__file="src/controls/layoutcontainer/layout.vue";const de=new Map,nn=new Map;let fe;const zs={getDefaultClient(){if(fe||(fe=new Lt(SysConfig.DefaultHproseAPI)),!fe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return fe},registerHprose(t,e){const n=nn.get(t);if(!n){const i=new Lt(e);de.set(t,i)}return n},getHprose:t=>nn?.get(t),getProxyHprose:t=>de.get(t),unregisterHprose(t){de.get(t)&&(nn.delete(t),de.delete(t))}},Ms=5e3,_s=36e5,Et={Login:"/api/User/Login",ChangeMyPwd:"/api/User/ChangeMyPwd",Logout:"/api/Check/ExitLogin",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken",GetSystemRights:"/api/System/GetSystem"},rn="access_token",Is=B.Config.ServiceURL.LoginAuthURL;function on(){const t=qn();t&<(Et.RefreshToken,Is,{refreshToken:t}).then(e=>{sn(e.data)})}function xi(){const t=ut.getJsonObject(rn);if(!t)return;const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=5e3?on():setTimeout(on,n-5e3))}function sn(t){const e=new Date().getTime();let n=new Date(t.accessToken.expires).getTime()-e;if(n>=36e5?(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u8FC7\u53BB\u65F6\u95F4\uFF01")):n<-6e5&&(n=18e5,B.Message?.err("\u5BA2\u6237\u7AEF\u65F6\u95F4\u4E0E\u670D\u52A1\u5668\u4E0D\u4E00\u81F4\uFF1A\u672A\u6765\u65F6\u95F4\uFF01")),n>0){let i=St();i?(i.token=t.accessToken.tokenContent,i.expire=t.accessToken.expires,i.refresh=t.refreshToken.tokenContent):i={token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent},ut.set(rn,i,n/1e3),xi()}else ut.remove(rn)}const pe="Wm314243",me=B.Config.ServiceURL.LoginAuthURL;async function Rs(t){const e={username:t.username,pwd:te.encryptToString(t.pwd,pe)},n=(await lt(Et.Login,me,e))?.data;return n&&sn(n.doubletoken),n}function Ps(t){const e={oldpwd:te.encryptToString(t.oldpwd,pe),newpwd:te.encryptToString(t.newpwd,pe)};return lt(Et.ChangeMyPwd,me,e)}function As(t){return te.encryptToString(t,pe)}function Ls(){const t=St();t&&(He(Et.Logout,me,{token:t.token,reftoken:t.refresh}),Ne())}function Ds(t){return lt(Et.CheckToken,me,{token:t})}const an="ROLE_SYSTEM_RIGHT",cn=new Wt("",sessionStorage);function Ci(){return cn.get(an)}function un(t){cn.set(an,t)}function Ei(){cn.remove(an)}function Rt(t){if(t)for(let e=0;e<t.length;e++){const n=t[e];n.children&&n.children.length>0?(Rt(n.children),n.children.length===0&&(t.splice(e,1),e--)):n.selected||(t.splice(e,1),e--)}}function ki(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&ki(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function zi(t,e,n="name"){t&&e&&t.forEach(i=>{const r=e.find(o=>o[n]===i[n]);r&&(i.children?r.children&&zi(i.children,r.children,n):(!r.children||r.children.length===0)&&r.selected&&(i.selected=r.selected))})}function Tt(t,e,n,i="name"){const r=t[n],o=e[n];r?o&&zi(r,o,i):o&&(t[n]=o)}function Mi(t){if(t&&t.length>0){const e=t.length;let n,i=!1;if(e>0){i=xt(t[0]);const r=i?t[0]:JSON.parse(t[0]);if(e>1)for(let o=1;o<t.length;o++){const u=t[o],p=i?u:JSON.parse(u);Tt(r,p,"routes","name"),Tt(r,p,"widgetMenu","name"),Tt(r,p,"widgets","id"),Tt(r,p,"functions","id")}n=r}return n&&(Rt(n.routes),Rt(n.widgetMenu),Rt(n.widgets),Rt(n.functions)),n}}const ln=[],hn=[],dn=[];function Bt(){return Ci()}async function Ts(t,e=!1){Ei();const n=Et.GetSystemRights,i=B.Config.ServiceURL.LoginAuthURL,r=await lt(n,i,{systemid:t});if(!r||!r.data)return void B.Message?.warn("\u65E0\u6CD5\u83B7\u53D6\u529F\u80FD\u6388\u6743\u5217\u8868\uFF01");const o=r.data;if(o&&o.length>0){if(e){const u=JSON.parse(o[0]);return un(u),u}{const u=Mi(o);return un(u),u}}}function _i(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(i=>{const r=t.children?.find(o=>o.path===i.path);if(r){const o=_i(r,i);o&&n.children?.push(o)}})),n}function Bs(t,e=2){if(e===0)return t;const n=Bt();return n&&n.routes?(dn.length>0||t.forEach(i=>{const r=n.routes?.find(o=>o.name===i.name);if(r){const o=_i(i,r);o&&dn.push(o)}}),dn):void 0}function Ii(t,e){const n={...t};return e.index!=null&&(n.index=e.index),t.children&&(n.children=[],e.children&&e.children.forEach(i=>{const r=t.children?.find(o=>o.name===i.name);if(r){const o=Ii(r,i);o&&n.children?.push(o)}})),n}function Ns(t,e=2){if(e===0)return t;const n=Bt();return n&&n.widgetMenu?(hn.length>0||t.forEach(i=>{const r=n.widgetMenu?.find(o=>o.name===i.name);if(r){const o=Ii(i,r);o&&hn.push(o)}}),hn):void 0}function Os(t,e=2){if(e===0)return t;const n=Bt();return n&&n.widgets?(ln.length>0||t?.forEach(i=>{n.widgets?.find(r=>r.id===i.id)&&ln.push(i)}),ln):void 0}function Us(t,e=2){if(e===0)return t;const n=Bt();return n?n.functions:void 0}export{Ko as BigFileDownload,Xt as Download,eo as DownloadByUrl,bt as EnumColor,Jn as FileUpload,B as Global,zs as GlobalHprose,It as GlobalMitt,ot as H5Tool,Nt as HproseClient,to as HttpDownload,$n as JsonDownload,he as LayoutContainer,V as LayoutContainerEnum,Si as LayoutManager,Vo as ObjToUrlParams,Ie as Pane,Lt as ProxyClient,Qr as SaveAs,Ur as Splitpanes,Wt as Storage,Ht as StringUtils,ps as StyleBlack,vs as StyleGrayblue,gs as StyleMetal,ms as StyleWhite,nt as SysEvents,Ms as TOKEN_REFRESH_TIME,_s as TOKEN_VALID_TIMESPAN,Et as USER_TOKEN_API,ie as VCollapsiblePanel,ne as VCollapsiblePanelGroup,le as VWindow,wi as WindowResizeEvent,ys as WindowType,Zr as calculateBestTextColor,Ps as changeMyPWD,xi as checkDoRefreshToken,Ds as checkToken,Ne as clearLocalToken,Ei as clearRight,Vr as colorIsDark,Oo as createFileUpload,Yr as darken,ii as deepMerge,on as doRefreshToken,ri as exportSystemRights,ko as get,Bt as getCurrentSystemRight,Mo as getData,As as getEncryptPWD,Us as getFunctions,Hr as getHexColor,St as getLocalToken,Ho as getLockState,qr as getLongHexColor,Zn as getProxyClient,Wr as getRGBColor,Xr as getRGBColorFromHSLA,qn as getRefreshToken,Ci as getRight,Bs as getRoutes,Ts as getSystemRoleRight,Os as getWidgetConfig,Ns as getWidgetMenus,Rt as handleNodes,Le as hexToRGB,Fo as init,$o as initDefaultProxyClient,J as is,Fe as isArray,co as isAsyncFunction,lo as isBoolean,ho as isClient,so as isDate,Gn as isDef,po as isElement,vo as isEmpty,Gr as isEnumColor,yo as isError,Kt as isFunction,Gt as isHexColor,go as isImageDom,xo as isMap,Ue as isNull,ro as isNullAndUnDef,oo as isNullOrUnDef,ao as isNumber,xt as isObject,uo as isPromise,mo as isServer,je as isString,So as isSymbol,Oe as isUnDef,Co as isValidURL,bo as isWeakMap,wo as isWeakSet,fo as isWindow,Uo as jquery,Jr as lighten,Rs as login,Ls as logout,Mi as mergeFilterRoleSysRight,ki as mergeNodes,Tt as mergeNodesAll,$r as newGuid,Wo as onLockListener,zo as post,lt as requestGet,He as requestPost,Eo as requestPostBody,Kr as rgbToHex,sn as setLocalToken,un as setRight,no as sleep,Fr as storage,ut as storageHelper,qo as unLockListener,qt as uuid,Jo as writeIconifyList,Zo as writeSysRoleRight};
|