@icanbwell/composite 1.1100.3 → 1.1100.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},Ve=({src:Gt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn,cr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Pn=`bwell-${Kt}`;if(customElements.get(Pn)!==void 0)return;class Ur extends f{constructor(){super(),Fe.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Lt.set(this,new I.EventEmitter),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),$n.set(this,void 0),this.attachShadow({mode:"open"});const Dt=new Me(ze).attachToShadowRoot(this.shadowRoot);Dt.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Ye,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,$n,{slots:Dt,attributes:new k().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Lt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Fe,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Fe,"m",vn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Fe,"m",cr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Fe,"m",cr).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,$n,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Qe,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(Dt=>this.dispatchEvent(Dt)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,mn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,mn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Gt).catch(()=>{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Dt;(0,p.__classPrivateFieldGet)(this,Lt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(Dt=(0,p.__classPrivateFieldGet)(this,Qe,"f"))===null||Dt===void 0||Dt.deregister(),(0,p.__classPrivateFieldGet)(this,Lt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,$n=new WeakMap,Fe=new WeakSet,Mr=function(){(0,p.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${Pn}`),(0,p.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",Gt),(0,p.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Pn,utils:(0,p.__classPrivateFieldGet)(this,$n,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Ye,"f"))},vn=function({visibility:Dt,name:$e}){(0,p.__classPrivateFieldGet)(this,Ye,"f").style.display=Dt==="hidden"?"unset":"hidden"},Nn=function(Dt){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},cr=function(Dt){return $e=>{const ot=Ie.findIndex(tt=>tt===Dt);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,Fe,"m",Nn).call(this,Dt),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlotLocked(xe[Dt]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,Fe,"m",Nn).call(this,Dt);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Pn,Ur)}),it={rE:"1.1100.3"},bt="composite";var xt=e(67321);Ve({src:`https://embeddables.prod.icanbwell.com/${bt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:bt,version:it.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),k=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===k&&U.resourceType==="Questionnaire"),q=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:q,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[Me,Se]=(0,t.useState)(he),[ge,ne]=(0,t.useState)(he),[ae,{loading:me,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(he)},onCompleted:Kt=>{var Ct,Xe;const Fe=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(Fe?.length?Fe:he)}}),De=(0,t.useMemo)(()=>Me.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,Me]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn;if(F(Kt),G(Kt),ie(!1),Kt&&typeof Kt=="string"){const cr=Me.find(tt=>tt.id===Kt),Pn=cr?.label||V;if(!cr)return;k(Pn),q(Pn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Se(tt),ne(tt)},f);const Ur=yield ae({variables:{placeId:Kt}}),t0=(Xe=(Ct=Ur?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Dt=(Ot=(Fe=Ur?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Ye=(Qe=Ur?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=Ur?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=Ur?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(t0&&Dt)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(t0),longitude:String(Dt)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Mr=($n=tt?.data)==null?void 0:$n.geocodingByLatLon)==null?void 0:Mr.state)||"",Et=((Nn=(vn=tt?.data)==null?void 0:vn.geocodingByLatLon)==null?void 0:Nn.stateCode)||"";T({latitude:t0,longitude:Dt,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Pn,value:Kt})}else T({latitude:t0,longitude:Dt,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Pn,value:Kt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),Ve=Kt=>h(void 0,null,function*(){if(ie(!1),k(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(he)}),it=Kt=>{te.current=Kt},bt=()=>{k(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),k(w),q(w),w===V&&k(w);const cr=yield ae({variables:{placeId:N}}),Pn=(Xe=(Ct=cr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Ur=(Ot=(Fe=cr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,t0=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",Dt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",$e=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Pn&&Ur)if(!t0||!Dt||!$e){const ot=yield ce({variables:{latitude:String(Pn),longitude:String(Ur)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Mr=($n=ot?.data)==null?void 0:$n.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((Nn=(vn=ot?.data)==null?void 0:vn.geocodingByLatLon)==null?void 0:Nn.stateCode)||"";T({latitude:Pn,longitude:Ur,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Pn,longitude:Ur,zipCode:t0,state:Dt,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),k(""),q(""),Se(he),ne(he)}))()},[]);const xt=se||!!pe||!!re||!!Ee||!!R,Gt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:Ve,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:xt,hint:Gt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,Fe=Ct.mainText||"",Ot=Ct.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ot.trim().length>0,Lt=Qe?(0,r.RZ)(Fe,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=k=>{try{V(L.next(k))}catch(I){D(I)}},w=k=>{try{V(L.throw(k))}catch(I){D(I)}},V=k=>k.done?P(k.value):Promise.resolve(k.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},k.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),he=(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]),Me=(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 he()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[he,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield Me(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield Me(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}q(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield Me(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{q(!1)}}),[ne,P,L,te,Me,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield he())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[he,P,Se]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{q(!1)}}),[he,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield Me(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{q(!1)}}),[he,P,te,Me,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Me(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},k.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{q(!1)}}),[he,P,w,te,Me]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{q(!0);const ve=yield ae();ve&&w(M(b({},k.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{q(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,pe,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>Ur,GI:()=>F,rz:()=>Xe,Fp:()=>Ct,el:()=>Kt,ao:()=>Gt,oA:()=>T,Yt:()=>t0,g4:()=>xt,tn:()=>Je,n4:()=>S,gD:()=>z,Vp:()=>cr,Cx:()=>P,bK:()=>R,gi:()=>Pn,Z$:()=>he,GT:()=>Nn,hr:()=>Me,JL:()=>Se,Ck:()=>L,dU:()=>C,wG:()=>Sn,hZ:()=>Lt,$e:()=>Fe,qT:()=>Ye,GQ:()=>Qe,q3:()=>mn,D_:()=>Ot,Uf:()=>N,_l:()=>G,Md:()=>k,V7:()=>V,fe:()=>ie,JP:()=>zt,Z_:()=>E,zO:()=>te,UZ:()=>q,$7:()=>xe,rb:()=>w,_W:()=>it,WS:()=>Ve,VF:()=>Mr,vf:()=>Rt,PV:()=>vn,PS:()=>et,Iz:()=>$n,zD:()=>I,m3:()=>De,XP:()=>ze,PM:()=>pe,cX:()=>ge,G6:()=>ne,Us:()=>ue,AA:()=>me,G0:()=>Ee,mO:()=>J,HH:()=>ce,PU:()=>ot,Tl:()=>ve,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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"}));b.displayName="ClipboardPlus";const M=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",w="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",V="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",k="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",q="tz-code",U="footer",F="check-box",K="header",G="page",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{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"}],Me={"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"},Se={"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"},ge="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",me="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",ce="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",re="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ve="ui-toolkit/SelectableOption",Ee="ui-toolkit/Modal",De="ui-toolkit/Alert",ze="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ve="http://icanbwell.com/fhir/StructureDefinition/text-align",it={LEFT:"left",CENTER:"center"},bt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},xt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Gt="http://icanbwell.com/fhir/StructureDefinition/error-title",Kt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ct="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Xe="http://icanbwell.com/fhir/StructureDefinition/description",Fe="http://icanbwell.com/fhir/StructureDefinition/modal-description",Ot="http://icanbwell.com/fhir/StructureDefinition/modal-title",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Lt="http://icanbwell.com/fhir/StructureDefinition/button-text",mn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Sn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",et="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",kt="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",$n="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Mr="http://icanbwell.com/fhir/StructureDefinition/trigger-color",vn="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Nn="http://hl7.org/fhir/StructureDefinition/mimeType",cr="http://hl7.org/fhir/StructureDefinition/maxSize",Pn="http://icanbwell.com/fhir/StructureDefinition/message-severity",Ur="http://icanbwell.com/fhir/StructureDefinition/alert-color",t0="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dt="http://icanbwell.com/fhir/StructureDefinition/placeholder",$e="http://icanbwell.com/fhir/StructureDefinition/hint-text",ot="ui-toolkit/PrefilledMemberDemographicsAlert",Je="http://hl7.org/fhir/issue-severity",tt="http://icanbwell.com/fhir/StructureDefinition/button-type",rt="http://icanbwell.com/fhir/StructureDefinition/button-action",lt="button-type",Et="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",le="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Te={},zt={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-plus":b,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>Ve,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>Dt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>k,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>it,yQ:()=>Te,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(pt,Qt,qt)=>Qt in pt?A(pt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Qt]=qt,f=(pt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(pt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(pt,qt,Qt[qt]);return pt},b=(pt,Qt)=>m(pt,d(Qt));const M=pt=>{var Qt;return(Qt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Qt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Qt&&qt?Pt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Qt=pt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=pt=>{const Qt=pt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Qt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&E[Qt]||C},L=pt=>{const Qt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=pt=>{const Qt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Yt)=>Yt.indexOf(Pt)===$t).join(", "),N=(pt,Qt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Yt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,An=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return An.length>0?`${Yt} (${An.join(", ")})`:Yt},w=pt=>{const Qt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(pt,Qt)=>{var qt,Pt,$t;const Yt=Qt?.find(An=>An.url.includes(pt));return($t=(Pt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Pt:Yt?.valueString)!=null?$t:Yt?.valueDate},k=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Qt=(0,o.evaluate)({},pt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Qt)=>{var qt,Pt;const $t=Qt?.find(An=>An.url===pt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||k((Pt=$t.valueExpression)==null?void 0:Pt.expression)},q=(pt,Qt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=V(Qt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=q(qt.item,Qt);if($t!==void 0)return $t}}},U=(pt,Qt)=>{try{const qt=String(pt??Qt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},F=(pt,Qt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Qt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=F(Pt.item,Qt);if($t!==void 0)return $t}}},K=(pt,Qt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Qt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Pt.push(...Yt)}return Pt},G=(pt,Qt,qt=0)=>K(pt,Qt)[qt];function se(pt){return pt!=null}const ie=(pt,Qt)=>{var qt,Pt,$t;if("answerString"in pt&&se(pt.answerString)){if(pt.operator==="=")return Qt?.valueString===pt.answerString;if(pt.operator==="!=")return Qt?.valueString!==pt.answerString}if("answerBoolean"in pt&&se(pt.answerBoolean)){if(pt.operator==="=")return Qt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Qt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&se(pt.answerInteger)||"answerDecimal"in pt&&se(pt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),An=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Yt===An;if(pt.operator==="!=")return Yt!==An;if(pt.operator===">")return Yt>An;if(pt.operator==="<")return Yt<An;if(pt.operator===">=")return Yt>=An;if(pt.operator==="<=")return Yt<=An}if("answerQuantity"in pt&&se(pt.answerQuantity)){const Yt=Qt?.valueQuantity,An=pt.answerQuantity;if(Yt?.unit!==An?.unit)return!1;if(pt.operator==="=")return Yt.value===An.value;if(pt.operator==="!=")return Yt.value!==An.value;if(pt.operator===">")return Yt.value>An.value;if(pt.operator==="<")return Yt.value<An.value;if(pt.operator===">=")return Yt.value>=An.value;if(pt.operator==="<=")return Yt.value<=An.value}if("answerCoding"in pt&&se(pt.answerCoding)){const Yt=Qt?.valueCoding,An=pt.answerCoding;if(pt.operator==="=")return Yt?.code===An.code;if(pt.operator==="!=")return Yt?.code!==An.code}if("answerReference"in pt&&se(pt.answerReference)){const Yt=Qt?.valueReference,An=pt.answerReference;if(pt.operator==="=")return Yt?.reference===An.reference;if(pt.operator==="!=")return Yt?.reference!==An.reference}if("answerDate"in pt&&se(pt.answerDate)||"answerDateTime"in pt&&se(pt.answerDateTime)||"answerTime"in pt&&se(pt.answerTime)){const Yt=new Date(($t=(Pt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Pt:Qt?.valueTime)!=null?$t:""),An=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Yt.getTime()===An.getTime();if(pt.operator==="!=")return Yt.getTime()!==An.getTime();if(pt.operator===">")return Yt.getTime()>An.getTime();if(pt.operator==="<")return Yt.getTime()<An.getTime();if(pt.operator===">=")return Yt.getTime()>=An.getTime();if(pt.operator==="<=")return Yt.getTime()<=An.getTime()}return pt.operator==="exists"?Qt!=null===pt.answerBoolean:!0},te=(pt,Qt,qt)=>{const Pt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(An=>!An.answer||An.answer.length===0)?ie($t,void 0):Yt.some(An=>{var zr;return(zr=An.answer)==null?void 0:zr.some(qr=>ie($t,qr&&Object.keys(qr).length>0?qr:void 0))})};return pt&&pt?.length>0?Qt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},he=(pt,Qt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Yt=An=>{var zr;let qr;if(Pt&&typeof $t=="number"){const Dn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Dn?.item){const rn=Dn.item.find(vt=>vt.linkId===An.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!qr){const Ln=K(qt,An.question);if(Ln.length>0)return Ln.some(Dn=>{var rn;return(rn=Dn.answer)==null?void 0:rn.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))});qr=void 0}return ie(An,qr)};return Qt==="any"?pt.some(An=>Yt(An)):pt.every(An=>Yt(An))},Me=(pt,Qt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Qt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Se=(pt,Qt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=Me(Pt,Qt);return b(f({},pt),{readOnly:$t??pt.readOnly})},ge=(pt,Qt,qt)=>{const{required:Pt,maxLength:$t,type:Yt,extension:An,enableWhen:zr,enableBehavior:qr,repeats:Ln,answerOption:Dn}=pt;if(!te(zr,qr,Qt)||pt.type==="group"||pt.type==="display")return"";if(Ln)return ne(pt,Qt,qt);const rn=ce(pt,Qt);return rn&&ue(rn,pt)?re(pt,Qt,qt,rn):pe(An,Yt,Pt,$t,qt,Dn)},ne=(pt,Qt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const An=qt[Yt];if(An&&Object.keys(An).length>0&&Object.values(An).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){$t=!0;const qr=pe(pt.extension,pt.type,!0,pt.maxLength,[An],pt.answerOption);if(qr)return`Item ${Yt+1}: ${qr}`;if(pt.item&&pt.item.length>0){const Ln=ae(pt.item,Qt,pt.linkId,Yt);if(Ln)return`Item ${Yt+1}: ${Ln}`}}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(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Yt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const qr=ae(pt.item,Qt,pt.linkId,$t);if(qr)return`Item ${$t+1}: ${qr}`}}}return""},ae=(pt,Qt,qt,Pt)=>{var $t,Yt;for(const An of pt){if(!he(An.enableWhen,An.enableBehavior,Qt,qt,Pt))continue;const zr=F(Qt,qt),qr=($t=zr?.item)==null?void 0:$t.find(Dn=>Dn.linkId===An.linkId),Ln=(Yt=qr?.answer)!=null&&Yt[Pt]?[qr.answer[Pt]]:void 0;if(An.required){if(!Ln||!Ln[0]||!me(Ln[0]))return`${An.text||An.linkId} is required`;const Dn=pe(An.extension,An.type,!0,An.maxLength,Ln,An.answerOption);if(Dn)return`${An.text||An.linkId}: ${Dn}`}else if(Ln&&Ln[0]&&me(Ln[0])){const Dn=pe(An.extension,An.type,!1,An.maxLength,Ln,An.answerOption);if(Dn)return`${An.text||An.linkId}: ${Dn}`}if(An.item&&An.item.length>0){const Dn=ae(An.item,Qt,An.linkId,Pt);if(Dn)return Dn}}return""},me=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),pe=(pt,Qt,qt,Pt,$t,Yt)=>{var An,zr,qr,Ln,Dn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),St=$t?.[0],Zt={choice:((An=St?.valueCoding)==null?void 0:An.code)||(St?.valueString&&Yt?.some(Cn=>Cn.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.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:(qr=St?.valueQuantity)==null?void 0:qr.value,reference:(Ln=St?.valueReference)==null?void 0:Ln.display,attachment:(Dn=St?.valueAttachment)==null?void 0:Dn.title};if(!(Qt in Zt))return"";const cn=Zt[Qt],on={required:()=>qt&&(cn==null||cn===""||cn==="NaN"||Number.isNaN(cn)||Qt==="boolean"&&cn!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&cn!==null&&cn!==void 0&&cn.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=V("minLength",pt);return Cn&&cn!==null&&cn!==void 0&&cn.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=V("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Qt==="url"&&cn&&!Cn.test(cn)?String(wr):""},regex:()=>{const Cn=V("regex",pt);if(!Cn||typeof cn!="string")return"";const jn=new RegExp(Cn),wr=V("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&cn&&!jn.test(cn)?String(Wr):""},dateTime:()=>{if(Qt==="dateTime"&&cn){const Cn=cn?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!cn)return"";const Cn=cn.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(cn).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Qt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(cn,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=V("minValue",pt);return jn!=null&&cn!==null&&cn!==void 0&&cn<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Qt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(cn,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=V("maxValue",pt);return jn!=null&&cn!==null&&cn!==void 0&&cn>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(pt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===pt.linkId))return qt;const $t=ce(pt,qt.item);if($t)return $t}return null},ue=(pt,Qt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(pt,Qt,qt,Pt)=>{var $t,Yt;const{required:An}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Dn=>Dn.linkId===pt.linkId),qr=zr?.answer||[],Ln=((Yt=Pt.answer)==null?void 0:Yt.length)||1;for(let Dn=0;Dn<Ln;Dn++){const rn=qr[Dn];if(An){if(!rn||!me(rn))return`Item ${Dn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Dn+1}: ${vt}`}else if(rn&&me(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Dn+1}: ${vt}`}}return""},J=(pt,Qt)=>{for(const qt of pt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Qt);if(Pt)return Pt}}},ve=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},Ve=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Qt;const qt=(Qt=pt?.extension)==null?void 0:Qt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(pt,Qt,qt,Pt,$t,Yt)=>{const An=qr=>Qt.filter(Ln=>Ln.linkId===qr),zr=new Set;return pt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Dn=An(qr.linkId),rn=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),rn){const vt=[];if(Dn.forEach((St,Zt)=>{const cn={linkId:qr.linkId,text:qr.text};let on;if(qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const Cn=St?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=b(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else qr.item&&(on=xt(qr.item,St?.item||[],qt,Pt,$t,Zt));qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Pt?cn.answer=Pt:cn.answer=St.answer||[{}],on&&on.length>0?cn.item=on:St.item&&(cn.item=St.item),vt.push(cn)}),qt===qr.linkId&&typeof Yt=="number"&&Yt>=Dn.length)for(let St=Dn.length;St<=Yt;St++){const Zt={linkId:qr.linkId,text:qr.text,answer:St===Yt&&Pt?Pt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:qr.item&&(Zt.item=xt(qr.item,[],void 0,void 0,void 0,void 0)),vt.push(Zt)}return vt}else if(qr.repeats&&typeof Yt=="number"&&qt===qr.linkId){const vt=Dn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},St={linkId:qr.linkId,text:qr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Pt[0]}return St}else{const vt=Dn[0],St=qr.item?xt(qr.item,vt?.item||[],qt,Pt,$t,Yt):void 0,Zt=St&&St.length>0,cn={linkId:qr.linkId,text:qr.text};return qt&&qr.linkId===qt&&typeof Yt!="number"?(Pt||!Pt&&!$t?cn.answer=Pt:vt?.answer&&(cn.answer=vt.answer),$t?cn.item=$t:Zt&&(cn.item=St)):(vt?.answer?cn.answer=vt.answer:cn.answer=[{}],Zt&&(cn.item=St)),cn}}).filter(Boolean).flat()},Gt=(pt,Qt)=>{for(const qt of pt)if(qt.linkId===Qt||qt.item&&Gt(qt.item,Qt))return qt.linkId;return null},Kt=(pt,Qt,qt,Pt)=>{var $t;const Yt=($t=pt?.item)!=null?$t:Pt;return!Yt||Yt.length===0?!0:Yt.every(An=>{var zr;const qr=K(Qt,An.linkId);if(qr.length===0){const Ln=(zr=F(Qt,An.linkId))==null?void 0:zr.answer;if(ge(An,Qt,Ln)&&te(An.enableWhen,An.enableBehavior,Qt)&&qt.includes(An.linkId))return!1}else for(const Ln of qr)if(ge(An,Qt,Ln.answer)&&te(An.enableWhen,An.enableBehavior,Qt)&&qt.includes(An.linkId))return!1;return An.item?Kt(An,Qt,qt):!0})},Ct=(pt,Qt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Qt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&Ct(Pt.item,Qt,qt))return!0;return!1},Xe=(pt,Qt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Qt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(An=>An!=null&&An!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(pt,Qt,!1)},Fe=(pt,Qt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(Ee(Pt)&&Pt.required&&te(Pt.enableWhen,Pt.enableBehavior,Qt)){const Yt=F(Qt,Pt.linkId),An=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Yt?.answer,Pt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||An)return!0}if(Pt.item){for(const Yt of Pt.item)if(qt(Yt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Ot=pt=>{var Qt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Qt=pt.valueCoding)==null?void 0:Qt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Qt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Ot(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Qt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Ye=(pt,Qt,qt,Pt,$t,Yt)=>{var An;const zr=(An=Qt?.item)==null?void 0:An[qt[Pt]],qr=zr?.linkId;if(!qr)return!1;const Ln=K(pt,qr),Dn=K($t,qr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const St=vt.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 vt=="object"){const St={};for(const[Zt,cn]of Object.entries(vt))if(cn!=null){const on=rn(cn);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return vt}};if(Ln.length!==Dn.length)return!1;for(let vt=0;vt<Ln.length;vt++){const St=Ln[vt],Zt=Dn[vt];if(!St||!Zt)return!1;const cn=Qe(rn(St)),on=Qe(rn(Zt));if(!_.isEqual(cn,on))return!1}return Pt!==Yt},Lt=(pt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(pt,Qt,qt)||null,mn=(pt,Qt)=>{const qt={},Pt=$t=>{$t.forEach(Yt=>{const An=K(Qt,Yt.linkId);if(st(Yt,pt)||Yt.repeats)for(let zr=0;zr<An.length;zr++){const qr=An[zr];if(qr?.answer&&qr.answer.length>0){const Ln=Lt(Yt,Qt,qr.answer);Ln&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Ln}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Lt(Yt,Qt,zr.answer);qr&&(qt[Yt.linkId]={0:qr})}}Yt.item&&Yt.item.length>0&&Pt(Yt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Qt=pt.split("-");if(Qt.length===3){const[qt,Pt,$t]=Qt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Qt)=>{const qt=(Pt,$t)=>{for(const Yt of Pt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const An=qt(Yt.item,$t);if(An!==void 0)return An}}};return qt(pt,Qt)},kt=(pt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=pt.linkId,Pt=($t,Yt,An=[])=>{for(const zr of $t){const qr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Yt,qr))return zr}}return null};return Pt(Qt,qt)},$n=(pt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=pt.linkId,Pt=($t,Yt,An=[])=>{for(const zr of $t){const qr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Yt,qr))return!0}}return!1};return Pt(Qt,qt)},Mr=(pt,Qt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Qt;if(pt[$t]){const Yt=pt[$t];Pt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(pt[Yt.linkId]){const An=pt[Yt.linkId];Pt[Yt.linkId]=An[qt]||""}}),Pt},vn=(pt,Qt)=>{const qt={};if(!pt||!pt[Qt])return qt;const Pt=pt[Qt];return qt[Qt]=Pt[0]||"",qt},Nn=pt=>{const Qt=pt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Pt=new Map;let $t=null;if(pt.forEach((Yt,An)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")An!==Qt&&qt.push(An),Pt.set(An,[An]),$t=An;else if($t!==null&&!zr){const qr=Pt.get($t)||[];Pt.set($t,[...qr,An])}}),pt.length>0&&qt.length>0){const Yt=qt[0];if(!Pt.has(Yt)){const An=qt.find(qr=>qr>Yt),zr=[];for(let qr=Yt;qr<(An??pt.length);qr++)zr.push(qr);Pt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Qt,qt,Pt)=>{let $t=[...Pt];const Yt=(An,zr)=>{An.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Ct(zr,qr.linkId))if(qr.repeats){const Ln=zr.filter(Dn=>Dn.linkId===qr.linkId);Ln.length>0?Ln.forEach((Dn,rn)=>{Xe(zr,qr.linkId,rn)||($t=xt(qt,$t,qr.linkId,qr.initial,void 0,rn))}):$t=xt(qt,$t,qr.linkId,qr.initial)}else $t=xt(qt,$t,qr.linkId,qr.initial);qr.item&&Yt(qr.item,zr)})};return Yt(pt,Qt),$t},Pn=(pt,Qt,qt)=>{if(!pt)return[];const Pt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Pt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return pt.forEach($t),Pt},Ur=(pt,Qt)=>pt.every(qt=>{var Pt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Pt=F(Qt,qt.linkId))==null?void 0:Pt.answer;return!ge(qt,Qt,Yt)}}),t0=(pt,Qt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Qt){qt=Pt;break}return qt},Dt=(pt,Qt)=>pt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Dt(qt.item,Qt)}):qt),$e=(pt,Qt,qt=pt)=>pt.reduce((Pt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Qt,qt=[])=>{const Pt=[],$t=Yt=>{Yt.forEach(An=>{Pt.push(An.linkId),An.item&&An.item.length>0&&$t(An.item)})};for(let Yt=0;Yt<pt.length;Yt++){const An=pt[Yt];if(An.linkId===Qt){const zr=pt.slice(0,Yt+1),qr=pt.slice(Yt+1),{kept:Ln,removed:Dn}=qr.reduce((rn,vt)=>{const St=J(qt,vt.linkId);return!St||ze(St)||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Dn),{trimmedData:[...zr,...Ln],trimmedLinkIds:Pt,found:!0}}if(An.item&&An.item.length>0){const zr=ot(An.item,Qt,qt);if(zr.found){const qr=pt.slice(0,Yt),Ln=pt.slice(Yt+1),Dn=[...qr,b(f({},An),{item:zr.trimmedData})],{kept:rn,removed:vt}=Ln.reduce((St,Zt)=>{const cn=J(qt,Zt.linkId);return!cn||ze(cn)||Ee(cn)&&te(cn.enableWhen,cn.enableBehavior,Dn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Dn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Qt)=>pt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=pt=>{var Qt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(pt,Qt)=>{const{groupIndices:qt}=Nn(pt),Pt=pt.findIndex($t=>$t.linkId===Qt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Qt=qt=>{const Pt=pt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Pt?.valueString)return null;const $t=Pt.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"},Ve=({src:Gt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn,cr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Pn=`bwell-${Kt}`;if(customElements.get(Pn)!==void 0)return;class Ur extends f{constructor(){super(),Fe.add(this),Ot.set(this,(0,S.nanoid)()),Qe.set(this,void 0),Ye.set(this,document.createElement("feature-app-loader")),Lt.set(this,new I.EventEmitter),mn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),$n.set(this,void 0),this.attachShadow({mode:"open"});const Dt=new Me(ze).attachToShadowRoot(this.shadowRoot);Dt.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Ye,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,$n,{slots:Dt,attributes:new k().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Lt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,mn,(0,p.__classPrivateFieldGet)(this,Fe,"m",Mr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Fe,"m",vn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Fe,"m",cr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Fe,"m",cr).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,$n,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Qe,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Qe,"f").registerDispatcher(Dt=>this.dispatchEvent(Dt)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,mn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,mn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Gt).catch(()=>{(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlot("error")}))})}disconnectedCallback(){var Dt;(0,p.__classPrivateFieldGet)(this,Lt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,$n,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(Dt=(0,p.__classPrivateFieldGet)(this,Qe,"f"))===null||Dt===void 0||Dt.deregister(),(0,p.__classPrivateFieldGet)(this,Lt,"f").removeAllListeners()}}Ot=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Lt=new WeakMap,mn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,$n=new WeakMap,Fe=new WeakSet,Mr=function(){(0,p.__classPrivateFieldGet)(this,Ye,"f").setAttribute("featureAppId",`bwell-embeddable:${Pn}`),(0,p.__classPrivateFieldGet)(this,Ye,"f").setAttribute("src",Gt),(0,p.__classPrivateFieldGet)(this,Ye,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Pn,utils:(0,p.__classPrivateFieldGet)(this,$n,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Ye,"f"))},vn=function({visibility:Dt,name:$e}){(0,p.__classPrivateFieldGet)(this,Ye,"f").style.display=Dt==="hidden"?"unset":"hidden"},Nn=function(Dt){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},cr=function(Dt){return $e=>{const ot=Ie.findIndex(tt=>tt===Dt);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,Fe,"m",Nn).call(this,Dt),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlotLocked(xe[Dt]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,Fe,"m",Nn).call(this,Dt);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,$n,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,$n,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Pn,Ur)}),it={rE:"1.1100.5"},bt="composite";var xt=e(67321);Ve({src:`https://embeddables.prod.icanbwell.com/${bt}/${it.rE}/scripts/embeddable.federated.js`,elementNameSuffix:bt,version:it.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),k=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===k&&U.resourceType==="Questionnaire"),q=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:q,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,k]=(0,t.useState)(""),[I,q]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),he=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[Me,Se]=(0,t.useState)(he),[ge,ne]=(0,t.useState)(he),[ae,{loading:me,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(he)},onCompleted:Kt=>{var Ct,Xe;const Fe=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Qe;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Qe=Ot.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(Fe?.length?Fe:he)}}),De=(0,t.useMemo)(()=>Me.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,Me]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn;if(F(Kt),G(Kt),ie(!1),Kt&&typeof Kt=="string"){const cr=Me.find(tt=>tt.id===Kt),Pn=cr?.label||V;if(!cr)return;k(Pn),q(Pn),setTimeout(()=>{const tt=[{id:cr.id,label:cr.label}];Se(tt),ne(tt)},f);const Ur=yield ae({variables:{placeId:Kt}}),t0=(Xe=(Ct=Ur?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Dt=(Ot=(Fe=Ur?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Ye=(Qe=Ur?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",ot=((mn=(Lt=Ur?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",Je=((et=(Sn=Ur?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(t0&&Dt)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(t0),longitude:String(Dt)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Mr=($n=tt?.data)==null?void 0:$n.geocodingByLatLon)==null?void 0:Mr.state)||"",Et=((Nn=(vn=tt?.data)==null?void 0:vn.geocodingByLatLon)==null?void 0:Nn.stateCode)||"";T({latitude:t0,longitude:Dt,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Pn,value:Kt})}else T({latitude:t0,longitude:Dt,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Pn,value:Kt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),Ve=Kt=>h(void 0,null,function*(){if(ie(!1),k(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(he),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(he)}),it=Kt=>{te.current=Kt},bt=()=>{k(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,Fe,Ot,Qe,Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),k(w),q(w),w===V&&k(w);const cr=yield ae({variables:{placeId:N}}),Pn=(Xe=(Ct=cr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Ur=(Ot=(Fe=cr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ot.longitude,t0=((Ye=(Qe=cr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",Dt=((mn=(Lt=cr?.data)==null?void 0:Lt.geocodingByPlaceId)==null?void 0:mn.state)||"",$e=((et=(Sn=cr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Pn&&Ur)if(!t0||!Dt||!$e){const ot=yield ce({variables:{latitude:String(Pn),longitude:String(Ur)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Mr=($n=ot?.data)==null?void 0:$n.geocodingByLatLon)==null?void 0:Mr.state)||"",rt=((Nn=(vn=ot?.data)==null?void 0:vn.geocodingByLatLon)==null?void 0:Nn.stateCode)||"";T({latitude:Pn,longitude:Ur,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Pn,longitude:Ur,zipCode:t0,state:Dt,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),k(""),q(""),Se(he),ne(he)}))()},[]);const xt=se||!!pe||!!re||!!Ee||!!R,Gt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:Ve,defaultFilter:Ie,onOpenChange:it,onBlur:bt,isInvalid:xt,hint:Gt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,Fe=Ct.mainText||"",Ot=Ct.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ot.trim().length>0,Lt=Qe?(0,r.RZ)(Fe,V):{beforePart:"",highlightedPart:"",remainingPart:""},mn=Ye?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Qe?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Lt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Lt.highlightedPart}),(0,n.jsx)("span",{children:Lt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:mn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:mn.highlightedPart}),(0,n.jsx)("span",{children:mn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=k=>{try{V(L.next(k))}catch(I){D(I)}},w=k=>{try{V(L.throw(k))}catch(I){D(I)}},V=k=>k.done?P(k.value):Promise.resolve(k.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),k=(0,t.useRef)(N);(0,t.useEffect)(()=>{k.current=N},[N]);const[I,q]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},k.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),he=(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]),Me=(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 he()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[he,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield Me(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield Me(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{q(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}q(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield Me(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{q(!1)}}),[ne,P,L,te,Me,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield he())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[he,P,Se]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{q(!1)}}),[he,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield Me(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{q(!1)}}),[he,P,te,Me,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){q(!0);try{if(!(yield he())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Me(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},k.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{q(!1)}}),[he,P,w,te,Me]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{q(!0);const ve=yield ae();ve&&w(M(b({},k.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{q(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,pe,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>Ur,GI:()=>F,rz:()=>Xe,Fp:()=>Ct,el:()=>Kt,ao:()=>Gt,oA:()=>T,Yt:()=>t0,g4:()=>xt,tn:()=>Je,n4:()=>S,gD:()=>z,Vp:()=>cr,Cx:()=>P,bK:()=>R,gi:()=>Pn,Z$:()=>he,GT:()=>Nn,hr:()=>Me,JL:()=>Se,Ck:()=>L,dU:()=>C,wG:()=>Sn,hZ:()=>Lt,$e:()=>Fe,qT:()=>Ye,GQ:()=>Qe,q3:()=>mn,D_:()=>Ot,Uf:()=>N,_l:()=>G,Md:()=>k,V7:()=>V,fe:()=>ie,JP:()=>zt,Z_:()=>E,zO:()=>te,UZ:()=>q,$7:()=>xe,rb:()=>w,_W:()=>it,WS:()=>Ve,VF:()=>Mr,vf:()=>Rt,PV:()=>vn,PS:()=>et,Iz:()=>$n,zD:()=>I,m3:()=>De,XP:()=>ze,PM:()=>pe,cX:()=>ge,G6:()=>ne,Us:()=>ue,AA:()=>me,G0:()=>Ee,mO:()=>J,HH:()=>ce,PU:()=>ot,Tl:()=>ve,uH:()=>Ie,c3:()=>ae,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const i=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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"}));b.displayName="ClipboardPlus";const M=({size:Ft=24,color:dn="currentColor",...zn})=>t.createElement("svg",{viewBox:"0 0 24 24",width:Ft,height:Ft,stroke:dn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...zn},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"}));M.displayName="Route";const x=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,z="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",T="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",S="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",C="http://hl7.org/fhir/StructureDefinition/minValue",R="http://hl7.org/fhir/StructureDefinition/maxValue",L="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",P="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",N="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",w="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",V="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",k="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",q="tz-code",U="footer",F="check-box",K="header",G="page",se="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",he=[{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"}],Me={"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"},Se={"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"},ge="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",ae="ui-toolkit/ServiceChoice",me="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",ce="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",re="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ve="ui-toolkit/SelectableOption",Ee="ui-toolkit/Modal",De="ui-toolkit/Alert",ze="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",Ve="http://icanbwell.com/fhir/StructureDefinition/text-align",it={LEFT:"left",CENTER:"center"},bt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},xt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Gt="http://icanbwell.com/fhir/StructureDefinition/error-title",Kt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ct="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Xe="http://icanbwell.com/fhir/StructureDefinition/description",Fe="http://icanbwell.com/fhir/StructureDefinition/modal-description",Ot="http://icanbwell.com/fhir/StructureDefinition/modal-title",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Lt="http://icanbwell.com/fhir/StructureDefinition/button-text",mn="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Sn="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",et="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",kt="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",$n="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Mr="http://icanbwell.com/fhir/StructureDefinition/trigger-color",vn="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Nn="http://hl7.org/fhir/StructureDefinition/mimeType",cr="http://hl7.org/fhir/StructureDefinition/maxSize",Pn="http://icanbwell.com/fhir/StructureDefinition/message-severity",Ur="http://icanbwell.com/fhir/StructureDefinition/alert-color",t0="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dt="http://icanbwell.com/fhir/StructureDefinition/placeholder",$e="http://icanbwell.com/fhir/StructureDefinition/hint-text",ot="ui-toolkit/PrefilledMemberDemographicsAlert",Je="http://hl7.org/fhir/issue-severity",tt="http://icanbwell.com/fhir/StructureDefinition/button-type",rt="http://icanbwell.com/fhir/StructureDefinition/button-action",lt="button-type",Et="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",st="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",le="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Te={},zt={"user-check":r,"user-check-02":s,"user-plus":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-plus":b,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>Ve,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>Dt,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>k,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>it,yQ:()=>Te,zj:()=>pe});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(69364),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(pt,Qt,qt)=>Qt in pt?A(pt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):pt[Qt]=qt,f=(pt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(pt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(pt,qt,Qt[qt]);return pt},b=(pt,Qt)=>m(pt,d(Qt));const M=pt=>{var Qt;return(Qt=pt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Pt,$t;return($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)!=null?$t:[]}).find(qt=>{var Pt;return(Pt=qt.code)==null?void 0:Pt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.V7);return qt?.valueCode||"off"},z=(pt,Qt,qt)=>{const Pt=(0,u.A)(qt);return pt&&Qt&&qt?Pt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Pt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=pt=>{const Qt=pt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=pt=>{const Qt=pt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(pt,Qt)=>{const qt=pt?.find(Pt=>Pt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&E[Qt]||C},L=pt=>{const Qt=pt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=pt=>{const Qt=pt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=pt=>pt.split(",").map(Pt=>Pt.trim()).map(Pt=>y.JL[Pt]||Pt).filter((Pt,$t,Yt)=>Yt.indexOf(Pt)===$t).join(", "),N=(pt,Qt,qt)=>{const Pt=D(pt),$t=Pt.lastIndexOf(","),Yt=$t!==-1?`${Pt.substring(0,$t)} or${Pt.substring($t+1)}`:Pt,An=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return An.length>0?`${Yt} (${An.join(", ")})`:Yt},w=pt=>{const Qt=pt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(pt,Qt)=>{var qt,Pt,$t;const Yt=Qt?.find(An=>An.url.includes(pt));return($t=(Pt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Pt:Yt?.valueString)!=null?$t:Yt?.valueDate},k=pt=>{if(!!pt){if(/^\d{4}-\d{2}-\d{2}$/.test(pt))return pt;try{const Qt=(0,o.evaluate)({},pt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Pt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Pt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(pt,Qt)=>{var qt,Pt;const $t=Qt?.find(An=>An.url===pt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||k((Pt=$t.valueExpression)==null?void 0:Pt.expression)},q=(pt,Qt)=>{if(!(!pt||pt.length===0))for(const qt of pt){const Pt=V(Qt,qt.extension);if(Pt!==void 0)return Pt;if(qt.item&&qt.item.length>0){const $t=q(qt.item,Qt);if($t!==void 0)return $t}}},U=(pt,Qt)=>{try{const qt=String(pt??Qt);let Pt;if(qt.includes("/"))Pt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Pt=(0,t.A)($t)}return(0,r.A)(Pt)}catch(qt){return console.error("Date parsing error:",qt,pt),null}},F=(pt,Qt)=>{var qt;for(const Pt of pt){if(Pt.linkId===Qt)return Pt;if((qt=Pt.item)!=null&&qt.length){const $t=F(Pt.item,Qt);if($t!==void 0)return $t}}},K=(pt,Qt)=>{var qt;const Pt=[];for(const $t of pt)if($t.linkId===Qt&&Pt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Pt.push(...Yt)}return Pt},G=(pt,Qt,qt=0)=>K(pt,Qt)[qt];function se(pt){return pt!=null}const ie=(pt,Qt)=>{var qt,Pt,$t;if("answerString"in pt&&se(pt.answerString)){if(pt.operator==="=")return Qt?.valueString===pt.answerString;if(pt.operator==="!=")return Qt?.valueString!==pt.answerString}if("answerBoolean"in pt&&se(pt.answerBoolean)){if(pt.operator==="=")return Qt?.valueBoolean===pt.answerBoolean;if(pt.operator==="!=")return Qt?.valueBoolean!==pt.answerBoolean}if("answerInteger"in pt&&se(pt.answerInteger)||"answerDecimal"in pt&&se(pt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),An=Number(pt.answerInteger||pt.answerDecimal);if(pt.operator==="=")return Yt===An;if(pt.operator==="!=")return Yt!==An;if(pt.operator===">")return Yt>An;if(pt.operator==="<")return Yt<An;if(pt.operator===">=")return Yt>=An;if(pt.operator==="<=")return Yt<=An}if("answerQuantity"in pt&&se(pt.answerQuantity)){const Yt=Qt?.valueQuantity,An=pt.answerQuantity;if(Yt?.unit!==An?.unit)return!1;if(pt.operator==="=")return Yt.value===An.value;if(pt.operator==="!=")return Yt.value!==An.value;if(pt.operator===">")return Yt.value>An.value;if(pt.operator==="<")return Yt.value<An.value;if(pt.operator===">=")return Yt.value>=An.value;if(pt.operator==="<=")return Yt.value<=An.value}if("answerCoding"in pt&&se(pt.answerCoding)){const Yt=Qt?.valueCoding,An=pt.answerCoding;if(pt.operator==="=")return Yt?.code===An.code;if(pt.operator==="!=")return Yt?.code!==An.code}if("answerReference"in pt&&se(pt.answerReference)){const Yt=Qt?.valueReference,An=pt.answerReference;if(pt.operator==="=")return Yt?.reference===An.reference;if(pt.operator==="!=")return Yt?.reference!==An.reference}if("answerDate"in pt&&se(pt.answerDate)||"answerDateTime"in pt&&se(pt.answerDateTime)||"answerTime"in pt&&se(pt.answerTime)){const Yt=new Date(($t=(Pt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Pt:Qt?.valueTime)!=null?$t:""),An=new Date(pt.answerDate||pt.answerDateTime||pt.answerTime||"");if(pt.operator==="=")return Yt.getTime()===An.getTime();if(pt.operator==="!=")return Yt.getTime()!==An.getTime();if(pt.operator===">")return Yt.getTime()>An.getTime();if(pt.operator==="<")return Yt.getTime()<An.getTime();if(pt.operator===">=")return Yt.getTime()>=An.getTime();if(pt.operator==="<=")return Yt.getTime()<=An.getTime()}return pt.operator==="exists"?Qt!=null===pt.answerBoolean:!0},te=(pt,Qt,qt)=>{const Pt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(An=>!An.answer||An.answer.length===0)?ie($t,void 0):Yt.some(An=>{var zr;return(zr=An.answer)==null?void 0:zr.some(qr=>ie($t,qr&&Object.keys(qr).length>0?qr:void 0))})};return pt&&pt?.length>0?Qt==="any"?pt?.some($t=>Pt($t)):pt?.every($t=>Pt($t)):!0},he=(pt,Qt,qt,Pt,$t)=>{if(!pt||pt.length===0)return!0;const Yt=An=>{var zr;let qr;if(Pt&&typeof $t=="number"){const Dn=qt.filter(rn=>rn.linkId===Pt)[$t];if(Dn?.item){const rn=Dn.item.find(vt=>vt.linkId===An.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))}}if(!qr){const Ln=K(qt,An.question);if(Ln.length>0)return Ln.some(Dn=>{var rn;return(rn=Dn.answer)==null?void 0:rn.some(vt=>ie(An,vt&&Object.keys(vt).length>0?vt:void 0))});qr=void 0}return ie(An,qr)};return Qt==="any"?pt.some(An=>Yt(An)):pt.every(An=>Yt(An))},Me=(pt,Qt)=>{var qt;if(!!((qt=pt?.valueExpression)!=null&&qt.expression))try{const Pt=evaluate(Qt,pt.valueExpression.expression);return Array.isArray(Pt)?Pt.some($t=>Boolean($t)):Boolean(Pt)}catch{return}},Se=(pt,Qt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=Me(Pt,Qt);return b(f({},pt),{readOnly:$t??pt.readOnly})},ge=(pt,Qt,qt)=>{const{required:Pt,maxLength:$t,type:Yt,extension:An,enableWhen:zr,enableBehavior:qr,repeats:Ln,answerOption:Dn}=pt;if(!te(zr,qr,Qt)||pt.type==="group"||pt.type==="display")return"";if(Ln)return ne(pt,Qt,qt);const rn=ce(pt,Qt);return rn&&ue(rn,pt)?re(pt,Qt,qt,rn):pe(An,Yt,Pt,$t,qt,Dn)},ne=(pt,Qt,qt)=>{const{required:Pt}=pt;if(Pt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const An=qt[Yt];if(An&&Object.keys(An).length>0&&Object.values(An).some(qr=>qr!=null&&qr!==""&&(Array.isArray(qr)?qr.length>0:!0))){$t=!0;const qr=pe(pt.extension,pt.type,!0,pt.maxLength,[An],pt.answerOption);if(qr)return`Item ${Yt+1}: ${qr}`;if(pt.item&&pt.item.length>0){const Ln=ae(pt.item,Qt,pt.linkId,Yt);if(Ln)return`Item ${Yt+1}: ${Ln}`}}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(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=pe(pt.extension,pt.type,!1,pt.maxLength,[Yt],pt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(pt.item&&pt.item.length>0){const qr=ae(pt.item,Qt,pt.linkId,$t);if(qr)return`Item ${$t+1}: ${qr}`}}}return""},ae=(pt,Qt,qt,Pt)=>{var $t,Yt;for(const An of pt){if(!he(An.enableWhen,An.enableBehavior,Qt,qt,Pt))continue;const zr=F(Qt,qt),qr=($t=zr?.item)==null?void 0:$t.find(Dn=>Dn.linkId===An.linkId),Ln=(Yt=qr?.answer)!=null&&Yt[Pt]?[qr.answer[Pt]]:void 0;if(An.required){if(!Ln||!Ln[0]||!me(Ln[0]))return`${An.text||An.linkId} is required`;const Dn=pe(An.extension,An.type,!0,An.maxLength,Ln,An.answerOption);if(Dn)return`${An.text||An.linkId}: ${Dn}`}else if(Ln&&Ln[0]&&me(Ln[0])){const Dn=pe(An.extension,An.type,!1,An.maxLength,Ln,An.answerOption);if(Dn)return`${An.text||An.linkId}: ${Dn}`}if(An.item&&An.item.length>0){const Dn=ae(An.item,Qt,An.linkId,Pt);if(Dn)return Dn}}return""},me=pt=>!pt||Object.keys(pt).length===0?!1:Object.values(pt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),pe=(pt,Qt,qt,Pt,$t,Yt)=>{var An,zr,qr,Ln,Dn;let rn="";const vt=!!pt?.find(Cn=>{var jn,wr;return Cn.url===y.gD&&((wr=(jn=Cn.valueCodeableConcept)==null?void 0:jn.coding)==null?void 0:wr.some(Wr=>Wr.system===y.n4&&Wr.code===y.GI))}),St=$t?.[0],Zt={choice:((An=St?.valueCoding)==null?void 0:An.code)||(St?.valueString&&Yt?.some(Cn=>Cn.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.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:(qr=St?.valueQuantity)==null?void 0:qr.value,reference:(Ln=St?.valueReference)==null?void 0:Ln.display,attachment:(Dn=St?.valueAttachment)==null?void 0:Dn.title};if(!(Qt in Zt))return"";const cn=Zt[Qt],on={required:()=>qt&&(cn==null||cn===""||cn==="NaN"||Number.isNaN(cn)||Qt==="boolean"&&cn!==!0&&vt)?"This field is required":"",maxLength:()=>Pt&&cn!==null&&cn!==void 0&&cn.toString().length>Pt?`Input should not exceed ${Pt} characters`:"",minLength:()=>{const Cn=V("minLength",pt);return Cn&&cn!==null&&cn!==void 0&&cn.toString().length<Number(Cn)?`Input should be at least ${Cn} characters`:""},urlRegex:()=>{const Cn=new RegExp(y.rx),jn=V("regexError",pt),wr=jn??"Please enter a valid url starting from http:// and https://";return Cn&&Qt==="url"&&cn&&!Cn.test(cn)?String(wr):""},regex:()=>{const Cn=V("regex",pt);if(!Cn||typeof cn!="string")return"";const jn=new RegExp(Cn),wr=V("regexError",pt),Wr=wr??"Please enter a valid input";return jn&&cn&&!jn.test(cn)?String(Wr):""},dateTime:()=>{if(Qt==="dateTime"&&cn){const Cn=cn?.toString(),jn=new Date(Cn);return isNaN(jn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!cn)return"";const Cn=cn.replace(/\D/g,"");return Cn.length>0&&Cn.length<8||isNaN(new Date(cn).getTime())?"Invalid date":""},minValue:()=>{var Cn;if(Qt==="date"){const wr=I(y.dU,pt),Wr=U(wr??"01/01/1900","01/01/1900"),_r=U(cn,"");if(!Wr||!_r)return"";if((0,s.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Ck))==null?void 0:Cn.valueString;return f0??`Date should not be before ${wr??"01/01/1900"}`}return""}const jn=V("minValue",pt);return jn!=null&&cn!==null&&cn!==void 0&&cn<jn?`Input should not be less than ${jn}`:""},maxValue:()=>{var Cn;if(Qt==="date"){const wr=I(y.bK,pt),Wr=U(wr??"01/01/2100","01/01/2100"),_r=U(cn,"");if(!Wr||!_r)return"";if((0,i.A)(_r,Wr)){const f0=(Cn=pt?.find(Di=>Di.url===y.Cx))==null?void 0:Cn.valueString;return f0??`Date should not be after ${wr??"01/01/2100"}`}return""}const jn=V("maxValue",pt);return jn!=null&&cn!==null&&cn!==void 0&&cn>jn?`Input should not exceed ${jn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(pt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===pt.linkId))return qt;const $t=ce(pt,qt.item);if($t)return $t}return null},ue=(pt,Qt)=>{if(pt.answer&&pt.answer.length>1)return!0;if(pt.item){const qt=pt.item.find(Pt=>Pt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(pt,Qt,qt,Pt)=>{var $t,Yt;const{required:An}=pt,zr=($t=Pt.item)==null?void 0:$t.find(Dn=>Dn.linkId===pt.linkId),qr=zr?.answer||[],Ln=((Yt=Pt.answer)==null?void 0:Yt.length)||1;for(let Dn=0;Dn<Ln;Dn++){const rn=qr[Dn];if(An){if(!rn||!me(rn))return`Item ${Dn+1}: ${pt.text||pt.linkId} is required`;const vt=pe(pt.extension,pt.type,!0,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Dn+1}: ${vt}`}else if(rn&&me(rn)){const vt=pe(pt.extension,pt.type,!1,pt.maxLength,[rn],pt.answerOption);if(vt)return`Item ${Dn+1}: ${vt}`}}return""},J=(pt,Qt)=>{for(const qt of pt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Pt=J(qt.item,Qt);if(Pt)return Pt}}},ve=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===y.gD&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>{var Pt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Pt=qt.valueCodeableConcept)==null?void 0:Pt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},Ve=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.fe);return qt?.valueInteger},it=pt=>{var Qt;const qt=(Qt=pt.extension)==null?void 0:Qt.find(Pt=>Pt.url===y.zO);return qt?.valueInteger},bt=pt=>{var Qt;const qt=(Qt=pt?.extension)==null?void 0:Qt.find(Pt=>Pt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(pt,Qt,qt,Pt,$t,Yt)=>{const An=qr=>Qt.filter(Ln=>Ln.linkId===qr),zr=new Set;return pt.map(qr=>{if(zr.has(qr.linkId)||ve(qr))return null;const Dn=An(qr.linkId),rn=qr.type==="group"&&qr.repeats;if(zr.add(qr.linkId),rn){const vt=[];if(Dn.forEach((St,Zt)=>{const cn={linkId:qr.linkId,text:qr.text};let on;if(qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const Cn=St?.item||[];on=[...Cn],$t.forEach(jn=>{const wr=on.findIndex(Wr=>Wr.linkId===jn.linkId);wr>=0?on[wr]=b(f({},Cn[wr]),{answer:jn.answer}):on.push(jn)})}else qr.item&&(on=xt(qr.item,St?.item||[],qt,Pt,$t,Zt));qt===qr.linkId&&typeof Yt=="number"&&Yt===Zt&&Pt?cn.answer=Pt:cn.answer=St.answer||[{}],on&&on.length>0?cn.item=on:St.item&&(cn.item=St.item),vt.push(cn)}),qt===qr.linkId&&typeof Yt=="number"&&Yt>=Dn.length)for(let St=Dn.length;St<=Yt;St++){const Zt={linkId:qr.linkId,text:qr.text,answer:St===Yt&&Pt?Pt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:qr.item&&(Zt.item=xt(qr.item,[],void 0,void 0,void 0,void 0)),vt.push(Zt)}return vt}else if(qr.repeats&&typeof Yt=="number"&&qt===qr.linkId){const vt=Dn[0]||{linkId:qr.linkId,text:qr.text,answer:[]},St={linkId:qr.linkId,text:qr.text,answer:[...vt.answer||[]]};if(Pt&&Pt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Pt[0]}return St}else{const vt=Dn[0],St=qr.item?xt(qr.item,vt?.item||[],qt,Pt,$t,Yt):void 0,Zt=St&&St.length>0,cn={linkId:qr.linkId,text:qr.text};return qt&&qr.linkId===qt&&typeof Yt!="number"?(Pt||!Pt&&!$t?cn.answer=Pt:vt?.answer&&(cn.answer=vt.answer),$t?cn.item=$t:Zt&&(cn.item=St)):(vt?.answer?cn.answer=vt.answer:cn.answer=[{}],Zt&&(cn.item=St)),cn}}).filter(Boolean).flat()},Gt=(pt,Qt)=>{for(const qt of pt)if(qt.linkId===Qt||qt.item&&Gt(qt.item,Qt))return qt.linkId;return null},Kt=(pt,Qt,qt,Pt)=>{var $t;const Yt=($t=pt?.item)!=null?$t:Pt;return!Yt||Yt.length===0?!0:Yt.every(An=>{var zr;const qr=K(Qt,An.linkId);if(qr.length===0){const Ln=(zr=F(Qt,An.linkId))==null?void 0:zr.answer;if(ge(An,Qt,Ln)&&te(An.enableWhen,An.enableBehavior,Qt)&&qt.includes(An.linkId))return!1}else for(const Ln of qr)if(ge(An,Qt,Ln.answer)&&te(An.enableWhen,An.enableBehavior,Qt)&&qt.includes(An.linkId))return!1;return An.item?Kt(An,Qt,qt):!0})},Ct=(pt,Qt,qt=!0)=>{for(const Pt of pt)if(Pt.linkId===Qt&&Pt.answer&&Pt.answer.length>0||Pt.item&&Pt.item.length>0&&Ct(Pt.item,Qt,qt))return!0;return!1},Xe=(pt,Qt,qt=0)=>{const Pt=pt.filter($t=>$t.linkId===Qt);if(Pt.length>qt){const $t=Pt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(An=>An!=null&&An!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(pt,Qt,!1)},Fe=(pt,Qt)=>{if(!pt||!pt.item)return!1;const qt=Pt=>{var $t;if(Ee(Pt)&&Pt.required&&te(Pt.enableWhen,Pt.enableBehavior,Qt)){const Yt=F(Qt,Pt.linkId),An=pe(Pt.extension,Pt.type,Pt.required,Pt.maxLength,Yt?.answer,Pt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||An)return!0}if(Pt.item){for(const Yt of Pt.item)if(qt(Yt))return!0}return!1};for(const Pt of pt.item)if(qt(Pt))return!0;return!1},Ot=pt=>{var Qt,qt,Pt;if(pt.valueString!==void 0)return pt.valueString;if(pt.valueBoolean!==void 0)return pt.valueBoolean;if(pt.valueInteger!==void 0)return pt.valueInteger;if(pt.valueDecimal!==void 0)return pt.valueDecimal;if(pt.valueDate!==void 0)return pt.valueDate;if(pt.valueDateTime!==void 0)return pt.valueDateTime;if(((Qt=pt.valueCoding)==null?void 0:Qt.code)!==void 0)return pt.valueCoding.code;if(((qt=pt.valueReference)==null?void 0:qt.reference)!==void 0)return pt.valueReference.reference;if(((Pt=pt.valueQuantity)==null?void 0:Pt.value)!==void 0)return pt.valueQuantity.value;if(pt.valueAttachment!==void 0)return pt.valueAttachment},Qe=pt=>{const Qt={linkId:pt.linkId};if(pt.answer&&pt.answer.length>0){const qt=pt.answer.map(Pt=>Ot(Pt)).filter(Pt=>Pt!==void 0);qt.length>0&&(Qt.answer=qt)}if(pt.item&&pt.item.length>0){const qt=pt.item.map(Pt=>Qe(Pt)).filter(Pt=>{const $t=Object.keys(Pt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Ye=(pt,Qt,qt,Pt,$t,Yt)=>{var An;const zr=(An=Qt?.item)==null?void 0:An[qt[Pt]],qr=zr?.linkId;if(!qr)return!1;const Ln=K(pt,qr),Dn=K($t,qr),rn=vt=>{if(vt!=null){if(Array.isArray(vt)){const St=vt.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 vt=="object"){const St={};for(const[Zt,cn]of Object.entries(vt))if(cn!=null){const on=rn(cn);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return vt}};if(Ln.length!==Dn.length)return!1;for(let vt=0;vt<Ln.length;vt++){const St=Ln[vt],Zt=Dn[vt];if(!St||!Zt)return!1;const cn=Qe(rn(St)),on=Qe(rn(Zt));if(!_.isEqual(cn,on))return!1}return Pt!==Yt},Lt=(pt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(pt,Qt,qt)||null,mn=(pt,Qt)=>{const qt={},Pt=$t=>{$t.forEach(Yt=>{const An=K(Qt,Yt.linkId);if(st(Yt,pt)||Yt.repeats)for(let zr=0;zr<An.length;zr++){const qr=An[zr];if(qr?.answer&&qr.answer.length>0){const Ln=Lt(Yt,Qt,qr.answer);Ln&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Ln}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const qr=Lt(Yt,Qt,zr.answer);qr&&(qt[Yt.linkId]={0:qr})}}Yt.item&&Yt.item.length>0&&Pt(Yt.item)})};return Pt(pt),qt},Sn=pt=>{if(!pt)return"";const Qt=pt.split("-");if(Qt.length===3){const[qt,Pt,$t]=Qt;return`${qt.slice(-4)}-${Pt}-${$t}`}return""},et=pt=>pt.trim().replace(/[A-Za-z]+/g,""),Rt=(pt,Qt)=>{const qt=(Pt,$t)=>{for(const Yt of Pt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const An=qt(Yt.item,$t);if(An!==void 0)return An}}};return qt(pt,Qt)},kt=(pt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=pt.linkId,Pt=($t,Yt,An=[])=>{for(const zr of $t){const qr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>rn.repeats===!0)?zr:null;if(Pt(zr.item,Yt,qr))return zr}}return null};return Pt(Qt,qt)},$n=(pt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=pt.linkId,Pt=($t,Yt,An=[])=>{for(const zr of $t){const qr=[...An,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return qr.some(rn=>{const vt=M(rn.extension||[]);return!!vt&&vt!==UI_TOOLKIT_FORM_CONTAINER});if(Pt(zr.item,Yt,qr))return!0}}return!1};return Pt(Qt,qt)},Mr=(pt,Qt,qt)=>{const Pt={};if(!pt)return Pt;const{linkId:$t}=Qt;if(pt[$t]){const Yt=pt[$t];Pt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(pt[Yt.linkId]){const An=pt[Yt.linkId];Pt[Yt.linkId]=An[qt]||""}}),Pt},vn=(pt,Qt)=>{const qt={};if(!pt||!pt[Qt])return qt;const Pt=pt[Qt];return qt[Qt]=Pt[0]||"",qt},Nn=pt=>{const Qt=pt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Pt=new Map;let $t=null;if(pt.forEach((Yt,An)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")An!==Qt&&qt.push(An),Pt.set(An,[An]),$t=An;else if($t!==null&&!zr){const qr=Pt.get($t)||[];Pt.set($t,[...qr,An])}}),pt.length>0&&qt.length>0){const Yt=qt[0];if(!Pt.has(Yt)){const An=qt.find(qr=>qr>Yt),zr=[];for(let qr=Yt;qr<(An??pt.length);qr++)zr.push(qr);Pt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Pt}},cr=(pt,Qt,qt,Pt)=>{let $t=[...Pt];const Yt=(An,zr)=>{An.forEach(qr=>{if((!qr?.enableWhen||te(qr?.enableWhen,qr.enableBehavior,zr))&&qr.initial&&!Ct(zr,qr.linkId))if(qr.repeats){const Ln=zr.filter(Dn=>Dn.linkId===qr.linkId);Ln.length>0?Ln.forEach((Dn,rn)=>{Xe(zr,qr.linkId,rn)||($t=xt(qt,$t,qr.linkId,qr.initial,void 0,rn))}):$t=xt(qt,$t,qr.linkId,qr.initial)}else $t=xt(qt,$t,qr.linkId,qr.initial);qr.item&&Yt(qr.item,zr)})};return Yt(pt,Qt),$t},Pn=(pt,Qt,qt)=>{if(!pt)return[];const Pt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Pt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return pt.forEach($t),Pt},Ur=(pt,Qt)=>pt.every(qt=>{var Pt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Pt=F(Qt,qt.linkId))==null?void 0:Pt.answer;return!ge(qt,Qt,Yt)}}),t0=(pt,Qt)=>{let qt=-1;for(let Pt=pt.length-1;Pt>=0;Pt--)if(pt[Pt].linkId===Qt){qt=Pt;break}return qt},Dt=(pt,Qt)=>pt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Dt(qt.item,Qt)}):qt),$e=(pt,Qt,qt=pt)=>pt.reduce((Pt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Pt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Pt.push($t)),Pt},[]),ot=(pt,Qt,qt=[])=>{const Pt=[],$t=Yt=>{Yt.forEach(An=>{Pt.push(An.linkId),An.item&&An.item.length>0&&$t(An.item)})};for(let Yt=0;Yt<pt.length;Yt++){const An=pt[Yt];if(An.linkId===Qt){const zr=pt.slice(0,Yt+1),qr=pt.slice(Yt+1),{kept:Ln,removed:Dn}=qr.reduce((rn,vt)=>{const St=J(qt,vt.linkId);return!St||ze(St)||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(vt):rn.removed.push(vt),rn},{kept:[],removed:[]});return $t(Dn),{trimmedData:[...zr,...Ln],trimmedLinkIds:Pt,found:!0}}if(An.item&&An.item.length>0){const zr=ot(An.item,Qt,qt);if(zr.found){const qr=pt.slice(0,Yt),Ln=pt.slice(Yt+1),Dn=[...qr,b(f({},An),{item:zr.trimmedData})],{kept:rn,removed:vt}=Ln.reduce((St,Zt)=>{const cn=J(qt,Zt.linkId);return!cn||ze(cn)||Ee(cn)&&te(cn.enableWhen,cn.enableBehavior,Dn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(vt),{trimmedData:[...Dn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Pt],found:!0}}}}return{trimmedData:pt,trimmedLinkIds:[],found:!1}},Je=(pt,Qt)=>pt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=pt=>{var Qt;if(!pt)return"empty";const qt=y.Z$.find(({patterns:Pt})=>Pt.some($t=>pt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(pt,Qt)=>{const{groupIndices:qt}=Nn(pt),Pt=pt.findIndex($t=>$t.linkId===Qt);return Pt!==-1?qt.indexOf(Pt):-1},lt=pt=>{if(!pt)return{restriction:null,warning:null};const Qt=qt=>{const Pt=pt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Pt?.valueString)return null;const $t=Pt.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=(pt,Qt)=>{var qt;switch(Qt.type){case"boolean-to-string":return typeof pt=="boolean"?pt?Qt.trueValue:Qt.falseValue:pt;case"map":return Qt.mapping&&pt in Qt.mapping?Qt.mapping[pt]:pt;case"date-format":return pt;case"number-format":if(typeof pt=="number"){let Pt=pt.toFixed((qt=Qt.decimals)!=null?qt:0);return Qt.prefix&&(Pt=Qt.prefix+Pt),Qt.suffix&&(Pt=Pt+Qt.suffix),Pt}return pt;case"passthrough":default:return pt}},st=(pt,Qt)=>{const qt=pt.linkId,Pt=(Yt,An,zr=[])=>{for(const qr of Yt){const Ln=[...zr,qr];if(qr.item){if(qr.item.some(vt=>vt.linkId===An))return Ln.filter(vt=>vt.repeats===!0);const rn=Pt(qr.item,An,Ln);if(rn.length>0)return rn}}return[]},$t=Pt(Qt,qt);return $t.length>0?$t[$t.length-1]:null},le=(pt,Qt)=>{if(!pt?.item)return[];const qt=[];for(const Pt of pt.item){if(Pt.type!=="group")continue;te(Pt.enableWhen,Pt.enableBehavior,Qt||[])&&Pt.linkId&&qt.push(Pt.linkId)}return qt},ye=(pt,Qt)=>{const qt=le(pt,Qt||void 0);return qt[qt.length-1]},Ue=({questionnaire:pt,extensionUrl:Qt,errorCode:qt})=>{if(!qt||!pt?.item)return;const Pt=pt.item.find($t=>{var Yt;return(Yt=$t.extension)==null?void 0:Yt.some(An=>An.url===Qt&&An.valueString===qt)});return Pt?.linkId},Te=(pt,Qt)=>{var qt;const Pt=(qt=pt.extension)==null?void 0:qt.find(Yt=>Yt.url===y.rb);if(!Pt?.valueString)return;const $t=Pt.valueString;return J(Qt,$t)},zt=pt=>{var Qt;return!!((Qt=pt.extension)!=null&&Qt.find(qt=>qt.url===y.rb))},Ft=(pt,Qt)=>pt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Ft(qt.item,Qt)}):qt),dn=pt=>{const Qt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,pt.extension);return Qt??q(pt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},zn=pt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,pt.extension),gr=pt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,pt.extension),Bt=pt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,pt.extension),we=pt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,pt),Ze=(pt,Qt)=>{var qt,Pt,$t;if(!pt.answerOption)return;const Yt=F(Qt,pt.linkId),An=($t=(Pt=(qt=Yt?.answer)==null?void 0:qt[0])==null?void 0:Pt.valueCoding)==null?void 0:$t.code;if(!An)return;const zr=pt.answerOption.find(qr=>{var Ln;return((Ln=qr.valueCoding)==null?void 0:Ln.code)===An});if(!!zr)return we(zr.extension)},At=(pt,Qt)=>{const qt={},Pt=$t=>{if(!!$t)for(const Yt of $t){const An=Bt(Yt);if(An){let zr;switch(Yt.type){case"choice":zr=Ze(Yt,Qt);break;default:break}zr&&(qt[An]=zr)}Yt.item&&Yt.item.length>0&&Pt(Yt.item)}};return Pt(pt.item),qt},en=pt=>!!(pt.initial&&pt.initial.length>0),nn=(pt,Qt,qt)=>{if(!pt)return[];const Pt=[],$t=Yt=>{Yt.forEach(An=>{if(qt&&qt.includes(An.linkId))return;const zr=Ee(An),qr=Qt.includes(An.linkId);(qr||zr&&An.required)&&Pt.push(An),qr&&An.item&&An.item.length>0&&$t(An.item)})};return $t(pt),Pt},pn=(pt,Qt,qt,Pt,$t,Yt)=>{var An;if(qt<0||!Pt?.item)return!0;const zr=$t.current[qt],qr=qt+1,Ln=$t.current[qr],Dn=qt===0?0:zr,rn=Ln??Pt.item.length,vt=[];for(let Cn=Dn;Cn<rn;Cn++){const jn=(An=Pt?.item)==null?void 0:An[Cn];if(jn){if(Yt&&Yt.includes(jn.linkId))continue;const wr=Ee(jn);(Qt.includes(jn.linkId)||wr&&jn.required)&&vt.push(jn),jn.item&&jn.item.length>0&&vt.push(...nn(jn.item,Qt,Yt))}}const St=vt.filter(Cn=>Cn.required===!0),Zt=vt.filter(Cn=>Cn.required!==!0),cn=Ur(St,pt),on=Zt?.every(Cn=>{var jn;const wr=(jn=F(pt,Cn.linkId))==null?void 0:jn.answer;return wr?!ge(Cn,pt,wr):!0});return!St?.length||cn&&on}},28058:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),i=e(69364),o=e(25624);const a=({item:er})=>{const Yr=er.text||"",Zr=er.extension||[],Li=_o=>{var xo;return(xo=Zr.find(So=>So.url===_o))==null?void 0:xo.valueString},ro=Li(i.$7),Mo=Li(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:Yr,description:ro??"",color:Mo})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(er,Yr,Zr)=>Yr in er?u(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,O=(er,Yr)=>{for(var Zr in Yr||(Yr={}))A.call(Yr,Zr)&&d(er,Zr,Yr[Zr]);if(y)for(var Zr of y(Yr))m.call(Yr,Zr)&&d(er,Zr,Yr[Zr]);return er};const v=({item:er})=>{const[Yr,Zr]=(0,t.useState)(!1),Li=er.extension||[],ro=In=>{var lr;return(lr=Li.find(gn=>gn.url===In))==null?void 0:lr.valueString},Mo=ro(i.PS)||er.text||"",_o=ro(i.Iz)||"button",xo=ro(i.VF),So=ro(i.PV),No=ro(i.vf),uo=No?i.JP[No]:void 0,pa=ro(i.D_)||"",Er=ro(i.$e),ar=ro(i.GQ),Tr=ro(i.qT)||"gray",Pe=ro(i.hZ),Ce=ro(i.wG),We=ro(i.q3),gt=ar?i.JP[ar]:void 0,Xt=()=>Zr(!0),tn=()=>{switch(_o){case"icon-button":return(0,n.jsxs)("button",{onClick:Xt,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":Mo||pa||void 0,children:[uo&&(0,n.jsx)(uo,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Mo&&(0,n.jsx)("span",{className:"text-sm",children:Mo})]});default:return(0,n.jsx)(r.Button,{color:xo??"secondary",size:So??"md",iconLeading:uo,onClick:Xt,"aria-label":Mo,children:Mo})}};return(0,n.jsxs)(n.Fragment,{children:[tn(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${er.linkId}`,isOpen:Yr,onOpenChange:Zr,title:{content:pa},description:{content:Er?(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(Er)}}):void 0},closeButton:{onCloseClick:()=>Zr(!1)}},gt?{featuredIcon:{icon:gt,color:Tr,size:"lg",className:"bg-white"}}:{}),Pe?{primaryButton:{children:Pe,onClick:()=>{var In,lr;Ce==="open-zendesk"&&((lr=(In=globalThis.zE)==null?void 0:In.activate)==null||lr.call(In,{hideOnClose:!0})),Zr(!1)}}}:{}),We?{secondaryButton:{children:We,onClick:()=>Zr(!1)}}:{}))]})};var p=e(18522);const h=({item:er})=>{var Yr,Zr,Li,ro,Mo,_o,xo,So,No,uo,pa,Er;const{hasExternalError:ar}=(0,p.c)(),Tr=er.text||"",Pe=(Zr=(Yr=er.extension)==null?void 0:Yr.find(a0=>a0.url===i.ao))==null?void 0:Zr.valueString,Ce=ar&&Pe?Pe:Tr,We=(ro=(Li=er.extension)==null?void 0:Li.find(a0=>a0.url===i.$7))==null?void 0:ro.valueString,gt=(_o=(Mo=er.extension)==null?void 0:Mo.find(a0=>a0.url===i.el))==null?void 0:_o.valueString,Xt=ar&&gt?gt:We,tn=(So=(xo=er.extension)==null?void 0:xo.find(a0=>a0.url===i.g4))==null?void 0:So.valueString,In=(uo=(No=er.extension)==null?void 0:No.find(a0=>a0.url===i.Fp))==null?void 0:uo.valueString,lr=tn?i.JP[tn]:void 0,gn=In?i.JP[In]:void 0,Kn=ar&&gn?gn:lr,sn=((Er=(pa=er.extension)==null?void 0:pa.find(a0=>a0.url===i.WS))==null?void 0:Er.valueString)===i._W.LEFT,Ar=sn?"items-start":"items-center",yr=sn?"text-left":"text-center",$r=sn?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${Ar} gap-4`,children:[Kn&&(0,n.jsx)(r.FeaturedIcon,{icon:Kn,color:ar&&gn?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${Ar} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${yr} ${$r} md:max-w-[352px]`,children:Ce}),(0,n.jsx)("p",{className:`text-md text-secondary ${yr}`,children:Xt})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(er,Yr,Zr)=>Yr in er?M(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,E=(er,Yr)=>{for(var Zr in Yr||(Yr={}))z.call(Yr,Zr)&&S(er,Zr,Yr[Zr]);if(x)for(var Zr of x(Yr))T.call(Yr,Zr)&&S(er,Zr,Yr[Zr]);return er};const C=({item:er})=>{const[Yr,Zr]=(0,t.useState)(!1),Li=(0,b.T$)(),ro=er.extension||[],Mo=Pe=>{var Ce;return(Ce=ro.find(We=>We.url===Pe))==null?void 0:Ce.valueString},_o=er.text||"",xo=Mo(i.PS)||"",So=Mo(i.D_)||"",No=Mo(i.$e),uo=Mo(i.GQ),pa=Mo(i.qT)||"gray",Er=Mo(i.hZ),ar=Mo(i.q3),Tr=uo?i.JP[uo]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(f.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:_o})]}),xo&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Zr(!0),children:xo})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${er.linkId}`,isOpen:Yr,onOpenChange:Zr,title:{content:So},description:{content:No?(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(No)}}):void 0},closeButton:{onCloseClick:()=>Zr(!1)}},Tr?{featuredIcon:{icon:Tr,color:pa,size:"lg",className:"bg-white"}}:{}),Er?{primaryButton:{children:Er,onClick:()=>{Zr(!1),Li.navigate({id:"profile"})}}}:{}),ar?{secondaryButton:{children:ar,onClick:()=>Zr(!1)}}:{}))]})},R=({item:er,selectedAnswer:Yr,handleInputChange:Zr})=>{var Li,ro,Mo;const _o=(Li=er.answerOption)!=null?Li:[],xo=(Mo=(ro=Yr?.[0])==null?void 0:ro.valueCoding)==null?void 0:Mo.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:_o.map(So=>{var No,uo,pa,Er,ar,Tr,Pe;const Ce=(uo=(No=So.valueCoding)==null?void 0:No.code)!=null?uo:"",We=(Er=(pa=So.valueCoding)==null?void 0:pa.display)!=null?Er:"",gt=xo===Ce,Xt=(ar=So.extension)==null?void 0:ar.find(gn=>gn.url===i.g4),tn=(Tr=So.extension)==null?void 0:Tr.find(gn=>gn.url===i.rz),In=Xt?.valueString?i.JP[Xt.valueString]:void 0,lr=(Pe=tn?.valueString)!=null?Pe:"";return(0,n.jsx)(r.SelectableOption,{icon:In,title:We,description:lr,isSelected:gt,onSelect:()=>{Zr(er,[{valueCoding:{code:Ce,display:We}}])}},Ce)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:er,isLabel:Yr,required:Zr,className:Li,id:ro})=>(0,n.jsxs)("p",{id:ro,className:Li??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(Yr&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(er||"")}}),Zr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(er,Yr)=>{const Zr=er.replace(/\D/g,"");let Li="",ro=0;for(let Mo=0;Mo<Yr.length&&ro<Zr.length;Mo++)Yr[Mo]==="#"?(Li+=Zr[ro],ro++):Li+=Yr[Mo];return Li},k=er=>{if(!er)return w;const Yr=er.find(Zr=>Zr.url===i.Md);return Yr?.valueString||w},I=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:pa,readOnly:Er,extension:ar}=er,Tr=k(ar),Pe=((xo=Zr?.[0])==null?void 0:xo.valueString)||"",[Ce,We]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Pe){const lr=V(Pe,Tr);We(lr)}},[Pe,Tr]);const gt=No?(0,o.nt)(ro,pa,No):"",Xt=Mo?.[So]||"",tn=lr=>{const gn=V(lr,Tr);We(gn),Li(er,[{valueString:gn}])},In=()=>{Yr&&Yr(So)};return(0,n.jsxs)("div",{"data-testid":So,children:[gt&&(0,n.jsx)(N,{isLabel:!0,text:gt,required:uo||!1}),(0,n.jsx)(r.Input,{id:So,"aria-label":So,"data-testid":So,type:"tel",placeholder:"Enter phone number",value:Ce,onChange:tn,onBlur:In,isDisabled:Er||_o,isRequired:uo,hint:Xt,isInvalid:!!Xt,size:"md"},So)]})},q=({item:er,questionnaireSchemaItems:Yr})=>{var Zr;const{isLoading:Li,setCurrentGroupIndex:ro}=(0,p.c)(),Mo=(Zr=er.extension)==null?void 0:Zr.find(No=>No.url===i.Uf),_o=Mo?.valueString,xo=er.text||"Save & continue",So=()=>{if(_o){const No=(0,o.Ue)(Yr||[],_o);No!==-1&&ro(No)}};return(0,n.jsx)("div",{"data-testid":er.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:Li,onClick:So,isDisabled:er.readOnly,children:xo})})},U=({size:er=24,color:Yr="currentColor",...Zr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Yr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Zr},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:er=24,color:Yr="currentColor",...Zr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Yr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Zr},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:er=24,color:Yr="currentColor",...Zr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Yr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Zr},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));se.displayName="Mail01";var ie=e(31165),te=e(14449),he=e(27163);const Me=er=>{try{const Yr=er.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Yr)return er;const[,Zr,Li,ro]=Yr;return new Date(Date.UTC(parseInt(Zr),parseInt(Li)-1,parseInt(ro))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return er}},Se=er=>{try{if(er.includes("AM")||er.includes("PM"))return er;const Yr=er.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Yr)return er;const[,Zr,Li]=Yr,ro=parseInt(Zr),Mo=ro>=12?"PM":"AM";return`${ro%12||12}:${Li} ${Mo}`}catch{return er}},ge=(er,Yr,Zr=f.d)=>{var Li;const ro=(Li=er.extension)==null?void 0:Li.find(Mo=>Mo.url===i.g4);return ro?.valueString&&i.JP[ro.valueString]?i.JP[ro.valueString]:er.linkId&&Yr[er.linkId]?Yr[er.linkId]:Zr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":ie.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],pe=["appointment-review/facility-phone"],ce=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:er,questionnaireSchemaItems:Yr})=>{var Zr;const{setCurrentGroupIndex:Li}=(0,p.c)(),{trackEvent:ro}=(0,s.st)(),Mo=er.item||[];if(Mo.length===0)return null;const _o=(Zr=er.extension)==null?void 0:Zr.find(uo=>uo.url===i.Uf),xo=_o?.valueString,So=()=>{if(ro("edit_info_clicked",{section:er.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),xo){const uo=(0,o.Ue)(Yr||[],xo);uo!==-1&&Li(uo)}},No=Mo.map(uo=>{let pa="";if(uo.initial&&uo.initial.length>0){const Tr=uo.initial.map(Pe=>{var Ce,We;let gt=((Ce=Pe.valueCoding)==null?void 0:Ce.display)||((We=Pe.valueReference)==null?void 0:We.display)||Pe.valueString||"";return gt&&typeof gt=="string"&&(ae.includes(uo.linkId)?gt=Me(gt):me.includes(uo.linkId)&&(gt=Se(gt))),gt}).filter(Boolean);Tr.length>1||uo.repeats&&Tr.length>0?pa=Tr:Tr.length===1&&(pa=Tr[0])}if(!pa||Array.isArray(pa)&&pa.length===0)return null;let Er;pe.includes(uo.linkId)?Er="phone":ce.includes(uo.linkId)&&(Er="address");let ar;return ue.includes(uo.linkId)&&(ar="phone"),{Icon:ge(uo,ne),label:uo.text||uo.linkId,value:pa,linkType:Er,displayType:ar}}).filter(Boolean);return No.length===0?null:(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(he.InfoCard,{title:er.text||"Details",infoDetails:No,actionButtonText:xo&&"Edit info",onActionButtonClick:xo?So:void 0})})},J=({size:er=24,color:Yr="currentColor",...Zr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:er,height:er,stroke:Yr,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Zr},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:er})=>{const{setHideFooterButton:Yr,incrementCustomErrorCount:Zr,decrementCustomErrorCount:Li}=(0,p.c)();return(0,t.useEffect)(()=>(Yr(!0),Zr(),()=>{Yr(!1),Li()}),[Yr,Zr,Li]),(0,n.jsx)("div",{"data-testid":er.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)(er.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:er})=>{var Yr,Zr,Li,ro;const{incrementCustomErrorCount:Mo,decrementCustomErrorCount:_o,setHideFooterButton:xo}=(0,p.c)(),[So,No]=(0,t.useState)(!1),uo=(Yr=er.extension)==null?void 0:Yr.find(Ce=>Ce.url===i.gi),pa=(Li=(Zr=uo?.valueCodeableConcept)==null?void 0:Zr.coding)==null?void 0:Li.find(Ce=>Ce.system===i.tn),Er=pa?.code||"error",ar=De[Er]||"error";(0,t.useEffect)(()=>{if(ar==="error")return Mo(),xo(!0),No(!0),()=>{_o(),xo(!1)};No(!0)},[ar,Mo,_o,xo]);const Tr=pa?.display||"Error",Pe=(ro=er.text)!=null?ro:"";return So?(0,n.jsx)("div",{"data-testid":er.linkId,children:(0,n.jsx)(r.InfoBanner,{type:ar,title:Tr,description:Pe})}):null},Ie=({configKey:er,customErrorConfigurations:Yr})=>{if(!Yr)return null;const Zr=Yr[er];if(!Zr)return null;const{icon:Li,title:ro,description:Mo,primaryButton:_o,secondaryButton:xo}=Zr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:ro,description:Mo,featuredIconProps:{icon:Li,color:"gray"},primaryButton:_o,secondaryButton:xo})},xe=10,Ve=({item:er,customErrorConfigurations:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo,So,No,uo;const{trackEvent:pa}=(0,s.st)(),{setHideFooterButton:Er}=(0,p.c)(),{linkId:ar,text:Tr,required:Pe,answerOption:Ce,prefix:We,readOnly:gt}=er,Xt=er?.type==="reference",tn=(xo=Zr?.map(xn=>{var tr,Vr;return Xt?(tr=xn.valueReference)==null?void 0:tr.display:(Vr=xn.valueCoding)==null?void 0:Vr.code}).filter(xn=>xn!==void 0))!=null?xo:[],[In,lr]=(0,t.useState)(tn.length),gn=Tr?(0,o.nt)(ro,We,Tr):"",Kn=(No=(So=er.extension)==null?void 0:So.find(xn=>xn.url===i.Z_))==null?void 0:No.valueInteger,sn=(uo=Ce?.map(xn=>{var tr,Vr,p0,ui;return{value:Xt?((tr=xn.valueReference)==null?void 0:tr.display)||"":((Vr=xn.valueCoding)==null?void 0:Vr.code)||"",label:Xt?((p0=xn.valueReference)==null?void 0:p0.display)||"":((ui=xn.valueCoding)==null?void 0:ui.display)||"",valueReference:xn.valueReference}}))!=null?uo:[],Ar=Mo?.[ar],yr=sn.length>xe,$r=yr?sn.slice(0,xe):sn,a0=yr?sn.slice(xe):[],Kr=a0.some(xn=>tn?.includes(xn?.value)),[K0,Ni]=(0,t.useState)(Kr);if(!(er.answerOption&&er.answerOption.length>0))return Er(!0),(0,n.jsx)(Ie,{configKey:er.linkId,customErrorConfigurations:Yr});const _t=sn.filter(xn=>tn?.includes(xn?.value)).map(xn=>{var tr;const{restriction:Vr,warning:p0}=Xt?(0,o.eC)((tr=xn.valueReference)==null?void 0:tr.extension):{restriction:null,warning:null};return{label:xn.label,restriction:Vr,warning:p0}}).filter(xn=>xn.restriction||xn.warning),En=(xn,tr)=>{var Vr;pa("vaccine_type_checkbox_selected",{on_or_off:xn?"on":"off",vaccine:tr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let p0;if(xn){const ui=sn.find(g0=>g0.value===tr);p0=[...(Vr=Zr?.filter(g0=>Object.keys(g0).length!==0))!=null?Vr:[],Xt?{valueReference:ui?.valueReference}:{valueCoding:{code:tr,display:ui?.label}}],lr(g0=>g0+1)}else p0=Zr?.filter(ui=>{var g0,wi;return Xt?((g0=ui.valueReference)==null?void 0:g0.display)!==tr:((wi=ui.valueCoding)==null?void 0:wi.code)!==tr})||[{}],lr(ui=>ui-1);Li&&Li(er,p0)};return(0,n.jsxs)("div",{"data-testid":ar,children:[gn&&(0,n.jsx)(N,{text:gn,required:Pe||!1}),yr&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:$r.map((xn,tr)=>{const Vr=tn?.includes(xn?.value),p0=!Vr&&Kn?In>=Kn:!1;return(0,n.jsx)("div",{className:tr!==$r.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":xn.value,id:tr.toString(),name:xn.label,isInvalid:!!Ar,isSelected:Vr,label:xn.label,onChange:ui=>En(ui,xn.value),isDisabled:gt||_o||p0})},tr)})}),yr&&!K0&&!Kr&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{Ni(!0),pa("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:gt||_o,children:"See all"})}),yr&&K0&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),yr&&K0&&(0,n.jsx)("div",{children:a0.map((xn,tr)=>{const Vr=tn?.includes(xn?.value),p0=!Vr&&Kn?In>=Kn:!1;return(0,n.jsx)("div",{className:tr!==a0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":xn.value,id:(xe+tr).toString(),name:xn.label,isInvalid:!!Ar,isSelected:Vr,label:xn.label,onChange:ui=>En(ui,xn.value),isDisabled:gt||_o||p0})},xe+tr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Ar,children:Ar}),_t.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:_t.map((xn,tr)=>(0,n.jsxs)("div",{children:[xn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${xn.label}`,description:xn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:xn.restriction.items.map((Vr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Vr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:xn.restriction.items[0]})}),xn.warning&&(0,n.jsx)("div",{className:xn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${xn.label}`,description:xn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:xn.warning.items.map((Vr,p0)=>(0,n.jsx)("li",{className:"text-sm",children:Vr},p0))}):(0,n.jsx)("p",{className:"text-sm",children:xn.warning.items[0]})})})]},tr))})]})};var it=e(76323),bt=e(56192),xt=e(66267),Gt=Object.defineProperty,Kt=Object.defineProperties,Ct=Object.getOwnPropertyDescriptors,Xe=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ot=Object.prototype.propertyIsEnumerable,Qe=(er,Yr,Zr)=>Yr in er?Gt(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,Ye=(er,Yr)=>{for(var Zr in Yr||(Yr={}))Fe.call(Yr,Zr)&&Qe(er,Zr,Yr[Zr]);if(Xe)for(var Zr of Xe(Yr))Ot.call(Yr,Zr)&&Qe(er,Zr,Yr[Zr]);return er},Lt=(er,Yr)=>Kt(er,Ct(Yr)),mn=(er,Yr,Zr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Zr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Zr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Zr=Zr.apply(er,Yr)).next())});const Sn=({item:er,handleInputChange:Yr,onCompleteHandler:Zr,errors:Li})=>{const{i18n:{t:ro},loading:Mo}=(0,xt.E_)({keys:["shared-translations"]}),{trackEvent:_o}=(0,s.st)(),{linkId:xo,required:So,readOnly:No}=er,uo=Li?.[xo]||"",[pa,Er]=(0,t.useState)(it.LocationType.CURRENT_LOCATION),[ar,Tr]=(0,t.useState)(""),Pe=(0,t.useRef)({}),[Ce,We]=(0,t.useState)([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:gt,setIsLoading:Xt,setIsCurrentFormValid:tn,isCurrentFormValid:In}=(0,p.c)(),{position:lr,loading:gn,locationPermission:Kn}=(0,it.useDeviceLocationContext)(),{queryParams:sn,setQueryParams:Ar}=(0,it.useSearchQueryParams)(),[yr,{loading:$r}]=(0,bt.qtq)({fetchPolicy:"cache-first"}),[a0,{loading:Kr}]=(0,bt.YyG)({fetchPolicy:"cache-first"}),K0=er.item?(0,o.Yo)(er.item,"postal-code"):void 0,Ni=er.item?(0,o.Yo)(er.item,"state"):void 0,dt=er.item?(0,o.Yo)(er.item,"latitude"):void 0,_t=er.item?(0,o.Yo)(er.item,"longitude"):void 0,En=k0=>{if(!k0||!K0)return Tr(""),!1;const Ci=(0,o.zj)(K0.extension,K0.type,!1,K0.maxLength,[{valueString:k0}]);return Ci?(Tr(pa!==it.LocationType.ZIP_CODE?ro("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ci),!1):(Tr(""),!0)},xn=()=>{const{latitude:k0,longitude:Ci,state:G0,zipcode:d0}=Pe.current;return!!(k0&&Ci&&G0&&d0)},tr=(0,t.useCallback)(k0=>{Pe.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},er.item&&(Ni&&Yr(Ni,[{valueString:""}]),dt&&Yr(dt,[{valueDecimal:void 0}]),_t&&Yr(_t,[{valueDecimal:void 0}]),K0&&Yr(K0,[{valueString:""}])),Ar({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:k0,locationPermission:Kn}),tn&&tn(!1),Tr("")},[Yr,er.item,dt,Kn,_t,tn,Ar,Ni,K0]);(0,t.useEffect)(()=>{if(!So)return;!xn()&&tn&&tn(!1)},[In,So,tn]);const Vr=k0=>{Pe.current=Ye(Ye({},Pe.current),k0),k0.addressDescription&&_o("address_selected",{value:k0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),g0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,Pe.current.zipcode,Pe.current.placeId,Pe.current.addressDescription)},p0=k0=>mn(void 0,null,function*(){var Ci,G0,d0;if(Tr(""),Pe.current.zipcode=k0,tn&&tn(!1),En(k0)){_o("zip_code_entered",{value:k0,_event_metadata:{description:"A user entered a zip code."}});const Z0=yield a0({variables:{location:k0}}),x0=(Ci=Z0?.data)==null?void 0:Ci.geocoding,Ao=Z0?.error;if(x0){const Bi=x0.stateCode||"",Fo=(G0=x0.latitude)!=null?G0:void 0,ko=(d0=x0.longitude)!=null?d0:void 0;Vr({latitude:Fo,longitude:ko,state:Bi,zipcode:k0,placeId:void 0,addressDescription:void 0})}else Ao&&(Vr({latitude:void 0,longitude:void 0,state:void 0,zipcode:k0,placeId:void 0,addressDescription:void 0}),Tr(ro("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else g0(Pe.current.latitude,Pe.current.longitude,Pe.current.state,k0)}),ui=()=>{const k0=Pe.current.zipcode||"";!k0||pa!==it.LocationType.ZIP_CODE||En(k0)};(0,t.useEffect)(()=>{sn.locationType&&(Er(sn.locationType),sn.locationType===it.LocationType.ZIP_CODE&&sn.zipCode&&p0(sn.zipCode),sn.locationType===it.LocationType.ADDRESS&&sn.placeId&&sn.addressDescription&&(Pe.current.addressDescription=sn.addressDescription,Pe.current.placeId=sn.placeId))},[]),(0,t.useEffect)(()=>{const k0=[it.LocationPermissionEnum.DENIED,it.LocationPermissionEnum.UNAVAILABLE,it.LocationPermissionEnum.BLOCKED].includes(sn.locationPermission),Ci=[it.LocationPermissionEnum.GRANTED,it.LocationPermissionEnum.PROMPT].includes(sn.locationPermission);if(k0&&Ce.length!==2){if(We([{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}]),pa===it.LocationType.CURRENT_LOCATION||!sn.locationType||sn.locationType===""){const G0=sn.locationType===it.LocationType.ZIP_CODE?it.LocationType.ZIP_CODE:it.LocationType.ADDRESS;Er(G0),Ar(Lt(Ye({},sn),{locationType:G0})),tr(G0)}Tr("")}Ci&&Ce.length!==3&&We([{id:it.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:it.LocationType.ADDRESS,label:"Address"},{id:it.LocationType.ZIP_CODE,label:"Zip code"}])},[pa,Kn,Ce.length,sn,Ar,tr]);const g0=(k0,Ci,G0,d0,Z0,x0)=>{if(!er.item)return;Ni&&Yr(Ni,[{valueString:G0||""}]),dt&&Yr(dt,[{valueDecimal:k0}]),_t&&Yr(_t,[{valueDecimal:Ci}]),K0&&Yr(K0,[{valueString:d0||""}]),Ar(Lt(Ye({},sn),{lat:String(k0),lng:String(Ci),location:`${k0},${Ci}`,zipCode:d0||"",placeId:Z0||"",addressDescription:x0||"",locationPermission:Kn}));const Ao=xn()&&En(d0||"");tn&&tn(Ao),Zr&&Zr(xo)};(0,t.useEffect)(()=>{const k0=()=>mn(void 0,null,function*(){var Ci;try{const G0=yield yr({variables:{latitude:String(lr?.coords.latitude),longitude:String(lr?.coords.longitude)}}),d0=(Ci=G0?.data)==null?void 0:Ci.geocodingByLatLon,Z0=d0?.stateCode||"",x0=d0?.zipCode||"";(!x0||!Z0)&&Tr(ro("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),Vr({latitude:lr?.coords.latitude,longitude:lr?.coords.longitude,state:Z0,zipcode:x0,placeId:void 0,addressDescription:void 0})}catch{Er(it.LocationType.ADDRESS)}});pa===it.LocationType.CURRENT_LOCATION&&lr&&k0()},[pa,lr]);const wi=k0=>{if(!k0||!k0.latitude||!k0.longitude||!k0.zipCode||!k0.stateCode){Vr({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),k0&&typeof k0.value=="string"&&k0.value.trim().length!==0&&Tr(ro("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}Vr({latitude:k0.latitude,longitude:k0.longitude,state:k0.stateCode,zipcode:k0.zipCode,placeId:k0.placeId,addressDescription:k0.description})};return(0,t.useEffect)(()=>{Xt(gn||$r||Kr||Mo)},[gn,$r,Kr,Mo,Xt]),(0,t.useEffect)(()=>{sn.locationType!==pa&&Ar(Lt(Ye({},sn),{locationType:pa}))},[pa]),(0,n.jsxs)("div",{"data-testid":er.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:So||!1}),(0,n.jsx)(r.Select,{id:xo,"aria-label":xo,"data-testid":xo,isDisabled:No||$r||Kr||gt,selectedKey:pa,onSelectionChange:k0=>{var Ci;_o("location_type_input_selected",{choice:(Ci=Ce.find(({id:G0})=>G0===k0))==null?void 0:Ci.label,_event_metadata:{description:"A user changed the location type input."}}),k0!==pa&&(tr(k0),Er(k0))},hint:uo,isInvalid:!!uo,items:Ce,placeholder:"Select an option",isRequired:So,children:k0=>(0,n.jsx)(r.Select.Item,{id:k0.id,"data-testid":k0.id,value:k0,children:k0.label},k0.id)},xo),pa===it.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!ar,children:ar}),pa===it.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:So||!1}),(0,n.jsx)(it.AddressTypeahead,{onValueChange:wi,isDisabled:gt,setIsLoading:Xt,initialValue:{placeId:Pe.current.placeId||"",description:Pe.current.addressDescription||""},errorText:ar||uo})]}),pa===it.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:So||!1}),(0,n.jsx)(r.Input,{isRequired:So,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${xo}-zipcode`,placeholder:"Type your response here...",value:Pe.current.zipcode||"",onChange:p0,onBlur:ui,isDisabled:No||Kr||gt,hint:ar||uo,isInvalid:!!ar||!!uo,autoComplete:"postal-code"},`${xo}-zipcode`)]})]})},et=er=>(0,n.jsx)(it.DeviceLocationProvider,{children:(0,n.jsx)(Sn,Ye({},er))}),Rt={[i.cX]:et,[i.G6]:re,[i.c3]:Ve,[i.AA]:ze,[i.mO]:h,[i.PM]:q,[i.HH]:I,[i.Us]:Ee,[i.Tl]:R,[i.G0]:v,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v};var kt,$n=new Uint8Array(16);function Mr(){if(!kt&&(kt=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!kt))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return kt($n)}const vn=/^(?:[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 Nn(er){return typeof er=="string"&&vn.test(er)}const cr=Nn;for(var Pn=[],Ur=0;Ur<256;++Ur)Pn.push((Ur+256).toString(16).substr(1));function t0(er){var Yr=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Zr=(Pn[er[Yr+0]]+Pn[er[Yr+1]]+Pn[er[Yr+2]]+Pn[er[Yr+3]]+"-"+Pn[er[Yr+4]]+Pn[er[Yr+5]]+"-"+Pn[er[Yr+6]]+Pn[er[Yr+7]]+"-"+Pn[er[Yr+8]]+Pn[er[Yr+9]]+"-"+Pn[er[Yr+10]]+Pn[er[Yr+11]]+Pn[er[Yr+12]]+Pn[er[Yr+13]]+Pn[er[Yr+14]]+Pn[er[Yr+15]]).toLowerCase();if(!cr(Zr))throw TypeError("Stringified UUID is invalid");return Zr}const Dt=t0;function $e(er,Yr,Zr){er=er||{};var Li=er.random||(er.rng||Mr)();if(Li[6]=Li[6]&15|64,Li[8]=Li[8]&63|128,Yr){Zr=Zr||0;for(var ro=0;ro<16;++ro)Yr[Zr+ro]=Li[ro];return Yr}return Dt(Li)}const ot=$e,Je=(er,Yr="application/octet-stream")=>{try{const Zr=window.atob(er),Li=new Uint8Array(Zr.length);for(let Mo=0;Mo<Zr.length;Mo++)Li[Mo]=Zr.charCodeAt(Mo);return new Blob([Li],{type:Yr}).size}catch{return 0}},tt=(er,Yr)=>`data:${Yr};base64,${er}`,rt=(er,Yr,Zr=512)=>{const Li=window.atob(er),ro=[];for(let _o=0;_o<Li.length;_o+=Zr){const xo=Li.slice(_o,_o+Zr),So=new Array(xo.length);for(let uo=0;uo<xo.length;uo++)So[uo]=xo.charCodeAt(uo);const No=new Uint8Array(So);ro.push(No)}const Mo=new Blob(ro,{type:Yr});return URL.createObjectURL(Mo)},lt=er=>{const Yr=new Date().toISOString().replace(/[:.-]/g,"");return`${er.split(" ").join("-")}_${Yr}`},Et=4e3,st=.8,le=(er,Yr)=>{var Zr,Li;const ro=(Zr=Yr?.maxDimension)!=null?Zr:Et,Mo=(Li=Yr?.quality)!=null?Li:st;return new Promise((_o,xo)=>{if(!er.type.startsWith("image/")){_o(er);return}const So=new Image,No=new FileReader;No.onload=()=>{const uo=No.result;So.onload=()=>{let{width:pa,height:Er}=So;if(pa>ro||Er>ro){const We=ro/Math.max(pa,Er);pa=Math.round(pa*We),Er=Math.round(Er*We)}const ar=document.createElement("canvas");ar.width=pa,ar.height=Er;const Tr=ar.getContext("2d");if(!Tr){_o(er);return}Tr.drawImage(So,0,0,pa,Er);const Pe=er.type==="image/png"?"image/png":"image/jpeg",Ce=er.type==="image/png"?void 0:Mo;ar.toBlob(We=>{if(!We||We.size>=er.size){_o(er);return}_o(new File([We],er.name,{type:Pe}))},Pe,Ce)},So.onerror=()=>{xo(new Error(`Failed to load image: ${er.name}`))},So.src=uo},No.onerror=()=>{xo(new Error(`Failed to read file: ${er.name}`))},No.readAsDataURL(er)})},ye=50,Ue=(er,Yr=ye)=>{if(er.length<=Yr)return er;const Zr=er.lastIndexOf("."),Li=Zr!==-1?er.slice(Zr):"",ro=Zr!==-1?er.slice(0,Zr):er,Mo=Yr-Li.length-1,_o=Math.ceil(Mo/2),xo=Math.floor(Mo/2);return`${ro.slice(0,_o)}\u2026${ro.slice(-xo)}${Li}`};var Te=Object.defineProperty,zt=Object.defineProperties,Ft=Object.getOwnPropertyDescriptors,dn=Object.getOwnPropertySymbols,zn=Object.prototype.hasOwnProperty,gr=Object.prototype.propertyIsEnumerable,Bt=(er,Yr,Zr)=>Yr in er?Te(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,we=(er,Yr)=>{for(var Zr in Yr||(Yr={}))zn.call(Yr,Zr)&&Bt(er,Zr,Yr[Zr]);if(dn)for(var Zr of dn(Yr))gr.call(Yr,Zr)&&Bt(er,Zr,Yr[Zr]);return er},Ze=(er,Yr)=>zt(er,Ft(Yr)),At=(er,Yr,Zr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Zr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Zr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Zr=Zr.apply(er,Yr)).next())});const en=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{const{linkId:xo,text:So,required:No,prefix:uo,readOnly:pa,repeats:Er,extension:ar}=er,Tr=(0,o.Qr)(ar),Pe=(0,o.cz)(ar),Ce=(0,o.$H)(ar)||"image/*,.pdf,.doc,.docx",We=So?(0,o.nt)(ro,uo,So):"",gt=Mo?.[xo]||"",[Xt,tn]=(0,t.useState)([]),In=(0,t.useRef)(Zr||[]);(0,t.useEffect)(()=>{Zr&&(In.current=Zr)},[Zr]),(0,t.useEffect)(()=>{Zr?.length&&tn(yr=>{const $r=yr.filter(Kr=>Kr.isLoading||Kr.failed);return[...Zr.filter(Kr=>Kr.valueAttachment).map((Kr,K0)=>{var Ni,dt,_t,En,xn;const tr=((Ni=Kr.valueAttachment)==null?void 0:Ni.title)||`attachment-${K0}`,Vr=(dt=Kr.valueAttachment)==null?void 0:dt.id,p0=yr.find(wi=>Vr&&wi.id===Vr||!Vr&&wi.id===`existing-${K0}`),ui=(_t=Kr.valueAttachment)==null?void 0:_t.data,g0=ui?Je(ui,(En=Kr.valueAttachment)==null?void 0:En.contentType):0;return{id:Vr||p0?.id||`existing-${K0}`,name:tr,size:p0?.size||g0,progress:100,failed:!1,type:(0,o.J4)((xn=Kr.valueAttachment)==null?void 0:xn.contentType),isLoading:!1}}),...$r]})},[Zr]);const lr=yr=>{let $r=Array.from(yr);if(Pe!==void 0){const Kr=Pe-Xt.length;if(Kr<=0)return;$r=$r.slice(0,Kr)}const a0=$r.map(Kr=>{const K0=Tr&&Kr.size>Tr,Ni=Kr.name.replace(/\s+/g,"-");return{id:ot(),name:Ni,size:Kr.size,progress:0,type:(0,o.J4)(Kr.type),failed:!!K0,isLoading:!K0,disableRetry:!!K0,errorMessage:K0?`File size exceeds ${(Tr/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});tn(Kr=>[...Kr,...a0]),a0.filter(Kr=>!Kr.failed).forEach(Kr=>{const K0=$r.find(Ni=>Ni.name.replace(/\s+/g,"-")===Kr.name);K0&&gn(K0,Kr.id)})},gn=(yr,$r)=>At(void 0,null,function*(){try{const a0=yield le(yr),Kr=yield Ar(a0),K0=a0.name.replace(/\s+/g,"-");tn(En=>En.map(xn=>xn.id===$r?Ze(we({},xn),{isLoading:!1,progress:100,failed:!1}):xn));const Ni={valueAttachment:{id:$r,contentType:a0.type,data:Kr,title:K0}},_t=[...(In.current||[]).filter(En=>En.valueAttachment||Object.keys(En).length>0),Ni];In.current=_t,Li(er,_t),Yr(xo)}catch{tn(Kr=>Kr.map(K0=>K0.id===$r?Ze(we({},K0),{isLoading:!1,failed:!0}):K0))}}),Kn=yr=>{const $r=Xt.find(a0=>a0.id===yr);if(tn(a0=>a0.filter(Kr=>Kr.id!==yr)),$r){const a0=(In.current||[]).filter((Kr,K0)=>{var Ni;if(yr.startsWith("existing-")){const dt=parseInt(yr.replace("existing-",""));return K0!==dt}return((Ni=Kr.valueAttachment)==null?void 0:Ni.id)!==yr}).filter(Kr=>Kr.valueAttachment||Object.keys(Kr).length>0);In.current=a0,Li(er,a0.length>0?a0:[{}])}},sn=yr=>{const $r=Xt.find(a0=>a0.id===yr);if($r){tn(Kr=>Kr.map(K0=>K0.id===yr?Ze(we({},K0),{failed:!1,isLoading:!0,progress:0}):K0));const a0=new File([""],$r.name,{type:"application/octet-stream"});gn(a0,yr)}},Ar=yr=>new Promise(($r,a0)=>{const Kr=new FileReader;Kr.onload=()=>{const Ni=Kr.result.split(",")[1];$r(Ni)},Kr.onerror=a0,Kr.readAsDataURL(yr)});return(0,n.jsxs)("div",{children:[We&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:We,required:No||!1}),(0,n.jsx)(r.FileUpload,{files:Xt,onDropFiles:lr,onDeleteFile:Kn,onRetryFile:sn,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(Ce,Tr,Pe),accept:Ce,allowsMultiple:Er!==!1,isDisabled:pa||_o||Pe!==void 0&&Xt.length>=Pe,className:"w-full",showDisclosureModal:!0}),gt&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:gt})]})},nn=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo,So;const{linkId:No,text:uo,prefix:pa,readOnly:Er,required:ar,extension:Tr}=er,{trackQuestionnaireEvent:Pe}=(0,p.c)(),Ce=uo?(0,o.nt)(ro,pa,uo):"",We=Mo?.[No];return Tr?.find(Xt=>{var tn,In;return Xt.url===i.gD&&((In=(tn=Xt.valueCodeableConcept)==null?void 0:tn.coding)==null?void 0:In.some(lr=>lr.system===i.n4&&lr.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":No,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":No,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:No,name:No,isDisabled:Er||_o,isSelected:(xo=Zr?.[0])==null?void 0:xo.valueBoolean,"aria-label":No,label:"",className:"mt-1",onChange:Xt=>{Pe(er.linkId,{value:Xt}),Li(er,[{valueBoolean:Xt}]),Yr(er.linkId)}}),Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ar||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!We,children:We})]}):(0,n.jsxs)("div",{"data-testid":No,children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:ar||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:No,name:No,"aria-label":No,value:String((So=Zr?.[0])==null?void 0:So.valueBoolean)||"",onChange:Xt=>{Li(er,[{valueBoolean:Xt==="true"}]),Yr(er.linkId)},isInvalid:!!We,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Er||_o}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Er||_o})]},No),We&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:We})})]})};var pn=Object.defineProperty,pt=Object.getOwnPropertySymbols,Qt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,Pt=(er,Yr,Zr)=>Yr in er?pn(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,$t=(er,Yr)=>{for(var Zr in Yr||(Yr={}))Qt.call(Yr,Zr)&&Pt(er,Zr,Yr[Zr]);if(pt)for(var Zr of pt(Yr))qt.call(Yr,Zr)&&Pt(er,Zr,Yr[Zr]);return er};const Yt=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,pa;const{linkId:Er,text:ar,required:Tr,answerOption:Pe,prefix:Ce,readOnly:We}=er,gt=ar?(0,o.nt)(ro,Ce,ar):"",Xt=Pe?.map(lr=>{var gn,Kn,sn,Ar;return{id:((gn=lr.valueCoding)==null?void 0:gn.code)||lr.valueString||"",label:((Kn=lr.valueCoding)==null?void 0:Kn.display)||lr.valueString||"",value:((sn=lr.valueCoding)==null?void 0:sn.code)||lr.valueString||"",extension:lr.extension||[],system:((Ar=lr.valueCoding)==null?void 0:Ar.system)||void 0}})||[],tn=((uo=(No=Zr?.[0])==null?void 0:No.valueCoding)==null?void 0:uo.code)||((pa=Zr?.[0])==null?void 0:pa.valueString)||"",In=Mo?.[Er];return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:gt,required:Tr||!1}),(0,n.jsx)(r.Select,{id:Er,"aria-label":Er,"data-testid":Er,isDisabled:We||_o,selectedKey:tn,onSelectionChange:lr=>{const gn=String(lr),Kn=Xt.find(yr=>yr.value===gn),sn=Kn?Kn.label:"",Ar=Boolean(Pe?.find(yr=>yr.valueString===gn));Li(er,[Ar?{valueString:gn}:{valueCoding:$t({code:gn,display:sn},Kn?.system?{system:Kn.system}:{}),extension:Kn?.extension||[]}]),Yr(er.linkId)},isInvalid:!!In,hint:In||So,items:Xt,placeholder:xo,isRequired:Tr,children:lr=>(0,n.jsx)(r.Select.Item,{id:lr.id,"data-testid":lr.value,value:lr.value,children:lr.label},lr.id)},Er)]})};var An=Object.defineProperty,zr=Object.getOwnPropertySymbols,qr=Object.prototype.hasOwnProperty,Ln=Object.prototype.propertyIsEnumerable,Dn=(er,Yr,Zr)=>Yr in er?An(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,rn=(er,Yr)=>{for(var Zr in Yr||(Yr={}))qr.call(Yr,Zr)&&Dn(er,Zr,Yr[Zr]);if(zr)for(var Zr of zr(Yr))Ln.call(Yr,Zr)&&Dn(er,Zr,Yr[Zr]);return er};const vt=er=>{var Yr,Zr,Li;const{item:ro,selectedAnswer:Mo,updatedText:_o,required:xo,errorMessage:So}=er,No=ro?.type==="reference",uo=(Yr=Mo?.map(Pe=>{var Ce,We;return No?(Ce=Pe.valueReference)==null?void 0:Ce.display:(We=Pe.valueCoding)==null?void 0:We.code}).filter(Pe=>Pe!==void 0))!=null?Yr:[],[pa,Er]=(0,t.useState)(uo.length),ar=(Li=(Zr=ro.extension)==null?void 0:Zr.find(Pe=>Pe.url===i.Z_))==null?void 0:Li.valueInteger,Tr=(Pe,Ce)=>{var We,gt,Xt;let tn;if(Pe){const In=er.options.find(lr=>lr.value===Ce);tn=[...(gt=(We=er.selectedAnswer)==null?void 0:We.filter(lr=>Object.keys(lr).length!==0))!=null?gt:[],No?{valueReference:In?.valueReference}:{valueCoding:rn({code:Ce,display:In?.label},In?.system?{system:In.system}:{}),extension:In?.extension||[]}],Er(lr=>lr+1)}else tn=((Xt=er.selectedAnswer)==null?void 0:Xt.filter(In=>{var lr,gn;return No?((lr=In.valueReference)==null?void 0:lr.display)!==Ce:((gn=In.valueCoding)==null?void 0:gn.code)!==Ce}))||[{}],Er(In=>In-1);er.handleInputChange(er.item,tn)};return(0,n.jsxs)("div",{"data-testid":ro.linkId,children:[_o&&(0,n.jsx)(N,{isLabel:!0,text:_o,required:xo||!1}),(0,n.jsx)("div",{children:er.options.map((Pe,Ce)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Pe.value,id:Ce.toString(),className:Ce!==er.options.length-1?"mb-2xl":"",name:Pe.label,isInvalid:!!So,isSelected:uo?.includes(Pe?.value),label:Pe.label,onChange:We=>Tr(We,Pe.value),isDisabled:er.readOnly||er.isLoading||(!uo?.includes(Pe?.value)&&ar?pa>=ar:!1)},Ce))}),(0,n.jsx)(r.HintText,{isInvalid:!!So,children:So})]})},St=({item:er,onCompleteHandler:Yr,updatedText:Zr,options:Li,handleInputChange:ro,errorMessage:Mo,readOnly:_o,initialValue:xo,selectedAnswer:So,isLoading:No,required:uo})=>{var pa,Er;const ar=`${er.linkId}-label`,Tr=`${er.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":er.linkId,children:[Zr&&(0,n.jsx)(N,{id:ar,isLabel:!0,text:Zr,required:uo||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:er.linkId,name:er.linkId,"aria-labelledby":Zr?ar:void 0,"aria-describedby":Mo?Tr:void 0,isRequired:uo,className:Li.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Er=(pa=So?.[0])==null?void 0:pa.valueCoding)==null?void 0:Er.code)||xo||"",onChange:Pe=>{const Ce=Pe,We=Li.find(Xt=>Xt.value===Ce),gt=We?We.label:"";ro(er,[{valueCoding:{code:Ce,display:gt,system:We?.system||void 0},extension:We?.extension||[]}]),Yr(er.linkId)},isInvalid:!!Mo,children:Li.map(Pe=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Pe.value,isDisabled:_o||No,value:Pe.value,label:Pe.label},Pe.value))},er.linkId),Mo&&(0,n.jsx)("div",{id:Tr,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Mo})})]})};var Zt=Object.defineProperty,cn=Object.getOwnPropertySymbols,on=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable,jn=(er,Yr,Zr)=>Yr in er?Zt(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,wr=(er,Yr)=>{for(var Zr in Yr||(Yr={}))on.call(Yr,Zr)&&jn(er,Zr,Yr[Zr]);if(cn)for(var Zr of cn(Yr))Cn.call(Yr,Zr)&&jn(er,Zr,Yr[Zr]);return er};const Wr=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,pa,Er,ar;const{linkId:Tr,text:Pe,required:Ce,answerOption:We,prefix:gt,readOnly:Xt}=er,tn=er?.type==="reference",In=Pe?(0,o.nt)(ro,gt,Pe):"",gn=(()=>{var a0,Kr;const K0=We?.find(Ni=>Ni.initialSelected===!0);return K0?tn?((a0=K0.valueReference)==null?void 0:a0.display)||"":((Kr=K0?.valueCoding)==null?void 0:Kr.code)||"":""})(),Kn=(We?.map(a0=>{var Kr,K0,Ni,dt,_t;return{label:((Kr=a0?.valueCoding)==null?void 0:Kr.display)||((K0=a0?.valueReference)==null?void 0:K0.display)||"",value:tn?((Ni=a0.valueReference)==null?void 0:Ni.display)||"":((dt=a0.valueCoding)==null?void 0:dt.code)||"",valueReference:tn?a0.valueReference:{},extension:a0.extension||[],system:((_t=a0.valueCoding)==null?void 0:_t.system)||""}})||[]).filter(a0=>a0.label),sn=Mo?.[Tr],Ar=(ar=(Er=(pa=(uo=(No=er?.extension)==null?void 0:No.find(a0=>a0.url.includes("questionnaire-itemControl")))==null?void 0:uo.valueCodeableConcept)==null?void 0:pa.coding)==null?void 0:Er[0])==null?void 0:ar.code;let yr=null;const $r={item:er,onCompleteHandler:Yr,updatedText:In,options:Kn,handleInputChange:Li,errorMessage:sn,required:Ce,readOnly:Xt,initialValue:gn,selectedAnswer:Zr,isLoading:_o,showQuestionPrefix:ro,placeholder:xo,hintText:So};switch(Ar){case"drop-down":yr=(0,n.jsx)(Yt,wr({},$r));break;case"check-box":yr=(0,n.jsx)(vt,wr({},$r));break;case"radio-button":yr=(0,n.jsx)(St,wr({},$r));break}return(0,n.jsx)(n.Fragment,{children:yr})};var _r=e(73697),f0=e(71924),Di=e(46776);const _0=er=>`${String(er.month).padStart(2,"0")}/${String(er.day).padStart(2,"0")}/${er.year}`,si=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,pa;const{linkId:Er,text:ar,required:Tr,prefix:Pe,readOnly:Ce}=er,We=(0,t.useRef)(null),[gt,Xt]=(0,t.useState)(!1),[tn,In]=(0,t.useState)(null),{setIsCurrentFormValid:lr,isCurrentFormValid:gn,trackQuestionnaireEvent:Kn}=(0,p.c)(),sn=ar?(0,o.nt)(ro,Pe,ar):"",Ar=Mo?.[Er]||"",yr=(No=er.extension)==null?void 0:No.find(G0=>G0.url===i.dU),$r=(uo=er.extension)==null?void 0:uo.find(G0=>G0.url===i.bK),a0=(0,t.useMemo)(()=>{var G0;const d0=yr?.valueString||yr?.valueDate;return d0||(0,o.iI)((G0=yr?.valueExpression)==null?void 0:G0.expression)},[yr]),Kr=(0,t.useMemo)(()=>{var G0;const d0=$r?.valueString||$r?.valueDate;return d0||(0,o.iI)((G0=$r?.valueExpression)==null?void 0:G0.expression)},[$r]),K0=(0,t.useMemo)(()=>{if(a0&&/^\d{4}-\d{2}-\d{2}$/.test(a0))try{return(0,_r._U)(a0)}catch{}return(0,_r._U)("1900-01-01")},[a0]),Ni=(0,t.useMemo)(()=>{if(Kr&&/^\d{4}-\d{2}-\d{2}$/.test(Kr))try{return(0,_r._U)(Kr)}catch(G0){console.warn("Failed to parse maxDateStr:",Kr,G0)}return(0,_r._U)("2099-12-31")},[Kr]),_t=(G0=>{if(!G0)return"";const d0=G0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!d0)return G0;const[,Z0,x0,Ao]=d0;return`${x0}/${Ao}/${Z0}`})(((pa=Zr?.[0])==null?void 0:pa.valueDate)||""),En=G0=>{if(!G0)return"";const d0=G0.replace(/\D/g,"");if(d0.length===0)return"";if(d0.length<=2)return d0.length===2?`${d0}/`:d0;const Z0=Ao=>{const Bi=Ao.slice(0,2),Fo=Ao.slice(2);return Fo.length===2?`${Bi}/${Fo}/`:`${Bi}/${Fo}`},x0=Ao=>{const Bi=Ao.slice(0,2),Fo=Ao.slice(2,4),ko=Ao.slice(4,8);return`${Bi}/${Fo}/${ko}`};return d0.length<=4?Z0(d0):x0(d0)},xn=()=>{if(Ce||_o)return;if(_t.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const d0=(0,_r._U)(_t);In(d0)}catch{In(null)}else{const d0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(d0){const[,Z0,x0,Ao]=d0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10);if(Bi>=1&&Bi<=12&&Fo>=1&&Fo<=31)try{const ko=(0,_r._U)(`${Ao}-${Z0}-${x0}`);In(ko)}catch{In(null)}else In(null)}else In(null)}Xt(!0)},tr=()=>{if(tn){const G0=`${tn.year}-${String(tn.month).padStart(2,"0")}-${String(tn.day).padStart(2,"0")}`;Kn(er.linkId,{value:(0,o.CP)(`${String(tn.month).padStart(2,"0")}/${String(tn.day).padStart(2,"0")}/${tn.year}`)}),Li(er,[{valueDate:(0,o.Fy)(G0)}])}Xt(!1),In(null)},Vr=()=>{Xt(!1),In(null)},p0=G0=>{var d0;const Z0=((d0=We.current)==null?void 0:d0.selectionStart)||0,x0=_t,Ao=En(G0),Bi=Ao.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Bi){const[,Fo,ko,Oa]=Bi,Sa=parseInt(Fo,10),Ls=parseInt(ko,10),Bs=parseInt(Oa,10);if(ui(Sa,Ls,Bs).isValid){const Zo=`${Oa}-${Fo}-${ko}`;Kn(er.linkId,{value:(0,o.CP)(`${Fo}/${ko}/${Oa}`)}),Li(er,[{valueDate:(0,o.Fy)(Zo)}])}else Li(er,[{valueDate:Ao}])}else Li(er,[{valueDate:Ao}]);setTimeout(()=>{if(We.current){const Fo=x0.replace(/\D/g,""),ko=Ao.replace(/\D/g,"");let Oa=Z0;Ao===x0&&(Oa=Z0-1),ko.length>=Fo.length&&Ao!==x0?Ao[Z0-1]==="/"?Oa=Z0+1:Oa=Z0:ko.length<Fo.length&&(x0[Z0-1]==="/"?Oa=Math.max(0,Z0-1):Oa=Z0),We.current.setSelectionRange(Oa,Oa)}},0)},ui=(G0,d0,Z0)=>{if(G0<1||G0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(d0<1||d0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const x0=new Date(Z0,G0,0).getDate();if(d0>x0)return{isValid:!1,error:"Invalid day for the selected month"};if(a0||Kr){const Ao=new f0.ng(Z0,G0,d0);if(a0&&/^\d{4}-\d{2}-\d{2}$/.test(a0))try{const Bi=(0,_r._U)(a0);if(Ao.compare(Bi)<0){const Fo=(0,o.di)(i.Ck,er.extension);if(Fo)return{isValid:!1,error:Fo};const ko=_0(Bi);return{isValid:!1,error:`Date must be on or after ${ko}`}}}catch{}if(Kr&&/^\d{4}-\d{2}-\d{2}$/.test(Kr))try{const Bi=(0,_r._U)(Kr);if(Ao.compare(Bi)>0){const Fo=(0,o.di)(i.Cx,er.extension);if(Fo)return{isValid:!1,error:Fo};const ko=_0(Bi);return{isValid:!1,error:`Date must be on or before ${ko}`}}}catch{}}return{isValid:!0,error:""}},g0=()=>{const G0=_t.replace(/\D/g,"");if(G0.length>0&&G0.length<8){Yr(er.linkId);return}const d0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!d0&&G0.length>=6){Yr(er.linkId);return}if(d0){const[,Z0,x0,Ao]=d0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10),ko=parseInt(Ao,10);if(ui(Bi,Fo,ko).isValid){const Oa=`${Ao}-${Z0}-${x0}`;Li(er,[{valueDate:(0,o.Fy)(Oa)}])}}Yr(er.linkId)},k0=(()=>{if(!_t)return"";const G0=_t.replace(/\D/g,"");if(G0.length>0&&G0.length<8)return"";const d0=_t.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!d0&&G0.length>=6)return gn&&lr(!1),"Invalid date";if(d0){const[,Z0,x0,Ao]=d0,Bi=parseInt(Z0,10),Fo=parseInt(x0,10),ko=parseInt(Ao,10),{isValid:Oa,error:Sa}=ui(Bi,Fo,ko);if(!Oa)return gn&&lr(!1),Sa||"Invalid date"}return""})(),Ci=!!Ar||!!k0;return(0,n.jsxs)("div",{children:[sn&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:sn,required:Tr||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Ce||_o,className:(0,P.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Ce||_o)&&"cursor-not-allowed opacity-50"),onClick:xn,"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",(Ce||_o)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:We,isRequired:Tr,size:"md",type:"text",name:Er,"data-testid":Er,id:Er,value:_t,onChange:p0,placeholder:xo,isDisabled:Ce||_o,onBlur:g0,hint:k0||Ar||So,isInvalid:Ci,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Er)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:gt,onOpenChange:G0=>{G0||Vr()},primaryButton:{children:"Apply",onClick:tr,isDisabled:!tn},secondaryButton:{children:"Cancel",onClick:Vr},children:(0,n.jsx)(Di.lr,{value:tn,onChange:In,minValue:K0,maxValue:Ni,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:K0,maxValue:Ni,onYearPickerOpen:()=>{In(null)}})})})]})},X0=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:pa,readOnly:Er}=er,ar=No?(0,o.nt)(ro,pa,No):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ar,required:uo||!1}),(0,n.jsx)(r.Input,{isRequired:uo,size:"md",type:"datetime-local",id:So,"aria-label":So,"data-testid":So,placeholder:"Type your response here...",value:((xo=Zr?.[0])==null?void 0:xo.valueDateTime)||"",onChange:Pe=>{let Ce=Pe;const[We,gt]=Ce.split("T");We&&gt&&(Ce=`${(0,o.Fy)(We)}T${gt}:00`),Li(er,[{valueDateTime:Ce}])},isDisabled:Er||_o,onBlur:()=>{Yr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},Si=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:pa,required:Er,prefix:ar,readOnly:Tr}=er,Pe=pa?(0,o.nt)(ro,ar,pa):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er),gt=(No=Zr?.[0])==null?void 0:No.valueDecimal,[Xt,tn]=(0,t.useState)(String(gt??""));return(0,t.useEffect)(()=>{tn(String(gt??""))},[gt]),(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,text:Pe,required:Er||!1}),(0,n.jsx)(r.Input,{isRequired:Er,size:"md",id:uo,"aria-label":uo,"data-testid":uo,placeholder:xo,value:Xt,onChange:In=>{tn(In)},isDisabled:Tr||_o,onBlur:()=>{const In=parseFloat(Xt);tn(isNaN(In)?"":String(In)),Li(er,[{valueDecimal:isNaN(In)?void 0:In}]),Yr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},pr=({item:er,showStepper:Yr=!1})=>{var Zr;const{text:Li,linkId:ro,type:Mo}=er,_o=Li&&(0,o.nt)(!1,"",Li),xo=(Zr=er.extension)==null?void 0:Zr.find(pa=>pa.url===i.Yt),So=xo?.valueBoolean===!0,No=Mo==="group"&&(0,o.$O)(er)!==void 0,uo=()=>{const pa=(0,o.$O)(er),Er=(0,o.t7)(er);if(pa===void 0||Er===void 0||Er<=0)return[];const ar=[];for(let Tr=1;Tr<=Er;Tr++){let Pe="incomplete";Tr<pa?Pe="complete":Tr===pa&&(Pe="current"),ar.push({title:"",description:"",status:Pe})}return ar};return _o&&!So?(0,n.jsxs)("div",{"data-testid":ro,children:[(0,n.jsx)(N,{text:_o,required:!1,className:""}),Yr&&No&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:uo()})})]}):null},mr=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:pa,required:Er,prefix:ar,readOnly:Tr}=er,Pe=pa?(0,o.nt)(ro,ar,pa):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Er||!1}),(0,n.jsx)(r.Input,{isRequired:Er,"data-testid":uo,size:"md",id:uo,"aria-label":uo,placeholder:xo,value:String((No=Zr?.[0])==null?void 0:No.valueInteger)||"",onChange:gt=>{Li(er,[{valueInteger:Number(gt)}])},isDisabled:Tr||_o,onBlur:()=>{Yr(er.linkId)},type:"number",hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},vr=({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No,uo,pa;const{linkId:Er,text:ar,extension:Tr,required:Pe,prefix:Ce,readOnly:We}=er,gt=ar?(0,o.nt)(ro,Ce,ar):"",Xt=Tr?.find(lr=>lr.url.includes("questionnaire-unitOption")),tn=Mo?.[Er],In=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[gt&&(0,n.jsx)(N,{isLabel:!0,text:gt,required:Pe||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Pe,size:"md",id:Er,"aria-label":Er,"data-testid":Er,value:(No=Zr?.[0])!=null&&No.valueQuantity?String((uo=Zr[0].valueQuantity)==null?void 0:uo.value):"",onChange:lr=>{Li(er,[{valueQuantity:{value:parseFloat(lr)}}])},isDisabled:We||_o,onBlur:()=>{var lr,gn,Kn;const sn=(lr=Zr?.[0])!=null&&lr.valueQuantity?parseFloat(String((Kn=(gn=Zr?.[0])==null?void 0:gn.valueQuantity)==null?void 0:Kn.value)).toFixed(2):"";Li(er,[{valueQuantity:{value:parseFloat(sn)}}]),Yr(er.linkId)},hint:tn||So,isInvalid:!!tn,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:(pa=Xt?.valueCoding)==null?void 0:pa.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:xo,autoComplete:In})},Er)]})};var T0=e(61784);const M0="ui-toolkit-modern",Q0={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS",SUBMIT:"SUBMIT"},$i={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},ki={[$i.CURRENT_LOCATION]:Q0.CURRENT_LOCATION,[$i.ZIP_CODE]:Q0.ZIP_CODE,[$i.ADDRESS]:Q0.ADDRESS},so={mi:{singular:Q0.MILE,plural:Q0.MILES}},Ro=({resourceData:er,handleInputChange:Yr,item:Zr,questionnaireSchemaItems:Li})=>{var ro;const{t:Mo}=(0,T0.SS)(),{queryParams:_o}=(0,it.useSearchQueryParams)(),xo=_o.locationType||"",{setCurrentGroupIndex:So,handleContinueButtonClick:No,setHideFooterButton:uo}=(0,p.c)(),{trackEvent:pa}=(0,s.st)();(0,t.useEffect)(()=>{if(!Zr.readOnly)return uo(!0),()=>{uo(!1)}},[Zr.readOnly,uo]);const Er=(ro=Zr.extension)==null?void 0:ro.find(gn=>gn.url===i.Uf),ar=Er?.valueString,Tr=()=>{if(ar){const gn=(0,o.Ue)(Li||[],ar);gn!==-1&&So(gn)}},Pe=gn=>{const Kn=gn.find(sn=>sn.url.includes("description"));return Kn?.valueString||""},Ce=gn=>{const Kn=gn.find(Kr=>Kr.url.includes("distance-value")),sn=gn.find(Kr=>Kr.url.includes("distance-unit")),Ar=Kn?.valueString?Number(Kn.valueString):NaN,yr=sn?.valueString||"";if(!yr||isNaN(Ar))return null;const $r=Math.round(Ar);let a0=yr;return so[yr]&&(a0=Mo($r===1?so[yr].singular:so[yr].plural)),xo&&ki[xo]?Mo(Q0.LOCATION_DISTANCE,{distance:`${$r} ${a0}`,locationType:Mo(ki[xo])}):Mo(Q0.LOCATION_DISTANCE_AWAY,{distance:`${$r} ${a0}`})},We=gn=>({id:gn.id||"",providerName:gn.name||"",specialty:"",distance:Ce(gn.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:gn.address||"",valueReference:gn.valueReference||{reference:gn.id}}),gt=gn=>{var Kn,sn,Ar,yr;const $r=gn;return We({id:$r.id,name:(Kn=$r.name)!=null?Kn:"",address:(yr=(Ar=(sn=$r?.address)==null?void 0:sn.line)==null?void 0:Ar[0])!=null?yr:"",extension:$r?.extension,valueReference:{reference:$r.id}})},Xt=gn=>We({id:gn?.reference,name:gn?.display,address:Pe(gn?.extension||[]),extension:gn?.extension,valueReference:gn}),In=(()=>er&&Array.isArray(er)&&er.length>0?er.map(gt):Zr.initial&&Array.isArray(Zr.initial)&&Zr.initial.length>0?Zr.initial.map(gn=>Xt(gn.valueReference)):Zr.answerOption?Zr.answerOption.map(gn=>Xt(gn.valueReference)):[])(),lr=gn=>{Yr(Zr,[{valueReference:gn}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Zr.readOnly&&"pb-4xl"),children:Zr.readOnly?In.map(({address:gn,id:Kn,providerName:sn,placeholderIcon:Ar,distance:yr})=>(0,n.jsx)(it.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ar},locationName:sn,address:gn,distance:yr,actionButtonText:ar?"Change location":void 0,onActionButtonClick:ar?Tr:void 0},Kn)):In.map(({address:gn,id:Kn,providerName:sn,placeholderIcon:Ar,specialty:yr,valueReference:$r,distance:a0})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ar},providerName:{content:sn},specialty:{content:yr},location:{address:gn,distance:a0},actionButton:{children:"Schedule appointment",onClick:()=>{pa("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:gn,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),lr($r),No?.()}}},Kn))})};var To=e(79079),eo=e(32066),Io=e(43915),mo=e(36181),qo=e(37234),Uo=e(59931),qa=e(65388),Dr=Object.defineProperty,Jn=Object.defineProperties,Xr=Object.getOwnPropertyDescriptors,Lr=Object.getOwnPropertySymbols,U0=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,Vn=(er,Yr,Zr)=>Yr in er?Dr(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,Sr=(er,Yr)=>{for(var Zr in Yr||(Yr={}))U0.call(Yr,Zr)&&Vn(er,Zr,Yr[Zr]);if(Lr)for(var Zr of Lr(Yr))bn.call(Yr,Zr)&&Vn(er,Zr,Yr[Zr]);return er},c0=(er,Yr)=>Jn(er,Xr(Yr));const Qn="tz-code",Nr={"ui-toolkit/LocationCard":Ro,"ui-toolkit/TimeSlotSelection":({resourceData:er,item:Yr,handleInputChange:Zr,selectedAnswer:Li,questionnaireSchemaItems:ro,formData:Mo,onCompleteHandler:_o})=>{var xo,So;const{t:No}=(0,To.S)(),{trackEvent:uo}=(0,s.st)(),{isLoading:pa,setIsInlineNextQuestionTriggered:Er}=(0,p.c)(),ar=d0=>{const Z0=d0.match(/^(\d{4}-\d{2}-\d{2})/);return Z0?Z0[1]:d0},Tr=d0=>{const Z0=d0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Z0?`${Z0[1]} ${Z0[2]}`:d0},Pe=d0=>{const Z0=d0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Z0){const[,x0,Ao,Bi]=Z0;return new Date(parseInt(x0),parseInt(Ao)-1,parseInt(Bi))}return new Date},We=(()=>{var d0;if((d0=Li?.[0])!=null&&d0.valueReference){const Z0=Li[0].valueReference,x0=Z0.display||"",Ao=ar(x0);if(Ao)return{date:Pe(Ao),slotId:Z0.reference||""}}return{date:new Date,slotId:""}})(),[gt,Xt]=(0,t.useState)(We.date),[tn,In]=(0,t.useState)(We.slotId),[lr,gn]=(0,t.useState)(new Set),Kn=(0,t.useMemo)(()=>new f0.ng(gt.getFullYear(),gt.getMonth()+1,gt.getDate()),[gt]),sn=d0=>({display:d0.display||"",id:d0.id||"",start:d0.start||"",extension:Array.isArray(d0.extension)?d0.extension:[],identifier:Array.isArray(d0.identifier)?d0.identifier:[],type:d0.type||""}),Ar=d0=>sn({display:d0.start?Tr(d0.start):"",id:d0.id,start:d0.start,extension:d0.extension,identifier:d0.identifier}),yr=d0=>sn({display:d0?.display||"",id:d0?.reference,start:d0?.display,extension:d0?.extension,identifier:d0?.identifier,type:d0?.type}),$r=()=>{if(Array.isArray(er)&&er.length>0)return er.filter(d0=>d0.resourceType==="Appointment").map(Ar);if(Yr.initial&&Array.isArray(Yr.initial)&&Yr.initial.length>0)return Yr.initial.map(d0=>yr(d0.valueReference));if(Yr.answerOption)return Yr.answerOption.map(d0=>yr(d0.valueReference))},a0=(0,t.useMemo)(()=>$r()||[],[er,Li,Yr]),Kr=(0,t.useMemo)(()=>{const d0={};return a0.forEach(Z0=>{if(Z0.start&&Z0.id){const x0=ar(Z0.start);d0[x0]||(d0[x0]=[]),d0[x0].push({display:Z0.display,id:Z0.id,start:Z0.start,extension:Z0.extension})}}),d0},[a0]),K0=(0,t.useMemo)(()=>{const d0=Object.keys(Kr).sort(),Z0=[];if(d0.length===0)return Z0.push(Kn),lr.forEach(Bi=>{const Fo=(0,Io.A)(Bi);Z0.push(new f0.ng(Fo.getFullYear(),Fo.getMonth()+1,Fo.getDate()))}),Z0;const x0=(0,Io.A)(d0[d0.length-1]),Ao=new f0.ng(x0.getFullYear(),x0.getMonth()+1,x0.getDate());for(let Bi=Kn;Bi.compare(Ao)<=0;Bi=Bi.add({days:1})){const Fo=`${Bi.year}-${String(Bi.month).padStart(2,"0")}-${String(Bi.day).padStart(2,"0")}`;Kr[Fo]||Z0.push(Bi)}return lr.forEach(Bi=>{const Fo=(0,Io.A)(Bi),ko=new f0.ng(Fo.getFullYear(),Fo.getMonth()+1,Fo.getDate());Z0.some(Oa=>Oa.year===ko.year&&Oa.month===ko.month&&Oa.day===ko.day)||Z0.push(ko)}),Z0},[Kr,lr,Kn]),Ni=(0,t.useMemo)(()=>(0,o.mR)(Yr)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Yr]),dt=(0,t.useMemo)(()=>Object.keys(Kr).map(d0=>{const Z0=(0,Io.A)(d0);return new f0.ng(Z0.getFullYear(),Z0.getMonth()+1,Z0.getDate())}),[Kr]),_t=(0,mo.A)((0,qo.A)(gt),"yyyy-MM-dd"),En=(0,t.useMemo)(()=>Kr[_t]||[],[Kr,_t]);(0,t.useEffect)(()=>{const d0=Object.entries(Kr).sort(([Z0],[x0])=>Z0.localeCompare(x0)).slice(0,3).reduce((Z0,[x0,Ao])=>c0(Sr({},Z0),{[`${x0} ${p0}`]:Ao.map(Bi=>{var Fo;return(0,qa.YX)({time:Bi.start,timeZone:(0,o.lv)((Fo=En[0])==null?void 0:Fo.extension)}).time})}),{});uo("slots_returned",{Specialty:"Vaccines",first_three_days_slots:d0,_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 xn=t.useRef(null),tr=t.useRef(null),Vr=t.useRef(!1);(0,t.useEffect)(()=>{var d0;const Z0=Object.keys(Kr).sort();Z0.length===0||Vr.current||(Vr.current=!0,(d0=Li?.[0])!=null&&d0.valueReference||Xt((0,Io.A)(Z0[0])))},[Kr]),(0,t.useEffect)(()=>{var d0;const Z0=Object.keys(Kr).sort();if(Z0.length===0)return;const Ao=!(xn.current===null)&&JSON.stringify(xn.current)!==JSON.stringify(Kr);if(xn.current=Kr,!!Ao&&(gn(new Set),tr.current)){const Bi=tr.current;if(!(((d0=Kr[Bi])==null?void 0:d0.length)>0)){const ko=new Set,Oa=(0,Io.A)(Bi),Sa=(0,Io.A)(Z0[0]);let Ls=Oa;for(;Ls<Sa;){const Bs=(0,mo.A)(Ls,"yyyy-MM-dd");ko.add(Bs),Ls=new Date(Ls),Ls.setDate(Ls.getDate()+1)}gn(ko),In("")}tr.current=null}},[Kr]);const p0=(0,t.useMemo)(()=>{var d0;const Z0=En[0];if(!Z0?.extension)return"";const x0=Z0.extension.find(Ao=>Ao?.url===Qn);try{return(0,Uo.formatToTimeZone)(new Date,"(z)",{timeZone:(d0=x0?.valueCode)!=null?d0:""})}catch{return""}},[En]),ui=(0,t.useMemo)(()=>{const d0=No(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return p0?`${d0} ${p0}`:d0},[No,p0]),g0=(0,t.useMemo)(()=>{const d0=(0,eo.Ec)((0,eo.Xj)()).add({days:Ni}),Z0=`${d0.year}-${String(d0.month).padStart(2,"0")}-${String(d0.day).padStart(2,"0")}`,Ao=Object.keys(Kr).sort().find(Bi=>Bi>_t&&Bi<=Z0);if(Ao){const Bi=(0,Io.A)(Ao);return new f0.ng(Bi.getFullYear(),Bi.getMonth()+1,Bi.getDate())}return null},[Kr,_t,Ni]),wi=()=>{if(g0){const d0=g0.toDate((0,eo.Xj)());Xt(d0),In("")}},k0=d0=>{if(!d0){In(""),Zr(Yr,void 0);return}In(d0.id);const Z0=[{valueReference:{display:d0.display,reference:d0.id,extension:d0.extension,identifier:d0.identifier,type:d0.type}}];Zr(Yr,Z0)},Ci=d0=>{var Z0;if(!d0||pa||!Vr.current)return;const x0=Object.keys(Kr).sort(),Ao=x0[x0.length-1],Bi=x0[0],Fo=`${d0.year}-${String(d0.month).padStart(2,"0")}-${String(d0.day).padStart(2,"0")}`;if(Ao&&(Fo>Ao||Bi&&Fo<Bi)&&(0,o.mR)(Yr)&&ro&&!K0?.some(Oa=>Oa.compare(d0)===0)){const Oa=(0,o.yQ)(Yr,ro);if(Oa){tr.current=Fo;let Sa="-06:00";if((Z0=a0[0])!=null&&Z0.start){const f1=a0[0].start.match(/([+-]\d{2}:\d{2})$/);f1&&(Sa=f1[1])}const Bs=[{valueDateTime:`${Fo}T23:59:59${Sa}`}],Zo=Zr(Oa,Bs);Zr(Yr,void 0,(0,o.Nw)(Zo||Mo||[],Yr.linkId),void 0,!0),Er(!0),_o(Oa.linkId,!0,!0)}}const ko=d0.toDate((0,eo.Xj)());Xt(ko),In("")},G0=d0=>{if(!d0)return;const Z0=En.find(x0=>x0.id===d0);uo("slot_selected",{Specialty:"Vaccines",time_slot:Z0?(0,qa.YX)({time:Z0.start,timeZone:(0,o.lv)(En[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."}}),k0(Z0??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Ci,disabledDates:K0,highlightedDates:dt,loading:pa,minValue:(0,eo.Ec)((0,eo.Xj)()),maxValue:(0,eo.Ec)((0,eo.Xj)()).add({days:Ni}),value:Kn,defaultValue:Kn,appointmentSlots:{title:ui,onChange:G0,defaultValue:Li&&((So=(xo=Li[0])==null?void 0:xo.valueReference)==null?void 0:So.reference)||void 0,value:tn||void 0,items:En.map(d0=>({label:Se(d0.start),value:d0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[No(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),g0&&(0,n.jsx)("button",{onClick:wi,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:No(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var ri=Object.defineProperty,qi=Object.defineProperties,ea=Object.getOwnPropertyDescriptors,Wo=Object.getOwnPropertySymbols,la=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable,S0=(er,Yr,Zr)=>Yr in er?ri(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,ja=(er,Yr)=>{for(var Zr in Yr||(Yr={}))la.call(Yr,Zr)&&S0(er,Zr,Yr[Zr]);if(Wo)for(var Zr of Wo(Yr))Oi.call(Yr,Zr)&&S0(er,Zr,Yr[Zr]);return er},cs=(er,Yr)=>qi(er,ea(Yr)),ys=(er,Yr)=>{var Zr={};for(var Li in er)la.call(er,Li)&&Yr.indexOf(Li)<0&&(Zr[Li]=er[Li]);if(er!=null&&Wo)for(var Li of Wo(er))Yr.indexOf(Li)<0&&Oi.call(er,Li)&&(Zr[Li]=er[Li]);return Zr};const gs=(er,Yr)=>er.answerOption?er.answerOption.map(Zr=>{var Li,ro;const Mo=(ro=(Li=Zr.valueReference)==null?void 0:Li.reference)==null?void 0:ro.replace("#","");return Yr.find(_o=>_o.id===Mo)}).filter(Boolean):[],ss=er=>{var Yr,Zr,Li;const ro=er.find(Mo=>{var _o,xo;return Mo.url.includes("questionnaire-itemControl")&&((xo=(_o=Mo.valueCodeableConcept)==null?void 0:_o.coding)==null?void 0:xo.some(So=>{var No;return(No=So.code)==null?void 0:No.startsWith("ui-toolkit/")}))});return(Li=(Zr=(Yr=ro?.valueCodeableConcept)==null?void 0:Yr.coding)==null?void 0:Zr.find(Mo=>{var _o;return(_o=Mo.code)==null?void 0:_o.startsWith("ui-toolkit/")}))==null?void 0:Li.code},d1=er=>{var{uiToolkitCode:Yr,props:Zr}=er,Li=Zr,{item:ro,contained:Mo=[],customErrorConfigurations:_o}=Li,xo=ys(Li,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:So}=(0,p.c)(),No=Nr[Yr];if(!No)return(0,n.jsx)(n.Fragment,{});const uo=gs(ro,Mo),pa=uo.length>0;return!(ro.answerOption&&ro.answerOption.length>0)&&!pa&&!ro.readOnly?(So(!0),(0,n.jsx)(Ie,{configKey:Yr,customErrorConfigurations:_o})):(0,n.jsx)(No,cs(ja({},xo),{item:ro,contained:Mo,customErrorConfigurations:_o,resourceData:uo,"data-testid":ro.linkId}))},O0={attachment:en,choice:Wr,boolean:nn,integer:mr,string:({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:pa,required:Er,prefix:ar,readOnly:Tr}=er,Pe=pa?(0,o.nt)(ro,ar,pa):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Er||!1}),(0,n.jsx)(r.Input,{isRequired:Er,size:"md","aria-label":uo,"data-testid":uo,id:uo,type:We==="tel"?"tel":"text",placeholder:xo,value:((No=Zr?.[0])==null?void 0:No.valueString)||"",onChange:gt=>{Li(er,[{valueString:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const Xt=gt.target.value,tn=Xt.trim();tn!==Xt&&Li(er,[{valueString:tn}]),Yr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},url:({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:pa,required:Er,prefix:ar,readOnly:Tr}=er,Pe=pa?(0,o.nt)(ro,ar,pa):"",Ce=Mo?.[uo]||"",We=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Pe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Pe,required:Er||!1}),(0,n.jsx)(r.Input,{isRequired:Er,size:"md",type:"url",id:uo,"data-testid":uo,"aria-label":uo,placeholder:xo,value:((No=Zr?.[0])==null?void 0:No.valueUri)||"",onChange:gt=>{Li(er,[{valueUri:gt}])},isDisabled:Tr||_o,onBlur:gt=>{const Xt=gt.target.value,tn=Xt.trim();tn!==Xt&&Li(er,[{valueUri:tn}]),Yr(er.linkId)},hint:Ce||So,isInvalid:!!Ce,autoComplete:We},uo)]})},text:({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o,placeholder:xo,hintText:So})=>{var No;const{linkId:uo,text:pa,required:Er,prefix:ar,readOnly:Tr,maxLength:Pe}=er,Ce=pa?(0,o.nt)(ro,ar,pa):"",We=Mo?.[uo]||"",gt=(0,o.a0)(er);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Er||!1}),(0,n.jsx)(r.TextArea,{isRequired:Er,id:uo,"aria-label":uo,"data-testid":uo,rows:3,placeholder:xo,value:((No=Zr?.[0])==null?void 0:No.valueString)||"",onChange:Xt=>{Li(er,[{valueString:Xt}])},isDisabled:Tr||_o,onBlur:Xt=>{const tn=Xt.target.value,In=tn.trim();In!==tn&&Li(er,[{valueString:In}]),Yr(er.linkId)},hint:We||So,counter:!0,isInvalid:!!We,maxLength:Pe,autoComplete:gt},uo)]})},date:si,time:({item:er,onCompleteHandler:Yr,selectedAnswer:Zr,handleInputChange:Li,showQuestionPrefix:ro,errors:Mo,isLoading:_o})=>{var xo;const{linkId:So,text:No,required:uo,prefix:pa,readOnly:Er}=er,ar=No?(0,o.nt)(ro,pa,No):"",Tr=Mo?.[So]||"";return(0,n.jsxs)("div",{children:[ar&&(0,n.jsx)(N,{isLabel:!0,text:ar,required:uo||!1}),(0,n.jsx)(r.Input,{isRequired:uo,size:"md",type:"time",id:So,"data-testid":So,"aria-label":So,placeholder:"Type your response here...",value:((xo=Zr?.[0])==null?void 0:xo.valueTime)||"",onChange:Pe=>{Li(er,[{valueTime:Pe}])},isDisabled:Er||_o,onBlur:()=>{Yr(er.linkId)},hint:Tr,isInvalid:!!Tr},So)]})},dateTime:X0,quantity:vr,decimal:Si,question:pr,display:pr,group:pr,reference:er=>{var Yr,Zr,Li,ro,Mo;const{setHideFooterButton:_o}=(0,p.c)(),{item:xo,customErrorConfigurations:So}=er,No=xo.extension||[],uo=ss(No);return uo?(0,n.jsx)(d1,{uiToolkitCode:uo,props:er}):((Mo=(ro=(Li=(Zr=(Yr=xo?.extension)==null?void 0:Yr.find(Er=>Er.url.includes("questionnaire-itemControl")))==null?void 0:Zr.valueCodeableConcept)==null?void 0:Li.coding)==null?void 0:ro[0])==null?void 0:Mo.code)==="check-box"?xo.answerOption&&xo.answerOption.length>0?(0,n.jsx)(Wr,cs(ja({},er),{item:xo})):(_o(!0),(0,n.jsx)(Ie,{configKey:xo.linkId,customErrorConfigurations:So})):null}};var F0=(er,Yr,Zr)=>new Promise((Li,ro)=>{var Mo=So=>{try{xo(Zr.next(So))}catch(No){ro(No)}},_o=So=>{try{xo(Zr.throw(So))}catch(No){ro(No)}},xo=So=>So.done?Li(So.value):Promise.resolve(So.value).then(Mo,_o);xo((Zr=Zr.apply(er,Yr)).next())});const Wt=({item:er,selectedAnswer:Yr,showQuestionPrefix:Zr})=>{const{text:Li,prefix:ro,required:Mo}=er,_o=Li?getUpdatedQuestionText(Zr,ro,Li):"",[xo,So]=useState(null),[No,uo]=useState(!1),{documentDownload:pa,webview:Er}=useNativeBridge(),ar=(Yr||[]).filter(We=>{var gt,Xt;return((gt=We.valueAttachment)==null?void 0:gt.data)&&((Xt=We.valueAttachment)==null?void 0:Xt.title)}).map((We,gt)=>{var Xt,tn,In,lr,gn,Kn,sn;return{id:((Xt=We.valueAttachment)==null?void 0:Xt.id)||`preview-${gt}`,fileName:((tn=We.valueAttachment)==null?void 0:tn.title)||`attachment-${gt}`,contentType:((In=We.valueAttachment)==null?void 0:In.contentType)||"application/octet-stream",base64Data:((lr=We.valueAttachment)==null?void 0:lr.data)||"",size:getBase64Size(((gn=We.valueAttachment)==null?void 0:gn.data)||"",(Kn=We.valueAttachment)==null?void 0:Kn.contentType),type:getFileTypeFromMimeType((sn=We.valueAttachment)==null?void 0:sn.contentType)}}),Tr=useCallback(We=>{const{fileName:gt,contentType:Xt,base64Data:tn}=We;if(Er.isWithin)So({fileName:gt,contentType:Xt,base64Data:tn}),uo(!0);else{const In=base64toObjectUrl(tn,Xt),lr=document.createElement("a");lr.href=In,lr.download=gt,document.body.appendChild(lr),lr.click(),document.body.removeChild(lr),URL.revokeObjectURL(In)}},[Er.isWithin]),Pe=useCallback(()=>F0(void 0,null,function*(){!xo||(yield pa.writeFile(xo.fileName,prepareDataUrl(xo.base64Data,xo.contentType)))}),[xo,pa]),Ce=useCallback(()=>{uo(!1),So(null)},[]);return ar.length?jsxs("div",{children:[_o&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:_o,required:Mo||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:ar.map(We=>jsx("button",{type:"button",onClick:()=>Tr(We),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(We.fileName),size:We.size,type:We.type})},We.id))}),jsx(DownloadDisclosureModal,{opened:No,onClose:Ce,onDownload:Pe,contentType:xo?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Ke=Object.defineProperty,ut=Object.defineProperties,It=Object.getOwnPropertyDescriptors,wn=Object.getOwnPropertySymbols,or=Object.prototype.hasOwnProperty,xr=Object.prototype.propertyIsEnumerable,z0=(er,Yr,Zr)=>Yr in er?Ke(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,V0=(er,Yr)=>{for(var Zr in Yr||(Yr={}))or.call(Yr,Zr)&&z0(er,Zr,Yr[Zr]);if(wn)for(var Zr of wn(Yr))xr.call(Yr,Zr)&&z0(er,Zr,Yr[Zr]);return er},j0=(er,Yr)=>ut(er,It(Yr));const to=(er,Yr,Zr,Li)=>{var ro;const Mo=er.extension||[];if(Li?.[BUTTON_TYPE_EXTERNAL_KEY]&&Mo.some(uo=>uo.url===BUTTON_TYPE_EXTENSION_URL))return Li[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(er)||hasParentWithUIToolkitWidget(er,Yr))return null;if(Zr&&er.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const _o=getUIToolkitCode(Mo),xo=Mo.filter(uo=>uo.url.includes("questionnaire-itemControl")).flatMap(uo=>{var pa,Er;return(Er=(pa=uo.valueCodeableConcept)==null?void 0:pa.coding)!=null?Er:[]})||[];let So;return Li&&(So=(ro=xo.find(uo=>uo.code&&Li[uo.code]))==null?void 0:ro.code),(So&&Li?Li[So]:void 0)||UI_TOOLKIT_WIDGET_MAP[_o||""]||typeToRenderFunctionMap[er.type]||null},Zi=er=>{var Yr;const{item:Zr,selectedAnswer:Li,handleInputChange:ro,showQuestionPrefix:Mo,errors:_o,questionnaireSchemaItems:xo,formData:So,isNestedRepeatedItem:No=!1}=er,{linkId:uo,text:pa,prefix:Er,required:ar,repeats:Tr}=Zr,Pe=getMaxOccursFromExtensions(Zr.extension),Ce=getPlaceholderFromExtensions(Zr.extension,Zr.type),[We,gt]=useState(()=>{if(Zr.type==="group"&&Zr.item&&Zr.item.length>0){const a0=So?.filter(Kr=>Kr.linkId===Zr.linkId)||[];if(a0.length>0)return a0.map((Kr,K0)=>K0)}else if(Li&&Li.length>0)return Li.map((a0,Kr)=>Kr);return[0]}),Xt=Pe!==void 0&&We.length>=Pe,tn=pa?getUpdatedQuestionText(Mo,Er,pa):"",In=()=>{const a0=Math.max(...We,-1)+1,Kr=[...We,a0];if(gt(Kr),Zr.type==="group"&&Zr.item&&Zr.item.length>0){const K0=Zr.item.map(dt=>({linkId:dt.linkId,text:dt.text,answer:[{}]})),Ni={linkId:Zr.linkId,text:Zr.text,answer:[{}],item:K0};ro(Zr,void 0,[Ni])}else{const K0=[...Li||[]];K0.push({}),ro(Zr,K0)}},lr=a0=>{if(We.length<=1)return;const Kr=We.filter((K0,Ni)=>Ni!==We.length-1);if(gt(Kr),Zr.type==="group"&&Zr.item&&Zr.item.length>0){const K0=[];if(So?.forEach((Ni,dt)=>{Ni.linkId===uo&&K0.push({item:Ni,originalIndex:dt})}),a0>=0&&a0<K0.length){const Ni=K0[a0],dt=So?.filter((_t,En)=>En!==Ni.originalIndex);ro(Zr,void 0,dt,void 0,!0)}}else{const K0=Li?.filter((Ni,dt)=>dt!==a0)||[];ro(Zr,K0.length>0?K0:[{}])}},gn=a0=>{if(!So||!Zr.item)return[];const Kr=dt=>{const _t=[];for(const En of dt)if(En.linkId===Zr.linkId&&_t.push(En),En.item&&En.item.length>0){const xn=Kr(En.item);_t.push(...xn)}return _t},Ni=Kr(So)[a0];return Ni?.item?Ni.item:[]},Kn=(a0,Kr)=>{if(isHiddenExtensionPresent(a0))return null;const K0=gn(Kr);if(!isQuestionEnabledForInstance(a0.enableWhen,a0.enableBehavior,So||[],Zr.linkId,Kr))return null;if(a0.repeats){const xn=findNestedAnswer(K0,a0.linkId),tr=j0(V0({},er),{item:a0,selectedAnswer:xn||[{}],errors:getInstanceErrors(_o,Zr,Kr),handleInputChange:(Vr,p0,ui)=>ro(Vr,p0,ui,Kr)});return jsx("div",{children:jsx(Zi,j0(V0({},tr),{isNestedRepeatedItem:!0}))},a0.linkId)}if(a0.type==="group"&&a0.item&&!getUIToolkitCode(a0?.extension||[]))return jsxs("div",{children:[a0.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:a0.text}),jsx("div",{className:"space-y-3",children:a0.item.map(xn=>{if(!isQuestionEnabledForInstance(xn.enableWhen,xn.enableBehavior,So||[],Zr.linkId,Kr))return null;const Vr=to(xn,xo,er.isLoading,er.externalComponentRenderMap);if(!Vr)return null;const p0=findNestedAnswer(K0,xn.linkId),ui=j0(V0({},er),{item:xn,selectedAnswer:p0,placeholder:getPlaceholderFromExtensions(xn.extension,xn.type),errors:getInstanceErrors(_o,Zr,Kr),handleInputChange:(g0,wi,k0)=>ro(g0,wi,k0,Kr)});return createElement(Vr,j0(V0({},ui),{key:xn.linkId}))})})]},a0.linkId);const dt=to(a0,xo,er.isLoading,er.externalComponentRenderMap);if(!dt)return null;const _t=findNestedAnswer(K0,a0.linkId),En=j0(V0({},er),{item:a0,selectedAnswer:_t,placeholder:getPlaceholderFromExtensions(a0.extension,a0.type),errors:getInstanceErrors(_o,Zr,Kr),handleInputChange:(xn,tr,Vr)=>ro(xn,tr,Vr,Kr)});return createElement(dt,j0(V0({},En),{key:`${a0.linkId}-${Kr}`}))},sn=()=>{const a0=getDirectErrors(_o,uo);return jsxs("div",{className:"flex flex-col gap-2",children:[a0[uo]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:a0[uo]}),!Xt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:In,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Ar=a0=>We.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>lr(a0),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${a0+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:er.isLoading}),yr=to(Zr,xo,er.isLoading,er.externalComponentRenderMap);return hasRepeatingParent(Zr,xo)&&!No?null:!Tr||Tr&&hasCheckboxExtension(Zr)?yr?jsx(yr,j0(V0({},er),{placeholder:Ce,errors:{[Zr.linkId]:((Yr=_o?.[Zr.linkId])==null?void 0:Yr[0])||""}})):null:Zr.type==="group"&&Zr.item&&Zr.item.length>0&&Zr.repeats?jsxs("div",{"data-testid":`${uo}-repeating`,children:[tn&&jsx(FHIRQuestionnaireQuestionText,{text:tn,required:ar||!1}),We.map(a0=>{var Kr;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${a0>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",a0+1]}),Ar(a0)]}),jsx("div",{className:"space-y-4",children:(Kr=Zr.item)==null?void 0:Kr.map(K0=>Kn(K0,a0))})]},`${uo}-instance-${a0}`)}),sn()]}):yr?jsxs("div",{"data-testid":`${uo}-repeating`,children:[We.map(a0=>{const Kr=Li?.[a0]?[Li[a0]]:void 0,K0=j0(V0({},er),{item:Zr,selectedAnswer:Kr,errors:getInstanceErrors(_o,Zr,a0),handleInputChange:(Ni,dt,_t)=>ro(Ni,dt,_t,a0)});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 ",a0+1]}),Ar(a0)]}),jsx(yr,V0({},K0))]},`${uo}-instance-${a0}`)}),jsxs("div",{children:[(()=>{const Kr=getDirectErrors(_o,uo)[uo];return Kr&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:Kr})})(),!Xt&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:In,className:"mt-4 text-center",isDisabled:er.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var lo=Object.defineProperty,Lo=Object.defineProperties,va=Object.getOwnPropertyDescriptors,Qo=Object.getOwnPropertySymbols,Aa=Object.prototype.hasOwnProperty,Qa=Object.prototype.propertyIsEnumerable,Is=(er,Yr,Zr)=>Yr in er?lo(er,Yr,{enumerable:!0,configurable:!0,writable:!0,value:Zr}):er[Yr]=Zr,Ea=(er,Yr)=>{for(var Zr in Yr||(Yr={}))Aa.call(Yr,Zr)&&Is(er,Zr,Yr[Zr]);if(Qo)for(var Zr of Qo(Yr))Qa.call(Yr,Zr)&&Is(er,Zr,Yr[Zr]);return er},vs=(er,Yr)=>Lo(er,va(Yr));const Vs=null,ts=({formId:er,questionnaireSchema:Yr,questionnaireResponseItem:Zr,errorConfig:Li,customErrorConfigurations:ro,showQuestionPrefix:Mo=!0,isAdaptiveFlow:_o=!1,status:xo,hideBackButton:So=!1,showStepper:No=!1,onComplete:uo,onClearError:pa,handleHiddenQuestion:Er,onGoBack:ar,onFormDataChange:Tr=()=>{},externalComponentRenderMap:Pe,children:Ce})=>{var We,gt;const{setHandleContinueButtonClick:Xt,setHandleBackButtonClick:tn,setIsCurrentFormValid:In,setCurrentGroupLinkId:lr,setCurrentGroupIndex:gn,setTotalSteps:Kn,setHideFooterButton:sn,setIsInlineNextQuestionTriggered:Ar,isCurrentFormValid:yr,currentGroupIndex:$r,isLoading:a0,hasCustomError:Kr,groupItemIndicesRef:K0}=useFHIRQuestionnaire(),{trackEvent:Ni}=useAnalytics(),[dt,_t]=useState([]),[En,xn]=useState(new Set),[tr,Vr]=useState([]),[p0,ui]=useState([]),g0=K0,wi=useRef(new Map),k0=useRef(new Set),[Ci,G0]=useState({}),[d0,Z0]=useState(!1),[x0,Ao]=useState(Yr),Bi=useRef(Zr||[]),Fo=useRef(!1),ko=useRef(!1),Oa=useMemo(()=>getTotalStepsFromQuestionnaire(Yr),[Yr]),[Sa,Ls]=useState(!1),Bs=useRef([]),Zo=(ji,Vi)=>{var Vo,_i,ta,Ia,Fa;if(isCallNextQuestionExtensionPresent(ji))return ji.linkId;const Rr=validateCurrentPage(Vi,dt,$r,x0,g0),Zn=g0.current[$r],n0=$r+1,b1=g0.current[n0],_l=$r===0?0:Zn,dl=(_i=b1??((Vo=x0?.item)==null?void 0:Vo.length))!=null?_i:0;let ru=-1;for(let pi=_l;pi<dl;pi++){const Hn=(ta=x0?.item)==null?void 0:ta[pi];if(Hn?.linkId===ji.linkId){ru=pi;break}}const Dl=(pi,Hn=[])=>(pi.forEach(go=>{var jo;if((!go.enableWhen||isQuestionEnabled(go.enableWhen,go.enableBehavior,Vi))&&isCallNextQuestionExtensionPresent(go)&&!Bs.current.includes(go.linkId))if(go.required){const La=(jo=findResponseItem(Vi,go.linkId))==null?void 0:jo.answer;(La&&La.length>0&&Object.keys(La[0]).length>0||go.initial&&go.initial.length>0&&!En.has(go.linkId))&&Hn.push(go.linkId)}else Hn.push(go.linkId);go.item&&go.item.length>0&&Dl(go.item,Hn)}),Hn),cu=[],au=ru!==-1?ru+1:dl;for(let pi=_l;pi<au;pi++){const Hn=(Ia=x0?.item)==null?void 0:Ia[pi];Hn&&Dl([Hn],cu)}if(cu.length>0&&Rr){const pi=cu[cu.length-1],Hn=La=>La.flatMap(m1=>[m1,...m1.item?Hn(m1.item):[]]),go=Hn((Fa=x0?.item)!=null?Fa:[]),jo=go.findIndex(La=>La.linkId===pi),Ya=go.findIndex(La=>La.linkId===ji.linkId);return jo!==-1&&Ya>jo?void 0:pi}},f1=ji=>Zo(ji,Bi.current)?!0:ji.item&&ji.item.length>0?ji.item.some(f1):!1,Ys=()=>{var ji;if(!_o||$r<0||!x0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const Vi=g0.current[$r],_i=(wi.current.get(Vi)||[Vi]).some(Fa=>{var Rr;const Zn=(Rr=x0.item)==null?void 0:Rr[Fa];return Zn?f1(Zn):!1}),ta=$r<g0.current.length-1;let Ia=!1;if(_i&&ta){const Fa=$r+1,Rr=g0.current[Fa],Zn=(ji=x0?.item)==null?void 0:ji[Rr],n0=!Zn?.enableWhen||isQuestionEnabled(Zn.enableWhen,Zn.enableBehavior,Bi.current),b1=Zn?isPageExtensionPresent(Zn):!1;Ia=n0&&b1}return{shouldTriggerInlineLoading:_i,canNavigateToNextGroup:Ia,hasMoreGroups:ta}},ms=(ji,Vi,Vo,_i)=>{const ta=getUpdatedFormData(x0?.item||[],Bi.current,ji,Vi,Vo,_i);return Bi.current=ta,Tr(ta),ta},F1=(ji,Vi,Vo,_i,ta)=>{ms(Vi,Vo,_i,ta),_i.forEach(Ia=>{const Fa=getValidationError(vs(Ea({},ji),{linkId:Ia.linkId}),Bi.current,Ia.answer);Fa&&G0(Rr=>vs(Ea({},Rr),{[Ia.linkId]:typeof ta=="number"?vs(Ea({},Rr[Ia.linkId]),{[ta]:Fa}):Fa}))})},Or=(ji,Vi,Vo,_i,ta)=>{var Ia;const Fa=ms(Vi,Vo,_i,ta),Rr=(Ia=findResponseItem(Fa,Vi))==null?void 0:Ia.answer,Zn=getValidationError(ji,Bi.current,Rr);G0(n0=>vs(Ea({},n0),{[Vi]:typeof ta=="number"?vs(Ea({},n0[Vi]),{[ta]:Zn}):Zn}))},Yn=(ji,Vi)=>{const Vo=validateCurrentPage(Vi,dt,$r,x0,g0);if(In(Vo),x0?.item){const _i=validateAllItemsRecursively(x0.item,Vi);if(Object.keys(_i).length>0)G0(ta=>Ea(Ea({},ta),_i));else{const ta=x0.item,Ia={},Fa=Rr=>{Rr.forEach(Zn=>{Ia[Zn.linkId]={},Zn.item&&Fa(Zn.item)})};Fa(ta),G0(Rr=>Ea(Ea({},Rr),Ia))}}},Pr=(ji,Vi,Vo,_i,ta=!1)=>{var Ia;const{linkId:Fa}=ji;if(ta)return Bi.current=Vo||[],Yn(Fa,Vo||[]),Bi.current;if(Vo&&Vo.length>0&&ji.type==="group"&&ji.repeats){let b1=Bi.current.length;for(let dl=Bi.current.length-1;dl>=0;dl--)if(Bi.current[dl].linkId===Fa){b1=dl+1;break}const _l=[...Bi.current.slice(0,b1),...Vo,...Bi.current.slice(b1)];return Bi.current=_l,Yn(Fa,_l),Bi.current}if(typeof _i=="number"&&Vi){const b1=hasRepeatingParent(ji,x0?.item||[]);if(b1){const _l=Bi.current.filter(ru=>ru.linkId===b1.linkId);if(_i<_l.length){const ru=Bi.current.map(Dl=>{if(Dl.linkId===b1.linkId&&Bi.current.slice(0,Bi.current.indexOf(Dl)).filter(au=>au.linkId===b1.linkId).length===_i){const au=(go,jo)=>{const Ya=new Map(go.map(m1=>[m1.linkId,m1])),La=[];return jo?.forEach(m1=>{const sl=Ya.get(m1.linkId);if(m1.linkId===Fa)La.push(Ea({linkId:m1.linkId,text:m1.text,answer:Vi},sl?.item&&{item:sl.item}));else if(sl)if(m1.item&&m1.item.length>0){const Il=au(sl.item||[],m1.item);La.push(vs(Ea({},sl),{item:Il}))}else La.push(sl);else if(m1.item&&m1.item.length>0){const Il=au([],m1.item);Il.some(S1=>S1.linkId===Fa||S1.item&&pi(S1.item,Fa))&&La.push({linkId:m1.linkId,text:m1.text,answer:[{}],item:Il})}Ya.delete(m1.linkId)}),Ya.forEach(m1=>{La.push(m1)}),La},pi=(go,jo)=>go.some(Ya=>Ya.linkId===jo||Ya.item&&pi(Ya.item,jo)),Hn=au(Dl.item||[],b1.item);return vs(Ea({},Dl),{item:Hn})}return Dl});Bi.current=ru,Tr(ru)}else{const ru=_i+1,Dl=_l.length;if(Dl<ru||ru===1){const cu=[],au=(go,jo,Ya)=>go.map(La=>{const m1={linkId:La.linkId,text:La.text,answer:La.linkId===jo?Ya:[{}]};return La.item&&La.item.length>0&&(m1.item=au(La.item,jo,Ya)),m1});for(let go=Dl;go<ru;go++){const jo=b1.item?au(b1.item,Fa,Vi):[],Ya={linkId:b1.linkId,text:b1.text,answer:[{}],item:jo};cu.push(Ya)}let pi=Bi.current.length;for(let go=Bi.current.length-1;go>=0;go--)if(Bi.current[go].linkId===b1.linkId){pi=go+1;break}const Hn=[...Bi.current.slice(0,pi),...cu,...Bi.current.slice(pi)];Bi.current=Hn,Tr(Hn)}}const dl=getValidationError(ji,Bi.current,Vi);return G0(ru=>vs(Ea({},ru),{[Fa]:typeof _i=="number"?vs(Ea({},ru[Fa]),{[_i]:dl}):dl})),Yn(Fa,Bi.current),Bi.current}}if(typeof _i=="number")return Vo&&Vo.length>0?F1(ji,Fa,Vi,Vo,_i):Or(ji,Fa,Vi,Vo,_i),Bi.current;const Rr=ms(Fa,Vi,Vo),Zn=(Ia=findResponseItem(Rr,Fa))==null?void 0:Ia.answer,n0=getValidationError(ji,Rr,Zn);return G0(b1=>vs(Ea({},b1),{[Fa]:typeof _i=="number"?vs(Ea({},b1[Fa]),{[_i]:n0}):n0})),Yn(Fa,Rr),Bi.current},sr=()=>{var ji;for(let Vi=$r+1;Vi<g0.current.length;Vi++){const Vo=g0.current[Vi],_i=(ji=x0?.item)==null?void 0:ji[Vo];if(!!_i&&(!_i.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bi.current)))return!0}return!1},Fr=()=>{var ji,Vi,Vo,_i,ta;const Ia=(ji=Yr?.item)==null?void 0:ji[g0.current[$r]];if(Ia){const Zn=(Vi=getAnalyticsEventName(Ia))!=null?Vi:"questionnaire_form",n0=getAnalyticsPageName(Ia);if(n0){const b1=(Vo=getAnalyticsFormName(Yr))!=null?Vo:Yr.name,_l=collectAnalyticsProperties(Ia,Bi.current),dl={};b1&&(dl.form_name=b1),dl.page_name=n0,Object.assign(dl,_l),Ni(Zn,dl)}}const Fa=$r<g0.current.length-1,Rr=checkCurrentStepDataMatch(Bi.current,x0,g0.current,$r,Zr,g0.current.length-1);if(_o&&Fa){const Zn=$r+1,n0=g0.current[Zn],b1=(_i=x0?.item)==null?void 0:_i[n0],_l=!b1?.enableWhen||isQuestionEnabled(b1.enableWhen,b1.enableBehavior,Bi.current),dl=b1?isPageExtensionPresent(b1):!1;if(_l&&dl&&Rr){gn(Zn),In(!1),window.scrollTo(0,0);return}}if(Rr&&g0.current.length>0){sr()?gn($r+1):(uo(removeDisabledItems(Bi.current,x0?.item||[])),In(!1),window.scrollTo(0,0));return}if($r<g0.current.length-1){const Zn=(ta=x0?.item)==null?void 0:ta[g0.current[$r]];if(!Zn){uo(removeDisabledItems(Bi.current,x0?.item||[]));return}const n0=Zn.linkId,b1=findLastGroupInstanceIndex(Bi.current,n0),_l=Bi.current.slice(0,b1+1);if(!validateCurrentPage(_l,dt,$r,x0,g0))return;_o?(Bi.current=_l,Tr(_l),uo(Bi.current),In(!1)):g0.current.length>0&&(sr()?gn($r+1):(uo(removeDisabledItems(Bi.current,x0?.item||[])),window.scrollTo(0,0)))}else uo(removeDisabledItems(Bi.current,x0?.item||[])),In(!1),window.scrollTo(0,0)};useEffect(()=>{var ji;Xt(()=>Fr),tn(()=>io),In(yr);const Vi=(ji=x0?.item)==null?void 0:ji[g0.current[$r]];Vi&&lr(Vi.linkId)},[yr,$r]),useEffect(()=>{if(!Yr?.item)return;const{groupIndices:ji,itemsToRenderMap:Vi}=collectGroupItemIndices(Yr.item);g0.current=ji,wi.current=Vi;const Vo=Oa??ji.length;Kn(Vo),Vr(ji),_o?(ko.current||gn(ji.length>0?ji.length-1:0),Ar(!1),ko.current=!1):$r===-1&&gn(0)},[Yr?.item,Oa]),useEffect(()=>{if($r<0||!x0?.item)return;const ji=validateCurrentPage(Bi.current,dt,$r,x0,g0);if(!ji){In(!1);return}const{shouldTriggerInlineLoading:Vi,canNavigateToNextGroup:Vo,hasMoreGroups:_i}=Ys();if(_o&&Vi){if(!_i){In(!1);return}if(Vo&&ji){In(!0);return}else{In(!1);return}}In(ji)},[$r,x0?.item,Kr,_o,Bi.current,dt]),useEffect(()=>{if(!Yr?.item||Fo.current)return;const ji=initializeQuestionnaireItems(Yr.item,Bi.current,Yr.item,Bi.current);if(ji!==Bi.current){Bi.current=ji;const Vo=(ta=>{const Ia=new Set,Fa=Rr=>{Rr.forEach(Zn=>{var n0;const b1=Zn.initial&&Zn.initial.length>0,_l=(Zn.type==="choice"||Zn.type==="open-choice")&&((n0=Zn.answerOption)==null?void 0:n0.some(dl=>dl.initialSelected===!0));(b1||_l)&&(!Zn.enableWhen||isQuestionEnabled(Zn.enableWhen,Zn.enableBehavior,Bi.current))&&Ia.add(Zn.linkId),Zn.item&&Fa(Zn.item)})};return Fa(ta),Ia})(x0?.item||[]);xn(Vo);const _i=validateAllItemsRecursively(x0?.item||[],Bi.current);Object.keys(_i).length>0&&G0(ta=>Ea(Ea({},ta),_i))}Fo.current=!0},[x0?.item,Yr]),useEffect(()=>{Ao(Yr)},[Yr]),useEffect(()=>{$r>=0&&window.scrollTo(0,0)},[$r]),useEffect(()=>{var ji;if(!_o||dt.length===0||a0||!x0?.item)return;const Vi=g0.current[$r];if(Vi===void 0)return;const Vo=wi.current.get(Vi)||[Vi],_i=[];if(Vo.forEach(Zn=>{var n0;const b1=(n0=x0?.item)==null?void 0:n0[Zn];b1&&hasInitialValue(b1)&&_i.push(b1)}),_i.length===0||!_i.some(Zn=>Zo(Zn,Bi.current)&&!Bs.current.includes(Zn.linkId)?(Bs.current.push(Zn.linkId),!0):!1))return;const Ia=validateCurrentPage(Bi.current,dt,$r,x0,g0),Fa=(ji=x0?.item)==null?void 0:ji[Vi],Rr=isHiddenAnswerInValid(Fa,Bi.current);!Ia||Rr||(k0.current.add($r),Ar(!0),ko.current=!0,B0(_i[_i.length-1].linkId))},[$r,dt,_o,a0,x0]);const B0=(ji,Vi=!1,Vo=!1)=>{var _i;if(Vi){uo(removeDisabledItems(Bi.current,x0?.item||[]),Vo),In(!1);return}const ta=findQuestionByLinkId(x0?.item||[],ji);if(!ta)return;const Ia=(_i=findResponseItem(Bi.current,ji))==null?void 0:_i.answer;if(getValidationError(ta,Bi.current,Ia))return;const Fa=getUpdatedFormData(x0?.item||[],Bi.current,ji,Ia),Rr=Zo(ta,Fa);if(!Rr)return;In(!1);const Zn=findRootGroupLinkId(x0?.item||[],ji);let n0=Fa,b1=[];const _l=deepTrimFormData(Fa,Rr,x0?.item||[]);n0=_l.trimmedData,b1=_l.trimmedLinkIds;const dl=findQuestionByLinkId(x0?.item||[],Zn||"");Bi.current=n0;const ru=findGroupPositionByLinkId(x0?.item||[],ji||""),Dl=ru!==-1?ru:$r;if(validateCurrentPage(n0,dt,Dl,x0,g0,b1)&&!isHiddenAnswerInValid(dl,n0)){Ar(!0),ko.current=!0;let au;const pi=(()=>{var jo;const Ya=ks=>ks.flatMap(S1=>[S1,...S1.item?Ya(S1.item):[]]),La=Ya((jo=x0?.item)!=null?jo:[]),m1=La.findIndex(ks=>ks.linkId===Rr),sl=new Set;let Il=!0;for(;Il;){Il=!1;for(const ks of La){if(sl.has(ks.linkId)||!ks.enableWhen)continue;ks.enableWhen.some(z1=>{const Y1=La.findIndex(Xl=>Xl.linkId===z1.question);return Y1!==-1&&Y1<=m1||sl.has(z1.question)})&&(sl.add(ks.linkId),Il=!0)}}return b1.filter(ks=>!sl.has(ks))})();pi.length>0&&(au=removeItemsFromSchema(x0?.item||[],pi),Ao(vs(Ea({},x0),{item:au})));const go=((jo,Ya)=>{const La=[];let m1=!1;const sl=Il=>{for(const ks of Il)m1?(La.push(ks.linkId),ks.item&&sl(ks.item)):ks.linkId===Ya?m1=!0:ks.item&&sl(ks.item)};return sl(jo),La})(x0?.item||[],Rr);go.length>0&&(Bs.current=Bs.current.filter(jo=>!go.includes(jo)),xn(jo=>{const Ya=new Set(jo);return go.forEach(La=>Ya.delete(La)),Ya})),Bs.current.push(Rr),uo(removeDisabledItems(n0,x0?.item||[]),!0,au)}},J0=(ji,Vi,Vo=!1)=>{const _i=updateItemWithReadOnlyExpression(ji,x0),ta={item:_i,selectedAnswer:Vi,handleInputChange:Pr,showQuestionPrefix:Mo,onCompleteHandler:B0,errors:Ci,isLoading:a0,isCurrentFormValid:yr,contained:x0?.contained,questionnaireSchemaItems:x0?.item,customErrorConfigurations:ro,formData:Bi.current,showStepper:No,totalStepsFromExtension:Oa,externalComponentRenderMap:Pe,hintText:getHintTextFromExtensions(_i.extension)};if(typeof Er=="function"&&Vo)Er(ji,ta,Bi.current);else if(ji.type in typeToRenderFunctionMap&&!Vo)return dt.includes(ji.linkId)||_t(Ia=>[...Ia,ji.linkId]),jsx(RenderFHIRQuestionnaireItem,Ea({},ta),ji.linkId);return null},Nt=ji=>ji.map(Vi=>{var Vo,_i;const ta=isHiddenExtensionPresent(Vi);let Ia=(Vo=findResponseItem(Bi.current,Vi.linkId))==null?void 0:Vo.answer;if((!Ia||Object.keys((_i=Ia?.[0])!=null?_i:{}).length===0)&&!En.has(Vi.linkId)){if(Vi.initial&&Vi.initial.length>0)Ia=Vi.initial,xn(Fa=>new Set(Fa).add(Vi.linkId));else if((Vi.type==="choice"||Vi.type==="open-choice")&&Vi.answerOption){const Fa=Vi.answerOption.filter(Rr=>Rr.initialSelected===!0);Fa.length>0&&(Ia=Fa.map(Rr=>{let Zn={};return Rr.valueCoding?Zn={valueCoding:{code:Rr.valueCoding.code,display:Rr.valueCoding.display,system:Rr.valueCoding.system}}:Rr.valueReference&&(Zn={valueReference:{reference:Rr.valueReference.reference,display:Rr.valueReference.display}}),Zn}).filter(Rr=>Object.keys(Rr).length>0),xn(Rr=>new Set(Rr).add(Vi.linkId)))}Ia&&(Bi.current=getUpdatedFormData(x0?.item||[],Bi.current,Vi.linkId,Ia))}if(!Vi?.enableWhen||isQuestionEnabled(Vi?.enableWhen,Vi.enableBehavior,Bi.current)){const Fa=Vs.includes(Vi.linkId)||getUIToolkitCode(Vi.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[J0(Vi,Ia,ta),Vi.item&&!ta&&(Fa?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:Nt(Vi.item)})}):Nt(Vi.item))]},Vi.linkId)}else if(Vi.type==="group"&&!ta)return p0.includes(Vi.linkId)||(Oa===void 0&&Kn(g0.current.length-1||-1),g0.current=g0.current.filter((Fa,Rr)=>Rr!==$r),ui(Fa=>[...Fa,Vi.linkId])),null});if($r>=0){const ji=[];let Vi=0,Vo=0;for(;Vi<tr.length&&Vo<g0.current.length;){const _i=tr[Vi],ta=g0.current[Vo];if(_i<ta){const Ia=(We=x0?.item)==null?void 0:We[_i];(!Ia?.enableWhen||isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,Bi.current))&&ji.push(Vi),Vi++}else _i===ta&&Vi++,Vo++}for(;Vi<tr.length;){const _i=tr[Vi],ta=(gt=x0?.item)==null?void 0:gt[_i];(!ta?.enableWhen||isQuestionEnabled(ta.enableWhen,ta.enableBehavior,Bi.current))&&ji.push(Vi),Vi++}if(ji.length>0){Oa===void 0&&Kn(g0.current.length+ji.length),ji.reverse().forEach(ta=>{const Ia=tr[ta];let Fa=0;for(let Rr=0;Rr<g0.current.length;Rr++){if(g0.current[Rr]>Ia){Fa=Rr;break}Fa=Rr+1}g0.current.splice(Fa,0,Ia)});const _i=ji.map(ta=>{var Ia;const Fa=tr[ta],Rr=(Ia=x0?.item)==null?void 0:Ia[Fa];return Rr?.linkId}).filter(Boolean);ui(ta=>ta.filter(Ia=>!_i.includes(Ia)))}tr.forEach(_i=>{var ta;const Ia=(ta=x0?.item)==null?void 0:ta[_i];Ia?.enableWhen&&!isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,Bi.current)&&Bi.current.some(Rr=>Rr.linkId===Ia.linkId)&&(Bi.current=removeAnswerFromFormData(Bi.current,Ia.linkId))})}const io=()=>{var ji;if(Li&&!d0&&$r>0&&xo!=="completed")gn(g0.current.length-1),Z0(!0),sn(!1),pa?.();else if($r>0&&xo!=="completed"){let Vi=$r-1;for(;Vi>0;){const Vo=g0.current[Vi],_i=(ji=x0?.item)==null?void 0:ji[Vo];if(!_i?.enableWhen||isQuestionEnabled(_i.enableWhen,_i.enableBehavior,Bi.current))break;Vi--}gn(Vi),In(!0),sn(!1),pa?.()}else ar?.()},Co=ji=>ji.preventDefault();return useEffect(()=>{const ji=setTimeout(()=>{Ls(!0)},0);return()=>clearTimeout(ji)},[]),Sa?jsxs(Fragment,{children:[jsxs("form",{id:er,className:"w-full","data-testid":"questionnaire-form",onSubmit:Co,children:[!So&&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:()=>io(),onKeyDown:ji=>{(ji.key==="Enter"||ji.key===" ")&&io()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Li&&!d0?jsx(EmptyState,{className:"mt-5xl",title:Li.title,description:Li.description,featuredIconProps:{icon:Li.icon,color:"gray"},primaryButton:Li.primaryButton,secondaryButton:Li.secondaryButton?vs(Ea({},Li.secondaryButton),{onClick:io}):void 0}):jsxs(Fragment,{children:[!x0?.item&&a0&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),x0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:Nt($r>=0?x0.item.filter((ji,Vi)=>{const Vo=g0.current[$r];return(wi.current.get(Vo)||[Vo]).includes(Vi)}):x0?.item||[])})]})]}),Fo.current&&Ce]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,l,e)=>{"use strict";e.d(l,{l:()=>p});var n=e(31085),t=e(14041),r=e(36087),s=e(69364),i=e(25624),o=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,b)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[f]=b,d=(h,f)=>{for(var b in f||(f={}))y.call(f,b)&&m(h,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(h,b,f[b]);return h},O=(h,f)=>g(h,c(f));const v=({selected:h,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},p=({item:h,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,o.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),R=N=>{var w,V;if(!b)return!1;const k=(0,i.MU)(b,N);return((V=(w=k?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,b]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||E.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,E.length,x,z]),(0,t.useEffect)(()=>{C.forEach(N=>{var w,V;const k=b?(0,i.MU)(b,N.linkId):void 0;(!k||((V=(w=k.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:E.map(N=>{var w,V,k,I;const q=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(k=F?.valueString)!=null?k:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:q,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Z,l,e)=>{"use strict";e.d(l,{v:()=>o});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const i=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},o=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,p;if(!c)return!1;const h=(0,s.MU)(c,O);return((p=(v=h?.answer)==null?void 0:v[0])==null?void 0:p.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var v;const p=m(O.linkId);return(0,n.jsx)(i,{label:(v=O.text)!=null?v:"",selected:p,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},18522:(Z,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,A=(p,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(p,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(p,f,h[f]);return p},m=(p,h)=>o(p,a(h));const d=(0,t.createContext)(void 0),O=()=>{const p=(0,t.useContext)(d);if(!p)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return p},v=({children:p,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,k]=useState(!1),[I,q]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),ie=()=>{q(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),he=()=>{q(ne=>Math.max(0,ne-1))},Me=I>0,Se=useCallback((ne,ae,me)=>{if(!h)return;const pe=h[ne];if(!pe)return;let ce;if(Array.isArray(pe))if(me)ce=pe.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&&pe.inputType&&pe.inputType!==me)return;ce=pe}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:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:Me,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:k,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:ie,decrementCustomErrorCount:he,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:p})}},35473:(Z,l,e)=>{"use strict";var n=e(28058),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var i=e(25624),o=e(69364),a=e(7630),g=e(72866)},61388:(Z,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:i,onActionButtonClick:o,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),i&&o&&(0,n.jsx)(t.Button,{color:"link-color",onClick:o,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:i})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Z,l,e)=>{"use strict";e.d(l,{d:()=>i});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const i=({infoDetails:o,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>y(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:o.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const p=Array.isArray(d.value)?d.value:[d.value];return p.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:p.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(p[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Z,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:(Z,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:(Z,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:(Z,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:(Z,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),i=e(76808),o=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,p=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&p(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&p(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,E)=>{var C=P=>{try{L(T.next(P))}catch(D){E(D)}},R=P=>{try{L(T.throw(P))}catch(D){E(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(C,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:E})=>{const{locationPermission:C,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,g.i)(),[V,k]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),q=S!==void 0?S:V;(0,t.useEffect)(()=>{(q||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,q,D]);const U=(0,t.useCallback)(Me=>{w(f(h({},N),{location:Me,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||k([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let Me;try{Me=yield L(),Me&&U&&U(`${Me.coords.latitude},${Me.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&E?E():k(!1)}return x&&x(!1),!!Me}),[K,U,L,x,S,E]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():k(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),ie=(0,t.useCallback)(Me=>{D("location_permissions_cta_clicked",{click:Me==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():k(!1)},[D,P,w,N,I,S,E]),te=(0,t.useCallback)(()=>ie("close"),[ie]),he=(0,t.useCallback)(()=>ie("cancel"),[ie]);return(0,n.jsx)(o.Modal,{id:"location-modal",isOpen:q,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:he}})}},35471:(Z,l,e)=>{"use strict";var n=e(26877)},98741:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))i.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))o.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const p=c(y);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:p})}catch(p){console.error("Failed to load Lottie animation:",p)}return()=>{var p;(p=v.current)==null||p.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Z,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const i=y=>y*1609.34;var o=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:p})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:p||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:i(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,o.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,o.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,o.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Z,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:(Z,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:(Z,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:o,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:o,size:"md",initials:getInitials(o),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:o}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},i=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Z,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:i,fullImageHeader:o=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[o?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),i&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:i})]}),s]})]})}),r=null},51254:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:i,icon:o})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:o.icon,color:(a=o.color)!=null?a:"brand",size:"lg",className:o.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),i&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:i})]})]})}},69092:()=>{},33457:(Z,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:(Z,l,e)=>{"use strict";e.d(l,{i:()=>Qe});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Ye=24,color:Lt="currentColor",...mn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Lt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...mn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var i=e(14449),o=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Ye){Ye()}let y=null;const A=Ye=>y=Ye,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=Ye=>{h=Ye},b=(Ye,Lt)=>Ye===Lt;function M(Ye=d){const Lt=Ye===d?v:()=>(0,r.useContext)(Ye);return function(Sn,et=b){const{store:Rt,subscription:kt,getServerState:$n}=Lt(),Mr=h(kt.addNestedSub,Rt.getState,$n||Rt.getState,Sn,et);return(0,r.useDebugValue)(Mr),Mr}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Lt=null,mn=null;return{clear(){Lt=null,mn=null},notify(){Ye(()=>{let Sn=Lt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Lt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=mn={callback:Sn,next:null,prev:mn};return Rt.prev?Rt.prev.next=Rt:Lt=Rt,function(){!et||Lt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:mn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Lt=Rt.next)}}}}const E={notify(){},get:()=>[]};function C(Ye,Lt){let mn,Sn=E;function et(cr){return Mr(),Sn.subscribe(cr)}function Rt(){Sn.notify()}function kt(){Nn.onStateChange&&Nn.onStateChange()}function $n(){return Boolean(mn)}function Mr(){mn||(mn=Lt?Lt.addNestedSub(kt):Ye.subscribe(kt),Sn=S())}function vn(){mn&&(mn(),mn=void 0,Sn.clear(),Sn=E)}const Nn={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:kt,isSubscribed:$n,trySubscribe:Mr,tryUnsubscribe:vn,getListeners:()=>Sn};return Nn}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Ye=>{D=Ye},w=null,V=null,k=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Lt,mn){useIsomorphicLayoutEffect(()=>Ye(...Lt),mn)}function q(Ye,Lt,mn,Sn,et,Rt){Ye.current=Sn,mn.current=!1,et.current&&(et.current=null,Rt())}function U(Ye,Lt,mn,Sn,et,Rt,kt,$n,Mr,vn,Nn){if(!Ye)return()=>{};let cr=!1,Pn=null;const Ur=()=>{if(cr||!$n.current)return;const Dt=Lt.getState();let $e,ot;try{$e=Sn(Dt,et.current)}catch(Je){ot=Je,Pn=Je}ot||(Pn=null),$e===Rt.current?kt.current||vn():(Rt.current=$e,Mr.current=$e,kt.current=!0,Nn())};return mn.onStateChange=Ur,mn.trySubscribe(),Ur(),()=>{if(cr=!0,mn.tryUnsubscribe(),mn.onStateChange=null,Pn)throw Pn}}const F=()=>w;function K(Ye,Lt){return Ye===Lt}let G=!1;function se(Ye,Lt,mn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:kt=shallowEqual,areMergedPropsEqual:$n=shallowEqual,forwardRef:Mr=!1,context:vn=ReactReduxContext}={}){const Nn=vn,cr=mapStateToPropsFactory(Ye),Pn=mapDispatchToPropsFactory(Lt),Ur=mergePropsFactory(mn),t0=Boolean(Ye);return $e=>{const ot=$e.displayName||$e.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:t0,displayName:Je,wrappedComponentName:ot,WrappedComponent:$e,initMapStateToProps:cr,initMapDispatchToProps:Pn,initMergeProps:Ur,areStatesEqual:et,areStatePropsEqual:kt,areOwnPropsEqual:Rt,areMergedPropsEqual:$n};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Ln}=st,Dn=_objectWithoutPropertiesLoose(st,P);return[st.context,Ln,Dn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Nn,[le,Nn]),zt=useContext(Te),Ft=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),dn=Boolean(zt)&&Boolean(zt.store),zn=Ft?st.store:zt.store,gr=dn?zt.getServerState:zn.getState,Bt=useMemo(()=>defaultSelectorFactory(zn.dispatch,tt),[zn]),[we,Ze]=useMemo(()=>{if(!t0)return V;const Ln=createSubscription(zn,Ft?void 0:zt.subscription),Dn=Ln.notifyNestedSubs.bind(Ln);return[Ln,Dn]},[zn,Ft,zt]),At=useMemo(()=>Ft?zt:_extends({},zt,{subscription:we}),[Ft,zt,we]),en=useRef(),nn=useRef(Ue),pn=useRef(),pt=useRef(!1),Qt=useRef(!1),qt=useRef(!1),Pt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const $t=useMemo(()=>()=>pn.current&&Ue===nn.current?pn.current:Bt(zn.getState(),Ue),[zn,Ue]),Yt=useMemo(()=>Dn=>we?U(t0,zn,we,Bt,nn,en,pt,qt,pn,Ze,Dn):()=>{},[we]);I(q,[nn,en,pt,Ue,pn,Ze]);let An;try{An=D(Yt,$t,gr?()=>Bt(gr(),Ue):$t)}catch(Ln){throw Pt.current&&(Ln.message+=`
872
872
  The error may be correlated with this previous error:
package/native.js CHANGED
@@ -1 +1 @@
1
- import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1100.3",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.1348.2",D="@icanbwell/composite. repo version: 0.1348.2",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1100.5",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.1349.1",D="@icanbwell/composite. repo version: 0.1349.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.1100.3",
3
+ "version": "1.1100.5",
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.1348.2",
47
- "description": "@icanbwell/composite. repo version: 0.1348.2"
46
+ "repoVersion": "0.1349.1",
47
+ "description": "@icanbwell/composite. repo version: 0.1349.1"
48
48
  }