1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2748],{2381:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(85646).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},22748:(e,t,n)=>{n.d(t,{X:()=>b});var a=n(54568),i=n(7620),r=n(97509),s=n(39109),l=n(82288),o=n(71566),c=n(37703),u=n(2381),d=n(58917),m=n(4198),p=n(56605),h=n(73901),f=n(30527),y=n(73271);let g="https://center.dropin.care",x="AIzaSyCU3jeCeiY_U7tLyNe7LkHj10zWEqpNHQw";function w(e){return{centerId:e.centerId,centerName:e.name,address:e.address,city:e.city,state:e.state,zipCode:e.zipCode,licenseNumber:e.licenseNumber,licensedCapacity:e.licensedCapacity,ageRange:e.ageRange,centerType:e.centerType,description:e.description,phone:e.phone,website:e.website,imageUrl:null,hours:[]}}function b(e){let{open:t,onClose:n,initialMode:u="register"}=e,d=(0,i.useMemo)(()=>(0,m.K)(),[]),[b,v]=(0,i.useState)(u),[j,S]=(0,i.useState)("login"===u?"login":"account"),[N,_]=(0,i.useState)(!1),[C,P]=(0,i.useState)(null),[A,R]=(0,i.useState)(""),[U,E]=(0,i.useState)(""),[I,T]=(0,i.useState)(""),[z,L]=(0,i.useState)(""),[Y,M]=(0,i.useState)(""),[O,q]=(0,i.useState)([]),[B,V]=(0,i.useState)(!1),[W,X]=(0,i.useState)(!1),[F,G]=(0,i.useState)(null),[H,K]=(0,i.useState)([]),[Q,Z]=(0,i.useState)(null);async function J(){let{data:{session:e}}=await d.auth.getSession();if((null==e?void 0:e.access_token)&&(null==e?void 0:e.refresh_token)){let t=new URLSearchParams({access_token:e.access_token,refresh_token:e.refresh_token,next:"/dashboard"});window.location.href="".concat(g,"/auth/handoff#").concat(t.toString())}else window.location.href="".concat(g,"/dashboard")}let $=(0,i.useCallback)(async()=>{"login"===b?await J():S("find")},[b]),D=(0,i.useRef)(!1);async function ee(){if("register"===b&&!A.trim())return void P("Please enter your name.");if(!U.trim())return void P("Please enter your email.");if(_(!0),P(null),"register"===b){let[e,...t]=A.trim().split(" "),{error:n}=await (0,h.PV)(d,{email:U.trim(),role:"center_owner",firstName:e||"",lastName:t.join(" ")});_(!1),n?P(n.message):S("code")}else{let{error:e}=await d.auth.signInWithOtp({email:U.trim(),options:{shouldCreateUser:!1}});_(!1),e?P(e.message):S("code")}}async function et(){if(z.trim().length<6)return void P("Enter the 6-digit code we emailed you.");_(!0),P(null);let{error:e}=await (0,h.RY)(d,U.trim(),z.trim());if(e){_(!1),P("That code did not work. Check it and try again.");return}_(!1),await $()}async function en(e){P(null);let t="".concat(window.location.origin).concat(window.location.pathname,"?center_register=1"),{error:n}=await d.auth.signInWithOAuth({provider:e,options:{redirectTo:t}});n&&P(n.message)}async function ea(e){_(!0),P(null);try{let t=await (0,h.YP)(d,e);if(!t.ok)return void P(t.error);G(w(t.center))}finally{_(!1)}}async function ei(e){_(!0),P(null);try{let t=await (0,h.$m)(d,e);if("match_found"===t.status){let e=await (0,h.YP)(d,t.centerId);e.ok?G(w(e.center)):P(e.error)}else if("ok"===t.status){let{data:{user:e}}=await d.auth.getUser();if(!e)return void P("Your session expired. Please start again.");let n=await (0,h.dX)(d,e.id,t.place);n.ok?G(w(n.center)):P(n.error)}else P(t.message)}finally{_(!1)}}async function er(e){_(!0),P(null);try{var t,n;let a=await (0,h.ft)(d,"".concat(e.address,", ").concat(e.city,", ").concat(e.state," ").concat(e.zip)),i=null!=(t=null==a?void 0:a.lat)?t:0,r=null!=(n=null==a?void 0:a.lng)?n:0,s=await (0,h.X2)(d,{name:e.name,lat:i,lng:r,license:e.license});if(s.length>0){Z({form:e,lat:i,lng:r}),K(s),S("dups");return}await es(e,i,r)}finally{_(!1)}}
1async function es(e,t,n){let{data:{user:a}}=await d.auth.getUser();if(!a)return void P("Your session expired. Please start again.");let i=await (0,h.VE)(d,a.id,e,{lat:t,lng:n});if(!i.ok)return void P(i.error);G(w(i.center))}return((0,i.useEffect)(()=>{t&&!D.current&&(D.current=!0,"1"===new URLSearchParams(window.location.search).get("center_register")&&(async()=>{let{data:{session:e}}=await d.auth.getSession();e&&$()})())},[t,d,$]),(0,i.useEffect)(()=>{let e=Y.trim();if(e.length<3){q([]),X(!1);return}V(!0);let t=setTimeout(async()=>{q((await (0,p.Fp)(d,e,{includeUnclaimed:!0,limit:8})).map(e=>{var t;return{id:e.centerId,name:null!=(t=e.displayName)?t:e.name,address:e.address,city:e.city,state:e.state}})),V(!1),X(!0)},350);return()=>clearTimeout(t)},[Y,d]),t&&"undefined"!=typeof document)?F?(0,a.jsx)(y.F,{open:!0,onClose:n,prefill:F,resumeStep:"confirm"}):(0,r.createPortal)((0,a.jsx)(s.N,{children:(0,a.jsx)(l.P.div,{className:"fixed inset-0 z-[100] flex items-center justify-center overflow-y-auto bg-ink-900/45 p-4",initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},onClick:n,children:(0,a.jsx)(l.P.div,{className:"w-full max-w-[480px] overflow-hidden rounded-2xl bg-white shadow-2xl",initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:16,scale:.98},transition:{type:"spring",stiffness:300,damping:26},onClick:e=>e.stopPropagation(),children:(0,a.jsxs)("div",{className:"relative p-7",children:[(0,a.jsx)("button",{onClick:n,"aria-label":"Close",className:"absolute right-4 top-4 text-ink-500 transition-colors hover:text-ink-900",children:(0,a.jsx)(c.A,{className:"h-5 w-5"})}),C&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-sm text-red-800",children:C}),"login"===j&&(0,a.jsx)(f.MN,{email:U,busy:N,onEmail:E,onSubmit:ee,onOAuth:en,onRegister:()=>{v("register"),S("account"),P(null)}}),"account"===j&&(0,a.jsx)(f.Iu,{name:A,email:U,phone:I,busy:N,onName:R,onEmail:E,onPhone:T,onSubmit:ee,onOAuth:en,onLogin:()=>{v("login"),S("login"),P(null)}}),"code"===j&&(0,a.jsx)(f.GZ,{email:U,code:z,busy:N,onCode:L,onSubmit:et,onBack:()=>S("login"===b?"login":"account")}),"find"===j&&(0,a.jsx)(f.UV,{query:Y,onQuery:M,results:O,searching:B,searched:W,busy:N,onPick:ea,onManual:()=>{S("manual"),P(null)},googleSlot:x?(0,a.jsx)(o.c4,{apiKey:x,children:(0,a.jsx)(k,{onSelect:ei,disabled:N})}):void 0}),"manual"===j&&(0,a.jsx)(f.Zy,{busy:N,onBack:()=>S("find"),onSubmit:er}),"dups"===j&&(0,a.jsx)(f.JU,{candidates:H,busy:N,onClaim:ea,onCreateAnyway:()=>{Q&&(_(!0),es(Q.form,Q.lat,Q.lng).finally(()=>_(!1)))},onBack:()=>S("manual")})]})})})}),document.body):null}function k(e){let{onSelect:t,disabled:n}=e,r=(0,o.ST)("places"),[s,l]=(0,i.useState)(""),[c,m]=(0,i.useState)([]),p=(0,i.useRef)(null),h=(0,i.useRef)(null),f=(0,i.useRef)("");return(0,i.useEffect)(()=>{r&&(p.current=new r.AutocompleteService,h.current=new r.AutocompleteSessionToken)},[r]),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(u.A,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-ink-500"}),(0,a.jsx)("input",{value:s,disabled:n||!r,onChange:e=>{var t;l(t=e.target.value),f.current=t,p.current&&t.length>=3?p.current.getPlacePredictions({input:t,types:["establishment"],componentRestrictions:{country:"us"},sessionToken:h.current},e=>{f.current===t&&m(null!=e?e:[])}):m([])},placeholder:r?"Search for your center on Google":"Loading...",className:"w-full rounded-lg border border-brand-100 py-3 pl-9 pr-3 text-[15px] text-ink-900 outline-none focus:border-brand-400 focus:ring-2 focus:ring-brand-200 disabled:opacity-60"})]}),c.length>0&&(0,a.jsx)("ul",{className:"mt-2 max-h-56 space-y-1 overflow-y-auto",children:c.map(e=>{var i,r,s,o;return(0,a.jsx)("li",{children:(0,a.jsxs)("button",{onClick:()=>{var n,a;m([]),l(null!=(a=null==(n=e.structured_formatting)?void 0:n.main_text)?a:e.description),t(e.place_id)},disabled:n,className:"flex w-full items-start gap-2 rounded-lg border border-transparent px-2.5 py-2 text-left hover:border-brand-100 hover:bg-brand-50/50 disabled:opacity-60",children:[(0,a.jsx)(d.A,{className:"mt-0.5 h-4 w-4 shrink-0 text-ink-500"}),(0,a.jsxs)("span",{className:"min-w-0",children:[(0,a.jsx)("span",{className:"block truncate text-sm font-medium text-ink-900",children:null!=(s=null==(i=e.structured_formatting)?void 0:i.main_text)?s:e.description}),(0,a.jsx)("span",{className:"block truncate text-[13px] text-ink-500",children:null!=(o=null==(r=e.structured_formatting)?void 0:r.secondary_text)?o:""})]})]})},e.place_id)})})]})}},58917:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(85646).A)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])}}]);
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.