Files
ogame-vue-ts/docs/assets/vendor-pinia-DP9x75p8.js
2025-12-14 15:55:27 +08:00

1 line
8.3 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{Et as e,Ht as t,Lt as n,Rt as r,cn as i,dn as a,fn as o,hn as s,ln as c,pn as l,sn as u,tn as d,un as f,xn as p,yn as m}from"./game-logic-CfBcTF_c.js";var h=typeof window<`u`,g,_=e=>g=e,v=Symbol();function y(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var b;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(b||={});var x=(()=>typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null})();function S(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function C(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){O(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function w(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function T(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var E=typeof navigator==`object`?navigator:{userAgent:``},D=(()=>/Macintosh/.test(E.userAgent)&&/AppleWebKit/.test(E.userAgent)&&!/Safari/.test(E.userAgent))(),O=h?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!D?k:`msSaveOrOpenBlob`in E?A:j:()=>{};function k(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?T(r):w(r.href)?C(e,t,n):(r.target=`_blank`,T(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){T(r)},0))}function A(e,t=`download`,n){if(typeof e==`string`)if(w(e))C(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){T(t)})}else navigator.msSaveOrOpenBlob(S(e,n),t)}function j(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return C(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(x.HTMLElement))||`safari`in x,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||D)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:ee}=Object;function M(){let e=u(!0),t=e.run(()=>s({})),n=[],r=[],i=a({install(e){_(i),i._a=e,e.provide(v,i),e.config.globalProperties.$pinia=i,r.forEach(e=>n.push(e)),r=[]},use(e){return this._a?n.push(e):r.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}var N=()=>{};function P(e,t,n,r=N){e.add(t);let a=()=>{e.delete(t)&&r()};return!n&&i()&&o(a),a}function F(e,...t){e.forEach(e=>{e(...t)})}var I=e=>e(),L=Symbol(),R=Symbol();function z(e,t){for(let n in e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e),t){if(!t.hasOwnProperty(n))continue;let r=t[n],i=e[n];y(i)&&y(r)&&e.hasOwnProperty(n)&&!f(r)&&!c(r)?e[n]=z(i,r):e[n]=r}return e}var B=Symbol();function V(e){return!y(e)||!Object.prototype.hasOwnProperty.call(e,B)}var{assign:H}=Object;function U(e){return!!(f(e)&&e.effect)}function W(t,n,r,i){let{state:o,actions:s,getters:c}=n,l=r.state.value[t],u;function d(){return l||(r.state.value[t]=o?o():{}),H(p(r.state.value[t]),s,Object.keys(c||{}).reduce((n,i)=>(n[i]=a(e(()=>{_(r);let e=r._s.get(t);return c[i].call(e,e)})),n),{}))}return u=G(t,d,n,r,i,!0),u}function G(e,n,r={},i,a,o){let p,h=H({actions:{}},r),g={deep:!0},v,y,x=new Set,S=new Set,C=i.state.value[e];!o&&!C&&(i.state.value[e]={}),s({});let w;function T(n){let r;v=y=!1,typeof n==`function`?(n(i.state.value[e]),r={type:b.patchFunction,storeId:e,events:void 0}):(z(i.state.value[e],n),r={type:b.patchObject,payload:n,storeId:e,events:void 0});let a=w=Symbol();t().then(()=>{w===a&&(v=!0)}),y=!0,F(x,r,i.state.value[e])}let E=o?function(){let{state:e}=r,t=e?e():{};this.$patch(e=>{H(e,t)})}:N;function D(){p.stop(),x.clear(),S.clear(),i._s.delete(e)}let O=(t,n=``)=>{if(L in t)return t[R]=n,t;let r=function(){_(i);let n=Array.from(arguments),a=new Set,o=new Set;function s(e){a.add(e)}function c(e){o.add(e)}F(S,{args:n,name:r[R],store:k,after:s,onError:c});let l;try{l=t.apply(this&&this.$id===e?this:k,n)}catch(e){throw F(o,e),e}return l instanceof Promise?l.then(e=>(F(a,e),e)).catch(e=>(F(o,e),Promise.reject(e))):(F(a,l),l)};return r[L]=!0,r[R]=n,r},k=l({_p:i,$id:e,$onAction:P.bind(null,S),$patch:T,$reset:E,$subscribe(t,n={}){let r=P(x,t,n.detached,()=>a()),a=p.run(()=>d(()=>i.state.value[e],r=>{(n.flush===`sync`?y:v)&&t({storeId:e,type:b.direct,events:void 0},r)},H({},g,n)));return r},$dispose:D});i._s.set(e,k);let A=(i._a&&i._a.runWithContext||I)(()=>i._e.run(()=>(p=u()).run(()=>n({action:O}))));for(let t in A){let n=A[t];f(n)&&!U(n)||c(n)?o||(C&&V(n)&&(f(n)?n.value=C[t]:z(n,C[t])),i.state.value[e][t]=n):typeof n==`function`&&(A[t]=O(n,t),h.actions[t]=n)}return H(k,A),H(m(k),A),Object.defineProperty(k,`$state`,{get:()=>i.state.value[e],set:e=>{T(t=>{H(t,e)})}}),i._p.forEach(e=>{H(k,p.run(()=>e({store:k,app:i._a,pinia:i,options:h})))}),C&&o&&r.hydrate&&r.hydrate(k.$state,C),v=!0,y=!0,k}function K(e,t,i){let a,o=typeof t==`function`;a=o?i:t;function s(i,s){let c=n();return i||=c?r(v,null):null,i&&_(i),i=g,i._s.has(e)||(o?G(e,t,a,i):W(e,a,i)),i._s.get(e)}return s.$id=e,s}function q(e,t){if(e==null)return;let n=e;for(let e=0;e<t.length;e++){if(n===void 0||n[t[e]]===void 0)return;if(n===null||n[t[e]]===null)return null;n=n[t[e]]}return n}function J(e,t,n){if(n.length===0)return t;let r=n[0];return n.length>1&&(t=J(typeof e!=`object`||!e||!Object.prototype.hasOwnProperty.call(e,r)?Number.isInteger(Number(n[1]))?[]:{}:e[r],t,Array.prototype.slice.call(n,1))),Number.isInteger(Number(r))&&Array.isArray(e)?e.slice()[r]:Object.assign({},e,{[r]:t})}function Y(e,t){if(e==null||t.length===0)return e;if(t.length===1){if(e==null)return e;if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.slice.call(e,0).splice(t[0],1);let n={};for(let t in e)n[t]=e[t];return delete n[t[0]],n}if(e[t[0]]==null){if(Number.isInteger(t[0])&&Array.isArray(e))return Array.prototype.concat.call([],e);let n={};for(let t in e)n[t]=e[t];return n}return J(e,Y(e[t[0]],Array.prototype.slice.call(t,1)),[t[0]])}function X(e,t){return t.map(e=>e.split(`.`)).map(t=>[t,q(e,t)]).filter(e=>e[1]!==void 0).reduce((e,t)=>J(e,t[1],t[0]),{})}function Z(e,t){return t.map(e=>e.split(`.`)).reduce((e,t)=>Y(e,t),e)}function Q(e,{storage:t,serializer:n,key:r,debug:i,pick:a,omit:o,beforeHydrate:s,afterHydrate:c},l,u=!0){try{u&&s?.(l);let i=t.getItem(r);if(i){let t=n.deserialize(i),r=a?X(t,a):t,s=o?Z(r,o):r;e.$patch(s)}u&&c?.(l)}catch(e){i&&console.error(`[pinia-plugin-persistedstate]`,e)}}function $(e,{storage:t,serializer:n,key:r,debug:i,pick:a,omit:o}){try{let i=a?X(e,a):e,s=o?Z(i,o):i,c=n.serialize(s);t.setItem(r,c)}catch(e){i&&console.error(`[pinia-plugin-persistedstate]`,e)}}function te(e,t){return typeof e==`function`?e(t):typeof e==`string`?e:t}function ne(e,t,n){let{pinia:r,store:i,options:{persist:a=n}}=e;if(!a)return;if(!(i.$id in r.state.value)){let e=r._s.get(i.$id.replace(`__hot:`,``));e&&Promise.resolve().then(()=>e.$persist());return}let o=(Array.isArray(a)?a:a===!0?[{}]:[a]).map(t);i.$hydrate=({runHooks:t=!0}={})=>{o.forEach(n=>{Q(i,n,e,t)})},i.$persist=()=>{o.forEach(e=>{$(i.$state,e)})},o.forEach(t=>{Q(i,t,e),i.$subscribe((e,n)=>$(n,t),{detached:!0})})}function re(e={}){return function(t){ne(t,n=>{let r=te(n.key,t.store.$id);return{key:(e.key?e.key:e=>e)(r),debug:n.debug??e.debug??!1,serializer:n.serializer??e.serializer??{serialize:e=>JSON.stringify(e),deserialize:e=>JSON.parse(e)},storage:n.storage??e.storage??window.localStorage,beforeHydrate:n.beforeHydrate??e.beforeHydrate,afterHydrate:n.afterHydrate??e.afterHydrate,pick:n.pick,omit:n.omit}},e.auto??!1)}}var ie=re();export{M as n,K as r,ie as t};