PageSourceSearch

https://home.s.id/assets/use-swr-emll9s78-DFTfnjA5.js

js s.id collected 2026-09-24 07:39:37 UTC 11,792 bytes, 1 lines download raw bytes

1import{c as e,n as t}from"./jsx-runtime-CfjKz_hj.js";import{r as n}from"./useStore-Wp5MhgND.js";var r=e(t(),1),i=n(),a=Object.prototype.hasOwnProperty;function o(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&o(e[r],t[r]););return r===-1}if(!n||typeof e==`object`){for(n in r=0,e)if(a.call(e,n)&&++r&&!a.call(t,n)||!(n in t)||!o(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}var s=new WeakMap,c=()=>{},l=Object,u=e=>e===void 0,d=e=>typeof e==`function`,f=(e,t)=>({...e,...t}),p=e=>d(e.then),m={},h={},g=`undefined`,_=typeof window!=g,v=typeof document!=g,ee=_&&`Deno`in window,te=()=>_&&typeof window.requestAnimationFrame!=g,ne=(e,t)=>{let n=s.get(e);return[()=>!u(t)&&e.get(t)||m,r=>{if(!u(t)){let i=e.get(t);t in h||(h[t]=i),n[5](t,f(i,r),i||m)}},n[6],()=>!u(t)&&t in h?h[t]:!u(t)&&e.get(t)||m]},y=!0,b=()=>y,[x,S]=_&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[c,c],C=()=>{let e=v&&document.visibilityState;return u(e)||e!==`hidden`},w=e=>(v&&document.addEventListener(`visibilitychange`,e),x(`focus`,e),()=>{v&&document.removeEventListener(`visibilitychange`,e),S(`focus`,e)}),T=e=>{let t=()=>{y=!0,e()},n=()=>{y=!1};return x(`online`,t),x(`offline`,n),()=>{S(`online`,t),S(`offline`,n)}},E={isOnline:b,isVisible:C},D={initFocus:w,initReconnect:T},re=!r.useId,O=!_||ee,ie=e=>te()?window.requestAnimationFrame(e):setTimeout(e,1),k=O?r.useEffect:r.useLayoutEffect,A=typeof navigator<`u`&&navigator.connection,j=!O&&A&&([`slow-2g`,`2g`].includes(A.effectiveType)||A.saveData),M=new WeakMap,N=e=>l.prototype.toString.call(e),P=(e,t)=>e===`[object ${t}]`,F=0,ae=e=>{let t=typeof e,n=N(e),r=P(n,`Date`),i=P(n,`RegExp`),a=P(n,`Object`),o,s;if(l(e)===e&&!r&&!i){if(o=M.get(e),o)return o;if(o=++F+`~`,M.set(e,o),Array.isArray(e)){for(o=`@`,s=0;s<e.length;s++)o+=ae(e[s])+`,`;M.set(e,o)}if(a){o=`#`;let t=l.keys(e).sort();for(;!u(s=t.pop());)u(e[s])||(o+=s+`:`+ae(e[s])+`,`);M.set(e,o)}}else o=r?e.toJSON():t==`symbol`?e.toString():t==`string`?JSON.stringify(e):``+e;return o},oe=e=>{if(d(e))try{e=e()}catch{e=``}let t=e;return e=typeof e==`string`?e:(Array.isArray(e)?e.length:e)?ae(e):``,[e,t]},se=0,ce=()=>++se;async function le(...e){let[t,n,r,i]=e,a=f({populateCache:!0,throwOnError:!0},typeof i==`boolean`?{revalidate:i}:i||{}),o=a.populateCache,c=a.rollbackOnError,l=a.optimisticData,m=e=>typeof c==`function`?c(e):c!==!1,h=a.throwOnError;if(d(n)){let e=n,r=[],i=t.keys();for(let n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(g))}return g(n);async function g(n){let[i]=oe(n);if(!i)return;let[c,f]=ne(t,i),[g,_,v,ee]=s.get(t),te=()=>{let e=g[i];return(d(a.revalidate)?a.revalidate(c().data,n):a.revalidate!==!1)&&(delete v[i],delete ee[i],e&&e[0])?e[0](2).then(()=>c().data):c().data};if(e.length<3)return te();let y=r,b,x=!1,S=ce();_[i]=[S,0];let C=!u(l),w=c(),T=w.data,E=w._c,D=u(E)?T:E;if(C&&(l=d(l)?l(D,T):l,f({data:l,_c:D})),d(y))try{y=y(D)}catch(e){b=e,x=!0}if(y&&p(y)){if(y=await y.catch(e=>{b=e,x=!0}),S!==_[i][0]){if(x)throw b;return y}x&&C&&m(b)&&(o=!0,f({data:D,_c:void 0}))}if(o&&(x||(d(o)?f({data:o(y,D),error:void 0,_c:void 0}):f({data:y,error:void 0,_c:void 0}))),_[i][1]=ce(),Promise.resolve(te()).then(()=>{f({_c:void 0})}),x){if(h)throw b;return}return y}}var I=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},L=(e,t)=>{if(!s.has(e)){let n=f(D,t),r=Object.create(null),i=le.bind(void 0,e),a=c,o=Object.create(null),l=(e,t)=>{let n=o[e]||[];return o[e]=n,n.push(t),()=>{let e=n.indexOf(t);e>=0&&(n[e]=n[n.length-1],n.pop())}},u=(t,n,r)=>{e.set(t,n);let i=o[t];if(i)for(let e of i)e(n,r)},d=t=>{let n=s.get(e),[,i,a,c]=n,l=ce();n[8]++;for(let e in a)delete a[e];for(let e in c)delete c[e];for(let e in i)i[e]=[l,l];let u={};for(let t of[...e.keys()]){let n=e.get(t);e.delete(t);let r=o[t];if(r)for(let e of r)e(u,n)}let d=!t||t.revalidate!==!1;for(let e in r){let t=r[e];for(let e=0;e<t.length;e++)t[e](4,{revalidate:d&&!e})}},p=()=>
1{if(!s.has(e)&&(s.set(e,[r,Object.create(null),Object.create(null),Object.create(null),i,u,l,d,0]),!O)){let t=n.initFocus(setTimeout.bind(void 0,I.bind(void 0,r,0))),i=n.initReconnect(setTimeout.bind(void 0,I.bind(void 0,r,1)));a=()=>{t&&t(),i&&i(),s.delete(e)}}};return p(),[e,i,p,a,d]}let n=s.get(e);return[e,n[4],void 0,void 0,n[7]]},R=(e,t,n,r,i)=>{let a=n.errorRetryCount,o=i.retryCount,s=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!u(a)&&o>a||setTimeout(r,s,i)},ue=o,[z,B,,,V]=L(new Map),de=f({onLoadingSlow:c,onSuccess:c,onError:c,onErrorRetry:R,onDiscarded:c,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:j?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:j?5e3:3e3,compare:ue,isPaused:()=>!1,cache:z,mutate:B,unload:V,fallback:{}},E),H=(e,t)=>{let n=f(e,t);if(t){let{use:r,fallback:i,cacheData:a}=e,{use:o,fallback:s,cacheData:c}=t;r&&o&&(n.use=r.concat(o)),i&&s&&(n.fallback=f(i,s)),a&&c&&(n.cacheData=f(a,c))}return n},U=(0,r.createContext)({}),W=e=>{let{value:t}=e,n=(0,r.useContext)(U),i=d(t),a=(0,r.useMemo)(()=>i?t(n):t,[i,n,t]),o=(0,r.useMemo)(()=>i?a:H(n,a),[i,n,a]),s=a&&a.provider,c=(0,r.useRef)(void 0);s&&!c.current&&(c.current=L(s(o.cache||z),a));let l=c.current;return l&&(o.cache=l[0],o.mutate=l[1],o.unload=l[4]),k(()=>{if(l)return l[2]&&l[2](),l[3]},[]),(0,r.createElement)(U.Provider,f(e,{value:o}))},fe=_&&window.__SWR_DEVTOOLS_USE__,G=fe?window.__SWR_DEVTOOLS_USE__:[],K=()=>{fe&&(window.__SWR_DEVTOOLS_REACT__=r.default)},q=e=>d(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],J=()=>{let e=(0,r.useContext)(U);return(0,r.useMemo)(()=>f(de,e),[e])},pe=G.concat(e=>(t,n,r)=>e(t,n&&((...e)=>{let[r]=oe(t),[,,,i]=s.get(z);if(r.startsWith(`$inf$`))return n(...e);let a=i[r];return u(a)?n(...e):(delete i[r],a)}),r)),Y=e=>function(...t){let n=J(),[r,i,a]=q(t),o=H(n,a),s=e,{use:c}=o,l=(c||[]).concat(pe);for(let e=l.length;e--;)s=l[e](s);return s(r,i||o.fetcher||null,o)},me=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};K();var he=r.use||(e=>{switch(e.status){case`pending`:throw e;case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:throw e.status=`pending`,e.then(t=>{e.status=`fulfilled`,e.value=t},t=>{e.status=`rejected`,e.reason=t}),e}}),ge={dedupe:!0},_e=(e,t,n)=>t?e.get(t)?.has(n)===!0:!1,ve=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},ye=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{let i=e=>{n()&&u(t())&&r(e)};Promise.resolve(e).then(e=>{i({data:e,error:void 0})},e=>{i({error:e})})},be=Promise.resolve(void 0);be.status=`fulfilled`,be.value=void 0;var xe=()=>c,Se=(e,t,n)=>{let{cache:a,compare:o,suspense:c,fallbackData:l,revalidateOnMount:m,revalidateIfStale:h,refreshInterval:g,refreshWhenHidden:_,refreshWhenOffline:v,keepPreviousData:ee,strictServerPrefetchWarning:te}=n,[y,b,x,S]=s.get(a),[C,w]=oe(e),T=(0,r.useRef)(!1),E=(0,r.useRef)(!1),D=(0,r.useRef)(C),A=(0,r.useRef)(t),j=(0,r.useRef)(n),M=()=>j.current,N=()=>M().isVisible()&&M().isOnline(),[P,F,ae,se]=ne(a,C),I=(0,r.useRef)({}).current,L=u(l)?u(n.fallback)?void 0:n.fallback[C]:l,R=n.cacheData,ue=C?R?.[C]:void 0,z=C?S[C]:void 0,B=u(z)&&!u(ue),V=B?ue:z,de=(e,t)=>{for(let n in I){let r=n;if(r===`data`){if(!o(e[r],t[r])&&(!u(e[r])||!o(X,t[r])))return!1}else if(t[r]!==e[r])return!1}return!0},H=!T.current,U=(0,r.useMemo)(()=>{let e=P(),n=se(),r=e=>{let n=f(e);return delete n._k,(()=>{if(!C||!t||M().isPaused())return!1;if(H&&!u(m))return m;let e=u(L)?n.data:L;return c&&B&&u(e)?!1:u(e)||h})()?{isValidating:!0,isLoading:!0,...n}:n},i=r(e),a=e===n?i:r(n),o=i;return[()=>{let e=r(P());return de(e,o)?(o.data=e.data,o.isLoading=e.isLoading,o.isValidating=e.isValidating,o.error=e.error,o):(o=e,e)},()=>a]},[a,C]),W=(0,i.useSyncExternalStore)((0,r.useCallback)(e=>ae(C,(t,n)=>{de(n,t)||e()}),[a,C]),U[0],U[1]),fe=y[C]&&y[C].length>0,G=W.data,K=u(G)?L&&p(L)?he(L):L:G,q=W.error,J=(0,r.useRef)(K),pe=(0,r.useRef)(void 0),Y=pe.current;Y||(Y=new WeakMap,pe.current=Y);let Se=(0,r.useRef)(null),X=ee?u(G)?u(J.current)?K:J.current:G:K,Z=C&&u(K),Q=(0,r.useRef)(null);
1!O&&(0,i.useSyncExternalStore)(xe,()=>(Q.current=!1,Q),()=>(Q.current=!0,Q));let Ce=Q.current;te&&Ce&&!c&&Z&&console.warn(`Missing pre-initiated data for serialized key "${C}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);let we=!C||!t||M().isPaused()||fe&&!u(q)?!1:H&&!u(m)?m:c&&B&&Z?!1:c?!u(K)&&h:u(K)||h,Te=H&&we,Ee=u(W.isValidating)?Te:W.isValidating,De=u(W.isLoading)?Te:W.isLoading,$=(0,r.useCallback)(async e=>{let t=A.current;if(!C||!t||E.current||M().isPaused())return!1;let r,i,a=!0,s=e||{},c=!x[C]||!s.dedupe,l=B&&!_e(Y,R,C)&&!u(V)&&u(P().data),f=()=>re?!E.current&&C===D.current&&T.current:C===D.current,p={isValidating:!1,isLoading:!1},m=()=>{F(p)},h=()=>{let e=x[C];e&&e[1]===i&&delete x[C]},g={isValidating:!0};u(P().data)&&(g.isLoading=!0);try{if(c&&(F(g),n.loadingTimeout&&u(P().data)&&setTimeout(()=>{a&&f()&&M().onLoadingSlow(C,n)},n.loadingTimeout),l&&ve(Y,R,C),x[C]=[l?V:t(w),ce()],l&&S[C]&&delete S[C]),[r,i]=x[C],r=await r,c&&setTimeout(h,n.dedupingInterval),!x[C]||x[C][1]!==i)return c&&f()&&M().onDiscarded(C),!1;p.error=void 0;let e=b[C];if(!u(e)&&(i<=e[0]||i<=e[1]||e[1]===0))return m(),c&&f()&&M().onDiscarded(C),!1;let s=P().data;p.data=o(s,r)?s:r,c&&f()&&M().onSuccess(r,C,n)}catch(e){h();let t=M(),{shouldRetryOnError:n}=t;t.isPaused()||(p.error=e,c&&f()&&(t.onError(e,C,t),(n===!0||d(n)&&n(e))&&(!M().revalidateOnFocus||!M().revalidateOnReconnect||N())&&t.onErrorRetry(e,C,t,e=>{let t=y[C];t&&t[0]&&t[0](3,e)},{retryCount:(s.retryCount||0)+1,dedupe:!0})))}return a=!1,m(),!0},[C,a]),Oe=(0,r.useCallback)((...e)=>le(a,D.current,...e),[]);if(k(()=>{let e=Se.current;e&&(Se.current=null,ve(Y,e.cacheData,e.key),u(P().data)&&F({data:e.data,error:void 0,_k:e._k}),S[e.key]&&delete S[e.key])}),k(()=>{A.current=t,j.current=n,u(G)||(J.current=G)}),k(()=>{if(t||!B||u(V)||_e(Y,R,C)||!u(P().data))return;ve(Y,R,C);let e=b[C];ye({value:V,getCacheData:()=>P().data,canCommit:()=>!E.current&&C===D.current&&b[C]===e,setCache:e=>F({...e,_k:w})})}),k(()=>{if(!C)return;let e=$.bind(void 0,ge),t=0;M().revalidateOnFocus&&(t=Date.now()+M().focusThrottleInterval);let n=me(C,y,(n,r={})=>{if(n==0){let n=Date.now();M().revalidateOnFocus&&n>t&&N()&&(t=n+M().focusThrottleInterval,e())}else if(n==1)M().revalidateOnReconnect&&N()&&e();else if(n==2)return $();else if(n==3)return $(r);else if(n==4&&(J.current=void 0,r.revalidate))return $()});return E.current=!1,D.current=C,T.current=!0,F({_k:w}),we&&(x[C]||(u(K)||O?e():ie(e))),()=>{E.current=!0,n()}},[C]),k(()=>{let e;function t(){let t=d(g)?g(P().data):g;t&&e!==-1&&(e=setTimeout(n,t))}function n(){!P().error&&(_||M().isVisible())&&(v||M().isOnline())?$(ge).then(t):t()}return t(),()=>{e&&=(clearTimeout(e),-1)}},[g,_,v,C]),(0,r.useDebugValue)(X),c){if(!re&&O&&Z&&u(V))throw Error(`Fallback data is required when using Suspense in SSR.`);Z&&(A.current=t,j.current=n,E.current=!1);let e=!u(V)&&Z,r;if(e&&B?(r=V&&p(V)?he(V):V,K=r,X=r,O||(Se.current={data:r,_k:w,key:C,cacheData:R})):he(e?Oe(V):be),!u(q)&&Z)throw q;let i=Z&&u(r)?$(ge):be;!u(X)&&Z&&(i.status=`fulfilled`,i.value=!0),he(i)}return{mutate:Oe,get data(){return I.data=!0,X},get error(){return I.error=!0,q},get isValidating(){return I.isValidating=!0,Ee},get isLoading(){return I.isLoading=!0,De}}},X=l.defineProperty(W,`defaultValue`,{value:de}),Z=Y(Se);export{Z as n,X as 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.