1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="efb43140-6cd3-48ec-a678-75baff70842b",e._sentryDebugIdIdentifier="sentry-dbid-efb43140-6cd3-48ec-a678-75baff70842b")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8018],{98018:(e,t,r)=>{r.r(t),r.d(t,{default:()=>_,turboChargeResultIfSourceMap:()=>A});var s=r(22262),n=r(32388),a=r(82550);function i(e){return"https://www.sanity.io/help/"+e}let u=e=>(function(e){let t=!1,r;return(...s)=>(t||(r=e(...s),t=!0),r)})((...t)=>console.warn(e.join(" "),...t));u(["Because you set `withCredentials` to true, we will override your `useCdn`","setting to be false since (cookie-based) credentials are never set on the CDN"]),u(["Since you haven't set a value for `useCdn`, we will deliver content using our","global, edge-cached API-CDN. If you wish to have content delivered faster, set","`useCdn: false` to use the Live API. Note: You may incur higher costs using the live API."]),u(["The Sanity client is configured with the `perspective` set to `drafts` or `previewDrafts`, which doesn't support the API-CDN.","The Live API will be used instead. Set `useCdn: false` in your configuration to hide this warning."]),u(["The `previewDrafts` perspective has been renamed to `drafts` and will be removed in a future API version"]),u(["You have configured Sanity client to use a token in the browser. This may cause unintentional security issues.",`See ${i("js-client-browser-token")} for more information and how to hide this warning.`]),u(["You have configured Sanity client to use a token, but also provided `withCredentials: true`.","This is no longer supported - only token will be used - remove `withCredentials: true`."]),u(["Using the Sanity client without specifying an API version is deprecated.",`See ${i("js-client-api-version")}`]),u(["The default export of @sanity/client has been deprecated. Use the named export `createClient` instead."]),u(["You have called `createVersion()` with a defined `document`. The recommended approach is to provide a `baseId` and `releaseId` instead."]),u(["The `~experimental_resource` configuration property has been renamed to `resource`.","Please update your client configuration to use `resource` instead. Support for `~experimental_resource` will be removed in a future version."]);var o=r(28256),l=r(20702),c=r(7720),d=r(19254),f=r(46893),p=r(78958),h=r(80920),y=r(48217);function b(e,t){switch(t.type){case"message":return{...e,messages:[...e.messages,t]};case"reconnect":case"restart":return{...e,messages:[],resets:e.resets+1};case"welcome":return e;default:throw Error(`Unknown event: ${t.type}`,{cause:t})}}let v={messages:[],resets:0},w=(e,{previousValue:t})=>{if("string"==typeof t){if("number"==typeof e)return`${e}`;if(Array.isArray(e)){if(0===e.length)return"";if(e.some(e=>"object"==typeof e&&(0,y.IG)(e)))return(0,y.bo)(e)}}return e};function m(e,t){switch(t.type){case"query-listen":return function(e,{payload:t}){var r,s,n;let a=(r=t.perspective,s=t.query,n=t.params,`${r}:${s}:${JSON.stringify(n)}`),i={query:t.query,params:t.params,perspective:t.perspective},u=new Map(e.heartbeats);u.set(a,{receivedAt:Date.now(),heartbeat:t.heartbeat});let o=e.queries;return e.queries.has(a)&&c(e.queries.get(a),i)||(o=new Map(e.queries)).set(a,i),{heartbeats:u,queries:o}}(e,t);case"gc":if(e.queries.size<1)return e;let r=Date.now();if(!Array.from(e.heartbeats.values()).some(e=>!1!==e.heartbeat&&r>e.receivedAt+e.heartbeat))return e;let s=new Map,n=new Map;for(let[t,a]of e.heartbeats.entries())!1!==a.heartbeat&&r>a.receivedAt+a.heartbeat||(s.set(t,a),n.set(t,e.queries.get(t)));return{...e,queries:n,heartbeats:s};default:throw Error(`Unknown action: ${t.type}`,{cause:t})}}let g={queries:new Map,heartbeats:new Map};function _(e){let t,r,a,i,u,c,p,y,w,_=(0,n.c)(28),{controller:q,perspective:A,onLoadersConnection:T,onDocumentsOnPage:E}=e,[M,C]=(0,d.useState)(),[D,k]=function(){let e,t,r,s=(0,n.c)(4),[a,i]=(0,d.useReducer)(m,g);s[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=setInterval(()=>i({type:"gc"}),h.UR);return()=>clearInterval(e)},t=[],s[0]=e,s[1]=t):(e=s[0],t=s[1]),(0,d.useEffect)(e,t);let u=(0,d.useDeferredValue)(a.queries);return s[2]!==u?(r=[u,i],s[2]=u,s[3]=r):r=s[3],r}(),j=(0,f.M91)(),$=(0,f.EL1)();_[0]!==q||_[1]!==$||_[2]!==k||_[3]!==E||_[4]!==T||_[5]!==j?(t=()=>{if(q){let e=q.createChannel({name:"presentation",connectTo:"loaders",heartbeat:!0},(0,o.e3)().provide({actors:(0,l.jF)()}));return C(e),e.onStatus(T),e.on("loader/documents",e=>{e.projectId===j&&e.dataset===$&&E("loaders",e.perspective,e.documents)}),e.on("loader/query-listen",e=>{if(e.projectId===j&&e.dataset===$){if("number"==typeof e.heartbeat&&e.heartbeat<h.TG)throw Error(`Loader query listen heartbeat interval must be at least ${h.TG}ms`);k({type:"query-listen",payload:{perspective:e.perspective,query:e.query,params:e.params,heartbeat:e.heartbeat??!1}})}}),e.start()}return I},r=[q,$,k,E,T,j],_[0]=q,_[1]=$,_[2]=k,_[3]=E,_[4]=T,_[5]=j,_[6]=t,_[7]=r):(t=_[6],r=_[7]),(0,d.useEffect)(t,r),_[8]!==A?(a=(0,f.c7e)(A)?f.Ra0:{apiVersion:h.mG},_[8]=A,_[9]=a):a=_[9];let N=(0,f.tH7)(a);_[10]!==N?(u=N.withConfig({resultSourceMap:"withKeyArraySelector"}),_[10]=N,_[11]=u):u=_[11],i=u,_[12]!==A||_[13]!==M||_[14]!==$||_[15]!==j?(c=()=>{M&&M.post("loader/perspective",{projectId:j,dataset:$,perspective:A})},p=[M,A,j,$],_[12]=A,_[13]=M,_[14]=$,_[15]=j,_[16]=c,_[17]=p):(c=_[16],p=_[17]),(0,d.useEffect)(c,p);let P=(0,d.useDeferredValue)(e.liveDocument),x=function(e){let t,r,s=(0,n.c)(3),[a,i]=(0,d.useReducer)(b,v),[u,o]=(0,d.useState)(null);if(null!==u)throw u;return s[0]!==e.live?(t=()=>{let t=e.live.events({includeDrafts:!0,tag:"presentation-loader"}).subscribe({next:i,error:e=>o(e instanceof Error?e:Error("Unexpected error in useLiveEvents",{cause:e}))});return()=>t.unsubscribe()},r=[e.live],s[0]=e.live,s[1]=t,s[2]=r):(t=s[1],r=s[2]),(0,d.useEffect)(t,r),(0,d.useDeferredValue)(a)}(i);return _[18]!==D?(y=[...D.entries()],_[18]=D,_[19]=y):y=_[19],_[20]!==i||_[21]!==M||_[22]!==$||_[23]!==P||_[24]!==x||_[25]!==j||_[26]!==y?(w=(0,s.jsx)(s.Fragment,{children:y.map(e=>{let[t,r]=e,{query:n,params:a,perspective:u}=r;return(0,s.jsx)(S,{projectId:j,dataset:$,perspective:u,query:n,params:a,comlink:M,client:i,liveDocument:P,liveEventsMessages:x.messages},`${x.resets}:${t}`)})}),_[20]=i,_[21]=M,_[22]=$,_[23]=P,_[24]=x,_[25]=j,_[26]=y,_[27]=w):w=_[27],w}function I(){}let S=(0,d.memo)(function(e){let t,r,s,a=(0,n.c)(20),{projectId:i,dataset:u,perspective:o,query:l,client:f,liveDocument:h,params:y,comlink:b,liveEventsMessages:v}=e,{result:w,resultSourceMap:m,syncTags:g}=function(e){let t,r,s,a,i,u=(0,n.c)(30),{liveDocument:o,client:l,query:f,params:p,perspective:h,liveEventsMessages:y}=e,[b,v]=(0,d.useState)(null),[w,m]=(0,d.useState)(null),[g,_]=(0,d.useState)(void 0);u[0]!==y?(t=()=>new Set(y.map(q)),u[0]=y,u[1]=t):t=u[1];let[I]=(0,d.useState)(t);if(u[2]!==y||u[3]!==I||u[4]!==g){let e,t;u[6]!==I?(e=e=>
1!I.has(e.id),u[6]=I,u[7]=e):e=u[7];let s=y.filter(e);u[8]!==g?(t=e=>e.tags.some(e=>g?.includes(e)),u[8]=g,u[9]=t):t=u[9],r=s.findLast(t),u[2]=y,u[3]=I,u[4]=g,u[5]=r}else r=u[5];let S=r?.id,[T,E]=(0,d.useState)(null);if(T)throw T;u[10]!==l||u[11]!==S||u[12]!==p||u[13]!==h||u[14]!==f?(s=()=>{let e=new AbortController;return l.fetch(f,p,{lastLiveEventId:S,tag:"presentation-loader",signal:e.signal,perspective:h,filterResponse:!1,returnQuery:!1}).then(e=>{(0,d.startTransition)(()=>{v(t=>c(t,e.result)?t:e.result),m(t=>c(t,e.resultSourceMap)?t:e.resultSourceMap),_(t=>c(t,e.syncTags)?t:e.syncTags)})}).catch(e=>{("object"!=typeof e||e?.name!=="AbortError")&&E(e)}),()=>{e.abort()}},a=[l,S,p,h,f],u[10]=l,u[11]=S,u[12]=p,u[13]=h,u[14]=f,u[15]=s,u[16]=a):(s=u[15],a=u[16]),(0,d.useEffect)(s,a);e:{let e;if(o&&w){let e,t;u[17]!==o||u[18]!==h||u[19]!==b||u[20]!==w?(e=A(o,b,h,w),u[17]=o,u[18]=h,u[19]=b,u[20]=w,u[21]=e):e=u[21],u[22]!==w||u[23]!==g||u[24]!==e?(t={result:e,resultSourceMap:w,syncTags:g},u[22]=w,u[23]=g,u[24]=e,u[25]=t):t=u[25],i=t;break e}u[26]!==b||u[27]!==w||u[28]!==g?(e={result:b,resultSourceMap:w,syncTags:g},u[26]=b,u[27]=w,u[28]=g,u[29]=e):e=u[29],i=e}return i}({client:f,liveDocument:h,params:y,perspective:o,query:l,liveEventsMessages:v})||{};a[0]!==u||a[1]!==i?(t=(e,t,r,s,n,a,o)=>{e?.post("loader/query-change",{projectId:i,dataset:u,perspective:t,query:r,params:s,result:n,resultSourceMap:a,tags:o})},a[0]=u,a[1]=i,a[2]=t):t=a[2];let _=(0,p.J)(t);return a[3]!==b||a[4]!==_||a[5]!==y||a[6]!==o||a[7]!==l||a[8]!==w||a[9]!==m||a[10]!==g?(r=()=>{m&&_(b,o,l,y,w,m,g)},a[3]=b,a[4]=_,a[5]=y,a[6]=o,a[7]=l,a[8]=w,a[9]=m,a[10]=g,a[11]=r):r=a[11],a[12]!==b||a[13]!==y||a[14]!==o||a[15]!==l||a[16]!==w||a[17]!==m||a[18]!==g?(s=[b,y,o,l,w,m,g],a[12]=b,a[13]=y,a[14]=o,a[15]=l,a[16]=w,a[17]=m,a[18]=g,a[19]=s):s=a[19],(0,d.useEffect)(r,s),null});function q(e){return e.id}function A(e,t,r,s){if("raw"===r)throw Error("turboChargeResultIfSourceMap does not support raw perspective");if(!s)return t;let n=function(e,t){let r=function(e){if(function(e){if(Array.isArray(e)&&e.length>1&&e.includes("raw"))throw TypeError('Invalid API perspective value: "raw". The raw-perspective can not be combined with other perspectives')}(e),Array.isArray(e))return e.includes("published")?e:[...e,"published"];switch(e){case"previewDrafts":case"drafts":return["drafts","published"];default:return["published"]}}(t);return function(t){for(let s of r){let r=null;if(s.startsWith("r")&&(r=e({...t,_id:(0,a.ct)(t._id,s)})),"drafts"===s&&(r=e({...t,_id:(0,a.T4)(t._id)})),"published"===s&&(r=e({...t,_id:(0,a.IM)(t._id)})),r)return{...r,_id:(0,a.IM)(r._id),_originalId:r._id}}return null}}(t=>!t._projectId&&e?._id&&(0,a.IM)(e._id)===(0,a.IM)(t._id)?"string"==typeof e._id&&"string"==typeof t._type?e:{...e,_id:e._id||t._id,_type:e._type||t._type}:null,r),i=s.documents?.map?.(n)||[];return(0,a.KT)(JSON.parse(JSON.stringify(t)),(e,t)=>{let r=(0,a.fO)(t,s);if(!r)return e;let{mapping:n,pathSuffix:u}=r;if("value"!==n.type||"documentValue"!==n.source.type)return e;let o=s.documents[n.source.document],l=s.paths[n.source.path];if(o){let t=(0,a.Hf)(l+u),r=(0,a.dI)(t),s=i[n.source.document];if(!s)return e;let c=s?(0,a.Jt)(s,r,e):e;return e===c?e:w(c,{cachedDocument:s,previousValue:e,sourceDocument:o,sourcePath:t})}return e})}S.displayName="Memo(QuerySubscription)"}}]);
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.