1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2154],{22154:function(e,t,r){r.d(t,{ZP:function(){return u}});var s=r(35025),i=r(64705),n=r(41507),o=r(78430);function u(e){var t=e.cohortIds,r=e.enabled,s=(0,n.h)({queries:t.map((function(e){return{queryKey:["post-login-cohort-batches",{cohortId:e,limit:50,contentType:"live"}],queryFn:o.CZ,enabled:r,retry:0,refetchOnWindowFocus:!1}}))}),u=(0,n.h)({queries:t.map((function(e){return{queryKey:["post-login-cohort-batches",{cohortId:e,limit:50,contentType:"live",isSubscribed:!0}],queryFn:o.CZ,enabled:r,retry:0,refetchOnWindowFocus:!1}}))}),l=s.some((function(e){return e.isLoading}))||u.some((function(e){return e.isLoading})),c=s.some((function(e){return e.isError}))||u.some((function(e){return e.isError})),h=null===s||void 0===s?void 0:s.map((function(e){var t,r,s;return(null===e||void 0===e?void 0:e.data)?null===e||void 0===e||null===(t=e.data)||void 0===t||null===(r=t.data)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.map((function(e){return new a(e)})):null})),d=null===u||void 0===u?void 0:u.map((function(e){var t,r,s;return(null===e||void 0===e?void 0:e.data)?null===e||void 0===e||null===(t=e.data)||void 0===t||null===(r=t.data)||void 0===r||null===(s=r.data)||void 0===s?void 0:s.map((function(e){return new a(e)})):null}));return{isLoading:l,isError:c,data:(0,i.Z)(h.flat()).concat((0,i.Z)(d.flat())),refetch:function(){s.forEach((function(e){return e.refetch()})),u.forEach((function(e){return e.refetch()}))}}}var a=function e(t){(0,s.Z)(this,e),this.batchId=(null===t||void 0===t?void 0:t.batchId)||{},this.priority=(null===t||void 0===t?void 0:t.priority)||0,this.cohortId=(null===t||void 0===t?void 0:t.cohortId)||""}},41507:function(e,t,r){r.d(t,{h:function(){return p}});var s=r(92379),i=r(40287),n=r(58708),o=r(51927),u=r(45221);class a extends u.l{constructor(e,t){super(),this.client=e,this.queries=[],this.result=[],this.observers=[],this.observersMap={},t&&this.setQueries(t)}onSubscribe(){1===this.listeners.size&&this.observers.forEach((e=>{e.subscribe((t=>{this.onUpdate(e,t)}))}))}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.observers.forEach((e=>{e.destroy()}))}setQueries(e,t){this.queries=e,n.V.batch((()=>{const e=this.observers,r=this.findMatchingObservers(this.queries);r.forEach((e=>e.observer.setOptions(e.defaultedQueryOptions,t)));const s=r.map((e=>e.observer)),n=Object.fromEntries(s.map((e=>[e.options.queryHash,e]))),o=s.map((e=>e.getCurrentResult())),u=s.some(((t,r)=>t!==e[r]));(e.length!==s.length||u)&&(this.observers=s,this.observersMap=n,this.result=o,this.hasListeners()&&((0,i.e5)(e,s).forEach((e=>{e.destroy()})),(0,i.e5)(s,e).forEach((e=>{e.subscribe((t=>{this.onUpdate(e,t)}))})),this.notify()))}))}getCurrentResult(){return this.result}getQueries(){return this.observers.map((e=>e.getCurrentQuery()))}getObservers(){return this.observers}getOptimisticResult(e){return this.findMatchingObservers(e).map((e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)))}findMatchingObservers(e){const t=this.observers,r=new Map(t.map((e=>[e.options.queryHash,e]))),s=e.map((e=>this.client.defaultQueryOptions(e))),i=s.flatMap((e=>{const t=r.get(e.queryHash);return null!=t?[{defaultedQueryOptions:e,observer:t}]:[]})),n=new Set(i.map((e=>e.defaultedQueryOptions.queryHash))),u=s.filter((e=>!n.has(e.queryHash))),a=new Set(i.map((e=>e.observer))),l=t.filter((e=>!a.has(e))),c=e=>{const t=this.client.defaultQueryOptions(e),r=this.observersMap[t.queryHash];return null!=r?r:new o.z(this.client,t)},h=u.map(((e,t)=>{if(e.keepPreviousData){const r=l[t];if(void 0!==r)return{defaultedQueryOptions:e,observer:r}}return{defaultedQueryOptions:e,observer:c(e)}}));return i.concat(h).sort(((e,t)=>s.indexOf(e.defaultedQueryOptions)-s.indexOf(t.defaultedQueryOptions)))}onUpdate(e,t){const r=this.observers.indexOf(e);-1!==r&&(this.result=(0,i.Rc)(this.result,r,t),this.notify())}notify(){n.V.batch((()=>{this.listeners.forEach((({listener:e})=>{e(this.result)}))}))}}var l=r(71873),c=r(78497),h=r(67633),d=r(90701),f=r(76186),v=r(58617);function p({queries:e,context:t}){const r=(0,c.NL)({context:t}),i=(0,h.S)(),o=(0,d._)(),u=s.useMemo((()=>e.map((e=>{const t=r.defaultQueryOptions(e);return t._optimisticResults=i?"isRestoring":"optimistic",t}))),[e,r,i]);u.forEach((e=>{(0,v.Fb)(e),(0,f.pf)(e,o)})),(0,f.JN)(o);const[p]=s.useState((()=>new a(r,u))),b=p.getOptimisticResult(u);(0,l.$)(s.useCallback((e=>i?()=>{}:p.subscribe(n.V.batchCalls(e))),[p,i]),(()=>p.getCurrentResult()),(()=>p.getCurrentResult())),s.useEffect((()=>{p.setQueries(u,{listeners:!1})}),[u,p]);const y=b.some(((e,t)=>(0,v.SB)(u[t],e,i)))?b.flatMap(((e,t)=>{const r=u[t],s=p.getObservers()[t];if(r&&s){if((0,v.SB)(r,e,i))return(0,v.j8)(r,s,o);(0,v.Z$)(e,i)&&(0,v.j8)(r,s,o)}return[]})):[];if(y.length>0)throw Promise.all(y);const m=p.getQueries(),O=b.find(((e,t)=>{var r,s;return(0,f.KJ)({result:e,errorResetBoundary:o,useErrorBoundary:null!=(r=null==(s=u[t])?void 0:s.useErrorBoundary)&&r,query:m[t]})}));if(null!=O&&O.error)throw O.error;return b}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.