PageSourceSearch

https://www.sergehillproject.co.uk/_next/static/chunks/986.3b1b62f6a20ad7d5.js

js sergehillproject.co.uk collected 2026-10-04 13:28:05 UTC 9,924 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[986],{64063:function(e){e.exports=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,i;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(i=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,i[o]))return!1;for(o=r;0!==o--;){var c=i[o];if(!e(t[c],n[c]))return!1}return!0}return t!==t&&n!==n}},61986:function(e,t,n){n.r(t),n.d(t,{default:function(){return j}});var r=n(85893),o=n(33699),i=n(37288),c=n(64063);function s(e,t,n){var r,o=n||{},i=o.noTrailing,c=void 0!==i&&i,s=o.noLeading,a=void 0!==s&&s,u=o.debounceMode,d=void 0===u?void 0:u,l=!1,f=0;function p(){r&&clearTimeout(r)}function h(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=this,u=Date.now()-f;function h(){f=Date.now(),t.apply(s,o)}function m(){r=void 0}l||(a||!d||r||h(),p(),void 0===d&&u>e?a?(f=Date.now(),c||(r=setTimeout(d?m:h,e))):h():!0!==c&&(r=setTimeout(d?m:h,void 0===d?e-u:e)))}return h.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),l=!n},h}var a,u=n(34167),d=n(65104);const l=e=>!(e=>"undefined"!==typeof window&&e.addEventListener===window.EventSource.prototype.addEventListener)(e),f=(e,t,n)=>{l(e)?e.addEventListener(t,n):e.addEventListener(t,n,!1)};function p(e,t,n){const{projectId:r,dataset:o,token:i,includeTypes:c,requestTagPrefix:s}=t,a=i?{Authorization:"Bearer ".concat(i)}:void 0,u=s?{tag:s,effectFormat:"mendoza"}:{effectFormat:"mendoza"},d=(e=>{let{query:t,params:n={},options:r={}}=e;const o=new URLSearchParams,{tag:i,...c}=r;i&&o.set("tag",i),o.set("query",t);for(const[s,a]of Object.entries(n))o.set("$".concat(s),JSON.stringify(a));for(const[s,a]of Object.entries(c))a&&o.set(s,"".concat(a));return"?".concat(o)})(Array.isArray(c)&&c.length>0?{query:"*[_type in $includeTypes]",params:{includeTypes:c},options:u}:{query:"*",options:u}),l=new e("https://".concat(r,".api.sanity.io/v1/data/listen/").concat(o).concat(d),{withCredentials:!0,headers:a});var p;return f(l,"welcome",n.open),f(l,"mutation",(p=n.next,e=>{let t;try{t=JSON.parse(e.data)}catch(n){return}p(t)})),f(l,"channelError",(e=>{let t;l.close();try{t=JSON.parse(e.data)}catch(r){return void n.error(new Error("Unknown error parsing listener message"))}n.error(new Error(t.message||t.error||"Listener returned HTTP ".concat(t.statusCode)))})),f(l,"error",(e=>{const t="undefined"!==typeof window&&window.location.origin,r=t?", and that the CORS-origin (".concat(t,") is allowed"):"",o=function(e){return"object"===typeof e&&null!==e&&"message"in e}(e)?" (".concat(e.message,")"):"";n.error(new Error("Error establishing listener - check that the project ID and dataset are correct".concat(r).concat(o)))})),{unsubscribe:()=>Promise.resolve(l.close())}}function h(e){return e._id.startsWith("drafts.")?e._id.slice(7):e._id}function m(e,t){const n={...e};return delete n._rev,(0,d.a)(n,t)}function v(){return Promise.resolve()}function w(e,t,n){let{getDocuments:r,EventSource:o}=n;const{projectId:i,dataset:c,listen:s,overlayDrafts:a,documentLimit:u,token:d,includeTypes:l,requestTagPrefix:f}=e;let w,g,y;const b=e=>{w=void 0,y=void 0,g=void 0;const n=a?function(e){const t=new Map;return e.forEach((e=>{const n=t.get(h(e));e._id.startsWith("drafts.")?t.set(h(e),function(e){return{...e,_id:h(e),_originalId:e._id}}(e)):n||t.set(e._id,{...e,_originalId:e._id})})),Array.from(t.values())}(e):e;n.sort(((e,t)=>function(e,t){return e>t?1:e<t?-1:0}(e._id,t._id))),t(n)};if(!s){return{unsubscribe:v,loaded:r({projectId:i,dataset:c,documentLimit:u,token:d,includeTypes:l,requestTagPrefix:f}).then(b).then(v)}}const E=new Map;let S;const T=[];let j,_;const O=new Promise(((e,t)=>{j=e,_=t})),k=p(o,e,{next:e=>{S?(P(e),x(S,e)):T.push(e)},open:async()=>{const e=await r({projectId:i,dataset:c,documentLimit:u,token:d,includeTypes:l,requestTagPrefix:f});S=function(e,t){const n=new Map;return t.forEach((e=>{const t=n.get(e.documentId)||[];t.push(e),n.set(e.documentId,t)}
1)),n.forEach(((t,n)=>{const r=e.find((e=>e._id===n));if(!r)return void console.warn("Received mutation for missing document %s",n);let o=!1,i=r;t.forEach((e=>{o=o||e.previousRev===r._rev,o&&e.effects&&(i=m(i,e.effects.apply))})),e.splice(e.indexOf(r),1,i)})),e}(e,T),S.forEach((e=>E.set(e._id,e))),b(S),j()},error:e=>_(e)}),x=(e,t)=>{clearTimeout(y),g!==t.transactionId&&w?(b(w),g=void 0):(g=t.transactionId,w=e.slice()),y=setTimeout(b,25,e.slice())},P=e=>{if(!e.effects||e.documentId.startsWith("_."))return;const t=E.get(e.documentId)||null;q(e.documentId,m(t,e.effects.apply))},q=(e,t)=>{const n=E.get(e),r=S||[],o=n?r.indexOf(n):-1;-1===o&&t?(r.push(t),E.set(e,t)):t?(r.splice(o,1,t),E.set(e,t)):(r.splice(o,1),E.delete(e))};return{unsubscribe:k.unsubscribe,loaded:O}}function g(e,t){let n=[];const r=s(e.subscriptionThrottleMs||50,(function(){o.forEach(p)})),o=[];let d;async function l(){d||(d=w(e,(e=>{n=e,r()}),t)),await d.loaded}async function f(e,t){await l();const r=(0,u.Q)(e,{params:t});return(await(0,u.k)(r,{dataset:n,params:t})).get()}function p(e){return f(e.query,e.params).then((t=>{"previousResult"in e&&c(e.previousResult,t)||(e.previousResult=t,e.callback(void 0,t))})).catch((t=>{e.callback(t)}))}return{query:f,getDocument:async function(e){return await l(),f((0,i.Z)(a||(t=["*[_id == $id][0]"],n||(n=t.slice(0)),a=Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(n)}})))),{id:e});var t,n},getDocuments:async function(e){await l();const t=e.map((e=>'*[_id == "'.concat(e,'"][0]'))).join(",\n");return f("[".concat(t,"]"))},subscribe:function(t,n,r){if(!e.listen)throw new Error("Cannot use `subscribe()` without `listen: true`");const i={query:t,params:n,callback:r};o.push(i);let c=!1;return p(i),{unsubscribe:()=>(c||(c=!0,o.splice(o.indexOf(i),1)),Promise.resolve())}},close:function(){return r.cancel(),d?d.unsubscribe():Promise.resolve()}}}const y=async function(e){let{projectId:t,dataset:n,token:r,documentLimit:o,includeTypes:i=[],requestTagPrefix:c}=e;const s=new URL("https://".concat(t,".api.sanity.io/v1/data/export/").concat(n));c&&s.searchParams.set("tag",c),i.length>0&&s.searchParams.set("types",null==i?void 0:i.join(","));const a=r?{Authorization:"Bearer ".concat(r)}:void 0,u=await fetch(s,{credentials:"include",headers:a});if(200!==u.status)throw new Error("Error streaming dataset: ".concat(function(e){if("object"===typeof e&&"error"in e&&"message"in e)return e.message||e.error;return"<unknown error>"}(await u.json())));const d=function(e){if(!e)throw new Error("Failed to read body from response");let t,n=!1;function r(){n=!0,t&&t.cancel()}return new ReadableStream({start(o){t=e.getReader();const i=new TextDecoder;let c="";async function s(e){if(e.done){if(n)return;return c=c.trim(),0===c.length?void o.close():(o.enqueue(JSON.parse(c)),void o.close())}c+=i.decode(e.value,{stream:!0});const a=c.split("\n");for(let t=0;t<a.length-1;++t){const e=a[t].trim();if(0!==e.length)try{o.enqueue(JSON.parse(e))}catch(u){return o.error(u),void r()}}if(c=a[a.length-1],t)try{s(await t.read())}catch(u){o.error(u)}}t.read().then(s).catch((e=>o.error(e)))},cancel:r})}(u.body),l=d.getReader(),f=[];let p,h;do{if(p=await l.read(),h=p.value,b(h))throw new Error("Error streaming dataset: ".concat(h.error));if(h&&!h._id.startsWith("_.")&&f.push(h),o&&f.length>o)throw l.cancel("Reached document limit"),new Error("Error streaming dataset: Reached limit of ".concat(o," documents. Try using the includeTypes option to reduce the amount of documents, or increase the limit."))}while(!p.done);return f};function b(e){return!!e&&("error"in e&&"object"===typeof e.error&&null!==e.error&&("description"in e.error&&"string"===typeof e.error.description&&!("_id"in e)))}function E(e){var t;!function(){const e=["EventSource","ReadableStream","fetch"].filter((e=>!(e in window)));if(e.length>0)throw new Error("Browser not supported. Missing browser APIs: ".concat(e.join(", ")))}();const n=null!=(t=e.EventSource)?t:window.EventSource;if(e.token){if(!e.EventSource)throw new Error("When the `token` option is used the `EventSource` option must also be provided.");if(e.EventSource===window.EventSource)throw new Error("When the `token` option is used the `EventSource` option must also be provided. EventSource cannot be `window.EventSource`, as it does not support passing a token.")}return g(e,{EventSource:n,getDocuments:y})}var S=n(67294),T=n(34329);const j=(0,S.memo)((function(e){const{children:t,logger:n,...i}=e,[c]=(0,S.useState)((()=>new Set)),[s,a]=(0,T.tT)(c),[u]=(0,S.useState)((()=>new Map)),[d]=(0,S.useState)((()=>E({EventSource:e.token?o:void 0,listen:!0,overlayDrafts:!0,documentLimit:T.pm,...i}))),l=(0,S.useMemo)((()=>i.listen?"Updates are applied in real-time. The cache is set to max ".concat(i.documentLimit||T.pm," documents."):"Updates require a manual refresh. The cache is set to max ".concat(i.documentLimit||T.pm," documents.")),[i.documentLimit,i.listen]);(0,S.useEffect)((()=>{n&&n.log("[@sanity/preview-kit]: With the current configuration you can expect that: ".concat(l))}),[n,l]);const[f,p]=(0,S.useState)(null);if(f)throw f;const[h]=(0,S.useState)((()=>function(e,t,n){const r=(0,T.nW)(t,n);u.has(r)||u.set(r,e);return{subscribe:e=>{if(c.has(r)||d.query(t,n).then((t=>{c.has(r)||(u.set(r,t),c.add(r),a(),e())}),p),!i.listen)return()=>{};const o=d.subscribe(t,n,((t,n)=>{t?p(t):c.has(r)&&(u.set(r,n),e())}));return()=>o.unsubscribe()},getSnapshot:()=>u.get(r)}}
1));return(0,r.jsx)(T.iS.Provider,{value:h,children:(0,r.jsx)(T.Ts.Provider,{value:s,children:t})})}))}}]);

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.