@syhr/sy-three 1.0.0-rc.2 → 1.0.0-rc.4

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.
@@ -1,18 +1,18 @@
1
- "use strict";require('./sy-three.css');var Wt=Object.defineProperty,qt=Object.defineProperties;var __$t__=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Jt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var Ee=(r,e,t)=>e in r?Wt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,H=(r,e)=>{for(var t in e||(e={}))Jt.call(e,t)&&Ee(r,t,e[t]);if(Be)for(var t of Be(e))Xt.call(e,t)&&Ee(r,t,e[t]);return r},ce=(r,e)=>qt(r,__$t__(e));var j=(r,e,t)=>Ee(r,typeof e!="symbol"?e+"":e,t);var _=(r,e,t)=>new Promise((n,i)=>{var o=l=>{try{c(t.next(l))}catch(m){i(m)}},a=l=>{try{c(t.throw(l))}catch(m){i(m)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);c((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue"),jt=require("qs"),Yt=require("axios"),Qt=require("mitt");require("dayjs");const Zt=require("lodash-es");require("crypto-js");const Y=require("gm-crypto"),$=require("element-plus");require("@element-plus/icons-vue");const ve=require("pinia"),Q=require("three"),en=require("three/examples/jsm/renderers/CSS2DRenderer.js"),k=require("three-edit-cores"),M=require("localforage"),tn=require("three/addons/environments/RoomEnvironment.js"),le={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},Ge={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var fe={};/*!
1
+ "use strict";require('./sy-three.css');var Wt=Object.defineProperty,qt=Object.defineProperties;var __$t__=Object.getOwnPropertyDescriptors;var Be=Object.getOwnPropertySymbols;var Jt=Object.prototype.hasOwnProperty,Xt=Object.prototype.propertyIsEnumerable;var Ee=(r,e,t)=>e in r?Wt(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,H=(r,e)=>{for(var t in e||(e={}))Jt.call(e,t)&&Ee(r,t,e[t]);if(Be)for(var t of Be(e))Xt.call(e,t)&&Ee(r,t,e[t]);return r},ce=(r,e)=>qt(r,__$t__(e));var j=(r,e,t)=>Ee(r,typeof e!="symbol"?e+"":e,t);var _=(r,e,t)=>new Promise((n,i)=>{var a=l=>{try{c(t.next(l))}catch(m){i(m)}},o=l=>{try{c(t.throw(l))}catch(m){i(m)}},c=l=>l.done?n(l.value):Promise.resolve(l.value).then(a,o);c((t=t.apply(r,e)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const D=require("vue"),jt=require("qs"),Yt=require("axios"),Qt=require("mitt");require("dayjs");const Zt=require("lodash-es");require("crypto-js");const Y=require("gm-crypto"),$=require("element-plus");require("@element-plus/icons-vue");const ve=require("pinia"),Q=require("three"),en=require("three/examples/jsm/renderers/CSS2DRenderer.js"),k=require("three-edit-cores"),M=require("localforage"),tn=require("three/addons/environments/RoomEnvironment.js"),le={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},Ge={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var fe={};/*!
2
2
  * vite-plugin-qiankun.js v1.0.14
3
3
  * (c) 2021-2022 Teng Mao Qing
4
4
  * Released under the MIT License.
5
- */Object.defineProperty(fe,"__esModule",{value:!0});var te=typeof window!="undefined"?window.proxy||window:{},mt=function(r){te!=null&&te.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),te.qiankunName&&(window.moudleQiankunAppLifeCycles[te.qiankunName]=r))};fe.default=mt;var Ae=fe.qiankunWindow=te;fe.renderWithQiankun=mt;function nn(){return window.__POWERED_BY_WUJIE__||window.$wujie?le.WUJIE:window.__POWERED_BY_QIANKUN__||Ae!=null&&Ae.__POWERED_BY_QIANKUN__?le.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?le.MICROAPP:le.NONE}const ft="/";nn();const rn=location.origin;var et,tt,nt,rt,it,st,ot,at,ct,lt,ut,dt;const pt={savePath:((tt=(et=window.meta)==null?void 0:et.graph)==null?void 0:tt.savePath)||"/cockpit/drawing",graphPenPath:((rt=(nt=window.meta)==null?void 0:nt.graph)==null?void 0:rt.graphPenPath)||"/cockpit/graph",templatePath:((st=(it=window.meta)==null?void 0:it.graph)==null?void 0:st.templatePath)||"/cockpit/template",graphImgUploadPath:((at=(ot=window.meta)==null?void 0:ot.graph)==null?void 0:at.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((lt=(ct=window.meta)==null?void 0:ct.graph)==null?void 0:lt.threeSavePath)||"/cockpit/threed",threeModelPath:((dt=(ut=window.meta)==null?void 0:ut.graph)==null?void 0:dt.threeModelPath)||"/cockpit/models"},w=Yt.create({baseURL:rn,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>jt.stringify(r)});w.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));w.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function sn(r,e={},t={}){return new Promise(n=>{w.get(r,H({params:e},t)).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function on(r,e={},t={}){return new Promise(n=>{w.post(r,e,t).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function an(r,e={},t={}){return w.get(r,H({params:e},t))}function cn(r,e={},t={}){return w.post(r,e,t)}function ln(r,e={}){return w.get(`/filehandle/${r}`,{params:e})}function un(r,e={},t={}){return w.post(`/filehandle/${r}`,e,t)}function dn(r,e={}){return w.get(`/user/${r}`,{params:e})}function hn(r,e={},t={}){return w.post(`/user/${r}`,e,t)}function mn(r,e={}){return w.get(`${r}`,e.local?{params:e,baseURL:ft}:{params:e})}function fn(r,e={}){return w.get(`/media/${r}/`,{params:e})}function pn(r,e={},t={}){return w.post(`/media/${r}/`,e,t)}function _n(r,e={}){return w.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function En(r,e={},t={}){return w.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function An(r,e={}){return w.get(`/history/${r}`,{params:e})}function gn(r,e={},t={}){return w.post(`/history/${r}`,e,t)}function wn(r,e={}){return w.get(`/scada/${r}`,{params:e})}function Sn(r,e={},t={}){return w.post(`/scada/${r}`,e,t)}function In(r,e={}){return w.get(`/common/factory/${r}`,{params:e})}function yn(r,e={},t={}){return w.post(`/common/factory/${r}`,e,t)}function Cn(r,e={}){return w.get(`/factory/${r}`,{params:e})}function Rn(r,e={},t={}){return w.post(`/factory/${r}`,e,t)}function xn(r,e={}){return w.get(`/pd/${r}`,{params:e})}function Dn(r,e={},t={}){return w.post(`/pd/${r}`,e,t)}const V={getApi:sn,postApi:on,getFileApi:ln,postFileApi:un,getBaseApi:an,postBaseApi:cn,getUserApi:dn,postUserApi:hn,getGraphApi:mn,getMediaApi:fn,postMediaApi:pn,getScadaApi:wn,postScadaApi:Sn,getCommonApi:_n,postCommonApi:En,getHistoryApi:An,postHistoryApi:gn,getFactoryApi:Cn,postFactoryApi:Rn,getCommonFactoryApi:In,postCommonFactoryApi:yn,getPDApi:xn,postPDApi:Dn},we=Qt();class vn{constructor(e={}){this._options=H({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:n,onError:i,onMessage:o,token:a}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[a]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(c)},this._client.onerror=c=>{i&&i(c)},this._client.onmessage=c=>{o&&o(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const Tn=[65535,-99999];function Pn(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function bn(r){return typeof r=="number"&&!Tn.includes(r)}const Mn=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[i,o]of t.entries())r[i]=o;return r};function ze(r){return Object.prototype.toString.call(r).slice(8,-1)}function Se(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function Ln(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,i,o,a,c,l;for(o=t.length,i=0,n="";i<o;){if(a=t.charCodeAt(i++)&255,i==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4),n+="==";break}if(c=t.charCodeAt(i++),i==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2),n+="=";break}l=t.charCodeAt(i++),n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2|(l&192)>>6),n+=r.charAt(l&63)}return n},this.decode=function(t){var n,i,o,a,c,l,m;for(l=t.length,c=0,m="";c<l;){do n=e[t.charCodeAt(c++)&255];while(c<l&&n==-1);if(n==-1)break;do i=e[t.charCodeAt(c++)&255];while(c<l&&i==-1);if(i==-1)break;m+=String.fromCharCode(n<<2|(i&48)>>4);do{if(o=t.charCodeAt(c++)&255,o==61)return m;o=e[o]}while(c<l&&o==-1);if(o==-1)break;m+=String.fromCharCode((i&15)<<4|(o&60)>>2);do{if(a=t.charCodeAt(c++)&255,a==61)return m;a=e[a]}while(c<l&&a==-1);if(a==-1)break;m+=String.fromCharCode((o&3)<<6|a)}return m},this.utf16to8=function(t){var n,i,o,a;for(n="",o=t.length,i=0;i<o;i++)a=t.charCodeAt(i),a>=1&&a<=127?n+=t.charAt(i):a>2047?(n+=String.fromCharCode(224|a>>12&15),n+=String.fromCharCode(128|a>>6&63),n+=String.fromCharCode(128|a>>0&63)):(n+=String.fromCharCode(192|a>>6&31),n+=String.fromCharCode(128|a>>0&63));return n},this.utf8to16=function(t){var n,i,o,a,c,l;for(n="",o=t.length,i=0;i<o;)switch(a=t.charCodeAt(i++),a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(i-1);break;case 12:case 13:c=t.charCodeAt(i++),n+=String.fromCharCode((a&31)<<6|c&63);break;case 14:c=t.charCodeAt(i++),l=t.charCodeAt(i++),n+=String.fromCharCode((a&15)<<12|(c&63)<<6|(l&63)<<0);break}return n},this.charToHex=function(t){var n,i,o;for(n="",i=0;i<t.length;)o=t.charCodeAt(i++).toString(16),n+="\\0x"+o,n+=i>0&&i%8==0?`\r
6
- `:", ";return n}}function On(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Un(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new On,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var i=Object.id(n).toString();this.callbacks_.add(i,n);var o={MsgId:i,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var a=JSON.stringify(o);this.connect&&this.ws.send(a)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var i=this.callbacks_.getValue(n);i(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},i){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],i)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:i},o){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),i],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:i,DataInput:o},a){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(i),o],a)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:n},i){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],i)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:i},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(i)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},i){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],i)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},i){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],i)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},i){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],i)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:i,PinFlag:o},a){this.exec("Arm_ChangePIN",[parseInt(e),o,n,t,parseInt(i)],a)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:i,RsaPriFileSize:o},a){this.exec("Arm_RsaPri",[parseInt(e),parseInt(i),parseInt(o),t,n],a)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:i,RsaPubFileSize:o},a){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),n,t,t.length,i],a)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},i){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],i)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:i},o){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,i],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},i){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],i)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:i},o){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,i],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:i},o){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,i],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:i},o){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,i],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},i){this.exec("Arm_HASH",[parseInt(e),t,n],i)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},i){this.exec("Arm_Seed",[parseInt(e),n,t],i)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:i,StartUserID:o,AdminTryCount:a,UserPin:c,UserTryCount:l,UpdateRSAPriKey:m},I){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(l),parseInt(a),m,parseInt(o),parseInt(i)],I)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:i,FileType:o,Offset:a,DataLen:c,DataBuffer:l,UpRSAPubKey:m},I){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,o,parseInt(i),parseInt(a),l,m,parseInt(c)],I)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:i,FileType:o,Offset:a,DataLen:c,DataBuffer:l},m){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,o,parseInt(i),parseInt(a),l,parseInt(c)],m)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},i){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],i)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:i,IsReset:o,IsDecOnRAM:a},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(i),parseInt(a),parseInt(o)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:i},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(i),parseInt(n)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:i,CallLimit:o},a){this.exec("Arm_Set_EXE_FILE_INFO",[i,parseInt(n),parseInt(e),parseInt(o),t,t.length],a)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Hn={HID:0},ue={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},Ke={USER:0};class _t{constructor(){j(this,"Base64",new Ln);j(this,"AtlCtrl",null);j(this,"ArmCount",0);j(this,"ArmIndex",0);j(this,"ArmHandle",0);j(this,"ArmRandom","");try{this.AtlCtrl=new Un("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,i)=>{n?(this.ArmCount=+i,e(i)):t(i)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(i,o)=>{i?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,n(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(i,o)=>{i?t(o):n(o)})})}armChangePIN(e,t,n=255,i=Ke.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:i},(l,m)=>{l&&m==0?(this.ArmPin=e,a(m)):c(m)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,a)=>{o?(this.ArmRandom=a,n(a)):i(a)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(i,o)=>{i?(this.ArmDeadline=o,t(o)):n(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,a)=>{o?(this.ArmUKey=a,n(a)):i(a)})})}armGetDongleInfo(e=0,t=ue.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,i)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,a)=>{if(o){switch(t){case ue.USER_ID:this.ArmUid=a;break;case ue.PRODUCT_ID:this.ArmPid=a;break;case ue.HARDWARE_ID:this.ArmHid=a;break}n(a)}else i(a)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(i,o)=>{i&&o==0?t(o):n(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,a)=>{if(o&&a.length>0)try{a=this.Base64.decode(a),n(a)}catch(c){console.error(c),n(a)}else i(a)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(i,o)=>{i&&o==0?t(o):n(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSwitchProtocol(e=Hn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armVerifyPIN(e,t=Ke.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(a,c)=>{a&&c==0?(this.ArmPin=e,i(c)):o(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(a,c)=>{a?(this.ArmData=c,i(c)):o(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(a,c)=>{a&&c==0?i(c):o(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(i,o)=>{i?(this.ArmData=o,t(o)):n(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,a)=>{o&&a==0?n(a):i(a)})})}}const Et="0123456789abcdeffedcba9876543210",At="4b0de988570c3a0f",kn=window.ENCRYPT;let ne=kn&&new _t;function gt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function wt(){return _(this,null,function*(){return ne||(ne=new _t),new Promise((r,e)=>{ne.armEnum().then(t=>{r(+t)}).catch(t=>{$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Zt.throttle(()=>_(exports,null,function*(){const r=yield wt(),e={};if(typeof r!="number"||r<=0)$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Nn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||($.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):($.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Fn(r=0){return _(this,null,function*(){return ne?new Promise((e,t)=>{ne.armGetDongleInfo(r).then(n=>{n?e(n):($.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):$.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Nn(){return _(this,null,function*(){if(!ne)return $.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield wt();let e=[];for(let t=0;t<r;t++){const n=yield Fn(t);e.push(n)}return e})}gt(16);gt(16);const St=window.meta.app.inspect?Y.SM4.constants.CBC:Y.SM4.constants.ECB,{publicKey:qr,privateKey:$r}=Y.SM2.generateKeyPair();function Ve(r,e,t={}){const n=It(At),i=t.mode||St;t=i===Y.SM4.constants.ECB?H({mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t):H({iv:Et,mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=Y.SM4.encrypt(r,n,t)}catch(a){console.log("err: ",a)}return o}function We(r,e,t={}){const n=It(At),i=t.mode||St;return t=i===Y.SM4.constants.ECB?H({mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t):H({iv:Et,mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t),Y.SM4.decrypt(r,n,t)}function It(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const oe=r=>{const{onClose:e,customClass:t}=r;return $.ElMessage(ce(H({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:i=>{e&&e(i)}}))};["success","warning","info","error"].forEach(r=>{oe[r]=e=>oe(typeof e=="string"?{type:r,message:e}:ce(H({},e),{type:r}))});ve.createPinia();const Te={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?We(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||ze(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?We(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||ze(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},Bn=(r,e)=>new Promise((t,n)=>{V.postApi("/filehandle/save",{path:r,data:e}).then(i=>{i.res.success?t(!0):n(!1)})});class Gn extends Q.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Q.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const ee=new Q.Vector3,qe=new Q.Matrix4,$e=new Q.Matrix4,Je=new Q.Vector3,Xe=new Q.Vector3;class zn{constructor(e={}){const t=this;let n,i,o,a;const c={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:n,height:i}},this.render=function(d,E){d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),E.parent===null&&E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),qe.copy(E.matrixWorldInverse),$e.multiplyMatrices(E.projectionMatrix,qe),I(d,d,E),K(d)},this.setSize=function(d,E){n=d,i=E,o=n/2,a=i/2,l.style.width=d+"px",l.style.height=E+"px"};function m(d){d.isCSS2DObject&&(d.element.style.display="none");for(let E=0,g=d.children.length;E<g;E++)m(d.children[E])}function I(d,E,g){if(d.visible===!1){m(d);return}if(d.isCSS2DObject){ee.setFromMatrixPosition(d.matrixWorld),ee.applyMatrix4($e);const C=ee.z>=-1&&ee.z<=1&&d.layers.test(g.layers)===!0,p=d.element;p.style.display=C===!0?"":"none",C===!0&&(d.onBeforeRender(t,E,g),p.style.transform="translate("+-100*d.center.x+"%,"+-100*d.center.y+"%)translate("+(ee.x*o+o)+"px,"+(-ee.y*a+a)+"px)",p.parentNode!==l&&l.appendChild(p),d.onAfterRender(t,E,g));const A={distanceToCameraSquared:F(g,d)};c.objects.set(d,A)}for(let C=0,p=d.children.length;C<p;C++)I(d.children[C],E,g)}function F(d,E){return Je.setFromMatrixPosition(d.matrixWorld),Xe.setFromMatrixPosition(E.matrixWorld),Je.distanceToSquared(Xe)}function N(d){const E=[];return d.traverseVisible(function(g){g.isCSS2DObject&&E.push(g)}),E}function K(d){const E=N(d).sort(function(g,C){if(g.renderOrder!==C.renderOrder)return C.renderOrder-g.renderOrder;const p=c.objects.get(g).distanceToCameraSquared,A=c.objects.get(C).distanceToCameraSquared;return p-A});for(let g=0,C=E.length;g<C;g++)E[g].element.style.zIndex=1,console.log("🚀 ~ CSS2DRenderer ~ zOrder ~ sorted[i].element.style.zIndex:",E[g].element.style.zIndex)}}}const Kn={CSS2DObject:Gn,CSS2DRenderer:zn},Vn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',je='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',Wn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',qn={name:"局放测点",label:"局放测点",create:function(r,e){return _(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.zIndex="1";const i=document.createElement("div");i.style.width="1.3vw",i.style.height="1.3vw",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.cursor="pointer",i.style.pointerEvents="auto",i.style.userSelect="none",i.innerHTML=je;const o=document.createElement("style");o.innerHTML=`
5
+ */Object.defineProperty(fe,"__esModule",{value:!0});var te=typeof window!="undefined"?window.proxy||window:{},mt=function(r){te!=null&&te.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),te.qiankunName&&(window.moudleQiankunAppLifeCycles[te.qiankunName]=r))};fe.default=mt;var Ae=fe.qiankunWindow=te;fe.renderWithQiankun=mt;function nn(){return window.__POWERED_BY_WUJIE__||window.$wujie?le.WUJIE:window.__POWERED_BY_QIANKUN__||Ae!=null&&Ae.__POWERED_BY_QIANKUN__?le.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?le.MICROAPP:le.NONE}const ft="/";nn();const rn=location.origin;var et,tt,nt,rt,it,st,at,ot,ct,lt,ut,dt;const pt={savePath:((tt=(et=window.meta)==null?void 0:et.graph)==null?void 0:tt.savePath)||"/cockpit/drawing",graphPenPath:((rt=(nt=window.meta)==null?void 0:nt.graph)==null?void 0:rt.graphPenPath)||"/cockpit/graph",templatePath:((st=(it=window.meta)==null?void 0:it.graph)==null?void 0:st.templatePath)||"/cockpit/template",graphImgUploadPath:((ot=(at=window.meta)==null?void 0:at.graph)==null?void 0:ot.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((lt=(ct=window.meta)==null?void 0:ct.graph)==null?void 0:lt.threeSavePath)||"/cockpit/threed",threeModelPath:((dt=(ut=window.meta)==null?void 0:ut.graph)==null?void 0:dt.threeModelPath)||"/cockpit/models"},w=Yt.create({baseURL:rn,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>jt.stringify(r)});w.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r));w.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function sn(r,e={},t={}){return new Promise(n=>{w.get(r,H({params:e},t)).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function an(r,e={},t={}){return new Promise(n=>{w.post(r,e,t).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function on(r,e={},t={}){return w.get(r,H({params:e},t))}function cn(r,e={},t={}){return w.post(r,e,t)}function ln(r,e={}){return w.get(`/filehandle/${r}`,{params:e})}function un(r,e={},t={}){return w.post(`/filehandle/${r}`,e,t)}function dn(r,e={}){return w.get(`/user/${r}`,{params:e})}function hn(r,e={},t={}){return w.post(`/user/${r}`,e,t)}function mn(r,e={}){return w.get(`${r}`,e.local?{params:e,baseURL:ft}:{params:e})}function fn(r,e={}){return w.get(`/media/${r}/`,{params:e})}function pn(r,e={},t={}){return w.post(`/media/${r}/`,e,t)}function _n(r,e={}){return w.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function En(r,e={},t={}){return w.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function An(r,e={}){return w.get(`/history/${r}`,{params:e})}function gn(r,e={},t={}){return w.post(`/history/${r}`,e,t)}function wn(r,e={}){return w.get(`/scada/${r}`,{params:e})}function Sn(r,e={},t={}){return w.post(`/scada/${r}`,e,t)}function In(r,e={}){return w.get(`/common/factory/${r}`,{params:e})}function yn(r,e={},t={}){return w.post(`/common/factory/${r}`,e,t)}function Cn(r,e={}){return w.get(`/factory/${r}`,{params:e})}function Rn(r,e={},t={}){return w.post(`/factory/${r}`,e,t)}function xn(r,e={}){return w.get(`/pd/${r}`,{params:e})}function Dn(r,e={},t={}){return w.post(`/pd/${r}`,e,t)}const V={getApi:sn,postApi:an,getFileApi:ln,postFileApi:un,getBaseApi:on,postBaseApi:cn,getUserApi:dn,postUserApi:hn,getGraphApi:mn,getMediaApi:fn,postMediaApi:pn,getScadaApi:wn,postScadaApi:Sn,getCommonApi:_n,postCommonApi:En,getHistoryApi:An,postHistoryApi:gn,getFactoryApi:Cn,postFactoryApi:Rn,getCommonFactoryApi:In,postCommonFactoryApi:yn,getPDApi:xn,postPDApi:Dn},we=Qt();class vn{constructor(e={}){this._options=H({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:n,onError:i,onMessage:a,token:o}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[o]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(c)},this._client.onerror=c=>{i&&i(c)},this._client.onmessage=c=>{a&&a(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const Tn=[65535,-99999];function Pn(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function bn(r){return typeof r=="number"&&!Tn.includes(r)}const Mn=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[i,a]of t.entries())r[i]=a;return r};function ze(r){return Object.prototype.toString.call(r).slice(8,-1)}function Se(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function Ln(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,i,a,o,c,l;for(a=t.length,i=0,n="";i<a;){if(o=t.charCodeAt(i++)&255,i==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4),n+="==";break}if(c=t.charCodeAt(i++),i==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2),n+="=";break}l=t.charCodeAt(i++),n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2|(l&192)>>6),n+=r.charAt(l&63)}return n},this.decode=function(t){var n,i,a,o,c,l,m;for(l=t.length,c=0,m="";c<l;){do n=e[t.charCodeAt(c++)&255];while(c<l&&n==-1);if(n==-1)break;do i=e[t.charCodeAt(c++)&255];while(c<l&&i==-1);if(i==-1)break;m+=String.fromCharCode(n<<2|(i&48)>>4);do{if(a=t.charCodeAt(c++)&255,a==61)return m;a=e[a]}while(c<l&&a==-1);if(a==-1)break;m+=String.fromCharCode((i&15)<<4|(a&60)>>2);do{if(o=t.charCodeAt(c++)&255,o==61)return m;o=e[o]}while(c<l&&o==-1);if(o==-1)break;m+=String.fromCharCode((a&3)<<6|o)}return m},this.utf16to8=function(t){var n,i,a,o;for(n="",a=t.length,i=0;i<a;i++)o=t.charCodeAt(i),o>=1&&o<=127?n+=t.charAt(i):o>2047?(n+=String.fromCharCode(224|o>>12&15),n+=String.fromCharCode(128|o>>6&63),n+=String.fromCharCode(128|o>>0&63)):(n+=String.fromCharCode(192|o>>6&31),n+=String.fromCharCode(128|o>>0&63));return n},this.utf8to16=function(t){var n,i,a,o,c,l;for(n="",a=t.length,i=0;i<a;)switch(o=t.charCodeAt(i++),o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(i-1);break;case 12:case 13:c=t.charCodeAt(i++),n+=String.fromCharCode((o&31)<<6|c&63);break;case 14:c=t.charCodeAt(i++),l=t.charCodeAt(i++),n+=String.fromCharCode((o&15)<<12|(c&63)<<6|(l&63)<<0);break}return n},this.charToHex=function(t){var n,i,a;for(n="",i=0;i<t.length;)a=t.charCodeAt(i++).toString(16),n+="\\0x"+a,n+=i>0&&i%8==0?`\r
6
+ `:", ";return n}}function On(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function Un(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new On,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var i=Object.id(n).toString();this.callbacks_.add(i,n);var a={MsgId:i,Method:e+"|"+r};t&&(a.Param=JSON.stringify(t));var o=JSON.stringify(a);this.connect&&this.ws.send(o)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var i=this.callbacks_.getValue(n);i(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},i){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],i)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:i},a){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),i],a)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:i,DataInput:a},o){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(i),a],o)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:n},i){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],i)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:i},a){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(i)],a)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},i){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],i)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},i){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],i)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},i){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],i)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:i,PinFlag:a},o){this.exec("Arm_ChangePIN",[parseInt(e),a,n,t,parseInt(i)],o)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:i,RsaPriFileSize:a},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(i),parseInt(a),t,n],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:i,RsaPubFileSize:a},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(a),n,t,t.length,i],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},i){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],i)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:i},a){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,i],a)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},i){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],i)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:i},a){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,i],a)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:i},a){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,i],a)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:i},a){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,i],a)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},i){this.exec("Arm_HASH",[parseInt(e),t,n],i)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},i){this.exec("Arm_Seed",[parseInt(e),n,t],i)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:i,StartUserID:a,AdminTryCount:o,UserPin:c,UserTryCount:l,UpdateRSAPriKey:m},I){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(l),parseInt(o),m,parseInt(a),parseInt(i)],I)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:i,FileType:a,Offset:o,DataLen:c,DataBuffer:l,UpRSAPubKey:m},I){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,a,parseInt(i),parseInt(o),l,m,parseInt(c)],I)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:i,FileType:a,Offset:o,DataLen:c,DataBuffer:l},m){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,a,parseInt(i),parseInt(o),l,parseInt(c)],m)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},i){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],i)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:i,IsReset:a,IsDecOnRAM:o},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(i),parseInt(o),parseInt(a)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:i},a){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(i),parseInt(n)],a)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:i,CallLimit:a},o){this.exec("Arm_Set_EXE_FILE_INFO",[i,parseInt(n),parseInt(e),parseInt(a),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const Hn={HID:0},ue={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},Ke={USER:0};class _t{constructor(){j(this,"Base64",new Ln);j(this,"AtlCtrl",null);j(this,"ArmCount",0);j(this,"ArmIndex",0);j(this,"ArmHandle",0);j(this,"ArmRandom","");try{this.AtlCtrl=new Un("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,i)=>{n?(this.ArmCount=+i,e(i)):t(i)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(i,a)=>{i?(this.ArmHandle=+a,t(a)):(this.ArmHandle=a,n(a))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(i,a)=>{i?t(a):n(a)})})}armChangePIN(e,t,n=255,i=Ke.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:a,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:i},(l,m)=>{l&&m==0?(this.ArmPin=e,o(m)):c(m)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(a,o)=>{a?(this.ArmRandom=o,n(o)):i(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(i,a)=>{i?(this.ArmDeadline=a,t(a)):n(a)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(a,o)=>{a?(this.ArmUKey=o,n(o)):i(o)})})}armGetDongleInfo(e=0,t=ue.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,i)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(a,o)=>{if(a){switch(t){case ue.USER_ID:this.ArmUid=o;break;case ue.PRODUCT_ID:this.ArmPid=o;break;case ue.HARDWARE_ID:this.ArmHid=o;break}n(o)}else i(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(i,a)=>{i&&a==0?t(a):n(a)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(a,o)=>{if(a&&o.length>0)try{o=this.Base64.decode(o),n(o)}catch(c){console.error(c),n(o)}else i(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(i,a)=>{i&&a==0?t(a):n(a)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSwitchProtocol(e=Hn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armVerifyPIN(e,t=Ke.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(o,c)=>{o&&c==0?(this.ArmPin=e,i(c)):a(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(o,c)=>{o?(this.ArmData=c,i(c)):a(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(o,c)=>{o&&c==0?i(c):a(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(i,a)=>{i?(this.ArmData=a,t(a)):n(a)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(a,o)=>{a&&o==0?n(o):i(o)})})}}const Et="0123456789abcdeffedcba9876543210",At="4b0de988570c3a0f",kn=window.ENCRYPT;let ne=kn&&new _t;function gt(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function wt(){return _(this,null,function*(){return ne||(ne=new _t),new Promise((r,e)=>{ne.armEnum().then(t=>{r(+t)}).catch(t=>{$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}Zt.throttle(()=>_(exports,null,function*(){const r=yield wt(),e={};if(typeof r!="number"||r<=0)$.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield Nn();if(!e.token)return;t.length?t.includes(e.ukeyHid)||($.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):($.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Fn(r=0){return _(this,null,function*(){return ne?new Promise((e,t)=>{ne.armGetDongleInfo(r).then(n=>{n?e(n):($.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):$.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function Nn(){return _(this,null,function*(){if(!ne)return $.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield wt();let e=[];for(let t=0;t<r;t++){const n=yield Fn(t);e.push(n)}return e})}gt(16);gt(16);const St=window.meta.app.inspect?Y.SM4.constants.CBC:Y.SM4.constants.ECB,{publicKey:qr,privateKey:$r}=Y.SM2.generateKeyPair();function Ve(r,e,t={}){const n=It(At),i=t.mode||St;t=i===Y.SM4.constants.ECB?H({mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t):H({iv:Et,mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t);let a="";try{a=Y.SM4.encrypt(r,n,t)}catch(o){console.log("err: ",o)}return a}function We(r,e,t={}){const n=It(At),i=t.mode||St;return t=i===Y.SM4.constants.ECB?H({mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t):H({iv:Et,mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t),Y.SM4.decrypt(r,n,t)}function It(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const ae=r=>{const{onClose:e,customClass:t}=r;return $.ElMessage(ce(H({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:i=>{e&&e(i)}}))};["success","warning","info","error"].forEach(r=>{ae[r]=e=>ae(typeof e=="string"?{type:r,message:e}:ce(H({},e),{type:r}))});ve.createPinia();const Te={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?We(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||ze(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?We(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?Ve(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||ze(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},Bn=(r,e)=>new Promise((t,n)=>{V.postApi("/filehandle/save",{path:r,data:e}).then(i=>{i.res.success?t(!0):n(!1)})});class Gn extends Q.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Q.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const ee=new Q.Vector3,qe=new Q.Matrix4,$e=new Q.Matrix4,Je=new Q.Vector3,Xe=new Q.Vector3;class zn{constructor(e={}){const t=this;let n,i,a,o;const c={objects:new WeakMap},l=e.element!==void 0?e.element:document.createElement("div");l.style.overflow="hidden",this.domElement=l,this.getSize=function(){return{width:n,height:i}},this.render=function(d,E){d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),E.parent===null&&E.matrixWorldAutoUpdate===!0&&E.updateMatrixWorld(),qe.copy(E.matrixWorldInverse),$e.multiplyMatrices(E.projectionMatrix,qe),I(d,d,E),K(d)},this.setSize=function(d,E){n=d,i=E,a=n/2,o=i/2,l.style.width=d+"px",l.style.height=E+"px"};function m(d){d.isCSS2DObject&&(d.element.style.display="none");for(let E=0,g=d.children.length;E<g;E++)m(d.children[E])}function I(d,E,g){if(d.visible===!1){m(d);return}if(d.isCSS2DObject){ee.setFromMatrixPosition(d.matrixWorld),ee.applyMatrix4($e);const C=ee.z>=-1&&ee.z<=1&&d.layers.test(g.layers)===!0,p=d.element;p.style.display=C===!0?"":"none",C===!0&&(d.onBeforeRender(t,E,g),p.style.transform="translate("+-100*d.center.x+"%,"+-100*d.center.y+"%)translate("+(ee.x*a+a)+"px,"+(-ee.y*o+o)+"px)",p.parentNode!==l&&l.appendChild(p),d.onAfterRender(t,E,g));const A={distanceToCameraSquared:F(g,d)};c.objects.set(d,A)}for(let C=0,p=d.children.length;C<p;C++)I(d.children[C],E,g)}function F(d,E){return Je.setFromMatrixPosition(d.matrixWorld),Xe.setFromMatrixPosition(E.matrixWorld),Je.distanceToSquared(Xe)}function N(d){const E=[];return d.traverseVisible(function(g){g.isCSS2DObject&&E.push(g)}),E}function K(d){const E=N(d).sort(function(g,C){if(g.renderOrder!==C.renderOrder)return C.renderOrder-g.renderOrder;const p=c.objects.get(g).distanceToCameraSquared,A=c.objects.get(C).distanceToCameraSquared;return p-A});for(let g=0,C=E.length;g<C;g++)E[g].element.style.zIndex=1,console.log("🚀 ~ CSS2DRenderer ~ zOrder ~ sorted[i].element.style.zIndex:",E[g].element.style.zIndex)}}}const Kn={CSS2DObject:Gn,CSS2DRenderer:zn},Vn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',je='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',Wn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',qn={name:"局放测点",label:"局放测点",create:function(r,e){return _(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.zIndex="1";const i=document.createElement("div");i.style.width="1.3vw",i.style.height="1.3vw",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.cursor="pointer",i.style.pointerEvents="auto",i.style.userSelect="none",i.innerHTML=je;const a=document.createElement("style");a.innerHTML=`
7
7
  .icon { width: 100%; height: 100%; display: block; }
8
- `,n.append(o),n.append(i);const a=document.createElement("div");Object.assign(a.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),r.valueEleId||(r.valueEleId=Se()),a.innerHTML=`
8
+ `,n.append(a),n.append(i);const o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),r.valueEleId||(r.valueEleId=Se()),o.innerHTML=`
9
9
  <div style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${r.name}</div>
10
10
  <div style="font-size: 14px; color: #cae4ff;">幅值峰值</div>
11
11
  <div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
12
12
  <span id="${r.valueEleId}" style="font-size: 24px;font-weight: 600;">${r.value}</span>
13
13
  <span style="font-size: 14px;">dBm</span>
14
14
  </div>
15
- `;const c=new en.CSS2DObject(n);c.name=r.name,c.dataId=r.guid,c.userData.params=r,i.addEventListener("mouseover",()=>{a.style.display="flex",n.className="top-info"}),i.addEventListener("mouseleave",()=>{a.style.display="none",n.className=""}),i.addEventListener("click",()=>{we.emit("three-event",{type:"pd-sensor-click",data:c}),r.preview||setTimeout(()=>{t.attach(c)},100)}),n.append(a);const l=I=>{I===0?i.innerHTML=je:I===1?i.innerHTML=Vn:I===2&&(i.innerHTML=Wn)},m=I=>{const F=document.getElementById(r.valueEleId);F&&(F.innerText=I)};return c.changeState=l,c.changeValue=m,setTimeout(()=>{l(r.state),m(r.value)},200),c})},getStorage:function(r){return r.userData.params}};var ht;M.config(H({driver:[M.INDEXEDDB,M.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((ht=window.meta.storage)==null?void 0:ht.config)||{}));function $n(){return{getKey:d=>_(this,null,function*(){return yield M.key(d)}),getKeys:()=>_(this,null,function*(){return yield M.keys()}),getItem:d=>_(this,null,function*(){if(d)return yield M.getItem(d)}),setItem:(d,E)=>_(this,null,function*(){if(d)return yield M.setItem(d,E)}),removeItem:d=>_(this,null,function*(){if(d)return yield M.removeItem(d)}),clearItems:()=>_(this,null,function*(){return yield M.clear()}),iterateItems:(d,E)=>_(this,null,function*(){if(d)return yield M.iterate(d,E)}),getReady:()=>_(this,null,function*(){return yield M.ready()}),getLength:()=>_(this,null,function*(){return yield M.length()}),getDriver:()=>_(this,null,function*(){return yield M.driver()}),setDriver:d=>_(this,null,function*(){if(d)return yield M.setDriver(d)}),setConfig:d=>_(this,null,function*(){if(d)return yield M.config(d)}),dropInstance:d=>_(this,null,function*(){if(d)return yield M.dropInstance(d)}),createInstance:d=>_(this,null,function*(){if(d)return yield M.createInstance(d)})}}const Jn="THREED_LOG_BUFFER",Xn="THREED_CURRSCENE",jn="THREED_ACTIVE_MENU",Yn="THREED_PIXEL_RATIO",de="THREED_MODEL_DBNAME",Ie="THREED_MODEL_DBSTORE",Qn="THREED_SCENE_PREVIEW",ye="THREED_MODEL_LOAD_KEY",se="THREED_PREVIEW_URL_KEY",Zn="THREED_ADDON_EDITOR_JSON",er="THREED_SCENE_STORAGE_SUFFIX",Ce={step:.1},tr=80,yt=30,nr=1e3,rr=1200,ir=3e5,sr="三维测试",or="灯光",ar=1,cr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],Ct=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),lr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Rt=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),xt=new Set(["CSS2DObject","CSS3DObject"]),ur=Object.assign({"/src/views/threed/models/CSS2DRenderer.js":Kn,"/src/views/threed/models/pd-sensor.js":qn}),dr=Object.assign({}),hr={环境光:()=>new k.THREE.AmbientLight(16777215,1),平行光:()=>new k.THREE.DirectionalLight(16777215,1),点光源:()=>new k.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new k.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new k.THREE.HemisphereLight(16777215,0,1),平面光:()=>new k.THREE.RectAreaLight(16777215,1,100,100)},mr=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
15
+ `;const c=new en.CSS2DObject(n);c.name=r.name,c.dataId=r.guid,c.userData.params=r,i.addEventListener("mouseover",()=>{o.style.display="flex",n.className="top-info"}),i.addEventListener("mouseleave",()=>{o.style.display="none",n.className=""}),i.addEventListener("click",()=>{we.emit("three-event",{type:"pd-sensor-click",data:c}),r.preview||setTimeout(()=>{t.attach(c)},100)}),n.append(o);const l=I=>{I===0?i.innerHTML=je:I===1?i.innerHTML=Vn:I===2&&(i.innerHTML=Wn)},m=I=>{const F=document.getElementById(r.valueEleId);F&&(F.innerText=I)};return c.changeState=l,c.changeValue=m,setTimeout(()=>{l(r.state),m(r.value)},200),c})},getStorage:function(r){return r.userData.params}};var ht;M.config(H({driver:[M.INDEXEDDB,M.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((ht=window.meta.storage)==null?void 0:ht.config)||{}));function $n(){return{getKey:d=>_(this,null,function*(){return yield M.key(d)}),getKeys:()=>_(this,null,function*(){return yield M.keys()}),getItem:d=>_(this,null,function*(){if(d)return yield M.getItem(d)}),setItem:(d,E)=>_(this,null,function*(){if(d)return yield M.setItem(d,E)}),removeItem:d=>_(this,null,function*(){if(d)return yield M.removeItem(d)}),clearItems:()=>_(this,null,function*(){return yield M.clear()}),iterateItems:(d,E)=>_(this,null,function*(){if(d)return yield M.iterate(d,E)}),getReady:()=>_(this,null,function*(){return yield M.ready()}),getLength:()=>_(this,null,function*(){return yield M.length()}),getDriver:()=>_(this,null,function*(){return yield M.driver()}),setDriver:d=>_(this,null,function*(){if(d)return yield M.setDriver(d)}),setConfig:d=>_(this,null,function*(){if(d)return yield M.config(d)}),dropInstance:d=>_(this,null,function*(){if(d)return yield M.dropInstance(d)}),createInstance:d=>_(this,null,function*(){if(d)return yield M.createInstance(d)})}}const Jn="THREED_LOG_BUFFER",Xn="THREED_CURRSCENE",jn="THREED_ACTIVE_MENU",Yn="THREED_PIXEL_RATIO",de="THREED_MODEL_DBNAME",Ie="THREED_MODEL_DBSTORE",Qn="THREED_SCENE_PREVIEW",ye="THREED_MODEL_LOAD_KEY",se="THREED_PREVIEW_URL_KEY",Zn="THREED_ADDON_EDITOR_JSON",er="THREED_SCENE_STORAGE_SUFFIX",Ce={step:.1},tr=80,yt=30,nr=1e3,rr=1200,ir=3e5,sr="三维测试",ar="灯光",or=1,cr=["环境光","平行光","点光源","聚光灯","半球光","平面光"],Ct=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),lr=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],Rt=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),xt=new Set(["CSS2DObject","CSS3DObject"]),ur=Object.assign({"/src/views/threed/models/CSS2DRenderer.js":Kn,"/src/views/threed/models/pd-sensor.js":qn}),dr=Object.assign({}),hr={环境光:()=>new k.THREE.AmbientLight(16777215,1),平行光:()=>new k.THREE.DirectionalLight(16777215,1),点光源:()=>new k.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new k.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new k.THREE.HemisphereLight(16777215,0,1),平面光:()=>new k.THREE.RectAreaLight(16777215,1,100,100)},mr=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
16
16
  vec4 o = gl_FragColor.rgba;
17
17
  vec2 u = gl_FragCoord.xy;
18
18
  vec2 v = iResolution.xy;
@@ -50,4 +50,4 @@
50
50
  uv *= 2.0 * ( cos(iTime * 2.0) -2.5);
51
51
  float anim = sin(iTime * 12.0) * 0.1 + 1.0;
52
52
  vec3 col = cheap_star(uv, anim) * vec3(0.35,0.2,0.15);
53
- `,key:"col",commonFinish:!0,render:"iTime+speed"}];let ie=null,z=null;const Ye=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",Dt=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),fr=Dt(ur),pr=Dt(dr),_r=()=>({THREED_GUI_PARAMS:Ce,THREED_LOG_BUFFER:Jn,THREED_CURRSCENE:Xn,THREED_ACTIVE_MENU:jn,THREED_PIXEL_RATIO:Yn,THREED_IMPORT_SIZE:tr,THREED_LIGHT_TYPES:cr,THREED_EXPORT_BATCH:yt,THREED_RELOAD_DELAY:nr,THREED_MODEL_DBNAME:de,THREED_MODEL_DBSTORE:Ie,THREED_SCENE_PREVIEW:Qn,THREED_USER_DATA_KEYS:Ct,THREED_MODEL_LOAD_KEY:ye,THREED_PREVIEW_URL_KEY:se,THREED_ADDON_EDITOR_JSON:Zn,THREED_EXPORT_NODE_COUNT:rr,THREED_DEFAULT_SCENE_NAME:sr,THREED_DEFAULT_ACTIVE_MENU:or,THREED_DEFAULT_PIXEL_RATIO:ar,THREED_EXPORT_VERTEX_COUNT:ir,THREED_SCENE_EXCLUDE_TYPES:lr,THREED_EXPORT_EXCLUDE_TYPES:Rt,THREED_EXPORT_RUNTIME_TYPES:xt,THREED_SCENE_STORAGE_SUFFIX:er});function Er(){const{createInstance:r,dropInstance:e}=$n(),t="/";let n=[];const i=s=>{let u=URL.createObjectURL(s);return n.push(u),u},o=()=>{n.forEach(s=>URL.revokeObjectURL(s)),n=[]},a=()=>_(this,null,function*(){return yield m(),{clearRequest:c,getAllRequest:d,getRequest:K,status:!0,message:"数据库打开成功",DATABASE:z}}),c=s=>_(this,null,function*(){if(!s)return{status:!1,message:"删除失败"};yield m(),yield z.removeItem(s);const u=N();return u.list=u.list.filter(h=>h.name!==s),{status:!0,message:"删除成功"}}),l=(...u)=>_(this,[...u],function*(s=de){z=null,ie=null,yield e({name:s,storeName:Ie})}),m=()=>_(this,null,function*(){return z||(ie||(ie=r({name:de,storeName:Ie}).then(s=>(z=s,s))),yield ie)}),I=s=>{if(!s)return!1;const u=String(s.message||"");return s.name==="DataError"||u.includes("in-line keys")},F=()=>_(this,null,function*(){z=null,ie=null,yield e({name:de}),yield m()}),N=()=>(window.threeEditorDB||(window.threeEditorDB={db:null,list:[]}),window.threeEditorDB),K=s=>_(this,null,function*(){if(!s)return{status:!1,message:"获取失败"};yield m();const u=yield z.getItem(s);if(u!=null&&u.blob&&!s)return{status:!0,message:"获取成功",url:i(u.blob)};if(!s)return{status:!1,message:"获取失败"};const h=yield fetch(s).then(b=>b.blob()),f={blob:h};try{yield z.setItem(s,f)}catch(b){if(!I(b))throw b;yield F(),yield z.setItem(s,f)}const S=N(),B=H({name:s},f),P=S.list.findIndex(b=>b.name===s);return P>-1?S.list.splice(P,1,B):S.list.push(B),{status:!0,message:"文件缓存成功",url:i(h)}}),d=()=>_(this,null,function*(){const s=N();yield m();const u=[];return yield z.iterate((h,f)=>{u.push(ce(H({},h||{}),{name:f}))}),s.list=u,{status:!0,message:"获取成功",data:u}}),E=()=>_(this,null,function*(){var h;const{res:s}=yield V.getApi("/filehandle/scan",{path:pt.threeModelPath,extension:"glb,gltf"}),u=[];if(((h=s==null?void 0:s.children)==null?void 0:h.length)>0)for(const f of s.children)u.push({name:f.name,path:"/"+f.path});return u}),g=()=>window.GUI_PARAMS||Ce,C=()=>window.threeEditor||null,p=()=>window.editorJsons||[],A=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),v=()=>fr,y=()=>N(),L=()=>hr||{},R=()=>window[se]||"",x=()=>pr,O=()=>window.devicePixelRatio||1,T=()=>window[se]||"",U=()=>{const s=v(),u=x();return{modelDesigns:s,componentDesigns:u,modelList:s.map(h=>h.label),componentList:u.map(h=>h.label)}},G=(s,u)=>{var h;return(h=s==null?void 0:s.__DESIGNS__)==null?void 0:h.find(f=>f.label===u)},J=(s=0)=>!Number.isFinite(s)||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:s<1024*1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${(s/1024/1024/1024).toFixed(2)} GB`,Z=s=>{const u=window[ye];typeof u=="function"&&u(s)},X=s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z),re=s=>{var u,h;return!s||!s.visible||(u=s.userData)!=null&&u.excludeFromExport||s.isTransformControls||s.isHelper||s.isLight||s.isPoints||(h=s.type)!=null&&h.includes("Helper")||Rt.has(s.type)||xt.has(s.type)||s.isCSS2DObject||s.isCSS3DObject?!1:s.isMesh||s.isGroup||s.isObject3D||s.isLine},pe=(s,u)=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)?s:u,Pt=s=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)&&Number.isFinite(s.w)?s:{x:0,y:0,z:0,w:1},Oe=s=>{if(!(s!=null&&s.isObject3D))return;const u=pe(s.position,{x:0,y:0,z:0});s.position.set(u.x,u.y,u.z);const h=pe(s.scale,{x:1,y:1,z:1});s.scale.set(h.x===0?1:h.x,h.y===0?1:h.y,h.z===0?1:h.z);const f=pe(s.up,{x:0,y:1,z:0});s.up.set(f.x,f.y,f.z);const S=Pt(s.quaternion);s.quaternion.set(S.x,S.y,S.z,S.w),s.pivot&&!X(s.pivot)&&delete s.pivot,s.updateMatrix(),s.updateMatrixWorld(!1)},bt=(s,u="_blank")=>window.open(s,u),Mt=(s,u="")=>window.prompt(s,u),Lt=()=>window.location.reload(),Ot=()=>document.documentElement.classList.remove("dark"),Ut=s=>{if(!Array.isArray(s==null?void 0:s.__DESIGNS__))return U();const u=[...v(),...x()],h=new Set(s.__DESIGNS__.map(f=>Ye(f)));return u.forEach(f=>{const S=Ye(f);!S||h.has(S)||(h.add(S),s.__DESIGNS__.unshift(f))}),U()},Ht=s=>{if(!Array.isArray(s==null?void 0:s.__GLSLLIB__))return;const u=new Set(s.__GLSLLIB__.map(h=>h==null?void 0:h.name));mr.forEach(h=>{u.has(h.name)||(u.add(h.name),s.__GLSLLIB__.push(h))})},_e=(s={})=>{const u={};return Object.entries(s||{}).forEach(([h,f])=>{if(!(Ct.has(h)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){u[h]=f;return}if(Array.isArray(f)){try{u[h]=structuredClone(f)}catch(S){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{u[h]=structuredClone(f)}catch(S){return}}}),u},kt=(s=Ce)=>{window.GUI_PARAMS=s},Ft=s=>{window.threeEditor=s},Nt=s=>{window.threeEditorDB=s},Bt=s=>{window[ye]=s},Gt=(s="")=>{window[se]=s},zt=(s="")=>{window[se]=s},Ue=s=>{var h;const u=[];return(h=s==null?void 0:s.children)==null||h.forEach(f=>{re(f)&&u.push(f)}),u},He=(s=[])=>{const u={rootCount:s.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return s.forEach(h=>{h.traverse(f=>{var S,B,P;if(re(f)){u.nodeCount+=1,f.isMesh&&(u.meshCount+=1,u.vertexCount+=((P=(B=(S=f.geometry)==null?void 0:S.attributes)==null?void 0:B.position)==null?void 0:P.count)||0);return}f!==h&&(u.skippedCount+=1)})}),u},ke=()=>new Promise(s=>requestAnimationFrame(()=>setTimeout(s,0))),Fe=()=>new Promise(s=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>s(),{timeout:80});return}setTimeout(s,0)}),Kt=(s,u)=>_(this,null,function*(){var S;if(!re(s))return null;const h=s.clone(!1);h.userData=_e(s.userData),X(s.pivot)?h.pivot=new k.THREE.Vector3(s.pivot.x,s.pivot.y,s.pivot.z):"pivot"in h&&delete h.pivot,Oe(h);const f=[{source:s,clone:h}];for(;f.length;){const B=f.shift();for(const P of B.source.children){if(!re(P)){u.skippedCount+=1;continue}const b=P.clone(!1);b.userData=_e(P.userData),X(P.pivot)?b.pivot=new k.THREE.Vector3(P.pivot.x,P.pivot.y,P.pivot.z):"pivot"in b&&delete b.pivot,Oe(b),B.clone.add(b),f.push({source:P,clone:b}),u.processedCount+=1,u.processedCount%yt===0&&(yield(S=u.onProgress)==null?void 0:S.call(u,{processedCount:u.processedCount,totalCount:u.totalCount,skippedCount:u.skippedCount,progress:18+Math.min(u.processedCount/Math.max(u.totalCount,1)*54,54)}),yield ke())}}return h});return{baseUrl:t,getModels:E,getRequest:K,reloadPage:Lt,promptInput:Mt,waitForIdle:Fe,waitForPaint:ke,clearRequest:c,getGuiParams:g,setGuiParams:kt,getAllRequest:d,getEditorJsons:p,getThreeEditor:C,formatFileSize:J,setThreeEditor:Ft,removeDarkClass:Ot,openExternalUrl:bt,getThreedModels:v,getViewportSize:A,buildExportScene:(h,...f)=>_(this,[h,...f],function*(s,u={}){const S=Ue(s),B=He(S),P=new k.THREE.Scene,b={totalCount:B.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Vt of S){const Ne=yield Kt(Vt,b);Ne&&P.add(Ne),yield Fe()}return P.updateMatrixWorld(!0),B.skippedCount+=b.skippedCount,{exportScene:P,exportObjects:S,stats:B}}),createModelDbApi:a,getEditorPreviewSceneUrl:T,getThreeEditorDB:y,sanitizeUserData:_e,setThreeEditorDB:Nt,findThreedDesign:G,getThreedLightMap:L,collectExportStats:He,getPreviewSceneUrl:R,setEditorPreviewSceneUrl:zt,setPreviewSceneUrl:Gt,setModelLoadHander:Bt,isExportableObject:re,deleteThreeEditorDB:l,ensureThreeEditorDB:N,getDevicePixelRatio:O,getThreedComponents:x,collectExportObjects:Ue,resetModelDbInstance:F,ensureModelDbInstance:m,getLocalDesignMenuData:U,invokeModelLoadHandler:Z,isLegacyInlineKeyError:I,ensureThreedShaderLibrary:Ht,ensureThreedDesignRegistry:Ut,createBlobUrl:i,revokeModelObjectUrls:o}}const{THREED_LOG_BUFFER:Pe,THREED_CURRSCENE:he,THREED_ACTIVE_MENU:be,THREED_PIXEL_RATIO:Me,THREED_SCENE_PREVIEW:Le,THREED_ADDON_EDITOR_JSON:me,THREED_DEFAULT_SCENE_NAME:Ar,THREED_DEFAULT_ACTIVE_MENU:Re,THREED_DEFAULT_PIXEL_RATIO:xe,THREED_SCENE_STORAGE_SUFFIX:Qe}=_r(),gr=[Pe,he,be,Me,Le,me],q=(r,e)=>{const t=Te.getLocal(r);return t==null?e:t},W=(r,e)=>{r&&Te.setLocal(r,e)},ge=r=>{r&&Te.removeLocal(r)},wr=(r,e)=>{var n,i;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(o=>o.name===t)?t:((i=e[0])==null?void 0:i.name)||Ar},De=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],Ze=()=>{const r=[],e=q(he,{name:"",path:""}),t=Number.parseFloat(q(Me,xe));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!q(Le,!1),activeMenuTitle:q(be,Re)||Re,pixelRatio:Number.isFinite(t)&&t>0?t:xe,logarithmicDepthBuffer:q(Pe,!0)!==!1,addonEditorJson:De(q(me,[]))}},vt=ve.defineStore("threed",{state:()=>Ze(),actions:{getSceneList(){return _(this,null,function*(){var e;const r=yield V.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=wr(r,this.sceneList),W(he,this.sceneName)},createScene(r,e=""){return _(this,null,function*(){var c,l;const t=(c=r==null?void 0:r.trim)==null?void 0:c.call(r);if(!t||this.sceneList.some(m=>m.name===t))return!1;const n=pt.threeSavePath+"/"+Se()+".json",i=Se();if(!(yield V.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:i}]})).success)return!1;if(yield Bn(n,e)){const m=yield V.postCommonApi("threedfloorplan",{guid:i});if((l=m==null?void 0:m.data)!=null&&l.length)return this.sceneList=[...this.sceneList,m.data[0]],m.data[0]}return!0})},deleteScene(r){return _(this,null,function*(){var n;if(!r)return;if(!(yield V.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(i=>i.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return _(this,null,function*(){this.currScene=r,W(he,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,W(Le,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||Re,W(be,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:xe,W(Me,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,W(Pe,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${Qe}`},getSceneStorageParams(r,e=null){return q(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&W(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&ge(this.getSceneStorageKey(r))},resetTaskState(){return _(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=De(q(me,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=De(r),W(me,this.addonEditorJson)},clearThreedStorage(){gr.forEach(e=>ge(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(Qe)).forEach(e=>ge(e));const r=Ze();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),Sr={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Ir={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},yr={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},Cr={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},Rr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},xr={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},Dr={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},vr=[],Tr=[],Pr=[],br=[],Mr=[],Lr=[],Or={},Ur=[],Hr={viewAngleList:[],clipping:{size:20,clipList:[]}},kr={scene:Sr,perspectiveCamera:Ir,webglRenderer:yr,orbitControls:Cr,transformControls:Rr,effectComposer:xr,handler:Dr,lightCores:vr,innerCores:Tr,modelCores:Pr,drawCores:br,textCores:Mr,particleCores:Lr,geoCores:Or,designCores:Ur,other:Hr},Tt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},Fr=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){var L;const n=t,i=r,o=vt(),{currScene:a}=ve.storeToRefs(o),c=((L=window.meta.threed)==null?void 0:L.draco_path)||ft;k.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let l=null,m=null;const I=D.ref(null),{setGuiParams:F,getDevicePixelRatio:N,getThreeEditorDB:K,createBlobUrl:d,revokeModelObjectUrls:E,ensureThreedDesignRegistry:g}=Er();g(k.ThreeEditor),F({step:.1});const C=()=>{var R;return(R=l==null?void 0:l.renderSceneResize)==null?void 0:R.call(l)},p=()=>_(this,null,function*(){var x,O;let R=kr;try{if(i.data&&Object.keys(i.data).length)R=i.data;else if((x=a.value)!=null&&x.path){const T=yield V.getApi((O=a.value)==null?void 0:O.path).catch(()=>({}));console.log("初始化三维场景:",T),T.res&&(R=T.res)}l?l.resetEditorStorage(R):l=new k.ThreeEditor(I.value,{fps:null,pixelRatio:N()*o.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:o.logarithmicDepthBuffer},sceneParams:A(R)})}catch(T){console.error("三维图纸初始化失败",T),l==null||l.resetEditorStorage(R)}finally{l&&setTimeout(()=>{i.preview&&(l.handler.mode="none",l.handler.helpers.axes.showAxes=!1,l.handler.helpers.box3.useBox3=!1,l.handler.helpers.grid.showGrid=!1)},200),v()}n("emit-three-editor",l),window.addEventListener("resize",C)}),A=R=>{E(),R.designCores.forEach(U=>{U.preview=i.preview});const x=K(),O=x.list||[],T=structuredClone(R||{});return T.modelCores=(T.modelCores||[]).filter(U=>{const G=U.modelInfo.originPath;if(G){const J=O.find(X=>X.name===G);if(!J){const X=x.db.getRequest(G);U.modelInfo.url=X.url;return}const Z=d(J.blob);U.modelInfo.url=Z}return!0}),T},v=()=>{l!=null&&l.renderer&&(m=new k.THREE.PMREMGenerator(l.renderer),m.compileEquirectangularShader(),l.scene.environment=m.fromScene(new tn.RoomEnvironment).texture)},y=()=>l;return D.watch(()=>a.value.path,()=>_(this,null,function*(){p()})),D.watch(()=>i.data,()=>{p()},{deep:!0}),D.onMounted(()=>{p()}),D.onUnmounted(()=>{window.removeEventListener("resize",C),E(),l==null||l.destroySceneRender(),o.setCurrScene({name:"",path:""})}),e({getEditorInstance:y}),(R,x)=>(D.openBlock(),D.createElementBlock("div",{ref_key:"editorRef",ref:I,class:"threed-editor",onDragover:x[0]||(x[0]=D.withModifiers(()=>{},["prevent"])),onDrop:x[1]||(x[1]=D.withModifiers(()=>{},["prevent"]))},null,544))}}),Nr=Tt(Fr,[["__scopeId","data-v-a95a7094"]]),Br={class:"threed-preview"},Gr=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(r,{expose:e,emit:t}){const n=r,i=t;let o=D.shallowRef({});const a=D.ref(),c=vt();let l={},m=null,I=null;const F=p=>{var v,y,L;if(!p)return;if((v=p==null?void 0:p.includes)!=null&&v.call(p,"token 必传"))return oe({message:p,type:"warning"});const A=typeof p=="string"?JSON.parse(p):p;if((A==null?void 0:A.data)==="服务错误"||(L=(y=A==null?void 0:A.data)==null?void 0:y.includes)!=null&&L.call(y,"token is expired"))return oe({message:A.data,type:"warning"});switch(A.action){case Ge.ACPOINT.YCVALUE:case Ge.ACPOINT.YXVALUE:console.warn("遥测信息");break}},N=()=>{try{I=new vn({socketUrl:n.socketUrl,token:n.token,onMessage:F})}catch(p){console.warn("三维场景消息处理失败",p)}},K=()=>_(this,null,function*(){var p;if(l){const A=Object.keys(l);if(A.length){const v=yield V.postPDApi("querychannelstatus/",{data:A.map(y=>({ied_id:y,ln_list:l[y].map(L=>L.ln_id)}))});(p=v==null?void 0:v.data)!=null&&p.length&&A.forEach(y=>{const L=v.data.find(x=>x.ied_id===y),R=l[y];R!=null&&R.length&&R.forEach(x=>{const O=L.result.find(T=>T.ln_id===x.ln_id);if(O){const T=C();if(!(T!=null&&T.scene))return;const U=T.scene.getObjectsByProperty("dataId",x.guid);let G=U==null?void 0:U[0];if(G){const J=O.status==="告警"?2:O.status==="正常"?1:0;G.userData.params.state=J;const Z=Pn(O.amp_peak)?bn(Number(O.amp_peak))?Number(O.amp_peak):0:O.amp_peak;G.userData.params.value=Z;debugger;G.changeState(J),G.changeValue(Z)}}})})}}}),d=p=>{i("graph-event",p)},E=p=>{p&&(n.socketUrl&&N(),setTimeout(()=>{const A=p.scene.getObjectsByProperty("designType","局放测点");A.forEach(v=>{const{ied_id:y,ln_id:L}=v.userData.params;l[y]||(l[y]=[]),l[y].push({guid:v.dataId,id:v.uuid,ied_id:y,ln_id:L})}),A!=null&&A.length&&(m&&clearInterval(m),K(),m=setInterval(()=>{K()},2e3)),i("loaded",p)},100))},g=()=>_(this,null,function*(){if(o.value&&Object.keys(o.value).length)return;const p=Mn(),A=n.url||p.url;if(A){const L=yield V.getApi(A).catch(()=>({}));L.res&&(o.value=L.res);return}if(!(n.id||p.id)){console.warn("三维场景渲染失败,场景id为空!");return}const y=yield V.getCommonApi("threedfloorplan",{guid:n.id});y.data.length?c.setCurrScene(y.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),C=()=>a.value?a.value.getEditorInstance():null;return D.watch(()=>n.data,p=>{o.value=p,g()},{deep:!0,immediate:!0}),D.watch(()=>n.id,()=>{g()},{deep:!0,immediate:!0}),D.onMounted(()=>{we.on("three-event",d)}),D.onUnmounted(()=>{I&&I.destroy(),we.off("three-event",d)}),e({getEditorInstance:C}),(p,A)=>(D.openBlock(),D.createElementBlock("div",Br,[D.createVNode(Nr,{ref_key:"threedEditorRef",ref:a,data:D.unref(o),preview:"",onGraphEvent:d,onEmitThreeEditor:E},null,8,["data"])]))}}),ae=Tt(Gr,[["__scopeId","data-v-7a310c71"]]);ae.name||(ae.name="SyThree");const zr=r=>{r.component(ae.name||"SyThree",ae)},Kr={install:zr};exports.SyThree=ae;exports.default=Kr;
53
+ `,key:"col",commonFinish:!0,render:"iTime+speed"}];let ie=null,z=null;const Ye=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",Dt=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),fr=Dt(ur),pr=Dt(dr),_r=()=>({THREED_GUI_PARAMS:Ce,THREED_LOG_BUFFER:Jn,THREED_CURRSCENE:Xn,THREED_ACTIVE_MENU:jn,THREED_PIXEL_RATIO:Yn,THREED_IMPORT_SIZE:tr,THREED_LIGHT_TYPES:cr,THREED_EXPORT_BATCH:yt,THREED_RELOAD_DELAY:nr,THREED_MODEL_DBNAME:de,THREED_MODEL_DBSTORE:Ie,THREED_SCENE_PREVIEW:Qn,THREED_USER_DATA_KEYS:Ct,THREED_MODEL_LOAD_KEY:ye,THREED_PREVIEW_URL_KEY:se,THREED_ADDON_EDITOR_JSON:Zn,THREED_EXPORT_NODE_COUNT:rr,THREED_DEFAULT_SCENE_NAME:sr,THREED_DEFAULT_ACTIVE_MENU:ar,THREED_DEFAULT_PIXEL_RATIO:or,THREED_EXPORT_VERTEX_COUNT:ir,THREED_SCENE_EXCLUDE_TYPES:lr,THREED_EXPORT_EXCLUDE_TYPES:Rt,THREED_EXPORT_RUNTIME_TYPES:xt,THREED_SCENE_STORAGE_SUFFIX:er});function Er(){const{createInstance:r,dropInstance:e}=$n(),t="/";let n=[];const i=s=>{let u=URL.createObjectURL(s);return n.push(u),u},a=()=>{n.forEach(s=>URL.revokeObjectURL(s)),n=[]},o=()=>_(this,null,function*(){return yield m(),{clearRequest:c,getAllRequest:d,getRequest:K,status:!0,message:"数据库打开成功",DATABASE:z}}),c=s=>_(this,null,function*(){if(!s)return{status:!1,message:"删除失败"};yield m(),yield z.removeItem(s);const u=yield N();return u.list=u.list.filter(h=>h.name!==s),{status:!0,message:"删除成功"}}),l=(...u)=>_(this,[...u],function*(s=de){z=null,ie=null,yield e({name:s,storeName:Ie})}),m=()=>_(this,null,function*(){return z||(ie||(ie=r({name:de,storeName:Ie}).then(s=>(z=s,s))),yield ie)}),I=s=>{if(!s)return!1;const u=String(s.message||"");return s.name==="DataError"||u.includes("in-line keys")},F=()=>_(this,null,function*(){z=null,ie=null,yield e({name:de}),yield m()}),N=()=>_(this,null,function*(){if(!window.threeEditorDB){const s=yield o(),{data:u}=yield s.getAllRequest();window.threeEditorDB={db:s,list:u}}return window.threeEditorDB}),K=s=>_(this,null,function*(){if(!s)return{status:!1,message:"获取失败"};yield m();const u=yield z.getItem(s);if(u!=null&&u.blob&&!s)return{status:!0,message:"获取成功",url:i(u.blob)};if(!s)return{status:!1,message:"获取失败"};const h=yield fetch(s).then(b=>b.blob()),f={blob:h};try{yield z.setItem(s,f)}catch(b){if(!I(b))throw b;yield F(),yield z.setItem(s,f)}const S=yield N(),B=H({name:s},f),P=S.list.findIndex(b=>b.name===s);return P>-1?S.list.splice(P,1,B):S.list.push(B),{status:!0,message:"文件缓存成功",url:i(h)}}),d=()=>_(this,null,function*(){const s=yield N();yield m();const u=[];return yield z.iterate((h,f)=>{u.push(ce(H({},h||{}),{name:f}))}),s.list=u,{status:!0,message:"获取成功",data:u}}),E=()=>_(this,null,function*(){var h;const{res:s}=yield V.getApi("/filehandle/scan",{path:pt.threeModelPath,extension:"glb,gltf"}),u=[];if(((h=s==null?void 0:s.children)==null?void 0:h.length)>0)for(const f of s.children)u.push({name:f.name,path:"/"+f.path});return u}),g=()=>window.GUI_PARAMS||Ce,C=()=>window.threeEditor||null,p=()=>window.editorJsons||[],A=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),v=()=>fr,y=()=>N(),L=()=>hr||{},R=()=>window[se]||"",x=()=>pr,O=()=>window.devicePixelRatio||1,T=()=>window[se]||"",U=()=>{const s=v(),u=x();return{modelDesigns:s,componentDesigns:u,modelList:s.map(h=>h.label),componentList:u.map(h=>h.label)}},G=(s,u)=>{var h;return(h=s==null?void 0:s.__DESIGNS__)==null?void 0:h.find(f=>f.label===u)},J=(s=0)=>!Number.isFinite(s)||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:s<1024*1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${(s/1024/1024/1024).toFixed(2)} GB`,Z=s=>{const u=window[ye];typeof u=="function"&&u(s)},X=s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z),re=s=>{var u,h;return!s||!s.visible||(u=s.userData)!=null&&u.excludeFromExport||s.isTransformControls||s.isHelper||s.isLight||s.isPoints||(h=s.type)!=null&&h.includes("Helper")||Rt.has(s.type)||xt.has(s.type)||s.isCSS2DObject||s.isCSS3DObject?!1:s.isMesh||s.isGroup||s.isObject3D||s.isLine},pe=(s,u)=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)?s:u,Pt=s=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)&&Number.isFinite(s.w)?s:{x:0,y:0,z:0,w:1},Oe=s=>{if(!(s!=null&&s.isObject3D))return;const u=pe(s.position,{x:0,y:0,z:0});s.position.set(u.x,u.y,u.z);const h=pe(s.scale,{x:1,y:1,z:1});s.scale.set(h.x===0?1:h.x,h.y===0?1:h.y,h.z===0?1:h.z);const f=pe(s.up,{x:0,y:1,z:0});s.up.set(f.x,f.y,f.z);const S=Pt(s.quaternion);s.quaternion.set(S.x,S.y,S.z,S.w),s.pivot&&!X(s.pivot)&&delete s.pivot,s.updateMatrix(),s.updateMatrixWorld(!1)},bt=(s,u="_blank")=>window.open(s,u),Mt=(s,u="")=>window.prompt(s,u),Lt=()=>window.location.reload(),Ot=()=>document.documentElement.classList.remove("dark"),Ut=s=>{if(!Array.isArray(s==null?void 0:s.__DESIGNS__))return U();const u=[...v(),...x()],h=new Set(s.__DESIGNS__.map(f=>Ye(f)));return u.forEach(f=>{const S=Ye(f);!S||h.has(S)||(h.add(S),s.__DESIGNS__.unshift(f))}),U()},Ht=s=>{if(!Array.isArray(s==null?void 0:s.__GLSLLIB__))return;const u=new Set(s.__GLSLLIB__.map(h=>h==null?void 0:h.name));mr.forEach(h=>{u.has(h.name)||(u.add(h.name),s.__GLSLLIB__.push(h))})},_e=(s={})=>{const u={};return Object.entries(s||{}).forEach(([h,f])=>{if(!(Ct.has(h)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){u[h]=f;return}if(Array.isArray(f)){try{u[h]=structuredClone(f)}catch(S){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{u[h]=structuredClone(f)}catch(S){return}}}),u},kt=(s=Ce)=>{window.GUI_PARAMS=s},Ft=s=>{window.threeEditor=s},Nt=s=>{window.threeEditorDB=s},Bt=s=>{window[ye]=s},Gt=(s="")=>{window[se]=s},zt=(s="")=>{window[se]=s},Ue=s=>{var h;const u=[];return(h=s==null?void 0:s.children)==null||h.forEach(f=>{re(f)&&u.push(f)}),u},He=(s=[])=>{const u={rootCount:s.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return s.forEach(h=>{h.traverse(f=>{var S,B,P;if(re(f)){u.nodeCount+=1,f.isMesh&&(u.meshCount+=1,u.vertexCount+=((P=(B=(S=f.geometry)==null?void 0:S.attributes)==null?void 0:B.position)==null?void 0:P.count)||0);return}f!==h&&(u.skippedCount+=1)})}),u},ke=()=>new Promise(s=>requestAnimationFrame(()=>setTimeout(s,0))),Fe=()=>new Promise(s=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>s(),{timeout:80});return}setTimeout(s,0)}),Kt=(s,u)=>_(this,null,function*(){var S;if(!re(s))return null;const h=s.clone(!1);h.userData=_e(s.userData),X(s.pivot)?h.pivot=new k.THREE.Vector3(s.pivot.x,s.pivot.y,s.pivot.z):"pivot"in h&&delete h.pivot,Oe(h);const f=[{source:s,clone:h}];for(;f.length;){const B=f.shift();for(const P of B.source.children){if(!re(P)){u.skippedCount+=1;continue}const b=P.clone(!1);b.userData=_e(P.userData),X(P.pivot)?b.pivot=new k.THREE.Vector3(P.pivot.x,P.pivot.y,P.pivot.z):"pivot"in b&&delete b.pivot,Oe(b),B.clone.add(b),f.push({source:P,clone:b}),u.processedCount+=1,u.processedCount%yt===0&&(yield(S=u.onProgress)==null?void 0:S.call(u,{processedCount:u.processedCount,totalCount:u.totalCount,skippedCount:u.skippedCount,progress:18+Math.min(u.processedCount/Math.max(u.totalCount,1)*54,54)}),yield ke())}}return h});return{baseUrl:t,getModels:E,getRequest:K,reloadPage:Lt,promptInput:Mt,waitForIdle:Fe,waitForPaint:ke,clearRequest:c,getGuiParams:g,setGuiParams:kt,getAllRequest:d,getEditorJsons:p,getThreeEditor:C,formatFileSize:J,setThreeEditor:Ft,removeDarkClass:Ot,openExternalUrl:bt,getThreedModels:v,getViewportSize:A,buildExportScene:(h,...f)=>_(this,[h,...f],function*(s,u={}){const S=Ue(s),B=He(S),P=new k.THREE.Scene,b={totalCount:B.nodeCount,processedCount:0,skippedCount:0,onProgress:u.onProgress};for(const Vt of S){const Ne=yield Kt(Vt,b);Ne&&P.add(Ne),yield Fe()}return P.updateMatrixWorld(!0),B.skippedCount+=b.skippedCount,{exportScene:P,exportObjects:S,stats:B}}),createModelDbApi:o,getEditorPreviewSceneUrl:T,getThreeEditorDB:y,sanitizeUserData:_e,setThreeEditorDB:Nt,findThreedDesign:G,getThreedLightMap:L,collectExportStats:He,getPreviewSceneUrl:R,setEditorPreviewSceneUrl:zt,setPreviewSceneUrl:Gt,setModelLoadHander:Bt,isExportableObject:re,deleteThreeEditorDB:l,ensureThreeEditorDB:N,getDevicePixelRatio:O,getThreedComponents:x,collectExportObjects:Ue,resetModelDbInstance:F,ensureModelDbInstance:m,getLocalDesignMenuData:U,invokeModelLoadHandler:Z,isLegacyInlineKeyError:I,ensureThreedShaderLibrary:Ht,ensureThreedDesignRegistry:Ut,createBlobUrl:i,revokeModelObjectUrls:a}}const{THREED_LOG_BUFFER:Pe,THREED_CURRSCENE:he,THREED_ACTIVE_MENU:be,THREED_PIXEL_RATIO:Me,THREED_SCENE_PREVIEW:Le,THREED_ADDON_EDITOR_JSON:me,THREED_DEFAULT_SCENE_NAME:Ar,THREED_DEFAULT_ACTIVE_MENU:Re,THREED_DEFAULT_PIXEL_RATIO:xe,THREED_SCENE_STORAGE_SUFFIX:Qe}=_r(),gr=[Pe,he,be,Me,Le,me],q=(r,e)=>{const t=Te.getLocal(r);return t==null?e:t},W=(r,e)=>{r&&Te.setLocal(r,e)},ge=r=>{r&&Te.removeLocal(r)},wr=(r,e)=>{var n,i;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(a=>a.name===t)?t:((i=e[0])==null?void 0:i.name)||Ar},De=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],Ze=()=>{const r=[],e=q(he,{name:"",path:""}),t=Number.parseFloat(q(Me,xe));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!q(Le,!1),activeMenuTitle:q(be,Re)||Re,pixelRatio:Number.isFinite(t)&&t>0?t:xe,logarithmicDepthBuffer:q(Pe,!0)!==!1,addonEditorJson:De(q(me,[]))}},vt=ve.defineStore("threed",{state:()=>Ze(),actions:{getSceneList(){return _(this,null,function*(){var e;const r=yield V.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=wr(r,this.sceneList),W(he,this.sceneName)},createScene(r,e=""){return _(this,null,function*(){var c,l;const t=(c=r==null?void 0:r.trim)==null?void 0:c.call(r);if(!t||this.sceneList.some(m=>m.name===t))return!1;const n=pt.threeSavePath+"/"+Se()+".json",i=Se();if(!(yield V.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:i}]})).success)return!1;if(yield Bn(n,e)){const m=yield V.postCommonApi("threedfloorplan",{guid:i});if((l=m==null?void 0:m.data)!=null&&l.length)return this.sceneList=[...this.sceneList,m.data[0]],m.data[0]}return!0})},deleteScene(r){return _(this,null,function*(){var n;if(!r)return;if(!(yield V.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(i=>i.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return _(this,null,function*(){this.currScene=r,W(he,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,W(Le,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||Re,W(be,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:xe,W(Me,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,W(Pe,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${Qe}`},getSceneStorageParams(r,e=null){return q(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&W(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&ge(this.getSceneStorageKey(r))},resetTaskState(){return _(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=De(q(me,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=De(r),W(me,this.addonEditorJson)},clearThreedStorage(){gr.forEach(e=>ge(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(Qe)).forEach(e=>ge(e));const r=Ze();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),Sr={backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},Ir={fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},yr={outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},Cr={autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},Rr={mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},xr={renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},Dr={mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},vr=[],Tr=[],Pr=[],br=[],Mr=[],Lr=[],Or={},Ur=[],Hr={viewAngleList:[],clipping:{size:20,clipList:[]}},kr={scene:Sr,perspectiveCamera:Ir,webglRenderer:yr,orbitControls:Cr,transformControls:Rr,effectComposer:xr,handler:Dr,lightCores:vr,innerCores:Tr,modelCores:Pr,drawCores:br,textCores:Mr,particleCores:Lr,geoCores:Or,designCores:Ur,other:Hr},Tt=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},Fr=Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){var L;const n=t,i=r,a=vt(),{currScene:o}=ve.storeToRefs(a),c=((L=window.meta.threed)==null?void 0:L.draco_path)||ft;k.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let l=null,m=null;const I=D.ref(null),{setGuiParams:F,getDevicePixelRatio:N,getThreeEditorDB:K,createBlobUrl:d,revokeModelObjectUrls:E,ensureThreedDesignRegistry:g}=Er();g(k.ThreeEditor),F({step:.1});const C=()=>{var R;return(R=l==null?void 0:l.renderSceneResize)==null?void 0:R.call(l)},p=()=>_(this,null,function*(){var x,O;let R=kr;try{if(i.data&&Object.keys(i.data).length)R=i.data;else if((x=o.value)!=null&&x.path){const T=yield V.getApi((O=o.value)==null?void 0:O.path).catch(()=>({}));console.log("初始化三维场景:",T),T.res&&(R=T.res)}l?l.resetEditorStorage(R):l=new k.ThreeEditor(I.value,{fps:null,pixelRatio:N()*a.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:a.logarithmicDepthBuffer},sceneParams:A(R)})}catch(T){console.error("三维图纸初始化失败",T),l==null||l.resetEditorStorage(R)}finally{l&&setTimeout(()=>{i.preview&&(l.handler.mode="none",l.handler.helpers.axes.showAxes=!1,l.handler.helpers.box3.useBox3=!1,l.handler.helpers.grid.showGrid=!1)},200),v()}n("emit-three-editor",l),window.addEventListener("resize",C)}),A=R=>{E(),R.designCores.forEach(U=>{U.preview=i.preview});const x=K(),O=x.list||[],T=structuredClone(R||{});return T.modelCores=(T.modelCores||[]).filter(U=>{const G=U.modelInfo.originPath;if(G){const J=O.find(X=>X.name===G);if(!J){const X=x.db.getRequest(G);U.modelInfo.url=X.url;return}const Z=d(J.blob);U.modelInfo.url=Z}return!0}),T},v=()=>{l!=null&&l.renderer&&(m=new k.THREE.PMREMGenerator(l.renderer),m.compileEquirectangularShader(),l.scene.environment=m.fromScene(new tn.RoomEnvironment).texture)},y=()=>l;return D.watch(()=>o.value.path,()=>_(this,null,function*(){p()})),D.watch(()=>i.data,()=>{p()},{deep:!0}),D.onMounted(()=>{p()}),D.onUnmounted(()=>{window.removeEventListener("resize",C),E(),l==null||l.destroySceneRender(),a.setCurrScene({name:"",path:""})}),e({getEditorInstance:y}),(R,x)=>(D.openBlock(),D.createElementBlock("div",{ref_key:"editorRef",ref:I,class:"threed-editor",onDragover:x[0]||(x[0]=D.withModifiers(()=>{},["prevent"])),onDrop:x[1]||(x[1]=D.withModifiers(()=>{},["prevent"]))},null,544))}}),Nr=Tt(Fr,[["__scopeId","data-v-a95a7094"]]),Br={class:"threed-preview"},Gr=Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(r,{expose:e,emit:t}){const n=r,i=t;let a=D.shallowRef({});const o=D.ref(),c=vt();let l={},m=null,I=null;const F=p=>{var v,y,L;if(!p)return;if((v=p==null?void 0:p.includes)!=null&&v.call(p,"token 必传"))return ae({message:p,type:"warning"});const A=typeof p=="string"?JSON.parse(p):p;if((A==null?void 0:A.data)==="服务错误"||(L=(y=A==null?void 0:A.data)==null?void 0:y.includes)!=null&&L.call(y,"token is expired"))return ae({message:A.data,type:"warning"});switch(A.action){case Ge.ACPOINT.YCVALUE:case Ge.ACPOINT.YXVALUE:console.warn("遥测信息");break}},N=()=>{try{I=new vn({socketUrl:n.socketUrl,token:n.token,onMessage:F})}catch(p){console.warn("三维场景消息处理失败",p)}},K=()=>_(this,null,function*(){var p;if(l){const A=Object.keys(l);if(A.length){const v=yield V.postPDApi("querychannelstatus/",{data:A.map(y=>({ied_id:y,ln_list:l[y].map(L=>L.ln_id)}))});(p=v==null?void 0:v.data)!=null&&p.length&&A.forEach(y=>{const L=v.data.find(x=>x.ied_id===y),R=l[y];R!=null&&R.length&&R.forEach(x=>{const O=L.result.find(T=>T.ln_id===x.ln_id);if(O){const T=C();if(!(T!=null&&T.scene))return;const U=T.scene.getObjectsByProperty("dataId",x.guid);let G=U==null?void 0:U[0];if(G){const J=O.status==="告警"?2:O.status==="正常"?1:0;G.userData.params.state=J;const Z=Pn(O.amp_peak)?bn(Number(O.amp_peak))?Number(O.amp_peak):0:O.amp_peak;G.userData.params.value=Z;debugger;G.changeState(J),G.changeValue(Z)}}})})}}}),d=p=>{i("graph-event",p)},E=p=>{p&&(n.socketUrl&&N(),setTimeout(()=>{const A=p.scene.getObjectsByProperty("designType","局放测点");A.forEach(v=>{const{ied_id:y,ln_id:L}=v.userData.params;l[y]||(l[y]=[]),l[y].push({guid:v.dataId,id:v.uuid,ied_id:y,ln_id:L})}),A!=null&&A.length&&(m&&clearInterval(m),K(),m=setInterval(()=>{K()},2e3)),i("loaded",p)},100))},g=()=>_(this,null,function*(){if(a.value&&Object.keys(a.value).length)return;const p=Mn(),A=n.url||p.url;if(A){const L=yield V.getApi(A).catch(()=>({}));L.res&&(a.value=L.res);return}if(!(n.id||p.id)){console.warn("三维场景渲染失败,场景id为空!");return}const y=yield V.getCommonApi("threedfloorplan",{guid:n.id});y.data.length?c.setCurrScene(y.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),C=()=>o.value?o.value.getEditorInstance():null;return D.watch(()=>n.data,p=>{a.value=p,g()},{deep:!0,immediate:!0}),D.watch(()=>n.id,()=>{g()},{deep:!0,immediate:!0}),D.onMounted(()=>{we.on("three-event",d)}),D.onUnmounted(()=>{I&&I.destroy(),we.off("three-event",d)}),e({getEditorInstance:C}),(p,A)=>(D.openBlock(),D.createElementBlock("div",Br,[D.createVNode(Nr,{ref_key:"threedEditorRef",ref:o,data:D.unref(a),preview:"",onGraphEvent:d,onEmitThreeEditor:E},null,8,["data"])]))}}),oe=Tt(Gr,[["__scopeId","data-v-1cef540a"]]);oe.name||(oe.name="SyThree");const zr=r=>{r.component(oe.name||"SyThree",oe)},Kr={install:zr};exports.SyThree=oe;exports.default=Kr;
@@ -1 +1 @@
1
- @charset "UTF-8";.threed-editor[data-v-a95a7094]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-a95a7094] .top-info{z-index:9999!important}.threed-preview[data-v-7a310c71]{width:100%;height:100%}
1
+ @charset "UTF-8";.threed-editor[data-v-a95a7094]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-a95a7094] .top-info{z-index:9999!important}.threed-preview[data-v-1cef540a]{width:100%;height:100%}
@@ -1534,7 +1534,7 @@ function Or() {
1534
1534
  }), c = (s) => _(this, null, function* () {
1535
1535
  if (!s) return { status: !1, message: "删除失败" };
1536
1536
  yield m(), yield B.removeItem(s);
1537
- const u = H();
1537
+ const u = yield H();
1538
1538
  return u.list = u.list.filter((h) => h.name !== s), { status: !0, message: "删除成功" };
1539
1539
  }), l = (...u) => _(this, [...u], function* (s = ce) {
1540
1540
  B = null, ne = null, yield e({ name: s, storeName: Ie });
@@ -1549,7 +1549,13 @@ function Or() {
1549
1549
  return s.name === "DataError" || u.includes("in-line keys");
1550
1550
  }, k = () => _(this, null, function* () {
1551
1551
  B = null, ne = null, yield e({ name: ce }), yield m();
1552
- }), H = () => (window.threeEditorDB || (window.threeEditorDB = { db: null, list: [] }), window.threeEditorDB), G = (s) => _(this, null, function* () {
1552
+ }), H = () => _(this, null, function* () {
1553
+ if (!window.threeEditorDB) {
1554
+ const s = yield a(), { data: u } = yield s.getAllRequest();
1555
+ window.threeEditorDB = { db: s, list: u };
1556
+ }
1557
+ return window.threeEditorDB;
1558
+ }), G = (s) => _(this, null, function* () {
1553
1559
  if (!s) return { status: !1, message: "获取失败" };
1554
1560
  yield m();
1555
1561
  const u = yield B.getItem(s);
@@ -1563,10 +1569,10 @@ function Or() {
1563
1569
  if (!I(P)) throw P;
1564
1570
  yield k(), yield B.setItem(s, f);
1565
1571
  }
1566
- const S = H(), F = U({ name: s }, f), T = S.list.findIndex((P) => P.name === s);
1572
+ const S = yield H(), F = U({ name: s }, f), T = S.list.findIndex((P) => P.name === s);
1567
1573
  return T > -1 ? S.list.splice(T, 1, F) : S.list.push(F), { status: !0, message: "文件缓存成功", url: i(h) };
1568
1574
  }), d = () => _(this, null, function* () {
1569
- const s = H();
1575
+ const s = yield H();
1570
1576
  yield m();
1571
1577
  const u = [];
1572
1578
  return yield B.iterate((h, f) => {
@@ -2417,7 +2423,7 @@ const {
2417
2423
  }, null, 8, ["data"])
2418
2424
  ]));
2419
2425
  }
2420
- }), he = /* @__PURE__ */ kt(ri, [["__scopeId", "data-v-7a310c71"]]);
2426
+ }), he = /* @__PURE__ */ kt(ri, [["__scopeId", "data-v-1cef540a"]]);
2421
2427
  he.name || (he.name = "SyThree");
2422
2428
  const ii = (r) => {
2423
2429
  r.component(he.name || "SyThree", he);
@@ -1,19 +1,19 @@
1
- (function(g,p){typeof exports=="object"&&typeof module!="undefined"?p(exports,require("vue"),require("qs"),require("axios"),require("mitt"),require("dayjs"),require("lodash-es"),require("crypto-js"),require("gm-crypto"),require("element-plus"),require("@element-plus/icons-vue"),require("pinia"),require("three"),require("three/examples/jsm/renderers/CSS2DRenderer.js"),require("three-edit-cores"),require("localforage"),require("three/addons/environments/RoomEnvironment.js")):typeof define=="function"&&define.amd?define(["exports","vue","qs","axios","mitt","dayjs","lodash-es","crypto-js","gm-crypto","element-plus","@element-plus/icons-vue","pinia","three","three/examples/jsm/renderers/CSS2DRenderer.js","three-edit-cores","localforage","three/addons/environments/RoomEnvironment.js"],p):(g=typeof globalThis!="undefined"?globalThis:g||self,p(g.SyThree={},g.Vue,g.qs,g.axios,g.mitt,null,g._,null,g.gmCrypto,g.ElementPlus,g.ElementPlusIconsVue,g.Pinia,g.Three,g.CSS2DRenderer_js,g.ThreeEditCores,g.localforage,g.RoomEnvironment_js))})(this,function(g,p,D,ge,ue,Be,we,de,H,G,vr,Se,Y,Ft,F,L,Nt){"use strict";var yr=Object.defineProperty,Cr=Object.defineProperties;var Rr=Object.getOwnPropertyDescriptors;var kt=Object.getOwnPropertySymbols;var xr=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable;var Ne=(g,p,D)=>p in g?yr(g,p,{enumerable:!0,configurable:!0,writable:!0,value:D}):g[p]=D,B=(g,p)=>{for(var D in p||(p={}))xr.call(p,D)&&Ne(g,D,p[D]);if(kt)for(var D of kt(p))Dr.call(p,D)&&Ne(g,D,p[D]);return g},Ae=(g,p)=>Cr(g,Rr(p));var ee=(g,p,D)=>Ne(g,typeof p!="symbol"?p+"":p,D);var E=(g,p,D)=>new Promise((ge,ue)=>{var Be=H=>{try{de(D.next(H))}catch(G){ue(G)}},we=H=>{try{de(D.throw(H))}catch(G){ue(G)}},de=H=>H.done?ge(H.value):Promise.resolve(H.value).then(Be,we);de((D=D.apply(g,p)).next())});var At,gt,wt,St,It,yt,Ct,Rt,xt,Dt,vt,Tt,Pt;var Ge=document.createElement("style");Ge.textContent=`@charset "UTF-8";.threed-editor[data-v-a95a7094]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-a95a7094] .top-info{z-index:9999!important}.threed-preview[data-v-7a310c71]{width:100%;height:100%}
1
+ (function(g,p){typeof exports=="object"&&typeof module!="undefined"?p(exports,require("vue"),require("qs"),require("axios"),require("mitt"),require("dayjs"),require("lodash-es"),require("crypto-js"),require("gm-crypto"),require("element-plus"),require("@element-plus/icons-vue"),require("pinia"),require("three"),require("three/examples/jsm/renderers/CSS2DRenderer.js"),require("three-edit-cores"),require("localforage"),require("three/addons/environments/RoomEnvironment.js")):typeof define=="function"&&define.amd?define(["exports","vue","qs","axios","mitt","dayjs","lodash-es","crypto-js","gm-crypto","element-plus","@element-plus/icons-vue","pinia","three","three/examples/jsm/renderers/CSS2DRenderer.js","three-edit-cores","localforage","three/addons/environments/RoomEnvironment.js"],p):(g=typeof globalThis!="undefined"?globalThis:g||self,p(g.SyThree={},g.Vue,g.qs,g.axios,g.mitt,null,g._,null,g.gmCrypto,g.ElementPlus,g.ElementPlusIconsVue,g.Pinia,g.Three,g.CSS2DRenderer_js,g.ThreeEditCores,g.localforage,g.RoomEnvironment_js))})(this,function(g,p,D,ge,ue,Be,we,de,H,G,vr,Se,Y,Ft,F,L,Nt){"use strict";var yr=Object.defineProperty,Cr=Object.defineProperties;var Rr=Object.getOwnPropertyDescriptors;var kt=Object.getOwnPropertySymbols;var xr=Object.prototype.hasOwnProperty,Dr=Object.prototype.propertyIsEnumerable;var Ne=(g,p,D)=>p in g?yr(g,p,{enumerable:!0,configurable:!0,writable:!0,value:D}):g[p]=D,B=(g,p)=>{for(var D in p||(p={}))xr.call(p,D)&&Ne(g,D,p[D]);if(kt)for(var D of kt(p))Dr.call(p,D)&&Ne(g,D,p[D]);return g},Ae=(g,p)=>Cr(g,Rr(p));var ee=(g,p,D)=>Ne(g,typeof p!="symbol"?p+"":p,D);var E=(g,p,D)=>new Promise((ge,ue)=>{var Be=H=>{try{de(D.next(H))}catch(G){ue(G)}},we=H=>{try{de(D.throw(H))}catch(G){ue(G)}},de=H=>H.done?ge(H.value):Promise.resolve(H.value).then(Be,we);de((D=D.apply(g,p)).next())});var At,gt,wt,St,It,yt,Ct,Rt,xt,Dt,vt,Tt,Pt;var Ge=document.createElement("style");Ge.textContent=`@charset "UTF-8";.threed-editor[data-v-a95a7094]{position:absolute;top:0;left:0;width:100%;height:100%;background-color:var(--sc-bg-color)}.threed-editor[data-v-a95a7094] .top-info{z-index:9999!important}.threed-preview[data-v-1cef540a]{width:100%;height:100%}
2
2
  /*$vite$:1*/`,document.head.appendChild(Ge);const he={NONE:"none",WUJIE:"wujie",QIANKUN:"qiankun",MICROAPP:"microapp"},ze={ACPOINT:{YCVALUE:"status.platform.ycvalue",YXVALUE:"status.platform.yxvalue"}};var me={};/*!
3
3
  * vite-plugin-qiankun.js v1.0.14
4
4
  * (c) 2021-2022 Teng Mao Qing
5
5
  * Released under the MIT License.
6
- */Object.defineProperty(me,"__esModule",{value:!0});var te=typeof window!="undefined"?window.proxy||window:{},Ve=function(r){te!=null&&te.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),te.qiankunName&&(window.moudleQiankunAppLifeCycles[te.qiankunName]=r))};me.default=Ve;var Ie=me.qiankunWindow=te;me.renderWithQiankun=Ve;function Bt(){return window.__POWERED_BY_WUJIE__||window.$wujie?he.WUJIE:window.__POWERED_BY_QIANKUN__||Ie!=null&&Ie.__POWERED_BY_QIANKUN__?he.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?he.MICROAPP:he.NONE}const Ke="/";Bt();const Gt=location.origin,We={savePath:((gt=(At=window.meta)==null?void 0:At.graph)==null?void 0:gt.savePath)||"/cockpit/drawing",graphPenPath:((St=(wt=window.meta)==null?void 0:wt.graph)==null?void 0:St.graphPenPath)||"/cockpit/graph",templatePath:((yt=(It=window.meta)==null?void 0:It.graph)==null?void 0:yt.templatePath)||"/cockpit/template",graphImgUploadPath:((Rt=(Ct=window.meta)==null?void 0:Ct.graph)==null?void 0:Rt.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((Dt=(xt=window.meta)==null?void 0:xt.graph)==null?void 0:Dt.threeSavePath)||"/cockpit/threed",threeModelPath:((Tt=(vt=window.meta)==null?void 0:vt.graph)==null?void 0:Tt.threeModelPath)||"/cockpit/models"},I=ge.create({baseURL:Gt,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>D.stringify(r)});I.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r)),I.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function zt(r,e={},t={}){return new Promise(n=>{I.get(r,B({params:e},t)).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function Vt(r,e={},t={}){return new Promise(n=>{I.post(r,e,t).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function Kt(r,e={},t={}){return I.get(r,B({params:e},t))}function Wt(r,e={},t={}){return I.post(r,e,t)}function qt(r,e={}){return I.get(`/filehandle/${r}`,{params:e})}function jt(r,e={},t={}){return I.post(`/filehandle/${r}`,e,t)}function __$t__(r,e={}){return I.get(`/user/${r}`,{params:e})}function Jt(r,e={},t={}){return I.post(`/user/${r}`,e,t)}function Xt(r,e={}){return I.get(`${r}`,e.local?{params:e,baseURL:Ke}:{params:e})}function Yt(r,e={}){return I.get(`/media/${r}/`,{params:e})}function Qt(r,e={},t={}){return I.post(`/media/${r}/`,e,t)}function Zt(r,e={}){return I.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function en(r,e={},t={}){return I.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function tn(r,e={}){return I.get(`/history/${r}`,{params:e})}function nn(r,e={},t={}){return I.post(`/history/${r}`,e,t)}function rn(r,e={}){return I.get(`/scada/${r}`,{params:e})}function sn(r,e={},t={}){return I.post(`/scada/${r}`,e,t)}function on(r,e={}){return I.get(`/common/factory/${r}`,{params:e})}function an(r,e={},t={}){return I.post(`/common/factory/${r}`,e,t)}function cn(r,e={}){return I.get(`/factory/${r}`,{params:e})}function ln(r,e={},t={}){return I.post(`/factory/${r}`,e,t)}function un(r,e={}){return I.get(`/pd/${r}`,{params:e})}function dn(r,e={},t={}){return I.post(`/pd/${r}`,e,t)}const j={getApi:zt,postApi:Vt,getFileApi:qt,postFileApi:jt,getBaseApi:Kt,postBaseApi:Wt,getUserApi:__$t__,postUserApi:Jt,getGraphApi:Xt,getMediaApi:Yt,postMediaApi:Qt,getScadaApi:rn,postScadaApi:sn,getCommonApi:Zt,postCommonApi:en,getHistoryApi:tn,postHistoryApi:nn,getFactoryApi:cn,postFactoryApi:ln,getCommonFactoryApi:on,postCommonFactoryApi:an,getPDApi:un,postPDApi:dn},ye=ue();class hn{constructor(e={}){this._options=B({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:n,onError:i,onMessage:o,token:a}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[a]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(c)},this._client.onerror=c=>{i&&i(c)},this._client.onmessage=c=>{o&&o(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const mn=[65535,-99999];function fn(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function pn(r){return typeof r=="number"&&!mn.includes(r)}const _n=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[i,o]of t.entries())r[i]=o;return r};function qe(r){return Object.prototype.toString.call(r).slice(8,-1)}function Ce(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function En(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,i,o,a,c,u;for(o=t.length,i=0,n="";i<o;){if(a=t.charCodeAt(i++)&255,i==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4),n+="==";break}if(c=t.charCodeAt(i++),i==o){n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2),n+="=";break}u=t.charCodeAt(i++),n+=r.charAt(a>>2),n+=r.charAt((a&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2|(u&192)>>6),n+=r.charAt(u&63)}return n},this.decode=function(t){var n,i,o,a,c,u,m;for(u=t.length,c=0,m="";c<u;){do n=e[t.charCodeAt(c++)&255];while(c<u&&n==-1);if(n==-1)break;do i=e[t.charCodeAt(c++)&255];while(c<u&&i==-1);if(i==-1)break;m+=String.fromCharCode(n<<2|(i&48)>>4);do{if(o=t.charCodeAt(c++)&255,o==61)return m;o=e[o]}while(c<u&&o==-1);if(o==-1)break;m+=String.fromCharCode((i&15)<<4|(o&60)>>2);do{if(a=t.charCodeAt(c++)&255,a==61)return m;a=e[a]}while(c<u&&a==-1);if(a==-1)break;m+=String.fromCharCode((o&3)<<6|a)}return m},this.utf16to8=function(t){var n,i,o,a;for(n="",o=t.length,i=0;i<o;i++)a=t.charCodeAt(i),a>=1&&a<=127?n+=t.charAt(i):a>2047?(n+=String.fromCharCode(224|a>>12&15),n+=String.fromCharCode(128|a>>6&63),n+=String.fromCharCode(128|a>>0&63)):(n+=String.fromCharCode(192|a>>6&31),n+=String.fromCharCode(128|a>>0&63));return n},this.utf8to16=function(t){var n,i,o,a,c,u;for(n="",o=t.length,i=0;i<o;)switch(a=t.charCodeAt(i++),a>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(i-1);break;case 12:case 13:c=t.charCodeAt(i++),n+=String.fromCharCode((a&31)<<6|c&63);break;case 14:c=t.charCodeAt(i++),u=t.charCodeAt(i++),n+=String.fromCharCode((a&15)<<12|(c&63)<<6|(u&63)<<0);break}return n},this.charToHex=function(t){var n,i,o;for(n="",i=0;i<t.length;)o=t.charCodeAt(i++).toString(16),n+="\\0x"+o,n+=i>0&&i%8==0?`\r
7
- `:", ";return n}}function An(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function gn(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new An,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var i=Object.id(n).toString();this.callbacks_.add(i,n);var o={MsgId:i,Method:e+"|"+r};t&&(o.Param=JSON.stringify(t));var a=JSON.stringify(o);this.connect&&this.ws.send(a)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var i=this.callbacks_.getValue(n);i(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},i){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],i)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:i},o){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),i],o)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:i,DataInput:o},a){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(i),o],a)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:n},i){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],i)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:i},o){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(i)],o)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},i){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],i)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},i){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],i)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},i){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],i)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:i,PinFlag:o},a){this.exec("Arm_ChangePIN",[parseInt(e),o,n,t,parseInt(i)],a)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:i,RsaPriFileSize:o},a){this.exec("Arm_RsaPri",[parseInt(e),parseInt(i),parseInt(o),t,n],a)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:i,RsaPubFileSize:o},a){this.exec("Arm_RsaPub",[parseInt(e),parseInt(o),n,t,t.length,i],a)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},i){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],i)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:i},o){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,i],o)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},i){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],i)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:i},o){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,i],o)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:i},o){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,i],o)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:i},o){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,i],o)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},i){this.exec("Arm_HASH",[parseInt(e),t,n],i)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},i){this.exec("Arm_Seed",[parseInt(e),n,t],i)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:i,StartUserID:o,AdminTryCount:a,UserPin:c,UserTryCount:u,UpdateRSAPriKey:m},C){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(u),parseInt(a),m,parseInt(o),parseInt(i)],C)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:i,FileType:o,Offset:a,DataLen:c,DataBuffer:u,UpRSAPubKey:m},C){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,o,parseInt(i),parseInt(a),u,m,parseInt(c)],C)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:i,FileType:o,Offset:a,DataLen:c,DataBuffer:u},m){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,o,parseInt(i),parseInt(a),u,parseInt(c)],m)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},i){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],i)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:i,IsReset:o,IsDecOnRAM:a},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(i),parseInt(a),parseInt(o)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:i},o){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(i),parseInt(n)],o)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:i,CallLimit:o},a){this.exec("Arm_Set_EXE_FILE_INFO",[i,parseInt(n),parseInt(e),parseInt(o),t,t.length],a)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const wn={HID:0},fe={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},je={USER:0};class $e{constructor(){ee(this,"Base64",new En);ee(this,"AtlCtrl",null);ee(this,"ArmCount",0);ee(this,"ArmIndex",0);ee(this,"ArmHandle",0);ee(this,"ArmRandom","");try{this.AtlCtrl=new gn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,i)=>{n?(this.ArmCount=+i,e(i)):t(i)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(i,o)=>{i?(this.ArmHandle=+o,t(o)):(this.ArmHandle=o,n(o))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(i,o)=>{i?t(o):n(o)})})}armChangePIN(e,t,n=255,i=je.USER,o=this.ArmHandle){if(this.AtlCtrl)return new Promise((a,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:o,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:i},(u,m)=>{u&&m==0?(this.ArmPin=e,a(m)):c(m)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(o,a)=>{o?(this.ArmRandom=a,n(a)):i(a)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(i,o)=>{i?(this.ArmDeadline=o,t(o)):n(o)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(o,a)=>{o?(this.ArmUKey=a,n(a)):i(a)})})}armGetDongleInfo(e=0,t=fe.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,i)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(o,a)=>{if(o){switch(t){case fe.USER_ID:this.ArmUid=a;break;case fe.PRODUCT_ID:this.ArmPid=a;break;case fe.HARDWARE_ID:this.ArmHid=a;break}n(a)}else i(a)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(i,o)=>{i&&o==0?t(o):n(o)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(o,a)=>{if(o&&a.length>0)try{a=this.Base64.decode(a),n(a)}catch(c){console.error(c),n(a)}else i(a)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(i,o)=>{i&&o==0?t(o):n(o)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armSwitchProtocol(e=wn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(o,a)=>{o&&a==0?n(a):i(a)})})}armVerifyPIN(e,t=je.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(a,c)=>{a&&c==0?(this.ArmPin=e,i(c)):o(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(a,c)=>{a?(this.ArmData=c,i(c)):o(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,o)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(a,c)=>{a&&c==0?i(c):o(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(i,o)=>{i?(this.ArmData=o,t(o)):n(o)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(o,a)=>{o&&a==0?n(a):i(a)})})}}const Je="0123456789abcdeffedcba9876543210",Xe="4b0de988570c3a0f";let ne=window.ENCRYPT&&new $e;function Ye(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function Qe(){return E(this,null,function*(){return ne||(ne=new $e),new Promise((r,e)=>{ne.armEnum().then(t=>{r(+t)}).catch(t=>{G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}we.throttle(()=>E(this,null,function*(){const r=yield Qe(),e={};if(typeof r!="number"||r<=0)G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield In();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(G.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Sn(r=0){return E(this,null,function*(){return ne?new Promise((e,t)=>{ne.armGetDongleInfo(r).then(n=>{n?e(n):(G.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):G.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function In(){return E(this,null,function*(){if(!ne)return G.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Qe();let e=[];for(let t=0;t<r;t++){const n=yield Sn(t);e.push(n)}return e})}Ye(16),Ye(16);const Ze=window.meta.app.inspect?H.SM4.constants.CBC:H.SM4.constants.ECB,{publicKey:Pr,privateKey:Mr}=H.SM2.generateKeyPair();function et(r,e,t={}){const n=nt(Xe),i=t.mode||Ze;t=i===H.SM4.constants.ECB?B({mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t):B({iv:Je,mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t);let o="";try{o=H.SM4.encrypt(r,n,t)}catch(a){console.log("err: ",a)}return o}function tt(r,e,t={}){const n=nt(Xe),i=t.mode||Ze;return t=i===H.SM4.constants.ECB?B({mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t):B({iv:Je,mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t),H.SM4.decrypt(r,n,t)}function nt(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const se=r=>{const{onClose:e,customClass:t}=r;return G.ElMessage(Ae(B({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:i=>{e&&e(i)}}))};["success","warning","info","error"].forEach(r=>{se[r]=e=>se(typeof e=="string"?{type:r,message:e}:Ae(B({},e),{type:r}))}),Se.createPinia();const Re={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?tt(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?et(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||qe(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?tt(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?et(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||qe(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},yn=(r,e)=>new Promise((t,n)=>{j.postApi("/filehandle/save",{path:r,data:e}).then(i=>{i.res.success?t(!0):n(!1)})});class Cn extends Y.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Y.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const re=new Y.Vector3,rt=new Y.Matrix4,it=new Y.Matrix4,st=new Y.Vector3,ot=new Y.Vector3;class Rn{constructor(e={}){const t=this;let n,i,o,a;const c={objects:new WeakMap},u=e.element!==void 0?e.element:document.createElement("div");u.style.overflow="hidden",this.domElement=u,this.getSize=function(){return{width:n,height:i}},this.render=function(d,A){d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),rt.copy(A.matrixWorldInverse),it.multiplyMatrices(A.projectionMatrix,rt),C(d,d,A),$(d)},this.setSize=function(d,A){n=d,i=A,o=n/2,a=i/2,u.style.width=d+"px",u.style.height=A+"px"};function m(d){d.isCSS2DObject&&(d.element.style.display="none");for(let A=0,S=d.children.length;A<S;A++)m(d.children[A])}function C(d,A,S){if(d.visible===!1){m(d);return}if(d.isCSS2DObject){re.setFromMatrixPosition(d.matrixWorld),re.applyMatrix4(it);const x=re.z>=-1&&re.z<=1&&d.layers.test(S.layers)===!0,_=d.element;_.style.display=x===!0?"":"none",x===!0&&(d.onBeforeRender(t,A,S),_.style.transform="translate("+-100*d.center.x+"%,"+-100*d.center.y+"%)translate("+(re.x*o+o)+"px,"+(-re.y*a+a)+"px)",_.parentNode!==u&&u.appendChild(_),d.onAfterRender(t,A,S));const w={distanceToCameraSquared:z(S,d)};c.objects.set(d,w)}for(let x=0,_=d.children.length;x<_;x++)C(d.children[x],A,S)}function z(d,A){return st.setFromMatrixPosition(d.matrixWorld),ot.setFromMatrixPosition(A.matrixWorld),st.distanceToSquared(ot)}function V(d){const A=[];return d.traverseVisible(function(S){S.isCSS2DObject&&A.push(S)}),A}function $(d){const A=V(d).sort(function(S,x){if(S.renderOrder!==x.renderOrder)return x.renderOrder-S.renderOrder;const _=c.objects.get(S).distanceToCameraSquared,w=c.objects.get(x).distanceToCameraSquared;return _-w});for(let S=0,x=A.length;S<x;S++)A[S].element.style.zIndex=1,console.log("🚀 ~ CSS2DRenderer ~ zOrder ~ sorted[i].element.style.zIndex:",A[S].element.style.zIndex)}}}const xn={CSS2DObject:Cn,CSS2DRenderer:Rn},Dn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',at='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',vn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',Tn={name:"局放测点",label:"局放测点",create:function(r,e){return E(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.zIndex="1";const i=document.createElement("div");i.style.width="1.3vw",i.style.height="1.3vw",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.cursor="pointer",i.style.pointerEvents="auto",i.style.userSelect="none",i.innerHTML=at;const o=document.createElement("style");o.innerHTML=`
6
+ */Object.defineProperty(me,"__esModule",{value:!0});var te=typeof window!="undefined"?window.proxy||window:{},Ve=function(r){te!=null&&te.__POWERED_BY_QIANKUN__&&(window.moudleQiankunAppLifeCycles||(window.moudleQiankunAppLifeCycles={}),te.qiankunName&&(window.moudleQiankunAppLifeCycles[te.qiankunName]=r))};me.default=Ve;var Ie=me.qiankunWindow=te;me.renderWithQiankun=Ve;function Bt(){return window.__POWERED_BY_WUJIE__||window.$wujie?he.WUJIE:window.__POWERED_BY_QIANKUN__||Ie!=null&&Ie.__POWERED_BY_QIANKUN__?he.QIANKUN:window.__MICRO_APP_ENVIRONMENT__||window.microApp?he.MICROAPP:he.NONE}const Ke="/";Bt();const Gt=location.origin,We={savePath:((gt=(At=window.meta)==null?void 0:At.graph)==null?void 0:gt.savePath)||"/cockpit/drawing",graphPenPath:((St=(wt=window.meta)==null?void 0:wt.graph)==null?void 0:St.graphPenPath)||"/cockpit/graph",templatePath:((yt=(It=window.meta)==null?void 0:It.graph)==null?void 0:yt.templatePath)||"/cockpit/template",graphImgUploadPath:((Rt=(Ct=window.meta)==null?void 0:Ct.graph)==null?void 0:Rt.graphImgUploadPath)||"/cockpit/upload",threeSavePath:((Dt=(xt=window.meta)==null?void 0:xt.graph)==null?void 0:Dt.threeSavePath)||"/cockpit/threed",threeModelPath:((Tt=(vt=window.meta)==null?void 0:vt.graph)==null?void 0:Tt.threeModelPath)||"/cockpit/models"},I=ge.create({baseURL:Gt,timeout:window.meta.axios.timeout||12e4,withCredentials:!1,paramsSerializer:r=>D.stringify(r)});I.interceptors.request.use(r=>(r.headers["x-token"]="ewoglCJhbGcilDogpc3",r),r=>Promise.reject(r)),I.interceptors.response.use(r=>{const{data:e}=r;return Promise.resolve(e)},r=>Promise.reject(r));function zt(r,e={},t={}){return new Promise(n=>{I.get(r,B({params:e},t)).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function Vt(r,e={},t={}){return new Promise(n=>{I.post(r,e,t).then(i=>n({res:i,err:null})).catch(i=>n({res:null,err:i}))})}function Kt(r,e={},t={}){return I.get(r,B({params:e},t))}function Wt(r,e={},t={}){return I.post(r,e,t)}function qt(r,e={}){return I.get(`/filehandle/${r}`,{params:e})}function jt(r,e={},t={}){return I.post(`/filehandle/${r}`,e,t)}function __$t__(r,e={}){return I.get(`/user/${r}`,{params:e})}function Jt(r,e={},t={}){return I.post(`/user/${r}`,e,t)}function Xt(r,e={}){return I.get(`${r}`,e.local?{params:e,baseURL:Ke}:{params:e})}function Yt(r,e={}){return I.get(`/media/${r}/`,{params:e})}function Qt(r,e={},t={}){return I.post(`/media/${r}/`,e,t)}function Zt(r,e={}){return I.get(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,{params:e})}function en(r,e={},t={}){return I.post(`/${window.meta.app.isFactory?window.meta.factory.singo_prefix||"acproxy/common":"common"}/${r}/`,e,t)}function tn(r,e={}){return I.get(`/history/${r}`,{params:e})}function nn(r,e={},t={}){return I.post(`/history/${r}`,e,t)}function rn(r,e={}){return I.get(`/scada/${r}`,{params:e})}function sn(r,e={},t={}){return I.post(`/scada/${r}`,e,t)}function an(r,e={}){return I.get(`/common/factory/${r}`,{params:e})}function on(r,e={},t={}){return I.post(`/common/factory/${r}`,e,t)}function cn(r,e={}){return I.get(`/factory/${r}`,{params:e})}function ln(r,e={},t={}){return I.post(`/factory/${r}`,e,t)}function un(r,e={}){return I.get(`/pd/${r}`,{params:e})}function dn(r,e={},t={}){return I.post(`/pd/${r}`,e,t)}const j={getApi:zt,postApi:Vt,getFileApi:qt,postFileApi:jt,getBaseApi:Kt,postBaseApi:Wt,getUserApi:__$t__,postUserApi:Jt,getGraphApi:Xt,getMediaApi:Yt,postMediaApi:Qt,getScadaApi:rn,postScadaApi:sn,getCommonApi:Zt,postCommonApi:en,getHistoryApi:tn,postHistoryApi:nn,getFactoryApi:cn,postFactoryApi:ln,getCommonFactoryApi:an,postCommonFactoryApi:on,getPDApi:un,postPDApi:dn},ye=ue();class hn{constructor(e={}){this._options=B({url:e.socketUrl,onOpen:null,onClose:null,onError:null,onMessage:null},e),this._client=null,this._isConnect=!1,this._closeClient=!1,this._retryCount=0,this._retryTimes=10,this._retryInterval=1e4,this._retryIntervalObj=null,this._initSockjs()}_initSockjs(){const{url:e,onOpen:t,onClose:n,onError:i,onMessage:a,token:o}=this._options;WebSocket!==void 0?this._client=new WebSocket(e,[o]):this.$message({type:"error",message:"当前浏览器不支持WebSocket推送!"}),this._client.onopen=c=>{this._client.readyState===WebSocket.OPEN&&(this._retryCount=0,this._isConnect=!0,this._closeClient=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null),t&&t(c)},this._client.onclose=c=>{!this._closeClient&&this.retryIntervalStart(),this._isConnect=!1,n&&n(c)},this._client.onerror=c=>{i&&i(c)},this._client.onmessage=c=>{a&&a(c)}}_reconnect(){if(this._retryCount===this._retryTimes){this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null;return}this._client=null,this._initSockjs(),this._retryCount++}retryIntervalStart(){this._closeClient=!0,this._retryIntervalObj||(this._retryIntervalObj=setInterval(()=>{this._reconnect()},this._retryInterval))}sendMsg(e){this._isConnect&&this._client.send(e)}destroy(){this._client&&(this._isConnect=!1,this._retryIntervalObj&&clearInterval(this._retryIntervalObj),this._retryIntervalObj=null,this._closeClient=!0,this._client.close(),this._client=null)}}const mn=[65535,-99999];function fn(r){if(typeof r!="string")return!1;const e=/^-?\d+(\.\d+)?$/;return r.trim()!==""&&e.test(r.trim())}function pn(r){return typeof r=="number"&&!mn.includes(r)}const _n=()=>{var n;const r={},e=((n=window.location.href.split("?"))==null?void 0:n[1])||"",t=new URLSearchParams(e);for(const[i,a]of t.entries())r[i]=a;return r};function qe(r){return Object.prototype.toString.call(r).slice(8,-1)}function Ce(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,r=>(r^crypto.getRandomValues(new Uint8Array(1))[0]&15>>r/4).toString(16))}(function(){if(typeof Object.id=="undefined"){var r=0;Object.id=function(e){return typeof e.__uniqueid=="undefined"&&Object.defineProperty(e,"__uniqueid",{value:++r,enumerable:!1,writable:!1}),e.__uniqueid}}})();function En(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,-1,-1,-1,-1,-1];this.encode=function(t){var n,i,a,o,c,u;for(a=t.length,i=0,n="";i<a;){if(o=t.charCodeAt(i++)&255,i==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4),n+="==";break}if(c=t.charCodeAt(i++),i==a){n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2),n+="=";break}u=t.charCodeAt(i++),n+=r.charAt(o>>2),n+=r.charAt((o&3)<<4|(c&240)>>4),n+=r.charAt((c&15)<<2|(u&192)>>6),n+=r.charAt(u&63)}return n},this.decode=function(t){var n,i,a,o,c,u,m;for(u=t.length,c=0,m="";c<u;){do n=e[t.charCodeAt(c++)&255];while(c<u&&n==-1);if(n==-1)break;do i=e[t.charCodeAt(c++)&255];while(c<u&&i==-1);if(i==-1)break;m+=String.fromCharCode(n<<2|(i&48)>>4);do{if(a=t.charCodeAt(c++)&255,a==61)return m;a=e[a]}while(c<u&&a==-1);if(a==-1)break;m+=String.fromCharCode((i&15)<<4|(a&60)>>2);do{if(o=t.charCodeAt(c++)&255,o==61)return m;o=e[o]}while(c<u&&o==-1);if(o==-1)break;m+=String.fromCharCode((a&3)<<6|o)}return m},this.utf16to8=function(t){var n,i,a,o;for(n="",a=t.length,i=0;i<a;i++)o=t.charCodeAt(i),o>=1&&o<=127?n+=t.charAt(i):o>2047?(n+=String.fromCharCode(224|o>>12&15),n+=String.fromCharCode(128|o>>6&63),n+=String.fromCharCode(128|o>>0&63)):(n+=String.fromCharCode(192|o>>6&31),n+=String.fromCharCode(128|o>>0&63));return n},this.utf8to16=function(t){var n,i,a,o,c,u;for(n="",a=t.length,i=0;i<a;)switch(o=t.charCodeAt(i++),o>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:n+=t.charAt(i-1);break;case 12:case 13:c=t.charCodeAt(i++),n+=String.fromCharCode((o&31)<<6|c&63);break;case 14:c=t.charCodeAt(i++),u=t.charCodeAt(i++),n+=String.fromCharCode((o&15)<<12|(c&63)<<6|(u&63)<<0);break}return n},this.charToHex=function(t){var n,i,a;for(n="",i=0;i<t.length;)a=t.charCodeAt(i++).toString(16),n+="\\0x"+a,n+=i>0&&i%8==0?`\r
7
+ `:", ";return n}}function An(){var r=0,e=new Object;this.add=function(t,n){this.containsKey(t)||r++,e[t]=n},this.getValue=function(t){return this.containsKey(t)?e[t]:null},this.remove=function(t){this.containsKey(t)&&delete e[t]&&r--},this.containsKey=function(t){return t in e},this.containsValue=function(t){for(var n in e)if(e[n]==t)return!0;return!1},this.getValues=function(){var t=[];for(var n in e)t.push(e[n]);return t},this.getKeys=function(){var t=[];for(var n in e)t.push(n);return t},this.getSize=function(){return r},this.clear=function(){r=0,e=new Object}}function gn(r){if(this.connect=!1,this.ready_func_=null,this.callbacks_=new An,this.module_="JS_IActiveXCtrl","WebSocket"in window)this.ws=new WebSocket("ws://127.0.0.1:7321");else throw"WebSocket not supported";this.ws.onerror=function(){throw"Unable to establish connection to WebSocket"},this.loadModule=function(){this.connect=!0;var e=JSON.stringify({MsgId:"LoadModule",Module:this.module_});this.ws.onmessage=this._callback.bind(this),this.ws.send(e)},this.loadModuleCallBack=function(e){if(!e)throw e.Response;this.ready_func_&&this.ready_func_()}.bind(this),this.callbacks_.add("LoadModule",this.loadModuleCallBack),this.exec=function(e,t,n){var i=Object.id(n).toString();this.callbacks_.add(i,n);var a={MsgId:i,Method:e+"|"+r};t&&(a.Param=JSON.stringify(t));var o=JSON.stringify(a);this.connect&&this.ws.send(o)},this.ready=function(e){this.ready_func_=e},this._callback=function(e){var t=JSON.parse(e.data),n=t.MsgId;if(this.callbacks_.containsKey(n)){var i=this.callbacks_.getValue(n);i(t.Result,t.Response),this.callbacks_.remove(n)}},this.ws.onopen=this.loadModule.bind(this),this.Arm_GetDongleInfo=function({Index:e,DongleInfoNum:t},n){this.exec("Arm_GetDongleInfo",[parseInt(e),parseInt(t)],n)},this.Arm_Enum=function(e){this.exec("Arm_Enum",null,e)},this.Arm_Open=function({Index:e},t){this.exec("Arm_Open",[parseInt(e)],t)},this.Arm_Close=function({Handle:e},t){this.exec("Arm_Close",[parseInt(e)],t)},this.Arm_VerifyPIN=function({Handle:e,UserPin:t,UserType:n},i){this.exec("Arm_VerifyPIN",[parseInt(e),n,t],i)},this.Arm_ResetState=function({Handle:e},t){this.exec("Arm_ResetState",[parseInt(e)],t)},this.Arm_GenRandom=function({Handle:e,RandomLen:t},n){this.exec("Arm_GenRandom",[parseInt(e),parseInt(t)],n)},this.Arm_LEDControl=function({Handle:e,LedFlag:t},n){this.exec("Arm_LEDControl",[parseInt(e),t],n)},this.Arm_SwitchProtocol=function({Handle:e,ProtocolFlag:t},n){this.exec("Arm_SwitchProtocol",[parseInt(e),t],n)},this.Arm_CreateFile=function({Handle:e,FileID:t,FileType:n,AttrBuffer:i},a){this.exec("Arm_CreateFile",[parseInt(e),n,parseInt(t),i],a)},this.Arm_WriteFile=function({Handle:e,FileID:t,FileType:n,FileOffset:i,DataInput:a},o){this.exec("Arm_WriteFile",[parseInt(e),n,parseInt(t),parseInt(i),a],o)},this.Arm_ReadFile0001=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0001"),parseInt(0),parseInt("64")],t)},this.Arm_ReadFile0002=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0002"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0003=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0003"),parseInt(0),parseInt("130")],t)},this.Arm_ReadFile0004=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0004"),parseInt(0),parseInt("2048")],t)},this.Arm_ReadFile0005=function({Handle:e},t){this.exec("Arm_ReadFile",[parseInt(e),parseInt("0005"),parseInt(0),parseInt("2048")],t)},this.Arm_DownloadExeFile=function({Handle:e,Count:t,ExeFileInfo:n},i){this.exec("Arm_DownloadExeFile",[parseInt(e),parseInt(t),n],i)},this.Arm_RunExeFile=function({Handle:e,FileID:t,InData:n,DataLen:i},a){this.exec("Arm_RunExeFile",[parseInt(e),parseInt(t),n,n.length,parseInt(i)],a)},this.Arm_ReadRunExeFileData=function(e){this.exec("Arm_ReadRunExeFileData",null,e)},this.Arm_DeleteFile=function({Handle:e,FileID:t,FileType:n},i){this.exec("Arm_DeleteFile",[parseInt(e),n,parseInt(t)],i)},this.Arm_WriteData=function({Handle:e,Offset:t,DataInput:n},i){this.exec("Arm_WriteData",[parseInt(e),parseInt(t),n],i)},this.Arm_ReadData=function({Handle:e,Offset:t,ReadLength:n},i){this.exec("Arm_ReadData",[parseInt(e),parseInt(t),n],i)},this.Arm_WriteShareMemory=function({Handle:e,DataInput:t},n){this.exec("Arm_WriteShareMemory",[parseInt(e),t],n)},this.Arm_ReadShareMemory=function({Handle:e},t){this.exec("Arm_ReadShareMemory",[parseInt(e)],t)},this.Arm_GenUniqueKey=function({Handle:e,Seed:t},n){this.exec("Arm_GenUniqueKey",[parseInt(e),t.length,t],n)},this.Arm_ChangePIN=function({Handle:e,NewPIN:t,OldPIN:n,TryCount:i,PinFlag:a},o){this.exec("Arm_ChangePIN",[parseInt(e),a,n,t,parseInt(i)],o)},this.Arm_ResetUserPIN=function({Handle:e,AdminPIN:t},n){this.exec("Arm_ResetUserPIN",[parseInt(e),t],n)},this.Arm_SetUserID=function({Handle:e,UserID:t},n){this.exec("Arm_SetUserID",[parseInt(e),parseInt(t)],n)},this.Arm_GetDeadline=function({Handle:e},t){this.exec("Arm_GetDeadline",[parseInt(e)],t)},this.Arm_SetDeadline=function({Handle:e,SetDeadTime:t},n){this.exec("Arm_SetDeadline",[parseInt(e),parseInt(t)],n)},this.Arm_GetUTCTime=function({Handle:e},t){this.exec("Arm_GetUTCTime",[parseInt(e)],t)},this.Arm_RFS=function({Handle:e},t){this.exec("Arm_RFS",[parseInt(e)],t)},this.Arm_RsaGenPubPriKey=function({Handle:e,RsaFileId:t},n){this.exec("Arm_RsaGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_EccGenPubPriKey=function({Handle:e,EccFileId:t},n){this.exec("Arm_EccGenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_Sm2GenPubPriKey=function({Handle:e,Sm2FileId:t},n){this.exec("Arm_Sm2GenPubPriKey",[parseInt(e),parseInt(t)],n)},this.Arm_ReadRsaPri=function(e){this.exec("Arm_ReadRsaPri",null,e)},this.Arm_ReadRsaPub=function(e){this.exec("Arm_ReadRsaPub",null,e)},this.Arm_ReadEccPri=function(e){this.exec("Arm_ReadEccPri",null,e)},this.Arm_ReadEccPub=function(e){this.exec("Arm_ReadEccPub",null,e)},this.Arm_ReadSm2Pri=function(e){this.exec("Arm_ReadSm2Pri",null,e)},this.Arm_ReadSm2Pub=function(e){this.exec("Arm_ReadSm2Pub",null,e)},this.Arm_RsaPri=function({Handle:e,RsaPri_Flag:t,RsaPriInData:n,RsaPriFileID:i,RsaPriFileSize:a},o){this.exec("Arm_RsaPri",[parseInt(e),parseInt(i),parseInt(a),t,n],o)},this.Arm_RsaPub=function({Handle:e,RsaPubKey:t,RsaPub_Flag:n,RsaPubInData:i,RsaPubFileSize:a},o){this.exec("Arm_RsaPub",[parseInt(e),parseInt(a),n,t,t.length,i],o)},this.Arm_EccSign=function({Handle:e,HashData:t,EccFileId:n},i){this.exec("Arm_EccSign",[parseInt(e),parseInt(n),t],i)},this.Arm_EccVerify=function({Handle:e,HashData:t,EccPubKey:n,EccSignData:i},a){this.exec("Arm_EccVerify",[parseInt(e),n,n.length,t,i],a)},this.Arm_Sm2Sign=function({Handle:e,HashData:t,Sm2FileId:n},i){this.exec("Arm_Sm2Sign",[parseInt(e),parseInt(n),t],i)},this.Arm_Sm2Verify=function({Handle:e,HashData:t,Sm2PubKey:n,Sm2SignData:i},a){this.exec("Arm_Sm2Verify",[parseInt(e),n,n.length,t,i],a)},this.Arm_TDES=function({Handle:e,Tdes_Flag:t,TdesFileID:n,TdesInData:i},a){this.exec("Arm_TDES",[parseInt(e),parseInt(n),t,i],a)},this.Arm_SM4=function({Handle:e,Sm4_Flag:t,Sm4FileID:n,Sm4InData:i},a){this.exec("Arm_SM4",[parseInt(e),parseInt(n),t,i],a)},this.Arm_HASH=function({Handle:e,Hash_Flag:t,HashInData:n},i){this.exec("Arm_HASH",[parseInt(e),t,n],i)},this.Arm_Seed=function({Handle:e,SeedData:t,SeedLength:n},i){this.exec("Arm_Seed",[parseInt(e),n,t],i)},this.Arm_LimitSeedCount=function({Handle:e,SeedCount:t},n){this.exec("Arm_LimitSeedCount",[parseInt(e),parseInt(t)],n)},this.Arm_GenMotherKey=function({Handle:e,SeedLen:t,SeedForPID:n,SonCount:i,StartUserID:a,AdminTryCount:o,UserPin:c,UserTryCount:u,UpdateRSAPriKey:m},C){this.exec("Arm_GenMotherKey",[parseInt(e),parseInt(t),n,c,parseInt(u),parseInt(o),m,parseInt(a),parseInt(i)],C)},this.Arm_RequestInit=function({Handle:e},t){this.exec("Arm_RequestInit",[parseInt(e)],t)},this.Arm_GetInitDataFromMother=function({Handle:e},t){this.exec("Arm_GetInitDataFromMother",[parseInt(e),Request],t)},this.Arm_InitSon=function({Handle:e,InitData:t},n){this.exec("Arm_InitSon",[parseInt(e),t],n)},this.Arm_SetUpdatePriKey=function({Handle:e,UpdatePriKey:t},n){this.exec("Arm_SetUpdatePriKey",[parseInt(e),t],n)},this.Arm_MakeUpdatePacket=function({Handle:e,HID:t,Func:n,FileID:i,FileType:a,Offset:o,DataLen:c,DataBuffer:u,UpRSAPubKey:m},C){this.exec("Arm_MakeUpdatePacket",[parseInt(e),t,n,a,parseInt(i),parseInt(o),u,m,parseInt(c)],C)},this.Arm_MakeUpdatePacketFromMother=function({Handle:e,HID:t,Func:n,FileID:i,FileType:a,Offset:o,DataLen:c,DataBuffer:u},m){this.exec("Arm_MakeUpdatePacketFromMother",[parseInt(e),t,n,a,parseInt(i),parseInt(o),u,parseInt(c)],m)},this.Arm_Update=function({Handle:e,UpdateData:t},n){this.exec("Arm_Update",[parseInt(e),t],n)},this.Arm_Set_DATA_FILE_ATTR=function({Size:e,ReadPriv:t,WritePriv:n},i){this.exec("Arm_Set_DATA_FILE_ATTR",[parseInt(e),parseInt(t),parseInt(n)],i)},this.Arm_Set_PRIKEY_FILE_ATTR=function({Count:e,Size:t,Type:n,Priv:i,IsReset:a,IsDecOnRAM:o},c){this.exec("Arm_Set_PRIKEY_FILE_ATTR",[n,parseInt(t),parseInt(e),parseInt(i),parseInt(o),parseInt(a)],c)},this.Arm_Set_KEY_FILE_ATTR=function({Size:e,PrivEnc:t},n){this.exec("Arm_Set_KEY_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_EXE_FILE_ATTR=function({FileLen:e,PrivExe:t},n){this.exec("Arm_Set_EXE_FILE_ATTR",[parseInt(e),parseInt(t)],n)},this.Arm_Set_DATA_LIC=function({ReadPriv:e,WritePriv:t},n){this.exec("Arm_Set_DATA_LIC",[parseInt(e),parseInt(t)],n)},this.Arm_Set_PRIKEY_LIC=function({Count:e,Priv:t,IsReset:n,IsDecOnRAM:i},a){this.exec("Arm_Set_PRIKEY_LIC",[parseInt(e),parseInt(t),parseInt(i),parseInt(n)],a)},this.Arm_Set_KEY_LIC=function({PrivEnc:e},t){this.exec("Arm_Set_KEY_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_LIC=function({PrivExe:e},t){this.exec("Arm_Set_EXE_LIC",[parseInt(e)],t)},this.Arm_Set_EXE_FILE_INFO=function({FileID:e,FileData:t,FileSize:n,InBuffer:i,CallLimit:a},o){this.exec("Arm_Set_EXE_FILE_INFO",[i,parseInt(n),parseInt(e),parseInt(a),t,t.length],o)},this.Arm_Clear_EXE_FILE_INFO=function({InBuffer:e},t){this.exec("Arm_Clear_EXE_FILE_INFO",[e],t)}}const wn={HID:0},fe={PRODUCT_ID:0,USER_ID:1,HARDWARE_ID:2},je={USER:0};class $e{constructor(){ee(this,"Base64",new En);ee(this,"AtlCtrl",null);ee(this,"ArmCount",0);ee(this,"ArmIndex",0);ee(this,"ArmHandle",0);ee(this,"ArmRandom","");try{this.AtlCtrl=new gn("{39E9B272-82A7-4177-A19D-6723C1BDB0CC}")}catch(e){console.error(e),this.AtlCtrl=null}}armEnum(){if(this.AtlCtrl)return new Promise((e,t)=>{this.AtlCtrl.Arm_Enum((n,i)=>{n?(this.ArmCount=+i,e(i)):t(i)})})}armOpen(e=0){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((t,n)=>{this.AtlCtrl.Arm_Open({Index:e},(i,a)=>{i?(this.ArmHandle=+a,t(a)):(this.ArmHandle=a,n(a))})})}armClose(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_Close({Handle:e},(i,a)=>{i?t(a):n(a)})})}armChangePIN(e,t,n=255,i=je.USER,a=this.ArmHandle){if(this.AtlCtrl)return new Promise((o,c)=>{this.AtlCtrl.Arm_ChangePIN({Handle:a,NewPIN:e,OldPIN:t,TryCount:n,PinFlag:i},(u,m)=>{u&&m==0?(this.ArmPin=e,o(m)):c(m)})})}armGenRandom(e=16,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenRandom({Handle:t,RandomLen:e},(a,o)=>{a?(this.ArmRandom=o,n(o)):i(o)})})}armGetDeadline(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_GetDeadline({Handle:e},(i,a)=>{i?(this.ArmDeadline=a,t(a)):n(a)})})}armGenUniqueKey(e="MTIzNDU2Nzg5MA==",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_GenUniqueKey({Handle:t,Seed:e},(a,o)=>{a?(this.ArmUKey=o,n(o)):i(o)})})}armGetDongleInfo(e=0,t=fe.HARDWARE_ID){if(this.AtlCtrl)return this.ArmIndex=e,new Promise((n,i)=>{this.AtlCtrl.Arm_GetDongleInfo({Index:e,DongleInfoNum:t},(a,o)=>{if(a){switch(t){case fe.USER_ID:this.ArmUid=o;break;case fe.PRODUCT_ID:this.ArmPid=o;break;case fe.HARDWARE_ID:this.ArmHid=o;break}n(o)}else i(o)})})}armLEDControl(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_LEDControl({Handle:t,LedFlag:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armRFS(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_RFS({Handle:e},(i,a)=>{i&&a==0?t(a):n(a)})})}armReadFile(e="0001",t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl[`Arm_ReadFile${e}`]({Handle:t},(a,o)=>{if(a&&o.length>0)try{o=this.Base64.decode(o),n(o)}catch(c){console.error(c),n(o)}else i(o)})})}armResetState(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ResetState({Handle:e},(i,a)=>{i&&a==0?t(a):n(a)})})}armResetUserPIN(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_ResetUserPIN({Handle:t,AdminPIN:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSetUserID(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetUserID({Handle:t,UserID:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSetDeadline(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SetDeadline({Handle:t,SetDeadTime:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armSwitchProtocol(e=wn.HID,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_SwitchProtocol({Handle:t,ProtocolFlag:e},(a,o)=>{a&&o==0?n(o):i(o)})})}armVerifyPIN(e,t=je.USER,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_VerifyPIN({Handle:n,UserPin:e,UserType:t},(o,c)=>{o&&c==0?(this.ArmPin=e,i(c)):a(c)})})}armReadData(e=0,t=128,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_ReadData({Handle:n,Offset:e,ReadLength:t},(o,c)=>{o?(this.ArmData=c,i(c)):a(c)})})}armWriteData(e,t=0,n=this.ArmHandle){if(this.AtlCtrl)return new Promise((i,a)=>{this.AtlCtrl.Arm_WriteData({Handle:n,Offset:t,DataInput:e},(o,c)=>{o&&c==0?i(c):a(c)})})}armReadShareMemory(e=this.ArmHandle){if(this.AtlCtrl)return new Promise((t,n)=>{this.AtlCtrl.Arm_ReadShareMemory({Handle:e},(i,a)=>{i?(this.ArmData=a,t(a)):n(a)})})}armWriteShareMemory(e,t=this.ArmHandle){if(this.AtlCtrl)return new Promise((n,i)=>{this.AtlCtrl.Arm_WriteShareMemory({Handle:t,DataInput:e},(a,o)=>{a&&o==0?n(o):i(o)})})}}const Je="0123456789abcdeffedcba9876543210",Xe="4b0de988570c3a0f";let ne=window.ENCRYPT&&new $e;function Ye(r=16,e="0123456789abcdefghijklmnopqrstuvwxyz"){let t="",n=e.length;for(;r>0;)t+=e[Math.floor(Math.random()*n)],r--;return t}function Qe(){return E(this,null,function*(){return ne||(ne=new $e),new Promise((r,e)=>{ne.armEnum().then(t=>{r(+t)}).catch(t=>{G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e(t)})})})}we.throttle(()=>E(this,null,function*(){const r=yield Qe(),e={};if(typeof r!="number"||r<=0)G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken();else{const t=yield In();if(!e.token)return;t.length?t.includes(e.ukeyHid)||(G.ElMessage({type:"error",ElMessage:"U盘锁不匹配,请检查U盘锁!"}),e.resetToken()):(G.ElMessage({type:"warning",ElMessage:"未找到U盘锁,请检查U盘锁!"}),e.resetToken())}}),5e3,{trailing:!1});function Sn(r=0){return E(this,null,function*(){return ne?new Promise((e,t)=>{ne.armGetDongleInfo(r).then(n=>{n?e(n):(G.ElMessage({type:"warning",ElMessage:"U盘锁信息为空,请检查U盘锁!"}),t(n))}).catch(n=>{t(n)})}):G.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"})})}function In(){return E(this,null,function*(){if(!ne)return G.ElMessage({type:"warning",ElMessage:"未找到U盘锁程序,请检查后台程序!"});const r=yield Qe();let e=[];for(let t=0;t<r;t++){const n=yield Sn(t);e.push(n)}return e})}Ye(16),Ye(16);const Ze=window.meta.app.inspect?H.SM4.constants.CBC:H.SM4.constants.ECB,{publicKey:Pr,privateKey:Mr}=H.SM2.generateKeyPair();function et(r,e,t={}){const n=nt(Xe),i=t.mode||Ze;t=i===H.SM4.constants.ECB?B({mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t):B({iv:Je,mode:i,inputEncoding:"utf8",outputEncoding:"hex"},t);let a="";try{a=H.SM4.encrypt(r,n,t)}catch(o){console.log("err: ",o)}return a}function tt(r,e,t={}){const n=nt(Xe),i=t.mode||Ze;return t=i===H.SM4.constants.ECB?B({mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t):B({iv:Je,mode:i,inputEncoding:"hex",outputEncoding:"utf8"},t),H.SM4.decrypt(r,n,t)}function nt(r){return[...r].map(e=>e.charCodeAt().toString(16)).join("")}const se=r=>{const{onClose:e,customClass:t}=r;return G.ElMessage(Ae(B({},r),{center:!0,customClass:`sy-message ${t||""}`,onClose:i=>{e&&e(i)}}))};["success","warning","info","error"].forEach(r=>{se[r]=e=>se(typeof e=="string"?{type:r,message:e}:Ae(B({},e),{type:r}))}),Se.createPinia();const Re={getLocal:r=>{try{let e=window.localStorage.getItem(r);return e=e!==null?tt(e):e,JSON.parse(e)}catch(e){console.error(e)}},setLocal:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?et(t):t,window.localStorage.setItem(r,t)}catch(t){console.error(t)}},eachLocal:r=>{if(!r||qe(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.localStorage.length;e<t;e++){const n=window.localStorage.key(e);r((void 0).getLocal(n),n)}},clearLocal:()=>{window.localStorage.clear()},removeLocal:r=>{window.localStorage.removeItem(r)},getSession:r=>{try{let e=window.sessionStorage.getItem(r);return e=e!==null?tt(e):e,JSON.parse(e)}catch(e){console.error(e)}},setSession:(r,e)=>{try{let t=JSON.stringify(e);t=t!==null?et(t):t,window.sessionStorage.setItem(r,t)}catch(t){console.error(t)}},eachSession:r=>{if(!r||qe(r)!=="Function")return console.error("传递参数非函数类型!");for(let e=0,t=window.sessionStorage.length;e<t;e++){const n=window.sessionStorage.key(e);r((void 0).getSession(n),n)}},clearSession:()=>{window.sessionStorage.clear()},removeSession:r=>{window.sessionStorage.removeItem(r)}},yn=(r,e)=>new Promise((t,n)=>{j.postApi("/filehandle/save",{path:r,data:e}).then(i=>{i.res.success?t(!0):n(!1)})});class Cn extends Y.Object3D{constructor(e=document.createElement("div")){super(),this.isCSS2DObject=!0,this.element=e,this.element.style.position="absolute",this.element.style.userSelect="none",this.element.setAttribute("draggable",!1),this.center=new Y.Vector2(.5,.5),this.addEventListener("removed",function(){this.traverse(function(t){t.element instanceof Element&&t.element.parentNode!==null&&t.element.parentNode.removeChild(t.element)})})}copy(e,t){return super.copy(e,t),this.element=e.element.cloneNode(!0),this.center=e.center,this}}const re=new Y.Vector3,rt=new Y.Matrix4,it=new Y.Matrix4,st=new Y.Vector3,at=new Y.Vector3;class Rn{constructor(e={}){const t=this;let n,i,a,o;const c={objects:new WeakMap},u=e.element!==void 0?e.element:document.createElement("div");u.style.overflow="hidden",this.domElement=u,this.getSize=function(){return{width:n,height:i}},this.render=function(d,A){d.matrixWorldAutoUpdate===!0&&d.updateMatrixWorld(),A.parent===null&&A.matrixWorldAutoUpdate===!0&&A.updateMatrixWorld(),rt.copy(A.matrixWorldInverse),it.multiplyMatrices(A.projectionMatrix,rt),C(d,d,A),$(d)},this.setSize=function(d,A){n=d,i=A,a=n/2,o=i/2,u.style.width=d+"px",u.style.height=A+"px"};function m(d){d.isCSS2DObject&&(d.element.style.display="none");for(let A=0,S=d.children.length;A<S;A++)m(d.children[A])}function C(d,A,S){if(d.visible===!1){m(d);return}if(d.isCSS2DObject){re.setFromMatrixPosition(d.matrixWorld),re.applyMatrix4(it);const x=re.z>=-1&&re.z<=1&&d.layers.test(S.layers)===!0,_=d.element;_.style.display=x===!0?"":"none",x===!0&&(d.onBeforeRender(t,A,S),_.style.transform="translate("+-100*d.center.x+"%,"+-100*d.center.y+"%)translate("+(re.x*a+a)+"px,"+(-re.y*o+o)+"px)",_.parentNode!==u&&u.appendChild(_),d.onAfterRender(t,A,S));const w={distanceToCameraSquared:z(S,d)};c.objects.set(d,w)}for(let x=0,_=d.children.length;x<_;x++)C(d.children[x],A,S)}function z(d,A){return st.setFromMatrixPosition(d.matrixWorld),at.setFromMatrixPosition(A.matrixWorld),st.distanceToSquared(at)}function V(d){const A=[];return d.traverseVisible(function(S){S.isCSS2DObject&&A.push(S)}),A}function $(d){const A=V(d).sort(function(S,x){if(S.renderOrder!==x.renderOrder)return x.renderOrder-S.renderOrder;const _=c.objects.get(S).distanceToCameraSquared,w=c.objects.get(x).distanceToCameraSquared;return _-w});for(let S=0,x=A.length;S<x;S++)A[S].element.style.zIndex=1,console.log("🚀 ~ CSS2DRenderer ~ zOrder ~ sorted[i].element.style.zIndex:",A[S].element.style.zIndex)}}}const xn={CSS2DObject:Cn,CSS2DRenderer:Rn},Dn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1155" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#1afa29" p-id="1156"></path></svg>',ot='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M512 512m-500.62222187 0a500.62222187 500.62222187 0 1 0 1001.24444374 0 500.62222187 500.62222187 0 1 0-1001.24444374 0Z" fill="#808080" p-id="1658"></path></svg>',vn='<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="25776" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M377.083 125.44c74.606-135.314 195.292-135.314 269.897 0l346.332 629.394c74.606 135.315 9.508 245.395-145.189 245.395H175.94c-154.697 0-219.428-109.715-145.188-245.395L377.083 125.44z" fill="#FF2D16" p-id="25777"></path><path d="M567.986 328.046c0-31.086-25.234-55.955-55.954-55.955s-55.954 25.235-55.954 55.955v280.137c0 31.086 25.234 55.954 55.954 55.954s55.954-25.234 55.954-55.954V328.046z m-111.908 448h111.908v111.908H456.078z" fill="#FFFFFF" p-id="25778"></path></svg>',Tn={name:"局放测点",label:"局放测点",create:function(r,e){return E(this,null,function*(){const{transformControls:t}=e,n=document.createElement("div");n.style.position="relative",n.style.zIndex="1";const i=document.createElement("div");i.style.width="1.3vw",i.style.height="1.3vw",i.style.display="flex",i.style.alignItems="center",i.style.justifyContent="center",i.style.cursor="pointer",i.style.pointerEvents="auto",i.style.userSelect="none",i.innerHTML=ot;const a=document.createElement("style");a.innerHTML=`
8
8
  .icon { width: 100%; height: 100%; display: block; }
9
- `,n.append(o),n.append(i);const a=document.createElement("div");Object.assign(a.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),r.valueEleId||(r.valueEleId=Ce()),a.innerHTML=`
9
+ `,n.append(a),n.append(i);const o=document.createElement("div");Object.assign(o.style,{position:"absolute",top:"0",left:"1.8vw",display:"none",flexDirection:"column",gap:"10px",padding:"10px",borderRadius:"4px",border:"1px solid rgba(255, 255, 255, 0.2)",backdropFilter:"blur(12px)",background:"#24262933",minWidth:"12vw",zIndex:999}),r.valueEleId||(r.valueEleId=Ce()),o.innerHTML=`
10
10
  <div style="padding-bottom: 10px; font-size: 16px; color: #ffffff; border-bottom: 1px solid rgba(255, 113, 108, 0.5);white-space: nowrap;">${r.name}</div>
11
11
  <div style="font-size: 14px; color: #cae4ff;">幅值峰值</div>
12
12
  <div style="display: flex; align-items: flex-end; gap: 10px; color: #FF716C;">
13
13
  <span id="${r.valueEleId}" style="font-size: 24px;font-weight: 600;">${r.value}</span>
14
14
  <span style="font-size: 14px;">dBm</span>
15
15
  </div>
16
- `;const c=new Ft.CSS2DObject(n);c.name=r.name,c.dataId=r.guid,c.userData.params=r,i.addEventListener("mouseover",()=>{a.style.display="flex",n.className="top-info"}),i.addEventListener("mouseleave",()=>{a.style.display="none",n.className=""}),i.addEventListener("click",()=>{ye.emit("three-event",{type:"pd-sensor-click",data:c}),r.preview||setTimeout(()=>{t.attach(c)},100)}),n.append(a);const u=C=>{C===0?i.innerHTML=at:C===1?i.innerHTML=Dn:C===2&&(i.innerHTML=vn)},m=C=>{const z=document.getElementById(r.valueEleId);z&&(z.innerText=C)};return c.changeState=u,c.changeValue=m,setTimeout(()=>{u(r.state),m(r.value)},200),c})},getStorage:function(r){return r.userData.params}};L.config(B({driver:[L.INDEXEDDB,L.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((Pt=window.meta.storage)==null?void 0:Pt.config)||{}));function Pn(){return{getKey:d=>E(this,null,function*(){return yield L.key(d)}),getKeys:()=>E(this,null,function*(){return yield L.keys()}),getItem:d=>E(this,null,function*(){if(d)return yield L.getItem(d)}),setItem:(d,A)=>E(this,null,function*(){if(d)return yield L.setItem(d,A)}),removeItem:d=>E(this,null,function*(){if(d)return yield L.removeItem(d)}),clearItems:()=>E(this,null,function*(){return yield L.clear()}),iterateItems:(d,A)=>E(this,null,function*(){if(d)return yield L.iterate(d,A)}),getReady:()=>E(this,null,function*(){return yield L.ready()}),getLength:()=>E(this,null,function*(){return yield L.length()}),getDriver:()=>E(this,null,function*(){return yield L.driver()}),setDriver:d=>E(this,null,function*(){if(d)return yield L.setDriver(d)}),setConfig:d=>E(this,null,function*(){if(d)return yield L.config(d)}),dropInstance:d=>E(this,null,function*(){if(d)return yield L.dropInstance(d)}),createInstance:d=>E(this,null,function*(){if(d)return yield L.createInstance(d)})}}const Mn="THREED_LOG_BUFFER",bn="THREED_CURRSCENE",Ln="THREED_ACTIVE_MENU",On="THREED_PIXEL_RATIO",pe="THREED_MODEL_DBNAME",xe="THREED_MODEL_DBSTORE",Un="THREED_SCENE_PREVIEW",De="THREED_MODEL_LOAD_KEY",oe="THREED_PREVIEW_URL_KEY",Hn="THREED_ADDON_EDITOR_JSON",kn="THREED_SCENE_STORAGE_SUFFIX",ve={step:.1},Fn=80,ct=30,Nn=1e3,Bn=1200,Gn=3e5,zn="三维测试",Vn="灯光",Kn=1,Wn=["环境光","平行光","点光源","聚光灯","半球光","平面光"],lt=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),qn=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],ut=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),dt=new Set(["CSS2DObject","CSS3DObject"]),jn=Object.assign({"/src/views/threed/models/CSS2DRenderer.js":xn,"/src/views/threed/models/pd-sensor.js":Tn}),$n=Object.assign({}),Jn={环境光:()=>new F.THREE.AmbientLight(16777215,1),平行光:()=>new F.THREE.DirectionalLight(16777215,1),点光源:()=>new F.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new F.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new F.THREE.HemisphereLight(16777215,0,1),平面光:()=>new F.THREE.RectAreaLight(16777215,1,100,100)},Xn=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
16
+ `;const c=new Ft.CSS2DObject(n);c.name=r.name,c.dataId=r.guid,c.userData.params=r,i.addEventListener("mouseover",()=>{o.style.display="flex",n.className="top-info"}),i.addEventListener("mouseleave",()=>{o.style.display="none",n.className=""}),i.addEventListener("click",()=>{ye.emit("three-event",{type:"pd-sensor-click",data:c}),r.preview||setTimeout(()=>{t.attach(c)},100)}),n.append(o);const u=C=>{C===0?i.innerHTML=ot:C===1?i.innerHTML=Dn:C===2&&(i.innerHTML=vn)},m=C=>{const z=document.getElementById(r.valueEleId);z&&(z.innerText=C)};return c.changeState=u,c.changeValue=m,setTimeout(()=>{u(r.state),m(r.value)},200),c})},getStorage:function(r){return r.userData.params}};L.config(B({driver:[L.INDEXEDDB,L.LOCALSTORAGE],name:"SGP7000",size:4980736,storeName:"keyvaluepairs",version:1,description:"SGP7000"},((Pt=window.meta.storage)==null?void 0:Pt.config)||{}));function Pn(){return{getKey:d=>E(this,null,function*(){return yield L.key(d)}),getKeys:()=>E(this,null,function*(){return yield L.keys()}),getItem:d=>E(this,null,function*(){if(d)return yield L.getItem(d)}),setItem:(d,A)=>E(this,null,function*(){if(d)return yield L.setItem(d,A)}),removeItem:d=>E(this,null,function*(){if(d)return yield L.removeItem(d)}),clearItems:()=>E(this,null,function*(){return yield L.clear()}),iterateItems:(d,A)=>E(this,null,function*(){if(d)return yield L.iterate(d,A)}),getReady:()=>E(this,null,function*(){return yield L.ready()}),getLength:()=>E(this,null,function*(){return yield L.length()}),getDriver:()=>E(this,null,function*(){return yield L.driver()}),setDriver:d=>E(this,null,function*(){if(d)return yield L.setDriver(d)}),setConfig:d=>E(this,null,function*(){if(d)return yield L.config(d)}),dropInstance:d=>E(this,null,function*(){if(d)return yield L.dropInstance(d)}),createInstance:d=>E(this,null,function*(){if(d)return yield L.createInstance(d)})}}const Mn="THREED_LOG_BUFFER",bn="THREED_CURRSCENE",Ln="THREED_ACTIVE_MENU",On="THREED_PIXEL_RATIO",pe="THREED_MODEL_DBNAME",xe="THREED_MODEL_DBSTORE",Un="THREED_SCENE_PREVIEW",De="THREED_MODEL_LOAD_KEY",ae="THREED_PREVIEW_URL_KEY",Hn="THREED_ADDON_EDITOR_JSON",kn="THREED_SCENE_STORAGE_SUFFIX",ve={step:.1},Fn=80,ct=30,Nn=1e3,Bn=1200,Gn=3e5,zn="三维测试",Vn="灯光",Kn=1,Wn=["环境光","平行光","点光源","聚光灯","半球光","平面光"],lt=new Set(["syncStatus","disposeTargets","statusMaterials","syncPanelPlacement"]),qn=["AxesHelper","GridHelper","Box3Helper","PerspectiveCamera"],ut=new Set(["GridHelper","AxesHelper","CameraHelper","SpotLightHelper","PointLightHelper","TransformControls","HemisphereLightHelper","DirectionalLightHelper","TransformControlsPlane"]),dt=new Set(["CSS2DObject","CSS3DObject"]),jn=Object.assign({"/src/views/threed/models/CSS2DRenderer.js":xn,"/src/views/threed/models/pd-sensor.js":Tn}),$n=Object.assign({}),Jn={环境光:()=>new F.THREE.AmbientLight(16777215,1),平行光:()=>new F.THREE.DirectionalLight(16777215,1),点光源:()=>new F.THREE.PointLight(16777215,1,0,0),聚光灯:()=>new F.THREE.SpotLight(16777215,1,0,Math.PI/6,0,0),半球光:()=>new F.THREE.HemisphereLight(16777215,0,1),平面光:()=>new F.THREE.RectAreaLight(16777215,1,100,100)},Xn=[{name:"荧光流动",commonUniforms:!0,vertex:"vUv-material",fragment:`
17
17
  vec4 o = gl_FragColor.rgba;
18
18
  vec2 u = gl_FragCoord.xy;
19
19
  vec2 v = iResolution.xy;
@@ -51,4 +51,4 @@
51
51
  uv *= 2.0 * ( cos(iTime * 2.0) -2.5);
52
52
  float anim = sin(iTime * 12.0) * 0.1 + 1.0;
53
53
  vec3 col = cheap_star(uv, anim) * vec3(0.35,0.2,0.15);
54
- `,key:"col",commonFinish:!0,render:"iTime+speed"}];let ae=null,W=null;const ht=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",mt=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),Yn=mt(jn),Qn=mt($n),Zn=()=>({THREED_GUI_PARAMS:ve,THREED_LOG_BUFFER:Mn,THREED_CURRSCENE:bn,THREED_ACTIVE_MENU:Ln,THREED_PIXEL_RATIO:On,THREED_IMPORT_SIZE:Fn,THREED_LIGHT_TYPES:Wn,THREED_EXPORT_BATCH:ct,THREED_RELOAD_DELAY:Nn,THREED_MODEL_DBNAME:pe,THREED_MODEL_DBSTORE:xe,THREED_SCENE_PREVIEW:Un,THREED_USER_DATA_KEYS:lt,THREED_MODEL_LOAD_KEY:De,THREED_PREVIEW_URL_KEY:oe,THREED_ADDON_EDITOR_JSON:Hn,THREED_EXPORT_NODE_COUNT:Bn,THREED_DEFAULT_SCENE_NAME:zn,THREED_DEFAULT_ACTIVE_MENU:Vn,THREED_DEFAULT_PIXEL_RATIO:Kn,THREED_EXPORT_VERTEX_COUNT:Gn,THREED_SCENE_EXCLUDE_TYPES:qn,THREED_EXPORT_EXCLUDE_TYPES:ut,THREED_EXPORT_RUNTIME_TYPES:dt,THREED_SCENE_STORAGE_SUFFIX:kn});function er(){const{createInstance:r,dropInstance:e}=Pn(),t="/";let n=[];const i=s=>{let l=URL.createObjectURL(s);return n.push(l),l},o=()=>{n.forEach(s=>URL.revokeObjectURL(s)),n=[]},a=()=>E(this,null,function*(){return yield m(),{clearRequest:c,getAllRequest:d,getRequest:$,status:!0,message:"数据库打开成功",DATABASE:W}}),c=s=>E(this,null,function*(){if(!s)return{status:!1,message:"删除失败"};yield m(),yield W.removeItem(s);const l=V();return l.list=l.list.filter(h=>h.name!==s),{status:!0,message:"删除成功"}}),u=(...l)=>E(this,[...l],function*(s=pe){W=null,ae=null,yield e({name:s,storeName:xe})}),m=()=>E(this,null,function*(){return W||(ae||(ae=r({name:pe,storeName:xe}).then(s=>(W=s,s))),yield ae)}),C=s=>{if(!s)return!1;const l=String(s.message||"");return s.name==="DataError"||l.includes("in-line keys")},z=()=>E(this,null,function*(){W=null,ae=null,yield e({name:pe}),yield m()}),V=()=>(window.threeEditorDB||(window.threeEditorDB={db:null,list:[]}),window.threeEditorDB),$=s=>E(this,null,function*(){if(!s)return{status:!1,message:"获取失败"};yield m();const l=yield W.getItem(s);if(l!=null&&l.blob&&!s)return{status:!0,message:"获取成功",url:i(l.blob)};if(!s)return{status:!1,message:"获取失败"};const h=yield fetch(s).then(O=>O.blob()),f={blob:h};try{yield W.setItem(s,f)}catch(O){if(!C(O))throw O;yield z(),yield W.setItem(s,f)}const y=V(),K=B({name:s},f),b=y.list.findIndex(O=>O.name===s);return b>-1?y.list.splice(b,1,K):y.list.push(K),{status:!0,message:"文件缓存成功",url:i(h)}}),d=()=>E(this,null,function*(){const s=V();yield m();const l=[];return yield W.iterate((h,f)=>{l.push(Ae(B({},h||{}),{name:f}))}),s.list=l,{status:!0,message:"获取成功",data:l}}),A=()=>E(this,null,function*(){var h;const{res:s}=yield j.getApi("/filehandle/scan",{path:We.threeModelPath,extension:"glb,gltf"}),l=[];if(((h=s==null?void 0:s.children)==null?void 0:h.length)>0)for(const f of s.children)l.push({name:f.name,path:"/"+f.path});return l}),S=()=>window.GUI_PARAMS||ve,x=()=>window.threeEditor||null,_=()=>window.editorJsons||[],w=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),P=()=>Yn,R=()=>V(),U=()=>Jn||{},v=()=>window[oe]||"",T=()=>Qn,k=()=>window.devicePixelRatio||1,M=()=>window[oe]||"",N=()=>{const s=P(),l=T();return{modelDesigns:s,componentDesigns:l,modelList:s.map(h=>h.label),componentList:l.map(h=>h.label)}},q=(s,l)=>{var h;return(h=s==null?void 0:s.__DESIGNS__)==null?void 0:h.find(f=>f.label===l)},Q=(s=0)=>!Number.isFinite(s)||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:s<1024*1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${(s/1024/1024/1024).toFixed(2)} GB`,ie=s=>{const l=window[De];typeof l=="function"&&l(s)},Z=s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z),le=s=>{var l,h;return!s||!s.visible||(l=s.userData)!=null&&l.excludeFromExport||s.isTransformControls||s.isHelper||s.isLight||s.isPoints||(h=s.type)!=null&&h.includes("Helper")||ut.has(s.type)||dt.has(s.type)||s.isCSS2DObject||s.isCSS3DObject?!1:s.isMesh||s.isGroup||s.isObject3D||s.isLine},ke=(s,l)=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)?s:l,cr=s=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)&&Number.isFinite(s.w)?s:{x:0,y:0,z:0,w:1},Mt=s=>{if(!(s!=null&&s.isObject3D))return;const l=ke(s.position,{x:0,y:0,z:0});s.position.set(l.x,l.y,l.z);const h=ke(s.scale,{x:1,y:1,z:1});s.scale.set(h.x===0?1:h.x,h.y===0?1:h.y,h.z===0?1:h.z);const f=ke(s.up,{x:0,y:1,z:0});s.up.set(f.x,f.y,f.z);const y=cr(s.quaternion);s.quaternion.set(y.x,y.y,y.z,y.w),s.pivot&&!Z(s.pivot)&&delete s.pivot,s.updateMatrix(),s.updateMatrixWorld(!1)},lr=(s,l="_blank")=>window.open(s,l),ur=(s,l="")=>window.prompt(s,l),dr=()=>window.location.reload(),hr=()=>document.documentElement.classList.remove("dark"),mr=s=>{if(!Array.isArray(s==null?void 0:s.__DESIGNS__))return N();const l=[...P(),...T()],h=new Set(s.__DESIGNS__.map(f=>ht(f)));return l.forEach(f=>{const y=ht(f);!y||h.has(y)||(h.add(y),s.__DESIGNS__.unshift(f))}),N()},fr=s=>{if(!Array.isArray(s==null?void 0:s.__GLSLLIB__))return;const l=new Set(s.__GLSLLIB__.map(h=>h==null?void 0:h.name));Xn.forEach(h=>{l.has(h.name)||(l.add(h.name),s.__GLSLLIB__.push(h))})},Fe=(s={})=>{const l={};return Object.entries(s||{}).forEach(([h,f])=>{if(!(lt.has(h)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){l[h]=f;return}if(Array.isArray(f)){try{l[h]=structuredClone(f)}catch(y){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{l[h]=structuredClone(f)}catch(y){return}}}),l},pr=(s=ve)=>{window.GUI_PARAMS=s},_r=s=>{window.threeEditor=s},Er=s=>{window.threeEditorDB=s},Ar=s=>{window[De]=s},gr=(s="")=>{window[oe]=s},wr=(s="")=>{window[oe]=s},bt=s=>{var h;const l=[];return(h=s==null?void 0:s.children)==null||h.forEach(f=>{le(f)&&l.push(f)}),l},Lt=(s=[])=>{const l={rootCount:s.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return s.forEach(h=>{h.traverse(f=>{var y,K,b;if(le(f)){l.nodeCount+=1,f.isMesh&&(l.meshCount+=1,l.vertexCount+=((b=(K=(y=f.geometry)==null?void 0:y.attributes)==null?void 0:K.position)==null?void 0:b.count)||0);return}f!==h&&(l.skippedCount+=1)})}),l},Ot=()=>new Promise(s=>requestAnimationFrame(()=>setTimeout(s,0))),Ut=()=>new Promise(s=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>s(),{timeout:80});return}setTimeout(s,0)}),Sr=(s,l)=>E(this,null,function*(){var y;if(!le(s))return null;const h=s.clone(!1);h.userData=Fe(s.userData),Z(s.pivot)?h.pivot=new F.THREE.Vector3(s.pivot.x,s.pivot.y,s.pivot.z):"pivot"in h&&delete h.pivot,Mt(h);const f=[{source:s,clone:h}];for(;f.length;){const K=f.shift();for(const b of K.source.children){if(!le(b)){l.skippedCount+=1;continue}const O=b.clone(!1);O.userData=Fe(b.userData),Z(b.pivot)?O.pivot=new F.THREE.Vector3(b.pivot.x,b.pivot.y,b.pivot.z):"pivot"in O&&delete O.pivot,Mt(O),K.clone.add(O),f.push({source:b,clone:O}),l.processedCount+=1,l.processedCount%ct===0&&(yield(y=l.onProgress)==null?void 0:y.call(l,{processedCount:l.processedCount,totalCount:l.totalCount,skippedCount:l.skippedCount,progress:18+Math.min(l.processedCount/Math.max(l.totalCount,1)*54,54)}),yield Ot())}}return h});return{baseUrl:t,getModels:A,getRequest:$,reloadPage:dr,promptInput:ur,waitForIdle:Ut,waitForPaint:Ot,clearRequest:c,getGuiParams:S,setGuiParams:pr,getAllRequest:d,getEditorJsons:_,getThreeEditor:x,formatFileSize:Q,setThreeEditor:_r,removeDarkClass:hr,openExternalUrl:lr,getThreedModels:P,getViewportSize:w,buildExportScene:(h,...f)=>E(this,[h,...f],function*(s,l={}){const y=bt(s),K=Lt(y),b=new F.THREE.Scene,O={totalCount:K.nodeCount,processedCount:0,skippedCount:0,onProgress:l.onProgress};for(const Ir of y){const Ht=yield Sr(Ir,O);Ht&&b.add(Ht),yield Ut()}return b.updateMatrixWorld(!0),K.skippedCount+=O.skippedCount,{exportScene:b,exportObjects:y,stats:K}}),createModelDbApi:a,getEditorPreviewSceneUrl:M,getThreeEditorDB:R,sanitizeUserData:Fe,setThreeEditorDB:Er,findThreedDesign:q,getThreedLightMap:U,collectExportStats:Lt,getPreviewSceneUrl:v,setEditorPreviewSceneUrl:wr,setPreviewSceneUrl:gr,setModelLoadHander:Ar,isExportableObject:le,deleteThreeEditorDB:u,ensureThreeEditorDB:V,getDevicePixelRatio:k,getThreedComponents:T,collectExportObjects:bt,resetModelDbInstance:z,ensureModelDbInstance:m,getLocalDesignMenuData:N,invokeModelLoadHandler:ie,isLegacyInlineKeyError:C,ensureThreedShaderLibrary:fr,ensureThreedDesignRegistry:mr,createBlobUrl:i,revokeModelObjectUrls:o}}const{THREED_LOG_BUFFER:Te,THREED_CURRSCENE:_e,THREED_ACTIVE_MENU:Pe,THREED_PIXEL_RATIO:Me,THREED_SCENE_PREVIEW:be,THREED_ADDON_EDITOR_JSON:Ee,THREED_DEFAULT_SCENE_NAME:tr,THREED_DEFAULT_ACTIVE_MENU:Le,THREED_DEFAULT_PIXEL_RATIO:Oe,THREED_SCENE_STORAGE_SUFFIX:ft}=Zn(),nr=[Te,_e,Pe,Me,be,Ee],J=(r,e)=>{const t=Re.getLocal(r);return t==null?e:t},X=(r,e)=>{r&&Re.setLocal(r,e)},Ue=r=>{r&&Re.removeLocal(r)},rr=(r,e)=>{var n,i;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(o=>o.name===t)?t:((i=e[0])==null?void 0:i.name)||tr},He=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],pt=()=>{const r=[],e=J(_e,{name:"",path:""}),t=Number.parseFloat(J(Me,Oe));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!J(be,!1),activeMenuTitle:J(Pe,Le)||Le,pixelRatio:Number.isFinite(t)&&t>0?t:Oe,logarithmicDepthBuffer:J(Te,!0)!==!1,addonEditorJson:He(J(Ee,[]))}},_t=Se.defineStore("threed",{state:()=>pt(),actions:{getSceneList(){return E(this,null,function*(){var e;const r=yield j.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=rr(r,this.sceneList),X(_e,this.sceneName)},createScene(r,e=""){return E(this,null,function*(){var c,u;const t=(c=r==null?void 0:r.trim)==null?void 0:c.call(r);if(!t||this.sceneList.some(m=>m.name===t))return!1;const n=We.threeSavePath+"/"+Ce()+".json",i=Ce();if(!(yield j.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:i}]})).success)return!1;if(yield yn(n,e)){const m=yield j.postCommonApi("threedfloorplan",{guid:i});if((u=m==null?void 0:m.data)!=null&&u.length)return this.sceneList=[...this.sceneList,m.data[0]],m.data[0]}return!0})},deleteScene(r){return E(this,null,function*(){var n;if(!r)return;if(!(yield j.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(i=>i.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return E(this,null,function*(){this.currScene=r,X(_e,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,X(be,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||Le,X(Pe,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:Oe,X(Me,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,X(Te,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${ft}`},getSceneStorageParams(r,e=null){return J(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&X(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&Ue(this.getSceneStorageKey(r))},resetTaskState(){return E(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=He(J(Ee,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=He(r),X(Ee,this.addonEditorJson)},clearThreedStorage(){nr.forEach(e=>Ue(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(ft)).forEach(e=>Ue(e));const r=pt();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),ir={scene:{backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},perspectiveCamera:{fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},webglRenderer:{outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},orbitControls:{autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},transformControls:{mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},effectComposer:{renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},handler:{mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},lightCores:[],innerCores:[],modelCores:[],drawCores:[],textCores:[],particleCores:[],geoCores:{},designCores:[],other:{viewAngleList:[],clipping:{size:20,clipList:[]}}},Et=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},sr=Et(Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){var U;const n=t,i=r,o=_t(),{currScene:a}=Se.storeToRefs(o),c=((U=window.meta.threed)==null?void 0:U.draco_path)||Ke;F.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let u=null,m=null;const C=p.ref(null),{setGuiParams:z,getDevicePixelRatio:V,getThreeEditorDB:$,createBlobUrl:d,revokeModelObjectUrls:A,ensureThreedDesignRegistry:S}=er();S(F.ThreeEditor),z({step:.1});const x=()=>{var v;return(v=u==null?void 0:u.renderSceneResize)==null?void 0:v.call(u)},_=()=>E(this,null,function*(){var T,k;let v=ir;try{if(i.data&&Object.keys(i.data).length)v=i.data;else if((T=a.value)!=null&&T.path){const M=yield j.getApi((k=a.value)==null?void 0:k.path).catch(()=>({}));console.log("初始化三维场景:",M),M.res&&(v=M.res)}u?u.resetEditorStorage(v):u=new F.ThreeEditor(C.value,{fps:null,pixelRatio:V()*o.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:o.logarithmicDepthBuffer},sceneParams:w(v)})}catch(M){console.error("三维图纸初始化失败",M),u==null||u.resetEditorStorage(v)}finally{u&&setTimeout(()=>{i.preview&&(u.handler.mode="none",u.handler.helpers.axes.showAxes=!1,u.handler.helpers.box3.useBox3=!1,u.handler.helpers.grid.showGrid=!1)},200),P()}n("emit-three-editor",u),window.addEventListener("resize",x)}),w=v=>{A(),v.designCores.forEach(N=>{N.preview=i.preview});const T=$(),k=T.list||[],M=structuredClone(v||{});return M.modelCores=(M.modelCores||[]).filter(N=>{const q=N.modelInfo.originPath;if(q){const Q=k.find(Z=>Z.name===q);if(!Q){const Z=T.db.getRequest(q);N.modelInfo.url=Z.url;return}const ie=d(Q.blob);N.modelInfo.url=ie}return!0}),M},P=()=>{u!=null&&u.renderer&&(m=new F.THREE.PMREMGenerator(u.renderer),m.compileEquirectangularShader(),u.scene.environment=m.fromScene(new Nt.RoomEnvironment).texture)},R=()=>u;return p.watch(()=>a.value.path,()=>E(this,null,function*(){_()})),p.watch(()=>i.data,()=>{_()},{deep:!0}),p.onMounted(()=>{_()}),p.onUnmounted(()=>{window.removeEventListener("resize",x),A(),u==null||u.destroySceneRender(),o.setCurrScene({name:"",path:""})}),e({getEditorInstance:R}),(v,T)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"editorRef",ref:C,class:"threed-editor",onDragover:T[0]||(T[0]=p.withModifiers(()=>{},["prevent"])),onDrop:T[1]||(T[1]=p.withModifiers(()=>{},["prevent"]))},null,544))}}),[["__scopeId","data-v-a95a7094"]]),or={class:"threed-preview"},ce=Et(Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(r,{expose:e,emit:t}){const n=r,i=t;let o=p.shallowRef({});const a=p.ref(),c=_t();let u={},m=null,C=null;const z=_=>{var P,R,U;if(!_)return;if((P=_==null?void 0:_.includes)!=null&&P.call(_,"token 必传"))return se({message:_,type:"warning"});const w=typeof _=="string"?JSON.parse(_):_;if((w==null?void 0:w.data)==="服务错误"||(U=(R=w==null?void 0:w.data)==null?void 0:R.includes)!=null&&U.call(R,"token is expired"))return se({message:w.data,type:"warning"});switch(w.action){case ze.ACPOINT.YCVALUE:case ze.ACPOINT.YXVALUE:console.warn("遥测信息");break}},V=()=>{try{C=new hn({socketUrl:n.socketUrl,token:n.token,onMessage:z})}catch(_){console.warn("三维场景消息处理失败",_)}},$=()=>E(this,null,function*(){var _;if(u){const w=Object.keys(u);if(w.length){const P=yield j.postPDApi("querychannelstatus/",{data:w.map(R=>({ied_id:R,ln_list:u[R].map(U=>U.ln_id)}))});(_=P==null?void 0:P.data)!=null&&_.length&&w.forEach(R=>{const U=P.data.find(T=>T.ied_id===R),v=u[R];v!=null&&v.length&&v.forEach(T=>{const k=U.result.find(M=>M.ln_id===T.ln_id);if(k){const M=x();if(!(M!=null&&M.scene))return;const N=M.scene.getObjectsByProperty("dataId",T.guid);let q=N==null?void 0:N[0];if(q){const Q=k.status==="告警"?2:k.status==="正常"?1:0;q.userData.params.state=Q;const ie=fn(k.amp_peak)?pn(Number(k.amp_peak))?Number(k.amp_peak):0:k.amp_peak;q.userData.params.value=ie;debugger;q.changeState(Q),q.changeValue(ie)}}})})}}}),d=_=>{i("graph-event",_)},A=_=>{_&&(n.socketUrl&&V(),setTimeout(()=>{const w=_.scene.getObjectsByProperty("designType","局放测点");w.forEach(P=>{const{ied_id:R,ln_id:U}=P.userData.params;u[R]||(u[R]=[]),u[R].push({guid:P.dataId,id:P.uuid,ied_id:R,ln_id:U})}),w!=null&&w.length&&(m&&clearInterval(m),$(),m=setInterval(()=>{$()},2e3)),i("loaded",_)},100))},S=()=>E(this,null,function*(){if(o.value&&Object.keys(o.value).length)return;const _=_n(),w=n.url||_.url;if(w){const U=yield j.getApi(w).catch(()=>({}));U.res&&(o.value=U.res);return}if(!(n.id||_.id)){console.warn("三维场景渲染失败,场景id为空!");return}const R=yield j.getCommonApi("threedfloorplan",{guid:n.id});R.data.length?c.setCurrScene(R.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),x=()=>a.value?a.value.getEditorInstance():null;return p.watch(()=>n.data,_=>{o.value=_,S()},{deep:!0,immediate:!0}),p.watch(()=>n.id,()=>{S()},{deep:!0,immediate:!0}),p.onMounted(()=>{ye.on("three-event",d)}),p.onUnmounted(()=>{C&&C.destroy(),ye.off("three-event",d)}),e({getEditorInstance:x}),(_,w)=>(p.openBlock(),p.createElementBlock("div",or,[p.createVNode(sr,{ref_key:"threedEditorRef",ref:a,data:p.unref(o),preview:"",onGraphEvent:d,onEmitThreeEditor:A},null,8,["data"])]))}}),[["__scopeId","data-v-7a310c71"]]);ce.name||(ce.name="SyThree");const ar={install:r=>{r.component(ce.name||"SyThree",ce)}};g.SyThree=ce,g.default=ar,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
54
+ `,key:"col",commonFinish:!0,render:"iTime+speed"}];let oe=null,W=null;const ht=r=>(r==null?void 0:r.name)||(r==null?void 0:r.label)||"",mt=(r={})=>Object.values(r).filter(e=>e&&(e.label||e.name)),Yn=mt(jn),Qn=mt($n),Zn=()=>({THREED_GUI_PARAMS:ve,THREED_LOG_BUFFER:Mn,THREED_CURRSCENE:bn,THREED_ACTIVE_MENU:Ln,THREED_PIXEL_RATIO:On,THREED_IMPORT_SIZE:Fn,THREED_LIGHT_TYPES:Wn,THREED_EXPORT_BATCH:ct,THREED_RELOAD_DELAY:Nn,THREED_MODEL_DBNAME:pe,THREED_MODEL_DBSTORE:xe,THREED_SCENE_PREVIEW:Un,THREED_USER_DATA_KEYS:lt,THREED_MODEL_LOAD_KEY:De,THREED_PREVIEW_URL_KEY:ae,THREED_ADDON_EDITOR_JSON:Hn,THREED_EXPORT_NODE_COUNT:Bn,THREED_DEFAULT_SCENE_NAME:zn,THREED_DEFAULT_ACTIVE_MENU:Vn,THREED_DEFAULT_PIXEL_RATIO:Kn,THREED_EXPORT_VERTEX_COUNT:Gn,THREED_SCENE_EXCLUDE_TYPES:qn,THREED_EXPORT_EXCLUDE_TYPES:ut,THREED_EXPORT_RUNTIME_TYPES:dt,THREED_SCENE_STORAGE_SUFFIX:kn});function er(){const{createInstance:r,dropInstance:e}=Pn(),t="/";let n=[];const i=s=>{let l=URL.createObjectURL(s);return n.push(l),l},a=()=>{n.forEach(s=>URL.revokeObjectURL(s)),n=[]},o=()=>E(this,null,function*(){return yield m(),{clearRequest:c,getAllRequest:d,getRequest:$,status:!0,message:"数据库打开成功",DATABASE:W}}),c=s=>E(this,null,function*(){if(!s)return{status:!1,message:"删除失败"};yield m(),yield W.removeItem(s);const l=yield V();return l.list=l.list.filter(h=>h.name!==s),{status:!0,message:"删除成功"}}),u=(...l)=>E(this,[...l],function*(s=pe){W=null,oe=null,yield e({name:s,storeName:xe})}),m=()=>E(this,null,function*(){return W||(oe||(oe=r({name:pe,storeName:xe}).then(s=>(W=s,s))),yield oe)}),C=s=>{if(!s)return!1;const l=String(s.message||"");return s.name==="DataError"||l.includes("in-line keys")},z=()=>E(this,null,function*(){W=null,oe=null,yield e({name:pe}),yield m()}),V=()=>E(this,null,function*(){if(!window.threeEditorDB){const s=yield o(),{data:l}=yield s.getAllRequest();window.threeEditorDB={db:s,list:l}}return window.threeEditorDB}),$=s=>E(this,null,function*(){if(!s)return{status:!1,message:"获取失败"};yield m();const l=yield W.getItem(s);if(l!=null&&l.blob&&!s)return{status:!0,message:"获取成功",url:i(l.blob)};if(!s)return{status:!1,message:"获取失败"};const h=yield fetch(s).then(O=>O.blob()),f={blob:h};try{yield W.setItem(s,f)}catch(O){if(!C(O))throw O;yield z(),yield W.setItem(s,f)}const y=yield V(),K=B({name:s},f),b=y.list.findIndex(O=>O.name===s);return b>-1?y.list.splice(b,1,K):y.list.push(K),{status:!0,message:"文件缓存成功",url:i(h)}}),d=()=>E(this,null,function*(){const s=yield V();yield m();const l=[];return yield W.iterate((h,f)=>{l.push(Ae(B({},h||{}),{name:f}))}),s.list=l,{status:!0,message:"获取成功",data:l}}),A=()=>E(this,null,function*(){var h;const{res:s}=yield j.getApi("/filehandle/scan",{path:We.threeModelPath,extension:"glb,gltf"}),l=[];if(((h=s==null?void 0:s.children)==null?void 0:h.length)>0)for(const f of s.children)l.push({name:f.name,path:"/"+f.path});return l}),S=()=>window.GUI_PARAMS||ve,x=()=>window.threeEditor||null,_=()=>window.editorJsons||[],w=()=>({width:window.innerWidth||0,height:window.innerHeight||0}),P=()=>Yn,R=()=>V(),U=()=>Jn||{},v=()=>window[ae]||"",T=()=>Qn,k=()=>window.devicePixelRatio||1,M=()=>window[ae]||"",N=()=>{const s=P(),l=T();return{modelDesigns:s,componentDesigns:l,modelList:s.map(h=>h.label),componentList:l.map(h=>h.label)}},q=(s,l)=>{var h;return(h=s==null?void 0:s.__DESIGNS__)==null?void 0:h.find(f=>f.label===l)},Q=(s=0)=>!Number.isFinite(s)||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:s<1024*1024*1024?`${(s/1024/1024).toFixed(1)} MB`:`${(s/1024/1024/1024).toFixed(2)} GB`,ie=s=>{const l=window[De];typeof l=="function"&&l(s)},Z=s=>!!s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z),le=s=>{var l,h;return!s||!s.visible||(l=s.userData)!=null&&l.excludeFromExport||s.isTransformControls||s.isHelper||s.isLight||s.isPoints||(h=s.type)!=null&&h.includes("Helper")||ut.has(s.type)||dt.has(s.type)||s.isCSS2DObject||s.isCSS3DObject?!1:s.isMesh||s.isGroup||s.isObject3D||s.isLine},ke=(s,l)=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)?s:l,cr=s=>s&&Number.isFinite(s.x)&&Number.isFinite(s.y)&&Number.isFinite(s.z)&&Number.isFinite(s.w)?s:{x:0,y:0,z:0,w:1},Mt=s=>{if(!(s!=null&&s.isObject3D))return;const l=ke(s.position,{x:0,y:0,z:0});s.position.set(l.x,l.y,l.z);const h=ke(s.scale,{x:1,y:1,z:1});s.scale.set(h.x===0?1:h.x,h.y===0?1:h.y,h.z===0?1:h.z);const f=ke(s.up,{x:0,y:1,z:0});s.up.set(f.x,f.y,f.z);const y=cr(s.quaternion);s.quaternion.set(y.x,y.y,y.z,y.w),s.pivot&&!Z(s.pivot)&&delete s.pivot,s.updateMatrix(),s.updateMatrixWorld(!1)},lr=(s,l="_blank")=>window.open(s,l),ur=(s,l="")=>window.prompt(s,l),dr=()=>window.location.reload(),hr=()=>document.documentElement.classList.remove("dark"),mr=s=>{if(!Array.isArray(s==null?void 0:s.__DESIGNS__))return N();const l=[...P(),...T()],h=new Set(s.__DESIGNS__.map(f=>ht(f)));return l.forEach(f=>{const y=ht(f);!y||h.has(y)||(h.add(y),s.__DESIGNS__.unshift(f))}),N()},fr=s=>{if(!Array.isArray(s==null?void 0:s.__GLSLLIB__))return;const l=new Set(s.__GLSLLIB__.map(h=>h==null?void 0:h.name));Xn.forEach(h=>{l.has(h.name)||(l.add(h.name),s.__GLSLLIB__.push(h))})},Fe=(s={})=>{const l={};return Object.entries(s||{}).forEach(([h,f])=>{if(!(lt.has(h)||typeof f=="function")){if(!f||["string","number","boolean"].includes(typeof f)){l[h]=f;return}if(Array.isArray(f)){try{l[h]=structuredClone(f)}catch(y){return}return}if(!(f.isObject3D||f.isMaterial||f.isTexture||f.nodeType))try{l[h]=structuredClone(f)}catch(y){return}}}),l},pr=(s=ve)=>{window.GUI_PARAMS=s},_r=s=>{window.threeEditor=s},Er=s=>{window.threeEditorDB=s},Ar=s=>{window[De]=s},gr=(s="")=>{window[ae]=s},wr=(s="")=>{window[ae]=s},bt=s=>{var h;const l=[];return(h=s==null?void 0:s.children)==null||h.forEach(f=>{le(f)&&l.push(f)}),l},Lt=(s=[])=>{const l={rootCount:s.length,nodeCount:0,meshCount:0,vertexCount:0,skippedCount:0};return s.forEach(h=>{h.traverse(f=>{var y,K,b;if(le(f)){l.nodeCount+=1,f.isMesh&&(l.meshCount+=1,l.vertexCount+=((b=(K=(y=f.geometry)==null?void 0:y.attributes)==null?void 0:K.position)==null?void 0:b.count)||0);return}f!==h&&(l.skippedCount+=1)})}),l},Ot=()=>new Promise(s=>requestAnimationFrame(()=>setTimeout(s,0))),Ut=()=>new Promise(s=>{if(typeof window.requestIdleCallback=="function"){window.requestIdleCallback(()=>s(),{timeout:80});return}setTimeout(s,0)}),Sr=(s,l)=>E(this,null,function*(){var y;if(!le(s))return null;const h=s.clone(!1);h.userData=Fe(s.userData),Z(s.pivot)?h.pivot=new F.THREE.Vector3(s.pivot.x,s.pivot.y,s.pivot.z):"pivot"in h&&delete h.pivot,Mt(h);const f=[{source:s,clone:h}];for(;f.length;){const K=f.shift();for(const b of K.source.children){if(!le(b)){l.skippedCount+=1;continue}const O=b.clone(!1);O.userData=Fe(b.userData),Z(b.pivot)?O.pivot=new F.THREE.Vector3(b.pivot.x,b.pivot.y,b.pivot.z):"pivot"in O&&delete O.pivot,Mt(O),K.clone.add(O),f.push({source:b,clone:O}),l.processedCount+=1,l.processedCount%ct===0&&(yield(y=l.onProgress)==null?void 0:y.call(l,{processedCount:l.processedCount,totalCount:l.totalCount,skippedCount:l.skippedCount,progress:18+Math.min(l.processedCount/Math.max(l.totalCount,1)*54,54)}),yield Ot())}}return h});return{baseUrl:t,getModels:A,getRequest:$,reloadPage:dr,promptInput:ur,waitForIdle:Ut,waitForPaint:Ot,clearRequest:c,getGuiParams:S,setGuiParams:pr,getAllRequest:d,getEditorJsons:_,getThreeEditor:x,formatFileSize:Q,setThreeEditor:_r,removeDarkClass:hr,openExternalUrl:lr,getThreedModels:P,getViewportSize:w,buildExportScene:(h,...f)=>E(this,[h,...f],function*(s,l={}){const y=bt(s),K=Lt(y),b=new F.THREE.Scene,O={totalCount:K.nodeCount,processedCount:0,skippedCount:0,onProgress:l.onProgress};for(const Ir of y){const Ht=yield Sr(Ir,O);Ht&&b.add(Ht),yield Ut()}return b.updateMatrixWorld(!0),K.skippedCount+=O.skippedCount,{exportScene:b,exportObjects:y,stats:K}}),createModelDbApi:o,getEditorPreviewSceneUrl:M,getThreeEditorDB:R,sanitizeUserData:Fe,setThreeEditorDB:Er,findThreedDesign:q,getThreedLightMap:U,collectExportStats:Lt,getPreviewSceneUrl:v,setEditorPreviewSceneUrl:wr,setPreviewSceneUrl:gr,setModelLoadHander:Ar,isExportableObject:le,deleteThreeEditorDB:u,ensureThreeEditorDB:V,getDevicePixelRatio:k,getThreedComponents:T,collectExportObjects:bt,resetModelDbInstance:z,ensureModelDbInstance:m,getLocalDesignMenuData:N,invokeModelLoadHandler:ie,isLegacyInlineKeyError:C,ensureThreedShaderLibrary:fr,ensureThreedDesignRegistry:mr,createBlobUrl:i,revokeModelObjectUrls:a}}const{THREED_LOG_BUFFER:Te,THREED_CURRSCENE:_e,THREED_ACTIVE_MENU:Pe,THREED_PIXEL_RATIO:Me,THREED_SCENE_PREVIEW:be,THREED_ADDON_EDITOR_JSON:Ee,THREED_DEFAULT_SCENE_NAME:tr,THREED_DEFAULT_ACTIVE_MENU:Le,THREED_DEFAULT_PIXEL_RATIO:Oe,THREED_SCENE_STORAGE_SUFFIX:ft}=Zn(),nr=[Te,_e,Pe,Me,be,Ee],J=(r,e)=>{const t=Re.getLocal(r);return t==null?e:t},X=(r,e)=>{r&&Re.setLocal(r,e)},Ue=r=>{r&&Re.removeLocal(r)},rr=(r,e)=>{var n,i;const t=(n=r==null?void 0:r.trim)==null?void 0:n.call(r);return t&&e.some(a=>a.name===t)?t:((i=e[0])==null?void 0:i.name)||tr},He=(r=[])=>Array.isArray(r)?r.filter(e=>typeof e=="string"&&e):[],pt=()=>{const r=[],e=J(_e,{name:"",path:""}),t=Number.parseFloat(J(Me,Oe));return{taskState:{busy:!1,type:"",title:"",message:"",description:"",progress:0},currScene:e,sceneList:r,previewScene:!!J(be,!1),activeMenuTitle:J(Pe,Le)||Le,pixelRatio:Number.isFinite(t)&&t>0?t:Oe,logarithmicDepthBuffer:J(Te,!0)!==!1,addonEditorJson:He(J(Ee,[]))}},_t=Se.defineStore("threed",{state:()=>pt(),actions:{getSceneList(){return E(this,null,function*(){var e;const r=yield j.getCommonApi("threedfloorplan",{limit:1e4,ordering:"-create_time"});(e=r==null?void 0:r.data)!=null&&e.length?(this.sceneList=r.data,this.currScene.path?this.sceneList.find(n=>n.id===this.currScene.id)||this.setCurrScene({name:"",path:""}):this.setCurrScene(this.sceneList[0])):(this.sceneList=[],this.setCurrScene({name:"",path:""}))})},setSceneList(r){this.sceneList=r},setSceneName(r){this.sceneName=rr(r,this.sceneList),X(_e,this.sceneName)},createScene(r,e=""){return E(this,null,function*(){var c,u;const t=(c=r==null?void 0:r.trim)==null?void 0:c.call(r);if(!t||this.sceneList.some(m=>m.name===t))return!1;const n=We.threeSavePath+"/"+Ce()+".json",i=Ce();if(!(yield j.postCommonApi("query/threedfloorplan/create",{data:[{name:t,path:n,guid:i}]})).success)return!1;if(yield yn(n,e)){const m=yield j.postCommonApi("threedfloorplan",{guid:i});if((u=m==null?void 0:m.data)!=null&&u.length)return this.sceneList=[...this.sceneList,m.data[0]],m.data[0]}return!0})},deleteScene(r){return E(this,null,function*(){var n;if(!r)return;if(!(yield j.postCommonApi("query/threedfloorplan/delete",{data:[r]})).success)return!1;const t=this.sceneList.findIndex(i=>i.id===r);return t===-1?!1:(this.sceneList.splice(t,1),((n=this.currScene)==null?void 0:n.id)===r&&this.setCurrScene(this.sceneList[0]||{name:"",path:""}),!0)})},setCurrScene(r){return E(this,null,function*(){this.currScene=r,X(_e,this.currScene)})},setPreviewMode(r){this.previewScene=!!r,X(be,this.previewScene)},setActiveMenuTitle(r){this.activeMenuTitle=r||Le,X(Pe,this.activeMenuTitle)},setPixelRatio(r){const e=Number.parseFloat(r);this.pixelRatio=Number.isFinite(e)&&e>0?e:Oe,X(Me,this.pixelRatio)},setLogarithmicDepthBuffer(r){this.logarithmicDepthBuffer=!!r,X(Te,this.logarithmicDepthBuffer)},getSceneStorageKey(r){return`${r||this.sceneName}${ft}`},getSceneStorageParams(r,e=null){return J(this.getSceneStorageKey(r),e)},setSceneStorageParams(r,e){r&&X(this.getSceneStorageKey(r),e)},removeSceneStorageParams(r){r&&Ue(this.getSceneStorageKey(r))},resetTaskState(){return E(this,null,function*(){yield new Promise(r=>setTimeout(r,120)),this.taskState={busy:!1,type:"",title:"",message:"",description:"",progress:0}})},getAddonEditorJson(){return this.addonEditorJson=He(J(Ee,this.addonEditorJson)),this.addonEditorJson},setAddonEditorJson(r){this.addonEditorJson=He(r),X(Ee,this.addonEditorJson)},clearThreedStorage(){nr.forEach(e=>Ue(e)),Object.keys(window.localStorage).filter(e=>e.endsWith(ft)).forEach(e=>Ue(e));const r=pt();this.currScene=r.currScene,this.sceneList=r.sceneList,this.previewScene=r.previewScene,this.activeMenuTitle=r.activeMenuTitle,this.pixelRatio=r.pixelRatio,this.logarithmicDepthBuffer=r.logarithmicDepthBuffer,this.addonEditorJson=r.addonEditorJson}}}),ir={scene:{backgroundBlurriness:0,backgroundIntensity:1,backgroundUrls:null,environmentEnabled:!1},perspectiveCamera:{fov:50,near:.1,far:1e5,zoom:1,layers:{mask:1},filmOffset:0,filmGauge:35,position:{x:247.72931803058157,y:715.3890430349733,z:789.6794984861216}},webglRenderer:{outputColorSpace:"srgb",toneMapping:0,toneMappingExposure:1,shadowMap:{enabled:!1,type:1},color:0,opacity:0,sortObjects:!0,localClippingEnabled:!1,autoClear:!0,autoClearColor:!0,renderListCompare:[{name:"stats",enabled:!0},{name:"controls",enabled:!0},{name:"scene",enabled:!0},{name:"css3DRender",enabled:!0},{name:"css2DRender",enabled:!0}]},orbitControls:{autoRotate:!1,autoRotateSpeed:2,enableDamping:!0,dampingFactor:.05,minDistance:.01,maxDistance:1e6,maxAzimuthAngle:null,minAzimuthAngle:null,maxPolarAngle:3.141592653589793,minPolarAngle:0,maxTargetRadius:null,minTargetRadius:0,enablePan:!0,panSpeed:1,enableRotate:!0,rotateSpeed:1,enableZoom:!0,zoomSpeed:1,zoomToCursor:!1,target:{x:-38.59603927643809,y:-48.97202695679889,z:-49.19814250541991}},transformControls:{mode:"translate",space:"world",size:1,showX:!0,showY:!0,showZ:!0,translationSnap:null,rotationSnap:null,scaleSnap:null},effectComposer:{renderWay:"effectComposer",fxaaPass:{enabled:!0,order:60,multPixel:1},outlinePass:{enabled:!0,order:40,edgeStrength:3,edgeGlow:0,edgeThickness:1,pulsePeriod:0,usePatternTexture:!1,visibleEdgeColor:16449071,hiddenEdgeColor:16449071,overlayMaterial:{blending:5,blendEquation:100,blendSrc:201,blendDst:205}},outputPass:{enabled:!0,order:50},saoPass:{enabled:!1,order:10,saoBias:.5,saoIntensity:.01,saoScale:100,saoKernelRadius:100,saoMinResolution:0,saoBlur:!0,saoBlurRadius:8,saoBlurStdDev:4,saoBlurDepthCutoff:.01},screenMaskPass:{enabled:!1,order:70,intensity:1,maskColor:16777215,R:.2,sr:1.2},ssrPass:{enabled:!1,order:30,maxDistance:.01,distanceAttenuation:!0,opacity:.5,thickness:.018,fresnel:!0,infiniteThick:!1,bouncing:!1},unrealBloomPass:{enabled:!1,order:20,strength:1.5,radius:.4,threshold:.85}},handler:{mode:"transform",openKeyEnable:!0,rightClickMenusEnable:!0,selectChildEnabled:!1,selectChildLevel:1,stats:{showStats:!1,statsMode:0},helpers:{axes:{showAxes:!0,axesLength:1e3},grid:{showGrid:!0,size:1e3,divisions:15,colorCenterLine:4473924,colorGrid:8947848},box3:{useBox3:!0,color:16776960}}},lightCores:[],innerCores:[],modelCores:[],drawCores:[],textCores:[],particleCores:[],geoCores:{},designCores:[],other:{viewAngleList:[],clipping:{size:20,clipList:[]}}},Et=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},sr=Et(Object.assign({name:"ThreedEditor"},{__name:"editor",props:{data:{type:Object,default:()=>({})},preview:{type:Boolean,default:!1}},emits:["emit-three-editor","graph-event"],setup(r,{expose:e,emit:t}){var U;const n=t,i=r,a=_t(),{currScene:o}=Se.storeToRefs(a),c=((U=window.meta.threed)==null?void 0:U.draco_path)||Ke;F.ThreeEditor.dracoPath=c.endsWith("/")?c:`${c}/`;let u=null,m=null;const C=p.ref(null),{setGuiParams:z,getDevicePixelRatio:V,getThreeEditorDB:$,createBlobUrl:d,revokeModelObjectUrls:A,ensureThreedDesignRegistry:S}=er();S(F.ThreeEditor),z({step:.1});const x=()=>{var v;return(v=u==null?void 0:u.renderSceneResize)==null?void 0:v.call(u)},_=()=>E(this,null,function*(){var T,k;let v=ir;try{if(i.data&&Object.keys(i.data).length)v=i.data;else if((T=o.value)!=null&&T.path){const M=yield j.getApi((k=o.value)==null?void 0:k.path).catch(()=>({}));console.log("初始化三维场景:",M),M.res&&(v=M.res)}u?u.resetEditorStorage(v):u=new F.ThreeEditor(C.value,{fps:null,pixelRatio:V()*a.pixelRatio,webglRenderParams:{antialias:!0,alpha:!0,logarithmicDepthBuffer:a.logarithmicDepthBuffer},sceneParams:w(v)})}catch(M){console.error("三维图纸初始化失败",M),u==null||u.resetEditorStorage(v)}finally{u&&setTimeout(()=>{i.preview&&(u.handler.mode="none",u.handler.helpers.axes.showAxes=!1,u.handler.helpers.box3.useBox3=!1,u.handler.helpers.grid.showGrid=!1)},200),P()}n("emit-three-editor",u),window.addEventListener("resize",x)}),w=v=>{A(),v.designCores.forEach(N=>{N.preview=i.preview});const T=$(),k=T.list||[],M=structuredClone(v||{});return M.modelCores=(M.modelCores||[]).filter(N=>{const q=N.modelInfo.originPath;if(q){const Q=k.find(Z=>Z.name===q);if(!Q){const Z=T.db.getRequest(q);N.modelInfo.url=Z.url;return}const ie=d(Q.blob);N.modelInfo.url=ie}return!0}),M},P=()=>{u!=null&&u.renderer&&(m=new F.THREE.PMREMGenerator(u.renderer),m.compileEquirectangularShader(),u.scene.environment=m.fromScene(new Nt.RoomEnvironment).texture)},R=()=>u;return p.watch(()=>o.value.path,()=>E(this,null,function*(){_()})),p.watch(()=>i.data,()=>{_()},{deep:!0}),p.onMounted(()=>{_()}),p.onUnmounted(()=>{window.removeEventListener("resize",x),A(),u==null||u.destroySceneRender(),a.setCurrScene({name:"",path:""})}),e({getEditorInstance:R}),(v,T)=>(p.openBlock(),p.createElementBlock("div",{ref_key:"editorRef",ref:C,class:"threed-editor",onDragover:T[0]||(T[0]=p.withModifiers(()=>{},["prevent"])),onDrop:T[1]||(T[1]=p.withModifiers(()=>{},["prevent"]))},null,544))}}),[["__scopeId","data-v-a95a7094"]]),ar={class:"threed-preview"},ce=Et(Object.assign({name:"ThreedPreview"},{__name:"preview",props:{data:{type:Object,default:null},url:{type:String,default:""},id:{type:String,default:""},token:{type:String,default:""},socketUrl:{type:String,default:""}},emits:["loaded","graph-event"],setup(r,{expose:e,emit:t}){const n=r,i=t;let a=p.shallowRef({});const o=p.ref(),c=_t();let u={},m=null,C=null;const z=_=>{var P,R,U;if(!_)return;if((P=_==null?void 0:_.includes)!=null&&P.call(_,"token 必传"))return se({message:_,type:"warning"});const w=typeof _=="string"?JSON.parse(_):_;if((w==null?void 0:w.data)==="服务错误"||(U=(R=w==null?void 0:w.data)==null?void 0:R.includes)!=null&&U.call(R,"token is expired"))return se({message:w.data,type:"warning"});switch(w.action){case ze.ACPOINT.YCVALUE:case ze.ACPOINT.YXVALUE:console.warn("遥测信息");break}},V=()=>{try{C=new hn({socketUrl:n.socketUrl,token:n.token,onMessage:z})}catch(_){console.warn("三维场景消息处理失败",_)}},$=()=>E(this,null,function*(){var _;if(u){const w=Object.keys(u);if(w.length){const P=yield j.postPDApi("querychannelstatus/",{data:w.map(R=>({ied_id:R,ln_list:u[R].map(U=>U.ln_id)}))});(_=P==null?void 0:P.data)!=null&&_.length&&w.forEach(R=>{const U=P.data.find(T=>T.ied_id===R),v=u[R];v!=null&&v.length&&v.forEach(T=>{const k=U.result.find(M=>M.ln_id===T.ln_id);if(k){const M=x();if(!(M!=null&&M.scene))return;const N=M.scene.getObjectsByProperty("dataId",T.guid);let q=N==null?void 0:N[0];if(q){const Q=k.status==="告警"?2:k.status==="正常"?1:0;q.userData.params.state=Q;const ie=fn(k.amp_peak)?pn(Number(k.amp_peak))?Number(k.amp_peak):0:k.amp_peak;q.userData.params.value=ie;debugger;q.changeState(Q),q.changeValue(ie)}}})})}}}),d=_=>{i("graph-event",_)},A=_=>{_&&(n.socketUrl&&V(),setTimeout(()=>{const w=_.scene.getObjectsByProperty("designType","局放测点");w.forEach(P=>{const{ied_id:R,ln_id:U}=P.userData.params;u[R]||(u[R]=[]),u[R].push({guid:P.dataId,id:P.uuid,ied_id:R,ln_id:U})}),w!=null&&w.length&&(m&&clearInterval(m),$(),m=setInterval(()=>{$()},2e3)),i("loaded",_)},100))},S=()=>E(this,null,function*(){if(a.value&&Object.keys(a.value).length)return;const _=_n(),w=n.url||_.url;if(w){const U=yield j.getApi(w).catch(()=>({}));U.res&&(a.value=U.res);return}if(!(n.id||_.id)){console.warn("三维场景渲染失败,场景id为空!");return}const R=yield j.getCommonApi("threedfloorplan",{guid:n.id});R.data.length?c.setCurrScene(R.data[0]):console.warn("三维场景渲染失败,场景id为:"+n.id+"不存在!")}),x=()=>o.value?o.value.getEditorInstance():null;return p.watch(()=>n.data,_=>{a.value=_,S()},{deep:!0,immediate:!0}),p.watch(()=>n.id,()=>{S()},{deep:!0,immediate:!0}),p.onMounted(()=>{ye.on("three-event",d)}),p.onUnmounted(()=>{C&&C.destroy(),ye.off("three-event",d)}),e({getEditorInstance:x}),(_,w)=>(p.openBlock(),p.createElementBlock("div",ar,[p.createVNode(sr,{ref_key:"threedEditorRef",ref:o,data:p.unref(a),preview:"",onGraphEvent:d,onEmitThreeEditor:A},null,8,["data"])]))}}),[["__scopeId","data-v-1cef540a"]]);ce.name||(ce.name="SyThree");const or={install:r=>{r.component(ce.name||"SyThree",ce)}};g.SyThree=ce,g.default=or,Object.defineProperties(g,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syhr/sy-three",
3
- "version": "1.0.0-rc.2",
3
+ "version": "1.0.0-rc.4",
4
4
  "author": "syhr <aiops.sieyuan@gmail.com>",
5
5
  "description": "Planar graphic config tool based on @meta2d.",
6
6
  "license": "MIT",