u()?void 0:m()).then(()=>{t?f(v):g()})})};return{promise:i,status:()=>i.status,cancel:a,continue:()=>(r==null||r(),i),cancelRetry:o,continueRetry:l,canStart:d,start:()=>(d()?g():m().then(g),i)}}var si,Sm,qy=(Sm=class{constructor(){ne(this,si)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Uc(this.gcTime)&&H(this,si,ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_i?1/0:5*60*1e3))}clearGcTimeout(){_(this,si)&&(ni.clearTimeout(_(this,si)),H(this,si,void 0))}},si=new WeakMap,Sm),ai,rs,Ut,oi,et,Ia,li,rn,Ln,Em,hw=(Em=class extends qy{constructor(t){super();ne(this,rn);ne(this,ai);ne(this,rs);ne(this,Ut);ne(this,oi);ne(this,et);ne(this,Ia);ne(this,li);H(this,li,!1),H(this,Ia,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,oi,t.client),H(this,Ut,_(this,oi).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,ai,pp(this.options)),this.state=t.state??_(this,ai),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,et))==null?void 0:t.promise}setOptions(t){if(this.options={..._(this,Ia),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=pp(this.options);n.data!==void 0&&(this.setState(hp(n.data,n.dataUpdatedAt)),H(this,ai,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Ut).remove(this)}setData(t,n){const r=Qc(this.state.data,t,this.options);return fe(this,rn,Ln).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){fe(this,rn,Ln).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=_(this,et))==null?void 0:r.promise;return(i=_(this,et))==null||i.cancel(t),n?n.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,ai))}isActive(){return this.observers.some(t=>Vt(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===gf||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Mr(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Qy(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,et))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Ut).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,et)&&(_(this,li)?_(this,et).cancel({revert:!0}):_(this,et).cancelRetry()),this.scheduleGc()),_(this,Ut).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||fe(this,rn,Ln).call(this,{type:"invalidate"})}async fetch(t,n){var l,u,d,c,f,m,g,x,T,v,p,y;if(this.state.fetchStatus!=="idle"&&((l=_(this,et))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,et))return _(this,et).continueRetry(),_(this,et).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(R=>R.options.queryFn);S&&this.setOptions(S.options)}const r=new AbortController,i=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:)DELIM"
-R"DELIM(()=>(H(this,li,!0),r.signal)})},s=()=>{const S=Zy(this.options,n),L=(()=>{const k={client:_(this,oi),queryKey:this.queryKey,meta:this.meta};return i(k),k})();return H(this,li,!1),this.options.persister?this.options.persister(S,L,this):S(L)},o=(()=>{const S={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:_(this,oi),state:this.state,fetchFn:s};return i(S),S})();(u=this.options.behavior)==null||u.onFetch(o,this),H(this,rs,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=o.fetchOptions)==null?void 0:d.meta))&&fe(this,rn,Ln).call(this,{type:"fetch",meta:(c=o.fetchOptions)==null?void 0:c.meta}),H(this,et,Gy({initialPromise:n==null?void 0:n.initialPromise,fn:o.fetchFn,onCancel:S=>{S instanceof Zc&&S.revert&&this.setState({..._(this,rs),fetchStatus:"idle"}),r.abort()},onFail:(S,R)=>{fe(this,rn,Ln).call(this,{type:"failed",failureCount:S,error:R})},onPause:()=>{fe(this,rn,Ln).call(this,{type:"pause"})},onContinue:()=>{fe(this,rn,Ln).call(this,{type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}));try{const S=await _(this,et).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(m=(f=_(this,Ut).config).onSuccess)==null||m.call(f,S,this),(x=(g=_(this,Ut).config).onSettled)==null||x.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Zc){if(S.silent)return _(this,et).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw fe(this,rn,Ln).call(this,{type:"error",error:S}),(v=(T=_(this,Ut).config).onError)==null||v.call(T,S,this),(y=(p=_(this,Ut).config).onSettled)==null||y.call(p,this.state.data,S,this),S}finally{this.scheduleGc()}}},ai=new WeakMap,rs=new WeakMap,Ut=new WeakMap,oi=new WeakMap,et=new WeakMap,Ia=new WeakMap,li=new WeakMap,rn=new WeakSet,Ln=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Yy(r.data,this.options),fetchMeta:t.meta??null};case"success":const i={...r,...hp(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,rs,t.manual?i:void 0),i;case"error":const s=t.error;return{...r,error:s,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ot.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Ut).notify({query:this,type:"updated",action:t})})},Em);function Yy(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ky(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hp(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function pp(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var _t,he,$a,mt,ui,is,In,mr,Fa,ss,as,ci,di,vr,os,Se,Ys,Kc,Gc,qc,Yc,Xc,Jc,ed,Xy,Cm,pw=(Cm=class extends Za{constructor(t,n){super();ne(this,Se);ne(this,_t);ne(this,he);ne(this,$a);ne(this,mt);ne(this,ui);ne(this,is);ne(this,In);ne(this,mr);ne(this,Fa);ne(this,ss);ne(this,as);ne(this,ci);ne(this,di);ne(this,vr);ne(this,os,new Set);this.options=n,H(this,_t,t),H(this,mr,null),H(this,In,Wc()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,he).addObserver(this),mp(_(this,he),this.options)?fe(this,Se,Ys).call(this):this.updateResult(),fe(this,Se,Yc).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return td(_(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return td(_(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,fe(this,Se,Xc).call(this),fe(this,Se,Jc).call(this),_(this,he).removeObserver(this)}setOptions(t){const n=this.options,r=_(this,he);if(this.options=_(this,_t).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Vt(this.options.enabled,_(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");fe(this,Se,ed).call(this),_(this,he).setOptions(this.options),n._defaulted&&!Hc(this.options,n)&&_(this,_t).getQueryCac)DELIM"
-R"DELIM(he().notify({type:"observerOptionsUpdated",query:_(this,he),observer:this});const i=this.hasListeners();i&&vp(_(this,he),r,this.options,n)&&fe(this,Se,Ys).call(this),this.updateResult(),i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||Mr(this.options.staleTime,_(this,he))!==Mr(n.staleTime,_(this,he)))&&fe(this,Se,Kc).call(this);const s=fe(this,Se,Gc).call(this);i&&(_(this,he)!==r||Vt(this.options.enabled,_(this,he))!==Vt(n.enabled,_(this,he))||s!==_(this,vr))&&fe(this,Se,qc).call(this,s)}getOptimisticResult(t){const n=_(this,_t).getQueryCache().build(_(this,_t),t),r=this.createResult(n,t);return vw(this,r)&&(H(this,mt,r),H(this,is,this.options),H(this,ui,_(this,he).state)),r}getCurrentResult(){return _(this,mt)}trackResult(t,n){return new Proxy(t,{get:(r,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&_(this,In).status==="pending"&&_(this,In).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,i))})}trackProp(t){_(this,os).add(t)}getCurrentQuery(){return _(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,_t).defaultQueryOptions(t),r=_(this,_t).getQueryCache().build(_(this,_t),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return fe(this,Se,Ys).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,mt)))}createResult(t,n){var W;const r=_(this,he),i=this.options,s=_(this,mt),a=_(this,ui),o=_(this,is),u=t!==r?t.state:_(this,$a),{state:d}=t;let c={...d},f=!1,m;if(n._optimisticResults){const P=this.hasListeners(),B=!P&&mp(t,n),ue=P&&vp(t,r,n,i);(B||ue)&&(c={...c,...Yy(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:g,errorUpdatedAt:x,status:T}=c;m=c.data;let v=!1;if(n.placeholderData!==void 0&&m===void 0&&T==="pending"){let P;s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData)?(P=s.data,v=!0):P=typeof n.placeholderData=="function"?n.placeholderData((W=_(this,as))==null?void 0:W.state.data,_(this,as)):n.placeholderData,P!==void 0&&(T="success",m=Qc(s==null?void 0:s.data,P,n),f=!0)}if(n.select&&m!==void 0&&!v)if(s&&m===(a==null?void 0:a.data)&&n.select===_(this,Fa))m=_(this,ss);else try{H(this,Fa,n.select),m=n.select(m),m=Qc(s==null?void 0:s.data,m,n),H(this,ss,m),H(this,mr,null)}catch(P){H(this,mr,P)}_(this,mr)&&(g=_(this,mr),m=_(this,ss),x=Date.now(),T="error");const p=c.fetchStatus==="fetching",y=T==="pending",S=T==="error",R=y&&p,L=m!==void 0,j={status:T,fetchStatus:c.fetchStatus,isPending:y,isSuccess:T==="success",isError:S,isInitialLoading:R,isLoading:R,data:m,dataUpdatedAt:c.dataUpdatedAt,error:g,errorUpdatedAt:x,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:p,isRefetching:p&&!y,isLoadingError:S&&!L,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:S&&L,isStale:wf(t,n),refetch:this.refetch,promise:_(this,In),isEnabled:Vt(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const P=be=>{j.status==="error"?be.reject(j.error):j.data!==void 0&&be.resolve(j.data)},B=()=>{const be=H(this,In,j.promise=Wc());P(be)},ue=_(this,In);switch(ue.status){case"pending":t.queryHash===r.queryHash&&P(ue);break;case"fulfilled":(j.status==="error"||j.data!==ue.value)&&B();break;case"rejected":(j.status!=="error"||j.error!==ue.reason)&&B();break}}return j}updateResult(){const t=_(this,mt),n=this.createResult(_(this,he),this.options);if(H(this,ui,_(this,he).state),H(this,is,this.options),_(this,ui).data!==void 0&&H(this,as,_(this,he)),Hc(n,t))return;H(this,mt,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,s=typeof i=="function"?i():i;if(s==="all"||!s&&!_(this,os).size)return!0;const a=new Set(s??_(this,os));return this.options.throwOnError&&a.add("error"),Object.keys(_(this,mt)).some(o=>{const l=o;return _(this,mt)[l]!==t[l]&&a.has(l)})};fe(this,Se,Xy).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&fe(this,Se,Yc).call(this)}},_t=new WeakMap,he=new WeakMap,$a=new WeakMap,mt=new WeakMap,ui=new WeakMap,is=new WeakMap,In=new WeakMap,mr=new WeakMap,Fa=new WeakMap,ss=new WeakMap,as=new WeakMap,ci=new WeakMap,di=new WeakMap,vr=new WeakMap,os=new WeakMap,Se=new WeakSet,Ys=function(t){fe(this,Se,ed).call(this);let n=_(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Et)),n},Kc=function(){fe(this,Se,Xc).call(this);const t=Mr(this.options.staleTime,_(this,he));if(_i||_(this,mt).isStale||!Uc(t))return;const r=Qy(_(this,mt).dataUpdatedAt,t)+1;H(this,ci,ni.setTimeout(()=>{_(this,mt).isStale||this.updateResult()},r))},Gc=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchIn)DELIM"
-R"DELIM(terval(_(this,he)):this.options.refetchInterval)??!1},qc=function(t){fe(this,Se,Jc).call(this),H(this,vr,t),!(_i||Vt(this.options.enabled,_(this,he))===!1||!Uc(_(this,vr))||_(this,vr)===0)&&H(this,di,ni.setInterval(()=>{(this.options.refetchIntervalInBackground||xf.isFocused())&&fe(this,Se,Ys).call(this)},_(this,vr)))},Yc=function(){fe(this,Se,Kc).call(this),fe(this,Se,qc).call(this,fe(this,Se,Gc).call(this))},Xc=function(){_(this,ci)&&(ni.clearTimeout(_(this,ci)),H(this,ci,void 0))},Jc=function(){_(this,di)&&(ni.clearInterval(_(this,di)),H(this,di,void 0))},ed=function(){const t=_(this,_t).getQueryCache().build(_(this,_t),this.options);if(t===_(this,he))return;const n=_(this,he);H(this,he,t),H(this,$a,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Xy=function(t){ot.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,mt))}),_(this,_t).getQueryCache().notify({query:_(this,he),type:"observerResultsUpdated"})})},Cm);function mw(e,t){return Vt(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function mp(e,t){return mw(e,t)||e.state.data!==void 0&&td(e,t,t.refetchOnMount)}function td(e,t,n){if(Vt(t.enabled,e)!==!1&&Mr(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&wf(e,t)}return!1}function vp(e,t,n,r){return(e!==t||Vt(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&wf(e,n)}function wf(e,t){return Vt(t.enabled,e)!==!1&&e.isStaleByTime(Mr(t.staleTime,e))}function vw(e,t){return!Hc(e.getCurrentResult(),t)}function yp(e){return{onFetch:(t,n)=>{var d,c,f,m,g;const r=t.options,i=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((g=t.state.data)==null?void 0:g.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const u=async()=>{let x=!1;const T=y=>{Object.defineProperty(y,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},v=Zy(t.options,t.fetchOptions),p=async(y,S,R)=>{if(x)return Promise.reject();if(S==null&&y.pages.length)return Promise.resolve(y);const k=(()=>{const B={client:t.client,queryKey:t.queryKey,pageParam:S,direction:R?"backward":"forward",meta:t.options.meta};return T(B),B})(),j=await v(k),{maxPages:W}=t.options,P=R?aw:sw;return{pages:P(y.pages,j,W),pageParams:P(y.pageParams,S,W)}};if(i&&s.length){const y=i==="backward",S=y?yw:gp,R={pages:s,pageParams:a},L=S(r,R);o=await p(R,L,y)}else{const y=e??s.length;do{const S=l===0?a[0]??r.initialPageParam:gp(r,o);if(l>0&&S==null)break;o=await p(o,S),l++}while(l Hello world!i-a&&(this.process(r,0),a=0);for(let c=a;cd.length)throw new Error("_sha2: outputLen bigger than state");for(let c=0;c>>3,x=yn(m,17)^yn(m,19)^m>>>10;nr[c]=x+nr[c-7]+g+nr[c-16]|0}let{A:r,B:i,C:s,D:a,E:o,F:l,G:u,H:d}=this;for(let c=0;c<64;c++){const f=yn(o,6)^yn(o,11)^yn(o,25),m=d+f+p_(o,l,u)+y_[c]+nr[c]|0,x=(yn(r,2)^yn(r,13)^yn(r,22))+m_(r,i,s)|0;d=u,u=l,l=o,o=a+m|0,a=s,s=i,i=r,r=m+x|0}r=r+this.A|0,i=i+this.B|0,s=s+this.C|0,a=a+this.D|0,o=o+this.E|0,l=l+this.F|0,u=u+this.G|0,d=d+this.H|0,this.set(r,i,s,a,o,l,u,d)}roundClean(){dd(nr)}destroy(){this.set(0,0,0,0,0,0,0,0),dd(this.buffer)}}const x_=f_(()=>new g_),Sg=x_,Eg=s_(Sg),w_=BigInt("0x00000000FFFF0000000000000000000000000000000000000000000000000000"),Qp=5e3,Bu=new Map;async function Zt(e,t,n){const r=t.startsWith("/")?t:`/${t}`;let i=r.includes("?")?`${e}${r}`:`${e}${r}?format=json`;n&&(i+=i.includes("?")?"&turbo=true":"?turbo=true");const s=await fetch(i);if(!s.ok){const o=await s.text().catch(()=>"");throw new Error(`Request failed ${s.status}: ${o||s.statusText}`)}const a=await s.text();try{return JSON.parse(a)}catch{return a}}async function bo(e,t,n){try{return await Zt(e,t,n)}catch{return null}}function Nf(e){if(e.length%2!==0)throw new Error("Invalid hex string");const t=new Uint8Array(e.length/2);for(let n=0;n executor::stopping_{};
-
-// non-const member static (global for non-blocking interrupt handling).
-std::atomic_bool executor::cancel_{};
-
-executor::executor(parser& metadata, std::istream& input, std::ostream& output,
- std::ostream&)
- : metadata_(metadata),
- store_(metadata.configured.database),
- query_(store_),
- input_(input),
- output_(output),
- toggle_
- {
- metadata.configured.log.application,
- metadata.configured.log.news,
- metadata.configured.log.session,
- metadata.configured.log.protocol,
- metadata.configured.log.proxy,
- metadata.configured.log.remote,
- metadata.configured.log.fault,
- metadata.configured.log.quitting,
- metadata.configured.log.objects,
- metadata.configured.log.verbose
- }
-{
- initialize_stop();
-}
-
-// Stop signal.
-// ----------------------------------------------------------------------------
-
-// Capture