import{d as I,c as h,o as _,e as C,f as c,j as M,u as $,bF as E,F as L,m as j,_ as A,I as z,bG as G,h as S,b9 as B,bH as H,J as K,L as O,r as R,bI as N,R as v,bJ as P,a as w,b as Q,bK as f,bL as D,bM as F,g as T,k as U,K as W}from"./offline.ee04b43a.js";import{H as X}from"./index.2a7137c8.js";import{_ as Y}from"./index.vue_vue_type_script_setup_true_lang.9d8e32c7.js";import{S as Z}from"./scene-select.5723a731.js";import{L as x}from"./left-pano.dbbe321d.js";/* empty css */import"./index.f31d612e.js";const ee=I({__name:"menu-item-child",props:{menuItem:{},activePaths:{},refer:{},level:{},show:{type:Boolean}},emits:["enter","leave","select"],setup(n,{emit:l}){const a=document.body,e=l;return(t,o)=>{const g=h("ui-icon"),y=h("ui-floating");return t.menuItem.children&&t.menuItem.children.length?(_(),C(L,{key:0},[c(g,{type:"pull-more",class:"menu-more-icon",size:"12px"}),c(y,{mount:$(a),refer:t.refer,dire:"right-top",class:E(["menu-children strengthen",{show:t.show}]),onEnter:o[3]||(o[3]=i=>e("enter")),onLeave:o[4]||(o[4]=i=>e("leave"))},{default:M(()=>[c(q,{menu:t.menuItem.children,"active-paths":t.activePaths,level:t.level,onEnter:o[0]||(o[0]=i=>e("enter")),onLeave:o[1]||(o[1]=i=>e("leave")),onSelect:o[2]||(o[2]=i=>e("select",i))},null,8,["menu","active-paths","level"])]),_:1},8,["mount","refer","class"])],64)):j("",!0)}}});const V=A(ee,[["__scopeId","data-v-42f7caa3"]]),te=["onMouseenter","onMouseleave","onClick"],ne=I({__name:"menu-item",props:{menu:{},activePaths:{},level:{}},emits:["enter","leave","select"],setup(n,{emit:l}){const a=n,e=l,t=z(()=>{const u=Array.isArray(a.menu)?a.menu:[a.menu];return{level:Array.isArray(a.menu)?a.level+1:1,menus:u,children:u.map(b=>({timeout:null,menuRef:R(null),show:R(!1)}))}}),o=(s=0)=>{const u=t.value,d=u.children[s],b=u.menus[s],r=d.menuRef.value,m=u.level===1?r==null?void 0:r.dom:r;return{menuItem:b,activePaths:a.activePaths,refer:m,level:u.level,show:d.show.value}};let g=!1;const y=(s=0)=>{if(g)return;const{show:u,timeout:d}=t.value.children[s];e("enter"),clearTimeout(d),u.value=!0},i=(s=0)=>{if(g)return;const{show:u,timeout:d}=t.value.children[s];e("leave"),clearTimeout(d),t.value.children[s].timeout=setTimeout(()=>u.value=!1,50)},k=(s=0,u)=>{e("select",u),i(s),g=!0,setTimeout(()=>g=!1,350)};return(s,u)=>{const d=h("ui-menu-item"),b=h("ui-icon");return _(!0),C(L,null,G(t.value.menus,(r,m)=>(_(),C(L,null,[t.value.level===1?(_(),S(d,{key:0,text:r.title,icon:r.icon,active:s.activePaths.includes(r.name),ref_for:!0,ref:t.value.children[m].menuRef,class:"menu-item",onEnter:y,onLeave:i,onClick:p=>e("select",r)},{default:M(()=>[B(s.$slots,"attach",{raw:r,active:s.activePaths.includes(r.name)},void 0,!0),c(V,H({ref_for:!0},o(),{onEnter:y,onLeave:i,onSelect:u[0]||(u[0]=p=>e("select",p))}),null,16)]),_:2},1032,["text","icon","active","onClick"])):(_(),C("div",{key:1,class:E(["menu-children-item menu-item",{active:s.activePaths.includes(r.name)}]),ref_for:!0,ref:t.value.children[m].menuRef,onMouseenter:p=>y(m),onMouseleave:p=>i(m),onClick:p=>k(m,r)},[B(s.$slots,"attach",{raw:r},void 0,!0),c(b,{type:r.icon,size:"18px"},null,8,["type"]),K("span",null,O(r.title),1),c(V,H({ref_for:!0},o(m),{onEnter:p=>y(m),onLeave:p=>i(m),onSelect:p=>k(m,p)}),null,16,["onEnter","onLeave","onSelect"])],42,te))],64))),256)}}});const q=A(ne,[["__scopeId","data-v-605df0d8"]]),J=(n,l,a=[])=>{for(const e of n){if(e.name===l)return[...a,e.name];if(e.children){const t=J(e.children,l,[...a,e.name]);if(t.length)return t}}return[]},oe=I({name:"slide-menu",props:{items:{type:Array,required:!0},active:{type:String},hide:{type:Boolean},logo:{type:String}},emits:{select:(n,l)=>!0},setup(n){return{activePaths:z(()=>n.active?J(n.items,n.active):[])}},components:{MenuItem:q}});const se={class:"logo"};function le(n,l,a,e,t,o){const g=h("MenuItem"),y=h("ui-icon"),i=h("ui-editor-menu");return _(),S(i,{menu:n.items,class:E(["menu global-menu",{show:!n.hide}])},N({default:M(({raw:k})=>[c(g,{menu:k,activePaths:n.activePaths,onSelect:l[0]||(l[0]=s=>n.$emit("select",s.name,s))},null,8,["menu","activePaths"])]),_:2},[n.logo?{name:"attach",fn:M(()=>[K("div",se,[c(y,{type:n.logo},null,8,["type"])])]),key:"0"}:void 0]),1032,["menu","class"])}const ae=A(oe,[["render",le],["__scopeId","data-v-8ad2976c"]]),ue=I({__name:"fuse-slide-menu",setup(n){const l=[{name:v.merge,...P[v.merge]},{name:v.tagging,...P[v.tagging]},{name:v.measure,...P[v.measure]},{name:v.guide,...P[v.guide]},{name:v.setting,...P[v.setting]}];return(a,e)=>(_(),S(ae,{items:l,onSelect:e[0]||(e[0]=t=>$(w).push({name:t})),active:$(w).currentRoute.value.name},null,8,["active"]))}}),re=I({__name:"fuse-left-pano",setup(n){const l=e=>{var t,o;D(e).value&&(f.currentModel!==e?((t=F(e))==null||t.changeSelect(!0),f.currentModel=e):((o=F(f.currentModel))==null||o.changeSelect(!1),f.currentModel=null))};Q(()=>{f.currentModel&&!D(f.currentModel).value&&(f.currentModel=null)});const a=e=>{const t=T.value.indexOf(e);~t&&T.value.splice(t,1)};return(e,t)=>{const o=h("ui-icon");return _(),S($(x),null,{default:M(()=>[c(Y,{"can-change":$(f).modelsChangeStore,onDeleteModel:a,onClickModel:l},N({_:2},[$(f).modelsChangeStore?{name:"action",fn:M(()=>[c(Z,null,{default:M(()=>[c(o,{ctrl:"",type:"add"})]),_:1})]),key:"0"}:void 0]),1032,["can-change"])]),_:1})}}}),fe=I({__name:"fuse-switch",setup(n){return(l,a)=>{const e=h("router-view");return _(),C(L,null,[c(ue),c(X),c(re),c(e,null,{default:M(({Component:t})=>[(_(),S(W,null,[(_(),S(U(t)))],1024))]),_:1})],64)}}});export{fe as default};