69 lines
533 KiB
JavaScript
Raw Normal View History

2024-06-18 03:16:42 +08:00
var f1=Object.defineProperty;var p1=(e,t,s)=>t in e?f1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var it=(e,t,s)=>(p1(e,typeof t!="symbol"?t+"":t,s),s);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const r of o.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&n(r)}).observe(document,{childList:!0,subtree:!0});function s(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=s(i);fetch(i.href,o)}})();var Jp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function g1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function m1(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var s=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};s.prototype=t.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(s,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}),s}var _1={exports:{}},Se="top",Re="bottom",Ne="right",Ae="left",Na="auto",Yi=[Se,Re,Ne,Ae],Jn="start",Ci="end",Qp="clippingParents",td="viewport",_i="popper",Zp="reference",lc=Yi.reduce(function(e,t){return e.concat([t+"-"+Jn,t+"-"+Ci])},[]),ed=[].concat(Yi,[Na]).reduce(function(e,t){return e.concat([t,t+"-"+Jn,t+"-"+Ci])},[]),tg="beforeRead",eg="read",sg="afterRead",ng="beforeMain",ig="main",og="afterMain",rg="beforeWrite",ag="write",lg="afterWrite",cg=[tg,eg,sg,ng,ig,og,rg,ag,lg];function bs(e){return e?(e.nodeName||"").toLowerCase():null}function Fe(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Qn(e){var t=Fe(e).Element;return e instanceof t||e instanceof Element}function Xe(e){var t=Fe(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function sd(e){if(typeof ShadowRoot>"u")return!1;var t=Fe(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function b1(e){var t=e.state;Object.keys(t.elements).forEach(function(s){var n=t.styles[s]||{},i=t.attributes[s]||{},o=t.elements[s];!Xe(o)||!bs(o)||(Object.assign(o.style,n),Object.keys(i).forEach(function(r){var a=i[r];a===!1?o.removeAttribute(r):o.setAttribute(r,a===!0?"":a)}))})}function v1(e){var t=e.state,s={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,s.popper),t.styles=s,t.elements.arrow&&Object.assign(t.elements.arrow.style,s.arrow),function(){Object.keys(t.elements).forEach(function(n){var i=t.elements[n],o=t.attributes[n]||{},r=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:s[n]),a=r.reduce(function(l,c){return l[c]="",l},{});!Xe(i)||!bs(i)||(Object.assign(i.style,a),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const nd={name:"applyStyles",enabled:!0,phase:"write",fn:b1,effect:v1,requires:["computeStyles"]};function gs(e){return e.split("-")[0]}var zn=Math.max,ma=Math.min,$i=Math.round;function cc(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function dg(){return!/^((?!chrome|android).)*safari/i.test(cc())}function Pi(e,t,s){t===void 0&&(t=!1),s===void 0&&(s=!1);var n=e.getBoundingClientRect(),i=1,o=1;t&&Xe(e)&&(i=e.offsetWidth>0&&$i(n.width)/e.offsetWidth||1,o=e.offsetHeight>0&&$i(n.height)/e.offsetHeight||1);var r=Qn(e)?Fe(e):window,a=r.visualViewport,l=!dg()&&s,c=(n.left+(l&&a?a.offsetLeft:0))
* Bootstrap v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
2024-06-18 03:16:42 +08:00
*/(function(e,t){(function(s,n){e.exports=n(rx)})(Jp,function(s){function n(k){const h=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(k){for(const _ in k)if(_!=="default"){const O=Object.getOwnPropertyDescriptor(k,_);Object.defineProperty(h,_,O.get?O:{enumerable:!0,get:()=>k[_]})}}return h.default=k,Object.freeze(h)}const i=n(s),o=new Map,r={set(k,h,_){o.has(k)||o.set(k,new Map);const O=o.get(k);if(!O.has(h)&&O.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(O.keys())[0]}.`);return}O.set(h,_)},get(k,h){return o.has(k)&&o.get(k).get(h)||null},remove(k,h){if(!o.has(k))return;const _=o.get(k);_.delete(h),_.size===0&&o.delete(k)}},a=1e6,l=1e3,c="transitionend",d=k=>(k&&window.CSS&&window.CSS.escape&&(k=k.replace(/#([^\s"#']+)/g,(h,_)=>`#${CSS.escape(_)}`)),k),u=k=>k==null?`${k}`:Object.prototype.toString.call(k).match(/\s([a-z]+)/i)[1].toLowerCase(),f=k=>{do k+=Math.floor(Math.random()*a);while(document.getElementById(k));return k},g=k=>{if(!k)return 0;let{transitionDuration:h,transitionDelay:_}=window.getComputedStyle(k);const O=Number.parseFloat(h),U=Number.parseFloat(_);return!O&&!U?0:(h=h.split(",")[0],_=_.split(",")[0],(Number.parseFloat(h)+Number.parseFloat(_))*l)},m=k=>{k.dispatchEvent(new Event(c))},b=k=>!k||typeof k!="object"?!1:(typeof k.jquery<"u"&&(k=k[0]),typeof k.nodeType<"u"),v=k=>b(k)?k.jquery?k[0]:k:typeof k=="string"&&k.length>0?document.querySelector(d(k)):null,w=k=>{if(!b(k)||k.getClientRects().length===0)return!1;const h=getComputedStyle(k).getPropertyValue("visibility")==="visible",_=k.closest("details:not([open])");if(!_)return h;if(_!==k){const O=k.closest("summary");if(O&&O.parentNode!==_||O===null)return!1}return h},E=k=>!k||k.nodeType!==Node.ELEMENT_NODE||k.classList.contains("disabled")?!0:typeof k.disabled<"u"?k.disabled:k.hasAttribute("disabled")&&k.getAttribute("disabled")!=="false",$=k=>{if(!document.documentElement.attachShadow)return null;if(typeof k.getRootNode=="function"){const h=k.getRootNode();return h instanceof ShadowRoot?h:null}return k instanceof ShadowRoot?k:k.parentNode?$(k.parentNode):null},T=()=>{},y=k=>{k.offsetHeight},x=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,C=[],S=k=>{document.readyState==="loading"?(C.length||document.addEventListener("DOMContentLoaded",()=>{for(const h of C)h()}),C.push(k)):k()},P=()=>document.documentElement.dir==="rtl",M=k=>{S(()=>{const h=x();if(h){const _=k.NAME,O=h.fn[_];h.fn[_]=k.jQueryInterface,h.fn[_].Constructor=k,h.fn[_].noConflict=()=>(h.fn[_]=O,k.jQueryInterface)}})},I=(k,h=[],_=k)=>typeof k=="function"?k(...h):_,N=(k,h,_=!0)=>{if(!_){I(k);return}const U=g(h)+5;let nt=!1;const et=({target:$t})=>{$t===h&&(nt=!0,h.removeEventListener(c,et),I(k))};h.addEventListener(c,et),setTimeout(()=>{nt||m(h)},U)},Q=(k,h,_,O)=>{const U=k.length;let nt=k.indexOf(h);return nt===-1?!_&&O?k[U-1]:k[0]:(nt+=_?1:-1,O&&(nt=(nt+U)%U),k[Math.max(0,Math.min(nt,U-1))])},G=/[^.]*(?=\..*)\.|.*/,V=/\..*/,L=/::\d+$/,W={};let K=1;const ot={mouseenter:"mouseover",mouseleave:"mouseout"},ut=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function bt(k,h){return h&&`${h}::${K++}`||k.uidEvent||K++}function _t(k){const h=bt(k);return k.uidEvent=h,W[h]=W[h]||{},W[h]}function Pt(k,h){return function _(O){return Mt(O,{delegateTarget:k}),_.oneOff&&B.off(k,O.type,h),h.apply(k,[O])}}function At(k,h,_){return function O(U){const nt=k.querySelectorAll(h);for(let{target:et}=U;et&&et!==this;et=et.parentNode)for(const $t of nt)if($t===et)return Mt(U,{delegateTarget:et})
* @vue/shared v3.4.29
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**//*! #__NO_SIDE_EFFECTS__ */function hd(e,t){const s=new Set(e.split(","));return t?n=>s.has(n.toLowerCase()):n=>s.has(n)}const Yt={},yi=[],Ye=()=>{},ax=()=>!1,Va=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),fd=e=>e.startsWith("onUpdate:"),ee=Object.assign,pd=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},lx=Object.prototype.hasOwnProperty,Nt=(e,t)=>lx.call(e,t),gt=Array.isArray,xi=e=>tr(e)==="[object Map]",qi=e=>tr(e)==="[object Set]",lh=e=>tr(e)==="[object Date]",wt=e=>typeof e=="function",se=e=>typeof e=="string",Ns=e=>typeof e=="symbol",Ut=e=>e!==null&&typeof e=="object",wg=e=>(Ut(e)||wt(e))&&wt(e.then)&&wt(e.catch),Eg=Object.prototype.toString,tr=e=>Eg.call(e),cx=e=>tr(e).slice(8,-1),Sg=e=>tr(e)==="[object Object]",gd=e=>se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,So=hd(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ha=e=>{const t=Object.create(null);return s=>t[s]||(t[s]=e(s))},dx=/-(\w)/g,vs=Ha(e=>e.replace(dx,(t,s)=>s?s.toUpperCase():"")),ux=/\B([A-Z])/g,Gi=Ha(e=>e.replace(ux,"-$1").toLowerCase()),ja=Ha(e=>e.charAt(0).toUpperCase()+e.slice(1)),Tl=Ha(e=>e?`on${ja(e)}`:""),pn=(e,t)=>!Object.is(e,t),ta=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},Ag=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},_a=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Cg=e=>{const t=se(e)?Number(e):NaN;return isNaN(t)?e:t};let ch;const $g=()=>ch||(ch=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Mi(e){if(gt(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],i=se(n)?gx(n):Mi(n);if(i)for(const o in i)t[o]=i[o]}return t}else if(se(e)||Ut(e))return e}const hx=/;(?![^(]*\))/g,fx=/:([^]+)/,px=/\/\*[^]*?\*\//g;function gx(e){const t={};return e.replace(px,"").split(hx).forEach(s=>{if(s){const n=s.split(fx);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Rt(e){let t="";if(se(e))t=e;else if(gt(e))for(let s=0;s<e.length;s++){const n=Rt(e[s]);n&&(t+=n+" ")}else if(Ut(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const mx="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_x=hd(mx);function Pg(e){return!!e||e===""}function bx(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Zn(e[n],t[n]);return s}function Zn(e,t){if(e===t)return!0;let s=lh(e),n=lh(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=Ns(e),n=Ns(t),s||n)return e===t;if(s=gt(e),n=gt(t),s||n)return s&&n?bx(e,t):!1;if(s=Ut(e),n=Ut(t),s||n){if(!s||!n)return!1;const i=Object.keys(e).length,o=Object.keys(t).length;if(i!==o)return!1;for(const r in e){const a=e.hasOwnProperty(r),l=t.hasOwnProperty(r);if(a&&!l||!a&&l||!Zn(e[r],t[r]))return!1}}return String(e)===String(t)}function md(e,t){return e.findIndex(s=>Zn(s,t))}const lt=e=>se(e)?e:e==null?"":gt(e)||Ut(e)&&(e.toString===Eg||!wt(e.toString))?JSON.stringify(e,kg,2):String(e),kg=(e,t)=>t&&t.__v_isRef?kg(e,t.value):xi(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,i],o)=>(s[Ml(n,o)+" =>"]=i,s),{})}:qi(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Ml(s))}:Ns(t)?Ml(t):Ut(t)&&!gt(t)&&!Sg(t)?String(t):t,Ml=(e,t="")=>{var s;return Ns(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
* @vue/reactivity v3.4.29
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let De;class Tg{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this.parent=De,!t&&De&&(this.index=(De.scopes||(De.scopes=[])).push(this)-1)}get active(){return this._active}run(t){if(this._active){const s=De;try{return De=this,t()}finally{De=s}}}on(){De=this}off(){De=this.parent}stop(t){if(this._active){let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.scopes)for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0,this._active=!1}}}function Mg(e){return new Tg(e)}function vx(e,t=De){t&&t.active&&t.effects.push(e)}function _d(){return De}function Og(e){De&&De.cleanups.push(e)}let Un;class bd{constructor(t,s,n,i){this.fn=t,this.trigger=s,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=5,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,vx(this,i)}get dirty(){if(this._dirtyLevel===2)return!1;if(this._dirtyLevel===3||this._dirtyLevel===4){this._dirtyLevel=1,yn();for(let t=0;t<this._depsLength;t++){const s=this.deps[t];if(s.computed){if(s.computed.effect._dirtyLevel===2)return!0;if(yx(s.computed),this._dirtyLevel>=5)break}}this._dirtyLevel===1&&(this._dirtyLevel=0),xn()}return this._dirtyLevel>=5}set dirty(t){this._dirtyLevel=t?5:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=dn,s=Un;try{return dn=!0,Un=this,this._runnings++,dh(this),this.fn()}finally{uh(this),this._runnings--,Un=s,dn=t}}stop(){this.active&&(dh(this),uh(this),this.onStop&&this.onStop(),this.active=!1)}}function yx(e){return e.value}function dh(e){e._trackId++,e._depsLength=0}function uh(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Dg(e.deps[t],e);e.deps.length=e._depsLength}}function Dg(e,t){const s=e.get(t);s!==void 0&&t._trackId!==s&&(e.delete(t),e.size===0&&e.cleanup())}let dn=!0,uc=0;const Ig=[];function yn(){Ig.push(dn),dn=!1}function xn(){const e=Ig.pop();dn=e===void 0?!0:e}function vd(){uc++}function yd(){for(uc--;!uc&&hc.length;)hc.shift()()}function Lg(e,t,s){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&Dg(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const hc=[];function Rg(e,t,s){vd();for(const n of e.keys()){if(!e.computed&&n.computed&&e.get(n)===n._trackId&&n._runnings>0){n._dirtyLevel=2;continue}let i;n._dirtyLevel<t&&(i??(i=e.get(n)===n._trackId))&&(n._shouldSchedule||(n._shouldSchedule=n._dirtyLevel===0),n.computed&&n._dirtyLevel===2&&(n._shouldSchedule=!0),n._dirtyLevel=t),n._shouldSchedule&&(i??(i=e.get(n)===n._trackId))&&(n.trigger(),(!n._runnings||n.allowRecurse)&&n._dirtyLevel!==3&&(n._shouldSchedule=!1,n.scheduler&&hc.push(n.scheduler)))}yd()}const Ng=(e,t)=>{const s=new Map;return s.cleanup=e,s.computed=t,s},ba=new WeakMap,Kn=Symbol(""),fc=Symbol("");function Me(e,t,s){if(dn&&Un){let n=ba.get(e);n||ba.set(e,n=new Map);let i=n.get(s);i||n.set(s,i=Ng(()=>n.delete(s))),Lg(Un,i)}}function Ls(e,t,s,n,i,o){const r=ba.get(e);if(!r)return;let a=[];if(t==="clear")a=[...r.values()];else if(s==="length"&&gt(e)){const l=Number(n);r.forEach((c,d)=>{(d==="length"||!Ns(d)&&d>=l)&&a.push(c)})}else switch(s!==void 0&&a.push(r.get(s)),t){case"add":gt(e)?gd(s)&&a.push(r.get("length")):(a.push(r.get(Kn)),xi(e)&&a.push(r.get(fc)));break;case"delete":gt(e)||(a.push(r.get(Kn)),xi(e)&&a.push(r.get(fc)));break;case"set":xi(e)&&a.push(r.get(Kn));break}vd();for(const l of a)l&&Rg(l,5);yd()}function xx(e,t){const s=ba.get(e);return s&&s.get(t)}const wx=hd("__proto__,__v_isRef,__isVue"),Fg=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ns)),hh=Ex();function Ex(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...s){const n=Tt(this);for(let o=0,r=this.length;o<r;o++)Me(n,"get",o+"");const i=n[t](...s);return i===-1||i===!1?n[t](...s.map(Tt)):i}}),["push","pop"
* @vue/runtime-core v3.4.29
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function hn(e,t,s,n){try{return n?e(...n):e()}catch(i){sr(i,t,s)}}function Je(e,t,s,n){if(wt(e)){const i=hn(e,t,s,n);return i&&wg(i)&&i.catch(o=>{sr(o,t,s)}),i}if(gt(e)){const i=[];for(let o=0;o<e.length;o++)i.push(Je(e[o],t,s,n));return i}}function sr(e,t,s,n=!0){const i=t?t.vnode:null;if(t){let o=t.parent;const r=t.proxy,a=`https://vuejs.org/error-reference/#runtime-${s}`;for(;o;){const c=o.ec;if(c){for(let d=0;d<c.length;d++)if(c[d](e,r,a)===!1)return}o=o.parent}const l=t.appContext.config.errorHandler;if(l){yn(),hn(l,null,10,[e,r,a]),xn();return}}Kx(e,s,i,n)}function Kx(e,t,s,n=!0){console.error(e)}let Bo=!1,pc=!1;const me=[];let hs=0;const wi=[];let Qs=null,jn=0;const Xg=Promise.resolve();let Cd=null;function nr(e){const t=Cd||Xg;return e?t.then(this?e.bind(this):e):t}function Yx(e){let t=hs+1,s=me.length;for(;t<s;){const n=t+s>>>1,i=me[n],o=Vo(i);o<e||o===e&&i.pre?t=n+1:s=n}return t}function $d(e){(!me.length||!me.includes(e,Bo&&e.allowRecurse?hs+1:hs))&&(e.id==null?me.push(e):me.splice(Yx(e.id),0,e),Jg())}function Jg(){!Bo&&!pc&&(pc=!0,Cd=Xg.then(Zg))}function qx(e){const t=me.indexOf(e);t>hs&&me.splice(t,1)}function gc(e){gt(e)?wi.push(...e):(!Qs||!Qs.includes(e,e.allowRecurse?jn+1:jn))&&wi.push(e),Jg()}function _h(e,t,s=Bo?hs+1:0){for(;s<me.length;s++){const n=me[s];if(n&&n.pre){if(e&&n.id!==e.uid)continue;me.splice(s,1),s--,n()}}}function Qg(e){if(wi.length){const t=[...new Set(wi)].sort((s,n)=>Vo(s)-Vo(n));if(wi.length=0,Qs){Qs.push(...t);return}for(Qs=t,jn=0;jn<Qs.length;jn++){const s=Qs[jn];s.active!==!1&&s()}Qs=null,jn=0}}const Vo=e=>e.id==null?1/0:e.id,Gx=(e,t)=>{const s=Vo(e)-Vo(t);if(s===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return s};function Zg(e){pc=!1,Bo=!0,me.sort(Gx);try{for(hs=0;hs<me.length;hs++){const t=me[hs];t&&t.active!==!1&&hn(t,null,14)}}finally{hs=0,me.length=0,Qg(),Bo=!1,Cd=null,(me.length||wi.length)&&Zg()}}function Xx(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||Yt;let i=s;const o=t.startsWith("update:"),r=o&&t.slice(7);if(r&&r in n){const d=`${r==="modelValue"?"model":r}Modifiers`,{number:u,trim:f}=n[d]||Yt;f&&(i=s.map(g=>se(g)?g.trim():g)),u&&(i=s.map(_a))}let a,l=n[a=Tl(t)]||n[a=Tl(vs(t))];!l&&o&&(l=n[a=Tl(Gi(t))]),l&&Je(l,e,6,i);const c=n[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Je(c,e,6,i)}}function tm(e,t,s=!1){const n=t.emitsCache,i=n.get(e);if(i!==void 0)return i;const o=e.emits;let r={},a=!1;if(!wt(e)){const l=c=>{const d=tm(c,t,!0);d&&(a=!0,ee(r,d))};!s&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(Ut(e)&&n.set(e,null),null):(gt(o)?o.forEach(l=>r[l]=null):ee(r,o),Ut(e)&&n.set(e,r),r)}function Ka(e,t){return!e||!Va(t)?!1:(t=t.slice(2).replace(/Once$/,""),Nt(e,t[0].toLowerCase()+t.slice(1))||Nt(e,Gi(t))||Nt(e,t))}let Ee=null,Ya=null;function ya(e){const t=Ee;return Ee=e,Ya=e&&e.type.__scopeId||null,t}function Bs(e){Ya=e}function Vs(){Ya=null}function Bt(e,t=Ee,s){if(!t||e._n)return e;const n=(...i)=>{n._d&&Mh(-1);const o=ya(t);let r;try{r=e(...i)}finally{ya(o),n._d&&Mh(1)}return r};return n._n=!0,n._c=!0,n._d=!0,n}function Ol(e){const{type:t,vnode:s,proxy:n,withProxy:i,propsOptions:[o],slots:r,attrs:a,emit:l,render:c,renderCache:d,props:u,data:f,setupState:g,ctx:m,inheritAttrs:b}=e,v=ya(e);let w,E;try{if(s.shapeFlag&4){const T=i||n,y=T;w=ss(c.call(y,T,d,u,g,f,m)),E=a}else{const T=t;w=ss(T.length>1?T(u,{attrs:a,slots:r,emit:l}):T(u,null)),E=t.props?a:Qx(a)}}catch(T){Co.length=0,sr(T,e,1),w=dt(we)}let $=w;if(E&&b!==!1){const T=Object.keys(E),{shapeFlag:y}=$;T.length&&y&7&&(o&&T.some(fd)&&(E=Zx(E,o)),$=gn($,E,!1,!0))}return s.dirs&&($=gn($,null,!1,!0),$.dirs=$.dirs?$.dirs.concat(s.dirs):s.dirs),s.transition&&($.transition=s.transition),w=$,ya(v),w}function Jx(e,t=!0){let s;for(let n=0;n<e.length;n++){const i=e[n];if(wa(i)){if(i.type!==we||i.children==="v-if"){if(s)return;s=i}}else return}return s}const Qx=e=>{let t;for(const s in e)(s==="class"||s==="style"||Va(s))&&((t||(t={}))[s]=e[s]);return t},Zx=(e,t)=>{const s={};for(const n in e)(!fd(n)||
* @vue/runtime-dom v3.4.29
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/const tE="http://www.w3.org/2000/svg",eE="http://www.w3.org/1998/Math/MathML",ks=typeof document<"u"?document:null,Ih=ks&&ks.createElement("template"),sE={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const i=t==="svg"?ks.createElementNS(tE,e):t==="mathml"?ks.createElementNS(eE,e):s?ks.createElement(e,{is:s}):ks.createElement(e);return e==="select"&&n&&n.multiple!=null&&i.setAttribute("multiple",n.multiple),i},createText:e=>ks.createTextNode(e),createComment:e=>ks.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ks.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,i,o){const r=s?s.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),s),!(i===o||!(i=i.nextSibling)););else{Ih.innerHTML=n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e;const a=Ih.content;if(n==="svg"||n==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,s)}return[r?r.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Ys="transition",ro="animation",Ri=Symbol("_vtc"),is=(e,{slots:t})=>Li(Vw,Om(e),t);is.displayName="Transition";const Mm={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},nE=is.props=ee({},xm,Mm),Ln=(e,t=[])=>{gt(e)?e.forEach(s=>s(...t)):e&&e(...t)},Lh=e=>e?gt(e)?e.some(t=>t.length>1):e.length>1:!1;function Om(e){const t={};for(const N in e)N in Mm||(t[N]=e[N]);if(e.css===!1)return t;const{name:s="v",type:n,duration:i,enterFromClass:o=`${s}-enter-from`,enterActiveClass:r=`${s}-enter-active`,enterToClass:a=`${s}-enter-to`,appearFromClass:l=o,appearActiveClass:c=r,appearToClass:d=a,leaveFromClass:u=`${s}-leave-from`,leaveActiveClass:f=`${s}-leave-active`,leaveToClass:g=`${s}-leave-to`}=e,m=iE(i),b=m&&m[0],v=m&&m[1],{onBeforeEnter:w,onEnter:E,onEnterCancelled:$,onLeave:T,onLeaveCancelled:y,onBeforeAppear:x=w,onAppear:C=E,onAppearCancelled:S=$}=t,P=(N,Q,G)=>{Xs(N,Q?d:a),Xs(N,Q?c:r),G&&G()},M=(N,Q)=>{N._isLeaving=!1,Xs(N,u),Xs(N,g),Xs(N,f),Q&&Q()},I=N=>(Q,G)=>{const V=N?C:E,L=()=>P(Q,N,G);Ln(V,[Q,L]),Rh(()=>{Xs(Q,N?l:o),Cs(Q,N?d:a),Lh(V)||Nh(Q,n,b,L)})};return ee(t,{onBeforeEnter(N){Ln(w,[N]),Cs(N,o),Cs(N,r)},onBeforeAppear(N){Ln(x,[N]),Cs(N,l),Cs(N,c)},onEnter:I(!1),onAppear:I(!0),onLeave(N,Q){N._isLeaving=!0;const G=()=>M(N,Q);Cs(N,u),Cs(N,f),Im(),Rh(()=>{N._isLeaving&&(Xs(N,u),Cs(N,g),Lh(T)||Nh(N,n,v,G))}),Ln(T,[N,G])},onEnterCancelled(N){P(N,!1),Ln($,[N])},onAppearCancelled(N){P(N,!0),Ln(S,[N])},onLeaveCancelled(N){M(N),Ln(y,[N])}})}function iE(e){if(e==null)return null;if(Ut(e))return[Nl(e.enter),Nl(e.leave)];{const t=Nl(e);return[t,t]}}function Nl(e){return Cg(e)}function Cs(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.add(s)),(e[Ri]||(e[Ri]=new Set)).add(t)}function Xs(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const s=e[Ri];s&&(s.delete(t),s.size||(e[Ri]=void 0))}function Rh(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let oE=0;function Nh(e,t,s,n){const i=e._endId=++oE,o=()=>{i===e._endId&&n()};if(s)return setTimeout(o,s);const{type:r,timeout:a,propCount:l}=Dm(e,t);if(!r)return n();const c=r+"end";let d=0;const u=()=>{e.removeEventListener(c,f),o()},f=g=>{g.target===e&&++d>=l&&u()};setTimeout(()=>{d<l&&u()},a+1),e.addEventListener(c,f)}function Dm(e,t){const s=window.getComputedStyle(e),n=m=>(s[m]||"").split(", "),i=n(`${Ys}Delay`),o=n(`${Ys}Duration`),r=Fh(i,o),a=n(`${ro}Delay`),l=n(`${ro}Duration`),c=Fh(a,l);let d=null,u=0,f=0;t===Ys?r>0&&(d=Ys,u=r,f=o.length):t===ro?c>0&&(d=ro,u=c,f=l.length):(u=Math.max(r,c),d=u>0?r>c?Ys:ro:null,f=d?d===Ys?o.length:l.length:0);const g=d===Ys&&/\b(transform|all)(,|$)/.test(n(`${Ys}Property`).toString(
* pinia v2.1.7
* (c) 2023 Eduardo San Martin Morote
* @license MIT
2024-06-18 03:16:42 +08:00
*/let Bm;const el=e=>Bm=e,Vm=Symbol();function Sc(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var $o;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})($o||($o={}));function NE(){const e=Mg(!0),t=e.run(()=>Oi({}));let s=[],n=[];const i=Ua({install(o){el(i),i._a=o,o.provide(Vm,i),o.config.globalProperties.$pinia=i,n.forEach(r=>s.push(r)),n=[]},use(o){return!this._a&&!RE?n.push(o):s.push(o),this},_p:s,_a:null,_e:e,_s:new Map,state:t});return i}const Hm=()=>{};function Zh(e,t,s,n=Hm){e.push(t);const i=()=>{const o=e.indexOf(t);o>-1&&(e.splice(o,1),n())};return!s&&_d()&&Og(i),i}function fi(e,...t){e.slice().forEach(s=>{s(...t)})}const FE=e=>e();function Ac(e,t){e instanceof Map&&t instanceof Map&&t.forEach((s,n)=>e.set(n,s)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const s in t){if(!t.hasOwnProperty(s))continue;const n=t[s],i=e[s];Sc(i)&&Sc(n)&&e.hasOwnProperty(s)&&!ae(n)&&!Yn(n)?e[s]=Ac(i,n):e[s]=n}return e}const BE=Symbol();function VE(e){return!Sc(e)||!e.hasOwnProperty(BE)}const{assign:Js}=Object;function HE(e){return!!(ae(e)&&e.effect)}function jE(e,t,s,n){const{state:i,actions:o,getters:r}=t,a=s.state.value[e];let l;function c(){a||(s.state.value[e]=i?i():{});const d=Wx(s.state.value[e]);return Js(d,o,Object.keys(r||{}).reduce((u,f)=>(u[f]=Ua(Ke(()=>{el(s);const g=s._s.get(e);return r[f].call(g,g)})),u),{}))}return l=jm(e,c,t,s,n,!0),l}function jm(e,t,s={},n,i,o){let r;const a=Js({actions:{}},s),l={deep:!0};let c,d,u=[],f=[],g;const m=n.state.value[e];!o&&!m&&(n.state.value[e]={}),Oi({});let b;function v(S){let P;c=d=!1,typeof S=="function"?(S(n.state.value[e]),P={type:$o.patchFunction,storeId:e,events:g}):(Ac(n.state.value[e],S),P={type:$o.patchObject,payload:S,storeId:e,events:g});const M=b=Symbol();nr().then(()=>{b===M&&(c=!0)}),d=!0,fi(u,P,n.state.value[e])}const w=o?function(){const{state:P}=s,M=P?P():{};this.$patch(I=>{Js(I,M)})}:Hm;function E(){r.stop(),u=[],f=[],n._s.delete(e)}function $(S,P){return function(){el(n);const M=Array.from(arguments),I=[],N=[];function Q(L){I.push(L)}function G(L){N.push(L)}fi(f,{args:M,name:S,store:y,after:Q,onError:G});let V;try{V=P.apply(this&&this.$id===e?this:y,M)}catch(L){throw fi(N,L),L}return V instanceof Promise?V.then(L=>(fi(I,L),L)).catch(L=>(fi(N,L),Promise.reject(L))):(fi(I,V),V)}}const T={_p:n,$id:e,$onAction:Zh.bind(null,f),$patch:v,$reset:w,$subscribe(S,P={}){const M=Zh(u,S,P.detached,()=>I()),I=r.run(()=>qn(()=>n.state.value[e],N=>{(P.flush==="sync"?d:c)&&S({storeId:e,type:$o.direct,events:g},N)},Js({},l,P)));return M},$dispose:E},y=er(T);n._s.set(e,y);const C=(n._a&&n._a.runWithContext||FE)(()=>n._e.run(()=>(r=Mg()).run(t)));for(const S in C){const P=C[S];if(ae(P)&&!HE(P)||Yn(P))o||(m&&VE(P)&&(ae(P)?P.value=m[S]:Ac(P,m[S])),n.state.value[e][S]=P);else if(typeof P=="function"){const M=$(S,P);C[S]=M,a.actions[S]=P}}return Js(y,C),Js(Tt(y),C),Object.defineProperty(y,"$state",{get:()=>n.state.value[e],set:S=>{v(P=>{Js(P,S)})}}),n._p.forEach(S=>{Js(y,r.run(()=>S({store:y,app:n._a,pinia:n,options:a})))}),m&&o&&s.hydrate&&s.hydrate(y.$state,m),c=!0,d=!0,y}function Fd(e,t,s){let n,i;const o=typeof t=="function";typeof e=="string"?(n=e,i=o?s:t):(i=e,n=e.id);function r(a,l){const c=Ew();return a=a||(c?ms(Vm,null):null),a&&el(a),a=Bm,a._s.has(n)||(o?jm(n,t,i,a):jE(n,i,a)),a._s.get(n)}return r.$id=n,r}/*!
* vue-router v4.2.5
* (c) 2023 Eduardo San Martin Morote
* @license MIT
2024-06-18 03:16:42 +08:00
*/const bi=typeof window<"u";function WE(e){return e.__esModule||e[Symbol.toStringTag]==="Module"}const Wt=Object.assign;function Vl(e,t){const s={};for(const n in t){const i=t[n];s[n]=rs(i)?i.map(e):e(i)}return s}const Po=()=>{},rs=Array.isArray,zE=/\/$/,UE=e=>e.replace(zE,"");function Hl(e,t,s="/"){let n,i={},o="",r="";const a=t.indexOf("#");let l=t.indexOf("?");return a<l&&a>=0&&(l=-1),l>-1&&(n=t.slice(0,l),o=t.slice(l+1,a>-1?a:t.length),i=e(o)),a>-1&&(n=n||t.slice(0,a),r=t.slice(a,t.length)),n=GE(n??t,s),{fullPath:n+(o&&"?")+o+r,path:n,query:i,hash:r}}function KE(e,t){const s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function tf(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function YE(e,t,s){const n=t.matched.length-1,i=s.matched.length-1;return n>-1&&n===i&&Fi(t.matched[n],s.matched[i])&&Wm(t.params,s.params)&&e(t.query)===e(s.query)&&t.hash===s.hash}function Fi(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Wm(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(!qE(e[s],t[s]))return!1;return!0}function qE(e,t){return rs(e)?ef(e,t):rs(t)?ef(t,e):e===t}function ef(e,t){return rs(t)?e.length===t.length&&e.every((s,n)=>s===t[n]):e.length===1&&e[0]===t}function GE(e,t){if(e.startsWith("/"))return e;if(!e)return t;const s=t.split("/"),n=e.split("/"),i=n[n.length-1];(i===".."||i===".")&&n.push("");let o=s.length-1,r,a;for(r=0;r<n.length;r++)if(a=n[r],a!==".")if(a==="..")o>1&&o--;else break;return s.slice(0,o).join("/")+"/"+n.slice(r-(r===n.length?1:0)).join("/")}var Wo;(function(e){e.pop="pop",e.push="push"})(Wo||(Wo={}));var ko;(function(e){e.back="back",e.forward="forward",e.unknown=""})(ko||(ko={}));function XE(e){if(!e)if(bi){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),UE(e)}const JE=/^[^#]+#/;function QE(e,t){return e.replace(JE,"#")+t}function ZE(e,t){const s=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-s.left-(t.left||0),top:n.top-s.top-(t.top||0)}}const sl=()=>({left:window.pageXOffset,top:window.pageYOffset});function tS(e){let t;if("el"in e){const s=e.el,n=typeof s=="string"&&s.startsWith("#"),i=typeof s=="string"?n?document.getElementById(s.slice(1)):document.querySelector(s):s;if(!i)return;t=ZE(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.pageXOffset,t.top!=null?t.top:window.pageYOffset)}function sf(e,t){return(history.state?history.state.position-t:-1)+e}const Cc=new Map;function eS(e,t){Cc.set(e,t)}function sS(e){const t=Cc.get(e);return Cc.delete(e),t}let nS=()=>location.protocol+"//"+location.host;function zm(e,t){const{pathname:s,search:n,hash:i}=t,o=e.indexOf("#");if(o>-1){let a=i.includes(e.slice(o))?e.slice(o).length:1,l=i.slice(a);return l[0]!=="/"&&(l="/"+l),tf(l,"")}return tf(s,e)+n+i}function iS(e,t,s,n){let i=[],o=[],r=null;const a=({state:f})=>{const g=zm(e,location),m=s.value,b=t.value;let v=0;if(f){if(s.value=g,t.value=f,r&&r===m){r=null;return}v=b?f.position-b.position:0}else n(g);i.forEach(w=>{w(s.value,m,{delta:v,type:Wo.pop,direction:v?v>0?ko.forward:ko.back:ko.unknown})})};function l(){r=s.value}function c(f){i.push(f);const g=()=>{const m=i.indexOf(f);m>-1&&i.splice(m,1)};return o.push(g),g}function d(){const{history:f}=window;f.state&&f.replaceState(Wt({},f.state,{scroll:sl()}),"")}function u(){for(const f of o)f();o=[],window.removeEventListener("popstate",a),window.removeEventListener("beforeunload",d)}return window.addEventListener("popstate",a),window.addEventListener("beforeunload",d,{passive:!0}),{pauseListeners:l,listen:c,destroy:u}}function nf(e,t,s,n=!1,i=!1){return{back:e,current:t,forward:s,replaced:n,position:window.history.length,scroll:i?sl():null}}function oS(e){const{history:t,location:s}=window,n={value:zm(e,s)},i={value:t.state};i.value||o(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replace
2024-04-03 01:16:56 -04:00
(?:
2024-06-18 03:16:42 +08:00
(?:${ie}:){7}(?:${ie}|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8
(?:${ie}:){6}(?:${es}|:${ie}|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4
(?:${ie}:){5}(?::${es}|(?::${ie}){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4
(?:${ie}:){4}(?:(?::${ie}){0,1}:${es}|(?::${ie}){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4
(?:${ie}:){3}(?:(?::${ie}){0,2}:${es}|(?::${ie}){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4
(?:${ie}:){2}(?:(?::${ie}){0,3}:${es}|(?::${ie}){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4
(?:${ie}:){1}(?:(?::${ie}){0,4}:${es}|(?::${ie}){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4
(?::(?:(?::${ie}){0,5}:${es}|(?::${ie}){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4
2024-04-03 01:16:56 -04:00
)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1
2024-06-18 03:16:42 +08:00
`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),ZS=new RegExp(`(?:^${es}$)|(?:^${nl}$)`),tA=new RegExp(`^${es}$`),eA=new RegExp(`^${nl}$`),il=e=>e&&e.exact?ZS:new RegExp(`(?:${nn(e)}${es}${nn(e)})|(?:${nn(e)}${nl}${nn(e)})`,"g");il.v4=e=>e&&e.exact?tA:new RegExp(`${nn(e)}${es}${nn(e)}`,"g");il.v6=e=>e&&e.exact?eA:new RegExp(`${nn(e)}${nl}${nn(e)}`,"g");const e_={exact:!1},s_=`${il.v4().source}\\/(3[0-2]|[12]?[0-9])`,n_=`${il.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,sA=new RegExp(`^${s_}$`),nA=new RegExp(`^${n_}$`),iA=({exact:e}=e_)=>e?sA:new RegExp(s_,"g"),oA=({exact:e}=e_)=>e?nA:new RegExp(n_,"g"),i_=iA({exact:!0}),o_=oA({exact:!0}),Hd=e=>i_.test(e)?4:o_.test(e)?6:0;Hd.v4=e=>i_.test(e);Hd.v6=e=>o_.test(e);const as=Fd("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:""}),actions:{async getConfigurations(){await he("/api/getWireguardConfigurations",{},e=>{e.status&&(this.Configurations=e.data)})},regexCheckIP(e){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(e)},checkCIDR(e){return Hd(e)!==0}}}),kt=(e,t)=>{const s=e.__vccOpts||e;for(const[n,i]of t)s[n]=i;return s},rA={name:"navbar",setup(){const e=as(),t=Jt();return{wireguardConfigurationsStore:e,dashboardConfigurationStore:t}}},aA={class:"col-md-3 col-lg-2 d-md-block p-3"},lA={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow"},cA={class:"sidebar-sticky pt-3"},dA={class:"nav flex-column"},uA={class:"nav-item"},hA={class:"nav-item"},fA=p("hr",null,null,-1),pA=p("h6",{class:"sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"},[p("span",null,"Configurations")],-1),gA={class:"nav flex-column"},mA={class:"nav-item"},_A=p("hr",null,null,-1),bA=p("h6",{class:"sidebar-heading d-flex justify-content-between align-items-center px-3 mt-4 mb-1 text-muted"},[p("span",null,"Tools")],-1),vA={class:"nav flex-column"},yA={class:"nav-item"},xA={class:"nav-item"},wA=p("hr",null,null,-1),EA={class:"nav flex-column"},SA={class:"nav-item"},AA=p("ul",{class:"nav flex-column"},[p("li",{class:"nav-item"},[p("a",{href:"https://github.com/donaldzou/WGDashboard/releases/tag/"},[p("small",{class:"nav-link text-muted"})])])],-1);function CA(e,t,s,n,i,o){const r=Dt("RouterLink");return H(),q("div",aA,[p("nav",lA,[p("div",cA,[p("ul",dA,[p("li",uA,[dt(r,{class:"nav-link",to:"/","exact-active-class":"active"},{default:Bt(()=>[ht("Home")]),_:1})]),p("li",hA,[dt(r,{class:"nav-link",to:"/settings","exact-active-class":"active"},{default:Bt(()=>[ht("Settings")]),_:1})])]),fA,pA,p("ul",gA,[p("li",mA,[(H(!0),q(Ht,null,_e(this.wireguardConfigurationsStore.Configurations,a=>(H(),oe(r,{to:"/configuration/"+a.Name+"/peers",class:"nav-link nav-conf-link","active-class":"active"},{default:Bt(()=>[p("samp",null,lt(a.Name),1)]),_:2},1032,["to"]))),256))])]),_A,bA,p("ul",vA,[p("li",yA,[dt(r,{to:"/ping",class:"nav-link","active-class":"active"},{default:Bt(()=>[h
]))+`;ys.KANJI=new RegExp(zo,"g");ys.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");ys.BYTE=new RegExp(kP,"g");ys.NUMERIC=new RegExp(p_,"g");ys.ALPHANUMERIC=new RegExp(PP,"g");const TP=new RegExp("^"+zo+"$"),MP=new RegExp("^"+p_+"$"),OP=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");ys.testKanji=function(t){return TP.test(t)};ys.testNumeric=function(t){return MP.test(t)};ys.testAlphanumeric=function(t){return OP.test(t)};(function(e){const t=zd,s=ys;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,r){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?o.ccBits[0]:r<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return s.testNumeric(o)?e.NUMERIC:s.testAlphanumeric(o)?e.ALPHANUMERIC:s.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function n(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(o,r){if(e.isValid(o))return o;try{return n(o)}catch{return r}}})(wn);(function(e){const t=Be,s=rl,n=ol,i=wn,o=zd,r=7973,a=t.getBCHDigit(r);function l(f,g,m){for(let b=1;b<=40;b++)if(g<=e.getCapacity(b,m,f))return b}function c(f,g){return i.getCharCountIndicator(f,g)+4}function d(f,g){let m=0;return f.forEach(function(b){const v=c(b.mode,g);m+=v+b.getBitsLength()}),m}function u(f,g){for(let m=1;m<=40;m++)if(d(f,m)<=e.getCapacity(m,g,i.MIXED))return m}e.from=function(g,m){return o.isValid(g)?parseInt(g,10):m},e.getCapacity=function(g,m,b){if(!o.isValid(g))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=i.BYTE);const v=t.getSymbolTotalCodewords(g),w=s.getTotalCodewordsCount(g,m),E=(v-w)*8;if(b===i.MIXED)return E;const $=E-c(b,g);switch(b){case i.NUMERIC:return Math.floor($/10*3);case i.ALPHANUMERIC:return Math.floor($/11*2);case i.KANJI:return Math.floor($/13);case i.BYTE:default:return Math.floor($/8)}},e.getBestVersionForData=function(g,m){let b;const v=n.from(m,n.M);if(Array.isArray(g)){if(g.length>1)return u(g,v);if(g.length===0)return 1;b=g[0]}else b=g;return l(b.mode,b.getLength(),v)},e.getEncodedBits=function(g){if(!o.isValid(g)||g<7)throw new Error("Invalid QR Code version");let m=g<<12;for(;t.getBCHDigit(m)-a>=0;)m^=r<<t.getBCHDigit(m)-a;return g<<12|m}})(f_);var g_={};const kc=Be,m_=1335,DP=21522,yf=kc.getBCHDigit(m_);g_.getEncodedBits=function(t,s){const n=t.bit<<3|s;let i=n<<10;for(;kc.getBCHDigit(i)-yf>=0;)i^=m_<<kc.getBCHDigit(i)-yf;return(n<<10|i)^DP};var __={};const IP=wn;function Vi(e){this.mode=IP.NUMERIC,this.data=e.toString()}Vi.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};Vi.prototype.getLength=function(){return this.data.length};Vi.prototype.getBitsLength=function(){return Vi.getBitsLength(this.data.length)};Vi.prototype.write=function(t){let s,n,i;for(s=0;s+3<=this.data.length;s+=3)n=this.data.substr(s,3),i=parseInt(n,10),t.put(i,10);const o=this.data.length-s;o>0&&(n=this.data.substr(s),i=parseInt(n,10),t.put(i,o*3+1))};var LP=Vi;const RP=wn,Wl=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Hi(e){this.mode=RP.ALPHANUMERIC,this.data=e}Hi.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Hi.prototype.getLength=function(){return this.data.length};Hi.prototype.getBitsLength=function(){return Hi.getBitsLength(this.data.length)};Hi.prototype.write=function(t){let s;for(s=0;s+2<=this.data.length;s+=2){let n=Wl.indexOf(this.data[s])*45;n+=Wl.indexOf(this.data[s+1]),t.put(n,11)}this.data.length%2&&t.put(Wl.indexOf(this.data[s]),6)};var NP
Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),e.put(s,13)}};var zP=Wi,b_={exports:{}};(function(e){var t={single_source_shortest_paths:function(s,n,i){var o={},r={};r[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var l,c,d,u,f,g,m,b,v;!a.empty();){l=a.pop(),c=l.value,u=l.cost,f=s[c]||{};for(d in f)f.hasOwnProperty(d)&&(g=f[d],m=u+g,b=r[d],v=typeof r[d]>"u",(v||b>m)&&(r[d]=m,a.push(d,m),o[d]=c))}if(typeof i<"u"&&typeof r[i]>"u"){var w=["Could not find a path from ",n," to ",i,"."].join("");throw new Error(w)}return o},extract_shortest_path_from_predecessor_list:function(s,n){for(var i=[],o=n;o;)i.push(o),s[o],o=s[o];return i.reverse(),i},find_path:function(s,n,i){var o=t.single_source_shortest_paths(s,n,i);return t.extract_shortest_path_from_predecessor_list(o,i)},PriorityQueue:{make:function(s){var n=t.PriorityQueue,i={},o;s=s||{};for(o in n)n.hasOwnProperty(o)&&(i[o]=n[o]);return i.queue=[],i.sorter=s.sorter||n.default_sorter,i},default_sorter:function(s,n){return s.cost-n.cost},push:function(s,n){var i={value:s,cost:n};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(b_);var UP=b_.exports;(function(e){const t=wn,s=LP,n=NP,i=HP,o=zP,r=ys,a=Be,l=UP;function c(w){return unescape(encodeURIComponent(w)).length}function d(w,E,$){const T=[];let y;for(;(y=w.exec($))!==null;)T.push({data:y[0],index:y.index,mode:E,length:y[0].length});return T}function u(w){const E=d(r.NUMERIC,t.NUMERIC,w),$=d(r.ALPHANUMERIC,t.ALPHANUMERIC,w);let T,y;return a.isKanjiModeEnabled()?(T=d(r.BYTE,t.BYTE,w),y=d(r.KANJI,t.KANJI,w)):(T=d(r.BYTE_KANJI,t.BYTE,w),y=[]),E.concat($,T,y).sort(function(C,S){return C.index-S.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function f(w,E){switch(E){case t.NUMERIC:return s.getBitsLength(w);case t.ALPHANUMERIC:return n.getBitsLength(w);case t.KANJI:return o.getBitsLength(w);case t.BYTE:return i.getBitsLength(w)}}function g(w){return w.reduce(function(E,$){const T=E.length-1>=0?E[E.length-1]:null;return T&&T.mode===$.mode?(E[E.length-1].data+=$.data,E):(E.push($),E)},[])}function m(w){const E=[];for(let $=0;$<w.length;$++){const T=w[$];switch(T.mode){case t.NUMERIC:E.push([T,{data:T.data,mode:t.ALPHANUMERIC,length:T.length},{data:T.data,mode:t.BYTE,length:T.length}]);break;case t.ALPHANUMERIC:E.push([T,{data:T.data,mode:t.BYTE,length:T.length}]);break;case t.KANJI:E.push([T,{data:T.data,mode:t.BYTE,length:c(T.data)}]);break;case t.BYTE:E.push([{data:T.data,mode:t.BYTE,length:c(T.data)}])}}return E}function b(w,E){const $={},T={start:{}};let y=["start"];for(let x=0;x<w.length;x++){const C=w[x],S=[];for(let P=0;P<C.length;P++){const M=C[P],I=""+x+P;S.push(I),$[I]={node:M,lastCount:0},T[I]={};for(let N=0;N<y.length;N++){const Q=y[N];$[Q]&&$[Q].node.mode===M.mode?(T[Q][I]=f($[Q].lastCount+M.length,M.mode)-f($[Q].lastCount,M.mode),$[Q].lastCount+=M.length):($[Q]&&($[Q].lastCount=M.length),T[Q][I]=f(M.length,M.mode)+4+t.getCharCountIndicator(M.mode,E))}}y=S}for(let x=0;x<y.length;x++)T[y[x]].end=0;return{map:T,table:$}}function v(w,E){let $;const T=t.getBestModeForData(w);if($=t.from(E,T),$!==t.BYTE&&$.bit<T.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString($)+`.
Suggested mode is: `+t.toString(T));switch($===t.KANJI&&!a.isKanjiModeEnabled()&&($=t.BYTE),$){case t.NUMERIC:return new s(w);case t.ALPHANUMERIC:return new n(w);case t.KANJI:return new o(w);case t.BYTE:return new i(w)}}e.fromArray=function(E){return E.reduce(function($,T){return typeof T=="string"?$.push(v(T,null)):T.data&&$.push(v(T.data,T.mode)),$},[])},e.fromString=function(E,$){const T=u(E,a.isKanjiModeEnabled()),y=m(T),x=b(y,$),C=l.find_path(x.map,"start","end"),S=[];for(let P=1;P<C.length-1;P++)S.push(x.table[C[P]].node);return e.fromArray(g(S))},e.rawSplit=function(E){return e.fromArray(u(E,a.isKanjiModeEnabled()))}})(__);const ll=Be,zl=ol,KP=SP,YP=AP,qP=l_,GP=c_,Tc=d_,Mc=rl,XP=$P,$a=f_,JP=g_,QP=wn,Ul=__;function ZP(e,t){const s=e.size,n=GP.getPositions(t);for(let i=0;i<n.length;i++){const o=n[i][0],r=n[i][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||s<=o+a))for(let l=-1;l<=7;l++)r+l<=-1||s<=r+l||(a>=0&&a<=6&&(l===0||l===6)||l>=0&&l<=6&&(a===0||a===6)||a>=2&&a<=4&&l>=2&&l<=4?e.set(o+a,r+l,!0,!0):e.set(o+a,r+l,!1,!0))}}function tk(e){const t=e.size;for(let s=8;s<t-8;s++){const n=s%2===0;e.set(s,6,n,!0),e.set(6,s,n,!0)}}function ek(e,t){const s=qP.getPositions(t);for(let n=0;n<s.length;n++){const i=s[n][0],o=s[n][1];for(let r=-2;r<=2;r++)for(let a=-2;a<=2;a++)r===-2||r===2||a===-2||a===2||r===0&&a===0?e.set(i+r,o+a,!0,!0):e.set(i+r,o+a,!1,!0)}}function sk(e,t){const s=e.size,n=$a.getEncodedBits(t);let i,o,r;for(let a=0;a<18;a++)i=Math.floor(a/3),o=a%3+s-8-3,r=(n>>a&1)===1,e.set(i,o,r,!0),e.set(o,i,r,!0)}function Kl(e,t,s){const n=e.size,i=JP.getEncodedBits(t,s);let o,r;for(o=0;o<15;o++)r=(i>>o&1)===1,o<6?e.set(o,8,r,!0):o<8?e.set(o+1,8,r,!0):e.set(n-15+o,8,r,!0),o<8?e.set(8,n-o-1,r,!0):o<9?e.set(8,15-o-1+1,r,!0):e.set(8,15-o-1,r,!0);e.set(n-8,8,1,!0)}function nk(e,t){const s=e.size;let n=-1,i=s-1,o=7,r=0;for(let a=s-1;a>0;a-=2)for(a===6&&a--;;){for(let l=0;l<2;l++)if(!e.isReserved(i,a-l)){let c=!1;r<t.length&&(c=(t[r]>>>o&1)===1),e.set(i,a-l,c),o--,o===-1&&(r++,o=7)}if(i+=n,i<0||s<=i){i-=n,n=-n;break}}}function ik(e,t,s){const n=new KP;s.forEach(function(l){n.put(l.mode.bit,4),n.put(l.getLength(),QP.getCharCountIndicator(l.mode,e)),l.write(n)});const i=ll.getSymbolTotalCodewords(e),o=Mc.getTotalCodewordsCount(e,t),r=(i-o)*8;for(n.getLengthInBits()+4<=r&&n.put(0,4);n.getLengthInBits()%8!==0;)n.putBit(0);const a=(r-n.getLengthInBits())/8;for(let l=0;l<a;l++)n.put(l%2?17:236,8);return ok(n,e,t)}function ok(e,t,s){const n=ll.getSymbolTotalCodewords(t),i=Mc.getTotalCodewordsCount(t,s),o=n-i,r=Mc.getBlocksCount(t,s),a=n%r,l=r-a,c=Math.floor(n/r),d=Math.floor(o/r),u=d+1,f=c-d,g=new XP(f);let m=0;const b=new Array(r),v=new Array(r);let w=0;const E=new Uint8Array(e.buffer);for(let C=0;C<r;C++){const S=C<l?d:u;b[C]=E.slice(m,m+S),v[C]=g.encode(b[C]),m+=S,w=Math.max(w,S)}const $=new Uint8Array(n);let T=0,y,x;for(y=0;y<w;y++)for(x=0;x<r;x++)y<b[x].length&&($[T++]=b[x][y]);for(y=0;y<f;y++)for(x=0;x<r;x++)$[T++]=v[x][y];return $}function rk(e,t,s,n){let i;if(Array.isArray(e))i=Ul.fromArray(e);else if(typeof e=="string"){let c=t;if(!c){const d=Ul.rawSplit(e);c=$a.getBestVersionForData(d,s)}i=Ul.fromString(e,c||40)}else throw new Error("Invalid data");const o=$a.getBestVersionForData(i,s);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+o+`.
2024-06-18 03:16:42 +08:00
`);const r=ik(t,s,i),a=ll.getSymbolSize(t),l=new YP(a);return ZP(l,t),tk(l),ek(l,t),Kl(l,s,0),t>=7&&sk(l,t),nk(l,r),isNaN(n)&&(n=Tc.getBestMask(l,Kl.bind(null,l,s))),Tc.applyMask(n,l),Kl(l,s,n),{modules:l,version:t,errorCorrectionLevel:s,maskPattern:n,segments:i}}r_.create=function(t,s){if(typeof t>"u"||t==="")throw new Error("No input text");let n=zl.M,i,o;return typeof s<"u"&&(n=zl.from(s.errorCorrectionLevel,zl.M),i=$a.from(s.version),o=Tc.from(s.maskPattern),s.toSJISFunc&&ll.setToSJISFunction(s.toSJISFunc)),rk(t,i,n,o)};var v_={},Ud={};(function(e){function t(s){if(typeof s=="number"&&(s=s.toString()),typeof s!="string")throw new Error("Color should be defined as hex string");let n=s.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+s);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(o){return[o,o]}))),n.length===6&&n.push("F","F");const i=parseInt(n.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const i=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,o=n.width&&n.width>=21?n.width:void 0,r=n.scale||4;return{width:o,scale:o?4:r,margin:i,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,i){return i.width&&i.width>=n+i.margin*2?i.width/(n+i.margin*2):i.scale},e.getImageWidth=function(n,i){const o=e.getScale(n,i);return Math.floor((n+i.margin*2)*o)},e.qrToImageData=function(n,i,o){const r=i.modules.size,a=i.modules.data,l=e.getScale(r,o),c=Math.floor((r+o.margin*2)*l),d=o.margin*l,u=[o.color.light,o.color.dark];for(let f=0;f<c;f++)for(let g=0;g<c;g++){let m=(f*c+g)*4,b=o.color.light;if(f>=d&&g>=d&&f<c-d&&g<c-d){const v=Math.floor((f-d)/l),w=Math.floor((g-d)/l);b=u[a[v*r+w]?1:0]}n[m++]=b.r,n[m++]=b.g,n[m++]=b.b,n[m]=b.a}}})(Ud);(function(e){const t=Ud;function s(i,o,r){i.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=r,o.width=r,o.style.height=r+"px",o.style.width=r+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,r,a){let l=a,c=r;typeof l>"u"&&(!r||!r.getContext)&&(l=r,r=void 0),r||(c=n()),l=t.getOptions(l);const d=t.getImageWidth(o.modules.size,l),u=c.getContext("2d"),f=u.createImageData(d,d);return t.qrToImageData(f.data,o,l),s(u,c,d),u.putImageData(f,0,0),c},e.renderToDataURL=function(o,r,a){let l=a;typeof l>"u"&&(!r||!r.getContext)&&(l=r,r=void 0),l||(l={});const c=e.render(o,r,l),d=l.type||"image/png",u=l.rendererOpts||{};return c.toDataURL(d,u.quality)}})(v_);var y_={};const ak=Ud;function xf(e,t){const s=e.a/255,n=t+'="'+e.hex+'"';return s<1?n+" "+t+'-opacity="'+s.toFixed(2).slice(1)+'"':n}function Yl(e,t,s){let n=e+t;return typeof s<"u"&&(n+=" "+s),n}function lk(e,t,s){let n="",i=0,o=!1,r=0;for(let a=0;a<e.length;a++){const l=Math.floor(a%t),c=Math.floor(a/t);!l&&!o&&(o=!0),e[a]?(r++,a>0&&l>0&&e[a-1]||(n+=o?Yl("M",l+s,.5+c+s):Yl("m",i,0),i=0,o=!1),l+1<t&&e[a+1]||(n+=Yl("h",r),r=0)):i++}return n}y_.render=function(t,s,n){const i=ak.getOptions(s),o=t.modules.size,r=t.modules.data,a=o+i.margin*2,l=i.color.light.a?"<path "+xf(i.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",c="<path "+xf(i.color.dark,"stroke")+' d="'+lk(r,o,i.margin)+'"/>',d='viewBox="0 0 '+a+" "+a+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+d+' shape-rendering="crispEdges">'+l+c+`</svg>
`;return typeof n=="function"&&n(null,f),f};const ck=wP,Oc=r_,x_=v_,dk=y_;function Kd(e,t,s,n,i){const o=[].slice.call(arguments,1),r=o.length,a=typeof o[r-1]=="function";if(!a&&!ck())throw new Error("Callback required as last argument");if(a){if(r<2)throw new Error("Too few arguments provided");r===2?(i=s,s=t,t=n=void 0):r===3&&(t.getContext&&typeof i>"u"?(i=n,n=void 0):(i=n,n=s,s=t,t=void 0))}else{if(r<1)throw new Error("Too few arguments provided");return r===1?(s=t,t=n=void 0):r===2&&!t.getContext&&(n=s,s=t,t=void 0),new Promise(function(l,c){try{const d=Oc.create(s,n);l(e(d,t,n))}catch(d){c(d)}})}try{const l=Oc.create(s,n);i(null,e(l,t,n))}catch(l){i(l)}}Qi.create=Oc.create;Qi.toCanvas=Kd.bind(null,x_.render);Qi.toDataURL=Kd.bind(null,x_.renderToDataURL);Qi.toString=Kd.bind(null,function(e,t,s){return dk.render(e,s)});const uk={name:"totp",async setup(){let e="";return await he("/api/Welcome_GetTotpLink",{},t=>{t.status&&(e=t.data)}),{l:e}},mounted(){this.l&&Qi.toCanvas(document.getElementById("qrcode"),this.l,function(e){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(e){const t=document.querySelector("#totp");t.classList.remove("is-invalid","is-valid"),e.length===6&&(console.log(e),/[0-9]{6}/.test(e)?ue("/api/Welcome_VerifyTotpLink",{totp:e},s=>{s.status?(this.verified=!0,t.classList.add("is-valid"),this.$emit("verified")):(t.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(t.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},hk={class:"mb-3"},fk=p("p",{class:"mb-2"},[p("small",{class:"text-muted"},"1. Please scan the following QR Code to generate TOTP")],-1),pk=p("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1),gk={class:"p-3 bg-body-secondary rounded-3 border mb-3"},mk=p("p",{class:"text-muted mb-0"},[p("small",null,"Or you can click the link below:")],-1),_k=["href"],bk={style:{"line-break":"anywhere"}},vk=p("label",{for:"totp",class:"mb-2"},[p("small",{class:"text-muted"},"2. Enter the TOTP generated by your authenticator to verify")],-1),yk={class:"form-group"},xk=["disabled"],wk={class:"invalid-feedback"},Ek=p("div",{class:"valid-feedback"}," TOTP verified! ",-1);function Sk(e,t,s,n,i,o){return H(),q("div",hk,[fk,pk,p("div",gk,[mk,p("a",{href:this.l},[p("code",bk,lt(this.l),1)],8,_k)]),vk,p("div",yk,[mt(p("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":t[0]||(t[0]=r=>this.totp=r),disabled:this.verified},null,8,xk),[[yt,this.totp]]),p("div",wk,lt(this.totpInvalidMessage),1),Ek])])}const Ak=kt(uk,[["render",Sk]]),Ck={name:"setup",components:{Totp:Ak},setup(){return{store:Jt()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!1,verified_totp:!1},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword&&(this.setup.enable_totp&&this.setup.verified_totp||!this.setup.enable_totp)}},methods:{submit(){this.loading=!0,ue("/api/Welcome_Finish",this.setup,e=>{e.status?(this.done=!0,setTimeout(()=>{this.$router.push("/")},500)):(document.querySelectorAll("#createAccount input").forEach(t=>t.classList.add("is-invalid")),this.errorMessage=e.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},$k=["data-bs-theme"],Pk={class:"mx-auto text-body",style:{width:"500px"}},kk=p("span",{class:"dashboardLogo display-4"},"Nice to meet you!",-1),Tk=p("p",{class:"mb-5"},"Please fill in the following fields to finish setup 😊",-1),Mk=p("h3",null,"Create an account",-1),Ok={key:0,class:"alert alert-danger"},Dk={class:"d-flex flex-column gap-3"},Ik={id:"createAccount",class:"d-flex flex-column gap-2"},Lk={class:"form-group text-body"},Rk=p("label",{for:"username",class:"mb-1 text-muted"},[p("small",null,"Pick an username you like")],-1),Nk={class:
*
* Copyright (C) 2015-2020 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
2024-06-18 03:16:42 +08:00
*/(function(){function e(y){var x=new Float64Array(16);if(y)for(var C=0;C<y.length;++C)x[C]=y[C];return x}function t(y,x){for(var C,S=e(),P=e(),M=0;M<16;++M)P[M]=x[M];s(P),s(P),s(P);for(var I=0;I<2;++I){S[0]=P[0]-65517;for(var M=1;M<15;++M)S[M]=P[M]-65535-(S[M-1]>>16&1),S[M-1]&=65535;S[15]=P[15]-32767-(S[14]>>16&1),C=S[15]>>16&1,S[14]&=65535,n(P,S,1-C)}for(var M=0;M<16;++M)y[2*M]=P[M]&255,y[2*M+1]=P[M]>>8}function s(y){for(var x=0;x<16;++x)y[(x+1)%16]+=(x<15?1:38)*Math.floor(y[x]/65536),y[x]&=65535}function n(y,x,C){for(var S,P=~(C-1),M=0;M<16;++M)S=P&(y[M]^x[M]),y[M]^=S,x[M]^=S}function i(y,x,C){for(var S=0;S<16;++S)y[S]=x[S]+C[S]|0}function o(y,x,C){for(var S=0;S<16;++S)y[S]=x[S]-C[S]|0}function r(y,x,C){for(var S=new Float64Array(31),P=0;P<16;++P)for(var M=0;M<16;++M)S[P+M]+=x[P]*C[M];for(var P=0;P<15;++P)S[P]+=38*S[P+16];for(var P=0;P<16;++P)y[P]=S[P];s(y),s(y)}function a(y,x){for(var C=e(),S=0;S<16;++S)C[S]=x[S];for(var S=253;S>=0;--S)r(C,C,C),S!==2&&S!==4&&r(C,C,x);for(var S=0;S<16;++S)y[S]=C[S]}function l(y){y[31]=y[31]&127|64,y[0]&=248}function c(y){for(var x,C=new Uint8Array(32),S=e([1]),P=e([9]),M=e(),I=e([1]),N=e(),Q=e(),G=e([56129,1]),V=e([9]),L=0;L<32;++L)C[L]=y[L];l(C);for(var L=254;L>=0;--L)x=C[L>>>3]>>>(L&7)&1,n(S,P,x),n(M,I,x),i(N,S,M),o(S,S,M),i(M,P,I),o(P,P,I),r(I,N,N),r(Q,S,S),r(S,M,S),r(M,P,N),i(N,S,M),o(S,S,M),r(P,S,S),o(M,I,Q),r(S,M,G),i(S,S,I),r(M,M,S),r(S,I,Q),r(I,P,V),r(P,N,N),n(S,P,x),n(M,I,x);return a(M,M),r(S,S,M),t(C,S),C}function d(){var y=new Uint8Array(32);return window.crypto.getRandomValues(y),y}function u(){var y=d();return l(y),y}function f(y,x){for(var C=Uint8Array.from([x[0]>>2&63,(x[0]<<4|x[1]>>4)&63,(x[1]<<2|x[2]>>6)&63,x[2]&63]),S=0;S<4;++S)y[S]=C[S]+65+(25-C[S]>>8&6)-(51-C[S]>>8&75)-(61-C[S]>>8&15)+(62-C[S]>>8&3)}function g(y){var x,C=new Uint8Array(44);for(x=0;x<32/3;++x)f(C.subarray(x*4),y.subarray(x*3));return f(C.subarray(x*4),Uint8Array.from([y[x*3+0],y[x*3+1],0])),C[43]=61,String.fromCharCode.apply(null,C)}function m(y){let x=window.atob(y),C=x.length,S=new Uint8Array(C);for(let M=0;M<C;M++)S[M]=x.charCodeAt(M);return new Uint8Array(S.buffer)}function b(y,x){y.push(x&255,x>>>8&255,x>>>16&255,x>>>24&255)}function v(y,x){y.push(x&255,x>>>8&255)}function w(y,x){for(var C=0;C<x.length;++C)y.push(x[C]&255)}function E(y){for(var x=unescape(encodeURIComponent(y)),C=new Uint8Array(x.length),S=0;S<x.length;++S)C[S]=x.charCodeAt(S);return C}function $(y){if(!$.table){$.table=[];for(var x=0,C=0;C<256;x=++C){for(var S=0;S<8;++S)x=x&1?3988292384^x>>>1:x>>>1;$.table[C]=x}}for(var P=-1,M=0;M<y.length;++M)P=P>>>8^$.table[(P^y[M])&255];return(P^-1)>>>0}function T(y){for(var x=[],C=[],S=0,P=0;P<y.length;++P){var M=E(y[P].fileName),I=E(y[P].file),N=$(I);b(x,67324752),v(x,20),v(x,0),v(x,0),v(x,0),v(x,0),b(x,N),b(x,I.length),b(x,I.length),v(x,M.length),v(x,0),w(x,M),w(x,I),b(C,33639248),v(C,0),v(C,20),v(C,0),v(C,0),v(C,0),v(C,0),b(C,N),b(C,I.length),b(C,I.length),v(C,M.length),v(C,0),v(C,0),v(C,0),v(C,0),b(C,32),b(C,S),w(C,M),S+=30+I.length+M.length}return w(x,C),b(x,101010256),v(x,0),v(x,0),v(x,y.length),v(x,y.length),b(x,C.length),b(x,S),v(x,0),Uint8Array.from(x)}window.wireguard={generateKeypair:function(){var y=u(),x=c(y),C=d();return{publicKey:g(x),privateKey:g(y),presharedKey:g(C)}},generatePublicKey:function(y){return y=m(y),g(c(y))},generateZipFiles:function(y,x){var C=y.data,S=T(C),P=new Blob([S],{type:"application/zip"}),M=document.createElement("a");M.download=x,M.href=URL.createObjectURL(P),M.style.display="none",document.body.appendChild(M),M.click(),document.body.removeChild(M)}}})();const eT={name:"newConfiguration",setup(){return{store:as()}},data(){return{newConfiguration:{ConfigurationName:"",Address:"",ListenPort:"",PrivateKey:"",PublicKey:"",PresharedKey:"",PreUp:"",PreDown:"",PostUp:"",PostDown:""},numberOfAvailableIPs:"0",error:!1,errorMessage:"",success:!1,loading:!1}},created(){this.wireguardGenerateKeypair()},methods:{wireguardGenerateKeypair(){const e=window.wireguard.generateKeypair();this.newConfiguration.PrivateKey=e.privateKey,this.newConfiguration.PublicKey=e.p
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
2024-06-18 03:16:42 +08:00
*/function ar(e){return e+.5|0}const rn=(e,t,s)=>Math.max(Math.min(e,s),t);function mo(e){return rn(ar(e*2.55),0,255)}function fn(e){return rn(ar(e*255),0,255)}function Ts(e){return rn(ar(e/2.55)/100,0,1)}function Sf(e){return rn(ar(e*100),0,100)}const Ue={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Dc=[..."0123456789ABCDEF"],uD=e=>Dc[e&15],hD=e=>Dc[(e&240)>>4]+Dc[e&15],Fr=e=>(e&240)>>4===(e&15),fD=e=>Fr(e.r)&&Fr(e.g)&&Fr(e.b)&&Fr(e.a);function pD(e){var t=e.length,s;return e[0]==="#"&&(t===4||t===5?s={r:255&Ue[e[1]]*17,g:255&Ue[e[2]]*17,b:255&Ue[e[3]]*17,a:t===5?Ue[e[4]]*17:255}:(t===7||t===9)&&(s={r:Ue[e[1]]<<4|Ue[e[2]],g:Ue[e[3]]<<4|Ue[e[4]],b:Ue[e[5]]<<4|Ue[e[6]],a:t===9?Ue[e[7]]<<4|Ue[e[8]]:255})),s}const gD=(e,t)=>e<255?t(e):"";function mD(e){var t=fD(e)?uD:hD;return e?"#"+t(e.r)+t(e.g)+t(e.b)+gD(e.a,t):void 0}const _D=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function A_(e,t,s){const n=t*Math.min(s,1-s),i=(o,r=(o+e/30)%12)=>s-n*Math.max(Math.min(r-3,9-r,1),-1);return[i(0),i(8),i(4)]}function bD(e,t,s){const n=(i,o=(i+e/60)%6)=>s-s*t*Math.max(Math.min(o,4-o,1),0);return[n(5),n(3),n(1)]}function vD(e,t,s){const n=A_(e,1,.5);let i;for(t+s>1&&(i=1/(t+s),t*=i,s*=i),i=0;i<3;i++)n[i]*=1-t-s,n[i]+=t;return n}function yD(e,t,s,n,i){return e===i?(t-s)/n+(t<s?6:0):t===i?(s-e)/n+2:(e-t)/n+4}function qd(e){const s=e.r/255,n=e.g/255,i=e.b/255,o=Math.max(s,n,i),r=Math.min(s,n,i),a=(o+r)/2;let l,c,d;return o!==r&&(d=o-r,c=a>.5?d/(2-o-r):d/(o+r),l=yD(s,n,i,d,o),l=l*60+.5),[l|0,c||0,a]}function Gd(e,t,s,n){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,s,n)).map(fn)}function Xd(e,t,s){return Gd(A_,e,t,s)}function xD(e,t,s){return Gd(vD,e,t,s)}function wD(e,t,s){return Gd(bD,e,t,s)}function C_(e){return(e%360+360)%360}function ED(e){const t=_D.exec(e);let s=255,n;if(!t)return;t[5]!==n&&(s=t[6]?mo(+t[5]):fn(+t[5]));const i=C_(+t[2]),o=+t[3]/100,r=+t[4]/100;return t[1]==="hwb"?n=xD(i,o,r):t[1]==="hsv"?n=wD(i,o,r):n=Xd(i,o,r),{r:n[0],g:n[1],b:n[2],a:s}}function SD(e,t){var s=qd(e);s[0]=C_(s[0]+t),s=Xd(s),e.r=s[0],e.g=s[1],e.b=s[2]}function AD(e){if(!e)return;const t=qd(e),s=t[0],n=Sf(t[1]),i=Sf(t[2]);return e.a<255?`hsla(${s}, ${n}%, ${i}%, ${Ts(e.a)})`:`hsl(${s}, ${n}%, ${i}%)`}const Af={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Cf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
2024-06-18 03:16:42 +08:00
*/function As(){}const DD=(()=>{let e=0;return()=>e++})();function Ft(e){return e===null||typeof e>"u"}function qt(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function It(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function Qt(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Oe(e,t){return Qt(e)?e:t}function St(e,t){return typeof e>"u"?t:e}const ID=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,P_=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function Kt(e,t,s){if(e&&typeof e.call=="function")return e.apply(s,t)}function zt(e,t,s,n){let i,o,r;if(qt(e))if(o=e.length,n)for(i=o-1;i>=0;i--)t.call(s,e[i],i);else for(i=0;i<o;i++)t.call(s,e[i],i);else if(It(e))for(r=Object.keys(e),o=r.length,i=0;i<o;i++)t.call(s,e[r[i]],r[i])}function Pa(e,t){let s,n,i,o;if(!e||!t||e.length!==t.length)return!1;for(s=0,n=e.length;s<n;++s)if(i=e[s],o=t[s],i.datasetIndex!==o.datasetIndex||i.index!==o.index)return!1;return!0}function ka(e){if(qt(e))return e.map(ka);if(It(e)){const t=Object.create(null),s=Object.keys(e),n=s.length;let i=0;for(;i<n;++i)t[s[i]]=ka(e[s[i]]);return t}return e}function k_(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function LD(e,t,s,n){if(!k_(e))return;const i=t[e],o=s[e];It(i)&&It(o)?Ko(i,o,n):t[e]=ka(o)}function Ko(e,t,s){const n=qt(t)?t:[t],i=n.length;if(!It(e))return e;s=s||{};const o=s.merger||LD;let r;for(let a=0;a<i;++a){if(r=n[a],!It(r))continue;const l=Object.keys(r);for(let c=0,d=l.length;c<d;++c)o(l[c],e,r,s)}return e}function Mo(e,t){return Ko(e,t,{merger:RD})}function RD(e,t,s){if(!k_(e))return;const n=t[e],i=s[e];It(n)&&It(i)?Mo(n,i):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=ka(i))}const Pf={"":e=>e,x:e=>e.x,y:e=>e.y};function ND(e){const t=e.split("."),s=[];let n="";for(const i of t)n+=i,n.endsWith("\\")?n=n.slice(0,-1)+".":(s.push(n),n="");return s}function FD(e){const t=ND(e);return s=>{for(const n of t){if(n==="")break;s=s&&s[n]}return s}}function _n(e,t){return(Pf[t]||(Pf[t]=FD(t)))(e)}function Jd(e){return e.charAt(0).toUpperCase()+e.slice(1)}const Yo=e=>typeof e<"u",bn=e=>typeof e=="function",kf=(e,t)=>{if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0};function BD(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Xt=Math.PI,Gt=2*Xt,VD=Gt+Xt,Ta=Number.POSITIVE_INFINITY,HD=Xt/180,te=Xt/2,Rn=Xt/4,Tf=Xt*2/3,an=Math.log10,_s=Math.sign;function Oo(e,t,s){return Math.abs(e-t)<s}function Mf(e){const t=Math.round(e);e=Oo(e,t,e/1e3)?t:e;const s=Math.pow(10,Math.floor(an(e))),n=e/s;return(n<=1?1:n<=2?2:n<=5?5:10)*s}function jD(e){const t=[],s=Math.sqrt(e);let n;for(n=1;n<s;n++)e%n===0&&(t.push(n),t.push(e/n));return s===(s|0)&&t.push(s),t.sort((i,o)=>i-o).pop(),t}function zi(e){return!isNaN(parseFloat(e))&&isFinite(e)}function WD(e,t){const s=Math.round(e);return s-t<=e&&s+t>=e}function T_(e,t,s){let n,i,o;for(n=0,i=e.length;n<i;n++)o=e[n][s],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function ns(e){return e*(Xt/180)}function Qd(e){return e*(180/Xt)}function Of(e){if(!Qt(e))return;let t=1,s=0;for(;Math.round(e*t)/t!==e;)t*=10,s++;return s}function M_(e,t){const s=t.x-e.x,n=t.y-e.y,i=Math.sqrt(s*s+n*n);let o=Math.atan2(n,s);return o<-.5*Xt&&(o+=Gt),{angle:o,distance:i}}function Ic(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function zD(e,t){return(e-t+VD)%Gt-Xt}function Ie(e){return(e%Gt+Gt)%Gt}function qo(e,t,s,n){const i=Ie(e),o=Ie(t),r=Ie(s),a=Ie(o-i),l=Ie(r-i),c=Ie(i-o),d=Ie(i-r);return i===o||i===r||n&&o===r||a>l&&c<d}function de(e,t,s){return Math.max(t,Math.min(s,e))}function UD(e){return de(e,-32768,32767)}function Os(e,t,s,n=1e-6){return e>=Math.min(t,s)-n&&e<=Math.max(t,s)+n}function Zd(e,t,s){s=s||(r=>e[r]<t);let n=e.length-1,i=0,o;for(;n-i>1;)o=i+n>>1,s(o)?i=o:n=o;return{lo:i,hi:n}}const Ds=(e,t,s,n)=>Zd(e,s,n?i=>{const o=e[i][t];return o<s||o===s&&e[i+1][t]===s}:i=>e[i][t]<s),KD=(e,t,s)=>Zd
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
2024-06-18 03:16:42 +08:00
*/class XI{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,s,n,i){const o=s.listeners[i],r=s.duration;o.forEach(a=>a({chart:t,initial:s.initial,numSteps:r,currentStep:Math.min(n-s.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=I_.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let s=0;this._charts.forEach((n,i)=>{if(!n.running||!n.items.length)return;const o=n.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>n.duration&&(n.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(i.draw(),this._notify(i,n,t,"progress")),o.length||(n.running=!1,this._notify(i,n,t,"complete"),n.initial=!1),s+=o.length}),this._lastDate=t,s===0&&(this._running=!1)}_getAnims(t){const s=this._charts;let n=s.get(t);return n||(n={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},s.set(t,n)),n}listen(t,s,n){this._getAnims(t).listeners[s].push(n)}add(t,s){!s||!s.length||this._getAnims(t).items.push(...s)}has(t){return this._getAnims(t).items.length>0}start(t){const s=this._charts.get(t);s&&(s.running=!0,s.start=Date.now(),s.duration=s.items.reduce((n,i)=>Math.max(n,i._duration),0),this._refresh())}running(t){if(!this._running)return!1;const s=this._charts.get(t);return!(!s||!s.running||!s.items.length)}stop(t){const s=this._charts.get(t);if(!s||!s.items.length)return;const n=s.items;let i=n.length-1;for(;i>=0;--i)n[i].cancel();s.items=[],this._notify(t,s,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var $s=new XI;const Kf="transparent",JI={boolean(e,t,s){return s>.5?t:e},color(e,t,s){const n=Rf(e||Kf),i=n.valid&&Rf(t||Kf);return i&&i.valid?i.mix(n,s).hexString():t},number(e,t,s){return e+(t-e)*s}};class QI{constructor(t,s,n,i){const o=s[n];i=_o([t.to,i,o,t.from]);const r=_o([t.from,o,i]);this._active=!0,this._fn=t.fn||JI[t.type||typeof r],this._easing=Do[t.easing]||Do.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=s,this._prop=n,this._from=r,this._to=i,this._promises=void 0}active(){return this._active}update(t,s,n){if(this._active){this._notify(!1);const i=this._target[this._prop],o=n-this._start,r=this._duration-o;this._start=n,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=_o([t.to,s,i,t.from]),this._from=_o([t.from,i,s])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const s=t-this._start,n=this._duration,i=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||s<n),!this._active){this._target[i]=a,this._notify(!0);return}if(s<0){this._target[i]=o;return}l=s/n%2,l=r&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[i]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((s,n)=>{t.push({res:s,rej:n})})}_notify(t){const s=t?"res":"rej",n=this._promises||[];for(let i=0;i<n.length;i++)n[i][s]()}}class Q_{constructor(t,s){this._chart=t,this._properties=new Map,this.configure(s)}configure(t){if(!It(t))return;const s=Object.keys(Zt.animation),n=this._properties;Object.getOwnPropertyNames(t).forEach(i=>{const o=t[i];if(!It(o))return;const r={};for(const a of s)r[a]=o[a];(qt(o.properties)&&o.properties||[i]).forEach(a=>{(a===i||!n.has(a))&&n.set(a,r)})})}_animateOptions(t,s){const n=s.options,i=t2(t,n);if(!i)return[];const o=this._createAnimations(i,n);return n.$shared&&ZI(t.options.$animations,n).then(()=>{t.options=n},()=>{}),o}_createAnimations(t,s){const n=this._properties,i=[],o=t.$animations||(t.$animations={}),r=Object.keys(s),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){i.push(...this._animateOptions(t,s));continue}const d=s[c];let u=o[c];const f=n.get(c);if(u)if(f&&u.active()){u.update(f,d,a);continue}else u.cancel();if(!f||!f.duration){t[c]=d;continue}o[c]=u=new QI(f,t,c,d),i.push(u)}return i}update(t,s){if(this._properties.size
`)>-1?e.split(`
2024-06-18 03:16:42 +08:00
`):e}function PR(e,t){const{element:s,datasetIndex:n,index:i}=t,o=e.getDatasetMeta(n).controller,{label:r,value:a}=o.getLabelAndValue(i);return{chart:e,label:r,parsed:o.getParsed(i),raw:e.data.datasets[n].data[i],formattedValue:a,dataset:o.getDataset(),dataIndex:i,datasetIndex:n,element:s}}function Tp(e,t){const s=e.chart.ctx,{body:n,footer:i,title:o}=e,{boxWidth:r,boxHeight:a}=t,l=re(t.bodyFont),c=re(t.titleFont),d=re(t.footerFont),u=o.length,f=i.length,g=n.length,m=be(t.padding);let b=m.height,v=0,w=n.reduce((T,y)=>T+y.before.length+y.lines.length+y.after.length,0);if(w+=e.beforeBody.length+e.afterBody.length,u&&(b+=u*c.lineHeight+(u-1)*t.titleSpacing+t.titleMarginBottom),w){const T=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;b+=g*T+(w-g)*l.lineHeight+(w-1)*t.bodySpacing}f&&(b+=t.footerMarginTop+f*d.lineHeight+(f-1)*t.footerSpacing);let E=0;const $=function(T){v=Math.max(v,s.measureText(T).width+E)};return s.save(),s.font=c.string,zt(e.title,$),s.font=l.string,zt(e.beforeBody.concat(e.afterBody),$),E=t.displayColors?r+2+t.boxPadding:0,zt(n,T=>{zt(T.before,$),zt(T.lines,$),zt(T.after,$)}),E=0,s.font=d.string,zt(e.footer,$),s.restore(),v+=m.width,{width:v,height:b}}function kR(e,t){const{y:s,height:n}=t;return s<n/2?"top":s>e.height-n/2?"bottom":"center"}function TR(e,t,s,n){const{x:i,width:o}=n,r=s.caretSize+s.caretPadding;if(e==="left"&&i+o+r>t.width||e==="right"&&i-o-r<0)return!0}function MR(e,t,s,n){const{x:i,width:o}=s,{width:r,chartArea:{left:a,right:l}}=e;let c="center";return n==="center"?c=i<=(a+l)/2?"left":"right":i<=o/2?c="left":i>=r-o/2&&(c="right"),TR(c,e,t,s)&&(c="center"),c}function Mp(e,t,s){const n=s.yAlign||t.yAlign||kR(e,s);return{xAlign:s.xAlign||t.xAlign||MR(e,t,s,n),yAlign:n}}function OR(e,t){let{x:s,width:n}=e;return t==="right"?s-=n:t==="center"&&(s-=n/2),s}function DR(e,t,s){let{y:n,height:i}=e;return t==="top"?n+=s:t==="bottom"?n-=i+s:n-=i/2,n}function Op(e,t,s,n){const{caretSize:i,caretPadding:o,cornerRadius:r}=e,{xAlign:a,yAlign:l}=s,c=i+o,{topLeft:d,topRight:u,bottomLeft:f,bottomRight:g}=Gn(r);let m=OR(t,a);const b=DR(t,l,c);return l==="center"?a==="left"?m+=c:a==="right"&&(m-=c):a==="left"?m-=Math.max(d,f)+i:a==="right"&&(m+=Math.max(u,g)+i),{x:de(m,0,n.width-t.width),y:de(b,0,n.height-t.height)}}function Gr(e,t,s){const n=be(s.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-n.right:e.x+n.left}function Dp(e){return ds([],Ps(e))}function IR(e,t,s){return En(e,{tooltip:t,tooltipItems:s,type:"tooltip"})}function Ip(e,t){const s=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return s?e.override(s):e}const bb={beforeTitle:As,title(e){if(e.length>0){const t=e[0],s=t.chart.data.labels,n=s?s.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(n>0&&t.dataIndex<n)return s[t.dataIndex]}return""},afterTitle:As,beforeBody:As,beforeLabel:As,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const s=e.formattedValue;return Ft(s)||(t+=s),t},labelColor(e){const s=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:s.borderColor,backgroundColor:s.backgroundColor,borderWidth:s.borderWidth,borderDash:s.borderDash,borderDashOffset:s.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const s=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:s.pointStyle,rotation:s.rotation}},afterLabel:As,afterBody:As,beforeFooter:As,footer:As,afterFooter:As};function Pe(e,t,s,n){const i=e[t].call(s,n);return typeof i>"u"?bb[t].call(s,n):i}class jc extends js{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void
${e.data?"is on":"is off"}`,"Success"):this.dashboardConfigurationStore.newMessage("Server",e.message,"danger"),this.configurationInfo.Status=e.data,this.configurationToggling=!1})},getPeers(e=this.$route.params.id){he("/api/getWireguardConfigurationInfo",{configurationName:e},t=>{if(this.configurationInfo=t.data.configurationInfo,this.configurationPeers=t.data.configurationPeers,this.configurationPeers.forEach(s=>{s.restricted=!1}),t.data.configurationRestrictedPeers.forEach(s=>{s.restricted=!0,this.configurationPeers.push(s)}),this.loading=!1,this.configurationPeers.length>0){const s=this.configurationPeers.map(i=>i.total_sent+i.cumu_sent).reduce((i,o)=>i+o).toFixed(4),n=this.configurationPeers.map(i=>i.total_receive+i.cumu_receive).reduce((i,o)=>i+o).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==s&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,Xp().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((s-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:" #198754",tension:0}]}),this.historyDataSentDifference.push(s)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==n&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,Xp().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((n-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(n))}})},setInterval(){this.interval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(e=>e.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.map(e=>e.total_data+e.cumu_data).reduce((e,t)=>e+t):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.map(e=>e.total_receive+e.cumu_receive).reduce((e,t)=>e+t):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.map(e=>e.total_sent+e.cumu_sent).reduce((e,t)=>e+t):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(e=>e.name?e.name:`Untitled Peer - ${e.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(e=>e.cumu_data+e.total_data),backgroundColor:this.configurationPeers.map(e=>"#0dcaf0"),tooltip:{callbacks:{label:e=>`${e.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(e,t)=>`${e} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:e=>`${e.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(e,t)=>`${e} MB/s`},grid:{display:!1}}}}},searchPeers(){const e=new Zi(this.configurationPeers,{keys:["name","id","allowed_ip"]}),t=this.wireguardConfigurationStore.searchString?e.search(this.wireguardConfigurationStore.searchString).map(s=>s.item):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?t.slice().sort((s,n)=>s[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:s[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]>n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):t.slice().sort((s,n)=>s[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]<n[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:s[this.dashboardConfigurationStore.Configuration.Serve