import{Bt as e,H as t,Jt as n,K as r,Mt as i,Pt as a,U as o,X as s,Xt as c,Y as l,_n as u,at as d,bn as f,bt as p,d as m,dt as h,g,it as _,kt as v,nt as y,ot as b,p as x,st as S,tt as C}from"./client-9GVGzxpS.js";import{c as w,l as T,o as E}from"./_plugin-vue_export-helper-CtmSANVP.js";import{I as D,U as O,b as k,i as A,o as j,ot as ee}from"./index-CsGvlisv.js";function M(e){return typeof e==`string`?e.endsWith(`px`)?Number(e.slice(0,e.length-2)):Number(e):e}function N(e){if(e!=null)return typeof e==`number`?`${e}px`:e.endsWith(`px`)?e:`${e}px`}function P(e,t){let n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw Error(`[seemly/getMargin]:`+e+` is not a valid value.`)}return t===void 0?r:r[t]}function F(e,t){let[n,r]=e.split(` `);return t?t===`row`?n:r:{row:n,col:r||n}}function I(e){let{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:i,infoColor:a,successColor:o,warningColor:c,errorColor:l,baseColor:u,borderColor:d,opacityDisabled:f,tagColor:p,closeIconColor:m,closeIconColorHover:h,closeIconColorPressed:g,borderRadiusSmall:_,fontSizeMini:v,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:x,heightMini:S,heightTiny:C,heightSmall:w,heightMedium:T,closeColorHover:E,closeColorPressed:O,buttonColor2Hover:k,buttonColor2Pressed:A,fontWeightStrong:j}=e;return Object.assign(Object.assign({},D),{closeBorderRadius:_,heightTiny:S,heightSmall:C,heightMedium:w,heightLarge:T,borderRadius:_,opacityDisabled:f,fontSizeTiny:v,fontSizeSmall:y,fontSizeMedium:b,fontSizeLarge:x,fontWeightStrong:j,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:u,colorCheckable:`#0000`,colorHoverCheckable:k,colorPressedCheckable:A,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${d}`,textColor:t,color:p,colorBordered:`rgb(250, 250, 252)`,closeIconColor:m,closeIconColorHover:h,closeIconColorPressed:g,closeColorHover:E,closeColorPressed:O,borderPrimary:`1px solid ${s(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:s(i,{alpha:.12}),colorBorderedPrimary:s(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:s(i,{alpha:.12}),closeColorPressedPrimary:s(i,{alpha:.18}),borderInfo:`1px solid ${s(a,{alpha:.3})}`,textColorInfo:a,colorInfo:s(a,{alpha:.12}),colorBorderedInfo:s(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:s(a,{alpha:.12}),closeColorPressedInfo:s(a,{alpha:.18}),borderSuccess:`1px solid ${s(o,{alpha:.3})}`,textColorSuccess:o,colorSuccess:s(o,{alpha:.12}),colorBorderedSuccess:s(o,{alpha:.1}),closeIconColorSuccess:o,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:o,closeColorHoverSuccess:s(o,{alpha:.12}),closeColorPressedSuccess:s(o,{alpha:.18}),borderWarning:`1px solid ${s(c,{alpha:.35})}`,textColorWarning:c,colorWarning:s(c,{alpha:.15}),colorBorderedWarning:s(c,{alpha:.12}),closeIconColorWarning:c,closeIconColorHoverWarning:c,closeIconColorPressedWarning:c,closeColorHoverWarning:s(c,{alpha:.12}),closeColorPressedWarning:s(c,{alpha:.18}),borderError:`1px solid ${s(l,{alpha:.23})}`,textColorError:l,colorError:s(l,{alpha:.1}),colorBorderedError:s(l,{alpha:.08}),closeIconColorError:l,closeIconColorHoverError:l,closeIconColorPressedError:l,closeColorHoverError:s(l,{alpha:.12}),closeColorPressedError:s(l,{alpha:.18})})}var L={name:`Tag`,common:m,self:I},R={color:Object,type:{type:String,default:`default`},round:Boolean,size:String,closable:Boolean,disabled:{type:Boolean,default:void 0}},z=y(`tag`,` --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left); white-space: nowrap; position: relative; box-sizing: border-box; cursor: default; display: inline-flex; align-items: center; flex-wrap: nowrap; padding: var(--n-padding); border-radius: var(--n-border-radius); color: var(--n-text-color); background-color: var(--n-color); transition: border-color .3s var(--n-bezier), background-color .3s var(--n-bezier), color .3s var(--n-bezier), box-shadow .3s var(--n-bezier), opacity .3s var(--n-bezier); line-height: 1; height: var(--n-height); font-size: var(--n-font-size); `,[d(`strong`,` font-weight: var(--n-font-weight-strong); `),_(`border`,` pointer-events: none; position: absolute; left: 0; right: 0; top: 0; bottom: 0; border-radius: inherit; border: var(--n-border); transition: border-color .3s var(--n-bezier); `),_(`icon`,` display: flex; margin: 0 4px 0 0; color: var(--n-text-color); transition: color .3s var(--n-bezier); font-size: var(--n-avatar-size-override); `),_(`avatar`,` display: flex; margin: 0 6px 0 0; `),_(`close`,` margin: var(--n-close-margin); transition: background-color .3s var(--n-bezier), color .3s var(--n-bezier); `),d(`round`,` padding: 0 calc(var(--n-height) / 3); border-radius: calc(var(--n-height) / 2); `,[_(`icon`,` margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); `),_(`avatar`,` margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); `),d(`closable`,` padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); `)]),d(`icon, avatar`,[d(`round`,` padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); `)]),d(`disabled`,` cursor: not-allowed !important; opacity: var(--n-opacity-disabled); `),d(`checkable`,` cursor: pointer; box-shadow: none; color: var(--n-text-color-checkable); background-color: var(--n-color-checkable); `,[b(`disabled`,[C(`&:hover`,`background-color: var(--n-color-hover-checkable);`,[b(`checked`,`color: var(--n-text-color-hover-checkable);`)]),C(`&:active`,`background-color: var(--n-color-pressed-checkable);`,[b(`checked`,`color: var(--n-text-color-pressed-checkable);`)])]),d(`checked`,` color: var(--n-text-color-checked); background-color: var(--n-color-checked); `,[b(`disabled`,[C(`&:hover`,`background-color: var(--n-color-checked-hover);`),C(`&:active`,`background-color: var(--n-color-checked-pressed);`)])])])]),te=Object.assign(Object.assign(Object.assign({},x.props),R),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),ne=l(`n-tag`),re=v({name:`Tag`,props:te,slots:Object,setup(e){let r=u(null),{mergedBorderedRef:i,mergedClsPrefixRef:a,inlineThemeDisabled:s,mergedRtlRef:c,mergedComponentPropsRef:l}=o(e),d=p(()=>e.size||l?.value?.Tag?.size||`medium`),m=x(`Tag`,`-tag`,z,L,e,a);n(ne,{roundRef:f(e,`round`)});function h(){if(!e.disabled&&e.checkable){let{checked:t,onCheckedChange:n,onUpdateChecked:r,"onUpdate:checked":i}=e;r&&r(!t),i&&i(!t),n&&n(!t)}}function _(t){if(e.triggerClickOnClose||t.stopPropagation(),!e.disabled){let{onClose:n}=e;n&&w(n,t)}}let v={setTextContent(e){let{value:t}=r;t&&(t.textContent=e)}},y=g(`Tag`,c,a),b=p(()=>{let{type:t,color:{color:n,textColor:r}={}}=e,a=d.value,{common:{cubicBezierEaseInOut:o},self:{padding:s,closeMargin:c,borderRadius:l,opacityDisabled:u,textColorCheckable:f,textColorHoverCheckable:p,textColorPressedCheckable:h,textColorChecked:g,colorCheckable:_,colorHoverCheckable:v,colorPressedCheckable:y,colorChecked:b,colorCheckedHover:x,colorCheckedPressed:C,closeBorderRadius:w,fontWeightStrong:T,[S(`colorBordered`,t)]:E,[S(`closeSize`,a)]:D,[S(`closeIconSize`,a)]:O,[S(`fontSize`,a)]:k,[S(`height`,a)]:A,[S(`color`,t)]:j,[S(`textColor`,t)]:ee,[S(`border`,t)]:M,[S(`closeIconColor`,t)]:N,[S(`closeIconColorHover`,t)]:F,[S(`closeIconColorPressed`,t)]:I,[S(`closeColorHover`,t)]:L,[S(`closeColorPressed`,t)]:R}}=m.value,z=P(c);return{"--n-font-weight-strong":T,"--n-avatar-size-override":`calc(${A} - 8px)`,"--n-bezier":o,"--n-border-radius":l,"--n-border":M,"--n-close-icon-size":O,"--n-close-color-pressed":R,"--n-close-color-hover":L,"--n-close-border-radius":w,"--n-close-icon-color":N,"--n-close-icon-color-hover":F,"--n-close-icon-color-pressed":I,"--n-close-icon-color-disabled":N,"--n-close-margin-top":z.top,"--n-close-margin-right":z.right,"--n-close-margin-bottom":z.bottom,"--n-close-margin-left":z.left,"--n-close-size":D,"--n-color":n||(i.value?E:j),"--n-color-checkable":_,"--n-color-checked":b,"--n-color-checked-hover":x,"--n-color-checked-pressed":C,"--n-color-hover-checkable":v,"--n-color-pressed-checkable":y,"--n-font-size":k,"--n-height":A,"--n-opacity-disabled":u,"--n-padding":s,"--n-text-color":r||ee,"--n-text-color-checkable":f,"--n-text-color-checked":g,"--n-text-color-hover-checkable":p,"--n-text-color-pressed-checkable":h}}),C=s?t(`tag`,p(()=>{let t=``,{type:n,color:{color:r,textColor:a}={}}=e;return t+=n[0],t+=d.value[0],r&&(t+=`a${T(r)}`),a&&(t+=`b${T(a)}`),i.value&&(t+=`c`),t}),b,e):void 0;return Object.assign(Object.assign({},v),{rtlEnabled:y,mergedClsPrefix:a,contentRef:r,mergedBordered:i,handleClick:h,handleCloseClick:_,cssVars:s?void 0:b,themeClass:C?.themeClass,onRender:C?.onRender})},render(){var e;let{mergedClsPrefix:t,rtlEnabled:n,closable:r,color:{borderColor:a}={},round:o,onRender:s,$slots:c}=this;s?.();let l=E(c.avatar,e=>e&&i(`div`,{class:`${t}-tag__avatar`},e)),u=E(c.icon,e=>e&&i(`div`,{class:`${t}-tag__icon`},e));return i(`div`,{class:[`${t}-tag`,this.themeClass,{[`${t}-tag--rtl`]:n,[`${t}-tag--strong`]:this.strong,[`${t}-tag--disabled`]:this.disabled,[`${t}-tag--checkable`]:this.checkable,[`${t}-tag--checked`]:this.checkable&&this.checked,[`${t}-tag--round`]:o,[`${t}-tag--avatar`]:l,[`${t}-tag--icon`]:u,[`${t}-tag--closable`]:r}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||l,i(`span`,{class:`${t}-tag__content`,ref:`contentRef`},(e=this.$slots).default?.call(e)),!this.checkable&&r?i(O,{clsPrefix:t,class:`${t}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:o,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?i(`div`,{class:`${t}-tag__border`,style:{borderColor:a}}):null)}});function ie(){let e=a(k,null);return e===null&&r(`use-message`,"No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}function ae(e){let t=0;for(let n=0;n{let r=ae(t);if(!r){e.forEach(e=>{n.push((e&&e+` `)+t)});return}else if(r===1){e.forEach(e=>{n.push(t.replace(`&`,e))});return}let i=[t];for(;r--;){let t=[];i.forEach(n=>{e.forEach(e=>{t.push(n.replace(`&`,e))})}),i=t}i.forEach(e=>n.push(e))}),n}function ce(e,t){let n=[];return t.split(B).forEach(t=>{e.forEach(e=>{n.push((e&&e+` `)+t)})}),n}function le(e){let t=[``];return e.forEach(e=>{e&&=e.trim(),e&&(t=e.includes(`&`)?se(t,e):ce(t,e))}),t.join(`, `).replace(oe,` `)}var ue=/[A-Z]/g;function V(e){return e.replace(ue,e=>`-`+e.toLowerCase())}function de(e,t=` `){return typeof e==`object`&&e?` { `+Object.entries(e).map(e=>t+` ${V(e[0])}: ${e[1]};`).join(` `)+` `+t+`}`:`: ${e};`}function fe(e,t,n){return typeof e==`function`?e({context:t.context,props:n}):e}function H(e,t,n,r){if(!t)return``;let i=fe(t,n,r);if(!i)return``;if(typeof i==`string`)return`${e} {\n${i}\n}`;let a=Object.keys(i);if(a.length===0)return n.config.keepEmptyBlock?e+` { }`:``;let o=e?[e+` {`]:[];return a.forEach(e=>{let t=i[e];if(e===`raw`){o.push(` `+t+` `);return}e=V(e),t!=null&&o.push(` ${e}${de(t)}`)}),e&&o.push(`}`),o.join(` `)}function U(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))U(e,t,n);else if(typeof e==`function`){let r=e(t);Array.isArray(r)?U(r,t,n):r&&n(r)}else e&&n(e)})}function W(e,t,n,r,i,a){let o=e.$;!o||typeof o==`string`?t.push(o):typeof o==`function`?t.push(o({context:r.context,props:i})):(o.before&&o.before(r.context),!o.$||typeof o.$==`string`?t.push(o.$):o.$&&t.push(o.$({context:r.context,props:i})));let s=le(t),c=H(s,e.props,r,i);a&&c&&a.insertRule(c),!a&&c.length&&n.push(c),e.children&&U(e.children,{context:r.context,props:i},e=>{if(typeof e==`string`){let t=H(s,{raw:e},r,i);a?a.insertRule(t):n.push(t)}else W(e,t,n,r,i,a)}),t.pop(),o&&o.after&&o.after(r.context)}function G(e,t,n,r=!1){let i=[];return W(e,[],i,t,n,r?e.instance.__styleSheet:void 0),r?``:i.join(` `)}function K(e){if(!e)return;let t=e.parentElement;t&&t.removeChild(e)}function q(e){return document.querySelector(`style[cssr-id="${e}"]`)}function pe(e){let t=document.createElement(`style`);return t.setAttribute(`cssr-id`,e),t}window&&(window.__cssrContext={});function J(e){let t=e.getAttribute(`mount-count`);return t===null?null:Number(t)}function Y(e,t){e.setAttribute(`mount-count`,String(t))}function X(e,t,n,r){let{els:i}=t;if(n===void 0)i.forEach(K),t.els=[];else{let e=q(n);if(e&&i.includes(e)){let a=J(e);r?a===null?console.error(`[css-render/unmount]: The style with target='${n}' is mounted in count mode.`):a<=1?(K(e),t.els=i.filter(t=>t!==e)):Y(e,a-1):a===null?(K(e),t.els=i.filter(t=>t!==e)):console.error(`[css-render/unmount]: The style with target='${n}' is mounted in no-count mode.`)}}}function me(e,t){e.push(t)}function he(e,t,n,r,i,a,o,s,c){if(o&&!c){if(n===void 0){console.error("[css-render/mount]: `id` is required in `boost` mode.");return}let i=window.__cssrContext;i[n]||(i[n]=!0,G(t,e,r,o));return}let l,{els:u}=t,d;if(n===void 0&&(d=t.render(r),n=h(d)),c){c(n,d??t.render(r));return}let f=q(n);if(s||f===null){if(l=f===null?pe(n):f,d===void 0&&(d=t.render(r)),l.textContent=d,f!==null)return;if(i){let e=document.head.getElementsByTagName(`style`)[0]||null;document.head.insertBefore(l,e)}else document.head.appendChild(l);a&&Y(l,1),me(u,l)}else{let e=J(f);a?e===null?console.error(`[css-render/mount]: The style with id='${n}' has been mounted in no-count mode.`):Y(f,e+1):e!==null&&console.error(`[css-render/mount]: The style with id='${n}' has been mounted in count mode.`)}return f??l}function ge(e){return G(this,this.instance,e)}function _e(e={}){let{target:t,id:n,ssr:r,props:i,count:a=!1,head:o=!1,boost:s=!1,force:c=!1}=e;return he(this.instance,this,n??t,i,o,a,s,c,r)}function ve(e={}){let{id:t,target:n,delay:r=0,count:i=!1}=e;r===0?X(this.instance,this,t??n,i):setTimeout(()=>X(this.instance,this,t??n,i),r)}var Z=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:ge,mount:_e,unmount:ve}},ye=function(e,t,n,r){return Array.isArray(t)?Z(e,{$:null},null,t):Array.isArray(n)?Z(e,t,null,n):Array.isArray(r)?Z(e,t,n,r):Z(e,t,n,null)};function be(e={}){let t=null,n={c:((...e)=>ye(n,...e)),use:(e,...t)=>e.install(n,...t),find:q,context:{},config:e,get __styleSheet(){if(!t){let e=document.createElement(`style`);return document.head.appendChild(e),t=document.styleSheets[document.styleSheets.length-1],t}return t}};return n}var{c:Q}=be(),xe=Q(`.xicon`,{width:`1em`,height:`1em`,display:`inline-flex`},[Q(`svg`,{width:`1em`,height:`1em`}),Q(`svg:not([fill])`,{fill:`currentColor`})]),Se=()=>{xe.mount({id:`xicons-icon`})},Ce={size:[String,Number],color:String,tag:String},$=Symbol(`IconConfigInjection`);v({name:`IconConfigProvider`,props:Ce,setup(e,{slots:t}){return n($,e),()=>c(t,`default`)}});var we=`span`,Te=v({name:`Icon`,props:Ce,setup(t,{slots:n}){let r=a($,null),o=p(()=>{let e=t.size??r?.size;if(e!==void 0)return typeof e==`number`||/^\d+$/.test(e)?`${e}px`:e}),s=p(()=>{let{color:e}=t;return e===void 0?r?r.color:void 0:e}),l=p(()=>{let{tag:e}=t;return e===void 0?r?.tag??we:e});return e(()=>{Se()}),()=>i(l.value,{class:`xicon`,style:{color:s.value,fontSize:o.value}},[c(n,`default`)])}}),Ee=ee(`ui`,()=>{let e=u([]),t=u(null),n=u(!0),r=0;async function i(){let i=j(),a=i.getToken(),o=++r;e.value=[],t.value=null,n.value=!0;try{let n=await A().GetPermissions({});if(o!==r)return;a===i.getToken()&&(e.value=n.permissions||[]),(n.environment===`prod`||n.environment===`venue`)&&(t.value=n.environment)}catch(e){if(o===r)throw e}finally{o===r&&(n.value=!1)}}return{permissions:e,environment:t,isLoadingEnvironment:n,load:i}});export{M as a,N as c,re as i,Te as n,F as o,ie as r,P as s,Ee as t};