ray-template/js/utils-CWEcFevi.js

2 lines
8.6 KiB
JavaScript

const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/en-US-CXdTftFx.js","js/directives-jkwfeMNs.js","js/toString-BWDzaUQG.js","js/Close-D8ap5Wyu.js","js/_toKey-BqfG5Sv9.js","js/InputNumber-Bc7oBMaF.js","js/preload-helper-B5zr4nmU.js","js/schema-rQn3Oa0L.js","css/directives-pj3e2iol.css","js/combine-i18n-messages-BgygAwb_.js","js/zh-CN-B6MTvn10.js"])))=>i.map(i=>d[i]);
import{W as e,a as t,c as n,p as r}from"./toString-BWDzaUQG.js";import{n as i,t as a}from"./_toKey-BqfG5Sv9.js";import{t as o}from"./preload-helper-B5zr4nmU.js";var s=`https://xiaodaigua-ray.github.io/ray-template/docs/`,c={darkClassName:`r-template--dark`,lightClassName:`r-template--light`,preLoadingAnimation:`pre-loading-animation`,htmlHeight:`--html-height`,htmlWidth:`--html-width`},l={max:5,closable:!1},u=`loading`,d={signing:`signing`,localeLanguage:`localeLanguage`,token:`token`,appMenuKey:`menuKey`,appPiniaSettingStore:`piniaSettingStore`,appPiniaKeepAliveStore:`piniaKeepAliveStore`,appPiniaMenuStore:`piniaMenuStore`,appPiniaSigningStore:`piniaSigningStore`,appVersionProvider:`appVersionProvider`,isAppLockScreen:`isAppLockScreen`,appGlobalSearchOptions:`appGlobalSearchOptions`,appMenuTagOptions:`appMenuTagOptions`,appLockScreenPasswordKey:`appLockScreenPasswordKey`},f=[{label:`无`,value:`none`},{label:`缩放出现`,value:`scale`},{label:`缩放消退`,value:`fade-scale`},{label:`滑入出现`,value:`fade-slide`},{label:`淡入消退`,value:`opacity`},{label:`底部消退`,value:`fade-bottom`},{label:`向上浮入`,value:`slide-up`},{label:`向左滑入`,value:`slide-left`}],p={primaryColor:`#3b63d9`,primaryFadeColor:`rgba(59, 99, 217, 0.85)`},m={Card:{borderRadius:`12px`,titleFontSizeMedium:`16px`,paddingMedium:`20px 24px`},Menu:{itemHeight:`40px`,borderRadius:`8px`},Button:{fontWeight:`500`},Tag:{borderRadius:`5px`}},h={dark:{...m,common:{borderRadius:`8px`,fontWeightStrong:`600`,lineHeight:`1.6`,heightMedium:`36px`,heightSmall:`30px`,bodyColor:`#101722`,cardColor:`#172131`,modalColor:`#192638`,popoverColor:`#192638`,actionColor:`#1c293b`,textColor1:`#e9eef7`,textColor2:`#b3c0d3`,textColor3:`#a0b0c6`,placeholderColor:`#a0b0c6`,borderColor:`#687b96`,dividerColor:`#2c394d`,hoverColor:`rgba(179, 192, 211, 0.08)`,primaryColor:`#aabaff`,primaryColorHover:`#c4ceff`,primaryColorPressed:`#96a9fa`,primaryColorSuppl:`#aabaff`,boxShadow1:`0 1px 2px rgb(0 0 0 / 10%), 0 8px 24px rgb(0 0 0 / 10%)`},Layout:{siderColor:`#172131`,headerColor:`#172131`}},light:{...m,common:{borderRadius:`8px`,fontWeightStrong:`600`,lineHeight:`1.6`,heightMedium:`36px`,heightSmall:`30px`,bodyColor:`#f5f7fb`,cardColor:`#ffffff`,modalColor:`#ffffff`,popoverColor:`#ffffff`,actionColor:`#f7f9fc`,textColor1:`#1d2a3e`,textColor2:`#52647c`,textColor3:`#617187`,placeholderColor:`#617187`,borderColor:`#8492a8`,dividerColor:`#e4e9f1`,hoverColor:`rgba(82, 100, 124, 0.06)`,primaryColor:p.primaryColor,primaryColorHover:`#4b70df`,primaryColorPressed:`#2b50be`,primaryColorSuppl:p.primaryColor,boxShadow1:`0 1px 2px rgb(25 43 74 / 3%), 0 6px 20px rgb(25 43 74 / 3%)`},Layout:{siderColor:`#ffffff`,headerColor:`#ffffff`}}},g={Card:{borderRadius:`20px`},Button:{fontWeight:`500`,borderRadiusSmall:`999px`,borderRadiusMedium:`999px`,borderRadiusLarge:`999px`},Menu:{itemHeight:`44px`,borderRadius:`24px`},Tag:{borderRadius:`8px`},DataTable:{borderRadius:`16px`}},_={Card:{borderRadius:`2px`},Menu:{itemHeight:`36px`,borderRadius:`2px`},Tag:{borderRadius:`2px`}},v=[`modern`,`naive`,`material`,`plain`],y=`modern`,b=e=>v.find(t=>t===e)??`modern`,x={naive:{light:{},dark:{}},modern:h,material:{light:{...g,common:{primaryColor:`#655292`,primaryColorHover:`#755fa4`,primaryColorPressed:`#514178`,primaryColorSuppl:`#655292`,borderRadius:`12px`,heightMedium:`40px`,bodyColor:`#f5f1fa`,cardColor:`#fffaff`,actionColor:`#efe8f7`,popoverColor:`#fffaff`,modalColor:`#fffaff`,textColor1:`#201a29`,textColor2:`#433a50`,textColor3:`#61566c`,borderColor:`#8c8199`,dividerColor:`#e1d8ea`,boxShadow1:`0 2px 6px rgb(46 31 65 / 14%)`},Layout:{siderColor:`#fffaff`,headerColor:`#fffaff`}},dark:{...g,common:{primaryColor:`#d6bbff`,primaryColorHover:`#e4d1ff`,primaryColorPressed:`#bf9ff1`,primaryColorSuppl:`#d6bbff`,borderRadius:`12px`,heightMedium:`40px`,bodyColor:`#16121c`,cardColor:`#241e2c`,actionColor:`#302838`,popoverColor:`#2b2433`,modalColor:`#2b2433`,textColor1:`#f1e7fa`,textColor2:`#ded0e8`,textColor3:`#b9a9c4`,borderColor:`#867791`,dividerColor:`#473c52`},Layout:{siderColor:`#241e2c`,headerColor:`#241e2c`}}},plain:{light:{..._,common:{primaryColor:`#454545`,primaryColorHover:`#555555`,primaryColorPressed:`#292929`,primaryColorSuppl:`#454545`,borderRadius:`2px`,bodyColor:`#f5f5f5`,actionColor:`#eeeeee`,boxShadow1:`none`,boxShadow2:`none`,boxShadow3:`none`}},dark:{..._,common:{primaryColor:`#d5d5d5`,primaryColorHover:`#ededed`,primaryColorPressed:`#bdbdbd`,primaryColorSuppl:`#d5d5d5`,borderRadius:`2px`,bodyColor:`#161616`,cardColor:`#202020`,popoverColor:`#252525`,modalColor:`#252525`,actionColor:`#2b2b2b`,boxShadow1:`none`,boxShadow2:`none`,boxShadow3:`none`},Layout:{siderColor:`#202020`,headerColor:`#202020`}}}},S=(e,t)=>({"--r-token-primary":e.primaryColor,"--r-token-primary-hover":e.primaryColorHover,"--r-token-canvas":e.bodyColor,"--r-token-surface":e.cardColor,"--r-token-surface-muted":e.actionColor,"--r-token-surface-hover":`color-mix(in srgb, ${e.textColor1} 9%, ${e.cardColor})`,"--r-token-divider":e.dividerColor,"--r-token-border":e.borderColor,"--r-token-text":e.textColor1,"--r-token-text-secondary":e.textColor2,"--r-token-text-muted":e.textColor3,"--r-token-shadow":e.boxShadow1,"--r-token-radius":typeof t.Card?.borderRadius==`string`?t.Card.borderRadius:e.borderRadius,"--r-token-control-radius":e.borderRadius}),C={appThemeColors:[`#3b63d9`,`#3f9eff`,`#ff42bc`,`#ee4f12`,`#dbcb02`,`#18a058`],appPrimaryColor:p,appNaiveUIThemeOverrides:h,echartTheme:`macarons`},w=[{key:`zh-CN`,label:`中文(简体)`},{key:`en-US`,label:`English(US)`}],T=`zh-CN`,E=`zh-CN`,D={"zh-CN":`zh-cn`,"en-US":`en`},O=`zh-cn`,k=e(null),A=e(null),j={setupRouterLoadingBar:!0,setupRouterGuard:!0},M=[`RLogin`,`ErrorPage`,`RayTemplateDoc`],N=[];function P(e,o,s,c){if(!r(e))return e;o=i(o,e);for(var l=-1,u=o.length,d=u-1,f=e;f!=null&&++l<u;){var p=a(o[l]),m=s;if(p===`__proto__`||p===`constructor`||p===`prototype`)return e;if(l!=d){var h=f[p];m=c?c(h,p,f):void 0,m===void 0&&(m=r(h)?h:n(o[l+1])?[]:{})}t(f,p,m),f=f[p]}return e}var F=(e,t,n)=>{let r=t.lastIndexOf(`?`),i=e[r===-1||r<t.lastIndexOf(`/`)?t:t.slice(0,r)];return i?typeof i==`function`?i():Promise.resolve(i):new Promise((e,r)=>{(typeof queueMicrotask==`function`?queueMicrotask:setTimeout)(r.bind(null,Error(`Unknown variable dynamic import: `+t+(t.split(`/`).length===n?``:`. Note that variables only represent file names one level deep.`))))})},I=async e=>{let t={};for(let n of e){let e=await F(Object.assign({"../lang/en-US.ts":()=>o(()=>import(`./en-US-CXdTftFx.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9])),"../lang/zh-CN.ts":()=>o(()=>import(`./zh-CN-B6MTvn10.js`),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))}),`../lang/${n.key}.ts`,3),r=n.key;r&&(t[r]=e?.default?.message??{})}return t},L=(e,t)=>{let{customPrefix:n}=t??{};return n?`${n}${e}`:`${e}`},R=()=>{let e=new Map;return{get length(){return e.size},key:t=>Array.from(e.keys())[t]??null,getItem:t=>e.get(t)??null,setItem:(t,n)=>{e.set(t,n)},removeItem:t=>{e.delete(t)},clear:()=>e.clear()}},z;function B(){z={localStorage:R(),sessionStorage:R()}}var V=(e=`sessionStorage`)=>e===`localStorage`?z?.localStorage??window.localStorage:z?.sessionStorage??window.sessionStorage,H=(e,t)=>t?.prefix?L(e,{customPrefix:t.prefixKey}):e;function U(e,t=`sessionStorage`,n){try{return V(t).getItem(H(e,n))!==null}catch{return!1}}function W(e,t,n=`sessionStorage`,r){if(e)try{let i=JSON.stringify(t);if(i===void 0)throw TypeError(`Value is not JSON serializable.`);V(n).setItem(H(e,r),i)}catch{}}function G(e,t=`sessionStorage`,n){let r=n?.defaultValue??null;try{let i=V(t).getItem(H(e,n));return i===null?r:JSON.parse(i)}catch{return r}}var K=(e,t,n)=>{if(!e)return;let r=(t,r=!1)=>{try{let i=V(t);if(!r){i.removeItem(H(e,n));return}let a=H(``,n);if(!a){i.clear();return}for(let e=i.length-1;e>=0;e--){let t=i.key(e);t?.startsWith(a)&&i.removeItem(t)}}catch{}};switch(e){case`__all__`:r(`localStorage`,!0),r(`sessionStorage`,!0);break;case`__all_sessionStorage__`:r(`sessionStorage`,!0);break;case`__all_localStorage__`:r(`localStorage`,!0);break;default:r(t===`localStorage`?`localStorage`:`sessionStorage`)}},q=()=>G(d.localeLanguage,`localStorage`,{defaultValue:T});export{l as A,b as C,u as D,d as E,f as O,S,v as T,O as _,W as a,C as b,L as c,k as d,A as f,D as g,M as h,K as i,s as j,c as k,I as l,N as m,G as n,V as o,j as p,U as r,B as s,q as t,P as u,w as v,x as w,y as x,E as y};