@icanbwell/composite 1.1133.0 → 1.1133.1
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.
- package/index.js +1 -1
- package/native.js +1 -1
- 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:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn,hr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Fn=`bwell-${Kt}`;if(customElements.get(Fn)!==void 0)return;class $r extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Wn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Cr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,zn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",hr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",hr).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,Rt,"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,Rt,"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,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"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,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,zn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Wn=new WeakMap,We=new WeakSet,Cr=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Fn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Fn,utils:(0,p.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Dn=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},hr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Dn).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Dn).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Fn,$r)}),at={rE:"1.1133.0"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,A=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,m=(p,h)=>{for(var f in h||(h={}))u.call(h,f)&&A(p,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&A(p,f,h[f]);return p},d=(p,h)=>a(p,g(h));const O=(p,h,f)=>{const b=_.cloneDeep(p);if(!b.contained||h<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const E=x.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:p,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=h.questionnaire)==null?void 0:w.replace("#",""),U=(N=h?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(h);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=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 C=L=>{try{R(z.next(L))}catch(P){S(P)}},E=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(C,E);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:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=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,oe]=(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,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Ye;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Ye=Ot.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const hr=be.find(tt=>tt.id===Kt),Fn=hr?.label||V;if(!hr)return;q(Fn),k(Fn),setTimeout(()=>{const tt=[{id:hr.id,label:hr.label}];Se(tt),ne(tt)},f);const $r=yield ae({variables:{placeId:Kt}}),Jr=(Xe=(Ct=$r?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=$r?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=$r?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=$r?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(zn=$r?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Jr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Jr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Cr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:Cr.state)||"",Et=((Dn=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Jr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Fn,value:Kt})}else T({latitude:Jr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Fn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const hr=yield ae({variables:{placeId:w}}),Fn=(Xe=(Ct=hr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,$r=(Ot=(We=hr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Jr=((Qe=(Ye=hr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=hr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(zn=hr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Fn&&$r)if(!Jr||!It||!$e){const ot=yield ce({variables:{latitude:String(Fn),longitude:String($r)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Cr=(Wn=ot?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:Cr.state)||"",rt=((Dn=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Fn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Fn,longitude:$r,zipCode:Jr,state:It,stateCode:$e,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||ue||D)},[E,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.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:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",Ot=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=Ot.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.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:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.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:o,title:i})=>{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:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,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),o=e(52449);const i=({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:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,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=(E,R,L)=>R in E?m(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,b=(E,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(E,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(E,L,R[L]);return E},M=(E,R)=>d(E,O(R)),x=(E,R,L)=>new Promise((P,D)=>{var w=q=>{try{V(L.next(q))}catch(I){D(I)}},N=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(w,N);V((L=L.apply(E,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),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.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)}`)}},[N,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!==i.Ef.GRANTED&&Ee!==i.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=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!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(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.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!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.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():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.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(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.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(i.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(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.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(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.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,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},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:()=>It,GI:()=>K,rz:()=>Ot,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>C,gD:()=>T,Vp:()=>$r,Cx:()=>D,bK:()=>L,gi:()=>Jr,Z$:()=>be,GT:()=>Fn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>zn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>N,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>E,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Dn,vf:()=>Wn,PV:()=>hr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>ce,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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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 o=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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",C="http://hl7.org/fhir/questionnaire-item-control",E="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",w="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="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",oe="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",ce="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",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ot="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="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",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Cr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Dn="http://icanbwell.com/fhir/StructureDefinition/trigger-color",hr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Fn="http://hl7.org/fhir/StructureDefinition/mimeType",$r="http://hl7.org/fhir/StructureDefinition/maxSize",Jr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="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",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="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",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.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:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>N,mR:()=>zt,nt:()=>z,od:()=>w,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),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=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,$t;return($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?$t:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},C={date:"MM/DD/YYYY",choice:"Select an option"},E="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&C[Qt]||E},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,$t,Yt)=>Yt.indexOf(Lt)===$t).join(", "),w=(mt,Qt,qt)=>{const Lt=D(mt),$t=Lt.lastIndexOf(","),Yt=$t!==-1?`${Lt.substring(0,$t)} or${Lt.substring($t+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},N=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,$t;const Yt=Qt?.find(On=>On.url.includes(mt));return($t=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?$t:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const $t=Qt?.find(On=>On.url===mt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||q((Lt=$t.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Qt);if($t!==void 0)return $t}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Lt=(0,t.A)($t)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const $t=F(Lt.item,Qt);if($t!==void 0)return $t}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const $t of mt)if($t.linkId===Qt&&Lt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,$t;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date(($t=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?$t:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe($t,void 0):Yt.some(On=>{var Tr;return(Tr=On.answer)==null?void 0:Tr.some(Gr=>oe($t,Gr&&Object.keys(Gr).length>0?Gr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some($t=>Lt($t)):mt?.every($t=>Lt($t)):!0},pe=(mt,Qt,qt,Lt,$t)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var Tr;let Gr;if(Lt&&typeof $t=="number"){const Ln=qt.filter(rn=>rn.linkId===Lt)[$t];if(Ln?.item){const rn=Ln.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(Tr=rn?.answer)==null?void 0:Tr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!Gr){const Pn=K(qt,On.question);if(Pn.length>0)return Pn.some(Ln=>{var rn;return(rn=Ln.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});Gr=void 0}return oe(On,Gr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some($t=>Boolean($t)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Lt,Qt);return b(f({},mt),{readOnly:$t??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:$t,type:Yt,extension:On,enableWhen:Tr,enableBehavior:Gr,repeats:Pn,answerOption:Ln}=mt;if(!te(Tr,Gr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Pn)return ne(mt,Qt,qt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,$t,qt,Ln)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(Gr=>Gr!=null&&Gr!==""&&(Array.isArray(Gr)?Gr.length>0:!0))){$t=!0;const Gr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(Gr)return`Item ${Yt+1}: ${Gr}`;if(mt.item&&mt.item.length>0){const Pn=ae(mt.item,Qt,mt.linkId,Yt);if(Pn)return`Item ${Yt+1}: ${Pn}`}}else return`Item ${Yt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Yt=qt[$t];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(Tr=>Tr!=null&&Tr!==""&&(Array.isArray(Tr)?Tr.length>0:!0))){const Tr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(Tr)return`Item ${$t+1}: ${Tr}`;if(mt.item&&mt.item.length>0){const Gr=ae(mt.item,Qt,mt.linkId,$t);if(Gr)return`Item ${$t+1}: ${Gr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var $t,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const Tr=F(Qt,qt),Gr=($t=Tr?.item)==null?void 0:$t.find(Ln=>Ln.linkId===On.linkId),Pn=(Yt=Gr?.answer)!=null&&Yt[Lt]?[Gr.answer[Lt]]:void 0;if(On.required){if(!Pn||!Pn[0]||!me(Pn[0]))return`${On.text||On.linkId} is required`;const Ln=he(On.extension,On.type,!0,On.maxLength,Pn,On.answerOption);if(Ln)return`${On.text||On.linkId}: ${Ln}`}else if(Pn&&Pn[0]&&me(Pn[0])){const Ln=he(On.extension,On.type,!1,On.maxLength,Pn,On.answerOption);if(Ln)return`${On.text||On.linkId}: ${Ln}`}if(On.item&&On.item.length>0){const Ln=ae(On.item,Qt,On.linkId,Lt);if(Ln)return Ln}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,$t,Yt)=>{var On,Tr,Gr,Pn,Ln;let rn="";const bt=!!mt?.find(En=>{var Zn,Wr;return En.url===y.gD&&((Wr=(Zn=En.valueCodeableConcept)==null?void 0:Zn.coding)==null?void 0:Wr.some(_r=>_r.system===y.n4&&_r.code===y.GI))}),St=$t?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((Tr=St?.valueCoding)==null?void 0:Tr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(Gr=St?.valueQuantity)==null?void 0:Gr.value,reference:(Pn=St?.valueReference)==null?void 0:Pn.display,attachment:(Ln=St?.valueAttachment)==null?void 0:Ln.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Zn=V("regexError",mt),Wr=Zn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(Wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Zn=new RegExp(En),Wr=V("regexError",mt),_r=Wr??"Please enter a valid input";return Zn&&un&&!Zn.test(un)?String(_r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Zn=new Date(En);return isNaN(Zn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const Wr=I(y.dU,mt),_r=U(Wr??"01/01/1900","01/01/1900"),Zr=U(un,"");if(!_r||!Zr)return"";if((0,s.A)(Zr,_r)){const f0=(En=mt?.find(wo=>wo.url===y.Ck))==null?void 0:En.valueString;return f0??`Date should not be before ${Wr??"01/01/1900"}`}return""}const Zn=V("minValue",mt);return Zn!=null&&un!==null&&un!==void 0&&un<Zn?`Input should not be less than ${Zn}`:""},maxValue:()=>{var En;if(Qt==="date"){const Wr=I(y.bK,mt),_r=U(Wr??"01/01/2100","01/01/2100"),Zr=U(un,"");if(!_r||!Zr)return"";if((0,o.A)(Zr,_r)){const f0=(En=mt?.find(wo=>wo.url===y.Cx))==null?void 0:En.valueString;return f0??`Date should not be after ${Wr??"01/01/2100"}`}return""}const Zn=V("maxValue",mt);return Zn!=null&&un!==null&&un!==void 0&&un>Zn?`Input should not exceed ${Zn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const $t=ce(mt,qt.item);if($t)return $t}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var $t,Yt;const{required:On}=mt,Tr=($t=Lt.item)==null?void 0:$t.find(Ln=>Ln.linkId===mt.linkId),Gr=Tr?.answer||[],Pn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Ln=0;Ln<Pn;Ln++){const rn=Gr[Ln];if(On){if(!rn||!me(rn))return`Item ${Ln+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Ln+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Ln+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===y.gD&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,$t,Yt)=>{const On=Gr=>Qt.filter(Pn=>Pn.linkId===Gr),Tr=new Set;return mt.map(Gr=>{if(Tr.has(Gr.linkId)||ve(Gr))return null;const Ln=On(Gr.linkId),rn=Gr.type==="group"&&Gr.repeats;if(Tr.add(Gr.linkId),rn){const bt=[];if(Ln.forEach((St,Zt)=>{const un={linkId:Gr.linkId,text:Gr.text};let on;if(qt===Gr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const En=St?.item||[];on=[...En],$t.forEach(Zn=>{const Wr=on.findIndex(_r=>_r.linkId===Zn.linkId);Wr>=0?on[Wr]=b(f({},En[Wr]),{answer:Zn.answer}):on.push(Zn)})}else Gr.item&&(on=xt(Gr.item,St?.item||[],qt,Lt,$t,Zt));qt===Gr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===Gr.linkId&&typeof Yt=="number"&&Yt>=Ln.length)for(let St=Ln.length;St<=Yt;St++){const Zt={linkId:Gr.linkId,text:Gr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:Gr.item&&(Zt.item=xt(Gr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(Gr.repeats&&typeof Yt=="number"&&qt===Gr.linkId){const bt=Ln[0]||{linkId:Gr.linkId,text:Gr.text,answer:[]},St={linkId:Gr.linkId,text:Gr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Ln[0],St=Gr.item?xt(Gr.item,bt?.item||[],qt,Lt,$t,Yt):void 0,Zt=St&&St.length>0,un={linkId:Gr.linkId,text:Gr.text};return qt&&Gr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!$t?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),$t?un.item=$t:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var $t;const Yt=($t=mt?.item)!=null?$t:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var Tr;const Gr=K(Qt,On.linkId);if(Gr.length===0){const Pn=(Tr=F(Qt,On.linkId))==null?void 0:Tr.answer;if(ge(On,Qt,Pn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Pn of Gr)if(ge(On,Qt,Pn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter($t=>$t.linkId===Qt);if(Lt.length>qt){const $t=Lt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var $t;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},Ot=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const $t=Object.keys(Lt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,$t,Yt)=>{var On;const Tr=(On=Qt?.item)==null?void 0:On[qt[Lt]],Gr=Tr?.linkId;if(!Gr)return!1;const Pn=K(mt,Gr),Ln=K($t,Gr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Pn.length!==Ln.length)return!1;for(let bt=0;bt<Pn.length;bt++){const St=Pn[bt],Zt=Ln[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=$t=>{$t.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let Tr=0;Tr<On.length;Tr++){const Gr=On[Tr];if(Gr?.answer&&Gr.answer.length>0){const Pn=Pt(Yt,Qt,Gr.answer);Pn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[Tr]:Pn}))}}else{const Tr=F(Qt,Yt.linkId);if(Tr?.answer&&Tr.answer.length>0){const Gr=Pt(Yt,Qt,Tr.answer);Gr&&(qt[Yt.linkId]={0:Gr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},zn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,$t]=Qt;return`${qt.slice(-4)}-${Lt}-${$t}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,$t)=>{for(const Yt of Lt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,$t);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const Tr of $t){const Gr=[...On,Tr];if(Tr.item){if(Tr.item.some(rn=>rn.linkId===Yt))return Gr.some(rn=>rn.repeats===!0)?Tr:null;if(Lt(Tr.item,Yt,Gr))return Tr}}return null};return Lt(Qt,qt)},Wn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const Tr of $t){const Gr=[...On,Tr];if(Tr.item){if(Tr.item.some(rn=>rn.linkId===Yt))return Gr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(Tr.item,Yt,Gr))return!0}}return!1};return Lt(Qt,qt)},Cr=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:$t}=Qt;if(mt[$t]){const Yt=mt[$t];Lt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Dn=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let $t=null;if(mt.forEach((Yt,On)=>{const Tr=ze(Yt);if(Tr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),$t=On;else if($t!==null&&!Tr){const Gr=Lt.get($t)||[];Lt.set($t,[...Gr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(Gr=>Gr>Yt),Tr=[];for(let Gr=Yt;Gr<(On??mt.length);Gr++)Tr.push(Gr);Lt.set(Yt,Tr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},hr=(mt,Qt,qt,Lt)=>{let $t=[...Lt];const Yt=(On,Tr)=>{On.forEach(Gr=>{if((!Gr?.enableWhen||te(Gr?.enableWhen,Gr.enableBehavior,Tr))&&Gr.initial&&!Ct(Tr,Gr.linkId))if(Gr.repeats){const Pn=Tr.filter(Ln=>Ln.linkId===Gr.linkId);Pn.length>0?Pn.forEach((Ln,rn)=>{Xe(Tr,Gr.linkId,rn)||($t=xt(qt,$t,Gr.linkId,Gr.initial,void 0,rn))}):$t=xt(qt,$t,Gr.linkId,Gr.initial)}else $t=xt(qt,$t,Gr.linkId,Gr.initial);Gr.item&&Yt(Gr.item,Tr)})};return Yt(mt,Qt),$t},Fn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return mt.forEach($t),Lt},$r=(mt,Qt)=>mt.every(qt=>{var Lt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Jr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Lt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Lt.push($t)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],$t=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&$t(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const Tr=mt.slice(0,Yt+1),Gr=mt.slice(Yt+1),{kept:Pn,removed:Ln}=Gr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,Tr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return $t(Ln),{trimmedData:[...Tr,...Pn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const Tr=ot(On.item,Qt,qt);if(Tr.found){const Gr=mt.slice(0,Yt),Pn=mt.slice(Yt+1),Ln=[...Gr,b(f({},On),{item:Tr.trimmedData})],{kept:rn,removed:bt}=Pn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Ln)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(bt),{trimmedData:[...Ln,...rn],trimmedLinkIds:[...Tr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some($t=>mt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Dn(mt),Lt=mt.findIndex($t=>$t.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const $t=Lt.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:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn,hr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Fn=`bwell-${Kt}`;if(customElements.get(Fn)!==void 0)return;class $r extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),zn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Wn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Cr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,zn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",hr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",hr).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,Rt,"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,Rt,"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,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"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,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,zn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Wn=new WeakMap,We=new WeakSet,Cr=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Fn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Fn,utils:(0,p.__classPrivateFieldGet)(this,Wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Dn=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},hr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Dn).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Dn).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Fn,$r)}),at={rE:"1.1133.1"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,A=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,m=(p,h)=>{for(var f in h||(h={}))u.call(h,f)&&A(p,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&A(p,f,h[f]);return p},d=(p,h)=>a(p,g(h));const O=(p,h,f)=>{const b=_.cloneDeep(p);if(!b.contained||h<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const E=x.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:p,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var w,N,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(w=h.questionnaire)==null?void 0:w.replace("#",""),U=(N=h?.contained)==null?void 0:N.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(h);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=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 C=L=>{try{R(z.next(L))}catch(P){S(P)}},E=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(C,E);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:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),w=x?.placeId,N=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,oe]=(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,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Ye;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Ye=Ot.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const hr=be.find(tt=>tt.id===Kt),Fn=hr?.label||V;if(!hr)return;q(Fn),k(Fn),setTimeout(()=>{const tt=[{id:hr.id,label:hr.label}];Se(tt),ne(tt)},f);const $r=yield ae({variables:{placeId:Kt}}),Jr=(Xe=(Ct=$r?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=$r?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=$r?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=$r?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(zn=$r?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Jr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Jr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Cr=(Wn=tt?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:Cr.state)||"",Et=((Dn=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Jr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Fn,value:Kt})}else T({latitude:Jr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Fn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn;if(w&&N){Se([{id:w,label:V||N}]),ne([{id:w,label:V||N}]),F(w),G(w),q(N),k(N),N===V&&q(N);const hr=yield ae({variables:{placeId:w}}),Fn=(Xe=(Ct=hr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,$r=(Ot=(We=hr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Jr=((Qe=(Ye=hr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=hr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(zn=hr?.data)==null?void 0:zn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Fn&&$r)if(!Jr||!It||!$e){const ot=yield ce({variables:{latitude:String(Fn),longitude:String($r)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Cr=(Wn=ot?.data)==null?void 0:Wn.geocodingByLatLon)==null?void 0:Cr.state)||"",rt=((Dn=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Dn.stateCode)||"";T({latitude:Fn,longitude:$r,zipCode:Je,state:tt,stateCode:rt,placeId:w,description:N,value:w})}else T({latitude:Fn,longitude:$r,zipCode:Jr,state:It,stateCode:$e,placeId:w,description:N,value:w})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||ue||D)},[E,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.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:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",Ot=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=Ot.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.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:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.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:o,title:i})=>{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:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,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),o=e(52449);const i=({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:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,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=(E,R,L)=>R in E?m(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,b=(E,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(E,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(E,L,R[L]);return E},M=(E,R)=>d(E,O(R)),x=(E,R,L)=>new Promise((P,D)=>{var w=q=>{try{V(L.next(q))}catch(I){D(I)}},N=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(w,N);V((L=L.apply(E,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),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:w,setQueryParams:N}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(w);(0,t.useEffect)(()=>{q.current=w},[w]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=w.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{N(M(b({},q.current),{locationPermission:ve||i.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)}`)}},[N,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!==i.Ef.GRANTED&&Ee!==i.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=w.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!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(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.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!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.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():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.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(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.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(i.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(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),N(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.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(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,N,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&N(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.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,N]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},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:()=>It,GI:()=>K,rz:()=>Ot,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>C,gD:()=>T,Vp:()=>$r,Cx:()=>D,bK:()=>L,gi:()=>Jr,Z$:()=>be,GT:()=>Fn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>zn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>N,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>E,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Dn,vf:()=>Wn,PV:()=>hr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>ce,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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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 o=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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:Tn=24,color:ar="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Tn,height:Tn,stroke:ar,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},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",C="http://hl7.org/fhir/questionnaire-item-control",E="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",w="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="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",oe="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",ce="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",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ot="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="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",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Cr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Dn="http://icanbwell.com/fhir/StructureDefinition/trigger-color",hr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Fn="http://hl7.org/fhir/StructureDefinition/mimeType",$r="http://hl7.org/fhir/StructureDefinition/maxSize",Jr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="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",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="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",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.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:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>N,mR:()=>zt,nt:()=>z,od:()=>w,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),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=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,$t;return($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?$t:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},C={date:"MM/DD/YYYY",choice:"Select an option"},E="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&C[Qt]||E},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,$t,Yt)=>Yt.indexOf(Lt)===$t).join(", "),w=(mt,Qt,qt)=>{const Lt=D(mt),$t=Lt.lastIndexOf(","),Yt=$t!==-1?`${Lt.substring(0,$t)} or${Lt.substring($t+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},N=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,$t;const Yt=Qt?.find(On=>On.url.includes(mt));return($t=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?$t:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const $t=Qt?.find(On=>On.url===mt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||q((Lt=$t.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Qt);if($t!==void 0)return $t}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Lt=(0,t.A)($t)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const $t=F(Lt.item,Qt);if($t!==void 0)return $t}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const $t of mt)if($t.linkId===Qt&&Lt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,$t;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date(($t=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?$t:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe($t,void 0):Yt.some(On=>{var Tr;return(Tr=On.answer)==null?void 0:Tr.some(Gr=>oe($t,Gr&&Object.keys(Gr).length>0?Gr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some($t=>Lt($t)):mt?.every($t=>Lt($t)):!0},pe=(mt,Qt,qt,Lt,$t)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var Tr;let Gr;if(Lt&&typeof $t=="number"){const Ln=qt.filter(rn=>rn.linkId===Lt)[$t];if(Ln?.item){const rn=Ln.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(Tr=rn?.answer)==null?void 0:Tr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!Gr){const Pn=K(qt,On.question);if(Pn.length>0)return Pn.some(Ln=>{var rn;return(rn=Ln.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});Gr=void 0}return oe(On,Gr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some($t=>Boolean($t)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Lt,Qt);return b(f({},mt),{readOnly:$t??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:$t,type:Yt,extension:On,enableWhen:Tr,enableBehavior:Gr,repeats:Pn,answerOption:Ln}=mt;if(!te(Tr,Gr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Pn)return ne(mt,Qt,qt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,$t,qt,Ln)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(Gr=>Gr!=null&&Gr!==""&&(Array.isArray(Gr)?Gr.length>0:!0))){$t=!0;const Gr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(Gr)return`Item ${Yt+1}: ${Gr}`;if(mt.item&&mt.item.length>0){const Pn=ae(mt.item,Qt,mt.linkId,Yt);if(Pn)return`Item ${Yt+1}: ${Pn}`}}else return`Item ${Yt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Yt=qt[$t];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(Tr=>Tr!=null&&Tr!==""&&(Array.isArray(Tr)?Tr.length>0:!0))){const Tr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(Tr)return`Item ${$t+1}: ${Tr}`;if(mt.item&&mt.item.length>0){const Gr=ae(mt.item,Qt,mt.linkId,$t);if(Gr)return`Item ${$t+1}: ${Gr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var $t,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const Tr=F(Qt,qt),Gr=($t=Tr?.item)==null?void 0:$t.find(Ln=>Ln.linkId===On.linkId),Pn=(Yt=Gr?.answer)!=null&&Yt[Lt]?[Gr.answer[Lt]]:void 0;if(On.required){if(!Pn||!Pn[0]||!me(Pn[0]))return`${On.text||On.linkId} is required`;const Ln=he(On.extension,On.type,!0,On.maxLength,Pn,On.answerOption);if(Ln)return`${On.text||On.linkId}: ${Ln}`}else if(Pn&&Pn[0]&&me(Pn[0])){const Ln=he(On.extension,On.type,!1,On.maxLength,Pn,On.answerOption);if(Ln)return`${On.text||On.linkId}: ${Ln}`}if(On.item&&On.item.length>0){const Ln=ae(On.item,Qt,On.linkId,Lt);if(Ln)return Ln}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,$t,Yt)=>{var On,Tr,Gr,Pn,Ln;let rn="";const bt=!!mt?.find(En=>{var Zn,Wr;return En.url===y.gD&&((Wr=(Zn=En.valueCodeableConcept)==null?void 0:Zn.coding)==null?void 0:Wr.some(_r=>_r.system===y.n4&&_r.code===y.GI))}),St=$t?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((Tr=St?.valueCoding)==null?void 0:Tr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(Gr=St?.valueQuantity)==null?void 0:Gr.value,reference:(Pn=St?.valueReference)==null?void 0:Pn.display,attachment:(Ln=St?.valueAttachment)==null?void 0:Ln.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Zn=V("regexError",mt),Wr=Zn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(Wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Zn=new RegExp(En),Wr=V("regexError",mt),_r=Wr??"Please enter a valid input";return Zn&&un&&!Zn.test(un)?String(_r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Zn=new Date(En);return isNaN(Zn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const Wr=I(y.dU,mt),_r=U(Wr??"01/01/1900","01/01/1900"),Zr=U(un,"");if(!_r||!Zr)return"";if((0,s.A)(Zr,_r)){const f0=(En=mt?.find(wo=>wo.url===y.Ck))==null?void 0:En.valueString;return f0??`Date should not be before ${Wr??"01/01/1900"}`}return""}const Zn=V("minValue",mt);return Zn!=null&&un!==null&&un!==void 0&&un<Zn?`Input should not be less than ${Zn}`:""},maxValue:()=>{var En;if(Qt==="date"){const Wr=I(y.bK,mt),_r=U(Wr??"01/01/2100","01/01/2100"),Zr=U(un,"");if(!_r||!Zr)return"";if((0,o.A)(Zr,_r)){const f0=(En=mt?.find(wo=>wo.url===y.Cx))==null?void 0:En.valueString;return f0??`Date should not be after ${Wr??"01/01/2100"}`}return""}const Zn=V("maxValue",mt);return Zn!=null&&un!==null&&un!==void 0&&un>Zn?`Input should not exceed ${Zn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const $t=ce(mt,qt.item);if($t)return $t}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var $t,Yt;const{required:On}=mt,Tr=($t=Lt.item)==null?void 0:$t.find(Ln=>Ln.linkId===mt.linkId),Gr=Tr?.answer||[],Pn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Ln=0;Ln<Pn;Ln++){const rn=Gr[Ln];if(On){if(!rn||!me(rn))return`Item ${Ln+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Ln+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Ln+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===y.gD&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,$t,Yt)=>{const On=Gr=>Qt.filter(Pn=>Pn.linkId===Gr),Tr=new Set;return mt.map(Gr=>{if(Tr.has(Gr.linkId)||ve(Gr))return null;const Ln=On(Gr.linkId),rn=Gr.type==="group"&&Gr.repeats;if(Tr.add(Gr.linkId),rn){const bt=[];if(Ln.forEach((St,Zt)=>{const un={linkId:Gr.linkId,text:Gr.text};let on;if(qt===Gr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const En=St?.item||[];on=[...En],$t.forEach(Zn=>{const Wr=on.findIndex(_r=>_r.linkId===Zn.linkId);Wr>=0?on[Wr]=b(f({},En[Wr]),{answer:Zn.answer}):on.push(Zn)})}else Gr.item&&(on=xt(Gr.item,St?.item||[],qt,Lt,$t,Zt));qt===Gr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===Gr.linkId&&typeof Yt=="number"&&Yt>=Ln.length)for(let St=Ln.length;St<=Yt;St++){const Zt={linkId:Gr.linkId,text:Gr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:Gr.item&&(Zt.item=xt(Gr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(Gr.repeats&&typeof Yt=="number"&&qt===Gr.linkId){const bt=Ln[0]||{linkId:Gr.linkId,text:Gr.text,answer:[]},St={linkId:Gr.linkId,text:Gr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Ln[0],St=Gr.item?xt(Gr.item,bt?.item||[],qt,Lt,$t,Yt):void 0,Zt=St&&St.length>0,un={linkId:Gr.linkId,text:Gr.text};return qt&&Gr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!$t?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),$t?un.item=$t:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var $t;const Yt=($t=mt?.item)!=null?$t:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var Tr;const Gr=K(Qt,On.linkId);if(Gr.length===0){const Pn=(Tr=F(Qt,On.linkId))==null?void 0:Tr.answer;if(ge(On,Qt,Pn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Pn of Gr)if(ge(On,Qt,Pn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter($t=>$t.linkId===Qt);if(Lt.length>qt){const $t=Lt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var $t;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},Ot=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const $t=Object.keys(Lt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,$t,Yt)=>{var On;const Tr=(On=Qt?.item)==null?void 0:On[qt[Lt]],Gr=Tr?.linkId;if(!Gr)return!1;const Pn=K(mt,Gr),Ln=K($t,Gr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Pn.length!==Ln.length)return!1;for(let bt=0;bt<Pn.length;bt++){const St=Pn[bt],Zt=Ln[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=$t=>{$t.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let Tr=0;Tr<On.length;Tr++){const Gr=On[Tr];if(Gr?.answer&&Gr.answer.length>0){const Pn=Pt(Yt,Qt,Gr.answer);Pn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[Tr]:Pn}))}}else{const Tr=F(Qt,Yt.linkId);if(Tr?.answer&&Tr.answer.length>0){const Gr=Pt(Yt,Qt,Tr.answer);Gr&&(qt[Yt.linkId]={0:Gr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},zn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,$t]=Qt;return`${qt.slice(-4)}-${Lt}-${$t}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,$t)=>{for(const Yt of Lt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,$t);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const Tr of $t){const Gr=[...On,Tr];if(Tr.item){if(Tr.item.some(rn=>rn.linkId===Yt))return Gr.some(rn=>rn.repeats===!0)?Tr:null;if(Lt(Tr.item,Yt,Gr))return Tr}}return null};return Lt(Qt,qt)},Wn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const Tr of $t){const Gr=[...On,Tr];if(Tr.item){if(Tr.item.some(rn=>rn.linkId===Yt))return Gr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(Tr.item,Yt,Gr))return!0}}return!1};return Lt(Qt,qt)},Cr=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:$t}=Qt;if(mt[$t]){const Yt=mt[$t];Lt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Dn=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let $t=null;if(mt.forEach((Yt,On)=>{const Tr=ze(Yt);if(Tr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),$t=On;else if($t!==null&&!Tr){const Gr=Lt.get($t)||[];Lt.set($t,[...Gr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(Gr=>Gr>Yt),Tr=[];for(let Gr=Yt;Gr<(On??mt.length);Gr++)Tr.push(Gr);Lt.set(Yt,Tr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},hr=(mt,Qt,qt,Lt)=>{let $t=[...Lt];const Yt=(On,Tr)=>{On.forEach(Gr=>{if((!Gr?.enableWhen||te(Gr?.enableWhen,Gr.enableBehavior,Tr))&&Gr.initial&&!Ct(Tr,Gr.linkId))if(Gr.repeats){const Pn=Tr.filter(Ln=>Ln.linkId===Gr.linkId);Pn.length>0?Pn.forEach((Ln,rn)=>{Xe(Tr,Gr.linkId,rn)||($t=xt(qt,$t,Gr.linkId,Gr.initial,void 0,rn))}):$t=xt(qt,$t,Gr.linkId,Gr.initial)}else $t=xt(qt,$t,Gr.linkId,Gr.initial);Gr.item&&Yt(Gr.item,Tr)})};return Yt(mt,Qt),$t},Fn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return mt.forEach($t),Lt},$r=(mt,Qt)=>mt.every(qt=>{var Lt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Jr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Lt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Lt.push($t)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],$t=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&$t(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const Tr=mt.slice(0,Yt+1),Gr=mt.slice(Yt+1),{kept:Pn,removed:Ln}=Gr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,Tr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return $t(Ln),{trimmedData:[...Tr,...Pn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const Tr=ot(On.item,Qt,qt);if(Tr.found){const Gr=mt.slice(0,Yt),Pn=mt.slice(Yt+1),Ln=[...Gr,b(f({},On),{item:Tr.trimmedData})],{kept:rn,removed:bt}=Pn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Ln)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(bt),{trimmedData:[...Ln,...rn],trimmedLinkIds:[...Tr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some($t=>mt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Dn(mt),Lt=mt.findIndex($t=>$t.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const $t=Lt.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Yt=>Yt.trim()).filter(Boolean).map(Yt=>Yt.startsWith("*")?Yt.substring(1).trim():Yt);return $t.length===0?null:$t.length===1?{isList:!1,items:$t}:{isList:!0,items:$t}};return{restriction:Qt("restriction"),warning:Qt("warning")}},Et=(mt,Qt)=>{var qt;switch(Qt.type){case"boolean-to-string":return typeof mt=="boolean"?mt?Qt.trueValue:Qt.falseValue:mt;case"map":return Qt.mapping&&mt in Qt.mapping?Qt.mapping[mt]:mt;case"date-format":return mt;case"number-format":if(typeof mt=="number"){let Lt=mt.toFixed((qt=Qt.decimals)!=null?qt:0);return Qt.prefix&&(Lt=Qt.prefix+Lt),Qt.suffix&&(Lt=Lt+Qt.suffix),Lt}return mt;case"passthrough":default:return mt}},st=(mt,Qt)=>{const qt=mt.linkId,Lt=(Yt,On,Tr=[])=>{for(const Gr of Yt){const Pn=[...Tr,Gr];if(Gr.item){if(Gr.item.some(bt=>bt.linkId===On))return Pn.filter(bt=>bt.repeats===!0);const rn=Lt(Gr.item,On,Pn);if(rn.length>0)return rn}}return[]},$t=Lt(Qt,qt);return $t.length>0?$t[$t.length-1]:null},le=(mt,Qt)=>{if(!mt?.item)return[];const qt=[];for(const Lt of mt.item){if(Lt.type!=="group")continue;te(Lt.enableWhen,Lt.enableBehavior,Qt||[])&&Lt.linkId&&qt.push(Lt.linkId)}return qt},ye=(mt,Qt)=>{const qt=le(mt,Qt||void 0);return qt[qt.length-1]},Ue=({questionnaire:mt,extensionUrl:Qt,errorCode:qt})=>{if(!qt||!mt?.item)return;const Lt=mt.item.find($t=>{var Yt;return(Yt=$t.extension)==null?void 0:Yt.some(On=>On.url===Qt&&On.valueString===qt)});return Lt?.linkId},Te=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===y.rb);if(!Lt?.valueString)return;const $t=Lt.valueString;return J(Qt,$t)},zt=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.rb))},Gt=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Gt(qt.item,Qt)}):qt),vn=mt=>{const Qt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,mt.extension);return Qt??k(mt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},Tn=mt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,mt.extension),ar=mt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,mt.extension),Dt=mt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,mt.extension),Ne=mt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,mt),Ze=(mt,Qt)=>{var qt,Lt,$t;if(!mt.answerOption)return;const Yt=F(Qt,mt.linkId),On=($t=(Lt=(qt=Yt?.answer)==null?void 0:qt[0])==null?void 0:Lt.valueCoding)==null?void 0:$t.code;if(!On)return;const Tr=mt.answerOption.find(Gr=>{var Pn;return((Pn=Gr.valueCoding)==null?void 0:Pn.code)===On});if(!!Tr)return Ne(Tr.extension)},At=(mt,Qt)=>{const qt={},Lt=$t=>{if(!!$t)for(const Yt of $t){const On=Dt(Yt);if(On){let Tr;switch(Yt.type){case"choice":Tr=Ze(Yt,Qt);break;default:break}Tr&&(qt[On]=Tr)}Yt.item&&Yt.item.length>0&&Lt(Yt.item)}};return Lt(mt.item),qt},en=mt=>!!(mt.initial&&mt.initial.length>0),nn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.forEach(On=>{if(qt&&qt.includes(On.linkId))return;const Tr=Ee(On),Gr=Qt.includes(On.linkId);(Gr||Tr&&On.required)&&Lt.push(On),Gr&&On.item&&On.item.length>0&&$t(On.item)})};return $t(mt),Lt},fn=(mt,Qt,qt,Lt,$t,Yt)=>{var On;if(qt<0||!Lt?.item)return!0;const Tr=$t.current[qt],Gr=qt+1,Pn=$t.current[Gr],Ln=qt===0?0:Tr,rn=Pn??Lt.item.length,bt=[];for(let En=Ln;En<rn;En++){const Zn=(On=Lt?.item)==null?void 0:On[En];if(Zn){if(Yt&&Yt.includes(Zn.linkId))continue;const Wr=Ee(Zn);(Qt.includes(Zn.linkId)||Wr&&Zn.required)&&bt.push(Zn),Zn.item&&Zn.item.length>0&&bt.push(...nn(Zn.item,Qt,Yt))}}const St=bt.filter(En=>En.required===!0),Zt=bt.filter(En=>En.required!==!0),un=$r(St,mt),on=Zt?.every(En=>{var Zn;const Wr=(Zn=F(mt,En.linkId))==null?void 0:Zn.answer;return Wr?!ge(En,mt,Wr):!0});return!St?.length||un&&on}},28058:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),o=e(76260),i=e(25624);const a=({item:pr})=>{const i0=pr.text||"",Fr=pr.extension||[],Vo=ki=>{var Ii;return(Ii=Fr.find(Si=>Si.url===ki))==null?void 0:Ii.valueString},vi=Vo(o.$7),yi=Vo(o.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:i0,description:vi??"",color:yi})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(pr,i0,Fr)=>i0 in pr?u(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,O=(pr,i0)=>{for(var Fr in i0||(i0={}))A.call(i0,Fr)&&d(pr,Fr,i0[Fr]);if(y)for(var Fr of y(i0))m.call(i0,Fr)&&d(pr,Fr,i0[Fr]);return pr};const v=({item:pr})=>{const[i0,Fr]=(0,t.useState)(!1),Vo=pr.extension||[],vi=nr=>{var gn;return(gn=Vo.find(kn=>kn.url===nr))==null?void 0:gn.valueString},yi=vi(o.PS)||pr.text||"",ki=vi(o.Iz)||"button",Ii=vi(o.VF),Si=vi(o.PV),Li=vi(o.vf),hi=Li?o.JP[Li]:void 0,Er=vi(o.D_)||"",Qn=vi(o.$e),zr=vi(o.GQ),Le=vi(o.qT)||"gray",Ce=vi(o.hZ),Fe=vi(o.wG),ht=vi(o.q3),Ht=zr?o.JP[zr]:void 0,tn=()=>Fr(!0),wn=()=>{switch(ki){case"icon-button":return(0,n.jsxs)("button",{onClick:tn,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":yi||Er||void 0,children:[hi&&(0,n.jsx)(hi,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),yi&&(0,n.jsx)("span",{className:"text-sm",children:yi})]});default:return(0,n.jsx)(r.Button,{color:Ii??"secondary",size:Si??"md",iconLeading:hi,onClick:tn,"aria-label":yi,children:yi})}};return(0,n.jsxs)(n.Fragment,{children:[wn(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${pr.linkId}`,isOpen:i0,onOpenChange:Fr,title:{content:Er},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)}},Ht?{featuredIcon:{icon:Ht,color:Le,size:"lg",className:"bg-white"}}:{}),Ce?{primaryButton:{children:Ce,onClick:()=>{var nr,gn;Fe==="open-zendesk"&&((gn=(nr=globalThis.zE)==null?void 0:nr.activate)==null||gn.call(nr,{hideOnClose:!0})),Fr(!1)}}}:{}),ht?{secondaryButton:{children:ht,onClick:()=>Fr(!1)}}:{}))]})};var p=e(18522);const h=({item:pr})=>{var i0,Fr,Vo,vi,yi,ki,Ii,Si,Li,hi,Er,Qn;const{hasExternalError:zr}=(0,p.c)(),Le=pr.text||"",Ce=(Fr=(i0=pr.extension)==null?void 0:i0.find(Vr=>Vr.url===o.ao))==null?void 0:Fr.valueString,Fe=zr&&Ce?Ce:Le,ht=(vi=(Vo=pr.extension)==null?void 0:Vo.find(Vr=>Vr.url===o.$7))==null?void 0:vi.valueString,Ht=(ki=(yi=pr.extension)==null?void 0:yi.find(Vr=>Vr.url===o.el))==null?void 0:ki.valueString,tn=zr&&Ht?Ht:ht,wn=(Si=(Ii=pr.extension)==null?void 0:Ii.find(Vr=>Vr.url===o.g4))==null?void 0:Si.valueString,nr=(hi=(Li=pr.extension)==null?void 0:Li.find(Vr=>Vr.url===o.Fp))==null?void 0:hi.valueString,gn=wn?o.JP[wn]:void 0,kn=nr?o.JP[nr]:void 0,cn=zr&&kn?kn:gn,dr=((Qn=(Er=pr.extension)==null?void 0:Er.find(Vr=>Vr.url===o.WS))==null?void 0:Qn.valueString)===o._W.LEFT,wr=dr?"items-start":"items-center",n0=dr?"text-left":"text-center",O0=dr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${wr} gap-4`,children:[cn&&(0,n.jsx)(r.FeaturedIcon,{icon:cn,color:zr&&kn?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${wr} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${n0} ${O0} md:max-w-[352px]`,children:Fe}),(0,n.jsx)("p",{className:`text-md text-secondary ${n0}`,children:tn})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(pr,i0,Fr)=>i0 in pr?M(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,C=(pr,i0)=>{for(var Fr in i0||(i0={}))z.call(i0,Fr)&&S(pr,Fr,i0[Fr]);if(x)for(var Fr of x(i0))T.call(i0,Fr)&&S(pr,Fr,i0[Fr]);return pr};const E=({item:pr})=>{const[i0,Fr]=(0,t.useState)(!1),Vo=(0,b.T$)(),vi=pr.extension||[],yi=Ce=>{var Fe;return(Fe=vi.find(ht=>ht.url===Ce))==null?void 0:Fe.valueString},ki=pr.text||"",Ii=yi(o.PS)||"",Si=yi(o.D_)||"",Li=yi(o.$e),hi=yi(o.GQ),Er=yi(o.qT)||"gray",Qn=yi(o.hZ),zr=yi(o.q3),Le=hi?o.JP[hi]: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:ki})]}),Ii&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Fr(!0),children:Ii})]}),(0,n.jsx)(r.Modal,C(C(C({id:`modal-${pr.linkId}`,isOpen:i0,onOpenChange:Fr,title:{content:Si},description:{content:Li?(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(Li)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Le?{featuredIcon:{icon:Le,color:Er,size:"lg",className:"bg-white"}}:{}),Qn?{primaryButton:{children:Qn,onClick:()=>{Fr(!1),Vo.navigate({id:"profile"})}}}:{}),zr?{secondaryButton:{children:zr,onClick:()=>Fr(!1)}}:{}))]})},R=({item:pr,selectedAnswer:i0,handleInputChange:Fr})=>{var Vo,vi,yi;const ki=(Vo=pr.answerOption)!=null?Vo:[],Ii=(yi=(vi=i0?.[0])==null?void 0:vi.valueCoding)==null?void 0:yi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ki.map(Si=>{var Li,hi,Er,Qn,zr,Le,Ce;const Fe=(hi=(Li=Si.valueCoding)==null?void 0:Li.code)!=null?hi:"",ht=(Qn=(Er=Si.valueCoding)==null?void 0:Er.display)!=null?Qn:"",Ht=Ii===Fe,tn=(zr=Si.extension)==null?void 0:zr.find(kn=>kn.url===o.g4),wn=(Le=Si.extension)==null?void 0:Le.find(kn=>kn.url===o.rz),nr=tn?.valueString?o.JP[tn.valueString]:void 0,gn=(Ce=wn?.valueString)!=null?Ce:"";return(0,n.jsx)(r.SelectableOption,{icon:nr,title:ht,description:gn,isSelected:Ht,onSelect:()=>{Fr(pr,[{valueCoding:{code:Fe,display:ht}}])}},Fe)})})};var L=e(72866),P=e(94043),D=e(94627);const w=({text:pr,isLabel:i0,required:Fr,className:Vo,id:vi})=>(0,n.jsxs)("p",{id:vi,className:Vo??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(i0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(pr||"")}}),Fr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),N="(###) ###-####",V=(pr,i0)=>{const Fr=pr.replace(/\D/g,"");let Vo="",vi=0;for(let yi=0;yi<i0.length&&vi<Fr.length;yi++)i0[yi]==="#"?(Vo+=Fr[vi],vi++):Vo+=i0[yi];return Vo},q=pr=>{if(!pr)return N;const i0=pr.find(Fr=>Fr.url===o.Md);return i0?.valueString||N},I=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:Er,readOnly:Qn,extension:zr}=pr,Le=q(zr),Ce=((Ii=Fr?.[0])==null?void 0:Ii.valueString)||"",[Fe,ht]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Ce){const gn=V(Ce,Le);ht(gn)}},[Ce,Le]);const Ht=Li?(0,i.nt)(vi,Er,Li):"",tn=yi?.[Si]||"",wn=gn=>{const kn=V(gn,Le);ht(kn),Vo(pr,[{valueString:kn}])},nr=()=>{i0&&i0(Si)};return(0,n.jsxs)("div",{"data-testid":Si,children:[Ht&&(0,n.jsx)(w,{isLabel:!0,text:Ht,required:hi||!1}),(0,n.jsx)(r.Input,{id:Si,"aria-label":Si,"data-testid":Si,type:"tel",placeholder:"Enter phone number",value:Fe,onChange:wn,onBlur:nr,isDisabled:Qn||ki,isRequired:hi,hint:tn,isInvalid:!!tn,size:"md"},Si)]})},k=({item:pr,questionnaireSchemaItems:i0})=>{var Fr;const{isLoading:Vo,setCurrentGroupIndex:vi}=(0,p.c)(),yi=(Fr=pr.extension)==null?void 0:Fr.find(Li=>Li.url===o.Uf),ki=yi?.valueString,Ii=pr.text||"Save & continue",Si=()=>{if(ki){const Li=(0,i.Ue)(i0||[],ki);Li!==-1&&vi(Li)}};return(0,n.jsx)("div",{"data-testid":pr.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:Vo,onClick:Si,isDisabled:pr.readOnly,children:Ii})})},U=({size:pr=24,color:i0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:pr,height:pr,stroke:i0,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:pr=24,color:i0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:pr,height:pr,stroke:i0,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:pr=24,color:i0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:pr,height:pr,stroke:i0,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 oe=e(31165),te=e(14449),pe=e(27163);const be=pr=>{try{const i0=pr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!i0)return pr;const[,Fr,Vo,vi]=i0;return new Date(Date.UTC(parseInt(Fr),parseInt(Vo)-1,parseInt(vi))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return pr}},Se=pr=>{try{if(pr.includes("AM")||pr.includes("PM"))return pr;const i0=pr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!i0)return pr;const[,Fr,Vo]=i0,vi=parseInt(Fr),yi=vi>=12?"PM":"AM";return`${vi%12||12}:${Vo} ${yi}`}catch{return pr}},ge=(pr,i0,Fr=f.d)=>{var Vo;const vi=(Vo=pr.extension)==null?void 0:Vo.find(yi=>yi.url===o.g4);return vi?.valueString&&o.JP[vi.valueString]?o.JP[vi.valueString]:pr.linkId&&i0[pr.linkId]?i0[pr.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":oe.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"],ce=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:pr,questionnaireSchemaItems:i0})=>{var Fr;const{setCurrentGroupIndex:Vo}=(0,p.c)(),{trackEvent:vi}=(0,s.st)(),yi=pr.item||[];if(yi.length===0)return null;const ki=(Fr=pr.extension)==null?void 0:Fr.find(hi=>hi.url===o.Uf),Ii=ki?.valueString,Si=()=>{if(vi("edit_info_clicked",{section:pr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Ii){const hi=(0,i.Ue)(i0||[],Ii);hi!==-1&&Vo(hi)}},Li=yi.map(hi=>{let Er="";if(hi.initial&&hi.initial.length>0){const Le=hi.initial.map(Ce=>{var Fe,ht;let Ht=((Fe=Ce.valueCoding)==null?void 0:Fe.display)||((ht=Ce.valueReference)==null?void 0:ht.display)||Ce.valueString||"";return Ht&&typeof Ht=="string"&&(ae.includes(hi.linkId)?Ht=be(Ht):me.includes(hi.linkId)&&(Ht=Se(Ht))),Ht}).filter(Boolean);Le.length>1||hi.repeats&&Le.length>0?Er=Le:Le.length===1&&(Er=Le[0])}if(!Er||Array.isArray(Er)&&Er.length===0)return null;let Qn;he.includes(hi.linkId)?Qn="phone":ce.includes(hi.linkId)&&(Qn="address");let zr;return ue.includes(hi.linkId)&&(zr="phone"),{Icon:ge(hi,ne),label:hi.text||hi.linkId,value:Er,linkType:Qn,displayType:zr}}).filter(Boolean);return Li.length===0?null:(0,n.jsx)("div",{"data-testid":pr.linkId,children:(0,n.jsx)(pe.InfoCard,{title:pr.text||"Details",infoDetails:Li,actionButtonText:Ii&&"Edit info",onActionButtonClick:Ii?Si:void 0})})},J=({size:pr=24,color:i0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:pr,height:pr,stroke:i0,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:pr})=>{const{setHideFooterButton:i0,incrementCustomErrorCount:Fr,decrementCustomErrorCount:Vo}=(0,p.c)();return(0,t.useEffect)(()=>(i0(!0),Fr(),()=>{i0(!1),Vo()}),[i0,Fr,Vo]),(0,n.jsx)("div",{"data-testid":pr.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)(pr.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:pr})=>{var i0,Fr,Vo,vi;const{incrementCustomErrorCount:yi,decrementCustomErrorCount:ki,setHideFooterButton:Ii}=(0,p.c)(),[Si,Li]=(0,t.useState)(!1),hi=(i0=pr.extension)==null?void 0:i0.find(Fe=>Fe.url===o.gi),Er=(Vo=(Fr=hi?.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:Vo.find(Fe=>Fe.system===o.tn),Qn=Er?.code||"error",zr=De[Qn]||"error";(0,t.useEffect)(()=>{if(zr==="error")return yi(),Ii(!0),Li(!0),()=>{ki(),Ii(!1)};Li(!0)},[zr,yi,ki,Ii]);const Le=Er?.display||"Error",Ce=(vi=pr.text)!=null?vi:"";return Si?(0,n.jsx)("div",{"data-testid":pr.linkId,children:(0,n.jsx)(r.InfoBanner,{type:zr,title:Le,description:Ce})}):null};var Ie=e(65735);const xe=({configKey:pr,customErrorConfigurations:i0})=>{if(!i0)return null;const Fr=i0[pr];if(!Fr)return null;const{icon:Vo,title:vi,description:yi,primaryButton:ki,secondaryButton:Ii}=Fr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:vi,description:yi,featuredIconProps:{icon:Vo,color:"gray"},primaryButton:ki,secondaryButton:Ii})},_e=10,at=({item:pr,customErrorConfigurations:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii,Si,Li,hi;const{trackEvent:Er}=(0,s.st)(),{setHideFooterButton:Qn}=(0,p.c)(),{linkId:zr,text:Le,required:Ce,answerOption:Fe,prefix:ht,readOnly:Ht}=pr,tn=pr?.type==="reference",wn=(Ii=Fr?.map(jn=>{var kr,d0;return tn?(kr=jn.valueReference)==null?void 0:kr.display:(d0=jn.valueCoding)==null?void 0:d0.code}).filter(jn=>jn!==void 0))!=null?Ii:[],[nr,gn]=(0,t.useState)(wn.length),kn=Le?(0,i.nt)(vi,ht,Le):"",cn=(Li=(Si=pr.extension)==null?void 0:Si.find(jn=>jn.url===o.Z_))==null?void 0:Li.valueInteger,dr=(hi=Fe?.map(jn=>{var kr,d0,ao,E0;return{value:tn?((kr=jn.valueReference)==null?void 0:kr.display)||"":((d0=jn.valueCoding)==null?void 0:d0.code)||"",label:tn?((ao=jn.valueReference)==null?void 0:ao.display)||"":((E0=jn.valueCoding)==null?void 0:E0.display)||"",valueReference:jn.valueReference}}))!=null?hi:[],wr=yi?.[zr],n0=dr.length>_e,O0=n0?dr.slice(0,_e):dr,Vr=n0?dr.slice(_e):[],S0=Vr.some(jn=>wn?.includes(jn?.value)),[po,ct]=(0,t.useState)(S0);if(!(pr.answerOption&&pr.answerOption.length>0))return Qn(!0),(0,n.jsx)(xe,{configKey:pr.linkId,customErrorConfigurations:i0});const An=dr.filter(jn=>wn?.includes(jn?.value)).map(jn=>{var kr;const{restriction:d0,warning:ao}=tn?(0,i.eC)((kr=jn.valueReference)==null?void 0:kr.extension):{restriction:null,warning:null};return{label:jn.label,restriction:d0,warning:ao}}).filter(jn=>jn.restriction||jn.warning),Gn=(jn,kr)=>{var d0;Er("vaccine_type_checkbox_selected",{on_or_off:jn?"on":"off",vaccine:kr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let ao;if(jn){const E0=dr.find(J0=>J0.value===kr);ao=[...(d0=Fr?.filter(J0=>Object.keys(J0).length!==0))!=null?d0:[],tn?{valueReference:E0?.valueReference}:{valueCoding:{code:kr,display:E0?.label}}],gn(J0=>J0+1)}else ao=Fr?.filter(E0=>{var J0,No;return tn?((J0=E0.valueReference)==null?void 0:J0.display)!==kr:((No=E0.valueCoding)==null?void 0:No.code)!==kr})||[{}],gn(E0=>E0-1);Vo&&Vo(pr,ao)};return(0,n.jsxs)("div",{"data-testid":zr,children:[kn&&(0,n.jsx)(w,{text:kn,required:Ce||!1}),n0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:O0.map((jn,kr)=>{const d0=wn?.includes(jn?.value),ao=!d0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:kr!==O0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":jn.value,id:kr.toString(),name:jn.label,isInvalid:!!wr,isSelected:d0,label:jn.label,onChange:E0=>Gn(E0,jn.value),isDisabled:Ht||ki||ao})},kr)})}),n0&&!po&&!S0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{ct(!0),Er("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:Ht||ki,children:"See all"})}),n0&&po&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),n0&&po&&(0,n.jsx)("div",{children:Vr.map((jn,kr)=>{const d0=wn?.includes(jn?.value),ao=!d0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:kr!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":jn.value,id:(_e+kr).toString(),name:jn.label,isInvalid:!!wr,isSelected:d0,label:jn.label,onChange:E0=>Gn(E0,jn.value),isDisabled:Ht||ki||ao})},_e+kr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!wr,children:wr}),An.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:An.map((jn,kr)=>(0,n.jsxs)("div",{children:[jn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${jn.label}`,description:jn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:jn.restriction.items.map((d0,ao)=>(0,n.jsx)("li",{className:"text-sm",children:d0},ao))}):(0,n.jsx)("p",{className:"text-sm",children:jn.restriction.items[0]})}),jn.warning&&(0,n.jsx)("div",{className:jn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${jn.label}`,description:jn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:jn.warning.items.map((d0,ao)=>(0,n.jsx)("li",{className:"text-sm",children:d0},ao))}):(0,n.jsx)("p",{className:"text-sm",children:jn.warning.items[0]})})})]},kr))})]})};var pt=e(76323),xt=e(56192),Xt=e(66267),Kt=Object.defineProperty,Ct=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Qe=(pr,i0,Fr)=>i0 in pr?Kt(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,Pt=(pr,i0)=>{for(var Fr in i0||(i0={}))Ot.call(i0,Fr)&&Qe(pr,Fr,i0[Fr]);if(We)for(var Fr of We(i0))Ye.call(i0,Fr)&&Qe(pr,Fr,i0[Fr]);return pr},hn=(pr,i0)=>Ct(pr,Xe(i0)),zn=(pr,i0,Fr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Fr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Fr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Fr=Fr.apply(pr,i0)).next())});const et=({item:pr,handleInputChange:i0,onCompleteHandler:Fr,errors:Vo})=>{const{i18n:{t:vi},loading:yi}=(0,Xt.E_)({keys:["shared-translations"]}),{trackEvent:ki}=(0,s.st)(),{linkId:Ii,required:Si,readOnly:Li}=pr,hi=Vo?.[Ii]||"",[Er,Qn]=(0,t.useState)(pt.LocationType.CURRENT_LOCATION),[zr,Le]=(0,t.useState)(""),Ce=(0,t.useRef)({}),[Fe,ht]=(0,t.useState)([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ht,setIsLoading:tn,setIsCurrentFormValid:wn,isCurrentFormValid:nr}=(0,p.c)(),{position:gn,loading:kn,locationPermission:cn}=(0,pt.useDeviceLocationContext)(),{queryParams:dr,setQueryParams:wr}=(0,pt.useSearchQueryParams)(),[n0,{loading:O0}]=(0,xt.qtq)({fetchPolicy:"cache-first"}),[Vr,{loading:S0}]=(0,xt.YyG)({fetchPolicy:"cache-first"}),po=pr.item?(0,i.Yo)(pr.item,"postal-code"):void 0,ct=pr.item?(0,i.Yo)(pr.item,"state"):void 0,_t=pr.item?(0,i.Yo)(pr.item,"latitude"):void 0,An=pr.item?(0,i.Yo)(pr.item,"longitude"):void 0,Gn=j0=>{if(!j0||!po)return Le(""),!1;const Lo=(0,i.zj)(po.extension,po.type,!1,po.maxLength,[{valueString:j0}]);return Lo?(Le(Er!==pt.LocationType.ZIP_CODE?vi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Lo),!1):(Le(""),!0)},jn=()=>{const{latitude:j0,longitude:Lo,state:Z0,zipcode:A0}=Ce.current;return!!(j0&&Lo&&Z0&&A0)},kr=(0,t.useCallback)(j0=>{Ce.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},pr.item&&(ct&&i0(ct,[{valueString:""}]),_t&&i0(_t,[{valueDecimal:void 0}]),An&&i0(An,[{valueDecimal:void 0}]),po&&i0(po,[{valueString:""}])),wr({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:j0,locationPermission:cn}),wn&&wn(!1),Le("")},[i0,pr.item,_t,cn,An,wn,wr,ct,po]);(0,t.useEffect)(()=>{if(!Si)return;!jn()&&wn&&wn(!1)},[nr,Si,wn]);const d0=j0=>{Ce.current=Pt(Pt({},Ce.current),j0),j0.addressDescription&&ki("address_selected",{value:j0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),J0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,Ce.current.zipcode,Ce.current.placeId,Ce.current.addressDescription)},ao=j0=>zn(void 0,null,function*(){var Lo,Z0,A0;if(Le(""),Ce.current.zipcode=j0,wn&&wn(!1),Gn(j0)){ki("zip_code_entered",{value:j0,_event_metadata:{description:"A user entered a zip code."}});const Eo=yield Vr({variables:{location:j0}}),K0=(Lo=Eo?.data)==null?void 0:Lo.geocoding,$i=Eo?.error;if(K0){const Wo=K0.stateCode||"",Ci=(Z0=K0.latitude)!=null?Z0:void 0,va=(A0=K0.longitude)!=null?A0:void 0;d0({latitude:Ci,longitude:va,state:Wo,zipcode:j0,placeId:void 0,addressDescription:void 0})}else $i&&(d0({latitude:void 0,longitude:void 0,state:void 0,zipcode:j0,placeId:void 0,addressDescription:void 0}),Le(vi("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else J0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,j0)}),E0=()=>{const j0=Ce.current.zipcode||"";!j0||Er!==pt.LocationType.ZIP_CODE||Gn(j0)};(0,t.useEffect)(()=>{dr.locationType&&(Qn(dr.locationType),dr.locationType===pt.LocationType.ZIP_CODE&&dr.zipCode&&ao(dr.zipCode),dr.locationType===pt.LocationType.ADDRESS&&dr.placeId&&dr.addressDescription&&(Ce.current.addressDescription=dr.addressDescription,Ce.current.placeId=dr.placeId))},[]),(0,t.useEffect)(()=>{const j0=[pt.LocationPermissionEnum.DENIED,pt.LocationPermissionEnum.UNAVAILABLE,pt.LocationPermissionEnum.BLOCKED].includes(dr.locationPermission),Lo=[pt.LocationPermissionEnum.GRANTED,pt.LocationPermissionEnum.PROMPT].includes(dr.locationPermission);if(j0&&Fe.length!==2){if(ht([{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),Er===pt.LocationType.CURRENT_LOCATION||!dr.locationType||dr.locationType===""){const Z0=dr.locationType===pt.LocationType.ZIP_CODE?pt.LocationType.ZIP_CODE:pt.LocationType.ADDRESS;Qn(Z0),wr(hn(Pt({},dr),{locationType:Z0})),kr(Z0)}Le("")}Lo&&Fe.length!==3&&ht([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}])},[Er,cn,Fe.length,dr,wr,kr]);const J0=(j0,Lo,Z0,A0,Eo,K0)=>{if(!pr.item)return;ct&&i0(ct,[{valueString:Z0||""}]),_t&&i0(_t,[{valueDecimal:j0}]),An&&i0(An,[{valueDecimal:Lo}]),po&&i0(po,[{valueString:A0||""}]),wr(hn(Pt({},dr),{lat:String(j0),lng:String(Lo),location:`${j0},${Lo}`,zipCode:A0||"",placeId:Eo||"",addressDescription:K0||"",locationPermission:cn}));const $i=jn()&&Gn(A0||"");wn&&wn($i),Fr&&Fr(Ii)};(0,t.useEffect)(()=>{const j0=()=>zn(void 0,null,function*(){var Lo;try{const Z0=yield n0({variables:{latitude:String(gn?.coords.latitude),longitude:String(gn?.coords.longitude)}}),A0=(Lo=Z0?.data)==null?void 0:Lo.geocodingByLatLon,Eo=A0?.stateCode||"",K0=A0?.zipCode||"";(!K0||!Eo)&&Le(vi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),d0({latitude:gn?.coords.latitude,longitude:gn?.coords.longitude,state:Eo,zipcode:K0,placeId:void 0,addressDescription:void 0})}catch{Qn(pt.LocationType.ADDRESS)}});Er===pt.LocationType.CURRENT_LOCATION&&gn&&j0()},[Er,gn]);const No=j0=>{if(!j0||!j0.latitude||!j0.longitude||!j0.zipCode||!j0.stateCode){d0({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(vi("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}d0({latitude:j0.latitude,longitude:j0.longitude,state:j0.stateCode,zipcode:j0.zipCode,placeId:j0.placeId,addressDescription:j0.description})};return(0,t.useEffect)(()=>{tn(kn||O0||S0||yi)},[kn,O0,S0,yi,tn]),(0,t.useEffect)(()=>{dr.locationType!==Er&&wr(hn(Pt({},dr),{locationType:Er}))},[Er]),(0,n.jsxs)("div",{"data-testid":pr.linkId,children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Si||!1}),(0,n.jsx)(r.Select,{id:Ii,"aria-label":Ii,"data-testid":Ii,isDisabled:Li||O0||S0||Ht,selectedKey:Er,onSelectionChange:j0=>{var Lo;ki("location_type_input_selected",{choice:(Lo=Fe.find(({id:Z0})=>Z0===j0))==null?void 0:Lo.label,_event_metadata:{description:"A user changed the location type input."}}),j0!==Er&&(kr(j0),Qn(j0))},hint:hi,isInvalid:!!hi,items:Fe,placeholder:"Select an option",isRequired:Si,children:j0=>(0,n.jsx)(r.Select.Item,{id:j0.id,"data-testid":j0.id,value:j0,children:j0.label},j0.id)},Ii),Er===pt.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!zr,children:zr}),Er===pt.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Si||!1}),(0,n.jsx)(pt.AddressTypeahead,{onValueChange:No,isDisabled:Ht,setIsLoading:tn,initialValue:{placeId:Ce.current.placeId||"",description:Ce.current.addressDescription||""},errorText:zr||hi})]}),Er===pt.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:Si||!1}),(0,n.jsx)(r.Input,{isRequired:Si,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Ii}-zipcode`,placeholder:"Type your response here...",value:Ce.current.zipcode||"",onChange:ao,onBlur:E0,isDisabled:Li||S0||Ht,hint:zr||hi,isInvalid:!!zr||!!hi,autoComplete:"postal-code"},`${Ii}-zipcode`)]})]})},Rt=pr=>(0,n.jsx)(pt.DeviceLocationProvider,{children:(0,n.jsx)(et,Pt({},pr))}),kt={[o.cX]:Rt,[o.G6]:re,[o.c3]:at,[o.AA]:ze,[o.mO]:h,[o.PM]:k,[o.HH]:I,[o.Us]:Ee,[o.Tl]:R,[o.G0]:v,[o.m3]:a,[o.PU]:E,[o.XP]:g.l,[o.uH]:L.v,[o.it]:Ie.d};var Wn,Cr=new Uint8Array(16);function mn(){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(Cr)}const Dn=/^(?:[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 hr(pr){return typeof pr=="string"&&Dn.test(pr)}const Fn=hr;for(var $r=[],Jr=0;Jr<256;++Jr)$r.push((Jr+256).toString(16).substr(1));function It(pr){var i0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Fr=($r[pr[i0+0]]+$r[pr[i0+1]]+$r[pr[i0+2]]+$r[pr[i0+3]]+"-"+$r[pr[i0+4]]+$r[pr[i0+5]]+"-"+$r[pr[i0+6]]+$r[pr[i0+7]]+"-"+$r[pr[i0+8]]+$r[pr[i0+9]]+"-"+$r[pr[i0+10]]+$r[pr[i0+11]]+$r[pr[i0+12]]+$r[pr[i0+13]]+$r[pr[i0+14]]+$r[pr[i0+15]]).toLowerCase();if(!Fn(Fr))throw TypeError("Stringified UUID is invalid");return Fr}const $e=It;function ot(pr,i0,Fr){pr=pr||{};var Vo=pr.random||(pr.rng||mn)();if(Vo[6]=Vo[6]&15|64,Vo[8]=Vo[8]&63|128,i0){Fr=Fr||0;for(var vi=0;vi<16;++vi)i0[Fr+vi]=Vo[vi];return i0}return $e(Vo)}const Je=ot,tt=(pr,i0="application/octet-stream")=>{try{const Fr=window.atob(pr),Vo=new Uint8Array(Fr.length);for(let yi=0;yi<Fr.length;yi++)Vo[yi]=Fr.charCodeAt(yi);return new Blob([Vo],{type:i0}).size}catch{return 0}},rt=(pr,i0)=>`data:${i0};base64,${pr}`,lt=(pr,i0,Fr=512)=>{const Vo=window.atob(pr),vi=[];for(let ki=0;ki<Vo.length;ki+=Fr){const Ii=Vo.slice(ki,ki+Fr),Si=new Array(Ii.length);for(let hi=0;hi<Ii.length;hi++)Si[hi]=Ii.charCodeAt(hi);const Li=new Uint8Array(Si);vi.push(Li)}const yi=new Blob(vi,{type:i0});return URL.createObjectURL(yi)},Et=pr=>{const i0=new Date().toISOString().replace(/[:.-]/g,"");return`${pr.split(" ").join("-")}_${i0}`},st=4e3,le=.8,ye=(pr,i0)=>{var Fr,Vo;const vi=(Fr=i0?.maxDimension)!=null?Fr:st,yi=(Vo=i0?.quality)!=null?Vo:le;return new Promise((ki,Ii)=>{if(!pr.type.startsWith("image/")){ki(pr);return}if(pr.type==="image/heic"||pr.type==="image/heif"||pr.name.toLowerCase().endsWith(".heic")||pr.name.toLowerCase().endsWith(".heif")){ki(pr);return}const Li=new Image,hi=new FileReader;hi.onload=()=>{const Er=hi.result;Li.onload=()=>{let{width:Qn,height:zr}=Li;if(Qn>vi||zr>vi){const Ht=vi/Math.max(Qn,zr);Qn=Math.round(Qn*Ht),zr=Math.round(zr*Ht)}const Le=document.createElement("canvas");Le.width=Qn,Le.height=zr;const Ce=Le.getContext("2d");if(!Ce){ki(pr);return}Ce.drawImage(Li,0,0,Qn,zr);const Fe=pr.type==="image/png"?"image/png":"image/jpeg",ht=pr.type==="image/png"?void 0:yi;Le.toBlob(Ht=>{if(!Ht||Ht.size>=pr.size){ki(pr);return}ki(new File([Ht],pr.name,{type:Fe}))},Fe,ht)},Li.onerror=()=>{Ii(new Error(`Failed to load image: ${pr.name}`))},Li.src=Er},hi.onerror=()=>{Ii(new Error(`Failed to read file: ${pr.name}`))},hi.readAsDataURL(pr)})},Ue=50,Te=(pr,i0=Ue)=>{if(pr.length<=i0)return pr;const Fr=pr.lastIndexOf("."),Vo=Fr!==-1?pr.slice(Fr):"",vi=Fr!==-1?pr.slice(0,Fr):pr,yi=i0-Vo.length-1,ki=Math.ceil(yi/2),Ii=Math.floor(yi/2);return`${vi.slice(0,ki)}\u2026${vi.slice(-Ii)}${Vo}`};var zt=Object.defineProperty,Gt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,Tn=Object.getOwnPropertySymbols,ar=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,Ne=(pr,i0,Fr)=>i0 in pr?zt(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,Ze=(pr,i0)=>{for(var Fr in i0||(i0={}))ar.call(i0,Fr)&&Ne(pr,Fr,i0[Fr]);if(Tn)for(var Fr of Tn(i0))Dt.call(i0,Fr)&&Ne(pr,Fr,i0[Fr]);return pr},At=(pr,i0)=>Gt(pr,vn(i0)),en=(pr,i0,Fr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Fr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Fr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Fr=Fr.apply(pr,i0)).next())});const nn=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{const{linkId:Ii,text:Si,required:Li,prefix:hi,readOnly:Er,repeats:Qn,extension:zr}=pr,Le=(0,i.Qr)(zr),Ce=(0,i.cz)(zr),Fe=(0,i.$H)(zr)||"image/*,.pdf,.doc,.docx",ht=Si?(0,i.nt)(vi,hi,Si):"",Ht=yi?.[Ii]||"",[tn,wn]=(0,t.useState)([]),nr=(0,t.useRef)(Fr||[]);(0,t.useEffect)(()=>{Fr&&(nr.current=Fr)},[Fr]),(0,t.useEffect)(()=>{Fr?.length&&wn(n0=>{const O0=n0.filter(S0=>S0.isLoading||S0.failed);return[...Fr.filter(S0=>S0.valueAttachment).map((S0,po)=>{var ct,_t,An,Gn,jn;const kr=((ct=S0.valueAttachment)==null?void 0:ct.title)||`attachment-${po}`,d0=(_t=S0.valueAttachment)==null?void 0:_t.id,ao=n0.find(No=>d0&&No.id===d0||!d0&&No.id===`existing-${po}`),E0=(An=S0.valueAttachment)==null?void 0:An.data,J0=E0?tt(E0,(Gn=S0.valueAttachment)==null?void 0:Gn.contentType):0;return{id:d0||ao?.id||`existing-${po}`,name:kr,size:ao?.size||J0,progress:100,failed:!1,type:(0,i.J4)((jn=S0.valueAttachment)==null?void 0:jn.contentType),isLoading:!1}}),...O0]})},[Fr]);const gn=n0=>{let O0=Array.from(n0);if(Ce!==void 0){const S0=Ce-tn.length;if(S0<=0)return;O0=O0.slice(0,S0)}const Vr=O0.map(S0=>{const po=Le&&S0.size>Le,ct=S0.name.replace(/\s+/g,"-");return{id:Je(),name:ct,size:S0.size,progress:0,type:(0,i.J4)(S0.type),failed:!!po,isLoading:!po,disableRetry:!!po,errorMessage:po?`File size exceeds ${(Le/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});wn(S0=>[...S0,...Vr]),Vr.filter(S0=>!S0.failed).forEach(S0=>{const po=O0.find(ct=>ct.name.replace(/\s+/g,"-")===S0.name);po&&kn(po,S0.id)})},kn=(n0,O0)=>en(void 0,null,function*(){try{const Vr=yield ye(n0),S0=yield wr(Vr),po=Vr.name.replace(/\s+/g,"-");wn(Gn=>Gn.map(jn=>jn.id===O0?At(Ze({},jn),{isLoading:!1,progress:100,failed:!1}):jn));const ct={valueAttachment:{id:O0,contentType:Vr.type,data:S0,title:po}},An=[...(nr.current||[]).filter(Gn=>Gn.valueAttachment||Object.keys(Gn).length>0),ct];nr.current=An,Vo(pr,An),i0(Ii)}catch{wn(S0=>S0.map(po=>po.id===O0?At(Ze({},po),{isLoading:!1,failed:!0}):po))}}),cn=n0=>{const O0=tn.find(Vr=>Vr.id===n0);if(wn(Vr=>Vr.filter(S0=>S0.id!==n0)),O0){const Vr=(nr.current||[]).filter((S0,po)=>{var ct;if(n0.startsWith("existing-")){const _t=parseInt(n0.replace("existing-",""));return po!==_t}return((ct=S0.valueAttachment)==null?void 0:ct.id)!==n0}).filter(S0=>S0.valueAttachment||Object.keys(S0).length>0);nr.current=Vr,Vo(pr,Vr.length>0?Vr:[{}])}},dr=n0=>{const O0=tn.find(Vr=>Vr.id===n0);if(O0){wn(S0=>S0.map(po=>po.id===n0?At(Ze({},po),{failed:!1,isLoading:!0,progress:0}):po));const Vr=new File([""],O0.name,{type:"application/octet-stream"});kn(Vr,n0)}},wr=n0=>new Promise((O0,Vr)=>{const S0=new FileReader;S0.onload=()=>{const ct=S0.result.split(",")[1];O0(ct)},S0.onerror=Vr,S0.readAsDataURL(n0)});return(0,n.jsxs)("div",{children:[ht&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:ht,required:Li||!1}),(0,n.jsx)(r.FileUpload,{files:tn,onDropFiles:gn,onDeleteFile:cn,onRetryFile:dr,onDropUnacceptedFiles:()=>{},hint:(0,i.od)(Fe,Le,Ce),accept:Fe,allowsMultiple:Qn!==!1,isDisabled:Er||ki||Ce!==void 0&&tn.length>=Ce,className:"w-full",showDisclosureModal:!0}),Ht&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ht})]})},fn=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii,Si;const{linkId:Li,text:hi,prefix:Er,readOnly:Qn,required:zr,extension:Le}=pr,{trackQuestionnaireEvent:Ce}=(0,p.c)(),Fe=hi?(0,i.nt)(vi,Er,hi):"",ht=yi?.[Li];return Le?.find(tn=>{var wn,nr;return tn.url===o.gD&&((nr=(wn=tn.valueCodeableConcept)==null?void 0:wn.coding)==null?void 0:nr.some(gn=>gn.system===o.n4&&gn.code===o.GI))})?(0,n.jsxs)("div",{"data-testid":Li,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Li,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Li,name:Li,isDisabled:Qn||ki,isSelected:(Ii=Fr?.[0])==null?void 0:Ii.valueBoolean,"aria-label":Li,label:"",className:"mt-1",onChange:tn=>{Ce(pr.linkId,{value:tn}),Vo(pr,[{valueBoolean:tn}]),i0(pr.linkId)}}),Fe&&(0,n.jsx)(w,{isLabel:!0,text:Fe,required:zr||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!ht,children:ht})]}):(0,n.jsxs)("div",{"data-testid":Li,children:[Fe&&(0,n.jsx)(w,{isLabel:!0,text:Fe,required:zr||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Li,name:Li,"aria-label":Li,value:String((Si=Fr?.[0])==null?void 0:Si.valueBoolean)||"",onChange:tn=>{Vo(pr,[{valueBoolean:tn==="true"}]),i0(pr.linkId)},isInvalid:!!ht,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Qn||ki}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Qn||ki})]},Li),ht&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:ht})})]})};var mt=Object.defineProperty,Qt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,$t=(pr,i0,Fr)=>i0 in pr?mt(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,Yt=(pr,i0)=>{for(var Fr in i0||(i0={}))qt.call(i0,Fr)&&$t(pr,Fr,i0[Fr]);if(Qt)for(var Fr of Qt(i0))Lt.call(i0,Fr)&&$t(pr,Fr,i0[Fr]);return pr};const On=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,Er;const{linkId:Qn,text:zr,required:Le,answerOption:Ce,prefix:Fe,readOnly:ht}=pr,Ht=zr?(0,i.nt)(vi,Fe,zr):"",tn=Ce?.map(gn=>{var kn,cn,dr,wr;return{id:((kn=gn.valueCoding)==null?void 0:kn.code)||gn.valueString||"",label:((cn=gn.valueCoding)==null?void 0:cn.display)||gn.valueString||"",value:((dr=gn.valueCoding)==null?void 0:dr.code)||gn.valueString||"",extension:gn.extension||[],system:((wr=gn.valueCoding)==null?void 0:wr.system)||void 0}})||[],wn=((hi=(Li=Fr?.[0])==null?void 0:Li.valueCoding)==null?void 0:hi.code)||((Er=Fr?.[0])==null?void 0:Er.valueString)||"",nr=yi?.[Qn];return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ht,required:Le||!1}),(0,n.jsx)(r.Select,{id:Qn,"aria-label":Qn,"data-testid":Qn,isDisabled:ht||ki,selectedKey:wn,onSelectionChange:gn=>{const kn=String(gn),cn=tn.find(n0=>n0.value===kn),dr=cn?cn.label:"",wr=Boolean(Ce?.find(n0=>n0.valueString===kn));Vo(pr,[wr?{valueString:kn}:{valueCoding:Yt({code:kn,display:dr},cn?.system?{system:cn.system}:{}),extension:cn?.extension||[]}]),i0(pr.linkId)},isInvalid:!!nr,hint:nr||Si,items:tn,placeholder:Ii,isRequired:Le,children:gn=>(0,n.jsx)(r.Select.Item,{id:gn.id,"data-testid":gn.value,value:gn.value,children:gn.label},gn.id)},Qn)]})};var Tr=Object.defineProperty,Gr=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,rn=(pr,i0,Fr)=>i0 in pr?Tr(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,bt=(pr,i0)=>{for(var Fr in i0||(i0={}))Pn.call(i0,Fr)&&rn(pr,Fr,i0[Fr]);if(Gr)for(var Fr of Gr(i0))Ln.call(i0,Fr)&&rn(pr,Fr,i0[Fr]);return pr};const St=pr=>{var i0,Fr,Vo;const{item:vi,selectedAnswer:yi,updatedText:ki,required:Ii,errorMessage:Si}=pr,Li=vi?.type==="reference",hi=(i0=yi?.map(Ce=>{var Fe,ht;return Li?(Fe=Ce.valueReference)==null?void 0:Fe.display:(ht=Ce.valueCoding)==null?void 0:ht.code}).filter(Ce=>Ce!==void 0))!=null?i0:[],[Er,Qn]=(0,t.useState)(hi.length),zr=(Vo=(Fr=vi.extension)==null?void 0:Fr.find(Ce=>Ce.url===o.Z_))==null?void 0:Vo.valueInteger,Le=(Ce,Fe)=>{var ht,Ht,tn;let wn;if(Ce){const nr=pr.options.find(gn=>gn.value===Fe);wn=[...(Ht=(ht=pr.selectedAnswer)==null?void 0:ht.filter(gn=>Object.keys(gn).length!==0))!=null?Ht:[],Li?{valueReference:nr?.valueReference}:{valueCoding:bt({code:Fe,display:nr?.label},nr?.system?{system:nr.system}:{}),extension:nr?.extension||[]}],Qn(gn=>gn+1)}else wn=((tn=pr.selectedAnswer)==null?void 0:tn.filter(nr=>{var gn,kn;return Li?((gn=nr.valueReference)==null?void 0:gn.display)!==Fe:((kn=nr.valueCoding)==null?void 0:kn.code)!==Fe}))||[{}],Qn(nr=>nr-1);pr.handleInputChange(pr.item,wn)};return(0,n.jsxs)("div",{"data-testid":vi.linkId,children:[ki&&(0,n.jsx)(w,{isLabel:!0,text:ki,required:Ii||!1}),(0,n.jsx)("div",{children:pr.options.map((Ce,Fe)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Ce.value,id:Fe.toString(),className:Fe!==pr.options.length-1?"mb-2xl":"",name:Ce.label,isInvalid:!!Si,isSelected:hi?.includes(Ce?.value),label:Ce.label,onChange:ht=>Le(ht,Ce.value),isDisabled:pr.readOnly||pr.isLoading||(!hi?.includes(Ce?.value)&&zr?Er>=zr:!1)},Fe))}),(0,n.jsx)(r.HintText,{isInvalid:!!Si,children:Si})]})},Zt=({item:pr,onCompleteHandler:i0,updatedText:Fr,options:Vo,handleInputChange:vi,errorMessage:yi,readOnly:ki,initialValue:Ii,selectedAnswer:Si,isLoading:Li,required:hi})=>{var Er,Qn;const zr=`${pr.linkId}-label`,Le=`${pr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":pr.linkId,children:[Fr&&(0,n.jsx)(w,{id:zr,isLabel:!0,text:Fr,required:hi||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:pr.linkId,name:pr.linkId,"aria-labelledby":Fr?zr:void 0,"aria-describedby":yi?Le:void 0,isRequired:hi,className:Vo.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Qn=(Er=Si?.[0])==null?void 0:Er.valueCoding)==null?void 0:Qn.code)||Ii||"",onChange:Ce=>{const Fe=Ce,ht=Vo.find(tn=>tn.value===Fe),Ht=ht?ht.label:"";vi(pr,[{valueCoding:{code:Fe,display:Ht,system:ht?.system||void 0},extension:ht?.extension||[]}]),i0(pr.linkId)},isInvalid:!!yi,children:Vo.map(Ce=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Ce.value,isDisabled:ki||Li,value:Ce.value,label:Ce.label},Ce.value))},pr.linkId),yi&&(0,n.jsx)("div",{id:Le,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:yi})})]})};var un=Object.defineProperty,on=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Zn=Object.prototype.propertyIsEnumerable,Wr=(pr,i0,Fr)=>i0 in pr?un(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,_r=(pr,i0)=>{for(var Fr in i0||(i0={}))En.call(i0,Fr)&&Wr(pr,Fr,i0[Fr]);if(on)for(var Fr of on(i0))Zn.call(i0,Fr)&&Wr(pr,Fr,i0[Fr]);return pr};const Zr=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,Er,Qn,zr;const{linkId:Le,text:Ce,required:Fe,answerOption:ht,prefix:Ht,readOnly:tn}=pr,wn=pr?.type==="reference",nr=Ce?(0,i.nt)(vi,Ht,Ce):"",kn=(()=>{var Vr,S0;const po=ht?.find(ct=>ct.initialSelected===!0);return po?wn?((Vr=po.valueReference)==null?void 0:Vr.display)||"":((S0=po?.valueCoding)==null?void 0:S0.code)||"":""})(),cn=(ht?.map(Vr=>{var S0,po,ct,_t,An;return{label:((S0=Vr?.valueCoding)==null?void 0:S0.display)||((po=Vr?.valueReference)==null?void 0:po.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),dr=yi?.[Le],wr=(zr=(Qn=(Er=(hi=(Li=pr?.extension)==null?void 0:Li.find(Vr=>Vr.url.includes("questionnaire-itemControl")))==null?void 0:hi.valueCodeableConcept)==null?void 0:Er.coding)==null?void 0:Qn[0])==null?void 0:zr.code;let n0=null;const O0={item:pr,onCompleteHandler:i0,updatedText:nr,options:cn,handleInputChange:Vo,errorMessage:dr,required:Fe,readOnly:tn,initialValue:kn,selectedAnswer:Fr,isLoading:ki,showQuestionPrefix:vi,placeholder:Ii,hintText:Si};switch(wr){case"drop-down":n0=(0,n.jsx)(On,_r({},O0));break;case"check-box":n0=(0,n.jsx)(St,_r({},O0));break;case"radio-button":n0=(0,n.jsx)(Zt,_r({},O0));break}return(0,n.jsx)(n.Fragment,{children:n0})};var f0=e(73697),wo=e(71924),_0=e(46776);const lo=pr=>`${String(pr.month).padStart(2,"0")}/${String(pr.day).padStart(2,"0")}/${pr.year}`,G0=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,Er;const{linkId:Qn,text:zr,required:Le,prefix:Ce,readOnly:Fe}=pr,ht=(0,t.useRef)(null),[Ht,tn]=(0,t.useState)(!1),[wn,nr]=(0,t.useState)(null),{setIsCurrentFormValid:gn,isCurrentFormValid:kn,trackQuestionnaireEvent:cn}=(0,p.c)(),dr=zr?(0,i.nt)(vi,Ce,zr):"",wr=yi?.[Qn]||"",n0=(Li=pr.extension)==null?void 0:Li.find(Z0=>Z0.url===o.dU),O0=(hi=pr.extension)==null?void 0:hi.find(Z0=>Z0.url===o.bK),Vr=(0,t.useMemo)(()=>{var Z0;const A0=n0?.valueString||n0?.valueDate;return A0||(0,i.iI)((Z0=n0?.valueExpression)==null?void 0:Z0.expression)},[n0]),S0=(0,t.useMemo)(()=>{var Z0;const A0=O0?.valueString||O0?.valueDate;return A0||(0,i.iI)((Z0=O0?.valueExpression)==null?void 0:Z0.expression)},[O0]),po=(0,t.useMemo)(()=>{if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{return(0,f0._U)(Vr)}catch{}return(0,f0._U)("1900-01-01")},[Vr]),ct=(0,t.useMemo)(()=>{if(S0&&/^\d{4}-\d{2}-\d{2}$/.test(S0))try{return(0,f0._U)(S0)}catch(Z0){console.warn("Failed to parse maxDateStr:",S0,Z0)}return(0,f0._U)("2099-12-31")},[S0]),An=(Z0=>{if(!Z0)return"";const A0=Z0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!A0)return Z0;const[,Eo,K0,$i]=A0;return`${K0}/${$i}/${Eo}`})(((Er=Fr?.[0])==null?void 0:Er.valueDate)||""),Gn=Z0=>{if(!Z0)return"";const A0=Z0.replace(/\D/g,"");if(A0.length===0)return"";if(A0.length<=2)return A0.length===2?`${A0}/`:A0;const Eo=$i=>{const Wo=$i.slice(0,2),Ci=$i.slice(2);return Ci.length===2?`${Wo}/${Ci}/`:`${Wo}/${Ci}`},K0=$i=>{const Wo=$i.slice(0,2),Ci=$i.slice(2,4),va=$i.slice(4,8);return`${Wo}/${Ci}/${va}`};return A0.length<=4?Eo(A0):K0(A0)},jn=()=>{if(Fe||ki)return;if(An.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const A0=(0,f0._U)(An);nr(A0)}catch{nr(null)}else{const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(A0){const[,Eo,K0,$i]=A0,Wo=parseInt(Eo,10),Ci=parseInt(K0,10);if(Wo>=1&&Wo<=12&&Ci>=1&&Ci<=31)try{const va=(0,f0._U)(`${$i}-${Eo}-${K0}`);nr(va)}catch{nr(null)}else nr(null)}else nr(null)}tn(!0)},kr=()=>{if(wn){const Z0=`${wn.year}-${String(wn.month).padStart(2,"0")}-${String(wn.day).padStart(2,"0")}`;cn(pr.linkId,{value:(0,i.CP)(`${String(wn.month).padStart(2,"0")}/${String(wn.day).padStart(2,"0")}/${wn.year}`)}),Vo(pr,[{valueDate:(0,i.Fy)(Z0)}])}tn(!1),nr(null)},d0=()=>{tn(!1),nr(null)},ao=Z0=>{var A0;const Eo=((A0=ht.current)==null?void 0:A0.selectionStart)||0,K0=An,$i=Gn(Z0),Wo=$i.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Wo){const[,Ci,va,Ki]=Wo,Xs=parseInt(Ci,10),Ks=parseInt(va,10),Xi=parseInt(Ki,10);if(E0(Xs,Ks,Xi).isValid){const h1=`${Ki}-${Ci}-${va}`;cn(pr.linkId,{value:(0,i.CP)(`${Ci}/${va}/${Ki}`)}),Vo(pr,[{valueDate:(0,i.Fy)(h1)}])}else Vo(pr,[{valueDate:$i}])}else Vo(pr,[{valueDate:$i}]);setTimeout(()=>{if(ht.current){const Ci=K0.replace(/\D/g,""),va=$i.replace(/\D/g,"");let Ki=Eo;$i===K0&&(Ki=Eo-1),va.length>=Ci.length&&$i!==K0?$i[Eo-1]==="/"?Ki=Eo+1:Ki=Eo:va.length<Ci.length&&(K0[Eo-1]==="/"?Ki=Math.max(0,Eo-1):Ki=Eo),ht.current.setSelectionRange(Ki,Ki)}},0)},E0=(Z0,A0,Eo)=>{if(Z0<1||Z0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(A0<1||A0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const K0=new Date(Eo,Z0,0).getDate();if(A0>K0)return{isValid:!1,error:"Invalid day for the selected month"};if(Vr||S0){const $i=new wo.ng(Eo,Z0,A0);if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{const Wo=(0,f0._U)(Vr);if($i.compare(Wo)<0){const Ci=(0,i.di)(o.Ck,pr.extension);if(Ci)return{isValid:!1,error:Ci};const va=lo(Wo);return{isValid:!1,error:`Date must be on or after ${va}`}}}catch{}if(S0&&/^\d{4}-\d{2}-\d{2}$/.test(S0))try{const Wo=(0,f0._U)(S0);if($i.compare(Wo)>0){const Ci=(0,i.di)(o.Cx,pr.extension);if(Ci)return{isValid:!1,error:Ci};const va=lo(Wo);return{isValid:!1,error:`Date must be on or before ${va}`}}}catch{}}return{isValid:!0,error:""}},J0=()=>{const Z0=An.replace(/\D/g,"");if(Z0.length>0&&Z0.length<8){i0(pr.linkId);return}const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!A0&&Z0.length>=6){i0(pr.linkId);return}if(A0){const[,Eo,K0,$i]=A0,Wo=parseInt(Eo,10),Ci=parseInt(K0,10),va=parseInt($i,10);if(E0(Wo,Ci,va).isValid){const Ki=`${$i}-${Eo}-${K0}`;Vo(pr,[{valueDate:(0,i.Fy)(Ki)}])}}i0(pr.linkId)},j0=(()=>{if(!An)return"";const Z0=An.replace(/\D/g,"");if(Z0.length>0&&Z0.length<8)return"";const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!A0&&Z0.length>=6)return kn&&gn(!1),"Invalid date";if(A0){const[,Eo,K0,$i]=A0,Wo=parseInt(Eo,10),Ci=parseInt(K0,10),va=parseInt($i,10),{isValid:Ki,error:Xs}=E0(Wo,Ci,va);if(!Ki)return kn&&gn(!1),Xs||"Invalid date"}return""})(),Lo=!!wr||!!j0;return(0,n.jsxs)("div",{children:[dr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:dr,required:Le||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Fe||ki,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||ki)&&"cursor-not-allowed opacity-50"),onClick:jn,"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||ki)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:ht,isRequired:Le,size:"md",type:"text",name:Qn,"data-testid":Qn,id:Qn,value:An,onChange:ao,placeholder:Ii,isDisabled:Fe||ki,onBlur:J0,hint:j0||wr||Si,isInvalid:Lo,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:Ht,onOpenChange:Z0=>{Z0||d0()},primaryButton:{children:"Apply",onClick:kr,isDisabled:!wn},secondaryButton:{children:"Cancel",onClick:d0},children:(0,n.jsx)(_0.lr,{value:wn,onChange:nr,minValue:po,maxValue:ct,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:po,maxValue:ct,onYearPickerOpen:()=>{nr(null)}})})})]})},Po=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:Er,readOnly:Qn}=pr,zr=Li?(0,i.nt)(vi,Er,Li):"",Le=yi?.[Si]||"";return(0,n.jsxs)("div",{children:[zr&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:zr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"datetime-local",id:Si,"aria-label":Si,"data-testid":Si,placeholder:"Type your response here...",value:((Ii=Fr?.[0])==null?void 0:Ii.valueDateTime)||"",onChange:Ce=>{let Fe=Ce;const[ht,Ht]=Fe.split("T");ht&&Ht&&(Fe=`${(0,i.Fy)(ht)}T${Ht}:00`),Vo(pr,[{valueDateTime:Fe}])},isDisabled:Qn||ki,onBlur:()=>{i0(pr.linkId)},hint:Le,isInvalid:!!Le},Si)]})},br=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:Er,required:Qn,prefix:zr,readOnly:Le}=pr,Ce=Er?(0,i.nt)(vi,zr,Er):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(pr),Ht=(Li=Fr?.[0])==null?void 0:Li.valueDecimal,[tn,wn]=(0,t.useState)(String(Ht??""));return(0,t.useEffect)(()=>{wn(String(Ht??""))},[Ht]),(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(w,{isLabel:!0,text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",id:hi,"aria-label":hi,"data-testid":hi,placeholder:Ii,value:tn,onChange:nr=>{wn(nr)},isDisabled:Le||ki,onBlur:()=>{const nr=parseFloat(tn);wn(isNaN(nr)?"":String(nr)),Vo(pr,[{valueDecimal:isNaN(nr)?void 0:nr}]),i0(pr.linkId)},type:"number",hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},vr=({item:pr,showStepper:i0=!1})=>{var Fr;const{text:Vo,linkId:vi,type:yi}=pr,ki=Vo&&(0,i.nt)(!1,"",Vo),Ii=(Fr=pr.extension)==null?void 0:Fr.find(Er=>Er.url===o.Yt),Si=Ii?.valueBoolean===!0,Li=yi==="group"&&(0,i.$O)(pr)!==void 0,hi=()=>{const Er=(0,i.$O)(pr),Qn=(0,i.t7)(pr);if(Er===void 0||Qn===void 0||Qn<=0)return[];const zr=[];for(let Le=1;Le<=Qn;Le++){let Ce="incomplete";Le<Er?Ce="complete":Le===Er&&(Ce="current"),zr.push({title:"",description:"",status:Ce})}return zr};return ki&&!Si?(0,n.jsxs)("div",{"data-testid":vi,children:[(0,n.jsx)(w,{text:ki,required:!1,className:""}),i0&&Li&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:hi()})})]}):null},Mr=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:Er,required:Qn,prefix:zr,readOnly:Le}=pr,Ce=Er?(0,i.nt)(vi,zr,Er):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(pr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,"data-testid":hi,size:"md",id:hi,"aria-label":hi,placeholder:Ii,value:String((Li=Fr?.[0])==null?void 0:Li.valueInteger)||"",onChange:Ht=>{Vo(pr,[{valueInteger:Number(Ht)}])},isDisabled:Le||ki,onBlur:()=>{i0(pr.linkId)},type:"number",hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},R0=({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,Er;const{linkId:Qn,text:zr,extension:Le,required:Ce,prefix:Fe,readOnly:ht}=pr,Ht=zr?(0,i.nt)(vi,Fe,zr):"",tn=Le?.find(gn=>gn.url.includes("questionnaire-unitOption")),wn=yi?.[Qn],nr=(0,i.a0)(pr);return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(w,{isLabel:!0,text:Ht,required:Ce||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Ce,size:"md",id:Qn,"aria-label":Qn,"data-testid":Qn,value:(Li=Fr?.[0])!=null&&Li.valueQuantity?String((hi=Fr[0].valueQuantity)==null?void 0:hi.value):"",onChange:gn=>{Vo(pr,[{valueQuantity:{value:parseFloat(gn)}}])},isDisabled:ht||ki,onBlur:()=>{var gn,kn,cn;const dr=(gn=Fr?.[0])!=null&&gn.valueQuantity?parseFloat(String((cn=(kn=Fr?.[0])==null?void 0:kn.valueQuantity)==null?void 0:cn.value)).toFixed(2):"";Vo(pr,[{valueQuantity:{value:parseFloat(dr)}}]),i0(pr.linkId)},hint:wn||Si,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:(Er=tn?.valueCoding)==null?void 0:Er.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Ii,autoComplete:nr})},Qn)]})};var g0=e(61784);const ro="ui-toolkit-modern",Fo={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"},ko={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},si={[ko.CURRENT_LOCATION]:Fo.CURRENT_LOCATION,[ko.ZIP_CODE]:Fo.ZIP_CODE,[ko.ADDRESS]:Fo.ADDRESS},Di={mi:{singular:Fo.MILE,plural:Fo.MILES}},Pi=({resourceData:pr,handleInputChange:i0,item:Fr,questionnaireSchemaItems:Vo})=>{var vi;const{t:yi}=(0,g0.SS)(),{queryParams:ki}=(0,pt.useSearchQueryParams)(),Ii=ki.locationType||"",{setCurrentGroupIndex:Si,handleContinueButtonClick:Li,setHideFooterButton:hi}=(0,p.c)(),{trackEvent:Er}=(0,s.st)();(0,t.useEffect)(()=>{if(!Fr.readOnly)return hi(!0),()=>{hi(!1)}},[Fr.readOnly,hi]);const Qn=(vi=Fr.extension)==null?void 0:vi.find(kn=>kn.url===o.Uf),zr=Qn?.valueString,Le=()=>{if(zr){const kn=(0,i.Ue)(Vo||[],zr);kn!==-1&&Si(kn)}},Ce=kn=>{const cn=kn.find(dr=>dr.url.includes("description"));return cn?.valueString||""},Fe=kn=>{const cn=kn.find(S0=>S0.url.includes("distance-value")),dr=kn.find(S0=>S0.url.includes("distance-unit")),wr=cn?.valueString?Number(cn.valueString):NaN,n0=dr?.valueString||"";if(!n0||isNaN(wr))return null;const O0=Math.round(wr);let Vr=n0;return Di[n0]&&(Vr=yi(O0===1?Di[n0].singular:Di[n0].plural)),Ii&&si[Ii]?yi(Fo.LOCATION_DISTANCE,{distance:`${O0} ${Vr}`,locationType:yi(si[Ii])}):yi(Fo.LOCATION_DISTANCE_AWAY,{distance:`${O0} ${Vr}`})},ht=kn=>({id:kn.id||"",providerName:kn.name||"",specialty:"",distance:Fe(kn.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:kn.address||"",valueReference:kn.valueReference||{reference:kn.id}}),Ht=kn=>{var cn,dr,wr,n0;const O0=kn;return ht({id:O0.id,name:(cn=O0.name)!=null?cn:"",address:(n0=(wr=(dr=O0?.address)==null?void 0:dr.line)==null?void 0:wr[0])!=null?n0:"",extension:O0?.extension,valueReference:{reference:O0.id}})},tn=kn=>ht({id:kn?.reference,name:kn?.display,address:Ce(kn?.extension||[]),extension:kn?.extension,valueReference:kn}),nr=(()=>pr&&Array.isArray(pr)&&pr.length>0?pr.map(Ht):Fr.initial&&Array.isArray(Fr.initial)&&Fr.initial.length>0?Fr.initial.map(kn=>tn(kn.valueReference)):Fr.answerOption?Fr.answerOption.map(kn=>tn(kn.valueReference)):[])(),gn=kn=>{i0(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:cn,providerName:dr,placeholderIcon:wr,distance:n0})=>(0,n.jsx)(pt.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:wr},locationName:dr,address:kn,distance:n0,actionButtonText:zr?"Change location":void 0,onActionButtonClick:zr?Le:void 0},cn)):nr.map(({address:kn,id:cn,providerName:dr,placeholderIcon:wr,specialty:n0,valueReference:O0,distance:Vr})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:wr},providerName:{content:dr},specialty:{content:n0},location:{address:kn,distance:Vr},actionButton:{children:"Schedule appointment",onClick:()=>{Er("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:kn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),gn(O0),Li?.()}}},cn))})};var ci=e(79079),Ni=e(32066),fi=e(43915),qi=e(36181),Ui=e(37234),Ga=e(59931),Lr=e(65388),tr=Object.defineProperty,Yr=Object.defineProperties,Dr=Object.getOwnPropertyDescriptors,V0=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Sr=(pr,i0,Fr)=>i0 in pr?tr(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,c0=(pr,i0)=>{for(var Fr in i0||(i0={}))bn.call(i0,Fr)&&Sr(pr,Fr,i0[Fr]);if(V0)for(var Fr of V0(i0))Hn.call(i0,Fr)&&Sr(pr,Fr,i0[Fr]);return pr},er=(pr,i0)=>Yr(pr,Dr(i0));const Kn="tz-code",io={"ui-toolkit/LocationCard":Pi,"ui-toolkit/TimeSlotSelection":({resourceData:pr,item:i0,handleInputChange:Fr,selectedAnswer:Vo,questionnaireSchemaItems:vi,formData:yi,onCompleteHandler:ki})=>{var Ii,Si;const{t:Li}=(0,ci.S)(),{trackEvent:hi}=(0,s.st)(),{isLoading:Er,setIsInlineNextQuestionTriggered:Qn}=(0,p.c)(),zr=A0=>{const Eo=A0.match(/^(\d{4}-\d{2}-\d{2})/);return Eo?Eo[1]:A0},Le=A0=>{const Eo=A0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Eo?`${Eo[1]} ${Eo[2]}`:A0},Ce=A0=>{const Eo=A0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Eo){const[,K0,$i,Wo]=Eo;return new Date(parseInt(K0),parseInt($i)-1,parseInt(Wo))}return new Date},ht=(()=>{var A0;if((A0=Vo?.[0])!=null&&A0.valueReference){const Eo=Vo[0].valueReference,K0=Eo.display||"",$i=zr(K0);if($i)return{date:Ce($i),slotId:Eo.reference||""}}return{date:new Date,slotId:""}})(),[Ht,tn]=(0,t.useState)(ht.date),[wn,nr]=(0,t.useState)(ht.slotId),[gn,kn]=(0,t.useState)(new Set),cn=(0,t.useMemo)(()=>new wo.ng(Ht.getFullYear(),Ht.getMonth()+1,Ht.getDate()),[Ht]),dr=A0=>({display:A0.display||"",id:A0.id||"",start:A0.start||"",extension:Array.isArray(A0.extension)?A0.extension:[],identifier:Array.isArray(A0.identifier)?A0.identifier:[],type:A0.type||""}),wr=A0=>dr({display:A0.start?Le(A0.start):"",id:A0.id,start:A0.start,extension:A0.extension,identifier:A0.identifier}),n0=A0=>dr({display:A0?.display||"",id:A0?.reference,start:A0?.display,extension:A0?.extension,identifier:A0?.identifier,type:A0?.type}),O0=()=>{if(Array.isArray(pr)&&pr.length>0)return pr.filter(A0=>A0.resourceType==="Appointment").map(wr);if(i0.initial&&Array.isArray(i0.initial)&&i0.initial.length>0)return i0.initial.map(A0=>n0(A0.valueReference));if(i0.answerOption)return i0.answerOption.map(A0=>n0(A0.valueReference))},Vr=(0,t.useMemo)(()=>O0()||[],[pr,Vo,i0]),S0=(0,t.useMemo)(()=>{const A0={};return Vr.forEach(Eo=>{if(Eo.start&&Eo.id){const K0=zr(Eo.start);A0[K0]||(A0[K0]=[]),A0[K0].push({display:Eo.display,id:Eo.id,start:Eo.start,extension:Eo.extension})}}),A0},[Vr]),po=(0,t.useMemo)(()=>{const A0=Object.keys(S0).sort(),Eo=[];if(A0.length===0)return Eo.push(cn),gn.forEach(Wo=>{const Ci=(0,fi.A)(Wo);Eo.push(new wo.ng(Ci.getFullYear(),Ci.getMonth()+1,Ci.getDate()))}),Eo;const K0=(0,fi.A)(A0[A0.length-1]),$i=new wo.ng(K0.getFullYear(),K0.getMonth()+1,K0.getDate());for(let Wo=cn;Wo.compare($i)<=0;Wo=Wo.add({days:1})){const Ci=`${Wo.year}-${String(Wo.month).padStart(2,"0")}-${String(Wo.day).padStart(2,"0")}`;S0[Ci]||Eo.push(Wo)}if(!(0,i.mR)(i0)){const Wo=(0,Ni.Ec)((0,Ni.Xj)()).add({days:30});let Ci=$i.add({days:1});for(;Ci.compare(Wo)<=0;)Eo.push(Ci),Ci=Ci.add({days:1})}return gn.forEach(Wo=>{const Ci=(0,fi.A)(Wo),va=new wo.ng(Ci.getFullYear(),Ci.getMonth()+1,Ci.getDate());Eo.some(Ki=>Ki.year===va.year&&Ki.month===va.month&&Ki.day===va.day)||Eo.push(va)}),Eo},[S0,gn,cn,i0]),ct=(0,t.useMemo)(()=>(0,i.mR)(i0)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[i0]),_t=(0,t.useMemo)(()=>Object.keys(S0).map(A0=>{const Eo=(0,fi.A)(A0);return new wo.ng(Eo.getFullYear(),Eo.getMonth()+1,Eo.getDate())}),[S0]),An=(0,qi.A)((0,Ui.A)(Ht),"yyyy-MM-dd"),Gn=(0,t.useMemo)(()=>S0[An]||[],[S0,An]);(0,t.useEffect)(()=>{const A0=Object.entries(S0).sort(([Eo],[K0])=>Eo.localeCompare(K0)).slice(0,3).reduce((Eo,[K0,$i])=>er(c0({},Eo),{[`${K0} ${ao}`]:$i.map(Wo=>{var Ci;return(0,Lr.YX)({time:Wo.start,timeZone:(0,i.lv)((Ci=Gn[0])==null?void 0:Ci.extension)}).time})}),{});hi("slots_returned",{Specialty:"Vaccines",first_three_days_slots:A0,_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 jn=t.useRef(null),kr=t.useRef(null),d0=t.useRef(!1);(0,t.useEffect)(()=>{var A0;const Eo=Object.keys(S0).sort();Eo.length===0||d0.current||(d0.current=!0,(A0=Vo?.[0])!=null&&A0.valueReference||tn((0,fi.A)(Eo[0])))},[S0]),(0,t.useEffect)(()=>{var A0;const Eo=Object.keys(S0).sort();if(Eo.length===0)return;const $i=!(jn.current===null)&&JSON.stringify(jn.current)!==JSON.stringify(S0);if(jn.current=S0,!!$i&&(kn(new Set),kr.current)){const Wo=kr.current;if(!(((A0=S0[Wo])==null?void 0:A0.length)>0)){const va=new Set,Ki=(0,fi.A)(Wo),Xs=(0,fi.A)(Eo[0]);let Ks=Ki;for(;Ks<Xs;){const Xi=(0,qi.A)(Ks,"yyyy-MM-dd");va.add(Xi),Ks=new Date(Ks),Ks.setDate(Ks.getDate()+1)}kn(va),nr("")}kr.current=null}},[S0]);const ao=(0,t.useMemo)(()=>{var A0;const Eo=Gn[0];if(!Eo?.extension)return"";const K0=Eo.extension.find($i=>$i?.url===Kn);try{return(0,Ga.formatToTimeZone)(new Date,"(z)",{timeZone:(A0=K0?.valueCode)!=null?A0:""})}catch{return""}},[Gn]),E0=(0,t.useMemo)(()=>{const A0=Li(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return ao?`${A0} ${ao}`:A0},[Li,ao]),J0=(0,t.useMemo)(()=>{const A0=(0,Ni.Ec)((0,Ni.Xj)()).add({days:ct}),Eo=`${A0.year}-${String(A0.month).padStart(2,"0")}-${String(A0.day).padStart(2,"0")}`,$i=Object.keys(S0).sort().find(Wo=>Wo>An&&Wo<=Eo);if($i){const Wo=(0,fi.A)($i);return new wo.ng(Wo.getFullYear(),Wo.getMonth()+1,Wo.getDate())}return null},[S0,An,ct]),No=()=>{if(J0){const A0=J0.toDate((0,Ni.Xj)());tn(A0),nr("")}},j0=A0=>{if(!A0){nr(""),Fr(i0,void 0);return}nr(A0.id);const Eo=[{valueReference:{display:A0.display,reference:A0.id,extension:A0.extension,identifier:A0.identifier,type:A0.type}}];Fr(i0,Eo)},Lo=A0=>{var Eo;if(!A0||Er||!d0.current)return;const K0=Object.keys(S0).sort(),$i=K0[K0.length-1],Wo=K0[0],Ci=`${A0.year}-${String(A0.month).padStart(2,"0")}-${String(A0.day).padStart(2,"0")}`;if($i&&(Ci>$i||Wo&&Ci<Wo)&&(0,i.mR)(i0)&&vi&&!po?.some(Ki=>Ki.compare(A0)===0)){const Ki=(0,i.yQ)(i0,vi);if(Ki){kr.current=Ci;let Xs="-06:00";if((Eo=Vr[0])!=null&&Eo.start){const js=Vr[0].start.match(/([+-]\d{2}:\d{2})$/);js&&(Xs=js[1])}const Xi=[{valueDateTime:`${Ci}T23:59:59${Xs}`}],h1=Fr(Ki,Xi);Fr(i0,void 0,(0,i.Nw)(h1||yi||[],i0.linkId),void 0,!0),Qn(!0),ki(Ki.linkId,!0,!0)}}const va=A0.toDate((0,Ni.Xj)());tn(va),nr("")},Z0=A0=>{if(!A0)return;const Eo=Gn.find(K0=>K0.id===A0);hi("slot_selected",{Specialty:"Vaccines",time_slot:Eo?(0,Lr.YX)({time:Eo.start,timeZone:(0,i.lv)(Gn[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(Eo??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Lo,disabledDates:po,highlightedDates:_t,loading:Er,minValue:(0,Ni.Ec)((0,Ni.Xj)()),maxValue:(0,Ni.Ec)((0,Ni.Xj)()).add({days:ct}),value:cn,defaultValue:cn,appointmentSlots:{title:E0,onChange:Z0,defaultValue:Vo&&((Si=(Ii=Vo[0])==null?void 0:Ii.valueReference)==null?void 0:Si.reference)||void 0,value:wn||void 0,items:Gn.map(A0=>({label:Se(A0.start),value:A0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Li(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),J0&&(0,n.jsx)("button",{onClick:No,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Li(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var qo=Object.defineProperty,ea=Object.defineProperties,ji=Object.getOwnPropertyDescriptors,oa=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,T0=Object.prototype.propertyIsEnumerable,Ua=(pr,i0,Fr)=>i0 in pr?qo(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,vs=(pr,i0)=>{for(var Fr in i0||(i0={}))zo.call(i0,Fr)&&Ua(pr,Fr,i0[Fr]);if(oa)for(var Fr of oa(i0))T0.call(i0,Fr)&&Ua(pr,Fr,i0[Fr]);return pr},zs=(pr,i0)=>ea(pr,ji(i0)),Ts=(pr,i0)=>{var Fr={};for(var Vo in pr)zo.call(pr,Vo)&&i0.indexOf(Vo)<0&&(Fr[Vo]=pr[Vo]);if(pr!=null&&oa)for(var Vo of oa(pr))i0.indexOf(Vo)<0&&T0.call(pr,Vo)&&(Fr[Vo]=pr[Vo]);return Fr};const os=(pr,i0)=>pr.answerOption?pr.answerOption.map(Fr=>{var Vo,vi;const yi=(vi=(Vo=Fr.valueReference)==null?void 0:Vo.reference)==null?void 0:vi.replace("#","");return i0.find(ki=>ki.id===yi)}).filter(Boolean):[],v1=pr=>{var i0,Fr,Vo;const vi=pr.find(yi=>{var ki,Ii;return yi.url.includes("questionnaire-itemControl")&&((Ii=(ki=yi.valueCodeableConcept)==null?void 0:ki.coding)==null?void 0:Ii.some(Si=>{var Li;return(Li=Si.code)==null?void 0:Li.startsWith("ui-toolkit/")}))});return(Vo=(Fr=(i0=vi?.valueCodeableConcept)==null?void 0:i0.coding)==null?void 0:Fr.find(yi=>{var ki;return(ki=yi.code)==null?void 0:ki.startsWith("ui-toolkit/")}))==null?void 0:Vo.code},Xn=pr=>{var{uiToolkitCode:i0,props:Fr}=pr,Vo=Fr,{item:vi,contained:yi=[],customErrorConfigurations:ki}=Vo,Ii=Ts(Vo,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Si}=(0,p.c)(),Li=io[i0];if(!Li)return(0,n.jsx)(n.Fragment,{});const hi=os(vi,yi),Er=hi.length>0;return!(vi.answerOption&&vi.answerOption.length>0)&&!Er&&!vi.readOnly?(Si(!0),(0,n.jsx)(xe,{configKey:i0,customErrorConfigurations:ki})):(0,n.jsx)(Li,zs(vs({},Ii),{item:vi,contained:yi,customErrorConfigurations:ki,resourceData:hi,"data-testid":vi.linkId}))},W0={attachment:nn,choice:Zr,boolean:fn,integer:Mr,string:({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:Er,required:Qn,prefix:zr,readOnly:Le}=pr,Ce=Er?(0,i.nt)(vi,zr,Er):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(pr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md","aria-label":hi,"data-testid":hi,id:hi,type:ht==="tel"?"tel":"text",placeholder:Ii,value:((Li=Fr?.[0])==null?void 0:Li.valueString)||"",onChange:Ht=>{Vo(pr,[{valueString:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,wn=tn.trim();wn!==tn&&Vo(pr,[{valueString:wn}]),i0(pr.linkId)},hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},url:({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:Er,required:Qn,prefix:zr,readOnly:Le}=pr,Ce=Er?(0,i.nt)(vi,zr,Er):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(pr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",type:"url",id:hi,"data-testid":hi,"aria-label":hi,placeholder:Ii,value:((Li=Fr?.[0])==null?void 0:Li.valueUri)||"",onChange:Ht=>{Vo(pr,[{valueUri:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,wn=tn.trim();wn!==tn&&Vo(pr,[{valueUri:wn}]),i0(pr.linkId)},hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},text:({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:Er,required:Qn,prefix:zr,readOnly:Le,maxLength:Ce}=pr,Fe=Er?(0,i.nt)(vi,zr,Er):"",ht=yi?.[hi]||"",Ht=(0,i.a0)(pr);return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(w,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Qn||!1}),(0,n.jsx)(r.TextArea,{isRequired:Qn,id:hi,"aria-label":hi,"data-testid":hi,rows:3,placeholder:Ii,value:((Li=Fr?.[0])==null?void 0:Li.valueString)||"",onChange:tn=>{Vo(pr,[{valueString:tn}])},isDisabled:Le||ki,onBlur:tn=>{const wn=tn.target.value,nr=wn.trim();nr!==wn&&Vo(pr,[{valueString:nr}]),i0(pr.linkId)},hint:ht||Si,counter:!0,isInvalid:!!ht,maxLength:Ce,autoComplete:Ht},hi)]})},date:G0,time:({item:pr,onCompleteHandler:i0,selectedAnswer:Fr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:Er,readOnly:Qn}=pr,zr=Li?(0,i.nt)(vi,Er,Li):"",Le=yi?.[Si]||"";return(0,n.jsxs)("div",{children:[zr&&(0,n.jsx)(w,{isLabel:!0,text:zr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"time",id:Si,"data-testid":Si,"aria-label":Si,placeholder:"Type your response here...",value:((Ii=Fr?.[0])==null?void 0:Ii.valueTime)||"",onChange:Ce=>{Vo(pr,[{valueTime:Ce}])},isDisabled:Qn||ki,onBlur:()=>{i0(pr.linkId)},hint:Le,isInvalid:!!Le},Si)]})},dateTime:Po,quantity:R0,decimal:br,question:vr,display:vr,group:vr,reference:pr=>{var i0,Fr,Vo,vi,yi;const{setHideFooterButton:ki}=(0,p.c)(),{item:Ii,customErrorConfigurations:Si}=pr,Li=Ii.extension||[],hi=v1(Li);return hi?(0,n.jsx)(Xn,{uiToolkitCode:hi,props:pr}):((yi=(vi=(Vo=(Fr=(i0=Ii?.extension)==null?void 0:i0.find(Qn=>Qn.url.includes("questionnaire-itemControl")))==null?void 0:Fr.valueCodeableConcept)==null?void 0:Vo.coding)==null?void 0:vi[0])==null?void 0:yi.code)==="check-box"?Ii.answerOption&&Ii.answerOption.length>0?(0,n.jsx)(Zr,zs(vs({},pr),{item:Ii})):(ki(!0),(0,n.jsx)(xe,{configKey:Ii.linkId,customErrorConfigurations:Si})):null}};var Wt=(pr,i0,Fr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Fr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Fr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Fr=Fr.apply(pr,i0)).next())});const Ke=({item:pr,selectedAnswer:i0,showQuestionPrefix:Fr})=>{const{text:Vo,prefix:vi,required:yi}=pr,ki=Vo?getUpdatedQuestionText(Fr,vi,Vo):"",[Ii,Si]=useState(null),[Li,hi]=useState(!1),{documentDownload:Er,webview:Qn}=useNativeBridge(),zr=(i0||[]).filter(ht=>{var Ht,tn;return((Ht=ht.valueAttachment)==null?void 0:Ht.data)&&((tn=ht.valueAttachment)==null?void 0:tn.title)}).map((ht,Ht)=>{var tn,wn,nr,gn,kn,cn,dr;return{id:((tn=ht.valueAttachment)==null?void 0:tn.id)||`preview-${Ht}`,fileName:((wn=ht.valueAttachment)==null?void 0:wn.title)||`attachment-${Ht}`,contentType:((nr=ht.valueAttachment)==null?void 0:nr.contentType)||"application/octet-stream",base64Data:((gn=ht.valueAttachment)==null?void 0:gn.data)||"",size:getBase64Size(((kn=ht.valueAttachment)==null?void 0:kn.data)||"",(cn=ht.valueAttachment)==null?void 0:cn.contentType),type:getFileTypeFromMimeType((dr=ht.valueAttachment)==null?void 0:dr.contentType)}}),Le=useCallback(ht=>{const{fileName:Ht,contentType:tn,base64Data:wn}=ht;if(Qn.isWithin)Si({fileName:Ht,contentType:tn,base64Data:wn}),hi(!0);else{const nr=base64toObjectUrl(wn,tn),gn=document.createElement("a");gn.href=nr,gn.download=Ht,document.body.appendChild(gn),gn.click(),document.body.removeChild(gn),URL.revokeObjectURL(nr)}},[Qn.isWithin]),Ce=useCallback(()=>Wt(void 0,null,function*(){!Ii||(yield Er.writeFile(Ii.fileName,prepareDataUrl(Ii.base64Data,Ii.contentType)))}),[Ii,Er]),Fe=useCallback(()=>{hi(!1),Si(null)},[]);return zr.length?jsxs("div",{children:[ki&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:ki,required:yi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:zr.map(ht=>jsx("button",{type:"button",onClick:()=>Le(ht),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(ht.fileName),size:ht.size,type:ht.type})},ht.id))}),jsx(DownloadDisclosureModal,{opened:Li,onClose:Fe,onDownload:Ce,contentType:Ii?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var ut=Object.defineProperty,wt=Object.defineProperties,In=Object.getOwnPropertyDescriptors,sr=Object.getOwnPropertySymbols,Rr=Object.prototype.hasOwnProperty,x0=Object.prototype.propertyIsEnumerable,X0=(pr,i0,Fr)=>i0 in pr?ut(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,q0=(pr,i0)=>{for(var Fr in i0||(i0={}))Rr.call(i0,Fr)&&X0(pr,Fr,i0[Fr]);if(sr)for(var Fr of sr(i0))x0.call(i0,Fr)&&X0(pr,Fr,i0[Fr]);return pr},Jo=(pr,i0)=>wt(pr,In(i0));const Xo=(pr,i0,Fr,Vo)=>{var vi;const yi=pr.extension||[];if(Vo?.[BUTTON_TYPE_EXTERNAL_KEY]&&yi.some(hi=>hi.url===BUTTON_TYPE_EXTENSION_URL))return Vo[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(pr)||hasParentWithUIToolkitWidget(pr,i0))return null;if(Fr&&pr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const ki=getUIToolkitCode(yi),Ii=yi.filter(hi=>hi.url.includes("questionnaire-itemControl")).flatMap(hi=>{var Er,Qn;return(Qn=(Er=hi.valueCodeableConcept)==null?void 0:Er.coding)!=null?Qn:[]})||[];let Si;return Vo&&(Si=(vi=Ii.find(hi=>hi.code&&Vo[hi.code]))==null?void 0:vi.code),(Si&&Vo?Vo[Si]:void 0)||UI_TOOLKIT_WIDGET_MAP[ki||""]||typeToRenderFunctionMap[pr.type]||null},li=pr=>{var i0;const{item:Fr,selectedAnswer:Vo,handleInputChange:vi,showQuestionPrefix:yi,errors:ki,questionnaireSchemaItems:Ii,formData:Si,isNestedRepeatedItem:Li=!1}=pr,{linkId:hi,text:Er,prefix:Qn,required:zr,repeats:Le}=Fr,Ce=getMaxOccursFromExtensions(Fr.extension),Fe=getPlaceholderFromExtensions(Fr.extension,Fr.type),[ht,Ht]=useState(()=>{if(Fr.type==="group"&&Fr.item&&Fr.item.length>0){const Vr=Si?.filter(S0=>S0.linkId===Fr.linkId)||[];if(Vr.length>0)return Vr.map((S0,po)=>po)}else if(Vo&&Vo.length>0)return Vo.map((Vr,S0)=>S0);return[0]}),tn=Ce!==void 0&&ht.length>=Ce,wn=Er?getUpdatedQuestionText(yi,Qn,Er):"",nr=()=>{const Vr=Math.max(...ht,-1)+1,S0=[...ht,Vr];if(Ht(S0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const po=Fr.item.map(_t=>({linkId:_t.linkId,text:_t.text,answer:[{}]})),ct={linkId:Fr.linkId,text:Fr.text,answer:[{}],item:po};vi(Fr,void 0,[ct])}else{const po=[...Vo||[]];po.push({}),vi(Fr,po)}},gn=Vr=>{if(ht.length<=1)return;const S0=ht.filter((po,ct)=>ct!==ht.length-1);if(Ht(S0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const po=[];if(Si?.forEach((ct,_t)=>{ct.linkId===hi&&po.push({item:ct,originalIndex:_t})}),Vr>=0&&Vr<po.length){const ct=po[Vr],_t=Si?.filter((An,Gn)=>Gn!==ct.originalIndex);vi(Fr,void 0,_t,void 0,!0)}}else{const po=Vo?.filter((ct,_t)=>_t!==Vr)||[];vi(Fr,po.length>0?po:[{}])}},kn=Vr=>{if(!Si||!Fr.item)return[];const S0=_t=>{const An=[];for(const Gn of _t)if(Gn.linkId===Fr.linkId&&An.push(Gn),Gn.item&&Gn.item.length>0){const jn=S0(Gn.item);An.push(...jn)}return An},ct=S0(Si)[Vr];return ct?.item?ct.item:[]},cn=(Vr,S0)=>{if(isHiddenExtensionPresent(Vr))return null;const po=kn(S0);if(!isQuestionEnabledForInstance(Vr.enableWhen,Vr.enableBehavior,Si||[],Fr.linkId,S0))return null;if(Vr.repeats){const jn=findNestedAnswer(po,Vr.linkId),kr=Jo(q0({},pr),{item:Vr,selectedAnswer:jn||[{}],errors:getInstanceErrors(ki,Fr,S0),handleInputChange:(d0,ao,E0)=>vi(d0,ao,E0,S0)});return jsx("div",{children:jsx(li,Jo(q0({},kr),{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(jn=>{if(!isQuestionEnabledForInstance(jn.enableWhen,jn.enableBehavior,Si||[],Fr.linkId,S0))return null;const d0=Xo(jn,Ii,pr.isLoading,pr.externalComponentRenderMap);if(!d0)return null;const ao=findNestedAnswer(po,jn.linkId),E0=Jo(q0({},pr),{item:jn,selectedAnswer:ao,placeholder:getPlaceholderFromExtensions(jn.extension,jn.type),errors:getInstanceErrors(ki,Fr,S0),handleInputChange:(J0,No,j0)=>vi(J0,No,j0,S0)});return createElement(d0,Jo(q0({},E0),{key:jn.linkId}))})})]},Vr.linkId);const _t=Xo(Vr,Ii,pr.isLoading,pr.externalComponentRenderMap);if(!_t)return null;const An=findNestedAnswer(po,Vr.linkId),Gn=Jo(q0({},pr),{item:Vr,selectedAnswer:An,placeholder:getPlaceholderFromExtensions(Vr.extension,Vr.type),errors:getInstanceErrors(ki,Fr,S0),handleInputChange:(jn,kr,d0)=>vi(jn,kr,d0,S0)});return createElement(_t,Jo(q0({},Gn),{key:`${Vr.linkId}-${S0}`}))},dr=()=>{const Vr=getDirectErrors(ki,hi);return jsxs("div",{className:"flex flex-col gap-2",children:[Vr[hi]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Vr[hi]}),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:pr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},wr=Vr=>ht.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>gn(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:pr.isLoading}),n0=Xo(Fr,Ii,pr.isLoading,pr.externalComponentRenderMap);return hasRepeatingParent(Fr,Ii)&&!Li?null:!Le||Le&&hasCheckboxExtension(Fr)?n0?jsx(n0,Jo(q0({},pr),{placeholder:Fe,errors:{[Fr.linkId]:((i0=ki?.[Fr.linkId])==null?void 0:i0[0])||""}})):null:Fr.type==="group"&&Fr.item&&Fr.item.length>0&&Fr.repeats?jsxs("div",{"data-testid":`${hi}-repeating`,children:[wn&&jsx(FHIRQuestionnaireQuestionText,{text:wn,required:zr||!1}),ht.map(Vr=>{var S0;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]}),wr(Vr)]}),jsx("div",{className:"space-y-4",children:(S0=Fr.item)==null?void 0:S0.map(po=>cn(po,Vr))})]},`${hi}-instance-${Vr}`)}),dr()]}):n0?jsxs("div",{"data-testid":`${hi}-repeating`,children:[ht.map(Vr=>{const S0=Vo?.[Vr]?[Vo[Vr]]:void 0,po=Jo(q0({},pr),{item:Fr,selectedAnswer:S0,errors:getInstanceErrors(ki,Fr,Vr),handleInputChange:(ct,_t,An)=>vi(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]}),wr(Vr)]}),jsx(n0,q0({},po))]},`${hi}-instance-${Vr}`)}),jsxs("div",{children:[(()=>{const S0=getDirectErrors(ki,hi)[hi];return S0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:S0})})(),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:pr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Fi=Object.defineProperty,ga=Object.defineProperties,na=Object.getOwnPropertyDescriptors,pa=Object.getOwnPropertySymbols,Ka=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable,Za=(pr,i0,Fr)=>i0 in pr?Fi(pr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):pr[i0]=Fr,cs=(pr,i0)=>{for(var Fr in i0||(i0={}))Ka.call(i0,Fr)&&Za(pr,Fr,i0[Fr]);if(pa)for(var Fr of pa(i0))_s.call(i0,Fr)&&Za(pr,Fr,i0[Fr]);return pr},Ns=(pr,i0)=>ga(pr,na(i0));const Qa=null,Ws=({formId:pr,questionnaireSchema:i0,questionnaireResponseItem:Fr,errorConfig:Vo,customErrorConfigurations:vi,showQuestionPrefix:yi=!0,isAdaptiveFlow:ki=!1,status:Ii,hideBackButton:Si=!1,showStepper:Li=!1,onComplete:hi,onClearError:Er,handleHiddenQuestion:Qn,onGoBack:zr,onFormDataChange:Le=()=>{},externalComponentRenderMap:Ce,children:Fe})=>{var ht,Ht;const{setHandleContinueButtonClick:tn,setHandleBackButtonClick:wn,setIsCurrentFormValid:nr,setCurrentGroupLinkId:gn,setCurrentGroupIndex:kn,setTotalSteps:cn,setHideFooterButton:dr,setIsInlineNextQuestionTriggered:wr,isCurrentFormValid:n0,currentGroupIndex:O0,isLoading:Vr,hasCustomError:S0,groupItemIndicesRef:po}=useFHIRQuestionnaire(),{trackEvent:ct}=useAnalytics(),[_t,An]=useState([]),[Gn,jn]=useState(new Set),[kr,d0]=useState([]),[ao,E0]=useState([]),J0=po,No=useRef(new Map),j0=useRef(new Set),[Lo,Z0]=useState({}),[A0,Eo]=useState(!1),[K0,$i]=useState(i0),Wo=useRef(Fr||[]),Ci=useRef(!1),va=useRef(!1),Ki=useMemo(()=>getTotalStepsFromQuestionnaire(i0),[i0]),[Xs,Ks]=useState(!1),Xi=useRef([]),h1=(jo,ii)=>{var Ko,Bi,wa,Ra,Ja;if(isCallNextQuestionExtensionPresent(jo))return jo.linkId;const Ia=validateCurrentPage(ii,_t,O0,K0,J0),es=J0.current[O0],Y1=O0+1,R1=J0.current[Y1],ul=O0===0?0:es,Dl=(Bi=R1??((Ko=K0?.item)==null?void 0:Ko.length))!=null?Bi:0;let hl=-1;for(let $n=ul;$n<Dl;$n++){const xi=(wa=K0?.item)==null?void 0:wa[$n];if(xi?.linkId===jo.linkId){hl=$n;break}}const eu=($n,xi=[])=>($n.forEach(Ri=>{var qa;if((!Ri.enableWhen||isQuestionEnabled(Ri.enableWhen,Ri.enableBehavior,ii))&&isCallNextQuestionExtensionPresent(Ri)&&!Xi.current.includes(Ri.linkId))if(Ri.required){const M1=(qa=findResponseItem(ii,Ri.linkId))==null?void 0:qa.answer;(M1&&M1.length>0&&Object.keys(M1[0]).length>0||Ri.initial&&Ri.initial.length>0&&!Gn.has(Ri.linkId))&&xi.push(Ri.linkId)}else xi.push(Ri.linkId);Ri.item&&Ri.item.length>0&&eu(Ri.item,xi)}),xi),Ou=[],Ao=hl!==-1?hl+1:Dl;for(let $n=ul;$n<Ao;$n++){const xi=(Ra=K0?.item)==null?void 0:Ra[$n];xi&&eu([xi],Ou)}if(Ou.length>0&&Ia){const $n=Ou[Ou.length-1],xi=M1=>M1.flatMap(B1=>[B1,...B1.item?xi(B1.item):[]]),Ri=xi((Ja=K0?.item)!=null?Ja:[]),qa=Ri.findIndex(M1=>M1.linkId===$n),Na=Ri.findIndex(M1=>M1.linkId===jo.linkId);return qa!==-1&&Na>qa?void 0:$n}},js=jo=>h1(jo,Wo.current)?!0:jo.item&&jo.item.length>0?jo.item.some(js):!1,bs=()=>{var jo;if(!ki||O0<0||!K0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const ii=J0.current[O0],Bi=(No.current.get(ii)||[ii]).some(Ja=>{var Ia;const es=(Ia=K0.item)==null?void 0:Ia[Ja];return es?js(es):!1}),wa=O0<J0.current.length-1;let Ra=!1;if(Bi&&wa){const Ja=O0+1,Ia=J0.current[Ja],es=(jo=K0?.item)==null?void 0:jo[Ia],Y1=!es?.enableWhen||isQuestionEnabled(es.enableWhen,es.enableBehavior,Wo.current),R1=es?isPageExtensionPresent(es):!1;Ra=Y1&&R1}return{shouldTriggerInlineLoading:Bi,canNavigateToNextGroup:Ra,hasMoreGroups:wa}},N1=(jo,ii,Ko,Bi)=>{const wa=getUpdatedFormData(K0?.item||[],Wo.current,jo,ii,Ko,Bi);return Wo.current=wa,Le(wa),wa},Ar=(jo,ii,Ko,Bi,wa)=>{N1(ii,Ko,Bi,wa),Bi.forEach(Ra=>{const Ja=getValidationError(Ns(cs({},jo),{linkId:Ra.linkId}),Wo.current,Ra.answer);Ja&&Z0(Ia=>Ns(cs({},Ia),{[Ra.linkId]:typeof wa=="number"?Ns(cs({},Ia[Ra.linkId]),{[wa]:Ja}):Ja}))})},Jn=(jo,ii,Ko,Bi,wa)=>{var Ra;const Ja=N1(ii,Ko,Bi,wa),Ia=(Ra=findResponseItem(Ja,ii))==null?void 0:Ra.answer,es=getValidationError(jo,Wo.current,Ia);Z0(Y1=>Ns(cs({},Y1),{[ii]:typeof wa=="number"?Ns(cs({},Y1[ii]),{[wa]:es}):es}))},Pr=(jo,ii)=>{const Ko=validateCurrentPage(ii,_t,O0,K0,J0);if(nr(Ko),K0?.item){const Bi=validateAllItemsRecursively(K0.item,ii);if(Object.keys(Bi).length>0)Z0(wa=>cs(cs({},wa),Bi));else{const wa=K0.item,Ra={},Ja=Ia=>{Ia.forEach(es=>{Ra[es.linkId]={},es.item&&Ja(es.item)})};Ja(wa),Z0(Ia=>cs(cs({},Ia),Ra))}}},fr=(jo,ii,Ko,Bi,wa=!1)=>{var Ra;const{linkId:Ja}=jo;if(wa)return Wo.current=Ko||[],Pr(Ja,Ko||[]),Wo.current;if(Ko&&Ko.length>0&&jo.type==="group"&&jo.repeats){let R1=Wo.current.length;for(let Dl=Wo.current.length-1;Dl>=0;Dl--)if(Wo.current[Dl].linkId===Ja){R1=Dl+1;break}const ul=[...Wo.current.slice(0,R1),...Ko,...Wo.current.slice(R1)];return Wo.current=ul,Pr(Ja,ul),Wo.current}if(typeof Bi=="number"&&ii){const R1=hasRepeatingParent(jo,K0?.item||[]);if(R1){const ul=Wo.current.filter(hl=>hl.linkId===R1.linkId);if(Bi<ul.length){const hl=Wo.current.map(eu=>{if(eu.linkId===R1.linkId&&Wo.current.slice(0,Wo.current.indexOf(eu)).filter(Ao=>Ao.linkId===R1.linkId).length===Bi){const Ao=(Ri,qa)=>{const Na=new Map(Ri.map(B1=>[B1.linkId,B1])),M1=[];return qa?.forEach(B1=>{const Ol=Na.get(B1.linkId);if(B1.linkId===Ja)M1.push(cs({linkId:B1.linkId,text:B1.text,answer:ii},Ol?.item&&{item:Ol.item}));else if(Ol)if(B1.item&&B1.item.length>0){const b1=Ao(Ol.item||[],B1.item);M1.push(Ns(cs({},Ol),{item:b1}))}else M1.push(Ol);else if(B1.item&&B1.item.length>0){const b1=Ao([],B1.item);b1.some(d1=>d1.linkId===Ja||d1.item&&$n(d1.item,Ja))&&M1.push({linkId:B1.linkId,text:B1.text,answer:[{}],item:b1})}Na.delete(B1.linkId)}),Na.forEach(B1=>{M1.push(B1)}),M1},$n=(Ri,qa)=>Ri.some(Na=>Na.linkId===qa||Na.item&&$n(Na.item,qa)),xi=Ao(eu.item||[],R1.item);return Ns(cs({},eu),{item:xi})}return eu});Wo.current=hl,Le(hl)}else{const hl=Bi+1,eu=ul.length;if(eu<hl||hl===1){const Ou=[],Ao=(Ri,qa,Na)=>Ri.map(M1=>{const B1={linkId:M1.linkId,text:M1.text,answer:M1.linkId===qa?Na:[{}]};return M1.item&&M1.item.length>0&&(B1.item=Ao(M1.item,qa,Na)),B1});for(let Ri=eu;Ri<hl;Ri++){const qa=R1.item?Ao(R1.item,Ja,ii):[],Na={linkId:R1.linkId,text:R1.text,answer:[{}],item:qa};Ou.push(Na)}let $n=Wo.current.length;for(let Ri=Wo.current.length-1;Ri>=0;Ri--)if(Wo.current[Ri].linkId===R1.linkId){$n=Ri+1;break}const xi=[...Wo.current.slice(0,$n),...Ou,...Wo.current.slice($n)];Wo.current=xi,Le(xi)}}const Dl=getValidationError(jo,Wo.current,ii);return Z0(hl=>Ns(cs({},hl),{[Ja]:typeof Bi=="number"?Ns(cs({},hl[Ja]),{[Bi]:Dl}):Dl})),Pr(Ja,Wo.current),Wo.current}}if(typeof Bi=="number")return Ko&&Ko.length>0?Ar(jo,Ja,ii,Ko,Bi):Jn(jo,Ja,ii,Ko,Bi),Wo.current;const Ia=N1(Ja,ii,Ko),es=(Ra=findResponseItem(Ia,Ja))==null?void 0:Ra.answer,Y1=getValidationError(jo,Ia,es);return Z0(R1=>Ns(cs({},R1),{[Ja]:typeof Bi=="number"?Ns(cs({},R1[Ja]),{[Bi]:Y1}):Y1})),Pr(Ja,Ia),Wo.current},Hr=()=>{var jo;for(let ii=O0+1;ii<J0.current.length;ii++){const Ko=J0.current[ii],Bi=(jo=K0?.item)==null?void 0:jo[Ko];if(!!Bi&&(!Bi.enableWhen||isQuestionEnabled(Bi.enableWhen,Bi.enableBehavior,Wo.current)))return!0}return!1},$0=()=>{var jo,ii,Ko,Bi,wa;const Ra=(jo=i0?.item)==null?void 0:jo[J0.current[O0]];if(Ra){const es=(ii=getAnalyticsEventName(Ra))!=null?ii:"questionnaire_form",Y1=getAnalyticsPageName(Ra);if(Y1){const R1=(Ko=getAnalyticsFormName(i0))!=null?Ko:i0.name,ul=collectAnalyticsProperties(Ra,Wo.current),Dl={};R1&&(Dl.form_name=R1),Dl.page_name=Y1,Object.assign(Dl,ul),ct(es,Dl)}}const Ja=O0<J0.current.length-1,Ia=checkCurrentStepDataMatch(Wo.current,K0,J0.current,O0,Fr,J0.current.length-1);if(ki&&Ja){const es=O0+1,Y1=J0.current[es],R1=(Bi=K0?.item)==null?void 0:Bi[Y1],ul=!R1?.enableWhen||isQuestionEnabled(R1.enableWhen,R1.enableBehavior,Wo.current),Dl=R1?isPageExtensionPresent(R1):!1;if(ul&&Dl&&Ia){kn(es),nr(!1),window.scrollTo(0,0);return}}if(Ia&&J0.current.length>0){Hr()?kn(O0+1):(hi(removeDisabledItems(Wo.current,K0?.item||[])),nr(!1),window.scrollTo(0,0));return}if(O0<J0.current.length-1){const es=(wa=K0?.item)==null?void 0:wa[J0.current[O0]];if(!es){hi(removeDisabledItems(Wo.current,K0?.item||[]));return}const Y1=es.linkId,R1=findLastGroupInstanceIndex(Wo.current,Y1),ul=Wo.current.slice(0,R1+1);if(!validateCurrentPage(ul,_t,O0,K0,J0))return;ki?(Wo.current=ul,Le(ul),hi(Wo.current),nr(!1)):J0.current.length>0&&(Hr()?kn(O0+1):(hi(removeDisabledItems(Wo.current,K0?.item||[])),window.scrollTo(0,0)))}else hi(removeDisabledItems(Wo.current,K0?.item||[])),nr(!1),window.scrollTo(0,0)};useEffect(()=>{var jo;tn(()=>$0),wn(()=>Ai),nr(n0);const ii=(jo=K0?.item)==null?void 0:jo[J0.current[O0]];ii&&gn(ii.linkId)},[n0,O0]),useEffect(()=>{if(!i0?.item)return;const{groupIndices:jo,itemsToRenderMap:ii}=collectGroupItemIndices(i0.item);J0.current=jo,No.current=ii;const Ko=Ki??jo.length;cn(Ko),d0(jo),ki?(va.current||kn(jo.length>0?jo.length-1:0),wr(!1),va.current=!1):O0===-1&&kn(0)},[i0?.item,Ki]),useEffect(()=>{if(O0<0||!K0?.item)return;const jo=validateCurrentPage(Wo.current,_t,O0,K0,J0);if(!jo){nr(!1);return}const{shouldTriggerInlineLoading:ii,canNavigateToNextGroup:Ko,hasMoreGroups:Bi}=bs();if(ki&&ii){if(!Bi){nr(!1);return}if(Ko&&jo){nr(!0);return}else{nr(!1);return}}nr(jo)},[O0,K0?.item,S0,ki,Wo.current,_t]),useEffect(()=>{if(!i0?.item||Ci.current)return;const jo=initializeQuestionnaireItems(i0.item,Wo.current,i0.item,Wo.current);if(jo!==Wo.current){Wo.current=jo;const Ko=(wa=>{const Ra=new Set,Ja=Ia=>{Ia.forEach(es=>{var Y1;const R1=es.initial&&es.initial.length>0,ul=(es.type==="choice"||es.type==="open-choice")&&((Y1=es.answerOption)==null?void 0:Y1.some(Dl=>Dl.initialSelected===!0));(R1||ul)&&(!es.enableWhen||isQuestionEnabled(es.enableWhen,es.enableBehavior,Wo.current))&&Ra.add(es.linkId),es.item&&Ja(es.item)})};return Ja(wa),Ra})(K0?.item||[]);jn(Ko);const Bi=validateAllItemsRecursively(K0?.item||[],Wo.current);Object.keys(Bi).length>0&&Z0(wa=>cs(cs({},wa),Bi))}Ci.current=!0},[K0?.item,i0]),useEffect(()=>{$i(i0)},[i0]),useEffect(()=>{O0>=0&&window.scrollTo(0,0)},[O0]),useEffect(()=>{var jo;if(!ki||_t.length===0||Vr||!K0?.item)return;const ii=J0.current[O0];if(ii===void 0)return;const Ko=No.current.get(ii)||[ii],Bi=[];if(Ko.forEach(es=>{var Y1;const R1=(Y1=K0?.item)==null?void 0:Y1[es];R1&&hasInitialValue(R1)&&Bi.push(R1)}),Bi.length===0||!Bi.some(es=>h1(es,Wo.current)&&!Xi.current.includes(es.linkId)?(Xi.current.push(es.linkId),!0):!1))return;const Ra=validateCurrentPage(Wo.current,_t,O0,K0,J0),Ja=(jo=K0?.item)==null?void 0:jo[ii],Ia=isHiddenAnswerInValid(Ja,Wo.current);!Ra||Ia||(j0.current.add(O0),wr(!0),va.current=!0,Y0(Bi[Bi.length-1].linkId))},[O0,_t,ki,Vr,K0]);const Y0=(jo,ii=!1,Ko=!1)=>{var Bi;if(ii){hi(removeDisabledItems(Wo.current,K0?.item||[]),Ko),nr(!1);return}const wa=findQuestionByLinkId(K0?.item||[],jo);if(!wa)return;const Ra=(Bi=findResponseItem(Wo.current,jo))==null?void 0:Bi.answer;if(getValidationError(wa,Wo.current,Ra))return;const Ja=getUpdatedFormData(K0?.item||[],Wo.current,jo,Ra),Ia=h1(wa,Ja);if(!Ia)return;nr(!1);const es=findRootGroupLinkId(K0?.item||[],jo);let Y1=Ja,R1=[];const ul=deepTrimFormData(Ja,Ia,K0?.item||[]);Y1=ul.trimmedData,R1=ul.trimmedLinkIds;const Dl=findQuestionByLinkId(K0?.item||[],es||"");Wo.current=Y1;const hl=findGroupPositionByLinkId(K0?.item||[],jo||""),eu=hl!==-1?hl:O0;if(validateCurrentPage(Y1,_t,eu,K0,J0,R1)&&!isHiddenAnswerInValid(Dl,Y1)){wr(!0),va.current=!0;let Ao;const $n=(()=>{var qa;const Na=n1=>n1.flatMap(d1=>[d1,...d1.item?Na(d1.item):[]]),M1=Na((qa=K0?.item)!=null?qa:[]),B1=M1.findIndex(n1=>n1.linkId===Ia),Ol=new Set;let b1=!0;for(;b1;){b1=!1;for(const n1 of M1){if(Ol.has(n1.linkId)||!n1.enableWhen)continue;n1.enableWhen.some(Q1=>{const Wl=M1.findIndex($l=>$l.linkId===Q1.question);return Wl!==-1&&Wl<=B1||Ol.has(Q1.question)})&&(Ol.add(n1.linkId),b1=!0)}}return R1.filter(n1=>!Ol.has(n1))})();$n.length>0&&(Ao=removeItemsFromSchema(K0?.item||[],$n),$i(Ns(cs({},K0),{item:Ao})));const Ri=((qa,Na)=>{const M1=[];let B1=!1;const Ol=b1=>{for(const n1 of b1)B1?(M1.push(n1.linkId),n1.item&&Ol(n1.item)):n1.linkId===Na?B1=!0:n1.item&&Ol(n1.item)};return Ol(qa),M1})(K0?.item||[],Ia);Ri.length>0&&(Xi.current=Xi.current.filter(qa=>!Ri.includes(qa)),jn(qa=>{const Na=new Set(qa);return Ri.forEach(M1=>Na.delete(M1)),Na})),Xi.current.push(Ia),hi(removeDisabledItems(Y1,K0?.item||[]),!0,Ao)}},Bt=(jo,ii,Ko=!1)=>{const Bi=updateItemWithReadOnlyExpression(jo,K0),wa={item:Bi,selectedAnswer:ii,handleInputChange:fr,showQuestionPrefix:yi,onCompleteHandler:Y0,errors:Lo,isLoading:Vr,isCurrentFormValid:n0,contained:K0?.contained,questionnaireSchemaItems:K0?.item,customErrorConfigurations:vi,formData:Wo.current,showStepper:Li,totalStepsFromExtension:Ki,externalComponentRenderMap:Ce,hintText:getHintTextFromExtensions(Bi.extension)};if(typeof Qn=="function"&&Ko)Qn(jo,wa,Wo.current);else if(jo.type in typeToRenderFunctionMap&&!Ko)return _t.includes(jo.linkId)||An(Ra=>[...Ra,jo.linkId]),jsx(RenderFHIRQuestionnaireItem,cs({},wa),jo.linkId);return null},ni=jo=>jo.map(ii=>{var Ko,Bi;const wa=isHiddenExtensionPresent(ii);let Ra=(Ko=findResponseItem(Wo.current,ii.linkId))==null?void 0:Ko.answer;if((!Ra||Object.keys((Bi=Ra?.[0])!=null?Bi:{}).length===0)&&!Gn.has(ii.linkId)){if(ii.initial&&ii.initial.length>0)Ra=ii.initial,jn(Ja=>new Set(Ja).add(ii.linkId));else if((ii.type==="choice"||ii.type==="open-choice")&&ii.answerOption){const Ja=ii.answerOption.filter(Ia=>Ia.initialSelected===!0);Ja.length>0&&(Ra=Ja.map(Ia=>{let es={};return Ia.valueCoding?es={valueCoding:{code:Ia.valueCoding.code,display:Ia.valueCoding.display,system:Ia.valueCoding.system}}:Ia.valueReference&&(es={valueReference:{reference:Ia.valueReference.reference,display:Ia.valueReference.display}}),es}).filter(Ia=>Object.keys(Ia).length>0),jn(Ia=>new Set(Ia).add(ii.linkId)))}Ra&&(Wo.current=getUpdatedFormData(K0?.item||[],Wo.current,ii.linkId,Ra))}if(!ii?.enableWhen||isQuestionEnabled(ii?.enableWhen,ii.enableBehavior,Wo.current)){const Ja=Qa.includes(ii.linkId)||getUIToolkitCode(ii.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Bt(ii,Ra,wa),ii.item&&!wa&&(Ja?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:ni(ii.item)})}):ni(ii.item))]},ii.linkId)}else if(ii.type==="group"&&!wa)return ao.includes(ii.linkId)||(Ki===void 0&&cn(J0.current.length-1||-1),J0.current=J0.current.filter((Ja,Ia)=>Ia!==O0),E0(Ja=>[...Ja,ii.linkId])),null});if(O0>=0){const jo=[];let ii=0,Ko=0;for(;ii<kr.length&&Ko<J0.current.length;){const Bi=kr[ii],wa=J0.current[Ko];if(Bi<wa){const Ra=(ht=K0?.item)==null?void 0:ht[Bi];(!Ra?.enableWhen||isQuestionEnabled(Ra.enableWhen,Ra.enableBehavior,Wo.current))&&jo.push(ii),ii++}else Bi===wa&&ii++,Ko++}for(;ii<kr.length;){const Bi=kr[ii],wa=(Ht=K0?.item)==null?void 0:Ht[Bi];(!wa?.enableWhen||isQuestionEnabled(wa.enableWhen,wa.enableBehavior,Wo.current))&&jo.push(ii),ii++}if(jo.length>0){Ki===void 0&&cn(J0.current.length+jo.length),jo.reverse().forEach(wa=>{const Ra=kr[wa];let Ja=0;for(let Ia=0;Ia<J0.current.length;Ia++){if(J0.current[Ia]>Ra){Ja=Ia;break}Ja=Ia+1}J0.current.splice(Ja,0,Ra)});const Bi=jo.map(wa=>{var Ra;const Ja=kr[wa],Ia=(Ra=K0?.item)==null?void 0:Ra[Ja];return Ia?.linkId}).filter(Boolean);E0(wa=>wa.filter(Ra=>!Bi.includes(Ra)))}kr.forEach(Bi=>{var wa;const Ra=(wa=K0?.item)==null?void 0:wa[Bi];Ra?.enableWhen&&!isQuestionEnabled(Ra.enableWhen,Ra.enableBehavior,Wo.current)&&Wo.current.some(Ia=>Ia.linkId===Ra.linkId)&&(Wo.current=removeAnswerFromFormData(Wo.current,Ra.linkId))})}const Ai=()=>{var jo;if(Vo&&!A0&&O0>0&&Ii!=="completed")kn(J0.current.length-1),Eo(!0),dr(!1),Er?.();else if(O0>0&&Ii!=="completed"){let ii=O0-1;for(;ii>0;){const Ko=J0.current[ii],Bi=(jo=K0?.item)==null?void 0:jo[Ko];if(!Bi?.enableWhen||isQuestionEnabled(Bi.enableWhen,Bi.enableBehavior,Wo.current))break;ii--}kn(ii),nr(!0),dr(!1),Er?.()}else zr?.()},Ta=jo=>jo.preventDefault();return useEffect(()=>{const jo=setTimeout(()=>{Ks(!0)},0);return()=>clearTimeout(jo)},[]),Xs?jsxs(Fragment,{children:[jsxs("form",{id:pr,className:"w-full","data-testid":"questionnaire-form",onSubmit:Ta,children:[!Si&&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:()=>Ai(),onKeyDown:jo=>{(jo.key==="Enter"||jo.key===" ")&&Ai()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Vo&&!A0?jsx(EmptyState,{className:"mt-5xl",title:Vo.title,description:Vo.description,featuredIconProps:{icon:Vo.icon,color:"gray"},primaryButton:Vo.primaryButton,secondaryButton:Vo.secondaryButton?Ns(cs({},Vo.secondaryButton),{onClick:Ai}):void 0}):jsxs(Fragment,{children:[!K0?.item&&Vr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),K0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:ni(O0>=0?K0.item.filter((jo,ii)=>{const Ko=J0.current[O0];return(No.current.get(Ko)||[Ko]).includes(ii)}):K0?.item||[])})]})]}),Ci.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),o=e(25624),i=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,i.c)(),T=(0,t.useMemo)(()=>{var w;return(w=h.item)!=null?w:[]},[h.item]),S=h.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(w=>!w.enableWhen||(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),E=(0,t.useMemo)(()=>T.filter(w=>w.enableWhen&&!(0,o.GN)(w.enableWhen,w.enableBehavior,b??[])),[T,b]),R=w=>{var N,V;if(!b)return!1;const q=(0,o.MU)(b,w);return((V=(N=q?.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>C.some(w=>R(w.linkId)),[C,b]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.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,C.length,x,z]),(0,t.useEffect)(()=>{E.forEach(w=>{var N,V;const q=b?(0,o.MU)(b,w.linkId):void 0;(!q||((V=(N=q.answer)==null?void 0:N[0])==null?void 0:V.valueBoolean)!==!1)&&f(w,[{valueBoolean:!1}])})},[E]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=w=>{const N=R(w.linkId);f(w,[{valueBoolean:!N}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:C.map(w=>{var N,V,q,I;const k=R(w.linkId),U=(N=w.extension)==null?void 0:N.find(se=>se.url===s.g4),F=(V=w.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=w.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(w)},w.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({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})},i=({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)(o,{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:o})=>{var i,a,g,c;const u=o.text||"",y=(a=(i=o.extension)==null?void 0:i.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=o.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":o.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),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?o(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)=>i(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),[C,E]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[w,N]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),oe=()=>{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 ce;if(Array.isArray(he))if(me)ce=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;ce=he}if(!ce)return;let ue=A({},ae);ce.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=ce.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);ce.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=ce.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=ce.eventName,ve=ce.description;f(J,m(A(A({},re),ce.properties),{_event_metadata:ve?{description:ve}:void 0}))},[h,f]),ge={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:P,totalSteps:w,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:E,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:N,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:oe,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 o=e(25624),i=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:o,onActionButtonClick:i,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}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:i,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:i.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),o=e(76808),i=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,C)=>{var E=P=>{try{L(T.next(P))}catch(D){C(D)}},R=P=>{try{L(T.throw(P))}catch(D){C(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(E,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:w,setQueryParams:N}=(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=>{N(f(h({},w),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,w,N]),F=(0,t.useCallback)(()=>{S===void 0&&(!E||[a.Ef.GRANTED].includes(E)&&I.get()||[a.Ef.PROMPT].includes(E)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(E)))},[S,E,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,o.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&&C?C():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,C]),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&&C?C():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),oe=(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),N(f(h({},w),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&C?C():q(!1)},[D,P,N,w,I,S,C]),te=(0,t.useCallback)(()=>oe("close"),[oe]),pe=(0,t.useCallback)(()=>oe("cancel"),[oe]);return(0,n.jsx)(i.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,o=Object.prototype.hasOwnProperty,i=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={}))o.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))i.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 o=y=>y*1609.34;var i=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:o(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,i.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,i.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,i.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:i,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:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),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"})]})},o=()=>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:o,fullImageHeader:i=!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:[i?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}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:i})=>{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:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},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:Pt="currentColor",...hn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Qe,height:Qe,stroke:Pt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...hn},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 o=e(14449),i=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,Pt)=>Qe===Pt;function M(Qe=d){const Pt=Qe===d?v:()=>(0,r.useContext)(Qe);return function(zn,et=b){const{store:Rt,subscription:kt,getServerState:Wn}=Pt(),Cr=h(kt.addNestedSub,Rt.getState,Wn||Rt.getState,zn,et);return(0,r.useDebugValue)(Cr),Cr}}const x=M();var z=e(75985),T=e(524);function S(){const Qe=getBatch();let Pt=null,hn=null;return{clear(){Pt=null,hn=null},notify(){Qe(()=>{let zn=Pt;for(;zn;)zn.callback(),zn=zn.next})},get(){let zn=[],et=Pt;for(;et;)zn.push(et),et=et.next;return zn},subscribe(zn){let et=!0,Rt=hn={callback:zn,next:null,prev:hn};return Rt.prev?Rt.prev.next=Rt:Pt=Rt,function(){!et||Pt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:hn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Pt=Rt.next)}}}}const C={notify(){},get:()=>[]};function E(Qe,Pt){let hn,zn=C;function et(hr){return Cr(),zn.subscribe(hr)}function Rt(){zn.notify()}function kt(){Dn.onStateChange&&Dn.onStateChange()}function Wn(){return Boolean(hn)}function Cr(){hn||(hn=Pt?Pt.addNestedSub(kt):Qe.subscribe(kt),zn=S())}function mn(){hn&&(hn(),hn=void 0,zn.clear(),zn=C)}const Dn={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:kt,isSubscribed:Wn,trySubscribe:Cr,tryUnsubscribe:mn,getListeners:()=>zn};return Dn}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const w=Qe=>{D=Qe},N=null,V=null,q=Qe=>{try{return JSON.stringify(Qe)}catch{return String(Qe)}};function I(Qe,Pt,hn){useIsomorphicLayoutEffect(()=>Qe(...Pt),hn)}function k(Qe,Pt,hn,zn,et,Rt){Qe.current=zn,hn.current=!1,et.current&&(et.current=null,Rt())}function U(Qe,Pt,hn,zn,et,Rt,kt,Wn,Cr,mn,Dn){if(!Qe)return()=>{};let hr=!1,Fn=null;const $r=()=>{if(hr||!Wn.current)return;const It=Pt.getState();let $e,ot;try{$e=zn(It,et.current)}catch(Je){ot=Je,Fn=Je}ot||(Fn=null),$e===Rt.current?kt.current||mn():(Rt.current=$e,Cr.current=$e,kt.current=!0,Dn())};return hn.onStateChange=$r,hn.trySubscribe(),$r(),()=>{if(hr=!0,hn.tryUnsubscribe(),hn.onStateChange=null,Fn)throw Fn}}const F=()=>N;function K(Qe,Pt){return Qe===Pt}let G=!1;function se(Qe,Pt,hn,{pure:zn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:kt=shallowEqual,areMergedPropsEqual:Wn=shallowEqual,forwardRef:Cr=!1,context:mn=ReactReduxContext}={}){const Dn=mn,hr=mapStateToPropsFactory(Qe),Fn=mapDispatchToPropsFactory(Pt),$r=mergePropsFactory(hn),Jr=Boolean(Qe);return $e=>{const ot=$e.displayName||$e.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:Jr,displayName:Je,wrappedComponentName:ot,WrappedComponent:$e,initMapStateToProps:hr,initMapDispatchToProps:Fn,initMergeProps:$r,areStatesEqual:et,areStatePropsEqual:kt,areOwnPropsEqual:Rt,areMergedPropsEqual:Wn};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Pn}=st,Ln=_objectWithoutPropertiesLoose(st,P);return[st.context,Pn,Ln]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Dn,[le,Dn]),zt=useContext(Te),Gt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(zt)&&Boolean(zt.store),Tn=Gt?st.store:zt.store,ar=vn?zt.getServerState:Tn.getState,Dt=useMemo(()=>defaultSelectorFactory(Tn.dispatch,tt),[Tn]),[Ne,Ze]=useMemo(()=>{if(!Jr)return V;const Pn=createSubscription(Tn,Gt?void 0:zt.subscription),Ln=Pn.notifyNestedSubs.bind(Pn);return[Pn,Ln]},[Tn,Gt,zt]),At=useMemo(()=>Gt?zt:_extends({},zt,{subscription:Ne}),[Gt,zt,Ne]),en=useRef(),nn=useRef(Ue),fn=useRef(),mt=useRef(!1),Qt=useRef(!1),qt=useRef(!1),Lt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const $t=useMemo(()=>()=>fn.current&&Ue===nn.current?fn.current:Dt(Tn.getState(),Ue),[Tn,Ue]),Yt=useMemo(()=>Ln=>Ne?U(Jr,Tn,Ne,Dt,nn,en,mt,qt,fn,Ze,Ln):()=>{},[Ne]);I(k,[nn,en,mt,Ue,fn,Ze]);let On;try{On=D(Yt,$t,ar?()=>Dt(ar(),Ue):$t)}catch(Pn){throw Lt.current&&(Pn.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.1133.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1133.1",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.1384.1",D="@icanbwell/composite. repo version: 0.1384.1",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.1133.
|
|
3
|
+
"version": "1.1133.1",
|
|
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.1384.
|
|
47
|
-
"description": "@icanbwell/composite. repo version: 0.1384.
|
|
46
|
+
"repoVersion": "0.1384.1",
|
|
47
|
+
"description": "@icanbwell/composite. repo version: 0.1384.1"
|
|
48
48
|
}
|