Files
infra/ru-vps/mihomo/config/ui/_nuxt/B794cfQr.js
T
Dmitry 59a7749b18
Deploy ru-vps / deploy (push) Successful in 22s
Убрать всё, кроме mihomo
2026-06-08 23:05:05 +03:00

1 line
12 KiB
JavaScript

import{M as e,Y as t,_ as n,ct as r,dt as i,ht as a,j as o,ot as s,st as c,ut as l}from"./CaGtQlYh.js";import{At as u,Ct as d,Dt as f,Et as p,St as m,Tt as h,_t as g,bt as _,ct as v,dt as y,ft as b,gt as x,ht as S,lt as C,mt as w,pt as T,ut as E,vt as D,wt as O,xt as k,yt as A}from"#entry";import{p as j,v as M}from"./DohEsvF1.js";var N=class extends f{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=w(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),F(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return I(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return I(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&L(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||k(this.options.staleTime,this.#t)!==k(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return z(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(D)),t}#g(){this.#b();let e=k(this.options.staleTime,this.#t);if(S.isServer()||this.#r.isStale||!g(e))return;let t=O(this.#r.dataUpdatedAt,e)+1;this.#d=h.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(S.isServer()||_(this.options.enabled,this.#t)===!1||!g(this.#p)||this.#p===0)&&(this.#f=h.setInterval(()=>{(this.options.refetchIntervalInBackground||p.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(h.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(h.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&F(e,t),o=i&&L(e,n,t,r);(a||o)&&(l={...l,...b(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=A(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=A(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,v=m===`pending`,y=m===`error`,x=v&&g,S=d!==void 0,C={status:m,fetchStatus:l.fetchStatus,isPending:v,isSuccess:m===`success`,isError:y,isInitialLoading:x,isLoading:x,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!v,isLoadingError:y&&!S,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:y&&S,isStale:R(e,t),refetch:this.refetch,promise:this.#o,isEnabled:_(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=C.data!==void 0,r=C.status===`error`&&!t,i=e=>{r?e.reject(C.error):t&&e.resolve(C.data)},a=()=>{i(this.#o=C.promise=w())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||C.data!==o.value)&&a();break;case`rejected`:(!r||C.error!==o.reason)&&a();break}}return C}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!m(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){T.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function P(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&_(t.retryOnMount,e)===!1)}function F(e,t){return P(e,t)||e.state.data!==void 0&&I(e,t,t.refetchOnMount)}function I(e,t,n){if(_(t.enabled,e)!==!1&&k(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&R(e,t)}return!1}function L(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&R(e,n)}function R(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(k(t.staleTime,e))}function z(e,t){return!m(e.getCurrentResult(),t)}var B=class extends f{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),m(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&x(t.mutationKey)!==x(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??y();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){T.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function V(t=``){if(!o())throw Error(`vue-query hooks can only be used inside setup() function or functions that support injection context.`);let n=e(C(t));if(!n)throw Error(`No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.`);return n}function H(e,o,u){let f=u||V(),p=n(()=>{let e=o;typeof e==`function`&&(e=e());let t=v(e);typeof t.enabled==`function`&&(t.enabled=t.enabled());let n=f.defaultQueryOptions(t);return n._optimisticResults=f.isRestoring?.value?`isRestoring`:`optimistic`,n}),m=new e(f,p.value),h=p.value.shallow?l(m.getCurrentResult()):c(m.getCurrentResult()),g=()=>{};f.isRestoring&&t(f.isRestoring,e=>{e||(g(),g=m.subscribe(e=>{E(h,e)}))},{immediate:!0});let _=()=>{m.setOptions(p.value),E(h,m.getCurrentResult())};t(p,_),s(()=>{g()});let y=(...e)=>(_(),h.refetch(...e)),b=()=>new Promise((e,n)=>{let r=()=>{},i=()=>{if(p.value.enabled!==!1){m.setOptions(p.value);let t=m.getOptimisticResult(p.value);t.isStale?(r(),m.fetchOptimistic(p.value).then(e,t=>{d(p.value.throwOnError,[t,m.getCurrentQuery()])?n(t):e(m.getCurrentResult())})):(r(),e(t))}};i(),r=t(p,i)});t(()=>h.error,e=>{if(h.isError&&!h.isFetching&&d(p.value.throwOnError,[e,m.getCurrentQuery()]))throw e});let x=a(p.value.shallow?i(h):r(h));for(let e in h)typeof h[e]==`function`&&(x[e]=h[e]);return x.suspense=b,x.refetch=y,x}function U(e,t){return H(N,e,t)}function W(e,o){let u=o||V(),f=n(()=>{let t=typeof e==`function`?e():e;return u.defaultMutationOptions(v(t))}),p=new B(u,f.value),m=f.value.shallow?l(p.getCurrentResult()):c(p.getCurrentResult()),h=p.subscribe(e=>{E(m,e)}),g=(e,t)=>{p.mutate(e,t).catch(()=>{})};t(f,()=>{p.setOptions(f.value)}),s(()=>{h()});let _=a(f.value.shallow?i(m):r(m));return t(()=>m.error,e=>{if(e&&d(f.value.throwOnError,[e]))throw e}),{..._,mutate:g,mutateAsync:m.mutate,reset:m.reset}}function G(){return M()}var K={proxies:[`proxies`],proxyProviders:[`proxy-providers`],rules:[`rules`],ruleProviders:[`rule-providers`],config:[`config`],version:[`version`]};function q(e){let t=u();return n(()=>[...e,t.selectedEndpoint])}function J(){return U({queryKey:q(K.rules),queryFn:async()=>{let{rules:e}=await G().get(`rules`).json();return Object.entries(e).map(([e,t])=>({...t,index:Number(e)}))}})}function Y(){let e=V();return W({mutationFn:async({index:e,disabled:t})=>{await j(e,t)},onSuccess:()=>{e.invalidateQueries({queryKey:K.rules})}})}function X(){return U({queryKey:q(K.ruleProviders),queryFn:async()=>{let{providers:e}=await G().get(`providers/rules`).json();return Object.values(e)}})}function Z(){let e=V();return W({mutationFn:async e=>{await G().put(`providers/rules/${encodeURIComponent(e)}`)},onSuccess:()=>{e.invalidateQueries({queryKey:K.rules}),e.invalidateQueries({queryKey:K.ruleProviders})}})}function Q(){return U({queryKey:q(K.config),queryFn:async()=>G().get(`configs`).json()})}function $(){let e=V();return W({mutationFn:async({key:e,value:t})=>{await G().patch(`configs`,{json:{[e]:t}})},onSuccess:()=>{e.invalidateQueries({queryKey:K.config})}})}function ee(){return U({queryKey:q(K.version),queryFn:async()=>{let{version:e}=await G().get(`version`).json();return e}})}export{$ as a,W as c,Y as i,X as n,Z as o,J as r,ee as s,Q as t};