import{a as p}from"./objectUtil.ec24ceed.js";import{c as f}from"./constant.b4bfe346.js";const y=(e,n)=>{if(n=="PLATFORM")return"--";let r="";if(e){const a=e.applicationName;if(n=="ORG"){const o=e.organizationRole?"-"+e.organizationRole:"";r+=a+o}else if(n=="PERSON"){e!=null&&e.userName&&(r=e.userName);let o=p(e.clientType,new Map(Object.entries(f)));o=o?"-"+o:"",r+=" ("+a+o+")"}}return r},m=(e,n)=>{const r=n.toString();let a=document.querySelector("#copy-input");a||(a=document.createElement("input"),a.id="copy-input",a.readOnly=!0,a.style.position="fixed",a.style.left="-1000px",a.style.zIndex="-1000",document.body.appendChild(a)),a.value=r,o(a,0,r.length),document.execCommand("copy")&&(document.execCommand("copy"),e.success("\u590D\u5236\u6210\u529F")),a.blur();function o(l,t,i){if(l.createTextRange){const c=l.createTextRange();c.collapse(!0),c.moveStart("character",t),c.moveEnd("character",i-t),c.select()}else l.setSelectionRange(t,i),l.focus()}},s=e=>{e.map(n=>(n&&(n.disabled=!n.enable),n.children&&n.children.length>0&&s(n.children),e))};export{m as c,s as f,y as g};
