"use strict";(globalThis.webpackChunk_palladium_ethiopia_esm_patient_registration_app=globalThis.webpackChunk_palladium_ethiopia_esm_patient_registration_app||[]).push([["2152"],{52470(e,t,r){r.r(t),r.d(t,{default:()=>m,infinite:()=>k,unstable_serialize:()=>b});var a=r(93763),l=r(85216),i=r(90549),n=r(42372),u=r(58139);let s=()=>{},o=s(),f=Object,c=e=>e===o,p=new WeakMap,_=(e,t)=>e===`[object ${t}]`,g=0,d=e=>{let t,r,a=typeof e,l=f.prototype.toString.call(e),i=_(l,"Date"),n=_(l,"RegExp"),u=_(l,"Object");if(f(e)!==e||i||n)t=i?e.toJSON():"symbol"==a?e.toString():"string"==a?JSON.stringify(e):""+e;else{if(t=p.get(e))return t;if(t=++g+"~",p.set(e,t),Array.isArray(e)){for(r=0,t="@";r<e.length;r++)t+=d(e[r])+",";p.set(e,t)}if(u){t="#";let a=f.keys(e).sort();for(;!c(r=a.pop());)c(e[r])||(t+=r+":"+d(e[r])+",");p.set(e,t)}}return t},y=e=>(e=>{if("function"==typeof e)try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?d(e):"",t]})(e?e(0,null):null)[0],b=e=>"$inf$"+y(e),h=Promise.resolve(),k=e=>(t,r,l)=>{let n,s=(0,a.useRef)(!1),{cache:o,initialSize:f=1,revalidateAll:c=!1,persistSize:p=!1,revalidateFirstPage:_=!0,revalidateOnMount:g=!1,parallel:d=!1}=l,[,,,b]=i.b.get(i.c);try{(n=y(t))&&(n="$inf$"+n)}catch(e){}let[k,m,z]=(0,i.z)(o,n),v=(0,a.useCallback)(()=>(0,i.e)(k()._l)?f:k()._l,[o,n,f]);(0,u.useSyncExternalStore)((0,a.useCallback)(e=>n?z(n,()=>{e()}):()=>{},[o,n]),v,v);let w=(0,a.useCallback)(()=>{let e=k()._l;return(0,i.e)(e)?f:e},[n,f]),C=(0,a.useRef)(w());(0,i.u)(()=>{if(!s.current){s.current=!0;return}n&&m({_l:p?C.current:w()})},[n,o]);let S=g&&!s.current,A=e(n,async e=>{let a=k()._i,n=k()._r;m({_r:i.U});let u=[],s=w(),[f]=(0,i.z)(o,e),p=f().data,g=[],y=null;for(let e=0;e<s;++e){let[s,f]=(0,i.s)(t(e,d?null:y));if(!s)break;let[h,k]=(0,i.z)(o,s),m=h().data,z=c||a||(0,i.e)(m)||_&&!e&&!(0,i.e)(p)||S||p&&!(0,i.e)(p[e])&&!l.compare(p[e],m);if(r&&("function"==typeof n?n(m,f):z)){let t=async()=>{if(s in b){let e=b[s];delete b[s],m=await e}else m=await r(f);k({data:m,_k:f}),u[e]=m};d?g.push(t):await t()}else u[e]=m;d||(y=m)}return d&&await Promise.all(g.map(e=>e())),m({_i:i.U}),u},l),$=(0,a.useCallback)(function(e,t){let r="boolean"==typeof t?{revalidate:t}:t||{},a=!1!==r.revalidate;return n?(a&&((0,i.e)(e)?m({_i:!0,_r:r.revalidate}):m({_i:!1,_r:r.revalidate})),arguments.length?A.mutate(e,{...r,revalidate:a}):A.mutate()):h},[n,o]),O=(0,a.useCallback)(e=>{let r;if(!n)return h;let[,a]=(0,i.z)(o,n);if((0,i.a)(e)?r=e(w()):"number"==typeof e&&(r=e),"number"!=typeof r)return h;a({_l:r}),C.current=r;let l=[],[u]=(0,i.z)(o,n),s=null;for(let e=0;e<r;++e){let[r]=(0,i.s)(t(e,s)),[a]=(0,i.z)(o,r),n=r?a().data:i.U;if((0,i.e)(n))return $(u().data);l.push(n),s=n}return $(l)},[n,o,$,w]);return{size:w(),setSize:O,mutate:$,get data(){return A.data},get error(){return A.error},get isValidating(){return A.isValidating},get isLoading(){return A.isLoading}}},m=(0,n.Ht)(l.Ay,k)}}]);