@icanbwell/composite 1.1123.0 → 1.1124.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Kt,elementNameSuffix:Zt,version:Et,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In,pr;window.bwell||(window.bwell=new re({metadata:{version:Et}}));const $n=`bwell-${Zt}`;if(customElements.get($n)!==void 0)return;class Wr extends f{constructor(){super(),We.add(this),Ct.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Lt.set(this,new I.EventEmitter),mn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Pt.set(this,void 0),qt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const Nt=new be(ze).attachToShadowRoot(this.shadowRoot);Nt.addEventListener("visibilitychange",({visibility:$e,container:it,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(it),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Wn,{slots:Nt,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Lt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,We,"m",yr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,zn,(0,p.__classPrivateFieldGet)(this,We,"m",gn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",pr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Pt,(0,p.__classPrivateFieldGet)(this,We,"m",pr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Pt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,zn,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Pt,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ct,this.id||(0,p.__classPrivateFieldGet)(this,Ct,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ct,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(Nt=>this.dispatchEvent(Nt)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,mn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,mn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Kt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Nt;(0,p.__classPrivateFieldGet)(this,Lt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,zn,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Pt,"f")),(Nt=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||Nt===void 0||Nt.deregister(),(0,p.__classPrivateFieldGet)(this,Lt,"f").removeAllListeners()}}Ct=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Lt=new WeakMap,mn=new WeakMap,zn=new WeakMap,et=new WeakMap,Pt=new WeakMap,qt=new WeakMap,Wn=new WeakMap,We=new WeakSet,yr=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${$n}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Kt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ct,"f"),name:Zt,elementName:$n,utils:(0,p.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},gn=function({visibility:Nt,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=Nt==="hidden"?"unset":"hidden"},In=function(Nt){(0,p.__classPrivateFieldGet)(this,qt,"f")(),(0,p.__classPrivateFieldSet)(this,qt,void 0,"f")},pr=function(Nt){return $e=>{const it=Ie.findIndex(tt=>tt===Nt);if(!Ie.slice(0,it).some(tt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,qt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",In).call(this,Nt),(0,p.__classPrivateFieldSet)(this,qt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[Nt]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,qt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",In).call(this,Nt);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,qt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define($n,Wr)}),at={rE:"1.1123.0"},ht="composite";var Rt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${ht}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ht,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Zt=>{var Et,Xe;const We=(Xe=(Et=Zt.placeAutocomplete)==null?void 0:Et.predictions)==null?void 0:Xe.map(Ct=>{var Ye;return{id:Ct.placeId,label:(0,s.removeAfterLastComma)(Ct.description),mainText:Ct?.mainText||((Ye=Ct.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ct?.secondaryText||Ct.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Zt=>p(v({},Zt),{displayLabel:(0,r.RZ)(Zt?.label||"",V)})),[V,be]),ze=Zt=>h(void 0,null,function*(){var Et,Xe,We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In;if(F(Zt),G(Zt),ie(!1),Zt&&typeof Zt=="string"){const pr=be.find(tt=>tt.id===Zt),$n=pr?.label||V;if(!pr)return;q($n),k($n),setTimeout(()=>{const tt=[{id:pr.id,label:pr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Zt}}),Zr=(Xe=(Et=Wr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Nt=(Ct=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ct.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",it=((mn=(Lt=Wr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(zn=Wr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Zr&&Nt)if(!$e||!Je){const tt=yield de({variables:{latitude:String(Zr),longitude:String(Nt)}}),rt=((qt=(Pt=tt?.data)==null?void 0:Pt.geocodingByLatLon)==null?void 0:qt.zipCode)||"",ut=((yr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:yr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Zr,longitude:Nt,zipCode:rt,state:ut,stateCode:St,placeId:Zt,description:$n,value:Zt})}else T({latitude:Zr,longitude:Nt,zipCode:$e,state:it,stateCode:Je,placeId:Zt,description:$n,value:Zt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Zt=>h(void 0,null,function*(){return yield J({variables:{input:Zt,types:"geocode"}})})),_e=Zt=>h(void 0,null,function*(){if(ie(!1),q(Zt),z?.(Zt),!Zt||Zt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Zt});return}const Et=Zt.trim();Et.length>=2?yield xe(Et):Se(pe)}),at=Zt=>{te.current=Zt},ht=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Et,Xe,We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const pr=yield ae({variables:{placeId:N}}),$n=(Xe=(Et=pr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(Ct=(We=pr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ct.longitude,Zr=((Qe=(Ye=pr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",Nt=((mn=(Lt=pr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",$e=((et=(zn=pr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if($n&&Wr)if(!Zr||!Nt||!$e){const it=yield de({variables:{latitude:String($n),longitude:String(Wr)}}),Je=((qt=(Pt=it?.data)==null?void 0:Pt.geocodingByLatLon)==null?void 0:qt.zipCode)||"",tt=((yr=(Wn=it?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:yr.state)||"",rt=((In=(gn=it?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:$n,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:$n,longitude:Wr,zipCode:Zr,state:Nt,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Rt=se||!!he||!!re||!!Ee||!!R,Kt=Rt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:ht,isInvalid:Rt,hint:Kt,autoComplete:"address-line1",className:"w-full",children:Zt=>{const Et=Zt,Xe=V.trim().length>=2,We=Et.mainText||"",Ct=Et.secondaryText||"",Ye=We.trim().length>0,Qe=Ct.trim().length>0,Lt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Qe?(0,r.RZ)(Ct,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:Et.id,supportingText:Et.supportingText,isDisabled:Et.isDisabled,icon:Et.icon,avatarUrl:Et.avatarUrl,textValue:Et.label,children:Xe&&Ye?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Et.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,de,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>Nt,GI:()=>K,rz:()=>Ct,Fp:()=>We,el:()=>Xe,ao:()=>Et,oA:()=>S,Yt:()=>$e,g4:()=>Zt,tn:()=>rt,n4:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Zr,Z$:()=>be,GT:()=>$n,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Pt,hZ:()=>zn,$e:()=>Ye,qT:()=>mn,GQ:()=>Lt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>bn,Z_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>Rt,WS:()=>ht,VF:()=>In,vf:()=>Wn,PV:()=>pr,PS:()=>qt,Iz:()=>gn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>de,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));p.displayName="CreditCard02";const h=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const b=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",de="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",ht="http://icanbwell.com/fhir/StructureDefinition/text-align",Rt={LEFT:"left",CENTER:"center"},Kt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Zt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Et="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Lt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",mn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",zn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",qt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",yr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",gn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",In="http://icanbwell.com/fhir/StructureDefinition/trigger-color",pr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",$n="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Zr="http://icanbwell.com/fhir/StructureDefinition/message-severity",Nt="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",it="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",ut="http://icanbwell.com/fhir/StructureDefinition/button-type",St="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Tt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xt={},bn={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>zn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>Nt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>ut,iI:()=>q,lv:()=>w,mR:()=>Tt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(gt,Jt,jt)=>Jt in gt?A(gt,Jt,{enumerable:!0,configurable:!0,writable:!0,value:jt}):gt[Jt]=jt,f=(gt,Jt)=>{for(var jt in Jt||(Jt={}))v.call(Jt,jt)&&h(gt,jt,Jt[jt]);if(O)for(var jt of O(Jt))p.call(Jt,jt)&&h(gt,jt,Jt[jt]);return gt},b=(gt,Jt)=>m(gt,d(Jt));const M=gt=>{var Jt;return(Jt=gt.filter(jt=>jt.url.includes("questionnaire-itemControl")).flatMap(jt=>{var Dt,$t;return($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)!=null?$t:[]}).find(jt=>{var Dt;return(Dt=jt.code)==null?void 0:Dt.startsWith("ui-toolkit/")}))==null?void 0:Jt.code},x=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.V7);return jt?.valueCode||"off"},z=(gt,Jt,jt)=>{const Dt=(0,u.A)(jt);return gt&&Jt&&jt?Dt.replace("<p>",`<span>${Jt} `).replace("</p>","</span>").trim():Dt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=gt=>{const Jt=gt?.find(jt=>jt.url===y.Vp);return Jt?.valueInteger},S=gt=>{const Jt=gt?.find(jt=>jt.url===y.Z_);return Jt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(gt,Jt)=>{const jt=gt?.find(Dt=>Dt.url===PLACEHOLDER_EXTENSION_URL);return jt?.valueString||Jt&&E[Jt]||C},L=gt=>{const Jt=gt?.find(jt=>jt.url===HINT_TEXT_EXTENSION_URL);return Jt?.valueString},P=gt=>{const Jt=gt?.filter(jt=>jt.url===y.GT&&jt.valueCode).map(jt=>y.hr[jt.valueCode]||jt.valueCode);return Jt?.length?Jt.join(","):void 0},D=gt=>gt.split(",").map(Dt=>Dt.trim()).map(Dt=>y.JL[Dt]||Dt).filter((Dt,$t,Qt)=>Qt.indexOf(Dt)===$t).join(", "),N=(gt,Jt,jt)=>{const Dt=D(gt),$t=Dt.lastIndexOf(","),Qt=$t!==-1?`${Dt.substring(0,$t)} or${Dt.substring($t+1)}`:Dt,yn=[Jt&&`max. ${(Jt/(1e3*1e3)).toFixed(0)}MB`,jt&&`upto ${jt} file${jt>1?"s":""}`].filter(Boolean);return yn.length>0?`${Qt} (${yn.join(", ")})`:Qt},w=gt=>{const Jt=gt?.find(jt=>jt?.url===y.zD||jt?.url===y.UZ);return Jt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(gt,Jt)=>{var jt,Dt,$t;const Qt=Jt?.find(yn=>yn.url.includes(gt));return($t=(Dt=(jt=Qt?.valueInteger)!=null?jt:Qt?.valueDecimal)!=null?Dt:Qt?.valueString)!=null?$t:Qt?.valueDate},q=gt=>{if(!!gt){if(/^\d{4}-\d{2}-\d{2}$/.test(gt))return gt;try{const Jt=(0,o.evaluate)({},gt);if(Array.isArray(Jt)&&Jt.length>0){const jt=Jt[0];if(jt instanceof Date&&!isNaN(jt.getTime())){const Dt=jt.getFullYear(),$t=String(jt.getMonth()+1).padStart(2,"0"),Qt=String(jt.getDate()).padStart(2,"0");return`${Dt}-${$t}-${Qt}`}if(typeof jt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(jt))return jt}}catch{}}},I=(gt,Jt)=>{var jt,Dt;const $t=Jt?.find(yn=>yn.url===gt);if(!$t)return;const Qt=(jt=$t.valueString)!=null?jt:$t.valueDate;return Qt||q((Dt=$t.valueExpression)==null?void 0:Dt.expression)},k=(gt,Jt)=>{if(!(!gt||gt.length===0))for(const jt of gt){const Dt=V(Jt,jt.extension);if(Dt!==void 0)return Dt;if(jt.item&&jt.item.length>0){const $t=k(jt.item,Jt);if($t!==void 0)return $t}}},U=(gt,Jt)=>{try{const jt=String(gt??Jt);let Dt;if(jt.includes("/"))Dt=(0,n.A)(jt,"MM/dd/yyyy",new Date);else{const $t=jt.split("T")[0];Dt=(0,t.A)($t)}return(0,r.A)(Dt)}catch(jt){return console.error("Date parsing error:",jt,gt),null}},F=(gt,Jt)=>{var jt;for(const Dt of gt){if(Dt.linkId===Jt)return Dt;if((jt=Dt.item)!=null&&jt.length){const $t=F(Dt.item,Jt);if($t!==void 0)return $t}}},K=(gt,Jt)=>{var jt;const Dt=[];for(const $t of gt)if($t.linkId===Jt&&Dt.push($t),(jt=$t.item)!=null&&jt.length){const Qt=K($t.item,Jt);Dt.push(...Qt)}return Dt},G=(gt,Jt,jt=0)=>K(gt,Jt)[jt];function se(gt){return gt!=null}const ie=(gt,Jt)=>{var jt,Dt,$t;if("answerString"in gt&&se(gt.answerString)){if(gt.operator==="=")return Jt?.valueString===gt.answerString;if(gt.operator==="!=")return Jt?.valueString!==gt.answerString}if("answerBoolean"in gt&&se(gt.answerBoolean)){if(gt.operator==="=")return Jt?.valueBoolean===gt.answerBoolean;if(gt.operator==="!=")return Jt?.valueBoolean!==gt.answerBoolean}if("answerInteger"in gt&&se(gt.answerInteger)||"answerDecimal"in gt&&se(gt.answerDecimal)){const Qt=Number(Jt?.valueInteger||Jt?.valueDecimal),yn=Number(gt.answerInteger||gt.answerDecimal);if(gt.operator==="=")return Qt===yn;if(gt.operator==="!=")return Qt!==yn;if(gt.operator===">")return Qt>yn;if(gt.operator==="<")return Qt<yn;if(gt.operator===">=")return Qt>=yn;if(gt.operator==="<=")return Qt<=yn}if("answerQuantity"in gt&&se(gt.answerQuantity)){const Qt=Jt?.valueQuantity,yn=gt.answerQuantity;if(Qt?.unit!==yn?.unit)return!1;if(gt.operator==="=")return Qt.value===yn.value;if(gt.operator==="!=")return Qt.value!==yn.value;if(gt.operator===">")return Qt.value>yn.value;if(gt.operator==="<")return Qt.value<yn.value;if(gt.operator===">=")return Qt.value>=yn.value;if(gt.operator==="<=")return Qt.value<=yn.value}if("answerCoding"in gt&&se(gt.answerCoding)){const Qt=Jt?.valueCoding,yn=gt.answerCoding;if(gt.operator==="=")return Qt?.code===yn.code;if(gt.operator==="!=")return Qt?.code!==yn.code}if("answerReference"in gt&&se(gt.answerReference)){const Qt=Jt?.valueReference,yn=gt.answerReference;if(gt.operator==="=")return Qt?.reference===yn.reference;if(gt.operator==="!=")return Qt?.reference!==yn.reference}if("answerDate"in gt&&se(gt.answerDate)||"answerDateTime"in gt&&se(gt.answerDateTime)||"answerTime"in gt&&se(gt.answerTime)){const Qt=new Date(($t=(Dt=(jt=Jt?.valueDate)!=null?jt:Jt?.valueDateTime)!=null?Dt:Jt?.valueTime)!=null?$t:""),yn=new Date(gt.answerDate||gt.answerDateTime||gt.answerTime||"");if(gt.operator==="=")return Qt.getTime()===yn.getTime();if(gt.operator==="!=")return Qt.getTime()!==yn.getTime();if(gt.operator===">")return Qt.getTime()>yn.getTime();if(gt.operator==="<")return Qt.getTime()<yn.getTime();if(gt.operator===">=")return Qt.getTime()>=yn.getTime();if(gt.operator==="<=")return Qt.getTime()<=yn.getTime()}return gt.operator==="exists"?Jt!=null===gt.answerBoolean:!0},te=(gt,Jt,jt)=>{const Dt=$t=>{const Qt=K(jt,$t.question);return Qt.length===0||Qt.every(yn=>!yn.answer||yn.answer.length===0)?ie($t,void 0):Qt.some(yn=>{var zr;return(zr=yn.answer)==null?void 0:zr.some(qr=>ie($t,qr&&Object.keys(qr).length>0?qr:void 0))})};return gt&&gt?.length>0?Jt==="any"?gt?.some($t=>Dt($t)):gt?.every($t=>Dt($t)):!0},pe=(gt,Jt,jt,Dt,$t)=>{if(!gt||gt.length===0)return!0;const Qt=yn=>{var zr;let qr;if(Dt&&typeof $t=="number"){const Dn=jt.filter(on=>on.linkId===Dt)[$t];if(Dn?.item){const on=Dn.item.find(Mt=>Mt.linkId===yn.question);if(on?.answer&&on.answer.length>0)return(zr=on?.answer)==null?void 0:zr.some(Mt=>ie(yn,Mt&&Object.keys(Mt).length>0?Mt:void 0))}}if(!qr){const Ln=K(jt,yn.question);if(Ln.length>0)return Ln.some(Dn=>{var on;return(on=Dn.answer)==null?void 0:on.some(Mt=>ie(yn,Mt&&Object.keys(Mt).length>0?Mt:void 0))});qr=void 0}return ie(yn,qr)};return Jt==="any"?gt.some(yn=>Qt(yn)):gt.every(yn=>Qt(yn))},be=(gt,Jt)=>{var jt;if(!!((jt=gt?.valueExpression)!=null&&jt.expression))try{const Dt=evaluate(Jt,gt.valueExpression.expression);return Array.isArray(Dt)?Dt.some($t=>Boolean($t)):Boolean(Dt)}catch{return}},Se=(gt,Jt)=>{var jt;const Dt=(jt=gt.extension)==null?void 0:jt.find(Qt=>Qt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Dt,Jt);return b(f({},gt),{readOnly:$t??gt.readOnly})},ge=(gt,Jt,jt)=>{const{required:Dt,maxLength:$t,type:Qt,extension:yn,enableWhen:zr,enableBehavior:qr,repeats:Ln,answerOption:Dn}=gt;if(!te(zr,qr,Jt)||gt.type==="group"||gt.type==="display")return"";if(Ln)return ne(gt,Jt,jt);const on=de(gt,Jt);return on&&ue(on,gt)?re(gt,Jt,jt,on):he(yn,Qt,Dt,$t,jt,Dn)},ne=(gt,Jt,jt)=>{const{required:Dt}=gt;if(Dt){if(!jt||jt.length===0)return"At least one item is required";let $t=!1;for(let Qt=0;Qt<jt.length;Qt++){const yn=jt[Qt];if(yn&&Object.keys(yn).length>0&&Object.values(yn).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){$t=!0;const qr=he(gt.extension,gt.type,!0,gt.maxLength,[yn],gt.answerOption);if(qr)return`Item ${Qt+1}: ${qr}`;if(gt.item&&gt.item.length>0){const Ln=ae(gt.item,Jt,gt.linkId,Qt);if(Ln)return`Item ${Qt+1}: ${Ln}`}}else return`Item ${Qt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(jt&&jt.length>0)for(let $t=0;$t<jt.length;$t++){const Qt=jt[$t];if(Qt&&Object.keys(Qt).length>0&&Object.values(Qt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(gt.extension,gt.type,!1,gt.maxLength,[Qt],gt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(gt.item&&gt.item.length>0){const qr=ae(gt.item,Jt,gt.linkId,$t);if(qr)return`Item ${$t+1}: ${qr}`}}}return""},ae=(gt,Jt,jt,Dt)=>{var $t,Qt;for(const yn of gt){if(!pe(yn.enableWhen,yn.enableBehavior,Jt,jt,Dt))continue;const zr=F(Jt,jt),qr=($t=zr?.item)==null?void 0:$t.find(Dn=>Dn.linkId===yn.linkId),Ln=(Qt=qr?.answer)!=null&&Qt[Dt]?[qr.answer[Dt]]:void 0;if(yn.required){if(!Ln||!Ln[0]||!me(Ln[0]))return`${yn.text||yn.linkId} is required`;const Dn=he(yn.extension,yn.type,!0,yn.maxLength,Ln,yn.answerOption);if(Dn)return`${yn.text||yn.linkId}: ${Dn}`}else if(Ln&&Ln[0]&&me(Ln[0])){const Dn=he(yn.extension,yn.type,!1,yn.maxLength,Ln,yn.answerOption);if(Dn)return`${yn.text||yn.linkId}: ${Dn}`}if(yn.item&&yn.item.length>0){const Dn=ae(yn.item,Jt,yn.linkId,Dt);if(Dn)return Dn}}return""},me=gt=>!gt||Object.keys(gt).length===0?!1:Object.values(gt).some(Jt=>Jt!=null&&Jt!==""&&(Array.isArray(Jt)?Jt.length>0:!0)),he=(gt,Jt,jt,Dt,$t,Qt)=>{var yn,zr,qr,Ln,Dn;let on="";const Mt=!!gt?.find(Sn=>{var Kn,wr;return Sn.url===y.gD&&((wr=(Kn=Sn.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),zt=$t?.[0],Yt={choice:((yn=zt?.valueCoding)==null?void 0:yn.code)||(zt?.valueString&&Qt?.some(Sn=>Sn.valueString===zt.valueString)?zt.valueString:null),"open-choice":((zr=zt?.valueCoding)==null?void 0:zr.code)||zt?.valueString,boolean:zt?.valueBoolean,string:zt?.valueString,text:zt?.valueString,url:zt?.valueUri,integer:zt?.valueInteger,decimal:zt?.valueDecimal,dateTime:zt?.valueDateTime,date:zt?.valueDate,time:zt?.valueTime,quantity:(qr=zt?.valueQuantity)==null?void 0:qr.value,reference:(Ln=zt?.valueReference)==null?void 0:Ln.display,attachment:(Dn=zt?.valueAttachment)==null?void 0:Dn.title};if(!(Jt in Yt))return"";const cn=Yt[Jt],an={required:()=>jt&&(cn==null||cn===""||cn==="NaN"||Number.isNaN(cn)||Jt==="boolean"&&cn!==!0&&Mt)?"This field is required":"",maxLength:()=>Dt&&cn!==null&&cn!==void 0&&cn.toString().length>Dt?`Input should not exceed ${Dt} characters`:"",minLength:()=>{const Sn=V("minLength",gt);return Sn&&cn!==null&&cn!==void 0&&cn.toString().length<Number(Sn)?`Input should be at least ${Sn} characters`:""},urlRegex:()=>{const Sn=new RegExp(y.rx),Kn=V("regexError",gt),wr=Kn??"Please enter a valid url starting from http:// and https://";return Sn&&Jt==="url"&&cn&&!Sn.test(cn)?String(wr):""},regex:()=>{const Sn=V("regex",gt);if(!Sn||typeof cn!="string")return"";const Kn=new RegExp(Sn),wr=V("regexError",gt),$r=wr??"Please enter a valid input";return Kn&&cn&&!Kn.test(cn)?String($r):""},dateTime:()=>{if(Jt==="dateTime"&&cn){const Sn=cn?.toString(),Kn=new Date(Sn);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Jt!=="date"||!cn)return"";const Sn=cn.replace(/\D/g,"");return Sn.length>0&&Sn.length<8||isNaN(new Date(cn).getTime())?"Invalid date":""},minValue:()=>{var Sn;if(Jt==="date"){const wr=I(y.dU,gt),$r=U(wr??"01/01/1900","01/01/1900"),Xr=U(cn,"");if(!$r||!Xr)return"";if((0,s.A)(Xr,$r)){const c0=(Sn=gt?.find(Pi=>Pi.url===y.Ck))==null?void 0:Sn.valueString;return c0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Kn=V("minValue",gt);return Kn!=null&&cn!==null&&cn!==void 0&&cn<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var Sn;if(Jt==="date"){const wr=I(y.bK,gt),$r=U(wr??"01/01/2100","01/01/2100"),Xr=U(cn,"");if(!$r||!Xr)return"";if((0,i.A)(Xr,$r)){const c0=(Sn=gt?.find(Pi=>Pi.url===y.Cx))==null?void 0:Sn.valueString;return c0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Kn=V("maxValue",gt);return Kn!=null&&cn!==null&&cn!==void 0&&cn>Kn?`Input should not exceed ${Kn}`:""}};return on=an.required()||an.maxLength()||an.minLength()||an.urlRegex()||an.regex()||an.dateTime()||an.date()||an.minValue()||an.maxValue()||"",on},de=(gt,Jt)=>{for(const jt of Jt)if(jt.item){if(jt.item.find(Qt=>Qt.linkId===gt.linkId))return jt;const $t=de(gt,jt.item);if($t)return $t}return null},ue=(gt,Jt)=>{if(gt.answer&&gt.answer.length>1)return!0;if(gt.item){const jt=gt.item.find(Dt=>Dt.linkId===Jt.linkId);if(jt&&jt.answer&&jt.answer.length>1)return!0}return!1},re=(gt,Jt,jt,Dt)=>{var $t,Qt;const{required:yn}=gt,zr=($t=Dt.item)==null?void 0:$t.find(Dn=>Dn.linkId===gt.linkId),qr=zr?.answer||[],Ln=((Qt=Dt.answer)==null?void 0:Qt.length)||1;for(let Dn=0;Dn<Ln;Dn++){const on=qr[Dn];if(yn){if(!on||!me(on))return`Item ${Dn+1}: ${gt.text||gt.linkId} is required`;const Mt=he(gt.extension,gt.type,!0,gt.maxLength,[on],gt.answerOption);if(Mt)return`Item ${Dn+1}: ${Mt}`}else if(on&&me(on)){const Mt=he(gt.extension,gt.type,!1,gt.maxLength,[on],gt.answerOption);if(Mt)return`Item ${Dn+1}: ${Mt}`}}return""},J=(gt,Jt)=>{for(const jt of gt){if(jt?.linkId===Jt)return jt;if(jt?.item&&jt.item.length>0){const Dt=J(jt.item,Jt);if(Dt)return Dt}}},ve=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===FOOTER_CODE))}))},Ee=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>jt.url===y.oA&&jt.valueBoolean))},De=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===HEADER_CODE))}))},ze=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===y.gD&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===y.n4&&Qt.code===y._l))}))},Ie=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>jt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&jt.valueBoolean))},xe=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===CHECKBOX_CODE))}))},_e=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.fe);return jt?.valueInteger},at=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.zO);return jt?.valueInteger},ht=gt=>{var Jt;const jt=(Jt=gt?.extension)==null?void 0:Jt.find(Dt=>Dt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return jt?.valueInteger},Rt=(gt,Jt,jt,Dt,$t,Qt)=>{const yn=qr=>Jt.filter(Ln=>Ln.linkId===qr),zr=new Set;return gt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Dn=yn(qr.linkId),on=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),on){const Mt=[];if(Dn.forEach((zt,Yt)=>{const cn={linkId:qr.linkId,text:qr.text};let an;if(jt===qr.linkId&&typeof Qt=="number"&&Qt===Yt&&$t&&$t.length>0){const Sn=zt?.item||[];an=[...Sn],$t.forEach(Kn=>{const wr=an.findIndex($r=>$r.linkId===Kn.linkId);wr>=0?an[wr]=b(f({},Sn[wr]),{answer:Kn.answer}):an.push(Kn)})}else qr.item&&(an=Rt(qr.item,zt?.item||[],jt,Dt,$t,Yt));jt===qr.linkId&&typeof Qt=="number"&&Qt===Yt&&Dt?cn.answer=Dt:cn.answer=zt.answer||[{}],an&&an.length>0?cn.item=an:zt.item&&(cn.item=zt.item),Mt.push(cn)}),jt===qr.linkId&&typeof Qt=="number"&&Qt>=Dn.length)for(let zt=Dn.length;zt<=Qt;zt++){const Yt={linkId:qr.linkId,text:qr.text,answer:zt===Qt&&Dt?Dt:[{}]};zt===Qt&&$t&&$t.length>0?Yt.item=$t:qr.item&&(Yt.item=Rt(qr.item,[],void 0,void 0,void 0,void 0)),Mt.push(Yt)}return Mt}else if(qr.repeats&&typeof Qt=="number"&&jt===qr.linkId){const Mt=Dn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},zt={linkId:qr.linkId,text:qr.text,answer:[...Mt.answer||[]]};if(Dt&&Dt.length>0){for(;zt.answer.length<=Qt;)zt.answer.push({});zt.answer[Qt]=Dt[0]}return zt}else{const Mt=Dn[0],zt=qr.item?Rt(qr.item,Mt?.item||[],jt,Dt,$t,Qt):void 0,Yt=zt&&zt.length>0,cn={linkId:qr.linkId,text:qr.text};return jt&&qr.linkId===jt&&typeof Qt!="number"?(Dt||!Dt&&!$t?cn.answer=Dt:Mt?.answer&&(cn.answer=Mt.answer),$t?cn.item=$t:Yt&&(cn.item=zt)):(Mt?.answer?cn.answer=Mt.answer:cn.answer=[{}],Yt&&(cn.item=zt)),cn}}).filter(Boolean).flat()},Kt=(gt,Jt)=>{for(const jt of gt)if(jt.linkId===Jt||jt.item&&Kt(jt.item,Jt))return jt.linkId;return null},Zt=(gt,Jt,jt,Dt)=>{var $t;const Qt=($t=gt?.item)!=null?$t:Dt;return!Qt||Qt.length===0?!0:Qt.every(yn=>{var zr;const qr=K(Jt,yn.linkId);if(qr.length===0){const Ln=(zr=F(Jt,yn.linkId))==null?void 0:zr.answer;if(ge(yn,Jt,Ln)&&te(yn.enableWhen,yn.enableBehavior,Jt)&&jt.includes(yn.linkId))return!1}else for(const Ln of qr)if(ge(yn,Jt,Ln.answer)&&te(yn.enableWhen,yn.enableBehavior,Jt)&&jt.includes(yn.linkId))return!1;return yn.item?Zt(yn,Jt,jt):!0})},Et=(gt,Jt,jt=!0)=>{for(const Dt of gt)if(Dt.linkId===Jt&&Dt.answer&&Dt.answer.length>0||Dt.item&&Dt.item.length>0&&Et(Dt.item,Jt,jt))return!0;return!1},Xe=(gt,Jt,jt=0)=>{const Dt=gt.filter($t=>$t.linkId===Jt);if(Dt.length>jt){const $t=Dt[jt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Qt=>Qt&&Object.keys(Qt).length>0&&Object.values(Qt).some(yn=>yn!=null&&yn!==""));if($t.item&&$t.item.length>0)return Et($t.item,Jt,!1)}return Et(gt,Jt,!1)},We=(gt,Jt)=>{if(!gt||!gt.item)return!1;const jt=Dt=>{var $t;if(Ee(Dt)&&Dt.required&&te(Dt.enableWhen,Dt.enableBehavior,Jt)){const Qt=F(Jt,Dt.linkId),yn=he(Dt.extension,Dt.type,Dt.required,Dt.maxLength,Qt?.answer,Dt.answerOption);if(!(($t=Qt?.answer)!=null&&$t.length)||yn)return!0}if(Dt.item){for(const Qt of Dt.item)if(jt(Qt))return!0}return!1};for(const Dt of gt.item)if(jt(Dt))return!0;return!1},Ct=gt=>{var Jt,jt,Dt;if(gt.valueString!==void 0)return gt.valueString;if(gt.valueBoolean!==void 0)return gt.valueBoolean;if(gt.valueInteger!==void 0)return gt.valueInteger;if(gt.valueDecimal!==void 0)return gt.valueDecimal;if(gt.valueDate!==void 0)return gt.valueDate;if(gt.valueDateTime!==void 0)return gt.valueDateTime;if(((Jt=gt.valueCoding)==null?void 0:Jt.code)!==void 0)return gt.valueCoding.code;if(((jt=gt.valueReference)==null?void 0:jt.reference)!==void 0)return gt.valueReference.reference;if(((Dt=gt.valueQuantity)==null?void 0:Dt.value)!==void 0)return gt.valueQuantity.value;if(gt.valueAttachment!==void 0)return gt.valueAttachment},Ye=gt=>{const Jt={linkId:gt.linkId};if(gt.answer&&gt.answer.length>0){const jt=gt.answer.map(Dt=>Ct(Dt)).filter(Dt=>Dt!==void 0);jt.length>0&&(Jt.answer=jt)}if(gt.item&&gt.item.length>0){const jt=gt.item.map(Dt=>Ye(Dt)).filter(Dt=>{const $t=Object.keys(Dt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});jt.length>0&&(Jt.item=jt)}return Jt},Qe=(gt,Jt,jt,Dt,$t,Qt)=>{var yn;const zr=(yn=Jt?.item)==null?void 0:yn[jt[Dt]],qr=zr?.linkId;if(!qr)return!1;const Ln=K(gt,qr),Dn=K($t,qr),on=Mt=>{if(Mt!=null){if(Array.isArray(Mt)){const zt=Mt.filter(Yt=>Yt!=null).map(Yt=>on(Yt)).filter(Yt=>Yt!==void 0);return zt.length===0||zt.length===1&&typeof zt[0]=="object"&&Object.keys(zt[0]).length===0?void 0:zt}if(typeof Mt=="object"){const zt={};for(const[Yt,cn]of Object.entries(Mt))if(cn!=null){const an=on(cn);an!==void 0&&(zt[Yt]=an)}return Object.keys(zt).length===0?void 0:zt}return Mt}};if(Ln.length!==Dn.length)return!1;for(let Mt=0;Mt<Ln.length;Mt++){const zt=Ln[Mt],Yt=Dn[Mt];if(!zt||!Yt)return!1;const cn=Ye(on(zt)),an=Ye(on(Yt));if(!_.isEqual(cn,an))return!1}return Dt!==Qt},Lt=(gt,Jt,jt)=>jt&&jt.length>0&&!(jt.length===1&&Object.keys(jt[0]).length===0)&&ge(gt,Jt,jt)||null,mn=(gt,Jt)=>{const jt={},Dt=$t=>{$t.forEach(Qt=>{const yn=K(Jt,Qt.linkId);if(st(Qt,gt)||Qt.repeats)for(let zr=0;zr<yn.length;zr++){const qr=yn[zr];if(qr?.answer&&qr.answer.length>0){const Ln=Lt(Qt,Jt,qr.answer);Ln&&(jt[Qt.linkId]=b(f({},jt[Qt.linkId]),{[zr]:Ln}))}}else{const zr=F(Jt,Qt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Lt(Qt,Jt,zr.answer);qr&&(jt[Qt.linkId]={0:qr})}}Qt.item&&Qt.item.length>0&&Dt(Qt.item)})};return Dt(gt),jt},zn=gt=>{if(!gt)return"";const Jt=gt.split("-");if(Jt.length===3){const[jt,Dt,$t]=Jt;return`${jt.slice(-4)}-${Dt}-${$t}`}return""},et=gt=>gt.trim().replace(/[A-Za-z]+/g,""),Pt=(gt,Jt)=>{const jt=(Dt,$t)=>{for(const Qt of Dt){if(Qt.linkId===$t)return Qt.answer;if(Qt.item&&Qt.item.length>0){const yn=jt(Qt.item,$t);if(yn!==void 0)return yn}}};return jt(gt,Jt)},qt=(gt,Jt)=>{if(!Jt||Jt.length===0)return null;const jt=gt.linkId,Dt=($t,Qt,yn=[])=>{for(const zr of $t){const qr=[...yn,zr];if(zr.item){if(zr.item.some(on=>on.linkId===Qt))return qr.some(on=>on.repeats===!0)?zr:null;if(Dt(zr.item,Qt,qr))return zr}}return null};return Dt(Jt,jt)},Wn=(gt,Jt)=>{if(!Jt||Jt.length===0)return!1;const jt=gt.linkId,Dt=($t,Qt,yn=[])=>{for(const zr of $t){const qr=[...yn,zr];if(zr.item){if(zr.item.some(on=>on.linkId===Qt))return qr.some(on=>{const Mt=M(on.extension||[]);return!!Mt&&Mt!==UI_TOOLKIT_FORM_CONTAINER});if(Dt(zr.item,Qt,qr))return!0}}return!1};return Dt(Jt,jt)},yr=(gt,Jt,jt)=>{const Dt={};if(!gt)return Dt;const{linkId:$t}=Jt;if(gt[$t]){const Qt=gt[$t];Dt[$t]=Qt[jt]||""}return Jt.item&&Jt.item.length>0&&Jt.item.forEach(Qt=>{if(gt[Qt.linkId]){const yn=gt[Qt.linkId];Dt[Qt.linkId]=yn[jt]||""}}),Dt},gn=(gt,Jt)=>{const jt={};if(!gt||!gt[Jt])return jt;const Dt=gt[Jt];return jt[Jt]=Dt[0]||"",jt},In=gt=>{const Jt=gt.findIndex(Qt=>!Ee(Qt)),jt=Jt>=0?[Jt]:[],Dt=new Map;let $t=null;if(gt.forEach((Qt,yn)=>{const zr=ze(Qt);if(zr&&Qt.type==="group")yn!==Jt&&jt.push(yn),Dt.set(yn,[yn]),$t=yn;else if($t!==null&&!zr){const qr=Dt.get($t)||[];Dt.set($t,[...qr,yn])}}),gt.length>0&&jt.length>0){const Qt=jt[0];if(!Dt.has(Qt)){const yn=jt.find(qr=>qr>Qt),zr=[];for(let qr=Qt;qr<(yn??gt.length);qr++)zr.push(qr);Dt.set(Qt,zr)}}return{groupIndices:jt,itemsToRenderMap:Dt}},pr=(gt,Jt,jt,Dt)=>{let $t=[...Dt];const Qt=(yn,zr)=>{yn.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Et(zr,qr.linkId))if(qr.repeats){const Ln=zr.filter(Dn=>Dn.linkId===qr.linkId);Ln.length>0?Ln.forEach((Dn,on)=>{Xe(zr,qr.linkId,on)||($t=Rt(jt,$t,qr.linkId,qr.initial,void 0,on))}):$t=Rt(jt,$t,qr.linkId,qr.initial)}else $t=Rt(jt,$t,qr.linkId,qr.initial);qr.item&&Qt(qr.item,zr)})};return Qt(gt,Jt),$t},$n=(gt,Jt,jt)=>{if(!gt)return[];const Dt=[],$t=Qt=>{Qt.required===Jt&&te(Qt.enableWhen,Qt.enableBehavior,jt)&&!Ee(Qt)&&Qt.type!=="display"&&Dt.push(Qt),Qt.item&&Qt.item.length>0&&Qt.item.forEach($t)};return gt.forEach($t),Dt},Wr=(gt,Jt)=>gt.every(jt=>{var Dt;const $t=K(Jt,jt.linkId);if($t.length>0)return $t.every(Qt=>!ge(jt,Jt,Qt.answer));{const Qt=(Dt=F(Jt,jt.linkId))==null?void 0:Dt.answer;return!ge(jt,Jt,Qt)}}),Zr=(gt,Jt)=>{let jt=-1;for(let Dt=gt.length-1;Dt>=0;Dt--)if(gt[Dt].linkId===Jt){jt=Dt;break}return jt},Nt=(gt,Jt)=>gt.filter(jt=>jt.linkId!==Jt).map(jt=>jt.item&&jt.item.length>0?b(f({},jt),{item:Nt(jt.item,Jt)}):jt),$e=(gt,Jt,jt=gt)=>gt.reduce((Dt,$t)=>{const Qt=J(Jt,$t.linkId);return Qt?.enableWhen&&!te(Qt.enableWhen,Qt.enableBehavior,jt)||($t.item&&$t.item.length>0?Dt.push(b(f({},$t),{item:$e($t.item,Jt,jt)})):Dt.push($t)),Dt},[]),it=(gt,Jt,jt=[])=>{const Dt=[],$t=Qt=>{Qt.forEach(yn=>{Dt.push(yn.linkId),yn.item&&yn.item.length>0&&$t(yn.item)})};for(let Qt=0;Qt<gt.length;Qt++){const yn=gt[Qt];if(yn.linkId===Jt){const zr=gt.slice(0,Qt+1),qr=gt.slice(Qt+1),{kept:Ln,removed:Dn}=qr.reduce((on,Mt)=>{const zt=J(jt,Mt.linkId);return!zt||Ee(zt)&&te(zt.enableWhen,zt.enableBehavior,zr)?on.kept.push(Mt):on.removed.push(Mt),on},{kept:[],removed:[]});return $t(Dn),{trimmedData:[...zr,...Ln],trimmedLinkIds:Dt,found:!0}}if(yn.item&&yn.item.length>0){const zr=it(yn.item,Jt,jt);if(zr.found){const qr=gt.slice(0,Qt),Ln=gt.slice(Qt+1),Dn=[...qr,b(f({},yn),{item:zr.trimmedData})],{kept:on,removed:Mt}=Ln.reduce((zt,Yt)=>{const cn=J(jt,Yt.linkId);return!cn||Ee(cn)&&te(cn.enableWhen,cn.enableBehavior,Dn)?zt.kept.push(Yt):zt.removed.push(Yt),zt},{kept:[],removed:[]});return $t(Mt),{trimmedData:[...Dn,...on],trimmedLinkIds:[...zr.trimmedLinkIds,...Dt],found:!0}}}}return{trimmedData:gt,trimmedLinkIds:[],found:!1}},Je=(gt,Jt)=>gt.filter(jt=>!Jt.includes(jt.linkId)).map(jt=>jt.item&&jt.item.length>0?b(f({},jt),{item:Je(jt.item,Jt)}):jt),tt=gt=>{var Jt;if(!gt)return"empty";const jt=y.Z$.find(({patterns:Dt})=>Dt.some($t=>gt.includes($t)));return(Jt=jt?.type)!=null?Jt:"empty"},rt=(gt,Jt)=>{const{groupIndices:jt}=In(gt),Dt=gt.findIndex($t=>$t.linkId===Jt);return Dt!==-1?jt.indexOf(Dt):-1},ut=gt=>{if(!gt)return{restriction:null,warning:null};const Jt=jt=>{const Dt=gt.find(Qt=>Qt.url===jt&&Qt.valueString);if(!Dt?.valueString)return null;const $t=Dt.valueString.replace(/\\n/g,`
869
+ `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Kt,elementNameSuffix:Zt,version:Et,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In,pr;window.bwell||(window.bwell=new re({metadata:{version:Et}}));const $n=`bwell-${Zt}`;if(customElements.get($n)!==void 0)return;class Wr extends f{constructor(){super(),We.add(this),Ct.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Lt.set(this,new I.EventEmitter),mn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Pt.set(this,void 0),qt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const Nt=new be(ze).attachToShadowRoot(this.shadowRoot);Nt.addEventListener("visibilitychange",({visibility:$e,container:it,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(it),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Wn,{slots:Nt,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Lt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,We,"m",yr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,zn,(0,p.__classPrivateFieldGet)(this,We,"m",gn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",pr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Pt,(0,p.__classPrivateFieldGet)(this,We,"m",pr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Pt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,zn,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Pt,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ct,this.id||(0,p.__classPrivateFieldGet)(this,Ct,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ct,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(Nt=>this.dispatchEvent(Nt)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,mn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,mn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Kt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Nt;(0,p.__classPrivateFieldGet)(this,Lt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,zn,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Pt,"f")),(Nt=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||Nt===void 0||Nt.deregister(),(0,p.__classPrivateFieldGet)(this,Lt,"f").removeAllListeners()}}Ct=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Lt=new WeakMap,mn=new WeakMap,zn=new WeakMap,et=new WeakMap,Pt=new WeakMap,qt=new WeakMap,Wn=new WeakMap,We=new WeakSet,yr=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${$n}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Kt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ct,"f"),name:Zt,elementName:$n,utils:(0,p.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},gn=function({visibility:Nt,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=Nt==="hidden"?"unset":"hidden"},In=function(Nt){(0,p.__classPrivateFieldGet)(this,qt,"f")(),(0,p.__classPrivateFieldSet)(this,qt,void 0,"f")},pr=function(Nt){return $e=>{const it=Ie.findIndex(tt=>tt===Nt);if(!Ie.slice(0,it).some(tt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,qt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",In).call(this,Nt),(0,p.__classPrivateFieldSet)(this,qt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[Nt]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,qt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",In).call(this,Nt);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,qt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define($n,Wr)}),at={rE:"1.1124.0"},ht="composite";var Rt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${ht}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ht,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[de,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Zt=>{var Et,Xe;const We=(Xe=(Et=Zt.placeAutocomplete)==null?void 0:Et.predictions)==null?void 0:Xe.map(Ct=>{var Ye;return{id:Ct.placeId,label:(0,s.removeAfterLastComma)(Ct.description),mainText:Ct?.mainText||((Ye=Ct.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ct?.secondaryText||Ct.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Zt=>p(v({},Zt),{displayLabel:(0,r.RZ)(Zt?.label||"",V)})),[V,be]),ze=Zt=>h(void 0,null,function*(){var Et,Xe,We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In;if(F(Zt),G(Zt),ie(!1),Zt&&typeof Zt=="string"){const pr=be.find(tt=>tt.id===Zt),$n=pr?.label||V;if(!pr)return;q($n),k($n),setTimeout(()=>{const tt=[{id:pr.id,label:pr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Zt}}),Zr=(Xe=(Et=Wr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Nt=(Ct=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ct.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",it=((mn=(Lt=Wr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(zn=Wr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Zr&&Nt)if(!$e||!Je){const tt=yield de({variables:{latitude:String(Zr),longitude:String(Nt)}}),rt=((qt=(Pt=tt?.data)==null?void 0:Pt.geocodingByLatLon)==null?void 0:qt.zipCode)||"",ut=((yr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:yr.state)||"",St=((In=(gn=tt?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Zr,longitude:Nt,zipCode:rt,state:ut,stateCode:St,placeId:Zt,description:$n,value:Zt})}else T({latitude:Zr,longitude:Nt,zipCode:$e,state:it,stateCode:Je,placeId:Zt,description:$n,value:Zt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Zt=>h(void 0,null,function*(){return yield J({variables:{input:Zt,types:"geocode"}})})),_e=Zt=>h(void 0,null,function*(){if(ie(!1),q(Zt),z?.(Zt),!Zt||Zt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Zt});return}const Et=Zt.trim();Et.length>=2?yield xe(Et):Se(pe)}),at=Zt=>{te.current=Zt},ht=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Et,Xe,We,Ct,Ye,Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const pr=yield ae({variables:{placeId:N}}),$n=(Xe=(Et=pr?.data)==null?void 0:Et.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(Ct=(We=pr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ct.longitude,Zr=((Qe=(Ye=pr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",Nt=((mn=(Lt=pr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",$e=((et=(zn=pr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if($n&&Wr)if(!Zr||!Nt||!$e){const it=yield de({variables:{latitude:String($n),longitude:String(Wr)}}),Je=((qt=(Pt=it?.data)==null?void 0:Pt.geocodingByLatLon)==null?void 0:qt.zipCode)||"",tt=((yr=(Wn=it?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:yr.state)||"",rt=((In=(gn=it?.data)==null?void 0:gn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:$n,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:$n,longitude:Wr,zipCode:Zr,state:Nt,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const Rt=se||!!he||!!re||!!Ee||!!R,Kt=Rt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:ht,isInvalid:Rt,hint:Kt,autoComplete:"address-line1",className:"w-full",children:Zt=>{const Et=Zt,Xe=V.trim().length>=2,We=Et.mainText||"",Ct=Et.secondaryText||"",Ye=We.trim().length>0,Qe=Ct.trim().length>0,Lt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Qe?(0,r.RZ)(Ct,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:Et.id,supportingText:Et.supportingText,isDisabled:Et.isDisabled,icon:Et.icon,avatarUrl:Et.avatarUrl,textValue:Et.label,children:Xe&&Ye?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Et.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),de=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:de,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,de,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>Nt,GI:()=>K,rz:()=>Ct,Fp:()=>We,el:()=>Xe,ao:()=>Et,oA:()=>S,Yt:()=>$e,g4:()=>Zt,tn:()=>rt,n4:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Zr,Z$:()=>be,GT:()=>$n,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Pt,hZ:()=>zn,$e:()=>Ye,qT:()=>mn,GQ:()=>Lt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>bn,Z_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>Rt,WS:()=>ht,VF:()=>In,vf:()=>Wn,PV:()=>pr,PS:()=>qt,Iz:()=>gn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>de,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));p.displayName="CreditCard02";const h=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const b=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:xn=24,color:sr="currentColor",...It})=>t.createElement("svg",{viewBox:"0 0 24 24",width:xn,height:xn,stroke:sr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...It},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",de="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",ht="http://icanbwell.com/fhir/StructureDefinition/text-align",Rt={LEFT:"left",CENTER:"center"},Kt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Zt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Et="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Lt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",mn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",zn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",qt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",yr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",gn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",In="http://icanbwell.com/fhir/StructureDefinition/trigger-color",pr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",$n="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Zr="http://icanbwell.com/fhir/StructureDefinition/message-severity",Nt="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",it="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",ut="http://icanbwell.com/fhir/StructureDefinition/button-type",St="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Tt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Xt={},bn={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>zn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>Nt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>ut,iI:()=>q,lv:()=>w,mR:()=>Tt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(gt,Jt,jt)=>Jt in gt?A(gt,Jt,{enumerable:!0,configurable:!0,writable:!0,value:jt}):gt[Jt]=jt,f=(gt,Jt)=>{for(var jt in Jt||(Jt={}))v.call(Jt,jt)&&h(gt,jt,Jt[jt]);if(O)for(var jt of O(Jt))p.call(Jt,jt)&&h(gt,jt,Jt[jt]);return gt},b=(gt,Jt)=>m(gt,d(Jt));const M=gt=>{var Jt;return(Jt=gt.filter(jt=>jt.url.includes("questionnaire-itemControl")).flatMap(jt=>{var Dt,$t;return($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)!=null?$t:[]}).find(jt=>{var Dt;return(Dt=jt.code)==null?void 0:Dt.startsWith("ui-toolkit/")}))==null?void 0:Jt.code},x=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.V7);return jt?.valueCode||"off"},z=(gt,Jt,jt)=>{const Dt=(0,u.A)(jt);return gt&&Jt&&jt?Dt.replace("<p>",`<span>${Jt} `).replace("</p>","</span>").trim():Dt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=gt=>{const Jt=gt?.find(jt=>jt.url===y.Vp);return Jt?.valueInteger},S=gt=>{const Jt=gt?.find(jt=>jt.url===y.Z_);return Jt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(gt,Jt)=>{const jt=gt?.find(Dt=>Dt.url===PLACEHOLDER_EXTENSION_URL);return jt?.valueString||Jt&&E[Jt]||C},L=gt=>{const Jt=gt?.find(jt=>jt.url===HINT_TEXT_EXTENSION_URL);return Jt?.valueString},P=gt=>{const Jt=gt?.filter(jt=>jt.url===y.GT&&jt.valueCode).map(jt=>y.hr[jt.valueCode]||jt.valueCode);return Jt?.length?Jt.join(","):void 0},D=gt=>gt.split(",").map(Dt=>Dt.trim()).map(Dt=>y.JL[Dt]||Dt).filter((Dt,$t,Qt)=>Qt.indexOf(Dt)===$t).join(", "),N=(gt,Jt,jt)=>{const Dt=D(gt),$t=Dt.lastIndexOf(","),Qt=$t!==-1?`${Dt.substring(0,$t)} or${Dt.substring($t+1)}`:Dt,yn=[Jt&&`max. ${(Jt/(1e3*1e3)).toFixed(0)}MB`,jt&&`upto ${jt} file${jt>1?"s":""}`].filter(Boolean);return yn.length>0?`${Qt} (${yn.join(", ")})`:Qt},w=gt=>{const Jt=gt?.find(jt=>jt?.url===y.zD||jt?.url===y.UZ);return Jt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(gt,Jt)=>{var jt,Dt,$t;const Qt=Jt?.find(yn=>yn.url.includes(gt));return($t=(Dt=(jt=Qt?.valueInteger)!=null?jt:Qt?.valueDecimal)!=null?Dt:Qt?.valueString)!=null?$t:Qt?.valueDate},q=gt=>{if(!!gt){if(/^\d{4}-\d{2}-\d{2}$/.test(gt))return gt;try{const Jt=(0,o.evaluate)({},gt);if(Array.isArray(Jt)&&Jt.length>0){const jt=Jt[0];if(jt instanceof Date&&!isNaN(jt.getTime())){const Dt=jt.getFullYear(),$t=String(jt.getMonth()+1).padStart(2,"0"),Qt=String(jt.getDate()).padStart(2,"0");return`${Dt}-${$t}-${Qt}`}if(typeof jt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(jt))return jt}}catch{}}},I=(gt,Jt)=>{var jt,Dt;const $t=Jt?.find(yn=>yn.url===gt);if(!$t)return;const Qt=(jt=$t.valueString)!=null?jt:$t.valueDate;return Qt||q((Dt=$t.valueExpression)==null?void 0:Dt.expression)},k=(gt,Jt)=>{if(!(!gt||gt.length===0))for(const jt of gt){const Dt=V(Jt,jt.extension);if(Dt!==void 0)return Dt;if(jt.item&&jt.item.length>0){const $t=k(jt.item,Jt);if($t!==void 0)return $t}}},U=(gt,Jt)=>{try{const jt=String(gt??Jt);let Dt;if(jt.includes("/"))Dt=(0,n.A)(jt,"MM/dd/yyyy",new Date);else{const $t=jt.split("T")[0];Dt=(0,t.A)($t)}return(0,r.A)(Dt)}catch(jt){return console.error("Date parsing error:",jt,gt),null}},F=(gt,Jt)=>{var jt;for(const Dt of gt){if(Dt.linkId===Jt)return Dt;if((jt=Dt.item)!=null&&jt.length){const $t=F(Dt.item,Jt);if($t!==void 0)return $t}}},K=(gt,Jt)=>{var jt;const Dt=[];for(const $t of gt)if($t.linkId===Jt&&Dt.push($t),(jt=$t.item)!=null&&jt.length){const Qt=K($t.item,Jt);Dt.push(...Qt)}return Dt},G=(gt,Jt,jt=0)=>K(gt,Jt)[jt];function se(gt){return gt!=null}const ie=(gt,Jt)=>{var jt,Dt,$t;if("answerString"in gt&&se(gt.answerString)){if(gt.operator==="=")return Jt?.valueString===gt.answerString;if(gt.operator==="!=")return Jt?.valueString!==gt.answerString}if("answerBoolean"in gt&&se(gt.answerBoolean)){if(gt.operator==="=")return Jt?.valueBoolean===gt.answerBoolean;if(gt.operator==="!=")return Jt?.valueBoolean!==gt.answerBoolean}if("answerInteger"in gt&&se(gt.answerInteger)||"answerDecimal"in gt&&se(gt.answerDecimal)){const Qt=Number(Jt?.valueInteger||Jt?.valueDecimal),yn=Number(gt.answerInteger||gt.answerDecimal);if(gt.operator==="=")return Qt===yn;if(gt.operator==="!=")return Qt!==yn;if(gt.operator===">")return Qt>yn;if(gt.operator==="<")return Qt<yn;if(gt.operator===">=")return Qt>=yn;if(gt.operator==="<=")return Qt<=yn}if("answerQuantity"in gt&&se(gt.answerQuantity)){const Qt=Jt?.valueQuantity,yn=gt.answerQuantity;if(Qt?.unit!==yn?.unit)return!1;if(gt.operator==="=")return Qt.value===yn.value;if(gt.operator==="!=")return Qt.value!==yn.value;if(gt.operator===">")return Qt.value>yn.value;if(gt.operator==="<")return Qt.value<yn.value;if(gt.operator===">=")return Qt.value>=yn.value;if(gt.operator==="<=")return Qt.value<=yn.value}if("answerCoding"in gt&&se(gt.answerCoding)){const Qt=Jt?.valueCoding,yn=gt.answerCoding;if(gt.operator==="=")return Qt?.code===yn.code;if(gt.operator==="!=")return Qt?.code!==yn.code}if("answerReference"in gt&&se(gt.answerReference)){const Qt=Jt?.valueReference,yn=gt.answerReference;if(gt.operator==="=")return Qt?.reference===yn.reference;if(gt.operator==="!=")return Qt?.reference!==yn.reference}if("answerDate"in gt&&se(gt.answerDate)||"answerDateTime"in gt&&se(gt.answerDateTime)||"answerTime"in gt&&se(gt.answerTime)){const Qt=new Date(($t=(Dt=(jt=Jt?.valueDate)!=null?jt:Jt?.valueDateTime)!=null?Dt:Jt?.valueTime)!=null?$t:""),yn=new Date(gt.answerDate||gt.answerDateTime||gt.answerTime||"");if(gt.operator==="=")return Qt.getTime()===yn.getTime();if(gt.operator==="!=")return Qt.getTime()!==yn.getTime();if(gt.operator===">")return Qt.getTime()>yn.getTime();if(gt.operator==="<")return Qt.getTime()<yn.getTime();if(gt.operator===">=")return Qt.getTime()>=yn.getTime();if(gt.operator==="<=")return Qt.getTime()<=yn.getTime()}return gt.operator==="exists"?Jt!=null===gt.answerBoolean:!0},te=(gt,Jt,jt)=>{const Dt=$t=>{const Qt=K(jt,$t.question);return Qt.length===0||Qt.every(yn=>!yn.answer||yn.answer.length===0)?ie($t,void 0):Qt.some(yn=>{var zr;return(zr=yn.answer)==null?void 0:zr.some(qr=>ie($t,qr&&Object.keys(qr).length>0?qr:void 0))})};return gt&&gt?.length>0?Jt==="any"?gt?.some($t=>Dt($t)):gt?.every($t=>Dt($t)):!0},pe=(gt,Jt,jt,Dt,$t)=>{if(!gt||gt.length===0)return!0;const Qt=yn=>{var zr;let qr;if(Dt&&typeof $t=="number"){const Dn=jt.filter(on=>on.linkId===Dt)[$t];if(Dn?.item){const on=Dn.item.find(Mt=>Mt.linkId===yn.question);if(on?.answer&&on.answer.length>0)return(zr=on?.answer)==null?void 0:zr.some(Mt=>ie(yn,Mt&&Object.keys(Mt).length>0?Mt:void 0))}}if(!qr){const Ln=K(jt,yn.question);if(Ln.length>0)return Ln.some(Dn=>{var on;return(on=Dn.answer)==null?void 0:on.some(Mt=>ie(yn,Mt&&Object.keys(Mt).length>0?Mt:void 0))});qr=void 0}return ie(yn,qr)};return Jt==="any"?gt.some(yn=>Qt(yn)):gt.every(yn=>Qt(yn))},be=(gt,Jt)=>{var jt;if(!!((jt=gt?.valueExpression)!=null&&jt.expression))try{const Dt=evaluate(Jt,gt.valueExpression.expression);return Array.isArray(Dt)?Dt.some($t=>Boolean($t)):Boolean(Dt)}catch{return}},Se=(gt,Jt)=>{var jt;const Dt=(jt=gt.extension)==null?void 0:jt.find(Qt=>Qt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Dt,Jt);return b(f({},gt),{readOnly:$t??gt.readOnly})},ge=(gt,Jt,jt)=>{const{required:Dt,maxLength:$t,type:Qt,extension:yn,enableWhen:zr,enableBehavior:qr,repeats:Ln,answerOption:Dn}=gt;if(!te(zr,qr,Jt)||gt.type==="group"||gt.type==="display")return"";if(Ln)return ne(gt,Jt,jt);const on=de(gt,Jt);return on&&ue(on,gt)?re(gt,Jt,jt,on):he(yn,Qt,Dt,$t,jt,Dn)},ne=(gt,Jt,jt)=>{const{required:Dt}=gt;if(Dt){if(!jt||jt.length===0)return"At least one item is required";let $t=!1;for(let Qt=0;Qt<jt.length;Qt++){const yn=jt[Qt];if(yn&&Object.keys(yn).length>0&&Object.values(yn).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){$t=!0;const qr=he(gt.extension,gt.type,!0,gt.maxLength,[yn],gt.answerOption);if(qr)return`Item ${Qt+1}: ${qr}`;if(gt.item&&gt.item.length>0){const Ln=ae(gt.item,Jt,gt.linkId,Qt);if(Ln)return`Item ${Qt+1}: ${Ln}`}}else return`Item ${Qt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(jt&&jt.length>0)for(let $t=0;$t<jt.length;$t++){const Qt=jt[$t];if(Qt&&Object.keys(Qt).length>0&&Object.values(Qt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(gt.extension,gt.type,!1,gt.maxLength,[Qt],gt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(gt.item&&gt.item.length>0){const qr=ae(gt.item,Jt,gt.linkId,$t);if(qr)return`Item ${$t+1}: ${qr}`}}}return""},ae=(gt,Jt,jt,Dt)=>{var $t,Qt;for(const yn of gt){if(!pe(yn.enableWhen,yn.enableBehavior,Jt,jt,Dt))continue;const zr=F(Jt,jt),qr=($t=zr?.item)==null?void 0:$t.find(Dn=>Dn.linkId===yn.linkId),Ln=(Qt=qr?.answer)!=null&&Qt[Dt]?[qr.answer[Dt]]:void 0;if(yn.required){if(!Ln||!Ln[0]||!me(Ln[0]))return`${yn.text||yn.linkId} is required`;const Dn=he(yn.extension,yn.type,!0,yn.maxLength,Ln,yn.answerOption);if(Dn)return`${yn.text||yn.linkId}: ${Dn}`}else if(Ln&&Ln[0]&&me(Ln[0])){const Dn=he(yn.extension,yn.type,!1,yn.maxLength,Ln,yn.answerOption);if(Dn)return`${yn.text||yn.linkId}: ${Dn}`}if(yn.item&&yn.item.length>0){const Dn=ae(yn.item,Jt,yn.linkId,Dt);if(Dn)return Dn}}return""},me=gt=>!gt||Object.keys(gt).length===0?!1:Object.values(gt).some(Jt=>Jt!=null&&Jt!==""&&(Array.isArray(Jt)?Jt.length>0:!0)),he=(gt,Jt,jt,Dt,$t,Qt)=>{var yn,zr,qr,Ln,Dn;let on="";const Mt=!!gt?.find(Sn=>{var Kn,wr;return Sn.url===y.gD&&((wr=(Kn=Sn.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),zt=$t?.[0],Yt={choice:((yn=zt?.valueCoding)==null?void 0:yn.code)||(zt?.valueString&&Qt?.some(Sn=>Sn.valueString===zt.valueString)?zt.valueString:null),"open-choice":((zr=zt?.valueCoding)==null?void 0:zr.code)||zt?.valueString,boolean:zt?.valueBoolean,string:zt?.valueString,text:zt?.valueString,url:zt?.valueUri,integer:zt?.valueInteger,decimal:zt?.valueDecimal,dateTime:zt?.valueDateTime,date:zt?.valueDate,time:zt?.valueTime,quantity:(qr=zt?.valueQuantity)==null?void 0:qr.value,reference:(Ln=zt?.valueReference)==null?void 0:Ln.display,attachment:(Dn=zt?.valueAttachment)==null?void 0:Dn.title};if(!(Jt in Yt))return"";const cn=Yt[Jt],an={required:()=>jt&&(cn==null||cn===""||cn==="NaN"||Number.isNaN(cn)||Jt==="boolean"&&cn!==!0&&Mt)?"This field is required":"",maxLength:()=>Dt&&cn!==null&&cn!==void 0&&cn.toString().length>Dt?`Input should not exceed ${Dt} characters`:"",minLength:()=>{const Sn=V("minLength",gt);return Sn&&cn!==null&&cn!==void 0&&cn.toString().length<Number(Sn)?`Input should be at least ${Sn} characters`:""},urlRegex:()=>{const Sn=new RegExp(y.rx),Kn=V("regexError",gt),wr=Kn??"Please enter a valid url starting from http:// and https://";return Sn&&Jt==="url"&&cn&&!Sn.test(cn)?String(wr):""},regex:()=>{const Sn=V("regex",gt);if(!Sn||typeof cn!="string")return"";const Kn=new RegExp(Sn),wr=V("regexError",gt),$r=wr??"Please enter a valid input";return Kn&&cn&&!Kn.test(cn)?String($r):""},dateTime:()=>{if(Jt==="dateTime"&&cn){const Sn=cn?.toString(),Kn=new Date(Sn);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Jt!=="date"||!cn)return"";const Sn=cn.replace(/\D/g,"");return Sn.length>0&&Sn.length<8||isNaN(new Date(cn).getTime())?"Invalid date":""},minValue:()=>{var Sn;if(Jt==="date"){const wr=I(y.dU,gt),$r=U(wr??"01/01/1900","01/01/1900"),Xr=U(cn,"");if(!$r||!Xr)return"";if((0,s.A)(Xr,$r)){const c0=(Sn=gt?.find(Pi=>Pi.url===y.Ck))==null?void 0:Sn.valueString;return c0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Kn=V("minValue",gt);return Kn!=null&&cn!==null&&cn!==void 0&&cn<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var Sn;if(Jt==="date"){const wr=I(y.bK,gt),$r=U(wr??"01/01/2100","01/01/2100"),Xr=U(cn,"");if(!$r||!Xr)return"";if((0,i.A)(Xr,$r)){const c0=(Sn=gt?.find(Pi=>Pi.url===y.Cx))==null?void 0:Sn.valueString;return c0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Kn=V("maxValue",gt);return Kn!=null&&cn!==null&&cn!==void 0&&cn>Kn?`Input should not exceed ${Kn}`:""}};return on=an.required()||an.maxLength()||an.minLength()||an.urlRegex()||an.regex()||an.dateTime()||an.date()||an.minValue()||an.maxValue()||"",on},de=(gt,Jt)=>{for(const jt of Jt)if(jt.item){if(jt.item.find(Qt=>Qt.linkId===gt.linkId))return jt;const $t=de(gt,jt.item);if($t)return $t}return null},ue=(gt,Jt)=>{if(gt.answer&&gt.answer.length>1)return!0;if(gt.item){const jt=gt.item.find(Dt=>Dt.linkId===Jt.linkId);if(jt&&jt.answer&&jt.answer.length>1)return!0}return!1},re=(gt,Jt,jt,Dt)=>{var $t,Qt;const{required:yn}=gt,zr=($t=Dt.item)==null?void 0:$t.find(Dn=>Dn.linkId===gt.linkId),qr=zr?.answer||[],Ln=((Qt=Dt.answer)==null?void 0:Qt.length)||1;for(let Dn=0;Dn<Ln;Dn++){const on=qr[Dn];if(yn){if(!on||!me(on))return`Item ${Dn+1}: ${gt.text||gt.linkId} is required`;const Mt=he(gt.extension,gt.type,!0,gt.maxLength,[on],gt.answerOption);if(Mt)return`Item ${Dn+1}: ${Mt}`}else if(on&&me(on)){const Mt=he(gt.extension,gt.type,!1,gt.maxLength,[on],gt.answerOption);if(Mt)return`Item ${Dn+1}: ${Mt}`}}return""},J=(gt,Jt)=>{for(const jt of gt){if(jt?.linkId===Jt)return jt;if(jt?.item&&jt.item.length>0){const Dt=J(jt.item,Jt);if(Dt)return Dt}}},ve=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===FOOTER_CODE))}))},Ee=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>jt.url===y.oA&&jt.valueBoolean))},De=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===HEADER_CODE))}))},ze=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===y.gD&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===y.n4&&Qt.code===y._l))}))},Ie=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>jt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&jt.valueBoolean))},xe=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>{var Dt,$t;return jt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Dt=jt.valueCodeableConcept)==null?void 0:Dt.coding)==null?void 0:$t.some(Qt=>Qt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Qt.code===CHECKBOX_CODE))}))},_e=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.fe);return jt?.valueInteger},at=gt=>{var Jt;const jt=(Jt=gt.extension)==null?void 0:Jt.find(Dt=>Dt.url===y.zO);return jt?.valueInteger},ht=gt=>{var Jt;const jt=(Jt=gt?.extension)==null?void 0:Jt.find(Dt=>Dt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return jt?.valueInteger},Rt=(gt,Jt,jt,Dt,$t,Qt)=>{const yn=qr=>Jt.filter(Ln=>Ln.linkId===qr),zr=new Set;return gt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Dn=yn(qr.linkId),on=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),on){const Mt=[];if(Dn.forEach((zt,Yt)=>{const cn={linkId:qr.linkId,text:qr.text};let an;if(jt===qr.linkId&&typeof Qt=="number"&&Qt===Yt&&$t&&$t.length>0){const Sn=zt?.item||[];an=[...Sn],$t.forEach(Kn=>{const wr=an.findIndex($r=>$r.linkId===Kn.linkId);wr>=0?an[wr]=b(f({},Sn[wr]),{answer:Kn.answer}):an.push(Kn)})}else qr.item&&(an=Rt(qr.item,zt?.item||[],jt,Dt,$t,Yt));jt===qr.linkId&&typeof Qt=="number"&&Qt===Yt&&Dt?cn.answer=Dt:cn.answer=zt.answer||[{}],an&&an.length>0?cn.item=an:zt.item&&(cn.item=zt.item),Mt.push(cn)}),jt===qr.linkId&&typeof Qt=="number"&&Qt>=Dn.length)for(let zt=Dn.length;zt<=Qt;zt++){const Yt={linkId:qr.linkId,text:qr.text,answer:zt===Qt&&Dt?Dt:[{}]};zt===Qt&&$t&&$t.length>0?Yt.item=$t:qr.item&&(Yt.item=Rt(qr.item,[],void 0,void 0,void 0,void 0)),Mt.push(Yt)}return Mt}else if(qr.repeats&&typeof Qt=="number"&&jt===qr.linkId){const Mt=Dn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},zt={linkId:qr.linkId,text:qr.text,answer:[...Mt.answer||[]]};if(Dt&&Dt.length>0){for(;zt.answer.length<=Qt;)zt.answer.push({});zt.answer[Qt]=Dt[0]}return zt}else{const Mt=Dn[0],zt=qr.item?Rt(qr.item,Mt?.item||[],jt,Dt,$t,Qt):void 0,Yt=zt&&zt.length>0,cn={linkId:qr.linkId,text:qr.text};return jt&&qr.linkId===jt&&typeof Qt!="number"?(Dt||!Dt&&!$t?cn.answer=Dt:Mt?.answer&&(cn.answer=Mt.answer),$t?cn.item=$t:Yt&&(cn.item=zt)):(Mt?.answer?cn.answer=Mt.answer:cn.answer=[{}],Yt&&(cn.item=zt)),cn}}).filter(Boolean).flat()},Kt=(gt,Jt)=>{for(const jt of gt)if(jt.linkId===Jt||jt.item&&Kt(jt.item,Jt))return jt.linkId;return null},Zt=(gt,Jt,jt,Dt)=>{var $t;const Qt=($t=gt?.item)!=null?$t:Dt;return!Qt||Qt.length===0?!0:Qt.every(yn=>{var zr;const qr=K(Jt,yn.linkId);if(qr.length===0){const Ln=(zr=F(Jt,yn.linkId))==null?void 0:zr.answer;if(ge(yn,Jt,Ln)&&te(yn.enableWhen,yn.enableBehavior,Jt)&&jt.includes(yn.linkId))return!1}else for(const Ln of qr)if(ge(yn,Jt,Ln.answer)&&te(yn.enableWhen,yn.enableBehavior,Jt)&&jt.includes(yn.linkId))return!1;return yn.item?Zt(yn,Jt,jt):!0})},Et=(gt,Jt,jt=!0)=>{for(const Dt of gt)if(Dt.linkId===Jt&&Dt.answer&&Dt.answer.length>0||Dt.item&&Dt.item.length>0&&Et(Dt.item,Jt,jt))return!0;return!1},Xe=(gt,Jt,jt=0)=>{const Dt=gt.filter($t=>$t.linkId===Jt);if(Dt.length>jt){const $t=Dt[jt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Qt=>Qt&&Object.keys(Qt).length>0&&Object.values(Qt).some(yn=>yn!=null&&yn!==""));if($t.item&&$t.item.length>0)return Et($t.item,Jt,!1)}return Et(gt,Jt,!1)},We=(gt,Jt)=>{if(!gt||!gt.item)return!1;const jt=Dt=>{var $t;if(Ee(Dt)&&Dt.required&&te(Dt.enableWhen,Dt.enableBehavior,Jt)){const Qt=F(Jt,Dt.linkId),yn=he(Dt.extension,Dt.type,Dt.required,Dt.maxLength,Qt?.answer,Dt.answerOption);if(!(($t=Qt?.answer)!=null&&$t.length)||yn)return!0}if(Dt.item){for(const Qt of Dt.item)if(jt(Qt))return!0}return!1};for(const Dt of gt.item)if(jt(Dt))return!0;return!1},Ct=gt=>{var Jt,jt,Dt;if(gt.valueString!==void 0)return gt.valueString;if(gt.valueBoolean!==void 0)return gt.valueBoolean;if(gt.valueInteger!==void 0)return gt.valueInteger;if(gt.valueDecimal!==void 0)return gt.valueDecimal;if(gt.valueDate!==void 0)return gt.valueDate;if(gt.valueDateTime!==void 0)return gt.valueDateTime;if(((Jt=gt.valueCoding)==null?void 0:Jt.code)!==void 0)return gt.valueCoding.code;if(((jt=gt.valueReference)==null?void 0:jt.reference)!==void 0)return gt.valueReference.reference;if(((Dt=gt.valueQuantity)==null?void 0:Dt.value)!==void 0)return gt.valueQuantity.value;if(gt.valueAttachment!==void 0)return gt.valueAttachment},Ye=gt=>{const Jt={linkId:gt.linkId};if(gt.answer&&gt.answer.length>0){const jt=gt.answer.map(Dt=>Ct(Dt)).filter(Dt=>Dt!==void 0);jt.length>0&&(Jt.answer=jt)}if(gt.item&&gt.item.length>0){const jt=gt.item.map(Dt=>Ye(Dt)).filter(Dt=>{const $t=Object.keys(Dt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});jt.length>0&&(Jt.item=jt)}return Jt},Qe=(gt,Jt,jt,Dt,$t,Qt)=>{var yn;const zr=(yn=Jt?.item)==null?void 0:yn[jt[Dt]],qr=zr?.linkId;if(!qr)return!1;const Ln=K(gt,qr),Dn=K($t,qr),on=Mt=>{if(Mt!=null){if(Array.isArray(Mt)){const zt=Mt.filter(Yt=>Yt!=null).map(Yt=>on(Yt)).filter(Yt=>Yt!==void 0);return zt.length===0||zt.length===1&&typeof zt[0]=="object"&&Object.keys(zt[0]).length===0?void 0:zt}if(typeof Mt=="object"){const zt={};for(const[Yt,cn]of Object.entries(Mt))if(cn!=null){const an=on(cn);an!==void 0&&(zt[Yt]=an)}return Object.keys(zt).length===0?void 0:zt}return Mt}};if(Ln.length!==Dn.length)return!1;for(let Mt=0;Mt<Ln.length;Mt++){const zt=Ln[Mt],Yt=Dn[Mt];if(!zt||!Yt)return!1;const cn=Ye(on(zt)),an=Ye(on(Yt));if(!_.isEqual(cn,an))return!1}return Dt!==Qt},Lt=(gt,Jt,jt)=>jt&&jt.length>0&&!(jt.length===1&&Object.keys(jt[0]).length===0)&&ge(gt,Jt,jt)||null,mn=(gt,Jt)=>{const jt={},Dt=$t=>{$t.forEach(Qt=>{const yn=K(Jt,Qt.linkId);if(st(Qt,gt)||Qt.repeats)for(let zr=0;zr<yn.length;zr++){const qr=yn[zr];if(qr?.answer&&qr.answer.length>0){const Ln=Lt(Qt,Jt,qr.answer);Ln&&(jt[Qt.linkId]=b(f({},jt[Qt.linkId]),{[zr]:Ln}))}}else{const zr=F(Jt,Qt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Lt(Qt,Jt,zr.answer);qr&&(jt[Qt.linkId]={0:qr})}}Qt.item&&Qt.item.length>0&&Dt(Qt.item)})};return Dt(gt),jt},zn=gt=>{if(!gt)return"";const Jt=gt.split("-");if(Jt.length===3){const[jt,Dt,$t]=Jt;return`${jt.slice(-4)}-${Dt}-${$t}`}return""},et=gt=>gt.trim().replace(/[A-Za-z]+/g,""),Pt=(gt,Jt)=>{const jt=(Dt,$t)=>{for(const Qt of Dt){if(Qt.linkId===$t)return Qt.answer;if(Qt.item&&Qt.item.length>0){const yn=jt(Qt.item,$t);if(yn!==void 0)return yn}}};return jt(gt,Jt)},qt=(gt,Jt)=>{if(!Jt||Jt.length===0)return null;const jt=gt.linkId,Dt=($t,Qt,yn=[])=>{for(const zr of $t){const qr=[...yn,zr];if(zr.item){if(zr.item.some(on=>on.linkId===Qt))return qr.some(on=>on.repeats===!0)?zr:null;if(Dt(zr.item,Qt,qr))return zr}}return null};return Dt(Jt,jt)},Wn=(gt,Jt)=>{if(!Jt||Jt.length===0)return!1;const jt=gt.linkId,Dt=($t,Qt,yn=[])=>{for(const zr of $t){const qr=[...yn,zr];if(zr.item){if(zr.item.some(on=>on.linkId===Qt))return qr.some(on=>{const Mt=M(on.extension||[]);return!!Mt&&Mt!==UI_TOOLKIT_FORM_CONTAINER});if(Dt(zr.item,Qt,qr))return!0}}return!1};return Dt(Jt,jt)},yr=(gt,Jt,jt)=>{const Dt={};if(!gt)return Dt;const{linkId:$t}=Jt;if(gt[$t]){const Qt=gt[$t];Dt[$t]=Qt[jt]||""}return Jt.item&&Jt.item.length>0&&Jt.item.forEach(Qt=>{if(gt[Qt.linkId]){const yn=gt[Qt.linkId];Dt[Qt.linkId]=yn[jt]||""}}),Dt},gn=(gt,Jt)=>{const jt={};if(!gt||!gt[Jt])return jt;const Dt=gt[Jt];return jt[Jt]=Dt[0]||"",jt},In=gt=>{const Jt=gt.findIndex(Qt=>!Ee(Qt)),jt=Jt>=0?[Jt]:[],Dt=new Map;let $t=null;if(gt.forEach((Qt,yn)=>{const zr=ze(Qt);if(zr&&Qt.type==="group")yn!==Jt&&jt.push(yn),Dt.set(yn,[yn]),$t=yn;else if($t!==null&&!zr){const qr=Dt.get($t)||[];Dt.set($t,[...qr,yn])}}),gt.length>0&&jt.length>0){const Qt=jt[0];if(!Dt.has(Qt)){const yn=jt.find(qr=>qr>Qt),zr=[];for(let qr=Qt;qr<(yn??gt.length);qr++)zr.push(qr);Dt.set(Qt,zr)}}return{groupIndices:jt,itemsToRenderMap:Dt}},pr=(gt,Jt,jt,Dt)=>{let $t=[...Dt];const Qt=(yn,zr)=>{yn.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Et(zr,qr.linkId))if(qr.repeats){const Ln=zr.filter(Dn=>Dn.linkId===qr.linkId);Ln.length>0?Ln.forEach((Dn,on)=>{Xe(zr,qr.linkId,on)||($t=Rt(jt,$t,qr.linkId,qr.initial,void 0,on))}):$t=Rt(jt,$t,qr.linkId,qr.initial)}else $t=Rt(jt,$t,qr.linkId,qr.initial);qr.item&&Qt(qr.item,zr)})};return Qt(gt,Jt),$t},$n=(gt,Jt,jt)=>{if(!gt)return[];const Dt=[],$t=Qt=>{Qt.required===Jt&&te(Qt.enableWhen,Qt.enableBehavior,jt)&&!Ee(Qt)&&Qt.type!=="display"&&Dt.push(Qt),Qt.item&&Qt.item.length>0&&Qt.item.forEach($t)};return gt.forEach($t),Dt},Wr=(gt,Jt)=>gt.every(jt=>{var Dt;const $t=K(Jt,jt.linkId);if($t.length>0)return $t.every(Qt=>!ge(jt,Jt,Qt.answer));{const Qt=(Dt=F(Jt,jt.linkId))==null?void 0:Dt.answer;return!ge(jt,Jt,Qt)}}),Zr=(gt,Jt)=>{let jt=-1;for(let Dt=gt.length-1;Dt>=0;Dt--)if(gt[Dt].linkId===Jt){jt=Dt;break}return jt},Nt=(gt,Jt)=>gt.filter(jt=>jt.linkId!==Jt).map(jt=>jt.item&&jt.item.length>0?b(f({},jt),{item:Nt(jt.item,Jt)}):jt),$e=(gt,Jt,jt=gt)=>gt.reduce((Dt,$t)=>{const Qt=J(Jt,$t.linkId);return Qt?.enableWhen&&!te(Qt.enableWhen,Qt.enableBehavior,jt)||($t.item&&$t.item.length>0?Dt.push(b(f({},$t),{item:$e($t.item,Jt,jt)})):Dt.push($t)),Dt},[]),it=(gt,Jt,jt=[])=>{const Dt=[],$t=Qt=>{Qt.forEach(yn=>{Dt.push(yn.linkId),yn.item&&yn.item.length>0&&$t(yn.item)})};for(let Qt=0;Qt<gt.length;Qt++){const yn=gt[Qt];if(yn.linkId===Jt){const zr=gt.slice(0,Qt+1),qr=gt.slice(Qt+1),{kept:Ln,removed:Dn}=qr.reduce((on,Mt)=>{const zt=J(jt,Mt.linkId);return!zt||Ee(zt)&&te(zt.enableWhen,zt.enableBehavior,zr)?on.kept.push(Mt):on.removed.push(Mt),on},{kept:[],removed:[]});return $t(Dn),{trimmedData:[...zr,...Ln],trimmedLinkIds:Dt,found:!0}}if(yn.item&&yn.item.length>0){const zr=it(yn.item,Jt,jt);if(zr.found){const qr=gt.slice(0,Qt),Ln=gt.slice(Qt+1),Dn=[...qr,b(f({},yn),{item:zr.trimmedData})],{kept:on,removed:Mt}=Ln.reduce((zt,Yt)=>{const cn=J(jt,Yt.linkId);return!cn||Ee(cn)&&te(cn.enableWhen,cn.enableBehavior,Dn)?zt.kept.push(Yt):zt.removed.push(Yt),zt},{kept:[],removed:[]});return $t(Mt),{trimmedData:[...Dn,...on],trimmedLinkIds:[...zr.trimmedLinkIds,...Dt],found:!0}}}}return{trimmedData:gt,trimmedLinkIds:[],found:!1}},Je=(gt,Jt)=>gt.filter(jt=>!Jt.includes(jt.linkId)).map(jt=>jt.item&&jt.item.length>0?b(f({},jt),{item:Je(jt.item,Jt)}):jt),tt=gt=>{var Jt;if(!gt)return"empty";const jt=y.Z$.find(({patterns:Dt})=>Dt.some($t=>gt.includes($t)));return(Jt=jt?.type)!=null?Jt:"empty"},rt=(gt,Jt)=>{const{groupIndices:jt}=In(gt),Dt=gt.findIndex($t=>$t.linkId===Jt);return Dt!==-1?jt.indexOf(Dt):-1},ut=gt=>{if(!gt)return{restriction:null,warning:null};const Jt=jt=>{const Dt=gt.find(Qt=>Qt.url===jt&&Qt.valueString);if(!Dt?.valueString)return null;const $t=Dt.valueString.replace(/\\n/g,`
870
870
  `).split(`
871
871
  `).map(Qt=>Qt.trim()).filter(Boolean).map(Qt=>Qt.startsWith("*")?Qt.substring(1).trim():Qt);return $t.length===0?null:$t.length===1?{isList:!1,items:$t}:{isList:!0,items:$t}};return{restriction:Jt("restriction"),warning:Jt("warning")}},St=(gt,Jt)=>{var jt;switch(Jt.type){case"boolean-to-string":return typeof gt=="boolean"?gt?Jt.trueValue:Jt.falseValue:gt;case"map":return Jt.mapping&&gt in Jt.mapping?Jt.mapping[gt]:gt;case"date-format":return gt;case"number-format":if(typeof gt=="number"){let Dt=gt.toFixed((jt=Jt.decimals)!=null?jt:0);return Jt.prefix&&(Dt=Jt.prefix+Dt),Jt.suffix&&(Dt=Dt+Jt.suffix),Dt}return gt;case"passthrough":default:return gt}},st=(gt,Jt)=>{const jt=gt.linkId,Dt=(Qt,yn,zr=[])=>{for(const qr of Qt){const Ln=[...zr,qr];if(qr.item){if(qr.item.some(Mt=>Mt.linkId===yn))return Ln.filter(Mt=>Mt.repeats===!0);const on=Dt(qr.item,yn,Ln);if(on.length>0)return on}}return[]},$t=Dt(Jt,jt);return $t.length>0?$t[$t.length-1]:null},le=(gt,Jt)=>{if(!gt?.item)return[];const jt=[];for(const Dt of gt.item){if(Dt.type!=="group")continue;te(Dt.enableWhen,Dt.enableBehavior,Jt||[])&&Dt.linkId&&jt.push(Dt.linkId)}return jt},ye=(gt,Jt)=>{const jt=le(gt,Jt||void 0);return jt[jt.length-1]},Ue=({questionnaire:gt,extensionUrl:Jt,errorCode:jt})=>{if(!jt||!gt?.item)return;const Dt=gt.item.find($t=>{var Qt;return(Qt=$t.extension)==null?void 0:Qt.some(yn=>yn.url===Jt&&yn.valueString===jt)});return Dt?.linkId},Te=(gt,Jt)=>{var jt;const Dt=(jt=gt.extension)==null?void 0:jt.find(Qt=>Qt.url===y.rb);if(!Dt?.valueString)return;const $t=Dt.valueString;return J(Jt,$t)},Tt=gt=>{var Jt;return!!((Jt=gt.extension)!=null&&Jt.find(jt=>jt.url===y.rb))},Xt=(gt,Jt)=>gt.filter(jt=>jt.linkId!==Jt).map(jt=>jt.item&&jt.item.length>0?b(f({},jt),{item:Xt(jt.item,Jt)}):jt),bn=gt=>{const Jt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,gt.extension);return Jt??k(gt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},xn=gt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,gt.extension),sr=gt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,gt.extension),It=gt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,gt.extension),we=gt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,gt),Ze=(gt,Jt)=>{var jt,Dt,$t;if(!gt.answerOption)return;const Qt=F(Jt,gt.linkId),yn=($t=(Dt=(jt=Qt?.answer)==null?void 0:jt[0])==null?void 0:Dt.valueCoding)==null?void 0:$t.code;if(!yn)return;const zr=gt.answerOption.find(qr=>{var Ln;return((Ln=qr.valueCoding)==null?void 0:Ln.code)===yn});if(!!zr)return we(zr.extension)},yt=(gt,Jt)=>{const jt={},Dt=$t=>{if(!!$t)for(const Qt of $t){const yn=It(Qt);if(yn){let zr;switch(Qt.type){case"choice":zr=Ze(Qt,Jt);break;default:break}zr&&(jt[yn]=zr)}Qt.item&&Qt.item.length>0&&Dt(Qt.item)}};return Dt(gt.item),jt},tn=gt=>!!(gt.initial&&gt.initial.length>0),rn=(gt,Jt,jt)=>{if(!gt)return[];const Dt=[],$t=Qt=>{Qt.forEach(yn=>{if(jt&&jt.includes(yn.linkId))return;const zr=Ee(yn),qr=Jt.includes(yn.linkId);(qr||zr&&yn.required)&&Dt.push(yn),qr&&yn.item&&yn.item.length>0&&$t(yn.item)})};return $t(gt),Dt},pn=(gt,Jt,jt,Dt,$t,Qt)=>{var yn;if(jt<0||!Dt?.item)return!0;const zr=$t.current[jt],qr=jt+1,Ln=$t.current[qr],Dn=jt===0?0:zr,on=Ln??Dt.item.length,Mt=[];for(let Sn=Dn;Sn<on;Sn++){const Kn=(yn=Dt?.item)==null?void 0:yn[Sn];if(Kn){if(Qt&&Qt.includes(Kn.linkId))continue;const wr=Ee(Kn);(Jt.includes(Kn.linkId)||wr&&Kn.required)&&Mt.push(Kn),Kn.item&&Kn.item.length>0&&Mt.push(...rn(Kn.item,Jt,Qt))}}const zt=Mt.filter(Sn=>Sn.required===!0),Yt=Mt.filter(Sn=>Sn.required!==!0),cn=Wr(zt,gt),an=Yt?.every(Sn=>{var Kn;const wr=(Kn=F(gt,Sn.linkId))==null?void 0:Kn.answer;return wr?!ge(Sn,gt,wr):!0});return!zt?.length||cn&&an}},28058:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),i=e(76260),o=e(25624);const a=({item:fr})=>{const n0=fr.text||"",Fr=fr.extension||[],Vi=$o=>{var Ro;return(Ro=Fr.find(Oo=>Oo.url===$o))==null?void 0:Ro.valueString},fo=Vi(i.$7),Ao=Vi(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:n0,description:fo??"",color:Ao})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(fr,n0,Fr)=>n0 in fr?u(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,O=(fr,n0)=>{for(var Fr in n0||(n0={}))A.call(n0,Fr)&&d(fr,Fr,n0[Fr]);if(y)for(var Fr of y(n0))m.call(n0,Fr)&&d(fr,Fr,n0[Fr]);return fr};const v=({item:fr})=>{const[n0,Fr]=(0,t.useState)(!1),Vi=fr.extension||[],fo=nr=>{var vn;return(vn=Vi.find(kn=>kn.url===nr))==null?void 0:vn.valueString},Ao=fo(i.PS)||fr.text||"",$o=fo(i.Iz)||"button",Ro=fo(i.VF),Oo=fo(i.PV),zo=fo(i.vf),po=zo?i.JP[zo]:void 0,Cr=fo(i.D_)||"",Qn=fo(i.$e),Tr=fo(i.GQ),Le=fo(i.qT)||"gray",Ce=fo(i.hZ),Fe=fo(i.wG),mt=fo(i.q3),Ut=Tr?i.JP[Tr]:void 0,nn=()=>Fr(!0),wn=()=>{switch($o){case"icon-button":return(0,n.jsxs)("button",{onClick:nn,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Ao||Cr||void 0,children:[po&&(0,n.jsx)(po,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Ao&&(0,n.jsx)("span",{className:"text-sm",children:Ao})]});default:return(0,n.jsx)(r.Button,{color:Ro??"secondary",size:Oo??"md",iconLeading:po,onClick:nn,"aria-label":Ao,children:Ao})}};return(0,n.jsxs)(n.Fragment,{children:[wn(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${fr.linkId}`,isOpen:n0,onOpenChange:Fr,title:{content:Cr},description:{content:Qn?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(Qn)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Ut?{featuredIcon:{icon:Ut,color:Le,size:"lg",className:"bg-white"}}:{}),Ce?{primaryButton:{children:Ce,onClick:()=>{var nr,vn;Fe==="open-zendesk"&&((vn=(nr=globalThis.zE)==null?void 0:nr.activate)==null||vn.call(nr,{hideOnClose:!0})),Fr(!1)}}}:{}),mt?{secondaryButton:{children:mt,onClick:()=>Fr(!1)}}:{}))]})};var p=e(18522);const h=({item:fr})=>{var n0,Fr,Vi,fo,Ao,$o,Ro,Oo,zo,po,Cr,Qn;const{hasExternalError:Tr}=(0,p.c)(),Le=fr.text||"",Ce=(Fr=(n0=fr.extension)==null?void 0:n0.find(Vr=>Vr.url===i.ao))==null?void 0:Fr.valueString,Fe=Tr&&Ce?Ce:Le,mt=(fo=(Vi=fr.extension)==null?void 0:Vi.find(Vr=>Vr.url===i.$7))==null?void 0:fo.valueString,Ut=($o=(Ao=fr.extension)==null?void 0:Ao.find(Vr=>Vr.url===i.el))==null?void 0:$o.valueString,nn=Tr&&Ut?Ut:mt,wn=(Oo=(Ro=fr.extension)==null?void 0:Ro.find(Vr=>Vr.url===i.g4))==null?void 0:Oo.valueString,nr=(po=(zo=fr.extension)==null?void 0:zo.find(Vr=>Vr.url===i.Fp))==null?void 0:po.valueString,vn=wn?i.JP[wn]:void 0,kn=nr?i.JP[nr]:void 0,dn=Tr&&kn?kn:vn,cr=((Qn=(Cr=fr.extension)==null?void 0:Cr.find(Vr=>Vr.url===i.WS))==null?void 0:Qn.valueString)===i._W.LEFT,Ir=cr?"items-start":"items-center",e0=cr?"text-left":"text-center",M0=cr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-4`,children:[dn&&(0,n.jsx)(r.FeaturedIcon,{icon:dn,color:Tr&&kn?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${e0} ${M0} md:max-w-[352px]`,children:Fe}),(0,n.jsx)("p",{className:`text-md text-secondary ${e0}`,children:nn})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(fr,n0,Fr)=>n0 in fr?M(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,E=(fr,n0)=>{for(var Fr in n0||(n0={}))z.call(n0,Fr)&&S(fr,Fr,n0[Fr]);if(x)for(var Fr of x(n0))T.call(n0,Fr)&&S(fr,Fr,n0[Fr]);return fr};const C=({item:fr})=>{const[n0,Fr]=(0,t.useState)(!1),Vi=(0,b.T$)(),fo=fr.extension||[],Ao=Ce=>{var Fe;return(Fe=fo.find(mt=>mt.url===Ce))==null?void 0:Fe.valueString},$o=fr.text||"",Ro=Ao(i.PS)||"",Oo=Ao(i.D_)||"",zo=Ao(i.$e),po=Ao(i.GQ),Cr=Ao(i.qT)||"gray",Qn=Ao(i.hZ),Tr=Ao(i.q3),Le=po?i.JP[po]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(f.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:$o})]}),Ro&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Fr(!0),children:Ro})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${fr.linkId}`,isOpen:n0,onOpenChange:Fr,title:{content:Oo},description:{content:zo?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(zo)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Le?{featuredIcon:{icon:Le,color:Cr,size:"lg",className:"bg-white"}}:{}),Qn?{primaryButton:{children:Qn,onClick:()=>{Fr(!1),Vi.navigate({id:"profile"})}}}:{}),Tr?{secondaryButton:{children:Tr,onClick:()=>Fr(!1)}}:{}))]})},R=({item:fr,selectedAnswer:n0,handleInputChange:Fr})=>{var Vi,fo,Ao;const $o=(Vi=fr.answerOption)!=null?Vi:[],Ro=(Ao=(fo=n0?.[0])==null?void 0:fo.valueCoding)==null?void 0:Ao.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:$o.map(Oo=>{var zo,po,Cr,Qn,Tr,Le,Ce;const Fe=(po=(zo=Oo.valueCoding)==null?void 0:zo.code)!=null?po:"",mt=(Qn=(Cr=Oo.valueCoding)==null?void 0:Cr.display)!=null?Qn:"",Ut=Ro===Fe,nn=(Tr=Oo.extension)==null?void 0:Tr.find(kn=>kn.url===i.g4),wn=(Le=Oo.extension)==null?void 0:Le.find(kn=>kn.url===i.rz),nr=nn?.valueString?i.JP[nn.valueString]:void 0,vn=(Ce=wn?.valueString)!=null?Ce:"";return(0,n.jsx)(r.SelectableOption,{icon:nr,title:mt,description:vn,isSelected:Ut,onSelect:()=>{Fr(fr,[{valueCoding:{code:Fe,display:mt}}])}},Fe)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:fr,isLabel:n0,required:Fr,className:Vi,id:fo})=>(0,n.jsxs)("p",{id:fo,className:Vi??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(n0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(fr||"")}}),Fr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(fr,n0)=>{const Fr=fr.replace(/\D/g,"");let Vi="",fo=0;for(let Ao=0;Ao<n0.length&&fo<Fr.length;Ao++)n0[Ao]==="#"?(Vi+=Fr[fo],fo++):Vi+=n0[Ao];return Vi},q=fr=>{if(!fr)return w;const n0=fr.find(Fr=>Fr.url===i.Md);return n0?.valueString||w},I=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{var Ro;const{linkId:Oo,text:zo,required:po,prefix:Cr,readOnly:Qn,extension:Tr}=fr,Le=q(Tr),Ce=((Ro=Fr?.[0])==null?void 0:Ro.valueString)||"",[Fe,mt]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Ce){const vn=V(Ce,Le);mt(vn)}},[Ce,Le]);const Ut=zo?(0,o.nt)(fo,Cr,zo):"",nn=Ao?.[Oo]||"",wn=vn=>{const kn=V(vn,Le);mt(kn),Vi(fr,[{valueString:kn}])},nr=()=>{n0&&n0(Oo)};return(0,n.jsxs)("div",{"data-testid":Oo,children:[Ut&&(0,n.jsx)(N,{isLabel:!0,text:Ut,required:po||!1}),(0,n.jsx)(r.Input,{id:Oo,"aria-label":Oo,"data-testid":Oo,type:"tel",placeholder:"Enter phone number",value:Fe,onChange:wn,onBlur:nr,isDisabled:Qn||$o,isRequired:po,hint:nn,isInvalid:!!nn,size:"md"},Oo)]})},k=({item:fr,questionnaireSchemaItems:n0})=>{var Fr;const{isLoading:Vi,setCurrentGroupIndex:fo}=(0,p.c)(),Ao=(Fr=fr.extension)==null?void 0:Fr.find(zo=>zo.url===i.Uf),$o=Ao?.valueString,Ro=fr.text||"Save & continue",Oo=()=>{if($o){const zo=(0,o.Ue)(n0||[],$o);zo!==-1&&fo(zo)}};return(0,n.jsx)("div",{"data-testid":fr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Vi,onClick:Oo,isDisabled:fr.readOnly,children:Ro})})},U=({size:fr=24,color:n0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:n0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M10 16h4m-5.2 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V6.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 2 16.88 2 15.2 2H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 22 7.12 22 8.8 22ZM15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));U.displayName="Passport";var F=e(56327);const K=({size:fr=24,color:n0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:n0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));K.displayName="UserCircle";var G=e(14711);const se=({size:fr=24,color:n0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:n0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));se.displayName="Mail01";var ie=e(31165),te=e(14449),pe=e(27163);const be=fr=>{try{const n0=fr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!n0)return fr;const[,Fr,Vi,fo]=n0;return new Date(Date.UTC(parseInt(Fr),parseInt(Vi)-1,parseInt(fo))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return fr}},Se=fr=>{try{if(fr.includes("AM")||fr.includes("PM"))return fr;const n0=fr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!n0)return fr;const[,Fr,Vi]=n0,fo=parseInt(Fr),Ao=fo>=12?"PM":"AM";return`${fo%12||12}:${Vi} ${Ao}`}catch{return fr}},ge=(fr,n0,Fr=f.d)=>{var Vi;const fo=(Vi=fr.extension)==null?void 0:Vi.find(Ao=>Ao.url===i.g4);return fo?.valueString&&i.JP[fo.valueString]?i.JP[fo.valueString]:fr.linkId&&n0[fr.linkId]?n0[fr.linkId]:Fr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":ie.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],he=["appointment-review/facility-phone"],de=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:fr,questionnaireSchemaItems:n0})=>{var Fr;const{setCurrentGroupIndex:Vi}=(0,p.c)(),{trackEvent:fo}=(0,s.st)(),Ao=fr.item||[];if(Ao.length===0)return null;const $o=(Fr=fr.extension)==null?void 0:Fr.find(po=>po.url===i.Uf),Ro=$o?.valueString,Oo=()=>{if(fo("edit_info_clicked",{section:fr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Ro){const po=(0,o.Ue)(n0||[],Ro);po!==-1&&Vi(po)}},zo=Ao.map(po=>{let Cr="";if(po.initial&&po.initial.length>0){const Le=po.initial.map(Ce=>{var Fe,mt;let Ut=((Fe=Ce.valueCoding)==null?void 0:Fe.display)||((mt=Ce.valueReference)==null?void 0:mt.display)||Ce.valueString||"";return Ut&&typeof Ut=="string"&&(ae.includes(po.linkId)?Ut=be(Ut):me.includes(po.linkId)&&(Ut=Se(Ut))),Ut}).filter(Boolean);Le.length>1||po.repeats&&Le.length>0?Cr=Le:Le.length===1&&(Cr=Le[0])}if(!Cr||Array.isArray(Cr)&&Cr.length===0)return null;let Qn;he.includes(po.linkId)?Qn="phone":de.includes(po.linkId)&&(Qn="address");let Tr;return ue.includes(po.linkId)&&(Tr="phone"),{Icon:ge(po,ne),label:po.text||po.linkId,value:Cr,linkType:Qn,displayType:Tr}}).filter(Boolean);return zo.length===0?null:(0,n.jsx)("div",{"data-testid":fr.linkId,children:(0,n.jsx)(pe.InfoCard,{title:fr.text||"Details",infoDetails:zo,actionButtonText:Ro&&"Edit info",onActionButtonClick:Ro?Oo:void 0})})},J=({size:fr=24,color:n0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:n0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));J.displayName="AlertTriangle";var ve=e(18807);const Ee=({item:fr})=>{const{setHideFooterButton:n0,incrementCustomErrorCount:Fr,decrementCustomErrorCount:Vi}=(0,p.c)();return(0,t.useEffect)(()=>(n0(!0),Fr(),()=>{n0(!1),Vi()}),[n0,Fr,Vi]),(0,n.jsx)("div",{"data-testid":fr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(r.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ve.p)(fr.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},ze=({item:fr})=>{var n0,Fr,Vi,fo;const{incrementCustomErrorCount:Ao,decrementCustomErrorCount:$o,setHideFooterButton:Ro}=(0,p.c)(),[Oo,zo]=(0,t.useState)(!1),po=(n0=fr.extension)==null?void 0:n0.find(Fe=>Fe.url===i.gi),Cr=(Vi=(Fr=po?.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:Vi.find(Fe=>Fe.system===i.tn),Qn=Cr?.code||"error",Tr=De[Qn]||"error";(0,t.useEffect)(()=>{if(Tr==="error")return Ao(),Ro(!0),zo(!0),()=>{$o(),Ro(!1)};zo(!0)},[Tr,Ao,$o,Ro]);const Le=Cr?.display||"Error",Ce=(fo=fr.text)!=null?fo:"";return Oo?(0,n.jsx)("div",{"data-testid":fr.linkId,children:(0,n.jsx)(r.InfoBanner,{type:Tr,title:Le,description:Ce})}):null};var Ie=e(65735);const xe=({configKey:fr,customErrorConfigurations:n0})=>{if(!n0)return null;const Fr=n0[fr];if(!Fr)return null;const{icon:Vi,title:fo,description:Ao,primaryButton:$o,secondaryButton:Ro}=Fr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:fo,description:Ao,featuredIconProps:{icon:Vi,color:"gray"},primaryButton:$o,secondaryButton:Ro})},_e=10,at=({item:fr,customErrorConfigurations:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{var Ro,Oo,zo,po;const{trackEvent:Cr}=(0,s.st)(),{setHideFooterButton:Qn}=(0,p.c)(),{linkId:Tr,text:Le,required:Ce,answerOption:Fe,prefix:mt,readOnly:Ut}=fr,nn=fr?.type==="reference",wn=(Ro=Fr?.map(qn=>{var Hr,u0;return nn?(Hr=qn.valueReference)==null?void 0:Hr.display:(u0=qn.valueCoding)==null?void 0:u0.code}).filter(qn=>qn!==void 0))!=null?Ro:[],[nr,vn]=(0,t.useState)(wn.length),kn=Le?(0,o.nt)(fo,mt,Le):"",dn=(zo=(Oo=fr.extension)==null?void 0:Oo.find(qn=>qn.url===i.Z_))==null?void 0:zo.valueInteger,cr=(po=Fe?.map(qn=>{var Hr,u0,ai,E0;return{value:nn?((Hr=qn.valueReference)==null?void 0:Hr.display)||"":((u0=qn.valueCoding)==null?void 0:u0.code)||"",label:nn?((ai=qn.valueReference)==null?void 0:ai.display)||"":((E0=qn.valueCoding)==null?void 0:E0.display)||"",valueReference:qn.valueReference}}))!=null?po:[],Ir=Ao?.[Tr],e0=cr.length>_e,M0=e0?cr.slice(0,_e):cr,Vr=e0?cr.slice(_e):[],y0=Vr.some(qn=>wn?.includes(qn?.value)),[ci,ct]=(0,t.useState)(y0);if(!(fr.answerOption&&fr.answerOption.length>0))return Qn(!0),(0,n.jsx)(xe,{configKey:fr.linkId,customErrorConfigurations:n0});const An=cr.filter(qn=>wn?.includes(qn?.value)).map(qn=>{var Hr;const{restriction:u0,warning:ai}=nn?(0,o.eC)((Hr=qn.valueReference)==null?void 0:Hr.extension):{restriction:null,warning:null};return{label:qn.label,restriction:u0,warning:ai}}).filter(qn=>qn.restriction||qn.warning),jn=(qn,Hr)=>{var u0;Cr("vaccine_type_checkbox_selected",{on_or_off:qn?"on":"off",vaccine:Hr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let ai;if(qn){const E0=cr.find(Z0=>Z0.value===Hr);ai=[...(u0=Fr?.filter(Z0=>Object.keys(Z0).length!==0))!=null?u0:[],nn?{valueReference:E0?.valueReference}:{valueCoding:{code:Hr,display:E0?.label}}],vn(Z0=>Z0+1)}else ai=Fr?.filter(E0=>{var Z0,Li;return nn?((Z0=E0.valueReference)==null?void 0:Z0.display)!==Hr:((Li=E0.valueCoding)==null?void 0:Li.code)!==Hr})||[{}],vn(E0=>E0-1);Vi&&Vi(fr,ai)};return(0,n.jsxs)("div",{"data-testid":Tr,children:[kn&&(0,n.jsx)(N,{text:kn,required:Ce||!1}),e0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:M0.map((qn,Hr)=>{const u0=wn?.includes(qn?.value),ai=!u0&&dn?nr>=dn:!1;return(0,n.jsx)("div",{className:Hr!==M0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":qn.value,id:Hr.toString(),name:qn.label,isInvalid:!!Ir,isSelected:u0,label:qn.label,onChange:E0=>jn(E0,qn.value),isDisabled:Ut||$o||ai})},Hr)})}),e0&&!ci&&!y0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{ct(!0),Cr("see_all_vaccines_clicked",{_event_metadata:{description:"A user clicked the see all link on the vaccine type page."}})},color:"link-color",size:"sm",isDisabled:Ut||$o,children:"See all"})}),e0&&ci&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),e0&&ci&&(0,n.jsx)("div",{children:Vr.map((qn,Hr)=>{const u0=wn?.includes(qn?.value),ai=!u0&&dn?nr>=dn:!1;return(0,n.jsx)("div",{className:Hr!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":qn.value,id:(_e+Hr).toString(),name:qn.label,isInvalid:!!Ir,isSelected:u0,label:qn.label,onChange:E0=>jn(E0,qn.value),isDisabled:Ut||$o||ai})},_e+Hr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Ir,children:Ir}),An.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:An.map((qn,Hr)=>(0,n.jsxs)("div",{children:[qn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${qn.label}`,description:qn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:qn.restriction.items.map((u0,ai)=>(0,n.jsx)("li",{className:"text-sm",children:u0},ai))}):(0,n.jsx)("p",{className:"text-sm",children:qn.restriction.items[0]})}),qn.warning&&(0,n.jsx)("div",{className:qn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${qn.label}`,description:qn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:qn.warning.items.map((u0,ai)=>(0,n.jsx)("li",{className:"text-sm",children:u0},ai))}):(0,n.jsx)("p",{className:"text-sm",children:qn.warning.items[0]})})})]},Hr))})]})};var ht=e(76323),Rt=e(56192),Kt=e(66267),Zt=Object.defineProperty,Et=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,Ct=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Qe=(fr,n0,Fr)=>n0 in fr?Zt(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,Lt=(fr,n0)=>{for(var Fr in n0||(n0={}))Ct.call(n0,Fr)&&Qe(fr,Fr,n0[Fr]);if(We)for(var Fr of We(n0))Ye.call(n0,Fr)&&Qe(fr,Fr,n0[Fr]);return fr},mn=(fr,n0)=>Et(fr,Xe(n0)),zn=(fr,n0,Fr)=>new Promise((Vi,fo)=>{var Ao=Oo=>{try{Ro(Fr.next(Oo))}catch(zo){fo(zo)}},$o=Oo=>{try{Ro(Fr.throw(Oo))}catch(zo){fo(zo)}},Ro=Oo=>Oo.done?Vi(Oo.value):Promise.resolve(Oo.value).then(Ao,$o);Ro((Fr=Fr.apply(fr,n0)).next())});const et=({item:fr,handleInputChange:n0,onCompleteHandler:Fr,errors:Vi})=>{const{i18n:{t:fo},loading:Ao}=(0,Kt.E_)({keys:["shared-translations"]}),{trackEvent:$o}=(0,s.st)(),{linkId:Ro,required:Oo,readOnly:zo}=fr,po=Vi?.[Ro]||"",[Cr,Qn]=(0,t.useState)(ht.LocationType.CURRENT_LOCATION),[Tr,Le]=(0,t.useState)(""),Ce=(0,t.useRef)({}),[Fe,mt]=(0,t.useState)([{id:ht.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ut,setIsLoading:nn,setIsCurrentFormValid:wn,isCurrentFormValid:nr}=(0,p.c)(),{position:vn,loading:kn,locationPermission:dn}=(0,ht.useDeviceLocationContext)(),{queryParams:cr,setQueryParams:Ir}=(0,ht.useSearchQueryParams)(),[e0,{loading:M0}]=(0,Rt.qtq)({fetchPolicy:"cache-first"}),[Vr,{loading:y0}]=(0,Rt.YyG)({fetchPolicy:"cache-first"}),ci=fr.item?(0,o.Yo)(fr.item,"postal-code"):void 0,ct=fr.item?(0,o.Yo)(fr.item,"state"):void 0,_t=fr.item?(0,o.Yo)(fr.item,"latitude"):void 0,An=fr.item?(0,o.Yo)(fr.item,"longitude"):void 0,jn=j0=>{if(!j0||!ci)return Le(""),!1;const Ei=(0,o.zj)(ci.extension,ci.type,!1,ci.maxLength,[{valueString:j0}]);return Ei?(Le(Cr!==ht.LocationType.ZIP_CODE?fo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ei),!1):(Le(""),!0)},qn=()=>{const{latitude:j0,longitude:Ei,state:X0,zipcode:b0}=Ce.current;return!!(j0&&Ei&&X0&&b0)},Hr=(0,t.useCallback)(j0=>{Ce.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},fr.item&&(ct&&n0(ct,[{valueString:""}]),_t&&n0(_t,[{valueDecimal:void 0}]),An&&n0(An,[{valueDecimal:void 0}]),ci&&n0(ci,[{valueString:""}])),Ir({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:j0,locationPermission:dn}),wn&&wn(!1),Le("")},[n0,fr.item,_t,dn,An,wn,Ir,ct,ci]);(0,t.useEffect)(()=>{if(!Oo)return;!qn()&&wn&&wn(!1)},[nr,Oo,wn]);const u0=j0=>{Ce.current=Lt(Lt({},Ce.current),j0),j0.addressDescription&&$o("address_selected",{value:j0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),Z0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,Ce.current.zipcode,Ce.current.placeId,Ce.current.addressDescription)},ai=j0=>zn(void 0,null,function*(){var Ei,X0,b0;if(Le(""),Ce.current.zipcode=j0,wn&&wn(!1),jn(j0)){$o("zip_code_entered",{value:j0,_event_metadata:{description:"A user entered a zip code."}});const vi=yield Vr({variables:{location:j0}}),H0=(Ei=vi?.data)==null?void 0:Ei.geocoding,Io=vi?.error;if(H0){const Ii=H0.stateCode||"",yo=(X0=H0.latitude)!=null?X0:void 0,ga=(b0=H0.longitude)!=null?b0:void 0;u0({latitude:yo,longitude:ga,state:Ii,zipcode:j0,placeId:void 0,addressDescription:void 0})}else Io&&(u0({latitude:void 0,longitude:void 0,state:void 0,zipcode:j0,placeId:void 0,addressDescription:void 0}),Le(fo("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else Z0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,j0)}),E0=()=>{const j0=Ce.current.zipcode||"";!j0||Cr!==ht.LocationType.ZIP_CODE||jn(j0)};(0,t.useEffect)(()=>{cr.locationType&&(Qn(cr.locationType),cr.locationType===ht.LocationType.ZIP_CODE&&cr.zipCode&&ai(cr.zipCode),cr.locationType===ht.LocationType.ADDRESS&&cr.placeId&&cr.addressDescription&&(Ce.current.addressDescription=cr.addressDescription,Ce.current.placeId=cr.placeId))},[]),(0,t.useEffect)(()=>{const j0=[ht.LocationPermissionEnum.DENIED,ht.LocationPermissionEnum.UNAVAILABLE,ht.LocationPermissionEnum.BLOCKED].includes(cr.locationPermission),Ei=[ht.LocationPermissionEnum.GRANTED,ht.LocationPermissionEnum.PROMPT].includes(cr.locationPermission);if(j0&&Fe.length!==2){if(mt([{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}]),Cr===ht.LocationType.CURRENT_LOCATION||!cr.locationType||cr.locationType===""){const X0=cr.locationType===ht.LocationType.ZIP_CODE?ht.LocationType.ZIP_CODE:ht.LocationType.ADDRESS;Qn(X0),Ir(mn(Lt({},cr),{locationType:X0})),Hr(X0)}Le("")}Ei&&Fe.length!==3&&mt([{id:ht.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}])},[Cr,dn,Fe.length,cr,Ir,Hr]);const Z0=(j0,Ei,X0,b0,vi,H0)=>{if(!fr.item)return;ct&&n0(ct,[{valueString:X0||""}]),_t&&n0(_t,[{valueDecimal:j0}]),An&&n0(An,[{valueDecimal:Ei}]),ci&&n0(ci,[{valueString:b0||""}]),Ir(mn(Lt({},cr),{lat:String(j0),lng:String(Ei),location:`${j0},${Ei}`,zipCode:b0||"",placeId:vi||"",addressDescription:H0||"",locationPermission:dn}));const Io=qn()&&jn(b0||"");wn&&wn(Io),Fr&&Fr(Ro)};(0,t.useEffect)(()=>{const j0=()=>zn(void 0,null,function*(){var Ei;try{const X0=yield e0({variables:{latitude:String(vn?.coords.latitude),longitude:String(vn?.coords.longitude)}}),b0=(Ei=X0?.data)==null?void 0:Ei.geocodingByLatLon,vi=b0?.stateCode||"",H0=b0?.zipCode||"";(!H0||!vi)&&Le(fo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),u0({latitude:vn?.coords.latitude,longitude:vn?.coords.longitude,state:vi,zipcode:H0,placeId:void 0,addressDescription:void 0})}catch{Qn(ht.LocationType.ADDRESS)}});Cr===ht.LocationType.CURRENT_LOCATION&&vn&&j0()},[Cr,vn]);const Li=j0=>{if(!j0||!j0.latitude||!j0.longitude||!j0.zipCode||!j0.stateCode){u0({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),j0&&typeof j0.value=="string"&&j0.value.trim().length!==0&&Le(fo("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}u0({latitude:j0.latitude,longitude:j0.longitude,state:j0.stateCode,zipcode:j0.zipCode,placeId:j0.placeId,addressDescription:j0.description})};return(0,t.useEffect)(()=>{nn(kn||M0||y0||Ao)},[kn,M0,y0,Ao,nn]),(0,t.useEffect)(()=>{cr.locationType!==Cr&&Ir(mn(Lt({},cr),{locationType:Cr}))},[Cr]),(0,n.jsxs)("div",{"data-testid":fr.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Oo||!1}),(0,n.jsx)(r.Select,{id:Ro,"aria-label":Ro,"data-testid":Ro,isDisabled:zo||M0||y0||Ut,selectedKey:Cr,onSelectionChange:j0=>{var Ei;$o("location_type_input_selected",{choice:(Ei=Fe.find(({id:X0})=>X0===j0))==null?void 0:Ei.label,_event_metadata:{description:"A user changed the location type input."}}),j0!==Cr&&(Hr(j0),Qn(j0))},hint:po,isInvalid:!!po,items:Fe,placeholder:"Select an option",isRequired:Oo,children:j0=>(0,n.jsx)(r.Select.Item,{id:j0.id,"data-testid":j0.id,value:j0,children:j0.label},j0.id)},Ro),Cr===ht.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!Tr,children:Tr}),Cr===ht.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Oo||!1}),(0,n.jsx)(ht.AddressTypeahead,{onValueChange:Li,isDisabled:Ut,setIsLoading:nn,initialValue:{placeId:Ce.current.placeId||"",description:Ce.current.addressDescription||""},errorText:Tr||po})]}),Cr===ht.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:Oo||!1}),(0,n.jsx)(r.Input,{isRequired:Oo,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Ro}-zipcode`,placeholder:"Type your response here...",value:Ce.current.zipcode||"",onChange:ai,onBlur:E0,isDisabled:zo||y0||Ut,hint:Tr||po,isInvalid:!!Tr||!!po,autoComplete:"postal-code"},`${Ro}-zipcode`)]})]})},Pt=fr=>(0,n.jsx)(ht.DeviceLocationProvider,{children:(0,n.jsx)(et,Lt({},fr))}),qt={[i.cX]:Pt,[i.G6]:re,[i.c3]:at,[i.AA]:ze,[i.mO]:h,[i.PM]:k,[i.HH]:I,[i.Us]:Ee,[i.Tl]:R,[i.G0]:v,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v,[i.it]:Ie.d};var Wn,yr=new Uint8Array(16);function gn(){if(!Wn&&(Wn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Wn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Wn(yr)}const In=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function pr(fr){return typeof fr=="string"&&In.test(fr)}const $n=pr;for(var Wr=[],Zr=0;Zr<256;++Zr)Wr.push((Zr+256).toString(16).substr(1));function Nt(fr){var n0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Fr=(Wr[fr[n0+0]]+Wr[fr[n0+1]]+Wr[fr[n0+2]]+Wr[fr[n0+3]]+"-"+Wr[fr[n0+4]]+Wr[fr[n0+5]]+"-"+Wr[fr[n0+6]]+Wr[fr[n0+7]]+"-"+Wr[fr[n0+8]]+Wr[fr[n0+9]]+"-"+Wr[fr[n0+10]]+Wr[fr[n0+11]]+Wr[fr[n0+12]]+Wr[fr[n0+13]]+Wr[fr[n0+14]]+Wr[fr[n0+15]]).toLowerCase();if(!$n(Fr))throw TypeError("Stringified UUID is invalid");return Fr}const $e=Nt;function it(fr,n0,Fr){fr=fr||{};var Vi=fr.random||(fr.rng||gn)();if(Vi[6]=Vi[6]&15|64,Vi[8]=Vi[8]&63|128,n0){Fr=Fr||0;for(var fo=0;fo<16;++fo)n0[Fr+fo]=Vi[fo];return n0}return $e(Vi)}const Je=it,tt=(fr,n0="application/octet-stream")=>{try{const Fr=window.atob(fr),Vi=new Uint8Array(Fr.length);for(let Ao=0;Ao<Fr.length;Ao++)Vi[Ao]=Fr.charCodeAt(Ao);return new Blob([Vi],{type:n0}).size}catch{return 0}},rt=(fr,n0)=>`data:${n0};base64,${fr}`,ut=(fr,n0,Fr=512)=>{const Vi=window.atob(fr),fo=[];for(let $o=0;$o<Vi.length;$o+=Fr){const Ro=Vi.slice($o,$o+Fr),Oo=new Array(Ro.length);for(let po=0;po<Ro.length;po++)Oo[po]=Ro.charCodeAt(po);const zo=new Uint8Array(Oo);fo.push(zo)}const Ao=new Blob(fo,{type:n0});return URL.createObjectURL(Ao)},St=fr=>{const n0=new Date().toISOString().replace(/[:.-]/g,"");return`${fr.split(" ").join("-")}_${n0}`},st=4e3,le=.8,ye=(fr,n0)=>{var Fr,Vi;const fo=(Fr=n0?.maxDimension)!=null?Fr:st,Ao=(Vi=n0?.quality)!=null?Vi:le;return new Promise(($o,Ro)=>{if(!fr.type.startsWith("image/")){$o(fr);return}if(fr.type==="image/heic"||fr.type==="image/heif"||fr.name.toLowerCase().endsWith(".heic")||fr.name.toLowerCase().endsWith(".heif")){$o(fr);return}const zo=new Image,po=new FileReader;po.onload=()=>{const Cr=po.result;zo.onload=()=>{let{width:Qn,height:Tr}=zo;if(Qn>fo||Tr>fo){const Ut=fo/Math.max(Qn,Tr);Qn=Math.round(Qn*Ut),Tr=Math.round(Tr*Ut)}const Le=document.createElement("canvas");Le.width=Qn,Le.height=Tr;const Ce=Le.getContext("2d");if(!Ce){$o(fr);return}Ce.drawImage(zo,0,0,Qn,Tr);const Fe=fr.type==="image/png"?"image/png":"image/jpeg",mt=fr.type==="image/png"?void 0:Ao;Le.toBlob(Ut=>{if(!Ut||Ut.size>=fr.size){$o(fr);return}$o(new File([Ut],fr.name,{type:Fe}))},Fe,mt)},zo.onerror=()=>{Ro(new Error(`Failed to load image: ${fr.name}`))},zo.src=Cr},po.onerror=()=>{Ro(new Error(`Failed to read file: ${fr.name}`))},po.readAsDataURL(fr)})},Ue=50,Te=(fr,n0=Ue)=>{if(fr.length<=n0)return fr;const Fr=fr.lastIndexOf("."),Vi=Fr!==-1?fr.slice(Fr):"",fo=Fr!==-1?fr.slice(0,Fr):fr,Ao=n0-Vi.length-1,$o=Math.ceil(Ao/2),Ro=Math.floor(Ao/2);return`${fo.slice(0,$o)}\u2026${fo.slice(-Ro)}${Vi}`};var Tt=Object.defineProperty,Xt=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,xn=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,It=Object.prototype.propertyIsEnumerable,we=(fr,n0,Fr)=>n0 in fr?Tt(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,Ze=(fr,n0)=>{for(var Fr in n0||(n0={}))sr.call(n0,Fr)&&we(fr,Fr,n0[Fr]);if(xn)for(var Fr of xn(n0))It.call(n0,Fr)&&we(fr,Fr,n0[Fr]);return fr},yt=(fr,n0)=>Xt(fr,bn(n0)),tn=(fr,n0,Fr)=>new Promise((Vi,fo)=>{var Ao=Oo=>{try{Ro(Fr.next(Oo))}catch(zo){fo(zo)}},$o=Oo=>{try{Ro(Fr.throw(Oo))}catch(zo){fo(zo)}},Ro=Oo=>Oo.done?Vi(Oo.value):Promise.resolve(Oo.value).then(Ao,$o);Ro((Fr=Fr.apply(fr,n0)).next())});const rn=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{const{linkId:Ro,text:Oo,required:zo,prefix:po,readOnly:Cr,repeats:Qn,extension:Tr}=fr,Le=(0,o.Qr)(Tr),Ce=(0,o.cz)(Tr),Fe=(0,o.$H)(Tr)||"image/*,.pdf,.doc,.docx",mt=Oo?(0,o.nt)(fo,po,Oo):"",Ut=Ao?.[Ro]||"",[nn,wn]=(0,t.useState)([]),nr=(0,t.useRef)(Fr||[]);(0,t.useEffect)(()=>{Fr&&(nr.current=Fr)},[Fr]),(0,t.useEffect)(()=>{Fr?.length&&wn(e0=>{const M0=e0.filter(y0=>y0.isLoading||y0.failed);return[...Fr.filter(y0=>y0.valueAttachment).map((y0,ci)=>{var ct,_t,An,jn,qn;const Hr=((ct=y0.valueAttachment)==null?void 0:ct.title)||`attachment-${ci}`,u0=(_t=y0.valueAttachment)==null?void 0:_t.id,ai=e0.find(Li=>u0&&Li.id===u0||!u0&&Li.id===`existing-${ci}`),E0=(An=y0.valueAttachment)==null?void 0:An.data,Z0=E0?tt(E0,(jn=y0.valueAttachment)==null?void 0:jn.contentType):0;return{id:u0||ai?.id||`existing-${ci}`,name:Hr,size:ai?.size||Z0,progress:100,failed:!1,type:(0,o.J4)((qn=y0.valueAttachment)==null?void 0:qn.contentType),isLoading:!1}}),...M0]})},[Fr]);const vn=e0=>{let M0=Array.from(e0);if(Ce!==void 0){const y0=Ce-nn.length;if(y0<=0)return;M0=M0.slice(0,y0)}const Vr=M0.map(y0=>{const ci=Le&&y0.size>Le,ct=y0.name.replace(/\s+/g,"-");return{id:Je(),name:ct,size:y0.size,progress:0,type:(0,o.J4)(y0.type),failed:!!ci,isLoading:!ci,disableRetry:!!ci,errorMessage:ci?`File size exceeds ${(Le/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});wn(y0=>[...y0,...Vr]),Vr.filter(y0=>!y0.failed).forEach(y0=>{const ci=M0.find(ct=>ct.name.replace(/\s+/g,"-")===y0.name);ci&&kn(ci,y0.id)})},kn=(e0,M0)=>tn(void 0,null,function*(){try{const Vr=yield ye(e0),y0=yield Ir(Vr),ci=Vr.name.replace(/\s+/g,"-");wn(jn=>jn.map(qn=>qn.id===M0?yt(Ze({},qn),{isLoading:!1,progress:100,failed:!1}):qn));const ct={valueAttachment:{id:M0,contentType:Vr.type,data:y0,title:ci}},An=[...(nr.current||[]).filter(jn=>jn.valueAttachment||Object.keys(jn).length>0),ct];nr.current=An,Vi(fr,An),n0(Ro)}catch{wn(y0=>y0.map(ci=>ci.id===M0?yt(Ze({},ci),{isLoading:!1,failed:!0}):ci))}}),dn=e0=>{const M0=nn.find(Vr=>Vr.id===e0);if(wn(Vr=>Vr.filter(y0=>y0.id!==e0)),M0){const Vr=(nr.current||[]).filter((y0,ci)=>{var ct;if(e0.startsWith("existing-")){const _t=parseInt(e0.replace("existing-",""));return ci!==_t}return((ct=y0.valueAttachment)==null?void 0:ct.id)!==e0}).filter(y0=>y0.valueAttachment||Object.keys(y0).length>0);nr.current=Vr,Vi(fr,Vr.length>0?Vr:[{}])}},cr=e0=>{const M0=nn.find(Vr=>Vr.id===e0);if(M0){wn(y0=>y0.map(ci=>ci.id===e0?yt(Ze({},ci),{failed:!1,isLoading:!0,progress:0}):ci));const Vr=new File([""],M0.name,{type:"application/octet-stream"});kn(Vr,e0)}},Ir=e0=>new Promise((M0,Vr)=>{const y0=new FileReader;y0.onload=()=>{const ct=y0.result.split(",")[1];M0(ct)},y0.onerror=Vr,y0.readAsDataURL(e0)});return(0,n.jsxs)("div",{children:[mt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:mt,required:zo||!1}),(0,n.jsx)(r.FileUpload,{files:nn,onDropFiles:vn,onDeleteFile:dn,onRetryFile:cr,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(Fe,Le,Ce),accept:Fe,allowsMultiple:Qn!==!1,isDisabled:Cr||$o||Ce!==void 0&&nn.length>=Ce,className:"w-full",showDisclosureModal:!0}),Ut&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ut})]})},pn=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{var Ro,Oo;const{linkId:zo,text:po,prefix:Cr,readOnly:Qn,required:Tr,extension:Le}=fr,{trackQuestionnaireEvent:Ce}=(0,p.c)(),Fe=po?(0,o.nt)(fo,Cr,po):"",mt=Ao?.[zo];return Le?.find(nn=>{var wn,nr;return nn.url===i.gD&&((nr=(wn=nn.valueCodeableConcept)==null?void 0:wn.coding)==null?void 0:nr.some(vn=>vn.system===i.n4&&vn.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":zo,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":zo,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:zo,name:zo,isDisabled:Qn||$o,isSelected:(Ro=Fr?.[0])==null?void 0:Ro.valueBoolean,"aria-label":zo,label:"",className:"mt-1",onChange:nn=>{Ce(fr.linkId,{value:nn}),Vi(fr,[{valueBoolean:nn}]),n0(fr.linkId)}}),Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Tr||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!mt,children:mt})]}):(0,n.jsxs)("div",{"data-testid":zo,children:[Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Tr||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:zo,name:zo,"aria-label":zo,value:String((Oo=Fr?.[0])==null?void 0:Oo.valueBoolean)||"",onChange:nn=>{Vi(fr,[{valueBoolean:nn==="true"}]),n0(fr.linkId)},isInvalid:!!mt,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Qn||$o}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Qn||$o})]},zo),mt&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:mt})})]})};var gt=Object.defineProperty,Jt=Object.getOwnPropertySymbols,jt=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,$t=(fr,n0,Fr)=>n0 in fr?gt(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,Qt=(fr,n0)=>{for(var Fr in n0||(n0={}))jt.call(n0,Fr)&&$t(fr,Fr,n0[Fr]);if(Jt)for(var Fr of Jt(n0))Dt.call(n0,Fr)&&$t(fr,Fr,n0[Fr]);return fr};const yn=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo,po,Cr;const{linkId:Qn,text:Tr,required:Le,answerOption:Ce,prefix:Fe,readOnly:mt}=fr,Ut=Tr?(0,o.nt)(fo,Fe,Tr):"",nn=Ce?.map(vn=>{var kn,dn,cr,Ir;return{id:((kn=vn.valueCoding)==null?void 0:kn.code)||vn.valueString||"",label:((dn=vn.valueCoding)==null?void 0:dn.display)||vn.valueString||"",value:((cr=vn.valueCoding)==null?void 0:cr.code)||vn.valueString||"",extension:vn.extension||[],system:((Ir=vn.valueCoding)==null?void 0:Ir.system)||void 0}})||[],wn=((po=(zo=Fr?.[0])==null?void 0:zo.valueCoding)==null?void 0:po.code)||((Cr=Fr?.[0])==null?void 0:Cr.valueString)||"",nr=Ao?.[Qn];return(0,n.jsxs)("div",{children:[Ut&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ut,required:Le||!1}),(0,n.jsx)(r.Select,{id:Qn,"aria-label":Qn,"data-testid":Qn,isDisabled:mt||$o,selectedKey:wn,onSelectionChange:vn=>{const kn=String(vn),dn=nn.find(e0=>e0.value===kn),cr=dn?dn.label:"",Ir=Boolean(Ce?.find(e0=>e0.valueString===kn));Vi(fr,[Ir?{valueString:kn}:{valueCoding:Qt({code:kn,display:cr},dn?.system?{system:dn.system}:{}),extension:dn?.extension||[]}]),n0(fr.linkId)},isInvalid:!!nr,hint:nr||Oo,items:nn,placeholder:Ro,isRequired:Le,children:vn=>(0,n.jsx)(r.Select.Item,{id:vn.id,"data-testid":vn.value,value:vn.value,children:vn.label},vn.id)},Qn)]})};var zr=Object.defineProperty,qr=Object.getOwnPropertySymbols,Ln=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,on=(fr,n0,Fr)=>n0 in fr?zr(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,Mt=(fr,n0)=>{for(var Fr in n0||(n0={}))Ln.call(n0,Fr)&&on(fr,Fr,n0[Fr]);if(qr)for(var Fr of qr(n0))Dn.call(n0,Fr)&&on(fr,Fr,n0[Fr]);return fr};const zt=fr=>{var n0,Fr,Vi;const{item:fo,selectedAnswer:Ao,updatedText:$o,required:Ro,errorMessage:Oo}=fr,zo=fo?.type==="reference",po=(n0=Ao?.map(Ce=>{var Fe,mt;return zo?(Fe=Ce.valueReference)==null?void 0:Fe.display:(mt=Ce.valueCoding)==null?void 0:mt.code}).filter(Ce=>Ce!==void 0))!=null?n0:[],[Cr,Qn]=(0,t.useState)(po.length),Tr=(Vi=(Fr=fo.extension)==null?void 0:Fr.find(Ce=>Ce.url===i.Z_))==null?void 0:Vi.valueInteger,Le=(Ce,Fe)=>{var mt,Ut,nn;let wn;if(Ce){const nr=fr.options.find(vn=>vn.value===Fe);wn=[...(Ut=(mt=fr.selectedAnswer)==null?void 0:mt.filter(vn=>Object.keys(vn).length!==0))!=null?Ut:[],zo?{valueReference:nr?.valueReference}:{valueCoding:Mt({code:Fe,display:nr?.label},nr?.system?{system:nr.system}:{}),extension:nr?.extension||[]}],Qn(vn=>vn+1)}else wn=((nn=fr.selectedAnswer)==null?void 0:nn.filter(nr=>{var vn,kn;return zo?((vn=nr.valueReference)==null?void 0:vn.display)!==Fe:((kn=nr.valueCoding)==null?void 0:kn.code)!==Fe}))||[{}],Qn(nr=>nr-1);fr.handleInputChange(fr.item,wn)};return(0,n.jsxs)("div",{"data-testid":fo.linkId,children:[$o&&(0,n.jsx)(N,{isLabel:!0,text:$o,required:Ro||!1}),(0,n.jsx)("div",{children:fr.options.map((Ce,Fe)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Ce.value,id:Fe.toString(),className:Fe!==fr.options.length-1?"mb-2xl":"",name:Ce.label,isInvalid:!!Oo,isSelected:po?.includes(Ce?.value),label:Ce.label,onChange:mt=>Le(mt,Ce.value),isDisabled:fr.readOnly||fr.isLoading||(!po?.includes(Ce?.value)&&Tr?Cr>=Tr:!1)},Fe))}),(0,n.jsx)(r.HintText,{isInvalid:!!Oo,children:Oo})]})},Yt=({item:fr,onCompleteHandler:n0,updatedText:Fr,options:Vi,handleInputChange:fo,errorMessage:Ao,readOnly:$o,initialValue:Ro,selectedAnswer:Oo,isLoading:zo,required:po})=>{var Cr,Qn;const Tr=`${fr.linkId}-label`,Le=`${fr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":fr.linkId,children:[Fr&&(0,n.jsx)(N,{id:Tr,isLabel:!0,text:Fr,required:po||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:fr.linkId,name:fr.linkId,"aria-labelledby":Fr?Tr:void 0,"aria-describedby":Ao?Le:void 0,isRequired:po,className:Vi.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Qn=(Cr=Oo?.[0])==null?void 0:Cr.valueCoding)==null?void 0:Qn.code)||Ro||"",onChange:Ce=>{const Fe=Ce,mt=Vi.find(nn=>nn.value===Fe),Ut=mt?mt.label:"";fo(fr,[{valueCoding:{code:Fe,display:Ut,system:mt?.system||void 0},extension:mt?.extension||[]}]),n0(fr.linkId)},isInvalid:!!Ao,children:Vi.map(Ce=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Ce.value,isDisabled:$o||zo,value:Ce.value,label:Ce.label},Ce.value))},fr.linkId),Ao&&(0,n.jsx)("div",{id:Le,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Ao})})]})};var cn=Object.defineProperty,an=Object.getOwnPropertySymbols,Sn=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,wr=(fr,n0,Fr)=>n0 in fr?cn(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,$r=(fr,n0)=>{for(var Fr in n0||(n0={}))Sn.call(n0,Fr)&&wr(fr,Fr,n0[Fr]);if(an)for(var Fr of an(n0))Kn.call(n0,Fr)&&wr(fr,Fr,n0[Fr]);return fr};const Xr=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo,po,Cr,Qn,Tr;const{linkId:Le,text:Ce,required:Fe,answerOption:mt,prefix:Ut,readOnly:nn}=fr,wn=fr?.type==="reference",nr=Ce?(0,o.nt)(fo,Ut,Ce):"",kn=(()=>{var Vr,y0;const ci=mt?.find(ct=>ct.initialSelected===!0);return ci?wn?((Vr=ci.valueReference)==null?void 0:Vr.display)||"":((y0=ci?.valueCoding)==null?void 0:y0.code)||"":""})(),dn=(mt?.map(Vr=>{var y0,ci,ct,_t,An;return{label:((y0=Vr?.valueCoding)==null?void 0:y0.display)||((ci=Vr?.valueReference)==null?void 0:ci.display)||"",value:wn?((ct=Vr.valueReference)==null?void 0:ct.display)||"":((_t=Vr.valueCoding)==null?void 0:_t.code)||"",valueReference:wn?Vr.valueReference:{},extension:Vr.extension||[],system:((An=Vr.valueCoding)==null?void 0:An.system)||""}})||[]).filter(Vr=>Vr.label),cr=Ao?.[Le],Ir=(Tr=(Qn=(Cr=(po=(zo=fr?.extension)==null?void 0:zo.find(Vr=>Vr.url.includes("questionnaire-itemControl")))==null?void 0:po.valueCodeableConcept)==null?void 0:Cr.coding)==null?void 0:Qn[0])==null?void 0:Tr.code;let e0=null;const M0={item:fr,onCompleteHandler:n0,updatedText:nr,options:dn,handleInputChange:Vi,errorMessage:cr,required:Fe,readOnly:nn,initialValue:kn,selectedAnswer:Fr,isLoading:$o,showQuestionPrefix:fo,placeholder:Ro,hintText:Oo};switch(Ir){case"drop-down":e0=(0,n.jsx)(yn,$r({},M0));break;case"check-box":e0=(0,n.jsx)(zt,$r({},M0));break;case"radio-button":e0=(0,n.jsx)(Yt,$r({},M0));break}return(0,n.jsx)(n.Fragment,{children:e0})};var c0=e(73697),Pi=e(71924),$0=e(46776);const si=fr=>`${String(fr.month).padStart(2,"0")}/${String(fr.day).padStart(2,"0")}/${fr.year}`,G0=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo,po,Cr;const{linkId:Qn,text:Tr,required:Le,prefix:Ce,readOnly:Fe}=fr,mt=(0,t.useRef)(null),[Ut,nn]=(0,t.useState)(!1),[wn,nr]=(0,t.useState)(null),{setIsCurrentFormValid:vn,isCurrentFormValid:kn,trackQuestionnaireEvent:dn}=(0,p.c)(),cr=Tr?(0,o.nt)(fo,Ce,Tr):"",Ir=Ao?.[Qn]||"",e0=(zo=fr.extension)==null?void 0:zo.find(X0=>X0.url===i.dU),M0=(po=fr.extension)==null?void 0:po.find(X0=>X0.url===i.bK),Vr=(0,t.useMemo)(()=>{var X0;const b0=e0?.valueString||e0?.valueDate;return b0||(0,o.iI)((X0=e0?.valueExpression)==null?void 0:X0.expression)},[e0]),y0=(0,t.useMemo)(()=>{var X0;const b0=M0?.valueString||M0?.valueDate;return b0||(0,o.iI)((X0=M0?.valueExpression)==null?void 0:X0.expression)},[M0]),ci=(0,t.useMemo)(()=>{if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{return(0,c0._U)(Vr)}catch{}return(0,c0._U)("1900-01-01")},[Vr]),ct=(0,t.useMemo)(()=>{if(y0&&/^\d{4}-\d{2}-\d{2}$/.test(y0))try{return(0,c0._U)(y0)}catch(X0){console.warn("Failed to parse maxDateStr:",y0,X0)}return(0,c0._U)("2099-12-31")},[y0]),An=(X0=>{if(!X0)return"";const b0=X0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!b0)return X0;const[,vi,H0,Io]=b0;return`${H0}/${Io}/${vi}`})(((Cr=Fr?.[0])==null?void 0:Cr.valueDate)||""),jn=X0=>{if(!X0)return"";const b0=X0.replace(/\D/g,"");if(b0.length===0)return"";if(b0.length<=2)return b0.length===2?`${b0}/`:b0;const vi=Io=>{const Ii=Io.slice(0,2),yo=Io.slice(2);return yo.length===2?`${Ii}/${yo}/`:`${Ii}/${yo}`},H0=Io=>{const Ii=Io.slice(0,2),yo=Io.slice(2,4),ga=Io.slice(4,8);return`${Ii}/${yo}/${ga}`};return b0.length<=4?vi(b0):H0(b0)},qn=()=>{if(Fe||$o)return;if(An.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const b0=(0,c0._U)(An);nr(b0)}catch{nr(null)}else{const b0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(b0){const[,vi,H0,Io]=b0,Ii=parseInt(vi,10),yo=parseInt(H0,10);if(Ii>=1&&Ii<=12&&yo>=1&&yo<=31)try{const ga=(0,c0._U)(`${Io}-${vi}-${H0}`);nr(ga)}catch{nr(null)}else nr(null)}else nr(null)}nn(!0)},Hr=()=>{if(wn){const X0=`${wn.year}-${String(wn.month).padStart(2,"0")}-${String(wn.day).padStart(2,"0")}`;dn(fr.linkId,{value:(0,o.CP)(`${String(wn.month).padStart(2,"0")}/${String(wn.day).padStart(2,"0")}/${wn.year}`)}),Vi(fr,[{valueDate:(0,o.Fy)(X0)}])}nn(!1),nr(null)},u0=()=>{nn(!1),nr(null)},ai=X0=>{var b0;const vi=((b0=mt.current)==null?void 0:b0.selectionStart)||0,H0=An,Io=jn(X0),Ii=Io.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Ii){const[,yo,ga,Go]=Ii,Ds=parseInt(yo,10),Fs=parseInt(ga,10),Ho=parseInt(Go,10);if(E0(Ds,Fs,Ho).isValid){const u1=`${Go}-${yo}-${ga}`;dn(fr.linkId,{value:(0,o.CP)(`${yo}/${ga}/${Go}`)}),Vi(fr,[{valueDate:(0,o.Fy)(u1)}])}else Vi(fr,[{valueDate:Io}])}else Vi(fr,[{valueDate:Io}]);setTimeout(()=>{if(mt.current){const yo=H0.replace(/\D/g,""),ga=Io.replace(/\D/g,"");let Go=vi;Io===H0&&(Go=vi-1),ga.length>=yo.length&&Io!==H0?Io[vi-1]==="/"?Go=vi+1:Go=vi:ga.length<yo.length&&(H0[vi-1]==="/"?Go=Math.max(0,vi-1):Go=vi),mt.current.setSelectionRange(Go,Go)}},0)},E0=(X0,b0,vi)=>{if(X0<1||X0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(b0<1||b0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const H0=new Date(vi,X0,0).getDate();if(b0>H0)return{isValid:!1,error:"Invalid day for the selected month"};if(Vr||y0){const Io=new Pi.ng(vi,X0,b0);if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{const Ii=(0,c0._U)(Vr);if(Io.compare(Ii)<0){const yo=(0,o.di)(i.Ck,fr.extension);if(yo)return{isValid:!1,error:yo};const ga=si(Ii);return{isValid:!1,error:`Date must be on or after ${ga}`}}}catch{}if(y0&&/^\d{4}-\d{2}-\d{2}$/.test(y0))try{const Ii=(0,c0._U)(y0);if(Io.compare(Ii)>0){const yo=(0,o.di)(i.Cx,fr.extension);if(yo)return{isValid:!1,error:yo};const ga=si(Ii);return{isValid:!1,error:`Date must be on or before ${ga}`}}}catch{}}return{isValid:!0,error:""}},Z0=()=>{const X0=An.replace(/\D/g,"");if(X0.length>0&&X0.length<8){n0(fr.linkId);return}const b0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!b0&&X0.length>=6){n0(fr.linkId);return}if(b0){const[,vi,H0,Io]=b0,Ii=parseInt(vi,10),yo=parseInt(H0,10),ga=parseInt(Io,10);if(E0(Ii,yo,ga).isValid){const Go=`${Io}-${vi}-${H0}`;Vi(fr,[{valueDate:(0,o.Fy)(Go)}])}}n0(fr.linkId)},j0=(()=>{if(!An)return"";const X0=An.replace(/\D/g,"");if(X0.length>0&&X0.length<8)return"";const b0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!b0&&X0.length>=6)return kn&&vn(!1),"Invalid date";if(b0){const[,vi,H0,Io]=b0,Ii=parseInt(vi,10),yo=parseInt(H0,10),ga=parseInt(Io,10),{isValid:Go,error:Ds}=E0(Ii,yo,ga);if(!Go)return kn&&vn(!1),Ds||"Invalid date"}return""})(),Ei=!!Ir||!!j0;return(0,n.jsxs)("div",{children:[cr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:cr,required:Le||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Fe||$o,className:(0,P.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Fe||$o)&&"cursor-not-allowed opacity-50"),onClick:qn,"aria-label":"Open calendar",children:(0,n.jsx)(F.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,P.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Fe||$o)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:mt,isRequired:Le,size:"md",type:"text",name:Qn,"data-testid":Qn,id:Qn,value:An,onChange:ai,placeholder:Ro,isDisabled:Fe||$o,onBlur:Z0,hint:j0||Ir||Oo,isInvalid:Ei,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Qn)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:Ut,onOpenChange:X0=>{X0||u0()},primaryButton:{children:"Apply",onClick:Hr,isDisabled:!wn},secondaryButton:{children:"Cancel",onClick:u0},children:(0,n.jsx)($0.lr,{value:wn,onChange:nr,minValue:ci,maxValue:ct,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:ci,maxValue:ct,onYearPickerOpen:()=>{nr(null)}})})})]})},Ci=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{var Ro;const{linkId:Oo,text:zo,required:po,prefix:Cr,readOnly:Qn}=fr,Tr=zo?(0,o.nt)(fo,Cr,zo):"",Le=Ao?.[Oo]||"";return(0,n.jsxs)("div",{children:[Tr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Tr,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,size:"md",type:"datetime-local",id:Oo,"aria-label":Oo,"data-testid":Oo,placeholder:"Type your response here...",value:((Ro=Fr?.[0])==null?void 0:Ro.valueDateTime)||"",onChange:Ce=>{let Fe=Ce;const[mt,Ut]=Fe.split("T");mt&&Ut&&(Fe=`${(0,o.Fy)(mt)}T${Ut}:00`),Vi(fr,[{valueDateTime:Fe}])},isDisabled:Qn||$o,onBlur:()=>{n0(fr.linkId)},hint:Le,isInvalid:!!Le},Oo)]})},br=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo;const{linkId:po,text:Cr,required:Qn,prefix:Tr,readOnly:Le}=fr,Ce=Cr?(0,o.nt)(fo,Tr,Cr):"",Fe=Ao?.[po]||"",mt=(0,o.a0)(fr),Ut=(zo=Fr?.[0])==null?void 0:zo.valueDecimal,[nn,wn]=(0,t.useState)(String(Ut??""));return(0,t.useEffect)(()=>{wn(String(Ut??""))},[Ut]),(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",id:po,"aria-label":po,"data-testid":po,placeholder:Ro,value:nn,onChange:nr=>{wn(nr)},isDisabled:Le||$o,onBlur:()=>{const nr=parseFloat(nn);wn(isNaN(nr)?"":String(nr)),Vi(fr,[{valueDecimal:isNaN(nr)?void 0:nr}]),n0(fr.linkId)},type:"number",hint:Fe||Oo,isInvalid:!!Fe,autoComplete:mt},po)]})},gr=({item:fr,showStepper:n0=!1})=>{var Fr;const{text:Vi,linkId:fo,type:Ao}=fr,$o=Vi&&(0,o.nt)(!1,"",Vi),Ro=(Fr=fr.extension)==null?void 0:Fr.find(Cr=>Cr.url===i.Yt),Oo=Ro?.valueBoolean===!0,zo=Ao==="group"&&(0,o.$O)(fr)!==void 0,po=()=>{const Cr=(0,o.$O)(fr),Qn=(0,o.t7)(fr);if(Cr===void 0||Qn===void 0||Qn<=0)return[];const Tr=[];for(let Le=1;Le<=Qn;Le++){let Ce="incomplete";Le<Cr?Ce="complete":Le===Cr&&(Ce="current"),Tr.push({title:"",description:"",status:Ce})}return Tr};return $o&&!Oo?(0,n.jsxs)("div",{"data-testid":fo,children:[(0,n.jsx)(N,{text:$o,required:!1,className:""}),n0&&zo&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:po()})})]}):null},Mr=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo;const{linkId:po,text:Cr,required:Qn,prefix:Tr,readOnly:Le}=fr,Ce=Cr?(0,o.nt)(fo,Tr,Cr):"",Fe=Ao?.[po]||"",mt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,"data-testid":po,size:"md",id:po,"aria-label":po,placeholder:Ro,value:String((zo=Fr?.[0])==null?void 0:zo.valueInteger)||"",onChange:Ut=>{Vi(fr,[{valueInteger:Number(Ut)}])},isDisabled:Le||$o,onBlur:()=>{n0(fr.linkId)},type:"number",hint:Fe||Oo,isInvalid:!!Fe,autoComplete:mt},po)]})},x0=({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo,po,Cr;const{linkId:Qn,text:Tr,extension:Le,required:Ce,prefix:Fe,readOnly:mt}=fr,Ut=Tr?(0,o.nt)(fo,Fe,Tr):"",nn=Le?.find(vn=>vn.url.includes("questionnaire-unitOption")),wn=Ao?.[Qn],nr=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ut&&(0,n.jsx)(N,{isLabel:!0,text:Ut,required:Ce||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Ce,size:"md",id:Qn,"aria-label":Qn,"data-testid":Qn,value:(zo=Fr?.[0])!=null&&zo.valueQuantity?String((po=Fr[0].valueQuantity)==null?void 0:po.value):"",onChange:vn=>{Vi(fr,[{valueQuantity:{value:parseFloat(vn)}}])},isDisabled:mt||$o,onBlur:()=>{var vn,kn,dn;const cr=(vn=Fr?.[0])!=null&&vn.valueQuantity?parseFloat(String((dn=(kn=Fr?.[0])==null?void 0:kn.valueQuantity)==null?void 0:dn.value)).toFixed(2):"";Vi(fr,[{valueQuantity:{value:parseFloat(cr)}}]),n0(fr.linkId)},hint:wn||Oo,isInvalid:!!wn,trailingAddon:(0,n.jsx)("p",{className:"bg-primary ring-primary flex size-full w-max items-center rounded-lg rounded-l-none p-1 text-center ring-1 ring-inset",children:(Cr=nn?.valueCoding)==null?void 0:Cr.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Ro,autoComplete:nr})},Qn)]})};var p0=e(61784);const ei="ui-toolkit-modern",wi={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS",SUBMIT:"SUBMIT"},_i={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},oo={[_i.CURRENT_LOCATION]:wi.CURRENT_LOCATION,[_i.ZIP_CODE]:wi.ZIP_CODE,[_i.ADDRESS]:wi.ADDRESS},xo={mi:{singular:wi.MILE,plural:wi.MILES}},So=({resourceData:fr,handleInputChange:n0,item:Fr,questionnaireSchemaItems:Vi})=>{var fo;const{t:Ao}=(0,p0.SS)(),{queryParams:$o}=(0,ht.useSearchQueryParams)(),Ro=$o.locationType||"",{setCurrentGroupIndex:Oo,handleContinueButtonClick:zo,setHideFooterButton:po}=(0,p.c)(),{trackEvent:Cr}=(0,s.st)();(0,t.useEffect)(()=>{if(!Fr.readOnly)return po(!0),()=>{po(!1)}},[Fr.readOnly,po]);const Qn=(fo=Fr.extension)==null?void 0:fo.find(kn=>kn.url===i.Uf),Tr=Qn?.valueString,Le=()=>{if(Tr){const kn=(0,o.Ue)(Vi||[],Tr);kn!==-1&&Oo(kn)}},Ce=kn=>{const dn=kn.find(cr=>cr.url.includes("description"));return dn?.valueString||""},Fe=kn=>{const dn=kn.find(y0=>y0.url.includes("distance-value")),cr=kn.find(y0=>y0.url.includes("distance-unit")),Ir=dn?.valueString?Number(dn.valueString):NaN,e0=cr?.valueString||"";if(!e0||isNaN(Ir))return null;const M0=Math.round(Ir);let Vr=e0;return xo[e0]&&(Vr=Ao(M0===1?xo[e0].singular:xo[e0].plural)),Ro&&oo[Ro]?Ao(wi.LOCATION_DISTANCE,{distance:`${M0} ${Vr}`,locationType:Ao(oo[Ro])}):Ao(wi.LOCATION_DISTANCE_AWAY,{distance:`${M0} ${Vr}`})},mt=kn=>({id:kn.id||"",providerName:kn.name||"",specialty:"",distance:Fe(kn.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:kn.address||"",valueReference:kn.valueReference||{reference:kn.id}}),Ut=kn=>{var dn,cr,Ir,e0;const M0=kn;return mt({id:M0.id,name:(dn=M0.name)!=null?dn:"",address:(e0=(Ir=(cr=M0?.address)==null?void 0:cr.line)==null?void 0:Ir[0])!=null?e0:"",extension:M0?.extension,valueReference:{reference:M0.id}})},nn=kn=>mt({id:kn?.reference,name:kn?.display,address:Ce(kn?.extension||[]),extension:kn?.extension,valueReference:kn}),nr=(()=>fr&&Array.isArray(fr)&&fr.length>0?fr.map(Ut):Fr.initial&&Array.isArray(Fr.initial)&&Fr.initial.length>0?Fr.initial.map(kn=>nn(kn.valueReference)):Fr.answerOption?Fr.answerOption.map(kn=>nn(kn.valueReference)):[])(),vn=kn=>{n0(Fr,[{valueReference:kn}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Fr.readOnly&&"pb-4xl"),children:Fr.readOnly?nr.map(({address:kn,id:dn,providerName:cr,placeholderIcon:Ir,distance:e0})=>(0,n.jsx)(ht.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},locationName:cr,address:kn,distance:e0,actionButtonText:Tr?"Change location":void 0,onActionButtonClick:Tr?Le:void 0},dn)):nr.map(({address:kn,id:dn,providerName:cr,placeholderIcon:Ir,specialty:e0,valueReference:M0,distance:Vr})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},providerName:{content:cr},specialty:{content:e0},location:{address:kn,distance:Vr},actionButton:{children:"Schedule appointment",onClick:()=>{Cr("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:kn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),vn(M0),zo?.()}}},dn))})};var ao=e(79079),Po=e(32066),uo=e(43915),Uo=e(36181),Vo=e(37234),Ha=e(59931),Pr=e(65388),tr=Object.defineProperty,Kr=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,_0=Object.getOwnPropertySymbols,Mn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Er=(fr,n0,Fr)=>n0 in fr?tr(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,l0=(fr,n0)=>{for(var Fr in n0||(n0={}))Mn.call(n0,Fr)&&Er(fr,Fr,n0[Fr]);if(_0)for(var Fr of _0(n0))Hn.call(n0,Fr)&&Er(fr,Fr,n0[Fr]);return fr},Jn=(fr,n0)=>Kr(fr,Lr(n0));const Xn="tz-code",ni={"ui-toolkit/LocationCard":So,"ui-toolkit/TimeSlotSelection":({resourceData:fr,item:n0,handleInputChange:Fr,selectedAnswer:Vi,questionnaireSchemaItems:fo,formData:Ao,onCompleteHandler:$o})=>{var Ro,Oo;const{t:zo}=(0,ao.S)(),{trackEvent:po}=(0,s.st)(),{isLoading:Cr,setIsInlineNextQuestionTriggered:Qn}=(0,p.c)(),Tr=b0=>{const vi=b0.match(/^(\d{4}-\d{2}-\d{2})/);return vi?vi[1]:b0},Le=b0=>{const vi=b0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return vi?`${vi[1]} ${vi[2]}`:b0},Ce=b0=>{const vi=b0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(vi){const[,H0,Io,Ii]=vi;return new Date(parseInt(H0),parseInt(Io)-1,parseInt(Ii))}return new Date},mt=(()=>{var b0;if((b0=Vi?.[0])!=null&&b0.valueReference){const vi=Vi[0].valueReference,H0=vi.display||"",Io=Tr(H0);if(Io)return{date:Ce(Io),slotId:vi.reference||""}}return{date:new Date,slotId:""}})(),[Ut,nn]=(0,t.useState)(mt.date),[wn,nr]=(0,t.useState)(mt.slotId),[vn,kn]=(0,t.useState)(new Set),dn=(0,t.useMemo)(()=>new Pi.ng(Ut.getFullYear(),Ut.getMonth()+1,Ut.getDate()),[Ut]),cr=b0=>({display:b0.display||"",id:b0.id||"",start:b0.start||"",extension:Array.isArray(b0.extension)?b0.extension:[],identifier:Array.isArray(b0.identifier)?b0.identifier:[],type:b0.type||""}),Ir=b0=>cr({display:b0.start?Le(b0.start):"",id:b0.id,start:b0.start,extension:b0.extension,identifier:b0.identifier}),e0=b0=>cr({display:b0?.display||"",id:b0?.reference,start:b0?.display,extension:b0?.extension,identifier:b0?.identifier,type:b0?.type}),M0=()=>{if(Array.isArray(fr)&&fr.length>0)return fr.filter(b0=>b0.resourceType==="Appointment").map(Ir);if(n0.initial&&Array.isArray(n0.initial)&&n0.initial.length>0)return n0.initial.map(b0=>e0(b0.valueReference));if(n0.answerOption)return n0.answerOption.map(b0=>e0(b0.valueReference))},Vr=(0,t.useMemo)(()=>M0()||[],[fr,Vi,n0]),y0=(0,t.useMemo)(()=>{const b0={};return Vr.forEach(vi=>{if(vi.start&&vi.id){const H0=Tr(vi.start);b0[H0]||(b0[H0]=[]),b0[H0].push({display:vi.display,id:vi.id,start:vi.start,extension:vi.extension})}}),b0},[Vr]),ci=(0,t.useMemo)(()=>{const b0=Object.keys(y0).sort(),vi=[];if(b0.length===0)return vi.push(dn),vn.forEach(Ii=>{const yo=(0,uo.A)(Ii);vi.push(new Pi.ng(yo.getFullYear(),yo.getMonth()+1,yo.getDate()))}),vi;const H0=(0,uo.A)(b0[b0.length-1]),Io=new Pi.ng(H0.getFullYear(),H0.getMonth()+1,H0.getDate());for(let Ii=dn;Ii.compare(Io)<=0;Ii=Ii.add({days:1})){const yo=`${Ii.year}-${String(Ii.month).padStart(2,"0")}-${String(Ii.day).padStart(2,"0")}`;y0[yo]||vi.push(Ii)}if(!(0,o.mR)(n0)){const Ii=(0,Po.Ec)((0,Po.Xj)()).add({days:30});let yo=Io.add({days:1});for(;yo.compare(Ii)<=0;)vi.push(yo),yo=yo.add({days:1})}return vn.forEach(Ii=>{const yo=(0,uo.A)(Ii),ga=new Pi.ng(yo.getFullYear(),yo.getMonth()+1,yo.getDate());vi.some(Go=>Go.year===ga.year&&Go.month===ga.month&&Go.day===ga.day)||vi.push(ga)}),vi},[y0,vn,dn,n0]),ct=(0,t.useMemo)(()=>(0,o.mR)(n0)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[n0]),_t=(0,t.useMemo)(()=>Object.keys(y0).map(b0=>{const vi=(0,uo.A)(b0);return new Pi.ng(vi.getFullYear(),vi.getMonth()+1,vi.getDate())}),[y0]),An=(0,Uo.A)((0,Vo.A)(Ut),"yyyy-MM-dd"),jn=(0,t.useMemo)(()=>y0[An]||[],[y0,An]);(0,t.useEffect)(()=>{const b0=Object.entries(y0).sort(([vi],[H0])=>vi.localeCompare(H0)).slice(0,3).reduce((vi,[H0,Io])=>Jn(l0({},vi),{[`${H0} ${ai}`]:Io.map(Ii=>{var yo;return(0,Pr.YX)({time:Ii.start,timeZone:(0,o.lv)((yo=jn[0])==null?void 0:yo.extension)}).time})}),{});po("slots_returned",{Specialty:"Vaccines",first_three_days_slots:b0,_event_metadata:{description:"The API called for bookable slots based on the user's answers on who, when, where and why they want to book an appointment."}})},[]);const qn=t.useRef(null),Hr=t.useRef(null),u0=t.useRef(!1);(0,t.useEffect)(()=>{var b0;const vi=Object.keys(y0).sort();vi.length===0||u0.current||(u0.current=!0,(b0=Vi?.[0])!=null&&b0.valueReference||nn((0,uo.A)(vi[0])))},[y0]),(0,t.useEffect)(()=>{var b0;const vi=Object.keys(y0).sort();if(vi.length===0)return;const Io=!(qn.current===null)&&JSON.stringify(qn.current)!==JSON.stringify(y0);if(qn.current=y0,!!Io&&(kn(new Set),Hr.current)){const Ii=Hr.current;if(!(((b0=y0[Ii])==null?void 0:b0.length)>0)){const ga=new Set,Go=(0,uo.A)(Ii),Ds=(0,uo.A)(vi[0]);let Fs=Go;for(;Fs<Ds;){const Ho=(0,Uo.A)(Fs,"yyyy-MM-dd");ga.add(Ho),Fs=new Date(Fs),Fs.setDate(Fs.getDate()+1)}kn(ga),nr("")}Hr.current=null}},[y0]);const ai=(0,t.useMemo)(()=>{var b0;const vi=jn[0];if(!vi?.extension)return"";const H0=vi.extension.find(Io=>Io?.url===Xn);try{return(0,Ha.formatToTimeZone)(new Date,"(z)",{timeZone:(b0=H0?.valueCode)!=null?b0:""})}catch{return""}},[jn]),E0=(0,t.useMemo)(()=>{const b0=zo(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return ai?`${b0} ${ai}`:b0},[zo,ai]),Z0=(0,t.useMemo)(()=>{const b0=(0,Po.Ec)((0,Po.Xj)()).add({days:ct}),vi=`${b0.year}-${String(b0.month).padStart(2,"0")}-${String(b0.day).padStart(2,"0")}`,Io=Object.keys(y0).sort().find(Ii=>Ii>An&&Ii<=vi);if(Io){const Ii=(0,uo.A)(Io);return new Pi.ng(Ii.getFullYear(),Ii.getMonth()+1,Ii.getDate())}return null},[y0,An,ct]),Li=()=>{if(Z0){const b0=Z0.toDate((0,Po.Xj)());nn(b0),nr("")}},j0=b0=>{if(!b0){nr(""),Fr(n0,void 0);return}nr(b0.id);const vi=[{valueReference:{display:b0.display,reference:b0.id,extension:b0.extension,identifier:b0.identifier,type:b0.type}}];Fr(n0,vi)},Ei=b0=>{var vi;if(!b0||Cr||!u0.current)return;const H0=Object.keys(y0).sort(),Io=H0[H0.length-1],Ii=H0[0],yo=`${b0.year}-${String(b0.month).padStart(2,"0")}-${String(b0.day).padStart(2,"0")}`;if(Io&&(yo>Io||Ii&&yo<Ii)&&(0,o.mR)(n0)&&fo&&!ci?.some(Go=>Go.compare(b0)===0)){const Go=(0,o.yQ)(n0,fo);if(Go){Hr.current=yo;let Ds="-06:00";if((vi=Vr[0])!=null&&vi.start){const Hs=Vr[0].start.match(/([+-]\d{2}:\d{2})$/);Hs&&(Ds=Hs[1])}const Ho=[{valueDateTime:`${yo}T23:59:59${Ds}`}],u1=Fr(Go,Ho);Fr(n0,void 0,(0,o.Nw)(u1||Ao||[],n0.linkId),void 0,!0),Qn(!0),$o(Go.linkId,!0,!0)}}const ga=b0.toDate((0,Po.Xj)());nn(ga),nr("")},X0=b0=>{if(!b0)return;const vi=jn.find(H0=>H0.id===b0);po("slot_selected",{Specialty:"Vaccines",time_slot:vi?(0,Pr.YX)({time:vi.start,timeZone:(0,o.lv)(jn[0].extension)}).dateWithTime:"",_event_metadata:{description:"A user clicked an option to select a slot or search a different date set if no slots were found."}}),j0(vi??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Ei,disabledDates:ci,highlightedDates:_t,loading:Cr,minValue:(0,Po.Ec)((0,Po.Xj)()),maxValue:(0,Po.Ec)((0,Po.Xj)()).add({days:ct}),value:dn,defaultValue:dn,appointmentSlots:{title:E0,onChange:X0,defaultValue:Vi&&((Oo=(Ro=Vi[0])==null?void 0:Ro.valueReference)==null?void 0:Oo.reference)||void 0,value:wn||void 0,items:jn.map(b0=>({label:Se(b0.start),value:b0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[zo(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),Z0&&(0,n.jsx)("button",{onClick:Li,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:zo(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var Hi=Object.defineProperty,Qo=Object.defineProperties,ko=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,Ai=Object.prototype.hasOwnProperty,C0=Object.prototype.propertyIsEnumerable,Va=(fr,n0,Fr)=>n0 in fr?Hi(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,ls=(fr,n0)=>{for(var Fr in n0||(n0={}))Ai.call(n0,Fr)&&Va(fr,Fr,n0[Fr]);if(ra)for(var Fr of ra(n0))C0.call(n0,Fr)&&Va(fr,Fr,n0[Fr]);return fr},vs=(fr,n0)=>Qo(fr,ko(n0)),ms=(fr,n0)=>{var Fr={};for(var Vi in fr)Ai.call(fr,Vi)&&n0.indexOf(Vi)<0&&(Fr[Vi]=fr[Vi]);if(fr!=null&&ra)for(var Vi of ra(fr))n0.indexOf(Vi)<0&&C0.call(fr,Vi)&&(Fr[Vi]=fr[Vi]);return Fr};const is=(fr,n0)=>fr.answerOption?fr.answerOption.map(Fr=>{var Vi,fo;const Ao=(fo=(Vi=Fr.valueReference)==null?void 0:Vi.reference)==null?void 0:fo.replace("#","");return n0.find($o=>$o.id===Ao)}).filter(Boolean):[],h1=fr=>{var n0,Fr,Vi;const fo=fr.find(Ao=>{var $o,Ro;return Ao.url.includes("questionnaire-itemControl")&&((Ro=($o=Ao.valueCodeableConcept)==null?void 0:$o.coding)==null?void 0:Ro.some(Oo=>{var zo;return(zo=Oo.code)==null?void 0:zo.startsWith("ui-toolkit/")}))});return(Vi=(Fr=(n0=fo?.valueCodeableConcept)==null?void 0:n0.coding)==null?void 0:Fr.find(Ao=>{var $o;return($o=Ao.code)==null?void 0:$o.startsWith("ui-toolkit/")}))==null?void 0:Vi.code},Gn=fr=>{var{uiToolkitCode:n0,props:Fr}=fr,Vi=Fr,{item:fo,contained:Ao=[],customErrorConfigurations:$o}=Vi,Ro=ms(Vi,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Oo}=(0,p.c)(),zo=ni[n0];if(!zo)return(0,n.jsx)(n.Fragment,{});const po=is(fo,Ao),Cr=po.length>0;return!(fo.answerOption&&fo.answerOption.length>0)&&!Cr&&!fo.readOnly?(Oo(!0),(0,n.jsx)(xe,{configKey:n0,customErrorConfigurations:$o})):(0,n.jsx)(zo,vs(ls({},Ro),{item:fo,contained:Ao,customErrorConfigurations:$o,resourceData:po,"data-testid":fo.linkId}))},W0={attachment:rn,choice:Xr,boolean:pn,integer:Mr,string:({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo;const{linkId:po,text:Cr,required:Qn,prefix:Tr,readOnly:Le}=fr,Ce=Cr?(0,o.nt)(fo,Tr,Cr):"",Fe=Ao?.[po]||"",mt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md","aria-label":po,"data-testid":po,id:po,type:mt==="tel"?"tel":"text",placeholder:Ro,value:((zo=Fr?.[0])==null?void 0:zo.valueString)||"",onChange:Ut=>{Vi(fr,[{valueString:Ut}])},isDisabled:Le||$o,onBlur:Ut=>{const nn=Ut.target.value,wn=nn.trim();wn!==nn&&Vi(fr,[{valueString:wn}]),n0(fr.linkId)},hint:Fe||Oo,isInvalid:!!Fe,autoComplete:mt},po)]})},url:({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo;const{linkId:po,text:Cr,required:Qn,prefix:Tr,readOnly:Le}=fr,Ce=Cr?(0,o.nt)(fo,Tr,Cr):"",Fe=Ao?.[po]||"",mt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",type:"url",id:po,"data-testid":po,"aria-label":po,placeholder:Ro,value:((zo=Fr?.[0])==null?void 0:zo.valueUri)||"",onChange:Ut=>{Vi(fr,[{valueUri:Ut}])},isDisabled:Le||$o,onBlur:Ut=>{const nn=Ut.target.value,wn=nn.trim();wn!==nn&&Vi(fr,[{valueUri:wn}]),n0(fr.linkId)},hint:Fe||Oo,isInvalid:!!Fe,autoComplete:mt},po)]})},text:({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o,placeholder:Ro,hintText:Oo})=>{var zo;const{linkId:po,text:Cr,required:Qn,prefix:Tr,readOnly:Le,maxLength:Ce}=fr,Fe=Cr?(0,o.nt)(fo,Tr,Cr):"",mt=Ao?.[po]||"",Ut=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Qn||!1}),(0,n.jsx)(r.TextArea,{isRequired:Qn,id:po,"aria-label":po,"data-testid":po,rows:3,placeholder:Ro,value:((zo=Fr?.[0])==null?void 0:zo.valueString)||"",onChange:nn=>{Vi(fr,[{valueString:nn}])},isDisabled:Le||$o,onBlur:nn=>{const wn=nn.target.value,nr=wn.trim();nr!==wn&&Vi(fr,[{valueString:nr}]),n0(fr.linkId)},hint:mt||Oo,counter:!0,isInvalid:!!mt,maxLength:Ce,autoComplete:Ut},po)]})},date:G0,time:({item:fr,onCompleteHandler:n0,selectedAnswer:Fr,handleInputChange:Vi,showQuestionPrefix:fo,errors:Ao,isLoading:$o})=>{var Ro;const{linkId:Oo,text:zo,required:po,prefix:Cr,readOnly:Qn}=fr,Tr=zo?(0,o.nt)(fo,Cr,zo):"",Le=Ao?.[Oo]||"";return(0,n.jsxs)("div",{children:[Tr&&(0,n.jsx)(N,{isLabel:!0,text:Tr,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,size:"md",type:"time",id:Oo,"data-testid":Oo,"aria-label":Oo,placeholder:"Type your response here...",value:((Ro=Fr?.[0])==null?void 0:Ro.valueTime)||"",onChange:Ce=>{Vi(fr,[{valueTime:Ce}])},isDisabled:Qn||$o,onBlur:()=>{n0(fr.linkId)},hint:Le,isInvalid:!!Le},Oo)]})},dateTime:Ci,quantity:x0,decimal:br,question:gr,display:gr,group:gr,reference:fr=>{var n0,Fr,Vi,fo,Ao;const{setHideFooterButton:$o}=(0,p.c)(),{item:Ro,customErrorConfigurations:Oo}=fr,zo=Ro.extension||[],po=h1(zo);return po?(0,n.jsx)(Gn,{uiToolkitCode:po,props:fr}):((Ao=(fo=(Vi=(Fr=(n0=Ro?.extension)==null?void 0:n0.find(Qn=>Qn.url.includes("questionnaire-itemControl")))==null?void 0:Fr.valueCodeableConcept)==null?void 0:Vi.coding)==null?void 0:fo[0])==null?void 0:Ao.code)==="check-box"?Ro.answerOption&&Ro.answerOption.length>0?(0,n.jsx)(Xr,vs(ls({},fr),{item:Ro})):($o(!0),(0,n.jsx)(xe,{configKey:Ro.linkId,customErrorConfigurations:Oo})):null}};var Ft=(fr,n0,Fr)=>new Promise((Vi,fo)=>{var Ao=Oo=>{try{Ro(Fr.next(Oo))}catch(zo){fo(zo)}},$o=Oo=>{try{Ro(Fr.throw(Oo))}catch(zo){fo(zo)}},Ro=Oo=>Oo.done?Vi(Oo.value):Promise.resolve(Oo.value).then(Ao,$o);Ro((Fr=Fr.apply(fr,n0)).next())});const Ke=({item:fr,selectedAnswer:n0,showQuestionPrefix:Fr})=>{const{text:Vi,prefix:fo,required:Ao}=fr,$o=Vi?getUpdatedQuestionText(Fr,fo,Vi):"",[Ro,Oo]=useState(null),[zo,po]=useState(!1),{documentDownload:Cr,webview:Qn}=useNativeBridge(),Tr=(n0||[]).filter(mt=>{var Ut,nn;return((Ut=mt.valueAttachment)==null?void 0:Ut.data)&&((nn=mt.valueAttachment)==null?void 0:nn.title)}).map((mt,Ut)=>{var nn,wn,nr,vn,kn,dn,cr;return{id:((nn=mt.valueAttachment)==null?void 0:nn.id)||`preview-${Ut}`,fileName:((wn=mt.valueAttachment)==null?void 0:wn.title)||`attachment-${Ut}`,contentType:((nr=mt.valueAttachment)==null?void 0:nr.contentType)||"application/octet-stream",base64Data:((vn=mt.valueAttachment)==null?void 0:vn.data)||"",size:getBase64Size(((kn=mt.valueAttachment)==null?void 0:kn.data)||"",(dn=mt.valueAttachment)==null?void 0:dn.contentType),type:getFileTypeFromMimeType((cr=mt.valueAttachment)==null?void 0:cr.contentType)}}),Le=useCallback(mt=>{const{fileName:Ut,contentType:nn,base64Data:wn}=mt;if(Qn.isWithin)Oo({fileName:Ut,contentType:nn,base64Data:wn}),po(!0);else{const nr=base64toObjectUrl(wn,nn),vn=document.createElement("a");vn.href=nr,vn.download=Ut,document.body.appendChild(vn),vn.click(),document.body.removeChild(vn),URL.revokeObjectURL(nr)}},[Qn.isWithin]),Ce=useCallback(()=>Ft(void 0,null,function*(){!Ro||(yield Cr.writeFile(Ro.fileName,prepareDataUrl(Ro.base64Data,Ro.contentType)))}),[Ro,Cr]),Fe=useCallback(()=>{po(!1),Oo(null)},[]);return Tr.length?jsxs("div",{children:[$o&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:$o,required:Ao||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Tr.map(mt=>jsx("button",{type:"button",onClick:()=>Le(mt),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(mt.fileName),size:mt.size,type:mt.type})},mt.id))}),jsx(DownloadDisclosureModal,{opened:zo,onClose:Fe,onDownload:Ce,contentType:Ro?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var ft=Object.defineProperty,wt=Object.defineProperties,Nn=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,z0=Object.prototype.propertyIsEnumerable,k0=(fr,n0,Fr)=>n0 in fr?ft(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,q0=(fr,n0)=>{for(var Fr in n0||(n0={}))xr.call(n0,Fr)&&k0(fr,Fr,n0[Fr]);if(ar)for(var Fr of ar(n0))z0.call(n0,Fr)&&k0(fr,Fr,n0[Fr]);return fr},Zi=(fr,n0)=>wt(fr,Nn(n0));const qi=(fr,n0,Fr,Vi)=>{var fo;const Ao=fr.extension||[];if(Vi?.[BUTTON_TYPE_EXTERNAL_KEY]&&Ao.some(po=>po.url===BUTTON_TYPE_EXTENSION_URL))return Vi[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(fr)||hasParentWithUIToolkitWidget(fr,n0))return null;if(Fr&&fr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const $o=getUIToolkitCode(Ao),Ro=Ao.filter(po=>po.url.includes("questionnaire-itemControl")).flatMap(po=>{var Cr,Qn;return(Qn=(Cr=po.valueCodeableConcept)==null?void 0:Cr.coding)!=null?Qn:[]})||[];let Oo;return Vi&&(Oo=(fo=Ro.find(po=>po.code&&Vi[po.code]))==null?void 0:fo.code),(Oo&&Vi?Vi[Oo]:void 0)||UI_TOOLKIT_WIDGET_MAP[$o||""]||typeToRenderFunctionMap[fr.type]||null},ro=fr=>{var n0;const{item:Fr,selectedAnswer:Vi,handleInputChange:fo,showQuestionPrefix:Ao,errors:$o,questionnaireSchemaItems:Ro,formData:Oo,isNestedRepeatedItem:zo=!1}=fr,{linkId:po,text:Cr,prefix:Qn,required:Tr,repeats:Le}=Fr,Ce=getMaxOccursFromExtensions(Fr.extension),Fe=getPlaceholderFromExtensions(Fr.extension,Fr.type),[mt,Ut]=useState(()=>{if(Fr.type==="group"&&Fr.item&&Fr.item.length>0){const Vr=Oo?.filter(y0=>y0.linkId===Fr.linkId)||[];if(Vr.length>0)return Vr.map((y0,ci)=>ci)}else if(Vi&&Vi.length>0)return Vi.map((Vr,y0)=>y0);return[0]}),nn=Ce!==void 0&&mt.length>=Ce,wn=Cr?getUpdatedQuestionText(Ao,Qn,Cr):"",nr=()=>{const Vr=Math.max(...mt,-1)+1,y0=[...mt,Vr];if(Ut(y0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const ci=Fr.item.map(_t=>({linkId:_t.linkId,text:_t.text,answer:[{}]})),ct={linkId:Fr.linkId,text:Fr.text,answer:[{}],item:ci};fo(Fr,void 0,[ct])}else{const ci=[...Vi||[]];ci.push({}),fo(Fr,ci)}},vn=Vr=>{if(mt.length<=1)return;const y0=mt.filter((ci,ct)=>ct!==mt.length-1);if(Ut(y0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const ci=[];if(Oo?.forEach((ct,_t)=>{ct.linkId===po&&ci.push({item:ct,originalIndex:_t})}),Vr>=0&&Vr<ci.length){const ct=ci[Vr],_t=Oo?.filter((An,jn)=>jn!==ct.originalIndex);fo(Fr,void 0,_t,void 0,!0)}}else{const ci=Vi?.filter((ct,_t)=>_t!==Vr)||[];fo(Fr,ci.length>0?ci:[{}])}},kn=Vr=>{if(!Oo||!Fr.item)return[];const y0=_t=>{const An=[];for(const jn of _t)if(jn.linkId===Fr.linkId&&An.push(jn),jn.item&&jn.item.length>0){const qn=y0(jn.item);An.push(...qn)}return An},ct=y0(Oo)[Vr];return ct?.item?ct.item:[]},dn=(Vr,y0)=>{if(isHiddenExtensionPresent(Vr))return null;const ci=kn(y0);if(!isQuestionEnabledForInstance(Vr.enableWhen,Vr.enableBehavior,Oo||[],Fr.linkId,y0))return null;if(Vr.repeats){const qn=findNestedAnswer(ci,Vr.linkId),Hr=Zi(q0({},fr),{item:Vr,selectedAnswer:qn||[{}],errors:getInstanceErrors($o,Fr,y0),handleInputChange:(u0,ai,E0)=>fo(u0,ai,E0,y0)});return jsx("div",{children:jsx(ro,Zi(q0({},Hr),{isNestedRepeatedItem:!0}))},Vr.linkId)}if(Vr.type==="group"&&Vr.item&&!getUIToolkitCode(Vr?.extension||[]))return jsxs("div",{children:[Vr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:Vr.text}),jsx("div",{className:"space-y-3",children:Vr.item.map(qn=>{if(!isQuestionEnabledForInstance(qn.enableWhen,qn.enableBehavior,Oo||[],Fr.linkId,y0))return null;const u0=qi(qn,Ro,fr.isLoading,fr.externalComponentRenderMap);if(!u0)return null;const ai=findNestedAnswer(ci,qn.linkId),E0=Zi(q0({},fr),{item:qn,selectedAnswer:ai,placeholder:getPlaceholderFromExtensions(qn.extension,qn.type),errors:getInstanceErrors($o,Fr,y0),handleInputChange:(Z0,Li,j0)=>fo(Z0,Li,j0,y0)});return createElement(u0,Zi(q0({},E0),{key:qn.linkId}))})})]},Vr.linkId);const _t=qi(Vr,Ro,fr.isLoading,fr.externalComponentRenderMap);if(!_t)return null;const An=findNestedAnswer(ci,Vr.linkId),jn=Zi(q0({},fr),{item:Vr,selectedAnswer:An,placeholder:getPlaceholderFromExtensions(Vr.extension,Vr.type),errors:getInstanceErrors($o,Fr,y0),handleInputChange:(qn,Hr,u0)=>fo(qn,Hr,u0,y0)});return createElement(_t,Zi(q0({},jn),{key:`${Vr.linkId}-${y0}`}))},cr=()=>{const Vr=getDirectErrors($o,po);return jsxs("div",{className:"flex flex-col gap-2",children:[Vr[po]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Vr[po]}),!nn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:fr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Ir=Vr=>mt.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>vn(Vr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${Vr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:fr.isLoading}),e0=qi(Fr,Ro,fr.isLoading,fr.externalComponentRenderMap);return hasRepeatingParent(Fr,Ro)&&!zo?null:!Le||Le&&hasCheckboxExtension(Fr)?e0?jsx(e0,Zi(q0({},fr),{placeholder:Fe,errors:{[Fr.linkId]:((n0=$o?.[Fr.linkId])==null?void 0:n0[0])||""}})):null:Fr.type==="group"&&Fr.item&&Fr.item.length>0&&Fr.repeats?jsxs("div",{"data-testid":`${po}-repeating`,children:[wn&&jsx(FHIRQuestionnaireQuestionText,{text:wn,required:Tr||!1}),mt.map(Vr=>{var y0;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${Vr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Vr+1]}),Ir(Vr)]}),jsx("div",{className:"space-y-4",children:(y0=Fr.item)==null?void 0:y0.map(ci=>dn(ci,Vr))})]},`${po}-instance-${Vr}`)}),cr()]}):e0?jsxs("div",{"data-testid":`${po}-repeating`,children:[mt.map(Vr=>{const y0=Vi?.[Vr]?[Vi[Vr]]:void 0,ci=Zi(q0({},fr),{item:Fr,selectedAnswer:y0,errors:getInstanceErrors($o,Fr,Vr),handleInputChange:(ct,_t,An)=>fo(ct,_t,An,Vr)});return jsxs("div",{className:"relative mb-2",children:[jsxs("div",{className:"flex items-end justify-between",children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Vr+1]}),Ir(Vr)]}),jsx(e0,q0({},ci))]},`${po}-instance-${Vr}`)}),jsxs("div",{children:[(()=>{const y0=getDirectErrors($o,po)[po];return y0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:y0})})(),!nn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:fr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Do=Object.defineProperty,fa=Object.defineProperties,Zo=Object.getOwnPropertyDescriptors,pa=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,ja=(fr,n0,Fr)=>n0 in fr?Do(fr,n0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[n0]=Fr,es=(fr,n0)=>{for(var Fr in n0||(n0={}))Ya.call(n0,Fr)&&ja(fr,Fr,n0[Fr]);if(pa)for(var Fr of pa(n0))Is.call(n0,Fr)&&ja(fr,Fr,n0[Fr]);return fr},zs=(fr,n0)=>fa(fr,Zo(n0));const Qa=null,Ws=({formId:fr,questionnaireSchema:n0,questionnaireResponseItem:Fr,errorConfig:Vi,customErrorConfigurations:fo,showQuestionPrefix:Ao=!0,isAdaptiveFlow:$o=!1,status:Ro,hideBackButton:Oo=!1,showStepper:zo=!1,onComplete:po,onClearError:Cr,handleHiddenQuestion:Qn,onGoBack:Tr,onFormDataChange:Le=()=>{},externalComponentRenderMap:Ce,children:Fe})=>{var mt,Ut;const{setHandleContinueButtonClick:nn,setHandleBackButtonClick:wn,setIsCurrentFormValid:nr,setCurrentGroupLinkId:vn,setCurrentGroupIndex:kn,setTotalSteps:dn,setHideFooterButton:cr,setIsInlineNextQuestionTriggered:Ir,isCurrentFormValid:e0,currentGroupIndex:M0,isLoading:Vr,hasCustomError:y0,groupItemIndicesRef:ci}=useFHIRQuestionnaire(),{trackEvent:ct}=useAnalytics(),[_t,An]=useState([]),[jn,qn]=useState(new Set),[Hr,u0]=useState([]),[ai,E0]=useState([]),Z0=ci,Li=useRef(new Map),j0=useRef(new Set),[Ei,X0]=useState({}),[b0,vi]=useState(!1),[H0,Io]=useState(n0),Ii=useRef(Fr||[]),yo=useRef(!1),ga=useRef(!1),Go=useMemo(()=>getTotalStepsFromQuestionnaire(n0),[n0]),[Ds,Fs]=useState(!1),Ho=useRef([]),u1=(Ui,Ji)=>{var ji,Wo,Da,La,Xa;if(isCallNextQuestionExtensionPresent(Ui))return Ui.linkId;const Ra=validateCurrentPage(Ji,_t,M0,H0,Z0),Ka=Z0.current[M0],k1=M0+1,z1=Z0.current[k1],ll=M0===0?0:Ka,Bl=(Wo=z1??((ji=H0?.item)==null?void 0:ji.length))!=null?Wo:0;let fl=-1;for(let lt=ll;lt<Bl;lt++){const lr=(Da=H0?.item)==null?void 0:Da[lt];if(lr?.linkId===Ui.linkId){fl=lt;break}}const Ql=(lt,lr=[])=>(lt.forEach(To=>{var Ga;if((!To.enableWhen||isQuestionEnabled(To.enableWhen,To.enableBehavior,Ji))&&isCallNextQuestionExtensionPresent(To)&&!Ho.current.includes(To.linkId))if(To.required){const m1=(Ga=findResponseItem(Ji,To.linkId))==null?void 0:Ga.answer;(m1&&m1.length>0&&Object.keys(m1[0]).length>0||To.initial&&To.initial.length>0&&!jn.has(To.linkId))&&lr.push(To.linkId)}else lr.push(To.linkId);To.item&&To.item.length>0&&Ql(To.item,lr)}),lr),Mu=[],Tn=fl!==-1?fl+1:Bl;for(let lt=ll;lt<Tn;lt++){const lr=(La=H0?.item)==null?void 0:La[lt];lr&&Ql([lr],Mu)}if(Mu.length>0&&Ra){const lt=Mu[Mu.length-1],lr=m1=>m1.flatMap(P1=>[P1,...P1.item?lr(P1.item):[]]),To=lr((Xa=H0?.item)!=null?Xa:[]),Ga=To.findIndex(m1=>m1.linkId===lt),Ia=To.findIndex(m1=>m1.linkId===Ui.linkId);return Ga!==-1&&Ia>Ga?void 0:lt}},Hs=Ui=>u1(Ui,Ii.current)?!0:Ui.item&&Ui.item.length>0?Ui.item.some(Hs):!1,bs=()=>{var Ui;if(!$o||M0<0||!H0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const Ji=Z0.current[M0],Wo=(Li.current.get(Ji)||[Ji]).some(Xa=>{var Ra;const Ka=(Ra=H0.item)==null?void 0:Ra[Xa];return Ka?Hs(Ka):!1}),Da=M0<Z0.current.length-1;let La=!1;if(Wo&&Da){const Xa=M0+1,Ra=Z0.current[Xa],Ka=(Ui=H0?.item)==null?void 0:Ui[Ra],k1=!Ka?.enableWhen||isQuestionEnabled(Ka.enableWhen,Ka.enableBehavior,Ii.current),z1=Ka?isPageExtensionPresent(Ka):!1;La=k1&&z1}return{shouldTriggerInlineLoading:Wo,canNavigateToNextGroup:La,hasMoreGroups:Da}},w1=(Ui,Ji,ji,Wo)=>{const Da=getUpdatedFormData(H0?.item||[],Ii.current,Ui,Ji,ji,Wo);return Ii.current=Da,Le(Da),Da},Or=(Ui,Ji,ji,Wo,Da)=>{w1(Ji,ji,Wo,Da),Wo.forEach(La=>{const Xa=getValidationError(zs(es({},Ui),{linkId:La.linkId}),Ii.current,La.answer);Xa&&X0(Ra=>zs(es({},Ra),{[La.linkId]:typeof Da=="number"?zs(es({},Ra[La.linkId]),{[Da]:Xa}):Xa}))})},er=(Ui,Ji,ji,Wo,Da)=>{var La;const Xa=w1(Ji,ji,Wo,Da),Ra=(La=findResponseItem(Xa,Ji))==null?void 0:La.answer,Ka=getValidationError(Ui,Ii.current,Ra);X0(k1=>zs(es({},k1),{[Ji]:typeof Da=="number"?zs(es({},k1[Ji]),{[Da]:Ka}):Ka}))},Rr=(Ui,Ji)=>{const ji=validateCurrentPage(Ji,_t,M0,H0,Z0);if(nr(ji),H0?.item){const Wo=validateAllItemsRecursively(H0.item,Ji);if(Object.keys(Wo).length>0)X0(Da=>es(es({},Da),Wo));else{const Da=H0.item,La={},Xa=Ra=>{Ra.forEach(Ka=>{La[Ka.linkId]={},Ka.item&&Xa(Ka.item)})};Xa(Da),X0(Ra=>es(es({},Ra),La))}}},ur=(Ui,Ji,ji,Wo,Da=!1)=>{var La;const{linkId:Xa}=Ui;if(Da)return Ii.current=ji||[],Rr(Xa,ji||[]),Ii.current;if(ji&&ji.length>0&&Ui.type==="group"&&Ui.repeats){let z1=Ii.current.length;for(let Bl=Ii.current.length-1;Bl>=0;Bl--)if(Ii.current[Bl].linkId===Xa){z1=Bl+1;break}const ll=[...Ii.current.slice(0,z1),...ji,...Ii.current.slice(z1)];return Ii.current=ll,Rr(Xa,ll),Ii.current}if(typeof Wo=="number"&&Ji){const z1=hasRepeatingParent(Ui,H0?.item||[]);if(z1){const ll=Ii.current.filter(fl=>fl.linkId===z1.linkId);if(Wo<ll.length){const fl=Ii.current.map(Ql=>{if(Ql.linkId===z1.linkId&&Ii.current.slice(0,Ii.current.indexOf(Ql)).filter(Tn=>Tn.linkId===z1.linkId).length===Wo){const Tn=(To,Ga)=>{const Ia=new Map(To.map(P1=>[P1.linkId,P1])),m1=[];return Ga?.forEach(P1=>{const gl=Ia.get(P1.linkId);if(P1.linkId===Xa)m1.push(es({linkId:P1.linkId,text:P1.text,answer:Ji},gl?.item&&{item:gl.item}));else if(gl)if(P1.item&&P1.item.length>0){const c1=Tn(gl.item||[],P1.item);m1.push(zs(es({},gl),{item:c1}))}else m1.push(gl);else if(P1.item&&P1.item.length>0){const c1=Tn([],P1.item);c1.some(g1=>g1.linkId===Xa||g1.item&&lt(g1.item,Xa))&&m1.push({linkId:P1.linkId,text:P1.text,answer:[{}],item:c1})}Ia.delete(P1.linkId)}),Ia.forEach(P1=>{m1.push(P1)}),m1},lt=(To,Ga)=>To.some(Ia=>Ia.linkId===Ga||Ia.item&&lt(Ia.item,Ga)),lr=Tn(Ql.item||[],z1.item);return zs(es({},Ql),{item:lr})}return Ql});Ii.current=fl,Le(fl)}else{const fl=Wo+1,Ql=ll.length;if(Ql<fl||fl===1){const Mu=[],Tn=(To,Ga,Ia)=>To.map(m1=>{const P1={linkId:m1.linkId,text:m1.text,answer:m1.linkId===Ga?Ia:[{}]};return m1.item&&m1.item.length>0&&(P1.item=Tn(m1.item,Ga,Ia)),P1});for(let To=Ql;To<fl;To++){const Ga=z1.item?Tn(z1.item,Xa,Ji):[],Ia={linkId:z1.linkId,text:z1.text,answer:[{}],item:Ga};Mu.push(Ia)}let lt=Ii.current.length;for(let To=Ii.current.length-1;To>=0;To--)if(Ii.current[To].linkId===z1.linkId){lt=To+1;break}const lr=[...Ii.current.slice(0,lt),...Mu,...Ii.current.slice(lt)];Ii.current=lr,Le(lr)}}const Bl=getValidationError(Ui,Ii.current,Ji);return X0(fl=>zs(es({},fl),{[Xa]:typeof Wo=="number"?zs(es({},fl[Xa]),{[Wo]:Bl}):Bl})),Rr(Xa,Ii.current),Ii.current}}if(typeof Wo=="number")return ji&&ji.length>0?Or(Ui,Xa,Ji,ji,Wo):er(Ui,Xa,Ji,ji,Wo),Ii.current;const Ra=w1(Xa,Ji,ji),Ka=(La=findResponseItem(Ra,Xa))==null?void 0:La.answer,k1=getValidationError(Ui,Ra,Ka);return X0(z1=>zs(es({},z1),{[Xa]:typeof Wo=="number"?zs(es({},z1[Xa]),{[Wo]:k1}):k1})),Rr(Xa,Ra),Ii.current},_r=()=>{var Ui;for(let Ji=M0+1;Ji<Z0.current.length;Ji++){const ji=Z0.current[Ji],Wo=(Ui=H0?.item)==null?void 0:Ui[ji];if(!!Wo&&(!Wo.enableWhen||isQuestionEnabled(Wo.enableWhen,Wo.enableBehavior,Ii.current)))return!0}return!1},w0=()=>{var Ui,Ji,ji,Wo,Da;const La=(Ui=n0?.item)==null?void 0:Ui[Z0.current[M0]];if(La){const Ka=(Ji=getAnalyticsEventName(La))!=null?Ji:"questionnaire_form",k1=getAnalyticsPageName(La);if(k1){const z1=(ji=getAnalyticsFormName(n0))!=null?ji:n0.name,ll=collectAnalyticsProperties(La,Ii.current),Bl={};z1&&(Bl.form_name=z1),Bl.page_name=k1,Object.assign(Bl,ll),ct(Ka,Bl)}}const Xa=M0<Z0.current.length-1,Ra=checkCurrentStepDataMatch(Ii.current,H0,Z0.current,M0,Fr,Z0.current.length-1);if($o&&Xa){const Ka=M0+1,k1=Z0.current[Ka],z1=(Wo=H0?.item)==null?void 0:Wo[k1],ll=!z1?.enableWhen||isQuestionEnabled(z1.enableWhen,z1.enableBehavior,Ii.current),Bl=z1?isPageExtensionPresent(z1):!1;if(ll&&Bl&&Ra){kn(Ka),nr(!1),window.scrollTo(0,0);return}}if(Ra&&Z0.current.length>0){_r()?kn(M0+1):(po(removeDisabledItems(Ii.current,H0?.item||[])),nr(!1),window.scrollTo(0,0));return}if(M0<Z0.current.length-1){const Ka=(Da=H0?.item)==null?void 0:Da[Z0.current[M0]];if(!Ka){po(removeDisabledItems(Ii.current,H0?.item||[]));return}const k1=Ka.linkId,z1=findLastGroupInstanceIndex(Ii.current,k1),ll=Ii.current.slice(0,z1+1);if(!validateCurrentPage(ll,_t,M0,H0,Z0))return;$o?(Ii.current=ll,Le(ll),po(Ii.current),nr(!1)):Z0.current.length>0&&(_r()?kn(M0+1):(po(removeDisabledItems(Ii.current,H0?.item||[])),window.scrollTo(0,0)))}else po(removeDisabledItems(Ii.current,H0?.item||[])),nr(!1),window.scrollTo(0,0)};useEffect(()=>{var Ui;nn(()=>w0),wn(()=>vo),nr(e0);const Ji=(Ui=H0?.item)==null?void 0:Ui[Z0.current[M0]];Ji&&vn(Ji.linkId)},[e0,M0]),useEffect(()=>{if(!n0?.item)return;const{groupIndices:Ui,itemsToRenderMap:Ji}=collectGroupItemIndices(n0.item);Z0.current=Ui,Li.current=Ji;const ji=Go??Ui.length;dn(ji),u0(Ui),$o?(ga.current||kn(Ui.length>0?Ui.length-1:0),Ir(!1),ga.current=!1):M0===-1&&kn(0)},[n0?.item,Go]),useEffect(()=>{if(M0<0||!H0?.item)return;const Ui=validateCurrentPage(Ii.current,_t,M0,H0,Z0);if(!Ui){nr(!1);return}const{shouldTriggerInlineLoading:Ji,canNavigateToNextGroup:ji,hasMoreGroups:Wo}=bs();if($o&&Ji){if(!Wo){nr(!1);return}if(ji&&Ui){nr(!0);return}else{nr(!1);return}}nr(Ui)},[M0,H0?.item,y0,$o,Ii.current,_t]),useEffect(()=>{if(!n0?.item||yo.current)return;const Ui=initializeQuestionnaireItems(n0.item,Ii.current,n0.item,Ii.current);if(Ui!==Ii.current){Ii.current=Ui;const ji=(Da=>{const La=new Set,Xa=Ra=>{Ra.forEach(Ka=>{var k1;const z1=Ka.initial&&Ka.initial.length>0,ll=(Ka.type==="choice"||Ka.type==="open-choice")&&((k1=Ka.answerOption)==null?void 0:k1.some(Bl=>Bl.initialSelected===!0));(z1||ll)&&(!Ka.enableWhen||isQuestionEnabled(Ka.enableWhen,Ka.enableBehavior,Ii.current))&&La.add(Ka.linkId),Ka.item&&Xa(Ka.item)})};return Xa(Da),La})(H0?.item||[]);qn(ji);const Wo=validateAllItemsRecursively(H0?.item||[],Ii.current);Object.keys(Wo).length>0&&X0(Da=>es(es({},Da),Wo))}yo.current=!0},[H0?.item,n0]),useEffect(()=>{Io(n0)},[n0]),useEffect(()=>{M0>=0&&window.scrollTo(0,0)},[M0]),useEffect(()=>{var Ui;if(!$o||_t.length===0||Vr||!H0?.item)return;const Ji=Z0.current[M0];if(Ji===void 0)return;const ji=Li.current.get(Ji)||[Ji],Wo=[];if(ji.forEach(Ka=>{var k1;const z1=(k1=H0?.item)==null?void 0:k1[Ka];z1&&hasInitialValue(z1)&&Wo.push(z1)}),Wo.length===0||!Wo.some(Ka=>u1(Ka,Ii.current)&&!Ho.current.includes(Ka.linkId)?(Ho.current.push(Ka.linkId),!0):!1))return;const La=validateCurrentPage(Ii.current,_t,M0,H0,Z0),Xa=(Ui=H0?.item)==null?void 0:Ui[Ji],Ra=isHiddenAnswerInValid(Xa,Ii.current);!La||Ra||(j0.current.add(M0),Ir(!0),ga.current=!0,Y0(Wo[Wo.length-1].linkId))},[M0,_t,$o,Vr,H0]);const Y0=(Ui,Ji=!1,ji=!1)=>{var Wo;if(Ji){po(removeDisabledItems(Ii.current,H0?.item||[]),ji),nr(!1);return}const Da=findQuestionByLinkId(H0?.item||[],Ui);if(!Da)return;const La=(Wo=findResponseItem(Ii.current,Ui))==null?void 0:Wo.answer;if(getValidationError(Da,Ii.current,La))return;const Xa=getUpdatedFormData(H0?.item||[],Ii.current,Ui,La),Ra=u1(Da,Xa);if(!Ra)return;nr(!1);const Ka=findRootGroupLinkId(H0?.item||[],Ui);let k1=Xa,z1=[];const ll=deepTrimFormData(Xa,Ra,H0?.item||[]);k1=ll.trimmedData,z1=ll.trimmedLinkIds;const Bl=findQuestionByLinkId(H0?.item||[],Ka||"");Ii.current=k1;const fl=findGroupPositionByLinkId(H0?.item||[],Ui||""),Ql=fl!==-1?fl:M0;if(validateCurrentPage(k1,_t,Ql,H0,Z0,z1)&&!isHiddenAnswerInValid(Bl,k1)){Ir(!0),ga.current=!0;let Tn;const lt=(()=>{var Ga;const Ia=s1=>s1.flatMap(g1=>[g1,...g1.item?Ia(g1.item):[]]),m1=Ia((Ga=H0?.item)!=null?Ga:[]),P1=m1.findIndex(s1=>s1.linkId===Ra),gl=new Set;let c1=!0;for(;c1;){c1=!1;for(const s1 of m1){if(gl.has(s1.linkId)||!s1.enableWhen)continue;s1.enableWhen.some(J1=>{const ql=m1.findIndex(zl=>zl.linkId===J1.question);return ql!==-1&&ql<=P1||gl.has(J1.question)})&&(gl.add(s1.linkId),c1=!0)}}return z1.filter(s1=>!gl.has(s1))})();lt.length>0&&(Tn=removeItemsFromSchema(H0?.item||[],lt),Io(zs(es({},H0),{item:Tn})));const To=((Ga,Ia)=>{const m1=[];let P1=!1;const gl=c1=>{for(const s1 of c1)P1?(m1.push(s1.linkId),s1.item&&gl(s1.item)):s1.linkId===Ia?P1=!0:s1.item&&gl(s1.item)};return gl(Ga),m1})(H0?.item||[],Ra);To.length>0&&(Ho.current=Ho.current.filter(Ga=>!To.includes(Ga)),qn(Ga=>{const Ia=new Set(Ga);return To.forEach(m1=>Ia.delete(m1)),Ia})),Ho.current.push(Ra),po(removeDisabledItems(k1,H0?.item||[]),!0,Tn)}},Wt=(Ui,Ji,ji=!1)=>{const Wo=updateItemWithReadOnlyExpression(Ui,H0),Da={item:Wo,selectedAnswer:Ji,handleInputChange:ur,showQuestionPrefix:Ao,onCompleteHandler:Y0,errors:Ei,isLoading:Vr,isCurrentFormValid:e0,contained:H0?.contained,questionnaireSchemaItems:H0?.item,customErrorConfigurations:fo,formData:Ii.current,showStepper:zo,totalStepsFromExtension:Go,externalComponentRenderMap:Ce,hintText:getHintTextFromExtensions(Wo.extension)};if(typeof Qn=="function"&&ji)Qn(Ui,Da,Ii.current);else if(Ui.type in typeToRenderFunctionMap&&!ji)return _t.includes(Ui.linkId)||An(La=>[...La,Ui.linkId]),jsx(RenderFHIRQuestionnaireItem,es({},Da),Ui.linkId);return null},io=Ui=>Ui.map(Ji=>{var ji,Wo;const Da=isHiddenExtensionPresent(Ji);let La=(ji=findResponseItem(Ii.current,Ji.linkId))==null?void 0:ji.answer;if((!La||Object.keys((Wo=La?.[0])!=null?Wo:{}).length===0)&&!jn.has(Ji.linkId)){if(Ji.initial&&Ji.initial.length>0)La=Ji.initial,qn(Xa=>new Set(Xa).add(Ji.linkId));else if((Ji.type==="choice"||Ji.type==="open-choice")&&Ji.answerOption){const Xa=Ji.answerOption.filter(Ra=>Ra.initialSelected===!0);Xa.length>0&&(La=Xa.map(Ra=>{let Ka={};return Ra.valueCoding?Ka={valueCoding:{code:Ra.valueCoding.code,display:Ra.valueCoding.display,system:Ra.valueCoding.system}}:Ra.valueReference&&(Ka={valueReference:{reference:Ra.valueReference.reference,display:Ra.valueReference.display}}),Ka}).filter(Ra=>Object.keys(Ra).length>0),qn(Ra=>new Set(Ra).add(Ji.linkId)))}La&&(Ii.current=getUpdatedFormData(H0?.item||[],Ii.current,Ji.linkId,La))}if(!Ji?.enableWhen||isQuestionEnabled(Ji?.enableWhen,Ji.enableBehavior,Ii.current)){const Xa=Qa.includes(Ji.linkId)||getUIToolkitCode(Ji.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Wt(Ji,La,Da),Ji.item&&!Da&&(Xa?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:io(Ji.item)})}):io(Ji.item))]},Ji.linkId)}else if(Ji.type==="group"&&!Da)return ai.includes(Ji.linkId)||(Go===void 0&&dn(Z0.current.length-1||-1),Z0.current=Z0.current.filter((Xa,Ra)=>Ra!==M0),E0(Xa=>[...Xa,Ji.linkId])),null});if(M0>=0){const Ui=[];let Ji=0,ji=0;for(;Ji<Hr.length&&ji<Z0.current.length;){const Wo=Hr[Ji],Da=Z0.current[ji];if(Wo<Da){const La=(mt=H0?.item)==null?void 0:mt[Wo];(!La?.enableWhen||isQuestionEnabled(La.enableWhen,La.enableBehavior,Ii.current))&&Ui.push(Ji),Ji++}else Wo===Da&&Ji++,ji++}for(;Ji<Hr.length;){const Wo=Hr[Ji],Da=(Ut=H0?.item)==null?void 0:Ut[Wo];(!Da?.enableWhen||isQuestionEnabled(Da.enableWhen,Da.enableBehavior,Ii.current))&&Ui.push(Ji),Ji++}if(Ui.length>0){Go===void 0&&dn(Z0.current.length+Ui.length),Ui.reverse().forEach(Da=>{const La=Hr[Da];let Xa=0;for(let Ra=0;Ra<Z0.current.length;Ra++){if(Z0.current[Ra]>La){Xa=Ra;break}Xa=Ra+1}Z0.current.splice(Xa,0,La)});const Wo=Ui.map(Da=>{var La;const Xa=Hr[Da],Ra=(La=H0?.item)==null?void 0:La[Xa];return Ra?.linkId}).filter(Boolean);E0(Da=>Da.filter(La=>!Wo.includes(La)))}Hr.forEach(Wo=>{var Da;const La=(Da=H0?.item)==null?void 0:Da[Wo];La?.enableWhen&&!isQuestionEnabled(La.enableWhen,La.enableBehavior,Ii.current)&&Ii.current.some(Ra=>Ra.linkId===La.linkId)&&(Ii.current=removeAnswerFromFormData(Ii.current,La.linkId))})}const vo=()=>{var Ui;if(Vi&&!b0&&M0>0&&Ro!=="completed")kn(Z0.current.length-1),vi(!0),cr(!1),Cr?.();else if(M0>0&&Ro!=="completed"){let Ji=M0-1;for(;Ji>0;){const ji=Z0.current[Ji],Wo=(Ui=H0?.item)==null?void 0:Ui[ji];if(!Wo?.enableWhen||isQuestionEnabled(Wo.enableWhen,Wo.enableBehavior,Ii.current))break;Ji--}kn(Ji),nr(!0),cr(!1),Cr?.()}else Tr?.()},Ea=Ui=>Ui.preventDefault();return useEffect(()=>{const Ui=setTimeout(()=>{Fs(!0)},0);return()=>clearTimeout(Ui)},[]),Ds?jsxs(Fragment,{children:[jsxs("form",{id:fr,className:"w-full","data-testid":"questionnaire-form",onSubmit:Ea,children:[!Oo&&jsxs("div",{className:"tw group text-secondary gap-md mb-2xl hover:text-secondary_hover flex w-fit cursor-pointer items-center text-sm font-semibold hover:font-bold",role:"button","data-testid":"questionnaire-back-button",tabIndex:0,onClick:()=>vo(),onKeyDown:Ui=>{(Ui.key==="Enter"||Ui.key===" ")&&vo()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Vi&&!b0?jsx(EmptyState,{className:"mt-5xl",title:Vi.title,description:Vi.description,featuredIconProps:{icon:Vi.icon,color:"gray"},primaryButton:Vi.primaryButton,secondaryButton:Vi.secondaryButton?zs(es({},Vi.secondaryButton),{onClick:vo}):void 0}):jsxs(Fragment,{children:[!H0?.item&&Vr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),H0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:io(M0>=0?H0.item.filter((Ui,Ji)=>{const ji=Z0.current[M0];return(Li.current.get(ji)||[ji]).includes(Ji)}):H0?.item||[])})]})]}),yo.current&&Fe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>p});var n=e(31085),t=e(14041),r=e(36087),s=e(76260),i=e(25624),o=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,b)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[f]=b,d=(h,f)=>{for(var b in f||(f={}))y.call(f,b)&&m(h,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(h,b,f[b]);return h},O=(h,f)=>g(h,c(f));const v=({selected:h,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},p=({item:h,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,o.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),R=N=>{var w,V;if(!b)return!1;const q=(0,i.MU)(b,N);return((V=(w=q?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,b]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||E.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,E.length,x,z]),(0,t.useEffect)(()=>{C.forEach(N=>{var w,V;const q=b?(0,i.MU)(b,N.linkId):void 0;(!q||((V=(w=q.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:E.map(N=>{var w,V,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>o});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const i=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},o=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,p;if(!c)return!1;const h=(0,s.MU)(c,O);return((p=(v=h?.answer)==null?void 0:v[0])==null?void 0:p.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var v;const p=m(O.linkId);return(0,n.jsx)(i,{label:(v=O.text)!=null?v:"",selected:p,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(76260);const s=({item:i})=>{var o,a,g,c;const u=i.text||"",y=(a=(o=i.extension)==null?void 0:o.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=i.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":i.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,A=(p,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(p,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(p,f,h[f]);return p},m=(p,h)=>o(p,a(h));const d=(0,t.createContext)(void 0),O=()=>{const p=(0,t.useContext)(d);if(!p)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return p},v=({children:p,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),ie=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!h)return;const he=h[ne];if(!he)return;let de;if(Array.isArray(he))if(me)de=he.find(Ee=>Ee.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(me&&he.inputType&&he.inputType!==me)return;de=he}if(!de)return;let ue=A({},ae);de.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=de.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);de.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=de.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=de.eventName,ve=de.description;f(J,m(A(A({},re),de.properties),{_event_metadata:ve?{description:ve}:void 0}))},[h,f]),ge={isCurrentFormValid:T,currentGroupLinkId:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:ie,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:p})}},35473:(Y,l,e)=>{"use strict";var n=e(28058),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var i=e(25624),o=e(76260),a=e(7630),g=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:i,onActionButtonClick:o,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),i&&o&&(0,n.jsx)(t.Button,{color:"link-color",onClick:o,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:i})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>i});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const i=({infoDetails:o,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>y(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:o.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const p=Array.isArray(d.value)?d.value:[d.value];return p.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:p.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(p[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),i=e(76808),o=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,p=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&p(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&p(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,E)=>{var C=P=>{try{L(T.next(P))}catch(D){E(D)}},R=P=>{try{L(T.throw(P))}catch(D){E(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(C,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:E})=>{const{locationPermission:C,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{w(f(h({},N),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield L(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,E]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),ie=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,w,N,I,S,E]),te=(0,t.useCallback)(()=>ie("close"),[ie]),pe=(0,t.useCallback)(()=>ie("cancel"),[ie]);return(0,n.jsx)(o.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))i.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))o.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const p=c(y);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:p})}catch(p){console.error("Failed to load Lottie animation:",p)}return()=>{var p;(p=v.current)==null||p.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const i=y=>y*1609.34;var o=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:p})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:p||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:i(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,o.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,o.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,o.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:o,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:o,size:"md",initials:getInitials(o),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:o}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},i=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:i,fullImageHeader:o=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[o?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),i&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:i})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:i,icon:o})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:o.icon,color:(a=o.color)!=null?a:"brand",size:"lg",className:o.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),i&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:i})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>Ye});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Qe=24,color:Lt="currentColor",...mn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Qe,height:Qe,stroke:Lt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...mn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var i=e(14449),o=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Qe){Qe()}let y=null;const A=Qe=>y=Qe,m=()=>y,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Qe=>{h=Qe},b=(Qe,Lt)=>Qe===Lt;function M(Qe=d){const Lt=Qe===d?v:()=>(0,r.useContext)(Qe);return function(zn,et=b){const{store:Pt,subscription:qt,getServerState:Wn}=Lt(),yr=h(qt.addNestedSub,Pt.getState,Wn||Pt.getState,zn,et);return(0,r.useDebugValue)(yr),yr}}const x=M();var z=e(75985),T=e(524);function S(){const Qe=getBatch();let Lt=null,mn=null;return{clear(){Lt=null,mn=null},notify(){Qe(()=>{let zn=Lt;for(;zn;)zn.callback(),zn=zn.next})},get(){let zn=[],et=Lt;for(;et;)zn.push(et),et=et.next;return zn},subscribe(zn){let et=!0,Pt=mn={callback:zn,next:null,prev:mn};return Pt.prev?Pt.prev.next=Pt:Lt=Pt,function(){!et||Lt===null||(et=!1,Pt.next?Pt.next.prev=Pt.prev:mn=Pt.prev,Pt.prev?Pt.prev.next=Pt.next:Lt=Pt.next)}}}}const E={notify(){},get:()=>[]};function C(Qe,Lt){let mn,zn=E;function et(pr){return yr(),zn.subscribe(pr)}function Pt(){zn.notify()}function qt(){In.onStateChange&&In.onStateChange()}function Wn(){return Boolean(mn)}function yr(){mn||(mn=Lt?Lt.addNestedSub(qt):Qe.subscribe(qt),zn=S())}function gn(){mn&&(mn(),mn=void 0,zn.clear(),zn=E)}const In={addNestedSub:et,notifyNestedSubs:Pt,handleChangeWrapper:qt,isSubscribed:Wn,trySubscribe:yr,tryUnsubscribe:gn,getListeners:()=>zn};return In}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Qe=>{D=Qe},w=null,V=null,q=Qe=>{try{return JSON.stringify(Qe)}catch{return String(Qe)}};function I(Qe,Lt,mn){useIsomorphicLayoutEffect(()=>Qe(...Lt),mn)}function k(Qe,Lt,mn,zn,et,Pt){Qe.current=zn,mn.current=!1,et.current&&(et.current=null,Pt())}function U(Qe,Lt,mn,zn,et,Pt,qt,Wn,yr,gn,In){if(!Qe)return()=>{};let pr=!1,$n=null;const Wr=()=>{if(pr||!Wn.current)return;const Nt=Lt.getState();let $e,it;try{$e=zn(Nt,et.current)}catch(Je){it=Je,$n=Je}it||($n=null),$e===Pt.current?qt.current||gn():(Pt.current=$e,yr.current=$e,qt.current=!0,In())};return mn.onStateChange=Wr,mn.trySubscribe(),Wr(),()=>{if(pr=!0,mn.tryUnsubscribe(),mn.onStateChange=null,$n)throw $n}}const F=()=>w;function K(Qe,Lt){return Qe===Lt}let G=!1;function se(Qe,Lt,mn,{pure:zn,areStatesEqual:et=K,areOwnPropsEqual:Pt=shallowEqual,areStatePropsEqual:qt=shallowEqual,areMergedPropsEqual:Wn=shallowEqual,forwardRef:yr=!1,context:gn=ReactReduxContext}={}){const In=gn,pr=mapStateToPropsFactory(Qe),$n=mapDispatchToPropsFactory(Lt),Wr=mergePropsFactory(mn),Zr=Boolean(Qe);return $e=>{const it=$e.displayName||$e.name||"Component",Je=`Connect(${it})`,tt={shouldHandleStateChanges:Zr,displayName:Je,wrappedComponentName:it,WrappedComponent:$e,initMapStateToProps:pr,initMapDispatchToProps:$n,initMergeProps:Wr,areStatesEqual:et,areStatePropsEqual:qt,areOwnPropsEqual:Pt,areMergedPropsEqual:Wn};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Ln}=st,Dn=_objectWithoutPropertiesLoose(st,P);return[st.context,Ln,Dn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:In,[le,In]),Tt=useContext(Te),Xt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),bn=Boolean(Tt)&&Boolean(Tt.store),xn=Xt?st.store:Tt.store,sr=bn?Tt.getServerState:xn.getState,It=useMemo(()=>defaultSelectorFactory(xn.dispatch,tt),[xn]),[we,Ze]=useMemo(()=>{if(!Zr)return V;const Ln=createSubscription(xn,Xt?void 0:Tt.subscription),Dn=Ln.notifyNestedSubs.bind(Ln);return[Ln,Dn]},[xn,Xt,Tt]),yt=useMemo(()=>Xt?Tt:_extends({},Tt,{subscription:we}),[Xt,Tt,we]),tn=useRef(),rn=useRef(Ue),pn=useRef(),gt=useRef(!1),Jt=useRef(!1),jt=useRef(!1),Dt=useRef();useIsomorphicLayoutEffect(()=>(jt.current=!0,()=>{jt.current=!1}),[]);const $t=useMemo(()=>()=>pn.current&&Ue===rn.current?pn.current:It(xn.getState(),Ue),[xn,Ue]),Qt=useMemo(()=>Dn=>we?U(Zr,xn,we,It,rn,tn,gt,jt,pn,Ze,Dn):()=>{},[we]);I(k,[rn,tn,gt,Ue,pn,Ze]);let yn;try{yn=D(Qt,$t,sr?()=>It(sr(),Ue):$t)}catch(Ln){throw Dt.current&&(Ln.message+=`
872
872
  The error may be correlated with this previous error:
package/native.js CHANGED
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1123.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.13.1"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1374.0",D="@icanbwell/composite. repo version: 0.1374.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1124.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.13.1"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1375.0",D="@icanbwell/composite. repo version: 0.1375.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1123.0",
3
+ "version": "1.1124.0",
4
4
  "author": "icanbwell",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,6 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "repoVersion": "0.1374.0",
47
- "description": "@icanbwell/composite. repo version: 0.1374.0"
46
+ "repoVersion": "0.1375.0",
47
+ "description": "@icanbwell/composite. repo version: 0.1375.0"
48
48
  }