@icanbwell/composite 1.1087.0 → 1.1087.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/native.js +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
866
866
|
<div class="wrapper">
|
|
867
867
|
<bwell-error-component />
|
|
868
868
|
</div>
|
|
869
|
-
`}}customElements.get(ge)===void 0&&customElements.define(ge,Se);const Le=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Ee=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:_t,version:Yt,prefetchFeatureApp:St})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;window.bwell||(window.bwell=new ue({metadata:{version:Yt}}));const mr=`bwell-${_t}`;if(customElements.get(mr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),Fe.set(this,(0,T.nanoid)()),Ct.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Dt.set(this,void 0),pn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const kr=new me(Le).attachToShadowRoot(this.shadowRoot);kr.addEventListener("visibilitychange",({visibility:Wt,container:_e,name:lt})=>{lt==="error"&&Wt==="visible"&&window.bwell._registerEmbeddableContent(_e),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=Wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:kr,attributes:new $().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Dt,(0,p.__classPrivateFieldGet)(this,Ke,"m",kn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,pn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Sr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,pn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Fe,this.id||(0,p.__classPrivateFieldGet)(this,Fe,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ct,new z((0,p.__classPrivateFieldGet)(this,Fe,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ct,"f").registerDispatcher(kr=>this.dispatchEvent(kr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Dt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Dt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),St&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var kr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,pn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(kr=(0,p.__classPrivateFieldGet)(this,Ct,"f"))===null||kr===void 0||kr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}Fe=new WeakMap,Ct=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,pn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,kn=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${mr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Fe,"f"),name:_t,elementName:mr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Sr=function({visibility:kr,name:Wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=kr==="hidden"?"unset":"hidden"},hn=function(kr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(kr){return Wt=>{const _e=Ee.findIndex(Je=>Je===kr);if(!Ee.slice(0,_e).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(Wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",hn).call(this,kr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[kr]),"f");else if(Wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",hn).call(this,kr);const Je=Ee.find(nt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(nt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(mr,Dn)}),$e={rE:"1.1087.0"},at="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${at}/${$e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:at,version:$e.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=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];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===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,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:$}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${$?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(N=b?.item)!=null?N:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});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,p=(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},b=(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,v=({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,[$,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[ie,le]=(0,t.useState)(!1),ae=(0,t.useRef)(!1),me=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ye,Te]=(0,t.useState)(me),[ve,ne]=(0,t.useState)(me),[se,{loading:he,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[fe,{loading:ue,error:te}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ge,error:Se}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Te(me)},onCompleted:Yt=>{var St,Ke;const Fe=(Ke=(St=Yt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Ke.map(Ct=>{var Qe;return{id:Ct.placeId,label:(0,s.removeAfterLastComma)(Ct.description),mainText:Ct?.mainText||((Qe=Ct.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ct?.secondaryText||Ct.description.split(",").slice(1).join(",").trim())}});Te(Fe?.length?Fe:me)}}),Le=(0,t.useMemo)(()=>ye.map(Yt=>b(p({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",$)})),[$,ye]),Ee=Yt=>h(void 0,null,function*(){var St,Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;if(F(Yt),G(Yt),le(!1),Yt&&typeof Yt=="string"){const mr=ye.find(nt=>nt.id===Yt),Dn=mr?.label||$;if(!mr)return;q(Dn),k(Dn),setTimeout(()=>{const nt=[{id:mr.id,label:mr.label}];Te(nt),ne(nt)},f);const $r=yield se({variables:{placeId:Yt}}),kr=(Ke=(St=$r?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ke.latitude,Wt=(Ct=(Fe=$r?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ct.longitude,_e=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",lt=((pn=(Dt=$r?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(kr&&Wt)if(!_e||!Je){const nt=yield fe({variables:{latitude:String(kr),longitude:String(Wt)}}),ot=((Ht=(Rt=nt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",ct=((Sr=(kn=nt?.data)==null?void 0:kn.geocodingByLatLon)==null?void 0:Sr.state)||"",Et=((In=(hn=nt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:kr,longitude:Wt,zipCode:ot,state:ct,stateCode:Et,placeId:Yt,description:Dn,value:Yt})}else T({latitude:kr,longitude:Wt,zipCode:_e,state:lt,stateCode:Je,placeId:Yt,description:Dn,value:Yt});else le(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield J({variables:{input:Yt,types:"geocode"}})})),$e=Yt=>h(void 0,null,function*(){if(le(!1),q(Yt),z?.(Yt),!Yt||Yt.trim().length===0){F(null),Te(me),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const St=Yt.trim();St.length>=2?yield xe(St):Te(me)}),at=Yt=>{ae.current=Yt},bt=()=>{q(I),Te(ve),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var St,Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;if(N&&w){Te([{id:N,label:$||w}]),ne([{id:N,label:$||w}]),F(N),G(N),q(w),k(w),w===$&&q(w);const mr=yield se({variables:{placeId:N}}),Dn=(Ke=(St=mr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Ct=(Fe=mr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ct.longitude,kr=((Ye=(Qe=mr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",Wt=((pn=(Dt=mr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",_e=((et=(Sn=mr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!kr||!Wt||!_e){const lt=yield fe({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=lt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",nt=((Sr=(kn=lt?.data)==null?void 0:kn.geocodingByLatLon)==null?void 0:Sr.state)||"",ot=((In=(hn=lt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:nt,stateCode:ot,placeId:N,description:w,value:N})}else T({latitude:Dn,longitude:$r,zipCode:kr,state:Wt,stateCode:_e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Te(me),ne(me)}))()},[]);const Ot=ie||!!pe||!!te||!!Se||!!R,_t=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(he||ue||D)},[C,he,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:$,isLoading:ge||he||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Le,selectedKey:U,onSelectionChange:Ee,onInputChange:$e,defaultFilter:Ie,onOpenChange:at,onBlur:bt,isInvalid:Ot,hint:_t,autoComplete:"address-line1",className:"w-full",children:Yt=>{const St=Yt,Ke=$.trim().length>=2,Fe=St.mainText||"",Ct=St.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ct.trim().length>0,Dt=Qe?(0,r.RZ)(Fe,$):{beforePart:"",highlightedPart:"",remainingPart:""},pn=Ye?(0,r.RZ)(Ct,$):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Ke&&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:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:pn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:pn.highlightedPart}),(0,n.jsx)("span",{children:pn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.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(11300);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 p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,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,p=Object.getOwnPropertySymbols,b=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,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{$(L.next(q))}catch(I){D(I)}},w=q=>{try{$(L.throw(q))}catch(I){D(I)}},$=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);$((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)(),$=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[ie,le]=(0,t.useState)(!1),ae=(0,t.useCallback)(ge=>{F(ge);try{w(M(v({},q.current),{locationPermission:ge||o.Ef.UNAVAILABLE}))}catch(Se){Se instanceof Error?P?.error(Se,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Se)}`)}},[w,P]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ye=(0,t.useCallback)(ge=>x(void 0,null,function*(){const Se=D.getCurrentPosition(ge).then(Le=>{if(!Le||!Le.coords)throw new Error("Location data is invalid or unavailable");return Le});try{return yield u(Se,y,"Location request timed out. Please check that location services are enabled.")}catch(Le){throw Le instanceof Error&&P?.error(Le,"Geolocation timeout or error"),Le}}),[D,P]),Te=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ve=(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 me()))return P?.error("Location services not available"),!1;const Se=yield Te();return Se!==o.Ef.GRANTED&&Se!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Se}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[me,P,Te]);(0,t.useEffect)(()=>{if($.current)return;$.current=!0,(()=>x(void 0,null,function*(){const Se=N.locationPermission;if(Se===o.Ef.DENIED||Se===o.Ef.BLOCKED||Se===o.Ef.UNAVAILABLE){F(Se);return}k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}if(Se===o.Ef.GRANTED){try{const Ie=yield Te();if(Ie===o.Ef.GRANTED){const xe=yield ye(z);xe&&(G(xe),ae(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(ae(Ie),le(!0)):ae(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)}`),ae(o.Ef.UNAVAILABLE)}return}const Ee=yield Te();if(ae(Ee),Ee===o.Ef.GRANTED)try{const Ie=yield ye(z);Ie?G(Ie):ae(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),ae(o.Ef.UNAVAILABLE)}else Ee===o.Ef.PROMPT&&le(!0)}catch(Le){Le instanceof Error?P?.error(Le,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(Le)}`),ae(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const se=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){ae(o.Ef.UNAVAILABLE);return}k(!0);let Se=yield Te();if(ae(Se),Se===o.Ef.GRANTED||Se===o.Ef.PROMPT){if(L==="Android"&&Se===o.Ef.GRANTED)try{Se=yield ve(),ae(Se)}catch(Le){Le instanceof Error?P?.error(Le,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(Le)}`);return}if(Se!==o.Ef.UNAVAILABLE){const Le=yield ye(z);return G(Le),Le}}return}catch(ge){ae(o.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{k(!1)}}),[ne,P,L,ae,ye,Te,ve]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield me())?yield Te():o.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),o.Ef.UNAVAILABLE}}),[me,P,Te]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield Te();ae(Se)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ae(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[me,P,ae,Te]),fe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield Te();if(Se===o.Ef.DENIED||Se===o.Ef.BLOCKED||Se===o.Ef.UNAVAILABLE){ae(Se);return}const Le=yield ve();if(ae(Le),["granted","prompt"].includes(Le)){const Ee=yield ye(z);return G(Ee),Ee}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const Se=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);Se?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Se}`)}ae(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[me,P,ae,ye,ve,Te]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield ye(z);Se&&(G(Se),F(o.Ef.GRANTED),w(M(v({},q.current),{location:`${Se.coords.latitude},${Se.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Se.coords.latitude}`,lng:`${Se.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ae(o.Ef.UNAVAILABLE),ge}finally{k(!1)}}),[me,P,w,ae,ye]),te=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ge=yield se();ge&&w(M(v({},q.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{k(!1)}}),[P,U,se,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:se,requestPosition:fe,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:he}),[I,te,U,K,se,fe,ue,pe,he]);return(0,n.jsxs)(T.Provider,{value:J,children:[ie&&(0,n.jsx)(g.J,{isOpen:ie,onClose:()=>le(!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)},71934:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267);const s=({onClick:i})=>{const{loading:o,i18n:{t:a}}=useI18nChild({keys:["health-space"]});return o?jsx(LoadingIndicator,{}):jsxs("div",{className:"tw-preflight flex h-full flex-col items-center justify-center gap-6 p-2 text-center md:p-4",children:[jsx(CircleIcon,{icon:Users01,size:"xl",className:"p-4 shadow-xl"}),jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Typography,{tag:"h2",className:"text-primary text-md font-semibold",children:a("YOUR_CARE_TEAM_IS_EMPTY")}),jsx(Typography,{tag:"p",className:"text-tertiary text-sm md:max-w-[26rem]",children:a("START_BUILDING_YOUR_CARE_TEAM")})]}),jsx(Button,{size:"sm",className:"w-fit min-w-[10rem] rounded-full shadow-lg",onClick:i,children:a("FIND_DOCTORS")})]})}},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>F,rz:()=>_t,Fp:()=>Ot,el:()=>bt,ao:()=>at,oA:()=>T,Yt:()=>mr,g4:()=>$e,tn:()=>Wt,n4:()=>S,gD:()=>z,Vp:()=>Sr,Cx:()=>P,bK:()=>R,gi:()=>hn,Z$:()=>me,GT:()=>kn,hr:()=>ye,JL:()=>Te,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Ct,$e:()=>Yt,qT:()=>Fe,GQ:()=>Ke,q3:()=>Qe,D_:()=>St,Uf:()=>N,_l:()=>G,Md:()=>q,V7:()=>$,fe:()=>le,JP:()=>Et,Z_:()=>E,zO:()=>ae,UZ:()=>k,$7:()=>xe,rb:()=>w,VF:()=>Rt,vf:()=>pn,PV:()=>Ht,PS:()=>Dt,Iz:()=>et,zD:()=>I,m3:()=>Le,XP:()=>Ee,PM:()=>pe,cX:()=>ve,G6:()=>ne,Us:()=>ue,AA:()=>he,G0:()=>Se,mO:()=>J,HH:()=>fe,PU:()=>kr,Tl:()=>ge,uH:()=>Ie,c3:()=>se,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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 p=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));p.displayName="Virus";const b=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));b.displayName="CreditCard02";const h=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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 v=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));v.displayName="ClipboardPlus";const M=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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",$="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",F="check-box",K="header",G="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",le="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",me=[{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"}],ye={"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"},Te={"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"},ve="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",se="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",fe="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",te="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ge="ui-toolkit/SelectableOption",Se="ui-toolkit/Modal",Le="ui-toolkit/Alert",Ee="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",$e="http://icanbwell.com/fhir/StructureDefinition/icon-name",at="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",_t="http://icanbwell.com/fhir/StructureDefinition/description",Yt="http://icanbwell.com/fhir/StructureDefinition/modal-description",St="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Fe="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Ct="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Dt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",pn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",kn="http://hl7.org/fhir/StructureDefinition/mimeType",Sr="http://hl7.org/fhir/StructureDefinition/maxSize",hn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",mr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",kr="ui-toolkit/PrefilledMemberDemographicsAlert",Wt="http://hl7.org/fhir/issue-severity",_e="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Je="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",nt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",ot="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",ct={},Et={"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:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>$e,CP:()=>et,Fy:()=>Sn,GN:()=>ae,J4:()=>Je,MU:()=>F,Nw:()=>Wt,Qr:()=>T,Ue:()=>nt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>$,eC:()=>ot,iI:()=>q,lv:()=>w,mR:()=>ze,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Ue,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,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(it,Pt,Zt)=>Pt in it?A(it,Pt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):it[Pt]=Zt,f=(it,Pt)=>{for(var Zt in Pt||(Pt={}))p.call(Pt,Zt)&&h(it,Zt,Pt[Zt]);if(O)for(var Zt of O(Pt))b.call(Pt,Zt)&&h(it,Zt,Pt[Zt]);return it},v=(it,Pt)=>m(it,d(Pt));const M=it=>{var Pt;return(Pt=it.filter(Zt=>Zt.url.includes("questionnaire-itemControl")).flatMap(Zt=>{var en,qt;return(qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)!=null?qt:[]}).find(Zt=>{var en;return(en=Zt.code)==null?void 0:en.startsWith("ui-toolkit/")}))==null?void 0:Pt.code},x=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.V7);return Zt?.valueCode||"off"},z=(it,Pt,Zt)=>{const en=(0,u.A)(Zt);return it&&Pt&&Zt?en.replace("<p>",`<span>${Pt} `).replace("</p>","</span>").trim():en.replace("<p>","<span>").replace("</p>","</span>").trim()},T=it=>{const Pt=it?.find(Zt=>Zt.url===y.Vp);return Pt?.valueInteger},S=it=>{const Pt=it?.find(Zt=>Zt.url===y.Z_);return Pt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(it,Pt)=>{const Zt=it?.find(en=>en.url===PLACEHOLDER_EXTENSION_URL);return Zt?.valueString||Pt&&E[Pt]||C},L=it=>{const Pt=it?.find(Zt=>Zt.url===HINT_TEXT_EXTENSION_URL);return Pt?.valueString},P=it=>{const Pt=it?.filter(Zt=>Zt.url===y.GT&&Zt.valueCode).map(Zt=>y.hr[Zt.valueCode]||Zt.valueCode);return Pt?.length?Pt.join(","):void 0},D=it=>it.split(",").map(en=>en.trim()).map(en=>y.JL[en]||en).filter((en,qt,Lt)=>Lt.indexOf(en)===qt).join(", "),N=(it,Pt,Zt)=>{const en=D(it),qt=en.lastIndexOf(","),Lt=qt!==-1?`${en.substring(0,qt)} or${en.substring(qt+1)}`:en,ln=[Pt&&`max. ${(Pt/(1e3*1e3)).toFixed(0)}MB`,Zt&&`upto ${Zt} file${Zt>1?"s":""}`].filter(Boolean);return ln.length>0?`${Lt} (${ln.join(", ")})`:Lt},w=it=>{const Pt=it?.find(Zt=>Zt?.url===y.zD||Zt?.url===y.UZ);return Pt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},$=(it,Pt)=>{var Zt,en,qt;const Lt=Pt?.find(ln=>ln.url.includes(it));return(qt=(en=(Zt=Lt?.valueInteger)!=null?Zt:Lt?.valueDecimal)!=null?en:Lt?.valueString)!=null?qt:Lt?.valueDate},q=it=>{if(!!it){if(/^\d{4}-\d{2}-\d{2}$/.test(it))return it;try{const Pt=(0,o.evaluate)({},it);if(Array.isArray(Pt)&&Pt.length>0){const Zt=Pt[0];if(Zt instanceof Date&&!isNaN(Zt.getTime())){const en=Zt.getFullYear(),qt=String(Zt.getMonth()+1).padStart(2,"0"),Lt=String(Zt.getDate()).padStart(2,"0");return`${en}-${qt}-${Lt}`}if(typeof Zt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(Zt))return Zt}}catch{}}},I=(it,Pt)=>{var Zt,en;const qt=Pt?.find(ln=>ln.url===it);if(!qt)return;const Lt=(Zt=qt.valueString)!=null?Zt:qt.valueDate;return Lt||q((en=qt.valueExpression)==null?void 0:en.expression)},k=(it,Pt)=>{if(!(!it||it.length===0))for(const Zt of it){const en=$(Pt,Zt.extension);if(en!==void 0)return en;if(Zt.item&&Zt.item.length>0){const qt=k(Zt.item,Pt);if(qt!==void 0)return qt}}},U=(it,Pt)=>{try{const Zt=String(it??Pt);let en;if(Zt.includes("/"))en=(0,n.A)(Zt,"MM/dd/yyyy",new Date);else{const qt=Zt.split("T")[0];en=(0,t.A)(qt)}return(0,r.A)(en)}catch(Zt){return console.error("Date parsing error:",Zt,it),null}},F=(it,Pt)=>{var Zt;for(const en of it){if(en.linkId===Pt)return en;if((Zt=en.item)!=null&&Zt.length){const qt=F(en.item,Pt);if(qt!==void 0)return qt}}},K=(it,Pt)=>{var Zt;const en=[];for(const qt of it)if(qt.linkId===Pt&&en.push(qt),(Zt=qt.item)!=null&&Zt.length){const Lt=K(qt.item,Pt);en.push(...Lt)}return en},G=(it,Pt,Zt=0)=>K(it,Pt)[Zt];function ie(it){return it!=null}const le=(it,Pt)=>{var Zt,en,qt;if("answerString"in it&&ie(it.answerString)){if(it.operator==="=")return Pt?.valueString===it.answerString;if(it.operator==="!=")return Pt?.valueString!==it.answerString}if("answerBoolean"in it&&ie(it.answerBoolean)){if(it.operator==="=")return Pt?.valueBoolean===it.answerBoolean;if(it.operator==="!=")return Pt?.valueBoolean!==it.answerBoolean}if("answerInteger"in it&&ie(it.answerInteger)||"answerDecimal"in it&&ie(it.answerDecimal)){const Lt=Number(Pt?.valueInteger||Pt?.valueDecimal),ln=Number(it.answerInteger||it.answerDecimal);if(it.operator==="=")return Lt===ln;if(it.operator==="!=")return Lt!==ln;if(it.operator===">")return Lt>ln;if(it.operator==="<")return Lt<ln;if(it.operator===">=")return Lt>=ln;if(it.operator==="<=")return Lt<=ln}if("answerQuantity"in it&&ie(it.answerQuantity)){const Lt=Pt?.valueQuantity,ln=it.answerQuantity;if(Lt?.unit!==ln?.unit)return!1;if(it.operator==="=")return Lt.value===ln.value;if(it.operator==="!=")return Lt.value!==ln.value;if(it.operator===">")return Lt.value>ln.value;if(it.operator==="<")return Lt.value<ln.value;if(it.operator===">=")return Lt.value>=ln.value;if(it.operator==="<=")return Lt.value<=ln.value}if("answerCoding"in it&&ie(it.answerCoding)){const Lt=Pt?.valueCoding,ln=it.answerCoding;if(it.operator==="=")return Lt?.code===ln.code;if(it.operator==="!=")return Lt?.code!==ln.code}if("answerReference"in it&&ie(it.answerReference)){const Lt=Pt?.valueReference,ln=it.answerReference;if(it.operator==="=")return Lt?.reference===ln.reference;if(it.operator==="!=")return Lt?.reference!==ln.reference}if("answerDate"in it&&ie(it.answerDate)||"answerDateTime"in it&&ie(it.answerDateTime)||"answerTime"in it&&ie(it.answerTime)){const Lt=new Date((qt=(en=(Zt=Pt?.valueDate)!=null?Zt:Pt?.valueDateTime)!=null?en:Pt?.valueTime)!=null?qt:""),ln=new Date(it.answerDate||it.answerDateTime||it.answerTime||"");if(it.operator==="=")return Lt.getTime()===ln.getTime();if(it.operator==="!=")return Lt.getTime()!==ln.getTime();if(it.operator===">")return Lt.getTime()>ln.getTime();if(it.operator==="<")return Lt.getTime()<ln.getTime();if(it.operator===">=")return Lt.getTime()>=ln.getTime();if(it.operator==="<=")return Lt.getTime()<=ln.getTime()}return it.operator==="exists"?Pt!=null===it.answerBoolean:!0},ae=(it,Pt,Zt)=>{const en=qt=>{const Lt=K(Zt,qt.question);return Lt.length===0||Lt.every(ln=>!ln.answer||ln.answer.length===0)?le(qt,void 0):Lt.some(ln=>{var Un;return(Un=ln.answer)==null?void 0:Un.some(cr=>le(qt,cr&&Object.keys(cr).length>0?cr:void 0))})};return it&&it?.length>0?Pt==="any"?it?.some(qt=>en(qt)):it?.every(qt=>en(qt)):!0},me=(it,Pt,Zt,en,qt)=>{if(!it||it.length===0)return!0;const Lt=ln=>{var Un;let cr;if(en&&typeof qt=="number"){const Tn=Zt.filter(xn=>xn.linkId===en)[qt];if(Tn?.item){const xn=Tn.item.find(nn=>nn.linkId===ln.question);if(xn?.answer&&xn.answer.length>0)return(Un=xn?.answer)==null?void 0:Un.some(nn=>le(ln,nn&&Object.keys(nn).length>0?nn:void 0))}}if(!cr){const M0=K(Zt,ln.question);if(M0.length>0)return M0.some(Tn=>{var xn;return(xn=Tn.answer)==null?void 0:xn.some(nn=>le(ln,nn&&Object.keys(nn).length>0?nn:void 0))});cr=void 0}return le(ln,cr)};return Pt==="any"?it.some(ln=>Lt(ln)):it.every(ln=>Lt(ln))},ye=(it,Pt)=>{var Zt;if(!!((Zt=it?.valueExpression)!=null&&Zt.expression))try{const en=evaluate(Pt,it.valueExpression.expression);return Array.isArray(en)?en.some(qt=>Boolean(qt)):Boolean(en)}catch{return}},Te=(it,Pt)=>{var Zt;const en=(Zt=it.extension)==null?void 0:Zt.find(Lt=>Lt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),qt=ye(en,Pt);return v(f({},it),{readOnly:qt??it.readOnly})},ve=(it,Pt,Zt)=>{const{required:en,maxLength:qt,type:Lt,extension:ln,enableWhen:Un,enableBehavior:cr,repeats:M0,answerOption:Tn}=it;if(!ae(Un,cr,Pt)||it.type==="group"||it.type==="display")return"";if(M0)return ne(it,Pt,Zt);const xn=fe(it,Pt);return xn&&ue(xn,it)?te(it,Pt,Zt,xn):pe(ln,Lt,en,qt,Zt,Tn)},ne=(it,Pt,Zt)=>{const{required:en}=it;if(en){if(!Zt||Zt.length===0)return"At least one item is required";let qt=!1;for(let Lt=0;Lt<Zt.length;Lt++){const ln=Zt[Lt];if(ln&&Object.keys(ln).length>0&&Object.values(ln).some(cr=>cr!=null&&cr!==""&&(Array.isArray(cr)?cr.length>0:!0))){qt=!0;const cr=pe(it.extension,it.type,!0,it.maxLength,[ln],it.answerOption);if(cr)return`Item ${Lt+1}: ${cr}`;if(it.item&&it.item.length>0){const M0=se(it.item,Pt,it.linkId,Lt);if(M0)return`Item ${Lt+1}: ${M0}`}}else return`Item ${Lt+1}: This field is required`}if(!qt)return"At least one item is required"}else if(Zt&&Zt.length>0)for(let qt=0;qt<Zt.length;qt++){const Lt=Zt[qt];if(Lt&&Object.keys(Lt).length>0&&Object.values(Lt).some(Un=>Un!=null&&Un!==""&&(Array.isArray(Un)?Un.length>0:!0))){const Un=pe(it.extension,it.type,!1,it.maxLength,[Lt],it.answerOption);if(Un)return`Item ${qt+1}: ${Un}`;if(it.item&&it.item.length>0){const cr=se(it.item,Pt,it.linkId,qt);if(cr)return`Item ${qt+1}: ${cr}`}}}return""},se=(it,Pt,Zt,en)=>{var qt,Lt;for(const ln of it){if(!me(ln.enableWhen,ln.enableBehavior,Pt,Zt,en))continue;const Un=F(Pt,Zt),cr=(qt=Un?.item)==null?void 0:qt.find(Tn=>Tn.linkId===ln.linkId),M0=(Lt=cr?.answer)!=null&&Lt[en]?[cr.answer[en]]:void 0;if(ln.required){if(!M0||!M0[0]||!he(M0[0]))return`${ln.text||ln.linkId} is required`;const Tn=pe(ln.extension,ln.type,!0,ln.maxLength,M0,ln.answerOption);if(Tn)return`${ln.text||ln.linkId}: ${Tn}`}else if(M0&&M0[0]&&he(M0[0])){const Tn=pe(ln.extension,ln.type,!1,ln.maxLength,M0,ln.answerOption);if(Tn)return`${ln.text||ln.linkId}: ${Tn}`}if(ln.item&&ln.item.length>0){const Tn=se(ln.item,Pt,ln.linkId,en);if(Tn)return Tn}}return""},he=it=>!it||Object.keys(it).length===0?!1:Object.values(it).some(Pt=>Pt!=null&&Pt!==""&&(Array.isArray(Pt)?Pt.length>0:!0)),pe=(it,Pt,Zt,en,qt,Lt)=>{var ln,Un,cr,M0,Tn;let xn="";const nn=!!it?.find(tn=>{var Cn,er;return tn.url===y.gD&&((er=(Cn=tn.valueCodeableConcept)==null?void 0:Cn.coding)==null?void 0:er.some(Fr=>Fr.system===y.n4&&Fr.code===y.GI))}),mt=qt?.[0],Nt={choice:((ln=mt?.valueCoding)==null?void 0:ln.code)||(mt?.valueString&&Lt?.some(tn=>tn.valueString===mt.valueString)?mt.valueString:null),"open-choice":((Un=mt?.valueCoding)==null?void 0:Un.code)||mt?.valueString,boolean:mt?.valueBoolean,string:mt?.valueString,text:mt?.valueString,url:mt?.valueUri,integer:mt?.valueInteger,decimal:mt?.valueDecimal,dateTime:mt?.valueDateTime,date:mt?.valueDate,time:mt?.valueTime,quantity:(cr=mt?.valueQuantity)==null?void 0:cr.value,reference:(M0=mt?.valueReference)==null?void 0:M0.display,attachment:(Tn=mt?.valueAttachment)==null?void 0:Tn.title};if(!(Pt in Nt))return"";const jt=Nt[Pt],gn={required:()=>Zt&&(jt==null||jt===""||jt==="NaN"||Number.isNaN(jt)||Pt==="boolean"&&jt!==!0&&nn)?"This field is required":"",maxLength:()=>en&&jt!==null&&jt!==void 0&&jt.toString().length>en?`Input should not exceed ${en} characters`:"",minLength:()=>{const tn=$("minLength",it);return tn&&jt!==null&&jt!==void 0&&jt.toString().length<Number(tn)?`Input should be at least ${tn} characters`:""},urlRegex:()=>{const tn=new RegExp(y.rx),Cn=$("regexError",it),er=Cn??"Please enter a valid url starting from http:// and https://";return tn&&Pt==="url"&&jt&&!tn.test(jt)?String(er):""},regex:()=>{const tn=$("regex",it);if(!tn||typeof jt!="string")return"";const Cn=new RegExp(tn),er=$("regexError",it),Fr=er??"Please enter a valid input";return Cn&&jt&&!Cn.test(jt)?String(Fr):""},dateTime:()=>{if(Pt==="dateTime"&&jt){const tn=jt?.toString(),Cn=new Date(tn);return isNaN(Cn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Pt!=="date"||!jt)return"";const tn=jt.replace(/\D/g,"");return tn.length>0&&tn.length<8||isNaN(new Date(jt).getTime())?"Invalid date":""},minValue:()=>{var tn;if(Pt==="date"){const er=I(y.dU,it),Fr=U(er??"01/01/1900","01/01/1900"),Vr=U(jt,"");if(!Fr||!Vr)return"";if((0,s.A)(Vr,Fr)){const Hr=(tn=it?.find(f0=>f0.url===y.Ck))==null?void 0:tn.valueString;return Hr??`Date should not be before ${er??"01/01/1900"}`}return""}const Cn=$("minValue",it);return Cn!=null&&jt!==null&&jt!==void 0&&jt<Cn?`Input should not be less than ${Cn}`:""},maxValue:()=>{var tn;if(Pt==="date"){const er=I(y.bK,it),Fr=U(er??"01/01/2100","01/01/2100"),Vr=U(jt,"");if(!Fr||!Vr)return"";if((0,i.A)(Vr,Fr)){const Hr=(tn=it?.find(f0=>f0.url===y.Cx))==null?void 0:tn.valueString;return Hr??`Date should not be after ${er??"01/01/2100"}`}return""}const Cn=$("maxValue",it);return Cn!=null&&jt!==null&&jt!==void 0&&jt>Cn?`Input should not exceed ${Cn}`:""}};return xn=gn.required()||gn.maxLength()||gn.minLength()||gn.urlRegex()||gn.regex()||gn.dateTime()||gn.date()||gn.minValue()||gn.maxValue()||"",xn},fe=(it,Pt)=>{for(const Zt of Pt)if(Zt.item){if(Zt.item.find(Lt=>Lt.linkId===it.linkId))return Zt;const qt=fe(it,Zt.item);if(qt)return qt}return null},ue=(it,Pt)=>{if(it.answer&&it.answer.length>1)return!0;if(it.item){const Zt=it.item.find(en=>en.linkId===Pt.linkId);if(Zt&&Zt.answer&&Zt.answer.length>1)return!0}return!1},te=(it,Pt,Zt,en)=>{var qt,Lt;const{required:ln}=it,Un=(qt=en.item)==null?void 0:qt.find(Tn=>Tn.linkId===it.linkId),cr=Un?.answer||[],M0=((Lt=en.answer)==null?void 0:Lt.length)||1;for(let Tn=0;Tn<M0;Tn++){const xn=cr[Tn];if(ln){if(!xn||!he(xn))return`Item ${Tn+1}: ${it.text||it.linkId} is required`;const nn=pe(it.extension,it.type,!0,it.maxLength,[xn],it.answerOption);if(nn)return`Item ${Tn+1}: ${nn}`}else if(xn&&he(xn)){const nn=pe(it.extension,it.type,!1,it.maxLength,[xn],it.answerOption);if(nn)return`Item ${Tn+1}: ${nn}`}}return""},J=(it,Pt)=>{for(const Zt of it){if(Zt?.linkId===Pt)return Zt;if(Zt?.item&&Zt.item.length>0){const en=J(Zt.item,Pt);if(en)return en}}},ge=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===FOOTER_CODE))}))},Se=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>Zt.url===y.oA&&Zt.valueBoolean))},Le=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===HEADER_CODE))}))},Ee=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===y.gD&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===y.n4&&Lt.code===y._l))}))},Ie=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>Zt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&Zt.valueBoolean))},xe=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===CHECKBOX_CODE))}))},$e=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.fe);return Zt?.valueInteger},at=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.zO);return Zt?.valueInteger},bt=it=>{var Pt;const Zt=(Pt=it?.extension)==null?void 0:Pt.find(en=>en.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return Zt?.valueInteger},Ot=(it,Pt,Zt,en,qt,Lt)=>{const ln=cr=>Pt.filter(M0=>M0.linkId===cr),Un=new Set;return it.map(cr=>{if(Un.has(cr.linkId)||ge(cr))return null;const Tn=ln(cr.linkId),xn=cr.type==="group"&&cr.repeats;if(Un.add(cr.linkId),xn){const nn=[];if(Tn.forEach((mt,Nt)=>{const jt={linkId:cr.linkId,text:cr.text};let gn;if(Zt===cr.linkId&&typeof Lt=="number"&&Lt===Nt&&qt&&qt.length>0){const tn=mt?.item||[];gn=[...tn],qt.forEach(Cn=>{const er=gn.findIndex(Fr=>Fr.linkId===Cn.linkId);er>=0?gn[er]=v(f({},tn[er]),{answer:Cn.answer}):gn.push(Cn)})}else cr.item&&(gn=Ot(cr.item,mt?.item||[],Zt,en,qt,Nt));Zt===cr.linkId&&typeof Lt=="number"&&Lt===Nt&&en?jt.answer=en:jt.answer=mt.answer||[{}],gn&&gn.length>0?jt.item=gn:mt.item&&(jt.item=mt.item),nn.push(jt)}),Zt===cr.linkId&&typeof Lt=="number"&&Lt>=Tn.length)for(let mt=Tn.length;mt<=Lt;mt++){const Nt={linkId:cr.linkId,text:cr.text,answer:mt===Lt&&en?en:[{}]};mt===Lt&&qt&&qt.length>0?Nt.item=qt:cr.item&&(Nt.item=Ot(cr.item,[],void 0,void 0,void 0,void 0)),nn.push(Nt)}return nn}else if(cr.repeats&&typeof Lt=="number"&&Zt===cr.linkId){const nn=Tn[0]||{linkId:cr.linkId,text:cr.text,answer:[]},mt={linkId:cr.linkId,text:cr.text,answer:[...nn.answer||[]]};if(en&&en.length>0){for(;mt.answer.length<=Lt;)mt.answer.push({});mt.answer[Lt]=en[0]}return mt}else{const nn=Tn[0],mt=cr.item?Ot(cr.item,nn?.item||[],Zt,en,qt,Lt):void 0,Nt=mt&&mt.length>0,jt={linkId:cr.linkId,text:cr.text};return Zt&&cr.linkId===Zt&&typeof Lt!="number"?(en||!en&&!qt?jt.answer=en:nn?.answer&&(jt.answer=nn.answer),qt?jt.item=qt:Nt&&(jt.item=mt)):(nn?.answer?jt.answer=nn.answer:jt.answer=[{}],Nt&&(jt.item=mt)),jt}}).filter(Boolean).flat()},_t=(it,Pt)=>{for(const Zt of it)if(Zt.linkId===Pt||Zt.item&&_t(Zt.item,Pt))return Zt.linkId;return null},Yt=(it,Pt,Zt,en)=>{var qt;const Lt=(qt=it?.item)!=null?qt:en;return!Lt||Lt.length===0?!0:Lt.every(ln=>{var Un;const cr=K(Pt,ln.linkId);if(cr.length===0){const M0=(Un=F(Pt,ln.linkId))==null?void 0:Un.answer;if(ve(ln,Pt,M0)&&ae(ln.enableWhen,ln.enableBehavior,Pt)&&Zt.includes(ln.linkId))return!1}else for(const M0 of cr)if(ve(ln,Pt,M0.answer)&&ae(ln.enableWhen,ln.enableBehavior,Pt)&&Zt.includes(ln.linkId))return!1;return ln.item?Yt(ln,Pt,Zt):!0})},St=(it,Pt,Zt=!0)=>{for(const en of it)if(en.linkId===Pt&&en.answer&&en.answer.length>0||en.item&&en.item.length>0&&St(en.item,Pt,Zt))return!0;return!1},Ke=(it,Pt,Zt=0)=>{const en=it.filter(qt=>qt.linkId===Pt);if(en.length>Zt){const qt=en[Zt];if(qt.answer&&qt.answer.length>0)return qt.answer.some(Lt=>Lt&&Object.keys(Lt).length>0&&Object.values(Lt).some(ln=>ln!=null&&ln!==""));if(qt.item&&qt.item.length>0)return St(qt.item,Pt,!1)}return St(it,Pt,!1)},Fe=(it,Pt)=>{if(!it||!it.item)return!1;const Zt=en=>{var qt;if(Se(en)&&en.required&&ae(en.enableWhen,en.enableBehavior,Pt)){const Lt=F(Pt,en.linkId),ln=pe(en.extension,en.type,en.required,en.maxLength,Lt?.answer,en.answerOption);if(!((qt=Lt?.answer)!=null&&qt.length)||ln)return!0}if(en.item){for(const Lt of en.item)if(Zt(Lt))return!0}return!1};for(const en of it.item)if(Zt(en))return!0;return!1},Ct=it=>{var Pt,Zt,en;if(it.valueString!==void 0)return it.valueString;if(it.valueBoolean!==void 0)return it.valueBoolean;if(it.valueInteger!==void 0)return it.valueInteger;if(it.valueDecimal!==void 0)return it.valueDecimal;if(it.valueDate!==void 0)return it.valueDate;if(it.valueDateTime!==void 0)return it.valueDateTime;if(((Pt=it.valueCoding)==null?void 0:Pt.code)!==void 0)return it.valueCoding.code;if(((Zt=it.valueReference)==null?void 0:Zt.reference)!==void 0)return it.valueReference.reference;if(((en=it.valueQuantity)==null?void 0:en.value)!==void 0)return it.valueQuantity.value;if(it.valueAttachment!==void 0)return it.valueAttachment},Qe=it=>{const Pt={linkId:it.linkId};if(it.answer&&it.answer.length>0){const Zt=it.answer.map(en=>Ct(en)).filter(en=>en!==void 0);Zt.length>0&&(Pt.answer=Zt)}if(it.item&&it.item.length>0){const Zt=it.item.map(en=>Qe(en)).filter(en=>{const qt=Object.keys(en);return qt.length>1||qt.length===1&&qt[0]!=="linkId"});Zt.length>0&&(Pt.item=Zt)}return Pt},Ye=(it,Pt,Zt,en,qt,Lt)=>{var ln;const Un=(ln=Pt?.item)==null?void 0:ln[Zt[en]],cr=Un?.linkId;if(!cr)return!1;const M0=K(it,cr),Tn=K(qt,cr),xn=nn=>{if(nn!=null){if(Array.isArray(nn)){const mt=nn.filter(Nt=>Nt!=null).map(Nt=>xn(Nt)).filter(Nt=>Nt!==void 0);return mt.length===0||mt.length===1&&typeof mt[0]=="object"&&Object.keys(mt[0]).length===0?void 0:mt}if(typeof nn=="object"){const mt={};for(const[Nt,jt]of Object.entries(nn))if(jt!=null){const gn=xn(jt);gn!==void 0&&(mt[Nt]=gn)}return Object.keys(mt).length===0?void 0:mt}return nn}};if(M0.length!==Tn.length)return!1;for(let nn=0;nn<M0.length;nn++){const mt=M0[nn],Nt=Tn[nn];if(!mt||!Nt)return!1;const jt=Qe(xn(mt)),gn=Qe(xn(Nt));if(!_.isEqual(jt,gn))return!1}return en!==Lt},Dt=(it,Pt,Zt)=>Zt&&Zt.length>0&&!(Zt.length===1&&Object.keys(Zt[0]).length===0)&&ve(it,Pt,Zt)||null,pn=(it,Pt)=>{const Zt={},en=qt=>{qt.forEach(Lt=>{const ln=K(Pt,Lt.linkId);if(Et(Lt,it)||Lt.repeats)for(let Un=0;Un<ln.length;Un++){const cr=ln[Un];if(cr?.answer&&cr.answer.length>0){const M0=Dt(Lt,Pt,cr.answer);M0&&(Zt[Lt.linkId]=v(f({},Zt[Lt.linkId]),{[Un]:M0}))}}else{const Un=F(Pt,Lt.linkId);if(Un?.answer&&Un.answer.length>0){const cr=Dt(Lt,Pt,Un.answer);cr&&(Zt[Lt.linkId]={0:cr})}}Lt.item&&Lt.item.length>0&&en(Lt.item)})};return en(it),Zt},Sn=it=>{if(!it)return"";const Pt=it.split("-");if(Pt.length===3){const[Zt,en,qt]=Pt;return`${Zt.slice(-4)}-${en}-${qt}`}return""},et=it=>it.trim().replace(/[A-Za-z]+/g,""),Rt=(it,Pt)=>{const Zt=(en,qt)=>{for(const Lt of en){if(Lt.linkId===qt)return Lt.answer;if(Lt.item&&Lt.item.length>0){const ln=Zt(Lt.item,qt);if(ln!==void 0)return ln}}};return Zt(it,Pt)},Ht=(it,Pt)=>{if(!Pt||Pt.length===0)return null;const Zt=it.linkId,en=(qt,Lt,ln=[])=>{for(const Un of qt){const cr=[...ln,Un];if(Un.item){if(Un.item.some(xn=>xn.linkId===Lt))return cr.some(xn=>xn.repeats===!0)?Un:null;if(en(Un.item,Lt,cr))return Un}}return null};return en(Pt,Zt)},kn=(it,Pt)=>{if(!Pt||Pt.length===0)return!1;const Zt=it.linkId,en=(qt,Lt,ln=[])=>{for(const Un of qt){const cr=[...ln,Un];if(Un.item){if(Un.item.some(xn=>xn.linkId===Lt))return cr.some(xn=>{const nn=M(xn.extension||[]);return!!nn&&nn!==UI_TOOLKIT_FORM_CONTAINER});if(en(Un.item,Lt,cr))return!0}}return!1};return en(Pt,Zt)},Sr=(it,Pt,Zt)=>{const en={};if(!it)return en;const{linkId:qt}=Pt;if(it[qt]){const Lt=it[qt];en[qt]=Lt[Zt]||""}return Pt.item&&Pt.item.length>0&&Pt.item.forEach(Lt=>{if(it[Lt.linkId]){const ln=it[Lt.linkId];en[Lt.linkId]=ln[Zt]||""}}),en},hn=(it,Pt)=>{const Zt={};if(!it||!it[Pt])return Zt;const en=it[Pt];return Zt[Pt]=en[0]||"",Zt},In=it=>{const Pt=it.findIndex(Lt=>!Se(Lt)),Zt=Pt>=0?[Pt]:[],en=new Map;let qt=null;if(it.forEach((Lt,ln)=>{const Un=Ee(Lt);if(Un&&Lt.type==="group")ln!==Pt&&Zt.push(ln),en.set(ln,[ln]),qt=ln;else if(qt!==null&&!Un){const cr=en.get(qt)||[];en.set(qt,[...cr,ln])}}),it.length>0&&Zt.length>0){const Lt=Zt[0];if(!en.has(Lt)){const ln=Zt.find(cr=>cr>Lt),Un=[];for(let cr=Lt;cr<(ln??it.length);cr++)Un.push(cr);en.set(Lt,Un)}}return{groupIndices:Zt,itemsToRenderMap:en}},mr=(it,Pt,Zt,en)=>{let qt=[...en];const Lt=(ln,Un)=>{ln.forEach(cr=>{if((!cr?.enableWhen||ae(cr?.enableWhen,cr.enableBehavior,Un))&&cr.initial&&!St(Un,cr.linkId))if(cr.repeats){const M0=Un.filter(Tn=>Tn.linkId===cr.linkId);M0.length>0?M0.forEach((Tn,xn)=>{Ke(Un,cr.linkId,xn)||(qt=Ot(Zt,qt,cr.linkId,cr.initial,void 0,xn))}):qt=Ot(Zt,qt,cr.linkId,cr.initial)}else qt=Ot(Zt,qt,cr.linkId,cr.initial);cr.item&&Lt(cr.item,Un)})};return Lt(it,Pt),qt},Dn=(it,Pt,Zt)=>{if(!it)return[];const en=[],qt=Lt=>{Lt.required===Pt&&ae(Lt.enableWhen,Lt.enableBehavior,Zt)&&!Se(Lt)&&Lt.type!=="display"&&en.push(Lt),Lt.item&&Lt.item.length>0&&Lt.item.forEach(qt)};return it.forEach(qt),en},$r=(it,Pt)=>it.every(Zt=>{var en;const qt=K(Pt,Zt.linkId);if(qt.length>0)return qt.every(Lt=>!ve(Zt,Pt,Lt.answer));{const Lt=(en=F(Pt,Zt.linkId))==null?void 0:en.answer;return!ve(Zt,Pt,Lt)}}),kr=(it,Pt)=>{let Zt=-1;for(let en=it.length-1;en>=0;en--)if(it[en].linkId===Pt){Zt=en;break}return Zt},Wt=(it,Pt)=>it.filter(Zt=>Zt.linkId!==Pt).map(Zt=>Zt.item&&Zt.item.length>0?v(f({},Zt),{item:Wt(Zt.item,Pt)}):Zt),_e=(it,Pt,Zt=[])=>{const en=[],qt=Lt=>{Lt.forEach(ln=>{en.push(ln.linkId),ln.item&&ln.item.length>0&&qt(ln.item)})};for(let Lt=0;Lt<it.length;Lt++){const ln=it[Lt];if(ln.linkId===Pt){const Un=it.slice(0,Lt+1),cr=it.slice(Lt+1),{kept:M0,removed:Tn}=cr.reduce((xn,nn)=>{const mt=J(Zt,nn.linkId);return mt&&Se(mt)&&ae(mt.enableWhen,mt.enableBehavior,Un)?xn.kept.push(nn):xn.removed.push(nn),xn},{kept:[],removed:[]});return qt(Tn),{trimmedData:[...Un,...M0],trimmedLinkIds:en,found:!0}}if(ln.item&&ln.item.length>0){const Un=_e(ln.item,Pt,Zt);if(Un.found){const cr=it.slice(0,Lt),M0=it.slice(Lt+1),Tn=[...cr,v(f({},ln),{item:Un.trimmedData})],{kept:xn,removed:nn}=M0.reduce((mt,Nt)=>{const jt=J(Zt,Nt.linkId);return jt&&Se(jt)&&ae(jt.enableWhen,jt.enableBehavior,Tn)?mt.kept.push(Nt):mt.removed.push(Nt),mt},{kept:[],removed:[]});return qt(nn),{trimmedData:[...Tn,...xn],trimmedLinkIds:[...Un.trimmedLinkIds,...en],found:!0}}}}return{trimmedData:it,trimmedLinkIds:[],found:!1}},lt=(it,Pt)=>it.filter(Zt=>!Pt.includes(Zt.linkId)).map(Zt=>Zt.item&&Zt.item.length>0?v(f({},Zt),{item:lt(Zt.item,Pt)}):Zt),Je=it=>{var Pt;if(!it)return"empty";const Zt=y.Z$.find(({patterns:en})=>en.some(qt=>it.includes(qt)));return(Pt=Zt?.type)!=null?Pt:"empty"},nt=(it,Pt)=>{const{groupIndices:Zt}=In(it),en=it.findIndex(qt=>qt.linkId===Pt);return en!==-1?Zt.indexOf(en):-1},ot=it=>{if(!it)return{restriction:null,warning:null};const Pt=Zt=>{const en=it.find(Lt=>Lt.url===Zt&&Lt.valueString);if(!en?.valueString)return null;const qt=en.valueString.replace(/\\n/g,`
|
|
869
|
+
`}}customElements.get(ge)===void 0&&customElements.define(ge,Se);const Le=[{name:"loader",defaultElement:document.createElement(te)},{name:"error",defaultElement:document.createElement(ge)}],Ee=["error","loading"],Ie={error:"error",loading:"loader"},xe=({src:Ot,elementNameSuffix:_t,version:Yt,prefetchFeatureApp:St})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;window.bwell||(window.bwell=new ue({metadata:{version:Yt}}));const mr=`bwell-${_t}`;if(customElements.get(mr)!==void 0)return;class Dn extends h{constructor(){super(),Ke.add(this),Fe.set(this,(0,T.nanoid)()),Ct.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Ye.set(this,new q.EventEmitter),Dt.set(this,void 0),pn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),Ht.set(this,void 0),this.attachShadow({mode:"open"});const kr=new me(Le).attachToShadowRoot(this.shadowRoot);kr.addEventListener("visibilitychange",({visibility:Wt,container:_e,name:lt})=>{lt==="error"&&Wt==="visible"&&window.bwell._registerEmbeddableContent(_e),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=Wt==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Ht,{slots:kr,attributes:new $().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Ye,"f")},"f"),(0,p.__classPrivateFieldSet)(this,Dt,(0,p.__classPrivateFieldGet)(this,Ke,"m",kn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,pn,(0,p.__classPrivateFieldGet)(this,Ke,"m",Sr).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,Ke,"m",In).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,Sn,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,pn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Fe,this.id||(0,p.__classPrivateFieldGet)(this,Fe,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ct,new z((0,p.__classPrivateFieldGet)(this,Fe,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ct,"f").registerDispatcher(kr=>this.dispatchEvent(kr)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,Dt,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,Dt,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}),St&&(0,b.h)(Ot).catch(()=>{(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlot("error")}))})}disconnectedCallback(){var kr;(0,p.__classPrivateFieldGet)(this,Ye,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,pn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,et,"f")),(kr=(0,p.__classPrivateFieldGet)(this,Ct,"f"))===null||kr===void 0||kr.deregister(),(0,p.__classPrivateFieldGet)(this,Ye,"f").removeAllListeners()}}Fe=new WeakMap,Ct=new WeakMap,Qe=new WeakMap,Ye=new WeakMap,Dt=new WeakMap,pn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ht=new WeakMap,Ke=new WeakSet,kn=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${mr}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Fe,"f"),name:_t,elementName:mr,utils:(0,p.__classPrivateFieldGet)(this,Ht,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},Sr=function({visibility:kr,name:Wt}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=kr==="hidden"?"unset":"hidden"},hn=function(kr){(0,p.__classPrivateFieldGet)(this,Rt,"f")(),(0,p.__classPrivateFieldSet)(this,Rt,void 0,"f")},In=function(kr){return Wt=>{const _e=Ee.findIndex(Je=>Je===kr);if(!Ee.slice(0,_e).some(Je=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(Je)!==null)){if(Wt!==null)(0,p.__classPrivateFieldGet)(this,Rt,"f")&&(0,p.__classPrivateFieldGet)(this,Ke,"m",hn).call(this,kr),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[kr]),"f");else if(Wt===null&&(0,p.__classPrivateFieldGet)(this,Rt,"f")){(0,p.__classPrivateFieldGet)(this,Ke,"m",hn).call(this,kr);const Je=Ee.find(nt=>(0,p.__classPrivateFieldGet)(this,Ht,"f").attributes.get(nt)!==null);Je&&(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,Ht,"f").slots.showSlotLocked(Ie[Je]),"f")}}}},customElements.define(mr,Dn)}),$e={rE:"1.1087.1"},at="composite";var bt=e(67321);xe({src:`https://embeddables.prod.icanbwell.com/${at}/${$e.rE}/scripts/embeddable.federated.js`,elementNameSuffix:at,version:$e.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=(p,b,h)=>b in p?i(p,b,{enumerable:!0,configurable:!0,writable:!0,value:h}):p[b]=h,A=(p,b)=>{for(var h in b||(b={}))c.call(b,h)&&y(p,h,b[h]);if(g)for(var h of g(b))u.call(b,h)&&y(p,h,b[h]);return p},m=(p,b)=>o(p,a(b));const d=(p,b,h)=>{const f=_.cloneDeep(p);if(!f.contained||b<0)return f;const v=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(v!==-1&&!h){const M=f.contained[v];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===b+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[v]=M}}else h&&v!==-1&&(f.contained[v]=m(A({},f.contained[v]),{item:h}));return f},O=({formId:p,questionnaireResponse:b,showQuestionPrefix:h,nextQuestion:f,onGoBack:v,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:$}=useFHIRQuestionnaire(),q=(P=b.questionnaire)==null?void 0:P.replace("#",""),I=(D=b?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(b);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${$?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:C,questionnaireResponseItem:(N=b?.item)!=null?N:[],questionnaireSchema:I,status:b.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:v,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>v});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,p=(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},b=(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,v=({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,[$,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[ie,le]=(0,t.useState)(!1),ae=(0,t.useRef)(!1),me=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[ye,Te]=(0,t.useState)(me),[ve,ne]=(0,t.useState)(me),[se,{loading:he,error:pe}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[fe,{loading:ue,error:te}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ge,error:Se}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Te(me)},onCompleted:Yt=>{var St,Ke;const Fe=(Ke=(St=Yt.placeAutocomplete)==null?void 0:St.predictions)==null?void 0:Ke.map(Ct=>{var Qe;return{id:Ct.placeId,label:(0,s.removeAfterLastComma)(Ct.description),mainText:Ct?.mainText||((Qe=Ct.description.split(",")[0])==null?void 0:Qe.trim()),secondaryText:(0,s.removeAfterLastComma)(Ct?.secondaryText||Ct.description.split(",").slice(1).join(",").trim())}});Te(Fe?.length?Fe:me)}}),Le=(0,t.useMemo)(()=>ye.map(Yt=>b(p({},Yt),{displayLabel:(0,r.RZ)(Yt?.label||"",$)})),[$,ye]),Ee=Yt=>h(void 0,null,function*(){var St,Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;if(F(Yt),G(Yt),le(!1),Yt&&typeof Yt=="string"){const mr=ye.find(nt=>nt.id===Yt),Dn=mr?.label||$;if(!mr)return;q(Dn),k(Dn),setTimeout(()=>{const nt=[{id:mr.id,label:mr.label}];Te(nt),ne(nt)},f);const $r=yield se({variables:{placeId:Yt}}),kr=(Ke=(St=$r?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ke.latitude,Wt=(Ct=(Fe=$r?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ct.longitude,_e=((Ye=(Qe=$r?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",lt=((pn=(Dt=$r?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",Je=((et=(Sn=$r?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(kr&&Wt)if(!_e||!Je){const nt=yield fe({variables:{latitude:String(kr),longitude:String(Wt)}}),ot=((Ht=(Rt=nt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",ct=((Sr=(kn=nt?.data)==null?void 0:kn.geocodingByLatLon)==null?void 0:Sr.state)||"",Et=((In=(hn=nt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:kr,longitude:Wt,zipCode:ot,state:ct,stateCode:Et,placeId:Yt,description:Dn,value:Yt})}else T({latitude:kr,longitude:Wt,zipCode:_e,state:lt,stateCode:Je,placeId:Yt,description:Dn,value:Yt});else le(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Yt=>h(void 0,null,function*(){return yield J({variables:{input:Yt,types:"geocode"}})})),$e=Yt=>h(void 0,null,function*(){if(le(!1),q(Yt),z?.(Yt),!Yt||Yt.trim().length===0){F(null),Te(me),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Yt});return}const St=Yt.trim();St.length>=2?yield xe(St):Te(me)}),at=Yt=>{ae.current=Yt},bt=()=>{q(I),Te(ve),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var St,Ke,Fe,Ct,Qe,Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In;if(N&&w){Te([{id:N,label:$||w}]),ne([{id:N,label:$||w}]),F(N),G(N),q(w),k(w),w===$&&q(w);const mr=yield se({variables:{placeId:N}}),Dn=(Ke=(St=mr?.data)==null?void 0:St.geocodingByPlaceId)==null?void 0:Ke.latitude,$r=(Ct=(Fe=mr?.data)==null?void 0:Fe.geocodingByPlaceId)==null?void 0:Ct.longitude,kr=((Ye=(Qe=mr?.data)==null?void 0:Qe.geocodingByPlaceId)==null?void 0:Ye.zipCode)||"",Wt=((pn=(Dt=mr?.data)==null?void 0:Dt.geocodingByPlaceId)==null?void 0:pn.state)||"",_e=((et=(Sn=mr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Dn&&$r)if(!kr||!Wt||!_e){const lt=yield fe({variables:{latitude:String(Dn),longitude:String($r)}}),Je=((Ht=(Rt=lt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ht.zipCode)||"",nt=((Sr=(kn=lt?.data)==null?void 0:kn.geocodingByLatLon)==null?void 0:Sr.state)||"",ot=((In=(hn=lt?.data)==null?void 0:hn.geocodingByLatLon)==null?void 0:In.stateCode)||"";T({latitude:Dn,longitude:$r,zipCode:Je,state:nt,stateCode:ot,placeId:N,description:w,value:N})}else T({latitude:Dn,longitude:$r,zipCode:kr,state:Wt,stateCode:_e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Te(me),ne(me)}))()},[]);const Ot=ie||!!pe||!!te||!!Se||!!R,_t=Ot?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{C&&C(he||ue||D)},[C,he,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:$,isLoading:ge||he||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:Le,selectedKey:U,onSelectionChange:Ee,onInputChange:$e,defaultFilter:Ie,onOpenChange:at,onBlur:bt,isInvalid:Ot,hint:_t,autoComplete:"address-line1",className:"w-full",children:Yt=>{const St=Yt,Ke=$.trim().length>=2,Fe=St.mainText||"",Ct=St.secondaryText||"",Qe=Fe.trim().length>0,Ye=Ct.trim().length>0,Dt=Qe?(0,r.RZ)(Fe,$):{beforePart:"",highlightedPart:"",remainingPart:""},pn=Ye?(0,r.RZ)(Ct,$):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(i.Select.Item,{id:St.id,supportingText:St.supportingText,isDisabled:St.isDisabled,icon:St.icon,avatarUrl:St.avatarUrl,textValue:St.label,children:Ke&&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:Dt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Dt.highlightedPart}),(0,n.jsx)("span",{children:Dt.remainingPart})]}),Ye&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:pn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:pn.highlightedPart}),(0,n.jsx)("span",{children:pn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:St.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(11300);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 p=c.getId(O),b=c.getRouteMeta(p)||{},h=getBreadcrumbTitleKey(p,b,u);if(!h||b.breadcrumbHide)return[];const f=y[p];let v=c.getHref(p),M=h;return f&&(f.href?v=f.href:f.search&&(v=c.getHref({id:p,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:p,href:v,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,p=Object.getOwnPropertySymbols,b=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,v=(C,R)=>{for(var L in R||(R={}))b.call(R,L)&&f(C,L,R[L]);if(p)for(var L of p(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{$(L.next(q))}catch(I){D(I)}},w=q=>{try{$(L.throw(q))}catch(I){D(I)}},$=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);$((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)(),$=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[ie,le]=(0,t.useState)(!1),ae=(0,t.useCallback)(ge=>{F(ge);try{w(M(v({},q.current),{locationPermission:ge||o.Ef.UNAVAILABLE}))}catch(Se){Se instanceof Error?P?.error(Se,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Se)}`)}},[w,P]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ge)}`),!1}}),[D,P]),ye=(0,t.useCallback)(ge=>x(void 0,null,function*(){const Se=D.getCurrentPosition(ge).then(Le=>{if(!Le||!Le.coords)throw new Error("Location data is invalid or unavailable");return Le});try{return yield u(Se,y,"Location request timed out. Please check that location services are enabled.")}catch(Le){throw Le instanceof Error&&P?.error(Le,"Geolocation timeout or error"),Le}}),[D,P]),Te=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ve=(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 me()))return P?.error("Location services not available"),!1;const Se=yield Te();return Se!==o.Ef.GRANTED&&Se!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Se}`),!1):!0}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ge)}`),!1}}),[me,P,Te]);(0,t.useEffect)(()=>{if($.current)return;$.current=!0,(()=>x(void 0,null,function*(){const Se=N.locationPermission;if(Se===o.Ef.DENIED||Se===o.Ef.BLOCKED||Se===o.Ef.UNAVAILABLE){F(Se);return}k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}if(Se===o.Ef.GRANTED){try{const Ie=yield Te();if(Ie===o.Ef.GRANTED){const xe=yield ye(z);xe&&(G(xe),ae(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(ae(Ie),le(!0)):ae(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)}`),ae(o.Ef.UNAVAILABLE)}return}const Ee=yield Te();if(ae(Ee),Ee===o.Ef.GRANTED)try{const Ie=yield ye(z);Ie?G(Ie):ae(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),ae(o.Ef.UNAVAILABLE)}else Ee===o.Ef.PROMPT&&le(!0)}catch(Le){Le instanceof Error?P?.error(Le,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(Le)}`),ae(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const se=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){ae(o.Ef.UNAVAILABLE);return}k(!0);let Se=yield Te();if(ae(Se),Se===o.Ef.GRANTED||Se===o.Ef.PROMPT){if(L==="Android"&&Se===o.Ef.GRANTED)try{Se=yield ve(),ae(Se)}catch(Le){Le instanceof Error?P?.error(Le,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(Le)}`);return}if(Se!==o.Ef.UNAVAILABLE){const Le=yield ye(z);return G(Le),Le}}return}catch(ge){ae(o.Ef.UNAVAILABLE),ge instanceof Error?P?.error(ge,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ge)}`);return}finally{k(!1)}}),[ne,P,L,ae,ye,Te,ve]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield me())?yield Te():o.Ef.UNAVAILABLE}catch(ge){return ge instanceof Error?P?.error(ge,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ge)}`),o.Ef.UNAVAILABLE}}),[me,P,Te]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield Te();ae(Se)}catch(ge){ge instanceof Error?P?.error(ge,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ge)}`),ae(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[me,P,ae,Te]),fe=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield Te();if(Se===o.Ef.DENIED||Se===o.Ef.BLOCKED||Se===o.Ef.UNAVAILABLE){ae(Se);return}const Le=yield ve();if(ae(Le),["granted","prompt"].includes(Le)){const Ee=yield ye(z);return G(Ee),Ee}return}catch(ge){if(ge instanceof Error)ge.message.includes("User denied Geolocation")||P?.error(ge,"Error requesting location");else{const Se=ge&&typeof ge=="object"&&"message"in ge?ge.message:JSON.stringify(ge);Se?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Se}`)}ae(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[me,P,ae,ye,ve,Te]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield me())){ae(o.Ef.UNAVAILABLE);return}const Se=yield ye(z);Se&&(G(Se),F(o.Ef.GRANTED),w(M(v({},q.current),{location:`${Se.coords.latitude},${Se.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Se.coords.latitude}`,lng:`${Se.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ge){throw ge instanceof Error?P?.error(ge,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ge)}`),ae(o.Ef.UNAVAILABLE),ge}finally{k(!1)}}),[me,P,w,ae,ye]),te=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ge=yield se();ge&&w(M(v({},q.current),{location:`${ge.coords.latitude},${ge.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ge.coords.latitude}`,lng:`${ge.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ge){ge instanceof Error?P?.error(ge,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ge)}`)}finally{k(!1)}}),[P,U,se,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:te,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:se,requestPosition:fe,requestCurrentLocation:ue,checkAndSetLocationPermission:pe,checkLocaitonPermission:he}),[I,te,U,K,se,fe,ue,pe,he]);return(0,n.jsxs)(T.Provider,{value:J,children:[ie&&(0,n.jsx)(g.J,{isOpen:ie,onClose:()=>le(!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)},71934:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267);const s=({onClick:i})=>{const{loading:o,i18n:{t:a}}=useI18nChild({keys:["health-space"]});return o?jsx(LoadingIndicator,{}):jsxs("div",{className:"tw-preflight flex h-full flex-col items-center justify-center gap-6 p-2 text-center md:p-4",children:[jsx(CircleIcon,{icon:Users01,size:"xl",className:"p-4 shadow-xl"}),jsxs("div",{className:"flex flex-col items-center gap-3",children:[jsx(Typography,{tag:"h2",className:"text-primary text-md font-semibold",children:a("YOUR_CARE_TEAM_IS_EMPTY")}),jsx(Typography,{tag:"p",className:"text-tertiary text-sm md:max-w-[26rem]",children:a("START_BUILDING_YOUR_CARE_TEAM")})]}),jsx(Button,{size:"sm",className:"w-fit min-w-[10rem] rounded-full shadow-lg",onClick:i,children:a("FIND_DOCTORS")})]})}},69364:(Z,l,e)=>{"use strict";e.d(l,{pc:()=>In,GI:()=>F,rz:()=>_t,Fp:()=>Ot,el:()=>bt,ao:()=>at,oA:()=>T,Yt:()=>mr,g4:()=>$e,tn:()=>Wt,n4:()=>S,gD:()=>z,Vp:()=>Sr,Cx:()=>P,bK:()=>R,gi:()=>hn,Z$:()=>me,GT:()=>kn,hr:()=>ye,JL:()=>Te,Ck:()=>L,dU:()=>C,wG:()=>Ye,hZ:()=>Ct,$e:()=>Yt,qT:()=>Fe,GQ:()=>Ke,q3:()=>Qe,D_:()=>St,Uf:()=>N,_l:()=>G,Md:()=>q,V7:()=>$,fe:()=>le,JP:()=>Et,Z_:()=>E,zO:()=>ae,UZ:()=>k,$7:()=>xe,rb:()=>w,VF:()=>Rt,vf:()=>pn,PV:()=>Ht,PS:()=>Dt,Iz:()=>et,zD:()=>I,m3:()=>Le,XP:()=>Ee,PM:()=>pe,cX:()=>ve,G6:()=>ne,Us:()=>ue,AA:()=>he,G0:()=>Se,mO:()=>J,HH:()=>fe,PU:()=>kr,Tl:()=>ge,uH:()=>Ie,c3:()=>se,rx:()=>x});var n=e(36087),t=e(14041);const r=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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 p=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));p.displayName="Virus";const b=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));b.displayName="CreditCard02";const h=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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 v=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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"}));v.displayName="ClipboardPlus";const M=({size:st=24,color:oe="currentColor",...Me})=>t.createElement("svg",{viewBox:"0 0 24 24",width:st,height:st,stroke:oe,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Me},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",$="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",q="http://hl7.org/fhir/StructureDefinition/entryFormat",I="http://hl7.org/fhir/StructureDefinition/tz-code",k="tz-code",U="footer",F="check-box",K="header",G="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",le="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",ae="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",me=[{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"}],ye={"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"},Te={"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"},ve="ui-toolkit/CoordinatePicker",ne="ui-toolkit/DetailsInfo",se="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",pe="ui-toolkit/Button",fe="ui-toolkit/Phone",ue="ui-toolkit/ErrorCard",te="ui-toolkit/FormContainer",J="ui-toolkit/PageHeader",ge="ui-toolkit/SelectableOption",Se="ui-toolkit/Modal",Le="ui-toolkit/Alert",Ee="ui-toolkit/AppSectionAccess",Ie="ui-toolkit/SensitiveDataCategory",xe="http://icanbwell.com/fhir/StructureDefinition/subtitle",$e="http://icanbwell.com/fhir/StructureDefinition/icon-name",at="http://icanbwell.com/fhir/StructureDefinition/error-title",bt="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",Ot="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",_t="http://icanbwell.com/fhir/StructureDefinition/description",Yt="http://icanbwell.com/fhir/StructureDefinition/modal-description",St="http://icanbwell.com/fhir/StructureDefinition/modal-title",Ke="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",Fe="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Ct="http://icanbwell.com/fhir/StructureDefinition/button-text",Qe="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",Dt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",pn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Sn="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",et="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Rt="http://icanbwell.com/fhir/StructureDefinition/trigger-color",Ht="http://icanbwell.com/fhir/StructureDefinition/trigger-size",kn="http://hl7.org/fhir/StructureDefinition/mimeType",Sr="http://hl7.org/fhir/StructureDefinition/maxSize",hn="http://icanbwell.com/fhir/StructureDefinition/message-severity",In="http://icanbwell.com/fhir/StructureDefinition/alert-color",mr="http://icanbwell.com/fhir/StructureDefinition/hideLabel",Dn="http://icanbwell.com/fhir/StructureDefinition/placeholder",$r="http://icanbwell.com/fhir/StructureDefinition/hint-text",kr="ui-toolkit/PrefilledMemberDemographicsAlert",Wt="http://hl7.org/fhir/issue-severity",_e="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",lt="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Je="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",nt="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",ot="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",ct={},Et={"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:p,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":b,"link-03":h,"search-lg":f.q,"clipboard-plus":v,route:M}},25624:(Z,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>$e,CP:()=>et,Fy:()=>Sn,GN:()=>ae,J4:()=>Je,MU:()=>F,Nw:()=>Wt,Qr:()=>T,Ue:()=>nt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>$,eC:()=>ot,iI:()=>q,lv:()=>w,mR:()=>ze,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Ue,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,p=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,h=(it,Pt,Zt)=>Pt in it?A(it,Pt,{enumerable:!0,configurable:!0,writable:!0,value:Zt}):it[Pt]=Zt,f=(it,Pt)=>{for(var Zt in Pt||(Pt={}))p.call(Pt,Zt)&&h(it,Zt,Pt[Zt]);if(O)for(var Zt of O(Pt))b.call(Pt,Zt)&&h(it,Zt,Pt[Zt]);return it},v=(it,Pt)=>m(it,d(Pt));const M=it=>{var Pt;return(Pt=it.filter(Zt=>Zt.url.includes("questionnaire-itemControl")).flatMap(Zt=>{var en,qt;return(qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)!=null?qt:[]}).find(Zt=>{var en;return(en=Zt.code)==null?void 0:en.startsWith("ui-toolkit/")}))==null?void 0:Pt.code},x=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.V7);return Zt?.valueCode||"off"},z=(it,Pt,Zt)=>{const en=(0,u.A)(Zt);return it&&Pt&&Zt?en.replace("<p>",`<span>${Pt} `).replace("</p>","</span>").trim():en.replace("<p>","<span>").replace("</p>","</span>").trim()},T=it=>{const Pt=it?.find(Zt=>Zt.url===y.Vp);return Pt?.valueInteger},S=it=>{const Pt=it?.find(Zt=>Zt.url===y.Z_);return Pt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(it,Pt)=>{const Zt=it?.find(en=>en.url===PLACEHOLDER_EXTENSION_URL);return Zt?.valueString||Pt&&E[Pt]||C},L=it=>{const Pt=it?.find(Zt=>Zt.url===HINT_TEXT_EXTENSION_URL);return Pt?.valueString},P=it=>{const Pt=it?.filter(Zt=>Zt.url===y.GT&&Zt.valueCode).map(Zt=>y.hr[Zt.valueCode]||Zt.valueCode);return Pt?.length?Pt.join(","):void 0},D=it=>it.split(",").map(en=>en.trim()).map(en=>y.JL[en]||en).filter((en,qt,Lt)=>Lt.indexOf(en)===qt).join(", "),N=(it,Pt,Zt)=>{const en=D(it),qt=en.lastIndexOf(","),Lt=qt!==-1?`${en.substring(0,qt)} or${en.substring(qt+1)}`:en,ln=[Pt&&`max. ${(Pt/(1e3*1e3)).toFixed(0)}MB`,Zt&&`upto ${Zt} file${Zt>1?"s":""}`].filter(Boolean);return ln.length>0?`${Lt} (${ln.join(", ")})`:Lt},w=it=>{const Pt=it?.find(Zt=>Zt?.url===y.zD||Zt?.url===y.UZ);return Pt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},$=(it,Pt)=>{var Zt,en,qt;const Lt=Pt?.find(ln=>ln.url.includes(it));return(qt=(en=(Zt=Lt?.valueInteger)!=null?Zt:Lt?.valueDecimal)!=null?en:Lt?.valueString)!=null?qt:Lt?.valueDate},q=it=>{if(!!it){if(/^\d{4}-\d{2}-\d{2}$/.test(it))return it;try{const Pt=(0,o.evaluate)({},it);if(Array.isArray(Pt)&&Pt.length>0){const Zt=Pt[0];if(Zt instanceof Date&&!isNaN(Zt.getTime())){const en=Zt.getFullYear(),qt=String(Zt.getMonth()+1).padStart(2,"0"),Lt=String(Zt.getDate()).padStart(2,"0");return`${en}-${qt}-${Lt}`}if(typeof Zt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(Zt))return Zt}}catch{}}},I=(it,Pt)=>{var Zt,en;const qt=Pt?.find(ln=>ln.url===it);if(!qt)return;const Lt=(Zt=qt.valueString)!=null?Zt:qt.valueDate;return Lt||q((en=qt.valueExpression)==null?void 0:en.expression)},k=(it,Pt)=>{if(!(!it||it.length===0))for(const Zt of it){const en=$(Pt,Zt.extension);if(en!==void 0)return en;if(Zt.item&&Zt.item.length>0){const qt=k(Zt.item,Pt);if(qt!==void 0)return qt}}},U=(it,Pt)=>{try{const Zt=String(it??Pt);let en;if(Zt.includes("/"))en=(0,n.A)(Zt,"MM/dd/yyyy",new Date);else{const qt=Zt.split("T")[0];en=(0,t.A)(qt)}return(0,r.A)(en)}catch(Zt){return console.error("Date parsing error:",Zt,it),null}},F=(it,Pt)=>{var Zt;for(const en of it){if(en.linkId===Pt)return en;if((Zt=en.item)!=null&&Zt.length){const qt=F(en.item,Pt);if(qt!==void 0)return qt}}},K=(it,Pt)=>{var Zt;const en=[];for(const qt of it)if(qt.linkId===Pt&&en.push(qt),(Zt=qt.item)!=null&&Zt.length){const Lt=K(qt.item,Pt);en.push(...Lt)}return en},G=(it,Pt,Zt=0)=>K(it,Pt)[Zt];function ie(it){return it!=null}const le=(it,Pt)=>{var Zt,en,qt;if("answerString"in it&&ie(it.answerString)){if(it.operator==="=")return Pt?.valueString===it.answerString;if(it.operator==="!=")return Pt?.valueString!==it.answerString}if("answerBoolean"in it&&ie(it.answerBoolean)){if(it.operator==="=")return Pt?.valueBoolean===it.answerBoolean;if(it.operator==="!=")return Pt?.valueBoolean!==it.answerBoolean}if("answerInteger"in it&&ie(it.answerInteger)||"answerDecimal"in it&&ie(it.answerDecimal)){const Lt=Number(Pt?.valueInteger||Pt?.valueDecimal),ln=Number(it.answerInteger||it.answerDecimal);if(it.operator==="=")return Lt===ln;if(it.operator==="!=")return Lt!==ln;if(it.operator===">")return Lt>ln;if(it.operator==="<")return Lt<ln;if(it.operator===">=")return Lt>=ln;if(it.operator==="<=")return Lt<=ln}if("answerQuantity"in it&&ie(it.answerQuantity)){const Lt=Pt?.valueQuantity,ln=it.answerQuantity;if(Lt?.unit!==ln?.unit)return!1;if(it.operator==="=")return Lt.value===ln.value;if(it.operator==="!=")return Lt.value!==ln.value;if(it.operator===">")return Lt.value>ln.value;if(it.operator==="<")return Lt.value<ln.value;if(it.operator===">=")return Lt.value>=ln.value;if(it.operator==="<=")return Lt.value<=ln.value}if("answerCoding"in it&&ie(it.answerCoding)){const Lt=Pt?.valueCoding,ln=it.answerCoding;if(it.operator==="=")return Lt?.code===ln.code;if(it.operator==="!=")return Lt?.code!==ln.code}if("answerReference"in it&&ie(it.answerReference)){const Lt=Pt?.valueReference,ln=it.answerReference;if(it.operator==="=")return Lt?.reference===ln.reference;if(it.operator==="!=")return Lt?.reference!==ln.reference}if("answerDate"in it&&ie(it.answerDate)||"answerDateTime"in it&&ie(it.answerDateTime)||"answerTime"in it&&ie(it.answerTime)){const Lt=new Date((qt=(en=(Zt=Pt?.valueDate)!=null?Zt:Pt?.valueDateTime)!=null?en:Pt?.valueTime)!=null?qt:""),ln=new Date(it.answerDate||it.answerDateTime||it.answerTime||"");if(it.operator==="=")return Lt.getTime()===ln.getTime();if(it.operator==="!=")return Lt.getTime()!==ln.getTime();if(it.operator===">")return Lt.getTime()>ln.getTime();if(it.operator==="<")return Lt.getTime()<ln.getTime();if(it.operator===">=")return Lt.getTime()>=ln.getTime();if(it.operator==="<=")return Lt.getTime()<=ln.getTime()}return it.operator==="exists"?Pt!=null===it.answerBoolean:!0},ae=(it,Pt,Zt)=>{const en=qt=>{const Lt=K(Zt,qt.question);return Lt.length===0||Lt.every(ln=>!ln.answer||ln.answer.length===0)?le(qt,void 0):Lt.some(ln=>{var Un;return(Un=ln.answer)==null?void 0:Un.some(cr=>le(qt,cr&&Object.keys(cr).length>0?cr:void 0))})};return it&&it?.length>0?Pt==="any"?it?.some(qt=>en(qt)):it?.every(qt=>en(qt)):!0},me=(it,Pt,Zt,en,qt)=>{if(!it||it.length===0)return!0;const Lt=ln=>{var Un;let cr;if(en&&typeof qt=="number"){const Tn=Zt.filter(xn=>xn.linkId===en)[qt];if(Tn?.item){const xn=Tn.item.find(nn=>nn.linkId===ln.question);if(xn?.answer&&xn.answer.length>0)return(Un=xn?.answer)==null?void 0:Un.some(nn=>le(ln,nn&&Object.keys(nn).length>0?nn:void 0))}}if(!cr){const M0=K(Zt,ln.question);if(M0.length>0)return M0.some(Tn=>{var xn;return(xn=Tn.answer)==null?void 0:xn.some(nn=>le(ln,nn&&Object.keys(nn).length>0?nn:void 0))});cr=void 0}return le(ln,cr)};return Pt==="any"?it.some(ln=>Lt(ln)):it.every(ln=>Lt(ln))},ye=(it,Pt)=>{var Zt;if(!!((Zt=it?.valueExpression)!=null&&Zt.expression))try{const en=evaluate(Pt,it.valueExpression.expression);return Array.isArray(en)?en.some(qt=>Boolean(qt)):Boolean(en)}catch{return}},Te=(it,Pt)=>{var Zt;const en=(Zt=it.extension)==null?void 0:Zt.find(Lt=>Lt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),qt=ye(en,Pt);return v(f({},it),{readOnly:qt??it.readOnly})},ve=(it,Pt,Zt)=>{const{required:en,maxLength:qt,type:Lt,extension:ln,enableWhen:Un,enableBehavior:cr,repeats:M0,answerOption:Tn}=it;if(!ae(Un,cr,Pt)||it.type==="group"||it.type==="display")return"";if(M0)return ne(it,Pt,Zt);const xn=fe(it,Pt);return xn&&ue(xn,it)?te(it,Pt,Zt,xn):pe(ln,Lt,en,qt,Zt,Tn)},ne=(it,Pt,Zt)=>{const{required:en}=it;if(en){if(!Zt||Zt.length===0)return"At least one item is required";let qt=!1;for(let Lt=0;Lt<Zt.length;Lt++){const ln=Zt[Lt];if(ln&&Object.keys(ln).length>0&&Object.values(ln).some(cr=>cr!=null&&cr!==""&&(Array.isArray(cr)?cr.length>0:!0))){qt=!0;const cr=pe(it.extension,it.type,!0,it.maxLength,[ln],it.answerOption);if(cr)return`Item ${Lt+1}: ${cr}`;if(it.item&&it.item.length>0){const M0=se(it.item,Pt,it.linkId,Lt);if(M0)return`Item ${Lt+1}: ${M0}`}}else return`Item ${Lt+1}: This field is required`}if(!qt)return"At least one item is required"}else if(Zt&&Zt.length>0)for(let qt=0;qt<Zt.length;qt++){const Lt=Zt[qt];if(Lt&&Object.keys(Lt).length>0&&Object.values(Lt).some(Un=>Un!=null&&Un!==""&&(Array.isArray(Un)?Un.length>0:!0))){const Un=pe(it.extension,it.type,!1,it.maxLength,[Lt],it.answerOption);if(Un)return`Item ${qt+1}: ${Un}`;if(it.item&&it.item.length>0){const cr=se(it.item,Pt,it.linkId,qt);if(cr)return`Item ${qt+1}: ${cr}`}}}return""},se=(it,Pt,Zt,en)=>{var qt,Lt;for(const ln of it){if(!me(ln.enableWhen,ln.enableBehavior,Pt,Zt,en))continue;const Un=F(Pt,Zt),cr=(qt=Un?.item)==null?void 0:qt.find(Tn=>Tn.linkId===ln.linkId),M0=(Lt=cr?.answer)!=null&&Lt[en]?[cr.answer[en]]:void 0;if(ln.required){if(!M0||!M0[0]||!he(M0[0]))return`${ln.text||ln.linkId} is required`;const Tn=pe(ln.extension,ln.type,!0,ln.maxLength,M0,ln.answerOption);if(Tn)return`${ln.text||ln.linkId}: ${Tn}`}else if(M0&&M0[0]&&he(M0[0])){const Tn=pe(ln.extension,ln.type,!1,ln.maxLength,M0,ln.answerOption);if(Tn)return`${ln.text||ln.linkId}: ${Tn}`}if(ln.item&&ln.item.length>0){const Tn=se(ln.item,Pt,ln.linkId,en);if(Tn)return Tn}}return""},he=it=>!it||Object.keys(it).length===0?!1:Object.values(it).some(Pt=>Pt!=null&&Pt!==""&&(Array.isArray(Pt)?Pt.length>0:!0)),pe=(it,Pt,Zt,en,qt,Lt)=>{var ln,Un,cr,M0,Tn;let xn="";const nn=!!it?.find(tn=>{var Cn,er;return tn.url===y.gD&&((er=(Cn=tn.valueCodeableConcept)==null?void 0:Cn.coding)==null?void 0:er.some(Fr=>Fr.system===y.n4&&Fr.code===y.GI))}),mt=qt?.[0],Nt={choice:((ln=mt?.valueCoding)==null?void 0:ln.code)||(mt?.valueString&&Lt?.some(tn=>tn.valueString===mt.valueString)?mt.valueString:null),"open-choice":((Un=mt?.valueCoding)==null?void 0:Un.code)||mt?.valueString,boolean:mt?.valueBoolean,string:mt?.valueString,text:mt?.valueString,url:mt?.valueUri,integer:mt?.valueInteger,decimal:mt?.valueDecimal,dateTime:mt?.valueDateTime,date:mt?.valueDate,time:mt?.valueTime,quantity:(cr=mt?.valueQuantity)==null?void 0:cr.value,reference:(M0=mt?.valueReference)==null?void 0:M0.display,attachment:(Tn=mt?.valueAttachment)==null?void 0:Tn.title};if(!(Pt in Nt))return"";const jt=Nt[Pt],gn={required:()=>Zt&&(jt==null||jt===""||jt==="NaN"||Number.isNaN(jt)||Pt==="boolean"&&jt!==!0&&nn)?"This field is required":"",maxLength:()=>en&&jt!==null&&jt!==void 0&&jt.toString().length>en?`Input should not exceed ${en} characters`:"",minLength:()=>{const tn=$("minLength",it);return tn&&jt!==null&&jt!==void 0&&jt.toString().length<Number(tn)?`Input should be at least ${tn} characters`:""},urlRegex:()=>{const tn=new RegExp(y.rx),Cn=$("regexError",it),er=Cn??"Please enter a valid url starting from http:// and https://";return tn&&Pt==="url"&&jt&&!tn.test(jt)?String(er):""},regex:()=>{const tn=$("regex",it);if(!tn||typeof jt!="string")return"";const Cn=new RegExp(tn),er=$("regexError",it),Fr=er??"Please enter a valid input";return Cn&&jt&&!Cn.test(jt)?String(Fr):""},dateTime:()=>{if(Pt==="dateTime"&&jt){const tn=jt?.toString(),Cn=new Date(tn);return isNaN(Cn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Pt!=="date"||!jt)return"";const tn=jt.replace(/\D/g,"");return tn.length>0&&tn.length<8||isNaN(new Date(jt).getTime())?"Invalid date":""},minValue:()=>{var tn;if(Pt==="date"){const er=I(y.dU,it),Fr=U(er??"01/01/1900","01/01/1900"),Vr=U(jt,"");if(!Fr||!Vr)return"";if((0,s.A)(Vr,Fr)){const Hr=(tn=it?.find(f0=>f0.url===y.Ck))==null?void 0:tn.valueString;return Hr??`Date should not be before ${er??"01/01/1900"}`}return""}const Cn=$("minValue",it);return Cn!=null&&jt!==null&&jt!==void 0&&jt<Cn?`Input should not be less than ${Cn}`:""},maxValue:()=>{var tn;if(Pt==="date"){const er=I(y.bK,it),Fr=U(er??"01/01/2100","01/01/2100"),Vr=U(jt,"");if(!Fr||!Vr)return"";if((0,i.A)(Vr,Fr)){const Hr=(tn=it?.find(f0=>f0.url===y.Cx))==null?void 0:tn.valueString;return Hr??`Date should not be after ${er??"01/01/2100"}`}return""}const Cn=$("maxValue",it);return Cn!=null&&jt!==null&&jt!==void 0&&jt>Cn?`Input should not exceed ${Cn}`:""}};return xn=gn.required()||gn.maxLength()||gn.minLength()||gn.urlRegex()||gn.regex()||gn.dateTime()||gn.date()||gn.minValue()||gn.maxValue()||"",xn},fe=(it,Pt)=>{for(const Zt of Pt)if(Zt.item){if(Zt.item.find(Lt=>Lt.linkId===it.linkId))return Zt;const qt=fe(it,Zt.item);if(qt)return qt}return null},ue=(it,Pt)=>{if(it.answer&&it.answer.length>1)return!0;if(it.item){const Zt=it.item.find(en=>en.linkId===Pt.linkId);if(Zt&&Zt.answer&&Zt.answer.length>1)return!0}return!1},te=(it,Pt,Zt,en)=>{var qt,Lt;const{required:ln}=it,Un=(qt=en.item)==null?void 0:qt.find(Tn=>Tn.linkId===it.linkId),cr=Un?.answer||[],M0=((Lt=en.answer)==null?void 0:Lt.length)||1;for(let Tn=0;Tn<M0;Tn++){const xn=cr[Tn];if(ln){if(!xn||!he(xn))return`Item ${Tn+1}: ${it.text||it.linkId} is required`;const nn=pe(it.extension,it.type,!0,it.maxLength,[xn],it.answerOption);if(nn)return`Item ${Tn+1}: ${nn}`}else if(xn&&he(xn)){const nn=pe(it.extension,it.type,!1,it.maxLength,[xn],it.answerOption);if(nn)return`Item ${Tn+1}: ${nn}`}}return""},J=(it,Pt)=>{for(const Zt of it){if(Zt?.linkId===Pt)return Zt;if(Zt?.item&&Zt.item.length>0){const en=J(Zt.item,Pt);if(en)return en}}},ge=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===FOOTER_CODE))}))},Se=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>Zt.url===y.oA&&Zt.valueBoolean))},Le=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===HEADER_CODE))}))},Ee=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===y.gD&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===y.n4&&Lt.code===y._l))}))},Ie=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>Zt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&Zt.valueBoolean))},xe=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>{var en,qt;return Zt.url===ITEM_CONTROL_EXTENSION_URL&&((qt=(en=Zt.valueCodeableConcept)==null?void 0:en.coding)==null?void 0:qt.some(Lt=>Lt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Lt.code===CHECKBOX_CODE))}))},$e=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.fe);return Zt?.valueInteger},at=it=>{var Pt;const Zt=(Pt=it.extension)==null?void 0:Pt.find(en=>en.url===y.zO);return Zt?.valueInteger},bt=it=>{var Pt;const Zt=(Pt=it?.extension)==null?void 0:Pt.find(en=>en.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return Zt?.valueInteger},Ot=(it,Pt,Zt,en,qt,Lt)=>{const ln=cr=>Pt.filter(M0=>M0.linkId===cr),Un=new Set;return it.map(cr=>{if(Un.has(cr.linkId)||ge(cr))return null;const Tn=ln(cr.linkId),xn=cr.type==="group"&&cr.repeats;if(Un.add(cr.linkId),xn){const nn=[];if(Tn.forEach((mt,Nt)=>{const jt={linkId:cr.linkId,text:cr.text};let gn;if(Zt===cr.linkId&&typeof Lt=="number"&&Lt===Nt&&qt&&qt.length>0){const tn=mt?.item||[];gn=[...tn],qt.forEach(Cn=>{const er=gn.findIndex(Fr=>Fr.linkId===Cn.linkId);er>=0?gn[er]=v(f({},tn[er]),{answer:Cn.answer}):gn.push(Cn)})}else cr.item&&(gn=Ot(cr.item,mt?.item||[],Zt,en,qt,Nt));Zt===cr.linkId&&typeof Lt=="number"&&Lt===Nt&&en?jt.answer=en:jt.answer=mt.answer||[{}],gn&&gn.length>0?jt.item=gn:mt.item&&(jt.item=mt.item),nn.push(jt)}),Zt===cr.linkId&&typeof Lt=="number"&&Lt>=Tn.length)for(let mt=Tn.length;mt<=Lt;mt++){const Nt={linkId:cr.linkId,text:cr.text,answer:mt===Lt&&en?en:[{}]};mt===Lt&&qt&&qt.length>0?Nt.item=qt:cr.item&&(Nt.item=Ot(cr.item,[],void 0,void 0,void 0,void 0)),nn.push(Nt)}return nn}else if(cr.repeats&&typeof Lt=="number"&&Zt===cr.linkId){const nn=Tn[0]||{linkId:cr.linkId,text:cr.text,answer:[]},mt={linkId:cr.linkId,text:cr.text,answer:[...nn.answer||[]]};if(en&&en.length>0){for(;mt.answer.length<=Lt;)mt.answer.push({});mt.answer[Lt]=en[0]}return mt}else{const nn=Tn[0],mt=cr.item?Ot(cr.item,nn?.item||[],Zt,en,qt,Lt):void 0,Nt=mt&&mt.length>0,jt={linkId:cr.linkId,text:cr.text};return Zt&&cr.linkId===Zt&&typeof Lt!="number"?(en||!en&&!qt?jt.answer=en:nn?.answer&&(jt.answer=nn.answer),qt?jt.item=qt:Nt&&(jt.item=mt)):(nn?.answer?jt.answer=nn.answer:jt.answer=[{}],Nt&&(jt.item=mt)),jt}}).filter(Boolean).flat()},_t=(it,Pt)=>{for(const Zt of it)if(Zt.linkId===Pt||Zt.item&&_t(Zt.item,Pt))return Zt.linkId;return null},Yt=(it,Pt,Zt,en)=>{var qt;const Lt=(qt=it?.item)!=null?qt:en;return!Lt||Lt.length===0?!0:Lt.every(ln=>{var Un;const cr=K(Pt,ln.linkId);if(cr.length===0){const M0=(Un=F(Pt,ln.linkId))==null?void 0:Un.answer;if(ve(ln,Pt,M0)&&ae(ln.enableWhen,ln.enableBehavior,Pt)&&Zt.includes(ln.linkId))return!1}else for(const M0 of cr)if(ve(ln,Pt,M0.answer)&&ae(ln.enableWhen,ln.enableBehavior,Pt)&&Zt.includes(ln.linkId))return!1;return ln.item?Yt(ln,Pt,Zt):!0})},St=(it,Pt,Zt=!0)=>{for(const en of it)if(en.linkId===Pt&&en.answer&&en.answer.length>0||en.item&&en.item.length>0&&St(en.item,Pt,Zt))return!0;return!1},Ke=(it,Pt,Zt=0)=>{const en=it.filter(qt=>qt.linkId===Pt);if(en.length>Zt){const qt=en[Zt];if(qt.answer&&qt.answer.length>0)return qt.answer.some(Lt=>Lt&&Object.keys(Lt).length>0&&Object.values(Lt).some(ln=>ln!=null&&ln!==""));if(qt.item&&qt.item.length>0)return St(qt.item,Pt,!1)}return St(it,Pt,!1)},Fe=(it,Pt)=>{if(!it||!it.item)return!1;const Zt=en=>{var qt;if(Se(en)&&en.required&&ae(en.enableWhen,en.enableBehavior,Pt)){const Lt=F(Pt,en.linkId),ln=pe(en.extension,en.type,en.required,en.maxLength,Lt?.answer,en.answerOption);if(!((qt=Lt?.answer)!=null&&qt.length)||ln)return!0}if(en.item){for(const Lt of en.item)if(Zt(Lt))return!0}return!1};for(const en of it.item)if(Zt(en))return!0;return!1},Ct=it=>{var Pt,Zt,en;if(it.valueString!==void 0)return it.valueString;if(it.valueBoolean!==void 0)return it.valueBoolean;if(it.valueInteger!==void 0)return it.valueInteger;if(it.valueDecimal!==void 0)return it.valueDecimal;if(it.valueDate!==void 0)return it.valueDate;if(it.valueDateTime!==void 0)return it.valueDateTime;if(((Pt=it.valueCoding)==null?void 0:Pt.code)!==void 0)return it.valueCoding.code;if(((Zt=it.valueReference)==null?void 0:Zt.reference)!==void 0)return it.valueReference.reference;if(((en=it.valueQuantity)==null?void 0:en.value)!==void 0)return it.valueQuantity.value;if(it.valueAttachment!==void 0)return it.valueAttachment},Qe=it=>{const Pt={linkId:it.linkId};if(it.answer&&it.answer.length>0){const Zt=it.answer.map(en=>Ct(en)).filter(en=>en!==void 0);Zt.length>0&&(Pt.answer=Zt)}if(it.item&&it.item.length>0){const Zt=it.item.map(en=>Qe(en)).filter(en=>{const qt=Object.keys(en);return qt.length>1||qt.length===1&&qt[0]!=="linkId"});Zt.length>0&&(Pt.item=Zt)}return Pt},Ye=(it,Pt,Zt,en,qt,Lt)=>{var ln;const Un=(ln=Pt?.item)==null?void 0:ln[Zt[en]],cr=Un?.linkId;if(!cr)return!1;const M0=K(it,cr),Tn=K(qt,cr),xn=nn=>{if(nn!=null){if(Array.isArray(nn)){const mt=nn.filter(Nt=>Nt!=null).map(Nt=>xn(Nt)).filter(Nt=>Nt!==void 0);return mt.length===0||mt.length===1&&typeof mt[0]=="object"&&Object.keys(mt[0]).length===0?void 0:mt}if(typeof nn=="object"){const mt={};for(const[Nt,jt]of Object.entries(nn))if(jt!=null){const gn=xn(jt);gn!==void 0&&(mt[Nt]=gn)}return Object.keys(mt).length===0?void 0:mt}return nn}};if(M0.length!==Tn.length)return!1;for(let nn=0;nn<M0.length;nn++){const mt=M0[nn],Nt=Tn[nn];if(!mt||!Nt)return!1;const jt=Qe(xn(mt)),gn=Qe(xn(Nt));if(!_.isEqual(jt,gn))return!1}return en!==Lt},Dt=(it,Pt,Zt)=>Zt&&Zt.length>0&&!(Zt.length===1&&Object.keys(Zt[0]).length===0)&&ve(it,Pt,Zt)||null,pn=(it,Pt)=>{const Zt={},en=qt=>{qt.forEach(Lt=>{const ln=K(Pt,Lt.linkId);if(Et(Lt,it)||Lt.repeats)for(let Un=0;Un<ln.length;Un++){const cr=ln[Un];if(cr?.answer&&cr.answer.length>0){const M0=Dt(Lt,Pt,cr.answer);M0&&(Zt[Lt.linkId]=v(f({},Zt[Lt.linkId]),{[Un]:M0}))}}else{const Un=F(Pt,Lt.linkId);if(Un?.answer&&Un.answer.length>0){const cr=Dt(Lt,Pt,Un.answer);cr&&(Zt[Lt.linkId]={0:cr})}}Lt.item&&Lt.item.length>0&&en(Lt.item)})};return en(it),Zt},Sn=it=>{if(!it)return"";const Pt=it.split("-");if(Pt.length===3){const[Zt,en,qt]=Pt;return`${Zt.slice(-4)}-${en}-${qt}`}return""},et=it=>it.trim().replace(/[A-Za-z]+/g,""),Rt=(it,Pt)=>{const Zt=(en,qt)=>{for(const Lt of en){if(Lt.linkId===qt)return Lt.answer;if(Lt.item&&Lt.item.length>0){const ln=Zt(Lt.item,qt);if(ln!==void 0)return ln}}};return Zt(it,Pt)},Ht=(it,Pt)=>{if(!Pt||Pt.length===0)return null;const Zt=it.linkId,en=(qt,Lt,ln=[])=>{for(const Un of qt){const cr=[...ln,Un];if(Un.item){if(Un.item.some(xn=>xn.linkId===Lt))return cr.some(xn=>xn.repeats===!0)?Un:null;if(en(Un.item,Lt,cr))return Un}}return null};return en(Pt,Zt)},kn=(it,Pt)=>{if(!Pt||Pt.length===0)return!1;const Zt=it.linkId,en=(qt,Lt,ln=[])=>{for(const Un of qt){const cr=[...ln,Un];if(Un.item){if(Un.item.some(xn=>xn.linkId===Lt))return cr.some(xn=>{const nn=M(xn.extension||[]);return!!nn&&nn!==UI_TOOLKIT_FORM_CONTAINER});if(en(Un.item,Lt,cr))return!0}}return!1};return en(Pt,Zt)},Sr=(it,Pt,Zt)=>{const en={};if(!it)return en;const{linkId:qt}=Pt;if(it[qt]){const Lt=it[qt];en[qt]=Lt[Zt]||""}return Pt.item&&Pt.item.length>0&&Pt.item.forEach(Lt=>{if(it[Lt.linkId]){const ln=it[Lt.linkId];en[Lt.linkId]=ln[Zt]||""}}),en},hn=(it,Pt)=>{const Zt={};if(!it||!it[Pt])return Zt;const en=it[Pt];return Zt[Pt]=en[0]||"",Zt},In=it=>{const Pt=it.findIndex(Lt=>!Se(Lt)),Zt=Pt>=0?[Pt]:[],en=new Map;let qt=null;if(it.forEach((Lt,ln)=>{const Un=Ee(Lt);if(Un&&Lt.type==="group")ln!==Pt&&Zt.push(ln),en.set(ln,[ln]),qt=ln;else if(qt!==null&&!Un){const cr=en.get(qt)||[];en.set(qt,[...cr,ln])}}),it.length>0&&Zt.length>0){const Lt=Zt[0];if(!en.has(Lt)){const ln=Zt.find(cr=>cr>Lt),Un=[];for(let cr=Lt;cr<(ln??it.length);cr++)Un.push(cr);en.set(Lt,Un)}}return{groupIndices:Zt,itemsToRenderMap:en}},mr=(it,Pt,Zt,en)=>{let qt=[...en];const Lt=(ln,Un)=>{ln.forEach(cr=>{if((!cr?.enableWhen||ae(cr?.enableWhen,cr.enableBehavior,Un))&&cr.initial&&!St(Un,cr.linkId))if(cr.repeats){const M0=Un.filter(Tn=>Tn.linkId===cr.linkId);M0.length>0?M0.forEach((Tn,xn)=>{Ke(Un,cr.linkId,xn)||(qt=Ot(Zt,qt,cr.linkId,cr.initial,void 0,xn))}):qt=Ot(Zt,qt,cr.linkId,cr.initial)}else qt=Ot(Zt,qt,cr.linkId,cr.initial);cr.item&&Lt(cr.item,Un)})};return Lt(it,Pt),qt},Dn=(it,Pt,Zt)=>{if(!it)return[];const en=[],qt=Lt=>{Lt.required===Pt&&ae(Lt.enableWhen,Lt.enableBehavior,Zt)&&!Se(Lt)&&Lt.type!=="display"&&en.push(Lt),Lt.item&&Lt.item.length>0&&Lt.item.forEach(qt)};return it.forEach(qt),en},$r=(it,Pt)=>it.every(Zt=>{var en;const qt=K(Pt,Zt.linkId);if(qt.length>0)return qt.every(Lt=>!ve(Zt,Pt,Lt.answer));{const Lt=(en=F(Pt,Zt.linkId))==null?void 0:en.answer;return!ve(Zt,Pt,Lt)}}),kr=(it,Pt)=>{let Zt=-1;for(let en=it.length-1;en>=0;en--)if(it[en].linkId===Pt){Zt=en;break}return Zt},Wt=(it,Pt)=>it.filter(Zt=>Zt.linkId!==Pt).map(Zt=>Zt.item&&Zt.item.length>0?v(f({},Zt),{item:Wt(Zt.item,Pt)}):Zt),_e=(it,Pt,Zt=[])=>{const en=[],qt=Lt=>{Lt.forEach(ln=>{en.push(ln.linkId),ln.item&&ln.item.length>0&&qt(ln.item)})};for(let Lt=0;Lt<it.length;Lt++){const ln=it[Lt];if(ln.linkId===Pt){const Un=it.slice(0,Lt+1),cr=it.slice(Lt+1),{kept:M0,removed:Tn}=cr.reduce((xn,nn)=>{const mt=J(Zt,nn.linkId);return mt&&Se(mt)&&ae(mt.enableWhen,mt.enableBehavior,Un)?xn.kept.push(nn):xn.removed.push(nn),xn},{kept:[],removed:[]});return qt(Tn),{trimmedData:[...Un,...M0],trimmedLinkIds:en,found:!0}}if(ln.item&&ln.item.length>0){const Un=_e(ln.item,Pt,Zt);if(Un.found){const cr=it.slice(0,Lt),M0=it.slice(Lt+1),Tn=[...cr,v(f({},ln),{item:Un.trimmedData})],{kept:xn,removed:nn}=M0.reduce((mt,Nt)=>{const jt=J(Zt,Nt.linkId);return jt&&Se(jt)&&ae(jt.enableWhen,jt.enableBehavior,Tn)?mt.kept.push(Nt):mt.removed.push(Nt),mt},{kept:[],removed:[]});return qt(nn),{trimmedData:[...Tn,...xn],trimmedLinkIds:[...Un.trimmedLinkIds,...en],found:!0}}}}return{trimmedData:it,trimmedLinkIds:[],found:!1}},lt=(it,Pt)=>it.filter(Zt=>!Pt.includes(Zt.linkId)).map(Zt=>Zt.item&&Zt.item.length>0?v(f({},Zt),{item:lt(Zt.item,Pt)}):Zt),Je=it=>{var Pt;if(!it)return"empty";const Zt=y.Z$.find(({patterns:en})=>en.some(qt=>it.includes(qt)));return(Pt=Zt?.type)!=null?Pt:"empty"},nt=(it,Pt)=>{const{groupIndices:Zt}=In(it),en=it.findIndex(qt=>qt.linkId===Pt);return en!==-1?Zt.indexOf(en):-1},ot=it=>{if(!it)return{restriction:null,warning:null};const Pt=Zt=>{const en=it.find(Lt=>Lt.url===Zt&&Lt.valueString);if(!en?.valueString)return null;const qt=en.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Lt=>Lt.trim()).filter(Boolean).map(Lt=>Lt.startsWith("*")?Lt.substring(1).trim():Lt);return qt.length===0?null:qt.length===1?{isList:!1,items:qt}:{isList:!0,items:qt}};return{restriction:Pt("restriction"),warning:Pt("warning")}},ct=(it,Pt)=>{var Zt;switch(Pt.type){case"boolean-to-string":return typeof it=="boolean"?it?Pt.trueValue:Pt.falseValue:it;case"map":return Pt.mapping&&it in Pt.mapping?Pt.mapping[it]:it;case"date-format":return it;case"number-format":if(typeof it=="number"){let en=it.toFixed((Zt=Pt.decimals)!=null?Zt:0);return Pt.prefix&&(en=Pt.prefix+en),Pt.suffix&&(en=en+Pt.suffix),en}return it;case"passthrough":default:return it}},Et=(it,Pt)=>{const Zt=it.linkId,en=(Lt,ln,Un=[])=>{for(const cr of Lt){const M0=[...Un,cr];if(cr.item){if(cr.item.some(nn=>nn.linkId===ln))return M0.filter(nn=>nn.repeats===!0);const xn=en(cr.item,ln,M0);if(xn.length>0)return xn}}return[]},qt=en(Pt,Zt);return qt.length>0?qt[qt.length-1]:null},st=(it,Pt)=>{if(!it?.item)return[];const Zt=[];for(const en of it.item){if(en.type!=="group")continue;ae(en.enableWhen,en.enableBehavior,Pt||[])&&en.linkId&&Zt.push(en.linkId)}return Zt},oe=(it,Pt)=>{const Zt=st(it,Pt||void 0);return Zt[Zt.length-1]},Me=({questionnaire:it,extensionUrl:Pt,errorCode:Zt})=>{if(!Zt||!it?.item)return;const en=it.item.find(qt=>{var Lt;return(Lt=qt.extension)==null?void 0:Lt.some(ln=>ln.url===Pt&&ln.valueString===Zt)});return en?.linkId},Ue=(it,Pt)=>{var Zt;const en=(Zt=it.extension)==null?void 0:Zt.find(Lt=>Lt.url===y.rb);if(!en?.valueString)return;const qt=en.valueString;return J(Pt,qt)},ze=it=>{var Pt;return!!((Pt=it.extension)!=null&&Pt.find(Zt=>Zt.url===y.rb))},zt=(it,Pt)=>it.filter(Zt=>Zt.linkId!==Pt).map(Zt=>Zt.item&&Zt.item.length>0?v(f({},Zt),{item:zt(Zt.item,Pt)}):Zt),Xt=it=>{const Pt=$(ANALYTICS_FORM_NAME_EXTENSION_URL,it.extension);return Pt??k(it.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},vn=it=>$(ANALYTICS_EVENT_NAME_EXTENSION_URL,it.extension),_n=it=>$(ANALYTICS_PAGE_NAME_EXTENSION_URL,it.extension),Or=it=>$(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,it.extension),Ft=it=>$(ANALYTICS_OPTION_NAME_EXTENSION_URL,it),we=(it,Pt)=>{var Zt,en,qt;if(!it.answerOption)return;const Lt=F(Pt,it.linkId),ln=(qt=(en=(Zt=Lt?.answer)==null?void 0:Zt[0])==null?void 0:en.valueCoding)==null?void 0:qt.code;if(!ln)return;const Un=it.answerOption.find(cr=>{var M0;return((M0=cr.valueCoding)==null?void 0:M0.code)===ln});if(!!Un)return Ft(Un.extension)},Ze=(it,Pt)=>{const Zt={},en=qt=>{if(!!qt)for(const Lt of qt){const ln=Or(Lt);if(ln){let Un;switch(Lt.type){case"choice":Un=we(Lt,Pt);break;default:break}Un&&(Zt[ln]=Un)}Lt.item&&Lt.item.length>0&&en(Lt.item)}};return en(it.item),Zt},At=it=>!!(it.initial&&it.initial.length>0),Jt=(it,Pt,Zt)=>{if(!it)return[];const en=[],qt=Lt=>{Lt.forEach(ln=>{if(Zt&&Zt.includes(ln.linkId))return;const Un=Se(ln),cr=Pt.includes(ln.linkId);(cr||Un&&ln.required)&&en.push(ln),cr&&ln.item&&ln.item.length>0&&qt(ln.item)})};return qt(it),en},rn=(it,Pt,Zt,en,qt,Lt)=>{var ln;if(Zt<0||!en?.item)return!0;const Un=qt.current[Zt],cr=Zt+1,M0=qt.current[cr],Tn=Zt===0?0:Un,xn=M0??en.item.length,nn=[];for(let tn=Tn;tn<xn;tn++){const Cn=(ln=en?.item)==null?void 0:ln[tn];if(Cn){if(Lt&&Lt.includes(Cn.linkId))continue;const er=Se(Cn);(Pt.includes(Cn.linkId)||er&&Cn.required)&&nn.push(Cn),Cn.item&&Cn.item.length>0&&nn.push(...Jt(Cn.item,Pt,Lt))}}const mt=nn.filter(tn=>tn.required===!0),Nt=nn.filter(tn=>tn.required!==!0),jt=$r(mt,it),gn=Nt?.every(tn=>{var Cn;const er=(Cn=F(it,tn.linkId))==null?void 0:Cn.answer;return er?!ve(tn,it,er):!0});return!mt?.length||jt&&gn}},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:En})=>{const Kn=En.text||"",or=En.extension||[],L0=Ii=>{var ji;return(ji=or.find(di=>di.url===Ii))==null?void 0:ji.valueString},B0=L0(i.$7),G0=L0(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:Kn,description:B0??"",color:G0})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(En,Kn,or)=>Kn in En?u(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,O=(En,Kn)=>{for(var or in Kn||(Kn={}))A.call(Kn,or)&&d(En,or,Kn[or]);if(y)for(var or of y(Kn))m.call(Kn,or)&&d(En,or,Kn[or]);return En};const p=({item:En})=>{const[Kn,or]=(0,t.useState)(!1),L0=En.extension||[],B0=ga=>{var Ta;return(Ta=L0.find(Sa=>Sa.url===ga))==null?void 0:Ta.valueString},G0=B0(i.PS)||En.text||"",Ii=B0(i.Iz)||"button",ji=B0(i.VF),di=B0(i.PV),Yi=B0(i.vf),Ti=Yi?i.JP[Yi]:void 0,ki=B0(i.D_)||"",po=B0(i.$e),Yo=B0(i.GQ),pa=B0(i.qT)||"gray",vo=B0(i.hZ),ra=B0(i.wG),da=B0(i.q3),Ba=Yo?i.JP[Yo]:void 0,_a=()=>or(!0),Fa=()=>{switch(Ii){case"icon-button":return(0,n.jsxs)("button",{onClick:_a,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":G0||ki||void 0,children:[Ti&&(0,n.jsx)(Ti,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),G0&&(0,n.jsx)("span",{className:"text-sm",children:G0})]});default:return(0,n.jsx)(r.Button,{color:ji??"secondary",size:di??"md",iconLeading:Ti,onClick:_a,"aria-label":G0,children:G0})}};return(0,n.jsxs)(n.Fragment,{children:[Fa(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${En.linkId}`,isOpen:Kn,onOpenChange:or,title:{content:ki},description:{content:po?(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(po)}}):void 0},closeButton:{onCloseClick:()=>or(!1)}},Ba?{featuredIcon:{icon:Ba,color:pa,size:"lg",className:"bg-white"}}:{}),vo?{primaryButton:{children:vo,onClick:()=>{var ga,Ta;ra==="open-zendesk"&&((Ta=(ga=globalThis.zE)==null?void 0:ga.activate)==null||Ta.call(ga,{hideOnClose:!0})),or(!1)}}}:{}),da?{secondaryButton:{children:da,onClick:()=>or(!1)}}:{}))]})};var b=e(18522);const h=({item:En})=>{var Kn,or,L0,B0,G0,Ii,ji,di,Yi,Ti;const{hasExternalError:ki}=(0,b.c)(),po=En.text||"",Yo=(or=(Kn=En.extension)==null?void 0:Kn.find(Sa=>Sa.url===i.ao))==null?void 0:or.valueString,pa=ki&&Yo?Yo:po,vo=(B0=(L0=En.extension)==null?void 0:L0.find(Sa=>Sa.url===i.$7))==null?void 0:B0.valueString,ra=(Ii=(G0=En.extension)==null?void 0:G0.find(Sa=>Sa.url===i.el))==null?void 0:Ii.valueString,da=ki&&ra?ra:vo,Ba=(di=(ji=En.extension)==null?void 0:ji.find(Sa=>Sa.url===i.g4))==null?void 0:di.valueString,_a=(Ti=(Yi=En.extension)==null?void 0:Yi.find(Sa=>Sa.url===i.Fp))==null?void 0:Ti.valueString,Fa=Ba?i.JP[Ba]:void 0,ga=_a?i.JP[_a]:void 0,Ta=ki&&ga?ga:Fa;return(0,n.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[Ta&&(0,n.jsx)(r.FeaturedIcon,{icon:Ta,color:ki&&ga?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,n.jsx)("h1",{className:"text-primary max-w-[330px] text-center text-3xl font-medium md:max-w-[352px]",children:pa}),(0,n.jsx)("p",{className:"text-md text-secondary text-center",children:da})]})]})};var f=e(15297),v=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(En,Kn,or)=>Kn in En?M(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,E=(En,Kn)=>{for(var or in Kn||(Kn={}))z.call(Kn,or)&&S(En,or,Kn[or]);if(x)for(var or of x(Kn))T.call(Kn,or)&&S(En,or,Kn[or]);return En};const C=({item:En})=>{const[Kn,or]=(0,t.useState)(!1),L0=(0,v.T$)(),B0=En.extension||[],G0=vo=>{var ra;return(ra=B0.find(da=>da.url===vo))==null?void 0:ra.valueString},Ii=En.text||"",ji=G0(i.PS)||"",di=G0(i.D_)||"",Yi=G0(i.$e),Ti=G0(i.GQ),ki=G0(i.qT)||"gray",po=G0(i.hZ),Yo=G0(i.q3),pa=Ti?i.JP[Ti]: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:Ii})]}),ji&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>or(!0),children:ji})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${En.linkId}`,isOpen:Kn,onOpenChange:or,title:{content:di},description:{content:Yi?(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(Yi)}}):void 0},closeButton:{onCloseClick:()=>or(!1)}},pa?{featuredIcon:{icon:pa,color:ki,size:"lg",className:"bg-white"}}:{}),po?{primaryButton:{children:po,onClick:()=>{or(!1),L0.navigate({id:"profile"})}}}:{}),Yo?{secondaryButton:{children:Yo,onClick:()=>or(!1)}}:{}))]})},R=({item:En,selectedAnswer:Kn,handleInputChange:or})=>{var L0,B0,G0;const Ii=(L0=En.answerOption)!=null?L0:[],ji=(G0=(B0=Kn?.[0])==null?void 0:B0.valueCoding)==null?void 0:G0.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:Ii.map(di=>{var Yi,Ti,ki,po,Yo,pa,vo;const ra=(Ti=(Yi=di.valueCoding)==null?void 0:Yi.code)!=null?Ti:"",da=(po=(ki=di.valueCoding)==null?void 0:ki.display)!=null?po:"",Ba=ji===ra,_a=(Yo=di.extension)==null?void 0:Yo.find(Sa=>Sa.url===i.g4),Fa=(pa=di.extension)==null?void 0:pa.find(Sa=>Sa.url===i.rz),ga=_a?.valueString?i.JP[_a.valueString]:void 0,Ta=(vo=Fa?.valueString)!=null?vo:"";return(0,n.jsx)(r.SelectableOption,{icon:ga,title:da,description:Ta,isSelected:Ba,onSelect:()=>{or(En,[{valueCoding:{code:ra,display:da}}])}},ra)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:En,isLabel:Kn,required:or,className:L0,id:B0})=>(0,n.jsxs)("p",{id:B0,className:L0??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(Kn&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(En||"")}}),or&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",$=(En,Kn)=>{const or=En.replace(/\D/g,"");let L0="",B0=0;for(let G0=0;G0<Kn.length&&B0<or.length;G0++)Kn[G0]==="#"?(L0+=or[B0],B0++):L0+=Kn[G0];return L0},q=En=>{if(!En)return w;const Kn=En.find(or=>or.url===i.Md);return Kn?.valueString||w},I=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{var ji;const{linkId:di,text:Yi,required:Ti,prefix:ki,readOnly:po,extension:Yo}=En,pa=q(Yo),vo=((ji=or?.[0])==null?void 0:ji.valueString)||"",[ra,da]=(0,t.useState)("");(0,t.useEffect)(()=>{if(vo){const Ta=$(vo,pa);da(Ta)}},[vo,pa]);const Ba=Yi?(0,o.nt)(B0,ki,Yi):"",_a=G0?.[di]||"",Fa=Ta=>{const Sa=$(Ta,pa);da(Sa),L0(En,[{valueString:Sa}])},ga=()=>{Kn&&Kn(di)};return(0,n.jsxs)("div",{"data-testid":di,children:[Ba&&(0,n.jsx)(N,{isLabel:!0,text:Ba,required:Ti||!1}),(0,n.jsx)(r.Input,{id:di,"aria-label":di,"data-testid":di,type:"tel",placeholder:"Enter phone number",value:ra,onChange:Fa,onBlur:ga,isDisabled:po||Ii,isRequired:Ti,hint:_a,isInvalid:!!_a,size:"md"},di)]})},k=({item:En,questionnaireSchemaItems:Kn})=>{var or;const{isLoading:L0,setCurrentGroupIndex:B0}=(0,b.c)(),G0=(or=En.extension)==null?void 0:or.find(Yi=>Yi.url===i.Uf),Ii=G0?.valueString,ji=En.text||"Save & continue",di=()=>{if(Ii){const Yi=(0,o.Ue)(Kn||[],Ii);Yi!==-1&&B0(Yi)}};return(0,n.jsx)("div",{"data-testid":En.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:L0,onClick:di,isDisabled:En.readOnly,children:ji})})},U=({size:En=24,color:Kn="currentColor",...or})=>t.createElement("svg",{viewBox:"0 0 24 24",width:En,height:En,stroke:Kn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...or},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:En=24,color:Kn="currentColor",...or})=>t.createElement("svg",{viewBox:"0 0 24 24",width:En,height:En,stroke:Kn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...or},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 ie=({size:En=24,color:Kn="currentColor",...or})=>t.createElement("svg",{viewBox:"0 0 24 24",width:En,height:En,stroke:Kn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...or},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"}));ie.displayName="Mail01";var le=e(31165),ae=e(14449),me=e(27163);const ye=En=>{try{const Kn=En.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!Kn)return En;const[,or,L0,B0]=Kn;return new Date(Date.UTC(parseInt(or),parseInt(L0)-1,parseInt(B0))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return En}},Te=En=>{try{if(En.includes("AM")||En.includes("PM"))return En;const Kn=En.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!Kn)return En;const[,or,L0]=Kn,B0=parseInt(or),G0=B0>=12?"PM":"AM";return`${B0%12||12}:${L0} ${G0}`}catch{return En}},ve=(En,Kn,or=f.d)=>{var L0;const B0=(L0=En.extension)==null?void 0:L0.find(G0=>G0.url===i.g4);return B0?.valueString&&i.JP[B0.valueString]?i.JP[B0.valueString]:En.linkId&&Kn[En.linkId]?Kn[En.linkId]:or},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":ie,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":le.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":ae.X},se=["appointment-review/appointment-date"],he=["appointment-review/appointment-time"],pe=["appointment-review/facility-phone"],fe=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],te=({item:En,questionnaireSchemaItems:Kn})=>{var or;const{setCurrentGroupIndex:L0}=(0,b.c)(),{trackEvent:B0}=(0,s.st)(),G0=En.item||[];if(G0.length===0)return null;const Ii=(or=En.extension)==null?void 0:or.find(Ti=>Ti.url===i.Uf),ji=Ii?.valueString,di=()=>{if(B0("edit_info_clicked",{section:En.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),ji){const Ti=(0,o.Ue)(Kn||[],ji);Ti!==-1&&L0(Ti)}},Yi=G0.map(Ti=>{let ki="";if(Ti.initial&&Ti.initial.length>0){const pa=Ti.initial.map(vo=>{var ra,da;let Ba=((ra=vo.valueCoding)==null?void 0:ra.display)||((da=vo.valueReference)==null?void 0:da.display)||vo.valueString||"";return Ba&&typeof Ba=="string"&&(se.includes(Ti.linkId)?Ba=ye(Ba):he.includes(Ti.linkId)&&(Ba=Te(Ba))),Ba}).filter(Boolean);pa.length>1||Ti.repeats&&pa.length>0?ki=pa:pa.length===1&&(ki=pa[0])}if(!ki||Array.isArray(ki)&&ki.length===0)return null;let po;pe.includes(Ti.linkId)?po="phone":fe.includes(Ti.linkId)&&(po="address");let Yo;return ue.includes(Ti.linkId)&&(Yo="phone"),{Icon:ve(Ti,ne),label:Ti.text||Ti.linkId,value:ki,linkType:po,displayType:Yo}}).filter(Boolean);return Yi.length===0?null:(0,n.jsx)("div",{"data-testid":En.linkId,children:(0,n.jsx)(me.InfoCard,{title:En.text||"Details",infoDetails:Yi,actionButtonText:ji&&"Edit info",onActionButtonClick:ji?di:void 0})})},J=({size:En=24,color:Kn="currentColor",...or})=>t.createElement("svg",{viewBox:"0 0 24 24",width:En,height:En,stroke:Kn,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...or},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 ge=e(18807);const Se=({item:En})=>{const{setHideFooterButton:Kn,incrementCustomErrorCount:or,decrementCustomErrorCount:L0}=(0,b.c)();return(0,t.useEffect)(()=>(Kn(!0),or(),()=>{Kn(!1),L0()}),[Kn,or,L0]),(0,n.jsx)("div",{"data-testid":En.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,ge.p)(En.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},Le={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},Ee=({item:En})=>{var Kn,or,L0,B0;const{incrementCustomErrorCount:G0,decrementCustomErrorCount:Ii,setHideFooterButton:ji}=(0,b.c)(),[di,Yi]=(0,t.useState)(!1),Ti=(Kn=En.extension)==null?void 0:Kn.find(ra=>ra.url===i.gi),ki=(L0=(or=Ti?.valueCodeableConcept)==null?void 0:or.coding)==null?void 0:L0.find(ra=>ra.system===i.tn),po=ki?.code||"error",Yo=Le[po]||"error";(0,t.useEffect)(()=>{if(Yo==="error")return G0(),ji(!0),Yi(!0),()=>{Ii(),ji(!1)};Yi(!0)},[Yo,G0,Ii,ji]);const pa=ki?.display||"Error",vo=(B0=En.text)!=null?B0:"";return di?(0,n.jsx)("div",{"data-testid":En.linkId,children:(0,n.jsx)(r.InfoBanner,{type:Yo,title:pa,description:vo})}):null},Ie=({configKey:En,customErrorConfigurations:Kn})=>{if(!Kn)return null;const or=Kn[En];if(!or)return null;const{icon:L0,title:B0,description:G0,primaryButton:Ii,secondaryButton:ji}=or;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:B0,description:G0,featuredIconProps:{icon:L0,color:"gray"},primaryButton:Ii,secondaryButton:ji})},xe=10,$e=({item:En,customErrorConfigurations:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{var ji,di,Yi,Ti;const{trackEvent:ki}=(0,s.st)(),{setHideFooterButton:po}=(0,b.c)(),{linkId:Yo,text:pa,required:vo,answerOption:ra,prefix:da,readOnly:Ba}=En,_a=En?.type==="reference",Fa=(ji=or?.map(qn=>{var cn,yr;return _a?(cn=qn.valueReference)==null?void 0:cn.display:(yr=qn.valueCoding)==null?void 0:yr.code}).filter(qn=>qn!==void 0))!=null?ji:[],[ga,Ta]=(0,t.useState)(Fa.length),Sa=pa?(0,o.nt)(B0,da,pa):"",Xr=(Yi=(di=En.extension)==null?void 0:di.find(qn=>qn.url===i.Z_))==null?void 0:Yi.valueInteger,zr=(Ti=ra?.map(qn=>{var cn,yr,Br,u0;return{value:_a?((cn=qn.valueReference)==null?void 0:cn.display)||"":((yr=qn.valueCoding)==null?void 0:yr.code)||"",label:_a?((Br=qn.valueReference)==null?void 0:Br.display)||"":((u0=qn.valueCoding)==null?void 0:u0.display)||"",valueReference:qn.valueReference}}))!=null?Ti:[],Qr=G0?.[Yo],De=zr.length>xe,Ce=De?zr.slice(0,xe):zr,We=De?zr.slice(xe):[],pt=We.some(qn=>Fa?.includes(qn?.value)),[Kt,dn]=(0,t.useState)(pt);if(!(En.answerOption&&En.answerOption.length>0))return po(!0),(0,n.jsx)(Ie,{configKey:En.linkId,customErrorConfigurations:Kn});const Lr=zr.filter(qn=>Fa?.includes(qn?.value)).map(qn=>{var cn;const{restriction:yr,warning:Br}=_a?(0,o.eC)((cn=qn.valueReference)==null?void 0:cn.extension):{restriction:null,warning:null};return{label:qn.label,restriction:yr,warning:Br}}).filter(qn=>qn.restriction||qn.warning),zn=(qn,cn)=>{var yr;ki("vaccine_type_checkbox_selected",{on_or_off:qn?"on":"off",vaccine:cn,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let Br;if(qn){const u0=zr.find(W0=>W0.value===cn);Br=[...(yr=or?.filter(W0=>Object.keys(W0).length!==0))!=null?yr:[],_a?{valueReference:u0?.valueReference}:{valueCoding:{code:cn,display:u0?.label}}],Ta(W0=>W0+1)}else Br=or?.filter(u0=>{var W0,w0;return _a?((W0=u0.valueReference)==null?void 0:W0.display)!==cn:((w0=u0.valueCoding)==null?void 0:w0.code)!==cn})||[{}],Ta(u0=>u0-1);L0&&L0(En,Br)};return(0,n.jsxs)("div",{"data-testid":Yo,children:[Sa&&(0,n.jsx)(N,{text:Sa,required:vo||!1}),De&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:Ce.map((qn,cn)=>{const yr=Fa?.includes(qn?.value),Br=!yr&&Xr?ga>=Xr:!1;return(0,n.jsx)("div",{className:cn!==Ce.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":qn.value,id:cn.toString(),name:qn.label,isInvalid:!!Qr,isSelected:yr,label:qn.label,onChange:u0=>zn(u0,qn.value),isDisabled:Ba||Ii||Br})},cn)})}),De&&!Kt&&!pt&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{dn(!0),ki("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:Ba||Ii,children:"See all"})}),De&&Kt&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),De&&Kt&&(0,n.jsx)("div",{children:We.map((qn,cn)=>{const yr=Fa?.includes(qn?.value),Br=!yr&&Xr?ga>=Xr:!1;return(0,n.jsx)("div",{className:cn!==We.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":qn.value,id:(xe+cn).toString(),name:qn.label,isInvalid:!!Qr,isSelected:yr,label:qn.label,onChange:u0=>zn(u0,qn.value),isDisabled:Ba||Ii||Br})},xe+cn)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Qr,children:Qr}),Lr.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:Lr.map((qn,cn)=>(0,n.jsxs)("div",{children:[qn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${qn.label}`,description:qn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:qn.restriction.items.map((yr,Br)=>(0,n.jsx)("li",{className:"text-sm",children:yr},Br))}):(0,n.jsx)("p",{className:"text-sm",children:qn.restriction.items[0]})}),qn.warning&&(0,n.jsx)("div",{className:qn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${qn.label}`,description:qn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:qn.warning.items.map((yr,Br)=>(0,n.jsx)("li",{className:"text-sm",children:yr},Br))}):(0,n.jsx)("p",{className:"text-sm",children:qn.warning.items[0]})})})]},cn))})]})};var at=e(76323),bt=e(56192),Ot=e(66267),_t=Object.defineProperty,Yt=Object.defineProperties,St=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,Qe=(En,Kn,or)=>Kn in En?_t(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,Ye=(En,Kn)=>{for(var or in Kn||(Kn={}))Fe.call(Kn,or)&&Qe(En,or,Kn[or]);if(Ke)for(var or of Ke(Kn))Ct.call(Kn,or)&&Qe(En,or,Kn[or]);return En},Dt=(En,Kn)=>Yt(En,St(Kn)),pn=(En,Kn,or)=>new Promise((L0,B0)=>{var G0=di=>{try{ji(or.next(di))}catch(Yi){B0(Yi)}},Ii=di=>{try{ji(or.throw(di))}catch(Yi){B0(Yi)}},ji=di=>di.done?L0(di.value):Promise.resolve(di.value).then(G0,Ii);ji((or=or.apply(En,Kn)).next())});const Sn=({item:En,handleInputChange:Kn,onCompleteHandler:or,errors:L0})=>{const{i18n:{t:B0},loading:G0}=(0,Ot.E_)({keys:["shared-translations"]}),{trackEvent:Ii}=(0,s.st)(),{linkId:ji,required:di,readOnly:Yi}=En,Ti=L0?.[ji]||"",[ki,po]=(0,t.useState)(at.LocationType.CURRENT_LOCATION),[Yo,pa]=(0,t.useState)(""),vo=(0,t.useRef)({}),[ra,da]=(0,t.useState)([{id:at.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:at.LocationType.ADDRESS,label:"Address"},{id:at.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ba,setIsLoading:_a,setIsCurrentFormValid:Fa,isCurrentFormValid:ga}=(0,b.c)(),{position:Ta,loading:Sa,locationPermission:Xr}=(0,at.useDeviceLocationContext)(),{queryParams:zr,setQueryParams:Qr}=(0,at.useSearchQueryParams)(),[De,{loading:Ce}]=(0,bt.qtq)({fetchPolicy:"cache-first"}),[We,{loading:pt}]=(0,bt.YyG)({fetchPolicy:"cache-first"}),Kt=En.item?(0,o.Yo)(En.item,"postal-code"):void 0,dn=En.item?(0,o.Yo)(En.item,"state"):void 0,Zn=En.item?(0,o.Yo)(En.item,"latitude"):void 0,Lr=En.item?(0,o.Yo)(En.item,"longitude"):void 0,zn=J0=>{if(!J0||!Kt)return pa(""),!1;const Ji=(0,o.zj)(Kt.extension,Kt.type,!1,Kt.maxLength,[{valueString:J0}]);return Ji?(pa(ki!==at.LocationType.ZIP_CODE?B0("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ji),!1):(pa(""),!0)},qn=()=>{const{latitude:J0,longitude:Ji,state:tt,zipcode:Tt}=vo.current;return!!(J0&&Ji&&tt&&Tt)},cn=(0,t.useCallback)(J0=>{vo.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},En.item&&(dn&&Kn(dn,[{valueString:""}]),Zn&&Kn(Zn,[{valueDecimal:void 0}]),Lr&&Kn(Lr,[{valueDecimal:void 0}]),Kt&&Kn(Kt,[{valueString:""}])),Qr({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:J0,locationPermission:Xr}),Fa&&Fa(!1),pa("")},[Kn,En.item,Zn,Xr,Lr,Fa,Qr,dn,Kt]);(0,t.useEffect)(()=>{if(!di)return;!qn()&&Fa&&Fa(!1)},[ga,di,Fa]);const yr=J0=>{vo.current=Ye(Ye({},vo.current),J0),J0.addressDescription&&Ii("address_selected",{value:J0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),W0(vo.current.latitude,vo.current.longitude,vo.current.state,vo.current.zipcode,vo.current.placeId,vo.current.addressDescription)},Br=J0=>pn(void 0,null,function*(){var Ji,tt,Tt;if(pa(""),vo.current.zipcode=J0,Fa&&Fa(!1),zn(J0)){Ii("zip_code_entered",{value:J0,_event_metadata:{description:"A user entered a zip code."}});const mn=yield We({variables:{location:J0}}),bn=(Ji=mn?.data)==null?void 0:Ji.geocoding,nr=mn?.error;if(bn){const pr=bn.stateCode||"",l0=(tt=bn.latitude)!=null?tt:void 0,Z0=(Tt=bn.longitude)!=null?Tt:void 0;yr({latitude:l0,longitude:Z0,state:pr,zipcode:J0,placeId:void 0,addressDescription:void 0})}else nr&&(yr({latitude:void 0,longitude:void 0,state:void 0,zipcode:J0,placeId:void 0,addressDescription:void 0}),pa(B0("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else W0(vo.current.latitude,vo.current.longitude,vo.current.state,J0)}),u0=()=>{const J0=vo.current.zipcode||"";!J0||ki!==at.LocationType.ZIP_CODE||zn(J0)};(0,t.useEffect)(()=>{zr.locationType&&(po(zr.locationType),zr.locationType===at.LocationType.ZIP_CODE&&zr.zipCode&&Br(zr.zipCode),zr.locationType===at.LocationType.ADDRESS&&zr.placeId&&zr.addressDescription&&(vo.current.addressDescription=zr.addressDescription,vo.current.placeId=zr.placeId))},[]),(0,t.useEffect)(()=>{const J0=[at.LocationPermissionEnum.DENIED,at.LocationPermissionEnum.UNAVAILABLE,at.LocationPermissionEnum.BLOCKED].includes(zr.locationPermission),Ji=[at.LocationPermissionEnum.GRANTED,at.LocationPermissionEnum.PROMPT].includes(zr.locationPermission);if(J0&&ra.length!==2){if(da([{id:at.LocationType.ADDRESS,label:"Address"},{id:at.LocationType.ZIP_CODE,label:"Zip code"}]),ki===at.LocationType.CURRENT_LOCATION||!zr.locationType||zr.locationType===""){const tt=zr.locationType===at.LocationType.ZIP_CODE?at.LocationType.ZIP_CODE:at.LocationType.ADDRESS;po(tt),Qr(Dt(Ye({},zr),{locationType:tt})),cn(tt)}pa("")}Ji&&ra.length!==3&&da([{id:at.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:at.LocationType.ADDRESS,label:"Address"},{id:at.LocationType.ZIP_CODE,label:"Zip code"}])},[ki,Xr,ra.length,zr,Qr,cn]);const W0=(J0,Ji,tt,Tt,mn,bn)=>{if(!En.item)return;dn&&Kn(dn,[{valueString:tt||""}]),Zn&&Kn(Zn,[{valueDecimal:J0}]),Lr&&Kn(Lr,[{valueDecimal:Ji}]),Kt&&Kn(Kt,[{valueString:Tt||""}]),Qr(Dt(Ye({},zr),{lat:String(J0),lng:String(Ji),location:`${J0},${Ji}`,zipCode:Tt||"",placeId:mn||"",addressDescription:bn||"",locationPermission:Xr}));const nr=qn()&&zn(Tt||"");Fa&&Fa(nr),or&&or(ji)};(0,t.useEffect)(()=>{const J0=()=>pn(void 0,null,function*(){var Ji;try{const tt=yield De({variables:{latitude:String(Ta?.coords.latitude),longitude:String(Ta?.coords.longitude)}}),Tt=(Ji=tt?.data)==null?void 0:Ji.geocodingByLatLon,mn=Tt?.stateCode||"",bn=Tt?.zipCode||"";(!bn||!mn)&&pa(B0("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),yr({latitude:Ta?.coords.latitude,longitude:Ta?.coords.longitude,state:mn,zipcode:bn,placeId:void 0,addressDescription:void 0})}catch{po(at.LocationType.ADDRESS)}});ki===at.LocationType.CURRENT_LOCATION&&Ta&&J0()},[ki,Ta]);const w0=J0=>{if(!J0||!J0.latitude||!J0.longitude||!J0.zipCode||!J0.stateCode){yr({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),J0&&typeof J0.value=="string"&&J0.value.trim().length!==0&&pa(B0("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}yr({latitude:J0.latitude,longitude:J0.longitude,state:J0.stateCode,zipcode:J0.zipCode,placeId:J0.placeId,addressDescription:J0.description})};return(0,t.useEffect)(()=>{_a(Sa||Ce||pt||G0)},[Sa,Ce,pt,G0,_a]),(0,t.useEffect)(()=>{zr.locationType!==ki&&Qr(Dt(Ye({},zr),{locationType:ki}))},[ki]),(0,n.jsxs)("div",{"data-testid":En.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:di||!1}),(0,n.jsx)(r.Select,{id:ji,"aria-label":ji,"data-testid":ji,isDisabled:Yi||Ce||pt||Ba,selectedKey:ki,onSelectionChange:J0=>{var Ji;Ii("location_type_input_selected",{choice:(Ji=ra.find(({id:tt})=>tt===J0))==null?void 0:Ji.label,_event_metadata:{description:"A user changed the location type input."}}),J0!==ki&&(cn(J0),po(J0))},hint:Ti,isInvalid:!!Ti,items:ra,placeholder:"Select an option",isRequired:di,children:J0=>(0,n.jsx)(r.Select.Item,{id:J0.id,"data-testid":J0.id,value:J0,children:J0.label},J0.id)},ji),ki===at.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!Yo,children:Yo}),ki===at.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:di||!1}),(0,n.jsx)(at.AddressTypeahead,{onValueChange:w0,isDisabled:Ba,setIsLoading:_a,initialValue:{placeId:vo.current.placeId||"",description:vo.current.addressDescription||""},errorText:Yo||Ti})]}),ki===at.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:di||!1}),(0,n.jsx)(r.Input,{isRequired:di,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${ji}-zipcode`,placeholder:"Type your response here...",value:vo.current.zipcode||"",onChange:Br,onBlur:u0,isDisabled:Yi||pt||Ba,hint:Yo||Ti,isInvalid:!!Yo||!!Ti,autoComplete:"postal-code"},`${ji}-zipcode`)]})]})},et=En=>(0,n.jsx)(at.DeviceLocationProvider,{children:(0,n.jsx)(Sn,Ye({},En))}),Rt={[i.cX]:et,[i.G6]:te,[i.c3]:$e,[i.AA]:Ee,[i.mO]:h,[i.PM]:k,[i.HH]:I,[i.Us]:Se,[i.Tl]:R,[i.G0]:p,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v};var Ht,kn=new Uint8Array(16);function Sr(){if(!Ht&&(Ht=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(kn)}const hn=/^(?:[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 In(En){return typeof En=="string"&&hn.test(En)}const mr=In;for(var Dn=[],$r=0;$r<256;++$r)Dn.push(($r+256).toString(16).substr(1));function kr(En){var Kn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,or=(Dn[En[Kn+0]]+Dn[En[Kn+1]]+Dn[En[Kn+2]]+Dn[En[Kn+3]]+"-"+Dn[En[Kn+4]]+Dn[En[Kn+5]]+"-"+Dn[En[Kn+6]]+Dn[En[Kn+7]]+"-"+Dn[En[Kn+8]]+Dn[En[Kn+9]]+"-"+Dn[En[Kn+10]]+Dn[En[Kn+11]]+Dn[En[Kn+12]]+Dn[En[Kn+13]]+Dn[En[Kn+14]]+Dn[En[Kn+15]]).toLowerCase();if(!mr(or))throw TypeError("Stringified UUID is invalid");return or}const Wt=kr;function _e(En,Kn,or){En=En||{};var L0=En.random||(En.rng||Sr)();if(L0[6]=L0[6]&15|64,L0[8]=L0[8]&63|128,Kn){or=or||0;for(var B0=0;B0<16;++B0)Kn[or+B0]=L0[B0];return Kn}return Wt(L0)}const lt=_e,Je=(En,Kn="application/octet-stream")=>{try{const or=window.atob(En),L0=new Uint8Array(or.length);for(let G0=0;G0<or.length;G0++)L0[G0]=or.charCodeAt(G0);return new Blob([L0],{type:Kn}).size}catch{return 0}},nt=(En,Kn)=>`data:${Kn};base64,${En}`,ot=(En,Kn,or=512)=>{const L0=window.atob(En),B0=[];for(let Ii=0;Ii<L0.length;Ii+=or){const ji=L0.slice(Ii,Ii+or),di=new Array(ji.length);for(let Ti=0;Ti<ji.length;Ti++)di[Ti]=ji.charCodeAt(Ti);const Yi=new Uint8Array(di);B0.push(Yi)}const G0=new Blob(B0,{type:Kn});return URL.createObjectURL(G0)},ct=En=>{const Kn=new Date().toISOString().replace(/[:.-]/g,"");return`${En.split(" ").join("-")}_${Kn}`},Et=4e3,st=.8,oe=(En,Kn)=>{var or,L0;const B0=(or=Kn?.maxDimension)!=null?or:Et,G0=(L0=Kn?.quality)!=null?L0:st;return new Promise((Ii,ji)=>{if(!En.type.startsWith("image/")){Ii(En);return}const di=new Image,Yi=URL.createObjectURL(En);di.onload=()=>{URL.revokeObjectURL(Yi);let{width:Ti,height:ki}=di;if(Ti>B0||ki>B0){const ra=B0/Math.max(Ti,ki);Ti=Math.round(Ti*ra),ki=Math.round(ki*ra)}const po=document.createElement("canvas");po.width=Ti,po.height=ki;const Yo=po.getContext("2d");if(!Yo){Ii(En);return}Yo.drawImage(di,0,0,Ti,ki);const pa=En.type==="image/png"?"image/png":"image/jpeg",vo=En.type==="image/png"?void 0:G0;po.toBlob(ra=>{if(!ra||ra.size>=En.size){Ii(En);return}Ii(new File([ra],En.name,{type:pa}))},pa,vo)},di.onerror=()=>{URL.revokeObjectURL(Yi),ji(new Error(`Failed to load image: ${En.name}`))},di.src=Yi})},Me=50,Ue=(En,Kn=Me)=>{if(En.length<=Kn)return En;const or=En.lastIndexOf("."),L0=or!==-1?En.slice(or):"",B0=or!==-1?En.slice(0,or):En,G0=Kn-L0.length-1,Ii=Math.ceil(G0/2),ji=Math.floor(G0/2);return`${B0.slice(0,Ii)}\u2026${B0.slice(-ji)}${L0}`};var ze=Object.defineProperty,zt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,_n=Object.prototype.hasOwnProperty,Or=Object.prototype.propertyIsEnumerable,Ft=(En,Kn,or)=>Kn in En?ze(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,we=(En,Kn)=>{for(var or in Kn||(Kn={}))_n.call(Kn,or)&&Ft(En,or,Kn[or]);if(vn)for(var or of vn(Kn))Or.call(Kn,or)&&Ft(En,or,Kn[or]);return En},Ze=(En,Kn)=>zt(En,Xt(Kn)),At=(En,Kn,or)=>new Promise((L0,B0)=>{var G0=di=>{try{ji(or.next(di))}catch(Yi){B0(Yi)}},Ii=di=>{try{ji(or.throw(di))}catch(Yi){B0(Yi)}},ji=di=>di.done?L0(di.value):Promise.resolve(di.value).then(G0,Ii);ji((or=or.apply(En,Kn)).next())});const Jt=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{const{linkId:ji,text:di,required:Yi,prefix:Ti,readOnly:ki,repeats:po,extension:Yo}=En,pa=(0,o.Qr)(Yo),vo=(0,o.cz)(Yo),ra=(0,o.$H)(Yo)||"image/*,.pdf,.doc,.docx",da=di?(0,o.nt)(B0,Ti,di):"",Ba=G0?.[ji]||"",[_a,Fa]=(0,t.useState)([]),ga=(0,t.useRef)(or||[]);(0,t.useEffect)(()=>{or&&(ga.current=or)},[or]),(0,t.useEffect)(()=>{or?.length&&Fa(De=>{const Ce=De.filter(pt=>pt.isLoading||pt.failed);return[...or.filter(pt=>pt.valueAttachment).map((pt,Kt)=>{var dn,Zn,Lr,zn,qn;const cn=((dn=pt.valueAttachment)==null?void 0:dn.title)||`attachment-${Kt}`,yr=(Zn=pt.valueAttachment)==null?void 0:Zn.id,Br=De.find(w0=>yr&&w0.id===yr||!yr&&w0.id===`existing-${Kt}`),u0=(Lr=pt.valueAttachment)==null?void 0:Lr.data,W0=u0?Je(u0,(zn=pt.valueAttachment)==null?void 0:zn.contentType):0;return{id:yr||Br?.id||`existing-${Kt}`,name:cn,size:Br?.size||W0,progress:100,failed:!1,type:(0,o.J4)((qn=pt.valueAttachment)==null?void 0:qn.contentType),isLoading:!1}}),...Ce]})},[or]);const Ta=De=>{let Ce=Array.from(De);if(vo!==void 0){const pt=vo-_a.length;if(pt<=0)return;Ce=Ce.slice(0,pt)}const We=Ce.map(pt=>{const Kt=pa&&pt.size>pa,dn=pt.name.replace(/\s+/g,"-");return{id:lt(),name:dn,size:pt.size,progress:0,type:(0,o.J4)(pt.type),failed:!!Kt,isLoading:!Kt,disableRetry:!!Kt,errorMessage:Kt?`File size exceeds ${(pa/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});Fa(pt=>[...pt,...We]),We.filter(pt=>!pt.failed).forEach(pt=>{const Kt=Ce.find(dn=>dn.name.replace(/\s+/g,"-")===pt.name);Kt&&Sa(Kt,pt.id)})},Sa=(De,Ce)=>At(void 0,null,function*(){try{const We=yield oe(De),pt=yield Qr(We),Kt=We.name.replace(/\s+/g,"-");Fa(zn=>zn.map(qn=>qn.id===Ce?Ze(we({},qn),{isLoading:!1,progress:100,failed:!1}):qn));const dn={valueAttachment:{id:Ce,contentType:We.type,data:pt,title:Kt}},Lr=[...(ga.current||[]).filter(zn=>zn.valueAttachment||Object.keys(zn).length>0),dn];ga.current=Lr,L0(En,Lr),Kn(ji)}catch{Fa(pt=>pt.map(Kt=>Kt.id===Ce?Ze(we({},Kt),{isLoading:!1,failed:!0}):Kt))}}),Xr=De=>{const Ce=_a.find(We=>We.id===De);if(Fa(We=>We.filter(pt=>pt.id!==De)),Ce){const We=(ga.current||[]).filter((pt,Kt)=>{var dn;if(De.startsWith("existing-")){const Zn=parseInt(De.replace("existing-",""));return Kt!==Zn}return((dn=pt.valueAttachment)==null?void 0:dn.id)!==De}).filter(pt=>pt.valueAttachment||Object.keys(pt).length>0);ga.current=We,L0(En,We.length>0?We:[{}])}},zr=De=>{const Ce=_a.find(We=>We.id===De);if(Ce){Fa(pt=>pt.map(Kt=>Kt.id===De?Ze(we({},Kt),{failed:!1,isLoading:!0,progress:0}):Kt));const We=new File([""],Ce.name,{type:"application/octet-stream"});Sa(We,De)}},Qr=De=>new Promise((Ce,We)=>{const pt=new FileReader;pt.onload=()=>{const dn=pt.result.split(",")[1];Ce(dn)},pt.onerror=We,pt.readAsDataURL(De)});return(0,n.jsxs)("div",{children:[da&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:da,required:Yi||!1}),(0,n.jsx)(r.FileUpload,{files:_a,onDropFiles:Ta,onDeleteFile:Xr,onRetryFile:zr,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(ra,pa,vo),accept:ra,allowsMultiple:po!==!1,isDisabled:ki||Ii||vo!==void 0&&_a.length>=vo,className:"w-full",showDisclosureModal:!0}),Ba&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ba})]})},rn=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{var ji,di;const{linkId:Yi,text:Ti,prefix:ki,readOnly:po,required:Yo,extension:pa}=En,{trackQuestionnaireEvent:vo}=(0,b.c)(),ra=Ti?(0,o.nt)(B0,ki,Ti):"",da=G0?.[Yi];return pa?.find(_a=>{var Fa,ga;return _a.url===i.gD&&((ga=(Fa=_a.valueCodeableConcept)==null?void 0:Fa.coding)==null?void 0:ga.some(Ta=>Ta.system===i.n4&&Ta.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Yi,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Yi,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Yi,name:Yi,isDisabled:po||Ii,isSelected:(ji=or?.[0])==null?void 0:ji.valueBoolean,"aria-label":Yi,label:"",className:"mt-1",onChange:_a=>{vo(En.linkId,{value:_a}),L0(En,[{valueBoolean:_a}]),Kn(En.linkId)}}),ra&&(0,n.jsx)(N,{isLabel:!0,text:ra,required:Yo||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!da,children:da})]}):(0,n.jsxs)("div",{"data-testid":Yi,children:[ra&&(0,n.jsx)(N,{isLabel:!0,text:ra,required:Yo||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Yi,name:Yi,"aria-label":Yi,value:String((di=or?.[0])==null?void 0:di.valueBoolean)||"",onChange:_a=>{L0(En,[{valueBoolean:_a==="true"}]),Kn(En.linkId)},isInvalid:!!da,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:po||Ii}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:po||Ii})]},Yi),da&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:da})})]})},it=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi,Ti,ki;const{linkId:po,text:Yo,required:pa,answerOption:vo,prefix:ra,readOnly:da}=En,Ba=Yo?(0,o.nt)(B0,ra,Yo):"",_a=vo?.map(Ta=>{var Sa,Xr,zr;return{id:((Sa=Ta.valueCoding)==null?void 0:Sa.code)||Ta.valueString||"",label:((Xr=Ta.valueCoding)==null?void 0:Xr.display)||Ta.valueString||"",value:((zr=Ta.valueCoding)==null?void 0:zr.code)||Ta.valueString||""}})||[],Fa=((Ti=(Yi=or?.[0])==null?void 0:Yi.valueCoding)==null?void 0:Ti.code)||((ki=or?.[0])==null?void 0:ki.valueString)||"",ga=G0?.[po];return(0,n.jsxs)("div",{children:[Ba&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ba,required:pa||!1}),(0,n.jsx)(r.Select,{id:po,"aria-label":po,"data-testid":po,isDisabled:da||Ii,selectedKey:Fa,onSelectionChange:Ta=>{const Sa=String(Ta),Xr=_a.find(De=>De.value===Sa),zr=Xr?Xr.label:"",Qr=Boolean(vo?.find(De=>De.valueString===Sa));L0(En,[Qr?{valueString:Sa}:{valueCoding:{code:Sa,display:zr}}]),Kn(En.linkId)},isInvalid:!!ga,hint:ga||di,items:_a,placeholder:ji,isRequired:pa,children:Ta=>(0,n.jsx)(r.Select.Item,{id:Ta.id,"data-testid":Ta.value,value:Ta.value,children:Ta.label},Ta.id)},po)]})},Pt=En=>{var Kn,or,L0;const{item:B0,selectedAnswer:G0,updatedText:Ii,required:ji,errorMessage:di}=En,Yi=B0?.type==="reference",Ti=(Kn=G0?.map(vo=>{var ra,da;return Yi?(ra=vo.valueReference)==null?void 0:ra.display:(da=vo.valueCoding)==null?void 0:da.code}).filter(vo=>vo!==void 0))!=null?Kn:[],[ki,po]=(0,t.useState)(Ti.length),Yo=(L0=(or=B0.extension)==null?void 0:or.find(vo=>vo.url===i.Z_))==null?void 0:L0.valueInteger,pa=(vo,ra)=>{var da,Ba,_a;let Fa;if(vo){const ga=En.options.find(Ta=>Ta.value===ra);Fa=[...(Ba=(da=En.selectedAnswer)==null?void 0:da.filter(Ta=>Object.keys(Ta).length!==0))!=null?Ba:[],Yi?{valueReference:ga?.valueReference}:{valueCoding:{code:ra,display:ga?.label}}],po(Ta=>Ta+1)}else Fa=((_a=En.selectedAnswer)==null?void 0:_a.filter(ga=>{var Ta,Sa;return Yi?((Ta=ga.valueReference)==null?void 0:Ta.display)!==ra:((Sa=ga.valueCoding)==null?void 0:Sa.code)!==ra}))||[{}],po(ga=>ga-1);En.handleInputChange(En.item,Fa)};return(0,n.jsxs)("div",{"data-testid":B0.linkId,children:[Ii&&(0,n.jsx)(N,{isLabel:!0,text:Ii,required:ji||!1}),(0,n.jsx)("div",{children:En.options.map((vo,ra)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":vo.value,id:ra.toString(),className:ra!==En.options.length-1?"mb-2xl":"",name:vo.label,isInvalid:!!di,isSelected:Ti?.includes(vo?.value),label:vo.label,onChange:da=>pa(da,vo.value),isDisabled:En.readOnly||En.isLoading||(!Ti?.includes(vo?.value)&&Yo?ki>=Yo:!1)},ra))}),(0,n.jsx)(r.HintText,{isInvalid:!!di,children:di})]})},Zt=({item:En,onCompleteHandler:Kn,updatedText:or,options:L0,handleInputChange:B0,errorMessage:G0,readOnly:Ii,initialValue:ji,selectedAnswer:di,isLoading:Yi,required:Ti})=>{var ki,po;const Yo=`${En.linkId}-label`,pa=`${En.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":En.linkId,children:[or&&(0,n.jsx)(N,{id:Yo,isLabel:!0,text:or,required:Ti||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:En.linkId,name:En.linkId,"aria-labelledby":or?Yo:void 0,"aria-describedby":G0?pa:void 0,isRequired:Ti,className:L0.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((po=(ki=di?.[0])==null?void 0:ki.valueCoding)==null?void 0:po.code)||ji||"",onChange:vo=>{const ra=vo,da=L0.find(_a=>_a.value===ra),Ba=da?da.label:"";B0(En,[{valueCoding:{code:ra,display:Ba}}]),Kn(En.linkId)},isInvalid:!!G0,children:L0.map(vo=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":vo.value,isDisabled:Ii||Yi,value:vo.value,label:vo.label},vo.value))},En.linkId),G0&&(0,n.jsx)("div",{id:pa,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:G0})})]})};var en=Object.defineProperty,qt=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,ln=Object.prototype.propertyIsEnumerable,Un=(En,Kn,or)=>Kn in En?en(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,cr=(En,Kn)=>{for(var or in Kn||(Kn={}))Lt.call(Kn,or)&&Un(En,or,Kn[or]);if(qt)for(var or of qt(Kn))ln.call(Kn,or)&&Un(En,or,Kn[or]);return En};const M0=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi,Ti,ki,po,Yo;const{linkId:pa,text:vo,required:ra,answerOption:da,prefix:Ba,readOnly:_a}=En,Fa=En?.type==="reference",ga=vo?(0,o.nt)(B0,Ba,vo):"",Sa=(()=>{var We,pt;const Kt=da?.find(dn=>dn.initialSelected===!0);return Kt?Fa?((We=Kt.valueReference)==null?void 0:We.display)||"":((pt=Kt?.valueCoding)==null?void 0:pt.code)||"":""})(),Xr=(da?.map(We=>{var pt,Kt,dn,Zn;return{label:((pt=We?.valueCoding)==null?void 0:pt.display)||((Kt=We?.valueReference)==null?void 0:Kt.display)||"",value:Fa?((dn=We.valueReference)==null?void 0:dn.display)||"":((Zn=We.valueCoding)==null?void 0:Zn.code)||"",valueReference:Fa?We.valueReference:{}}})||[]).filter(We=>We.label),zr=G0?.[pa],Qr=(Yo=(po=(ki=(Ti=(Yi=En?.extension)==null?void 0:Yi.find(We=>We.url.includes("questionnaire-itemControl")))==null?void 0:Ti.valueCodeableConcept)==null?void 0:ki.coding)==null?void 0:po[0])==null?void 0:Yo.code;let De=null;const Ce={item:En,onCompleteHandler:Kn,updatedText:ga,options:Xr,handleInputChange:L0,errorMessage:zr,required:ra,readOnly:_a,initialValue:Sa,selectedAnswer:or,isLoading:Ii,showQuestionPrefix:B0,placeholder:ji,hintText:di};switch(Qr){case"drop-down":De=(0,n.jsx)(it,cr({},Ce));break;case"check-box":De=(0,n.jsx)(Pt,cr({},Ce));break;case"radio-button":De=(0,n.jsx)(Zt,cr({},Ce));break}return(0,n.jsx)(n.Fragment,{children:De})};var Tn=e(73697),xn=e(71924),nn=e(46776);const mt=En=>`${String(En.month).padStart(2,"0")}/${String(En.day).padStart(2,"0")}/${En.year}`,Nt=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi,Ti,ki;const{linkId:po,text:Yo,required:pa,prefix:vo,readOnly:ra}=En,da=(0,t.useRef)(null),[Ba,_a]=(0,t.useState)(!1),[Fa,ga]=(0,t.useState)(null),{setIsCurrentFormValid:Ta,isCurrentFormValid:Sa,trackQuestionnaireEvent:Xr}=(0,b.c)(),zr=Yo?(0,o.nt)(B0,vo,Yo):"",Qr=G0?.[po]||"",De=(Yi=En.extension)==null?void 0:Yi.find(tt=>tt.url===i.dU),Ce=(Ti=En.extension)==null?void 0:Ti.find(tt=>tt.url===i.bK),We=(0,t.useMemo)(()=>{var tt;const Tt=De?.valueString||De?.valueDate;return Tt||(0,o.iI)((tt=De?.valueExpression)==null?void 0:tt.expression)},[De]),pt=(0,t.useMemo)(()=>{var tt;const Tt=Ce?.valueString||Ce?.valueDate;return Tt||(0,o.iI)((tt=Ce?.valueExpression)==null?void 0:tt.expression)},[Ce]),Kt=(0,t.useMemo)(()=>{if(We&&/^\d{4}-\d{2}-\d{2}$/.test(We))try{return(0,Tn._U)(We)}catch{}return(0,Tn._U)("1900-01-01")},[We]),dn=(0,t.useMemo)(()=>{if(pt&&/^\d{4}-\d{2}-\d{2}$/.test(pt))try{return(0,Tn._U)(pt)}catch(tt){console.warn("Failed to parse maxDateStr:",pt,tt)}return(0,Tn._U)("2099-12-31")},[pt]),Lr=(tt=>{if(!tt)return"";const Tt=tt.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!Tt)return tt;const[,mn,bn,nr]=Tt;return`${bn}/${nr}/${mn}`})(((ki=or?.[0])==null?void 0:ki.valueDate)||""),zn=tt=>{if(!tt)return"";const Tt=tt.replace(/\D/g,"");if(Tt.length===0)return"";if(Tt.length<=2)return Tt.length===2?`${Tt}/`:Tt;const mn=nr=>{const pr=nr.slice(0,2),l0=nr.slice(2);return l0.length===2?`${pr}/${l0}/`:`${pr}/${l0}`},bn=nr=>{const pr=nr.slice(0,2),l0=nr.slice(2,4),Z0=nr.slice(4,8);return`${pr}/${l0}/${Z0}`};return Tt.length<=4?mn(Tt):bn(Tt)},qn=()=>{if(ra||Ii)return;if(Lr.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const Tt=(0,Tn._U)(Lr);ga(Tt)}catch{ga(null)}else{const Tt=Lr.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Tt){const[,mn,bn,nr]=Tt,pr=parseInt(mn,10),l0=parseInt(bn,10);if(pr>=1&&pr<=12&&l0>=1&&l0<=31)try{const Z0=(0,Tn._U)(`${nr}-${mn}-${bn}`);ga(Z0)}catch{ga(null)}else ga(null)}else ga(null)}_a(!0)},cn=()=>{if(Fa){const tt=`${Fa.year}-${String(Fa.month).padStart(2,"0")}-${String(Fa.day).padStart(2,"0")}`;Xr(En.linkId,{value:(0,o.CP)(`${String(Fa.month).padStart(2,"0")}/${String(Fa.day).padStart(2,"0")}/${Fa.year}`)}),L0(En,[{valueDate:(0,o.Fy)(tt)}])}_a(!1),ga(null)},yr=()=>{_a(!1),ga(null)},Br=tt=>{var Tt;const mn=((Tt=da.current)==null?void 0:Tt.selectionStart)||0,bn=Lr,nr=zn(tt),pr=nr.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(pr){const[,l0,Z0,C0]=pr,wi=parseInt(l0,10),Pi=parseInt(Z0,10),Wi=parseInt(C0,10);if(u0(wi,Pi,Wi).isValid){const $i=`${C0}-${l0}-${Z0}`;Xr(En.linkId,{value:(0,o.CP)(`${l0}/${Z0}/${C0}`)}),L0(En,[{valueDate:(0,o.Fy)($i)}])}else L0(En,[{valueDate:nr}])}else L0(En,[{valueDate:nr}]);setTimeout(()=>{if(da.current){const l0=bn.replace(/\D/g,""),Z0=nr.replace(/\D/g,"");let C0=mn;nr===bn&&(C0=mn-1),Z0.length>=l0.length&&nr!==bn?nr[mn-1]==="/"?C0=mn+1:C0=mn:Z0.length<l0.length&&(bn[mn-1]==="/"?C0=Math.max(0,mn-1):C0=mn),da.current.setSelectionRange(C0,C0)}},0)},u0=(tt,Tt,mn)=>{if(tt<1||tt>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(Tt<1||Tt>31)return{isValid:!1,error:"Day must be between 01 and 31"};const bn=new Date(mn,tt,0).getDate();if(Tt>bn)return{isValid:!1,error:"Invalid day for the selected month"};if(We||pt){const nr=new xn.ng(mn,tt,Tt);if(We&&/^\d{4}-\d{2}-\d{2}$/.test(We))try{const pr=(0,Tn._U)(We);if(nr.compare(pr)<0){const l0=(0,o.di)(i.Ck,En.extension);if(l0)return{isValid:!1,error:l0};const Z0=mt(pr);return{isValid:!1,error:`Date must be on or after ${Z0}`}}}catch{}if(pt&&/^\d{4}-\d{2}-\d{2}$/.test(pt))try{const pr=(0,Tn._U)(pt);if(nr.compare(pr)>0){const l0=(0,o.di)(i.Cx,En.extension);if(l0)return{isValid:!1,error:l0};const Z0=mt(pr);return{isValid:!1,error:`Date must be on or before ${Z0}`}}}catch{}}return{isValid:!0,error:""}},W0=()=>{const tt=Lr.replace(/\D/g,"");if(tt.length>0&&tt.length<8){Kn(En.linkId);return}const Tt=Lr.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!Tt&&tt.length>=6){Kn(En.linkId);return}if(Tt){const[,mn,bn,nr]=Tt,pr=parseInt(mn,10),l0=parseInt(bn,10),Z0=parseInt(nr,10);if(u0(pr,l0,Z0).isValid){const C0=`${nr}-${mn}-${bn}`;L0(En,[{valueDate:(0,o.Fy)(C0)}])}}Kn(En.linkId)},J0=(()=>{if(!Lr)return"";const tt=Lr.replace(/\D/g,"");if(tt.length>0&&tt.length<8)return"";const Tt=Lr.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!Tt&&tt.length>=6)return Sa&&Ta(!1),"Invalid date";if(Tt){const[,mn,bn,nr]=Tt,pr=parseInt(mn,10),l0=parseInt(bn,10),Z0=parseInt(nr,10),{isValid:C0,error:wi}=u0(pr,l0,Z0);if(!C0)return Sa&&Ta(!1),wi||"Invalid date"}return""})(),Ji=!!Qr||!!J0;return(0,n.jsxs)("div",{children:[zr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:zr,required:pa||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:ra||Ii,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",(ra||Ii)&&"cursor-not-allowed opacity-50"),onClick:qn,"aria-label":"Open calendar",children:(0,n.jsx)(F.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,P.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(ra||Ii)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:da,isRequired:pa,size:"md",type:"text",name:po,"data-testid":po,id:po,value:Lr,onChange:Br,placeholder:ji,isDisabled:ra||Ii,onBlur:W0,hint:J0||Qr||di,isInvalid:Ji,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},po)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:Ba,onOpenChange:tt=>{tt||yr()},primaryButton:{children:"Apply",onClick:cn,isDisabled:!Fa},secondaryButton:{children:"Cancel",onClick:yr},children:(0,n.jsx)(nn.lr,{value:Fa,onChange:ga,minValue:Kt,maxValue:dn,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:Kt,maxValue:dn,onYearPickerOpen:()=>{ga(null)}})})})]})},jt=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{var ji;const{linkId:di,text:Yi,required:Ti,prefix:ki,readOnly:po}=En,Yo=Yi?(0,o.nt)(B0,ki,Yi):"",pa=G0?.[di]||"";return(0,n.jsxs)("div",{children:[Yo&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Yo,required:Ti||!1}),(0,n.jsx)(r.Input,{isRequired:Ti,size:"md",type:"datetime-local",id:di,"aria-label":di,"data-testid":di,placeholder:"Type your response here...",value:((ji=or?.[0])==null?void 0:ji.valueDateTime)||"",onChange:vo=>{let ra=vo;const[da,Ba]=ra.split("T");da&&Ba&&(ra=`${(0,o.Fy)(da)}T${Ba}:00`),L0(En,[{valueDateTime:ra}])},isDisabled:po||Ii,onBlur:()=>{Kn(En.linkId)},hint:pa,isInvalid:!!pa},di)]})},gn=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi;const{linkId:Ti,text:ki,required:po,prefix:Yo,readOnly:pa}=En,vo=ki?(0,o.nt)(B0,Yo,ki):"",ra=G0?.[Ti]||"",da=(0,o.a0)(En),Ba=(Yi=or?.[0])==null?void 0:Yi.valueDecimal,[_a,Fa]=(0,t.useState)(String(Ba??""));return(0,t.useEffect)(()=>{Fa(String(Ba??""))},[Ba]),(0,n.jsxs)("div",{children:[vo&&(0,n.jsx)(N,{isLabel:!0,text:vo,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,size:"md",id:Ti,"aria-label":Ti,"data-testid":Ti,placeholder:ji,value:_a,onChange:ga=>{Fa(ga)},isDisabled:pa||Ii,onBlur:()=>{const ga=parseFloat(_a);Fa(isNaN(ga)?"":String(ga)),L0(En,[{valueDecimal:isNaN(ga)?void 0:ga}]),Kn(En.linkId)},type:"number",hint:ra||di,isInvalid:!!ra,autoComplete:da},Ti)]})},tn=({item:En,showStepper:Kn=!1})=>{var or;const{text:L0,linkId:B0,type:G0}=En,Ii=L0&&(0,o.nt)(!1,"",L0),ji=(or=En.extension)==null?void 0:or.find(ki=>ki.url===i.Yt),di=ji?.valueBoolean===!0,Yi=G0==="group"&&(0,o.$O)(En)!==void 0,Ti=()=>{const ki=(0,o.$O)(En),po=(0,o.t7)(En);if(ki===void 0||po===void 0||po<=0)return[];const Yo=[];for(let pa=1;pa<=po;pa++){let vo="incomplete";pa<ki?vo="complete":pa===ki&&(vo="current"),Yo.push({title:"",description:"",status:vo})}return Yo};return Ii&&!di?(0,n.jsxs)("div",{"data-testid":B0,children:[(0,n.jsx)(N,{text:Ii,required:!1,className:""}),Kn&&Yi&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:Ti()})})]}):null},Cn=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi;const{linkId:Ti,text:ki,required:po,prefix:Yo,readOnly:pa}=En,vo=ki?(0,o.nt)(B0,Yo,ki):"",ra=G0?.[Ti]||"",da=(0,o.a0)(En);return(0,n.jsxs)("div",{children:[vo&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:vo,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,"data-testid":Ti,size:"md",id:Ti,"aria-label":Ti,placeholder:ji,value:String((Yi=or?.[0])==null?void 0:Yi.valueInteger)||"",onChange:Ba=>{L0(En,[{valueInteger:Number(Ba)}])},isDisabled:pa||Ii,onBlur:()=>{Kn(En.linkId)},type:"number",hint:ra||di,isInvalid:!!ra,autoComplete:da},Ti)]})},er=({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi,Ti,ki;const{linkId:po,text:Yo,extension:pa,required:vo,prefix:ra,readOnly:da}=En,Ba=Yo?(0,o.nt)(B0,ra,Yo):"",_a=pa?.find(Ta=>Ta.url.includes("questionnaire-unitOption")),Fa=G0?.[po],ga=(0,o.a0)(En);return(0,n.jsxs)("div",{children:[Ba&&(0,n.jsx)(N,{isLabel:!0,text:Ba,required:vo||!1}),(0,n.jsx)(r.InputGroup,{isRequired:vo,size:"md",id:po,"aria-label":po,"data-testid":po,value:(Yi=or?.[0])!=null&&Yi.valueQuantity?String((Ti=or[0].valueQuantity)==null?void 0:Ti.value):"",onChange:Ta=>{L0(En,[{valueQuantity:{value:parseFloat(Ta)}}])},isDisabled:da||Ii,onBlur:()=>{var Ta,Sa,Xr;const zr=(Ta=or?.[0])!=null&&Ta.valueQuantity?parseFloat(String((Xr=(Sa=or?.[0])==null?void 0:Sa.valueQuantity)==null?void 0:Xr.value)).toFixed(2):"";L0(En,[{valueQuantity:{value:parseFloat(zr)}}]),Kn(En.linkId)},hint:Fa||di,isInvalid:!!Fa,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:(ki=_a?.valueCoding)==null?void 0:ki.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:ji,autoComplete:ga})},po)]})};var Fr=e(61784);const Vr="ui-toolkit-modern",Hr={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"},f0={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},Ni={[f0.CURRENT_LOCATION]:Hr.CURRENT_LOCATION,[f0.ZIP_CODE]:Hr.ZIP_CODE,[f0.ADDRESS]:Hr.ADDRESS},H0={mi:{singular:Hr.MILE,plural:Hr.MILES}},ai=({resourceData:En,handleInputChange:Kn,item:or,questionnaireSchemaItems:L0})=>{var B0;const{t:G0}=(0,Fr.SS)(),{queryParams:Ii}=(0,at.useSearchQueryParams)(),ji=Ii.locationType||"",{setCurrentGroupIndex:di,handleContinueButtonClick:Yi,setHideFooterButton:Ti}=(0,b.c)(),{trackEvent:ki}=(0,s.st)();(0,t.useEffect)(()=>{if(!or.readOnly)return Ti(!0),()=>{Ti(!1)}},[or.readOnly,Ti]);const po=(B0=or.extension)==null?void 0:B0.find(Sa=>Sa.url===i.Uf),Yo=po?.valueString,pa=()=>{if(Yo){const Sa=(0,o.Ue)(L0||[],Yo);Sa!==-1&&di(Sa)}},vo=Sa=>{const Xr=Sa.find(zr=>zr.url.includes("description"));return Xr?.valueString||""},ra=Sa=>{const Xr=Sa.find(pt=>pt.url.includes("distance-value")),zr=Sa.find(pt=>pt.url.includes("distance-unit")),Qr=Xr?.valueString?Number(Xr.valueString):NaN,De=zr?.valueString||"";if(!De||isNaN(Qr))return null;const Ce=Math.round(Qr);let We=De;return H0[De]&&(We=G0(Ce===1?H0[De].singular:H0[De].plural)),ji&&Ni[ji]?G0(Hr.LOCATION_DISTANCE,{distance:`${Ce} ${We}`,locationType:G0(Ni[ji])}):G0(Hr.LOCATION_DISTANCE_AWAY,{distance:`${Ce} ${We}`})},da=Sa=>({id:Sa.id||"",providerName:Sa.name||"",specialty:"",distance:ra(Sa.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:Sa.address||"",valueReference:Sa.valueReference||{reference:Sa.id}}),Ba=Sa=>{var Xr,zr,Qr,De;const Ce=Sa;return da({id:Ce.id,name:(Xr=Ce.name)!=null?Xr:"",address:(De=(Qr=(zr=Ce?.address)==null?void 0:zr.line)==null?void 0:Qr[0])!=null?De:"",extension:Ce?.extension,valueReference:{reference:Ce.id}})},_a=Sa=>da({id:Sa?.reference,name:Sa?.display,address:vo(Sa?.extension||[]),extension:Sa?.extension,valueReference:Sa}),ga=(()=>En&&Array.isArray(En)&&En.length>0?En.map(Ba):or.initial&&Array.isArray(or.initial)&&or.initial.length>0?or.initial.map(Sa=>_a(Sa.valueReference)):or.answerOption?or.answerOption.map(Sa=>_a(Sa.valueReference)):[])(),Ta=Sa=>{Kn(or,[{valueReference:Sa}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!or.readOnly&&"pb-4xl"),children:or.readOnly?ga.map(({address:Sa,id:Xr,providerName:zr,placeholderIcon:Qr,distance:De})=>(0,n.jsx)(at.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Qr},locationName:zr,address:Sa,distance:De,actionButtonText:Yo?"Change location":void 0,onActionButtonClick:Yo?pa:void 0},Xr)):ga.map(({address:Sa,id:Xr,providerName:zr,placeholderIcon:Qr,specialty:De,valueReference:Ce,distance:We})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Qr},providerName:{content:zr},specialty:{content:De},location:{address:Sa,distance:We},actionButton:{children:"Schedule appointment",onClick:()=>{ki("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:Sa,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),Ta(Ce),Yi?.()}}},Xr))})};var j0=e(79079),mi=e(32066),gr=e(43915),Ar=e(36181),Cr=e(37234),z0=e(59931),p0=e(65388),Q0=Object.defineProperty,_i=Object.defineProperties,Ui=Object.getOwnPropertyDescriptors,ao=Object.getOwnPropertySymbols,To=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable,lo=(En,Kn,or)=>Kn in En?Q0(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,$o=(En,Kn)=>{for(var or in Kn||(Kn={}))To.call(Kn,or)&&lo(En,or,Kn[or]);if(ao)for(var or of ao(Kn))zo.call(Kn,or)&&lo(En,or,Kn[or]);return En},go=(En,Kn)=>_i(En,Ui(Kn));const Bo="tz-code",Ga={"ui-toolkit/LocationCard":ai,"ui-toolkit/TimeSlotSelection":({resourceData:En,item:Kn,handleInputChange:or,selectedAnswer:L0,questionnaireSchemaItems:B0,formData:G0,onCompleteHandler:Ii})=>{var ji,di;const{t:Yi}=(0,j0.S)(),{trackEvent:Ti}=(0,s.st)(),{isLoading:ki,setIsInlineNextQuestionTriggered:po}=(0,b.c)(),Yo=tt=>{const Tt=tt.match(/^(\d{4}-\d{2}-\d{2})/);return Tt?Tt[1]:tt},pa=tt=>{const Tt=tt.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Tt?`${Tt[1]} ${Tt[2]}`:tt},vo=tt=>{const Tt=tt.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Tt){const[,mn,bn,nr]=Tt;return new Date(parseInt(mn),parseInt(bn)-1,parseInt(nr))}return new Date},da=(()=>{var tt;if((tt=L0?.[0])!=null&&tt.valueReference){const Tt=L0[0].valueReference,mn=Tt.display||"",bn=Yo(mn);if(bn)return{date:vo(bn),slotId:Tt.reference||""}}return{date:new Date,slotId:""}})(),[Ba,_a]=(0,t.useState)(da.date),[Fa,ga]=(0,t.useState)(da.slotId),[Ta,Sa]=(0,t.useState)(new Set),Xr=(0,t.useMemo)(()=>new xn.ng(Ba.getFullYear(),Ba.getMonth()+1,Ba.getDate()),[Ba]),zr=tt=>({display:tt.display||"",id:tt.id||"",start:tt.start||"",extension:Array.isArray(tt.extension)?tt.extension:[],identifier:Array.isArray(tt.identifier)?tt.identifier:[],type:tt.type||""}),Qr=tt=>zr({display:tt.start?pa(tt.start):"",id:tt.id,start:tt.start,extension:tt.extension,identifier:tt.identifier}),De=tt=>zr({display:tt?.display||"",id:tt?.reference,start:tt?.display,extension:tt?.extension,identifier:tt?.identifier,type:tt?.type}),Ce=()=>{if(Array.isArray(En)&&En.length>0)return En.filter(tt=>tt.resourceType==="Appointment").map(Qr);if(Kn.initial&&Array.isArray(Kn.initial)&&Kn.initial.length>0)return Kn.initial.map(tt=>De(tt.valueReference));if(Kn.answerOption)return Kn.answerOption.map(tt=>De(tt.valueReference))},We=(0,t.useMemo)(()=>Ce()||[],[En,L0,Kn]),pt=(0,t.useMemo)(()=>{const tt={};return We.forEach(Tt=>{if(Tt.start&&Tt.id){const mn=Yo(Tt.start);tt[mn]||(tt[mn]=[]),tt[mn].push({display:Tt.display,id:Tt.id,start:Tt.start,extension:Tt.extension})}}),tt},[We]),Kt=(0,t.useMemo)(()=>{const tt=Object.keys(pt).sort(),Tt=[],mn=(0,o.mR)(Kn);if(tt.length===0)return Tt.push(Xr),Ta.forEach(bn=>{const nr=(0,gr.A)(bn);Tt.push(new xn.ng(nr.getFullYear(),nr.getMonth()+1,nr.getDate()))}),Tt;if(mn){const bn=(0,gr.A)(tt[0]),nr=(0,gr.A)(tt[tt.length-1]),pr=new xn.ng(bn.getFullYear(),bn.getMonth()+1,bn.getDate()),l0=new xn.ng(nr.getFullYear(),nr.getMonth()+1,nr.getDate());for(let Z0=pr;Z0.compare(l0)<=0;Z0=Z0.add({days:1})){const C0=`${Z0.year}-${String(Z0.month).padStart(2,"0")}-${String(Z0.day).padStart(2,"0")}`;pt[C0]||Tt.push(Z0)}Ta.forEach(Z0=>{const C0=(0,gr.A)(Z0),wi=new xn.ng(C0.getFullYear(),C0.getMonth()+1,C0.getDate());Tt.some(Pi=>Pi.year===wi.year&&Pi.month===wi.month&&Pi.day===wi.day)||Tt.push(wi)})}else{const bn=(0,mi.Ec)((0,mi.Xj)()),nr=bn.add({days:30});for(let pr=bn;pr.compare(nr)<=0;pr=pr.add({days:1})){const l0=`${pr.year}-${String(pr.month).padStart(2,"0")}-${String(pr.day).padStart(2,"0")}`;pt[l0]||Tt.push(pr)}}return Tt},[pt,Ta,Xr,Kn]),dn=(0,t.useMemo)(()=>(0,o.mR)(Kn)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[Kn]),Zn=(0,t.useMemo)(()=>Object.keys(pt).map(tt=>{const Tt=(0,gr.A)(tt);return new xn.ng(Tt.getFullYear(),Tt.getMonth()+1,Tt.getDate())}),[pt]),Lr=(0,Ar.A)((0,Cr.A)(Ba),"yyyy-MM-dd"),zn=(0,t.useMemo)(()=>pt[Lr]||[],[pt,Lr]);(0,t.useEffect)(()=>{const tt=Object.entries(pt).sort(([Tt],[mn])=>Tt.localeCompare(mn)).slice(0,3).reduce((Tt,[mn,bn])=>go($o({},Tt),{[`${mn} ${yr}`]:bn.map(nr=>{var pr;return(0,p0.YX)({time:nr.start,timeZone:(0,o.lv)((pr=zn[0])==null?void 0:pr.extension)}).time})}),{});Ti("slots_returned",{Specialty:"Vaccines",first_three_days_slots:tt,_event_metadata:{description:"The API called for bookable slots based on the user's answers on who, when, where and why they want to book an appointment."}})},[]);const qn=t.useRef(null),cn=t.useRef(null);(0,t.useEffect)(()=>{var tt;const Tt=Object.keys(pt).sort();if(Tt.length===0)return;const bn=!(qn.current===null)&&JSON.stringify(qn.current)!==JSON.stringify(pt);if(qn.current=pt,!!bn&&(Sa(new Set),cn.current)){const nr=cn.current;if(!(((tt=pt[nr])==null?void 0:tt.length)>0)){const l0=new Set,Z0=(0,gr.A)(nr),C0=(0,gr.A)(Tt[0]);let wi=Z0;for(;wi<C0;){const Pi=(0,Ar.A)(wi,"yyyy-MM-dd");l0.add(Pi),wi=new Date(wi),wi.setDate(wi.getDate()+1)}Sa(l0),ga("")}cn.current=null}},[pt]);const yr=(0,t.useMemo)(()=>{var tt;const Tt=zn[0];if(!Tt?.extension)return"";const mn=Tt.extension.find(bn=>bn?.url===Bo);try{return(0,z0.formatToTimeZone)(new Date,"(z)",{timeZone:(tt=mn?.valueCode)!=null?tt:""})}catch{return""}},[zn]),Br=(0,t.useMemo)(()=>{const tt=Yi(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return yr?`${tt} ${yr}`:tt},[Yi,yr]),u0=(0,t.useMemo)(()=>{const Tt=Object.keys(pt).sort().find(mn=>mn>Lr);if(Tt){const mn=(0,gr.A)(Tt);return new xn.ng(mn.getFullYear(),mn.getMonth()+1,mn.getDate())}return null},[pt,Lr]),W0=()=>{if(u0){const tt=u0.toDate((0,mi.Xj)());_a(tt),ga("")}},w0=tt=>{if(!tt){ga(""),or(Kn,void 0);return}ga(tt.id);const Tt=[{valueReference:{display:tt.display,reference:tt.id,extension:tt.extension,identifier:tt.identifier,type:tt.type}}];or(Kn,Tt)},J0=tt=>{var Tt;if(!tt)return;const mn=Object.keys(pt).sort(),bn=mn[mn.length-1],nr=mn[0],pr=`${tt.year}-${String(tt.month).padStart(2,"0")}-${String(tt.day).padStart(2,"0")}`;if(bn&&(pr>bn||nr&&pr<nr)&&(0,o.mR)(Kn)&&B0&&!Kt?.some(Z0=>Z0.compare(tt)===0)){const Z0=(0,o.yQ)(Kn,B0);if(Z0){cn.current=pr;let C0="-06:00";if((Tt=We[0])!=null&&Tt.start){const $i=We[0].start.match(/([+-]\d{2}:\d{2})$/);$i&&(C0=$i[1])}const Pi=[{valueDateTime:`${pr}T23:59:59${C0}`}],Wi=or(Z0,Pi);or(Kn,void 0,(0,o.Nw)(Wi||G0||[],Kn.linkId),void 0,!0),po(!0),Ii(Z0.linkId,!0,!0)}}const l0=tt?.toDate((0,mi.Xj)());_a(l0),ga("")},Ji=tt=>{if(!tt)return;const Tt=zn.find(mn=>mn.id===tt);Ti("slot_selected",{Specialty:"Vaccines",time_slot:Tt?(0,p0.YX)({time:Tt.start,timeZone:(0,o.lv)(zn[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."}}),w0(Tt??null)};return(0,n.jsx)(r.TimeSlot,{onChange:J0,disabledDates:Kt,highlightedDates:Zn,loading:ki,minValue:(0,mi.Ec)((0,mi.Xj)()),maxValue:(0,mi.Ec)((0,mi.Xj)()).add({days:dn}),value:Xr,defaultValue:Xr,appointmentSlots:{title:Br,onChange:Ji,defaultValue:L0&&((di=(ji=L0[0])==null?void 0:ji.valueReference)==null?void 0:di.reference)||void 0,value:Fa||void 0,items:zn.map(tt=>({label:Te(tt.start),value:tt.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Yi(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),u0&&(0,n.jsx)("button",{onClick:W0,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Yi(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var Dr=Object.defineProperty,rr=Object.defineProperties,Gr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertySymbols,U0=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,$n=(En,Kn,or)=>Kn in En?Dr(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,xr=(En,Kn)=>{for(var or in Kn||(Kn={}))U0.call(Kn,or)&&$n(En,or,Kn[or]);if(Pr)for(var or of Pr(Kn))Mn.call(Kn,or)&&$n(En,or,Kn[or]);return En},a0=(En,Kn)=>rr(En,Gr(Kn)),tr=(En,Kn)=>{var or={};for(var L0 in En)U0.call(En,L0)&&Kn.indexOf(L0)<0&&(or[L0]=En[L0]);if(En!=null&&Pr)for(var L0 of Pr(En))Kn.indexOf(L0)<0&&Mn.call(En,L0)&&(or[L0]=En[L0]);return or};const Xn=(En,Kn)=>En.answerOption?En.answerOption.map(or=>{var L0,B0;const G0=(B0=(L0=or.valueReference)==null?void 0:L0.reference)==null?void 0:B0.replace("#","");return Kn.find(Ii=>Ii.id===G0)}).filter(Boolean):[],Nr=En=>{var Kn,or,L0;const B0=En.find(G0=>{var Ii,ji;return G0.url.includes("questionnaire-itemControl")&&((ji=(Ii=G0.valueCodeableConcept)==null?void 0:Ii.coding)==null?void 0:ji.some(di=>{var Yi;return(Yi=di.code)==null?void 0:Yi.startsWith("ui-toolkit/")}))});return(L0=(or=(Kn=B0?.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:or.find(G0=>{var Ii;return(Ii=G0.code)==null?void 0:Ii.startsWith("ui-toolkit/")}))==null?void 0:L0.code},ni=En=>{var{uiToolkitCode:Kn,props:or}=En,L0=or,{item:B0,contained:G0=[],customErrorConfigurations:Ii}=L0,ji=tr(L0,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:di}=(0,b.c)(),Yi=Ga[Kn];if(!Yi)return(0,n.jsx)(n.Fragment,{});const Ti=Xn(B0,G0),ki=Ti.length>0;return!(B0.answerOption&&B0.answerOption.length>0)&&!ki&&!B0.readOnly?(di(!0),(0,n.jsx)(Ie,{configKey:Kn,customErrorConfigurations:Ii})):(0,n.jsx)(Yi,a0(xr({},ji),{item:B0,contained:G0,customErrorConfigurations:Ii,resourceData:Ti,"data-testid":B0.linkId}))},E0={attachment:Jt,choice:M0,boolean:rn,integer:Cn,string:({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi;const{linkId:Ti,text:ki,required:po,prefix:Yo,readOnly:pa}=En,vo=ki?(0,o.nt)(B0,Yo,ki):"",ra=G0?.[Ti]||"",da=(0,o.a0)(En);return(0,n.jsxs)("div",{children:[vo&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:vo,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,size:"md","aria-label":Ti,"data-testid":Ti,id:Ti,type:da==="tel"?"tel":"text",placeholder:ji,value:((Yi=or?.[0])==null?void 0:Yi.valueString)||"",onChange:Ba=>{L0(En,[{valueString:Ba}])},isDisabled:pa||Ii,onBlur:Ba=>{const _a=Ba.target.value,Fa=_a.trim();Fa!==_a&&L0(En,[{valueString:Fa}]),Kn(En.linkId)},hint:ra||di,isInvalid:!!ra,autoComplete:da},Ti)]})},url:({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi;const{linkId:Ti,text:ki,required:po,prefix:Yo,readOnly:pa}=En,vo=ki?(0,o.nt)(B0,Yo,ki):"",ra=G0?.[Ti]||"",da=(0,o.a0)(En);return(0,n.jsxs)("div",{children:[vo&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:vo,required:po||!1}),(0,n.jsx)(r.Input,{isRequired:po,size:"md",type:"url",id:Ti,"data-testid":Ti,"aria-label":Ti,placeholder:ji,value:((Yi=or?.[0])==null?void 0:Yi.valueUri)||"",onChange:Ba=>{L0(En,[{valueUri:Ba}])},isDisabled:pa||Ii,onBlur:Ba=>{const _a=Ba.target.value,Fa=_a.trim();Fa!==_a&&L0(En,[{valueUri:Fa}]),Kn(En.linkId)},hint:ra||di,isInvalid:!!ra,autoComplete:da},Ti)]})},text:({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii,placeholder:ji,hintText:di})=>{var Yi;const{linkId:Ti,text:ki,required:po,prefix:Yo,readOnly:pa,maxLength:vo}=En,ra=ki?(0,o.nt)(B0,Yo,ki):"",da=G0?.[Ti]||"",Ba=(0,o.a0)(En);return(0,n.jsxs)("div",{children:[ra&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ra,required:po||!1}),(0,n.jsx)(r.TextArea,{isRequired:po,id:Ti,"aria-label":Ti,"data-testid":Ti,rows:3,placeholder:ji,value:((Yi=or?.[0])==null?void 0:Yi.valueString)||"",onChange:_a=>{L0(En,[{valueString:_a}])},isDisabled:pa||Ii,onBlur:_a=>{const Fa=_a.target.value,ga=Fa.trim();ga!==Fa&&L0(En,[{valueString:ga}]),Kn(En.linkId)},hint:da||di,counter:!0,isInvalid:!!da,maxLength:vo,autoComplete:Ba},Ti)]})},date:Nt,time:({item:En,onCompleteHandler:Kn,selectedAnswer:or,handleInputChange:L0,showQuestionPrefix:B0,errors:G0,isLoading:Ii})=>{var ji;const{linkId:di,text:Yi,required:Ti,prefix:ki,readOnly:po}=En,Yo=Yi?(0,o.nt)(B0,ki,Yi):"",pa=G0?.[di]||"";return(0,n.jsxs)("div",{children:[Yo&&(0,n.jsx)(N,{isLabel:!0,text:Yo,required:Ti||!1}),(0,n.jsx)(r.Input,{isRequired:Ti,size:"md",type:"time",id:di,"data-testid":di,"aria-label":di,placeholder:"Type your response here...",value:((ji=or?.[0])==null?void 0:ji.valueTime)||"",onChange:vo=>{L0(En,[{valueTime:vo}])},isDisabled:po||Ii,onBlur:()=>{Kn(En.linkId)},hint:pa,isInvalid:!!pa},di)]})},dateTime:jt,quantity:er,decimal:gn,question:tn,display:tn,group:tn,reference:En=>{var Kn,or,L0,B0,G0;const{setHideFooterButton:Ii}=(0,b.c)(),{item:ji,customErrorConfigurations:di}=En,Yi=ji.extension||[],Ti=Nr(Yi);return Ti?(0,n.jsx)(ni,{uiToolkitCode:Ti,props:En}):((G0=(B0=(L0=(or=(Kn=ji?.extension)==null?void 0:Kn.find(po=>po.url.includes("questionnaire-itemControl")))==null?void 0:or.valueCodeableConcept)==null?void 0:L0.coding)==null?void 0:B0[0])==null?void 0:G0.code)==="check-box"?ji.answerOption&&ji.answerOption.length>0?(0,n.jsx)(M0,a0(xr({},En),{item:ji})):(Ii(!0),(0,n.jsx)(Ie,{configKey:ji.linkId,customErrorConfigurations:di})):null}};var Xa=(En,Kn,or)=>new Promise((L0,B0)=>{var G0=di=>{try{ji(or.next(di))}catch(Yi){B0(Yi)}},Ii=di=>{try{ji(or.throw(di))}catch(Yi){B0(Yi)}},ji=di=>di.done?L0(di.value):Promise.resolve(di.value).then(G0,Ii);ji((or=or.apply(En,Kn)).next())});const ms=({item:En,selectedAnswer:Kn,showQuestionPrefix:or})=>{const{text:L0,prefix:B0,required:G0}=En,Ii=L0?getUpdatedQuestionText(or,B0,L0):"",[ji,di]=useState(null),[Yi,Ti]=useState(!1),{documentDownload:ki,webview:po}=useNativeBridge(),Yo=(Kn||[]).filter(da=>{var Ba,_a;return((Ba=da.valueAttachment)==null?void 0:Ba.data)&&((_a=da.valueAttachment)==null?void 0:_a.title)}).map((da,Ba)=>{var _a,Fa,ga,Ta,Sa,Xr,zr;return{id:((_a=da.valueAttachment)==null?void 0:_a.id)||`preview-${Ba}`,fileName:((Fa=da.valueAttachment)==null?void 0:Fa.title)||`attachment-${Ba}`,contentType:((ga=da.valueAttachment)==null?void 0:ga.contentType)||"application/octet-stream",base64Data:((Ta=da.valueAttachment)==null?void 0:Ta.data)||"",size:getBase64Size(((Sa=da.valueAttachment)==null?void 0:Sa.data)||"",(Xr=da.valueAttachment)==null?void 0:Xr.contentType),type:getFileTypeFromMimeType((zr=da.valueAttachment)==null?void 0:zr.contentType)}}),pa=useCallback(da=>{const{fileName:Ba,contentType:_a,base64Data:Fa}=da;if(po.isWithin)di({fileName:Ba,contentType:_a,base64Data:Fa}),Ti(!0);else{const ga=base64toObjectUrl(Fa,_a),Ta=document.createElement("a");Ta.href=ga,Ta.download=Ba,document.body.appendChild(Ta),Ta.click(),document.body.removeChild(Ta),URL.revokeObjectURL(ga)}},[po.isWithin]),vo=useCallback(()=>Xa(void 0,null,function*(){!ji||(yield ki.writeFile(ji.fileName,prepareDataUrl(ji.base64Data,ji.contentType)))}),[ji,ki]),ra=useCallback(()=>{Ti(!1),di(null)},[]);return Yo.length?jsxs("div",{children:[Ii&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:Ii,required:G0||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Yo.map(da=>jsx("button",{type:"button",onClick:()=>pa(da),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(da.fileName),size:da.size,type:da.type})},da.id))}),jsx(DownloadDisclosureModal,{opened:Yi,onClose:ra,onDownload:vo,contentType:ji?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var Os=Object.defineProperty,gs=Object.defineProperties,ss=Object.getOwnPropertyDescriptors,c1=Object.getOwnPropertySymbols,Gn=Object.prototype.hasOwnProperty,vr=Object.prototype.propertyIsEnumerable,_r=(En,Kn,or)=>Kn in En?Os(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,s0=(En,Kn)=>{for(var or in Kn||(Kn={}))Gn.call(Kn,or)&&_r(En,or,Kn[or]);if(c1)for(var or of c1(Kn))vr.call(Kn,or)&&_r(En,or,Kn[or]);return En},ir=(En,Kn)=>gs(En,ss(Kn));const h0=(En,Kn,or,L0)=>{var B0;const G0=En.extension||[];if(isHiddenExtensionPresent(En)||hasParentWithUIToolkitWidget(En,Kn))return null;if(or&&En.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const Ii=getUIToolkitCode(G0),ji=G0.filter(Ti=>Ti.url.includes("questionnaire-itemControl")).flatMap(Ti=>{var ki,po;return(po=(ki=Ti.valueCodeableConcept)==null?void 0:ki.coding)!=null?po:[]})||[];let di;return L0&&(di=(B0=ji.find(Ti=>Ti.code&&L0[Ti.code]))==null?void 0:B0.code),(di&&L0?L0[di]:void 0)||UI_TOOLKIT_WIDGET_MAP[Ii||""]||typeToRenderFunctionMap[En.type]||null},$0=En=>{var Kn;const{item:or,selectedAnswer:L0,handleInputChange:B0,showQuestionPrefix:G0,errors:Ii,questionnaireSchemaItems:ji,formData:di,isNestedRepeatedItem:Yi=!1}=En,{linkId:Ti,text:ki,prefix:po,required:Yo,repeats:pa}=or,vo=getMaxOccursFromExtensions(or.extension),ra=getPlaceholderFromExtensions(or.extension,or.type),[da,Ba]=useState(()=>{if(or.type==="group"&&or.item&&or.item.length>0){const We=di?.filter(pt=>pt.linkId===or.linkId)||[];if(We.length>0)return We.map((pt,Kt)=>Kt)}else if(L0&&L0.length>0)return L0.map((We,pt)=>pt);return[0]}),_a=vo!==void 0&&da.length>=vo,Fa=ki?getUpdatedQuestionText(G0,po,ki):"",ga=()=>{const We=Math.max(...da,-1)+1,pt=[...da,We];if(Ba(pt),or.type==="group"&&or.item&&or.item.length>0){const Kt=or.item.map(Zn=>({linkId:Zn.linkId,text:Zn.text,answer:[{}]})),dn={linkId:or.linkId,text:or.text,answer:[{}],item:Kt};B0(or,void 0,[dn])}else{const Kt=[...L0||[]];Kt.push({}),B0(or,Kt)}},Ta=We=>{if(da.length<=1)return;const pt=da.filter((Kt,dn)=>dn!==da.length-1);if(Ba(pt),or.type==="group"&&or.item&&or.item.length>0){const Kt=[];if(di?.forEach((dn,Zn)=>{dn.linkId===Ti&&Kt.push({item:dn,originalIndex:Zn})}),We>=0&&We<Kt.length){const dn=Kt[We],Zn=di?.filter((Lr,zn)=>zn!==dn.originalIndex);B0(or,void 0,Zn,void 0,!0)}}else{const Kt=L0?.filter((dn,Zn)=>Zn!==We)||[];B0(or,Kt.length>0?Kt:[{}])}},Sa=We=>{if(!di||!or.item)return[];const pt=Zn=>{const Lr=[];for(const zn of Zn)if(zn.linkId===or.linkId&&Lr.push(zn),zn.item&&zn.item.length>0){const qn=pt(zn.item);Lr.push(...qn)}return Lr},dn=pt(di)[We];return dn?.item?dn.item:[]},Xr=(We,pt)=>{if(isHiddenExtensionPresent(We))return null;const Kt=Sa(pt);if(!isQuestionEnabledForInstance(We.enableWhen,We.enableBehavior,di||[],or.linkId,pt))return null;if(We.repeats){const qn=findNestedAnswer(Kt,We.linkId),cn=ir(s0({},En),{item:We,selectedAnswer:qn||[{}],errors:getInstanceErrors(Ii,or,pt),handleInputChange:(yr,Br,u0)=>B0(yr,Br,u0,pt)});return jsx("div",{children:jsx($0,ir(s0({},cn),{isNestedRepeatedItem:!0}))},We.linkId)}if(We.type==="group"&&We.item&&!getUIToolkitCode(We?.extension||[]))return jsxs("div",{children:[We.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:We.text}),jsx("div",{className:"space-y-3",children:We.item.map(qn=>{if(!isQuestionEnabledForInstance(qn.enableWhen,qn.enableBehavior,di||[],or.linkId,pt))return null;const yr=h0(qn,ji,En.isLoading,En.externalComponentRenderMap);if(!yr)return null;const Br=findNestedAnswer(Kt,qn.linkId),u0=ir(s0({},En),{item:qn,selectedAnswer:Br,placeholder:getPlaceholderFromExtensions(qn.extension,qn.type),errors:getInstanceErrors(Ii,or,pt),handleInputChange:(W0,w0,J0)=>B0(W0,w0,J0,pt)});return createElement(yr,ir(s0({},u0),{key:qn.linkId}))})})]},We.linkId);const Zn=h0(We,ji,En.isLoading,En.externalComponentRenderMap);if(!Zn)return null;const Lr=findNestedAnswer(Kt,We.linkId),zn=ir(s0({},En),{item:We,selectedAnswer:Lr,placeholder:getPlaceholderFromExtensions(We.extension,We.type),errors:getInstanceErrors(Ii,or,pt),handleInputChange:(qn,cn,yr)=>B0(qn,cn,yr,pt)});return createElement(Zn,ir(s0({},zn),{key:`${We.linkId}-${pt}`}))},zr=()=>{const We=getDirectErrors(Ii,Ti);return jsxs("div",{className:"flex flex-col gap-2",children:[We[Ti]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:We[Ti]}),!_a&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:ga,className:"mt-4 text-center",isDisabled:En.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Qr=We=>da.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>Ta(We),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${We+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:En.isLoading}),De=h0(or,ji,En.isLoading,En.externalComponentRenderMap);return hasRepeatingParent(or,ji)&&!Yi?null:!pa||pa&&hasCheckboxExtension(or)?De?jsx(De,ir(s0({},En),{placeholder:ra,errors:{[or.linkId]:((Kn=Ii?.[or.linkId])==null?void 0:Kn[0])||""}})):null:or.type==="group"&&or.item&&or.item.length>0&&or.repeats?jsxs("div",{"data-testid":`${Ti}-repeating`,children:[Fa&&jsx(FHIRQuestionnaireQuestionText,{text:Fa,required:Yo||!1}),da.map(We=>{var pt;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${We>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",We+1]}),Qr(We)]}),jsx("div",{className:"space-y-4",children:(pt=or.item)==null?void 0:pt.map(Kt=>Xr(Kt,We))})]},`${Ti}-instance-${We}`)}),zr()]}):De?jsxs("div",{"data-testid":`${Ti}-repeating`,children:[da.map(We=>{const pt=L0?.[We]?[L0[We]]:void 0,Kt=ir(s0({},En),{item:or,selectedAnswer:pt,errors:getInstanceErrors(Ii,or,We),handleInputChange:(dn,Zn,Lr)=>B0(dn,Zn,Lr,We)});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 ",We+1]}),Qr(We)]}),jsx(De,s0({},Kt))]},`${Ti}-instance-${We}`)}),jsxs("div",{children:[(()=>{const pt=getDirectErrors(Ii,Ti)[Ti];return pt&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:pt})})(),!_a&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:ga,className:"mt-4 text-center",isDisabled:En.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var $t=Object.defineProperty,Xe=Object.defineProperties,dt=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,Nn=Object.prototype.hasOwnProperty,ur=Object.prototype.propertyIsEnumerable,Rr=(En,Kn,or)=>Kn in En?$t(En,Kn,{enumerable:!0,configurable:!0,writable:!0,value:or}):En[Kn]=or,b0=(En,Kn)=>{for(var or in Kn||(Kn={}))Nn.call(Kn,or)&&Rr(En,or,Kn[or]);if(wt)for(var or of wt(Kn))ur.call(Kn,or)&&Rr(En,or,Kn[or]);return En},V0=(En,Kn)=>Xe(En,dt(Kn));const X0=null,oo=({formId:En,questionnaireSchema:Kn,questionnaireResponseItem:or,errorConfig:L0,customErrorConfigurations:B0,showQuestionPrefix:G0=!0,isAdaptiveFlow:Ii=!1,status:ji,hideBackButton:di=!1,showStepper:Yi=!1,onComplete:Ti,onClearError:ki,handleHiddenQuestion:po,onGoBack:Yo,onFormDataChange:pa=()=>{},externalComponentRenderMap:vo,children:ra})=>{var da,Ba;const{setHandleContinueButtonClick:_a,setHandleBackButtonClick:Fa,setIsCurrentFormValid:ga,setCurrentGroupLinkId:Ta,setCurrentGroupIndex:Sa,setTotalSteps:Xr,setHideFooterButton:zr,setIsInlineNextQuestionTriggered:Qr,isCurrentFormValid:De,currentGroupIndex:Ce,isLoading:We,hasCustomError:pt,groupItemIndicesRef:Kt}=useFHIRQuestionnaire(),{trackEvent:dn}=useAnalytics(),[Zn,Lr]=useState([]),[zn,qn]=useState(new Set),[cn,yr]=useState([]),[Br,u0]=useState([]),W0=Kt,w0=useRef(new Map),J0=useRef(new Set),[Ji,tt]=useState({}),[Tt,mn]=useState(!1),[bn,nr]=useState(Kn),pr=useRef(or||[]),l0=useRef(!1),Z0=useRef(!1),C0=useMemo(()=>getTotalStepsFromQuestionnaire(Kn),[Kn]),[wi,Pi]=useState(!1),Wi=useRef([]),$i=(Ao,ko)=>{var Qn,Ln,ar,Vn,hr;if(isCallNextQuestionExtensionPresent(Ao))return Ao.linkId;const c0=validateCurrentPage(ko,Zn,Ce,bn,W0),S0=W0.current[Ce],It=Ce+1,Ri=W0.current[It],so=Ce===0?0:S0,qo=(Ln=Ri??((Qn=bn?.item)==null?void 0:Qn.length))!=null?Ln:0;let Uo=-1;for(let Ns=so;Ns<qo;Ns++){const js=(ar=bn?.item)==null?void 0:ar[Ns];if(js?.linkId===Ao.linkId){Uo=Ns;break}}const wa=(Ns,js=[])=>(Ns.forEach(Wr=>{var fr;if((!Wr.enableWhen||isQuestionEnabled(Wr.enableWhen,Wr.enableBehavior,ko))&&isCallNextQuestionExtensionPresent(Wr)&&!Wi.current.includes(Wr.linkId))if(Wr.required){const B1=(fr=findResponseItem(ko,Wr.linkId))==null?void 0:fr.answer;(B1&&B1.length>0&&Object.keys(B1[0]).length>0||Wr.initial&&Wr.initial.length>0&&!zn.has(Wr.linkId))&&js.push(Wr.linkId)}else js.push(Wr.linkId);Wr.item&&Wr.item.length>0&&wa(Wr.item,js)}),js),So=[],rs=Uo!==-1?Uo+1:qo;for(let Ns=so;Ns<rs;Ns++){const js=(Vn=bn?.item)==null?void 0:Vn[Ns];js&&wa([js],So)}if(So.length>0&&c0){const Ns=So[So.length-1],js=B1=>B1.flatMap(al=>[al,...al.item?js(al.item):[]]),Wr=js((hr=bn?.item)!=null?hr:[]),fr=Wr.findIndex(B1=>B1.linkId===Ns),Jr=Wr.findIndex(B1=>B1.linkId===Ao.linkId);return fr!==-1&&Jr>fr?void 0:Ns}},Gi=Ao=>$i(Ao,pr.current)?!0:Ao.item&&Ao.item.length>0?Ao.item.some(Gi):!1,co=()=>{var Ao;if(!Ii||Ce<0||!bn?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const ko=W0.current[Ce],Ln=(w0.current.get(ko)||[ko]).some(hr=>{var c0;const S0=(c0=bn.item)==null?void 0:c0[hr];return S0?Gi(S0):!1}),ar=Ce<W0.current.length-1;let Vn=!1;if(Ln&&ar){const hr=Ce+1,c0=W0.current[hr],S0=(Ao=bn?.item)==null?void 0:Ao[c0],It=!S0?.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,pr.current),Ri=S0?isPageExtensionPresent(S0):!1;Vn=It&&Ri}return{shouldTriggerInlineLoading:Ln,canNavigateToNextGroup:Vn,hasMoreGroups:ar}},Io=(Ao,ko,Qn,Ln)=>{const ar=getUpdatedFormData(bn?.item||[],pr.current,Ao,ko,Qn,Ln);return pr.current=ar,pa(ar),ar},za=(Ao,ko,Qn,Ln,ar)=>{Io(ko,Qn,Ln,ar),Ln.forEach(Vn=>{const hr=getValidationError(V0(b0({},Ao),{linkId:Vn.linkId}),pr.current,Vn.answer);hr&&tt(c0=>V0(b0({},c0),{[Vn.linkId]:typeof ar=="number"?V0(b0({},c0[Vn.linkId]),{[ar]:hr}):hr}))})},Qa=(Ao,ko,Qn,Ln,ar)=>{var Vn;const hr=Io(ko,Qn,Ln,ar),c0=(Vn=findResponseItem(hr,ko))==null?void 0:Vn.answer,S0=getValidationError(Ao,pr.current,c0);tt(It=>V0(b0({},It),{[ko]:typeof ar=="number"?V0(b0({},It[ko]),{[ar]:S0}):S0}))},Ua=(Ao,ko)=>{const Qn=validateCurrentPage(ko,Zn,Ce,bn,W0);if(ga(Qn),bn?.item){const Ln=validateAllItemsRecursively(bn.item,ko);if(Object.keys(Ln).length>0)tt(ar=>b0(b0({},ar),Ln));else{const ar=bn.item,Vn={},hr=c0=>{c0.forEach(S0=>{Vn[S0.linkId]={},S0.item&&hr(S0.item)})};hr(ar),tt(c0=>b0(b0({},c0),Vn))}}},La=(Ao,ko,Qn,Ln,ar=!1)=>{var Vn;const{linkId:hr}=Ao;if(ar)return pr.current=Qn||[],Ua(hr,Qn||[]),pr.current;if(Qn&&Qn.length>0&&Ao.type==="group"&&Ao.repeats){let Ri=pr.current.length;for(let qo=pr.current.length-1;qo>=0;qo--)if(pr.current[qo].linkId===hr){Ri=qo+1;break}const so=[...pr.current.slice(0,Ri),...Qn,...pr.current.slice(Ri)];return pr.current=so,Ua(hr,so),pr.current}if(typeof Ln=="number"&&ko){const Ri=hasRepeatingParent(Ao,bn?.item||[]);if(Ri){const so=pr.current.filter(Uo=>Uo.linkId===Ri.linkId);if(Ln<so.length){const Uo=pr.current.map(wa=>{if(wa.linkId===Ri.linkId&&pr.current.slice(0,pr.current.indexOf(wa)).filter(rs=>rs.linkId===Ri.linkId).length===Ln){const rs=(Wr,fr)=>{const Jr=new Map(Wr.map(al=>[al.linkId,al])),B1=[];return fr?.forEach(al=>{const Ll=Jr.get(al.linkId);if(al.linkId===hr)B1.push(b0({linkId:al.linkId,text:al.text,answer:ko},Ll?.item&&{item:Ll.item}));else if(Ll)if(al.item&&al.item.length>0){const _u=rs(Ll.item||[],al.item);B1.push(V0(b0({},Ll),{item:_u}))}else B1.push(Ll);else if(al.item&&al.item.length>0){const _u=rs([],al.item);_u.some(uu=>uu.linkId===hr||uu.item&&Ns(uu.item,hr))&&B1.push({linkId:al.linkId,text:al.text,answer:[{}],item:_u})}Jr.delete(al.linkId)}),Jr.forEach(al=>{B1.push(al)}),B1},Ns=(Wr,fr)=>Wr.some(Jr=>Jr.linkId===fr||Jr.item&&Ns(Jr.item,fr)),js=rs(wa.item||[],Ri.item);return V0(b0({},wa),{item:js})}return wa});pr.current=Uo,pa(Uo)}else{const Uo=Ln+1,wa=so.length;if(wa<Uo||Uo===1){const So=[],rs=(Wr,fr,Jr)=>Wr.map(B1=>{const al={linkId:B1.linkId,text:B1.text,answer:B1.linkId===fr?Jr:[{}]};return B1.item&&B1.item.length>0&&(al.item=rs(B1.item,fr,Jr)),al});for(let Wr=wa;Wr<Uo;Wr++){const fr=Ri.item?rs(Ri.item,hr,ko):[],Jr={linkId:Ri.linkId,text:Ri.text,answer:[{}],item:fr};So.push(Jr)}let Ns=pr.current.length;for(let Wr=pr.current.length-1;Wr>=0;Wr--)if(pr.current[Wr].linkId===Ri.linkId){Ns=Wr+1;break}const js=[...pr.current.slice(0,Ns),...So,...pr.current.slice(Ns)];pr.current=js,pa(js)}}const qo=getValidationError(Ao,pr.current,ko);return tt(Uo=>V0(b0({},Uo),{[hr]:typeof Ln=="number"?V0(b0({},Uo[hr]),{[Ln]:qo}):qo})),Ua(hr,pr.current),pr.current}}if(typeof Ln=="number")return Qn&&Qn.length>0?za(Ao,hr,ko,Qn,Ln):Qa(Ao,hr,ko,Qn,Ln),pr.current;const c0=Io(hr,ko,Qn),S0=(Vn=findResponseItem(c0,hr))==null?void 0:Vn.answer,It=getValidationError(Ao,c0,S0);return tt(Ri=>V0(b0({},Ri),{[hr]:typeof Ln=="number"?V0(b0({},Ri[hr]),{[Ln]:It}):It})),Ua(hr,c0),pr.current},cs=()=>{var Ao;for(let ko=Ce+1;ko<W0.current.length;ko++){const Qn=W0.current[ko],Ln=(Ao=bn?.item)==null?void 0:Ao[Qn];if(!!Ln&&(!Ln.enableWhen||isQuestionEnabled(Ln.enableWhen,Ln.enableBehavior,pr.current)))return!0}return!1},Ia=()=>{var Ao,ko,Qn,Ln,ar;const Vn=(Ao=Kn?.item)==null?void 0:Ao[W0.current[Ce]];if(Vn){const S0=(ko=getAnalyticsEventName(Vn))!=null?ko:"questionnaire_form",It=getAnalyticsPageName(Vn);if(It){const Ri=(Qn=getAnalyticsFormName(Kn))!=null?Qn:Kn.name,so=collectAnalyticsProperties(Vn,pr.current),qo={};Ri&&(qo.form_name=Ri),qo.page_name=It,Object.assign(qo,so),dn(S0,qo)}}const hr=Ce<W0.current.length-1,c0=checkCurrentStepDataMatch(pr.current,bn,W0.current,Ce,or,W0.current.length-1);if(Ii&&hr){const S0=Ce+1,It=W0.current[S0],Ri=(Ln=bn?.item)==null?void 0:Ln[It],so=!Ri?.enableWhen||isQuestionEnabled(Ri.enableWhen,Ri.enableBehavior,pr.current),qo=Ri?isPageExtensionPresent(Ri):!1;if(so&&qo&&c0){Sa(S0),ga(!1),window.scrollTo(0,0);return}}if(c0&&W0.current.length>0){cs()?Sa(Ce+1):(Ti(pr.current),ga(!1),window.scrollTo(0,0));return}if(Ce<W0.current.length-1){const S0=(ar=bn?.item)==null?void 0:ar[W0.current[Ce]];if(!S0){Ti(pr.current);return}const It=S0.linkId,Ri=findLastGroupInstanceIndex(pr.current,It),so=pr.current.slice(0,Ri+1);if(!validateCurrentPage(so,Zn,Ce,bn,W0))return;Ii?(pr.current=so,pa(so),Ti(pr.current),ga(!1)):W0.current.length>0&&(cs()?Sa(Ce+1):(Ti(pr.current),window.scrollTo(0,0)))}else Ti(pr.current),ga(!1),window.scrollTo(0,0)};useEffect(()=>{var Ao;_a(()=>Ia),Fa(()=>p1),ga(De);const ko=(Ao=bn?.item)==null?void 0:Ao[W0.current[Ce]];ko&&Ta(ko.linkId)},[De,Ce]),useEffect(()=>{if(!Kn?.item)return;const{groupIndices:Ao,itemsToRenderMap:ko}=collectGroupItemIndices(Kn.item);W0.current=Ao,w0.current=ko;const Qn=C0??Ao.length;Xr(Qn),yr(Ao),Ii?(Z0.current||Sa(Ao.length>0?Ao.length-1:0),Qr(!1),Z0.current=!1):Ce===-1&&Sa(0)},[Kn?.item,C0]),useEffect(()=>{if(Ce<0||!bn?.item)return;const Ao=validateCurrentPage(pr.current,Zn,Ce,bn,W0);if(!Ao){ga(!1);return}const{shouldTriggerInlineLoading:ko,canNavigateToNextGroup:Qn,hasMoreGroups:Ln}=co();if(Ii&&ko){if(!Ln){ga(!1);return}if(Qn&&Ao){ga(!0);return}else{ga(!1);return}}checkCurrentStepDataMatch(pr.current,bn,W0.current,Ce,or,W0.current.length-1)&&Ao&&ga(!0)},[Ce,bn?.item,pt,Ii,pr.current,Zn]),useEffect(()=>{if(!Kn?.item||l0.current)return;const Ao=initializeQuestionnaireItems(Kn.item,pr.current,Kn.item,pr.current);if(Ao!==pr.current){pr.current=Ao;const Qn=(ar=>{const Vn=new Set,hr=c0=>{c0.forEach(S0=>{var It;const Ri=S0.initial&&S0.initial.length>0,so=(S0.type==="choice"||S0.type==="open-choice")&&((It=S0.answerOption)==null?void 0:It.some(qo=>qo.initialSelected===!0));(Ri||so)&&(!S0.enableWhen||isQuestionEnabled(S0.enableWhen,S0.enableBehavior,pr.current))&&Vn.add(S0.linkId),S0.item&&hr(S0.item)})};return hr(ar),Vn})(bn?.item||[]);qn(Qn);const Ln=validateAllItemsRecursively(bn?.item||[],pr.current);Object.keys(Ln).length>0&&tt(ar=>b0(b0({},ar),Ln))}l0.current=!0},[bn?.item,Kn]),useEffect(()=>{nr(Kn)},[Kn]),useEffect(()=>{Ce>=0&&window.scrollTo(0,0)},[Ce]),useEffect(()=>{var Ao;if(!Ii||Zn.length===0||We||!bn?.item)return;const ko=W0.current[Ce];if(ko===void 0)return;const Qn=w0.current.get(ko)||[ko],Ln=[];if(Qn.forEach(S0=>{var It;const Ri=(It=bn?.item)==null?void 0:It[S0];Ri&&hasInitialValue(Ri)&&Ln.push(Ri)}),Ln.length===0||!Ln.some(S0=>$i(S0,pr.current)&&!Wi.current.includes(S0.linkId)?(Wi.current.push(S0.linkId),!0):!1))return;const Vn=validateCurrentPage(pr.current,Zn,Ce,bn,W0),hr=(Ao=bn?.item)==null?void 0:Ao[ko],c0=isHiddenAnswerInValid(hr,pr.current);!Vn||c0||(J0.current.add(Ce),Qr(!0),Z0.current=!0,ks(Ln[Ln.length-1].linkId))},[Ce,Zn,Ii,We,bn]);const ks=(Ao,ko=!1,Qn=!1)=>{var Ln;if(ko){Ti(pr.current,Qn),ga(!1);return}const ar=findQuestionByLinkId(bn?.item||[],Ao);if(!ar)return;const Vn=(Ln=findResponseItem(pr.current,Ao))==null?void 0:Ln.answer;if(getValidationError(ar,pr.current,Vn))return;const hr=getUpdatedFormData(bn?.item||[],pr.current,Ao,Vn),c0=$i(ar,hr);if(!c0)return;ga(!1);const S0=findRootGroupLinkId(bn?.item||[],Ao);let It=hr,Ri=[];const so=deepTrimFormData(hr,c0,bn?.item||[]);It=so.trimmedData,Ri=so.trimmedLinkIds;const qo=findQuestionByLinkId(bn?.item||[],S0||"");pr.current=It;const Uo=findGroupPositionByLinkId(bn?.item||[],Ao||""),wa=Uo!==-1?Uo:Ce;if(validateCurrentPage(It,Zn,wa,bn,W0,Ri)&&!isHiddenAnswerInValid(qo,It)){Qr(!0),Z0.current=!0;let rs;const Ns=(()=>{var fr;const Jr=ml=>ml.flatMap(uu=>[uu,...uu.item?Jr(uu.item):[]]),B1=Jr((fr=bn?.item)!=null?fr:[]),al=B1.findIndex(ml=>ml.linkId===c0),Ll=new Set;let _u=!0;for(;_u;){_u=!1;for(const ml of B1){if(Ll.has(ml.linkId)||!ml.enableWhen)continue;ml.enableWhen.some(ic=>{const Li=B1.findIndex(jn=>jn.linkId===ic.question);return Li!==-1&&Li<=al||Ll.has(ic.question)})&&(Ll.add(ml.linkId),_u=!0)}}return Ri.filter(ml=>!Ll.has(ml))})();Ns.length>0&&(rs=removeItemsFromSchema(bn?.item||[],Ns),nr(V0(b0({},bn),{item:rs})));const Wr=((fr,Jr)=>{const B1=[];let al=!1;const Ll=_u=>{for(const ml of _u)al?(B1.push(ml.linkId),ml.item&&Ll(ml.item)):ml.linkId===Jr?al=!0:ml.item&&Ll(ml.item)};return Ll(fr),B1})(bn?.item||[],c0);Wr.length>0&&(Wi.current=Wi.current.filter(fr=>!Wr.includes(fr)),qn(fr=>{const Jr=new Set(fr);return Wr.forEach(B1=>Jr.delete(B1)),Jr})),Wi.current.push(c0),Ti(It,!0,rs)}},a1=(Ao,ko,Qn=!1)=>{const Ln=updateItemWithReadOnlyExpression(Ao,bn),ar={item:Ln,selectedAnswer:ko,handleInputChange:La,showQuestionPrefix:G0,onCompleteHandler:ks,errors:Ji,isLoading:We,isCurrentFormValid:De,contained:bn?.contained,questionnaireSchemaItems:bn?.item,customErrorConfigurations:B0,formData:pr.current,showStepper:Yi,totalStepsFromExtension:C0,externalComponentRenderMap:vo,hintText:getHintTextFromExtensions(Ln.extension)};if(typeof po=="function"&&Qn)po(Ao,ar,pr.current);else if(Ao.type in typeToRenderFunctionMap&&!Qn)return Zn.includes(Ao.linkId)||Lr(Vn=>[...Vn,Ao.linkId]),jsx(RenderFHIRQuestionnaireItem,b0({},ar),Ao.linkId);return null},Xo=Ao=>Ao.map(ko=>{var Qn,Ln;const ar=isHiddenExtensionPresent(ko);let Vn=(Qn=findResponseItem(pr.current,ko.linkId))==null?void 0:Qn.answer;if((!Vn||Object.keys((Ln=Vn?.[0])!=null?Ln:{}).length===0)&&!zn.has(ko.linkId)){if(ko.initial&&ko.initial.length>0)Vn=ko.initial,qn(hr=>new Set(hr).add(ko.linkId));else if((ko.type==="choice"||ko.type==="open-choice")&&ko.answerOption){const hr=ko.answerOption.filter(c0=>c0.initialSelected===!0);hr.length>0&&(Vn=hr.map(c0=>{let S0={};return c0.valueCoding?S0={valueCoding:{code:c0.valueCoding.code,display:c0.valueCoding.display,system:c0.valueCoding.system}}:c0.valueReference&&(S0={valueReference:{reference:c0.valueReference.reference,display:c0.valueReference.display}}),S0}).filter(c0=>Object.keys(c0).length>0),qn(c0=>new Set(c0).add(ko.linkId)))}Vn&&(pr.current=getUpdatedFormData(bn?.item||[],pr.current,ko.linkId,Vn))}if(!ko?.enableWhen||isQuestionEnabled(ko?.enableWhen,ko.enableBehavior,pr.current)){const hr=X0.includes(ko.linkId)||getUIToolkitCode(ko.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[a1(ko,Vn,ar),ko.item&&!ar&&(hr?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:Xo(ko.item)})}):Xo(ko.item))]},ko.linkId)}else if(ko.type==="group"&&!ar)return Br.includes(ko.linkId)||(C0===void 0&&Xr(W0.current.length-1||-1),W0.current=W0.current.filter((hr,c0)=>c0!==Ce),u0(hr=>[...hr,ko.linkId])),null});if(Ce>=0){const Ao=[];let ko=0,Qn=0;for(;ko<cn.length&&Qn<W0.current.length;){const Ln=cn[ko],ar=W0.current[Qn];if(Ln<ar){const Vn=(da=bn?.item)==null?void 0:da[Ln];(!Vn?.enableWhen||isQuestionEnabled(Vn.enableWhen,Vn.enableBehavior,pr.current))&&Ao.push(ko),ko++}else Ln===ar&&ko++,Qn++}for(;ko<cn.length;){const Ln=cn[ko],ar=(Ba=bn?.item)==null?void 0:Ba[Ln];(!ar?.enableWhen||isQuestionEnabled(ar.enableWhen,ar.enableBehavior,pr.current))&&Ao.push(ko),ko++}if(Ao.length>0){C0===void 0&&Xr(W0.current.length+Ao.length),Ao.reverse().forEach(ar=>{const Vn=cn[ar];let hr=0;for(let c0=0;c0<W0.current.length;c0++){if(W0.current[c0]>Vn){hr=c0;break}hr=c0+1}W0.current.splice(hr,0,Vn)});const Ln=Ao.map(ar=>{var Vn;const hr=cn[ar],c0=(Vn=bn?.item)==null?void 0:Vn[hr];return c0?.linkId}).filter(Boolean);u0(ar=>ar.filter(Vn=>!Ln.includes(Vn)))}cn.forEach(Ln=>{var ar;const Vn=(ar=bn?.item)==null?void 0:ar[Ln];Vn?.enableWhen&&!isQuestionEnabled(Vn.enableWhen,Vn.enableBehavior,pr.current)&&pr.current.some(c0=>c0.linkId===Vn.linkId)&&(pr.current=removeAnswerFromFormData(pr.current,Vn.linkId))})}const p1=()=>{var Ao;if(L0&&!Tt&&Ce>0&&ji!=="completed")Sa(W0.current.length-1),mn(!0),zr(!1),ki?.();else if(Ce>0&&ji!=="completed"){let ko=Ce-1;for(;ko>0;){const Qn=W0.current[ko],Ln=(Ao=bn?.item)==null?void 0:Ao[Qn];if(!Ln?.enableWhen||isQuestionEnabled(Ln.enableWhen,Ln.enableBehavior,pr.current))break;ko--}Sa(ko),ga(!0),zr(!1),ki?.()}else Yo?.()},Zs=Ao=>Ao.preventDefault();return useEffect(()=>{const Ao=setTimeout(()=>{Pi(!0)},0);return()=>clearTimeout(Ao)},[]),wi?jsxs(Fragment,{children:[jsxs("form",{id:En,className:"w-full","data-testid":"questionnaire-form",onSubmit:Zs,children:[!di&&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:()=>p1(),onKeyDown:Ao=>{(Ao.key==="Enter"||Ao.key===" ")&&p1()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),L0&&!Tt?jsx(EmptyState,{className:"mt-5xl",title:L0.title,description:L0.description,featuredIconProps:{icon:L0.icon,color:"gray"},primaryButton:L0.primaryButton,secondaryButton:L0.secondaryButton?V0(b0({},L0.secondaryButton),{onClick:p1}):void 0}):jsxs(Fragment,{children:[!bn?.item&&We&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),bn?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:Xo(Ce>=0?bn.item.filter((Ao,ko)=>{const Qn=W0.current[Ce];return(w0.current.get(Qn)||[Qn]).includes(ko)}):bn?.item||[])})]})]}),l0.current&&ra]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,l,e)=>{"use strict";e.d(l,{l:()=>b});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,v)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:v}):h[f]=v,d=(h,f)=>{for(var v in f||(f={}))y.call(f,v)&&m(h,v,f[v]);if(u)for(var v of u(f))A.call(f,v)&&m(h,v,f[v]);return h},O=(h,f)=>g(h,c(f));const p=({selected:h,onClick:f,icon:v,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:v}),(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})},b=({item:h,handleInputChange:f,formData:v,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,v??[])),[T,v]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,i.GN)(N.enableWhen,N.enableBehavior,v??[])),[T,v]),R=N=>{var w,$;if(!v)return!1;const q=(0,i.MU)(v,N);return(($=(w=q?.answer)==null?void 0:w[0])==null?void 0:$.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,v]),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,$;const q=v?(0,i.MU)(v,N.linkId):void 0;(!q||(($=(w=q.answer)==null?void 0:w[0])==null?void 0:$.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,$,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(ie=>ie.url===s.g4),F=($=N.extension)==null?void 0:$.find(ie=>ie.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(p,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(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 p,b;if(!c)return!1;const h=(0,s.MU)(c,O);return((b=(p=h?.answer)==null?void 0:p[0])==null?void 0:b.valueBoolean)===!0},d=O=>{const p=m(O.linkId);g(O,[{valueBoolean:!p}])};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 p;const b=m(O.linkId);return(0,n.jsx)(i,{label:(p=O.text)!=null?p:"",selected:b,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=(b,h,f)=>h in b?i(b,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):b[h]=f,A=(b,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(b,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(b,f,h[f]);return b},m=(b,h)=>o(b,a(h));const d=(0,t.createContext)(void 0),O=()=>{const b=(0,t.useContext)(d);if(!b)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return b},p=({children:b,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[v,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),[$,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),ie=useRef([]),le=()=>{k(ne=>ne+1)},ae=useCallback(ne=>{F(ne)},[]),me=()=>{k(ne=>Math.max(0,ne-1))},ye=I>0,Te=useCallback((ne,se,he)=>{if(!h)return;const pe=h[ne];if(!pe)return;let fe;if(Array.isArray(pe))if(he)fe=pe.find(Se=>Se.inputType===he);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(he&&pe.inputType&&pe.inputType!==he)return;fe=pe}if(!fe)return;let ue=A({},se);fe.valueTransform&&(ue=Object.keys(se).reduce((Se,Le)=>{var Ee;const Ie=(Ee=fe.valueTransform)==null?void 0:Ee[Le];return Se[Le]=Ie?applyValueTransform(se[Le],Ie):se[Le],Se},{}));let te=A({},ue);fe.propertyMapping&&(te=Object.keys(ue).reduce((Se,Le)=>{var Ee;const Ie=((Ee=fe.propertyMapping)==null?void 0:Ee[Le])||Le;return Se[Ie]=ue[Le],Se},{}));const J=fe.eventName,ge=fe.description;f(J,m(A(A({},te),fe.properties),{_event_metadata:ge?{description:ge}:void 0}))},[h,f]),ve={isCurrentFormValid:T,currentGroupLinkId:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:$,isInlineNextQuestionTriggered:K,hasCustomError:ye,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:v,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:le,decrementCustomErrorCount:me,trackQuestionnaireEvent:Te,setHasExternalError:ae,groupItemIndicesRef:ie};return jsx(d.Provider,{value:ve,children:b})}},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,p)=>{d.preventDefault(),O.linkType==="phone"?g(p):O.linkType==="address"?c({address:p}):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:p=>y(p,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 p=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(p,{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 b=Array.isArray(d.value)?d.value:[d.value];return b.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:b.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(b[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,p=Object.prototype.propertyIsEnumerable,b=(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)&&b(x,T,z[T]);if(d)for(var T of d(z))p.call(z,T)&&b(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),v=(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)(),[$,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:$;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(ye=>{w(f(h({},N),{location:ye,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>v(void 0,null,function*(){x&&x(!0);let ye;try{ye=yield L(),ye&&U&&U(`${ye.coords.latitude},${ye.coords.longitude}`)}catch(Te){Te instanceof Error?K?.error(Te,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Te)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!ye}),[K,U,L,x,S,E]),ie=(0,t.useCallback)(()=>v(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),le=(0,t.useCallback)(ye=>{D("location_permissions_cta_clicked",{click:ye==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,w,N,I,S,E]),ae=(0,t.useCallback)(()=>le("close"),[le]),me=(0,t.useCallback)(()=>le("cancel"),[le]);return(0,n.jsx)(o.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:ae},primaryButton:{children:"Use my current location",onClick:ie},secondaryButton:{children:"Search another way",onClick:me}})}},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),p=useRef(null);return useEffect(()=>{if(!!O.current){try{const b=c(y);p.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:b})}catch(b){console.error("Failed to load Lottie animation:",b)}return()=>{var b;(b=p.current)==null||b.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:p="100%",googleMapsApiKey:b})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:b||""}),v={height:typeof O=="number"?`${O}px`:O,width:typeof p=="number"?`${p}px`:p},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:v,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:v,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:v,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:Dt="currentColor",...pn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Ye,height:Ye,stroke:Dt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...pn},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 p(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Ye=>{h=Ye},v=(Ye,Dt)=>Ye===Dt;function M(Ye=d){const Dt=Ye===d?p:()=>(0,r.useContext)(Ye);return function(Sn,et=v){const{store:Rt,subscription:Ht,getServerState:kn}=Dt(),Sr=h(Ht.addNestedSub,Rt.getState,kn||Rt.getState,Sn,et);return(0,r.useDebugValue)(Sr),Sr}}const x=M();var z=e(75985),T=e(524);function S(){const Ye=getBatch();let Dt=null,pn=null;return{clear(){Dt=null,pn=null},notify(){Ye(()=>{let Sn=Dt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Dt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=pn={callback:Sn,next:null,prev:pn};return Rt.prev?Rt.prev.next=Rt:Dt=Rt,function(){!et||Dt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:pn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Dt=Rt.next)}}}}const E={notify(){},get:()=>[]};function C(Ye,Dt){let pn,Sn=E;function et(mr){return Sr(),Sn.subscribe(mr)}function Rt(){Sn.notify()}function Ht(){In.onStateChange&&In.onStateChange()}function kn(){return Boolean(pn)}function Sr(){pn||(pn=Dt?Dt.addNestedSub(Ht):Ye.subscribe(Ht),Sn=S())}function hn(){pn&&(pn(),pn=void 0,Sn.clear(),Sn=E)}const In={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:Ht,isSubscribed:kn,trySubscribe:Sr,tryUnsubscribe:hn,getListeners:()=>Sn};return In}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Ye=>{D=Ye},w=null,$=null,q=Ye=>{try{return JSON.stringify(Ye)}catch{return String(Ye)}};function I(Ye,Dt,pn){useIsomorphicLayoutEffect(()=>Ye(...Dt),pn)}function k(Ye,Dt,pn,Sn,et,Rt){Ye.current=Sn,pn.current=!1,et.current&&(et.current=null,Rt())}function U(Ye,Dt,pn,Sn,et,Rt,Ht,kn,Sr,hn,In){if(!Ye)return()=>{};let mr=!1,Dn=null;const $r=()=>{if(mr||!kn.current)return;const Wt=Dt.getState();let _e,lt;try{_e=Sn(Wt,et.current)}catch(Je){lt=Je,Dn=Je}lt||(Dn=null),_e===Rt.current?Ht.current||hn():(Rt.current=_e,Sr.current=_e,Ht.current=!0,In())};return pn.onStateChange=$r,pn.trySubscribe(),$r(),()=>{if(mr=!0,pn.tryUnsubscribe(),pn.onStateChange=null,Dn)throw Dn}}const F=()=>w;function K(Ye,Dt){return Ye===Dt}let G=!1;function ie(Ye,Dt,pn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:Ht=shallowEqual,areMergedPropsEqual:kn=shallowEqual,forwardRef:Sr=!1,context:hn=ReactReduxContext}={}){const In=hn,mr=mapStateToPropsFactory(Ye),Dn=mapDispatchToPropsFactory(Dt),$r=mergePropsFactory(pn),kr=Boolean(Ye);return _e=>{const lt=_e.displayName||_e.name||"Component",Je=`Connect(${lt})`,nt={shouldHandleStateChanges:kr,displayName:Je,wrappedComponentName:lt,WrappedComponent:_e,initMapStateToProps:mr,initMapDispatchToProps:Dn,initMergeProps:$r,areStatesEqual:et,areStatePropsEqual:Ht,areOwnPropsEqual:Rt,areMergedPropsEqual:kn};function ot(st){const[oe,Me,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Tn}=st,xn=_objectWithoutPropertiesLoose(st,P);return[st.context,Tn,xn]},[st]),ze=useMemo(()=>oe&&oe.Consumer&&isContextConsumer(React.createElement(oe.Consumer,null))?oe:In,[oe,In]),zt=useContext(ze),Xt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(zt)&&Boolean(zt.store),_n=Xt?st.store:zt.store,Or=vn?zt.getServerState:_n.getState,Ft=useMemo(()=>defaultSelectorFactory(_n.dispatch,nt),[_n]),[we,Ze]=useMemo(()=>{if(!kr)return $;const Tn=createSubscription(_n,Xt?void 0:zt.subscription),xn=Tn.notifyNestedSubs.bind(Tn);return[Tn,xn]},[_n,Xt,zt]),At=useMemo(()=>Xt?zt:_extends({},zt,{subscription:we}),[Xt,zt,we]),Jt=useRef(),rn=useRef(Ue),it=useRef(),Pt=useRef(!1),Zt=useRef(!1),en=useRef(!1),qt=useRef();useIsomorphicLayoutEffect(()=>(en.current=!0,()=>{en.current=!1}),[]);const Lt=useMemo(()=>()=>it.current&&Ue===rn.current?it.current:Ft(_n.getState(),Ue),[_n,Ue]),ln=useMemo(()=>xn=>we?U(kr,_n,we,Ft,rn,Jt,Pt,en,it,Ze,xn):()=>{},[we]);I(k,[rn,Jt,Pt,Ue,it,Ze]);let Un;try{Un=D(ln,Lt,Or?()=>Ft(Or(),Ue):Lt)}catch(Tn){throw qt.current&&(Tn.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.1087.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1087.1",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.12.3"},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.1334.1",D="@icanbwell/composite. repo version: 0.1334.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.1087.
|
|
3
|
+
"version": "1.1087.1",
|
|
4
4
|
"author": "icanbwell",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -43,6 +43,6 @@
|
|
|
43
43
|
"optional": true
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
"repoVersion": "0.1334.
|
|
47
|
-
"description": "@icanbwell/composite. repo version: 0.1334.
|
|
46
|
+
"repoVersion": "0.1334.1",
|
|
47
|
+
"description": "@icanbwell/composite. repo version: 0.1334.1"
|
|
48
48
|
}
|