PageSourceSearch

https://www.reworkd.ai/_next/static/chunks/5351.da3cb23e43f0d23a.js

js reworkd.ai collected 2026-10-02 14:49:47 UTC 16,577 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5351],{4070:function(t,e,r){var i=r(72455),n=r(96603),s=r(38554),o=r(29705);function a(t,e,r){arguments.length<2?i.call(this,t):i.call(this,t,e,r);var n=s.getPointerArray(this.capacity);this.deleted=new n(this.capacity),this.deletedSize=0}for(var u in i.prototype)a.prototype[u]=i.prototype[u];"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=i.prototype[Symbol.iterator]),a.prototype.clear=function(){i.prototype.clear.call(this),this.deletedSize=0},a.prototype.set=function(t,e){var r=this.items[t];if(void 0!==r){this.splayOnTop(r),this.V[r]=e;return}this.size<this.capacity?(r=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(r=this.tail,this.tail=this.backward[r],delete this.items[this.K[r]]),this.items[t]=r,this.K[r]=t,this.V[r]=e,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r},a.prototype.setpop=function(t,e){var r=null,i=null,n=this.items[t];return void 0!==n?(this.splayOnTop(n),r=this.V[n],this.V[n]=e,{evicted:!1,key:t,value:r}):(this.size<this.capacity?(n=this.deletedSize>0?this.deleted[--this.deletedSize]:this.size,this.size++):(n=this.tail,this.tail=this.backward[n],r=this.V[n],i=this.K[n],delete this.items[i]),this.items[t]=n,this.K[n]=t,this.V[n]=e,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i)?{evicted:!0,key:i,value:r}:null},a.prototype.delete=function(t){var e=this.items[t];if(void 0===e)return!1;if(delete this.items[t],1===this.size)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,!0;var r=this.backward[e],i=this.forward[e];return this.head===e&&(this.head=i),this.tail===e&&(this.tail=r),this.forward[r]=i,this.backward[i]=r,this.size--,this.deleted[this.deletedSize++]=e,!0},a.prototype.remove=function(t,e){var r=this.items[t];if(void 0===r)return e;var i=this.V[r];if(delete this.items[t],1===this.size)return this.size=0,this.head=0,this.tail=0,this.deletedSize=0,i;var n=this.backward[r],s=this.forward[r];return this.head===r&&(this.head=s),this.tail===r&&(this.tail=n),this.forward[n]=s,this.backward[s]=n,this.size--,this.deleted[this.deletedSize++]=r,i},a.from=function(t,e,r,i){if(arguments.length<2){if("number"!=typeof(i=o.guessLength(t)))throw Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2==arguments.length&&(i=e,e=null,r=null);var s=new a(e,r,i);return n(t,function(t,e){s.set(e,t)}),s},t.exports=a},72455:function(t,e,r){var i=r(60151),n=r(96603),s=r(38554),o=r(29705);function a(t,e,r){if(arguments.length<2&&(r=t,t=null,e=null),this.capacity=r,"number"!=typeof this.capacity||this.capacity<=0)throw Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var i=s.getPointerArray(r);this.forward=new i(r),this.backward=new i(r),this.K="function"==typeof t?new t(r):Array(r),this.V="function"==typeof e?new e(r):Array(r),this.size=0,this.head=0,this.tail=0,this.items={}}a.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},a.prototype.splayOnTop=function(t){var e=this.head;if(this.head===t)return this;var r=this.backward[t],i=this.forward[t];return this.tail===t?this.tail=r:this.backward[i]=r,this.forward[r]=i,this.backward[e]=t,this.head=t,this.forward[t]=e,this},a.prototype.set=function(t,e){var r=this.items[t];if(void 0!==r){this.splayOnTop(r),this.V[r]=e;return}this.size<this.capacity?r=this.size++:(r=this.tail,this.tail=this.backward[r],delete this.items[this.K[r]]),this.items[t]=r,this.K[r]=t,this.V[r]=e,this.forward[r]=this.head,this.backward[this.head]=r,this.head=r},a.prototype.setpop=function(t,e){var r=null,i=null,n=this.items[t];return void 0!==n?(this.splayOnTop(n),r=this.V[n],this.V[n]=e,{evicted:!1,key:t,value:r}):(this.size<this.capacity?n=this.size++:(n=this.tail,this.tail=this.backward[n],r=this.V[n],i=this.K[n],delete this.items[i]),this.items[t]=n,this.K[n]=t,this.V[n]=e,this.forward[n]=this.head,this.backward[this.head]=n,this.head=n,i)?{evicted:!0,key:i,value:r}:null},a.prototype.has=function(t){return t in this.items},a.prototype.get=function(t){var e=this.items[t];if(void 0!==e)return this.splayOnTop(e),this.V[e]},a.prototype.peek=function(t){var e=this.items[t];if(void 0!==e)return this.V[e]},a.prototype.forEach=function(t,e){e=arguments.length>1?e:this;for(var r=0,i=this.size,n=this.head,s=this.K,o=this.V,a=this.forward;r<i;)t.call(e,o[n],s[n],this),n=a[n],r++},a.prototype.keys=function(){var t=0,e=this.size,r=this.head,n=this.K,s=this.forward;return new i(function(){if(t>=e)return{done:!0};var i=n[r];return++t<e&&(r=s[r]),{done:!1,value:i}})},a.prototype.values=function(){var t=0,e=this.size,r=this.head,n=this.V,s=this.forward;return new i(function(){if(t>=e)return{done:!0};var i=n[r];return++t<e&&(r=s[r]),{done:!1,value:i}})},a.prototype.entries=function(){var t=0,e=this.size,r=this.head,n=this.K,s=this.V,o=this.forward;return new i(function(){if(t>=e)return{done:!0};var i=n[r],a=s[r];return++t<e&&(r=o[r]),{done:!1,value:[i,a]}})},"undefined"!=typeof Symbol&&(a.prototype[Symbol.iterator]=a.prototype.entries),a.prototype.inspect=function(){for(var t,e=new Map,r=this.entries();!(t=r.next()).done;)e.set(t.value[0],t.value[1]);return Object.defineProperty(e,"constructor",{value:a,enumerable:!1}),e},"undefined"!=typeof Symbol&&(a.prototype[Symbol.for("nodejs.util.inspect.custom")]=a.prototype.inspect),a.from=function(t,e,r,i){if(arguments.length<2){if("number"!=typeof(i=o.guessLength(t)))throw Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else 2==arguments.length&&(i=e,e=null,r=null);var s=new a(e,r,i);return n(t,function(t,e){s.set(e,t)}),s},t.exports=a},29705:function(t,e,r){var i=r(96603),n=r(38554);function s(t){return"number"==typeof t.length?t.length:"number"==typeof t.size?t.size:void 0}e.isArrayLike=function(t){return Array.isArray(t)||n.isTypedArray(t)},e.guessLength=s,e.toArray=function(t){var e=s(t),r="number"==typeof e?Array(e):[],n=0;return i(t,function(t){r[n++]=t}),r},e.toArrayWithIndices=function(t){var e=s(t),r="number"==typeof e?n.getPointerArray(e):Array,o="number"==typeof e?Array(e):[],a="number"==typeof e?new r(e):[],u=0;return i(t,function(t){o[u]=t,a[u]=u++}),[o,a]}},38554:function(t,e){e.getPointerArray=function(t){var e=t-1;if(e<=255)return Uint8Array;
1if(e<=65535)return Uint16Array;if(e<=4294967295)return Uint32Array;throw Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},e.getSignedPointerArray=function(t){var e=t-1;return e<=127?Int8Array:e<=32767?Int16Array:e<=2147483647?Int32Array:Float64Array},e.getNumberType=function(t){return t===(0|t)?-1===Math.sign(t)?t<=127&&t>=-128?Int8Array:t<=32767&&t>=-32768?Int16Array:Int32Array:t<=255?Uint8Array:t<=65535?Uint16Array:Uint32Array:Float64Array};var r={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};e.getMinimalRepresentation=function(t,i){var n,s,o,a,u,h=null,l=0;for(a=0,u=t.length;a<u;a++)o=i?i(t[a]):t[a],(n=r[(s=e.getNumberType(o)).name])>l&&(l=n,h=s);return h},e.isTypedArray=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView(t)},e.concat=function(){var t,e,r,i=0;for(t=0,r=arguments.length;t<r;t++)i+=arguments[t].length;var n=new arguments[0].constructor(i);for(t=0,e=0;t<r;t++)n.set(arguments[t],e),e+=arguments[t].length;return n},e.indices=function(t){for(var r=new(e.getPointerArray(t))(t),i=0;i<t;i++)r[i]=i;return r}},96603:function(t,e,r){var i=r(50355),n=i.ARRAY_BUFFER_SUPPORT,s=i.SYMBOL_SUPPORT;t.exports=function(t,e){var r,i,o,a,u;if(!t)throw Error("obliterator/forEach: invalid iterable.");if("function"!=typeof e)throw Error("obliterator/forEach: expecting a callback.");if(Array.isArray(t)||n&&ArrayBuffer.isView(t)||"string"==typeof t||"[object Arguments]"===t.toString()){for(o=0,a=t.length;o<a;o++)e(t[o],o);return}if("function"==typeof t.forEach){t.forEach(e);return}if(s&&Symbol.iterator in t&&"function"!=typeof t.next&&(t=t[Symbol.iterator]()),"function"==typeof t.next){for(r=t,o=0;!0!==(u=r.next()).done;)e(u.value,o),o++;return}for(i in t)t.hasOwnProperty(i)&&e(t[i],i)}},60151:function(t){function e(t){if("function"!=typeof t)throw Error("obliterator/iterator: expecting a function!");this.next=t}"undefined"!=typeof Symbol&&(e.prototype[Symbol.iterator]=function(){return this}),e.of=function(){var t=arguments,r=t.length,i=0;return new e(function(){return i>=r?{done:!0}:{done:!1,value:t[i++]}})},e.empty=function(){return new e(function(){return{done:!0}})},e.fromSequence=function(t){var r=0,i=t.length;return new e(function(){return r>=i?{done:!0}:{done:!1,value:t[r++]}})},e.is=function(t){return t instanceof e||"object"==typeof t&&null!==t&&"function"==typeof t.next},t.exports=e},50355:function(t,e){e.ARRAY_BUFFER_SUPPORT="undefined"!=typeof ArrayBuffer,e.SYMBOL_SUPPORT="undefined"!=typeof Symbol},30620:function(t,e,r){"use strict";r.d(e,{sq:function(){return s}});var i=r(72367);let n=t=>t;function s(t,e,r,s=n,o="raw"){if(!e)return t;if("published"!==o&&"raw"!==o&&"previewDrafts"!==o)throw Error(`Unknown perspective "${o}"`);return(0,i.lV)(JSON.parse(JSON.stringify(t)),(t,n)=>{let a=(0,i.Mx)(n,e);if(!a)return t;let{mapping:u,pathSuffix:h}=a;if("value"!==u.type||"documentValue"!==u.source.type)return t;let l=e.documents[u.source.document],c=e.paths[u.source.path];if(l){let e;let n=(0,i.F5)(c+h),a=(0,i.BB)(n);if("_id"===a||("previewDrafts"===o?((e=r(l._id.startsWith(i.jR)?l:{...l,_id:`${i.jR}${l._id}}`}))||(e=r(l._id.startsWith(i.jR)?{...l,_id:(0,i.vs)(l._id)}:l)),e&&(e={...e,_id:(0,i.vs)(l._id),_originalId:l._id})):e=r(l),!e))return t;let u=e?(0,i.U2)(e,a,t):t;return t===u?t:s(u,{cachedDocument:e,previousValue:t,sourceDocument:l,sourcePath:n})}return t})}},85351:function(t,e,r){"use strict";r.r(e),r.d(e,{default:function(){return p},turboChargeResultIfSourceMap:function(){return b}});var i=r(57437),n=r(42666),s=r(28248),o=r(30620),a=r(72367),u=r(32474),h=r(80096),l=r(4070),c=r(2265),f=r(74819),d=r(60506);function p(t){let{liveDocument:e,controller:r,perspective:s,documentsOnPage:o,onLoadersConnection:a,onDocumentsOnPage:h}=t,[p,m]=(0,c.useState)(),[w,b]=(0,c.useState)({}),g=(0,f.vpR)(),S=(0,f.p9V)();(0,c.useEffect)(()=>{let t=setInterval(()=>b(t=>{if(Object.keys(t).length<1)return t;let e=Date.now();if(!Object.values(t).some(t=>!1!==t.heartbeat&&e>t.receivedAt+t.heartbeat))return t;let r={};for(let[i,n]of Object.entries(t))!1!==n.heartbeat&&e>n.receivedAt+n.heartbeat||(r[i]=n);return r}),d.g0);return()=>clearInterval(t)},[]),(0,c.useEffect)(()=>
1{if(r){let t=r.createConnection({name:"presentation",connectTo:"loaders",heartbeat:!0},(0,u.oI)().provide({actors:(0,n.createCompatibilityActors)()}));return m(t),t.onStatus(a),t.on("loader/documents",t=>{t.projectId===g&&t.dataset===S&&h("loaders",t.perspective,t.documents)}),t.on("loader/query-listen",t=>{if(t.projectId===g&&t.dataset===S){if("number"==typeof t.heartbeat&&t.heartbeat<d.g0)throw Error(`Loader query listen heartbeat interval must be at least ${d.g0}ms`);b(e=>({...e,[(0,n.getQueryCacheKey)(t.query,t.params)]:{perspective:t.perspective,query:t.query,params:t.params,receivedAt:Date.now(),heartbeat:t.heartbeat??!1}}))}}),t.start()}},[r,S,h,a,g]);let[A]=(0,c.useState)(()=>new l(d.Zd)),E=(0,f.m85)({apiVersion:"2023-10-16"}),z=(0,c.useMemo)(()=>E.config(),[E]),k=(0,c.useMemo)(()=>E.withConfig({resultSourceMap:"withKeyArraySelector"}),[E]);(0,c.useEffect)(()=>{if(p){let{projectId:t,dataset:e}=z;p.post({type:"loader/perspective",data:{projectId:t,dataset:e,perspective:s}})}},[p,z,s]);let I=(0,c.useMemo)(()=>{let t=[...new Set(o.map(({_id:t})=>t))],e=A.capacity;return t.length>=e&&(t.length=e),t},[A.capacity,o]),[_,V]=(0,c.useState)(0);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{cache:A,client:k,turboIds:I,setDocumentsCacheLastUpdated:V}),Object.entries(w).map(([t,{query:r,params:n,perspective:o}])=>(0,i.jsx)(v,{cache:A,projectId:z.projectId,dataset:z.dataset,perspective:o,query:r,params:n,comlink:p,client:k,refreshInterval:s?2e3:0,liveDocument:e,documentsCacheLastUpdated:_},`${t}${o}`))]})}let y=(0,c.memo)(function(t){let{cache:e,client:r,turboIds:n,setDocumentsCacheLastUpdated:s}=t,[o,a]=(0,c.useState)([]);return(0,c.useEffect)(()=>{let t=new Set(o.flat()),r=new Set;for(let i of n)t.has(i)||e.has(i)||r.add(i);let i=[...r].slice(0,d.L1);0!==i.length&&a(t=>[...t.slice(-d.L1),i])},[o,e,n]),(0,c.useEffect)(()=>{let t=r.listen("*",{},{events:["mutation"],effectFormat:"mendoza",includePreviousRevision:!1,includeResult:!1,tag:"presentation-loader"}).subscribe(t=>{if("mutation"===t.type&&"disappear"===t.transition&&e.delete(t.documentId)&&s(Date.now()),"mutation"!==t.type||!t.effects?.apply?.length)return;let r=e.peek(t.documentId);if(r){let i={...r};delete i._rev;let n=(0,h.a)(i,t.effects.apply);e.set(t.documentId,n),s(Date.now())}});return()=>t.unsubscribe()},[e,r,s]),(0,i.jsx)(i.Fragment,{children:o.map(t=>(0,i.jsx)(m,{cache:e,client:r,ids:t,setDocumentsCacheLastUpdated:s},JSON.stringify(t)))})}),m=(0,c.memo)(function(t){let{client:e,cache:r,ids:i,setDocumentsCacheLastUpdated:n}=t;return(0,c.useEffect)(()=>{let t=i.filter(t=>!r.has(t));0!==t.length&&e.getDocuments(t).then(t=>{for(let e of t)e&&e?._id&&(r.set(e._id,e),n(Date.now()))},console.error)},[r,e,i,n]),null});function v(t){let{cache:e,projectId:r,dataset:i,perspective:n,query:o,client:a,refreshInterval:u,liveDocument:h,comlink:l,documentsCacheLastUpdated:f}=t,d=(0,s.K)(t.params),p=function(t){let{cache:e,liveDocument:r,client:i,refreshInterval:n,query:o,params:a,perspective:u,documentsCacheLastUpdated:h}=t,[l,f]=(0,c.useState)(null),{projectId:d,dataset:p}=(0,c.useMemo)(()=>{let{projectId:t,dataset:e}=i.config();return{projectId:t,dataset:e}},[i]),[y,m]=(0,c.useState)(null);if(y)throw y;let[v,w]=(0,s.o)({refreshInterval:n}),g="refresh"===v||"inflight"===v;return(0,c.useEffect)(()=>{if(!g)return;let t=!1,e=!1,r=new AbortController;async function n(){let{signal:n}=r;e=!0;let{result:s,resultSourceMap:h,syncTags:l}=await i.fetch(o,a,{tag:"presentation-loader",signal:n,perspective:u,filterResponse:!1});e=!1,n.aborted||(f({result:s,resultSourceMap:h,tags:l}),t=!0)}let s=w();return n().catch(t=>{e=!1,"AbortError"!==t.name&&m(t)}).finally(s),()=>{t||e||r.abort()}},[i,p,r,a,u,d,o,g,w]),(0,c.useMemo)(()=>h&&l?.resultSourceMap?{result:b(e,r,l.result,u,l.resultSourceMap),resultSourceMap:l.resultSourceMap}:l,[e,h,r,u,l])}({cache:e,client:a,liveDocument:h,params:d,perspective:n,query:o,refreshInterval:u,documentsCacheLastUpdated:f}),y=p?.result,m=p?.resultSourceMap,v=p?.tags;return(0,c.useEffect)(()=>{m&&l?.post({type:"loader/query-change",data:{projectId:r,dataset:i,perspective:n,query:o,params:d,result:y,resultSourceMap:m,tags:v}})},[l,i,d,n,r,o,y,m,v]),null}m.displayName="GetDocuments";let w=!1;function b(t,e,r,i,n){if("raw"===i)throw Error("turboChargeResultIfSourceMap does not support raw perspective");return(0,o.sq)(r,n,r=>{if(r._projectId){w||(console.warn("Cross dataset references are not supported yet, ignoring source document",r),w=!0);return}return e?._id&&(0,a.vs)(e._id)===(0,a.vs)(r._id)?e:t.get(r._id)},(t,{previousValue:e})=>"number"==typeof t&&"string"==typeof e?`${t}`:t,i)}},28248:function(t,e,r){"use strict";r.d(e,{K:function(){return n},o:function(){return s}});var i=r(2265);function n(t){let e=(0,i.useMemo)(()=>JSON.stringify(t||{}),[t]);return(0,i.useMemo)(()=>JSON.parse(e),[e])}function s(t){let{refreshInterval:e}=t,r=function(){let[t,e]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e(navigator.onLine);let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t),window.addEventListener("offline",r),
1()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}},[]);let r=(0,i.useSyncExternalStore)(o,()=>document.visibilityState,()=>"hidden");return!t||"hidden"===r}(),[n,s]=(0,i.useState)("hit"),a=(0,i.useCallback)(()=>(s("inflight"),()=>s("hit")),[]);return(0,i.useEffect)(()=>{if(!e||"hit"!==n)return;let t=setTimeout(()=>s("stale"),e);return()=>clearTimeout(t)},[e,n]),(0,i.useEffect)(()=>{if("hit"!==n)return;let t=()=>s("stale");return window.addEventListener("focus",t),()=>window.removeEventListener("focus",t)},[e,n]),(0,i.useEffect)(()=>{r&&"hit"===n&&s("stale"),r||"stale"!==n||s("refresh")},[r,n]),[n,a]}function o(t){return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",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.