wireguard-dashboard/web/static/js/dark-CUaA1YYV.js

82 lines
19 KiB
JavaScript
Raw Normal View History

2024-05-24 17:31:41 +08:00
var re=Object.defineProperty;var O=Object.getOwnPropertySymbols;var ie=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var Q=(t,e,o)=>e in t?re(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,D=(t,e)=>{for(var o in e||(e={}))ie.call(e,o)&&Q(t,o,e[o]);if(O)for(var o of O(e))de.call(e,o)&&Q(t,o,e[o]);return t};var U=(t,e,o)=>new Promise((n,l)=>{var i=r=>{try{f(o.next(r))}catch(m){l(m)}},y=r=>{try{f(o.throw(r))}catch(m){l(m)}},f=r=>r.done?n(r.value):Promise.resolve(r.value).then(i,y);f((o=o.apply(t,e)).next())});import{aq as z,H as v,dq as ce,S as G,C as q,N as T,G as k,D as C,ai as fe,E as J,r as N,dr as me,I,ds as Z,dt as he,du as ge,F as pe,z as ve,dv as be,dw as Te,T as Ce,J as ye,a9 as ke,a3 as V,dn as w,v as Se,R as Ae,dx as Be,o as _,f as ee,g as H}from"./index-C6A9XM5L.js";function Me(){const{$storage:t,$config:e}=z(),o=()=>{var i,y,f,r,m,b,A,B,g,S,u,s,c,h,d;ce().multiTagsCache&&(!t.tags||t.tags.length===0)&&(t.tags=G),t.layout||(t.layout={layout:(i=e==null?void 0:e.Layout)!=null?i:"vertical",theme:(y=e==null?void 0:e.Theme)!=null?y:"light",darkMode:(f=e==null?void 0:e.DarkMode)!=null?f:!1,sidebarStatus:(r=e==null?void 0:e.SidebarStatus)!=null?r:!0,epThemeColor:(m=e==null?void 0:e.EpThemeColor)!=null?m:"#409EFF",themeColor:(b=e==null?void 0:e.Theme)!=null?b:"light",overallStyle:(A=e==null?void 0:e.OverallStyle)!=null?A:"light"}),t.configure||(t.configure={grey:(B=e==null?void 0:e.Grey)!=null?B:!1,weak:(g=e==null?void 0:e.Weak)!=null?g:!1,hideTabs:(S=e==null?void 0:e.HideTabs)!=null?S:!1,hideFooter:(u=e.HideFooter)!=null?u:!0,showLogo:(s=e==null?void 0:e.ShowLogo)!=null?s:!0,showModel:(c=e==null?void 0:e.ShowModel)!=null?c:"smart",multiTagsCache:(h=e==null?void 0:e.MultiTagsCache)!=null?h:!1,stretch:(d=e==null?void 0:e.Stretch)!=null?d:!1})},n=v(()=>t==null?void 0:t.layout.layout),l=v(()=>t.layout);return{layout:n,layoutTheme:l,initStorage:o}}const we=q({id:"pure-app",state:()=>{var t,e,o,n;return{sidebar:{opened:(e=(t=T().getItem(`${k()}layout`))==null?void 0:t.sidebarStatus)!=null?e:C().SidebarStatus,withoutAnimation:!1,isClickCollapse:!1},layout:(n=(o=T().getItem(`${k()}layout`))==null?void 0:o.layout)!=null?n:C().Layout,device:fe()?"mobile":"desktop",viewportSize:{width:document.documentElement.clientWidth,height:document.documentElement.clientHeight}}},getters:{getSidebarStatus(t){return t.sidebar.opened},getDevice(t){return t.device},getViewportWidth(t){return t.viewportSize.width},getViewportHeight(t){return t.viewportSize.height}},actions:{TOGGLE_SIDEBAR(t,e){const o=T().getItem(`${k()}layout`);t&&e?(this.sidebar.withoutAnimation=!0,this.sidebar.opened=!0,o.sidebarStatus=!0):!t&&e?(this.sidebar.withoutAnimation=!0,this.sidebar.opened=!1,o.sidebarStatus=!1):!t&&!e&&(this.sidebar.withoutAnimation=!1,this.sidebar.opened=!this.sidebar.opened,this.sidebar.isClickCollapse=!this.sidebar.opened,o.sidebarStatus=this.sidebar.opened),T().setItem(`${k()}layout`,o)},toggleSideBar(t,e){return U(this,null,function*(){yield this.TOGGLE_SIDEBAR(t,e)})},toggleDevice(t){this.device=t},setLayout(t){this.layout=t},setViewportSize(t){this.viewportSize=t},setSortSwap(t){this.sortSwap=t}}});function te(){return we(J)}const xe=q({id:"pure-epTheme",state:()=>{var t,e,o,n;return{epThemeColor:(e=(t=T().getItem(`${k()}layout`))==null?void 0:t.epThemeColor)!=null?e:C().EpThemeColor,epTheme:(n=(o=T().getItem(`${k()}layout`))==null?void 0:o.theme)!=null?n:C().Theme}},getters:{getEpThemeColor(t){return t.epThemeColor},fill(t){return t.epTheme==="light"?"#409eff":"#fff"}},actions:{setEpThemeColor(t){const e=T().getItem(`${k()}layout`);this.epTheme=e==null?void 0:e.theme,this.epThemeColor=t,e&&(e.epThemeColor=t,T().setItem(`${k()}layout`,e))}}});function L(){return xe(J)}const R={outputDir:"",defaultScopeName:"",includeStyleWithColors:[],extract:!0,themeLinkTagId:"theme-link-tag",themeLinkTagInjectTo:"head",removeCssScopeName:!1,customThemeCssFileName:null,arbitraryMode:!1,defaultPrimaryColor:"",customThemeOutputPath:"E:/Workspace/NodeJs/wireguard-dashboard-admin/node_modules/.pnpm/@pureadmin+theme@3.2
$subMenuActiveText: #000000d9 !default;
$menuBg: #fff !default;
$menuHover: #f6f6f6 !default;
$subMenuBg: #fff !default;
$subMenuActiveBg: #e0ebf6 !default;
$menuText: rgb(0 0 0 / 60%) !default;
$sidebarLogo: #fff !default;
$menuTitleHover: #000 !default;
$menuActiveBefore: #4091f7 !default;
`},{scopeName:"layout-theme-default",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #001529 !default;
$menuHover: rgb(64 145 247 / 15%) !default;
$subMenuBg: #0f0303 !default;
$subMenuActiveBg: #4091f7 !default;
$menuText: rgb(254 254 254 / 65%) !default;
$sidebarLogo: #002140 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #4091f7 !default;
`},{scopeName:"layout-theme-saucePurple",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #130824 !default;
$menuHover: rgb(105 58 201 / 15%) !default;
$subMenuBg: #000 !default;
$subMenuActiveBg: #693ac9 !default;
$menuText: #7a80b4 !default;
$sidebarLogo: #1f0c38 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #693ac9 !default;
`},{scopeName:"layout-theme-pink",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #28081a !default;
$menuHover: rgb(216 68 147 / 15%) !default;
$subMenuBg: #000 !default;
$subMenuActiveBg: #d84493 !default;
$menuText: #7a80b4 !default;
$sidebarLogo: #3f0d29 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #d84493 !default;
`},{scopeName:"layout-theme-dusk",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #2a0608 !default;
$menuHover: rgb(225 60 57 / 15%) !default;
$subMenuBg: #000 !default;
$subMenuActiveBg: #e13c39 !default;
$menuText: rgb(254 254 254 / 65.1%) !default;
$sidebarLogo: #42090c !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #e13c39 !default;
`},{scopeName:"layout-theme-volcano",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #2b0e05 !default;
$menuHover: rgb(232 95 51 / 15%) !default;
$subMenuBg: #0f0603 !default;
$subMenuActiveBg: #e85f33 !default;
$menuText: rgb(254 254 254 / 65%) !default;
$sidebarLogo: #441708 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #e85f33 !default;
`},{scopeName:"layout-theme-mingQing",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #032121 !default;
$menuHover: rgb(89 191 193 / 15%) !default;
$subMenuBg: #000 !default;
$subMenuActiveBg: #59bfc1 !default;
$menuText: #7a80b4 !default;
$sidebarLogo: #053434 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #59bfc1 !default;
`},{scopeName:"layout-theme-auroraGreen",varsContent:`
$subMenuActiveText: #fff !default;
$menuBg: #0b1e15 !default;
$menuHover: rgb(96 172 128 / 15%) !default;
$subMenuBg: #000 !default;
$subMenuActiveBg: #60ac80 !default;
$menuText: #7a80b4 !default;
$sidebarLogo: #112f21 !default;
$menuTitleHover: #fff !default;
$menuActiveBefore: #60ac80 !default;
`}]},He="/web/",Ee="assets",oe=t=>{let e=t.replace("#","").match(/../g);for(let o=0;o<3;o++)e[o]=parseInt(e[o],16);return e},ne=(t,e,o)=>{let n=[t.toString(16),e.toString(16),o.toString(16)];for(let l=0;l<3;l++)n[l].length==1&&(n[l]=`0${n[l]}`);return`#${n.join("")}`},Fe=(t,e)=>{let o=oe(t);for(let n=0;n<3;n++)o[n]=Math.floor(o[n]*(1-e));return ne(o[0],o[1],o[2])},Ne=(t,e)=>{let o=oe(t);for(let n=0;n<3;n++)o[n]=Math.floor((255-o[n])*e+o[n]);return ne(o[0],o[1],o[2])},$=t=>`(^${t}\\s+|\\s+${t}\\s+|\\s+${t}$|^${t}$)`,X=({scopeName:t,multipleScopeVars:e})=>{const o=Array.isArray(e)&&e.length?e:R.multipleScopeVars;let n=document.documentElement.className;new RegExp($(t)).test(n)||(o.forEach(l=>{n=n.replace(new RegExp($(l.scopeName),"g"),` ${t} `)}),document.documentElement.className=n.replace(/(^\s+|\s+$)/g,""))},K=({id:t,href:e})=>{const o=document.createElement("link");return o.rel="stylesheet",o.href=e,o.id=t,o},Le=t=>{const e=D({scopeName:"theme-default",customLinkHref:i=>i},t),o=e.themeLinkTagId||R.themeLinkTagId;let n=document.getElementById(o);const l=e.customLinkHref(`${He.replace(/\/$/,"")}${`/${Ee}/${e.scopeName}.css`.replace(/\/+(?=\/)/g,"")}`);if(n){n.id=`${o}_old`;const i=K({id:o,href:l});n.nextSibling?n.parentNode.insertBefore(i,n.nextSibling):n.parentNode.appendChild(i),i.onload=()=>{setTimeout(()=>{n.parentNode.removeChild(n),n=null},60),X(e)};return}n=K({id:o,href:l}),X(e),document[(e.themeLinkTagInjectTo||R.themeLinkTagInjectTo||"").replace("-prepend","")].appendChild(n)};function Ye(){var g,S;const{layoutTheme:t,layout:e}=Me(),o=N([{color:"#ffffff",themeColor:"light"},{color:"#1b2a47",themeColor:"default"},{color:"#722ed1",themeColor:"saucePurple"},{color:"#eb2f96",themeColor:"pink"},{color:"#f5222d",themeColor:"dusk"},{color:"#fa541c",themeColor:"volcano"},{color:"#13c2c2",themeColor:"mingQing"},{color:"#52c41a",themeColor:"auroraGreen"}]),{$storage:n}=z(),l=N((g=n==null?void 0:n.layout)==null?void 0:g.darkMode),i=N((S=n==null?void 0:n.layout)==null?void 0:S.overallStyle),y=document.documentElement;function f(u,s,c){const h=c||document.body;let{className:d}=h;d=d.replace(s,"").trim(),h.className=u?`${d} ${s}`:d}function r(u=(c=>(c=C().Theme)!=null?c:"light")(),s=!0){var d,x;t.value.theme=u,Le({scopeName:`layout-theme-${u}`});const h=n.layout.themeColor;if(n.layout={layout:e.value,theme:u,darkMode:l.value,sidebarStatus:(d=n.layout)==null?void 0:d.sidebarStatus,epThemeColor:(x=n.layout)==null?void 0:x.epThemeColor,themeColor:s?u:h,overallStyle:i.value},u==="default"||u==="light")b(C().EpThemeColor);else{const E=o.value.find(F=>F.themeColor===u);b(E.color)}}function m(u,s,c){document.documentElement.style.setProperty(`--el-color-primary-${u}-${s}`,l.value?Fe(c,s/10):Ne(c,s/10))}const b=u=>{L().setEpThemeColor(u),document.documentElement.style.setProperty("--el-color-primary",u);for(let s=1;s<=2;s++)m("dark",s,u);for(let s=1;s<=9;s++)m("light",s,u)};function A(u){i.value=u,L().epTheme==="light"&&l.value?r("default",!1):r(L().epTheme,!1),l.value?document.documentElement.classList.add("dark"):(n.layout.themeColor==="light"&&r("light",!1),document.documentElement.classList.remove("dark"))}function B(){me(),T().clear();const{Grey:u,Weak:s,MultiTagsCache:c,EpThemeColor:h,Layout:d}=C();te().setLayout(d),b(h),I().multiTagsCacheChange(c),f(u,"html-grey",document.querySelector("html")),f(s,"html-weakness",document.querySelector("html")),Z.push("/login"),I().handleTags("equal",[...G]),he()}return{body:y,dataTheme:l,overallStyle:i,layoutTheme:t,themeColors:o,onReset:B,toggleClass:f,dataThemeChange:A,setEpThemeColor:b,setLayoutThemeColor:r}}const Y=ge(),Re="data:image/jpeg;base64,UklGRmYOAABXRUJQVlA4IFoOAAAQPQCdASqgAKAAPpFAmUmlo6IhJ7QNCLASCWcA01jzvtXkd+e8PfQR8n9x+YE0x/jewXtJ/evELd/2hfe/wANTLxF7AH6relXfsfhfUA/mv+C/8vtG/5fk2+r/YP8tr2Nfux7QH7SoPowKWqebxRdiSHmrH8GFmBdIomdQIFF4frYQyE//T/aGcL3+FRAkAsiuczHtKa13CwIplr9pJQkxHn6ANFik/bKaRSqBaWkRgZ1jh/CKclp/V7mWRVVkZtXuB9i5QNP3rELhaIyov6wkHur5Zueg2P04hxkPepJNFYretFoB1NkIY7/S3u3VF6QCWL0eM1hdGC/WMWKIaWlIRB+fifyD3RvAl91QkNzBHHir2n2PVeGljtpHNKa87Ps/EYFB4EScf4nGL0YoOtbdH5X0V2Ojhp