allinssl/build/static/js/index-DCCs3mde.js

2 lines
4.3 KiB
JavaScript

import{p as e,i as t,b as n,t as a,w as r,c as o,d as l,e as s,f as i}from"./index-BHwZLzK4.js";import{bS as u,av as f,bT as c,k as d,bU as v,o as g,bV as p,bW as w,r as m,x as y,V as h}from"./main-e4AvE_no.js";const b=n?window:void 0;function S(...e){const t=[],n=()=>{t.forEach((e=>e())),t.length=0},s=d((()=>{const t=a(c(e[0])).filter((e=>null!=e));return t.every((e=>"string"!=typeof e))?t:void 0})),i=r((()=>{var t,n;return[null!=(n=null==(t=s.value)?void 0:t.map((e=>function(e){var t;const n=c(e);return null!=(t=null==n?void 0:n.$el)?t:n}(e))))?n:[b].filter((e=>null!=e)),a(c(s.value?e[1]:e[0])),a(w(s.value?e[2]:e[1])),c(s.value?e[3]:e[2])]}),(([e,a,r,o])=>{if(n(),!(null==e?void 0:e.length)||!(null==a?void 0:a.length)||!(null==r?void 0:r.length))return;const s=l(o)?{...o}:o;t.push(...e.flatMap((e=>a.flatMap((t=>r.map((n=>((e,t,n,a)=>(e.addEventListener(t,n,a),()=>e.removeEventListener(t,n,a)))(e,t,n,s))))))))}),{flush:"post"});return o(n),()=>{i(),n()}}function N(e){const t=function(){const e=u(!1),t=p();return t&&g((()=>{e.value=!0}),t),e}();return d((()=>(t.value,Boolean(e()))))}const M=Symbol("vueuse-ssr-width");function O(){const e=v()?t(M,null):null;return"number"==typeof e?e:void 0}function A(t,n={}){const{window:a=b,ssrWidth:r=O()}=n,o=N((()=>a&&"matchMedia"in a&&"function"==typeof a.matchMedia)),l=u("number"==typeof r),s=u(),i=u(!1);return f((()=>{if(l.value){l.value=!o.value;const n=c(t).split(",");i.value=n.some((t=>{const n=t.includes("not all"),a=t.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),o=t.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let l=Boolean(a||o);return a&&l&&(l=r>=e(a[1])),o&&l&&(l=r<=e(o[1])),n?!l:l}))}else o.value&&(s.value=a.matchMedia(c(t)),i.value=s.value.matches)})),S(s,"change",(e=>{i.value=e.matches}),{passive:!0}),d((()=>i.value))}const E="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},j="__vueuse_ssr_handlers__",I=J();function J(){return j in E||(E[j]=E[j]||{}),E[j]}const V={boolean:{read:e=>"true"===e,write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},_="vueuse-storage";function D(e,t,n,a={}){var r;const{flush:o="pre",deep:l=!0,listenToStorageChanges:f=!0,writeDefaults:v=!0,mergeDefaults:g=!1,shallow:p,window:w=b,eventFilter:N,onError:M=e=>{},initOnMounted:O}=a,A=(p?u:m)("function"==typeof t?t():t),E=d((()=>c(e)));if(!n)try{n=function(e,t){return I[e]||t}("getDefaultStorage",(()=>{var e;return null==(e=b)?void 0:e.localStorage}))()}catch(B){M(B)}if(!n)return A;const j=c(t),J=function(e){return null==e?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":"boolean"==typeof e?"boolean":"string"==typeof e?"string":"object"==typeof e?"object":Number.isNaN(e)?"any":"number"}(j),D=null!=(r=a.serializer)?r:V[J],{pause:k,resume:x}=s(A,(()=>function(e){try{const t=n.getItem(E.value);if(null==e)T(t,null),n.removeItem(E.value);else{const a=D.write(e);t!==a&&(n.setItem(E.value,a),T(t,a))}}catch(B){M(B)}}(A.value)),{flush:o,deep:l,eventFilter:N});function T(e,t){if(w){const a={key:E.value,oldValue:e,newValue:t,storageArea:n};w.dispatchEvent(n instanceof Storage?new StorageEvent("storage",a):new CustomEvent(_,{detail:a}))}}function z(e){if(!e||e.storageArea===n)if(e&&null==e.key)A.value=j;else if(!e||e.key===E.value){k();try{(null==e?void 0:e.newValue)!==D.write(A.value)&&(A.value=function(e){const t=e?e.newValue:n.getItem(E.value);if(null==t)return v&&null!=j&&n.setItem(E.value,D.write(j)),j;if(!e&&g){const e=D.read(t);return"function"==typeof g?g(e,j):"object"!==J||Array.isArray(e)?e:{...j,...e}}return"string"!=typeof t?t:D.read(t)}(e))}catch(B){M(B)}finally{e?h(x):x()}}}function F(e){z(e.detail)}return y(E,(()=>z()),{flush:o}),w&&f&&i((()=>{n instanceof Storage?S(w,"storage",z,{passive:!0}):S(w,_,F),O&&z()})),O||z(),A}function k(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.localStorage,n)}function x(e,t,n={}){const{window:a=b}=n;return D(e,t,null==a?void 0:a.sessionStorage,n)}export{k as a,x as b,A as u};