UNPKG

@getontime/cli

Version:

Time keeping for live events

2 lines 3.25 kB
System.register(["./jsx-runtime-legacy-DMkDNnVj.js","./useSocket-legacy-C772wu7w.js","./constants-legacy-CvecvM28.js"],function(t,e){var s,i,n,r,o,a,h,u,c,d,l,b,f,p,y,m,g,v,w,S,E,O;function M(){const t=y(v,this)?.state??n();r(g,this,{...t,isPending:"pending"===t.status,isSuccess:"success"===t.status,isError:"error"===t.status,isIdle:"idle"===t.status,mutate:this.mutate,reset:this.reset})}function k(t){o.batch(()=>{if(y(w,this)&&this.hasListeners()){const s=y(g,this).variables,i=y(g,this).context,n={client:y(m,this),meta:this.options.meta,mutationKey:this.options.mutationKey};if("success"===t?.type){try{y(w,this).onSuccess?.(t.data,s,i,n)}catch(e){Promise.reject(e)}try{y(w,this).onSettled?.(t.data,null,s,i,n)}catch(e){Promise.reject(e)}}else if("error"===t?.type){try{y(w,this).onError?.(t.error,s,i,n)}catch(e){Promise.reject(e)}try{y(w,this).onSettled?.(void 0,t.error,s,i,n)}catch(e){Promise.reject(e)}}}this.listeners.forEach(t=>{t(y(g,this))})})}return t("t",function(t,e){const s=p(e),[i]=O.useState(()=>new E(s,t));O.useEffect(()=>{i.setOptions(t)},[i,t]);const n=O.useSyncExternalStore(O.useCallback(t=>i.subscribe(o.batchCalls(t)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),r=O.useCallback((t,e)=>{i.mutate(t,e).catch(c)},[i]);if(n.error&&u(i.options.throwOnError,[n.error]))throw n.error;return{...n,mutate:r,mutateAsync:n.mutate}}),{setters:[function(t){s=t.a,i=t.n},function(t){n=t.Zt},function(t){r=t.Bn,o=t.En,a=t.Fn,h=t.Hn,u=t.In,c=t.Mn,d=t.On,l=t.Sn,b=t.Un,f=t.Vn,p=t.bn,y=t.zn}],execute:function(){!function(){try{var t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};t.SENTRY_RELEASE={id:"f14ad0099eab1969fdd065b56af5fdd3cf530de6"};var e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="b56afbb1-b63a-46c4-8304-767bdd07f2ee",t._sentryDebugIdIdentifier="sentry-dbid-b56afbb1-b63a-46c4-8304-767bdd07f2ee")}catch(t){}}(),m=new WeakMap,g=new WeakMap,v=new WeakMap,w=new WeakMap,S=new WeakSet,E=class extends b{constructor(t,e){super(),l(this,S),h(this,m,void 0),h(this,g,void 0),h(this,v,void 0),h(this,w,void 0),r(m,this,t),this.setOptions(e),this.bindMethods(),f(S,this,M).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=y(m,this).defaultMutationOptions(t),a(this.options,e)||y(m,this).getMutationCache().notify({type:"observerOptionsUpdated",mutation:y(v,this),observer:this}),e?.mutationKey&&this.options.mutationKey&&d(e.mutationKey)!==d(this.options.mutationKey)?this.reset():"pending"===y(v,this)?.state.status&&y(v,this).setOptions(this.options)}onUnsubscribe(){this.hasListeners()||y(v,this)?.removeObserver(this)}onMutationUpdate(t){f(S,this,M).call(this),f(S,this,k).call(this,t)}getCurrentResult(){return y(g,this)}reset(){y(v,this)?.removeObserver(this),r(v,this,void 0),f(S,this,M).call(this),f(S,this,k).call(this)}mutate(t,e){return r(w,this,e),y(v,this)?.removeObserver(this),r(v,this,y(m,this).getMutationCache().build(y(m,this),this.options)),y(v,this).addObserver(this),y(v,this).execute(t)}},O=s(i(),1)}}}); //# sourceMappingURL=useMutation-legacy-CHaWRMnS.js.map