ss-component-new 1.1.280 → 1.1.281
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{array-DbgDmXNC.cjs → array-Ac3PKTGq.cjs} +1 -1
- package/dist/{array-2h3BcR8t.js → array-Cwyp1kgC.js} +2 -2
- package/dist/{cloneDeep-7OrlpXQx.js → cloneDeep-DUFqs1IK.js} +1 -1
- package/dist/{cloneDeep-Bpr66cRT.cjs → cloneDeep-FsOChpwa.cjs} +1 -1
- package/dist/{index-LQ6s3EAm.js → index-97mEFfHG.js} +4 -4
- package/dist/{index-CSuH9qx8.cjs → index-B-EoExkd.cjs} +1 -1
- package/dist/{index-C_kSlilX.cjs → index-BB3-z4Fn.cjs} +1 -1
- package/dist/{index-DNI0y4vG.js → index-BPSj68g5.js} +5 -5
- package/dist/{index-BC2c5Z8p.js → index-BTB-WN4W.js} +6 -6
- package/dist/{index-8g6OU0KZ.js → index-BUzwJReZ.js} +8 -8
- package/dist/{index-CkSwm-tt.js → index-BWYpFe1G.js} +3 -3
- package/dist/{index-BNkMYTSt.cjs → index-BY3N1q-K.cjs} +1 -1
- package/dist/{index-CnkTsOvJ.js → index-BbeTHsNm.js} +4 -4
- package/dist/{index-B4WyvSgX.js → index-Bboy25FG.js} +9 -9
- package/dist/{index-Ep3Txq0B.cjs → index-BgrOmPRR.cjs} +1 -1
- package/dist/{index-32rotZnG.cjs → index-BhiIxYT9.cjs} +1 -1
- package/dist/{index-C62MRIKC.js → index-BoWD0Dmi.js} +8 -8
- package/dist/{index-C-J5HhRC.js → index-BsONBHIY.js} +6 -6
- package/dist/{index-VyLAjHRF.cjs → index-BvyA3-zl.cjs} +1 -1
- package/dist/{index-DB9EBURn.js → index-C7qzvvHr.js} +3 -3
- package/dist/{index-CxEIzaZZ.cjs → index-C8s1N4N9.cjs} +1 -1
- package/dist/{index-Dg7tfoO3.cjs → index-CBQ65eXB.cjs} +1 -1
- package/dist/{index-BVY4csYI.js → index-CCF64i-n.js} +1 -1
- package/dist/{index-2p6ng8BQ.js → index-CGEGFh39.js} +3 -3
- package/dist/{index-BkPga8GN.cjs → index-CSOYjkUd.cjs} +1 -1
- package/dist/{index-B2_GOFWg.js → index-CT5MfiHK.js} +1 -1
- package/dist/{index-CEzpMHwU.js → index-CTsZrCe6.js} +5 -5
- package/dist/{index-DOYMQjSm.cjs → index-CY6WqluP.cjs} +1 -1
- package/dist/{index-BHDtnBBc.js → index-CYPV2KmM.js} +370 -366
- package/dist/{index-7ItrgNWX.cjs → index-Ca0dIRJ8.cjs} +1 -1
- package/dist/{index-Dm8c4dCB.cjs → index-CcFGFbV_.cjs} +1 -1
- package/dist/{index-C7dhDubA.js → index-CcLl4kPD.js} +3 -3
- package/dist/{index-C1JWqwIj.cjs → index-Co9eX0n9.cjs} +1 -1
- package/dist/{index-DiMnQQYq.cjs → index-CoLd5ctI.cjs} +1 -1
- package/dist/{index-pqpRJrua.cjs → index-Cpbn9ZY0.cjs} +1 -1
- package/dist/{index-ChoduCXO.js → index-D7p6Dhus.js} +1 -1
- package/dist/{index-yyeYGNEV.js → index-D9AMYW90.js} +5 -5
- package/dist/{index-phwIzPfM.cjs → index-D9BjWYYa.cjs} +1 -1
- package/dist/{index-DmEklWRV.js → index-D9SnMipa.js} +4 -4
- package/dist/{index-CQfpCCLD.cjs → index-DHsrdlpr.cjs} +1 -1
- package/dist/{index-EOe-M1Jp.js → index-DQ0J39WK.js} +3 -3
- package/dist/{index-DiH0tdPe.js → index-DWYS1YPx.js} +4 -4
- package/dist/{index-DHBcXVVE.cjs → index-DncBFxOs.cjs} +2 -2
- package/dist/{index-sj2Ha0yc.js → index-DvKFJNtb.js} +4 -4
- package/dist/{index-BFAI_oss.js → index-L6OEKoiT.js} +1 -1
- package/dist/{index-CpnAas7Z.cjs → index-LwOpibqQ.cjs} +1 -1
- package/dist/{index-BjbQxmDY.cjs → index-QSZIlTwl.cjs} +1 -1
- package/dist/{index-28Ykp9cC.cjs → index-YEyOVEsB.cjs} +1 -1
- package/dist/{index-CUUTl5-S.cjs → index-YLsm_qc3.cjs} +1 -1
- package/dist/{index-mWAzqtrn.cjs → index-aaPPOUAf.cjs} +1 -1
- package/dist/{index-BK1ygm84.cjs → index-cinslkDi.cjs} +1 -1
- package/dist/{index-C94t1Wq4.cjs → index-gICeEA0J.cjs} +1 -1
- package/dist/{index-BCF2zJQE.cjs → index-ofXwoqS2.cjs} +1 -1
- package/dist/{index-6OD6a79y.js → index-wLeUULYM.js} +5 -5
- package/dist/{index-qurOCtmA.js → index-yHkaAG5T.js} +7 -7
- package/dist/{index-BWJOcjmM.js → index-ygy6i7Ai.js} +7 -7
- package/dist/{index.vue_vue_type_script_setup_true_lang-D0atX1ZJ.cjs → index.vue_vue_type_script_setup_true_lang-CRx0k5-c.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-CawoKBGc.js → index.vue_vue_type_script_setup_true_lang-DcfW0D6o.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-yUqeEtl9.cjs → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-B5P2piGc.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-BVjLqUsb.js → index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-BNXgkB_T.js} +13 -13
- package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-DP168tSD.js → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-C0xOx_bk.js} +8 -8
- package/dist/{index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-D-o7M3tf.cjs → index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CG_bu310.cjs} +1 -1
- package/dist/{login-BtKUwOTM.js → login-41LfmeiG.js} +2 -2
- package/dist/{login-DY-KhEwK.cjs → login-D8VTsSIS.cjs} +1 -1
- package/dist/{main-D8G6yr67.js → main-B7pUgUYK.js} +7 -7
- package/dist/{main-DQi1x5NP.cjs → main-BimSDsES.cjs} +1 -1
- package/dist/{menu-wSGshUvU.cjs → menu-BasDnaD3.cjs} +1 -1
- package/dist/{menu-DMNIm2Ep.js → menu-CgcTyBO3.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +7 -7
- package/dist/ss-component3.cjs +1 -1
- package/dist/ss-component3.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),i=require("./menu-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),i=require("./menu-BasDnaD3.cjs"),w=require("./index-cinslkDi.cjs"),C=require("./index-ofXwoqS2.cjs"),K=require("./index-aaPPOUAf.cjs"),R=require("./login-D8VTsSIS.cjs"),_=require("./cloneDeep-FsOChpwa.cjs"),N=require("./index-CoLd5ctI.cjs"),q=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S=w.useModelComp(C.pinia),I=w.useUnit(C.pinia),v=i.useMenuState(C.pinia),{menus:x,configMenu:h,activeMenuPath:D,cacheStructures:A}=i.storeToRefs(v),O=o.computed(()=>{var t,e;return[{key:"extraButton",contents:[]},{key:"rowButton",contents:[{label:"修改"}]},{key:"header",contents:[{label:"菜单名称",prop:"title",isFormColHidden:!1},{label:"菜单类型",prop:"menuType",formType:"select",options:[{label:"系统菜单",value:"集团"},{label:"公司",value:"公司"}],isTableColHidden:!1,isFormColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:(e=(t=_.cloneDeep(x.value))==null?void 0:t.map(a=>({...a,menuType:"系统菜单"})))==null?void 0:e.filter(a=>a.title!=="系统管理"&&a.title!=="平台管理")}]}),m=o.ref([]),T=o.ref([{label:"新建"}]),H=o.computed(()=>[{key:"extraButton",contents:T.value},{key:"rowButton",contents:[{label:"修改"},{label:"删除"}]},{key:"header",contents:[{label:"操作类型",prop:"operateType",formType:"select",options:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标",prop:"operateIcon",formType:"inputPopover",value:""},{label:"图标触发事件",prop:"trigger",formType:"select",options:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"配置一:",prop:"dialogConfig",formType:"button",value:"弹窗内容",isTableColHidden:!0},{label:"配置二:",prop:"contentConfig",formType:"button",value:"模块内容",isTableColHidden:!0},{label:"操作"}]},{key:"tableContents",contents:m.value}]),F=o.ref([]),f=o.ref({}),$=o.ref({}),j=o.ref([{label:"菜单",prop:"path",isFormColHidden:!0,value:""},{label:"菜单图标:",prop:"menuIcon",type:"inputPopover",value:""},{label:"操作类型:",prop:"operateType",type:"select",contents:[{label:"新增",value:"新增"},{label:"编辑",value:"编辑"},{label:"删除",value:"删除"}],value:""},{label:"操作图标:",prop:"operateIcon",type:"inputPopover",value:""},{label:"图标触发事件:",prop:"trigger",type:"select",contents:[{label:"弹出弹窗",value:"openDialog"}],value:"openDialog"},{label:"配置一:",prop:"dialogConfig",type:"button",value:"弹窗结构"},{label:"配置二:",prop:"contentConfig",type:"button",value:"生成模块结构"}]),E=t=>{var e;F.value=(e=j.value)==null?void 0:e.map(a=>a.prop==="menu"?{...a,value:t==null?void 0:t[a==null?void 0:a.prop]}:a.prop==="dialogConfig"||a.prop==="contentConfig"||a.prop==="trigger"?a:{...a,value:t==null?void 0:t[a==null?void 0:a.prop]})},z=o.ref([{label:"查询"},{label:"重置"}]),U=async()=>{},B=t=>t.map(e=>e.childMenus&&e.childMenus.length>0?{...e,value:e==null?void 0:e.title,label:e==null?void 0:e.title,children:B(e.childMenus)}:{...e,value:e==null?void 0:e.title,label:e==null?void 0:e.title}),b=o.reactive({show:!1,title:"菜单配置",width:"30%"}),M=o.ref([]),g=o.ref({}),p=o.ref(null),P=o.computed(()=>{var t;return(t=B(x.value))==null?void 0:t.filter(e=>e.title!=="系统管理"&&e.title!=="平台管理")}),W=async t=>{var e;p.value={...t,rootNode:R.findRootNodeByPath(P.value,t.path)},(t==null?void 0:t.level)===0?T.value.splice(0):(T.value=[{label:"新建"}],M.value=(e=t==null?void 0:t.path)==null?void 0:e.split("/")),await v.setConfigMenu(null),k(t)},y=o.ref(""),G=async(t,e)=>{var a,l;if(!p.value)return i.ElMessage.warning("请先选择菜单");if(y.value=t,M.value=[],S.setSubmitCurStructure(!1),I.setSelectTitle([]),await v.setConfigMenu(null),g.value=_.cloneDeep(e),t!=="删除"){switch(t){case"新建":break;case"修改":console.log("修改",t,g.value),E(g.value),await v.setConfigMenu(g.value);break}await o.nextTick(),b.title=`【${t==="新建"?(a=p.value)==null?void 0:a.path:(l=g.value)==null?void 0:l.path}】菜单配置`,b.show=!0}else await V(g.value,t)},J=async t=>{var e;f.value=t,await v.setConfigMenu({...f.value,path:(e=p.value)==null?void 0:e.path})},L=o.ref(null),Q=async t=>{var l,r,s,n,u;v.setButtonTriggerType(t==="弹窗结构"?"dialogConfig":"contentConfig");let e;(l=f.value)!=null&&l.subMenus&&((r=f.value)==null?void 0:r.subMenus.length)>0&&(e=(s=M.value)==null?void 0:s.map(c=>({value:c})),e.unshift({value:(n=g.value)==null?void 0:n.title}));let a;y.value==="新建"?a={...f.value,path:(u=p.value)==null?void 0:u.path}:y.value==="修改"&&(a=h.value),await v.setConfigMenu(a),I.setSelectTitle(e),S.setIsEdit("edit")},k=async t=>{var a,l,r,s,n,u;const e=await i.getInsofDataApi({key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:D.value+"/"+(t==null?void 0:t.path),tableId:""}});((a=e==null?void 0:e.data)==null?void 0:a.code)===200&&(l=e.data)!=null&&l.result&&(m.value=((s=(r=e.data)==null?void 0:r.result)==null?void 0:s.length)>0?(u=(n=e.data)==null?void 0:n.result)==null?void 0:u.map(c=>{var d;return{id:c==null?void 0:c.id,...(d=c==null?void 0:c.value)==null?void 0:d.tableData}}):[])},X=async(t,e,a="contentConfig")=>{var l,r,s,n;try{let u,c;e==="create"&&(u={key:{systemKey:sessionStorage.getItem("systemKey"),pageKey:(l=p.value)==null?void 0:l.path,type:"structure",rootNodePath:(s=(r=p.value)==null?void 0:r.rootNode)==null?void 0:s.path,structureBelong:a,parentTable:"",version:1},value:{pageData:t}},c=i.createInsofDataApi);const d=await c(u);if(((n=d==null?void 0:d.data)==null?void 0:n.code)===200)return d.data.result;throw i.ElMessage.error("保存响应失败"),new Error("保存响应失败")}catch{i.ElMessage.error("保存响应失败")}},Y=async(t,e)=>{let a=[];t==null||t.forEach(l=>{var r;(r=l==null?void 0:l.data)==null||r.forEach(s=>{var n,u;s&&a.push(X({menuConfig:h.value,structure:s,rootNodePath:(u=(n=p.value)==null?void 0:n.rootNode)==null?void 0:u.path},"create",l==null?void 0:l.key))})}),await Promise.all(a).then(l=>{const r=l==null?void 0:l.every(s=>s);console.log("Promise:",l,r),r&&V({...e,structureIds:l},y.value)}).catch(l=>{i.ElMessage.error(l)})},V=async(t,e)=>{var r,s;let a,l;e==="新增"||e==="新建"?(a={key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:D.value+"/"+((r=p.value)==null?void 0:r.path),tableId:""},value:{tableData:t}},l=i.createInsofDataApi):e==="编辑"||e==="修改"?(console.log(890,t),a={id:t==null?void 0:t.id,key:{type:"menuConfigData",systemKey:sessionStorage.getItem("systemKey"),pageKey:D.value+"/"+((s=p.value)==null?void 0:s.path),tableId:""},value:{tableData:t}},l=i.updateInsofDataApi):e==="删除"&&(a={ids:[t.id,...t==null?void 0:t.structureIds]},l=i.batchDeleteInsofDataApi),K.handleSubmitAsync(l,a,e).then(n=>{(e==="新增"||e==="新建")&&m.value.push({...t,id:n}),e&&n&&i.ElMessage.success(e+"成功"),k(p.value)})},Z=async()=>{var a,l,r,s,n;const t=_.cloneDeep(A.value);console.log("clickSubmitForm",h.value,t),await o.nextTick();const e=y.value==="新建"?{...h.value,rootNodePath:(l=(a=p.value)==null?void 0:a.rootNode)==null?void 0:l.path}:{...h.value,rootNodePath:(s=(r=p.value)==null?void 0:r.rootNode)==null?void 0:s.path,id:(n=g.value)==null?void 0:n.id};await Y(t,e),f.value={},b.show=!1,v.setCacheStructures([]),await k(p.value)},ee=()=>{b.show=!1},te=Object.freeze(Object.defineProperty({__proto__:null,beforeDialogDestroy:ee,buttonValue:z,changeTrigger:J,changedRow:$,clickNodeTrigger:W,clickRowButton:G,clickSubmitForm:Z,clickTrigger:Q,dialogInfo:b,formatFormData:E,getTableDataAsync:k,handleItemDataChange:U,inputForm:f,menuPageData:H,operatingForm:L,pageData:O,renderFormData:F,treeData:P},Symbol.toStringTag,{value:"Module"})),ae={class:"menu-module"},oe={class:"tree-wrap"},le={class:"table-wrap"},ne={class:"module-dialog-default"},re=o.defineComponent({__name:"index",setup(t){const e=o.reactive({...te}),a=o.ref(null),l=i.useMenuState(C.pinia),{configMenu:r}=i.storeToRefs(l);return o.onMounted(()=>{e.formatFormData(r.value),o.nextTick(()=>{var s,n;(n=a.value)==null||n.setCurrentKey((s=r.value)==null?void 0:s.path)})}),(s,n)=>{const u=o.resolveComponent("el-tree"),c=o.resolveComponent("el-button");return o.openBlock(),o.createElementBlock("div",ae,[o.createElementVNode("div",oe,[o.createVNode(u,{ref_key:"treeRef",ref:a,data:e.treeData,"expand-on-click-node":!1,"node-key":"path",props:{children:"children",label:"label",path:"path"},"highlight-current":"","default-expand-all":"","check-on-click-leaf":!1,"check-strictly":"",onNodeClick:e.clickNodeTrigger},null,8,["data","onNodeClick"])]),o.createElementVNode("div",le,[o.createVNode(w.ssTable,{itemData:e.menuPageData,changedContent:e.changedRow,operatingForm:e.operatingForm,onOnFormChange:e.changeTrigger,onChange:e.handleItemDataChange,onClickTrigger:e.clickTrigger,onOnButtonClick:e.clickRowButton},null,8,["itemData","changedContent","operatingForm","onOnFormChange","onChange","onClickTrigger","onOnButtonClick"])]),o.createVNode(N.ssDialog,{class:"module-dialog",title:e.dialogInfo.title,visible:e.dialogInfo.show,width:e.dialogInfo.width,onBeforeDestroy:e.beforeDialogDestroy},{default:o.withCtx(()=>[o.createElementVNode("div",ne,[o.createVNode(N.ssForm,{rowContents:e.renderFormData,isEnableWrap:!1,isEdit:!0,onChange:e.changeTrigger,onClickTrigger:e.clickTrigger},null,8,["rowContents","onChange","onClickTrigger"])])]),footer:o.withCtx(()=>[o.createElementVNode("div",null,[o.createVNode(c,{onClick:e.beforeDialogDestroy},{default:o.withCtx(()=>n[0]||(n[0]=[o.createTextVNode("取消")])),_:1,__:[0]},8,["onClick"]),o.createVNode(c,{type:"primary",onClick:e.clickSubmitForm},{default:o.withCtx(()=>n[1]||(n[1]=[o.createTextVNode(" 确认 ")])),_:1,__:[1]},8,["onClick"])])]),_:1},8,["title","visible","width","onBeforeDestroy"])])}}}),se=q._export_sfc(re,[["__scopeId","data-v-623990e0"]]);exports.default=se;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as S, u as P, E as v } from "./menu-
|
|
2
|
-
import { p as K } from "./index-
|
|
3
|
-
import { u as k } from "./login-
|
|
1
|
+
import { g as S, u as P, E as v } from "./menu-CgcTyBO3.js";
|
|
2
|
+
import { p as K } from "./index-CT5MfiHK.js";
|
|
3
|
+
import { u as k } from "./login-41LfmeiG.js";
|
|
4
4
|
import { ref as h } from "vue";
|
|
5
5
|
const A = P(K), E = k(K), x = h(!1), D = h(!1), q = async () => {
|
|
6
6
|
const I = S({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ref as H, resolveComponent as U, createBlock as N, openBlock as m, defineComponent as Ne, onMounted as We, withCtx as O, createVNode as se, createElementVNode as ce, createElementBlock as V, Fragment as oe, renderList as ee, createTextVNode as Be, toDisplayString as xe, watch as De, renderSlot as te, createCommentVNode as J, resolveDynamicComponent as ht, createSlots as Re, mergeProps as pt, normalizeProps as G2, guardReactiveProps as W2, nextTick as Je, normalizeStyle as fe, computed as ft, unref as x2, h as a2, reactive as S2, onBeforeUnmount as Y2, toRefs as q2, withDirectives as i2, vShow as l2, normalizeClass as X2 } from "vue";
|
|
2
2
|
import { S as r2 } from "./index-BHtNKL1L.js";
|
|
3
3
|
import { _ as Me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { c as we } from "./cloneDeep-
|
|
5
|
-
import { E as D2, g as Jt, u as K2, s as J2, a as Z2 } from "./menu-
|
|
6
|
-
import { _ as Q2 } from "./index.vue_vue_type_script_setup_true_lang-
|
|
7
|
-
import { c as e0 } from "./index-
|
|
4
|
+
import { c as we } from "./cloneDeep-DUFqs1IK.js";
|
|
5
|
+
import { E as D2, g as Jt, u as K2, s as J2, a as Z2 } from "./menu-CgcTyBO3.js";
|
|
6
|
+
import { _ as Q2 } from "./index.vue_vue_type_script_setup_true_lang-DcfW0D6o.js";
|
|
7
|
+
import { c as e0 } from "./index-Bboy25FG.js";
|
|
8
8
|
function t0(o) {
|
|
9
9
|
return o && o.__esModule && Object.prototype.hasOwnProperty.call(o, "default") ? o.default : o;
|
|
10
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ce=require("./index-32rotZnG.cjs"),De=require("./index-BjbQxmDY.cjs"),se=require("./index-BCF2zJQE.cjs"),s=require("./index-BK1ygm84.cjs"),I=require("./menu-wSGshUvU.cjs"),rt=require("./index-phwIzPfM.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-yUqeEtl9.cjs"),_e=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),fe=require("./array-DbgDmXNC.cjs"),et=require("./login-DY-KhEwK.cjs"),ue=require("./index-BpPyaNFa.cjs"),lt=require("./index-CUUTl5-S.cjs"),ge=require("./cloneDeep-Bpr66cRT.cjs"),tt=require("./index-DOYMQjSm.cjs"),qe=require("./index-DiMnQQYq.cjs"),Ze={type:"change"},Ne={type:"start"},ot={type:"end"},Ee=new s.Ray,Ge=new s.Plane,ct=Math.cos(70*s.MathUtils.DEG2RAD),Z=new s.Vector3,oe=2*Math.PI,R={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Se=1e-6;class ht extends s.Controls{constructor(t,o=null){super(t,o),this.state=R.NONE,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=ut.bind(this),this._onPointerDown=dt.bind(this),this._onPointerUp=pt.bind(this),this._onContextMenu=vt.bind(this),this._onMouseWheel=gt.bind(this),this._onKeyDown=_t.bind(this),this._onTouchStart=yt.bind(this),this._onTouchMove=wt.bind(this),this._onMouseDown=mt.bind(this),this._onMouseMove=ft.bind(this),this._interceptControlDown=bt.bind(this),this._interceptControlUp=Ct.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Ze),this.update(),this.state=R.NONE}update(t=null){const o=this.object.position;Z.copy(o).sub(this.target),Z.applyQuaternion(this._quat),this._spherical.setFromVector3(Z),this.autoRotate&&this.state===R.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let a=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(a)&&isFinite(n)&&(a<-Math.PI?a+=oe:a>Math.PI&&(a-=oe),n<-Math.PI?n+=oe:n>Math.PI&&(n-=oe),a<=n?this._spherical.theta=Math.max(a,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(a+n)/2?Math.max(a,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const u=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=u!=this._spherical.radius}if(Z.setFromSpherical(this._spherical),Z.applyQuaternion(this._quatInverse),o.copy(this.target).add(Z),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let u=null;if(this.object.isPerspectiveCamera){const r=Z.length();u=this._clampDistance(r*this._scale);const m=r-u;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),i=!!m}else if(this.object.isOrthographicCamera){const r=new s.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=m!==this.object.zoom;const c=new s.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(r),this.object.updateMatrixWorld(),u=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;u!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(u).add(this.object.position):(Ee.origin.copy(this.object.position),Ee.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Ee.direction))<ct?this.object.lookAt(this.target):(Ge.setFromNormalAndCoplanarPoint(this.object.up,this.target),Ee.intersectPlane(Ge,this.target))))}else if(this.object.isOrthographicCamera){const u=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),u!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>Se||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Se||this._lastTargetPosition.distanceToSquared(this.target)>Se?(this.dispatchEvent(Ze),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?oe/60*this.autoRotateSpeed*t:oe/60/60*this.autoRotateSpeed}_getZoomScale(t){const o=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*o)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,o){Z.setFromMatrixColumn(o,0),Z.multiplyScalar(-t),this._panOffset.add(Z)}_panUp(t,o){this.screenSpacePanning===!0?Z.setFromMatrixColumn(o,1):(Z.setFromMatrixColumn(o,0),Z.crossVectors(this.object.up,Z)),Z.multiplyScalar(t),this._panOffset.add(Z)}_pan(t,o){const a=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;Z.copy(n).sub(this.target);let i=Z.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*i/a.clientHeight,this.object.matrix),this._panUp(2*o*i/a.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/a.clientWidth,this.object.matrix),this._panUp(o*(this.object.top-this.object.bottom)/this.object.zoom/a.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,o){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const a=this.domElement.getBoundingClientRect(),n=t-a.left,i=o-a.top,u=a.width,r=a.height;this._mouse.x=n/u*2-1,this._mouse.y=-(i/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const o=this.domElement;this._rotateLeft(oe*this._rotateDelta.x/o.clientHeight),this._rotateUp(oe*this._rotateDelta.y/o.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let o=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),o=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),o=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),o=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),o=!0;break}o&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._rotateStart.set(a,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._panStart.set(a,n)}}_handleTouchStartDolly(t){const o=this._getSecondPointerPosition(t),a=t.pageX-o.x,n=t.pageY-o.y,i=Math.sqrt(a*a+n*n);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const a=this._getSecondPointerPosition(t),n=.5*(t.pageX+a.x),i=.5*(t.pageY+a.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const o=this.domElement;this._rotateLeft(oe*this._rotateDelta.x/o.clientHeight),this._rotateUp(oe*this._rotateDelta.y/o.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._panEnd.set(a,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const o=this._getSecondPointerPosition(t),a=t.pageX-o.x,n=t.pageY-o.y,i=Math.sqrt(a*a+n*n);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const u=(t.pageX+o.x)*.5,r=(t.pageY+o.y)*.5;this._updateZoomParameters(u,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let o=0;o<this._pointers.length;o++)if(this._pointers[o]==t.pointerId){this._pointers.splice(o,1);return}}_isTrackingPointer(t){for(let o=0;o<this._pointers.length;o++)if(this._pointers[o]==t.pointerId)return!0;return!1}_trackPointer(t){let o=this._pointerPositions[t.pointerId];o===void 0&&(o=new s.Vector2,this._pointerPositions[t.pointerId]=o),o.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const o=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[o]}_customWheelEvent(t){const o=t.deltaMode,a={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(o){case 1:a.deltaY*=16;break;case 2:a.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(a.deltaY*=10),a}}function dt(g){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(g.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(g)&&(this._addPointer(g),g.pointerType==="touch"?this._onTouchStart(g):this._onMouseDown(g)))}function ut(g){this.enabled!==!1&&(g.pointerType==="touch"?this._onTouchMove(g):this._onMouseMove(g))}function pt(g){switch(this._removePointer(g),this._pointers.length){case 0:this.domElement.releasePointerCapture(g.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(ot),this.state=R.NONE;break;case 1:const t=this._pointers[0],o=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:o.x,pageY:o.y});break}}function mt(g){let t;switch(g.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(g),this.state=R.DOLLY;break;case s.MOUSE.ROTATE:if(g.ctrlKey||g.metaKey||g.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(g),this.state=R.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(g),this.state=R.ROTATE}break;case s.MOUSE.PAN:if(g.ctrlKey||g.metaKey||g.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(g),this.state=R.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(g),this.state=R.PAN}break;default:this.state=R.NONE}this.state!==R.NONE&&this.dispatchEvent(Ne)}function ft(g){switch(this.state){case R.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(g);break;case R.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(g);break;case R.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(g);break}}function gt(g){this.enabled===!1||this.enableZoom===!1||this.state!==R.NONE||(g.preventDefault(),this.dispatchEvent(Ne),this._handleMouseWheel(this._customWheelEvent(g)),this.dispatchEvent(ot))}function _t(g){this.enabled!==!1&&this._handleKeyDown(g)}function yt(g){switch(this._trackPointer(g),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(g),this.state=R.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(g),this.state=R.TOUCH_PAN;break;default:this.state=R.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(g),this.state=R.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(g),this.state=R.TOUCH_DOLLY_ROTATE;break;default:this.state=R.NONE}break;default:this.state=R.NONE}this.state!==R.NONE&&this.dispatchEvent(Ne)}function wt(g){switch(this._trackPointer(g),this.state){case R.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(g),this.update();break;case R.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(g),this.update();break;case R.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(g),this.update();break;case R.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(g),this.update();break;default:this.state=R.NONE}}function vt(g){this.enabled!==!1&&g.preventDefault()}function bt(g){g.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ct(g){g.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function xt(g){let t=null,o=null,a=null,n=null,i=null,u=null;const r=e.ref([]),m=e.ref(new s.Vector3),c=e.ref(new s.Vector3),y=()=>{if(!g.value)return;t=new s.Scene,t.background=new s.Color(16777215);const C=g.value;o=new s.PerspectiveCamera(75,C.clientWidth/C.clientHeight,.1,1e3),a=new s.WebGLRenderer({antialias:!0,alpha:!0}),a.setSize(C.clientWidth,C.clientHeight),a.localClippingEnabled=!0,a.shadowMap.enabled=!0,a.shadowMap.type=s.PCFSoftShadowMap,a.toneMapping=s.ACESFilmicToneMapping,a.toneMappingExposure=1,a.outputColorSpace=s.SRGBColorSpace,C.appendChild(a.domElement),n=new ht(o,a.domElement),n.enableDamping=!0,n.dampingFactor=.05,i=new s.Xe(o,a,{container:C,type:"cube",placement:"bottom-left",offset:{left:22,bottom:22},background:{color:"#D1D1D1"}}),i.attachControls(n),w(),_()},w=()=>{const C=new s.AmbientLight(4210752,.6);t.add(C);const E=new s.DirectionalLight(16777215,2);E.position.set(10,10,8),E.castShadow=!0,E.shadow.mapSize.width=2048,E.shadow.mapSize.height=2048,E.shadow.camera.near=.5,E.shadow.camera.far=50,t.add(E);const d=new s.DirectionalLight(16777215,.8);d.position.set(-8,-8,6),t.add(d);const P=new s.DirectionalLight(16777215,.6);P.position.set(0,-15,2),t.add(P);const D=new s.HemisphereLight(16777215,4473924,.8);t.add(D);const M=new s.PointLight(16777215,1,50);M.position.set(15,15,15),t.add(M);const F=new s.PointLight(16777215,.5,50);F.position.set(-15,-15,15),t.add(F)},_=()=>{u=requestAnimationFrame(_),n&&n.update(),a&&t&&o&&a.render(t,o),i&&i.render()},b=C=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(d=>{C[d]&&C[d].dispose&&C[d].dispose()}),C.dispose&&C.dispose()},x=C=>{C.traverse(E=>{E.geometry&&E.geometry.dispose(),E.material&&(Array.isArray(E.material)?E.material.forEach(d=>{b(d)}):b(E.material))})};return{currentModels:r,initialCameraPosition:m,initialTargetPosition:c,initThreeJS:y,handleResize:()=>{if(!g.value||!o||!a||!i)return;const C=g.value,E=C.clientWidth,d=C.clientHeight;o.aspect=E/d,o.updateProjectionMatrix(),a.setSize(E,d),i.update()},fitCameraToAllModels:()=>{if(!o||!n||r.value.length===0)return;const C=new s.Box3;r.value.forEach(T=>{C.expandByObject(T)});const E=C.getSize(new s.Vector3),d=C.getCenter(new s.Vector3),D=Math.max(E.x,E.y,E.z)*.6,M=new s.Vector3(d.x+D,d.y+D,d.z+D),F=d.clone();o.position.copy(M),o.lookAt(F),n.target.copy(F),n.update(),m.value.copy(M),c.value.copy(F)},getThreeJSObjects:()=>({scene:t,camera:o,renderer:a,controls:n,gizmo:i}),clearAllModels:()=>{if(!t)return;r.value.forEach(E=>{t.remove(E),x(E)});const C=[];t.children.forEach(E=>{!E.isLight&&!E.isCamera&&C.push(E)}),C.forEach(E=>{t.remove(E),x(E)}),r.value=[]},cleanup:()=>{u&&cancelAnimationFrame(u),a&&a.dispose(),n&&n.dispose(),i&&i.dispose()}}}function kt(g,t){const o=e.ref(!1);let a=null,n=12700,i=new s.Vector3,u=new s.Vector3,r=new s.Vector3,m=0,c=null;const y=l=>l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,w=l=>{const v=new s.Vector3,k=m*1.2,V=new s.Vector3(r.x+k,r.y,r.z),C=new s.Vector3(r.x,r.y+k,r.z),E=new s.Vector3(r.x,r.y-k,r.z);if(l<=.567){const P=l/.567*Math.PI*2;v.x=r.x+Math.cos(P)*k,v.z=r.z+Math.sin(P)*k,v.y=r.y}else if(l<=.724){const d=(l-.567)/.157,P=y(d);v.lerpVectors(V,C,P)}else if(l<=.881){const d=(l-.724)/.157,D=y(d)*Math.PI;v.x=r.x+Math.sin(D)*k,v.y=r.y+Math.cos(D)*k,v.z=r.z}else{const d=(l-.881)/.119,P=y(d);v.lerpVectors(E,i,P)}return v},_=()=>{const{camera:l,controls:v}=g();if(!l||!v)return;a||(a=Date.now());const k=Date.now()-a,V=Math.min(k/n,1);if(V>=1){x();return}const C=w(V);l.position.copy(C),l.lookAt(r),v.target.copy(r),c=requestAnimationFrame(_)},b=()=>{if(t.value.length===0)return;const{camera:l,controls:v}=g();if(!l||!v)return;i.copy(l.position),u.copy(v.target);const k=new s.Box3;t.value.forEach(M=>{k.expandByObject(M)});const V=k.getSize(new s.Vector3);r=k.getCenter(new s.Vector3),m=Math.max(V.x,V.y,V.z)*1.2;const C=new s.Vector3(r.x+m*1.2,r.y,r.z);v.enabled=!1;const E=l.position.clone(),d=1e3,P=Date.now(),D=()=>{const M=Date.now()-P,F=Math.min(M/d,1),T=y(F);l.position.lerpVectors(E,C,T),l.lookAt(r),v.target.copy(r),F<1?requestAnimationFrame(D):(o.value=!0,a=null,_())};D()},x=()=>{o.value=!1,a=null,c&&(cancelAnimationFrame(c),c=null);const{controls:l}=g();l&&(l.enabled=!0,l.target.copy(u))};return{isAnimating:o,toggleAnimation:()=>{if(o.value){o.value=!1,a=null,c&&(cancelAnimationFrame(c),c=null);const{camera:l,controls:v}=g();if(!l||!v)return;v.enabled=!0;const k=l.position.clone(),V=v.target.clone(),C=1500,E=Date.now(),d=()=>{const P=Date.now()-E,D=Math.min(P/C,1),M=y(D);l.position.lerpVectors(k,i,M),v.target.lerpVectors(V,u,M),D<1&&requestAnimationFrame(d)};d()}else b()},startAnimation:b,stopAnimation:x}}function Et(g,t){const o=e.ref(!1),a=e.ref("none");let n=[],i=[],u=new s.Box3,r=new s.Vector3;const m=()=>{n=[new s.Plane(new s.Vector3(1,0,0),0),new s.Plane(new s.Vector3(0,1,0),0),new s.Plane(new s.Vector3(0,0,1),0)]},c=()=>{u.makeEmpty(),t.value.forEach(p=>{u.expandByObject(p)}),r=u.getCenter(new s.Vector3)},y=p=>{const l=u.getSize(new s.Vector3);let v,k,V;p==="x"?(v=new s.PlaneGeometry(l.z*1.2,l.y*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(0,Math.PI/2,0)):p==="y"?(v=new s.PlaneGeometry(l.x*1.2,l.z*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(Math.PI/2,0,0)):p==="z"&&(v=new s.PlaneGeometry(l.x*1.2,l.y*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(0,0,0));const C=new s.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:s.DoubleSide,depthWrite:!1}),E=new s.Mesh(v,C);return E.position.copy(k),E.rotation.copy(V),E},w=()=>{if(_(),b(),a.value==="none")return;c();let p=null;if(a.value==="x"?(n[0].constant=-r.x,p=n[0]):a.value==="y"?(n[1].constant=-r.y,p=n[1]):a.value==="z"&&(n[2].constant=-r.z,p=n[2]),p){t.value.forEach(v=>{v.traverse(k=>{k.isMesh&&k.material&&(Array.isArray(k.material)?k.material.forEach(V=>{V.clippingPlanes=[p]}):k.material.clippingPlanes=[p])})});const{scene:l}=g();if(l){const v=y(a.value);l.add(v),i.push(v)}}},_=()=>{t.value.forEach(p=>{p.traverse(l=>{l.isMesh&&l.material&&(Array.isArray(l.material)?l.material.forEach(v=>{v.clippingPlanes=[]}):l.material.clippingPlanes=[])})})},b=()=>{const{scene:p}=g();p&&i.forEach(l=>{p.remove(l),l.geometry.dispose(),l.material.dispose()}),i=[]};return{isClipping:o,activeClippingAxis:a,toggleClipping:()=>{o.value=!o.value,o.value?(m(),t.value.length>0&&c()):(a.value="none",_(),b())},updateClippingPlanes:w,clearClippingPlanes:_,clearClippingMeshes:b}}const Mt=/^[og]\s*(.+)?/,Vt=/^mtllib /,Pt=/^usemtl /,St=/^usemap /,Ke=/\s+/,We=new s.Vector3,Te=new s.Vector3,Xe=new s.Vector3,Je=new s.Vector3,ne=new s.Vector3,Me=new s.Color;function Tt(){const g={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,o){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=o!==!1;return}const a=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:o!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(n,i){const u=this._finalize(!1);u&&(u.inherited||u.groupCount<=0)&&this.materials.splice(u.index,1);const r={index:this.materials.length,name:n||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:u!==void 0?u.smooth:this.smooth,groupStart:u!==void 0?u.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(m){const c={index:typeof m=="number"?m:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(n){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),n&&this.materials.length>1)for(let u=this.materials.length-1;u>=0;u--)this.materials[u].groupCount<=0&&this.materials.splice(u,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},a&&a.name&&typeof a.clone=="function"){const n=a.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/3)*3},parseNormalIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/3)*3},parseUVIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/2)*2},addVertex:function(t,o,a){const n=this.vertices,i=this.object.geometry.vertices;i.push(n[t+0],n[t+1],n[t+2]),i.push(n[o+0],n[o+1],n[o+2]),i.push(n[a+0],n[a+1],n[a+2])},addVertexPoint:function(t){const o=this.vertices;this.object.geometry.vertices.push(o[t+0],o[t+1],o[t+2])},addVertexLine:function(t){const o=this.vertices;this.object.geometry.vertices.push(o[t+0],o[t+1],o[t+2])},addNormal:function(t,o,a){const n=this.normals,i=this.object.geometry.normals;i.push(n[t+0],n[t+1],n[t+2]),i.push(n[o+0],n[o+1],n[o+2]),i.push(n[a+0],n[a+1],n[a+2])},addFaceNormal:function(t,o,a){const n=this.vertices,i=this.object.geometry.normals;We.fromArray(n,t),Te.fromArray(n,o),Xe.fromArray(n,a),ne.subVectors(Xe,Te),Je.subVectors(We,Te),ne.cross(Je),ne.normalize(),i.push(ne.x,ne.y,ne.z),i.push(ne.x,ne.y,ne.z),i.push(ne.x,ne.y,ne.z)},addColor:function(t,o,a){const n=this.colors,i=this.object.geometry.colors;n[t]!==void 0&&i.push(n[t+0],n[t+1],n[t+2]),n[o]!==void 0&&i.push(n[o+0],n[o+1],n[o+2]),n[a]!==void 0&&i.push(n[a+0],n[a+1],n[a+2])},addUV:function(t,o,a){const n=this.uvs,i=this.object.geometry.uvs;i.push(n[t+0],n[t+1]),i.push(n[o+0],n[o+1]),i.push(n[a+0],n[a+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const o=this.uvs;this.object.geometry.uvs.push(o[t+0],o[t+1])},addFace:function(t,o,a,n,i,u,r,m,c){const y=this.vertices.length;let w=this.parseVertexIndex(t,y),_=this.parseVertexIndex(o,y),b=this.parseVertexIndex(a,y);if(this.addVertex(w,_,b),this.addColor(w,_,b),r!==void 0&&r!==""){const x=this.normals.length;w=this.parseNormalIndex(r,x),_=this.parseNormalIndex(m,x),b=this.parseNormalIndex(c,x),this.addNormal(w,_,b)}else this.addFaceNormal(w,_,b);if(n!==void 0&&n!==""){const x=this.uvs.length;w=this.parseUVIndex(n,x),_=this.parseUVIndex(i,x),b=this.parseUVIndex(u,x),this.addUV(w,_,b),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const o=this.vertices.length;for(let a=0,n=t.length;a<n;a++){const i=this.parseVertexIndex(t[a],o);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(t,o){this.object.geometry.type="Line";const a=this.vertices.length,n=this.uvs.length;for(let i=0,u=t.length;i<u;i++)this.addVertexLine(this.parseVertexIndex(t[i],a));for(let i=0,u=o.length;i<u;i++)this.addUVLine(this.parseUVIndex(o[i],n))}};return g.startObject("",!1),g}class Qe extends s.Loader{constructor(t){super(t),this.materials=null}load(t,o,a,n){const i=this,u=new s.FileLoader(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(t,function(r){try{o(i.parse(r))}catch(m){n?n(m):console.error(m),i.manager.itemError(t)}},a,n)}setMaterials(t){return this.materials=t,this}parse(t){const o=new Tt;t.indexOf(`\r
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),he=require("./index-BhiIxYT9.cjs"),De=require("./index-QSZIlTwl.cjs"),ae=require("./index-ofXwoqS2.cjs"),s=require("./index-cinslkDi.cjs"),I=require("./menu-BasDnaD3.cjs"),rt=require("./index-D9BjWYYa.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_4bf164f6_lang-B5P2piGc.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ge=require("./array-Ac3PKTGq.cjs"),et=require("./login-D8VTsSIS.cjs"),pe=require("./index-BpPyaNFa.cjs"),lt=require("./index-YLsm_qc3.cjs"),_e=require("./cloneDeep-FsOChpwa.cjs"),tt=require("./index-CY6WqluP.cjs"),qe=require("./index-CoLd5ctI.cjs"),Ze={type:"change"},Ne={type:"start"},ot={type:"end"},Ee=new s.Ray,Ge=new s.Plane,ct=Math.cos(70*s.MathUtils.DEG2RAD),Z=new s.Vector3,oe=2*Math.PI,R={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},Se=1e-6;class ht extends s.Controls{constructor(t,o=null){super(t,o),this.state=R.NONE,this.target=new s.Vector3,this.cursor=new s.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:s.MOUSE.ROTATE,MIDDLE:s.MOUSE.DOLLY,RIGHT:s.MOUSE.PAN},this.touches={ONE:s.TOUCH.ROTATE,TWO:s.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new s.Vector3,this._lastQuaternion=new s.Quaternion,this._lastTargetPosition=new s.Vector3,this._quat=new s.Quaternion().setFromUnitVectors(t.up,new s.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new s.Spherical,this._sphericalDelta=new s.Spherical,this._scale=1,this._panOffset=new s.Vector3,this._rotateStart=new s.Vector2,this._rotateEnd=new s.Vector2,this._rotateDelta=new s.Vector2,this._panStart=new s.Vector2,this._panEnd=new s.Vector2,this._panDelta=new s.Vector2,this._dollyStart=new s.Vector2,this._dollyEnd=new s.Vector2,this._dollyDelta=new s.Vector2,this._dollyDirection=new s.Vector3,this._mouse=new s.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=ut.bind(this),this._onPointerDown=dt.bind(this),this._onPointerUp=pt.bind(this),this._onContextMenu=vt.bind(this),this._onMouseWheel=gt.bind(this),this._onKeyDown=_t.bind(this),this._onTouchStart=yt.bind(this),this._onTouchMove=wt.bind(this),this._onMouseDown=mt.bind(this),this._onMouseMove=ft.bind(this),this._interceptControlDown=bt.bind(this),this._interceptControlUp=Ct.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(Ze),this.update(),this.state=R.NONE}update(t=null){const o=this.object.position;Z.copy(o).sub(this.target),Z.applyQuaternion(this._quat),this._spherical.setFromVector3(Z),this.autoRotate&&this.state===R.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let a=this.minAzimuthAngle,n=this.maxAzimuthAngle;isFinite(a)&&isFinite(n)&&(a<-Math.PI?a+=oe:a>Math.PI&&(a-=oe),n<-Math.PI?n+=oe:n>Math.PI&&(n-=oe),a<=n?this._spherical.theta=Math.max(a,Math.min(n,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(a+n)/2?Math.max(a,this._spherical.theta):Math.min(n,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let i=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const u=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),i=u!=this._spherical.radius}if(Z.setFromSpherical(this._spherical),Z.applyQuaternion(this._quatInverse),o.copy(this.target).add(Z),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let u=null;if(this.object.isPerspectiveCamera){const r=Z.length();u=this._clampDistance(r*this._scale);const m=r-u;this.object.position.addScaledVector(this._dollyDirection,m),this.object.updateMatrixWorld(),i=!!m}else if(this.object.isOrthographicCamera){const r=new s.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const m=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),i=m!==this.object.zoom;const c=new s.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object),this.object.position.sub(c).add(r),this.object.updateMatrixWorld(),u=Z.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;u!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(u).add(this.object.position):(Ee.origin.copy(this.object.position),Ee.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(Ee.direction))<ct?this.object.lookAt(this.target):(Ge.setFromNormalAndCoplanarPoint(this.object.up,this.target),Ee.intersectPlane(Ge,this.target))))}else if(this.object.isOrthographicCamera){const u=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),u!==this.object.zoom&&(this.object.updateProjectionMatrix(),i=!0)}return this._scale=1,this._performCursorZoom=!1,i||this._lastPosition.distanceToSquared(this.object.position)>Se||8*(1-this._lastQuaternion.dot(this.object.quaternion))>Se||this._lastTargetPosition.distanceToSquared(this.target)>Se?(this.dispatchEvent(Ze),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?oe/60*this.autoRotateSpeed*t:oe/60/60*this.autoRotateSpeed}_getZoomScale(t){const o=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*o)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,o){Z.setFromMatrixColumn(o,0),Z.multiplyScalar(-t),this._panOffset.add(Z)}_panUp(t,o){this.screenSpacePanning===!0?Z.setFromMatrixColumn(o,1):(Z.setFromMatrixColumn(o,0),Z.crossVectors(this.object.up,Z)),Z.multiplyScalar(t),this._panOffset.add(Z)}_pan(t,o){const a=this.domElement;if(this.object.isPerspectiveCamera){const n=this.object.position;Z.copy(n).sub(this.target);let i=Z.length();i*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*i/a.clientHeight,this.object.matrix),this._panUp(2*o*i/a.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/a.clientWidth,this.object.matrix),this._panUp(o*(this.object.top-this.object.bottom)/this.object.zoom/a.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,o){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const a=this.domElement.getBoundingClientRect(),n=t-a.left,i=o-a.top,u=a.width,r=a.height;this._mouse.x=n/u*2-1,this._mouse.y=-(i/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const o=this.domElement;this._rotateLeft(oe*this._rotateDelta.x/o.clientHeight),this._rotateUp(oe*this._rotateDelta.y/o.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let o=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),o=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),o=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),o=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-oe*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),o=!0;break}o&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._rotateStart.set(a,n)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._panStart.set(a,n)}}_handleTouchStartDolly(t){const o=this._getSecondPointerPosition(t),a=t.pageX-o.x,n=t.pageY-o.y,i=Math.sqrt(a*a+n*n);this._dollyStart.set(0,i)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const a=this._getSecondPointerPosition(t),n=.5*(t.pageX+a.x),i=.5*(t.pageY+a.y);this._rotateEnd.set(n,i)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const o=this.domElement;this._rotateLeft(oe*this._rotateDelta.x/o.clientHeight),this._rotateUp(oe*this._rotateDelta.y/o.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const o=this._getSecondPointerPosition(t),a=.5*(t.pageX+o.x),n=.5*(t.pageY+o.y);this._panEnd.set(a,n)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const o=this._getSecondPointerPosition(t),a=t.pageX-o.x,n=t.pageY-o.y,i=Math.sqrt(a*a+n*n);this._dollyEnd.set(0,i),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const u=(t.pageX+o.x)*.5,r=(t.pageY+o.y)*.5;this._updateZoomParameters(u,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let o=0;o<this._pointers.length;o++)if(this._pointers[o]==t.pointerId){this._pointers.splice(o,1);return}}_isTrackingPointer(t){for(let o=0;o<this._pointers.length;o++)if(this._pointers[o]==t.pointerId)return!0;return!1}_trackPointer(t){let o=this._pointerPositions[t.pointerId];o===void 0&&(o=new s.Vector2,this._pointerPositions[t.pointerId]=o),o.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const o=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[o]}_customWheelEvent(t){const o=t.deltaMode,a={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(o){case 1:a.deltaY*=16;break;case 2:a.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(a.deltaY*=10),a}}function dt(g){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(g.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(g)&&(this._addPointer(g),g.pointerType==="touch"?this._onTouchStart(g):this._onMouseDown(g)))}function ut(g){this.enabled!==!1&&(g.pointerType==="touch"?this._onTouchMove(g):this._onMouseMove(g))}function pt(g){switch(this._removePointer(g),this._pointers.length){case 0:this.domElement.releasePointerCapture(g.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(ot),this.state=R.NONE;break;case 1:const t=this._pointers[0],o=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:o.x,pageY:o.y});break}}function mt(g){let t;switch(g.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case s.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(g),this.state=R.DOLLY;break;case s.MOUSE.ROTATE:if(g.ctrlKey||g.metaKey||g.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(g),this.state=R.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(g),this.state=R.ROTATE}break;case s.MOUSE.PAN:if(g.ctrlKey||g.metaKey||g.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(g),this.state=R.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(g),this.state=R.PAN}break;default:this.state=R.NONE}this.state!==R.NONE&&this.dispatchEvent(Ne)}function ft(g){switch(this.state){case R.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(g);break;case R.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(g);break;case R.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(g);break}}function gt(g){this.enabled===!1||this.enableZoom===!1||this.state!==R.NONE||(g.preventDefault(),this.dispatchEvent(Ne),this._handleMouseWheel(this._customWheelEvent(g)),this.dispatchEvent(ot))}function _t(g){this.enabled!==!1&&this._handleKeyDown(g)}function yt(g){switch(this._trackPointer(g),this._pointers.length){case 1:switch(this.touches.ONE){case s.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(g),this.state=R.TOUCH_ROTATE;break;case s.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(g),this.state=R.TOUCH_PAN;break;default:this.state=R.NONE}break;case 2:switch(this.touches.TWO){case s.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(g),this.state=R.TOUCH_DOLLY_PAN;break;case s.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(g),this.state=R.TOUCH_DOLLY_ROTATE;break;default:this.state=R.NONE}break;default:this.state=R.NONE}this.state!==R.NONE&&this.dispatchEvent(Ne)}function wt(g){switch(this._trackPointer(g),this.state){case R.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(g),this.update();break;case R.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(g),this.update();break;case R.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(g),this.update();break;case R.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(g),this.update();break;default:this.state=R.NONE}}function vt(g){this.enabled!==!1&&g.preventDefault()}function bt(g){g.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ct(g){g.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function xt(g){let t=null,o=null,a=null,n=null,i=null,u=null;const r=e.ref([]),m=e.ref(new s.Vector3),c=e.ref(new s.Vector3),y=()=>{if(!g.value)return;t=new s.Scene,t.background=new s.Color(16777215);const C=g.value;o=new s.PerspectiveCamera(75,C.clientWidth/C.clientHeight,.1,1e3),a=new s.WebGLRenderer({antialias:!0,alpha:!0}),a.setSize(C.clientWidth,C.clientHeight),a.localClippingEnabled=!0,a.shadowMap.enabled=!0,a.shadowMap.type=s.PCFSoftShadowMap,a.toneMapping=s.ACESFilmicToneMapping,a.toneMappingExposure=1,a.outputColorSpace=s.SRGBColorSpace,C.appendChild(a.domElement),n=new ht(o,a.domElement),n.enableDamping=!0,n.dampingFactor=.05,i=new s.Xe(o,a,{container:C,type:"cube",placement:"bottom-left",offset:{left:22,bottom:22},background:{color:"#D1D1D1"}}),i.attachControls(n),w(),_()},w=()=>{const C=new s.AmbientLight(4210752,.6);t.add(C);const E=new s.DirectionalLight(16777215,2);E.position.set(10,10,8),E.castShadow=!0,E.shadow.mapSize.width=2048,E.shadow.mapSize.height=2048,E.shadow.camera.near=.5,E.shadow.camera.far=50,t.add(E);const d=new s.DirectionalLight(16777215,.8);d.position.set(-8,-8,6),t.add(d);const P=new s.DirectionalLight(16777215,.6);P.position.set(0,-15,2),t.add(P);const D=new s.HemisphereLight(16777215,4473924,.8);t.add(D);const M=new s.PointLight(16777215,1,50);M.position.set(15,15,15),t.add(M);const F=new s.PointLight(16777215,.5,50);F.position.set(-15,-15,15),t.add(F)},_=()=>{u=requestAnimationFrame(_),n&&n.update(),a&&t&&o&&a.render(t,o),i&&i.render()},b=C=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(d=>{C[d]&&C[d].dispose&&C[d].dispose()}),C.dispose&&C.dispose()},x=C=>{C.traverse(E=>{E.geometry&&E.geometry.dispose(),E.material&&(Array.isArray(E.material)?E.material.forEach(d=>{b(d)}):b(E.material))})};return{currentModels:r,initialCameraPosition:m,initialTargetPosition:c,initThreeJS:y,handleResize:()=>{if(!g.value||!o||!a||!i)return;const C=g.value,E=C.clientWidth,d=C.clientHeight;o.aspect=E/d,o.updateProjectionMatrix(),a.setSize(E,d),i.update()},fitCameraToAllModels:()=>{if(!o||!n||r.value.length===0)return;const C=new s.Box3;r.value.forEach(T=>{C.expandByObject(T)});const E=C.getSize(new s.Vector3),d=C.getCenter(new s.Vector3),D=Math.max(E.x,E.y,E.z)*.6,M=new s.Vector3(d.x+D,d.y+D,d.z+D),F=d.clone();o.position.copy(M),o.lookAt(F),n.target.copy(F),n.update(),m.value.copy(M),c.value.copy(F)},getThreeJSObjects:()=>({scene:t,camera:o,renderer:a,controls:n,gizmo:i}),clearAllModels:()=>{if(!t)return;r.value.forEach(E=>{t.remove(E),x(E)});const C=[];t.children.forEach(E=>{!E.isLight&&!E.isCamera&&C.push(E)}),C.forEach(E=>{t.remove(E),x(E)}),r.value=[]},cleanup:()=>{u&&cancelAnimationFrame(u),a&&a.dispose(),n&&n.dispose(),i&&i.dispose()}}}function kt(g,t){const o=e.ref(!1);let a=null,n=12700,i=new s.Vector3,u=new s.Vector3,r=new s.Vector3,m=0,c=null;const y=l=>l<.5?4*l*l*l:1-Math.pow(-2*l+2,3)/2,w=l=>{const v=new s.Vector3,k=m*1.2,V=new s.Vector3(r.x+k,r.y,r.z),C=new s.Vector3(r.x,r.y+k,r.z),E=new s.Vector3(r.x,r.y-k,r.z);if(l<=.567){const P=l/.567*Math.PI*2;v.x=r.x+Math.cos(P)*k,v.z=r.z+Math.sin(P)*k,v.y=r.y}else if(l<=.724){const d=(l-.567)/.157,P=y(d);v.lerpVectors(V,C,P)}else if(l<=.881){const d=(l-.724)/.157,D=y(d)*Math.PI;v.x=r.x+Math.sin(D)*k,v.y=r.y+Math.cos(D)*k,v.z=r.z}else{const d=(l-.881)/.119,P=y(d);v.lerpVectors(E,i,P)}return v},_=()=>{const{camera:l,controls:v}=g();if(!l||!v)return;a||(a=Date.now());const k=Date.now()-a,V=Math.min(k/n,1);if(V>=1){x();return}const C=w(V);l.position.copy(C),l.lookAt(r),v.target.copy(r),c=requestAnimationFrame(_)},b=()=>{if(t.value.length===0)return;const{camera:l,controls:v}=g();if(!l||!v)return;i.copy(l.position),u.copy(v.target);const k=new s.Box3;t.value.forEach(M=>{k.expandByObject(M)});const V=k.getSize(new s.Vector3);r=k.getCenter(new s.Vector3),m=Math.max(V.x,V.y,V.z)*1.2;const C=new s.Vector3(r.x+m*1.2,r.y,r.z);v.enabled=!1;const E=l.position.clone(),d=1e3,P=Date.now(),D=()=>{const M=Date.now()-P,F=Math.min(M/d,1),T=y(F);l.position.lerpVectors(E,C,T),l.lookAt(r),v.target.copy(r),F<1?requestAnimationFrame(D):(o.value=!0,a=null,_())};D()},x=()=>{o.value=!1,a=null,c&&(cancelAnimationFrame(c),c=null);const{controls:l}=g();l&&(l.enabled=!0,l.target.copy(u))};return{isAnimating:o,toggleAnimation:()=>{if(o.value){o.value=!1,a=null,c&&(cancelAnimationFrame(c),c=null);const{camera:l,controls:v}=g();if(!l||!v)return;v.enabled=!0;const k=l.position.clone(),V=v.target.clone(),C=1500,E=Date.now(),d=()=>{const P=Date.now()-E,D=Math.min(P/C,1),M=y(D);l.position.lerpVectors(k,i,M),v.target.lerpVectors(V,u,M),D<1&&requestAnimationFrame(d)};d()}else b()},startAnimation:b,stopAnimation:x}}function Et(g,t){const o=e.ref(!1),a=e.ref("none");let n=[],i=[],u=new s.Box3,r=new s.Vector3;const m=()=>{n=[new s.Plane(new s.Vector3(1,0,0),0),new s.Plane(new s.Vector3(0,1,0),0),new s.Plane(new s.Vector3(0,0,1),0)]},c=()=>{u.makeEmpty(),t.value.forEach(p=>{u.expandByObject(p)}),r=u.getCenter(new s.Vector3)},y=p=>{const l=u.getSize(new s.Vector3);let v,k,V;p==="x"?(v=new s.PlaneGeometry(l.z*1.2,l.y*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(0,Math.PI/2,0)):p==="y"?(v=new s.PlaneGeometry(l.x*1.2,l.z*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(Math.PI/2,0,0)):p==="z"&&(v=new s.PlaneGeometry(l.x*1.2,l.y*1.2),k=new s.Vector3(r.x,r.y,r.z),V=new s.Euler(0,0,0));const C=new s.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:s.DoubleSide,depthWrite:!1}),E=new s.Mesh(v,C);return E.position.copy(k),E.rotation.copy(V),E},w=()=>{if(_(),b(),a.value==="none")return;c();let p=null;if(a.value==="x"?(n[0].constant=-r.x,p=n[0]):a.value==="y"?(n[1].constant=-r.y,p=n[1]):a.value==="z"&&(n[2].constant=-r.z,p=n[2]),p){t.value.forEach(v=>{v.traverse(k=>{k.isMesh&&k.material&&(Array.isArray(k.material)?k.material.forEach(V=>{V.clippingPlanes=[p]}):k.material.clippingPlanes=[p])})});const{scene:l}=g();if(l){const v=y(a.value);l.add(v),i.push(v)}}},_=()=>{t.value.forEach(p=>{p.traverse(l=>{l.isMesh&&l.material&&(Array.isArray(l.material)?l.material.forEach(v=>{v.clippingPlanes=[]}):l.material.clippingPlanes=[])})})},b=()=>{const{scene:p}=g();p&&i.forEach(l=>{p.remove(l),l.geometry.dispose(),l.material.dispose()}),i=[]};return{isClipping:o,activeClippingAxis:a,toggleClipping:()=>{o.value=!o.value,o.value?(m(),t.value.length>0&&c()):(a.value="none",_(),b())},updateClippingPlanes:w,clearClippingPlanes:_,clearClippingMeshes:b}}const Mt=/^[og]\s*(.+)?/,Vt=/^mtllib /,Pt=/^usemtl /,St=/^usemap /,Ke=/\s+/,We=new s.Vector3,Te=new s.Vector3,Xe=new s.Vector3,Je=new s.Vector3,se=new s.Vector3,Me=new s.Color;function Tt(){const g={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(t,o){if(this.object&&this.object.fromDeclaration===!1){this.object.name=t,this.object.fromDeclaration=o!==!1;return}const a=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:t||"",fromDeclaration:o!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},materials:[],smooth:!0,startMaterial:function(n,i){const u=this._finalize(!1);u&&(u.inherited||u.groupCount<=0)&&this.materials.splice(u.index,1);const r={index:this.materials.length,name:n||"",mtllib:Array.isArray(i)&&i.length>0?i[i.length-1]:"",smooth:u!==void 0?u.smooth:this.smooth,groupStart:u!==void 0?u.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(m){const c={index:typeof m=="number"?m:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return c.clone=this.clone.bind(c),c}};return this.materials.push(r),r},currentMaterial:function(){if(this.materials.length>0)return this.materials[this.materials.length-1]},_finalize:function(n){const i=this.currentMaterial();if(i&&i.groupEnd===-1&&(i.groupEnd=this.geometry.vertices.length/3,i.groupCount=i.groupEnd-i.groupStart,i.inherited=!1),n&&this.materials.length>1)for(let u=this.materials.length-1;u>=0;u--)this.materials[u].groupCount<=0&&this.materials.splice(u,1);return n&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),i}},a&&a.name&&typeof a.clone=="function"){const n=a.clone(0);n.inherited=!0,this.object.materials.push(n)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/3)*3},parseNormalIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/3)*3},parseUVIndex:function(t,o){const a=parseInt(t,10);return(a>=0?a-1:a+o/2)*2},addVertex:function(t,o,a){const n=this.vertices,i=this.object.geometry.vertices;i.push(n[t+0],n[t+1],n[t+2]),i.push(n[o+0],n[o+1],n[o+2]),i.push(n[a+0],n[a+1],n[a+2])},addVertexPoint:function(t){const o=this.vertices;this.object.geometry.vertices.push(o[t+0],o[t+1],o[t+2])},addVertexLine:function(t){const o=this.vertices;this.object.geometry.vertices.push(o[t+0],o[t+1],o[t+2])},addNormal:function(t,o,a){const n=this.normals,i=this.object.geometry.normals;i.push(n[t+0],n[t+1],n[t+2]),i.push(n[o+0],n[o+1],n[o+2]),i.push(n[a+0],n[a+1],n[a+2])},addFaceNormal:function(t,o,a){const n=this.vertices,i=this.object.geometry.normals;We.fromArray(n,t),Te.fromArray(n,o),Xe.fromArray(n,a),se.subVectors(Xe,Te),Je.subVectors(We,Te),se.cross(Je),se.normalize(),i.push(se.x,se.y,se.z),i.push(se.x,se.y,se.z),i.push(se.x,se.y,se.z)},addColor:function(t,o,a){const n=this.colors,i=this.object.geometry.colors;n[t]!==void 0&&i.push(n[t+0],n[t+1],n[t+2]),n[o]!==void 0&&i.push(n[o+0],n[o+1],n[o+2]),n[a]!==void 0&&i.push(n[a+0],n[a+1],n[a+2])},addUV:function(t,o,a){const n=this.uvs,i=this.object.geometry.uvs;i.push(n[t+0],n[t+1]),i.push(n[o+0],n[o+1]),i.push(n[a+0],n[a+1])},addDefaultUV:function(){const t=this.object.geometry.uvs;t.push(0,0),t.push(0,0),t.push(0,0)},addUVLine:function(t){const o=this.uvs;this.object.geometry.uvs.push(o[t+0],o[t+1])},addFace:function(t,o,a,n,i,u,r,m,c){const y=this.vertices.length;let w=this.parseVertexIndex(t,y),_=this.parseVertexIndex(o,y),b=this.parseVertexIndex(a,y);if(this.addVertex(w,_,b),this.addColor(w,_,b),r!==void 0&&r!==""){const x=this.normals.length;w=this.parseNormalIndex(r,x),_=this.parseNormalIndex(m,x),b=this.parseNormalIndex(c,x),this.addNormal(w,_,b)}else this.addFaceNormal(w,_,b);if(n!==void 0&&n!==""){const x=this.uvs.length;w=this.parseUVIndex(n,x),_=this.parseUVIndex(i,x),b=this.parseUVIndex(u,x),this.addUV(w,_,b),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(t){this.object.geometry.type="Points";const o=this.vertices.length;for(let a=0,n=t.length;a<n;a++){const i=this.parseVertexIndex(t[a],o);this.addVertexPoint(i),this.addColor(i)}},addLineGeometry:function(t,o){this.object.geometry.type="Line";const a=this.vertices.length,n=this.uvs.length;for(let i=0,u=t.length;i<u;i++)this.addVertexLine(this.parseVertexIndex(t[i],a));for(let i=0,u=o.length;i<u;i++)this.addUVLine(this.parseUVIndex(o[i],n))}};return g.startObject("",!1),g}class Qe extends s.Loader{constructor(t){super(t),this.materials=null}load(t,o,a,n){const i=this,u=new s.FileLoader(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(t,function(r){try{o(i.parse(r))}catch(m){n?n(m):console.error(m),i.manager.itemError(t)}},a,n)}setMaterials(t){return this.materials=t,this}parse(t){const o=new Tt;t.indexOf(`\r
|
|
2
2
|
`)!==-1&&(t=t.replace(/\r\n/g,`
|
|
3
3
|
`)),t.indexOf(`\\
|
|
4
4
|
`)!==-1&&(t=t.replace(/\\\n/g,""));const a=t.split(`
|
|
5
5
|
`);let n=[];for(let r=0,m=a.length;r<m;r++){const c=a[r].trimStart();if(c.length===0)continue;const y=c.charAt(0);if(y!=="#")if(y==="v"){const w=c.split(Ke);switch(w[0]){case"v":o.vertices.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3])),w.length>=7?(Me.setRGB(parseFloat(w[4]),parseFloat(w[5]),parseFloat(w[6]),s.SRGBColorSpace),o.colors.push(Me.r,Me.g,Me.b)):o.colors.push(void 0,void 0,void 0);break;case"vn":o.normals.push(parseFloat(w[1]),parseFloat(w[2]),parseFloat(w[3]));break;case"vt":o.uvs.push(parseFloat(w[1]),parseFloat(w[2]));break}}else if(y==="f"){const _=c.slice(1).trim().split(Ke),b=[];for(let p=0,l=_.length;p<l;p++){const v=_[p];if(v.length>0){const k=v.split("/");b.push(k)}}const x=b[0];for(let p=1,l=b.length-1;p<l;p++){const v=b[p],k=b[p+1];o.addFace(x[0],v[0],k[0],x[1],v[1],k[1],x[2],v[2],k[2])}}else if(y==="l"){const w=c.substring(1).trim().split(" ");let _=[];const b=[];if(c.indexOf("/")===-1)_=w;else for(let x=0,p=w.length;x<p;x++){const l=w[x].split("/");l[0]!==""&&_.push(l[0]),l[1]!==""&&b.push(l[1])}o.addLineGeometry(_,b)}else if(y==="p"){const _=c.slice(1).trim().split(" ");o.addPointGeometry(_)}else if((n=Mt.exec(c))!==null){const w=(" "+n[0].slice(1).trim()).slice(1);o.startObject(w)}else if(Pt.test(c))o.object.startMaterial(c.substring(7).trim(),o.materialLibraries);else if(Vt.test(c))o.materialLibraries.push(c.substring(7).trim());else if(St.test(c))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(y==="s"){if(n=c.split(" "),n.length>1){const _=n[1].trim().toLowerCase();o.object.smooth=_!=="0"&&_!=="off"}else o.object.smooth=!0;const w=o.object.currentMaterial();w&&(w.smooth=o.object.smooth)}else{if(c==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+c+'"')}}o.finalize();const i=new s.Group;if(i.materialLibraries=[].concat(o.materialLibraries),!(o.objects.length===1&&o.objects[0].geometry.vertices.length===0)===!0)for(let r=0,m=o.objects.length;r<m;r++){const c=o.objects[r],y=c.geometry,w=c.materials,_=y.type==="Line",b=y.type==="Points";let x=!1;if(y.vertices.length===0)continue;const p=new s.BufferGeometry;p.setAttribute("position",new s.Float32BufferAttribute(y.vertices,3)),y.normals.length>0&&p.setAttribute("normal",new s.Float32BufferAttribute(y.normals,3)),y.colors.length>0&&(x=!0,p.setAttribute("color",new s.Float32BufferAttribute(y.colors,3))),y.hasUVIndices===!0&&p.setAttribute("uv",new s.Float32BufferAttribute(y.uvs,2));const l=[];for(let k=0,V=w.length;k<V;k++){const C=w[k],E=C.name+"_"+C.smooth+"_"+x;let d=o.materials[E];if(this.materials!==null){if(d=this.materials.create(C.name),_&&d&&!(d instanceof s.LineBasicMaterial)){const P=new s.LineBasicMaterial;s.Material.prototype.copy.call(P,d),P.color.copy(d.color),d=P}else if(b&&d&&!(d instanceof s.PointsMaterial)){const P=new s.PointsMaterial({size:10,sizeAttenuation:!1});s.Material.prototype.copy.call(P,d),P.color.copy(d.color),P.map=d.map,d=P}}d===void 0&&(_?d=new s.LineBasicMaterial:b?d=new s.PointsMaterial({size:1,sizeAttenuation:!1}):d=new s.MeshPhongMaterial,d.name=C.name,d.flatShading=!C.smooth,d.vertexColors=x,o.materials[E]=d),l.push(d)}let v;if(l.length>1){for(let k=0,V=w.length;k<V;k++){const C=w[k];p.addGroup(C.groupStart,C.groupCount,k)}_?v=new s.LineSegments(p,l):b?v=new s.Points(p,l):v=new s.Mesh(p,l)}else _?v=new s.LineSegments(p,l[0]):b?v=new s.Points(p,l[0]):v=new s.Mesh(p,l[0]);v.name=c.name,i.add(v)}else if(o.vertices.length>0){const r=new s.PointsMaterial({size:1,sizeAttenuation:!1}),m=new s.BufferGeometry;m.setAttribute("position",new s.Float32BufferAttribute(o.vertices,3)),o.colors.length>0&&o.colors[0]!==void 0&&(m.setAttribute("color",new s.Float32BufferAttribute(o.colors,3)),r.vertexColors=!0);const c=new s.Points(m,r);i.add(c)}return i}}class Dt extends s.Loader{constructor(t){super(t)}load(t,o,a,n){const i=this,u=this.path===""?s.LoaderUtils.extractUrlBase(t):this.path,r=new s.FileLoader(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(t,function(m){try{o(i.parse(m,u))}catch(c){n?n(c):console.error(c),i.manager.itemError(t)}},a,n)}setMaterialOptions(t){return this.materialOptions=t,this}parse(t,o){const a=t.split(`
|
|
6
|
-
`);let n={};const i=/\s+/,u={};for(let m=0;m<a.length;m++){let c=a[m];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const y=c.indexOf(" ");let w=y>=0?c.substring(0,y):c;w=w.toLowerCase();let _=y>=0?c.substring(y+1):"";if(_=_.trim(),w==="newmtl")n={name:_},u[_]=n;else if(w==="ka"||w==="kd"||w==="ks"||w==="ke"){const b=_.split(i,3);n[w]=[parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[2])]}else n[w]=_}const r=new Nt(this.resourcePath||o,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(u),r}}class Nt{constructor(t="",o={}){this.baseUrl=t,this.options=o,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:s.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:s.RepeatWrapping}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const o={};for(const a in t){const n=t[a],i={};o[a]=i;for(const u in n){let r=!0,m=n[u];const c=u.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(m=[m[0]/255,m[1]/255,m[2]/255]),this.options&&this.options.ignoreZeroRGBs&&m[0]===0&&m[1]===0&&m[2]===0&&(r=!1);break}r&&(i[c]=m)}}return o}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const o in this.materialsInfo)this.materialsArray[t]=this.create(o),this.nameLookup[o]=t,t++;return this.materialsArray}create(t){return this.materials[t]===void 0&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const o=this,a=this.materialsInfo[t],n={name:t,side:this.side};function i(r,m){return typeof m!="string"||m===""?"":/^https?:\/\//i.test(m)?m:r+m}function u(r,m){if(n[r])return;const c=o.getTextureParams(m,n),y=o.loadTexture(i(o.baseUrl,c.url));y.repeat.copy(c.scale),y.offset.copy(c.offset),y.wrapS=o.wrap,y.wrapT=o.wrap,(r==="map"||r==="emissiveMap")&&(y.colorSpace=s.SRGBColorSpace),n[r]=y}for(const r in a){const m=a[r];let c;if(m!=="")switch(r.toLowerCase()){case"kd":n.color=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"ks":n.specular=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"ke":n.emissive=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"map_kd":u("map",m);break;case"map_ks":u("specularMap",m);break;case"map_ke":u("emissiveMap",m);break;case"norm":u("normalMap",m);break;case"map_bump":case"bump":u("bumpMap",m);break;case"disp":u("displacementMap",m);break;case"map_d":u("alphaMap",m),n.transparent=!0;break;case"ns":n.shininess=parseFloat(m);break;case"d":c=parseFloat(m),c<1&&(n.opacity=c,n.transparent=!0);break;case"tr":c=parseFloat(m),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(n.opacity=1-c,n.transparent=!0);break}}return this.materials[t]=new s.MeshPhongMaterial(n),this.materials[t]}getTextureParams(t,o){const a={scale:new s.Vector2(1,1),offset:new s.Vector2(0,0)},n=t.split(/\s+/);let i;return i=n.indexOf("-bm"),i>=0&&(o.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-mm"),i>=0&&(o.displacementBias=parseFloat(n[i+1]),o.displacementScale=parseFloat(n[i+2]),n.splice(i,3)),i=n.indexOf("-s"),i>=0&&(a.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(a.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),a.url=n.join(" ").trim(),a}loadTexture(t,o,a,n,i){const u=this.manager!==void 0?this.manager:s.DefaultLoadingManager;let r=u.getHandler(t);r===null&&(r=new s.TextureLoader(u)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const m=r.load(t,a,n,i);return o!==void 0&&(m.mapping=o),m}}class Bt extends s.Loader{constructor(t){super(t)}load(t,o,a,n){const i=this,u=new s.FileLoader(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(t,function(r){try{o(i.parse(r))}catch(m){n?n(m):console.error(m),i.manager.itemError(t)}},a,n)}parse(t){function o(c){const y=new DataView(c),w=32/8*3+32/8*3*3+16/8,_=y.getUint32(80,!0);if(80+32/8+_*w===y.byteLength)return!0;const x=[115,111,108,105,100];for(let p=0;p<5;p++)if(a(x,y,p))return!1;return!0}function a(c,y,w){for(let _=0,b=c.length;_<b;_++)if(c[_]!==y.getUint8(w+_))return!1;return!0}function n(c){const y=new DataView(c),w=y.getUint32(80,!0);let _,b,x,p=!1,l,v,k,V,C;for(let T=0;T<70;T++)y.getUint32(T,!1)==1129270351&&y.getUint8(T+4)==82&&y.getUint8(T+5)==61&&(p=!0,l=new Float32Array(w*3*3),v=y.getUint8(T+6)/255,k=y.getUint8(T+7)/255,V=y.getUint8(T+8)/255,C=y.getUint8(T+9)/255);const E=84,d=12*4+2,P=new s.BufferGeometry,D=new Float32Array(w*3*3),M=new Float32Array(w*3*3),F=new s.Color;for(let T=0;T<w;T++){const O=E+T*d,ee=y.getFloat32(O,!0),te=y.getFloat32(O+4,!0),f=y.getFloat32(O+8,!0);if(p){const h=y.getUint16(O+48,!0);(h&32768)===0?(_=(h&31)/31,b=(h>>5&31)/31,x=(h>>10&31)/31):(_=v,b=k,x=V)}for(let h=1;h<=3;h++){const S=O+h*12,B=T*3*3+(h-1)*3;D[B]=y.getFloat32(S,!0),D[B+1]=y.getFloat32(S+4,!0),D[B+2]=y.getFloat32(S+8,!0),M[B]=ee,M[B+1]=te,M[B+2]=f,p&&(F.setRGB(_,b,x,s.SRGBColorSpace),l[B]=F.r,l[B+1]=F.g,l[B+2]=F.b)}}return P.setAttribute("position",new s.BufferAttribute(D,3)),P.setAttribute("normal",new s.BufferAttribute(M,3)),p&&(P.setAttribute("color",new s.BufferAttribute(l,3)),P.hasColors=!0,P.alpha=C),P}function i(c){const y=new s.BufferGeometry,w=/solid([\s\S]*?)endsolid/g,_=/facet([\s\S]*?)endfacet/g,b=/solid\s(.+)/;let x=0;const p=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,l=new RegExp("vertex"+p+p+p,"g"),v=new RegExp("normal"+p+p+p,"g"),k=[],V=[],C=[],E=new s.Vector3;let d,P=0,D=0,M=0;for(;(d=w.exec(c))!==null;){D=M;const F=d[0],T=(d=b.exec(F))!==null?d[1]:"";for(C.push(T);(d=_.exec(F))!==null;){let te=0,f=0;const h=d[0];for(;(d=v.exec(h))!==null;)E.x=parseFloat(d[1]),E.y=parseFloat(d[2]),E.z=parseFloat(d[3]),f++;for(;(d=l.exec(h))!==null;)k.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),V.push(E.x,E.y,E.z),te++,M++;f!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+x),te!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+x),x++}const O=D,ee=M-D;y.userData.groupNames=C,y.addGroup(O,ee,P),P++}return y.setAttribute("position",new s.Float32BufferAttribute(k,3)),y.setAttribute("normal",new s.Float32BufferAttribute(V,3)),y}function u(c){return typeof c!="string"?new TextDecoder().decode(c):c}function r(c){if(typeof c=="string"){const y=new Uint8Array(c.length);for(let w=0;w<c.length;w++)y[w]=c.charCodeAt(w)&255;return y.buffer||y}else return c}const m=r(t);return o(m)?n(m):i(u(t))}}function At(g,t,o,a,n){const i=async _=>{try{const b=await tt.downloadAvatarApi({url:_});if(b.status!==200)throw new Error(`下载失败: ${b.status}`);return b.data}catch(b){throw console.error("addModelFromUrl失败:",b),b}},u=_=>new Promise((b,x)=>{const p=new FileReader;p.onload=l=>{try{const v=l.target.result,V=new Dt().parse(v);V.preload(),b(V)}catch(v){x(v)}},p.onerror=()=>{x(new Error("MTL文件读取失败"))},p.readAsText(_)}),r=async _=>{const b={materials:{},create:function(x){return this.materials[x]?this.materials[x]:(console.warn(`Material '${x}' not found, using default material`),new s.MeshPhongMaterial({color:8947848,side:s.DoubleSide}))},getAsArray:function(){const x=[];for(const p in this.materials)x.push(this.materials[p]);return x},preload:function(){for(const x in this.materials)this.materials[x].map&&(this.materials[x].map.needsUpdate=!0)}};for(const x of _){const p=await u(x);Object.assign(b.materials,p.materials)}return b.preload(),b},m=async(_,b=[])=>new Promise((x,p)=>{const l=new FileReader;l.onload=async v=>{try{const k=v.target.result;let V=null;b&&b.length>0&&(b.length===1?V=await u(b[0]):V=await r(b));const C=new Qe;V&&C.setMaterials(V);const E=C.parse(k);V||E.traverse(d=>{d.isMesh&&(d.material=new s.MeshPhongMaterial({color:8947848,side:s.DoubleSide}))}),x(E)}catch(k){p(k)}},l.onerror=()=>{p(new Error("OBJ文件读取失败"))},l.readAsText(_)}),c=async _=>{var b;try{o.value=!0;const{scene:x}=g();if(!x)throw new Error("Scene not initialized");n();const p=[];for(let l=0;l<_.length;l++){const v=_[l];a.value=`正在加载模型 ${l+1}/${_.length}...`;const k=await i(v.objUrl),V=((b=v.objUrl)==null?void 0:b.split("/").pop())||`model_${l}.obj`,C=new File([k],V,{type:k.type});let E=[];if(v.mtlUrls){const P=Array.isArray(v.mtlUrls)?v.mtlUrls:[v.mtlUrls];for(let D=0;D<P.length;D++){const M=P[D],F=await i(M),T=(M==null?void 0:M.split("/").pop())||`material_${l}_${D}.mtl`,O=new File([F],T,{type:F.type});E.push(O)}}const d=await m(C,E);x.add(d),t.value.push(d),p.push(d)}return o.value=!1,p}catch(x){throw console.error("加载模型失败:",x),o.value=!1,x}},y=async(_,b)=>{const x=await b.text();let p;switch(_){case".txt":case".cpt":const l=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,k=[...x.matchAll(l)].map(M=>({x:parseFloat(M[1]),y:parseFloat(M[2]),z:parseFloat(M[3])})),V=new s.BufferGeometry,C=k.flatMap(M=>[M.x,M.y,M.z]);if(V.setAttribute("position",new s.Float32BufferAttribute(C,3)),_===".txt"){const M=new s.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});p=new s.Points(V,M)}else if(_===".cpt"){const M=new s.LineBasicMaterial({color:"#5B5C99",linewidth:100});p=new s.Line(V,M)}break;case".obj":p=new Qe().parse(x),p.traverse(M=>{M.isMesh&&(M.material=new s.MeshPhongMaterial({color:"#5B5C99"})),M instanceof s.Mesh&&(M.material.side=s.DoubleSide)});break;case".stl":const P=new Bt().parse(x),D=new s.MeshPhongMaterial({color:"#5B5C99",side:s.DoubleSide});p=new s.Mesh(P,D);break;default:throw new Error(`不支持的文件格式: ${_}`)}return p};return{addModelsFromUrls:c,loadModelByDefaultPath:async _=>{console.log(_);try{o.value=!0,a.value="正在加载模型...";const{scene:b}=g();if(!b)throw new Error("Scene not initialized");n(),await new Promise(p=>setTimeout(p,100));const x=[];for(let p=0;p<_.length;p++){const l=_[p],v=await y(l.suffix,l.blob);b.add(v),t.value.push(v),x.push(v)}return o.value=!1,a.value="",x}catch(b){throw console.error("加载模型失败:",b),o.value=!1,a.value="",b}}}}const Ft={class:"obj-viewer-container"},Lt={class:"floating-controls"},Rt=["disabled"],jt=["disabled","title"],Ot={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},It={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},zt=["disabled"],Ut=["title"],$t={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ht={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Yt={key:0,class:"clipping-panel"},qt={class:"panel-content"},Zt={class:"radio-group"},Gt={class:"radio-label"},Kt={class:"radio-label"},Wt={class:"radio-label"},Xt={class:"radio-label"},Jt={key:1,class:"loading-overlay"},Qt={__name:"threeModel",setup(g,{expose:t}){const o=e.ref(null),a=e.ref(!1),n=e.ref(""),i=e.ref(!1),u=e.ref(!1),{currentModels:r,initialCameraPosition:m,initialTargetPosition:c,initThreeJS:y,handleResize:w,fitCameraToAllModels:_,getThreeJSObjects:b,clearAllModels:x,cleanup:p}=xt(o),{isAnimating:l,toggleAnimation:v,stopAnimation:k}=kt(b,r),{isClipping:V,activeClippingAxis:C,toggleClipping:E,updateClippingPlanes:d}=Et(b,r),{addModelsFromUrls:P,loadModelByDefaultPath:D}=At(b,r,a,n,x),M=()=>{if(u.value||r.value.length===0)return;u.value=!0,l.value&&k();const{camera:f,controls:h}=b();if(!f||!h)return;h.enabled=!0;const S=$=>$<.5?4*$*$*$:1-Math.pow(-2*$+2,3)/2,B=f.position.clone(),j=h.target.clone(),H=1500,L=Date.now(),X=()=>{const $=Date.now()-L,W=Math.min($/H,1),re=S(W);f.position.lerpVectors(B,m.value,re),h.target.lerpVectors(j,c.value,re),W<1?requestAnimationFrame(X):u.value=!1};X()},F=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{i.value=!1,e.nextTick(()=>{w()})}).catch(f=>{console.error("无法退出全屏:",f)}):o.value.requestFullscreen().then(()=>{i.value=!0,e.nextTick(()=>{w()})}).catch(f=>{console.error("无法进入全屏:",f)})},T=()=>{i.value=!!document.fullscreenElement,i.value||e.nextTick(()=>{w()})},O=async(f,h)=>{try{l.value&&k(),V.value&&E();const S=await h(f);return _(),S}catch(S){throw console.error("加载模型失败:",S),S}},ee=async f=>O(f,P),te=async f=>O(f,D);return e.onMounted(async()=>{await e.nextTick(),y(),window.addEventListener("resize",w),document.addEventListener("fullscreenchange",T)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",w),document.removeEventListener("fullscreenchange",T),l.value&&k(),p()}),t({addModelsFromUrls:ee,loadModelByDefaultPath:te}),(f,h)=>(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:o,class:"threejs-container"},null,512),e.createElementVNode("div",Lt,[e.createElementVNode("button",{onClick:M,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:a.value||e.unref(r).length===0||u.value,title:"重置"},h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.createElementVNode("polyline",{points:"9,22 9,12 15,12 15,22"})],-1)]),8,Rt),e.createElementVNode("button",{onClick:h[0]||(h[0]=(...S)=>e.unref(v)&&e.unref(v)(...S)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(l)}]),disabled:a.value||e.unref(r).length===0,title:e.unref(l)?"停止动画":"动画视图"},[e.unref(l)?(e.openBlock(),e.createElementBlock("svg",It,h[12]||(h[12]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("rect",{x:"9.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"12.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Ot,h[11]||(h[11]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("polygon",{points:"10,8 16,12 10,16",fill:"currentColor"},null,-1)])))],10,jt),e.createElementVNode("button",{onClick:h[1]||(h[1]=(...S)=>e.unref(E)&&e.unref(E)(...S)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(V)}]),disabled:a.value||e.unref(r).length===0,title:"剖面视图"},h[13]||(h[13]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18"}),e.createElementVNode("line",{x1:"-14",y1:"12",x2:"30",y2:"12","stroke-dasharray":"4,2"})],-1)]),10,zt),e.createElementVNode("button",{onClick:F,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:i.value?"退出全屏":"全屏"},[i.value?(e.openBlock(),e.createElementBlock("svg",Ht,h[15]||(h[15]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",$t,h[14]||(h[14]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))],8,Ut)]),e.unref(V)?(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("div",qt,[e.createElementVNode("div",Zt,[e.createElementVNode("label",Gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[2]||(h[2]=S=>e.isRef(C)?C.value=S:null),onChange:h[3]||(h[3]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[16]||(h[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":h[4]||(h[4]=S=>e.isRef(C)?C.value=S:null),onChange:h[5]||(h[5]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[17]||(h[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":h[6]||(h[6]=S=>e.isRef(C)?C.value=S:null),onChange:h[7]||(h[7]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[18]||(h[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Xt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":h[8]||(h[8]=S=>e.isRef(C)?C.value=S:null),onChange:h[9]||(h[9]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",Jt,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(n.value),1)])):e.createCommentVNode("",!0)]))}},eo=_e._export_sfc(Qt,[["__scopeId","data-v-f00cdda1"]]),to={class:"bread-content"},oo=["onClick"],no={key:0,class:"split-title"},so={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(g,{emit:t}){const o=g,a=e.ref([]),n=t;e.onMounted(()=>{a.value=o==null?void 0:o.breadArray}),e.watch(()=>o==null?void 0:o.breadArray,()=>{a.value=o==null?void 0:o.breadArray},{deep:!0,immediate:!0});const i=u=>{n("click",u)};return(u,r)=>(e.openBlock(),e.createElementBlock("div",to,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,c)=>{var y;return e.openBlock(),e.createElementBlock("div",{key:c,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:w=>i(m),style:e.normalizeStyle({opacity:((y=a.value)==null?void 0:y.length)-1===c?"0.7":"1"})},e.toDisplayString(m.value),13,oo),c!==a.value.length-1&&Array.isArray(a.value)?(e.openBlock(),e.createElementBlock("div",no,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},nt=_e._export_sfc(so,[["__scopeId","data-v-ded7e2bd"]]),ao={class:"item-menu-content"},io={class:"item-left-content"},ro={key:0,class:"page-icon"},lo={class:"avatar"},co={style:{display:"flex"}},ho={class:"select-icon"},uo={key:0,class:"model-operate",style:{width:"0px"}},po={class:"model-select"},mo={class:"model-fill"},fo={key:1,class:"show-main-content"},go={class:"show-content"},_o={class:"item-view-group"},yo={class:"show-item-content"},wo={class:"item-view-group"},vo={key:2,class:"show-main-content"},bo={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(g,{emit:t}){const o=et.useLoginState(),{loginUserInfo:a,cryptoInfo:n}=I.storeToRefs(o);e.onMounted(()=>{lt.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const i=s.useModelComp(se.pinia);s.useFormToTableComp(se.pinia),e.ref(!0);const u=I.useMenuState();e.ref(!0);const{itemData:r,isEdit:m,isRefreshCurStructure:c,curStructureCompIds:y}=I.storeToRefs(i),w=s.useUnit(se.pinia),{activeMenuPath:_,menus:b,importLoading:x}=I.storeToRefs(u),{selectIndex:p,selectTitle:l}=I.storeToRefs(w);return e.ref([]),e.ref(!1),(v,k)=>{const V=e.resolveComponent("el-aside"),C=e.resolveComponent("el-button"),E=e.resolveComponent("el-avatar"),d=e.resolveComponent("el-header"),P=e.resolveComponent("router-view"),D=e.resolveComponent("el-main"),M=e.resolveComponent("el-container"),F=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(M,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(m)==="view"?(e.openBlock(),e.createBlock(V,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(M,null,{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>{var T;return[e.createElementVNode("div",ao,[e.createElementVNode("div",io,[e.unref(m)==="edit"?(e.openBlock(),e.createElementBlock("div",ro,[e.createVNode(C,{text:"",onClick:e.unref(N.onBack)},{default:e.withCtx(()=>k[2]||(k[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(C,{text:"",onClick:k[0]||(k[0]=O=>{var ee,te;return e.unref(N.clickSavePage)((te=(ee=e.unref(l))==null?void 0:ee.map(f=>f.value))==null?void 0:te.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(ue.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[k[3]||(k[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(nt,{key:e.unref(l),breadArray:e.unref(l),onClick:e.unref(N.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",lo,[e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:k[1]||(k[1]=(...O)=>e.unref(N.onSelectFixContent)&&e.unref(N.onSelectFixContent)(...O))},[e.createElementVNode("div",co,[e.createVNode(ue.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),k[4]||(k[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ho,[e.renderSlot(v.$slots,"default",{},void 0,!0)]),e.createVNode(E,{size:35,src:(T=e.unref(a))==null?void 0:T.avatarUrl},{default:e.withCtx(()=>{var O;return[e.createTextVNode(e.toDisplayString(((O=e.unref(a))==null?void 0:O.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(D,null,{default:e.withCtx(()=>{var T,O,ee,te;return[e.unref(m)==="edit"?(e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",po,[e.createVNode(ce.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:v.innerWidth},[e.createVNode(ce.modelShow)])),e.createElementVNode("div",mo,[e.createVNode(ce.modelFill)])])):v.$route.path==="/"&&((T=e.unref(N.showItems))==null?void 0:T.length)>0&&e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("div",go,[(O=e.unref(ge.cloneDeep)(e.unref(N.showItems)))!=null&&O.find(f=>f.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:v.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ee=e.unref(ge.cloneDeep)(e.unref(N.showItems)))==null?void 0:ee.filter(f=>f.comp==="FormTop"),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",_o,e.toDisplayString(f.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(f.comp)),{itemData:f==null?void 0:f.compData,childItemData:f==null?void 0:f.itemChildData,key:(f==null?void 0:f.id)??h,onChange:e.unref(N.onChange),index:(f==null?void 0:f.id)??h,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",yo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((te=e.unref(ge.cloneDeep)(e.unref(N.showItems)))==null?void 0:te.filter(f=>f.comp!=="FormTop"),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",wo,e.toDisplayString(f.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(f.comp)),{itemData:f==null?void 0:f.compData,childItemData:f==null?void 0:f.itemChildData,key:(f==null?void 0:f.id)??h,onChange:e.unref(N.onChange),index:(f==null?void 0:f.id)??h,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",vo,[e.createVNode(P)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[F,e.unref(x)]])}}},Co=_e._export_sfc(bo,[["__scopeId","data-v-d2611062"]]);function xo(g,t,o,a,n,i){const u=e.resolveComponent("svg-icon"),r=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(r,{mode:g.mode,menuList:g.renderMenuList,onClickMenu:g.clickMenu,onOpenMenu:g.openMenu,onCloseMenu:g.closeMenu},{title:e.withCtx(({menu:m})=>[e.createVNode(u,{name:m.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(m.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ko=_e._export_sfc(N._sfc_main,[["render",xo],["__scopeId","data-v-8c86ef59"]]),K=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:""},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],Eo={class:"structure-buttons"},Mo={class:"structure-paths"},Vo={class:"client-header-user"},Po={class:"select-icon"},So={class:"model-select"},To={class:"model-show"},Do={class:"model-fill"},No={class:"client-header-logo"},Bo={class:"client-header-menu"},Ao={class:"client-header-user"},Fo={style:{display:"flex"}},Lo={class:"select-icon"},Ro={class:"client-main-content"},jo={key:0,class:"item-view-group"},Oo={key:0,class:"calculator"},Io={class:"router-aside"},zo=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(g){const t=s.useUnit(se.pinia),o=e.ref(0),a=e.ref(!1),{selectTitle:n}=I.storeToRefs(t),i=e.ref(!1),u=s.useTableComp(se.pinia),{tableShowThree:r}=I.storeToRefs(u),m=et.useLoginState(),{loginUserInfo:c}=I.storeToRefs(m),y=s.useModelComp(se.pinia),{isEdit:w}=I.storeToRefs(y),_=I.useMenuState(se.pinia),b=rt.useFormComp(se.pinia),{objUrl:x,blobUrls:p}=I.storeToRefs(b),l=e.ref(null),v=e.ref(!0),{importLoading:k,activeMenuPath:V,platName:C}=I.storeToRefs(_),E=e.ref(!1);e.watch(()=>V.value,async f=>{f&&(E.value=!0)},{immediate:!0});const d=async f=>{var B,j,H,L,X,$,W;const h=(B=f==null?void 0:f.split("/"))==null?void 0:B[0],S=await I.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:h}});return((j=S==null?void 0:S.data)==null?void 0:j.type)==="success"?((W=($=(X=(L=(H=S==null?void 0:S.data)==null?void 0:H.result)==null?void 0:L[0])==null?void 0:X.value)==null?void 0:$.tableData)==null?void 0:W.隐藏三维显示)!==!0:!0};e.watch(()=>N.showItems.value,()=>{var f,h,S;((f=N.showItems.value)==null?void 0:f.length)===2&&((h=N.showItems.value)!=null&&h.find(B=>(B==null?void 0:B.name)==="输入"))&&((S=N.showItems.value)!=null&&S.find(B=>(B==null?void 0:B.name)==="输出"))?i.value=!0:i.value=!1},{deep:!0,immediate:!0}),e.watch(()=>V.value,async()=>{V.value&&(v.value=await d(V.value))},{deep:!0,immediate:!0}),e.watch(()=>[x.value,l.value],()=>{var f;((f=x.value)==null?void 0:f.length)>0&&l.value&&l.value.addModelsFromUrls(x.value)},{immediate:!0,deep:!0}),e.watch(()=>p==null?void 0:p.value,async()=>{var f,h,S,B;if(p!=null&&p.value&&((f=p==null?void 0:p.value)==null?void 0:f.length)>0&&!((h=N.showItems.value)!=null&&h.find(j=>(j==null?void 0:j.name)==="输入")&&((S=N.showItems.value)!=null&&S.find(j=>(j==null?void 0:j.name)==="输出")))){let j=[];const H=await((B=ge.cloneDeep(p==null?void 0:p.value))==null?void 0:B.map(async L=>{var W;let X;!(L!=null&&L.includes("https://"))&&!(L!=null&&L.includes("http://"))?X=await tt.downloadAvatarApi({url:L}):X=I.axios.get(L,{responseType:"blob",headers:{"Content-Type":"application/json"}});const $={suffix:"."+((W=L==null?void 0:L.split("."))==null?void 0:W[1]),blob:new Blob([X.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:[]};j.push($)}));await Promise.all(H),l.value.loadModelByDefaultPath(j)}},{immediate:!0,deep:!0}),e.watch(()=>r.value,async()=>{var h,S,B,j;if(r.value!==""&&r.value){let H=(h=V.value)==null?void 0:h.split("/"),L=H[(H==null?void 0:H.length)-2];const $=(((S=K==null?void 0:K.find(Y=>(Y==null?void 0:Y.key)===L))==null?void 0:S.download)??"")+"/"+r.value,W=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),re=await I.axios.post($,null,{responseType:"blob",headers:{Authorization:W,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var f=new Blob([re.data],{type:"application/octet-stream;charset=UTF-8"});const ye=[{suffix:"."+((j=(B=r.value)==null?void 0:B.split("."))==null?void 0:j[1]),blob:f,mtlBlobs:[]}];l.value.loadModelByDefaultPath(ye)}},{deep:!0,immediate:!0});const P=async()=>{var X,$,W,re,ye,Y,A,le,he,xe,Be,Ae,Fe,Le,Re,je,Oe;a.value=!0;let f=(X=V.value)==null?void 0:X.split("/"),h=f[(f==null?void 0:f.length)-2];const S=(($=K==null?void 0:K.find(ae=>(ae==null?void 0:ae.key)===h))==null?void 0:$.value)??"";let B="";const j=await I.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((W=j==null?void 0:j.data)==null?void 0:W.code)===200&&(B=`Bearer ${(ye=(re=j.data)==null?void 0:re.result)==null?void 0:ye.accessToken}`,sessionStorage.setItem("magicToken",B));const H=B===""?"123456":B,L=await I.axios.post(S,null,{headers:{Authorization:H,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((Y=L==null?void 0:L.data)==null?void 0:Y.type)==="success"&&s.IsJson((le=(A=L==null?void 0:L.data)==null?void 0:A.result)==null?void 0:le.result)){const ae=(Fe=(Ae=(Be=JSON.parse((xe=(he=L==null?void 0:L.data)==null?void 0:he.result)==null?void 0:xe.result))==null?void 0:Be.lines_file_paths)==null?void 0:Ae[0])==null?void 0:Fe.split("\\"),st=(((Le=K==null?void 0:K.find(J=>(J==null?void 0:J.key)===h))==null?void 0:Le.resources)??"")+"/"+((ae==null?void 0:ae[(ae==null?void 0:ae.length)-2])??"outputResources"),we=await I.axios.post(st,null,{headers:{Authorization:H,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((Re=we==null?void 0:we.data)==null?void 0:Re.type)==="success"){const J=(je=we==null?void 0:we.data)==null?void 0:je.result,at=N.showItems.value,it=await((Oe=ge.cloneDeep(at))==null?void 0:Oe.map(async G=>{var Ie,ze,Ue,$e,He,Ye;if((G==null?void 0:G.name)==="输出"){if((G==null?void 0:G.comp)==="Table")G.compData=(Ie=G==null?void 0:G.compData)==null?void 0:Ie.map(z=>{var U,ie;return(z==null?void 0:z.key)==="tableContents"&&(z.contents=(ie=(U=z==null?void 0:z.contents)==null?void 0:U.map(Q=>(Q=Q==null?void 0:Q.map((q,de)=>{var pe;return typeof q=="string"&&de>1&&(q=((pe=J==null?void 0:J[de-1])!=null&&pe.includes("input")?q:J==null?void 0:J[de-1])??q),q}),Q)))==null?void 0:ie.filter((Q,q)=>q<=(J==null?void 0:J.length)-1)),z});else if((G==null?void 0:G.comp)==="Form"){let z="";if(J==null||J.forEach(U=>{z=z===""?z+U:z+","+U}),G.compData=(ze=G==null?void 0:G.compData)==null?void 0:ze.map(U=>{var ie;return(U==null?void 0:U.key)==="formContent"&&(U.contents=(ie=U.contents)==null?void 0:ie.map(Q=>(Q.value=z,Q))),U}),(Ue=z==null?void 0:z.split(","))!=null&&Ue.find(U=>U.includes(".obj"))){let U={};U.suffix=".obj";const ie=[];let Q=await((He=($e=z==null?void 0:z.split(","))==null?void 0:$e.filter(q=>q.includes(".obj")||q.includes(".mtl")))==null?void 0:He.map(async q=>{var pe,ke;if(q.includes(".obj")){const Ce=(((pe=K==null?void 0:K.find(me=>(me==null?void 0:me.key)===h))==null?void 0:pe.download)??"")+"/"+q,ve=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await I.axios.post(Ce,null,{responseType:"blob",headers:{Authorization:ve,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var de=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});U.blob=de}else if(q.includes(".mtl")){const Ce=(((ke=K==null?void 0:K.find(Pe=>(Pe==null?void 0:Pe.key)===h))==null?void 0:ke.download)??"")+"/"+q,ve=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await I.axios.post(Ce,null,{responseType:"blob",headers:{Authorization:ve,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var de=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});ie.push(de)}}));await Promise.all(Q),U.mtlBlobs=ie,l.value.loadModelByDefaultPath([U])}else{const U=[];let ie=await((Ye=z==null?void 0:z.split(","))==null?void 0:Ye.map(async Q=>{var ve,be;let q={};q.suffix="."+((ve=Q==null?void 0:Q.split("."))==null?void 0:ve[1]);const pe=(((be=K==null?void 0:K.find(me=>(me==null?void 0:me.key)===h))==null?void 0:be.download)??"")+"/"+Q,ke=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ve=await I.axios.post(pe,null,{responseType:"blob",headers:{Authorization:ke,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Ce=new Blob([Ve.data],{type:"application/octet-stream;charset=UTF-8"});q.blob=Ce,U.push(q)}));await Promise.all(ie),l.value.loadModelByDefaultPath(U)}}}return G}));N.showItems.value=await Promise.all(it)}}o.value++,a.value=!1},D=e.ref(""),M=e.ref("open"),F=e.ref("open"),T=e.ref(!1),O=()=>{const f=document.getElementById("menuCollapse");M.value==="open"?(f.style.width="18.75rem",f.style.height="96%",f.style.overflow="auto"):(f.style.width="50px",f.style.height="50px",f.style.overflow="hidden")},ee=()=>{const f=document.getElementById("operateCollapse");F.value==="open"?(f.style.width="25rem",f.style.height="96%",f.style.overflow="auto"):(f.style.width="50px",f.style.height="50px",f.style.overflow="hidden")},te=()=>{T.value=!T.value;const f=document.getElementById("operateCollapse"),h=document.getElementById("menuCollapse");T.value?(h.style.width="18.75rem",f.style.width="calc(100% - 24rem)"):f.style.width="400px"};return(f,h)=>{const S=e.resolveComponent("el-button"),B=e.resolveComponent("el-avatar"),j=e.resolveComponent("el-header"),H=e.resolveComponent("el-container"),L=e.resolveComponent("el-aside"),X=e.resolveComponent("el-collapse-item"),$=e.resolveComponent("el-collapse"),W=e.resolveComponent("el-main"),re=e.resolveComponent("router-view"),ye=e.resolveDirective("loading");return e.unref(w)==="edit"?(e.openBlock(),e.createBlock(H,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(j,{class:"client-structure-header"},{default:e.withCtx(()=>{var Y;return[e.createElementVNode("div",Eo,[e.createVNode(S,{class:"select-icon",onClick:e.unref(N.onBack)},{default:e.withCtx(()=>h[6]||(h[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(S,{class:"select-icon",onClick:h[0]||(h[0]=A=>{var le,he;return e.unref(N.clickSavePage)((he=(le=e.unref(n))==null?void 0:le.map(xe=>xe.value))==null?void 0:he.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(ue.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[h[7]||(h[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",Mo,[(e.openBlock(),e.createBlock(nt,{key:e.unref(n),breadArray:e.unref(n),onClick:e.unref(N.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Vo,[e.createElementVNode("div",Po,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),e.createVNode(B,{size:35,src:(Y=e.unref(c))==null?void 0:Y.avatarUrl},{default:e.withCtx(()=>{var A;return[e.createTextVNode(e.toDisplayString(((A=e.unref(c))==null?void 0:A.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(w)==="edit"?(e.openBlock(),e.createBlock(H,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",So,[e.createVNode(ce.modelSelect)]),e.createElementVNode("div",To,[e.createVNode(ce.modelShow)]),e.createElementVNode("div",Do,[e.createVNode(ce.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(H,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(j,{class:"client-header"},{default:e.withCtx(()=>{var Y;return[e.createElementVNode("div",No,[e.createVNode(ue.SvgIcon,{name:"logo",style:{width:"clamp(18px, 1.5rem, 24px)",height:"clamp(18px, 1.5rem, 24px)","margin-right":"8px"}}),e.createTextVNode(" "+e.toDisplayString(e.unref(C)===""?"CPMPIP":e.unref(C)),1)]),e.createElementVNode("div",Bo,[e.createVNode(ko,{mode:"horizontal"})]),e.createElementVNode("div",Ao,[e.createVNode(qe._sfc_main,{modelValue:D.value,"onUpdate:modelValue":h[1]||(h[1]=A=>D.value=A),style:{width:"130px"}},null,8,["modelValue"]),e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:h[2]||(h[2]=(...A)=>e.unref(N.onSelectFixContent)&&e.unref(N.onSelectFixContent)(...A))},[e.createElementVNode("div",Fo,[e.createVNode(ue.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),h[8]||(h[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Lo,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),e.createVNode(B,{size:35,src:(Y=e.unref(c))==null?void 0:Y.avatarUrl},{default:e.withCtx(()=>{var A;return[e.createTextVNode(e.toDisplayString(((A=e.unref(c))==null?void 0:A.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(H,{class:"client-body"},{default:e.withCtx(()=>[f.$route.path==="/"?(e.openBlock(),e.createBlock(W,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode($,{modelValue:M.value,"onUpdate:modelValue":h[3]||(h[3]=Y=>M.value=Y),accordion:"",class:"client-aside",id:"menuCollapse",onChange:O},{default:e.withCtx(()=>[e.createVNode(X,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(ue.SvgIcon,{name:M.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(L,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",Ro,[e.createVNode(eo,{isShow:E.value,windowConfig:g.windowConfig,ref_key:"threeModelRef",ref:l},null,8,["isShow","windowConfig"])]),e.createVNode($,{modelValue:F.value,"onUpdate:modelValue":h[5]||(h[5]=Y=>F.value=Y),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:ee},{default:e.withCtx(()=>[e.createVNode(X,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(ue.SvgIcon,{name:F.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var Y;return[e.createElementVNode("div",null,[e.createVNode(ue.SvgIcon,{class:"fold-icon",name:T.value?"Right":"Left",onClick:te},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((Y=e.unref(ge.cloneDeep)(e.unref(N.showItems)))==null?void 0:Y.filter(A=>A.comp!=="FormTop"),(A,le)=>{var he;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:le},[((he=A==null?void 0:A.comp)==null?void 0:he.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString(A.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(A.comp)),{compName:A.name,itemData:A==null?void 0:A.compData,childItemData:A==null?void 0:A.itemChildData,key:(A==null?void 0:A.id)??le,onChange:e.unref(N.onChange),index:(A==null?void 0:A.id)??le,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),i.value?(e.openBlock(),e.createElementBlock("div",Oo,[e.createVNode(qe._sfc_main$1,{class:"calculator-content",onClickTrigger:h[4]||(h[4]=A=>P()),loading:a.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(W,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",Io,[e.createVNode(L,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})]),e.createVNode(W,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(re)]),_:1})]),_:1}))]),_:1})]),_:3})),[[ye,e.unref(k)]])}}}),Uo=_e._export_sfc(zo,[["__scopeId","data-v-ad56734e"]]),$o={class:"system-wrap"},Ho={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(g){const t=s.useModelComp(se.pinia),o=s.useUnit(se.pinia),a=I.useMenuState();e.ref(!1);const n=e.ref(!0),i=g;return e.onMounted(()=>{}),e.watch(()=>[i==null?void 0:i.content,i==null?void 0:i.jsonContents],async()=>{var m,c,y,w;if(((m=i==null?void 0:i.jsonContents)==null?void 0:m.length)>0){t.setOriginalData(i==null?void 0:i.jsonContents);return}if(!(i!=null&&i.content)||((c=i==null?void 0:i.content)==null?void 0:c.length)===0)return;n.value=!0,a.setImportLoading(!0);let u=[],r=[];o.setSelectTitle([]),o.setSelectIndex(""),o.setSelectMenu(""),(w=(y=i==null?void 0:i.content)==null?void 0:y.filter(_=>_!==""))==null||w.forEach(_=>{fe.isExpandStringToJson(_)?r.push(fe.expandStringToJson(_)):fe.expandNewStringToJson(_)?r.push(fe.expandNewStringToJson(_)):fe.expandContentStringToJson(_)?r.push(fe.expandContentStringToJson(_)):r.push(N.expandToNewContents(_))}),u=r==null?void 0:r[0],await N.savePageDataAsync(u),await s.loadingSystemType(),t.setOriginalData(u),a.setImportLoading(!1)},{deep:!0,immediate:!0}),(u,r)=>(e.openBlock(),e.createElementBlock("div",$o,[g.platform==="browser"?(e.openBlock(),e.createBlock(Co,{key:0},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Uo,{key:1,windowConfig:g.windowConfig},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Yo=_e._export_sfc(Ho,[["__scopeId","data-v-65a44ad9"]]),qo={class:"add-model-content"},Zo={key:0,class:"model-operate"},Go={class:"model-select"},Ko={class:"model-fill"},Wo={key:1,class:"model-view"},Xo={key:0,class:"model-import-data"},Jo={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(g,{emit:t}){const o=g,a=t,n=e.ref([]),i=e.ref([]),u=e.ref([]),r=e.ref(0),m=s.useModelComp(se.pinia),c=I.useMenuState(se.pinia),{itemData:y,originalData:w}=I.storeToRefs(m),{activeMenuPath:_,platform:b}=I.storeToRefs(c),x=e.ref(null),p=e.ref(0),l=e.ref([]);e.ref("");const v=e.ref(0),k=d=>{a("contentChange",d)},V=d=>{var D;const P=(D=ge.cloneDeep(d==null?void 0:d.wholeValue))==null?void 0:D.map(M=>{var F;return(M==null?void 0:M.comp)==="Form"&&(M.compData=(F=M.compData)==null?void 0:F.map(T=>((T==null?void 0:T.key)==="formContent"&&(T.contents=fe.arrayToNumberArray(T==null?void 0:T.contents)),T))),M});a("change",{originalContents:w.value,currentContents:d==null?void 0:d.wholeValue,editContent:d==null?void 0:d.editValue,arrayToContents:P})};e.watch(()=>i.value,()=>{v.value===i.value.length&&i.value.length!==0&&(n.value=i.value)},{deep:!0,immediate:!0});const C=()=>{x.value.click()},E=async d=>{const P=d.target.files;if(!P)return;new FileReader,n.value=[],i.value=[],v.value=P.length;const D=Array.from(P).map(async M=>await new Promise(F=>{const T=new FileReader;T.onload=O=>{try{i.value.push(O.target.result),p.value++}catch(ee){console.error("解析失败:",ee);return}},T.onerror=()=>F(`读取 ${M.name} 失败`),T.readAsText(M),d.target.value="",x.value=null}));await Promise.all(D)};return e.watch(()=>[o==null?void 0:o.content,o==null?void 0:o.jsonContents],async()=>{await s.loadingSystemType(),n.value=o.content,u.value=o==null?void 0:o.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>p.value,()=>{var d;((d=l.value)==null?void 0:d.length)!==0&&(m.setOriginalData(l.value),m.setItemData(l.value))},{deep:!0,immediate:!0}),(d,P)=>{const D=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",qo,[(o==null?void 0:o.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Zo,[e.createElementVNode("div",Go,[e.createVNode(ce.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:r.value},[e.createVNode(ce.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(ce.modelFill)])])):e.createCommentVNode("",!0),(o==null?void 0:o.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[(e.openBlock(),e.createBlock(Yo,{platform:e.unref(b),content:n.value,onChange:V,jsonContents:u.value,onContentChange:k,key:r.value},{default:e.withCtx(()=>{var M;return[((M=o==null?void 0:o.jsonContents)==null?void 0:M.length)===0&&(o!=null&&o.showButton)?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",{class:"import-button",onClick:C},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:x,accept:".txt, .inm",onChange:E,style:{display:"none"},multiple:""},null,544),e.createVNode(D,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),P[0]||(P[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Qo=_e._export_sfc(Jo,[["__scopeId","data-v-4bf164f6"]]);exports.default=Qo;
|
|
6
|
+
`);let n={};const i=/\s+/,u={};for(let m=0;m<a.length;m++){let c=a[m];if(c=c.trim(),c.length===0||c.charAt(0)==="#")continue;const y=c.indexOf(" ");let w=y>=0?c.substring(0,y):c;w=w.toLowerCase();let _=y>=0?c.substring(y+1):"";if(_=_.trim(),w==="newmtl")n={name:_},u[_]=n;else if(w==="ka"||w==="kd"||w==="ks"||w==="ke"){const b=_.split(i,3);n[w]=[parseFloat(b[0]),parseFloat(b[1]),parseFloat(b[2])]}else n[w]=_}const r=new Nt(this.resourcePath||o,this.materialOptions);return r.setCrossOrigin(this.crossOrigin),r.setManager(this.manager),r.setMaterials(u),r}}class Nt{constructor(t="",o={}){this.baseUrl=t,this.options=o,this.materialsInfo={},this.materials={},this.materialsArray=[],this.nameLookup={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:s.FrontSide,this.wrap=this.options.wrap!==void 0?this.options.wrap:s.RepeatWrapping}setCrossOrigin(t){return this.crossOrigin=t,this}setManager(t){this.manager=t}setMaterials(t){this.materialsInfo=this.convert(t),this.materials={},this.materialsArray=[],this.nameLookup={}}convert(t){if(!this.options)return t;const o={};for(const a in t){const n=t[a],i={};o[a]=i;for(const u in n){let r=!0,m=n[u];const c=u.toLowerCase();switch(c){case"kd":case"ka":case"ks":this.options&&this.options.normalizeRGB&&(m=[m[0]/255,m[1]/255,m[2]/255]),this.options&&this.options.ignoreZeroRGBs&&m[0]===0&&m[1]===0&&m[2]===0&&(r=!1);break}r&&(i[c]=m)}}return o}preload(){for(const t in this.materialsInfo)this.create(t)}getIndex(t){return this.nameLookup[t]}getAsArray(){let t=0;for(const o in this.materialsInfo)this.materialsArray[t]=this.create(o),this.nameLookup[o]=t,t++;return this.materialsArray}create(t){return this.materials[t]===void 0&&this.createMaterial_(t),this.materials[t]}createMaterial_(t){const o=this,a=this.materialsInfo[t],n={name:t,side:this.side};function i(r,m){return typeof m!="string"||m===""?"":/^https?:\/\//i.test(m)?m:r+m}function u(r,m){if(n[r])return;const c=o.getTextureParams(m,n),y=o.loadTexture(i(o.baseUrl,c.url));y.repeat.copy(c.scale),y.offset.copy(c.offset),y.wrapS=o.wrap,y.wrapT=o.wrap,(r==="map"||r==="emissiveMap")&&(y.colorSpace=s.SRGBColorSpace),n[r]=y}for(const r in a){const m=a[r];let c;if(m!=="")switch(r.toLowerCase()){case"kd":n.color=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"ks":n.specular=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"ke":n.emissive=s.ColorManagement.colorSpaceToWorking(new s.Color().fromArray(m),s.SRGBColorSpace);break;case"map_kd":u("map",m);break;case"map_ks":u("specularMap",m);break;case"map_ke":u("emissiveMap",m);break;case"norm":u("normalMap",m);break;case"map_bump":case"bump":u("bumpMap",m);break;case"disp":u("displacementMap",m);break;case"map_d":u("alphaMap",m),n.transparent=!0;break;case"ns":n.shininess=parseFloat(m);break;case"d":c=parseFloat(m),c<1&&(n.opacity=c,n.transparent=!0);break;case"tr":c=parseFloat(m),this.options&&this.options.invertTrProperty&&(c=1-c),c>0&&(n.opacity=1-c,n.transparent=!0);break}}return this.materials[t]=new s.MeshPhongMaterial(n),this.materials[t]}getTextureParams(t,o){const a={scale:new s.Vector2(1,1),offset:new s.Vector2(0,0)},n=t.split(/\s+/);let i;return i=n.indexOf("-bm"),i>=0&&(o.bumpScale=parseFloat(n[i+1]),n.splice(i,2)),i=n.indexOf("-mm"),i>=0&&(o.displacementBias=parseFloat(n[i+1]),o.displacementScale=parseFloat(n[i+2]),n.splice(i,3)),i=n.indexOf("-s"),i>=0&&(a.scale.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),i=n.indexOf("-o"),i>=0&&(a.offset.set(parseFloat(n[i+1]),parseFloat(n[i+2])),n.splice(i,4)),a.url=n.join(" ").trim(),a}loadTexture(t,o,a,n,i){const u=this.manager!==void 0?this.manager:s.DefaultLoadingManager;let r=u.getHandler(t);r===null&&(r=new s.TextureLoader(u)),r.setCrossOrigin&&r.setCrossOrigin(this.crossOrigin);const m=r.load(t,a,n,i);return o!==void 0&&(m.mapping=o),m}}class Bt extends s.Loader{constructor(t){super(t)}load(t,o,a,n){const i=this,u=new s.FileLoader(this.manager);u.setPath(this.path),u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(t,function(r){try{o(i.parse(r))}catch(m){n?n(m):console.error(m),i.manager.itemError(t)}},a,n)}parse(t){function o(c){const y=new DataView(c),w=32/8*3+32/8*3*3+16/8,_=y.getUint32(80,!0);if(80+32/8+_*w===y.byteLength)return!0;const x=[115,111,108,105,100];for(let p=0;p<5;p++)if(a(x,y,p))return!1;return!0}function a(c,y,w){for(let _=0,b=c.length;_<b;_++)if(c[_]!==y.getUint8(w+_))return!1;return!0}function n(c){const y=new DataView(c),w=y.getUint32(80,!0);let _,b,x,p=!1,l,v,k,V,C;for(let T=0;T<70;T++)y.getUint32(T,!1)==1129270351&&y.getUint8(T+4)==82&&y.getUint8(T+5)==61&&(p=!0,l=new Float32Array(w*3*3),v=y.getUint8(T+6)/255,k=y.getUint8(T+7)/255,V=y.getUint8(T+8)/255,C=y.getUint8(T+9)/255);const E=84,d=12*4+2,P=new s.BufferGeometry,D=new Float32Array(w*3*3),M=new Float32Array(w*3*3),F=new s.Color;for(let T=0;T<w;T++){const O=E+T*d,ee=y.getFloat32(O,!0),te=y.getFloat32(O+4,!0),f=y.getFloat32(O+8,!0);if(p){const h=y.getUint16(O+48,!0);(h&32768)===0?(_=(h&31)/31,b=(h>>5&31)/31,x=(h>>10&31)/31):(_=v,b=k,x=V)}for(let h=1;h<=3;h++){const S=O+h*12,B=T*3*3+(h-1)*3;D[B]=y.getFloat32(S,!0),D[B+1]=y.getFloat32(S+4,!0),D[B+2]=y.getFloat32(S+8,!0),M[B]=ee,M[B+1]=te,M[B+2]=f,p&&(F.setRGB(_,b,x,s.SRGBColorSpace),l[B]=F.r,l[B+1]=F.g,l[B+2]=F.b)}}return P.setAttribute("position",new s.BufferAttribute(D,3)),P.setAttribute("normal",new s.BufferAttribute(M,3)),p&&(P.setAttribute("color",new s.BufferAttribute(l,3)),P.hasColors=!0,P.alpha=C),P}function i(c){const y=new s.BufferGeometry,w=/solid([\s\S]*?)endsolid/g,_=/facet([\s\S]*?)endfacet/g,b=/solid\s(.+)/;let x=0;const p=/[\s]+([+-]?(?:\d*)(?:\.\d*)?(?:[eE][+-]?\d+)?)/.source,l=new RegExp("vertex"+p+p+p,"g"),v=new RegExp("normal"+p+p+p,"g"),k=[],V=[],C=[],E=new s.Vector3;let d,P=0,D=0,M=0;for(;(d=w.exec(c))!==null;){D=M;const F=d[0],T=(d=b.exec(F))!==null?d[1]:"";for(C.push(T);(d=_.exec(F))!==null;){let te=0,f=0;const h=d[0];for(;(d=v.exec(h))!==null;)E.x=parseFloat(d[1]),E.y=parseFloat(d[2]),E.z=parseFloat(d[3]),f++;for(;(d=l.exec(h))!==null;)k.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),V.push(E.x,E.y,E.z),te++,M++;f!==1&&console.error("THREE.STLLoader: Something isn't right with the normal of face number "+x),te!==3&&console.error("THREE.STLLoader: Something isn't right with the vertices of face number "+x),x++}const O=D,ee=M-D;y.userData.groupNames=C,y.addGroup(O,ee,P),P++}return y.setAttribute("position",new s.Float32BufferAttribute(k,3)),y.setAttribute("normal",new s.Float32BufferAttribute(V,3)),y}function u(c){return typeof c!="string"?new TextDecoder().decode(c):c}function r(c){if(typeof c=="string"){const y=new Uint8Array(c.length);for(let w=0;w<c.length;w++)y[w]=c.charCodeAt(w)&255;return y.buffer||y}else return c}const m=r(t);return o(m)?n(m):i(u(t))}}function At(g,t,o,a,n){const i=async _=>{try{const b=await tt.downloadAvatarApi({url:_});if(b.status!==200)throw new Error(`下载失败: ${b.status}`);return b.data}catch(b){throw console.error("addModelFromUrl失败:",b),b}},u=_=>new Promise((b,x)=>{const p=new FileReader;p.onload=l=>{try{const v=l.target.result,V=new Dt().parse(v);V.preload(),b(V)}catch(v){x(v)}},p.onerror=()=>{x(new Error("MTL文件读取失败"))},p.readAsText(_)}),r=async _=>{const b={materials:{},create:function(x){return this.materials[x]?this.materials[x]:(console.warn(`Material '${x}' not found, using default material`),new s.MeshPhongMaterial({color:8947848,side:s.DoubleSide}))},getAsArray:function(){const x=[];for(const p in this.materials)x.push(this.materials[p]);return x},preload:function(){for(const x in this.materials)this.materials[x].map&&(this.materials[x].map.needsUpdate=!0)}};for(const x of _){const p=await u(x);Object.assign(b.materials,p.materials)}return b.preload(),b},m=async(_,b=[])=>new Promise((x,p)=>{const l=new FileReader;l.onload=async v=>{try{const k=v.target.result;let V=null;b&&b.length>0&&(b.length===1?V=await u(b[0]):V=await r(b));const C=new Qe;V&&C.setMaterials(V);const E=C.parse(k);V||E.traverse(d=>{d.isMesh&&(d.material=new s.MeshPhongMaterial({color:8947848,side:s.DoubleSide}))}),x(E)}catch(k){p(k)}},l.onerror=()=>{p(new Error("OBJ文件读取失败"))},l.readAsText(_)}),c=async _=>{var b;try{o.value=!0;const{scene:x}=g();if(!x)throw new Error("Scene not initialized");n();const p=[];for(let l=0;l<_.length;l++){const v=_[l];a.value=`正在加载模型 ${l+1}/${_.length}...`;const k=await i(v.objUrl),V=((b=v.objUrl)==null?void 0:b.split("/").pop())||`model_${l}.obj`,C=new File([k],V,{type:k.type});let E=[];if(v.mtlUrls){const P=Array.isArray(v.mtlUrls)?v.mtlUrls:[v.mtlUrls];for(let D=0;D<P.length;D++){const M=P[D],F=await i(M),T=(M==null?void 0:M.split("/").pop())||`material_${l}_${D}.mtl`,O=new File([F],T,{type:F.type});E.push(O)}}const d=await m(C,E);x.add(d),t.value.push(d),p.push(d)}return o.value=!1,p}catch(x){throw console.error("加载模型失败:",x),o.value=!1,x}},y=async(_,b)=>{const x=await b.text();let p;switch(_){case".txt":case".cpt":const l=/^(?!.*\bf\b)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?(-?\d*\.?\d+)[^\n]*?$/gm,k=[...x.matchAll(l)].map(M=>({x:parseFloat(M[1]),y:parseFloat(M[2]),z:parseFloat(M[3])})),V=new s.BufferGeometry,C=k.flatMap(M=>[M.x,M.y,M.z]);if(V.setAttribute("position",new s.Float32BufferAttribute(C,3)),_===".txt"){const M=new s.PointsMaterial({color:"#5B5C99",size:1,sizeAttenuation:!1});p=new s.Points(V,M)}else if(_===".cpt"){const M=new s.LineBasicMaterial({color:"#5B5C99",linewidth:100});p=new s.Line(V,M)}break;case".obj":p=new Qe().parse(x),p.traverse(M=>{M.isMesh&&(M.material=new s.MeshPhongMaterial({color:"#5B5C99"})),M instanceof s.Mesh&&(M.material.side=s.DoubleSide)});break;case".stl":const P=new Bt().parse(x),D=new s.MeshPhongMaterial({color:"#5B5C99",side:s.DoubleSide});p=new s.Mesh(P,D);break;default:throw new Error(`不支持的文件格式: ${_}`)}return p};return{addModelsFromUrls:c,loadModelByDefaultPath:async _=>{console.log(_);try{o.value=!0,a.value="正在加载模型...";const{scene:b}=g();if(!b)throw new Error("Scene not initialized");n(),await new Promise(p=>setTimeout(p,100));const x=[];for(let p=0;p<_.length;p++){const l=_[p],v=await y(l.suffix,l.blob);b.add(v),t.value.push(v),x.push(v)}return o.value=!1,a.value="",x}catch(b){throw console.error("加载模型失败:",b),o.value=!1,a.value="",b}}}}const Ft={class:"obj-viewer-container"},Lt={class:"floating-controls"},Rt=["disabled"],jt=["disabled","title"],Ot={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},It={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},zt=["disabled"],Ut=["title"],$t={key:0,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ht={key:1,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Yt={key:0,class:"clipping-panel"},qt={class:"panel-content"},Zt={class:"radio-group"},Gt={class:"radio-label"},Kt={class:"radio-label"},Wt={class:"radio-label"},Xt={class:"radio-label"},Jt={key:1,class:"loading-overlay"},Qt={__name:"threeModel",setup(g,{expose:t}){const o=e.ref(null),a=e.ref(!1),n=e.ref(""),i=e.ref(!1),u=e.ref(!1),{currentModels:r,initialCameraPosition:m,initialTargetPosition:c,initThreeJS:y,handleResize:w,fitCameraToAllModels:_,getThreeJSObjects:b,clearAllModels:x,cleanup:p}=xt(o),{isAnimating:l,toggleAnimation:v,stopAnimation:k}=kt(b,r),{isClipping:V,activeClippingAxis:C,toggleClipping:E,updateClippingPlanes:d}=Et(b,r),{addModelsFromUrls:P,loadModelByDefaultPath:D}=At(b,r,a,n,x),M=()=>{if(u.value||r.value.length===0)return;u.value=!0,l.value&&k();const{camera:f,controls:h}=b();if(!f||!h)return;h.enabled=!0;const S=U=>U<.5?4*U*U*U:1-Math.pow(-2*U+2,3)/2,B=f.position.clone(),j=h.target.clone(),Y=1500,L=Date.now(),W=()=>{const U=Date.now()-L,X=Math.min(U/Y,1),ne=S(X);f.position.lerpVectors(B,m.value,ne),h.target.lerpVectors(j,c.value,ne),X<1?requestAnimationFrame(W):u.value=!1};W()},F=()=>{document.fullscreenElement?document.exitFullscreen().then(()=>{i.value=!1,e.nextTick(()=>{w()})}).catch(f=>{console.error("无法退出全屏:",f)}):o.value.requestFullscreen().then(()=>{i.value=!0,e.nextTick(()=>{w()})}).catch(f=>{console.error("无法进入全屏:",f)})},T=()=>{i.value=!!document.fullscreenElement,i.value||e.nextTick(()=>{w()})},O=async(f,h)=>{try{l.value&&k(),V.value&&E();const S=await h(f);return _(),S}catch(S){throw console.error("加载模型失败:",S),S}},ee=async f=>O(f,P),te=async f=>O(f,D);return e.onMounted(async()=>{await e.nextTick(),y(),window.addEventListener("resize",w),document.addEventListener("fullscreenchange",T)}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",w),document.removeEventListener("fullscreenchange",T),l.value&&k(),p()}),t({addModelsFromUrls:ee,loadModelByDefaultPath:te}),(f,h)=>(e.openBlock(),e.createElementBlock("div",Ft,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:o,class:"threejs-container"},null,512),e.createElementVNode("div",Lt,[e.createElementVNode("button",{onClick:M,class:e.normalizeClass(["control-btn","reset-btn"]),disabled:a.value||e.unref(r).length===0||u.value,title:"重置"},h[10]||(h[10]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("path",{d:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),e.createElementVNode("polyline",{points:"9,22 9,12 15,12 15,22"})],-1)]),8,Rt),e.createElementVNode("button",{onClick:h[0]||(h[0]=(...S)=>e.unref(v)&&e.unref(v)(...S)),class:e.normalizeClass(["control-btn","animation-btn",{active:e.unref(l)}]),disabled:a.value||e.unref(r).length===0,title:e.unref(l)?"停止动画":"动画视图"},[e.unref(l)?(e.openBlock(),e.createElementBlock("svg",It,h[12]||(h[12]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("rect",{x:"9.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1),e.createElementVNode("rect",{x:"12.5",y:"8",width:"2",height:"8",fill:"currentColor"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",Ot,h[11]||(h[11]=[e.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),e.createElementVNode("polygon",{points:"10,8 16,12 10,16",fill:"currentColor"},null,-1)])))],10,jt),e.createElementVNode("button",{onClick:h[1]||(h[1]=(...S)=>e.unref(E)&&e.unref(E)(...S)),class:e.normalizeClass(["control-btn","clipping-btn",{active:e.unref(V)}]),disabled:a.value||e.unref(r).length===0,title:"剖面视图"},h[13]||(h[13]=[e.createElementVNode("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[e.createElementVNode("rect",{x:"3",y:"3",width:"18",height:"18"}),e.createElementVNode("line",{x1:"-14",y1:"12",x2:"30",y2:"12","stroke-dasharray":"4,2"})],-1)]),10,zt),e.createElementVNode("button",{onClick:F,class:e.normalizeClass(["control-btn","fullscreen-btn"]),title:i.value?"退出全屏":"全屏"},[i.value?(e.openBlock(),e.createElementBlock("svg",Ht,h[15]||(h[15]=[e.createElementVNode("path",{d:"M8 3v3a2 2 0 0 1-2 2H3m18 0h-3a2 2 0 0 1-2-2V3m0 18v-3a2 2 0 0 1 2-2h3M3 16h3a2 2 0 0 1 2 2v3"},null,-1)]))):(e.openBlock(),e.createElementBlock("svg",$t,h[14]||(h[14]=[e.createElementVNode("path",{d:"M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"},null,-1)])))],8,Ut)]),e.unref(V)?(e.openBlock(),e.createElementBlock("div",Yt,[e.createElementVNode("div",qt,[e.createElementVNode("div",Zt,[e.createElementVNode("label",Gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[2]||(h[2]=S=>e.isRef(C)?C.value=S:null),onChange:h[3]||(h[3]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[16]||(h[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":h[4]||(h[4]=S=>e.isRef(C)?C.value=S:null),onChange:h[5]||(h[5]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[17]||(h[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":h[6]||(h[6]=S=>e.isRef(C)?C.value=S:null),onChange:h[7]||(h[7]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[18]||(h[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Xt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":h[8]||(h[8]=S=>e.isRef(C)?C.value=S:null),onChange:h[9]||(h[9]=(...S)=>e.unref(d)&&e.unref(d)(...S))},null,544),[[e.vModelRadio,e.unref(C)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])])):e.createCommentVNode("",!0),a.value?(e.openBlock(),e.createElementBlock("div",Jt,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(n.value),1)])):e.createCommentVNode("",!0)]))}},eo=ye._export_sfc(Qt,[["__scopeId","data-v-f00cdda1"]]),to={class:"bread-content"},oo=["onClick"],no={key:0,class:"split-title"},so={__name:"index",props:{breadArray:{type:Array,default:()=>[]}},emits:["click"],setup(g,{emit:t}){const o=g,a=e.ref([]),n=t;e.onMounted(()=>{a.value=o==null?void 0:o.breadArray}),e.watch(()=>o==null?void 0:o.breadArray,()=>{a.value=o==null?void 0:o.breadArray},{deep:!0,immediate:!0});const i=u=>{n("click",u)};return(u,r)=>(e.openBlock(),e.createElementBlock("div",to,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,(m,c)=>{var y;return e.openBlock(),e.createElementBlock("div",{key:c,class:"bread-item"},[e.createElementVNode("div",{class:"bread-title",onClick:w=>i(m),style:e.normalizeStyle({opacity:((y=a.value)==null?void 0:y.length)-1===c?"0.7":"1"})},e.toDisplayString(m.value),13,oo),c!==a.value.length-1&&Array.isArray(a.value)?(e.openBlock(),e.createElementBlock("div",no,e.toDisplayString("/"))):e.createCommentVNode("",!0)])}),128))]))}},nt=ye._export_sfc(so,[["__scopeId","data-v-ded7e2bd"]]),ao={class:"item-menu-content"},io={class:"item-left-content"},ro={key:0,class:"page-icon"},lo={class:"avatar"},co={style:{display:"flex"}},ho={class:"select-icon"},uo={key:0,class:"model-operate",style:{width:"0px"}},po={class:"model-select"},mo={class:"model-fill"},fo={key:1,class:"show-main-content"},go={class:"show-content"},_o={class:"item-view-group"},yo={class:"show-item-content"},wo={class:"item-view-group"},vo={key:2,class:"show-main-content"},bo={__name:"browser",props:{content:String,jsonContents:Array},emits:["change","contentChange"],setup(g,{emit:t}){const o=et.useLoginState(),{loginUserInfo:a,cryptoInfo:n}=I.storeToRefs(o);e.onMounted(()=>{lt.ElNotification({title:"温馨提示:",type:"success",message:"欢迎使用系统",duration:1e3})});const i=s.useModelComp(ae.pinia);s.useFormToTableComp(ae.pinia),e.ref(!0);const u=I.useMenuState();e.ref(!0);const{itemData:r,isEdit:m,isRefreshCurStructure:c,curStructureCompIds:y}=I.storeToRefs(i),w=s.useUnit(ae.pinia),{activeMenuPath:_,menus:b,importLoading:x}=I.storeToRefs(u),{selectIndex:p,selectTitle:l}=I.storeToRefs(w);return e.ref([]),e.ref(!1),(v,k)=>{const V=e.resolveComponent("el-aside"),C=e.resolveComponent("el-button"),E=e.resolveComponent("el-avatar"),d=e.resolveComponent("el-header"),P=e.resolveComponent("router-view"),D=e.resolveComponent("el-main"),M=e.resolveComponent("el-container"),F=e.resolveDirective("loading");return e.withDirectives((e.openBlock(),e.createBlock(M,{"element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.unref(m)==="view"?(e.openBlock(),e.createBlock(V,{key:0,width:"250px"},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})):e.createCommentVNode("",!0),e.createVNode(M,null,{default:e.withCtx(()=>[e.createVNode(d,null,{default:e.withCtx(()=>{var T;return[e.createElementVNode("div",ao,[e.createElementVNode("div",io,[e.unref(m)==="edit"?(e.openBlock(),e.createElementBlock("div",ro,[e.createVNode(C,{text:"",onClick:e.unref(N.onBack)},{default:e.withCtx(()=>k[2]||(k[2]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[2]},8,["onClick"]),e.createVNode(C,{text:"",onClick:k[0]||(k[0]=O=>{var ee,te;return e.unref(N.clickSavePage)((te=(ee=e.unref(l))==null?void 0:ee.map(f=>f.value))==null?void 0:te.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(pe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[k[3]||(k[3]=e.createTextVNode(" 保存页面 "))]),_:1,__:[3]})])):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(nt,{key:e.unref(l),breadArray:e.unref(l),onClick:e.unref(N.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",lo,[e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:k[1]||(k[1]=(...O)=>e.unref(N.onSelectFixContent)&&e.unref(N.onSelectFixContent)(...O))},[e.createElementVNode("div",co,[e.createVNode(pe.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),k[4]||(k[4]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",ho,[e.renderSlot(v.$slots,"default",{},void 0,!0)]),e.createVNode(E,{size:35,src:(T=e.unref(a))==null?void 0:T.avatarUrl},{default:e.withCtx(()=>{var O;return[e.createTextVNode(e.toDisplayString(((O=e.unref(a))==null?void 0:O.account)??"未知"),1)]}),_:1},8,["src"])])])]}),_:3}),e.createVNode(D,null,{default:e.withCtx(()=>{var T,O,ee,te;return[e.unref(m)==="edit"?(e.openBlock(),e.createElementBlock("div",uo,[e.createElementVNode("div",po,[e.createVNode(he.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:v.innerWidth},[e.createVNode(he.modelShow)])),e.createElementVNode("div",mo,[e.createVNode(he.modelFill)])])):v.$route.path==="/"&&((T=e.unref(N.showItems))==null?void 0:T.length)>0&&e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",fo,[e.createElementVNode("div",go,[(O=e.unref(_e.cloneDeep)(e.unref(N.showItems)))!=null&&O.find(f=>f.comp==="FormTop")?(e.openBlock(),e.createElementBlock("div",{class:"show-header",key:v.index},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((ee=e.unref(_e.cloneDeep)(e.unref(N.showItems)))==null?void 0:ee.filter(f=>f.comp==="FormTop"),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",_o,e.toDisplayString(f.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(f.comp)),{itemData:f==null?void 0:f.compData,childItemData:f==null?void 0:f.itemChildData,key:(f==null?void 0:f.id)??h,onChange:e.unref(N.onChange),index:(f==null?void 0:f.id)??h,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",yo,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList((te=e.unref(_e.cloneDeep)(e.unref(N.showItems)))==null?void 0:te.filter(f=>f.comp!=="FormTop"),(f,h)=>(e.openBlock(),e.createElementBlock("div",{class:"item-content",key:h},[e.createElementVNode("div",wo,e.toDisplayString(f.name),1),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(f.comp)),{itemData:f==null?void 0:f.compData,childItemData:f==null?void 0:f.itemChildData,key:(f==null?void 0:f.id)??h,onChange:e.unref(N.onChange),index:(f==null?void 0:f.id)??h,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["itemData","childItemData","onChange","index","onContentChange","onPageChange"]))]))),128))])])])):e.unref(m)==="view"?(e.openBlock(),e.createElementBlock("div",vo,[e.createVNode(P)])):e.createCommentVNode("",!0)]}),_:1})]),_:3})]),_:3})),[[F,e.unref(x)]])}}},Co=ye._export_sfc(bo,[["__scopeId","data-v-d2611062"]]);function xo(g,t,o,a,n,i){const u=e.resolveComponent("svg-icon"),r=e.resolveComponent("ssMenu");return e.openBlock(),e.createBlock(r,{mode:g.mode,menuList:g.renderMenuList,onClickMenu:g.clickMenu,onOpenMenu:g.openMenu,onCloseMenu:g.closeMenu},{title:e.withCtx(({menu:m})=>[e.createVNode(u,{name:m.icon??"Fold",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(m.title??""),1)]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"])}const ko=ye._export_sfc(N._sfc_main,[["render",xo],["__scopeId","data-v-8c86ef59"]]),K=[{key:"FitCurve_Eleven",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35326658522693",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35326658522693",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35326658522693/outputResources"},{key:"MakeShape",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018179530309",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018179530309",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018179530309/outputResources"},{key:"FillEmpty",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35018289382469",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35018289382469",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35018289382469/outputResources"},{key:"ToolPathFakeFast",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35484063607109",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35484063607109",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35484063607109/outputResources"},{key:"FiveAxisCalculator",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35237389477957",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35237389477957",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35237389477957/outputResources"},{key:"DetectionAlgorithm",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35459977498949",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35459977498949",download:""},{key:"FeatureSelectionAlgorithm_FFS",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35277984187973",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35277984187973",download:"http://139.196.154.85:20024/api/algorithmRun/downloadFileByFileName/35277984187973/outputResources"},{key:"AIParameterOptimization",value:"http://139.196.154.85:20024/api/algorithmRun/verificationAlgorithm/35788169784389",resources:"http://139.196.154.85:20024/api/algorithmRun/allFilesByFolderName/35788169784389"}],Eo={class:"structure-buttons"},Mo={class:"structure-paths"},Vo={class:"client-header-user"},Po={class:"select-icon"},So={class:"model-select"},To={class:"model-show"},Do={class:"model-fill"},No={class:"client-header-logo"},Bo={class:"client-header-menu"},Ao={class:"client-header-user"},Fo={style:{display:"flex"}},Lo={class:"select-icon"},Ro={class:"client-main-content"},jo={key:0,class:"item-view-group"},Oo={key:0,class:"calculator"},Io={class:"router-aside"},zo=e.defineComponent({__name:"client",props:{windowConfig:{type:Object,default:()=>{}}},setup(g){const t=s.useUnit(ae.pinia),o=e.ref(0),a=e.ref(!1),{selectTitle:n}=I.storeToRefs(t),i=e.ref(!1),u=s.useTableComp(ae.pinia),{tableShowThree:r}=I.storeToRefs(u),m=et.useLoginState(),{loginUserInfo:c}=I.storeToRefs(m),y=s.useModelComp(ae.pinia),{isEdit:w}=I.storeToRefs(y),_=I.useMenuState(ae.pinia),b=rt.useFormComp(ae.pinia),{objUrl:x,blobUrls:p}=I.storeToRefs(b),l=e.ref(null),v=e.ref(!0),{importLoading:k,activeMenuPath:V,platName:C}=I.storeToRefs(_),E=e.ref(!1);e.watch(()=>V.value,async f=>{f&&(E.value=!0)},{immediate:!0});const d=async f=>{var B,j,Y,L,W,U,X;const h=(B=f==null?void 0:f.split("/"))==null?void 0:B[0],S=await I.getInsofDataApi({key:{type:"mainEquip",systemKey:sessionStorage.getItem("systemKey"),pageKey:h}});return((j=S==null?void 0:S.data)==null?void 0:j.type)==="success"?((X=(U=(W=(L=(Y=S==null?void 0:S.data)==null?void 0:Y.result)==null?void 0:L[0])==null?void 0:W.value)==null?void 0:U.tableData)==null?void 0:X.隐藏三维显示)!==!0:!0};e.watch(()=>N.showItems.value,()=>{var f,h,S;((f=N.showItems.value)==null?void 0:f.length)===2&&((h=N.showItems.value)!=null&&h.find(B=>(B==null?void 0:B.name)==="输入"))&&((S=N.showItems.value)!=null&&S.find(B=>(B==null?void 0:B.name)==="输出"))?i.value=!0:i.value=!1},{deep:!0,immediate:!0}),e.watch(()=>V.value,async()=>{V.value&&(v.value=await d(V.value))},{deep:!0,immediate:!0}),e.watch(()=>[x.value,l.value],()=>{var f;((f=x.value)==null?void 0:f.length)>0&&l.value&&l.value.addModelsFromUrls(x.value)},{immediate:!0,deep:!0}),e.watch(()=>p==null?void 0:p.value,async()=>{var f,h,S,B;if(p!=null&&p.value&&((f=p==null?void 0:p.value)==null?void 0:f.length)>0&&!((h=N.showItems.value)!=null&&h.find(j=>(j==null?void 0:j.name)==="输入")&&((S=N.showItems.value)!=null&&S.find(j=>(j==null?void 0:j.name)==="输出")))){let j=[];const Y=await((B=_e.cloneDeep(p==null?void 0:p.value))==null?void 0:B.map(async L=>{var X,ne,le,$;let W,U;!(L!=null&&L.includes("https://"))&&!(L!=null&&L.includes("http://"))?(W=await tt.downloadAvatarApi({url:L}),U={suffix:"."+((X=L==null?void 0:L.split("."))==null?void 0:X[1]),blob:new Blob([W.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:[]}):(W=await I.axios.get(L,{responseType:"blob",headers:{"Content-Type":"application/json"}}),U={suffix:"."+(($=(le=(ne=L==null?void 0:L.split("http://139.196.154.85:20026"))==null?void 0:ne[1])==null?void 0:le.split("."))==null?void 0:$[1]),blob:new Blob([W.data],{type:"application/octet-stream;charset=UTF-8"}),mtlBlobs:[]}),j.push(U)}));await Promise.all(Y),l.value.loadModelByDefaultPath(j)}},{immediate:!0,deep:!0}),e.watch(()=>r.value,async()=>{var h,S,B,j;if(r.value!==""&&r.value){let Y=(h=V.value)==null?void 0:h.split("/"),L=Y[(Y==null?void 0:Y.length)-2];const U=(((S=K==null?void 0:K.find($=>($==null?void 0:$.key)===L))==null?void 0:S.download)??"")+"/"+r.value,X=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),ne=await I.axios.post(U,null,{responseType:"blob",headers:{Authorization:X,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var f=new Blob([ne.data],{type:"application/octet-stream;charset=UTF-8"});const le=[{suffix:"."+((j=(B=r.value)==null?void 0:B.split("."))==null?void 0:j[1]),blob:f,mtlBlobs:[]}];l.value.loadModelByDefaultPath(le)}},{deep:!0,immediate:!0});const P=async()=>{var W,U,X,ne,le,$,A,ce,de,xe,Be,Ae,Fe,Le,Re,je,Oe;a.value=!0;let f=(W=V.value)==null?void 0:W.split("/"),h=f[(f==null?void 0:f.length)-2];const S=((U=K==null?void 0:K.find(ie=>(ie==null?void 0:ie.key)===h))==null?void 0:U.value)??"";let B="";const j=await I.axios.post("http://139.196.154.85:20024/api/sysAuth/login",{account:"superadmin",password:"9bf00809059adc7f57bd290bf73ddf4d16f4c83b5937e2d68144ab0bd60d045d22d70afeed8f2fa071cda536e1fac0daf12b8e63dd870c3ca8b308f23be6e693bb32ebd3d013116dc8338d6854b1332701a522a7c43706a6db4162fbe991c8c08aa842fbbc34",codeId:0,code:""});((X=j==null?void 0:j.data)==null?void 0:X.code)===200&&(B=`Bearer ${(le=(ne=j.data)==null?void 0:ne.result)==null?void 0:le.accessToken}`,sessionStorage.setItem("magicToken",B));const Y=B===""?"123456":B,L=await I.axios.post(S,null,{headers:{Authorization:Y,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if((($=L==null?void 0:L.data)==null?void 0:$.type)==="success"&&s.IsJson((ce=(A=L==null?void 0:L.data)==null?void 0:A.result)==null?void 0:ce.result)){const ie=(Fe=(Ae=(Be=JSON.parse((xe=(de=L==null?void 0:L.data)==null?void 0:de.result)==null?void 0:xe.result))==null?void 0:Be.lines_file_paths)==null?void 0:Ae[0])==null?void 0:Fe.split("\\"),st=(((Le=K==null?void 0:K.find(J=>(J==null?void 0:J.key)===h))==null?void 0:Le.resources)??"")+"/"+((ie==null?void 0:ie[(ie==null?void 0:ie.length)-2])??"outputResources"),we=await I.axios.post(st,null,{headers:{Authorization:Y,baseURL:"http://139.196.154.85:20025","Content-Type":"multipart/form-data"}});if(((Re=we==null?void 0:we.data)==null?void 0:Re.type)==="success"){const J=(je=we==null?void 0:we.data)==null?void 0:je.result,at=N.showItems.value,it=await((Oe=_e.cloneDeep(at))==null?void 0:Oe.map(async G=>{var Ie,ze,Ue,$e,He,Ye;if((G==null?void 0:G.name)==="输出"){if((G==null?void 0:G.comp)==="Table")G.compData=(Ie=G==null?void 0:G.compData)==null?void 0:Ie.map(z=>{var H,re;return(z==null?void 0:z.key)==="tableContents"&&(z.contents=(re=(H=z==null?void 0:z.contents)==null?void 0:H.map(Q=>(Q=Q==null?void 0:Q.map((q,ue)=>{var me;return typeof q=="string"&&ue>1&&(q=((me=J==null?void 0:J[ue-1])!=null&&me.includes("input")?q:J==null?void 0:J[ue-1])??q),q}),Q)))==null?void 0:re.filter((Q,q)=>q<=(J==null?void 0:J.length)-1)),z});else if((G==null?void 0:G.comp)==="Form"){let z="";if(J==null||J.forEach(H=>{z=z===""?z+H:z+","+H}),G.compData=(ze=G==null?void 0:G.compData)==null?void 0:ze.map(H=>{var re;return(H==null?void 0:H.key)==="formContent"&&(H.contents=(re=H.contents)==null?void 0:re.map(Q=>(Q.value=z,Q))),H}),(Ue=z==null?void 0:z.split(","))!=null&&Ue.find(H=>H.includes(".obj"))){let H={};H.suffix=".obj";const re=[];let Q=await((He=($e=z==null?void 0:z.split(","))==null?void 0:$e.filter(q=>q.includes(".obj")||q.includes(".mtl")))==null?void 0:He.map(async q=>{var me,ke;if(q.includes(".obj")){const Ce=(((me=K==null?void 0:K.find(fe=>(fe==null?void 0:fe.key)===h))==null?void 0:me.download)??"")+"/"+q,ve=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await I.axios.post(Ce,null,{responseType:"blob",headers:{Authorization:ve,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var ue=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});H.blob=ue}else if(q.includes(".mtl")){const Ce=(((ke=K==null?void 0:K.find(Pe=>(Pe==null?void 0:Pe.key)===h))==null?void 0:ke.download)??"")+"/"+q,ve=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),be=await I.axios.post(Ce,null,{responseType:"blob",headers:{Authorization:ve,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var ue=new Blob([be.data],{type:"application/octet-stream;charset=UTF-8"});re.push(ue)}}));await Promise.all(Q),H.mtlBlobs=re,l.value.loadModelByDefaultPath([H])}else{const H=[];let re=await((Ye=z==null?void 0:z.split(","))==null?void 0:Ye.map(async Q=>{var ve,be;let q={};q.suffix="."+((ve=Q==null?void 0:Q.split("."))==null?void 0:ve[1]);const me=(((be=K==null?void 0:K.find(fe=>(fe==null?void 0:fe.key)===h))==null?void 0:be.download)??"")+"/"+Q,ke=sessionStorage.getItem("magicToken")===""?"123456":sessionStorage.getItem("magicToken"),Ve=await I.axios.post(me,null,{responseType:"blob",headers:{Authorization:ke,baseURL:"http://139.196.154.85:20025","Content-Type":"application/json"}});var Ce=new Blob([Ve.data],{type:"application/octet-stream;charset=UTF-8"});q.blob=Ce,H.push(q)}));await Promise.all(re),l.value.loadModelByDefaultPath(H)}}}return G}));N.showItems.value=await Promise.all(it)}}o.value++,a.value=!1},D=e.ref(""),M=e.ref("open"),F=e.ref("open"),T=e.ref(!1),O=()=>{const f=document.getElementById("menuCollapse");M.value==="open"?(f.style.width="18.75rem",f.style.height="96%",f.style.overflow="auto"):(f.style.width="50px",f.style.height="50px",f.style.overflow="hidden")},ee=()=>{const f=document.getElementById("operateCollapse");F.value==="open"?(f.style.width="25rem",f.style.height="96%",f.style.overflow="auto"):(f.style.width="50px",f.style.height="50px",f.style.overflow="hidden")},te=()=>{T.value=!T.value;const f=document.getElementById("operateCollapse"),h=document.getElementById("menuCollapse");T.value?(h.style.width="18.75rem",f.style.width="calc(100% - 24rem)"):f.style.width="400px"};return(f,h)=>{const S=e.resolveComponent("el-button"),B=e.resolveComponent("el-avatar"),j=e.resolveComponent("el-header"),Y=e.resolveComponent("el-container"),L=e.resolveComponent("el-aside"),W=e.resolveComponent("el-collapse-item"),U=e.resolveComponent("el-collapse"),X=e.resolveComponent("el-main"),ne=e.resolveComponent("router-view"),le=e.resolveDirective("loading");return e.unref(w)==="edit"?(e.openBlock(),e.createBlock(Y,{key:0,class:"client-container"},{default:e.withCtx(()=>[e.createVNode(j,{class:"client-structure-header"},{default:e.withCtx(()=>{var $;return[e.createElementVNode("div",Eo,[e.createVNode(S,{class:"select-icon",onClick:e.unref(N.onBack)},{default:e.withCtx(()=>h[6]||(h[6]=[e.createTextVNode(" 返回页面 ")])),_:1,__:[6]},8,["onClick"]),e.createVNode(S,{class:"select-icon",onClick:h[0]||(h[0]=A=>{var ce,de;return e.unref(N.clickSavePage)((de=(ce=e.unref(n))==null?void 0:ce.map(xe=>xe.value))==null?void 0:de.join("/"))})},{icon:e.withCtx(()=>[e.createVNode(pe.SvgIcon,{name:"Store"})]),default:e.withCtx(()=>[h[7]||(h[7]=e.createTextVNode(" 保存页面 "))]),_:1,__:[7]})]),e.createElementVNode("div",Mo,[(e.openBlock(),e.createBlock(nt,{key:e.unref(n),breadArray:e.unref(n),onClick:e.unref(N.onClick)},null,8,["breadArray","onClick"]))]),e.createElementVNode("div",Vo,[e.createElementVNode("div",Po,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),e.createVNode(B,{size:35,src:($=e.unref(c))==null?void 0:$.avatarUrl},{default:e.withCtx(()=>{var A;return[e.createTextVNode(e.toDisplayString(((A=e.unref(c))==null?void 0:A.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.unref(w)==="edit"?(e.openBlock(),e.createBlock(Y,{key:0,class:"model-operate",style:{"margin-top":"10px",height:"0px"}},{default:e.withCtx(()=>[e.createElementVNode("div",So,[e.createVNode(he.modelSelect)]),e.createElementVNode("div",To,[e.createVNode(he.modelShow)]),e.createElementVNode("div",Do,[e.createVNode(he.modelFill)])]),_:1})):e.createCommentVNode("",!0)]),_:3})):e.withDirectives((e.openBlock(),e.createBlock(Y,{key:1,class:"client-container","element-loading-text":"正在加载页面数据..."},{default:e.withCtx(()=>[e.createVNode(j,{class:"client-header"},{default:e.withCtx(()=>{var $;return[e.createElementVNode("div",No,[e.createVNode(pe.SvgIcon,{name:"logo",style:{width:"clamp(18px, 1.5rem, 24px)",height:"clamp(18px, 1.5rem, 24px)","margin-right":"8px"}}),e.createTextVNode(" "+e.toDisplayString(e.unref(C)===""?"CPMPIP":e.unref(C)),1)]),e.createElementVNode("div",Bo,[e.createVNode(ko,{mode:"horizontal"})]),e.createElementVNode("div",Ao,[e.createVNode(qe._sfc_main,{modelValue:D.value,"onUpdate:modelValue":h[1]||(h[1]=A=>D.value=A),style:{width:"130px"}},null,8,["modelValue"]),e.unref(w)==="view"?(e.openBlock(),e.createElementBlock("div",{key:0,class:"select-icon",onClick:h[2]||(h[2]=(...A)=>e.unref(N.onSelectFixContent)&&e.unref(N.onSelectFixContent)(...A))},[e.createElementVNode("div",Fo,[e.createVNode(pe.SvgIcon,{name:"write",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}})]),h[8]||(h[8]=e.createElementVNode("div",{class:"layout-trigger"},e.toDisplayString("修改布局"),-1))])):e.createCommentVNode("",!0),e.createElementVNode("div",Lo,[e.renderSlot(f.$slots,"default",{},void 0,!0)]),e.createVNode(B,{size:35,src:($=e.unref(c))==null?void 0:$.avatarUrl},{default:e.withCtx(()=>{var A;return[e.createTextVNode(e.toDisplayString(((A=e.unref(c))==null?void 0:A.account)??"未知"),1)]}),_:1},8,["src"])])]}),_:3}),e.createVNode(Y,{class:"client-body"},{default:e.withCtx(()=>[f.$route.path==="/"?(e.openBlock(),e.createBlock(X,{key:0,class:"client-main"},{default:e.withCtx(()=>[e.createVNode(U,{modelValue:M.value,"onUpdate:modelValue":h[3]||(h[3]=$=>M.value=$),accordion:"",class:"client-aside",id:"menuCollapse",onChange:O},{default:e.withCtx(()=>[e.createVNode(W,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(pe.SvgIcon,{name:M.value===""?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>[e.createVNode(L,{style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})]),_:1})]),_:1},8,["modelValue"]),e.createElementVNode("div",Ro,[e.createVNode(eo,{isShow:E.value,windowConfig:g.windowConfig,ref_key:"threeModelRef",ref:l},null,8,["isShow","windowConfig"])]),e.createVNode(U,{modelValue:F.value,"onUpdate:modelValue":h[5]||(h[5]=$=>F.value=$),accordion:"",class:"client-main-operate",id:"operateCollapse",onChange:ee},{default:e.withCtx(()=>[e.createVNode(W,{name:"open"},{icon:e.withCtx(()=>[e.createVNode(pe.SvgIcon,{name:F.value==="open"?"Right":"Left",style:{width:"20px",height:"20px"}},null,8,["name"])]),default:e.withCtx(()=>{var $;return[e.createElementVNode("div",null,[e.createVNode(pe.SvgIcon,{class:"fold-icon",name:T.value?"Right":"Left",onClick:te},null,8,["name"]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(($=e.unref(_e.cloneDeep)(e.unref(N.showItems)))==null?void 0:$.filter(A=>A.comp!=="FormTop"),(A,ce)=>{var de;return e.openBlock(),e.createElementBlock("div",{class:"item-view-content",key:ce},[((de=A==null?void 0:A.comp)==null?void 0:de.toUpperCase())!=="TABLE"?(e.openBlock(),e.createElementBlock("div",jo,e.toDisplayString(A.name),1)):e.createCommentVNode("",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(N.getComponents)(A.comp)),{compName:A.name,itemData:A==null?void 0:A.compData,childItemData:A==null?void 0:A.itemChildData,key:(A==null?void 0:A.id)??ce,onChange:e.unref(N.onChange),index:(A==null?void 0:A.id)??ce,onContentChange:e.unref(N.onContentChange),onPageChange:e.unref(N.onPageChange)},null,40,["compName","itemData","childItemData","onChange","index","onContentChange","onPageChange"]))])}),128)),i.value?(e.openBlock(),e.createElementBlock("div",Oo,[e.createVNode(qe._sfc_main$1,{class:"calculator-content",onClickTrigger:h[4]||(h[4]=A=>P()),loading:a.value,modelValue:"调用方法"},null,8,["loading"])])):e.createCommentVNode("",!0)])]}),_:1})]),_:1},8,["modelValue"])]),_:1})):(e.openBlock(),e.createBlock(X,{key:1,class:"client-router"},{default:e.withCtx(()=>[e.createElementVNode("div",Io,[e.createVNode(L,{width:"300px"},{default:e.withCtx(()=>[e.createVNode(De.default,{mode:"vertical"})]),_:1})]),e.createVNode(X,{class:"router-main"},{default:e.withCtx(()=>[e.createVNode(ne)]),_:1})]),_:1}))]),_:1})]),_:3})),[[le,e.unref(k)]])}}}),Uo=ye._export_sfc(zo,[["__scopeId","data-v-f99a1858"]]),$o={class:"system-wrap"},Ho={__name:"index",props:{windowConfig:{type:Object,default:()=>{}},platform:{type:String,default:"browser"},content:String,jsonContents:Array},setup(g){const t=s.useModelComp(ae.pinia),o=s.useUnit(ae.pinia),a=I.useMenuState();e.ref(!1);const n=e.ref(!0),i=g;return e.onMounted(()=>{}),e.watch(()=>[i==null?void 0:i.content,i==null?void 0:i.jsonContents],async()=>{var m,c,y,w;if(((m=i==null?void 0:i.jsonContents)==null?void 0:m.length)>0){t.setOriginalData(i==null?void 0:i.jsonContents);return}if(!(i!=null&&i.content)||((c=i==null?void 0:i.content)==null?void 0:c.length)===0)return;n.value=!0,a.setImportLoading(!0);let u=[],r=[];o.setSelectTitle([]),o.setSelectIndex(""),o.setSelectMenu(""),(w=(y=i==null?void 0:i.content)==null?void 0:y.filter(_=>_!==""))==null||w.forEach(_=>{ge.isExpandStringToJson(_)?r.push(ge.expandStringToJson(_)):ge.expandNewStringToJson(_)?r.push(ge.expandNewStringToJson(_)):ge.expandContentStringToJson(_)?r.push(ge.expandContentStringToJson(_)):r.push(N.expandToNewContents(_))}),u=r==null?void 0:r[0],await N.savePageDataAsync(u),await s.loadingSystemType(),t.setOriginalData(u),a.setImportLoading(!1)},{deep:!0,immediate:!0}),(u,r)=>(e.openBlock(),e.createElementBlock("div",$o,[g.platform==="browser"?(e.openBlock(),e.createBlock(Co,{key:0},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3})):(e.openBlock(),e.createBlock(Uo,{key:1,windowConfig:g.windowConfig},{default:e.withCtx(()=>[e.renderSlot(u.$slots,"default",{},void 0,!0)]),_:3},8,["windowConfig"]))]))}},Yo=ye._export_sfc(Ho,[["__scopeId","data-v-65a44ad9"]]),qo={class:"add-model-content"},Zo={key:0,class:"model-operate"},Go={class:"model-select"},Ko={class:"model-fill"},Wo={key:1,class:"model-view"},Xo={key:0,class:"model-import-data"},Jo={__name:"index",props:{mode:{type:String,default:"view"},content:{type:String,default:""},jsonContents:{type:Array,default:()=>[]},showButton:{type:Boolean,default:!0}},emits:["change","contentChange"],setup(g,{emit:t}){const o=g,a=t,n=e.ref([]),i=e.ref([]),u=e.ref([]),r=e.ref(0),m=s.useModelComp(ae.pinia),c=I.useMenuState(ae.pinia),{itemData:y,originalData:w}=I.storeToRefs(m),{activeMenuPath:_,platform:b}=I.storeToRefs(c),x=e.ref(null),p=e.ref(0),l=e.ref([]);e.ref("");const v=e.ref(0),k=d=>{a("contentChange",d)},V=d=>{var D;const P=(D=_e.cloneDeep(d==null?void 0:d.wholeValue))==null?void 0:D.map(M=>{var F;return(M==null?void 0:M.comp)==="Form"&&(M.compData=(F=M.compData)==null?void 0:F.map(T=>((T==null?void 0:T.key)==="formContent"&&(T.contents=ge.arrayToNumberArray(T==null?void 0:T.contents)),T))),M});a("change",{originalContents:w.value,currentContents:d==null?void 0:d.wholeValue,editContent:d==null?void 0:d.editValue,arrayToContents:P})};e.watch(()=>i.value,()=>{v.value===i.value.length&&i.value.length!==0&&(n.value=i.value)},{deep:!0,immediate:!0});const C=()=>{x.value.click()},E=async d=>{const P=d.target.files;if(!P)return;new FileReader,n.value=[],i.value=[],v.value=P.length;const D=Array.from(P).map(async M=>await new Promise(F=>{const T=new FileReader;T.onload=O=>{try{i.value.push(O.target.result),p.value++}catch(ee){console.error("解析失败:",ee);return}},T.onerror=()=>F(`读取 ${M.name} 失败`),T.readAsText(M),d.target.value="",x.value=null}));await Promise.all(D)};return e.watch(()=>[o==null?void 0:o.content,o==null?void 0:o.jsonContents],async()=>{await s.loadingSystemType(),n.value=o.content,u.value=o==null?void 0:o.jsonContents},{deep:!0,immediate:!0}),e.watch(()=>p.value,()=>{var d;((d=l.value)==null?void 0:d.length)!==0&&(m.setOriginalData(l.value),m.setItemData(l.value))},{deep:!0,immediate:!0}),(d,P)=>{const D=e.resolveComponent("svg-icon");return e.openBlock(),e.createElementBlock("div",qo,[(o==null?void 0:o.mode)==="edit"?(e.openBlock(),e.createElementBlock("div",Zo,[e.createElementVNode("div",Go,[e.createVNode(he.modelSelect)]),(e.openBlock(),e.createElementBlock("div",{class:"model-show",key:r.value},[e.createVNode(he.modelShow)])),e.createElementVNode("div",Ko,[e.createVNode(he.modelFill)])])):e.createCommentVNode("",!0),(o==null?void 0:o.mode)==="view"?(e.openBlock(),e.createElementBlock("div",Wo,[(e.openBlock(),e.createBlock(Yo,{platform:e.unref(b),content:n.value,onChange:V,jsonContents:u.value,onContentChange:k,key:r.value},{default:e.withCtx(()=>{var M;return[((M=o==null?void 0:o.jsonContents)==null?void 0:M.length)===0&&(o!=null&&o.showButton)?(e.openBlock(),e.createElementBlock("div",Xo,[e.createElementVNode("div",{class:"import-button",onClick:C},[e.createElementVNode("input",{type:"file",ref_key:"fileInput",ref:x,accept:".txt, .inm",onChange:E,style:{display:"none"},multiple:""},null,544),e.createVNode(D,{name:"import",style:{width:"clamp(12px, 0.9375rem, 15px)",height:"clamp(12px, 0.9375rem, 15px)"}}),P[0]||(P[0]=e.createElementVNode("div",{class:"import-trigger"},e.toDisplayString("导入模型"),-1))])])):e.createCommentVNode("",!0)]}),_:1},8,["platform","content","jsonContents"]))])):e.createCommentVNode("",!0)])}}},Qo=ye._export_sfc(Jo,[["__scopeId","data-v-4bf164f6"]]);exports.default=Qo;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as g, ref as C, onMounted as _, createElementBlock as v, openBlock as D, createVNode as h } from "vue";
|
|
2
|
-
import { p as c } from "./index-
|
|
3
|
-
import { c as k, e as I, d as K, u as x, s as M, g as S } from "./menu-
|
|
4
|
-
import { a8 as T } from "./index-
|
|
5
|
-
import { c as y } from "./cloneDeep-
|
|
2
|
+
import { p as c } from "./index-CT5MfiHK.js";
|
|
3
|
+
import { c as k, e as I, d as K, u as x, s as M, g as S } from "./menu-CgcTyBO3.js";
|
|
4
|
+
import { a8 as T } from "./index-wLeUULYM.js";
|
|
5
|
+
import { c as y } from "./cloneDeep-DUFqs1IK.js";
|
|
6
6
|
import { _ as E } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
const q = (a) => {
|
|
8
8
|
const s = {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ref as Sp, onMounted as Ab, watch as vL, onUnmounted as cL, createElementBlock as Mb, openBlock as Ib, createVNode as pL } from "vue";
|
|
2
2
|
import { _ as Lb } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
-
import { c as Ki } from "./cloneDeep-
|
|
3
|
+
import { c as Ki } from "./cloneDeep-DUFqs1IK.js";
|
|
4
4
|
/*! *****************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation.
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./index-CoLd5ctI.cjs"),x=require("./index-cinslkDi.cjs"),i=require("./index-gICeEA0J.cjs"),u=require("./menu-BasDnaD3.cjs"),f=require("./cloneDeep-FsOChpwa.cjs"),y=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V={class:"role-wrapper"},w={class:"role-dialog-header"},b={class:"node-text"},D={class:"dialog-footer"},v=e.defineComponent({__name:"index",setup(N){const h=u.useMenuState(),{menus:p}=u.storeToRefs(h),t=e.reactive({...i.State}),{treeRef:g}=i.State;e.onMounted(async()=>{t.structureId=await t.getActivePageStructureId()});const _=l=>{const r=[l==null?void 0:l.find(n=>n.title==="系统管理")].flatMap(n=>n.children);return r==null?void 0:r.map(n=>({path:n.path,buttons:n.path==="/系统管理/个人中心"?["基本信息","上传头像","签名","修改密码"]:["新增","查看","编辑","删除"]}))};return e.watch(()=>p.value,l=>{e.nextTick(()=>{const o=f.cloneDeep(l);t.tempSysMenus=_(o),t.menuData=t.addButtonsToTree(o,t.structureButtons)})},{immediate:!0,deep:!0}),(l,o)=>{const r=e.resolveComponent("el-checkbox"),n=e.resolveComponent("el-checkbox-group"),m=e.resolveComponent("el-tree"),d=e.resolveComponent("el-button"),C=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",V,[e.createVNode(k.ssForm,{class:"role-header",rowContents:t.queryFormData,isEnableWrap:!0,isEdit:!0,onChange:t.handleQueryChange},null,8,["rowContents","onChange"]),e.createVNode(x.ssTable,{class:"role-body",itemData:t.pageDataFiltered,changedContent:t.changedRow,onChange:t.handleItemDataChange,onOnButtonClick:t.clickRowButton},null,8,["itemData","changedContent","onChange","onOnButtonClick"])]),e.createVNode(C,{modelValue:t.authorizeDialog.show,"onUpdate:modelValue":o[0]||(o[0]=s=>t.authorizeDialog.show=s),width:t.authorizeDialog.width,draggable:t.authorizeDialog.draggable,"before-close":t.closeAuthorizeDialog,class:"role-dialog"},{header:e.withCtx(()=>[e.createElementVNode("div",w,e.toDisplayString(t.authorizeDialog.title),1)]),footer:e.withCtx(()=>[e.createElementVNode("div",D,[e.createVNode(d,{onClick:t.closeAuthorizeDialog},{default:e.withCtx(()=>o[1]||(o[1]=[e.createTextVNode("取消")])),_:1,__:[1]},8,["onClick"]),e.createVNode(d,{type:"primary",onClick:t.clickSubmitAuthority},{default:e.withCtx(()=>o[2]||(o[2]=[e.createTextVNode(" 确认 ")])),_:1,__:[2]},8,["onClick"])])]),default:e.withCtx(()=>[e.createVNode(m,{class:"role-tree",ref_key:"treeRef",ref:g,data:t.menuData,"expand-on-click-node":!1,"node-key":"path",props:{children:"children",label:"title",path:"path"},"highlight-current":"","default-expand-all":"","check-on-click-leaf":!1,"check-strictly":"",onCheckChange:t.handleNodeCheckChange,style:{height:"500px","overflow-y":"auto"}},{default:e.withCtx(({node:s,data:c})=>[e.createElementVNode("span",b,e.toDisplayString(s.label),1),e.createVNode(n,{modelValue:c.checkedButtons,"onUpdate:modelValue":a=>c.checkedButtons=a,onChange:a=>t.handleNodeBtnChange(a,c),class:"node-buttons"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.renderButtons,a=>(e.openBlock(),e.createBlock(r,{key:a.title,label:a.title,value:a.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.title),1)]),_:2},1032,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])]),_:1},8,["data","onCheckChange"])]),_:1},8,["modelValue","width","draggable","before-close"])],64)}}}),B=y._export_sfc(v,[["__scopeId","data-v-7991d6ed"]]);exports.default=B;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index.vue_vue_type_style_index_0_scoped_d9b749a8_lang-CG_bu310.cjs"),e=require("vue"),r=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),d={class:"menu-operate-icon"},u={class:"module-dialog-content"};function c(t,k,_,C,f,v){const l=e.resolveComponent("svg-icon"),s=e.resolveComponent("ssMenu"),i=e.resolveComponent("ssDialog");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(s,{mode:t.mode,menuList:t.renderMenuList,onClickMenu:t.clickMenu,onOpenMenu:t.openMenu,onCloseMenu:t.closeMenu},{title:e.withCtx(({menu:n})=>[e.createVNode(l,{name:n.icon??"Edit",class:"menu-icon"},null,8,["name"]),e.createElementVNode("span",null,e.toDisplayString(n.title??""),1),e.createElementVNode("span",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n==null?void 0:n.config,o=>(e.openBlock(),e.createBlock(l,{key:o.id,name:o==null?void 0:o.menuIcon,onClick:M=>t.clickMenuIcon(o)},null,8,["name","onClick"]))),128))])]),_:1},8,["mode","menuList","onClickMenu","onOpenMenu","onCloseMenu"]),e.createVNode(i,{class:"module-dialog",title:t.dialogInfo.title,visible:t.dialogInfo.show,width:t.dialogInfo.width,onBeforeDestroy:t.beforeDialogDestroy},{default:e.withCtx(()=>[e.createElementVNode("div",u,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.dialogRenderComps,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.getComponents((n==null?void 0:n.comp)??"Input")),{itemData:n==null?void 0:n.compData,key:n==null?void 0:n.id,content:(n==null?void 0:n.contents)??[],config:n==null?void 0:n.config,onContentChange:t.handleCompChange},null,40,["itemData","content","config","onContentChange"]))]))),128))])]),_:1},8,["title","visible","width","onBeforeDestroy"])],64)}const g=r._export_sfc(a._sfc_main,[["render",c],["__scopeId","data-v-d9b749a8"]]);exports.default=g;
|