xframelib 0.4.1 → 0.4.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/api/Token.d.ts +20 -0
- package/dist/api/User.d.ts +45 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/controls/collapsepanel/VCollapsiblePanel.vue.d.ts +26 -0
- package/dist/controls/collapsepanel/VCollapsiblePanelGroup.vue.d.ts +30 -0
- package/dist/controls/collapsepanel/color.util.d.ts +1 -0
- package/dist/controls/collapsepanel/composables/store.d.ts +7 -0
- package/dist/controls/collapsepanel/constant.d.ts +1 -0
- package/dist/controls/collapsepanel/index.d.ts +3 -0
- package/dist/controls/layoutcontainer/LayoutManager.d.ts +107 -0
- package/dist/controls/layoutcontainer/index.d.ts +3 -0
- package/dist/controls/layoutcontainer/layout.vue.d.ts +37 -0
- package/dist/controls/splitpanes/index.d.ts +3 -0
- package/dist/controls/vuewindow/SinglePointerEvent.d.ts +23 -0
- package/dist/controls/vuewindow/dom.d.ts +16 -0
- package/dist/controls/vuewindow/draggable_helper.d.ts +20 -0
- package/dist/controls/vuewindow/index.d.ts +6 -0
- package/dist/controls/vuewindow/resizable_helper.d.ts +16 -0
- package/dist/controls/vuewindow/style.d.ts +77 -0
- package/dist/controls/vuewindow/window/Button.vue.d.ts +26 -0
- package/dist/controls/vuewindow/window/index.vue.d.ts +160 -0
- package/dist/controls/vuewindow/window/utils.d.ts +17 -0
- package/dist/controls/vuewindow/z_element.d.ts +11 -0
- package/dist/core/Global.d.ts +26 -0
- package/dist/core/IModel.d.ts +34 -0
- package/dist/core/MsgHelper.d.ts +12 -0
- package/dist/core/SysEvents.d.ts +16 -0
- package/dist/core/index.d.ts +3 -0
- package/dist/hprose/HproseClient.d.ts +20 -0
- package/dist/hprose/ProxyClient.d.ts +22 -0
- package/dist/hprose/index.d.ts +11 -0
- package/dist/index.cjs +4 -4
- package/dist/index.css +146 -76
- package/dist/index.d.ts +10 -1116
- package/dist/index.js +4 -4
- package/dist/mitt/index.d.ts +25 -0
- package/dist/model/Config.d.ts +94 -0
- package/dist/model/Constants.d.ts +15 -0
- package/dist/model/Layout.d.ts +36 -0
- package/dist/model/Token.d.ts +66 -0
- package/dist/model/index.d.ts +4 -0
- package/dist/utils/AxiosHelper.d.ts +51 -0
- package/dist/utils/BigFileDownload.d.ts +106 -0
- package/dist/utils/Color.d.ts +74 -0
- package/dist/utils/FileDownload.d.ts +36 -0
- package/dist/utils/FileUpload.d.ts +90 -0
- package/dist/utils/H5Tool.d.ts +98 -0
- package/dist/utils/IsTool.d.ts +101 -0
- package/dist/utils/JQuery.d.ts +35 -0
- package/dist/utils/LockHelper.d.ts +17 -0
- package/dist/utils/Storage.d.ts +57 -0
- package/dist/utils/StringUtils.d.ts +15 -0
- package/dist/utils/Time.d.ts +1 -0
- package/dist/utils/TokenHelper.d.ts +18 -0
- package/dist/utils/URLTool.d.ts +18 -0
- package/dist/utils/index.d.ts +16 -0
- package/dist/utils/uuid.d.ts +3 -0
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{h as Ti,openBlock as et,createElementBlock as ht,normalizeStyle as gt,renderSlot as at,reactive as Ni,computed as dt,defineComponent as At,ref as J,onMounted as on,onUpdated as Bi,nextTick as sn,normalizeClass as Oi,createElementVNode as ct,createCommentVNode as se,createVNode as ji,Transition as an,withCtx as ae,withModifiers as cn,getCurrentInstance as Ui,watch as Lt,onBeforeUnmount as Fi,resolveComponent as $i,createBlock as un,withDirectives as Hi,Fragment as Wi,createTextVNode as ln,toDisplayString as qi,vShow as Xi}from"vue";import{Client as Gi,ClientContext as hn}from"@hprose/rpc-core";import{ByteStream as dn}from"@hprose/io";import{HttpTransport as Vi}from"@hprose/rpc-html5";var Ki={name:"splitpanes",props:{horizontal:{type:Boolean},pushOtherPanes:{type:Boolean,default:!0},dblClickSplitter:{type:Boolean,default:!0},rtl:{type:Boolean,default:!1},firstSplitter:{type:Boolean}},provide(){return{requestUpdate:this.requestUpdate,onPaneAdd:this.onPaneAdd,onPaneRemove:this.onPaneRemove,onPaneClick:this.onPaneClick}},data:()=>({container:null,ready:!1,panes:[],touch:{mouseDown:!1,dragging:!1,activeSplitter:null},splitterTaps:{splitter:null,timeoutId:null}}),computed:{panesCount(){return this.panes.length},indexedPanes(){return this.panes.reduce((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,a)=>(i.size=a===e?i.max:i.min,a!==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),a=100-(this.pushOtherPanes?0:n.nextPanesSize),l=Math.max(Math.min(this.getCurrentDragPercentage(t),a),i);let g=[e,e+1],b=this.panes[g[0]]||null,S=this.panes[g[1]]||null;const C=b.max<100&&l>=b.max+n.prevPanesSize,z=S.max<100&&l<=100-(S.max+this.sumNextPanesSize(e+1));if(C||z)C?(b.size=b.max,S.size=Math.max(100-b.max-n.prevPanesSize-n.nextPanesSize,0)):(b.size=Math.max(100-S.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),S.size=S.max);else{if(this.pushOtherPanes){const P=this.doPushOtherPanes(n,l);if(!P)return;({sums:n,panesToResize:g}=P),b=this.panes[g[0]]||null,S=this.panes[g[1]]||null}b!==null&&(b.size=Math.min(Math.max(l-n.prevPanesSize-n.prevReachedMinPanes,b.min),b.max)),S!==null&&(S.size=Math.min(Math.max(100-l-n.nextPanesSize-n.nextReachedMinPanes,S.min),S.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((a,l)=>{l>i[0]&&l<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.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((a,l)=>{l>0&&l<=n&&(a.size=a.min,t.prevReachedMinPanes+=a.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((a,l)=>{l>n&&l<i[1]&&(a.size=a.min,t.nextReachedMinPanes+=a.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((a,l)=>{l<this.panesCount-1&&l>=n+1&&(a.size=a.min,t.nextReachedMinPanes+=a.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,a=document.createElement("div");a.classList.add("splitpanes__splitter"),n||(a.onmousedown=l=>this.onMouseDown(l,i),typeof window!="undefined"&&"ontouchstart"in window&&(a.ontouchstart=l=>this.onMouseDown(l,i)),a.onclick=l=>this.onSplitterClick(l,i+1)),this.dblClickSplitter&&(a.ondblclick=l=>this.onSplitterDblClick(l,i+1)),e.parentNode.insertBefore(a,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,a])=>n[i]=a)},onPaneAdd(t){let e=-1;Array.from(t.$el.parentNode.children).some(a=>(a.className.includes("splitpanes__pane")&&e++,a===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((a,l)=>a.index=l),this.ready&&this.$nextTick(()=>{this.redoSplitters(),this.resetPaneSizes({addedPane:this.panes[e]}),this.$emit("pane-add",{index:e,panes:this.panes.map(a=>({min:a.min,max:a.max,size:a.size}))})})},onPaneRemove(t){const e=this.panes.findIndex(i=>i.id===t._.uid),n=this.panes.splice(e,1)[0];this.panes.forEach((i,a)=>i.index=a),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(a=>{a.size=Math.max(Math.min(t,a.max),a.min),e-=a.size,a.size>=a.max&&n.push(a.id),a.size<=a.min&&i.push(a.id)}),e>.1&&this.readjustSizes(e,n,i)},initialPanesSizing(){let t=100;const e=[],n=[];let i=0;this.panes.forEach(l=>{t-=l.size,l.size!==null&&i++,l.size>=l.max&&e.push(l.id),l.size<=l.min&&n.push(l.id)});let a=100;t>.1&&(this.panes.forEach(l=>{l.size===null&&(l.size=Math.max(Math.min(t/(this.panesCount-i),l.max),l.min)),a-=l.size}),a>.1&&this.readjustSizes(t,e,n))},equalizeAfterAddOrRemove({addedPane:t}={}){let e=100/this.panesCount,n=0;const i=[],a=[];t&&t.givenSize!==null&&(e=(100-t.givenSize)/(this.panesCount-1)),this.panes.forEach(l=>{n-=l.size,l.size>=l.max&&i.push(l.id),l.size<=l.min&&a.push(l.id)}),Math.abs(n)<.1||(this.panes.forEach(l=>{t&&t.givenSize!==null&&t.id===l.id||(l.size=Math.max(Math.min(e,l.max),l.min)),n-=l.size,l.size>=l.max&&i.push(l.id),l.size<=l.min&&a.push(l.id)}),n>.1&&this.readjustSizes(n,i,a))},readjustSizes(t,e,n){let i;i=t>0?t/(this.panesCount-e.length):t/(this.panesCount-n.length),this.panes.forEach(a=>{if(t>0&&!e.includes(a.id)){const l=Math.max(Math.min(a.size+i,a.max),a.min);t-=l-a.size,a.size=l}else if(!n.includes(a.id)){const l=Math.max(Math.min(a.size+i,a.max),a.min);t-=l-a.size,a.size=l}a.update({[this.horizontal?"height":"width"]:`${this.indexedPanes[a.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 Ti("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},ce={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})}}};ce.render=function(t,e,n,i,a,l){return et(),ht("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=g=>l.onPaneClick(g,t._.uid)),style:gt(t.style)},[at(t.$slots,"default")],4)},ce.__file="src/controls/splitpanes/pane.vue";var yt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ue(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 Yi={exports:{}},fn=Yi.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(y,c){var h=y[0],d=y[1],u=y[2],p=y[3];d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[0]-680876936|0)<<7|h>>>25)+d|0)&d|~h&u)+c[1]-389564586|0)<<12|p>>>20)+h|0)&h|~p&d)+c[2]+606105819|0)<<17|u>>>15)+p|0)&p|~u&h)+c[3]-1044525330|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[4]-176418897|0)<<7|h>>>25)+d|0)&d|~h&u)+c[5]+1200080426|0)<<12|p>>>20)+h|0)&h|~p&d)+c[6]-1473231341|0)<<17|u>>>15)+p|0)&p|~u&h)+c[7]-45705983|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[8]+1770035416|0)<<7|h>>>25)+d|0)&d|~h&u)+c[9]-1958414417|0)<<12|p>>>20)+h|0)&h|~p&d)+c[10]-42063|0)<<17|u>>>15)+p|0)&p|~u&h)+c[11]-1990404162|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[12]+1804603682|0)<<7|h>>>25)+d|0)&d|~h&u)+c[13]-40341101|0)<<12|p>>>20)+h|0)&h|~p&d)+c[14]-1502002290|0)<<17|u>>>15)+p|0)&p|~u&h)+c[15]+1236535329|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[1]-165796510|0)<<5|h>>>27)+d|0)&u|d&~u)+c[6]-1069501632|0)<<9|p>>>23)+h|0)&d|h&~d)+c[11]+643717713|0)<<14|u>>>18)+p|0)&h|p&~h)+c[0]-373897302|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[5]-701558691|0)<<5|h>>>27)+d|0)&u|d&~u)+c[10]+38016083|0)<<9|p>>>23)+h|0)&d|h&~d)+c[15]-660478335|0)<<14|u>>>18)+p|0)&h|p&~h)+c[4]-405537848|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[9]+568446438|0)<<5|h>>>27)+d|0)&u|d&~u)+c[14]-1019803690|0)<<9|p>>>23)+h|0)&d|h&~d)+c[3]-187363961|0)<<14|u>>>18)+p|0)&h|p&~h)+c[8]+1163531501|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[13]-1444681467|0)<<5|h>>>27)+d|0)&u|d&~u)+c[2]-51403784|0)<<9|p>>>23)+h|0)&d|h&~d)+c[7]+1735328473|0)<<14|u>>>18)+p|0)&h|p&~h)+c[12]-1926607734|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[5]-378558|0)<<4|h>>>28)+d|0)^d^u)+c[8]-2022574463|0)<<11|p>>>21)+h|0)^h^d)+c[11]+1839030562|0)<<16|u>>>16)+p|0)^p^h)+c[14]-35309556|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[1]-1530992060|0)<<4|h>>>28)+d|0)^d^u)+c[4]+1272893353|0)<<11|p>>>21)+h|0)^h^d)+c[7]-155497632|0)<<16|u>>>16)+p|0)^p^h)+c[10]-1094730640|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[13]+681279174|0)<<4|h>>>28)+d|0)^d^u)+c[0]-358537222|0)<<11|p>>>21)+h|0)^h^d)+c[3]-722521979|0)<<16|u>>>16)+p|0)^p^h)+c[6]+76029189|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[9]-640364487|0)<<4|h>>>28)+d|0)^d^u)+c[12]-421815835|0)<<11|p>>>21)+h|0)^h^d)+c[15]+530742520|0)<<16|u>>>16)+p|0)^p^h)+c[2]-995338651|0)<<23|d>>>9)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[0]-198630844|0)<<6|h>>>26)+d|0)|~u))+c[7]+1126891415|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[14]-1416354905|0)<<15|u>>>17)+p|0)|~h))+c[5]-57434055|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[12]+1700485571|0)<<6|h>>>26)+d|0)|~u))+c[3]-1894986606|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[10]-1051523|0)<<15|u>>>17)+p|0)|~h))+c[1]-2054922799|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[8]+1873313359|0)<<6|h>>>26)+d|0)|~u))+c[15]-30611744|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[6]-1560198380|0)<<15|u>>>17)+p|0)|~h))+c[13]+1309151649|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[4]-145523070|0)<<6|h>>>26)+d|0)|~u))+c[11]-1120210379|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[2]+718787259|0)<<15|u>>>17)+p|0)|~h))+c[9]-343485551|0)<<21|d>>>11)+u|0,y[0]=h+y[0]|0,y[1]=d+y[1]|0,y[2]=u+y[2]|0,y[3]=p+y[3]|0}function i(y){var c,h=[];for(c=0;c<64;c+=4)h[c>>2]=y.charCodeAt(c)+(y.charCodeAt(c+1)<<8)+(y.charCodeAt(c+2)<<16)+(y.charCodeAt(c+3)<<24);return h}function a(y){var c,h=[];for(c=0;c<64;c+=4)h[c>>2]=y[c]+(y[c+1]<<8)+(y[c+2]<<16)+(y[c+3]<<24);return h}function l(y){var c,h,d,u,p,R,I=y.length,M=[1732584193,-271733879,-1732584194,271733878];for(c=64;c<=I;c+=64)n(M,i(y.substring(c-64,c)));for(h=(y=y.substring(c-64)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0;c<h;c+=1)d[c>>2]|=y.charCodeAt(c)<<(c%4<<3);if(d[c>>2]|=128<<(c%4<<3),c>55)for(n(M,d),c=0;c<16;c+=1)d[c]=0;return u=(u=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(u[2],16),R=parseInt(u[1],16)||0,d[14]=p,d[15]=R,n(M,d),M}function g(y){var c,h,d,u,p,R,I=y.length,M=[1732584193,-271733879,-1732584194,271733878];for(c=64;c<=I;c+=64)n(M,a(y.subarray(c-64,c)));for(h=(y=c-64<I?y.subarray(c-64):new Uint8Array(0)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0;c<h;c+=1)d[c>>2]|=y[c]<<(c%4<<3);if(d[c>>2]|=128<<(c%4<<3),c>55)for(n(M,d),c=0;c<16;c+=1)d[c]=0;return u=(u=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(u[2],16),R=parseInt(u[1],16)||0,d[14]=p,d[15]=R,n(M,d),M}function b(y){var c,h="";for(c=0;c<4;c+=1)h+=e[y>>8*c+4&15]+e[y>>8*c&15];return h}function S(y){var c;for(c=0;c<y.length;c+=1)y[c]=b(y[c]);return y.join("")}function C(y){return/[\u0080-\uFFFF]/.test(y)&&(y=unescape(encodeURIComponent(y))),y}function z(y,c){var h,d=y.length,u=new ArrayBuffer(d),p=new Uint8Array(u);for(h=0;h<d;h+=1)p[h]=y.charCodeAt(h);return c?p:u}function P(y){return String.fromCharCode.apply(null,new Uint8Array(y))}function D(y,c,h){var d=new Uint8Array(y.byteLength+c.byteLength);return d.set(new Uint8Array(y)),d.set(new Uint8Array(c),y.byteLength),h?d:d.buffer}function B(y){var c,h=[],d=y.length;for(c=0;c<d-1;c+=2)h.push(parseInt(y.substr(c,2),16));return String.fromCharCode.apply(String,h)}function A(){this.reset()}return S(l("hello")),typeof ArrayBuffer=="undefined"||ArrayBuffer.prototype.slice||function(){function y(c,h){return(c=0|c||0)<0?Math.max(c+h,0):Math.min(c,h)}ArrayBuffer.prototype.slice=function(c,h){var d,u,p,R,I=this.byteLength,M=y(c,I),O=I;return h!==t&&(O=y(h,I)),M>O?new ArrayBuffer(0):(d=O-M,u=new ArrayBuffer(d),p=new Uint8Array(u),R=new Uint8Array(this,M,d),p.set(R),u)}}(),A.prototype.append=function(y){return this.appendBinary(C(y)),this},A.prototype.appendBinary=function(y){this._buff+=y,this._length+=y.length;var c,h=this._buff.length;for(c=64;c<=h;c+=64)n(this._hash,i(this._buff.substring(c-64,c)));return this._buff=this._buff.substring(c-64),this},A.prototype.end=function(y){var c,h,d=this._buff,u=d.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(c=0;c<u;c+=1)p[c>>2]|=d.charCodeAt(c)<<(c%4<<3);return this._finish(p,u),h=S(this._hash),y&&(h=B(h)),this.reset(),h},A.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},A.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},A.prototype.setState=function(y){return this._buff=y.buff,this._length=y.length,this._hash=y.hash,this},A.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},A.prototype._finish=function(y,c){var h,d,u,p=c;if(y[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,y),p=0;p<16;p+=1)y[p]=0;h=(h=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(h[2],16),u=parseInt(h[1],16)||0,y[14]=d,y[15]=u,n(this._hash,y)},A.hash=function(y,c){return A.hashBinary(C(y),c)},A.hashBinary=function(y,c){var h=S(l(y));return c?B(h):h},A.ArrayBuffer=function(){this.reset()},A.ArrayBuffer.prototype.append=function(y){var c,h=D(this._buff.buffer,y,!0),d=h.length;for(this._length+=y.byteLength,c=64;c<=d;c+=64)n(this._hash,a(h.subarray(c-64,c)));return this._buff=c-64<d?new Uint8Array(h.buffer.slice(c-64)):new Uint8Array(0),this},A.ArrayBuffer.prototype.end=function(y){var c,h,d=this._buff,u=d.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(c=0;c<u;c+=1)p[c>>2]|=d[c]<<(c%4<<3);return this._finish(p,u),h=S(this._hash),y&&(h=B(h)),this.reset(),h},A.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},A.ArrayBuffer.prototype.getState=function(){var y=A.prototype.getState.call(this);return y.buff=P(y.buff),y},A.ArrayBuffer.prototype.setState=function(y){return y.buff=z(y.buff,!0),A.prototype.setState.call(this,y)},A.ArrayBuffer.prototype.destroy=A.prototype.destroy,A.ArrayBuffer.prototype._finish=A.prototype._finish,A.ArrayBuffer.hash=function(y,c){var h=S(g(new Uint8Array(y)));return c?B(h):h},A}();const le=[],ft=class{static addHandler(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}static windowResizeHandler(t){ft.addHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,e){if(e){const n=window.document;let i=window.document.exitFullscreen||n.msExitFullscreen||n.mozCancelFullScreen||n.webkitCancelFullScreen;if(i!==void 0&&i)i.call(window.document);else if(window.ActiveXObject!==void 0){let a=new window.ActiveXObject("WScript.Shell");a!=null&&a.SendKeys("{F11}")}}else{let n=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(n!==void 0&&n)n.call(t);else if(window.ActiveXObject!==void 0){let i=new window.ActiveXObject("WScript.Shell");i!=null&&i.SendKeys("{F11}")}}}static requestFullScreen(t){var e=t.requestFullScreen||t.webkitRequestFullScreen||t.mozRequestFullScreen||t.msRequestFullScreen;if(e)e.call(t);else if(window.ActiveXObject!==void 0){var n=new window.ActiveXObject("WScript.Shell");n!==null&&n.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var e=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(e)e.call(document);else if(window.ActiveXObject!==void 0){var n=new window.ActiveXObject("WScript.Shell");n!==null&&n.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!ft.fullScreenElement()}static onFullScreenChanged(t){let e;"onfullscreenchange"in window.document?e="fullscreenchange":"onwebkitfullscreenchange"in window.document?e="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(e="mozfullscreenchange"),e?document.addEventListener(e,function(){const n=ft.isFullScreen();t(n)}):document.addEventListener("MSFullscreenChange",function(){const n=ft.isFullScreen();t(n)})}static stringifyCircularHandler(t,e){if(typeof e=="object"&&e!==null){if(le.indexOf(e)!==-1)return;le.push(e)}return e}static jsonStringify(t){if(!t)return"";const e=JSON.stringify(t,ft.stringifyCircularHandler);return le.length=0,e}static jsonParse(t){const e=ft.jsonStringify(t);if(e.length>1)return JSON.parse(e)}static getObjectURL(t){let e;const n=window;return n.createObjcectURL!=null?e=n.createOjcectURL(t):window.URL!=null?e=window.URL.createObjectURL(t):window.webkitURL!=null&&(e=window.webkitURL.createObjectURL(t)),e}static getFileShortMD5(t,e){const n=File.prototype,i=n.slice||n.mozSlice||n.webkitSlice,a=t,l=new fn.ArrayBuffer,g=new FileReader;g.onload=function(b){l.append(b.target?.result);const S=l.end();e({isOK:!0,data:S})},g.onerror=function(){const b="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(b),e({isOK:!1,data:b})},function(){const b=2097152>=a.size?a.size:2097152;g.readAsArrayBuffer(i.call(a,0,b))}()}static MD5(t,e=!1){return fn.hash(t,e)}};let pn=ft;pn.copyText=t=>new Promise((e,n)=>{const i=document.createElement("input");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove(),e(!0)});class wt{static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,i)=>i.toUpperCase()).replace("views","")}}wt.isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0,wt.isNotEmpty=t=>t!==null&&t!==""&&t!==void 0&&t.length!==0;class he{constructor(e="",n=localStorage){this.prefixKey=e,this.storage=n}getKey(e){return`${this.prefixKey}${e}`.toUpperCase()}set(e,n,i=604800){const a=JSON.stringify({value:n,expire:i!==null?new Date().getTime()+1e3*i:null});this.storage.setItem(this.getKey(e),a)}get(e,n=null){const i=this.storage.getItem(this.getKey(e));if(i)try{const a=JSON.parse(i),{value:l,expire:g}=a;if(g===null||g>=Date.now())return l;this.remove(this.getKey(e))}catch{return n}return n}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,a=n.length;i<a;i++){const l=n[i].split("=");if(l[0]===this.getKey(e))return l[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 Ji=new he("",localStorage);function Dt(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++)t[n]=e.substr(Math.floor(16*Math.random()),1);return t[14]="4",t[19]=e.substr(3&Number(t[19])|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function Zi(){var t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?n:3&n|8).toString(16)})}function Qi(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)),a=Math.floor(n*parseInt(e[1])+255*(1-n)),l=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+a.toString(16)).slice(-2)+("0"+l.toString(16)).slice(-2)}function tr(t){var e=t.toLowerCase();if(Tt(t)){if(e.length===4){for(var n="#",i=1;i<4;i+=1){const l=e.slice(i,i+1);n+=l.concat(l)}e=n}var a=[];for(i=1;i<7;i+=2)a.push(parseInt("0x"+e.slice(i,i+2)));return"rgb("+a.join(",")+")"}return e}function er(t){const e=t;if(e.length===4){let i="#";for(var n=1;n<4;n+=1){const a=e.slice(n,n+1);i+=a.concat(a)}return i}return e}var pt,bt;function nr(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substr(0,1);return e==="#"?pt.Hex:e==="r"||e==="("?pt.RGBA:e==="h"?pt.Hsla:pt.RGBA}function ir(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,a,l=(parseFloat(e[1])%360+360)%360/360,g=parseFloat(e[2])/(/%$/.test(e[2])?100:1),b=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(g===0)n=i=a=b;else{var S=b<=.5?b*(g+1):b+g-b*g,C=2*b-S;n=de(C,S,l+1/3),i=de(C,S,l),a=de(C,S,l-1/3)}return`rgba(${n=Math.round(255*n)},${i=Math.round(255*i)},${a=Math.round(255*a)},${e[4]?parseFloat(e[4]):1})`}}}function de(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 Tt(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function rr(t,e,n){const i=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function fe(t){let e=t.toLowerCase();if(Tt(t)){if(e.length===4){let i="#";for(let a=1;a<4;a+=1)i+=e.slice(a,a+1).concat(e.slice(a,a+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 or(t){if(!Tt(t))return;const[e,n,i]=fe(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(a=>Number(a));return .299*e+.578*n+.114*i<192}function sr(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${me(t.substring(0,2),e)}${me(t.substring(2,4),e)}${me(t.substring(4,6),e)}`}function ar(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${pe(t.substring(0,2),e)}${pe(t.substring(2,4),e)}${pe(t.substring(4,6),e)}`}function pe(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 mn(t,e,n){const i=[t,e,n].map(a=>(a/=255)<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4));return .2126*i[0]+.7152*i[1]+.0722*i[2]}function cr(t){const e=fe(t.substring(1));var n,i;return n=e.split(","),i=[0,0,0],(mn(~~n[0],~~n[1],~~n[2])+.05)/(mn(i[0],i[1],i[2])+.05)>=12?"#000000":"#FFFFFF"}function me(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 ve(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)})}}}(bt=pt||(pt={}))[bt.RGBA=0]="RGBA",bt[bt.Hex=1]="Hex",bt[bt.Hsla=2]="Hsla";const St=ve(),nt={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent"},ge=(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 ur(t,e){const n=window.URL||window.webkitURL||window,i=new Blob([t]),a=document.createElement("a");a.href=n.createObjectURL(i),a.download=e,a.click(),n.revokeObjectURL(a.href)}const lr=(t,e)=>{const n=JSON.stringify(t,null,2);e?ge(n,e+".json"):St.emit(nt.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},hr=(t,e,n)=>{t.get(e).then(function(i){ge(i.data,n)}).catch(i=>{console.warn(i),St.emit(nt.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function vn(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function dr({url:t,target:e="_blank",fileName:n}){const i=new URL(t).host==location.host;return new Promise((a,l)=>{if(i){const g=document.createElement("a");if(g.href=t,g.target=e,g.download!==void 0&&(g.download=n||vn(t)),document.createEvent){const b=document.createEvent("MouseEvents");return b.initEvent("click",!0,!0),g.dispatchEvent(b),a(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),a(!0)}{const g=document.createElement("canvas"),b=document.createElement("img");b.setAttribute("crossOrigin","Anonymous"),b.src=t,b.onload=S=>{g.width=b.width,g.height=b.height,g.getContext("2d").drawImage(b,0,0,b.width,b.height),g.toBlob(C=>{const z=document.createElement("a");z.href=window.URL.createObjectURL(C),z.download=vn(t),z.click(),URL.revokeObjectURL(z.href),a(!0)},"image/jpeg")},b.onerror=S=>l(S)}})}function fr(t){for(var e=new Date().getTime();new Date().getTime()-e<t;);console.log(`\u5F3A\u5236\u7B49\u5F85${t}\u6BEB\u79D2`)}class kt{constructor(e){if(e&&!wt.isNullOrEmpty(e)){if(kt.httpTransport||(kt.httpTransport=new Vi),this.client=new Gi(e),!this.client)throw Error("Hprose Client\u521D\u59CB\u5316\u9519\u8BEF");this.hproseURL=e,this.init()}}init(){this.client&&this.client.useServiceAsync().then(e=>{this.hproseProxy=e}).catch(e=>{String(e).indexOf("find this method ~")>0?(this.hproseProxy=this.client?.useService(),console.warn("\u65E7\u7248\u672C\u4E0D\u652F\u6301useServiceAsync")):St.emit(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){return this.client?this.client.codec.encode(e,n,i):void 0}decode(e,n){return this.client?this.client.codec.decode(e,n):void 0}}class zt{constructor(e){this.hproseClient=new kt(e),this.hpProxyObj=null,this.defaultContext=new hn}getClientContext(){return null}async getHproseProxy(){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");if(!this.hpProxyObj){const e=await this.hproseClient.getProxy();this.hpProxyObj=e}return this.hpProxyObj||St.emit(nt.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");let i;return i=new hn,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");return await this.hproseClient.invoke(e,i,n)}async hproseInvokeEncode(e){const n=new dn(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 dn.toString(i)}}class pr{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(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")}}const ye=new Map,N={Config:SysConfig,EventBus:St,DefaultProxyClient:null,Axios:void 0};function mr(t){gn(t.message,t.axios,t.defaultHproseURL),t.config&&(N.Config=t.config)}const gn=function(t,e,n){n?N.Config.DefaultHproseAPI=n:!N.Config.DefaultHproseAPI&&N.Config.ServiceURL&&(N.Config.DefaultHproseAPI=N.Config.ServiceURL.DefaultHproseAPI),e&&(N.Axios=e),N.Config.DefaultHproseAPI&&wt.isNotEmpty(N.Config.DefaultHproseAPI)&&(N.DefaultProxyClient=new zt(N.Config.DefaultHproseAPI));const i=new pr(t,N.EventBus);N.Message=i,N.EventBus.on(nt.HproseServiceErrorEvent,a=>{const l=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${a}`;i.warn(l)}),N.EventBus.on(nt.WebAPIErrorEvent,a=>{const l=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${a}`;i.warn(l)}),N.EventBus.on(nt.CommonWarnEvent,a=>{i.warn(a)})};function yn(t){if(t&&wt.isNotEmpty(t)){if(ye.has(t))return ye.get(t);{const e=new zt(t);return ye.set(t,e),e}}}function vr(t){const e=yn(t);return e&&(N.DefaultProxyClient=e),e}const ut=new he("user",localStorage);function Nt(){return ut.get("access_token")}function we(){ut.remove("access_token"),N.User&&delete N.User}function wn(){return Nt()?.refresh}function be(t,e,n,i="json",a){const l={baseURL:N.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,headers:{"Content-Type":"application/json",Authorization:"bearer "+Nt()?.token},responseType:i,cancelToken:a};if(n)for(let g in n)l.headers[g]=n[g];return e&&(l.baseURL=e),l}function it(t,e,n,i,a="json",l){const g=be(n,e,i,a,l);return N.Axios?.get(t,g).catch(function(b){console.log(b),N.Message?.err("\u670D\u52A1Get\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function Se(t,e,n,i,a,l="json"){const g=be(i,e,a,l),b=function(S){let C=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let P=S[z];var D;P!=null&&C.append(z,(D=P)instanceof Blob?D:D.toString())}),C}(n);return N.Axios?.post(t,b,g).catch(function(S){console.log(S),N.Message?.err("\u670D\u52A1Post\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function gr(t,e,n,i,a,l="json"){const g=be(i,e,a,l);return N.Axios?.post(t,n,g).catch(function(b){console.log(b),N.Message?.err("\u670D\u52A1Post\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function yr(t,e){return it(t,void 0,e)}function wr(t,e){return Se(t,void 0,e)}function br(t,e){return N.Axios?.get(t,{params:e}).catch(function(n){console.log(n),N.Message?.err("\u5916\u90E8Get\u670D\u52A1\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}var xe={exports:{}},Sr=typeof window!="undefined"?window:yt!==void 0?yt:typeof self!="undefined"?self:{},xr=function(t){if(!t)return!1;var e=Cr.call(t);return e==="[object Function]"||typeof t=="function"&&e!=="[object RegExp]"||typeof window!="undefined"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},Cr=Object.prototype.toString,Ce=function(t){return t.replace(/^\s+|\s+$/g,"")},Er=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)kr.call(n,i)&&(t[i]=n[i])}return t},kr=Object.prototype.hasOwnProperty,bn=Sr,zr=xr,_r=function(t){if(!t)return{};for(var e,n={},i=Ce(t).split(`
|
|
2
|
-
`),a=0;a<i.length;a++){var l=i[a],g=l.indexOf(":"),b=Ce(l.slice(0,g)).toLowerCase(),S=Ce(l.slice(g+1));n[b]===void 0?n[b]=S:(e=n[b],Object.prototype.toString.call(e)==="[object Array]"?n[b].push(S):n[b]=[n[b],S])}return n},Ir=Er;function Sn(t,e,n){var i=t;return zr(e)?(n=e,typeof t=="string"&&(i={uri:t})):i=Ir(e,{uri:t}),i.callback=n,i}function rt(t,e,n){return xn(e=Sn(t,e,n))}function xn(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(h,d,u){e||(e=!0,t.callback(h,d,u))};function i(){var h=void 0;if(h=S.response?S.response:S.responseText||function(d){try{if(d.responseType==="document")return d.responseXML;var u=d.responseXML&&d.responseXML.documentElement.nodeName==="parsererror";if(d.responseType===""&&!u)return d.responseXML}catch{}return null}(S),y)try{h=JSON.parse(h)}catch{}return h}function a(h){return clearTimeout(C),h instanceof Error||(h=new Error(""+(h||"Unknown XMLHttpRequest Error"))),h.statusCode=0,n(h,c)}function l(){if(!b){var h;clearTimeout(C),h=t.useXDR&&S.status===void 0?200:S.status===1223?204:S.status;var d=c,u=null;return h!==0?(d={body:i(),statusCode:h,method:P,headers:{},url:z,rawRequest:S},S.getAllResponseHeaders&&(d.headers=_r(S.getAllResponseHeaders()))):u=new Error("Internal XMLHttpRequest Error"),n(u,d,d.body)}}var g,b,S=t.xhr||null;S||(S=t.cors||t.useXDR?new rt.XDomainRequest:new rt.XMLHttpRequest);var C,z=S.url=t.uri||t.url,P=S.method=t.method||"GET",D=t.body||t.data,B=S.headers=t.headers||{},A=!!t.sync,y=!1,c={body:void 0,headers:{},statusCode:0,method:P,url:z,rawRequest:S};if("json"in t&&t.json!==!1&&(y=!0,B.accept||B.Accept||(B.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(B["content-type"]||B["Content-Type"]||(B["Content-Type"]="application/json"),D=JSON.stringify(t.json===!0?D:t.json))),S.onreadystatechange=function(){S.readyState===4&&setTimeout(l,0)},S.onload=l,S.onerror=a,S.onprogress=function(){},S.onabort=function(){b=!0},S.ontimeout=a,S.open(P,z,!A,t.username,t.password),A||(S.withCredentials=!!t.withCredentials),!A&&t.timeout>0&&(C=setTimeout(function(){if(!b){b=!0,S.abort("timeout");var h=new Error("XMLHttpRequest timeout");h.code="ETIMEDOUT",a(h)}},t.timeout)),S.setRequestHeader)for(g in B)B.hasOwnProperty(g)&&S.setRequestHeader(g,B[g]);else if(t.headers&&!function(h){for(var d in h)if(h.hasOwnProperty(d))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(S.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(S),S.send(D||null),S}xe.exports=rt,xe.exports.default=rt,rt.XMLHttpRequest=bn.XMLHttpRequest||function(){},rt.XDomainRequest="withCredentials"in new rt.XMLHttpRequest?rt.XMLHttpRequest:bn.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){rt[t==="delete"?"del":t]=function(e,n,i){return(n=Sn(e,n,i)).method=t.toUpperCase(),xn(n)}});var Pr=xe.exports;const Mr=[200,201,202,204,308],Rr=[408,502,503,504];class Ar{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=ve(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window!="undefined"&&(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=a=>{const l=100/this.totalChunks,g=l*this.file.size,b=l*this.chunkCount,S=a.loaded/(a.total??g)*l;this.dispatch("progress",Math.min(b+S,100))}};return new Promise((i,a)=>{this.currentXhr=Pr({...e,beforeSend:n},(l,g)=>(this.currentXhr=void 0,l?a(l):i(g)))})}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&&Mr.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&&Rr.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 Lr=t=>new Ar(t),Dr=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)}},Cn=ut.get("is_LockScreen",!1),_t={isLock:Cn,lockTime:Cn=="true"?kn():0};function En(t){_t.isLock=t,ut.set("is_LockScreen",t,10),t&&(we(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function Tr(){return ut.get("is_LockScreen",!1)}function kn(){let t=3600;return N.Config.UI?.LockTime&&N.Config.UI?.LockTime>=10&&(t=N.Config.UI.LockTime),t}let Ee;function ke(){clearInterval(Ee),window.location.href.indexOf("/login")>0||_t.isLock||(En(!1),_t.lockTime=kn(),Ee=setInterval(()=>{if(_t.lockTime--,_t.lockTime<=0)return En(!0),clearInterval(Ee)},1e3))}function Nr(){ke(),document.addEventListener("mousedown",ke)}function Br(){document.removeEventListener("mousedown",ke)}var Or={exports:{}},Bt=Or.exports=function t(e,n,i){function a(b,S){if(!n[b]){if(!e[b]){if(!S&&ue)return ue(b);if(l)return l(b,!0);var C=new Error("Cannot find module '"+b+"'");throw C.code="MODULE_NOT_FOUND",C}var z=n[b]={exports:{}};e[b][0].call(z.exports,function(P){var D=e[b][1][P];return a(D||P)},z,z.exports,t,e,n,i)}return n[b].exports}for(var l=ue,g=0;g<i.length;g++)a(i[g]);return a}({1:[function(t,e,n){(function(i){var a,l,g=i.MutationObserver||i.WebKitMutationObserver;if(g){var b=0,S=new g(D),C=i.document.createTextNode("");S.observe(C,{characterData:!0}),a=function(){C.data=b=++b%2}}else if(i.setImmediate||i.MessageChannel===void 0)a="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var A=i.document.createElement("script");A.onreadystatechange=function(){D(),A.onreadystatechange=null,A.parentNode.removeChild(A),A=null},i.document.documentElement.appendChild(A)}:function(){setTimeout(D,0)};else{var z=new i.MessageChannel;z.port1.onmessage=D,a=function(){z.port2.postMessage(0)}}var P=[];function D(){var A,y;l=!0;for(var c=P.length;c;){for(y=P,P=[],A=-1;++A<c;)y[A]();c=P.length}l=!1}function B(A){P.push(A)!==1||l||a()}e.exports=B}).call(this,yt!==void 0?yt:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(t,e,n){var i=t(1);function a(){}var l={},g=["REJECTED"],b=["FULFILLED"],S=["PENDING"];function C(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=S,this.queue=[],this.outcome=void 0,u!==a&&B(this,u)}function z(u,p,R){this.promise=u,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof R=="function"&&(this.onRejected=R,this.callRejected=this.otherCallRejected)}function P(u,p,R){i(function(){var I;try{I=p(R)}catch(M){return l.reject(u,M)}I===u?l.reject(u,new TypeError("Cannot resolve promise with itself")):l.resolve(u,I)})}function D(u){var p=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof p=="function")return function(){p.apply(u,arguments)}}function B(u,p){var R=!1;function I(U){R||(R=!0,l.reject(u,U))}function M(U){R||(R=!0,l.resolve(u,U))}function O(){p(M,I)}var j=A(O);j.status==="error"&&I(j.value)}function A(u,p){var R={};try{R.value=u(p),R.status="success"}catch(I){R.status="error",R.value=I}return R}function y(u){return u instanceof this?u:l.resolve(new this(a),u)}function c(u){var p=new this(a);return l.reject(p,u)}function h(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=u.length,I=!1;if(!R)return this.resolve([]);for(var M=new Array(R),O=0,j=-1,U=new this(a);++j<R;)H(u[j],j);return U;function H(W,q){function Y(K){M[q]=K,++O!==R||I||(I=!0,l.resolve(U,M))}p.resolve(W).then(Y,function(K){I||(I=!0,l.reject(U,K))})}}function d(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var R=u.length,I=!1;if(!R)return this.resolve([]);for(var M=-1,O=new this(a);++M<R;)j(u[M]);return O;function j(U){p.resolve(U).then(function(H){I||(I=!0,l.resolve(O,H))},function(H){I||(I=!0,l.reject(O,H))})}}e.exports=C,C.prototype.catch=function(u){return this.then(null,u)},C.prototype.then=function(u,p){if(typeof u!="function"&&this.state===b||typeof p!="function"&&this.state===g)return this;var R=new this.constructor(a);return this.state!==S?P(R,this.state===b?u:p,this.outcome):this.queue.push(new z(R,u,p)),R},z.prototype.callFulfilled=function(u){l.resolve(this.promise,u)},z.prototype.otherCallFulfilled=function(u){P(this.promise,this.onFulfilled,u)},z.prototype.callRejected=function(u){l.reject(this.promise,u)},z.prototype.otherCallRejected=function(u){P(this.promise,this.onRejected,u)},l.resolve=function(u,p){var R=A(D,p);if(R.status==="error")return l.reject(u,R.value);var I=R.value;if(I)B(u,I);else{u.state=b,u.outcome=p;for(var M=-1,O=u.queue.length;++M<O;)u.queue[M].callFulfilled(p)}return u},l.reject=function(u,p){u.state=g,u.outcome=p;for(var R=-1,I=u.queue.length;++R<I;)u.queue[R].callRejected(p);return u},C.resolve=y,C.reject=c,C.all=h,C.race=d},{1:1}],3:[function(t,e,n){(function(i){typeof i.Promise!="function"&&(i.Promise=t(2))}).call(this,yt!==void 0?yt:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(t,e,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r};function a(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}var g=l();function b(){try{if(!g||!g.open)return!1;var r=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),o=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!r||o)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}function S(r,o){r=r||[],o=o||{};try{return new Blob(r,o)}catch(f){if(f.name!=="TypeError")throw f;for(var s=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<r.length;m+=1)s.append(r[m]);return s.getBlob(o.type)}}typeof Promise=="undefined"&&t(3);var C=Promise;function z(r,o){o&&r.then(function(s){o(null,s)},function(s){o(s)})}function P(r,o,s){typeof o=="function"&&r.then(o),typeof s=="function"&&r.catch(s)}function D(r){return typeof r!="string"&&(console.warn(r+" used as a key, but it is not a string."),r=String(r)),r}function B(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var A="local-forage-detect-blob-support",y=void 0,c={},h=Object.prototype.toString,d="readonly",u="readwrite";function p(r){for(var o=r.length,s=new ArrayBuffer(o),m=new Uint8Array(s),f=0;f<o;f++)m[f]=r.charCodeAt(f);return s}function R(r){return new C(function(o){var s=r.transaction(A,u),m=S([""]);s.objectStore(A).put(m,"key"),s.onabort=function(f){f.preventDefault(),f.stopPropagation(),o(!1)},s.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);o(v||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function I(r){return typeof y=="boolean"?C.resolve(y):R(r).then(function(o){return y=o})}function M(r){var o=c[r.name],s={};s.promise=new C(function(m,f){s.resolve=m,s.reject=f}),o.deferredOperations.push(s),o.dbReady?o.dbReady=o.dbReady.then(function(){return s.promise}):o.dbReady=s.promise}function O(r){var o=c[r.name].deferredOperations.pop();if(o)return o.resolve(),o.promise}function j(r,o){var s=c[r.name].deferredOperations.pop();if(s)return s.reject(o),s.promise}function U(r,o){return new C(function(s,m){if(c[r.name]=c[r.name]||Be(),r.db){if(!o)return s(r.db);M(r),r.db.close()}var f=[r.name];o&&f.push(r.version);var v=g.open.apply(g,f);o&&(v.onupgradeneeded=function(w){var x=v.result;try{x.createObjectStore(r.storeName),w.oldVersion<=1&&x.createObjectStore(A)}catch(E){if(E.name!=="ConstraintError")throw E;console.warn('The database "'+r.name+'" has been upgraded from version '+w.oldVersion+" to version "+w.newVersion+', but the storage "'+r.storeName+'" already exists.')}}),v.onerror=function(w){w.preventDefault(),m(v.error)},v.onsuccess=function(){var w=v.result;w.onversionchange=function(x){x.target.close()},s(w),O(r)}})}function H(r){return U(r,!1)}function W(r){return U(r,!0)}function q(r,o){if(!r.db)return!0;var s=!r.db.objectStoreNames.contains(r.storeName),m=r.version<r.db.version,f=r.version>r.db.version;if(m&&(r.version!==o&&console.warn('The database "'+r.name+`" can't be downgraded from version `+r.db.version+" to version "+r.version+"."),r.version=r.db.version),f||s){if(s){var v=r.db.version+1;v>r.version&&(r.version=v)}return!0}return!1}function Y(r){return new C(function(o,s){var m=new FileReader;m.onerror=s,m.onloadend=function(f){var v=btoa(f.target.result||"");o({__local_forage_encoded_blob:!0,data:v,type:r.type})},m.readAsBinaryString(r)})}function K(r){return S([p(atob(r.data))],{type:r.type})}function Q(r){return r&&r.__local_forage_encoded_blob}function Jt(r){var o=this,s=o._initReady().then(function(){var m=c[o._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return P(s,r,r),s}function Zt(r){M(r);for(var o=c[r.name],s=o.forages,m=0;m<s.length;m++){var f=s[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return r.db=null,H(r).then(function(v){return r.db=v,q(r)?W(r):v}).then(function(v){r.db=o.db=v;for(var w=0;w<s.length;w++)s[w]._dbInfo.db=v}).catch(function(v){throw j(r,v),v})}function tt(r,o,s,m){m===void 0&&(m=1);try{var f=r.db.transaction(r.storeName,o);s(null,f)}catch(v){if(m>0&&(!r.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return C.resolve().then(function(){if(!r.db||v.name==="NotFoundError"&&!r.db.objectStoreNames.contains(r.storeName)&&r.version<=r.db.version)return r.db&&(r.version=r.db.version+1),W(r)}).then(function(){return Zt(r).then(function(){tt(r,o,s,m-1)})}).catch(s);s(v)}}function Be(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Un(r){var o=this,s={db:null};if(r)for(var m in r)s[m]=r[m];var f=c[s.name];f||(f=Be(),c[s.name]=f),f.forages.push(o),o._initReady||(o._initReady=o.ready,o.ready=Jt);var v=[];function w(){return C.resolve()}for(var x=0;x<f.forages.length;x++){var E=f.forages[x];E!==o&&v.push(E._initReady().catch(w))}var k=f.forages.slice(0);return C.all(v).then(function(){return s.db=f.db,H(s)}).then(function(_){return s.db=_,q(s,o._defaultConfig.version)?W(s):_}).then(function(_){s.db=f.db=_,o._dbInfo=s;for(var L=0;L<k.length;L++){var T=k[L];T!==o&&(T._dbInfo.db=s.db,T._dbInfo.version=s.version)}})}function Fn(r,o){var s=this;r=D(r);var m=new C(function(f,v){s.ready().then(function(){tt(s._dbInfo,d,function(w,x){if(w)return v(w);try{var E=x.objectStore(s._dbInfo.storeName).get(r);E.onsuccess=function(){var k=E.result;k===void 0&&(k=null),Q(k)&&(k=K(k)),f(k)},E.onerror=function(){v(E.error)}}catch(k){v(k)}})}).catch(v)});return z(m,o),m}function $n(r,o){var s=this,m=new C(function(f,v){s.ready().then(function(){tt(s._dbInfo,d,function(w,x){if(w)return v(w);try{var E=x.objectStore(s._dbInfo.storeName).openCursor(),k=1;E.onsuccess=function(){var _=E.result;if(_){var L=_.value;Q(L)&&(L=K(L));var T=r(L,_.key,k++);T!==void 0?f(T):_.continue()}else f()},E.onerror=function(){v(E.error)}}catch(_){v(_)}})}).catch(v)});return z(m,o),m}function Hn(r,o,s){var m=this;r=D(r);var f=new C(function(v,w){var x;m.ready().then(function(){return x=m._dbInfo,h.call(o)==="[object Blob]"?I(x.db).then(function(E){return E?o:Y(o)}):o}).then(function(E){tt(m._dbInfo,u,function(k,_){if(k)return w(k);try{var L=_.objectStore(m._dbInfo.storeName);E===null&&(E=void 0);var T=L.put(E,r);_.oncomplete=function(){E===void 0&&(E=null),v(E)},_.onabort=_.onerror=function(){var F=T.error?T.error:T.transaction.error;w(F)}}catch(F){w(F)}})}).catch(w)});return z(f,s),f}function Wn(r,o){var s=this;r=D(r);var m=new C(function(f,v){s.ready().then(function(){tt(s._dbInfo,u,function(w,x){if(w)return v(w);try{var E=x.objectStore(s._dbInfo.storeName).delete(r);x.oncomplete=function(){f()},x.onerror=function(){v(E.error)},x.onabort=function(){var k=E.error?E.error:E.transaction.error;v(k)}}catch(k){v(k)}})}).catch(v)});return z(m,o),m}function qn(r){var o=this,s=new C(function(m,f){o.ready().then(function(){tt(o._dbInfo,u,function(v,w){if(v)return f(v);try{var x=w.objectStore(o._dbInfo.storeName).clear();w.oncomplete=function(){m()},w.onabort=w.onerror=function(){var E=x.error?x.error:x.transaction.error;f(E)}}catch(E){f(E)}})}).catch(f)});return z(s,r),s}function Xn(r){var o=this,s=new C(function(m,f){o.ready().then(function(){tt(o._dbInfo,d,function(v,w){if(v)return f(v);try{var x=w.objectStore(o._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(E){f(E)}})}).catch(f)});return z(s,r),s}function Gn(r,o){var s=this,m=new C(function(f,v){r<0?f(null):s.ready().then(function(){tt(s._dbInfo,d,function(w,x){if(w)return v(w);try{var E=x.objectStore(s._dbInfo.storeName),k=!1,_=E.openKeyCursor();_.onsuccess=function(){var L=_.result;L?r===0||k?f(L.key):(k=!0,L.advance(r)):f(null)},_.onerror=function(){v(_.error)}}catch(L){v(L)}})}).catch(v)});return z(m,o),m}function Vn(r){var o=this,s=new C(function(m,f){o.ready().then(function(){tt(o._dbInfo,d,function(v,w){if(v)return f(v);try{var x=w.objectStore(o._dbInfo.storeName).openKeyCursor(),E=[];x.onsuccess=function(){var k=x.result;k?(E.push(k.key),k.continue()):m(E)},x.onerror=function(){f(x.error)}}catch(k){f(k)}})}).catch(f)});return z(s,r),s}function Kn(r,o){o=B.apply(this,arguments);var s=this.config();(r=typeof r!="function"&&r||{}).name||(r.name=r.name||s.name,r.storeName=r.storeName||s.storeName);var m,f=this;if(r.name){var v=r.name===s.name&&f._dbInfo.db?C.resolve(f._dbInfo.db):H(r).then(function(w){var x=c[r.name],E=x.forages;x.db=w;for(var k=0;k<E.length;k++)E[k]._dbInfo.db=w;return w});m=r.storeName?v.then(function(w){if(w.objectStoreNames.contains(r.storeName)){var x=w.version+1;M(r);var E=c[r.name],k=E.forages;w.close();for(var _=0;_<k.length;_++){var L=k[_];L._dbInfo.db=null,L._dbInfo.version=x}return new C(function(T,F){var $=g.open(r.name,x);$.onerror=function(Z){$.result.close(),F(Z)},$.onupgradeneeded=function(){$.result.deleteObjectStore(r.storeName)},$.onsuccess=function(){var Z=$.result;Z.close(),T(Z)}}).then(function(T){E.db=T;for(var F=0;F<k.length;F++){var $=k[F];$._dbInfo.db=T,O($._dbInfo)}}).catch(function(T){throw(j(r,T)||C.resolve()).catch(function(){}),T})}}):v.then(function(w){M(r);var x=c[r.name],E=x.forages;w.close();for(var k=0;k<E.length;k++)E[k]._dbInfo.db=null;return new C(function(_,L){var T=g.deleteDatabase(r.name);T.onerror=function(){var F=T.result;F&&F.close(),L(T.error)},T.onblocked=function(){console.warn('dropInstance blocked for database "'+r.name+'" until all open connections are closed')},T.onsuccess=function(){var F=T.result;F&&F.close(),_(F)}}).then(function(_){x.db=_;for(var L=0;L<E.length;L++)O(E[L]._dbInfo)}).catch(function(_){throw(j(r,_)||C.resolve()).catch(function(){}),_})})}else m=C.reject("Invalid arguments");return z(m,o),m}var Yn={_driver:"asyncStorage",_initStorage:Un,_support:b(),iterate:$n,getItem:Fn,setItem:Hn,removeItem:Wn,clear:qn,length:Xn,key:Gn,keys:Vn,dropInstance:Kn};function Jn(){return typeof openDatabase=="function"}var ot="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Zn="~~local_forage_type~",Oe=/^~~local_forage_type~([^~]+)~/,Mt="__lfsc__:",Qt=Mt.length,te="arbf",ee="blob",je="si08",Ue="ui08",Fe="uic8",$e="si16",He="si32",We="ur16",qe="ui32",Xe="fl32",Ge="fl64",Ve=Qt+te.length,Ke=Object.prototype.toString;function Ye(r){var o,s,m,f,v,w=.75*r.length,x=r.length,E=0;r[r.length-1]==="="&&(w--,r[r.length-2]==="="&&w--);var k=new ArrayBuffer(w),_=new Uint8Array(k);for(o=0;o<x;o+=4)s=ot.indexOf(r[o]),m=ot.indexOf(r[o+1]),f=ot.indexOf(r[o+2]),v=ot.indexOf(r[o+3]),_[E++]=s<<2|m>>4,_[E++]=(15&m)<<4|f>>2,_[E++]=(3&f)<<6|63&v;return k}function ne(r){var o,s=new Uint8Array(r),m="";for(o=0;o<s.length;o+=3)m+=ot[s[o]>>2],m+=ot[(3&s[o])<<4|s[o+1]>>4],m+=ot[(15&s[o+1])<<2|s[o+2]>>6],m+=ot[63&s[o+2]];return s.length%3==2?m=m.substring(0,m.length-1)+"=":s.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function Qn(r,o){var s="";if(r&&(s=Ke.call(r)),r&&(s==="[object ArrayBuffer]"||r.buffer&&Ke.call(r.buffer)==="[object ArrayBuffer]")){var m,f=Mt;r instanceof ArrayBuffer?(m=r,f+=te):(m=r.buffer,s==="[object Int8Array]"?f+=je:s==="[object Uint8Array]"?f+=Ue:s==="[object Uint8ClampedArray]"?f+=Fe:s==="[object Int16Array]"?f+=$e:s==="[object Uint16Array]"?f+=We:s==="[object Int32Array]"?f+=He:s==="[object Uint32Array]"?f+=qe:s==="[object Float32Array]"?f+=Xe:s==="[object Float64Array]"?f+=Ge:o(new Error("Failed to get type for BinaryArray"))),o(f+ne(m))}else if(s==="[object Blob]"){var v=new FileReader;v.onload=function(){var w=Zn+r.type+"~"+ne(this.result);o(Mt+ee+w)},v.readAsArrayBuffer(r)}else try{o(JSON.stringify(r))}catch(w){console.error("Couldn't convert value into a JSON string: ",r),o(null,w)}}function ti(r){if(r.substring(0,Qt)!==Mt)return JSON.parse(r);var o,s=r.substring(Ve),m=r.substring(Qt,Ve);if(m===ee&&Oe.test(s)){var f=s.match(Oe);o=f[1],s=s.substring(f[0].length)}var v=Ye(s);switch(m){case te:return v;case ee:return S([v],{type:o});case je:return new Int8Array(v);case Ue:return new Uint8Array(v);case Fe:return new Uint8ClampedArray(v);case $e:return new Int16Array(v);case We:return new Uint16Array(v);case He:return new Int32Array(v);case qe:return new Uint32Array(v);case Xe:return new Float32Array(v);case Ge:return new Float64Array(v);default:throw new Error("Unkown type: "+m)}}var ie={serialize:Qn,deserialize:ti,stringToBuffer:Ye,bufferToString:ne};function Je(r,o,s,m){r.executeSql("CREATE TABLE IF NOT EXISTS "+o.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],s,m)}function ei(r){var o=this,s={db:null};if(r)for(var m in r)s[m]=typeof r[m]!="string"?r[m].toString():r[m];var f=new C(function(v,w){try{s.db=openDatabase(s.name,String(s.version),s.description,s.size)}catch(x){return w(x)}s.db.transaction(function(x){Je(x,s,function(){o._dbInfo=s,v()},function(E,k){w(k)})},w)});return s.serializer=ie,f}function st(r,o,s,m,f,v){r.executeSql(s,m,f,function(w,x){x.code===x.SYNTAX_ERR?w.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[o.storeName],function(E,k){k.rows.length?v(E,x):Je(E,o,function(){E.executeSql(s,m,f,v)},v)},v):v(w,x)},v)}function ni(r,o){var s=this;r=D(r);var m=new C(function(f,v){s.ready().then(function(){var w=s._dbInfo;w.db.transaction(function(x){st(x,w,"SELECT * FROM "+w.storeName+" WHERE key = ? LIMIT 1",[r],function(E,k){var _=k.rows.length?k.rows.item(0).value:null;_&&(_=w.serializer.deserialize(_)),f(_)},function(E,k){v(k)})})}).catch(v)});return z(m,o),m}function ii(r,o){var s=this,m=new C(function(f,v){s.ready().then(function(){var w=s._dbInfo;w.db.transaction(function(x){st(x,w,"SELECT * FROM "+w.storeName,[],function(E,k){for(var _=k.rows,L=_.length,T=0;T<L;T++){var F=_.item(T),$=F.value;if($&&($=w.serializer.deserialize($)),($=r($,F.key,T+1))!==void 0)return void f($)}f()},function(E,k){v(k)})})}).catch(v)});return z(m,o),m}function Ze(r,o,s,m){var f=this;r=D(r);var v=new C(function(w,x){f.ready().then(function(){o===void 0&&(o=null);var E=o,k=f._dbInfo;k.serializer.serialize(o,function(_,L){L?x(L):k.db.transaction(function(T){st(T,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[r,_],function(){w(E)},function(F,$){x($)})},function(T){if(T.code===T.QUOTA_ERR){if(m>0)return void w(Ze.apply(f,[r,E,s,m-1]));x(T)}})})}).catch(x)});return z(v,s),v}function ri(r,o,s){return Ze.apply(this,[r,o,s,1])}function oi(r,o){var s=this;r=D(r);var m=new C(function(f,v){s.ready().then(function(){var w=s._dbInfo;w.db.transaction(function(x){st(x,w,"DELETE FROM "+w.storeName+" WHERE key = ?",[r],function(){f()},function(E,k){v(k)})})}).catch(v)});return z(m,o),m}function si(r){var o=this,s=new C(function(m,f){o.ready().then(function(){var v=o._dbInfo;v.db.transaction(function(w){st(w,v,"DELETE FROM "+v.storeName,[],function(){m()},function(x,E){f(E)})})}).catch(f)});return z(s,r),s}function ai(r){var o=this,s=new C(function(m,f){o.ready().then(function(){var v=o._dbInfo;v.db.transaction(function(w){st(w,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(x,E){var k=E.rows.item(0).c;m(k)},function(x,E){f(E)})})}).catch(f)});return z(s,r),s}function ci(r,o){var s=this,m=new C(function(f,v){s.ready().then(function(){var w=s._dbInfo;w.db.transaction(function(x){st(x,w,"SELECT key FROM "+w.storeName+" WHERE id = ? LIMIT 1",[r+1],function(E,k){var _=k.rows.length?k.rows.item(0).key:null;f(_)},function(E,k){v(k)})})}).catch(v)});return z(m,o),m}function ui(r){var o=this,s=new C(function(m,f){o.ready().then(function(){var v=o._dbInfo;v.db.transaction(function(w){st(w,v,"SELECT key FROM "+v.storeName,[],function(x,E){for(var k=[],_=0;_<E.rows.length;_++)k.push(E.rows.item(_).key);m(k)},function(x,E){f(E)})})}).catch(f)});return z(s,r),s}function li(r){return new C(function(o,s){r.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,v){for(var w=[],x=0;x<v.rows.length;x++)w.push(v.rows.item(x).name);o({db:r,storeNames:w})},function(f,v){s(v)})},function(m){s(m)})})}function hi(r,o){o=B.apply(this,arguments);var s=this.config();(r=typeof r!="function"&&r||{}).name||(r.name=r.name||s.name,r.storeName=r.storeName||s.storeName);var m,f=this;return z(m=r.name?new C(function(v){var w;w=r.name===s.name?f._dbInfo.db:openDatabase(r.name,"","",0),r.storeName?v({db:w,storeNames:[r.storeName]}):v(li(w))}).then(function(v){return new C(function(w,x){v.db.transaction(function(E){function k(F){return new C(function($,Z){E.executeSql("DROP TABLE IF EXISTS "+F,[],function(){$()},function(nn,Et){Z(Et)})})}for(var _=[],L=0,T=v.storeNames.length;L<T;L++)_.push(k(v.storeNames[L]));C.all(_).then(function(){w()}).catch(function(F){x(F)})},function(E){x(E)})})}):C.reject("Invalid arguments"),o),m}var di={_driver:"webSQLStorage",_initStorage:ei,_support:Jn(),iterate:ii,getItem:ni,setItem:ri,removeItem:oi,clear:si,length:ai,key:ci,keys:ui,dropInstance:hi};function fi(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Qe(r,o){var s=r.name+"/";return r.storeName!==o.storeName&&(s+=r.storeName+"/"),s}function pi(){var r="_localforage_support_test";try{return localStorage.setItem(r,!0),localStorage.removeItem(r),!1}catch{return!0}}function mi(){return!pi()||localStorage.length>0}function vi(r){var o=this,s={};if(r)for(var m in r)s[m]=r[m];return s.keyPrefix=Qe(r,o._defaultConfig),mi()?(o._dbInfo=s,s.serializer=ie,C.resolve()):C.reject()}function gi(r){var o=this,s=o.ready().then(function(){for(var m=o._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var v=localStorage.key(f);v.indexOf(m)===0&&localStorage.removeItem(v)}});return z(s,r),s}function yi(r,o){var s=this;r=D(r);var m=s.ready().then(function(){var f=s._dbInfo,v=localStorage.getItem(f.keyPrefix+r);return v&&(v=f.serializer.deserialize(v)),v});return z(m,o),m}function wi(r,o){var s=this,m=s.ready().then(function(){for(var f=s._dbInfo,v=f.keyPrefix,w=v.length,x=localStorage.length,E=1,k=0;k<x;k++){var _=localStorage.key(k);if(_.indexOf(v)===0){var L=localStorage.getItem(_);if(L&&(L=f.serializer.deserialize(L)),(L=r(L,_.substring(w),E++))!==void 0)return L}}});return z(m,o),m}function bi(r,o){var s=this,m=s.ready().then(function(){var f,v=s._dbInfo;try{f=localStorage.key(r)}catch{f=null}return f&&(f=f.substring(v.keyPrefix.length)),f});return z(m,o),m}function Si(r){var o=this,s=o.ready().then(function(){for(var m=o._dbInfo,f=localStorage.length,v=[],w=0;w<f;w++){var x=localStorage.key(w);x.indexOf(m.keyPrefix)===0&&v.push(x.substring(m.keyPrefix.length))}return v});return z(s,r),s}function xi(r){var o=this.keys().then(function(s){return s.length});return z(o,r),o}function Ci(r,o){var s=this;r=D(r);var m=s.ready().then(function(){var f=s._dbInfo;localStorage.removeItem(f.keyPrefix+r)});return z(m,o),m}function Ei(r,o,s){var m=this;r=D(r);var f=m.ready().then(function(){o===void 0&&(o=null);var v=o;return new C(function(w,x){var E=m._dbInfo;E.serializer.serialize(o,function(k,_){if(_)x(_);else try{localStorage.setItem(E.keyPrefix+r,k),w(v)}catch(L){L.name!=="QuotaExceededError"&&L.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(L),x(L)}})})});return z(f,s),f}function ki(r,o){if(o=B.apply(this,arguments),!(r=typeof r!="function"&&r||{}).name){var s=this.config();r.name=r.name||s.name,r.storeName=r.storeName||s.storeName}var m,f=this;return z(m=r.name?new C(function(v){r.storeName?v(Qe(r,f._defaultConfig)):v(r.name+"/")}).then(function(v){for(var w=localStorage.length-1;w>=0;w--){var x=localStorage.key(w);x.indexOf(v)===0&&localStorage.removeItem(x)}}):C.reject("Invalid arguments"),o),m}var zi={_driver:"localStorageWrapper",_initStorage:vi,_support:fi(),iterate:wi,getItem:yi,setItem:Ei,removeItem:Ci,clear:gi,length:xi,key:bi,keys:Si,dropInstance:ki},_i=function(r,o){return r===o||typeof r=="number"&&typeof o=="number"&&isNaN(r)&&isNaN(o)},Ii=function(r,o){for(var s=r.length,m=0;m<s;){if(_i(r[m],o))return!0;m++}return!1},tn=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"},Ct={},en={},vt={INDEXEDDB:Yn,WEBSQL:di,LOCALSTORAGE:zi},Pi=[vt.INDEXEDDB._driver,vt.WEBSQL._driver,vt.LOCALSTORAGE._driver],Rt=["dropInstance"],re=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Rt),Mi={description:"",driver:Pi.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ri(r,o){r[o]=function(){var s=arguments;return r.ready().then(function(){return r[o].apply(r,s)})}}function oe(){for(var r=1;r<arguments.length;r++){var o=arguments[r];if(o)for(var s in o)o.hasOwnProperty(s)&&(tn(o[s])?arguments[0][s]=o[s].slice():arguments[0][s]=o[s])}return arguments[0]}var Ai=new(function(){function r(o){for(var s in a(this,r),vt)if(vt.hasOwnProperty(s)){var m=vt[s],f=m._driver;this[s]=f,Ct[f]||this.defineDriver(m)}this._defaultConfig=oe({},Mi),this._config=oe({},this._defaultConfig,o),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return r.prototype.config=function(o){if((o===void 0?"undefined":i(o))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var s in o){if(s==="storeName"&&(o[s]=o[s].replace(/\W/g,"_")),s==="version"&&typeof o[s]!="number")return new Error("Database version must be a number.");this._config[s]=o[s]}return!("driver"in o)||!o.driver||this.setDriver(this._config.driver)}return typeof o=="string"?this._config[o]:this._config},r.prototype.defineDriver=function(o,s,m){var f=new C(function(v,w){try{var x=o._driver,E=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!o._driver)return void w(E);for(var k=re.concat("_initStorage"),_=0,L=k.length;_<L;_++){var T=k[_];if((!Ii(Rt,T)||o[T])&&typeof o[T]!="function")return void w(E)}(function(){for(var $=function(Li){return function(){var Di=new Error("Method "+Li+" is not implemented by the current driver"),rn=C.reject(Di);return z(rn,arguments[arguments.length-1]),rn}},Z=0,nn=Rt.length;Z<nn;Z++){var Et=Rt[Z];o[Et]||(o[Et]=$(Et))}})();var F=function($){Ct[x]&&console.info("Redefining LocalForage driver: "+x),Ct[x]=o,en[x]=$,v()};"_support"in o?o._support&&typeof o._support=="function"?o._support().then(F,w):F(!!o._support):F(!0)}catch($){w($)}});return P(f,s,m),f},r.prototype.driver=function(){return this._driver||null},r.prototype.getDriver=function(o,s,m){var f=Ct[o]?C.resolve(Ct[o]):C.reject(new Error("Driver not found."));return P(f,s,m),f},r.prototype.getSerializer=function(o){var s=C.resolve(ie);return P(s,o),s},r.prototype.ready=function(o){var s=this,m=s._driverSet.then(function(){return s._ready===null&&(s._ready=s._initDriver()),s._ready});return P(m,o,o),m},r.prototype.setDriver=function(o,s,m){var f=this;tn(o)||(o=[o]);var v=this._getSupportedDrivers(o);function w(){f._config.driver=f.driver()}function x(_){return f._extend(_),w(),f._ready=f._initStorage(f._config),f._ready}function E(_){return function(){var L=0;function T(){for(;L<_.length;){var F=_[L];return L++,f._dbInfo=null,f._ready=null,f.getDriver(F).then(x).catch(T)}w();var $=new Error("No available storage method found.");return f._driverSet=C.reject($),f._driverSet}return T()}}var k=this._driverSet!==null?this._driverSet.catch(function(){return C.resolve()}):C.resolve();return this._driverSet=k.then(function(){var _=v[0];return f._dbInfo=null,f._ready=null,f.getDriver(_).then(function(L){f._driver=L._driver,w(),f._wrapLibraryMethodsWithReady(),f._initDriver=E(v)})}).catch(function(){w();var _=new Error("No available storage method found.");return f._driverSet=C.reject(_),f._driverSet}),P(this._driverSet,s,m),this._driverSet},r.prototype.supports=function(o){return!!en[o]},r.prototype._extend=function(o){oe(this,o)},r.prototype._getSupportedDrivers=function(o){for(var s=[],m=0,f=o.length;m<f;m++){var v=o[m];this.supports(v)&&s.push(v)}return s},r.prototype._wrapLibraryMethodsWithReady=function(){for(var o=0,s=re.length;o<s;o++)Ri(this,re[o])},r.prototype.createInstance=function(o){return new r(o)},r}());e.exports=Ai},{3:3}]},{},[4])(4),zn={exports:{}};/*!
|
|
1
|
+
import{h as qi,openBlock as H,createElementBlock as tt,normalizeStyle as gt,renderSlot as dt,reactive as fn,computed as ft,defineComponent as At,ref as nt,onMounted as pn,onUpdated as Xi,nextTick as mn,normalizeClass as Gi,createElementVNode as V,createCommentVNode as Et,createVNode as gn,Transition as vn,withCtx as jt,withModifiers as yn,getCurrentInstance as Vi,watch as Wt,onBeforeUnmount as Ki,resolveComponent as wn,createBlock as at,withDirectives as Yi,Fragment as vt,createTextVNode as bn,toDisplayString as Ji,vShow as Zi,markRaw as Sn,toRefs as Qi,renderList as kt,resolveDynamicComponent as yt}from"vue";import{Client as to,ClientContext as Cn}from"@hprose/rpc-core";import{ByteStream as xn}from"@hprose/io";import{HttpTransport as eo}from"@hprose/rpc-html5";var no={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),l=Math.max(Math.min(this.getCurrentDragPercentage(t),r),i);let v=[e,e+1],y=this.panes[v[0]]||null,S=this.panes[v[1]]||null;const C=y.max<100&&l>=y.max+n.prevPanesSize,z=S.max<100&&l<=100-(S.max+this.sumNextPanesSize(e+1));if(C||z)C?(y.size=y.max,S.size=Math.max(100-y.max-n.prevPanesSize-n.nextPanesSize,0)):(y.size=Math.max(100-S.max-n.prevPanesSize-this.sumNextPanesSize(e+1),0),S.size=S.max);else{if(this.pushOtherPanes){const _=this.doPushOtherPanes(n,l);if(!_)return;({sums:n,panesToResize:v}=_),y=this.panes[v[0]]||null,S=this.panes[v[1]]||null}y!==null&&(y.size=Math.min(Math.max(l-n.prevPanesSize-n.prevReachedMinPanes,y.min),y.max)),S!==null&&(S.size=Math.min(Math.max(100-l-n.nextPanesSize-n.nextReachedMinPanes,S.min),S.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,l)=>{l>i[0]&&l<=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,l)=>{l>0&&l<=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,l)=>{l>n&&l<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,l)=>{l<this.panesCount-1&&l>=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=l=>this.onMouseDown(l,i),typeof window!="undefined"&&"ontouchstart"in window&&(r.ontouchstart=l=>this.onMouseDown(l,i)),r.onclick=l=>this.onSplitterClick(l,i+1)),this.dblClickSplitter&&(r.ondblclick=l=>this.onSplitterDblClick(l,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,l)=>r.index=l),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(l=>{t-=l.size,l.size!==null&&i++,l.size>=l.max&&e.push(l.id),l.size<=l.min&&n.push(l.id)});let r=100;t>.1&&(this.panes.forEach(l=>{l.size===null&&(l.size=Math.max(Math.min(t/(this.panesCount-i),l.max),l.min)),r-=l.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(l=>{n-=l.size,l.size>=l.max&&i.push(l.id),l.size<=l.min&&r.push(l.id)}),Math.abs(n)<.1||(this.panes.forEach(l=>{t&&t.givenSize!==null&&t.id===l.id||(l.size=Math.max(Math.min(e,l.max),l.min)),n-=l.size,l.size>=l.max&&i.push(l.id),l.size<=l.min&&r.push(l.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 l=Math.max(Math.min(r.size+i,r.max),r.min);t-=l-r.size,r.size=l}else if(!n.includes(r.id)){const l=Math.max(Math.min(r.size+i,r.max),r.min);t-=l-r.size,r.size=l}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 qi("div",{ref:"container",class:["splitpanes","splitpanes--"+(this.horizontal?"horizontal":"vertical"),{"splitpanes--dragging":this.touch.dragging}]},this.$slots.default())},__file:"src/controls/splitpanes/splitpanes.vue"},me={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})}}};me.render=function(t,e,n,i,r,l){return H(),tt("div",{class:"splitpanes__pane",onClick:e[0]||(e[0]=v=>l.onPaneClick(v,t._.uid)),style:gt(t.style)},[dt(t.$slots,"default")],4)},me.__file="src/controls/splitpanes/pane.vue";var zt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ge(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 io={exports:{}},En=io.exports=function(t){var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(w,c){var h=w[0],d=w[1],u=w[2],p=w[3];d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[0]-680876936|0)<<7|h>>>25)+d|0)&d|~h&u)+c[1]-389564586|0)<<12|p>>>20)+h|0)&h|~p&d)+c[2]+606105819|0)<<17|u>>>15)+p|0)&p|~u&h)+c[3]-1044525330|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[4]-176418897|0)<<7|h>>>25)+d|0)&d|~h&u)+c[5]+1200080426|0)<<12|p>>>20)+h|0)&h|~p&d)+c[6]-1473231341|0)<<17|u>>>15)+p|0)&p|~u&h)+c[7]-45705983|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[8]+1770035416|0)<<7|h>>>25)+d|0)&d|~h&u)+c[9]-1958414417|0)<<12|p>>>20)+h|0)&h|~p&d)+c[10]-42063|0)<<17|u>>>15)+p|0)&p|~u&h)+c[11]-1990404162|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&u|~d&p)+c[12]+1804603682|0)<<7|h>>>25)+d|0)&d|~h&u)+c[13]-40341101|0)<<12|p>>>20)+h|0)&h|~p&d)+c[14]-1502002290|0)<<17|u>>>15)+p|0)&p|~u&h)+c[15]+1236535329|0)<<22|d>>>10)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[1]-165796510|0)<<5|h>>>27)+d|0)&u|d&~u)+c[6]-1069501632|0)<<9|p>>>23)+h|0)&d|h&~d)+c[11]+643717713|0)<<14|u>>>18)+p|0)&h|p&~h)+c[0]-373897302|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[5]-701558691|0)<<5|h>>>27)+d|0)&u|d&~u)+c[10]+38016083|0)<<9|p>>>23)+h|0)&d|h&~d)+c[15]-660478335|0)<<14|u>>>18)+p|0)&h|p&~h)+c[4]-405537848|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[9]+568446438|0)<<5|h>>>27)+d|0)&u|d&~u)+c[14]-1019803690|0)<<9|p>>>23)+h|0)&d|h&~d)+c[3]-187363961|0)<<14|u>>>18)+p|0)&h|p&~h)+c[8]+1163531501|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d&p|u&~p)+c[13]-1444681467|0)<<5|h>>>27)+d|0)&u|d&~u)+c[2]-51403784|0)<<9|p>>>23)+h|0)&d|h&~d)+c[7]+1735328473|0)<<14|u>>>18)+p|0)&h|p&~h)+c[12]-1926607734|0)<<20|d>>>12)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[5]-378558|0)<<4|h>>>28)+d|0)^d^u)+c[8]-2022574463|0)<<11|p>>>21)+h|0)^h^d)+c[11]+1839030562|0)<<16|u>>>16)+p|0)^p^h)+c[14]-35309556|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[1]-1530992060|0)<<4|h>>>28)+d|0)^d^u)+c[4]+1272893353|0)<<11|p>>>21)+h|0)^h^d)+c[7]-155497632|0)<<16|u>>>16)+p|0)^p^h)+c[10]-1094730640|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[13]+681279174|0)<<4|h>>>28)+d|0)^d^u)+c[0]-358537222|0)<<11|p>>>21)+h|0)^h^d)+c[3]-722521979|0)<<16|u>>>16)+p|0)^p^h)+c[6]+76029189|0)<<23|d>>>9)+u|0,d=((d+=((u=((u+=((p=((p+=((h=((h+=(d^u^p)+c[9]-640364487|0)<<4|h>>>28)+d|0)^d^u)+c[12]-421815835|0)<<11|p>>>21)+h|0)^h^d)+c[15]+530742520|0)<<16|u>>>16)+p|0)^p^h)+c[2]-995338651|0)<<23|d>>>9)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[0]-198630844|0)<<6|h>>>26)+d|0)|~u))+c[7]+1126891415|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[14]-1416354905|0)<<15|u>>>17)+p|0)|~h))+c[5]-57434055|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[12]+1700485571|0)<<6|h>>>26)+d|0)|~u))+c[3]-1894986606|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[10]-1051523|0)<<15|u>>>17)+p|0)|~h))+c[1]-2054922799|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[8]+1873313359|0)<<6|h>>>26)+d|0)|~u))+c[15]-30611744|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[6]-1560198380|0)<<15|u>>>17)+p|0)|~h))+c[13]+1309151649|0)<<21|d>>>11)+u|0,d=((d+=((p=((p+=(d^((h=((h+=(u^(d|~p))+c[4]-145523070|0)<<6|h>>>26)+d|0)|~u))+c[11]-1120210379|0)<<10|p>>>22)+h|0)^((u=((u+=(h^(p|~d))+c[2]+718787259|0)<<15|u>>>17)+p|0)|~h))+c[9]-343485551|0)<<21|d>>>11)+u|0,w[0]=h+w[0]|0,w[1]=d+w[1]|0,w[2]=u+w[2]|0,w[3]=p+w[3]|0}function i(w){var c,h=[];for(c=0;c<64;c+=4)h[c>>2]=w.charCodeAt(c)+(w.charCodeAt(c+1)<<8)+(w.charCodeAt(c+2)<<16)+(w.charCodeAt(c+3)<<24);return h}function r(w){var c,h=[];for(c=0;c<64;c+=4)h[c>>2]=w[c]+(w[c+1]<<8)+(w[c+2]<<16)+(w[c+3]<<24);return h}function l(w){var c,h,d,u,p,P,I=w.length,L=[1732584193,-271733879,-1732584194,271733878];for(c=64;c<=I;c+=64)n(L,i(w.substring(c-64,c)));for(h=(w=w.substring(c-64)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0;c<h;c+=1)d[c>>2]|=w.charCodeAt(c)<<(c%4<<3);if(d[c>>2]|=128<<(c%4<<3),c>55)for(n(L,d),c=0;c<16;c+=1)d[c]=0;return u=(u=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(u[2],16),P=parseInt(u[1],16)||0,d[14]=p,d[15]=P,n(L,d),L}function v(w){var c,h,d,u,p,P,I=w.length,L=[1732584193,-271733879,-1732584194,271733878];for(c=64;c<=I;c+=64)n(L,r(w.subarray(c-64,c)));for(h=(w=c-64<I?w.subarray(c-64):new Uint8Array(0)).length,d=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],c=0;c<h;c+=1)d[c>>2]|=w[c]<<(c%4<<3);if(d[c>>2]|=128<<(c%4<<3),c>55)for(n(L,d),c=0;c<16;c+=1)d[c]=0;return u=(u=8*I).toString(16).match(/(.*?)(.{0,8})$/),p=parseInt(u[2],16),P=parseInt(u[1],16)||0,d[14]=p,d[15]=P,n(L,d),L}function y(w){var c,h="";for(c=0;c<4;c+=1)h+=e[w>>8*c+4&15]+e[w>>8*c&15];return h}function S(w){var c;for(c=0;c<w.length;c+=1)w[c]=y(w[c]);return w.join("")}function C(w){return/[\u0080-\uFFFF]/.test(w)&&(w=unescape(encodeURIComponent(w))),w}function z(w,c){var h,d=w.length,u=new ArrayBuffer(d),p=new Uint8Array(u);for(h=0;h<d;h+=1)p[h]=w.charCodeAt(h);return c?p:u}function _(w){return String.fromCharCode.apply(null,new Uint8Array(w))}function D(w,c,h){var d=new Uint8Array(w.byteLength+c.byteLength);return d.set(new Uint8Array(w)),d.set(new Uint8Array(c),w.byteLength),h?d:d.buffer}function T(w){var c,h=[],d=w.length;for(c=0;c<d-1;c+=2)h.push(parseInt(w.substr(c,2),16));return String.fromCharCode.apply(String,h)}function R(){this.reset()}return S(l("hello")),typeof ArrayBuffer=="undefined"||ArrayBuffer.prototype.slice||function(){function w(c,h){return(c=0|c||0)<0?Math.max(c+h,0):Math.min(c,h)}ArrayBuffer.prototype.slice=function(c,h){var d,u,p,P,I=this.byteLength,L=w(c,I),O=I;return h!==t&&(O=w(h,I)),L>O?new ArrayBuffer(0):(d=O-L,u=new ArrayBuffer(d),p=new Uint8Array(u),P=new Uint8Array(this,L,d),p.set(P),u)}}(),R.prototype.append=function(w){return this.appendBinary(C(w)),this},R.prototype.appendBinary=function(w){this._buff+=w,this._length+=w.length;var c,h=this._buff.length;for(c=64;c<=h;c+=64)n(this._hash,i(this._buff.substring(c-64,c)));return this._buff=this._buff.substring(c-64),this},R.prototype.end=function(w){var c,h,d=this._buff,u=d.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(c=0;c<u;c+=1)p[c>>2]|=d.charCodeAt(c)<<(c%4<<3);return this._finish(p,u),h=S(this._hash),w&&(h=T(h)),this.reset(),h},R.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},R.prototype.setState=function(w){return this._buff=w.buff,this._length=w.length,this._hash=w.hash,this},R.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},R.prototype._finish=function(w,c){var h,d,u,p=c;if(w[p>>2]|=128<<(p%4<<3),p>55)for(n(this._hash,w),p=0;p<16;p+=1)w[p]=0;h=(h=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),d=parseInt(h[2],16),u=parseInt(h[1],16)||0,w[14]=d,w[15]=u,n(this._hash,w)},R.hash=function(w,c){return R.hashBinary(C(w),c)},R.hashBinary=function(w,c){var h=S(l(w));return c?T(h):h},R.ArrayBuffer=function(){this.reset()},R.ArrayBuffer.prototype.append=function(w){var c,h=D(this._buff.buffer,w,!0),d=h.length;for(this._length+=w.byteLength,c=64;c<=d;c+=64)n(this._hash,r(h.subarray(c-64,c)));return this._buff=c-64<d?new Uint8Array(h.buffer.slice(c-64)):new Uint8Array(0),this},R.ArrayBuffer.prototype.end=function(w){var c,h,d=this._buff,u=d.length,p=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(c=0;c<u;c+=1)p[c>>2]|=d[c]<<(c%4<<3);return this._finish(p,u),h=S(this._hash),w&&(h=T(h)),this.reset(),h},R.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},R.ArrayBuffer.prototype.getState=function(){var w=R.prototype.getState.call(this);return w.buff=_(w.buff),w},R.ArrayBuffer.prototype.setState=function(w){return w.buff=z(w.buff,!0),R.prototype.setState.call(this,w)},R.ArrayBuffer.prototype.destroy=R.prototype.destroy,R.ArrayBuffer.prototype._finish=R.prototype._finish,R.ArrayBuffer.hash=function(w,c){var h=S(v(new Uint8Array(w)));return c?T(h):h},R}();const ve=[],wt=class{static addHandler(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent?t.attachEvent("on"+e,n):t["on"+e]=n}static windowResizeHandler(t){wt.addHandler(window,"resize",t)}static fullscreenEnabled(){const t=window.document;return document.fullscreenEnabled||window.fullScreen||t.mozFullscreenEnabled||t.webkitIsFullScreen}static fullScreen(t,e){if(e){const n=window.document;let i=window.document.exitFullscreen||n.msExitFullscreen||n.mozCancelFullScreen||n.webkitCancelFullScreen;if(i!==void 0&&i)i.call(window.document);else if(window.ActiveXObject!==void 0){let r=new window.ActiveXObject("WScript.Shell");r!=null&&r.SendKeys("{F11}")}}else{let n=t;n||(n=window.document.documentElement);let i=n.requestFullScreen||n.webkitRequestFullScreen||n.mozRequestFullScreen||n.msRequestFullScreen;if(i!==void 0&&i)i.call(n);else if(window.ActiveXObject!==void 0){let r=new window.ActiveXObject("WScript.Shell");r!=null&&r.SendKeys("{F11}")}}}static requestFullScreen(t){let e=t;e||(e=window.document.documentElement);var n=e.requestFullScreen||e.webkitRequestFullScreen||e.mozRequestFullScreen||e.msRequestFullScreen;if(n)n.call(e);else if(window.ActiveXObject!==void 0){var i=new window.ActiveXObject("WScript.Shell");i!==null&&i.SendKeys("{F11}")}}static exitFullScreen(){const t=window.document;var e=document.exitFullscreen||t.mozCancelFullScreen||t.webkitExitFullscreen||t.webkitExitFullscreen;if(e)e.call(document);else if(window.ActiveXObject!==void 0){var n=new window.ActiveXObject("WScript.Shell");n!==null&&n.SendKeys("{F11}")}}static fullScreenElement(){return window.document.fullscreenElement||window.document.webkitFullscreenElement||window.document.mozFullscreenElement||window.document.msFullscreenElement}static isFullScreen(){return!!wt.fullScreenElement()}static onFullScreenChanged(t){let e;"onfullscreenchange"in window.document?e="fullscreenchange":"onwebkitfullscreenchange"in window.document?e="webkitfullscreenchange":"onmozfullscreenchange"in window.document&&(e="mozfullscreenchange"),e?document.addEventListener(e,function(){const n=wt.isFullScreen();t(n)}):document.addEventListener("MSFullscreenChange",function(){const n=wt.isFullScreen();t(n)})}static stringifyCircularHandler(t,e){if(typeof e=="object"&&e!==null){if(ve.indexOf(e)!==-1)return;ve.push(e)}return e}static jsonStringify(t){if(!t)return"";const e=JSON.stringify(t,wt.stringifyCircularHandler);return ve.length=0,e}static jsonParse(t){const e=wt.jsonStringify(t);if(e.length>1)return JSON.parse(e)}static getObjectURL(t){let e;const n=window;return n.createObjcectURL!=null?e=n.createOjcectURL(t):window.URL!=null?e=window.URL.createObjectURL(t):window.webkitURL!=null&&(e=window.webkitURL.createObjectURL(t)),e}static getFileShortMD5(t,e){const n=File.prototype,i=n.slice||n.mozSlice||n.webkitSlice,r=t,l=new En.ArrayBuffer,v=new FileReader;v.onload=function(y){l.append(y.target?.result);const S=l.end();e({isOK:!0,data:S})},v.onerror=function(){const y="\u8BA1\u7B97\u6587\u4EF6\u7B80\u5355\u6458\u8981\u9519\u8BEF\uFF01";console.warn(y),e({isOK:!1,data:y})},function(){const y=2097152>=r.size?r.size:2097152;v.readAsArrayBuffer(i.call(r,0,y))}()}static MD5(t,e=!1){return En.hash(t,e)}};let kn=wt;kn.copyText=t=>new Promise((e,n)=>{const i=document.createElement("input");i.value=t,document.body.appendChild(i),i.select(),document.execCommand("copy"),i.remove(),e(!0)});class _t{static toHump(e){return e.replace(/[\-\/\_](\w)/g,(n,i)=>i.toUpperCase()).replace("views","")}}_t.isNullOrEmpty=t=>t===null||t===""||t===void 0||t.length===0,_t.isNotEmpty=t=>t!==null&&t!==""&&t!==void 0&&t.length!==0;class ye{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:l,expire:v}=r;if(v===null||v>=Date.now())return l;this.remove(this.getKey(e))}catch{return n}return n}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 l=n[i].split("=");if(l[0]===this.getKey(e))return l[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 oo=new ye("",localStorage);function Ft(){let t=[];const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";for(var n=0;n<36;n++)t[n]=e.substr(Math.floor(16*Math.random()),1);return t[14]="4",t[19]=e.substr(3&Number(t[19])|8,1),t[8]=t[13]=t[18]=t[23]="-",t.join("")}function ro(){var t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?n:3&n|8).toString(16)})}function so(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)),l=Math.floor(n*parseInt(e[2])+255*(1-n));return"#"+("0"+i.toString(16)).slice(-2)+("0"+r.toString(16)).slice(-2)+("0"+l.toString(16)).slice(-2)}function ao(t){var e=t.toLowerCase();if($t(t)){if(e.length===4){for(var n="#",i=1;i<4;i+=1){const l=e.slice(i,i+1);n+=l.concat(l)}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 co(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,Mt;function uo(t){if(typeof t=="object"||!t)return;const e=t.toLowerCase().substr(0,1);return e==="#"?bt.Hex:e==="r"||e==="("?bt.RGBA:e==="h"?bt.Hsla:bt.RGBA}function lo(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,l=(parseFloat(e[1])%360+360)%360/360,v=parseFloat(e[2])/(/%$/.test(e[2])?100:1),y=parseFloat(e[3])/(/%$/.test(e[3])?100:1);if(v===0)n=i=r=y;else{var S=y<=.5?y*(v+1):y+v-y*v,C=2*y-S;n=we(C,S,l+1/3),i=we(C,S,l),r=we(C,S,l-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 we(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 $t(t){return/^#([0-9a-fA-F]{3}|[0-9a-fA-f]{6})$/.test(t)}function ho(t,e,n){const i=(t<<16|e<<8|n).toString(16);return"#"+new Array(Math.abs(i.length-7)).join("0")+i}function be(t){let e=t.toLowerCase();if($t(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 fo(t){if(!$t(t))return;const[e,n,i]=be(t).replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(r=>Number(r));return .299*e+.578*n+.114*i<192}function po(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Ce(t.substring(0,2),e)}${Ce(t.substring(2,4),e)}${Ce(t.substring(4,6),e)}`}function mo(t,e){return t=t.indexOf("#")>=0?t.substring(1,t.length):t,e=Math.trunc(255*e/100),`#${Se(t.substring(0,2),e)}${Se(t.substring(2,4),e)}${Se(t.substring(4,6),e)}`}function Se(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 zn(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 go(t){const e=be(t.substring(1));var n,i;return n=e.split(","),i=[0,0,0],(zn(~~n[0],~~n[1],~~n[2])+.05)/(zn(i[0],i[1],i[2])+.05)>=12?"#000000":"#FFFFFF"}function Ce(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 xe(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)})}}}(Mt=bt||(bt={}))[Mt.RGBA=0]="RGBA",Mt[Mt.Hex=1]="Hex",Mt[Mt.Hsla=2]="Hsla";const It=xe(),K={HproseServiceErrorEvent:"HproseServiceError",WebAPIErrorEvent:"WebAPIError",AlertInfoEvent:"AlertInfoEvent",CommonWarnEvent:"CommonWarnEvent",WidgetLoadedEvent:"WidgetLoaded",WidgetUnLoadedEvent:"WidgetLoaded",WidgetVisibleChanged:"WidgetVisibleChanged"},Ee=(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 vo(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 yo=(t,e)=>{const n=JSON.stringify(t,null,2);e?Ee(n,e+".json"):It.emit(K.CommonWarnEvent,"\u53C2\u6570JsonID\u4E0D\u80FD\u4E3A\u7A7A\uFF01")},wo=(t,e,n)=>{t.get(e).then(function(i){Ee(i.data,n)}).catch(i=>{console.warn(i),It.emit(K.CommonWarnEvent,"\u4E0B\u8F7D\u6587\u4EF6\u62A5\u9519\uFF01")})};function _n(t){const e=t.lastIndexOf("/")+1;let n=t.substring(e);return n=decodeURI(n.split("?")[0]),n}function bo({url:t,target:e="_blank",fileName:n}){const i=new URL(t).host==location.host;return new Promise((r,l)=>{if(i){const v=document.createElement("a");if(v.href=t,v.target=e,v.download!==void 0&&(v.download=n||_n(t)),document.createEvent){const y=document.createEvent("MouseEvents");return y.initEvent("click",!0,!0),v.dispatchEvent(y),r(!0)}return t.indexOf("?")===-1&&(t+="?download"),window.open(t,e),r(!0)}{const v=document.createElement("canvas"),y=document.createElement("img");y.setAttribute("crossOrigin","Anonymous"),y.src=t,y.onload=S=>{v.width=y.width,v.height=y.height,v.getContext("2d").drawImage(y,0,0,y.width,y.height),v.toBlob(C=>{const z=document.createElement("a");z.href=window.URL.createObjectURL(C),z.download=_n(t),z.click(),URL.revokeObjectURL(z.href),r(!0)},"image/jpeg")},y.onerror=S=>l(S)}})}function So(t){for(var e=new Date().getTime();new Date().getTime()-e<t;);console.log(`\u5F3A\u5236\u7B49\u5F85${t}\u6BEB\u79D2`)}class Bt{constructor(e){if(e&&!_t.isNullOrEmpty(e)){if(Bt.httpTransport||(Bt.httpTransport=new eo),this.client=new to(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(K.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){return this.client?this.client.codec.encode(e,n,i):void 0}decode(e,n){return this.client?this.client.codec.decode(e,n):void 0}}class Dt{constructor(e){this.hproseClient=new Bt(e),this.hpProxyObj=null,this.defaultContext=new Cn}getClientContext(){return null}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(K.HproseServiceErrorEvent,"HproseProxy\u5BF9\u8C61\u4E3A\u7A7A\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5\uFF01"),this.hpProxyObj}async hproseInvoke(e,n){if(!this.hproseClient)throw new Error("HproseClient\u5BF9\u8C61\u4E3A\u6784\u5EFA\uFF0C\u65E0\u6CD5\u8C03\u7528Hprose\u65B9\u6CD5");let i;return i=new Cn,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");return await this.hproseClient.invoke(e,i,n)}async hproseInvokeEncode(e){const n=new xn(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 xn.toString(i)}}class Co{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(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(K.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")}}const ke=new Map,B={Config:SysConfig,EventBus:It,DefaultProxyClient:null,Axios:void 0};function xo(t){Mn(t.message,t.axios,t.defaultHproseURL),t.config&&(B.Config=t.config)}const Mn=function(t,e,n){n?B.Config.DefaultHproseAPI=n:!B.Config.DefaultHproseAPI&&B.Config.ServiceURL&&(B.Config.DefaultHproseAPI=B.Config.ServiceURL.DefaultHproseAPI),e&&(B.Axios=e),B.Config.DefaultHproseAPI&&_t.isNotEmpty(B.Config.DefaultHproseAPI)&&(B.DefaultProxyClient=new Dt(B.Config.DefaultHproseAPI));const i=new Co(t,B.EventBus);B.Message=i,B.EventBus.on(K.HproseServiceErrorEvent,r=>{const l=`\u5F53\u524D\u540E\u53F0\u4E1A\u52A1\u670D\u52A1\u4E0D\u53EF\u7528!${r}`;i.warn(l)}),B.EventBus.on(K.WebAPIErrorEvent,r=>{const l=`WebAPI\u540E\u53F0\u670D\u52A1\u4E0D\u53EF\u7528!${r}`;i.warn(l)}),B.EventBus.on(K.CommonWarnEvent,r=>{i.warn(r)})};function In(t){if(t&&_t.isNotEmpty(t)){if(ke.has(t))return ke.get(t);{const e=new Dt(t);return ke.set(t,e),e}}}function Eo(t){const e=In(t);return e&&(B.DefaultProxyClient=e),e}const pt=new ye("user",localStorage);function Ht(){return pt.get("access_token")}function ze(){pt.remove("access_token"),B.User&&delete B.User}function Ln(){return Ht()?.refresh}function _e(t,e,n,i="json",r){const l={baseURL:B.Config.ServiceURL.DefaultWebAPI,timeout:6e4,params:t,headers:{"Content-Type":"application/json",Authorization:"bearer "+Ht()?.token},responseType:i,cancelToken:r};if(n)for(let v in n)l.headers[v]=n[v];return e&&(l.baseURL=e),l}function ct(t,e,n,i,r="json",l){const v=_e(n,e,i,r,l);return B.Axios?.get(t,v).catch(function(y){console.log(y),B.Message?.err("\u670D\u52A1Get\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function Me(t,e,n,i,r,l="json"){const v=_e(i,e,r,l),y=function(S){let C=new FormData;return S&&Object.keys(S).forEach(z=>{if(!S)return;let _=S[z];var D;_!=null&&C.append(z,(D=_)instanceof Blob?D:D.toString())}),C}(n);return B.Axios?.post(t,y,v).catch(function(S){console.log(S),B.Message?.err("\u670D\u52A1Post\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function ko(t,e,n,i,r,l="json"){const v=_e(i,e,r,l);return B.Axios?.post(t,n,v).catch(function(y){console.log(y),B.Message?.err("\u670D\u52A1Post\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}function zo(t,e){return ct(t,void 0,e)}function _o(t,e){return Me(t,void 0,e)}function Mo(t,e){return B.Axios?.get(t,{params:e}).catch(function(n){console.log(n),B.Message?.err("\u5916\u90E8Get\u670D\u52A1\u8BF7\u6C42\u9519\u8BEF\uFF1A"+t)})}var Ie={exports:{}},Io=typeof window!="undefined"?window:zt!==void 0?zt:typeof self!="undefined"?self:{},Lo=function(t){if(!t)return!1;var e=Po.call(t);return e==="[object Function]"||typeof t=="function"&&e!=="[object RegExp]"||typeof window!="undefined"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)},Po=Object.prototype.toString,Le=function(t){return t.replace(/^\s+|\s+$/g,"")},Ro=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,Pn=Io,Bo=Lo,Do=function(t){if(!t)return{};for(var e,n={},i=Le(t).split(`
|
|
2
|
+
`),r=0;r<i.length;r++){var l=i[r],v=l.indexOf(":"),y=Le(l.slice(0,v)).toLowerCase(),S=Le(l.slice(v+1));n[y]===void 0?n[y]=S:(e=n[y],Object.prototype.toString.call(e)==="[object Array]"?n[y].push(S):n[y]=[n[y],S])}return n},To=Ro;function Rn(t,e,n){var i=t;return Bo(e)?(n=e,typeof t=="string"&&(i={uri:t})):i=To(e,{uri:t}),i.callback=n,i}function ut(t,e,n){return An(e=Rn(t,e,n))}function An(t){if(t.callback===void 0)throw new Error("callback argument missing");var e=!1,n=function(h,d,u){e||(e=!0,t.callback(h,d,u))};function i(){var h=void 0;if(h=S.response?S.response:S.responseText||function(d){try{if(d.responseType==="document")return d.responseXML;var u=d.responseXML&&d.responseXML.documentElement.nodeName==="parsererror";if(d.responseType===""&&!u)return d.responseXML}catch{}return null}(S),w)try{h=JSON.parse(h)}catch{}return h}function r(h){return clearTimeout(C),h instanceof Error||(h=new Error(""+(h||"Unknown XMLHttpRequest Error"))),h.statusCode=0,n(h,c)}function l(){if(!y){var h;clearTimeout(C),h=t.useXDR&&S.status===void 0?200:S.status===1223?204:S.status;var d=c,u=null;return h!==0?(d={body:i(),statusCode:h,method:_,headers:{},url:z,rawRequest:S},S.getAllResponseHeaders&&(d.headers=Do(S.getAllResponseHeaders()))):u=new Error("Internal XMLHttpRequest Error"),n(u,d,d.body)}}var v,y,S=t.xhr||null;S||(S=t.cors||t.useXDR?new ut.XDomainRequest:new ut.XMLHttpRequest);var C,z=S.url=t.uri||t.url,_=S.method=t.method||"GET",D=t.body||t.data,T=S.headers=t.headers||{},R=!!t.sync,w=!1,c={body:void 0,headers:{},statusCode:0,method:_,url:z,rawRequest:S};if("json"in t&&t.json!==!1&&(w=!0,T.accept||T.Accept||(T.Accept="application/json"),_!=="GET"&&_!=="HEAD"&&(T["content-type"]||T["Content-Type"]||(T["Content-Type"]="application/json"),D=JSON.stringify(t.json===!0?D:t.json))),S.onreadystatechange=function(){S.readyState===4&&setTimeout(l,0)},S.onload=l,S.onerror=r,S.onprogress=function(){},S.onabort=function(){y=!0},S.ontimeout=r,S.open(_,z,!R,t.username,t.password),R||(S.withCredentials=!!t.withCredentials),!R&&t.timeout>0&&(C=setTimeout(function(){if(!y){y=!0,S.abort("timeout");var h=new Error("XMLHttpRequest timeout");h.code="ETIMEDOUT",r(h)}},t.timeout)),S.setRequestHeader)for(v in T)T.hasOwnProperty(v)&&S.setRequestHeader(v,T[v]);else if(t.headers&&!function(h){for(var d in h)if(h.hasOwnProperty(d))return!1;return!0}(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(S.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(S),S.send(D||null),S}Ie.exports=ut,Ie.exports.default=ut,ut.XMLHttpRequest=Pn.XMLHttpRequest||function(){},ut.XDomainRequest="withCredentials"in new ut.XMLHttpRequest?ut.XMLHttpRequest:Pn.XDomainRequest,function(t,e){for(var n=0;n<t.length;n++)e(t[n])}(["get","put","post","patch","head","delete"],function(t){ut[t==="delete"?"del":t]=function(e,n,i){return(n=Rn(e,n,i)).method=t.toUpperCase(),An(n)}});var No=Ie.exports;const Oo=[200,201,202,204,308],Uo=[408,502,503,504];class jo{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=xe(),this.validateOptions(),this.getEndpoint().then(()=>this.sendChunks()),typeof window!="undefined"&&(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 l=100/this.totalChunks,v=l*this.file.size,y=l*this.chunkCount,S=r.loaded/(r.total??v)*l;this.dispatch("progress",Math.min(y+S,100))}};return new Promise((i,r)=>{this.currentXhr=No({...e,beforeSend:n},(l,v)=>(this.currentXhr=void 0,l?r(l):i(v)))})}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&&Oo.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&&Uo.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 Wo=t=>new jo(t),Fo=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)}},Bn=pt.get("is_LockScreen",!1),Tt={isLock:Bn,lockTime:Bn=="true"?Tn():0};function Dn(t){Tt.isLock=t,pt.set("is_LockScreen",t,10),t&&(ze(),console.log("\u9501\u5C4F\u4E86\u2026\u2026"))}function $o(){return pt.get("is_LockScreen",!1)}function Tn(){let t=3600;return B.Config.UI?.LockTime&&B.Config.UI?.LockTime>=10&&(t=B.Config.UI.LockTime),t}let Pe;function Re(){clearInterval(Pe),window.location.href.indexOf("/login")>0||Tt.isLock||(Dn(!1),Tt.lockTime=Tn(),Pe=setInterval(()=>{if(Tt.lockTime--,Tt.lockTime<=0)return Dn(!0),clearInterval(Pe)},1e3))}function Ho(){Re(),document.addEventListener("mousedown",Re)}function qo(){document.removeEventListener("mousedown",Re)}var Xo={exports:{}},qt=Xo.exports=function t(e,n,i){function r(y,S){if(!n[y]){if(!e[y]){if(!S&&ge)return ge(y);if(l)return l(y,!0);var C=new Error("Cannot find module '"+y+"'");throw C.code="MODULE_NOT_FOUND",C}var z=n[y]={exports:{}};e[y][0].call(z.exports,function(_){var D=e[y][1][_];return r(D||_)},z,z.exports,t,e,n,i)}return n[y].exports}for(var l=ge,v=0;v<i.length;v++)r(i[v]);return r}({1:[function(t,e,n){(function(i){var r,l,v=i.MutationObserver||i.WebKitMutationObserver;if(v){var y=0,S=new v(D),C=i.document.createTextNode("");S.observe(C,{characterData:!0}),r=function(){C.data=y=++y%2}}else if(i.setImmediate||i.MessageChannel===void 0)r="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var R=i.document.createElement("script");R.onreadystatechange=function(){D(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},i.document.documentElement.appendChild(R)}:function(){setTimeout(D,0)};else{var z=new i.MessageChannel;z.port1.onmessage=D,r=function(){z.port2.postMessage(0)}}var _=[];function D(){var R,w;l=!0;for(var c=_.length;c;){for(w=_,_=[],R=-1;++R<c;)w[R]();c=_.length}l=!1}function T(R){_.push(R)!==1||l||r()}e.exports=T}).call(this,zt!==void 0?zt:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(t,e,n){var i=t(1);function r(){}var l={},v=["REJECTED"],y=["FULFILLED"],S=["PENDING"];function C(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=S,this.queue=[],this.outcome=void 0,u!==r&&T(this,u)}function z(u,p,P){this.promise=u,typeof p=="function"&&(this.onFulfilled=p,this.callFulfilled=this.otherCallFulfilled),typeof P=="function"&&(this.onRejected=P,this.callRejected=this.otherCallRejected)}function _(u,p,P){i(function(){var I;try{I=p(P)}catch(L){return l.reject(u,L)}I===u?l.reject(u,new TypeError("Cannot resolve promise with itself")):l.resolve(u,I)})}function D(u){var p=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof p=="function")return function(){p.apply(u,arguments)}}function T(u,p){var P=!1;function I(j){P||(P=!0,l.reject(u,j))}function L(j){P||(P=!0,l.resolve(u,j))}function O(){p(L,I)}var U=R(O);U.status==="error"&&I(U.value)}function R(u,p){var P={};try{P.value=u(p),P.status="success"}catch(I){P.status="error",P.value=I}return P}function w(u){return u instanceof this?u:l.resolve(new this(r),u)}function c(u){var p=new this(r);return l.reject(p,u)}function h(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=u.length,I=!1;if(!P)return this.resolve([]);for(var L=new Array(P),O=0,U=-1,j=new this(r);++U<P;)$(u[U],U);return j;function $(X,G){function it(Q){L[G]=Q,++O!==P||I||(I=!0,l.resolve(j,L))}p.resolve(X).then(it,function(Q){I||(I=!0,l.reject(j,Q))})}}function d(u){var p=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var P=u.length,I=!1;if(!P)return this.resolve([]);for(var L=-1,O=new this(r);++L<P;)U(u[L]);return O;function U(j){p.resolve(j).then(function($){I||(I=!0,l.resolve(O,$))},function($){I||(I=!0,l.reject(O,$))})}}e.exports=C,C.prototype.catch=function(u){return this.then(null,u)},C.prototype.then=function(u,p){if(typeof u!="function"&&this.state===y||typeof p!="function"&&this.state===v)return this;var P=new this.constructor(r);return this.state!==S?_(P,this.state===y?u:p,this.outcome):this.queue.push(new z(P,u,p)),P},z.prototype.callFulfilled=function(u){l.resolve(this.promise,u)},z.prototype.otherCallFulfilled=function(u){_(this.promise,this.onFulfilled,u)},z.prototype.callRejected=function(u){l.reject(this.promise,u)},z.prototype.otherCallRejected=function(u){_(this.promise,this.onRejected,u)},l.resolve=function(u,p){var P=R(D,p);if(P.status==="error")return l.reject(u,P.value);var I=P.value;if(I)T(u,I);else{u.state=y,u.outcome=p;for(var L=-1,O=u.queue.length;++L<O;)u.queue[L].callFulfilled(p)}return u},l.reject=function(u,p){u.state=v,u.outcome=p;for(var P=-1,I=u.queue.length;++P<I;)u.queue[P].callRejected(p);return u},C.resolve=w,C.reject=c,C.all=h,C.race=d},{1:1}],3:[function(t,e,n){(function(i){typeof i.Promise!="function"&&(i.Promise=t(2))}).call(this,zt!==void 0?zt:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(t,e,n){var i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function r(o,s){if(!(o instanceof s))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch{return}}var v=l();function y(){try{if(!v||!v.open)return!1;var o=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),s=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!o||s)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch{return!1}}function S(o,s){o=o||[],s=s||{};try{return new Blob(o,s)}catch(f){if(f.name!=="TypeError")throw f;for(var a=new(typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder),m=0;m<o.length;m+=1)a.append(o[m]);return a.getBlob(s.type)}}typeof Promise=="undefined"&&t(3);var C=Promise;function z(o,s){s&&o.then(function(a){s(null,a)},function(a){s(a)})}function _(o,s,a){typeof s=="function"&&o.then(s),typeof a=="function"&&o.catch(a)}function D(o){return typeof o!="string"&&(console.warn(o+" used as a key, but it is not a string."),o=String(o)),o}function T(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",w=void 0,c={},h=Object.prototype.toString,d="readonly",u="readwrite";function p(o){for(var s=o.length,a=new ArrayBuffer(s),m=new Uint8Array(a),f=0;f<s;f++)m[f]=o.charCodeAt(f);return a}function P(o){return new C(function(s){var a=o.transaction(R,u),m=S([""]);a.objectStore(R).put(m,"key"),a.onabort=function(f){f.preventDefault(),f.stopPropagation(),s(!1)},a.oncomplete=function(){var f=navigator.userAgent.match(/Chrome\/(\d+)/),g=navigator.userAgent.match(/Edge\//);s(g||!f||parseInt(f[1],10)>=43)}}).catch(function(){return!1})}function I(o){return typeof w=="boolean"?C.resolve(w):P(o).then(function(s){return w=s})}function L(o){var s=c[o.name],a={};a.promise=new C(function(m,f){a.resolve=m,a.reject=f}),s.deferredOperations.push(a),s.dbReady?s.dbReady=s.dbReady.then(function(){return a.promise}):s.dbReady=a.promise}function O(o){var s=c[o.name].deferredOperations.pop();if(s)return s.resolve(),s.promise}function U(o,s){var a=c[o.name].deferredOperations.pop();if(a)return a.reject(s),a.promise}function j(o,s){return new C(function(a,m){if(c[o.name]=c[o.name]||qe(),o.db){if(!s)return a(o.db);L(o),o.db.close()}var f=[o.name];s&&f.push(o.version);var g=v.open.apply(v,f);s&&(g.onupgradeneeded=function(b){var x=g.result;try{x.createObjectStore(o.storeName),b.oldVersion<=1&&x.createObjectStore(R)}catch(E){if(E.name!=="ConstraintError")throw E;console.warn('The database "'+o.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+o.storeName+'" already exists.')}}),g.onerror=function(b){b.preventDefault(),m(g.error)},g.onsuccess=function(){var b=g.result;b.onversionchange=function(x){x.target.close()},a(b),O(o)}})}function $(o){return j(o,!1)}function X(o){return j(o,!0)}function G(o,s){if(!o.db)return!0;var a=!o.db.objectStoreNames.contains(o.storeName),m=o.version<o.db.version,f=o.version>o.db.version;if(m&&(o.version!==s&&console.warn('The database "'+o.name+`" can't be downgraded from version `+o.db.version+" to version "+o.version+"."),o.version=o.db.version),f||a){if(a){var g=o.db.version+1;g>o.version&&(o.version=g)}return!0}return!1}function it(o){return new C(function(s,a){var m=new FileReader;m.onerror=a,m.onloadend=function(f){var g=btoa(f.target.result||"");s({__local_forage_encoded_blob:!0,data:g,type:o.type})},m.readAsBinaryString(o)})}function Q(o){return S([p(atob(o.data))],{type:o.type})}function rt(o){return o&&o.__local_forage_encoded_blob}function se(o){var s=this,a=s._initReady().then(function(){var m=c[s._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return _(a,o,o),a}function ae(o){L(o);for(var s=c[o.name],a=s.forages,m=0;m<a.length;m++){var f=a[m];f._dbInfo.db&&(f._dbInfo.db.close(),f._dbInfo.db=null)}return o.db=null,$(o).then(function(g){return o.db=g,G(o)?X(o):g}).then(function(g){o.db=s.db=g;for(var b=0;b<a.length;b++)a[b]._dbInfo.db=g}).catch(function(g){throw U(o,g),g})}function st(o,s,a,m){m===void 0&&(m=1);try{var f=o.db.transaction(o.storeName,s);a(null,f)}catch(g){if(m>0&&(!o.db||g.name==="InvalidStateError"||g.name==="NotFoundError"))return C.resolve().then(function(){if(!o.db||g.name==="NotFoundError"&&!o.db.objectStoreNames.contains(o.storeName)&&o.version<=o.db.version)return o.db&&(o.version=o.db.version+1),X(o)}).then(function(){return ae(o).then(function(){st(o,s,a,m-1)})}).catch(a);a(g)}}function qe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Yn(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=o[m];var f=c[a.name];f||(f=qe(),c[a.name]=f),f.forages.push(s),s._initReady||(s._initReady=s.ready,s.ready=se);var g=[];function b(){return C.resolve()}for(var x=0;x<f.forages.length;x++){var E=f.forages[x];E!==s&&g.push(E._initReady().catch(b))}var k=f.forages.slice(0);return C.all(g).then(function(){return a.db=f.db,$(a)}).then(function(M){return a.db=M,G(a,s._defaultConfig.version)?X(a):M}).then(function(M){a.db=f.db=M,s._dbInfo=a;for(var A=0;A<k.length;A++){var N=k[A];N!==s&&(N._dbInfo.db=a.db,N._dbInfo.version=a.version)}})}function Jn(o,s){var a=this;o=D(o);var m=new C(function(f,g){a.ready().then(function(){st(a._dbInfo,d,function(b,x){if(b)return g(b);try{var E=x.objectStore(a._dbInfo.storeName).get(o);E.onsuccess=function(){var k=E.result;k===void 0&&(k=null),rt(k)&&(k=Q(k)),f(k)},E.onerror=function(){g(E.error)}}catch(k){g(k)}})}).catch(g)});return z(m,s),m}function Zn(o,s){var a=this,m=new C(function(f,g){a.ready().then(function(){st(a._dbInfo,d,function(b,x){if(b)return g(b);try{var E=x.objectStore(a._dbInfo.storeName).openCursor(),k=1;E.onsuccess=function(){var M=E.result;if(M){var A=M.value;rt(A)&&(A=Q(A));var N=o(A,M.key,k++);N!==void 0?f(N):M.continue()}else f()},E.onerror=function(){g(E.error)}}catch(M){g(M)}})}).catch(g)});return z(m,s),m}function Qn(o,s,a){var m=this;o=D(o);var f=new C(function(g,b){var x;m.ready().then(function(){return x=m._dbInfo,h.call(s)==="[object Blob]"?I(x.db).then(function(E){return E?s:it(s)}):s}).then(function(E){st(m._dbInfo,u,function(k,M){if(k)return b(k);try{var A=M.objectStore(m._dbInfo.storeName);E===null&&(E=void 0);var N=A.put(E,o);M.oncomplete=function(){E===void 0&&(E=null),g(E)},M.onabort=M.onerror=function(){var W=N.error?N.error:N.transaction.error;b(W)}}catch(W){b(W)}})}).catch(b)});return z(f,a),f}function ti(o,s){var a=this;o=D(o);var m=new C(function(f,g){a.ready().then(function(){st(a._dbInfo,u,function(b,x){if(b)return g(b);try{var E=x.objectStore(a._dbInfo.storeName).delete(o);x.oncomplete=function(){f()},x.onerror=function(){g(E.error)},x.onabort=function(){var k=E.error?E.error:E.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return z(m,s),m}function ei(o){var s=this,a=new C(function(m,f){s.ready().then(function(){st(s._dbInfo,u,function(g,b){if(g)return f(g);try{var x=b.objectStore(s._dbInfo.storeName).clear();b.oncomplete=function(){m()},b.onabort=b.onerror=function(){var E=x.error?x.error:x.transaction.error;f(E)}}catch(E){f(E)}})}).catch(f)});return z(a,o),a}function ni(o){var s=this,a=new C(function(m,f){s.ready().then(function(){st(s._dbInfo,d,function(g,b){if(g)return f(g);try{var x=b.objectStore(s._dbInfo.storeName).count();x.onsuccess=function(){m(x.result)},x.onerror=function(){f(x.error)}}catch(E){f(E)}})}).catch(f)});return z(a,o),a}function ii(o,s){var a=this,m=new C(function(f,g){o<0?f(null):a.ready().then(function(){st(a._dbInfo,d,function(b,x){if(b)return g(b);try{var E=x.objectStore(a._dbInfo.storeName),k=!1,M=E.openKeyCursor();M.onsuccess=function(){var A=M.result;A?o===0||k?f(A.key):(k=!0,A.advance(o)):f(null)},M.onerror=function(){g(M.error)}}catch(A){g(A)}})}).catch(g)});return z(m,s),m}function oi(o){var s=this,a=new C(function(m,f){s.ready().then(function(){st(s._dbInfo,d,function(g,b){if(g)return f(g);try{var x=b.objectStore(s._dbInfo.storeName).openKeyCursor(),E=[];x.onsuccess=function(){var k=x.result;k?(E.push(k.key),k.continue()):m(E)},x.onerror=function(){f(x.error)}}catch(k){f(k)}})}).catch(f)});return z(a,o),a}function ri(o,s){s=T.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;if(o.name){var g=o.name===a.name&&f._dbInfo.db?C.resolve(f._dbInfo.db):$(o).then(function(b){var x=c[o.name],E=x.forages;x.db=b;for(var k=0;k<E.length;k++)E[k]._dbInfo.db=b;return b});m=o.storeName?g.then(function(b){if(b.objectStoreNames.contains(o.storeName)){var x=b.version+1;L(o);var E=c[o.name],k=E.forages;b.close();for(var M=0;M<k.length;M++){var A=k[M];A._dbInfo.db=null,A._dbInfo.version=x}return new C(function(N,W){var F=v.open(o.name,x);F.onerror=function(ot){F.result.close(),W(ot)},F.onupgradeneeded=function(){F.result.deleteObjectStore(o.storeName)},F.onsuccess=function(){var ot=F.result;ot.close(),N(ot)}}).then(function(N){E.db=N;for(var W=0;W<k.length;W++){var F=k[W];F._dbInfo.db=N,O(F._dbInfo)}}).catch(function(N){throw(U(o,N)||C.resolve()).catch(function(){}),N})}}):g.then(function(b){L(o);var x=c[o.name],E=x.forages;b.close();for(var k=0;k<E.length;k++)E[k]._dbInfo.db=null;return new C(function(M,A){var N=v.deleteDatabase(o.name);N.onerror=function(){var W=N.result;W&&W.close(),A(N.error)},N.onblocked=function(){console.warn('dropInstance blocked for database "'+o.name+'" until all open connections are closed')},N.onsuccess=function(){var W=N.result;W&&W.close(),M(W)}}).then(function(M){x.db=M;for(var A=0;A<E.length;A++)O(E[A]._dbInfo)}).catch(function(M){throw(U(o,M)||C.resolve()).catch(function(){}),M})})}else m=C.reject("Invalid arguments");return z(m,s),m}var si={_driver:"asyncStorage",_initStorage:Yn,_support:y(),iterate:Zn,getItem:Jn,setItem:Qn,removeItem:ti,clear:ei,length:ni,key:ii,keys:oi,dropInstance:ri};function ai(){return typeof openDatabase=="function"}var lt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ci="~~local_forage_type~",Xe=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",ce=Ot.length,ue="arbf",le="blob",Ge="si08",Ve="ui08",Ke="uic8",Ye="si16",Je="si32",Ze="ur16",Qe="ui32",tn="fl32",en="fl64",nn=ce+ue.length,on=Object.prototype.toString;function rn(o){var s,a,m,f,g,b=.75*o.length,x=o.length,E=0;o[o.length-1]==="="&&(b--,o[o.length-2]==="="&&b--);var k=new ArrayBuffer(b),M=new Uint8Array(k);for(s=0;s<x;s+=4)a=lt.indexOf(o[s]),m=lt.indexOf(o[s+1]),f=lt.indexOf(o[s+2]),g=lt.indexOf(o[s+3]),M[E++]=a<<2|m>>4,M[E++]=(15&m)<<4|f>>2,M[E++]=(3&f)<<6|63&g;return k}function he(o){var s,a=new Uint8Array(o),m="";for(s=0;s<a.length;s+=3)m+=lt[a[s]>>2],m+=lt[(3&a[s])<<4|a[s+1]>>4],m+=lt[(15&a[s+1])<<2|a[s+2]>>6],m+=lt[63&a[s+2]];return a.length%3==2?m=m.substring(0,m.length-1)+"=":a.length%3==1&&(m=m.substring(0,m.length-2)+"=="),m}function ui(o,s){var a="";if(o&&(a=on.call(o)),o&&(a==="[object ArrayBuffer]"||o.buffer&&on.call(o.buffer)==="[object ArrayBuffer]")){var m,f=Ot;o instanceof ArrayBuffer?(m=o,f+=ue):(m=o.buffer,a==="[object Int8Array]"?f+=Ge:a==="[object Uint8Array]"?f+=Ve:a==="[object Uint8ClampedArray]"?f+=Ke:a==="[object Int16Array]"?f+=Ye:a==="[object Uint16Array]"?f+=Ze:a==="[object Int32Array]"?f+=Je:a==="[object Uint32Array]"?f+=Qe:a==="[object Float32Array]"?f+=tn:a==="[object Float64Array]"?f+=en:s(new Error("Failed to get type for BinaryArray"))),s(f+he(m))}else if(a==="[object Blob]"){var g=new FileReader;g.onload=function(){var b=ci+o.type+"~"+he(this.result);s(Ot+le+b)},g.readAsArrayBuffer(o)}else try{s(JSON.stringify(o))}catch(b){console.error("Couldn't convert value into a JSON string: ",o),s(null,b)}}function li(o){if(o.substring(0,ce)!==Ot)return JSON.parse(o);var s,a=o.substring(nn),m=o.substring(ce,nn);if(m===le&&Xe.test(a)){var f=a.match(Xe);s=f[1],a=a.substring(f[0].length)}var g=rn(a);switch(m){case ue:return g;case le:return S([g],{type:s});case Ge:return new Int8Array(g);case Ve:return new Uint8Array(g);case Ke:return new Uint8ClampedArray(g);case Ye:return new Int16Array(g);case Ze:return new Uint16Array(g);case Je:return new Int32Array(g);case Qe:return new Uint32Array(g);case tn:return new Float32Array(g);case en:return new Float64Array(g);default:throw new Error("Unkown type: "+m)}}var de={serialize:ui,deserialize:li,stringToBuffer:rn,bufferToString:he};function sn(o,s,a,m){o.executeSql("CREATE TABLE IF NOT EXISTS "+s.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],a,m)}function hi(o){var s=this,a={db:null};if(o)for(var m in o)a[m]=typeof o[m]!="string"?o[m].toString():o[m];var f=new C(function(g,b){try{a.db=openDatabase(a.name,String(a.version),a.description,a.size)}catch(x){return b(x)}a.db.transaction(function(x){sn(x,a,function(){s._dbInfo=a,g()},function(E,k){b(k)})},b)});return a.serializer=de,f}function ht(o,s,a,m,f,g){o.executeSql(a,m,f,function(b,x){x.code===x.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[s.storeName],function(E,k){k.rows.length?g(E,x):sn(E,s,function(){E.executeSql(a,m,f,g)},g)},g):g(b,x)},g)}function di(o,s){var a=this;o=D(o);var m=new C(function(f,g){a.ready().then(function(){var b=a._dbInfo;b.db.transaction(function(x){ht(x,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[o],function(E,k){var M=k.rows.length?k.rows.item(0).value:null;M&&(M=b.serializer.deserialize(M)),f(M)},function(E,k){g(k)})})}).catch(g)});return z(m,s),m}function fi(o,s){var a=this,m=new C(function(f,g){a.ready().then(function(){var b=a._dbInfo;b.db.transaction(function(x){ht(x,b,"SELECT * FROM "+b.storeName,[],function(E,k){for(var M=k.rows,A=M.length,N=0;N<A;N++){var W=M.item(N),F=W.value;if(F&&(F=b.serializer.deserialize(F)),(F=o(F,W.key,N+1))!==void 0)return void f(F)}f()},function(E,k){g(k)})})}).catch(g)});return z(m,s),m}function an(o,s,a,m){var f=this;o=D(o);var g=new C(function(b,x){f.ready().then(function(){s===void 0&&(s=null);var E=s,k=f._dbInfo;k.serializer.serialize(s,function(M,A){A?x(A):k.db.transaction(function(N){ht(N,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[o,M],function(){b(E)},function(W,F){x(F)})},function(N){if(N.code===N.QUOTA_ERR){if(m>0)return void b(an.apply(f,[o,E,a,m-1]));x(N)}})})}).catch(x)});return z(g,a),g}function pi(o,s,a){return an.apply(this,[o,s,a,1])}function mi(o,s){var a=this;o=D(o);var m=new C(function(f,g){a.ready().then(function(){var b=a._dbInfo;b.db.transaction(function(x){ht(x,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[o],function(){f()},function(E,k){g(k)})})}).catch(g)});return z(m,s),m}function gi(o){var s=this,a=new C(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(b){ht(b,g,"DELETE FROM "+g.storeName,[],function(){m()},function(x,E){f(E)})})}).catch(f)});return z(a,o),a}function vi(o){var s=this,a=new C(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(b){ht(b,g,"SELECT COUNT(key) as c FROM "+g.storeName,[],function(x,E){var k=E.rows.item(0).c;m(k)},function(x,E){f(E)})})}).catch(f)});return z(a,o),a}function yi(o,s){var a=this,m=new C(function(f,g){a.ready().then(function(){var b=a._dbInfo;b.db.transaction(function(x){ht(x,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[o+1],function(E,k){var M=k.rows.length?k.rows.item(0).key:null;f(M)},function(E,k){g(k)})})}).catch(g)});return z(m,s),m}function wi(o){var s=this,a=new C(function(m,f){s.ready().then(function(){var g=s._dbInfo;g.db.transaction(function(b){ht(b,g,"SELECT key FROM "+g.storeName,[],function(x,E){for(var k=[],M=0;M<E.rows.length;M++)k.push(E.rows.item(M).key);m(k)},function(x,E){f(E)})})}).catch(f)});return z(a,o),a}function bi(o){return new C(function(s,a){o.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(f,g){for(var b=[],x=0;x<g.rows.length;x++)b.push(g.rows.item(x).name);s({db:o,storeNames:b})},function(f,g){a(g)})},function(m){a(m)})})}function Si(o,s){s=T.apply(this,arguments);var a=this.config();(o=typeof o!="function"&&o||{}).name||(o.name=o.name||a.name,o.storeName=o.storeName||a.storeName);var m,f=this;return z(m=o.name?new C(function(g){var b;b=o.name===a.name?f._dbInfo.db:openDatabase(o.name,"","",0),o.storeName?g({db:b,storeNames:[o.storeName]}):g(bi(b))}).then(function(g){return new C(function(b,x){g.db.transaction(function(E){function k(W){return new C(function(F,ot){E.executeSql("DROP TABLE IF EXISTS "+W,[],function(){F()},function(hn,Rt){ot(Rt)})})}for(var M=[],A=0,N=g.storeNames.length;A<N;A++)M.push(k(g.storeNames[A]));C.all(M).then(function(){b()}).catch(function(W){x(W)})},function(E){x(E)})})}):C.reject("Invalid arguments"),s),m}var Ci={_driver:"webSQLStorage",_initStorage:hi,_support:ai(),iterate:fi,getItem:di,setItem:pi,removeItem:mi,clear:gi,length:vi,key:yi,keys:wi,dropInstance:Si};function xi(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function cn(o,s){var a=o.name+"/";return o.storeName!==s.storeName&&(a+=o.storeName+"/"),a}function Ei(){var o="_localforage_support_test";try{return localStorage.setItem(o,!0),localStorage.removeItem(o),!1}catch{return!0}}function ki(){return!Ei()||localStorage.length>0}function zi(o){var s=this,a={};if(o)for(var m in o)a[m]=o[m];return a.keyPrefix=cn(o,s._defaultConfig),ki()?(s._dbInfo=a,a.serializer=de,C.resolve()):C.reject()}function _i(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo.keyPrefix,f=localStorage.length-1;f>=0;f--){var g=localStorage.key(f);g.indexOf(m)===0&&localStorage.removeItem(g)}});return z(a,o),a}function Mi(o,s){var a=this;o=D(o);var m=a.ready().then(function(){var f=a._dbInfo,g=localStorage.getItem(f.keyPrefix+o);return g&&(g=f.serializer.deserialize(g)),g});return z(m,s),m}function Ii(o,s){var a=this,m=a.ready().then(function(){for(var f=a._dbInfo,g=f.keyPrefix,b=g.length,x=localStorage.length,E=1,k=0;k<x;k++){var M=localStorage.key(k);if(M.indexOf(g)===0){var A=localStorage.getItem(M);if(A&&(A=f.serializer.deserialize(A)),(A=o(A,M.substring(b),E++))!==void 0)return A}}});return z(m,s),m}function Li(o,s){var a=this,m=a.ready().then(function(){var f,g=a._dbInfo;try{f=localStorage.key(o)}catch{f=null}return f&&(f=f.substring(g.keyPrefix.length)),f});return z(m,s),m}function Pi(o){var s=this,a=s.ready().then(function(){for(var m=s._dbInfo,f=localStorage.length,g=[],b=0;b<f;b++){var x=localStorage.key(b);x.indexOf(m.keyPrefix)===0&&g.push(x.substring(m.keyPrefix.length))}return g});return z(a,o),a}function Ri(o){var s=this.keys().then(function(a){return a.length});return z(s,o),s}function Ai(o,s){var a=this;o=D(o);var m=a.ready().then(function(){var f=a._dbInfo;localStorage.removeItem(f.keyPrefix+o)});return z(m,s),m}function Bi(o,s,a){var m=this;o=D(o);var f=m.ready().then(function(){s===void 0&&(s=null);var g=s;return new C(function(b,x){var E=m._dbInfo;E.serializer.serialize(s,function(k,M){if(M)x(M);else try{localStorage.setItem(E.keyPrefix+o,k),b(g)}catch(A){A.name!=="QuotaExceededError"&&A.name!=="NS_ERROR_DOM_QUOTA_REACHED"||x(A),x(A)}})})});return z(f,a),f}function Di(o,s){if(s=T.apply(this,arguments),!(o=typeof o!="function"&&o||{}).name){var a=this.config();o.name=o.name||a.name,o.storeName=o.storeName||a.storeName}var m,f=this;return z(m=o.name?new C(function(g){o.storeName?g(cn(o,f._defaultConfig)):g(o.name+"/")}).then(function(g){for(var b=localStorage.length-1;b>=0;b--){var x=localStorage.key(b);x.indexOf(g)===0&&localStorage.removeItem(x)}}):C.reject("Invalid arguments"),s),m}var Ti={_driver:"localStorageWrapper",_initStorage:zi,_support:xi(),iterate:Ii,getItem:Mi,setItem:Bi,removeItem:Ai,clear:_i,length:Ri,key:Li,keys:Pi,dropInstance:Di},Ni=function(o,s){return o===s||typeof o=="number"&&typeof s=="number"&&isNaN(o)&&isNaN(s)},Oi=function(o,s){for(var a=o.length,m=0;m<a;){if(Ni(o[m],s))return!0;m++}return!1},un=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"},Pt={},ln={},xt={INDEXEDDB:si,WEBSQL:Ci,LOCALSTORAGE:Ti},Ui=[xt.INDEXEDDB._driver,xt.WEBSQL._driver,xt.LOCALSTORAGE._driver],Ut=["dropInstance"],fe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ut),ji={description:"",driver:Ui.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Wi(o,s){o[s]=function(){var a=arguments;return o.ready().then(function(){return o[s].apply(o,a)})}}function pe(){for(var o=1;o<arguments.length;o++){var s=arguments[o];if(s)for(var a in s)s.hasOwnProperty(a)&&(un(s[a])?arguments[0][a]=s[a].slice():arguments[0][a]=s[a])}return arguments[0]}var Fi=new(function(){function o(s){for(var a in r(this,o),xt)if(xt.hasOwnProperty(a)){var m=xt[a],f=m._driver;this[a]=f,Pt[f]||this.defineDriver(m)}this._defaultConfig=pe({},ji),this._config=pe({},this._defaultConfig,s),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return o.prototype.config=function(s){if((s===void 0?"undefined":i(s))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var a in s){if(a==="storeName"&&(s[a]=s[a].replace(/\W/g,"_")),a==="version"&&typeof s[a]!="number")return new Error("Database version must be a number.");this._config[a]=s[a]}return!("driver"in s)||!s.driver||this.setDriver(this._config.driver)}return typeof s=="string"?this._config[s]:this._config},o.prototype.defineDriver=function(s,a,m){var f=new C(function(g,b){try{var x=s._driver,E=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!s._driver)return void b(E);for(var k=fe.concat("_initStorage"),M=0,A=k.length;M<A;M++){var N=k[M];if((!Oi(Ut,N)||s[N])&&typeof s[N]!="function")return void b(E)}(function(){for(var F=function($i){return function(){var Hi=new Error("Method "+$i+" is not implemented by the current driver"),dn=C.reject(Hi);return z(dn,arguments[arguments.length-1]),dn}},ot=0,hn=Ut.length;ot<hn;ot++){var Rt=Ut[ot];s[Rt]||(s[Rt]=F(Rt))}})();var W=function(F){Pt[x]&&console.info("Redefining LocalForage driver: "+x),Pt[x]=s,ln[x]=F,g()};"_support"in s?s._support&&typeof s._support=="function"?s._support().then(W,b):W(!!s._support):W(!0)}catch(F){b(F)}});return _(f,a,m),f},o.prototype.driver=function(){return this._driver||null},o.prototype.getDriver=function(s,a,m){var f=Pt[s]?C.resolve(Pt[s]):C.reject(new Error("Driver not found."));return _(f,a,m),f},o.prototype.getSerializer=function(s){var a=C.resolve(de);return _(a,s),a},o.prototype.ready=function(s){var a=this,m=a._driverSet.then(function(){return a._ready===null&&(a._ready=a._initDriver()),a._ready});return _(m,s,s),m},o.prototype.setDriver=function(s,a,m){var f=this;un(s)||(s=[s]);var g=this._getSupportedDrivers(s);function b(){f._config.driver=f.driver()}function x(M){return f._extend(M),b(),f._ready=f._initStorage(f._config),f._ready}function E(M){return function(){var A=0;function N(){for(;A<M.length;){var W=M[A];return A++,f._dbInfo=null,f._ready=null,f.getDriver(W).then(x).catch(N)}b();var F=new Error("No available storage method found.");return f._driverSet=C.reject(F),f._driverSet}return N()}}var k=this._driverSet!==null?this._driverSet.catch(function(){return C.resolve()}):C.resolve();return this._driverSet=k.then(function(){var M=g[0];return f._dbInfo=null,f._ready=null,f.getDriver(M).then(function(A){f._driver=A._driver,b(),f._wrapLibraryMethodsWithReady(),f._initDriver=E(g)})}).catch(function(){b();var M=new Error("No available storage method found.");return f._driverSet=C.reject(M),f._driverSet}),_(this._driverSet,a,m),this._driverSet},o.prototype.supports=function(s){return!!ln[s]},o.prototype._extend=function(s){pe(this,s)},o.prototype._getSupportedDrivers=function(s){for(var a=[],m=0,f=s.length;m<f;m++){var g=s[m];this.supports(g)&&a.push(g)}return a},o.prototype._wrapLibraryMethodsWithReady=function(){for(var s=0,a=fe.length;s<a;s++)Wi(this,fe[s])},o.prototype.createInstance=function(s){return new o(s)},o}());e.exports=Fi},{3:3}]},{},[4])(4),Nn={exports:{}};/*!
|
|
3
3
|
localForage -- Offline Storage, Improved
|
|
4
4
|
Version 1.10.0
|
|
5
5
|
https://localforage.github.io/localForage
|
|
6
6
|
(c) 2013-2017 Mozilla, Apache License 2.0
|
|
7
|
-
*/(function(t){zn.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 a=e.WebStreamsPolyfill||{},l=e.isSecureContext;let g=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const b=l||"MozAppearance"in document.documentElement.style?"iframe":"navigate",S={createWriteStream:function(z,P,D){let B={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},A=0,y=null,c=null,h=null;if(Number.isFinite(P)?([D,P]=[P,D],console.warn("[StreamSaver] Depricated pass an object as 2nd argument when creating a write stream"),B.size=D,B.writableStrategy=P):P&&P.highWaterMark?(console.warn("[StreamSaver] Depricated pass an object as 2nd argument when creating a write stream"),B.size=D,B.writableStrategy=P):B=P||{},!g){n||(n=l?C(S.mitm):function(R){const I="width=200,height=100",M=document.createDocumentFragment(),O={frame:e.open(R,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){O.frame.close()},addEventListener(...U){M.addEventListener(...U)},dispatchEvent(...U){M.dispatchEvent(...U)},removeEventListener(...U){M.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}(S.mitm)),c=new MessageChannel,z=encodeURIComponent(z.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const u={transferringReadable:i,pathname:B.pathname||Math.random().toString().slice(-6)+"/"+z,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+z}};B.size&&(u.headers["Content-Length"]=B.size);const p=[u,"*",[c.port2]];if(i){const R=b==="iframe"?void 0:{transform(M,O){if(!(M instanceof Uint8Array))throw new TypeError("Can only wirte Uint8Arrays");A+=M.length,O.enqueue(M),y&&(location.href=y,y=null)},flush(){y&&(location.href=y)}};h=new S.TransformStream(R,B.writableStrategy,B.readableStrategy);const I=h.readable;c.port1.postMessage({readableStream:I},[I])}c.port1.onmessage=R=>{R.data.download&&(b==="navigate"?(n.remove(),n=null,A?location.href=R.data.download:y=R.data.download):(n.isPopup&&(n.remove(),n=null,b==="iframe"&&C(S.mitm)),C(R.data.download)))},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let d=[];return!g&&h&&h.writable||new S.WritableStream({write(u){if(!(u instanceof Uint8Array))throw new TypeError("Can only wirte Uint8Arrays");g?d.push(u):(c.port1.postMessage(u),A+=u.length,y&&(location.href=y,y=null))},close(){if(g){const u=new Blob(d,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(u),p.download=z,p.click()}else c.port1.postMessage("end")},abort(){d=[],c.port1.postMessage("abort"),c.port1.onmessage=null,c.port1.close(),c.port2.close(),c=null}},B.writableStrategy)},WritableStream:e.WritableStream||a.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 C(z){if(!z)throw new Error("meh");const P=document.createElement("iframe");return P.hidden=!0,P.src=z,P.loaded=!1,P.name="iframe",P.isIframe=!0,P.postMessage=(...D)=>P.contentWindow.postMessage(...D),P.addEventListener("load",()=>{P.loaded=!0},{once:!0}),document.body.appendChild(P),P}try{new Response(new ReadableStream),l&&!("serviceWorker"in navigator)&&(g=!0)}catch{g=!0}return(z=>{try{z()}catch{}})(()=>{const{readable:z}=new TransformStream,P=new MessageChannel;P.port1.postMessage(z,[z]),P.port1.close(),P.port2.close(),i=!0,Object.defineProperty(S,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),S})()})();var jr=zn.exports;class Ur{constructor(e,n,i=5){this.ChunkUnitM=1048576,this.totalChunks=1,this.fileMetaData=null,this.finishNum=0,this.isStarting=!1,this.fileID=e,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=ve(),this.initIndexDB()}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 a=await it(n,e);let l=null;return a&&a.status===200&&(l=a.data),l}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=Bt.createInstance({name:this.fileID,driver:Bt.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(),Bt.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")}download(e){e&&(this.downloadURL=e);const n=this.downloadURL;if(!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const i=N.Axios.CancelToken;this.cancelSource=i.source(),this.isStarting=!0;const a={key:this.fileMetaData?.downloadID};let l=0;for(let g=0;g<this.totalChunks;g++){if(this.keys&&this.keys?.indexOf(g.toString())>=0){l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());continue}const b=g*this.chunkByteSize;let S=b+this.chunkByteSize-1;this.fileMetaData&&S>this.fileMetaData.length&&(S=this.fileMetaData.length-1);const C={range:`bytes=${b}-${S}`},z=g.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${g+1}/${this.totalChunks}`),it("",n,a,C,"arraybuffer",this.cancelSource?.token).then(P=>{const D=P.data;this.currentDB?.setItem(z,D),l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());const B=parseInt(z)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${B}/${this.totalChunks}`),this.savefile()})}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");const e=jr.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const a=i.toString(),l=await this.currentDB?.getItem(a);let g=new Response(l).body;if(g===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u9519\u8BEF\uFF0C\u9000\u51FA\uFF01`);const b=g.getReader();for(;;){const{done:S,value:C}=await b.read();if(S)break;e.write(C)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),Bt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const Fr=Object.prototype.toString;function X(t,e){return Fr.call(t)===`[object ${e}]`}function ze(t){return X(t,"Function")}const _n=t=>t!==void 0,_e=t=>!_n(t);function Ie(t){return t===null}function $r(t){return _e(t)&&Ie(t)}function Hr(t){return _e(t)||Ie(t)}const It=t=>t!==null&&X(t,"Object");function Wr(t){return X(t,"Date")}function qr(t){return X(t,"Number")}function Xr(t){return X(t,"AsyncFunction")}function Gr(t){return X(t,"Promise")&&It(t)&&ze(t.then)&&ze(t.catch)}function In(t){return X(t,"String")}function Vr(t){return t===!0||t===!1||X(t,"Boolean")}function Pn(t){return t&&Array.isArray(t)}const Kr=()=>typeof window!="undefined",Yr=t=>typeof window!="undefined"&&X(t,"Window"),Jr=t=>It(t)&&!!t.tagName,Zr=typeof window=="undefined";function Qr(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function to(t){return t==null||(In(t)||Pn(t)?t.length===0:!!It(t)&&JSON.stringify(t)==="{}")}function eo(t){return X(t,"Error")}function no(t){return X(t,"WeakSet")}function io(t){return X(t,"WeakMap")}function ro(t){return X(t,"Symbol")}function oo(t){return X(t,"Map")}const so=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 ao(t,e){let n="",i="";for(const a in e)n+=a+"="+encodeURIComponent(e[a])+"&";return n=n.replace(/&$/,""),i=/\?$/.test(t)?t+n:t.replace(/\/?$/,"?")+n,i}function Mn(t={},e={}){let n;for(n in e)t[n]=It(t[n])?Mn(t[n],e[n]):t[n]=e[n];return t}const G=Ni({panelGroups:{}}),Rn=()=>({useGroupAccordion:t=>dt(()=>G.panelGroups[t].accordion),setGroupAccordionStatus:(t,e)=>{G.panelGroups[t]={...G.panelGroups[t],accordion:e}},panelExpanded:(t,e)=>dt(()=>G.panelGroups[t]?.panelExpandStatus?.[e]||!1),setPanelExpandedStatus:(t,e,n)=>{G.panelGroups[t]={...G.panelGroups[t],panelExpandStatus:{...G.panelGroups[t]?.panelExpandStatus||{},[e]:n}}},togglePanelExpandedStatus:(t,e)=>{G.panelGroups[t].accordion&&(G.panelGroups[t].panelExpandStatus[e]||Object.keys(G.panelGroups[t].panelExpandStatus).forEach(n=>{G.panelGroups[t].panelExpandStatus[n]=!1})),G.panelGroups[t].panelExpandStatus[e]=!G.panelGroups[t].panelExpandStatus[e]}}),Pe=t=>t>255?255:t<0?0:t,Ot=(t,e)=>{const n=t.replace("#",""),i=parseInt(n,16),a=Pe((i>>16)+e),l=Pe((i>>8&255)+e);return"#"+(Pe((255&i)+e)|l<<8|a<<16).toString(16)};var jt=At({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(t){const e=J(`group-${Dt()}`),{setGroupAccordionStatus:n}=Rn(),i={"--base-color":t.baseColor,"--border-color":Ot(t.baseColor,180),"--bg-color-header":Ot(t.baseColor,140),"--bg-color-header-hover":Ot(t.baseColor,190),"--bg-color-header-active":Ot(t.baseColor,200),"--bg-color-body":"#fff"};return n(e.value,t.accordion),{idGroup:e,cssColorVars:i}}});const co=["data-id-group"];jt.render=function(t,e,n,i,a,l){return et(),ht("div",{"data-id-group":t.idGroup,style:gt(t.cssColorVars),class:"vcpg"},[at(t.$slots,"default")],12,co)},jt.__scopeId="data-v-23ab5317",jt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Ut=At({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(t,e){const n=`panel-${Dt()}`,i=J(),a=J(),l=J(),{panelExpanded:g,togglePanelExpandedStatus:b,setPanelExpandedStatus:S}=Rn(),C=dt(()=>({hasContent:e.slots.content&&e.slots.content()[0].children.length>0,dataKey:Dt()})),z=dt(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),P=dt(()=>g(z.value,n).value&&C.value.hasContent);return on(()=>{S(z.value,n,t.expanded)}),Bi(()=>{(async()=>{await sn(),a.value&&l.value&&(a.value.style.height=`${Math.min(l.value.scrollHeight,a.value.scrollHeight)}px`)})()}),{body:C,panelRef:i,bodyRef:a,bodyContentRef:l,isExpanded:P,collapse:D=>{D.style.height="0"},expand:D=>{D.style.height=`${D.scrollHeight}px`},toggle:()=>{C.value.hasContent&&b(z.value,n)},toggleIcon:`
|
|
7
|
+
*/(function(t){Nn.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||{},l=e.isSecureContext;let v=/constructor/i.test(e.HTMLElement)||!!e.safari||!!e.WebKitPoint;const y=l||"MozAppearance"in document.documentElement.style?"iframe":"navigate",S={createWriteStream:function(z,_,D){let T={size:null,pathname:null,writableStrategy:void 0,readableStrategy:void 0},R=0,w=null,c=null,h=null;if(Number.isFinite(_)?([D,_]=[_,D],console.warn("[StreamSaver] Depricated pass an object as 2nd argument when creating a write stream"),T.size=D,T.writableStrategy=_):_&&_.highWaterMark?(console.warn("[StreamSaver] Depricated pass an object as 2nd argument when creating a write stream"),T.size=D,T.writableStrategy=_):T=_||{},!v){n||(n=l?C(S.mitm):function(P){const I="width=200,height=100",L=document.createDocumentFragment(),O={frame:e.open(P,"popup",I),loaded:!1,isIframe:!1,isPopup:!0,remove(){O.frame.close()},addEventListener(...j){L.addEventListener(...j)},dispatchEvent(...j){L.dispatchEvent(...j)},removeEventListener(...j){L.removeEventListener(...j)},postMessage(...j){O.frame.postMessage(...j)}},U=j=>{j.source===O.frame&&(O.loaded=!0,e.removeEventListener("message",U),O.dispatchEvent(new Event("load")))};return e.addEventListener("message",U),O}(S.mitm)),c=new MessageChannel,z=encodeURIComponent(z.replace(/\//g,":")).replace(/['()]/g,escape).replace(/\*/g,"%2A");const u={transferringReadable:i,pathname:T.pathname||Math.random().toString().slice(-6)+"/"+z,headers:{"Content-Type":"application/octet-stream; charset=utf-8","Content-Disposition":"attachment; filename*=UTF-8''"+z}};T.size&&(u.headers["Content-Length"]=T.size);const p=[u,"*",[c.port2]];if(i){const P=y==="iframe"?void 0:{transform(L,O){if(!(L instanceof Uint8Array))throw new TypeError("Can only wirte Uint8Arrays");R+=L.length,O.enqueue(L),w&&(location.href=w,w=null)},flush(){w&&(location.href=w)}};h=new S.TransformStream(P,T.writableStrategy,T.readableStrategy);const I=h.readable;c.port1.postMessage({readableStream:I},[I])}c.port1.onmessage=P=>{P.data.download&&(y==="navigate"?(n.remove(),n=null,R?location.href=P.data.download:w=P.data.download):(n.isPopup&&(n.remove(),n=null,y==="iframe"&&C(S.mitm)),C(P.data.download)))},n.loaded?n.postMessage(...p):n.addEventListener("load",()=>{n.postMessage(...p)},{once:!0})}let d=[];return!v&&h&&h.writable||new S.WritableStream({write(u){if(!(u instanceof Uint8Array))throw new TypeError("Can only wirte Uint8Arrays");v?d.push(u):(c.port1.postMessage(u),R+=u.length,w&&(location.href=w,w=null))},close(){if(v){const u=new Blob(d,{type:"application/octet-stream; charset=utf-8"}),p=document.createElement("a");p.href=URL.createObjectURL(u),p.download=z,p.click()}else c.port1.postMessage("end")},abort(){d=[],c.port1.postMessage("abort"),c.port1.onmessage=null,c.port1.close(),c.port2.close(),c=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 C(z){if(!z)throw new Error("meh");const _=document.createElement("iframe");return _.hidden=!0,_.src=z,_.loaded=!1,_.name="iframe",_.isIframe=!0,_.postMessage=(...D)=>_.contentWindow.postMessage(...D),_.addEventListener("load",()=>{_.loaded=!0},{once:!0}),document.body.appendChild(_),_}try{new Response(new ReadableStream),l&&!("serviceWorker"in navigator)&&(v=!0)}catch{v=!0}return(z=>{try{z()}catch{}})(()=>{const{readable:z}=new TransformStream,_=new MessageChannel;_.port1.postMessage(z,[z]),_.port1.close(),_.port2.close(),i=!0,Object.defineProperty(S,"TransformStream",{configurable:!1,writable:!1,value:TransformStream})}),S})()})();var Go=Nn.exports;class Vo{constructor(e,n,i=5){this.ChunkUnitM=1048576,this.totalChunks=1,this.fileMetaData=null,this.finishNum=0,this.isStarting=!1,this.fileID=e,this.downloadURL=n,this.chunkByteSize=i*this.ChunkUnitM,this.eventTarget=xe(),this.initIndexDB()}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 ct(n,e,i);let l=null;return r&&r.status===200&&(l=r.data),l}async getIFileMeta(){if(this.fileMetaData===null){const e=await this.currentDB?.getItem("fileinfo");this.fileMetaData=e||null}return this.fileMetaData}initIndexDB(){this.currentDB=qt.createInstance({name:this.fileID,driver:qt.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(),qt.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")}download(e){e&&(this.downloadURL=e);const n=this.downloadURL;if(!n)throw Error("\u4E0B\u8F7DURL\u4E0D\u80FD\u4E3A\u7A7A!");this.currentDB||this.initIndexDB();const i=B.Axios.CancelToken;this.cancelSource=i.source(),this.isStarting=!0;const r={key:this.fileMetaData?.downloadID};let l=0;for(let v=0;v<this.totalChunks;v++){if(this.keys&&this.keys?.indexOf(v.toString())>=0){l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());continue}const y=v*this.chunkByteSize;let S=y+this.chunkByteSize-1;this.fileMetaData&&S>this.fileMetaData.length&&(S=this.fileMetaData.length-1);const C={range:`bytes=${y}-${S}`},z=v.toString();this.dispatchInfo(`\u5F00\u59CB\u4E0B\u8F7D\u5206\u7247${v+1}/${this.totalChunks}`),ct("",n,r,C,"arraybuffer",this.cancelSource?.token).then(_=>{const D=_.data;this.currentDB?.setItem(z,D),l++,l>this.finishNum&&(this.finishNum=l,this.downloadProgress());const T=parseInt(z)+1;this.dispatchInfo(`\u5B8C\u6210\u4E0B\u8F7D\u5206\u7247${T}/${this.totalChunks}`),this.savefile()})}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");const e=Go.createWriteStream(this.fileName).getWriter();let n=0;for(let i=0;i<this.totalChunks;i++){const r=i.toString(),l=await this.currentDB?.getItem(r);let v=new Response(l).body;if(v===null)return void this.dispatchError(`\u8F93\u51FA\u5206\u7247\u7B2C${i+1}\uFF09\u4E2A\u9519\u8BEF\uFF0C\u9000\u51FA\uFF01`);const y=v.getReader();for(;;){const{done:S,value:C}=await y.read();if(S)break;e.write(C)}n++,this.outputProgress(n),this.dispatchInfo(`\u5B8C\u6210\u7B2C${i+1}\u4E2A\u5206\u7247\u8F93\u51FA`)}e.close(),qt.dropInstance({name:this.fileID}),this.dispatch("success"),this.isStarting=!1,this.dispatchInfo("\u5B8C\u6210\u6587\u4EF6\u4E0B\u8F7D")}}}const Ko=Object.prototype.toString;function Y(t,e){return Ko.call(t)===`[object ${e}]`}function Ae(t){return Y(t,"Function")}const On=t=>t!==void 0,Be=t=>!On(t);function De(t){return t===null}function Yo(t){return Be(t)&&De(t)}function Jo(t){return Be(t)||De(t)}const St=t=>t!==null&&Y(t,"Object");function Zo(t){return Y(t,"Date")}function Qo(t){return Y(t,"Number")}function tr(t){return Y(t,"AsyncFunction")}function er(t){return Y(t,"Promise")&&St(t)&&Ae(t.then)&&Ae(t.catch)}function Xt(t){return Y(t,"String")}function nr(t){return t===!0||t===!1||Y(t,"Boolean")}function Un(t){return t&&Array.isArray(t)}const ir=()=>typeof window!="undefined",or=t=>typeof window!="undefined"&&Y(t,"Window"),rr=t=>St(t)&&!!t.tagName,sr=typeof window=="undefined";function ar(t){return t&&["IMAGE","IMG"].includes(t.tagName)}function cr(t){return t==null||(Xt(t)||Un(t)?t.length===0:!!St(t)&&JSON.stringify(t)==="{}")}function ur(t){return Y(t,"Error")}function lr(t){return Y(t,"WeakSet")}function hr(t){return Y(t,"WeakMap")}function dr(t){return Y(t,"Symbol")}function fr(t){return Y(t,"Map")}const pr=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 mr(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 jn(t={},e={}){let n;for(n in e)t[n]=St(t[n])?jn(t[n],e[n]):t[n]=e[n];return t}const J=fn({panelGroups:{}}),Wn=()=>({useGroupAccordion:t=>ft(()=>J.panelGroups[t].accordion),setGroupAccordionStatus:(t,e)=>{J.panelGroups[t]={...J.panelGroups[t],accordion:e}},panelExpanded:(t,e)=>ft(()=>J.panelGroups[t]?.panelExpandStatus?.[e]||!1),setPanelExpandedStatus:(t,e,n)=>{J.panelGroups[t]={...J.panelGroups[t],panelExpandStatus:{...J.panelGroups[t]?.panelExpandStatus||{},[e]:n}}},togglePanelExpandedStatus:(t,e)=>{J.panelGroups[t].accordion&&(J.panelGroups[t].panelExpandStatus[e]||Object.keys(J.panelGroups[t].panelExpandStatus).forEach(n=>{J.panelGroups[t].panelExpandStatus[n]=!1})),J.panelGroups[t].panelExpandStatus[e]=!J.panelGroups[t].panelExpandStatus[e]}}),Te=t=>t>255?255:t<0?0:t,Gt=(t,e)=>{const n=t.replace("#",""),i=parseInt(n,16),r=Te((i>>16)+e),l=Te((i>>8&255)+e);return"#"+(Te((255&i)+e)|l<<8|r<<16).toString(16)};var Vt=At({name:"VueCollapsiblePanelGroup",props:{accordion:{type:Boolean,default:!1},baseColor:{type:String,default:"#333333"}},setup(t){const e=nt(`group-${Ft()}`),{setGroupAccordionStatus:n}=Wn(),i={"--base-color":t.baseColor,"--border-color":Gt(t.baseColor,180),"--bg-color-header":Gt(t.baseColor,140),"--bg-color-header-hover":Gt(t.baseColor,190),"--bg-color-header-active":Gt(t.baseColor,200),"--bg-color-body":"#fff"};return n(e.value,t.accordion),{idGroup:e,cssColorVars:i}}});const gr=["data-id-group"];Vt.render=function(t,e,n,i,r,l){return H(),tt("div",{"data-id-group":t.idGroup,style:gt(t.cssColorVars),class:"vcpg"},[dt(t.$slots,"default")],12,gr)},Vt.__scopeId="data-v-23ab5317",Vt.__file="src/controls/collapsepanel/VCollapsiblePanelGroup.vue";var Kt=At({name:"VueCollapsiblePanel",props:{expanded:{type:Boolean,default:!0}},setup(t,e){const n=`panel-${Ft()}`,i=nt(),r=nt(),l=nt(),{panelExpanded:v,togglePanelExpandedStatus:y,setPanelExpandedStatus:S}=Wn(),C=ft(()=>({hasContent:e.slots.content&&e.slots.content()[0].children.length>0,dataKey:Ft()})),z=ft(()=>i.value?.parentElement?.getAttribute("data-id-group")||""),_=ft(()=>v(z.value,n).value&&C.value.hasContent);return pn(()=>{S(z.value,n,t.expanded)}),Xi(()=>{(async()=>{await mn(),r.value&&l.value&&(r.value.style.height=`${Math.min(l.value.scrollHeight,r.value.scrollHeight)}px`)})()}),{body:C,panelRef:i,bodyRef:r,bodyContentRef:l,isExpanded:_,collapse:D=>{D.style.height="0"},expand:D=>{D.style.height=`${D.scrollHeight}px`},toggle:()=>{C.value.hasContent&&y(z.value,n)},toggleIcon:`
|
|
8
8
|
<svg
|
|
9
9
|
width="24px"
|
|
10
10
|
height="24px"
|
|
@@ -14,4 +14,4 @@ import{h as Ti,openBlock as et,createElementBlock as ht,normalizeStyle as gt,ren
|
|
|
14
14
|
>
|
|
15
15
|
<path d="M6.34292 7.75734L4.92871 9.17155L11.9998 16.2426L19.0708 9.17158L17.6566 7.75737L11.9998 13.4142L6.34292 7.75734Z"/>
|
|
16
16
|
</svg>
|
|
17
|
-
`}}});const uo={class:"vcp__header-title"},lo={key:0,class:"vcp__header-icon"},ho=["innerHTML"],fo={key:0,ref:"bodyRef",class:"vcp__body"},po={ref:"bodyContentRef",class:"vcp__body-content"};function Me(t){return window.TouchEvent&&t instanceof TouchEvent}Ut.render=function(t,e,n,i,a,l){return et(),ht("section",{ref:"panelRef",class:Oi(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[ct("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...g)=>t.toggle&&t.toggle(...g))},[ct("div",uo,[at(t.$slots,"title")]),t.body.hasContent?(et(),ht("div",lo,[at(t.$slots,"icon",{},()=>[ct("span",{innerHTML:t.toggleIcon},null,8,ho)])])):se("v-if",!0)]),ji(an,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:ae(()=>[t.isExpanded?(et(),ht("div",fo,[ct("div",po,[at(t.$slots,"content")],512)],512)):se("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Ut.__scopeId="data-v-08c94cf8",Ut.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class V{constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Me(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Me(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Re(this.clientX,this.clientY)}static bindDown(e,n,i,a=!1){const l=b=>{n(new V(b))},g=b=>{b.touches.length===1&&n(new V(b)),b.touches.length>1&&i&&i(new V(b))};return e.addEventListener("mousedown",l,a),e.addEventListener("touchstart",g,a),()=>{e.removeEventListener("mousedown",l,a),e.removeEventListener("touchstart",g,a)}}static bindMove(e,n,i=!1){const a=g=>{n(new V(g))},l=g=>{g.touches.length===1&&n(new V(g))};return e.addEventListener("mousemove",a,i),e.addEventListener("touchmove",l,i),()=>{e.removeEventListener("mousemove",a,i),e.removeEventListener("touchmove",l,i)}}static bindUp(e,n,i=!1){const a=g=>{n(new V(g))},l=g=>{g.touches.length===0&&n(new V(g))};return e.addEventListener("mouseup",a,i),e.addEventListener("touchend",l,i),()=>{e.removeEventListener("mouseup",a,i),e.removeEventListener("touchend",l,i)}}originalEvent({mouse:e,touch:n}){Me(this.e)?n&&n(this.e):e&&e(this.e)}}class Re{constructor(e,n){this.x=e,this.y=n}clone(){return new Re(this.x,this.y)}}class mo{constructor(e,n,i={}){this.mousedown=a=>{if(a.preventDefault(),this.handle){const{left:l,top:g}=this.handle.getBoundingClientRect();this.offsetX=a.clientX-l,this.offsetY=a.clientY-g}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=V.bindMove(document,this.mousemove),this.unbindUp=V.bindUp(document,this.mouseup)},this.mousemove=a=>{this.container&&(this.container.style.left=a.clientX-this.offsetX+"px",this.container.style.top=a.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()},this.mouseup=a=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0},this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=V.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()}}class vo{constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=$t(this._group),i=$t(e);n.splice(n.indexOf(this),1),i.push(this),Ln()}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($t(this._group)),Ln()}}const Ft=new Map;function $t(t){return Ft.has(t)||Ft.set(t,[]),Ft.get(t)}function An(t,e){return t>e?-An(e,t):t<0&&e>=0?1:t-e}function Ln(){let t=0;for(const e of function(n){const i=[];return n.forEach((a,l)=>i.push(l)),i}(Ft).sort(An))for(const n of $t(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Ae(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=Ht(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 Ht(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,a=e.top,l=e.left;return{width:n,height:i,top:a,left:l,bottom:a+i,right:l+n}}class go{constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Dn.map(S=>new S(e,this));const{width:i,height:a}=Ae(e),l=n.maxWidth||window.innerWidth,g=n.maxHeight||window.innerHeight;let b=!1;(i<n.minWidth||i>l)&&(e.style.width=`${Tn(i,n.minWidth,l)}px`,b=!0),(a<n.minHeight||a>g)&&(e.style.height=`${Tn(a,n.minHeight,g)}px`,b=!0),b&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Dn=[];class lt{constructor(e,n){this.handleSize=8,this.mousedown=i=>{i.preventDefault(),i.stopPropagation();const{left:a,top:l,width:g,height:b}=Ht(this.container);this.x0=i.clientX,this.y0=i.clientY,this.left0=a,this.top0=l,this.width0=g,this.height0=b,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=V.bindMove(document,this.mousemove),this.unbindUp=V.bindUp(document,this.mouseup)},this.mousemove=i=>{i.preventDefault(),i.stopPropagation(),this.setPosition(i),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()},this.mouseup=i=>{i.preventDefault(),i.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0},this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=V.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:a}=Ht(this.container),l=this.helper.options,g=l.maxWidth||window.innerWidth,b=l.maxHeight||window.innerHeight;this.minLeft=Math.max(i-g,0),this.maxLeft=i-l.minWidth,this.minRight=e+l.minWidth,this.maxRight=Math.min(e+g,window.innerWidth),this.minTop=Math.max(a-b,0),this.maxTop=a-l.minHeight,this.minBottom=n+l.minHeight,this.maxBottom=Math.min(n+b,window.innerHeight)}fixPosition(){const{width:e,height:n,left:i,top:a,right:l,bottom:g}=Ht(this.container),b=this.helper.options;b&&(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=`${b.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):l<this.minRight?this.container.style.width=`${b.minWidth}px`:l>this.maxRight&&(this.container.style.width=this.maxRight-i+"px"),a<this.minTop?(this.container.style.height=n+a-this.minTop+"px",this.container.style.top=`${this.minTop}px`):a>this.maxTop?(this.container.style.height=`${b.minHeight}px`,this.container.style.top=`${this.maxTop}px`):g<this.minBottom?this.container.style.height=`${b.minHeight}px`:g>this.maxBottom&&(this.container.style.height=this.maxBottom-a+"px"))}createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function Tn(t,e,n){return t<e?e:t>n?n:t}Dn.push(class extends lt{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 lt{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 lt{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 lt{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 lt{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 lt{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 lt{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 lt{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 Wt=At({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=J(!1),n=J(!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 a=V.bindUp(document,()=>{n.value=!1,a()})}}}});const yo=["disabled"];Wt.render=function(t,e,n,i,a,l){return et(),ht("div",{class:"btn",style:gt(t.style()),onMouseenter:e[0]||(e[0]=g=>t.hover=!0),onMouseleave:e[1]||(e[1]=g=>t.hover=!1),onMousedown:e[2]||(e[2]=cn((...g)=>t.mousedown&&t.mousedown(...g),["stop"])),onTouchstart:e[3]||(e[3]=cn((...g)=>t.mousedown&&t.mousedown(...g),["stop"])),onMouseup:e[4]||(e[4]=(...g)=>t.mouseup&&t.mouseup(...g)),onTouchend:e[5]||(e[5]=(...g)=>t.mouseup&&t.mouseup(...g)),disabled:t.disabled},[at(t.$slots,"default")],44,yo)},Wt.__scopeId="data-v-71662210",Wt.__file="src/controls/vuewindow/window/Button.vue";const Le=new Set;function Nn(t){return t!==null?parseFloat(t):0}function qt(t){const e=window.getComputedStyle(t);return{width:Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Nn).reduce((n,i)=>n+i)),height:Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Nn).reduce((n,i)=>n+i))}}class Bn{constructor(e,n){this.width=e,this.height=n}}function wo(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 bo(t,e,n,i){const a=t-n,l=e-i;return a*a+l*l}window.addEventListener("resize",t=>{Le.forEach(e=>{e?.fixPosition()})});const Xt=[];var Gt=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:Wt},setup(t,{emit:e}){const n=Ui();if(!n)return;const{proxy:i}=n;let a=0,l,g,b;const S=J(t.isOpen),C=()=>{Xt.push(i),b=new vo(t.zGroup,z),t.isOpen&&(sn(()=>{a++==0&&(d(i),function(){const I=P.value,{width:M,height:O}=Ae(I);let j,U;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")j=t.left,U=t.top;else{const H=t.positionHint||"auto";switch(H){case"auto":{let W=20,q=50,Y=0;do{if(Xt.every(K=>{if(!K.isOpen||i==K)return!0;const Q=wo(K);if(Q==null)return!0;const{left:Jt,top:Zt}=Q;return bo(Jt,Zt,W,q)>16}))break;W=(W+40)%(window.innerWidth-200),q=(q+40)%(window.innerHeight-200)}while(++Y<100);j=W,U=q}break;case"center":j=(window.innerWidth-M)/2,U=(window.innerHeight-O)/2,console.log(j,U,window.innerWidth,window.innerHeight,"111111");break;default:try{const W=H.split("/").map(Number);if(W.length!=2)throw null;const[q,Y]=W;if(!isFinite(q)||!isFinite(Y))throw null;j=q>=0?q:window.innerWidth-M+q,U=Y>=0?Y:window.innerHeight-O+Y}catch{throw new Error(`invalid position string: ${H}`)}}}I&&(I.style.left=`${j}px`,I.style.top=`${U}px`)}()),t.resizable&&u(),R(),l=new mo(D.value,P.value,{onMove:()=>R(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:I}=Ae(D.value);g=new go(P.value,{onResize:()=>u(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+I,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+I:void 0})}()}),t.activateWhenOpen&&A()),Le.add(i)};function z(I){y.value.zIndex=`${I}`}const P=J(null),D=J(null),B=J(null);function A(){b.raise(),e("activate")}const y=J({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),c=dt(()=>t.windowStyle.titlebar),h=dt(()=>{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:M,height:O,top:j,left:U}=I,H=P;if(H&&M!=null&&(H.value.style.width=`${M}px`),O!=null){const W=D.value;if(W){const q=qt(W).height;H.value.style.height=`${O+q}px`}}H&&U!=null&&(H.value.style.left=`${U}px`),H&&j!=null&&(H.value.style.top=`${j}px`)}function u(I=!0){const M=P.value,O=D.value,j=B.value;if(j&&M&&O){const{width:U,height:H}=qt(j),{width:W,height:q}=qt(M),Y=qt(O).height,K=W-(j.offsetWidth-U),Q=q-Y-(j.offsetHeight-H);j.style.width=`${K}px`,j.style.height=`${Q}px`,p(),e("resize",new Bn(K,Q)),I&&(e("update:width",K),e("update:height",Q))}}function p(){const I=P.value;if(I){const M=I.getBoundingClientRect();M.left<0&&(y.value.left="0px"),M.top<0&&(y.value.top="0px"),M.right>window.innerWidth&&(y.value.left=window.innerWidth-M.width+"px"),M.bottom>window.innerHeight&&(y.value.top=window.innerHeight-M.height+"px")}}function R(I=!0){p();const M=P.value;if(M){const{left:O,top:j}=M.getBoundingClientRect();I&&(e("update:left",O),e("update:top",j))}}return Lt(()=>t.isOpen,I=>{S.value=I}),Lt(()=>t.zGroup,I=>{b.group=I}),Lt(()=>t.width,I=>{d({width:I}),u(!1)}),Lt(()=>t.height,I=>{d({height:I}),u(!1)}),on(()=>{C()}),Fi(()=>{Le.delete(this),b.unregister(),g&&g.teardown(),l&&l.teardown(),Xt.splice(Xt.indexOf(i),1)}),{isOpen:S,windowEl:P,titlebar:D,content:B,activate:A,styleWindow:y,styleTitlebar:c,styleContent:h,closeButtonClick:function(){S.value=!1,e("closebuttonclick")}}}});const So={class:"title"},xo=ln("\xD7");var On,xt;Gt.render=function(t,e,n,i,a,l){const g=$i("myButton");return et(),un(an,{name:"fade",onAfterLeave:e[2]||(e[2]=b=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=b=>t.$emit("open"))},{default:ae(()=>[Hi(ct("div",{class:"window",style:gt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...b)=>t.activate&&t.activate(...b)),onTouchstart:e[1]||(e[1]=(...b)=>t.activate&&t.activate(...b))},[ct("div",{class:"titlebar",style:gt(t.styleTitlebar),ref:"titlebar"},[ct("div",So,[t.$slots.title?at(t.$slots,"title",{key:0}):(et(),ht(Wi,{key:1},[ln(qi(t.title),1)],2112))]),t.closeButton?(et(),un(g,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:ae(()=>[xo]),_:1},8,["windowStyle","onClick"])):se("v-if",!0)],4),ct("div",{class:"content",style:gt(t.styleContent),ref:"content"},[at(t.$slots,"default")],4)],36),[[Xi,t.isOpen]])]),_:3})},Gt.__file="src/controls/vuewindow/window/index.vue",(xt=On||(On={}))[xt.StyleBlack=0]="StyleBlack",xt[xt.StyleWhite=1]="StyleWhite",xt[xt.StyleMetal=2]="StyleMetal";const Co={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)"}},Eo={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)"}},ko={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)"}},zo=Gt,Vt=new Map,De=new Map;let Kt;const _o={getDefaultClient(){if(Kt||(Kt=new zt(SysConfig.DefaultHproseAPI)),!Kt)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return Kt},registerHprose(t,e){const n=De.get(t);if(!n){const i=new zt(e);Vt.set(t,i)}return n},getHprose:t=>De?.get(t),getProxyHprose:t=>Vt.get(t),unregisterHprose(t){Vt.get(t)&&(De.delete(t),Vt.delete(t))}},Io=4e3,mt={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},Po=N.Config.ServiceURL.LoginAuthURL;function Te(){const t=wn();t&&it(mt.RefreshToken,Po,{refreshToken:t}).then(e=>{Yt(e.data)})}function jn(t){N.User||(N.User={id:t.id,name:t.name});const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=4e3?Te():setTimeout(Te,n-4e3))}function Yt(t){N.User&&(N.User.doubleToken=t);const e=new Date().getTime(),n=new Date(t.accessToken.expires).getTime()-e;if(n>0&&N.User){const i={id:N.User.id,name:N.User.name,token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent};ut.set("access_token",i,n/1e3),jn(i)}else ut.remove("access_token")}function Ne(t){N.User=t}const Pt=N.Config.ServiceURL.LoginAuthURL;async function Mo(t){const e=(await it(mt.Login,Pt,t))?.data;return e&&e.isSuccess&&(Ne(e.resultValue),Yt(e.resultValue.doubleToken)),e}async function Ro(t){const e=(await it(mt.CheckLogin,Pt,t))?.data;return e&&e.isSuccess&&(Ne(e.resultValue),Yt(e.resultValue.doubleToken)),e}function Ao(t){return it(mt.ChangePWD,Pt,t)}function Lo(){const t=Nt();t&&(Se(mt.Logout,Pt,{token:t.token,reftoken:t.refresh}),we())}function Do(t){return it(mt.CheckToken,Pt,{token:t})}export{Ur as BigFileDownload,ge as Download,dr as DownloadByUrl,pt as EnumColor,N as Global,_o as GlobalHprose,St as GlobalMitt,pn as H5Tool,kt as HproseClient,hr as HttpDownload,lr as JsonDownload,ao as ObjToUrlParams,ce as Pane,zt as ProxyClient,ur as SaveAs,Ki as Splitpanes,he as Storage,wt as StringUtils,Co as StyleBlack,ko as StyleMetal,Eo as StyleWhite,nt as SysEvents,Io as TOKEN_REFRESH_TIME,mt as USER_TOKEN_API,Ut as VCollapsiblePanel,jt as VCollapsiblePanelGroup,Gt as VWindow,Bn as WindowResizeEvent,zo as WindowType,cr as calculateBestTextColor,Ao as changePWD,jn as checkDoRefreshToken,Ro as checkLogin,Do as checkToken,we as clearLocalToken,or as colorIsDark,Lr as createFileUpload,sr as darken,Mn as deepMerge,Te as doRefreshToken,yr as get,br as getData,Qi as getHexColor,Nt as getLocalToken,Tr as getLockState,er as getLongHexColor,yn as getProxyClient,tr as getRGBColor,ir as getRGBColorFromHSLA,wn as getRefreshToken,fe as hexToRGB,gn as init,vr as initDefaultProxyClient,mr as initXFrame,X as is,Pn as isArray,Xr as isAsyncFunction,Vr as isBoolean,Kr as isClient,Wr as isDate,_n as isDef,Jr as isElement,to as isEmpty,nr as isEnumColor,eo as isError,ze as isFunction,Tt as isHexColor,Qr as isImageDom,oo as isMap,Ie as isNull,$r as isNullAndUnDef,Hr as isNullOrUnDef,qr as isNumber,It as isObject,Gr as isPromise,Zr as isServer,In as isString,ro as isSymbol,_e as isUnDef,so as isValidURL,io as isWeakMap,no as isWeakSet,Yr as isWindow,Dr as jquery,ar as lighten,Mo as login,Lo as logout,Zi as newGuid,Nr as onLockListener,wr as post,it as requestGet,Se as requestPost,gr as requestPostBody,rr as rgbToHex,Yt as setLocalToken,Ne as setUser,fr as sleep,Ji as storage,ut as storageHelper,Br as unLockListener,Dt as uuid};
|
|
17
|
+
`}}});const vr={class:"vcp__header-title"},yr={key:0,class:"vcp__header-icon"},wr=["innerHTML"],br={key:0,ref:"bodyRef",class:"vcp__body"},Sr={ref:"bodyContentRef",class:"vcp__body-content"};function Ne(t){return window.TouchEvent&&t instanceof TouchEvent}Kt.render=function(t,e,n,i,r,l){return H(),tt("section",{ref:"panelRef",class:Gi(["vcp",{"vcp--expanded":t.isExpanded,"vcp--expandable":t.body.hasContent}])},[V("header",{class:"vcp__header",onClick:e[0]||(e[0]=(...v)=>t.toggle&&t.toggle(...v))},[V("div",vr,[dt(t.$slots,"title")]),t.body.hasContent?(H(),tt("div",yr,[dt(t.$slots,"icon",{},()=>[V("span",{innerHTML:t.toggleIcon},null,8,wr)])])):Et("v-if",!0)]),gn(vn,{"data-key":t.body.dataKey,name:"slide",onBeforeEnter:t.collapse,onEnter:t.expand,onBeforeLeave:t.expand,onLeave:t.collapse},{default:jt(()=>[t.isExpanded?(H(),tt("div",br,[V("div",Sr,[dt(t.$slots,"content")],512)],512)):Et("v-if",!0)]),_:3},8,["data-key","onBeforeEnter","onEnter","onBeforeLeave","onLeave"])],2)},Kt.__scopeId="data-v-08c94cf8",Kt.__file="src/controls/collapsepanel/VCollapsiblePanel.vue";class Z{constructor(e){this.e=e}stopPropagation(){this.e.stopPropagation()}preventDefault(){this.e.preventDefault()}get clientX(){return Ne(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientX:this.e.clientX}get clientY(){return Ne(this.e)?(this.e.type==="touchend"?this.e.changedTouches:this.e.touches).item(0).clientY:this.e.clientY}get clientCoord(){return new Oe(this.clientX,this.clientY)}static bindDown(e,n,i,r=!1){const l=y=>{n(new Z(y))},v=y=>{y.touches.length===1&&n(new Z(y)),y.touches.length>1&&i&&i(new Z(y))};return e.addEventListener("mousedown",l,r),e.addEventListener("touchstart",v,r),()=>{e.removeEventListener("mousedown",l,r),e.removeEventListener("touchstart",v,r)}}static bindMove(e,n,i=!1){const r=v=>{n(new Z(v))},l=v=>{v.touches.length===1&&n(new Z(v))};return e.addEventListener("mousemove",r,i),e.addEventListener("touchmove",l,i),()=>{e.removeEventListener("mousemove",r,i),e.removeEventListener("touchmove",l,i)}}static bindUp(e,n,i=!1){const r=v=>{n(new Z(v))},l=v=>{v.touches.length===0&&n(new Z(v))};return e.addEventListener("mouseup",r,i),e.addEventListener("touchend",l,i),()=>{e.removeEventListener("mouseup",r,i),e.removeEventListener("touchend",l,i)}}originalEvent({mouse:e,touch:n}){Ne(this.e)?n&&n(this.e):e&&e(this.e)}}class Oe{constructor(e,n){this.x=e,this.y=n}clone(){return new Oe(this.x,this.y)}}class Cr{constructor(e,n,i={}){this.mousedown=r=>{if(r.preventDefault(),this.handle){const{left:l,top:v}=this.handle.getBoundingClientRect();this.offsetX=r.clientX-l,this.offsetY=r.clientY-v}this.options.onMoveStart&&this.options.onMoveStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)},this.mousemove=r=>{this.container&&(this.container.style.left=r.clientX-this.offsetX+"px",this.container.style.top=r.clientY-this.offsetY+"px"),this.options.onMove&&this.options.onMove()},this.mouseup=r=>{this.options.onMoveEnd&&this.options.onMoveEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0},this.handle=e,this.container=n,this.options=i,e&&(this.unbindDown=Z.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()}}class xr{constructor(e,n){this._group=e,this.onChange=n,this.a(i=>i.push(this))}set group(e){this._group=e;const n=Jt(this._group),i=Jt(e);n.splice(n.indexOf(this),1),i.push(this),$n()}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(Jt(this._group)),$n()}}const Yt=new Map;function Jt(t){return Yt.has(t)||Yt.set(t,[]),Yt.get(t)}function Fn(t,e){return t>e?-Fn(e,t):t<0&&e>=0?1:t-e}function $n(){let t=0;for(const e of function(n){const i=[];return n.forEach((r,l)=>i.push(l)),i}(Yt).sort(Fn))for(const n of Jt(e))t!=n.zIndex&&(n.zIndex=t,n.onChange(t)),t++}function Ue(t){if(t){const{width:e,height:n}=t.style;t.style.width="auto",t.style.height="auto";const i=Zt(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 Zt(t){const e=t.getBoundingClientRect(),n=e.width,i=e.height,r=e.top,l=e.left;return{width:n,height:i,top:r,left:l,bottom:r+i,right:l+n}}class Er{constructor(e,n){if(this.container=e,this.options=n,e&&n){this.handles=Hn.map(S=>new S(e,this));const{width:i,height:r}=Ue(e),l=n.maxWidth||window.innerWidth,v=n.maxHeight||window.innerHeight;let y=!1;(i<n.minWidth||i>l)&&(e.style.width=`${qn(i,n.minWidth,l)}px`,y=!0),(r<n.minHeight||r>v)&&(e.style.height=`${qn(r,n.minHeight,v)}px`,y=!0),y&&n.onResize&&n.onResize()}}teardown(){this.handles?.forEach(e=>e.teardown())}}const Hn=[];class mt{constructor(e,n){this.handleSize=8,this.mousedown=i=>{i.preventDefault(),i.stopPropagation();const{left:r,top:l,width:v,height:y}=Zt(this.container);this.x0=i.clientX,this.y0=i.clientY,this.left0=r,this.top0=l,this.width0=v,this.height0=y,this.calcSafeBoundaries(),this.helper.options&&this.helper.options.onResizeStart&&this.helper.options.onResizeStart(),this.unbindMove=Z.bindMove(document,this.mousemove),this.unbindUp=Z.bindUp(document,this.mouseup)},this.mousemove=i=>{i.preventDefault(),i.stopPropagation(),this.setPosition(i),this.fixPosition(),this.helper.options&&this.helper.options.onResize&&this.helper.options.onResize()},this.mouseup=i=>{i.preventDefault(),i.stopPropagation(),this.helper.options&&this.helper.options.onResizeEnd&&this.helper.options.onResizeEnd(),this.unbindUp(),this.unbindMove(),this.unbindUp=this.unbindMove=void 0},this.container=e,this.helper=n,this.handle=this.createHandleElement(),this.unbindDown=Z.bindDown(this.handle,this.mousedown)}teardown(){this.unbindDown(),this.unbindUp&&this.unbindUp(),this.unbindMove&&this.unbindMove(),this.handle.parentElement.removeChild(this.handle)}calcSafeBoundaries(){if(!this.helper.options)return;const{left:e,top:n,right:i,bottom:r}=Zt(this.container),l=this.helper.options,v=l.maxWidth||window.innerWidth,y=l.maxHeight||window.innerHeight;this.minLeft=Math.max(i-v,0),this.maxLeft=i-l.minWidth,this.minRight=e+l.minWidth,this.maxRight=Math.min(e+v,window.innerWidth),this.minTop=Math.max(r-y,0),this.maxTop=r-l.minHeight,this.minBottom=n+l.minHeight,this.maxBottom=Math.min(n+y,window.innerHeight)}fixPosition(){const{width:e,height:n,left:i,top:r,right:l,bottom:v}=Zt(this.container),y=this.helper.options;y&&(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=`${y.minWidth}px`,this.container.style.left=`${this.maxLeft}px`):l<this.minRight?this.container.style.width=`${y.minWidth}px`:l>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=`${y.minHeight}px`,this.container.style.top=`${this.maxTop}px`):v<this.minBottom?this.container.style.height=`${y.minHeight}px`:v>this.maxBottom&&(this.container.style.height=this.maxBottom-r+"px"))}createHandleElement(){const e=document.createElement("div"),n=e.style;return n.position="absolute",this.applyStyle(n),this.container.appendChild(e),e}}function qn(t,e,n){return t<e?e:t>n?n:t}Hn.push(class extends mt{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 mt{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 mt{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 mt{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 mt{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 mt{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 mt{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 mt{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 Qt=At({name:"",props:{disabled:{type:Boolean,default:!1},windowStyle:{type:Object,required:!0}},components:{},setup(t){const e=nt(!1),n=nt(!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=Z.bindUp(document,()=>{n.value=!1,r()})}}}});const kr=["disabled"];Qt.render=function(t,e,n,i,r,l){return H(),tt("div",{class:"btn",style:gt(t.style()),onMouseenter:e[0]||(e[0]=v=>t.hover=!0),onMouseleave:e[1]||(e[1]=v=>t.hover=!1),onMousedown:e[2]||(e[2]=yn((...v)=>t.mousedown&&t.mousedown(...v),["stop"])),onTouchstart:e[3]||(e[3]=yn((...v)=>t.mousedown&&t.mousedown(...v),["stop"])),onMouseup:e[4]||(e[4]=(...v)=>t.mouseup&&t.mouseup(...v)),onTouchend:e[5]||(e[5]=(...v)=>t.mouseup&&t.mouseup(...v)),disabled:t.disabled},[dt(t.$slots,"default")],44,kr)},Qt.__scopeId="data-v-71662210",Qt.__file="src/controls/vuewindow/window/Button.vue";const je=new Set;function Xn(t){return t!==null?parseFloat(t):0}function te(t){const e=window.getComputedStyle(t);return{width:Math.ceil([e.paddingLeft,e.width,e.paddingRight].map(Xn).reduce((n,i)=>n+i)),height:Math.ceil([e.paddingTop,e.height,e.paddingBottom].map(Xn).reduce((n,i)=>n+i))}}class Gn{constructor(e,n){this.width=e,this.height=n}}function zr(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 _r(t,e,n,i){const r=t-n,l=e-i;return r*r+l*l}window.addEventListener("resize",t=>{je.forEach(e=>{e?.fixPosition()})});const ee=[];var ne=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:Qt},setup(t,{emit:e}){const n=Vi();if(!n)return;const{proxy:i}=n;let r=0,l,v,y;const S=nt(t.isOpen),C=()=>{ee.push(i),y=new xr(t.zGroup,z),t.isOpen&&(mn(()=>{r++==0&&(d(i),function(){const I=_.value,{width:L,height:O}=Ue(I);let U,j;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,j=t.top;else{const $=t.positionHint||"auto";switch($){case"auto":{let X=20,G=50,it=0;do{if(ee.every(Q=>{if(!Q.isOpen||i==Q)return!0;const rt=zr(Q);if(rt==null)return!0;const{left:se,top:ae}=rt;return _r(se,ae,X,G)>16}))break;X=(X+40)%(window.innerWidth-200),G=(G+40)%(window.innerHeight-200)}while(++it<100);U=X,j=G}break;case"center":U=(window.innerWidth-L)/2,j=(window.innerHeight-O)/2,console.log(U,j,window.innerWidth,window.innerHeight,"111111");break;default:try{const X=$.split("/").map(Number);if(X.length!=2)throw null;const[G,it]=X;if(!isFinite(G)||!isFinite(it))throw null;U=G>=0?G:window.innerWidth-L+G,j=it>=0?it:window.innerHeight-O+it}catch{throw new Error(`invalid position string: ${$}`)}}}I&&(I.style.left=`${U}px`,I.style.top=`${j}px`)}()),t.resizable&&u(),P(),l=new Cr(D.value,_.value,{onMove:()=>P(),onMoveStart:()=>e("move-start"),onMoveEnd:()=>e("move-end")}),t.resizable&&function(){const{height:I}=Ue(D.value);v=new Er(_.value,{onResize:()=>u(),onResizeStart:()=>e("resize-start"),onResizeEnd:()=>e("resize-end"),minWidth:t.minWidth,minHeight:t.minHeight+I,maxWidth:t.maxWidth,maxHeight:t.maxHeight?t.maxHeight+I:void 0})}()}),t.activateWhenOpen&&R()),je.add(i)};function z(I){w.value.zIndex=`${I}`}const _=nt(null),D=nt(null),T=nt(null);function R(){y.raise(),e("activate")}const w=nt({...t.windowStyle.window,zIndex:"auto",overflow:t.overflow}),c=ft(()=>t.windowStyle.titlebar),h=ft(()=>{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:L,height:O,top:U,left:j}=I,$=_;if($&&L!=null&&($.value.style.width=`${L}px`),O!=null){const X=D.value;if(X){const G=te(X).height;$.value.style.height=`${O+G}px`}}$&&j!=null&&($.value.style.left=`${j}px`),$&&U!=null&&($.value.style.top=`${U}px`)}function u(I=!0){const L=_.value,O=D.value,U=T.value;if(U&&L&&O){const{width:j,height:$}=te(U),{width:X,height:G}=te(L),it=te(O).height,Q=X-(U.offsetWidth-j),rt=G-it-(U.offsetHeight-$);U.style.width=`${Q}px`,U.style.height=`${rt}px`,p(),e("resize",new Gn(Q,rt)),I&&(e("update:width",Q),e("update:height",rt))}}function p(){const I=_.value;if(I){const L=I.getBoundingClientRect();L.left<0&&(w.value.left="0px"),L.top<0&&(w.value.top="0px"),L.right>window.innerWidth&&(w.value.left=window.innerWidth-L.width+"px"),L.bottom>window.innerHeight&&(w.value.top=window.innerHeight-L.height+"px")}}function P(I=!0){p();const L=_.value;if(L){const{left:O,top:U}=L.getBoundingClientRect();I&&(e("update:left",O),e("update:top",U))}}return Wt(()=>t.isOpen,I=>{S.value=I}),Wt(()=>t.zGroup,I=>{y.group=I}),Wt(()=>t.width,I=>{d({width:I}),u(!1)}),Wt(()=>t.height,I=>{d({height:I}),u(!1)}),pn(()=>{C()}),Ki(()=>{je.delete(this),y.unregister(),v&&v.teardown(),l&&l.teardown(),ee.splice(ee.indexOf(i),1)}),{isOpen:S,windowEl:_,titlebar:D,content:T,activate:R,styleWindow:w,styleTitlebar:c,styleContent:h,closeButtonClick:function(){S.value=!1,e("closebuttonclick")}}}});const Mr={class:"title"},Ir=bn("\xD7");var Vn,Lt;ne.render=function(t,e,n,i,r,l){const v=wn("myButton");return H(),at(vn,{name:"fade",onAfterLeave:e[2]||(e[2]=y=>t.$emit("close")),onAfterEnter:e[3]||(e[3]=y=>t.$emit("open"))},{default:jt(()=>[Yi(V("div",{class:"window",style:gt(t.styleWindow),ref:"windowEl",onMousedown:e[0]||(e[0]=(...y)=>t.activate&&t.activate(...y)),onTouchstart:e[1]||(e[1]=(...y)=>t.activate&&t.activate(...y))},[V("div",{class:"titlebar",style:gt(t.styleTitlebar),ref:"titlebar"},[V("div",Mr,[t.$slots.title?dt(t.$slots,"title",{key:0}):(H(),tt(vt,{key:1},[bn(Ji(t.title),1)],2112))]),t.closeButton?(H(),at(v,{key:0,windowStyle:t.windowStyle,onClick:t.closeButtonClick},{default:jt(()=>[Ir]),_:1},8,["windowStyle","onClick"])):Et("v-if",!0)],4),V("div",{class:"content",style:gt(t.styleContent),ref:"content"},[dt(t.$slots,"default")],4)],36),[[Zi,t.isOpen]])]),_:3})},ne.__file="src/controls/vuewindow/window/index.vue",(Lt=Vn||(Vn={}))[Lt.StyleBlack=0]="StyleBlack",Lt[Lt.StyleWhite=1]="StyleWhite",Lt[Lt.StyleMetal=2]="StyleMetal";const Lr={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)"}},Pr={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)"}},Rr={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)"}},Ar=ne;var q,et;(et=q||(q={}))[et.top=0]="top",et[et.bottom=1]="bottom",et[et.centerBack=2]="centerBack",et[et.centerMain=3]="centerMain",et[et.centerFront=4]="centerFront",et[et.left=5]="left",et[et.right=6]="right";class Br{constructor(e,n){this.layoutMap=new Map,this.preConditionMap=new Map,this.widgetsLoadedSet=new Set,this.layoutState=e,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(e){if(!e)return;let n;St(e)?n=e:Xt(e)&&(n=this.widgetCofig.find(i=>i.id===e)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e,n){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(i=>{if(i.default){const r=Sn(i.default);this.getContainerComponents(e.container).value.set(e.id,r),this.widgetsLoadedSet.add(e.id),B.EventBus.emit(K.WidgetLoadedEvent,e.id),n&&n(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.widgetCofig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(K.WidgetUnLoadedEvent,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 q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.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(K.WidgetVisibleChanged,{id:e,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetCofig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.get(e)}}getWigetItem(e){return this.widgetCofig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetCofig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=nt(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}var We=At({name:"MainContainer",props:{widgetConfig:{type:Array,required:!0,default:()=>[]},layoutStyle:{type:Object}},components:{},setup(t,{attrs:e,slots:n,emit:i}){const r=fn({topContainer:void 0,centerBackContainer:void 0,centerMainContainer:void 0,centerFrontContainer:void 0,bottomContainer:void 0,leftContainer:void 0,rightContainer:void 0});if(!B.LayoutManager){const T=new Br(r,t.widgetConfig);B.LayoutManager=T,T.preloadWidgets()}const l=_(q.top),v=_(q.centerBack),y=_(q.centerFront),S=_(q.left),C=_(q.right),z=_(q.bottom);function _(T){return B.LayoutManager?.getContainerComponents(T)}const D=ft(()=>t.layoutStyle);return{...Qi(r),topContainerComponents:l,centerbackComponents:v,centerfrontComponents:y,leftContainerComponents:S,rightContainerComponents:C,bottomContainerComponents:z,containerStyle:D}}});const Dr={ref:"topContainer",class:"topContainer"},Tr={ref:"centerBackContainer",class:"centerdiv backContainer"},Nr={ref:"centerMainContainer",class:"centerdiv mainContainer"},Or={ref:"centerFrontContainer",class:"centerdiv centerContainer"},Ur={ref:"leftContainer",class:"leftContainer"},jr={ref:"rightContainer",class:"rightContainer"},Wr={ref:"bottomContainer",class:"bottomContainer"};We.render=function(t,e,n,i,r,l){const v=wn("router-view");return H(),tt("div",{class:"layoutContainer",style:gt(t.containerStyle)},[V("div",Dr,[(H(!0),tt(vt,null,kt(t.topContainerComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512),V("div",null,[Et(" \u5E95\u5C42-\u4E3B\u5BB9\u5668 "),V("div",Tr,[(H(!0),tt(vt,null,kt(t.centerbackComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512),Et(" \u4E3B\u8981\u5BB9\u5668 "),V("div",Nr,[gn(v,null,{default:jt(({Component:y})=>[(H(),at(yt(y)))]),_:1})],512),Et(" \u6D6E\u52A8-\u4E3B\u5BB9\u5668 "),V("div",Or,[(H(!0),tt(vt,null,kt(t.centerfrontComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512),V("div",Ur,[(H(!0),tt(vt,null,kt(t.leftContainerComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512),V("div",jr,[(H(!0),tt(vt,null,kt(t.rightContainerComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512)]),V("div",Wr,[(H(!0),tt(vt,null,kt(t.bottomContainerComponents,([y,S])=>(H(),at(yt(S),{key:y}))),128))],512)],4)},We.__file="src/controls/layoutcontainer/layout.vue";class Fr{constructor(e,n){this.layoutMap=new Map,this.preConditionMap=new Map,this.widgetsLoadedSet=new Set,this.layoutState=e,this.widgetCofig=n,this.widgetCofig.forEach(i=>{if(i.afterid)if(this.preConditionMap.has(i.afterid))this.preConditionMap.get(i.afterid)?.add(i);else{const r=new Set;r.add(i),this.preConditionMap.set(i.afterid,r)}})}getWidgetConfig(){return this.widgetCofig}preloadWidgets(){this.widgetCofig.filter(e=>e.preload&&!e.afterid).forEach(e=>{this._loadWidget(e,this.loadOtherDependenceWidgets.bind(this))})}loadWidget(e){if(!e)return;let n;St(e)?n=e:Xt(e)&&(n=this.widgetCofig.find(i=>i.id===e)),n&&this._loadWidget(n,this.loadOtherDependenceWidgets.bind(this))}loadOtherDependenceWidgets(e){this.preConditionMap.has(e)&&this.preConditionMap.get(e)?.forEach(n=>{n.preload&&this._loadWidget(n)})}_loadWidget(e,n){if(!this.widgetsLoadedSet.has(e.id))return e.component().then(i=>{if(i.default){const r=Sn(i.default);this.getContainerComponents(e.container).value.set(e.id,r),this.widgetsLoadedSet.add(e.id),B.EventBus.emit(K.WidgetLoadedEvent,e.id),n&&n(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.widgetCofig.find(i=>i.id===e);if(n){if(this.preConditionMap.has(e)){const i=this.preConditionMap.get(e);if(i)for(const r of i)this.unloadWidget(r.id)}this.getContainerComponents(n.container).value.delete(e),this.widgetsLoadedSet.delete(e),B.EventBus.emit(K.WidgetUnLoadedEvent,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 q.top:return this.layoutState.topContainer;case q.bottom:return this.layoutState.bottomContainer;case q.left:return this.layoutState.leftContainer;case q.right:return this.layoutState.rightContainer;case q.centerBack:return this.layoutState.centerBackContainer;case q.centerMain:return this.layoutState.centerMainContainer;case q.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(K.WidgetVisibleChanged,{id:e,name:i.name,visible:n})}getWidgetComponent(e){if(this.widgetsLoadedSet.has(e)){const n=this.widgetCofig.find(i=>i.id===e);if(n)return this.getContainerComponents(n.container).value.get(e)}}getWigetItem(e){return this.widgetCofig.find(n=>n.id===e)}getGroupWigetItems(e){return this.widgetCofig.filter(n=>n.group===e)}getContainerComponents(e){if(this.layoutMap.has(e))return this.layoutMap.get(e);{const n=nt(new Map);return this.layoutMap.set(e,n),n}}addContainerComponent(e,n){}}const ie=new Map,Fe=new Map;let oe;const $r={getDefaultClient(){if(oe||(oe=new Dt(SysConfig.DefaultHproseAPI)),!oe)throw Error("HproseProxy\u5BF9\u8C61\u4E3A\u7A7A");return oe},registerHprose(t,e){const n=Fe.get(t);if(!n){const i=new Dt(e);ie.set(t,i)}return n},getHprose:t=>Fe?.get(t),getProxyHprose:t=>ie.get(t),unregisterHprose(t){ie.get(t)&&(Fe.delete(t),ie.delete(t))}},Hr=4e3,Ct={Login:"/api/Login/Login",CheckLogin:"\u200B/api\u200B/Check\u200B/Login",Logout:"/api/Check/ExitLogin",ChangePWD:"/api/UserManager/UpdateUserPWD",RefreshToken:"/api/Check/RefreshToken",CheckToken:"/api/Check/CheckToken"},qr=B.Config.ServiceURL.LoginAuthURL;function $e(){const t=Ln();t&&ct(Ct.RefreshToken,qr,{refreshToken:t}).then(e=>{re(e.data)})}function Kn(t){B.User||(B.User={id:t.id,name:t.name});const e=new Date().getTime(),n=new Date(t.expire).getTime()-e;n>0&&(n<=4e3?$e():setTimeout($e,n-4e3))}function re(t){B.User&&(B.User.doubleToken=t);const e=new Date().getTime(),n=new Date(t.accessToken.expires).getTime()-e;if(n>0&&B.User){const i={id:B.User.id,name:B.User.name,token:t.accessToken.tokenContent,expire:t.accessToken.expires,refresh:t.refreshToken.tokenContent};pt.set("access_token",i,n/1e3),Kn(i)}else pt.remove("access_token")}function He(t){B.User=t}const Nt=B.Config.ServiceURL.LoginAuthURL;async function Xr(t){const e=(await ct(Ct.Login,Nt,t))?.data;return e&&e.isSuccess&&(He(e.resultValue),re(e.resultValue.doubleToken)),e}async function Gr(t){const e=(await ct(Ct.CheckLogin,Nt,t))?.data;return e&&e.isSuccess&&(He(e.resultValue),re(e.resultValue.doubleToken)),e}function Vr(t){return ct(Ct.ChangePWD,Nt,t)}function Kr(){const t=Ht();t&&(Me(Ct.Logout,Nt,{token:t.token,reftoken:t.refresh}),ze())}function Yr(t){return ct(Ct.CheckToken,Nt,{token:t})}export{Vo as BigFileDownload,Ee as Download,bo as DownloadByUrl,bt as EnumColor,B as Global,$r as GlobalHprose,It as GlobalMitt,kn as H5Tool,Bt as HproseClient,wo as HttpDownload,yo as JsonDownload,We as LayoutContainer,q as LayoutContainerEnum,Fr as LayoutManager,mr as ObjToUrlParams,me as Pane,Dt as ProxyClient,vo as SaveAs,no as Splitpanes,ye as Storage,_t as StringUtils,Lr as StyleBlack,Rr as StyleMetal,Pr as StyleWhite,K as SysEvents,Hr as TOKEN_REFRESH_TIME,Ct as USER_TOKEN_API,Kt as VCollapsiblePanel,Vt as VCollapsiblePanelGroup,ne as VWindow,Gn as WindowResizeEvent,Ar as WindowType,go as calculateBestTextColor,Vr as changePWD,Kn as checkDoRefreshToken,Gr as checkLogin,Yr as checkToken,ze as clearLocalToken,fo as colorIsDark,Wo as createFileUpload,po as darken,jn as deepMerge,$e as doRefreshToken,zo as get,Mo as getData,so as getHexColor,Ht as getLocalToken,$o as getLockState,co as getLongHexColor,In as getProxyClient,ao as getRGBColor,lo as getRGBColorFromHSLA,Ln as getRefreshToken,be as hexToRGB,Mn as init,Eo as initDefaultProxyClient,xo as initXFrame,Y as is,Un as isArray,tr as isAsyncFunction,nr as isBoolean,ir as isClient,Zo as isDate,On as isDef,rr as isElement,cr as isEmpty,uo as isEnumColor,ur as isError,Ae as isFunction,$t as isHexColor,ar as isImageDom,fr as isMap,De as isNull,Yo as isNullAndUnDef,Jo as isNullOrUnDef,Qo as isNumber,St as isObject,er as isPromise,sr as isServer,Xt as isString,dr as isSymbol,Be as isUnDef,pr as isValidURL,hr as isWeakMap,lr as isWeakSet,or as isWindow,Fo as jquery,mo as lighten,Xr as login,Kr as logout,ro as newGuid,Ho as onLockListener,_o as post,ct as requestGet,Me as requestPost,ko as requestPostBody,ho as rgbToHex,re as setLocalToken,He as setUser,So as sleep,oo as storage,pt as storageHelper,qo as unLockListener,Ft as uuid};
|