@icanbwell/composite 1.1132.1 → 1.1132.2
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 +1 -1
package/index.js
CHANGED
|
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
|
|
|
866
866
|
<div class="wrapper">
|
|
867
867
|
<bwell-error-component />
|
|
868
868
|
</div>
|
|
869
|
-
`}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln,fr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Wn=`bwell-${Kt}`;if(customElements.get(Wn)!==void 0)return;class Fr extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Bn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Bn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Or).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Bn=new WeakMap,We=new WeakSet,Or=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Wn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Wn,utils:(0,p.__classPrivateFieldGet)(this,Bn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},fr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Wn,Fr)}),at={rE:"1.1132.1"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,A=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,m=(p,h)=>{for(var f in h||(h={}))u.call(h,f)&&A(p,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&A(p,f,h[f]);return p},d=(p,h)=>a(p,g(h));const O=(p,h,f)=>{const b=_.cloneDeep(p);if(!b.contained||h<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const E=x.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:p,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var N,w,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(h);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var C=L=>{try{R(z.next(L))}catch(P){S(P)}},E=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(C,E);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Ye;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Ye=Ot.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const fr=be.find(tt=>tt.id===Kt),Wn=fr?.label||V;if(!fr)return;q(Wn),k(Wn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Fr=yield ae({variables:{placeId:Kt}}),Jr=(Xe=(Ct=Fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=Fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=Fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Jr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Jr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Or=(Bn=tt?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Or.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Jr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Wn,value:Kt})}else T({latitude:Jr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Wn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const fr=yield ae({variables:{placeId:N}}),Wn=(Xe=(Ct=fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Fr=(Ot=(We=fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Jr=((Qe=(Ye=fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Wn&&Fr)if(!Jr||!It||!$e){const ot=yield ce({variables:{latitude:String(Wn),longitude:String(Fr)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Or=(Bn=ot?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Or.state)||"",rt=((Ln=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Wn,longitude:Fr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Wn,longitude:Fr,zipCode:Jr,state:It,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||ue||D)},[E,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",Ot=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=Ot.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Ye?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(E,R,L)=>R in E?m(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,b=(E,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(E,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(E,L,R[L]);return E},M=(E,R)=>d(E,O(R)),x=(E,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(E,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>It,GI:()=>K,rz:()=>Ot,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>C,gD:()=>T,Vp:()=>Fr,Cx:()=>D,bK:()=>L,gi:()=>Jr,Z$:()=>be,GT:()=>Wn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>Sn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>E,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Ln,vf:()=>Bn,PV:()=>fr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>ce,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));p.displayName="CreditCard02";const h=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const b=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",C="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",ce="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ot="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Sn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Or="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",fr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Wn="http://hl7.org/fhir/StructureDefinition/mimeType",Fr="http://hl7.org/fhir/StructureDefinition/maxSize",Jr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,$t;return($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?$t:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},C={date:"MM/DD/YYYY",choice:"Select an option"},E="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&C[Qt]||E},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,$t,Yt)=>Yt.indexOf(Lt)===$t).join(", "),N=(mt,Qt,qt)=>{const Lt=D(mt),$t=Lt.lastIndexOf(","),Yt=$t!==-1?`${Lt.substring(0,$t)} or${Lt.substring($t+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,$t;const Yt=Qt?.find(On=>On.url.includes(mt));return($t=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?$t:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const $t=Qt?.find(On=>On.url===mt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||q((Lt=$t.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Qt);if($t!==void 0)return $t}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Lt=(0,t.A)($t)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const $t=F(Lt.item,Qt);if($t!==void 0)return $t}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const $t of mt)if($t.linkId===Qt&&Lt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,$t;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date(($t=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?$t:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe($t,void 0):Yt.some(On=>{var zr;return(zr=On.answer)==null?void 0:zr.some(jr=>oe($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some($t=>Lt($t)):mt?.every($t=>Lt($t)):!0},pe=(mt,Qt,qt,Lt,$t)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var zr;let jr;if(Lt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Lt)[$t];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!jr){const Rn=K(qt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});jr=void 0}return oe(On,jr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some($t=>Boolean($t)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Lt,Qt);return b(f({},mt),{readOnly:$t??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:$t,type:Yt,extension:On,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=mt;if(!te(zr,jr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,qt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,$t,qt,Pn)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(jr)return`Item ${Yt+1}: ${jr}`;if(mt.item&&mt.item.length>0){const Rn=ae(mt.item,Qt,mt.linkId,Yt);if(Rn)return`Item ${Yt+1}: ${Rn}`}}else return`Item ${Yt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Yt=qt[$t];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(mt.item&&mt.item.length>0){const jr=ae(mt.item,Qt,mt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var $t,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const zr=F(Qt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===On.linkId),Rn=(Yt=jr?.answer)!=null&&Yt[Lt]?[jr.answer[Lt]]:void 0;if(On.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${On.text||On.linkId} is required`;const Pn=he(On.extension,On.type,!0,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=he(On.extension,On.type,!1,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}if(On.item&&On.item.length>0){const Pn=ae(On.item,Qt,On.linkId,Lt);if(Pn)return Pn}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,$t,Yt)=>{var On,zr,jr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Kn,Br;return En.url===y.gD&&((Br=(Kn=En.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:Br.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=$t?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(jr=St?.valueQuantity)==null?void 0:jr.value,reference:(Rn=St?.valueReference)==null?void 0:Rn.display,attachment:(Pn=St?.valueAttachment)==null?void 0:Pn.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Kn=V("regexError",mt),Br=Kn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(Br):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Kn=new RegExp(En),Br=V("regexError",mt),$r=Br??"Please enter a valid input";return Kn&&un&&!Kn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Kn=new Date(En);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const Br=I(y.dU,mt),$r=U(Br??"01/01/1900","01/01/1900"),Zr=U(un,"");if(!$r||!Zr)return"";if((0,s.A)(Zr,$r)){const f0=(En=mt?.find(Io=>Io.url===y.Ck))==null?void 0:En.valueString;return f0??`Date should not be before ${Br??"01/01/1900"}`}return""}const Kn=V("minValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var En;if(Qt==="date"){const Br=I(y.bK,mt),$r=U(Br??"01/01/2100","01/01/2100"),Zr=U(un,"");if(!$r||!Zr)return"";if((0,o.A)(Zr,$r)){const f0=(En=mt?.find(Io=>Io.url===y.Cx))==null?void 0:En.valueString;return f0??`Date should not be after ${Br??"01/01/2100"}`}return""}const Kn=V("maxValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un>Kn?`Input should not exceed ${Kn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const $t=ce(mt,qt.item);if($t)return $t}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var $t,Yt;const{required:On}=mt,zr=($t=Lt.item)==null?void 0:$t.find(Pn=>Pn.linkId===mt.linkId),jr=zr?.answer||[],Rn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(On){if(!rn||!me(rn))return`Item ${Pn+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===y.gD&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,$t,Yt)=>{const On=jr=>Qt.filter(Rn=>Rn.linkId===jr),zr=new Set;return mt.map(jr=>{if(zr.has(jr.linkId)||ve(jr))return null;const Pn=On(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const En=St?.item||[];on=[...En],$t.forEach(Kn=>{const Br=on.findIndex($r=>$r.linkId===Kn.linkId);Br>=0?on[Br]=b(f({},En[Br]),{answer:Kn.answer}):on.push(Kn)})}else jr.item&&(on=xt(jr.item,St?.item||[],qt,Lt,$t,Zt));qt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===jr.linkId&&typeof Yt=="number"&&Yt>=Pn.length)for(let St=Pn.length;St<=Yt;St++){const Zt={linkId:jr.linkId,text:jr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:jr.item&&(Zt.item=xt(jr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(jr.repeats&&typeof Yt=="number"&&qt===jr.linkId){const bt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},St={linkId:jr.linkId,text:jr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Pn[0],St=jr.item?xt(jr.item,bt?.item||[],qt,Lt,$t,Yt):void 0,Zt=St&&St.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!$t?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),$t?un.item=$t:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var $t;const Yt=($t=mt?.item)!=null?$t:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var zr;const jr=K(Qt,On.linkId);if(jr.length===0){const Rn=(zr=F(Qt,On.linkId))==null?void 0:zr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Rn of jr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter($t=>$t.linkId===Qt);if(Lt.length>qt){const $t=Lt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var $t;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},Ot=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const $t=Object.keys(Lt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,$t,Yt)=>{var On;const zr=(On=Qt?.item)==null?void 0:On[qt[Lt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(mt,jr),Pn=K($t,jr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Rn.length!==Pn.length)return!1;for(let bt=0;bt<Rn.length;bt++){const St=Rn[bt],Zt=Pn[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=$t=>{$t.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let zr=0;zr<On.length;zr++){const jr=On[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Pt(Yt,Qt,jr.answer);Rn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Rn}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Pt(Yt,Qt,zr.answer);jr&&(qt[Yt.linkId]={0:jr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,$t]=Qt;return`${qt.slice(-4)}-${Lt}-${$t}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,$t)=>{for(const Yt of Lt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,$t);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const zr of $t){const jr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Lt(zr.item,Yt,jr))return zr}}return null};return Lt(Qt,qt)},Bn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const zr of $t){const jr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(zr.item,Yt,jr))return!0}}return!1};return Lt(Qt,qt)},Or=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:$t}=Qt;if(mt[$t]){const Yt=mt[$t];Lt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let $t=null;if(mt.forEach((Yt,On)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),$t=On;else if($t!==null&&!zr){const jr=Lt.get($t)||[];Lt.set($t,[...jr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(jr=>jr>Yt),zr=[];for(let jr=Yt;jr<(On??mt.length);jr++)zr.push(jr);Lt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},fr=(mt,Qt,qt,Lt)=>{let $t=[...Lt];const Yt=(On,zr)=>{On.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!Ct(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(zr,jr.linkId,rn)||($t=xt(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=xt(qt,$t,jr.linkId,jr.initial)}else $t=xt(qt,$t,jr.linkId,jr.initial);jr.item&&Yt(jr.item,zr)})};return Yt(mt,Qt),$t},Wn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return mt.forEach($t),Lt},Fr=(mt,Qt)=>mt.every(qt=>{var Lt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Jr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Lt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Lt.push($t)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],$t=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&$t(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const zr=mt.slice(0,Yt+1),jr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const zr=ot(On.item,Qt,qt);if(zr.found){const jr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...jr,b(f({},On),{item:zr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some($t=>mt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Ln(mt),Lt=mt.findIndex($t=>$t.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const $t=Lt.valueString.replace(/\\n/g,`
|
|
869
|
+
`}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src:Xt,elementNameSuffix:Kt,version:Ct,prefetchFeatureApp:Xe})=>(0,p.__awaiter)(void 0,void 0,void 0,function*(){var We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln,fr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Wn=`bwell-${Kt}`;if(customElements.get(Wn)!==void 0)return;class Fr extends f{constructor(){super(),We.add(this),Ot.set(this,(0,S.nanoid)()),Ye.set(this,void 0),Qe.set(this,document.createElement("feature-app-loader")),Pt.set(this,new I.EventEmitter),hn.set(this,void 0),Sn.set(this,void 0),et.set(this,void 0),Rt.set(this,void 0),kt.set(this,void 0),Bn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:ot,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(ot),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,Bn,{slots:It,attributes:new q().bindTo(this),loaderEventEmitter:(0,p.__classPrivateFieldGet)(this,Pt,"f")},"f"),(0,p.__classPrivateFieldSet)(this,hn,(0,p.__classPrivateFieldGet)(this,We,"m",Or).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,Sn,(0,p.__classPrivateFieldGet)(this,We,"m",mn).bind(this),"f"),(0,p.__classPrivateFieldSet)(this,et,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",fr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,kt=new WeakMap,Bn=new WeakMap,We=new WeakSet,Or=function(){(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("featureAppId",`bwell-embeddable:${Wn}`),(0,p.__classPrivateFieldGet)(this,Qe,"f").setAttribute("src",Xt),(0,p.__classPrivateFieldGet)(this,Qe,"f").config={id:(0,p.__classPrivateFieldGet)(this,Ot,"f"),name:Kt,elementName:Wn,utils:(0,p.__classPrivateFieldGet)(this,Bn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,kt,"f")(),(0,p.__classPrivateFieldSet)(this,kt,void 0,"f")},fr=function(It){return $e=>{const ot=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,ot).some(tt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,kt,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,kt,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,Bn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,kt,(0,p.__classPrivateFieldGet)(this,Bn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Wn,Fr)}),at={rE:"1.1132.2"},pt="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${pt}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:pt,version:at.rE,prefetchFeatureApp:!0})},79566:(Y,l,e)=>{"use strict";var n=e(31085),t=e(94043),r=e(45250),s=e(35473),o=e(25624),i=Object.defineProperty,a=Object.defineProperties,g=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,A=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,m=(p,h)=>{for(var f in h||(h={}))u.call(h,f)&&A(p,f,h[f]);if(c)for(var f of c(h))y.call(h,f)&&A(p,f,h[f]);return p},d=(p,h)=>a(p,g(h));const O=(p,h,f)=>{const b=_.cloneDeep(p);if(!b.contained||h<0)return b;const M=b.contained.findIndex(x=>x.resourceType==="Questionnaire");if(M!==-1&&!f){const x=b.contained[M];if(x.item){if(!x.item.some(C=>isPageExtensionPresent(C)))return b;let T=0,S=x.item.length;for(let C=0;C<x.item.length;C++){const E=x.item[C];if(isPageExtensionPresent(E)){if(T===h+1){S=C;break}T++}}x.item=x.item.slice(0,S),b.contained[M]=x}}else f&&M!==-1&&(b.contained[M]=d(m({},b.contained[M]),{item:f}));return b},v=({formId:p,questionnaireResponse:h,showQuestionPrefix:f,nextQuestion:b,onGoBack:M,handleHiddenQuestion:x,errorConfig:z,onClearError:T,customErrorConfigurations:S,showStepper:C,hideBackButton:E,onFormDataChange:R,externalComponentRenderMap:L,className:P,children:D})=>{var N,w,V;const{currentGroupIndex:q,hasCustomError:I}=useFHIRQuestionnaire(),k=(N=h.questionnaire)==null?void 0:N.replace("#",""),U=(w=h?.contained)==null?void 0:w.find(K=>K.id===k&&K.resourceType==="Questionnaire"),F=(K,G,se)=>{let oe=_.cloneDeep(h);oe.item=K,oe=trimQuestionnaireItems(oe,q,se),b(oe,G)};return jsx("div",{className:cx(`${I?"mb-3":"mb-8"} flex w-full flex-col gap-8`,P),children:jsx(FHIRQuestionnaire,{formId:p,onFormDataChange:R,questionnaireResponseItem:(V=h?.item)!=null?V:[],questionnaireSchema:U,status:h.status,showQuestionPrefix:f,errorConfig:z,customErrorConfigurations:S,isAdaptiveFlow:!0,onComplete:F,onGoBack:M,onClearError:T,handleHiddenQuestion:x,showStepper:C,hideBackButton:E,externalComponentRenderMap:L,children:D})})}},19622:(Y,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),o=e(36087),i=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var C=L=>{try{R(z.next(L))}catch(P){S(P)}},E=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(C,E);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:C="",setIsLoading:E,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,oe]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,i.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,i.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,i.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(pe)},onCompleted:Kt=>{var Ct,Xe;const We=(Xe=(Ct=Kt.placeAutocomplete)==null?void 0:Ct.predictions)==null?void 0:Xe.map(Ot=>{var Ye;return{id:Ot.placeId,label:(0,s.removeAfterLastComma)(Ot.description),mainText:Ot?.mainText||((Ye=Ot.description.split(",")[0])==null?void 0:Ye.trim()),secondaryText:(0,s.removeAfterLastComma)(Ot?.secondaryText||Ot.description.split(",").slice(1).join(",").trim())}});Se(We?.length?We:pe)}}),De=(0,t.useMemo)(()=>be.map(Kt=>p(v({},Kt),{displayLabel:(0,r.RZ)(Kt?.label||"",V)})),[V,be]),ze=Kt=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln;if(F(Kt),G(Kt),oe(!1),Kt&&typeof Kt=="string"){const fr=be.find(tt=>tt.id===Kt),Wn=fr?.label||V;if(!fr)return;q(Wn),k(Wn),setTimeout(()=>{const tt=[{id:fr.id,label:fr.label}];Se(tt),ne(tt)},f);const Fr=yield ae({variables:{placeId:Kt}}),Jr=(Xe=(Ct=Fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=Fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",ot=((hn=(Pt=Fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Jr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Jr),longitude:String(It)}}),rt=((kt=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",lt=((Or=(Bn=tt?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Or.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Jr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Wn,value:Kt})}else T({latitude:Jr,longitude:It,zipCode:$e,state:ot,stateCode:Je,placeId:Kt,description:Wn,value:Kt});else oe(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(oe(!1),q(Kt),z?.(Kt),!Kt||Kt.trim().length===0){F(null),Se(pe),T({latitude:0,longitude:0,zipCode:"",state:"",stateCode:"",placeId:"",description:"",value:Kt});return}const Ct=Kt.trim();Ct.length>=2?yield xe(Ct):Se(pe)}),at=Kt=>{te.current=Kt},pt=()=>{q(I),Se(ge),F(K)};(0,t.useEffect)(()=>{(()=>h(void 0,null,function*(){var Ct,Xe,We,Ot,Ye,Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln;if(N&&w){Se([{id:N,label:V||w}]),ne([{id:N,label:V||w}]),F(N),G(N),q(w),k(w),w===V&&q(w);const fr=yield ae({variables:{placeId:N}}),Wn=(Xe=(Ct=fr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Fr=(Ot=(We=fr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Jr=((Qe=(Ye=fr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=fr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=fr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Wn&&Fr)if(!Jr||!It||!$e){const ot=yield ce({variables:{latitude:String(Wn),longitude:String(Fr)}}),Je=((kt=(Rt=ot?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:kt.zipCode)||"",tt=((Or=(Bn=ot?.data)==null?void 0:Bn.geocodingByLatLon)==null?void 0:Or.state)||"",rt=((Ln=(mn=ot?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Wn,longitude:Fr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Wn,longitude:Fr,zipCode:Jr,state:It,stateCode:$e,placeId:N,description:w,value:N})}else F(null),G(null),q(""),k(""),Se(pe),ne(pe)}))()},[]);const xt=se||!!he||!!re||!!Ee||!!R,Xt=xt?R||P("ADDRESS_TYPEAHEAD_ERROR"):"";return(0,t.useEffect)(()=>{E&&E(me||ue||D)},[E,me,ue,D]),(0,n.jsx)("div",{className:C,children:(0,n.jsx)(o.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:pt,isInvalid:xt,hint:Xt,autoComplete:"address-line1",className:"w-full",children:Kt=>{const Ct=Kt,Xe=V.trim().length>=2,We=Ct.mainText||"",Ot=Ct.secondaryText||"",Ye=We.trim().length>0,Qe=Ot.trim().length>0,Pt=Ye?(0,r.RZ)(We,V):{beforePart:"",highlightedPart:"",remainingPart:""},hn=Qe?(0,r.RZ)(Ot,V):{beforePart:"",highlightedPart:"",remainingPart:""};return(0,n.jsx)(o.Select.Item,{id:Ct.id,supportingText:Ct.supportingText,isDisabled:Ct.isDisabled,icon:Ct.icon,avatarUrl:Ct.avatarUrl,textValue:Ct.label,children:Xe&&Ye?(0,n.jsxs)("div",{className:"flex min-w-0 flex-col",children:[(0,n.jsxs)("div",{className:"truncate text-sm font-medium",children:[(0,n.jsx)("span",{children:Pt.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:Pt.highlightedPart}),(0,n.jsx)("span",{children:Pt.remainingPart})]}),Qe&&(0,n.jsxs)("div",{className:"truncate text-xs text-gray-600",children:[(0,n.jsx)("span",{children:hn.beforePart}),(0,n.jsx)("span",{className:"text-brand-primary font-semibold",children:hn.highlightedPart}),(0,n.jsx)("span",{children:hn.remainingPart})]})]}):(0,n.jsx)("div",{className:"truncate",children:Ct.label})})}})})}},18077:()=>{},12200:(Y,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:o,title:i})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[o??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[i,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),o=e(52449);const i=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Y,l,e)=>{"use strict";e.d(l,{rJ:()=>C,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),o=e(76808),i=e(5380),a=e(87896),g=e(26877);const c=(E,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),E)),u=(E,R,L)=>Promise.race([E,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(E,R,L)=>R in E?m(E,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):E[R]=L,b=(E,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(E,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(E,L,R[L]);return E},M=(E,R)=>d(E,O(R)),x=(E,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(E,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),C=({children:E})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,o.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,oe]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||i.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==i.Ef.GRANTED&&Ee!==i.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}if(Ee===i.Ef.GRANTED){try{const Ie=yield Se();if(Ie===i.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(i.Ef.GRANTED))}else Ie===i.Ef.PROMPT?(te(Ie),oe(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===i.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(i.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(i.Ef.UNAVAILABLE)}else ze===i.Ef.PROMPT&&oe(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(i.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===i.Ef.GRANTED||Ee===i.Ef.PROMPT){if(L==="Android"&&Ee===i.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==i.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(i.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():i.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),i.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===i.Ef.DENIED||Ee===i.Ef.BLOCKED||Ee===i.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(i.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(i.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(i.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:i.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(i.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:i.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||i.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition:ce,requestCurrentLocation:ue,checkAndSetLocationPermission:he,checkLocaitonPermission:me}),[I,re,U,K,ae,ce,ue,he,me]);return(0,n.jsxs)(T.Provider,{value:J,children:[se&&(0,n.jsx)(g.J,{isOpen:se,onClose:()=>oe(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),E]})}},82825:(Y,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Y,l,e)=>{"use strict";e.d(l,{pc:()=>It,GI:()=>K,rz:()=>Ot,Fp:()=>We,el:()=>Xe,ao:()=>Ct,oA:()=>S,Yt:()=>$e,g4:()=>Kt,tn:()=>rt,n4:()=>C,gD:()=>T,Vp:()=>Fr,Cx:()=>D,bK:()=>L,gi:()=>Jr,Z$:()=>be,GT:()=>Wn,hr:()=>Se,JL:()=>ge,Ck:()=>P,dU:()=>R,wG:()=>Rt,hZ:()=>Sn,$e:()=>Ye,qT:()=>hn,GQ:()=>Pt,q3:()=>et,D_:()=>Qe,Uf:()=>w,_l:()=>se,Md:()=>I,V7:()=>q,fe:()=>te,JP:()=>vn,Z_:()=>E,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>pt,VF:()=>Ln,vf:()=>Bn,PV:()=>fr,PS:()=>kt,Iz:()=>mn,zD:()=>k,m3:()=>ze,XP:()=>Ie,PM:()=>ce,cX:()=>ne,G6:()=>ae,Us:()=>re,AA:()=>he,G0:()=>De,mO:()=>ve,HH:()=>ue,PU:()=>tt,it:()=>_e,Tl:()=>Ee,uH:()=>xe,c3:()=>me,rx:()=>z});var n=e(36087),t=e(14041);const r=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m14-3 2 2 4-4m-7.5-8.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));r.displayName="UserCheck01";const s=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 21v-1.2c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C13.72 15 12.88 15 11.2 15H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 17.28 2 18.12 2 19.8V21M16 6l2 2 4-4m-9.5 3.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0Z"}));s.displayName="UserCheck02";const o=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21m17 0v-6m-3 3h6M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));o.displayName="UserPlus01";var i=e(8957);const a=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m16.5 16 5 5m0-5-5 5M12 15.5H7.5c-1.396 0-2.093 0-2.661.172a4 4 0 0 0-2.667 2.667C2 18.907 2 19.604 2 21M14.5 7.5a4.5 4.5 0 1 1-9 0 4.5 4.5 0 0 1 9 0Z"}));a.displayName="UserX01";const g=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M22 21v-2a4.002 4.002 0 0 0-3-3.874M15.5 3.291a4.001 4.001 0 0 1 0 7.418M17 21c0-1.864 0-2.796-.305-3.53a4 4 0 0 0-2.164-2.165C13.796 15 12.864 15 11 15H8c-1.864 0-2.796 0-3.53.305a4 4 0 0 0-2.166 2.164C2 18.204 2 19.136 2 21M13.5 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z"}));g.displayName="Users01";const c=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m21 21-6-6m2-5a7 7 0 1 1-14 0 7 7 0 0 1 14 0Z"}));c.displayName="SearchSm";var u=e(15297),y=e(22716),A=e(9495);const m=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M4 8h16M4 16h16M8 3v18m8-18v18"}));m.displayName="Hash01";const d=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"m9.5 3-3 18m11-18-3 18m6-13h-17m16 8h-17"}));d.displayName="Hash02";const O=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M15 4.6c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C14.24 3 13.96 3 13.4 3h-2.8c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C9 3.76 9 4.04 9 4.6v2.8c0 .56 0 .84-.109 1.054a1 1 0 0 1-.437.437C8.24 9 7.96 9 7.4 9H4.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C3 9.76 3 10.04 3 10.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C3.76 15 4.04 15 4.6 15h2.8c.56 0 .84 0 1.054.109a1 1 0 0 1 .437.437C9 15.76 9 16.04 9 16.6v2.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C9.76 21 10.04 21 10.6 21h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C15 20.24 15 19.96 15 19.4v-2.8c0-.56 0-.84.109-1.054a1 1 0 0 1 .437-.437C15.76 15 16.04 15 16.6 15h2.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C21 14.24 21 13.96 21 13.4v-2.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C20.24 9 19.96 9 19.4 9h-2.8c-.56 0-.84 0-1.054-.109a1 1 0 0 1-.437-.437C15 8.24 15 7.96 15 7.4V4.6Z"}));O.displayName="MedicalCross";const v=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M12 2v5m0-5c-.713 0-1.41.075-2.08.217M12 2c.713 0 1.41.075 2.08.217M12 7a5 5 0 0 0-5 5m5-5a5 5 0 0 1 5 5m-5 5v5m0-5a5 5 0 0 0 5-5m-5 5a5 5 0 0 1-5-5m5 10c.712 0 1.407-.075 2.077-.216M12 22a10.02 10.02 0 0 1-2.085-.218M4.93 4.93l3.535 3.535m7.072 7.072 3.535 3.535M2 12h5m-5 0c0 .713.075 1.41.217 2.08M2 12c0-.714.075-1.411.217-2.083M17 12h5m0 0c0-.713-.075-1.41-.217-2.08M22 12c0 .713-.075 1.409-.216 2.08M4.928 19.07l3.535-3.536m7.072-7.07 3.535-3.536m-1.624-1.317a10.053 10.053 0 0 1 2.942 2.943m-.003 10.895a10.053 10.053 0 0 1-2.941 2.94m-10.891-.002a10.055 10.055 0 0 1-2.94-2.937m0-10.896a10.054 10.054 0 0 1 2.94-2.942"}));v.displayName="Virus";const p=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M22 10H2m9 4H6M2 8.2v7.6c0 1.12 0 1.68.218 2.108a2 2 0 0 0 .874.874C3.52 19 4.08 19 5.2 19h13.6c1.12 0 1.68 0 2.108-.218a2 2 0 0 0 .874-.874C22 17.48 22 16.92 22 15.8V8.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C20.48 5 19.92 5 18.8 5H5.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C2 6.52 2 7.08 2 8.2Z"}));p.displayName="CreditCard02";const h=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}));h.displayName="Link03";var f=e(85418);const b=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m1 11 2 2 4.5-4.5M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));b.displayName="ClipboardCheck";const M=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M16 4c.93 0 1.395 0 1.776.102a3 3 0 0 1 2.122 2.122C20 6.605 20 7.07 20 8v9.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C17.72 22 16.88 22 15.2 22H8.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C4 19.72 4 18.88 4 17.2V8c0-.93 0-1.395.102-1.776a3 3 0 0 1 2.122-2.122C6.605 4 7.07 4 8 4m4 13v-6m-3 3h6M9.6 6h4.8c.56 0 .84 0 1.054-.109a1 1 0 0 0 .437-.437C16 5.24 16 4.96 16 4.4v-.8c0-.56 0-.84-.109-1.054a1 1 0 0 0-.437-.437C15.24 2 14.96 2 14.4 2H9.6c-.56 0-.84 0-1.054.109a1 1 0 0 0-.437.437C8 2.76 8 3.04 8 3.6v.8c0 .56 0 .84.109 1.054a1 1 0 0 0 .437.437C8.76 6 9.04 6 9.6 6Z"}));M.displayName="ClipboardPlus";const x=({size:zn=24,color:ir="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:ir,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Dt},t.createElement("path",{d:"M11.5 5h.434c3.048 0 4.571 0 5.15.547a2 2 0 0 1 .586 1.845c-.156.781-1.4 1.66-3.888 3.42l-4.064 2.876c-2.488 1.76-3.732 2.639-3.888 3.42a2 2 0 0 0 .586 1.845c.579.547 2.102.547 5.15.547h.934M8 5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm14 14a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));x.displayName="Route";const z=/^(https?):\/\/([a-zA-Z0-9-]+\.)+[a-zA-Z0-9-]{2,}(?::\d+)?(\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(#\/[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?(\?[a-zA-Z0-9\-._~:?#[\]@!$&'()*+,;=%]*)?$/i,T="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",S="http://hl7.org/fhir/StructureDefinition/questionnaire-hidden",C="http://hl7.org/fhir/questionnaire-item-control",E="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",oe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",ce="ui-toolkit/Button",ue="ui-toolkit/Phone",re="ui-toolkit/ErrorCard",J="ui-toolkit/FormContainer",ve="ui-toolkit/PageHeader",Ee="ui-toolkit/SelectableOption",De="ui-toolkit/Modal",ze="ui-toolkit/Alert",Ie="ui-toolkit/AppSectionAccess",xe="ui-toolkit/SensitiveDataCategory",_e="ui-toolkit/QuestCard",at="http://icanbwell.com/fhir/StructureDefinition/subtitle",pt="http://icanbwell.com/fhir/StructureDefinition/text-align",xt={LEFT:"left",CENTER:"center"},Xt={MYSELF:"myself",SOMEONE_ELSE:"someone-else"},Kt="http://icanbwell.com/fhir/StructureDefinition/icon-name",Ct="http://icanbwell.com/fhir/StructureDefinition/error-title",Xe="http://icanbwell.com/fhir/StructureDefinition/error-subtitle",We="http://icanbwell.com/fhir/StructureDefinition/error-icon-name",Ot="http://icanbwell.com/fhir/StructureDefinition/description",Ye="http://icanbwell.com/fhir/StructureDefinition/modal-description",Qe="http://icanbwell.com/fhir/StructureDefinition/modal-title",Pt="http://icanbwell.com/fhir/StructureDefinition/modal-icon-name",hn="http://icanbwell.com/fhir/StructureDefinition/modal-icon-color",Sn="http://icanbwell.com/fhir/StructureDefinition/button-text",et="http://icanbwell.com/fhir/StructureDefinition/secondary-button-text",Rt="http://icanbwell.com/fhir/StructureDefinition/modal-button-action",kt="http://icanbwell.com/fhir/StructureDefinition/trigger-text",Bn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",Or="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",fr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Wn="http://hl7.org/fhir/StructureDefinition/mimeType",Fr="http://hl7.org/fhir/StructureDefinition/maxSize",Jr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",ot="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",lt="http://icanbwell.com/fhir/StructureDefinition/button-type",Et="http://icanbwell.com/fhir/StructureDefinition/button-action",st="button-type",le="http://icanbwell.com/fhir/StructureDefinition/analytics-form-name",ye="http://icanbwell.com/fhir/StructureDefinition/analytics-event-name",Ue="http://icanbwell.com/fhir/StructureDefinition/analytics-page-name",Te="http://icanbwell.com/fhir/StructureDefinition/analytics-property-name",zt="http://icanbwell.com/fhir/StructureDefinition/analytics-option-name",Gt={},vn={"user-check":r,"user-check-02":s,"user-plus":o,"user-01":i.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Y,l,e)=>{"use strict";e.d(l,{$H:()=>P,$O:()=>_e,CP:()=>et,Fy:()=>Sn,GN:()=>te,J4:()=>tt,MU:()=>F,Nw:()=>It,Qr:()=>T,Ue:()=>rt,Yo:()=>J,a0:()=>x,cz:()=>S,di:()=>V,eC:()=>lt,iI:()=>q,lv:()=>w,mR:()=>zt,nt:()=>z,od:()=>N,t7:()=>at,yQ:()=>Te,zj:()=>he});var n=e(17637),t=e(43915),r=e(37234),s=e(65328),o=e(91595),i=e(27779),a=e.n(i),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,qt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:qt}):mt[Qt]=qt,f=(mt,Qt)=>{for(var qt in Qt||(Qt={}))v.call(Qt,qt)&&h(mt,qt,Qt[qt]);if(O)for(var qt of O(Qt))p.call(Qt,qt)&&h(mt,qt,Qt[qt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(qt=>qt.url.includes("questionnaire-itemControl")).flatMap(qt=>{var Lt,$t;return($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?$t:[]}).find(qt=>{var Lt;return(Lt=qt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return qt?.valueCode||"off"},z=(mt,Qt,qt)=>{const Lt=(0,u.A)(qt);return mt&&Qt&&qt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(qt=>qt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(qt=>qt.url===y.Z_);return Qt?.valueInteger},C={date:"MM/DD/YYYY",choice:"Select an option"},E="Type your response here...",R=(mt,Qt)=>{const qt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return qt?.valueString||Qt&&C[Qt]||E},L=mt=>{const Qt=mt?.find(qt=>qt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(qt=>qt.url===y.GT&&qt.valueCode).map(qt=>y.hr[qt.valueCode]||qt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,$t,Yt)=>Yt.indexOf(Lt)===$t).join(", "),N=(mt,Qt,qt)=>{const Lt=D(mt),$t=Lt.lastIndexOf(","),Yt=$t!==-1?`${Lt.substring(0,$t)} or${Lt.substring($t+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,qt&&`upto ${qt} file${qt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(qt=>qt?.url===y.zD||qt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var qt,Lt,$t;const Yt=Qt?.find(On=>On.url.includes(mt));return($t=(Lt=(qt=Yt?.valueInteger)!=null?qt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?$t:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,i.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const qt=Qt[0];if(qt instanceof Date&&!isNaN(qt.getTime())){const Lt=qt.getFullYear(),$t=String(qt.getMonth()+1).padStart(2,"0"),Yt=String(qt.getDate()).padStart(2,"0");return`${Lt}-${$t}-${Yt}`}if(typeof qt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(qt))return qt}}catch{}}},I=(mt,Qt)=>{var qt,Lt;const $t=Qt?.find(On=>On.url===mt);if(!$t)return;const Yt=(qt=$t.valueString)!=null?qt:$t.valueDate;return Yt||q((Lt=$t.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const qt of mt){const Lt=V(Qt,qt.extension);if(Lt!==void 0)return Lt;if(qt.item&&qt.item.length>0){const $t=k(qt.item,Qt);if($t!==void 0)return $t}}},U=(mt,Qt)=>{try{const qt=String(mt??Qt);let Lt;if(qt.includes("/"))Lt=(0,n.A)(qt,"MM/dd/yyyy",new Date);else{const $t=qt.split("T")[0];Lt=(0,t.A)($t)}return(0,r.A)(Lt)}catch(qt){return console.error("Date parsing error:",qt,mt),null}},F=(mt,Qt)=>{var qt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((qt=Lt.item)!=null&&qt.length){const $t=F(Lt.item,Qt);if($t!==void 0)return $t}}},K=(mt,Qt)=>{var qt;const Lt=[];for(const $t of mt)if($t.linkId===Qt&&Lt.push($t),(qt=$t.item)!=null&&qt.length){const Yt=K($t.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,qt=0)=>K(mt,Qt)[qt];function se(mt){return mt!=null}const oe=(mt,Qt)=>{var qt,Lt,$t;if("answerString"in mt&&se(mt.answerString)){if(mt.operator==="=")return Qt?.valueString===mt.answerString;if(mt.operator==="!=")return Qt?.valueString!==mt.answerString}if("answerBoolean"in mt&&se(mt.answerBoolean)){if(mt.operator==="=")return Qt?.valueBoolean===mt.answerBoolean;if(mt.operator==="!=")return Qt?.valueBoolean!==mt.answerBoolean}if("answerInteger"in mt&&se(mt.answerInteger)||"answerDecimal"in mt&&se(mt.answerDecimal)){const Yt=Number(Qt?.valueInteger||Qt?.valueDecimal),On=Number(mt.answerInteger||mt.answerDecimal);if(mt.operator==="=")return Yt===On;if(mt.operator==="!=")return Yt!==On;if(mt.operator===">")return Yt>On;if(mt.operator==="<")return Yt<On;if(mt.operator===">=")return Yt>=On;if(mt.operator==="<=")return Yt<=On}if("answerQuantity"in mt&&se(mt.answerQuantity)){const Yt=Qt?.valueQuantity,On=mt.answerQuantity;if(Yt?.unit!==On?.unit)return!1;if(mt.operator==="=")return Yt.value===On.value;if(mt.operator==="!=")return Yt.value!==On.value;if(mt.operator===">")return Yt.value>On.value;if(mt.operator==="<")return Yt.value<On.value;if(mt.operator===">=")return Yt.value>=On.value;if(mt.operator==="<=")return Yt.value<=On.value}if("answerCoding"in mt&&se(mt.answerCoding)){const Yt=Qt?.valueCoding,On=mt.answerCoding;if(mt.operator==="=")return Yt?.code===On.code;if(mt.operator==="!=")return Yt?.code!==On.code}if("answerReference"in mt&&se(mt.answerReference)){const Yt=Qt?.valueReference,On=mt.answerReference;if(mt.operator==="=")return Yt?.reference===On.reference;if(mt.operator==="!=")return Yt?.reference!==On.reference}if("answerDate"in mt&&se(mt.answerDate)||"answerDateTime"in mt&&se(mt.answerDateTime)||"answerTime"in mt&&se(mt.answerTime)){const Yt=new Date(($t=(Lt=(qt=Qt?.valueDate)!=null?qt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?$t:""),On=new Date(mt.answerDate||mt.answerDateTime||mt.answerTime||"");if(mt.operator==="=")return Yt.getTime()===On.getTime();if(mt.operator==="!=")return Yt.getTime()!==On.getTime();if(mt.operator===">")return Yt.getTime()>On.getTime();if(mt.operator==="<")return Yt.getTime()<On.getTime();if(mt.operator===">=")return Yt.getTime()>=On.getTime();if(mt.operator==="<=")return Yt.getTime()<=On.getTime()}return mt.operator==="exists"?Qt!=null===mt.answerBoolean:!0},te=(mt,Qt,qt)=>{const Lt=$t=>{const Yt=K(qt,$t.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?oe($t,void 0):Yt.some(On=>{var zr;return(zr=On.answer)==null?void 0:zr.some(jr=>oe($t,jr&&Object.keys(jr).length>0?jr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some($t=>Lt($t)):mt?.every($t=>Lt($t)):!0},pe=(mt,Qt,qt,Lt,$t)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var zr;let jr;if(Lt&&typeof $t=="number"){const Pn=qt.filter(rn=>rn.linkId===Lt)[$t];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(zr=rn?.answer)==null?void 0:zr.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!jr){const Rn=K(qt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>oe(On,bt&&Object.keys(bt).length>0?bt:void 0))});jr=void 0}return oe(On,jr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var qt;if(!!((qt=mt?.valueExpression)!=null&&qt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some($t=>Boolean($t)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),$t=be(Lt,Qt);return b(f({},mt),{readOnly:$t??mt.readOnly})},ge=(mt,Qt,qt)=>{const{required:Lt,maxLength:$t,type:Yt,extension:On,enableWhen:zr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=mt;if(!te(zr,jr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,qt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,qt,rn):he(On,Yt,Lt,$t,qt,Pn)},ne=(mt,Qt,qt)=>{const{required:Lt}=mt;if(Lt){if(!qt||qt.length===0)return"At least one item is required";let $t=!1;for(let Yt=0;Yt<qt.length;Yt++){const On=qt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){$t=!0;const jr=he(mt.extension,mt.type,!0,mt.maxLength,[On],mt.answerOption);if(jr)return`Item ${Yt+1}: ${jr}`;if(mt.item&&mt.item.length>0){const Rn=ae(mt.item,Qt,mt.linkId,Yt);if(Rn)return`Item ${Yt+1}: ${Rn}`}}else return`Item ${Yt+1}: This field is required`}if(!$t)return"At least one item is required"}else if(qt&&qt.length>0)for(let $t=0;$t<qt.length;$t++){const Yt=qt[$t];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(zr=>zr!=null&&zr!==""&&(Array.isArray(zr)?zr.length>0:!0))){const zr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(zr)return`Item ${$t+1}: ${zr}`;if(mt.item&&mt.item.length>0){const jr=ae(mt.item,Qt,mt.linkId,$t);if(jr)return`Item ${$t+1}: ${jr}`}}}return""},ae=(mt,Qt,qt,Lt)=>{var $t,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,qt,Lt))continue;const zr=F(Qt,qt),jr=($t=zr?.item)==null?void 0:$t.find(Pn=>Pn.linkId===On.linkId),Rn=(Yt=jr?.answer)!=null&&Yt[Lt]?[jr.answer[Lt]]:void 0;if(On.required){if(!Rn||!Rn[0]||!me(Rn[0]))return`${On.text||On.linkId} is required`;const Pn=he(On.extension,On.type,!0,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}else if(Rn&&Rn[0]&&me(Rn[0])){const Pn=he(On.extension,On.type,!1,On.maxLength,Rn,On.answerOption);if(Pn)return`${On.text||On.linkId}: ${Pn}`}if(On.item&&On.item.length>0){const Pn=ae(On.item,Qt,On.linkId,Lt);if(Pn)return Pn}}return""},me=mt=>!mt||Object.keys(mt).length===0?!1:Object.values(mt).some(Qt=>Qt!=null&&Qt!==""&&(Array.isArray(Qt)?Qt.length>0:!0)),he=(mt,Qt,qt,Lt,$t,Yt)=>{var On,zr,jr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Kn,Br;return En.url===y.gD&&((Br=(Kn=En.valueCodeableConcept)==null?void 0:Kn.coding)==null?void 0:Br.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=$t?.[0],Zt={choice:((On=St?.valueCoding)==null?void 0:On.code)||(St?.valueString&&Yt?.some(En=>En.valueString===St.valueString)?St.valueString:null),"open-choice":((zr=St?.valueCoding)==null?void 0:zr.code)||St?.valueString,boolean:St?.valueBoolean,string:St?.valueString,text:St?.valueString,url:St?.valueUri,integer:St?.valueInteger,decimal:St?.valueDecimal,dateTime:St?.valueDateTime,date:St?.valueDate,time:St?.valueTime,quantity:(jr=St?.valueQuantity)==null?void 0:jr.value,reference:(Rn=St?.valueReference)==null?void 0:Rn.display,attachment:(Pn=St?.valueAttachment)==null?void 0:Pn.title};if(!(Qt in Zt))return"";const un=Zt[Qt],on={required:()=>qt&&(un==null||un===""||un==="NaN"||Number.isNaN(un)||Qt==="boolean"&&un!==!0&&bt)?"This field is required":"",maxLength:()=>Lt&&un!==null&&un!==void 0&&un.toString().length>Lt?`Input should not exceed ${Lt} characters`:"",minLength:()=>{const En=V("minLength",mt);return En&&un!==null&&un!==void 0&&un.toString().length<Number(En)?`Input should be at least ${En} characters`:""},urlRegex:()=>{const En=new RegExp(y.rx),Kn=V("regexError",mt),Br=Kn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(Br):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Kn=new RegExp(En),Br=V("regexError",mt),$r=Br??"Please enter a valid input";return Kn&&un&&!Kn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Kn=new Date(En);return isNaN(Kn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const Br=I(y.dU,mt),$r=U(Br??"01/01/1900","01/01/1900"),Zr=U(un,"");if(!$r||!Zr)return"";if((0,s.A)(Zr,$r)){const f0=(En=mt?.find(Io=>Io.url===y.Ck))==null?void 0:En.valueString;return f0??`Date should not be before ${Br??"01/01/1900"}`}return""}const Kn=V("minValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un<Kn?`Input should not be less than ${Kn}`:""},maxValue:()=>{var En;if(Qt==="date"){const Br=I(y.bK,mt),$r=U(Br??"01/01/2100","01/01/2100"),Zr=U(un,"");if(!$r||!Zr)return"";if((0,o.A)(Zr,$r)){const f0=(En=mt?.find(Io=>Io.url===y.Cx))==null?void 0:En.valueString;return f0??`Date should not be after ${Br??"01/01/2100"}`}return""}const Kn=V("maxValue",mt);return Kn!=null&&un!==null&&un!==void 0&&un>Kn?`Input should not exceed ${Kn}`:""}};return rn=on.required()||on.maxLength()||on.minLength()||on.urlRegex()||on.regex()||on.dateTime()||on.date()||on.minValue()||on.maxValue()||"",rn},ce=(mt,Qt)=>{for(const qt of Qt)if(qt.item){if(qt.item.find(Yt=>Yt.linkId===mt.linkId))return qt;const $t=ce(mt,qt.item);if($t)return $t}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const qt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(qt&&qt.answer&&qt.answer.length>1)return!0}return!1},re=(mt,Qt,qt,Lt)=>{var $t,Yt;const{required:On}=mt,zr=($t=Lt.item)==null?void 0:$t.find(Pn=>Pn.linkId===mt.linkId),jr=zr?.answer||[],Rn=((Yt=Lt.answer)==null?void 0:Yt.length)||1;for(let Pn=0;Pn<Rn;Pn++){const rn=jr[Pn];if(On){if(!rn||!me(rn))return`Item ${Pn+1}: ${mt.text||mt.linkId} is required`;const bt=he(mt.extension,mt.type,!0,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}else if(rn&&me(rn)){const bt=he(mt.extension,mt.type,!1,mt.maxLength,[rn],mt.answerOption);if(bt)return`Item ${Pn+1}: ${bt}`}}return""},J=(mt,Qt)=>{for(const qt of mt){if(qt?.linkId===Qt)return qt;if(qt?.item&&qt.item.length>0){const Lt=J(qt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.oA&&qt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===y.gD&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&qt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>{var Lt,$t;return qt.url===ITEM_CONTROL_EXTENSION_URL&&(($t=(Lt=qt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:$t.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return qt?.valueInteger},at=mt=>{var Qt;const qt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return qt?.valueInteger},pt=mt=>{var Qt;const qt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return qt?.valueInteger},xt=(mt,Qt,qt,Lt,$t,Yt)=>{const On=jr=>Qt.filter(Rn=>Rn.linkId===jr),zr=new Set;return mt.map(jr=>{if(zr.has(jr.linkId)||ve(jr))return null;const Pn=On(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(zr.add(jr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(qt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&$t&&$t.length>0){const En=St?.item||[];on=[...En],$t.forEach(Kn=>{const Br=on.findIndex($r=>$r.linkId===Kn.linkId);Br>=0?on[Br]=b(f({},En[Br]),{answer:Kn.answer}):on.push(Kn)})}else jr.item&&(on=xt(jr.item,St?.item||[],qt,Lt,$t,Zt));qt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&Lt?un.answer=Lt:un.answer=St.answer||[{}],on&&on.length>0?un.item=on:St.item&&(un.item=St.item),bt.push(un)}),qt===jr.linkId&&typeof Yt=="number"&&Yt>=Pn.length)for(let St=Pn.length;St<=Yt;St++){const Zt={linkId:jr.linkId,text:jr.text,answer:St===Yt&&Lt?Lt:[{}]};St===Yt&&$t&&$t.length>0?Zt.item=$t:jr.item&&(Zt.item=xt(jr.item,[],void 0,void 0,void 0,void 0)),bt.push(Zt)}return bt}else if(jr.repeats&&typeof Yt=="number"&&qt===jr.linkId){const bt=Pn[0]||{linkId:jr.linkId,text:jr.text,answer:[]},St={linkId:jr.linkId,text:jr.text,answer:[...bt.answer||[]]};if(Lt&&Lt.length>0){for(;St.answer.length<=Yt;)St.answer.push({});St.answer[Yt]=Lt[0]}return St}else{const bt=Pn[0],St=jr.item?xt(jr.item,bt?.item||[],qt,Lt,$t,Yt):void 0,Zt=St&&St.length>0,un={linkId:jr.linkId,text:jr.text};return qt&&jr.linkId===qt&&typeof Yt!="number"?(Lt||!Lt&&!$t?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),$t?un.item=$t:Zt&&(un.item=St)):(bt?.answer?un.answer=bt.answer:un.answer=[{}],Zt&&(un.item=St)),un}}).filter(Boolean).flat()},Xt=(mt,Qt)=>{for(const qt of mt)if(qt.linkId===Qt||qt.item&&Xt(qt.item,Qt))return qt.linkId;return null},Kt=(mt,Qt,qt,Lt)=>{var $t;const Yt=($t=mt?.item)!=null?$t:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var zr;const jr=K(Qt,On.linkId);if(jr.length===0){const Rn=(zr=F(Qt,On.linkId))==null?void 0:zr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1}else for(const Rn of jr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&qt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,qt):!0})},Ct=(mt,Qt,qt=!0)=>{for(const Lt of mt)if(Lt.linkId===Qt&&Lt.answer&&Lt.answer.length>0||Lt.item&&Lt.item.length>0&&Ct(Lt.item,Qt,qt))return!0;return!1},Xe=(mt,Qt,qt=0)=>{const Lt=mt.filter($t=>$t.linkId===Qt);if(Lt.length>qt){const $t=Lt[qt];if($t.answer&&$t.answer.length>0)return $t.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if($t.item&&$t.item.length>0)return Ct($t.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const qt=Lt=>{var $t;if(Ee(Lt)&&Lt.required&&te(Lt.enableWhen,Lt.enableBehavior,Qt)){const Yt=F(Qt,Lt.linkId),On=he(Lt.extension,Lt.type,Lt.required,Lt.maxLength,Yt?.answer,Lt.answerOption);if(!(($t=Yt?.answer)!=null&&$t.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(qt(Yt))return!0}return!1};for(const Lt of mt.item)if(qt(Lt))return!0;return!1},Ot=mt=>{var Qt,qt,Lt;if(mt.valueString!==void 0)return mt.valueString;if(mt.valueBoolean!==void 0)return mt.valueBoolean;if(mt.valueInteger!==void 0)return mt.valueInteger;if(mt.valueDecimal!==void 0)return mt.valueDecimal;if(mt.valueDate!==void 0)return mt.valueDate;if(mt.valueDateTime!==void 0)return mt.valueDateTime;if(((Qt=mt.valueCoding)==null?void 0:Qt.code)!==void 0)return mt.valueCoding.code;if(((qt=mt.valueReference)==null?void 0:qt.reference)!==void 0)return mt.valueReference.reference;if(((Lt=mt.valueQuantity)==null?void 0:Lt.value)!==void 0)return mt.valueQuantity.value;if(mt.valueAttachment!==void 0)return mt.valueAttachment},Ye=mt=>{const Qt={linkId:mt.linkId};if(mt.answer&&mt.answer.length>0){const qt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);qt.length>0&&(Qt.answer=qt)}if(mt.item&&mt.item.length>0){const qt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const $t=Object.keys(Lt);return $t.length>1||$t.length===1&&$t[0]!=="linkId"});qt.length>0&&(Qt.item=qt)}return Qt},Qe=(mt,Qt,qt,Lt,$t,Yt)=>{var On;const zr=(On=Qt?.item)==null?void 0:On[qt[Lt]],jr=zr?.linkId;if(!jr)return!1;const Rn=K(mt,jr),Pn=K($t,jr),rn=bt=>{if(bt!=null){if(Array.isArray(bt)){const St=bt.filter(Zt=>Zt!=null).map(Zt=>rn(Zt)).filter(Zt=>Zt!==void 0);return St.length===0||St.length===1&&typeof St[0]=="object"&&Object.keys(St[0]).length===0?void 0:St}if(typeof bt=="object"){const St={};for(const[Zt,un]of Object.entries(bt))if(un!=null){const on=rn(un);on!==void 0&&(St[Zt]=on)}return Object.keys(St).length===0?void 0:St}return bt}};if(Rn.length!==Pn.length)return!1;for(let bt=0;bt<Rn.length;bt++){const St=Rn[bt],Zt=Pn[bt];if(!St||!Zt)return!1;const un=Ye(rn(St)),on=Ye(rn(Zt));if(!_.isEqual(un,on))return!1}return Lt!==Yt},Pt=(mt,Qt,qt)=>qt&&qt.length>0&&!(qt.length===1&&Object.keys(qt[0]).length===0)&&ge(mt,Qt,qt)||null,hn=(mt,Qt)=>{const qt={},Lt=$t=>{$t.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let zr=0;zr<On.length;zr++){const jr=On[zr];if(jr?.answer&&jr.answer.length>0){const Rn=Pt(Yt,Qt,jr.answer);Rn&&(qt[Yt.linkId]=b(f({},qt[Yt.linkId]),{[zr]:Rn}))}}else{const zr=F(Qt,Yt.linkId);if(zr?.answer&&zr.answer.length>0){const jr=Pt(Yt,Qt,zr.answer);jr&&(qt[Yt.linkId]={0:jr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),qt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[qt,Lt,$t]=Qt;return`${qt.slice(-4)}-${Lt}-${$t}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const qt=(Lt,$t)=>{for(const Yt of Lt){if(Yt.linkId===$t)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=qt(Yt.item,$t);if(On!==void 0)return On}}};return qt(mt,Qt)},kt=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const zr of $t){const jr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>rn.repeats===!0)?zr:null;if(Lt(zr.item,Yt,jr))return zr}}return null};return Lt(Qt,qt)},Bn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const qt=mt.linkId,Lt=($t,Yt,On=[])=>{for(const zr of $t){const jr=[...On,zr];if(zr.item){if(zr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(zr.item,Yt,jr))return!0}}return!1};return Lt(Qt,qt)},Or=(mt,Qt,qt)=>{const Lt={};if(!mt)return Lt;const{linkId:$t}=Qt;if(mt[$t]){const Yt=mt[$t];Lt[$t]=Yt[qt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[qt]||""}}),Lt},mn=(mt,Qt)=>{const qt={};if(!mt||!mt[Qt])return qt;const Lt=mt[Qt];return qt[Qt]=Lt[0]||"",qt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),qt=Qt>=0?[Qt]:[],Lt=new Map;let $t=null;if(mt.forEach((Yt,On)=>{const zr=ze(Yt);if(zr&&Yt.type==="group")On!==Qt&&qt.push(On),Lt.set(On,[On]),$t=On;else if($t!==null&&!zr){const jr=Lt.get($t)||[];Lt.set($t,[...jr,On])}}),mt.length>0&&qt.length>0){const Yt=qt[0];if(!Lt.has(Yt)){const On=qt.find(jr=>jr>Yt),zr=[];for(let jr=Yt;jr<(On??mt.length);jr++)zr.push(jr);Lt.set(Yt,zr)}}return{groupIndices:qt,itemsToRenderMap:Lt}},fr=(mt,Qt,qt,Lt)=>{let $t=[...Lt];const Yt=(On,zr)=>{On.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,zr))&&jr.initial&&!Ct(zr,jr.linkId))if(jr.repeats){const Rn=zr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(zr,jr.linkId,rn)||($t=xt(qt,$t,jr.linkId,jr.initial,void 0,rn))}):$t=xt(qt,$t,jr.linkId,jr.initial)}else $t=xt(qt,$t,jr.linkId,jr.initial);jr.item&&Yt(jr.item,zr)})};return Yt(mt,Qt),$t},Wn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,qt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach($t)};return mt.forEach($t),Lt},Fr=(mt,Qt)=>mt.every(qt=>{var Lt;const $t=K(Qt,qt.linkId);if($t.length>0)return $t.every(Yt=>!ge(qt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,qt.linkId))==null?void 0:Lt.answer;return!ge(qt,Qt,Yt)}}),Jr=(mt,Qt)=>{let qt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){qt=Lt;break}return qt},It=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:It(qt.item,Qt)}):qt),$e=(mt,Qt,qt=mt)=>mt.reduce((Lt,$t)=>{const Yt=J(Qt,$t.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,qt)||($t.item&&$t.item.length>0?Lt.push(b(f({},$t),{item:$e($t.item,Qt,qt)})):Lt.push($t)),Lt},[]),ot=(mt,Qt,qt=[])=>{const Lt=[],$t=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&$t(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const zr=mt.slice(0,Yt+1),jr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,bt)=>{const St=J(qt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,zr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return $t(Pn),{trimmedData:[...zr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const zr=ot(On.item,Qt,qt);if(zr.found){const jr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...jr,b(f({},On),{item:zr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(qt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return $t(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...zr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(qt=>!Qt.includes(qt.linkId)).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Je(qt.item,Qt)}):qt),tt=mt=>{var Qt;if(!mt)return"empty";const qt=y.Z$.find(({patterns:Lt})=>Lt.some($t=>mt.includes($t)));return(Qt=qt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:qt}=Ln(mt),Lt=mt.findIndex($t=>$t.linkId===Qt);return Lt!==-1?qt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=qt=>{const Lt=mt.find(Yt=>Yt.url===qt&&Yt.valueString);if(!Lt?.valueString)return null;const $t=Lt.valueString.replace(/\\n/g,`
|
|
870
870
|
`).split(`
|
|
871
871
|
`).map(Yt=>Yt.trim()).filter(Boolean).map(Yt=>Yt.startsWith("*")?Yt.substring(1).trim():Yt);return $t.length===0?null:$t.length===1?{isList:!1,items:$t}:{isList:!0,items:$t}};return{restriction:Qt("restriction"),warning:Qt("warning")}},Et=(mt,Qt)=>{var qt;switch(Qt.type){case"boolean-to-string":return typeof mt=="boolean"?mt?Qt.trueValue:Qt.falseValue:mt;case"map":return Qt.mapping&&mt in Qt.mapping?Qt.mapping[mt]:mt;case"date-format":return mt;case"number-format":if(typeof mt=="number"){let Lt=mt.toFixed((qt=Qt.decimals)!=null?qt:0);return Qt.prefix&&(Lt=Qt.prefix+Lt),Qt.suffix&&(Lt=Lt+Qt.suffix),Lt}return mt;case"passthrough":default:return mt}},st=(mt,Qt)=>{const qt=mt.linkId,Lt=(Yt,On,zr=[])=>{for(const jr of Yt){const Rn=[...zr,jr];if(jr.item){if(jr.item.some(bt=>bt.linkId===On))return Rn.filter(bt=>bt.repeats===!0);const rn=Lt(jr.item,On,Rn);if(rn.length>0)return rn}}return[]},$t=Lt(Qt,qt);return $t.length>0?$t[$t.length-1]:null},le=(mt,Qt)=>{if(!mt?.item)return[];const qt=[];for(const Lt of mt.item){if(Lt.type!=="group")continue;te(Lt.enableWhen,Lt.enableBehavior,Qt||[])&&Lt.linkId&&qt.push(Lt.linkId)}return qt},ye=(mt,Qt)=>{const qt=le(mt,Qt||void 0);return qt[qt.length-1]},Ue=({questionnaire:mt,extensionUrl:Qt,errorCode:qt})=>{if(!qt||!mt?.item)return;const Lt=mt.item.find($t=>{var Yt;return(Yt=$t.extension)==null?void 0:Yt.some(On=>On.url===Qt&&On.valueString===qt)});return Lt?.linkId},Te=(mt,Qt)=>{var qt;const Lt=(qt=mt.extension)==null?void 0:qt.find(Yt=>Yt.url===y.rb);if(!Lt?.valueString)return;const $t=Lt.valueString;return J(Qt,$t)},zt=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(qt=>qt.url===y.rb))},Gt=(mt,Qt)=>mt.filter(qt=>qt.linkId!==Qt).map(qt=>qt.item&&qt.item.length>0?b(f({},qt),{item:Gt(qt.item,Qt)}):qt),vn=mt=>{const Qt=V(ANALYTICS_FORM_NAME_EXTENSION_URL,mt.extension);return Qt??k(mt.item,ANALYTICS_FORM_NAME_EXTENSION_URL)},zn=mt=>V(ANALYTICS_EVENT_NAME_EXTENSION_URL,mt.extension),ir=mt=>V(ANALYTICS_PAGE_NAME_EXTENSION_URL,mt.extension),Dt=mt=>V(ANALYTICS_PROPERTY_NAME_EXTENSION_URL,mt.extension),we=mt=>V(ANALYTICS_OPTION_NAME_EXTENSION_URL,mt),Ze=(mt,Qt)=>{var qt,Lt,$t;if(!mt.answerOption)return;const Yt=F(Qt,mt.linkId),On=($t=(Lt=(qt=Yt?.answer)==null?void 0:qt[0])==null?void 0:Lt.valueCoding)==null?void 0:$t.code;if(!On)return;const zr=mt.answerOption.find(jr=>{var Rn;return((Rn=jr.valueCoding)==null?void 0:Rn.code)===On});if(!!zr)return we(zr.extension)},At=(mt,Qt)=>{const qt={},Lt=$t=>{if(!!$t)for(const Yt of $t){const On=Dt(Yt);if(On){let zr;switch(Yt.type){case"choice":zr=Ze(Yt,Qt);break;default:break}zr&&(qt[On]=zr)}Yt.item&&Yt.item.length>0&&Lt(Yt.item)}};return Lt(mt.item),qt},en=mt=>!!(mt.initial&&mt.initial.length>0),nn=(mt,Qt,qt)=>{if(!mt)return[];const Lt=[],$t=Yt=>{Yt.forEach(On=>{if(qt&&qt.includes(On.linkId))return;const zr=Ee(On),jr=Qt.includes(On.linkId);(jr||zr&&On.required)&&Lt.push(On),jr&&On.item&&On.item.length>0&&$t(On.item)})};return $t(mt),Lt},fn=(mt,Qt,qt,Lt,$t,Yt)=>{var On;if(qt<0||!Lt?.item)return!0;const zr=$t.current[qt],jr=qt+1,Rn=$t.current[jr],Pn=qt===0?0:zr,rn=Rn??Lt.item.length,bt=[];for(let En=Pn;En<rn;En++){const Kn=(On=Lt?.item)==null?void 0:On[En];if(Kn){if(Yt&&Yt.includes(Kn.linkId))continue;const Br=Ee(Kn);(Qt.includes(Kn.linkId)||Br&&Kn.required)&&bt.push(Kn),Kn.item&&Kn.item.length>0&&bt.push(...nn(Kn.item,Qt,Yt))}}const St=bt.filter(En=>En.required===!0),Zt=bt.filter(En=>En.required!==!0),un=Fr(St,mt),on=Zt?.every(En=>{var Kn;const Br=(Kn=F(mt,En.linkId))==null?void 0:Kn.answer;return Br?!ge(En,mt,Br):!0});return!St?.length||un&&on}},28058:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),o=e(76260),i=e(25624);const a=({item:dr})=>{const i0=dr.text||"",Wr=dr.extension||[],Vo=ki=>{var Ii;return(Ii=Wr.find(Si=>Si.url===ki))==null?void 0:Ii.valueString},vi=Vo(o.$7),yi=Vo(o.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:i0,description:vi??"",color:yi})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(dr,i0,Wr)=>i0 in dr?u(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,O=(dr,i0)=>{for(var Wr in i0||(i0={}))A.call(i0,Wr)&&d(dr,Wr,i0[Wr]);if(y)for(var Wr of y(i0))m.call(i0,Wr)&&d(dr,Wr,i0[Wr]);return dr};const v=({item:dr})=>{const[i0,Wr]=(0,t.useState)(!1),Vo=dr.extension||[],vi=tr=>{var gn;return(gn=Vo.find(Un=>Un.url===tr))==null?void 0:gn.valueString},yi=vi(o.PS)||dr.text||"",ki=vi(o.Iz)||"button",Ii=vi(o.VF),Si=vi(o.PV),Li=vi(o.vf),hi=Li?o.JP[Li]:void 0,yr=vi(o.D_)||"",Yn=vi(o.$e),Sr=vi(o.GQ),Le=vi(o.qT)||"gray",Ce=vi(o.hZ),Fe=vi(o.wG),ht=vi(o.q3),Ht=Sr?o.JP[Sr]:void 0,tn=()=>Wr(!0),In=()=>{switch(ki){case"icon-button":return(0,n.jsxs)("button",{onClick:tn,className:"text-secondary hover:text-primary! flex cursor-pointer items-center gap-2 rounded-lg p-2 transition-opacity",type:"button","aria-label":yi||yr||void 0,children:[hi&&(0,n.jsx)(hi,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),yi&&(0,n.jsx)("span",{className:"text-sm",children:yi})]});default:return(0,n.jsx)(r.Button,{color:Ii??"secondary",size:Si??"md",iconLeading:hi,onClick:tn,"aria-label":yi,children:yi})}};return(0,n.jsxs)(n.Fragment,{children:[In(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${dr.linkId}`,isOpen:i0,onOpenChange:Wr,title:{content:yr},description:{content:Yn?(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(Yn)}}):void 0},closeButton:{onCloseClick:()=>Wr(!1)}},Ht?{featuredIcon:{icon:Ht,color:Le,size:"lg",className:"bg-white"}}:{}),Ce?{primaryButton:{children:Ce,onClick:()=>{var tr,gn;Fe==="open-zendesk"&&((gn=(tr=globalThis.zE)==null?void 0:tr.activate)==null||gn.call(tr,{hideOnClose:!0})),Wr(!1)}}}:{}),ht?{secondaryButton:{children:ht,onClick:()=>Wr(!1)}}:{}))]})};var p=e(18522);const h=({item:dr})=>{var i0,Wr,Vo,vi,yi,ki,Ii,Si,Li,hi,yr,Yn;const{hasExternalError:Sr}=(0,p.c)(),Le=dr.text||"",Ce=(Wr=(i0=dr.extension)==null?void 0:i0.find(Vr=>Vr.url===o.ao))==null?void 0:Wr.valueString,Fe=Sr&&Ce?Ce:Le,ht=(vi=(Vo=dr.extension)==null?void 0:Vo.find(Vr=>Vr.url===o.$7))==null?void 0:vi.valueString,Ht=(ki=(yi=dr.extension)==null?void 0:yi.find(Vr=>Vr.url===o.el))==null?void 0:ki.valueString,tn=Sr&&Ht?Ht:ht,In=(Si=(Ii=dr.extension)==null?void 0:Ii.find(Vr=>Vr.url===o.g4))==null?void 0:Si.valueString,tr=(hi=(Li=dr.extension)==null?void 0:Li.find(Vr=>Vr.url===o.Fp))==null?void 0:hi.valueString,gn=In?o.JP[In]:void 0,Un=tr?o.JP[tr]:void 0,cn=Sr&&Un?Un:gn,lr=((Yn=(yr=dr.extension)==null?void 0:yr.find(Vr=>Vr.url===o.WS))==null?void 0:Yn.valueString)===o._W.LEFT,Ir=lr?"items-start":"items-center",n0=lr?"text-left":"text-center",O0=lr?"text-2xl font-semibold":"text-3xl font-medium";return(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-4`,children:[cn&&(0,n.jsx)(r.FeaturedIcon,{icon:cn,color:Sr&&Un?"error":"brand",size:"xl"}),(0,n.jsxs)("div",{className:`flex flex-col ${Ir} gap-1`,children:[(0,n.jsx)("h1",{className:`text-primary max-w-[330px] ${n0} ${O0} md:max-w-[352px]`,children:Fe}),(0,n.jsx)("p",{className:`text-md text-secondary ${n0}`,children:tn})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(dr,i0,Wr)=>i0 in dr?M(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,C=(dr,i0)=>{for(var Wr in i0||(i0={}))z.call(i0,Wr)&&S(dr,Wr,i0[Wr]);if(x)for(var Wr of x(i0))T.call(i0,Wr)&&S(dr,Wr,i0[Wr]);return dr};const E=({item:dr})=>{const[i0,Wr]=(0,t.useState)(!1),Vo=(0,b.T$)(),vi=dr.extension||[],yi=Ce=>{var Fe;return(Fe=vi.find(ht=>ht.url===Ce))==null?void 0:Fe.valueString},ki=dr.text||"",Ii=yi(o.PS)||"",Si=yi(o.D_)||"",Li=yi(o.$e),hi=yi(o.GQ),yr=yi(o.qT)||"gray",Yn=yi(o.hZ),Sr=yi(o.q3),Le=hi?o.JP[hi]:void 0;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"bg-secondary ring-border-secondary flex items-center justify-between rounded-lg px-4 py-2.5 ring-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(f.d,{className:"text-tertiary size-4 shrink-0"}),(0,n.jsx)("span",{className:"text-primary text-sm font-semibold",children:ki})]}),Ii&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Wr(!0),children:Ii})]}),(0,n.jsx)(r.Modal,C(C(C({id:`modal-${dr.linkId}`,isOpen:i0,onOpenChange:Wr,title:{content:Si},description:{content:Li?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(Li)}}):void 0},closeButton:{onCloseClick:()=>Wr(!1)}},Le?{featuredIcon:{icon:Le,color:yr,size:"lg",className:"bg-white"}}:{}),Yn?{primaryButton:{children:Yn,onClick:()=>{Wr(!1),Vo.navigate({id:"profile"})}}}:{}),Sr?{secondaryButton:{children:Sr,onClick:()=>Wr(!1)}}:{}))]})},R=({item:dr,selectedAnswer:i0,handleInputChange:Wr})=>{var Vo,vi,yi;const ki=(Vo=dr.answerOption)!=null?Vo:[],Ii=(yi=(vi=i0?.[0])==null?void 0:vi.valueCoding)==null?void 0:yi.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ki.map(Si=>{var Li,hi,yr,Yn,Sr,Le,Ce;const Fe=(hi=(Li=Si.valueCoding)==null?void 0:Li.code)!=null?hi:"",ht=(Yn=(yr=Si.valueCoding)==null?void 0:yr.display)!=null?Yn:"",Ht=Ii===Fe,tn=(Sr=Si.extension)==null?void 0:Sr.find(Un=>Un.url===o.g4),In=(Le=Si.extension)==null?void 0:Le.find(Un=>Un.url===o.rz),tr=tn?.valueString?o.JP[tn.valueString]:void 0,gn=(Ce=In?.valueString)!=null?Ce:"";return(0,n.jsx)(r.SelectableOption,{icon:tr,title:ht,description:gn,isSelected:Ht,onSelect:()=>{Wr(dr,[{valueCoding:{code:Fe,display:ht}}])}},Fe)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:dr,isLabel:i0,required:Wr,className:Vo,id:vi})=>(0,n.jsxs)("p",{id:vi,className:Vo??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(i0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(dr||"")}}),Wr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(dr,i0)=>{const Wr=dr.replace(/\D/g,"");let Vo="",vi=0;for(let yi=0;yi<i0.length&&vi<Wr.length;yi++)i0[yi]==="#"?(Vo+=Wr[vi],vi++):Vo+=i0[yi];return Vo},q=dr=>{if(!dr)return w;const i0=dr.find(Wr=>Wr.url===o.Md);return i0?.valueString||w},I=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:yr,readOnly:Yn,extension:Sr}=dr,Le=q(Sr),Ce=((Ii=Wr?.[0])==null?void 0:Ii.valueString)||"",[Fe,ht]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Ce){const gn=V(Ce,Le);ht(gn)}},[Ce,Le]);const Ht=Li?(0,i.nt)(vi,yr,Li):"",tn=yi?.[Si]||"",In=gn=>{const Un=V(gn,Le);ht(Un),Vo(dr,[{valueString:Un}])},tr=()=>{i0&&i0(Si)};return(0,n.jsxs)("div",{"data-testid":Si,children:[Ht&&(0,n.jsx)(N,{isLabel:!0,text:Ht,required:hi||!1}),(0,n.jsx)(r.Input,{id:Si,"aria-label":Si,"data-testid":Si,type:"tel",placeholder:"Enter phone number",value:Fe,onChange:In,onBlur:tr,isDisabled:Yn||ki,isRequired:hi,hint:tn,isInvalid:!!tn,size:"md"},Si)]})},k=({item:dr,questionnaireSchemaItems:i0})=>{var Wr;const{isLoading:Vo,setCurrentGroupIndex:vi}=(0,p.c)(),yi=(Wr=dr.extension)==null?void 0:Wr.find(Li=>Li.url===o.Uf),ki=yi?.valueString,Ii=dr.text||"Save & continue",Si=()=>{if(ki){const Li=(0,i.Ue)(i0||[],ki);Li!==-1&&vi(Li)}};return(0,n.jsx)("div",{"data-testid":dr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Vo,onClick:Si,isDisabled:dr.readOnly,children:Ii})})},U=({size:dr=24,color:i0="currentColor",...Wr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:i0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Wr},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:dr=24,color:i0="currentColor",...Wr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:i0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Wr},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));K.displayName="UserCircle";var G=e(14711);const se=({size:dr=24,color:i0="currentColor",...Wr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:i0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Wr},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));se.displayName="Mail01";var oe=e(31165),te=e(14449),pe=e(27163);const be=dr=>{try{const i0=dr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!i0)return dr;const[,Wr,Vo,vi]=i0;return new Date(Date.UTC(parseInt(Wr),parseInt(Vo)-1,parseInt(vi))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return dr}},Se=dr=>{try{if(dr.includes("AM")||dr.includes("PM"))return dr;const i0=dr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!i0)return dr;const[,Wr,Vo]=i0,vi=parseInt(Wr),yi=vi>=12?"PM":"AM";return`${vi%12||12}:${Vo} ${yi}`}catch{return dr}},ge=(dr,i0,Wr=f.d)=>{var Vo;const vi=(Vo=dr.extension)==null?void 0:Vo.find(yi=>yi.url===o.g4);return vi?.valueString&&o.JP[vi.valueString]?o.JP[vi.valueString]:dr.linkId&&i0[dr.linkId]?i0[dr.linkId]:Wr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":oe.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],he=["appointment-review/facility-phone"],ce=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:dr,questionnaireSchemaItems:i0})=>{var Wr;const{setCurrentGroupIndex:Vo}=(0,p.c)(),{trackEvent:vi}=(0,s.st)(),yi=dr.item||[];if(yi.length===0)return null;const ki=(Wr=dr.extension)==null?void 0:Wr.find(hi=>hi.url===o.Uf),Ii=ki?.valueString,Si=()=>{if(vi("edit_info_clicked",{section:dr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Ii){const hi=(0,i.Ue)(i0||[],Ii);hi!==-1&&Vo(hi)}},Li=yi.map(hi=>{let yr="";if(hi.initial&&hi.initial.length>0){const Le=hi.initial.map(Ce=>{var Fe,ht;let Ht=((Fe=Ce.valueCoding)==null?void 0:Fe.display)||((ht=Ce.valueReference)==null?void 0:ht.display)||Ce.valueString||"";return Ht&&typeof Ht=="string"&&(ae.includes(hi.linkId)?Ht=be(Ht):me.includes(hi.linkId)&&(Ht=Se(Ht))),Ht}).filter(Boolean);Le.length>1||hi.repeats&&Le.length>0?yr=Le:Le.length===1&&(yr=Le[0])}if(!yr||Array.isArray(yr)&&yr.length===0)return null;let Yn;he.includes(hi.linkId)?Yn="phone":ce.includes(hi.linkId)&&(Yn="address");let Sr;return ue.includes(hi.linkId)&&(Sr="phone"),{Icon:ge(hi,ne),label:hi.text||hi.linkId,value:yr,linkType:Yn,displayType:Sr}}).filter(Boolean);return Li.length===0?null:(0,n.jsx)("div",{"data-testid":dr.linkId,children:(0,n.jsx)(pe.InfoCard,{title:dr.text||"Details",infoDetails:Li,actionButtonText:Ii&&"Edit info",onActionButtonClick:Ii?Si:void 0})})},J=({size:dr=24,color:i0="currentColor",...Wr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:dr,height:dr,stroke:i0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Wr},t.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));J.displayName="AlertTriangle";var ve=e(18807);const Ee=({item:dr})=>{const{setHideFooterButton:i0,incrementCustomErrorCount:Wr,decrementCustomErrorCount:Vo}=(0,p.c)();return(0,t.useEffect)(()=>(i0(!0),Wr(),()=>{i0(!1),Vo()}),[i0,Wr,Vo]),(0,n.jsx)("div",{"data-testid":dr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(r.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ve.p)(dr.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},ze=({item:dr})=>{var i0,Wr,Vo,vi;const{incrementCustomErrorCount:yi,decrementCustomErrorCount:ki,setHideFooterButton:Ii}=(0,p.c)(),[Si,Li]=(0,t.useState)(!1),hi=(i0=dr.extension)==null?void 0:i0.find(Fe=>Fe.url===o.gi),yr=(Vo=(Wr=hi?.valueCodeableConcept)==null?void 0:Wr.coding)==null?void 0:Vo.find(Fe=>Fe.system===o.tn),Yn=yr?.code||"error",Sr=De[Yn]||"error";(0,t.useEffect)(()=>{if(Sr==="error")return yi(),Ii(!0),Li(!0),()=>{ki(),Ii(!1)};Li(!0)},[Sr,yi,ki,Ii]);const Le=yr?.display||"Error",Ce=(vi=dr.text)!=null?vi:"";return Si?(0,n.jsx)("div",{"data-testid":dr.linkId,children:(0,n.jsx)(r.InfoBanner,{type:Sr,title:Le,description:Ce})}):null};var Ie=e(65735);const xe=({configKey:dr,customErrorConfigurations:i0})=>{if(!i0)return null;const Wr=i0[dr];if(!Wr)return null;const{icon:Vo,title:vi,description:yi,primaryButton:ki,secondaryButton:Ii}=Wr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:vi,description:yi,featuredIconProps:{icon:Vo,color:"gray"},primaryButton:ki,secondaryButton:Ii})},_e=10,at=({item:dr,customErrorConfigurations:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii,Si,Li,hi;const{trackEvent:yr}=(0,s.st)(),{setHideFooterButton:Yn}=(0,p.c)(),{linkId:Sr,text:Le,required:Ce,answerOption:Fe,prefix:ht,readOnly:Ht}=dr,tn=dr?.type==="reference",In=(Ii=Wr?.map(kn=>{var kr,d0;return tn?(kr=kn.valueReference)==null?void 0:kr.display:(d0=kn.valueCoding)==null?void 0:d0.code}).filter(kn=>kn!==void 0))!=null?Ii:[],[tr,gn]=(0,t.useState)(In.length),Un=Le?(0,i.nt)(vi,ht,Le):"",cn=(Li=(Si=dr.extension)==null?void 0:Si.find(kn=>kn.url===o.Z_))==null?void 0:Li.valueInteger,lr=(hi=Fe?.map(kn=>{var kr,d0,ao,E0;return{value:tn?((kr=kn.valueReference)==null?void 0:kr.display)||"":((d0=kn.valueCoding)==null?void 0:d0.code)||"",label:tn?((ao=kn.valueReference)==null?void 0:ao.display)||"":((E0=kn.valueCoding)==null?void 0:E0.display)||"",valueReference:kn.valueReference}}))!=null?hi:[],Ir=yi?.[Sr],n0=lr.length>_e,O0=n0?lr.slice(0,_e):lr,Vr=n0?lr.slice(_e):[],S0=Vr.some(kn=>In?.includes(kn?.value)),[po,ct]=(0,t.useState)(S0);if(!(dr.answerOption&&dr.answerOption.length>0))return Yn(!0),(0,n.jsx)(xe,{configKey:dr.linkId,customErrorConfigurations:i0});const An=lr.filter(kn=>In?.includes(kn?.value)).map(kn=>{var kr;const{restriction:d0,warning:ao}=tn?(0,i.eC)((kr=kn.valueReference)==null?void 0:kr.extension):{restriction:null,warning:null};return{label:kn.label,restriction:d0,warning:ao}}).filter(kn=>kn.restriction||kn.warning),jn=(kn,kr)=>{var d0;yr("vaccine_type_checkbox_selected",{on_or_off:kn?"on":"off",vaccine:kr,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let ao;if(kn){const E0=lr.find(J0=>J0.value===kr);ao=[...(d0=Wr?.filter(J0=>Object.keys(J0).length!==0))!=null?d0:[],tn?{valueReference:E0?.valueReference}:{valueCoding:{code:kr,display:E0?.label}}],gn(J0=>J0+1)}else ao=Wr?.filter(E0=>{var J0,No;return tn?((J0=E0.valueReference)==null?void 0:J0.display)!==kr:((No=E0.valueCoding)==null?void 0:No.code)!==kr})||[{}],gn(E0=>E0-1);Vo&&Vo(dr,ao)};return(0,n.jsxs)("div",{"data-testid":Sr,children:[Un&&(0,n.jsx)(N,{text:Un,required:Ce||!1}),n0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:O0.map((kn,kr)=>{const d0=In?.includes(kn?.value),ao=!d0&&cn?tr>=cn:!1;return(0,n.jsx)("div",{className:kr!==O0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:kr.toString(),name:kn.label,isInvalid:!!Ir,isSelected:d0,label:kn.label,onChange:E0=>jn(E0,kn.value),isDisabled:Ht||ki||ao})},kr)})}),n0&&!po&&!S0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{ct(!0),yr("see_all_vaccines_clicked",{_event_metadata:{description:"A user clicked the see all link on the vaccine type page."}})},color:"link-color",size:"sm",isDisabled:Ht||ki,children:"See all"})}),n0&&po&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),n0&&po&&(0,n.jsx)("div",{children:Vr.map((kn,kr)=>{const d0=In?.includes(kn?.value),ao=!d0&&cn?tr>=cn:!1;return(0,n.jsx)("div",{className:kr!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:(_e+kr).toString(),name:kn.label,isInvalid:!!Ir,isSelected:d0,label:kn.label,onChange:E0=>jn(E0,kn.value),isDisabled:Ht||ki||ao})},_e+kr)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Ir,children:Ir}),An.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:An.map((kn,kr)=>(0,n.jsxs)("div",{children:[kn.restriction&&(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Restriction] ${kn.label}`,description:kn.restriction.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:kn.restriction.items.map((d0,ao)=>(0,n.jsx)("li",{className:"text-sm",children:d0},ao))}):(0,n.jsx)("p",{className:"text-sm",children:kn.restriction.items[0]})}),kn.warning&&(0,n.jsx)("div",{className:kn.restriction?"mt-2":"",children:(0,n.jsx)(r.InfoBanner,{type:"warning",title:`[Warning] ${kn.label}`,description:kn.warning.isList?(0,n.jsx)("ul",{className:"ml-5 list-disc space-y-1",children:kn.warning.items.map((d0,ao)=>(0,n.jsx)("li",{className:"text-sm",children:d0},ao))}):(0,n.jsx)("p",{className:"text-sm",children:kn.warning.items[0]})})})]},kr))})]})};var pt=e(76323),xt=e(56192),Xt=e(66267),Kt=Object.defineProperty,Ct=Object.defineProperties,Xe=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertySymbols,Ot=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable,Qe=(dr,i0,Wr)=>i0 in dr?Kt(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,Pt=(dr,i0)=>{for(var Wr in i0||(i0={}))Ot.call(i0,Wr)&&Qe(dr,Wr,i0[Wr]);if(We)for(var Wr of We(i0))Ye.call(i0,Wr)&&Qe(dr,Wr,i0[Wr]);return dr},hn=(dr,i0)=>Ct(dr,Xe(i0)),Sn=(dr,i0,Wr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Wr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Wr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Wr=Wr.apply(dr,i0)).next())});const et=({item:dr,handleInputChange:i0,onCompleteHandler:Wr,errors:Vo})=>{const{i18n:{t:vi},loading:yi}=(0,Xt.E_)({keys:["shared-translations"]}),{trackEvent:ki}=(0,s.st)(),{linkId:Ii,required:Si,readOnly:Li}=dr,hi=Vo?.[Ii]||"",[yr,Yn]=(0,t.useState)(pt.LocationType.CURRENT_LOCATION),[Sr,Le]=(0,t.useState)(""),Ce=(0,t.useRef)({}),[Fe,ht]=(0,t.useState)([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:Ht,setIsLoading:tn,setIsCurrentFormValid:In,isCurrentFormValid:tr}=(0,p.c)(),{position:gn,loading:Un,locationPermission:cn}=(0,pt.useDeviceLocationContext)(),{queryParams:lr,setQueryParams:Ir}=(0,pt.useSearchQueryParams)(),[n0,{loading:O0}]=(0,xt.qtq)({fetchPolicy:"cache-first"}),[Vr,{loading:S0}]=(0,xt.YyG)({fetchPolicy:"cache-first"}),po=dr.item?(0,i.Yo)(dr.item,"postal-code"):void 0,ct=dr.item?(0,i.Yo)(dr.item,"state"):void 0,_t=dr.item?(0,i.Yo)(dr.item,"latitude"):void 0,An=dr.item?(0,i.Yo)(dr.item,"longitude"):void 0,jn=j0=>{if(!j0||!po)return Le(""),!1;const Po=(0,i.zj)(po.extension,po.type,!1,po.maxLength,[{valueString:j0}]);return Po?(Le(yr!==pt.LocationType.ZIP_CODE?vi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Po),!1):(Le(""),!0)},kn=()=>{const{latitude:j0,longitude:Po,state:Z0,zipcode:A0}=Ce.current;return!!(j0&&Po&&Z0&&A0)},kr=(0,t.useCallback)(j0=>{Ce.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},dr.item&&(ct&&i0(ct,[{valueString:""}]),_t&&i0(_t,[{valueDecimal:void 0}]),An&&i0(An,[{valueDecimal:void 0}]),po&&i0(po,[{valueString:""}])),Ir({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:j0,locationPermission:cn}),In&&In(!1),Le("")},[i0,dr.item,_t,cn,An,In,Ir,ct,po]);(0,t.useEffect)(()=>{if(!Si)return;!kn()&&In&&In(!1)},[tr,Si,In]);const d0=j0=>{Ce.current=Pt(Pt({},Ce.current),j0),j0.addressDescription&&ki("address_selected",{value:j0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),J0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,Ce.current.zipcode,Ce.current.placeId,Ce.current.addressDescription)},ao=j0=>Sn(void 0,null,function*(){var Po,Z0,A0;if(Le(""),Ce.current.zipcode=j0,In&&In(!1),jn(j0)){ki("zip_code_entered",{value:j0,_event_metadata:{description:"A user entered a zip code."}});const Eo=yield Vr({variables:{location:j0}}),K0=(Po=Eo?.data)==null?void 0:Po.geocoding,Fi=Eo?.error;if(K0){const Bo=K0.stateCode||"",Ci=(Z0=K0.latitude)!=null?Z0:void 0,va=(A0=K0.longitude)!=null?A0:void 0;d0({latitude:Ci,longitude:va,state:Bo,zipcode:j0,placeId:void 0,addressDescription:void 0})}else Fi&&(d0({latitude:void 0,longitude:void 0,state:void 0,zipcode:j0,placeId:void 0,addressDescription:void 0}),Le(vi("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else J0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,j0)}),E0=()=>{const j0=Ce.current.zipcode||"";!j0||yr!==pt.LocationType.ZIP_CODE||jn(j0)};(0,t.useEffect)(()=>{lr.locationType&&(Yn(lr.locationType),lr.locationType===pt.LocationType.ZIP_CODE&&lr.zipCode&&ao(lr.zipCode),lr.locationType===pt.LocationType.ADDRESS&&lr.placeId&&lr.addressDescription&&(Ce.current.addressDescription=lr.addressDescription,Ce.current.placeId=lr.placeId))},[]),(0,t.useEffect)(()=>{const j0=[pt.LocationPermissionEnum.DENIED,pt.LocationPermissionEnum.UNAVAILABLE,pt.LocationPermissionEnum.BLOCKED].includes(lr.locationPermission),Po=[pt.LocationPermissionEnum.GRANTED,pt.LocationPermissionEnum.PROMPT].includes(lr.locationPermission);if(j0&&Fe.length!==2){if(ht([{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}]),yr===pt.LocationType.CURRENT_LOCATION||!lr.locationType||lr.locationType===""){const Z0=lr.locationType===pt.LocationType.ZIP_CODE?pt.LocationType.ZIP_CODE:pt.LocationType.ADDRESS;Yn(Z0),Ir(hn(Pt({},lr),{locationType:Z0})),kr(Z0)}Le("")}Po&&Fe.length!==3&&ht([{id:pt.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:pt.LocationType.ADDRESS,label:"Address"},{id:pt.LocationType.ZIP_CODE,label:"Zip code"}])},[yr,cn,Fe.length,lr,Ir,kr]);const J0=(j0,Po,Z0,A0,Eo,K0)=>{if(!dr.item)return;ct&&i0(ct,[{valueString:Z0||""}]),_t&&i0(_t,[{valueDecimal:j0}]),An&&i0(An,[{valueDecimal:Po}]),po&&i0(po,[{valueString:A0||""}]),Ir(hn(Pt({},lr),{lat:String(j0),lng:String(Po),location:`${j0},${Po}`,zipCode:A0||"",placeId:Eo||"",addressDescription:K0||"",locationPermission:cn}));const Fi=kn()&&jn(A0||"");In&&In(Fi),Wr&&Wr(Ii)};(0,t.useEffect)(()=>{const j0=()=>Sn(void 0,null,function*(){var Po;try{const Z0=yield n0({variables:{latitude:String(gn?.coords.latitude),longitude:String(gn?.coords.longitude)}}),A0=(Po=Z0?.data)==null?void 0:Po.geocodingByLatLon,Eo=A0?.stateCode||"",K0=A0?.zipCode||"";(!K0||!Eo)&&Le(vi("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),d0({latitude:gn?.coords.latitude,longitude:gn?.coords.longitude,state:Eo,zipcode:K0,placeId:void 0,addressDescription:void 0})}catch{Yn(pt.LocationType.ADDRESS)}});yr===pt.LocationType.CURRENT_LOCATION&&gn&&j0()},[yr,gn]);const No=j0=>{if(!j0||!j0.latitude||!j0.longitude||!j0.zipCode||!j0.stateCode){d0({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),j0&&typeof j0.value=="string"&&j0.value.trim().length!==0&&Le(vi("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}d0({latitude:j0.latitude,longitude:j0.longitude,state:j0.stateCode,zipcode:j0.zipCode,placeId:j0.placeId,addressDescription:j0.description})};return(0,t.useEffect)(()=>{tn(Un||O0||S0||yi)},[Un,O0,S0,yi,tn]),(0,t.useEffect)(()=>{lr.locationType!==yr&&Ir(hn(Pt({},lr),{locationType:yr}))},[yr]),(0,n.jsxs)("div",{"data-testid":dr.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:Si||!1}),(0,n.jsx)(r.Select,{id:Ii,"aria-label":Ii,"data-testid":Ii,isDisabled:Li||O0||S0||Ht,selectedKey:yr,onSelectionChange:j0=>{var Po;ki("location_type_input_selected",{choice:(Po=Fe.find(({id:Z0})=>Z0===j0))==null?void 0:Po.label,_event_metadata:{description:"A user changed the location type input."}}),j0!==yr&&(kr(j0),Yn(j0))},hint:hi,isInvalid:!!hi,items:Fe,placeholder:"Select an option",isRequired:Si,children:j0=>(0,n.jsx)(r.Select.Item,{id:j0.id,"data-testid":j0.id,value:j0,children:j0.label},j0.id)},Ii),yr===pt.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!Sr,children:Sr}),yr===pt.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:Si||!1}),(0,n.jsx)(pt.AddressTypeahead,{onValueChange:No,isDisabled:Ht,setIsLoading:tn,initialValue:{placeId:Ce.current.placeId||"",description:Ce.current.addressDescription||""},errorText:Sr||hi})]}),yr===pt.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:Si||!1}),(0,n.jsx)(r.Input,{isRequired:Si,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Ii}-zipcode`,placeholder:"Type your response here...",value:Ce.current.zipcode||"",onChange:ao,onBlur:E0,isDisabled:Li||S0||Ht,hint:Sr||hi,isInvalid:!!Sr||!!hi,autoComplete:"postal-code"},`${Ii}-zipcode`)]})]})},Rt=dr=>(0,n.jsx)(pt.DeviceLocationProvider,{children:(0,n.jsx)(et,Pt({},dr))}),kt={[o.cX]:Rt,[o.G6]:re,[o.c3]:at,[o.AA]:ze,[o.mO]:h,[o.PM]:k,[o.HH]:I,[o.Us]:Ee,[o.Tl]:R,[o.G0]:v,[o.m3]:a,[o.PU]:E,[o.XP]:g.l,[o.uH]:L.v,[o.it]:Ie.d};var Bn,Or=new Uint8Array(16);function mn(){if(!Bn&&(Bn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Bn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Bn(Or)}const Ln=/^(?:[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 fr(dr){return typeof dr=="string"&&Ln.test(dr)}const Wn=fr;for(var Fr=[],Jr=0;Jr<256;++Jr)Fr.push((Jr+256).toString(16).substr(1));function It(dr){var i0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Wr=(Fr[dr[i0+0]]+Fr[dr[i0+1]]+Fr[dr[i0+2]]+Fr[dr[i0+3]]+"-"+Fr[dr[i0+4]]+Fr[dr[i0+5]]+"-"+Fr[dr[i0+6]]+Fr[dr[i0+7]]+"-"+Fr[dr[i0+8]]+Fr[dr[i0+9]]+"-"+Fr[dr[i0+10]]+Fr[dr[i0+11]]+Fr[dr[i0+12]]+Fr[dr[i0+13]]+Fr[dr[i0+14]]+Fr[dr[i0+15]]).toLowerCase();if(!Wn(Wr))throw TypeError("Stringified UUID is invalid");return Wr}const $e=It;function ot(dr,i0,Wr){dr=dr||{};var Vo=dr.random||(dr.rng||mn)();if(Vo[6]=Vo[6]&15|64,Vo[8]=Vo[8]&63|128,i0){Wr=Wr||0;for(var vi=0;vi<16;++vi)i0[Wr+vi]=Vo[vi];return i0}return $e(Vo)}const Je=ot,tt=(dr,i0="application/octet-stream")=>{try{const Wr=window.atob(dr),Vo=new Uint8Array(Wr.length);for(let yi=0;yi<Wr.length;yi++)Vo[yi]=Wr.charCodeAt(yi);return new Blob([Vo],{type:i0}).size}catch{return 0}},rt=(dr,i0)=>`data:${i0};base64,${dr}`,lt=(dr,i0,Wr=512)=>{const Vo=window.atob(dr),vi=[];for(let ki=0;ki<Vo.length;ki+=Wr){const Ii=Vo.slice(ki,ki+Wr),Si=new Array(Ii.length);for(let hi=0;hi<Ii.length;hi++)Si[hi]=Ii.charCodeAt(hi);const Li=new Uint8Array(Si);vi.push(Li)}const yi=new Blob(vi,{type:i0});return URL.createObjectURL(yi)},Et=dr=>{const i0=new Date().toISOString().replace(/[:.-]/g,"");return`${dr.split(" ").join("-")}_${i0}`},st=4e3,le=.8,ye=(dr,i0)=>{var Wr,Vo;const vi=(Wr=i0?.maxDimension)!=null?Wr:st,yi=(Vo=i0?.quality)!=null?Vo:le;return new Promise((ki,Ii)=>{if(!dr.type.startsWith("image/")){ki(dr);return}if(dr.type==="image/heic"||dr.type==="image/heif"||dr.name.toLowerCase().endsWith(".heic")||dr.name.toLowerCase().endsWith(".heif")){ki(dr);return}const Li=new Image,hi=new FileReader;hi.onload=()=>{const yr=hi.result;Li.onload=()=>{let{width:Yn,height:Sr}=Li;if(Yn>vi||Sr>vi){const Ht=vi/Math.max(Yn,Sr);Yn=Math.round(Yn*Ht),Sr=Math.round(Sr*Ht)}const Le=document.createElement("canvas");Le.width=Yn,Le.height=Sr;const Ce=Le.getContext("2d");if(!Ce){ki(dr);return}Ce.drawImage(Li,0,0,Yn,Sr);const Fe=dr.type==="image/png"?"image/png":"image/jpeg",ht=dr.type==="image/png"?void 0:yi;Le.toBlob(Ht=>{if(!Ht||Ht.size>=dr.size){ki(dr);return}ki(new File([Ht],dr.name,{type:Fe}))},Fe,ht)},Li.onerror=()=>{Ii(new Error(`Failed to load image: ${dr.name}`))},Li.src=yr},hi.onerror=()=>{Ii(new Error(`Failed to read file: ${dr.name}`))},hi.readAsDataURL(dr)})},Ue=50,Te=(dr,i0=Ue)=>{if(dr.length<=i0)return dr;const Wr=dr.lastIndexOf("."),Vo=Wr!==-1?dr.slice(Wr):"",vi=Wr!==-1?dr.slice(0,Wr):dr,yi=i0-Vo.length-1,ki=Math.ceil(yi/2),Ii=Math.floor(yi/2);return`${vi.slice(0,ki)}\u2026${vi.slice(-Ii)}${Vo}`};var zt=Object.defineProperty,Gt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,ir=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,we=(dr,i0,Wr)=>i0 in dr?zt(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,Ze=(dr,i0)=>{for(var Wr in i0||(i0={}))ir.call(i0,Wr)&&we(dr,Wr,i0[Wr]);if(zn)for(var Wr of zn(i0))Dt.call(i0,Wr)&&we(dr,Wr,i0[Wr]);return dr},At=(dr,i0)=>Gt(dr,vn(i0)),en=(dr,i0,Wr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Wr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Wr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Wr=Wr.apply(dr,i0)).next())});const nn=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{const{linkId:Ii,text:Si,required:Li,prefix:hi,readOnly:yr,repeats:Yn,extension:Sr}=dr,Le=(0,i.Qr)(Sr),Ce=(0,i.cz)(Sr),Fe=(0,i.$H)(Sr)||"image/*,.pdf,.doc,.docx",ht=Si?(0,i.nt)(vi,hi,Si):"",Ht=yi?.[Ii]||"",[tn,In]=(0,t.useState)([]),tr=(0,t.useRef)(Wr||[]);(0,t.useEffect)(()=>{Wr&&(tr.current=Wr)},[Wr]),(0,t.useEffect)(()=>{Wr?.length&&In(n0=>{const O0=n0.filter(S0=>S0.isLoading||S0.failed);return[...Wr.filter(S0=>S0.valueAttachment).map((S0,po)=>{var ct,_t,An,jn,kn;const kr=((ct=S0.valueAttachment)==null?void 0:ct.title)||`attachment-${po}`,d0=(_t=S0.valueAttachment)==null?void 0:_t.id,ao=n0.find(No=>d0&&No.id===d0||!d0&&No.id===`existing-${po}`),E0=(An=S0.valueAttachment)==null?void 0:An.data,J0=E0?tt(E0,(jn=S0.valueAttachment)==null?void 0:jn.contentType):0;return{id:d0||ao?.id||`existing-${po}`,name:kr,size:ao?.size||J0,progress:100,failed:!1,type:(0,i.J4)((kn=S0.valueAttachment)==null?void 0:kn.contentType),isLoading:!1}}),...O0]})},[Wr]);const gn=n0=>{let O0=Array.from(n0);if(Ce!==void 0){const S0=Ce-tn.length;if(S0<=0)return;O0=O0.slice(0,S0)}const Vr=O0.map(S0=>{const po=Le&&S0.size>Le,ct=S0.name.replace(/\s+/g,"-");return{id:Je(),name:ct,size:S0.size,progress:0,type:(0,i.J4)(S0.type),failed:!!po,isLoading:!po,disableRetry:!!po,errorMessage:po?`File size exceeds ${(Le/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});In(S0=>[...S0,...Vr]),Vr.filter(S0=>!S0.failed).forEach(S0=>{const po=O0.find(ct=>ct.name.replace(/\s+/g,"-")===S0.name);po&&Un(po,S0.id)})},Un=(n0,O0)=>en(void 0,null,function*(){try{const Vr=yield ye(n0),S0=yield Ir(Vr),po=Vr.name.replace(/\s+/g,"-");In(jn=>jn.map(kn=>kn.id===O0?At(Ze({},kn),{isLoading:!1,progress:100,failed:!1}):kn));const ct={valueAttachment:{id:O0,contentType:Vr.type,data:S0,title:po}},An=[...(tr.current||[]).filter(jn=>jn.valueAttachment||Object.keys(jn).length>0),ct];tr.current=An,Vo(dr,An),i0(Ii)}catch{In(S0=>S0.map(po=>po.id===O0?At(Ze({},po),{isLoading:!1,failed:!0}):po))}}),cn=n0=>{const O0=tn.find(Vr=>Vr.id===n0);if(In(Vr=>Vr.filter(S0=>S0.id!==n0)),O0){const Vr=(tr.current||[]).filter((S0,po)=>{var ct;if(n0.startsWith("existing-")){const _t=parseInt(n0.replace("existing-",""));return po!==_t}return((ct=S0.valueAttachment)==null?void 0:ct.id)!==n0}).filter(S0=>S0.valueAttachment||Object.keys(S0).length>0);tr.current=Vr,Vo(dr,Vr.length>0?Vr:[{}])}},lr=n0=>{const O0=tn.find(Vr=>Vr.id===n0);if(O0){In(S0=>S0.map(po=>po.id===n0?At(Ze({},po),{failed:!1,isLoading:!0,progress:0}):po));const Vr=new File([""],O0.name,{type:"application/octet-stream"});Un(Vr,n0)}},Ir=n0=>new Promise((O0,Vr)=>{const S0=new FileReader;S0.onload=()=>{const ct=S0.result.split(",")[1];O0(ct)},S0.onerror=Vr,S0.readAsDataURL(n0)});return(0,n.jsxs)("div",{children:[ht&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ht,required:Li||!1}),(0,n.jsx)(r.FileUpload,{files:tn,onDropFiles:gn,onDeleteFile:cn,onRetryFile:lr,onDropUnacceptedFiles:()=>{},hint:(0,i.od)(Fe,Le,Ce),accept:Fe,allowsMultiple:Yn!==!1,isDisabled:yr||ki||Ce!==void 0&&tn.length>=Ce,className:"w-full",showDisclosureModal:!0}),Ht&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:Ht})]})},fn=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii,Si;const{linkId:Li,text:hi,prefix:yr,readOnly:Yn,required:Sr,extension:Le}=dr,{trackQuestionnaireEvent:Ce}=(0,p.c)(),Fe=hi?(0,i.nt)(vi,yr,hi):"",ht=yi?.[Li];return Le?.find(tn=>{var In,tr;return tn.url===o.gD&&((tr=(In=tn.valueCodeableConcept)==null?void 0:In.coding)==null?void 0:tr.some(gn=>gn.system===o.n4&&gn.code===o.GI))})?(0,n.jsxs)("div",{"data-testid":Li,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Li,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Li,name:Li,isDisabled:Yn||ki,isSelected:(Ii=Wr?.[0])==null?void 0:Ii.valueBoolean,"aria-label":Li,label:"",className:"mt-1",onChange:tn=>{Ce(dr.linkId,{value:tn}),Vo(dr,[{valueBoolean:tn}]),i0(dr.linkId)}}),Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Sr||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!ht,children:ht})]}):(0,n.jsxs)("div",{"data-testid":Li,children:[Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:Sr||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Li,name:Li,"aria-label":Li,value:String((Si=Wr?.[0])==null?void 0:Si.valueBoolean)||"",onChange:tn=>{Vo(dr,[{valueBoolean:tn==="true"}]),i0(dr.linkId)},isInvalid:!!ht,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Yn||ki}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Yn||ki})]},Li),ht&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:ht})})]})};var mt=Object.defineProperty,Qt=Object.getOwnPropertySymbols,qt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,$t=(dr,i0,Wr)=>i0 in dr?mt(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,Yt=(dr,i0)=>{for(var Wr in i0||(i0={}))qt.call(i0,Wr)&&$t(dr,Wr,i0[Wr]);if(Qt)for(var Wr of Qt(i0))Lt.call(i0,Wr)&&$t(dr,Wr,i0[Wr]);return dr};const On=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,yr;const{linkId:Yn,text:Sr,required:Le,answerOption:Ce,prefix:Fe,readOnly:ht}=dr,Ht=Sr?(0,i.nt)(vi,Fe,Sr):"",tn=Ce?.map(gn=>{var Un,cn,lr,Ir;return{id:((Un=gn.valueCoding)==null?void 0:Un.code)||gn.valueString||"",label:((cn=gn.valueCoding)==null?void 0:cn.display)||gn.valueString||"",value:((lr=gn.valueCoding)==null?void 0:lr.code)||gn.valueString||"",extension:gn.extension||[],system:((Ir=gn.valueCoding)==null?void 0:Ir.system)||void 0}})||[],In=((hi=(Li=Wr?.[0])==null?void 0:Li.valueCoding)==null?void 0:hi.code)||((yr=Wr?.[0])==null?void 0:yr.valueString)||"",tr=yi?.[Yn];return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ht,required:Le||!1}),(0,n.jsx)(r.Select,{id:Yn,"aria-label":Yn,"data-testid":Yn,isDisabled:ht||ki,selectedKey:In,onSelectionChange:gn=>{const Un=String(gn),cn=tn.find(n0=>n0.value===Un),lr=cn?cn.label:"",Ir=Boolean(Ce?.find(n0=>n0.valueString===Un));Vo(dr,[Ir?{valueString:Un}:{valueCoding:Yt({code:Un,display:lr},cn?.system?{system:cn.system}:{}),extension:cn?.extension||[]}]),i0(dr.linkId)},isInvalid:!!tr,hint:tr||Si,items:tn,placeholder:Ii,isRequired:Le,children:gn=>(0,n.jsx)(r.Select.Item,{id:gn.id,"data-testid":gn.value,value:gn.value,children:gn.label},gn.id)},Yn)]})};var zr=Object.defineProperty,jr=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,rn=(dr,i0,Wr)=>i0 in dr?zr(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,bt=(dr,i0)=>{for(var Wr in i0||(i0={}))Rn.call(i0,Wr)&&rn(dr,Wr,i0[Wr]);if(jr)for(var Wr of jr(i0))Pn.call(i0,Wr)&&rn(dr,Wr,i0[Wr]);return dr};const St=dr=>{var i0,Wr,Vo;const{item:vi,selectedAnswer:yi,updatedText:ki,required:Ii,errorMessage:Si}=dr,Li=vi?.type==="reference",hi=(i0=yi?.map(Ce=>{var Fe,ht;return Li?(Fe=Ce.valueReference)==null?void 0:Fe.display:(ht=Ce.valueCoding)==null?void 0:ht.code}).filter(Ce=>Ce!==void 0))!=null?i0:[],[yr,Yn]=(0,t.useState)(hi.length),Sr=(Vo=(Wr=vi.extension)==null?void 0:Wr.find(Ce=>Ce.url===o.Z_))==null?void 0:Vo.valueInteger,Le=(Ce,Fe)=>{var ht,Ht,tn;let In;if(Ce){const tr=dr.options.find(gn=>gn.value===Fe);In=[...(Ht=(ht=dr.selectedAnswer)==null?void 0:ht.filter(gn=>Object.keys(gn).length!==0))!=null?Ht:[],Li?{valueReference:tr?.valueReference}:{valueCoding:bt({code:Fe,display:tr?.label},tr?.system?{system:tr.system}:{}),extension:tr?.extension||[]}],Yn(gn=>gn+1)}else In=((tn=dr.selectedAnswer)==null?void 0:tn.filter(tr=>{var gn,Un;return Li?((gn=tr.valueReference)==null?void 0:gn.display)!==Fe:((Un=tr.valueCoding)==null?void 0:Un.code)!==Fe}))||[{}],Yn(tr=>tr-1);dr.handleInputChange(dr.item,In)};return(0,n.jsxs)("div",{"data-testid":vi.linkId,children:[ki&&(0,n.jsx)(N,{isLabel:!0,text:ki,required:Ii||!1}),(0,n.jsx)("div",{children:dr.options.map((Ce,Fe)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Ce.value,id:Fe.toString(),className:Fe!==dr.options.length-1?"mb-2xl":"",name:Ce.label,isInvalid:!!Si,isSelected:hi?.includes(Ce?.value),label:Ce.label,onChange:ht=>Le(ht,Ce.value),isDisabled:dr.readOnly||dr.isLoading||(!hi?.includes(Ce?.value)&&Sr?yr>=Sr:!1)},Fe))}),(0,n.jsx)(r.HintText,{isInvalid:!!Si,children:Si})]})},Zt=({item:dr,onCompleteHandler:i0,updatedText:Wr,options:Vo,handleInputChange:vi,errorMessage:yi,readOnly:ki,initialValue:Ii,selectedAnswer:Si,isLoading:Li,required:hi})=>{var yr,Yn;const Sr=`${dr.linkId}-label`,Le=`${dr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":dr.linkId,children:[Wr&&(0,n.jsx)(N,{id:Sr,isLabel:!0,text:Wr,required:hi||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:dr.linkId,name:dr.linkId,"aria-labelledby":Wr?Sr:void 0,"aria-describedby":yi?Le:void 0,isRequired:hi,className:Vo.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Yn=(yr=Si?.[0])==null?void 0:yr.valueCoding)==null?void 0:Yn.code)||Ii||"",onChange:Ce=>{const Fe=Ce,ht=Vo.find(tn=>tn.value===Fe),Ht=ht?ht.label:"";vi(dr,[{valueCoding:{code:Fe,display:Ht,system:ht?.system||void 0},extension:ht?.extension||[]}]),i0(dr.linkId)},isInvalid:!!yi,children:Vo.map(Ce=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Ce.value,isDisabled:ki||Li,value:Ce.value,label:Ce.label},Ce.value))},dr.linkId),yi&&(0,n.jsx)("div",{id:Le,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:yi})})]})};var un=Object.defineProperty,on=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Kn=Object.prototype.propertyIsEnumerable,Br=(dr,i0,Wr)=>i0 in dr?un(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,$r=(dr,i0)=>{for(var Wr in i0||(i0={}))En.call(i0,Wr)&&Br(dr,Wr,i0[Wr]);if(on)for(var Wr of on(i0))Kn.call(i0,Wr)&&Br(dr,Wr,i0[Wr]);return dr};const Zr=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,yr,Yn,Sr;const{linkId:Le,text:Ce,required:Fe,answerOption:ht,prefix:Ht,readOnly:tn}=dr,In=dr?.type==="reference",tr=Ce?(0,i.nt)(vi,Ht,Ce):"",Un=(()=>{var Vr,S0;const po=ht?.find(ct=>ct.initialSelected===!0);return po?In?((Vr=po.valueReference)==null?void 0:Vr.display)||"":((S0=po?.valueCoding)==null?void 0:S0.code)||"":""})(),cn=(ht?.map(Vr=>{var S0,po,ct,_t,An;return{label:((S0=Vr?.valueCoding)==null?void 0:S0.display)||((po=Vr?.valueReference)==null?void 0:po.display)||"",value:In?((ct=Vr.valueReference)==null?void 0:ct.display)||"":((_t=Vr.valueCoding)==null?void 0:_t.code)||"",valueReference:In?Vr.valueReference:{},extension:Vr.extension||[],system:((An=Vr.valueCoding)==null?void 0:An.system)||""}})||[]).filter(Vr=>Vr.label),lr=yi?.[Le],Ir=(Sr=(Yn=(yr=(hi=(Li=dr?.extension)==null?void 0:Li.find(Vr=>Vr.url.includes("questionnaire-itemControl")))==null?void 0:hi.valueCodeableConcept)==null?void 0:yr.coding)==null?void 0:Yn[0])==null?void 0:Sr.code;let n0=null;const O0={item:dr,onCompleteHandler:i0,updatedText:tr,options:cn,handleInputChange:Vo,errorMessage:lr,required:Fe,readOnly:tn,initialValue:Un,selectedAnswer:Wr,isLoading:ki,showQuestionPrefix:vi,placeholder:Ii,hintText:Si};switch(Ir){case"drop-down":n0=(0,n.jsx)(On,$r({},O0));break;case"check-box":n0=(0,n.jsx)(St,$r({},O0));break;case"radio-button":n0=(0,n.jsx)(Zt,$r({},O0));break}return(0,n.jsx)(n.Fragment,{children:n0})};var f0=e(73697),Io=e(71924),_0=e(46776);const lo=dr=>`${String(dr.month).padStart(2,"0")}/${String(dr.day).padStart(2,"0")}/${dr.year}`,G0=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,yr;const{linkId:Yn,text:Sr,required:Le,prefix:Ce,readOnly:Fe}=dr,ht=(0,t.useRef)(null),[Ht,tn]=(0,t.useState)(!1),[In,tr]=(0,t.useState)(null),{setIsCurrentFormValid:gn,isCurrentFormValid:Un,trackQuestionnaireEvent:cn}=(0,p.c)(),lr=Sr?(0,i.nt)(vi,Ce,Sr):"",Ir=yi?.[Yn]||"",n0=(Li=dr.extension)==null?void 0:Li.find(Z0=>Z0.url===o.dU),O0=(hi=dr.extension)==null?void 0:hi.find(Z0=>Z0.url===o.bK),Vr=(0,t.useMemo)(()=>{var Z0;const A0=n0?.valueString||n0?.valueDate;return A0||(0,i.iI)((Z0=n0?.valueExpression)==null?void 0:Z0.expression)},[n0]),S0=(0,t.useMemo)(()=>{var Z0;const A0=O0?.valueString||O0?.valueDate;return A0||(0,i.iI)((Z0=O0?.valueExpression)==null?void 0:Z0.expression)},[O0]),po=(0,t.useMemo)(()=>{if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{return(0,f0._U)(Vr)}catch{}return(0,f0._U)("1900-01-01")},[Vr]),ct=(0,t.useMemo)(()=>{if(S0&&/^\d{4}-\d{2}-\d{2}$/.test(S0))try{return(0,f0._U)(S0)}catch(Z0){console.warn("Failed to parse maxDateStr:",S0,Z0)}return(0,f0._U)("2099-12-31")},[S0]),An=(Z0=>{if(!Z0)return"";const A0=Z0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!A0)return Z0;const[,Eo,K0,Fi]=A0;return`${K0}/${Fi}/${Eo}`})(((yr=Wr?.[0])==null?void 0:yr.valueDate)||""),jn=Z0=>{if(!Z0)return"";const A0=Z0.replace(/\D/g,"");if(A0.length===0)return"";if(A0.length<=2)return A0.length===2?`${A0}/`:A0;const Eo=Fi=>{const Bo=Fi.slice(0,2),Ci=Fi.slice(2);return Ci.length===2?`${Bo}/${Ci}/`:`${Bo}/${Ci}`},K0=Fi=>{const Bo=Fi.slice(0,2),Ci=Fi.slice(2,4),va=Fi.slice(4,8);return`${Bo}/${Ci}/${va}`};return A0.length<=4?Eo(A0):K0(A0)},kn=()=>{if(Fe||ki)return;if(An.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const A0=(0,f0._U)(An);tr(A0)}catch{tr(null)}else{const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(A0){const[,Eo,K0,Fi]=A0,Bo=parseInt(Eo,10),Ci=parseInt(K0,10);if(Bo>=1&&Bo<=12&&Ci>=1&&Ci<=31)try{const va=(0,f0._U)(`${Fi}-${Eo}-${K0}`);tr(va)}catch{tr(null)}else tr(null)}else tr(null)}tn(!0)},kr=()=>{if(In){const Z0=`${In.year}-${String(In.month).padStart(2,"0")}-${String(In.day).padStart(2,"0")}`;cn(dr.linkId,{value:(0,i.CP)(`${String(In.month).padStart(2,"0")}/${String(In.day).padStart(2,"0")}/${In.year}`)}),Vo(dr,[{valueDate:(0,i.Fy)(Z0)}])}tn(!1),tr(null)},d0=()=>{tn(!1),tr(null)},ao=Z0=>{var A0;const Eo=((A0=ht.current)==null?void 0:A0.selectionStart)||0,K0=An,Fi=jn(Z0),Bo=Fi.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(Bo){const[,Ci,va,Ki]=Bo,Xs=parseInt(Ci,10),Ks=parseInt(va,10),Xi=parseInt(Ki,10);if(E0(Xs,Ks,Xi).isValid){const h1=`${Ki}-${Ci}-${va}`;cn(dr.linkId,{value:(0,i.CP)(`${Ci}/${va}/${Ki}`)}),Vo(dr,[{valueDate:(0,i.Fy)(h1)}])}else Vo(dr,[{valueDate:Fi}])}else Vo(dr,[{valueDate:Fi}]);setTimeout(()=>{if(ht.current){const Ci=K0.replace(/\D/g,""),va=Fi.replace(/\D/g,"");let Ki=Eo;Fi===K0&&(Ki=Eo-1),va.length>=Ci.length&&Fi!==K0?Fi[Eo-1]==="/"?Ki=Eo+1:Ki=Eo:va.length<Ci.length&&(K0[Eo-1]==="/"?Ki=Math.max(0,Eo-1):Ki=Eo),ht.current.setSelectionRange(Ki,Ki)}},0)},E0=(Z0,A0,Eo)=>{if(Z0<1||Z0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(A0<1||A0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const K0=new Date(Eo,Z0,0).getDate();if(A0>K0)return{isValid:!1,error:"Invalid day for the selected month"};if(Vr||S0){const Fi=new Io.ng(Eo,Z0,A0);if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{const Bo=(0,f0._U)(Vr);if(Fi.compare(Bo)<0){const Ci=(0,i.di)(o.Ck,dr.extension);if(Ci)return{isValid:!1,error:Ci};const va=lo(Bo);return{isValid:!1,error:`Date must be on or after ${va}`}}}catch{}if(S0&&/^\d{4}-\d{2}-\d{2}$/.test(S0))try{const Bo=(0,f0._U)(S0);if(Fi.compare(Bo)>0){const Ci=(0,i.di)(o.Cx,dr.extension);if(Ci)return{isValid:!1,error:Ci};const va=lo(Bo);return{isValid:!1,error:`Date must be on or before ${va}`}}}catch{}}return{isValid:!0,error:""}},J0=()=>{const Z0=An.replace(/\D/g,"");if(Z0.length>0&&Z0.length<8){i0(dr.linkId);return}const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!A0&&Z0.length>=6){i0(dr.linkId);return}if(A0){const[,Eo,K0,Fi]=A0,Bo=parseInt(Eo,10),Ci=parseInt(K0,10),va=parseInt(Fi,10);if(E0(Bo,Ci,va).isValid){const Ki=`${Fi}-${Eo}-${K0}`;Vo(dr,[{valueDate:(0,i.Fy)(Ki)}])}}i0(dr.linkId)},j0=(()=>{if(!An)return"";const Z0=An.replace(/\D/g,"");if(Z0.length>0&&Z0.length<8)return"";const A0=An.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!A0&&Z0.length>=6)return Un&&gn(!1),"Invalid date";if(A0){const[,Eo,K0,Fi]=A0,Bo=parseInt(Eo,10),Ci=parseInt(K0,10),va=parseInt(Fi,10),{isValid:Ki,error:Xs}=E0(Bo,Ci,va);if(!Ki)return Un&&gn(!1),Xs||"Invalid date"}return""})(),Po=!!Ir||!!j0;return(0,n.jsxs)("div",{children:[lr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:lr,required:Le||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Fe||ki,className:(0,P.cx)("absolute top-3 right-3.5 z-3 cursor-pointer","outline-focus-ring rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2",(Fe||ki)&&"cursor-not-allowed opacity-50"),onClick:kn,"aria-label":"Open calendar",children:(0,n.jsx)(F.V,{className:"size-5 text-gray-400"})}),(0,n.jsx)("div",{className:(0,P.cx)("pointer-events-none absolute top-[7px] right-[2px] z-2 h-[30px] w-[35px] bg-white",(Fe||ki)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:ht,isRequired:Le,size:"md",type:"text",name:Yn,"data-testid":Yn,id:Yn,value:An,onChange:ao,placeholder:Ii,isDisabled:Fe||ki,onBlur:J0,hint:j0||Ir||Si,isInvalid:Po,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Yn)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:Ht,onOpenChange:Z0=>{Z0||d0()},primaryButton:{children:"Apply",onClick:kr,isDisabled:!In},secondaryButton:{children:"Cancel",onClick:d0},children:(0,n.jsx)(_0.lr,{value:In,onChange:tr,minValue:po,maxValue:ct,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:po,maxValue:ct,onYearPickerOpen:()=>{tr(null)}})})})]})},Ro=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:yr,readOnly:Yn}=dr,Sr=Li?(0,i.nt)(vi,yr,Li):"",Le=yi?.[Si]||"";return(0,n.jsxs)("div",{children:[Sr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Sr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"datetime-local",id:Si,"aria-label":Si,"data-testid":Si,placeholder:"Type your response here...",value:((Ii=Wr?.[0])==null?void 0:Ii.valueDateTime)||"",onChange:Ce=>{let Fe=Ce;const[ht,Ht]=Fe.split("T");ht&&Ht&&(Fe=`${(0,i.Fy)(ht)}T${Ht}:00`),Vo(dr,[{valueDateTime:Fe}])},isDisabled:Yn||ki,onBlur:()=>{i0(dr.linkId)},hint:Le,isInvalid:!!Le},Si)]})},gr=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:yr,required:Yn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(vi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr),Ht=(Li=Wr?.[0])==null?void 0:Li.valueDecimal,[tn,In]=(0,t.useState)(String(Ht??""));return(0,t.useEffect)(()=>{In(String(Ht??""))},[Ht]),(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:Yn||!1}),(0,n.jsx)(r.Input,{isRequired:Yn,size:"md",id:hi,"aria-label":hi,"data-testid":hi,placeholder:Ii,value:tn,onChange:tr=>{In(tr)},isDisabled:Le||ki,onBlur:()=>{const tr=parseFloat(tn);In(isNaN(tr)?"":String(tr)),Vo(dr,[{valueDecimal:isNaN(tr)?void 0:tr}]),i0(dr.linkId)},type:"number",hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},mr=({item:dr,showStepper:i0=!1})=>{var Wr;const{text:Vo,linkId:vi,type:yi}=dr,ki=Vo&&(0,i.nt)(!1,"",Vo),Ii=(Wr=dr.extension)==null?void 0:Wr.find(yr=>yr.url===o.Yt),Si=Ii?.valueBoolean===!0,Li=yi==="group"&&(0,i.$O)(dr)!==void 0,hi=()=>{const yr=(0,i.$O)(dr),Yn=(0,i.t7)(dr);if(yr===void 0||Yn===void 0||Yn<=0)return[];const Sr=[];for(let Le=1;Le<=Yn;Le++){let Ce="incomplete";Le<yr?Ce="complete":Le===yr&&(Ce="current"),Sr.push({title:"",description:"",status:Ce})}return Sr};return ki&&!Si?(0,n.jsxs)("div",{"data-testid":vi,children:[(0,n.jsx)(N,{text:ki,required:!1,className:""}),i0&&Li&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:hi()})})]}):null},vr=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:yr,required:Yn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(vi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Yn||!1}),(0,n.jsx)(r.Input,{isRequired:Yn,"data-testid":hi,size:"md",id:hi,"aria-label":hi,placeholder:Ii,value:String((Li=Wr?.[0])==null?void 0:Li.valueInteger)||"",onChange:Ht=>{Vo(dr,[{valueInteger:Number(Ht)}])},isDisabled:Le||ki,onBlur:()=>{i0(dr.linkId)},type:"number",hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},R0=({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li,hi,yr;const{linkId:Yn,text:Sr,extension:Le,required:Ce,prefix:Fe,readOnly:ht}=dr,Ht=Sr?(0,i.nt)(vi,Fe,Sr):"",tn=Le?.find(gn=>gn.url.includes("questionnaire-unitOption")),In=yi?.[Yn],tr=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ht&&(0,n.jsx)(N,{isLabel:!0,text:Ht,required:Ce||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Ce,size:"md",id:Yn,"aria-label":Yn,"data-testid":Yn,value:(Li=Wr?.[0])!=null&&Li.valueQuantity?String((hi=Wr[0].valueQuantity)==null?void 0:hi.value):"",onChange:gn=>{Vo(dr,[{valueQuantity:{value:parseFloat(gn)}}])},isDisabled:ht||ki,onBlur:()=>{var gn,Un,cn;const lr=(gn=Wr?.[0])!=null&&gn.valueQuantity?parseFloat(String((cn=(Un=Wr?.[0])==null?void 0:Un.valueQuantity)==null?void 0:cn.value)).toFixed(2):"";Vo(dr,[{valueQuantity:{value:parseFloat(lr)}}]),i0(dr.linkId)},hint:In||Si,isInvalid:!!In,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:(yr=tn?.valueCoding)==null?void 0:yr.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Ii,autoComplete:tr})},Yn)]})};var m0=e(61784);const ro="ui-toolkit-modern",Fo={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS",SUBMIT:"SUBMIT"},ko={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},si={[ko.CURRENT_LOCATION]:Fo.CURRENT_LOCATION,[ko.ZIP_CODE]:Fo.ZIP_CODE,[ko.ADDRESS]:Fo.ADDRESS},Di={mi:{singular:Fo.MILE,plural:Fo.MILES}},Pi=({resourceData:dr,handleInputChange:i0,item:Wr,questionnaireSchemaItems:Vo})=>{var vi;const{t:yi}=(0,m0.SS)(),{queryParams:ki}=(0,pt.useSearchQueryParams)(),Ii=ki.locationType||"",{setCurrentGroupIndex:Si,handleContinueButtonClick:Li,setHideFooterButton:hi}=(0,p.c)(),{trackEvent:yr}=(0,s.st)();(0,t.useEffect)(()=>{if(!Wr.readOnly)return hi(!0),()=>{hi(!1)}},[Wr.readOnly,hi]);const Yn=(vi=Wr.extension)==null?void 0:vi.find(Un=>Un.url===o.Uf),Sr=Yn?.valueString,Le=()=>{if(Sr){const Un=(0,i.Ue)(Vo||[],Sr);Un!==-1&&Si(Un)}},Ce=Un=>{const cn=Un.find(lr=>lr.url.includes("description"));return cn?.valueString||""},Fe=Un=>{const cn=Un.find(S0=>S0.url.includes("distance-value")),lr=Un.find(S0=>S0.url.includes("distance-unit")),Ir=cn?.valueString?Number(cn.valueString):NaN,n0=lr?.valueString||"";if(!n0||isNaN(Ir))return null;const O0=Math.round(Ir);let Vr=n0;return Di[n0]&&(Vr=yi(O0===1?Di[n0].singular:Di[n0].plural)),Ii&&si[Ii]?yi(Fo.LOCATION_DISTANCE,{distance:`${O0} ${Vr}`,locationType:yi(si[Ii])}):yi(Fo.LOCATION_DISTANCE_AWAY,{distance:`${O0} ${Vr}`})},ht=Un=>({id:Un.id||"",providerName:Un.name||"",specialty:"",distance:Fe(Un.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:Un.address||"",valueReference:Un.valueReference||{reference:Un.id}}),Ht=Un=>{var cn,lr,Ir,n0;const O0=Un;return ht({id:O0.id,name:(cn=O0.name)!=null?cn:"",address:(n0=(Ir=(lr=O0?.address)==null?void 0:lr.line)==null?void 0:Ir[0])!=null?n0:"",extension:O0?.extension,valueReference:{reference:O0.id}})},tn=Un=>ht({id:Un?.reference,name:Un?.display,address:Ce(Un?.extension||[]),extension:Un?.extension,valueReference:Un}),tr=(()=>dr&&Array.isArray(dr)&&dr.length>0?dr.map(Ht):Wr.initial&&Array.isArray(Wr.initial)&&Wr.initial.length>0?Wr.initial.map(Un=>tn(Un.valueReference)):Wr.answerOption?Wr.answerOption.map(Un=>tn(Un.valueReference)):[])(),gn=Un=>{i0(Wr,[{valueReference:Un}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Wr.readOnly&&"pb-4xl"),children:Wr.readOnly?tr.map(({address:Un,id:cn,providerName:lr,placeholderIcon:Ir,distance:n0})=>(0,n.jsx)(pt.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},locationName:lr,address:Un,distance:n0,actionButtonText:Sr?"Change location":void 0,onActionButtonClick:Sr?Le:void 0},cn)):tr.map(({address:Un,id:cn,providerName:lr,placeholderIcon:Ir,specialty:n0,valueReference:O0,distance:Vr})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},providerName:{content:lr},specialty:{content:n0},location:{address:Un,distance:Vr},actionButton:{children:"Schedule appointment",onClick:()=>{yr("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:Un,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),gn(O0),Li?.()}}},cn))})};var ci=e(79079),wi=e(32066),fi=e(43915),qi=e(36181),Ui=e(37234),Ga=e(59931),Pr=e(65388),er=Object.defineProperty,Yr=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,V0=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable,Er=(dr,i0,Wr)=>i0 in dr?er(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,c0=(dr,i0)=>{for(var Wr in i0||(i0={}))bn.call(i0,Wr)&&Er(dr,Wr,i0[Wr]);if(V0)for(var Wr of V0(i0))Vn.call(i0,Wr)&&Er(dr,Wr,i0[Wr]);return dr},Jn=(dr,i0)=>Yr(dr,Lr(i0));const Xn="tz-code",io={"ui-toolkit/LocationCard":Pi,"ui-toolkit/TimeSlotSelection":({resourceData:dr,item:i0,handleInputChange:Wr,selectedAnswer:Vo,questionnaireSchemaItems:vi,formData:yi,onCompleteHandler:ki})=>{var Ii,Si;const{t:Li}=(0,ci.S)(),{trackEvent:hi}=(0,s.st)(),{isLoading:yr,setIsInlineNextQuestionTriggered:Yn}=(0,p.c)(),Sr=A0=>{const Eo=A0.match(/^(\d{4}-\d{2}-\d{2})/);return Eo?Eo[1]:A0},Le=A0=>{const Eo=A0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return Eo?`${Eo[1]} ${Eo[2]}`:A0},Ce=A0=>{const Eo=A0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(Eo){const[,K0,Fi,Bo]=Eo;return new Date(parseInt(K0),parseInt(Fi)-1,parseInt(Bo))}return new Date},ht=(()=>{var A0;if((A0=Vo?.[0])!=null&&A0.valueReference){const Eo=Vo[0].valueReference,K0=Eo.display||"",Fi=Sr(K0);if(Fi)return{date:Ce(Fi),slotId:Eo.reference||""}}return{date:new Date,slotId:""}})(),[Ht,tn]=(0,t.useState)(ht.date),[In,tr]=(0,t.useState)(ht.slotId),[gn,Un]=(0,t.useState)(new Set),cn=(0,t.useMemo)(()=>new Io.ng(Ht.getFullYear(),Ht.getMonth()+1,Ht.getDate()),[Ht]),lr=A0=>({display:A0.display||"",id:A0.id||"",start:A0.start||"",extension:Array.isArray(A0.extension)?A0.extension:[],identifier:Array.isArray(A0.identifier)?A0.identifier:[],type:A0.type||""}),Ir=A0=>lr({display:A0.start?Le(A0.start):"",id:A0.id,start:A0.start,extension:A0.extension,identifier:A0.identifier}),n0=A0=>lr({display:A0?.display||"",id:A0?.reference,start:A0?.display,extension:A0?.extension,identifier:A0?.identifier,type:A0?.type}),O0=()=>{if(Array.isArray(dr)&&dr.length>0)return dr.filter(A0=>A0.resourceType==="Appointment").map(Ir);if(i0.initial&&Array.isArray(i0.initial)&&i0.initial.length>0)return i0.initial.map(A0=>n0(A0.valueReference));if(i0.answerOption)return i0.answerOption.map(A0=>n0(A0.valueReference))},Vr=(0,t.useMemo)(()=>O0()||[],[dr,Vo,i0]),S0=(0,t.useMemo)(()=>{const A0={};return Vr.forEach(Eo=>{if(Eo.start&&Eo.id){const K0=Sr(Eo.start);A0[K0]||(A0[K0]=[]),A0[K0].push({display:Eo.display,id:Eo.id,start:Eo.start,extension:Eo.extension})}}),A0},[Vr]),po=(0,t.useMemo)(()=>{const A0=Object.keys(S0).sort(),Eo=[];if(A0.length===0)return Eo.push(cn),gn.forEach(Bo=>{const Ci=(0,fi.A)(Bo);Eo.push(new Io.ng(Ci.getFullYear(),Ci.getMonth()+1,Ci.getDate()))}),Eo;const K0=(0,fi.A)(A0[A0.length-1]),Fi=new Io.ng(K0.getFullYear(),K0.getMonth()+1,K0.getDate());for(let Bo=cn;Bo.compare(Fi)<=0;Bo=Bo.add({days:1})){const Ci=`${Bo.year}-${String(Bo.month).padStart(2,"0")}-${String(Bo.day).padStart(2,"0")}`;S0[Ci]||Eo.push(Bo)}if(!(0,i.mR)(i0)){const Bo=(0,wi.Ec)((0,wi.Xj)()).add({days:30});let Ci=Fi.add({days:1});for(;Ci.compare(Bo)<=0;)Eo.push(Ci),Ci=Ci.add({days:1})}return gn.forEach(Bo=>{const Ci=(0,fi.A)(Bo),va=new Io.ng(Ci.getFullYear(),Ci.getMonth()+1,Ci.getDate());Eo.some(Ki=>Ki.year===va.year&&Ki.month===va.month&&Ki.day===va.day)||Eo.push(va)}),Eo},[S0,gn,cn,i0]),ct=(0,t.useMemo)(()=>(0,i.mR)(i0)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[i0]),_t=(0,t.useMemo)(()=>Object.keys(S0).map(A0=>{const Eo=(0,fi.A)(A0);return new Io.ng(Eo.getFullYear(),Eo.getMonth()+1,Eo.getDate())}),[S0]),An=(0,qi.A)((0,Ui.A)(Ht),"yyyy-MM-dd"),jn=(0,t.useMemo)(()=>S0[An]||[],[S0,An]);(0,t.useEffect)(()=>{const A0=Object.entries(S0).sort(([Eo],[K0])=>Eo.localeCompare(K0)).slice(0,3).reduce((Eo,[K0,Fi])=>Jn(c0({},Eo),{[`${K0} ${ao}`]:Fi.map(Bo=>{var Ci;return(0,Pr.YX)({time:Bo.start,timeZone:(0,i.lv)((Ci=jn[0])==null?void 0:Ci.extension)}).time})}),{});hi("slots_returned",{Specialty:"Vaccines",first_three_days_slots:A0,_event_metadata:{description:"The API called for bookable slots based on the user's answers on who, when, where and why they want to book an appointment."}})},[]);const kn=t.useRef(null),kr=t.useRef(null),d0=t.useRef(!1);(0,t.useEffect)(()=>{var A0;const Eo=Object.keys(S0).sort();Eo.length===0||d0.current||(d0.current=!0,(A0=Vo?.[0])!=null&&A0.valueReference||tn((0,fi.A)(Eo[0])))},[S0]),(0,t.useEffect)(()=>{var A0;const Eo=Object.keys(S0).sort();if(Eo.length===0)return;const Fi=!(kn.current===null)&&JSON.stringify(kn.current)!==JSON.stringify(S0);if(kn.current=S0,!!Fi&&(Un(new Set),kr.current)){const Bo=kr.current;if(!(((A0=S0[Bo])==null?void 0:A0.length)>0)){const va=new Set,Ki=(0,fi.A)(Bo),Xs=(0,fi.A)(Eo[0]);let Ks=Ki;for(;Ks<Xs;){const Xi=(0,qi.A)(Ks,"yyyy-MM-dd");va.add(Xi),Ks=new Date(Ks),Ks.setDate(Ks.getDate()+1)}Un(va),tr("")}kr.current=null}},[S0]);const ao=(0,t.useMemo)(()=>{var A0;const Eo=jn[0];if(!Eo?.extension)return"";const K0=Eo.extension.find(Fi=>Fi?.url===Xn);try{return(0,Ga.formatToTimeZone)(new Date,"(z)",{timeZone:(A0=K0?.valueCode)!=null?A0:""})}catch{return""}},[jn]),E0=(0,t.useMemo)(()=>{const A0=Li(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return ao?`${A0} ${ao}`:A0},[Li,ao]),J0=(0,t.useMemo)(()=>{const A0=(0,wi.Ec)((0,wi.Xj)()).add({days:ct}),Eo=`${A0.year}-${String(A0.month).padStart(2,"0")}-${String(A0.day).padStart(2,"0")}`,Fi=Object.keys(S0).sort().find(Bo=>Bo>An&&Bo<=Eo);if(Fi){const Bo=(0,fi.A)(Fi);return new Io.ng(Bo.getFullYear(),Bo.getMonth()+1,Bo.getDate())}return null},[S0,An,ct]),No=()=>{if(J0){const A0=J0.toDate((0,wi.Xj)());tn(A0),tr("")}},j0=A0=>{if(!A0){tr(""),Wr(i0,void 0);return}tr(A0.id);const Eo=[{valueReference:{display:A0.display,reference:A0.id,extension:A0.extension,identifier:A0.identifier,type:A0.type}}];Wr(i0,Eo)},Po=A0=>{var Eo;if(!A0||yr||!d0.current)return;const K0=Object.keys(S0).sort(),Fi=K0[K0.length-1],Bo=K0[0],Ci=`${A0.year}-${String(A0.month).padStart(2,"0")}-${String(A0.day).padStart(2,"0")}`;if(Fi&&(Ci>Fi||Bo&&Ci<Bo)&&(0,i.mR)(i0)&&vi&&!po?.some(Ki=>Ki.compare(A0)===0)){const Ki=(0,i.yQ)(i0,vi);if(Ki){kr.current=Ci;let Xs="-06:00";if((Eo=Vr[0])!=null&&Eo.start){const js=Vr[0].start.match(/([+-]\d{2}:\d{2})$/);js&&(Xs=js[1])}const Xi=[{valueDateTime:`${Ci}T23:59:59${Xs}`}],h1=Wr(Ki,Xi);Wr(i0,void 0,(0,i.Nw)(h1||yi||[],i0.linkId),void 0,!0),Yn(!0),ki(Ki.linkId,!0,!0)}}const va=A0.toDate((0,wi.Xj)());tn(va),tr("")},Z0=A0=>{if(!A0)return;const Eo=jn.find(K0=>K0.id===A0);hi("slot_selected",{Specialty:"Vaccines",time_slot:Eo?(0,Pr.YX)({time:Eo.start,timeZone:(0,i.lv)(jn[0].extension)}).dateWithTime:"",_event_metadata:{description:"A user clicked an option to select a slot or search a different date set if no slots were found."}}),j0(Eo??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Po,disabledDates:po,highlightedDates:_t,loading:yr,minValue:(0,wi.Ec)((0,wi.Xj)()),maxValue:(0,wi.Ec)((0,wi.Xj)()).add({days:ct}),value:cn,defaultValue:cn,appointmentSlots:{title:E0,onChange:Z0,defaultValue:Vo&&((Si=(Ii=Vo[0])==null?void 0:Ii.valueReference)==null?void 0:Si.reference)||void 0,value:In||void 0,items:jn.map(A0=>({label:Se(A0.start),value:A0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Li(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),J0&&(0,n.jsx)("button",{onClick:No,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Li(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var qo=Object.defineProperty,ea=Object.defineProperties,ji=Object.getOwnPropertyDescriptors,ra=Object.getOwnPropertySymbols,zo=Object.prototype.hasOwnProperty,T0=Object.prototype.propertyIsEnumerable,Ua=(dr,i0,Wr)=>i0 in dr?qo(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,ms=(dr,i0)=>{for(var Wr in i0||(i0={}))zo.call(i0,Wr)&&Ua(dr,Wr,i0[Wr]);if(ra)for(var Wr of ra(i0))T0.call(i0,Wr)&&Ua(dr,Wr,i0[Wr]);return dr},zs=(dr,i0)=>ea(dr,ji(i0)),Ts=(dr,i0)=>{var Wr={};for(var Vo in dr)zo.call(dr,Vo)&&i0.indexOf(Vo)<0&&(Wr[Vo]=dr[Vo]);if(dr!=null&&ra)for(var Vo of ra(dr))i0.indexOf(Vo)<0&&T0.call(dr,Vo)&&(Wr[Vo]=dr[Vo]);return Wr};const os=(dr,i0)=>dr.answerOption?dr.answerOption.map(Wr=>{var Vo,vi;const yi=(vi=(Vo=Wr.valueReference)==null?void 0:Vo.reference)==null?void 0:vi.replace("#","");return i0.find(ki=>ki.id===yi)}).filter(Boolean):[],v1=dr=>{var i0,Wr,Vo;const vi=dr.find(yi=>{var ki,Ii;return yi.url.includes("questionnaire-itemControl")&&((Ii=(ki=yi.valueCodeableConcept)==null?void 0:ki.coding)==null?void 0:Ii.some(Si=>{var Li;return(Li=Si.code)==null?void 0:Li.startsWith("ui-toolkit/")}))});return(Vo=(Wr=(i0=vi?.valueCodeableConcept)==null?void 0:i0.coding)==null?void 0:Wr.find(yi=>{var ki;return(ki=yi.code)==null?void 0:ki.startsWith("ui-toolkit/")}))==null?void 0:Vo.code},Gn=dr=>{var{uiToolkitCode:i0,props:Wr}=dr,Vo=Wr,{item:vi,contained:yi=[],customErrorConfigurations:ki}=Vo,Ii=Ts(Vo,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:Si}=(0,p.c)(),Li=io[i0];if(!Li)return(0,n.jsx)(n.Fragment,{});const hi=os(vi,yi),yr=hi.length>0;return!(vi.answerOption&&vi.answerOption.length>0)&&!yr&&!vi.readOnly?(Si(!0),(0,n.jsx)(xe,{configKey:i0,customErrorConfigurations:ki})):(0,n.jsx)(Li,zs(ms({},Ii),{item:vi,contained:yi,customErrorConfigurations:ki,resourceData:hi,"data-testid":vi.linkId}))},B0={attachment:nn,choice:Zr,boolean:fn,integer:vr,string:({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:yr,required:Yn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(vi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Yn||!1}),(0,n.jsx)(r.Input,{isRequired:Yn,size:"md","aria-label":hi,"data-testid":hi,id:hi,type:ht==="tel"?"tel":"text",placeholder:Ii,value:((Li=Wr?.[0])==null?void 0:Li.valueString)||"",onChange:Ht=>{Vo(dr,[{valueString:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,In=tn.trim();In!==tn&&Vo(dr,[{valueString:In}]),i0(dr.linkId)},hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},url:({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:yr,required:Yn,prefix:Sr,readOnly:Le}=dr,Ce=yr?(0,i.nt)(vi,Sr,yr):"",Fe=yi?.[hi]||"",ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Yn||!1}),(0,n.jsx)(r.Input,{isRequired:Yn,size:"md",type:"url",id:hi,"data-testid":hi,"aria-label":hi,placeholder:Ii,value:((Li=Wr?.[0])==null?void 0:Li.valueUri)||"",onChange:Ht=>{Vo(dr,[{valueUri:Ht}])},isDisabled:Le||ki,onBlur:Ht=>{const tn=Ht.target.value,In=tn.trim();In!==tn&&Vo(dr,[{valueUri:In}]),i0(dr.linkId)},hint:Fe||Si,isInvalid:!!Fe,autoComplete:ht},hi)]})},text:({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki,placeholder:Ii,hintText:Si})=>{var Li;const{linkId:hi,text:yr,required:Yn,prefix:Sr,readOnly:Le,maxLength:Ce}=dr,Fe=yr?(0,i.nt)(vi,Sr,yr):"",ht=yi?.[hi]||"",Ht=(0,i.a0)(dr);return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Yn||!1}),(0,n.jsx)(r.TextArea,{isRequired:Yn,id:hi,"aria-label":hi,"data-testid":hi,rows:3,placeholder:Ii,value:((Li=Wr?.[0])==null?void 0:Li.valueString)||"",onChange:tn=>{Vo(dr,[{valueString:tn}])},isDisabled:Le||ki,onBlur:tn=>{const In=tn.target.value,tr=In.trim();tr!==In&&Vo(dr,[{valueString:tr}]),i0(dr.linkId)},hint:ht||Si,counter:!0,isInvalid:!!ht,maxLength:Ce,autoComplete:Ht},hi)]})},date:G0,time:({item:dr,onCompleteHandler:i0,selectedAnswer:Wr,handleInputChange:Vo,showQuestionPrefix:vi,errors:yi,isLoading:ki})=>{var Ii;const{linkId:Si,text:Li,required:hi,prefix:yr,readOnly:Yn}=dr,Sr=Li?(0,i.nt)(vi,yr,Li):"",Le=yi?.[Si]||"";return(0,n.jsxs)("div",{children:[Sr&&(0,n.jsx)(N,{isLabel:!0,text:Sr,required:hi||!1}),(0,n.jsx)(r.Input,{isRequired:hi,size:"md",type:"time",id:Si,"data-testid":Si,"aria-label":Si,placeholder:"Type your response here...",value:((Ii=Wr?.[0])==null?void 0:Ii.valueTime)||"",onChange:Ce=>{Vo(dr,[{valueTime:Ce}])},isDisabled:Yn||ki,onBlur:()=>{i0(dr.linkId)},hint:Le,isInvalid:!!Le},Si)]})},dateTime:Ro,quantity:R0,decimal:gr,question:mr,display:mr,group:mr,reference:dr=>{var i0,Wr,Vo,vi,yi;const{setHideFooterButton:ki}=(0,p.c)(),{item:Ii,customErrorConfigurations:Si}=dr,Li=Ii.extension||[],hi=v1(Li);return hi?(0,n.jsx)(Gn,{uiToolkitCode:hi,props:dr}):((yi=(vi=(Vo=(Wr=(i0=Ii?.extension)==null?void 0:i0.find(Yn=>Yn.url.includes("questionnaire-itemControl")))==null?void 0:Wr.valueCodeableConcept)==null?void 0:Vo.coding)==null?void 0:vi[0])==null?void 0:yi.code)==="check-box"?Ii.answerOption&&Ii.answerOption.length>0?(0,n.jsx)(Zr,zs(ms({},dr),{item:Ii})):(ki(!0),(0,n.jsx)(xe,{configKey:Ii.linkId,customErrorConfigurations:Si})):null}};var Wt=(dr,i0,Wr)=>new Promise((Vo,vi)=>{var yi=Si=>{try{Ii(Wr.next(Si))}catch(Li){vi(Li)}},ki=Si=>{try{Ii(Wr.throw(Si))}catch(Li){vi(Li)}},Ii=Si=>Si.done?Vo(Si.value):Promise.resolve(Si.value).then(yi,ki);Ii((Wr=Wr.apply(dr,i0)).next())});const Ke=({item:dr,selectedAnswer:i0,showQuestionPrefix:Wr})=>{const{text:Vo,prefix:vi,required:yi}=dr,ki=Vo?getUpdatedQuestionText(Wr,vi,Vo):"",[Ii,Si]=useState(null),[Li,hi]=useState(!1),{documentDownload:yr,webview:Yn}=useNativeBridge(),Sr=(i0||[]).filter(ht=>{var Ht,tn;return((Ht=ht.valueAttachment)==null?void 0:Ht.data)&&((tn=ht.valueAttachment)==null?void 0:tn.title)}).map((ht,Ht)=>{var tn,In,tr,gn,Un,cn,lr;return{id:((tn=ht.valueAttachment)==null?void 0:tn.id)||`preview-${Ht}`,fileName:((In=ht.valueAttachment)==null?void 0:In.title)||`attachment-${Ht}`,contentType:((tr=ht.valueAttachment)==null?void 0:tr.contentType)||"application/octet-stream",base64Data:((gn=ht.valueAttachment)==null?void 0:gn.data)||"",size:getBase64Size(((Un=ht.valueAttachment)==null?void 0:Un.data)||"",(cn=ht.valueAttachment)==null?void 0:cn.contentType),type:getFileTypeFromMimeType((lr=ht.valueAttachment)==null?void 0:lr.contentType)}}),Le=useCallback(ht=>{const{fileName:Ht,contentType:tn,base64Data:In}=ht;if(Yn.isWithin)Si({fileName:Ht,contentType:tn,base64Data:In}),hi(!0);else{const tr=base64toObjectUrl(In,tn),gn=document.createElement("a");gn.href=tr,gn.download=Ht,document.body.appendChild(gn),gn.click(),document.body.removeChild(gn),URL.revokeObjectURL(tr)}},[Yn.isWithin]),Ce=useCallback(()=>Wt(void 0,null,function*(){!Ii||(yield yr.writeFile(Ii.fileName,prepareDataUrl(Ii.base64Data,Ii.contentType)))}),[Ii,yr]),Fe=useCallback(()=>{hi(!1),Si(null)},[]);return Sr.length?jsxs("div",{children:[ki&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:ki,required:yi||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:Sr.map(ht=>jsx("button",{type:"button",onClick:()=>Le(ht),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(ht.fileName),size:ht.size,type:ht.type})},ht.id))}),jsx(DownloadDisclosureModal,{opened:Li,onClose:Fe,onDownload:Ce,contentType:Ii?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var ut=Object.defineProperty,Nt=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,x0=Object.prototype.propertyIsEnumerable,X0=(dr,i0,Wr)=>i0 in dr?ut(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,q0=(dr,i0)=>{for(var Wr in i0||(i0={}))xr.call(i0,Wr)&&X0(dr,Wr,i0[Wr]);if(ar)for(var Wr of ar(i0))x0.call(i0,Wr)&&X0(dr,Wr,i0[Wr]);return dr},Jo=(dr,i0)=>Nt(dr,Dn(i0));const Xo=(dr,i0,Wr,Vo)=>{var vi;const yi=dr.extension||[];if(Vo?.[BUTTON_TYPE_EXTERNAL_KEY]&&yi.some(hi=>hi.url===BUTTON_TYPE_EXTENSION_URL))return Vo[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(dr)||hasParentWithUIToolkitWidget(dr,i0))return null;if(Wr&&dr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const ki=getUIToolkitCode(yi),Ii=yi.filter(hi=>hi.url.includes("questionnaire-itemControl")).flatMap(hi=>{var yr,Yn;return(Yn=(yr=hi.valueCodeableConcept)==null?void 0:yr.coding)!=null?Yn:[]})||[];let Si;return Vo&&(Si=(vi=Ii.find(hi=>hi.code&&Vo[hi.code]))==null?void 0:vi.code),(Si&&Vo?Vo[Si]:void 0)||UI_TOOLKIT_WIDGET_MAP[ki||""]||typeToRenderFunctionMap[dr.type]||null},li=dr=>{var i0;const{item:Wr,selectedAnswer:Vo,handleInputChange:vi,showQuestionPrefix:yi,errors:ki,questionnaireSchemaItems:Ii,formData:Si,isNestedRepeatedItem:Li=!1}=dr,{linkId:hi,text:yr,prefix:Yn,required:Sr,repeats:Le}=Wr,Ce=getMaxOccursFromExtensions(Wr.extension),Fe=getPlaceholderFromExtensions(Wr.extension,Wr.type),[ht,Ht]=useState(()=>{if(Wr.type==="group"&&Wr.item&&Wr.item.length>0){const Vr=Si?.filter(S0=>S0.linkId===Wr.linkId)||[];if(Vr.length>0)return Vr.map((S0,po)=>po)}else if(Vo&&Vo.length>0)return Vo.map((Vr,S0)=>S0);return[0]}),tn=Ce!==void 0&&ht.length>=Ce,In=yr?getUpdatedQuestionText(yi,Yn,yr):"",tr=()=>{const Vr=Math.max(...ht,-1)+1,S0=[...ht,Vr];if(Ht(S0),Wr.type==="group"&&Wr.item&&Wr.item.length>0){const po=Wr.item.map(_t=>({linkId:_t.linkId,text:_t.text,answer:[{}]})),ct={linkId:Wr.linkId,text:Wr.text,answer:[{}],item:po};vi(Wr,void 0,[ct])}else{const po=[...Vo||[]];po.push({}),vi(Wr,po)}},gn=Vr=>{if(ht.length<=1)return;const S0=ht.filter((po,ct)=>ct!==ht.length-1);if(Ht(S0),Wr.type==="group"&&Wr.item&&Wr.item.length>0){const po=[];if(Si?.forEach((ct,_t)=>{ct.linkId===hi&&po.push({item:ct,originalIndex:_t})}),Vr>=0&&Vr<po.length){const ct=po[Vr],_t=Si?.filter((An,jn)=>jn!==ct.originalIndex);vi(Wr,void 0,_t,void 0,!0)}}else{const po=Vo?.filter((ct,_t)=>_t!==Vr)||[];vi(Wr,po.length>0?po:[{}])}},Un=Vr=>{if(!Si||!Wr.item)return[];const S0=_t=>{const An=[];for(const jn of _t)if(jn.linkId===Wr.linkId&&An.push(jn),jn.item&&jn.item.length>0){const kn=S0(jn.item);An.push(...kn)}return An},ct=S0(Si)[Vr];return ct?.item?ct.item:[]},cn=(Vr,S0)=>{if(isHiddenExtensionPresent(Vr))return null;const po=Un(S0);if(!isQuestionEnabledForInstance(Vr.enableWhen,Vr.enableBehavior,Si||[],Wr.linkId,S0))return null;if(Vr.repeats){const kn=findNestedAnswer(po,Vr.linkId),kr=Jo(q0({},dr),{item:Vr,selectedAnswer:kn||[{}],errors:getInstanceErrors(ki,Wr,S0),handleInputChange:(d0,ao,E0)=>vi(d0,ao,E0,S0)});return jsx("div",{children:jsx(li,Jo(q0({},kr),{isNestedRepeatedItem:!0}))},Vr.linkId)}if(Vr.type==="group"&&Vr.item&&!getUIToolkitCode(Vr?.extension||[]))return jsxs("div",{children:[Vr.text&&jsx("h5",{className:"mb-3 text-base font-medium text-gray-800",children:Vr.text}),jsx("div",{className:"space-y-3",children:Vr.item.map(kn=>{if(!isQuestionEnabledForInstance(kn.enableWhen,kn.enableBehavior,Si||[],Wr.linkId,S0))return null;const d0=Xo(kn,Ii,dr.isLoading,dr.externalComponentRenderMap);if(!d0)return null;const ao=findNestedAnswer(po,kn.linkId),E0=Jo(q0({},dr),{item:kn,selectedAnswer:ao,placeholder:getPlaceholderFromExtensions(kn.extension,kn.type),errors:getInstanceErrors(ki,Wr,S0),handleInputChange:(J0,No,j0)=>vi(J0,No,j0,S0)});return createElement(d0,Jo(q0({},E0),{key:kn.linkId}))})})]},Vr.linkId);const _t=Xo(Vr,Ii,dr.isLoading,dr.externalComponentRenderMap);if(!_t)return null;const An=findNestedAnswer(po,Vr.linkId),jn=Jo(q0({},dr),{item:Vr,selectedAnswer:An,placeholder:getPlaceholderFromExtensions(Vr.extension,Vr.type),errors:getInstanceErrors(ki,Wr,S0),handleInputChange:(kn,kr,d0)=>vi(kn,kr,d0,S0)});return createElement(_t,Jo(q0({},jn),{key:`${Vr.linkId}-${S0}`}))},lr=()=>{const Vr=getDirectErrors(ki,hi);return jsxs("div",{className:"flex flex-col gap-2",children:[Vr[hi]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Vr[hi]}),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:tr,className:"mt-4 text-center",isDisabled:dr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Ir=Vr=>ht.length>1&&jsx(Button,{color:"tertiary-destructive",onClick:()=>gn(Vr),className:"text-error-primary hover:text-error-primary-hover","aria-label":`Remove Item ${Vr+1}`,iconLeading:jsx(Trash02,{className:"h-4 w-4"}),isDisabled:dr.isLoading}),n0=Xo(Wr,Ii,dr.isLoading,dr.externalComponentRenderMap);return hasRepeatingParent(Wr,Ii)&&!Li?null:!Le||Le&&hasCheckboxExtension(Wr)?n0?jsx(n0,Jo(q0({},dr),{placeholder:Fe,errors:{[Wr.linkId]:((i0=ki?.[Wr.linkId])==null?void 0:i0[0])||""}})):null:Wr.type==="group"&&Wr.item&&Wr.item.length>0&&Wr.repeats?jsxs("div",{"data-testid":`${hi}-repeating`,children:[In&&jsx(FHIRQuestionnaireQuestionText,{text:In,required:Sr||!1}),ht.map(Vr=>{var S0;return jsxs("div",{className:"relative mb-4",children:[jsxs("div",{className:`mb-4 flex items-center justify-between ${Vr>0?"mt-8":""}`,children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Vr+1]}),Ir(Vr)]}),jsx("div",{className:"space-y-4",children:(S0=Wr.item)==null?void 0:S0.map(po=>cn(po,Vr))})]},`${hi}-instance-${Vr}`)}),lr()]}):n0?jsxs("div",{"data-testid":`${hi}-repeating`,children:[ht.map(Vr=>{const S0=Vo?.[Vr]?[Vo[Vr]]:void 0,po=Jo(q0({},dr),{item:Wr,selectedAnswer:S0,errors:getInstanceErrors(ki,Wr,Vr),handleInputChange:(ct,_t,An)=>vi(ct,_t,An,Vr)});return jsxs("div",{className:"relative mb-2",children:[jsxs("div",{className:"flex items-end justify-between",children:[jsxs("p",{className:"mb-2 text-sm font-bold",children:["Item ",Vr+1]}),Ir(Vr)]}),jsx(n0,q0({},po))]},`${hi}-instance-${Vr}`)}),jsxs("div",{children:[(()=>{const S0=getDirectErrors(ki,hi)[hi];return S0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:S0})})(),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:tr,className:"mt-4 text-center",isDisabled:dr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var Wi=Object.defineProperty,ga=Object.defineProperties,na=Object.getOwnPropertyDescriptors,pa=Object.getOwnPropertySymbols,Ka=Object.prototype.hasOwnProperty,$s=Object.prototype.propertyIsEnumerable,Za=(dr,i0,Wr)=>i0 in dr?Wi(dr,i0,{enumerable:!0,configurable:!0,writable:!0,value:Wr}):dr[i0]=Wr,cs=(dr,i0)=>{for(var Wr in i0||(i0={}))Ka.call(i0,Wr)&&Za(dr,Wr,i0[Wr]);if(pa)for(var Wr of pa(i0))$s.call(i0,Wr)&&Za(dr,Wr,i0[Wr]);return dr},ws=(dr,i0)=>ga(dr,na(i0));const Qa=null,Ws=({formId:dr,questionnaireSchema:i0,questionnaireResponseItem:Wr,errorConfig:Vo,customErrorConfigurations:vi,showQuestionPrefix:yi=!0,isAdaptiveFlow:ki=!1,status:Ii,hideBackButton:Si=!1,showStepper:Li=!1,onComplete:hi,onClearError:yr,handleHiddenQuestion:Yn,onGoBack:Sr,onFormDataChange:Le=()=>{},externalComponentRenderMap:Ce,children:Fe})=>{var ht,Ht;const{setHandleContinueButtonClick:tn,setHandleBackButtonClick:In,setIsCurrentFormValid:tr,setCurrentGroupLinkId:gn,setCurrentGroupIndex:Un,setTotalSteps:cn,setHideFooterButton:lr,setIsInlineNextQuestionTriggered:Ir,isCurrentFormValid:n0,currentGroupIndex:O0,isLoading:Vr,hasCustomError:S0,groupItemIndicesRef:po}=useFHIRQuestionnaire(),{trackEvent:ct}=useAnalytics(),[_t,An]=useState([]),[jn,kn]=useState(new Set),[kr,d0]=useState([]),[ao,E0]=useState([]),J0=po,No=useRef(new Map),j0=useRef(new Set),[Po,Z0]=useState({}),[A0,Eo]=useState(!1),[K0,Fi]=useState(i0),Bo=useRef(Wr||[]),Ci=useRef(!1),va=useRef(!1),Ki=useMemo(()=>getTotalStepsFromQuestionnaire(i0),[i0]),[Xs,Ks]=useState(!1),Xi=useRef([]),h1=(jo,ii)=>{var Ko,Bi,Na,Ra,Ja;if(isCallNextQuestionExtensionPresent(jo))return jo.linkId;const Ia=validateCurrentPage(ii,_t,O0,K0,J0),es=J0.current[O0],Z1=O0+1,R1=J0.current[Z1],ul=O0===0?0:es,Ll=(Bi=R1??((Ko=K0?.item)==null?void 0:Ko.length))!=null?Bi:0;let pl=-1;for(let Fn=ul;Fn<Ll;Fn++){const xi=(Na=K0?.item)==null?void 0:Na[Fn];if(xi?.linkId===jo.linkId){pl=Fn;break}}const eu=(Fn,xi=[])=>(Fn.forEach(Ri=>{var qa;if((!Ri.enableWhen||isQuestionEnabled(Ri.enableWhen,Ri.enableBehavior,ii))&&isCallNextQuestionExtensionPresent(Ri)&&!Xi.current.includes(Ri.linkId))if(Ri.required){const M1=(qa=findResponseItem(ii,Ri.linkId))==null?void 0:qa.answer;(M1&&M1.length>0&&Object.keys(M1[0]).length>0||Ri.initial&&Ri.initial.length>0&&!jn.has(Ri.linkId))&&xi.push(Ri.linkId)}else xi.push(Ri.linkId);Ri.item&&Ri.item.length>0&&eu(Ri.item,xi)}),xi),Au=[],Ao=pl!==-1?pl+1:Ll;for(let Fn=ul;Fn<Ao;Fn++){const xi=(Ra=K0?.item)==null?void 0:Ra[Fn];xi&&eu([xi],Au)}if(Au.length>0&&Ia){const Fn=Au[Au.length-1],xi=M1=>M1.flatMap(w1=>[w1,...w1.item?xi(w1.item):[]]),Ri=xi((Ja=K0?.item)!=null?Ja:[]),qa=Ri.findIndex(M1=>M1.linkId===Fn),wa=Ri.findIndex(M1=>M1.linkId===jo.linkId);return qa!==-1&&wa>qa?void 0:Fn}},js=jo=>h1(jo,Bo.current)?!0:jo.item&&jo.item.length>0?jo.item.some(js):!1,gs=()=>{var jo;if(!ki||O0<0||!K0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const ii=J0.current[O0],Bi=(No.current.get(ii)||[ii]).some(Ja=>{var Ia;const es=(Ia=K0.item)==null?void 0:Ia[Ja];return es?js(es):!1}),Na=O0<J0.current.length-1;let Ra=!1;if(Bi&&Na){const Ja=O0+1,Ia=J0.current[Ja],es=(jo=K0?.item)==null?void 0:jo[Ia],Z1=!es?.enableWhen||isQuestionEnabled(es.enableWhen,es.enableBehavior,Bo.current),R1=es?isPageExtensionPresent(es):!1;Ra=Z1&&R1}return{shouldTriggerInlineLoading:Bi,canNavigateToNextGroup:Ra,hasMoreGroups:Na}},N1=(jo,ii,Ko,Bi)=>{const Na=getUpdatedFormData(K0?.item||[],Bo.current,jo,ii,Ko,Bi);return Bo.current=Na,Le(Na),Na},br=(jo,ii,Ko,Bi,Na)=>{N1(ii,Ko,Bi,Na),Bi.forEach(Ra=>{const Ja=getValidationError(ws(cs({},jo),{linkId:Ra.linkId}),Bo.current,Ra.answer);Ja&&Z0(Ia=>ws(cs({},Ia),{[Ra.linkId]:typeof Na=="number"?ws(cs({},Ia[Ra.linkId]),{[Na]:Ja}):Ja}))})},Qn=(jo,ii,Ko,Bi,Na)=>{var Ra;const Ja=N1(ii,Ko,Bi,Na),Ia=(Ra=findResponseItem(Ja,ii))==null?void 0:Ra.answer,es=getValidationError(jo,Bo.current,Ia);Z0(Z1=>ws(cs({},Z1),{[ii]:typeof Na=="number"?ws(cs({},Z1[ii]),{[Na]:es}):es}))},Rr=(jo,ii)=>{const Ko=validateCurrentPage(ii,_t,O0,K0,J0);if(tr(Ko),K0?.item){const Bi=validateAllItemsRecursively(K0.item,ii);if(Object.keys(Bi).length>0)Z0(Na=>cs(cs({},Na),Bi));else{const Na=K0.item,Ra={},Ja=Ia=>{Ia.forEach(es=>{Ra[es.linkId]={},es.item&&Ja(es.item)})};Ja(Na),Z0(Ia=>cs(cs({},Ia),Ra))}}},cr=(jo,ii,Ko,Bi,Na=!1)=>{var Ra;const{linkId:Ja}=jo;if(Na)return Bo.current=Ko||[],Rr(Ja,Ko||[]),Bo.current;if(Ko&&Ko.length>0&&jo.type==="group"&&jo.repeats){let R1=Bo.current.length;for(let Ll=Bo.current.length-1;Ll>=0;Ll--)if(Bo.current[Ll].linkId===Ja){R1=Ll+1;break}const ul=[...Bo.current.slice(0,R1),...Ko,...Bo.current.slice(R1)];return Bo.current=ul,Rr(Ja,ul),Bo.current}if(typeof Bi=="number"&&ii){const R1=hasRepeatingParent(jo,K0?.item||[]);if(R1){const ul=Bo.current.filter(pl=>pl.linkId===R1.linkId);if(Bi<ul.length){const pl=Bo.current.map(eu=>{if(eu.linkId===R1.linkId&&Bo.current.slice(0,Bo.current.indexOf(eu)).filter(Ao=>Ao.linkId===R1.linkId).length===Bi){const Ao=(Ri,qa)=>{const wa=new Map(Ri.map(w1=>[w1.linkId,w1])),M1=[];return qa?.forEach(w1=>{const Ol=wa.get(w1.linkId);if(w1.linkId===Ja)M1.push(cs({linkId:w1.linkId,text:w1.text,answer:ii},Ol?.item&&{item:Ol.item}));else if(Ol)if(w1.item&&w1.item.length>0){const b1=Ao(Ol.item||[],w1.item);M1.push(ws(cs({},Ol),{item:b1}))}else M1.push(Ol);else if(w1.item&&w1.item.length>0){const b1=Ao([],w1.item);b1.some(c1=>c1.linkId===Ja||c1.item&&Fn(c1.item,Ja))&&M1.push({linkId:w1.linkId,text:w1.text,answer:[{}],item:b1})}wa.delete(w1.linkId)}),wa.forEach(w1=>{M1.push(w1)}),M1},Fn=(Ri,qa)=>Ri.some(wa=>wa.linkId===qa||wa.item&&Fn(wa.item,qa)),xi=Ao(eu.item||[],R1.item);return ws(cs({},eu),{item:xi})}return eu});Bo.current=pl,Le(pl)}else{const pl=Bi+1,eu=ul.length;if(eu<pl||pl===1){const Au=[],Ao=(Ri,qa,wa)=>Ri.map(M1=>{const w1={linkId:M1.linkId,text:M1.text,answer:M1.linkId===qa?wa:[{}]};return M1.item&&M1.item.length>0&&(w1.item=Ao(M1.item,qa,wa)),w1});for(let Ri=eu;Ri<pl;Ri++){const qa=R1.item?Ao(R1.item,Ja,ii):[],wa={linkId:R1.linkId,text:R1.text,answer:[{}],item:qa};Au.push(wa)}let Fn=Bo.current.length;for(let Ri=Bo.current.length-1;Ri>=0;Ri--)if(Bo.current[Ri].linkId===R1.linkId){Fn=Ri+1;break}const xi=[...Bo.current.slice(0,Fn),...Au,...Bo.current.slice(Fn)];Bo.current=xi,Le(xi)}}const Ll=getValidationError(jo,Bo.current,ii);return Z0(pl=>ws(cs({},pl),{[Ja]:typeof Bi=="number"?ws(cs({},pl[Ja]),{[Bi]:Ll}):Ll})),Rr(Ja,Bo.current),Bo.current}}if(typeof Bi=="number")return Ko&&Ko.length>0?br(jo,Ja,ii,Ko,Bi):Qn(jo,Ja,ii,Ko,Bi),Bo.current;const Ia=N1(Ja,ii,Ko),es=(Ra=findResponseItem(Ia,Ja))==null?void 0:Ra.answer,Z1=getValidationError(jo,Ia,es);return Z0(R1=>ws(cs({},R1),{[Ja]:typeof Bi=="number"?ws(cs({},R1[Ja]),{[Bi]:Z1}):Z1})),Rr(Ja,Ia),Bo.current},Hr=()=>{var jo;for(let ii=O0+1;ii<J0.current.length;ii++){const Ko=J0.current[ii],Bi=(jo=K0?.item)==null?void 0:jo[Ko];if(!!Bi&&(!Bi.enableWhen||isQuestionEnabled(Bi.enableWhen,Bi.enableBehavior,Bo.current)))return!0}return!1},$0=()=>{var jo,ii,Ko,Bi,Na;const Ra=(jo=i0?.item)==null?void 0:jo[J0.current[O0]];if(Ra){const es=(ii=getAnalyticsEventName(Ra))!=null?ii:"questionnaire_form",Z1=getAnalyticsPageName(Ra);if(Z1){const R1=(Ko=getAnalyticsFormName(i0))!=null?Ko:i0.name,ul=collectAnalyticsProperties(Ra,Bo.current),Ll={};R1&&(Ll.form_name=R1),Ll.page_name=Z1,Object.assign(Ll,ul),ct(es,Ll)}}const Ja=O0<J0.current.length-1,Ia=checkCurrentStepDataMatch(Bo.current,K0,J0.current,O0,Wr,J0.current.length-1);if(ki&&Ja){const es=O0+1,Z1=J0.current[es],R1=(Bi=K0?.item)==null?void 0:Bi[Z1],ul=!R1?.enableWhen||isQuestionEnabled(R1.enableWhen,R1.enableBehavior,Bo.current),Ll=R1?isPageExtensionPresent(R1):!1;if(ul&&Ll&&Ia){Un(es),tr(!1),window.scrollTo(0,0);return}}if(Ia&&J0.current.length>0){Hr()?Un(O0+1):(hi(removeDisabledItems(Bo.current,K0?.item||[])),tr(!1),window.scrollTo(0,0));return}if(O0<J0.current.length-1){const es=(Na=K0?.item)==null?void 0:Na[J0.current[O0]];if(!es){hi(removeDisabledItems(Bo.current,K0?.item||[]));return}const Z1=es.linkId,R1=findLastGroupInstanceIndex(Bo.current,Z1),ul=Bo.current.slice(0,R1+1);if(!validateCurrentPage(ul,_t,O0,K0,J0))return;ki?(Bo.current=ul,Le(ul),hi(Bo.current),tr(!1)):J0.current.length>0&&(Hr()?Un(O0+1):(hi(removeDisabledItems(Bo.current,K0?.item||[])),window.scrollTo(0,0)))}else hi(removeDisabledItems(Bo.current,K0?.item||[])),tr(!1),window.scrollTo(0,0)};useEffect(()=>{var jo;tn(()=>$0),In(()=>Ai),tr(n0);const ii=(jo=K0?.item)==null?void 0:jo[J0.current[O0]];ii&&gn(ii.linkId)},[n0,O0]),useEffect(()=>{if(!i0?.item)return;const{groupIndices:jo,itemsToRenderMap:ii}=collectGroupItemIndices(i0.item);J0.current=jo,No.current=ii;const Ko=Ki??jo.length;cn(Ko),d0(jo),ki?(va.current||Un(jo.length>0?jo.length-1:0),Ir(!1),va.current=!1):O0===-1&&Un(0)},[i0?.item,Ki]),useEffect(()=>{if(O0<0||!K0?.item)return;const jo=validateCurrentPage(Bo.current,_t,O0,K0,J0);if(!jo){tr(!1);return}const{shouldTriggerInlineLoading:ii,canNavigateToNextGroup:Ko,hasMoreGroups:Bi}=gs();if(ki&&ii){if(!Bi){tr(!1);return}if(Ko&&jo){tr(!0);return}else{tr(!1);return}}tr(jo)},[O0,K0?.item,S0,ki,Bo.current,_t]),useEffect(()=>{if(!i0?.item||Ci.current)return;const jo=initializeQuestionnaireItems(i0.item,Bo.current,i0.item,Bo.current);if(jo!==Bo.current){Bo.current=jo;const Ko=(Na=>{const Ra=new Set,Ja=Ia=>{Ia.forEach(es=>{var Z1;const R1=es.initial&&es.initial.length>0,ul=(es.type==="choice"||es.type==="open-choice")&&((Z1=es.answerOption)==null?void 0:Z1.some(Ll=>Ll.initialSelected===!0));(R1||ul)&&(!es.enableWhen||isQuestionEnabled(es.enableWhen,es.enableBehavior,Bo.current))&&Ra.add(es.linkId),es.item&&Ja(es.item)})};return Ja(Na),Ra})(K0?.item||[]);kn(Ko);const Bi=validateAllItemsRecursively(K0?.item||[],Bo.current);Object.keys(Bi).length>0&&Z0(Na=>cs(cs({},Na),Bi))}Ci.current=!0},[K0?.item,i0]),useEffect(()=>{Fi(i0)},[i0]),useEffect(()=>{O0>=0&&window.scrollTo(0,0)},[O0]),useEffect(()=>{var jo;if(!ki||_t.length===0||Vr||!K0?.item)return;const ii=J0.current[O0];if(ii===void 0)return;const Ko=No.current.get(ii)||[ii],Bi=[];if(Ko.forEach(es=>{var Z1;const R1=(Z1=K0?.item)==null?void 0:Z1[es];R1&&hasInitialValue(R1)&&Bi.push(R1)}),Bi.length===0||!Bi.some(es=>h1(es,Bo.current)&&!Xi.current.includes(es.linkId)?(Xi.current.push(es.linkId),!0):!1))return;const Ra=validateCurrentPage(Bo.current,_t,O0,K0,J0),Ja=(jo=K0?.item)==null?void 0:jo[ii],Ia=isHiddenAnswerInValid(Ja,Bo.current);!Ra||Ia||(j0.current.add(O0),Ir(!0),va.current=!0,Y0(Bi[Bi.length-1].linkId))},[O0,_t,ki,Vr,K0]);const Y0=(jo,ii=!1,Ko=!1)=>{var Bi;if(ii){hi(removeDisabledItems(Bo.current,K0?.item||[]),Ko),tr(!1);return}const Na=findQuestionByLinkId(K0?.item||[],jo);if(!Na)return;const Ra=(Bi=findResponseItem(Bo.current,jo))==null?void 0:Bi.answer;if(getValidationError(Na,Bo.current,Ra))return;const Ja=getUpdatedFormData(K0?.item||[],Bo.current,jo,Ra),Ia=h1(Na,Ja);if(!Ia)return;tr(!1);const es=findRootGroupLinkId(K0?.item||[],jo);let Z1=Ja,R1=[];const ul=deepTrimFormData(Ja,Ia,K0?.item||[]);Z1=ul.trimmedData,R1=ul.trimmedLinkIds;const Ll=findQuestionByLinkId(K0?.item||[],es||"");Bo.current=Z1;const pl=findGroupPositionByLinkId(K0?.item||[],jo||""),eu=pl!==-1?pl:O0;if(validateCurrentPage(Z1,_t,eu,K0,J0,R1)&&!isHiddenAnswerInValid(Ll,Z1)){Ir(!0),va.current=!0;let Ao;const Fn=(()=>{var qa;const wa=t1=>t1.flatMap(c1=>[c1,...c1.item?wa(c1.item):[]]),M1=wa((qa=K0?.item)!=null?qa:[]),w1=M1.findIndex(t1=>t1.linkId===Ia),Ol=new Set;let b1=!0;for(;b1;){b1=!1;for(const t1 of M1){if(Ol.has(t1.linkId)||!t1.enableWhen)continue;t1.enableWhen.some(Y1=>{const Bl=M1.findIndex(Fl=>Fl.linkId===Y1.question);return Bl!==-1&&Bl<=w1||Ol.has(Y1.question)})&&(Ol.add(t1.linkId),b1=!0)}}return R1.filter(t1=>!Ol.has(t1))})();Fn.length>0&&(Ao=removeItemsFromSchema(K0?.item||[],Fn),Fi(ws(cs({},K0),{item:Ao})));const Ri=((qa,wa)=>{const M1=[];let w1=!1;const Ol=b1=>{for(const t1 of b1)w1?(M1.push(t1.linkId),t1.item&&Ol(t1.item)):t1.linkId===wa?w1=!0:t1.item&&Ol(t1.item)};return Ol(qa),M1})(K0?.item||[],Ia);Ri.length>0&&(Xi.current=Xi.current.filter(qa=>!Ri.includes(qa)),kn(qa=>{const wa=new Set(qa);return Ri.forEach(M1=>wa.delete(M1)),wa})),Xi.current.push(Ia),hi(removeDisabledItems(Z1,K0?.item||[]),!0,Ao)}},Bt=(jo,ii,Ko=!1)=>{const Bi=updateItemWithReadOnlyExpression(jo,K0),Na={item:Bi,selectedAnswer:ii,handleInputChange:cr,showQuestionPrefix:yi,onCompleteHandler:Y0,errors:Po,isLoading:Vr,isCurrentFormValid:n0,contained:K0?.contained,questionnaireSchemaItems:K0?.item,customErrorConfigurations:vi,formData:Bo.current,showStepper:Li,totalStepsFromExtension:Ki,externalComponentRenderMap:Ce,hintText:getHintTextFromExtensions(Bi.extension)};if(typeof Yn=="function"&&Ko)Yn(jo,Na,Bo.current);else if(jo.type in typeToRenderFunctionMap&&!Ko)return _t.includes(jo.linkId)||An(Ra=>[...Ra,jo.linkId]),jsx(RenderFHIRQuestionnaireItem,cs({},Na),jo.linkId);return null},ni=jo=>jo.map(ii=>{var Ko,Bi;const Na=isHiddenExtensionPresent(ii);let Ra=(Ko=findResponseItem(Bo.current,ii.linkId))==null?void 0:Ko.answer;if((!Ra||Object.keys((Bi=Ra?.[0])!=null?Bi:{}).length===0)&&!jn.has(ii.linkId)){if(ii.initial&&ii.initial.length>0)Ra=ii.initial,kn(Ja=>new Set(Ja).add(ii.linkId));else if((ii.type==="choice"||ii.type==="open-choice")&&ii.answerOption){const Ja=ii.answerOption.filter(Ia=>Ia.initialSelected===!0);Ja.length>0&&(Ra=Ja.map(Ia=>{let es={};return Ia.valueCoding?es={valueCoding:{code:Ia.valueCoding.code,display:Ia.valueCoding.display,system:Ia.valueCoding.system}}:Ia.valueReference&&(es={valueReference:{reference:Ia.valueReference.reference,display:Ia.valueReference.display}}),es}).filter(Ia=>Object.keys(Ia).length>0),kn(Ia=>new Set(Ia).add(ii.linkId)))}Ra&&(Bo.current=getUpdatedFormData(K0?.item||[],Bo.current,ii.linkId,Ra))}if(!ii?.enableWhen||isQuestionEnabled(ii?.enableWhen,ii.enableBehavior,Bo.current)){const Ja=Qa.includes(ii.linkId)||getUIToolkitCode(ii.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Bt(ii,Ra,Na),ii.item&&!Na&&(Ja?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:ni(ii.item)})}):ni(ii.item))]},ii.linkId)}else if(ii.type==="group"&&!Na)return ao.includes(ii.linkId)||(Ki===void 0&&cn(J0.current.length-1||-1),J0.current=J0.current.filter((Ja,Ia)=>Ia!==O0),E0(Ja=>[...Ja,ii.linkId])),null});if(O0>=0){const jo=[];let ii=0,Ko=0;for(;ii<kr.length&&Ko<J0.current.length;){const Bi=kr[ii],Na=J0.current[Ko];if(Bi<Na){const Ra=(ht=K0?.item)==null?void 0:ht[Bi];(!Ra?.enableWhen||isQuestionEnabled(Ra.enableWhen,Ra.enableBehavior,Bo.current))&&jo.push(ii),ii++}else Bi===Na&&ii++,Ko++}for(;ii<kr.length;){const Bi=kr[ii],Na=(Ht=K0?.item)==null?void 0:Ht[Bi];(!Na?.enableWhen||isQuestionEnabled(Na.enableWhen,Na.enableBehavior,Bo.current))&&jo.push(ii),ii++}if(jo.length>0){Ki===void 0&&cn(J0.current.length+jo.length),jo.reverse().forEach(Na=>{const Ra=kr[Na];let Ja=0;for(let Ia=0;Ia<J0.current.length;Ia++){if(J0.current[Ia]>Ra){Ja=Ia;break}Ja=Ia+1}J0.current.splice(Ja,0,Ra)});const Bi=jo.map(Na=>{var Ra;const Ja=kr[Na],Ia=(Ra=K0?.item)==null?void 0:Ra[Ja];return Ia?.linkId}).filter(Boolean);E0(Na=>Na.filter(Ra=>!Bi.includes(Ra)))}kr.forEach(Bi=>{var Na;const Ra=(Na=K0?.item)==null?void 0:Na[Bi];Ra?.enableWhen&&!isQuestionEnabled(Ra.enableWhen,Ra.enableBehavior,Bo.current)&&Bo.current.some(Ia=>Ia.linkId===Ra.linkId)&&(Bo.current=removeAnswerFromFormData(Bo.current,Ra.linkId))})}const Ai=()=>{var jo;if(Vo&&!A0&&O0>0&&Ii!=="completed")Un(J0.current.length-1),Eo(!0),lr(!1),yr?.();else if(O0>0&&Ii!=="completed"){let ii=O0-1;for(;ii>0;){const Ko=J0.current[ii],Bi=(jo=K0?.item)==null?void 0:jo[Ko];if(!Bi?.enableWhen||isQuestionEnabled(Bi.enableWhen,Bi.enableBehavior,Bo.current))break;ii--}Un(ii),tr(!0),lr(!1),yr?.()}else Sr?.()},Ta=jo=>jo.preventDefault();return useEffect(()=>{const jo=setTimeout(()=>{Ks(!0)},0);return()=>clearTimeout(jo)},[]),Xs?jsxs(Fragment,{children:[jsxs("form",{id:dr,className:"w-full","data-testid":"questionnaire-form",onSubmit:Ta,children:[!Si&&jsxs("div",{className:"tw group text-secondary gap-md mb-2xl hover:text-secondary_hover flex w-fit cursor-pointer items-center text-sm font-semibold hover:font-bold",role:"button","data-testid":"questionnaire-back-button",tabIndex:0,onClick:()=>Ai(),onKeyDown:jo=>{(jo.key==="Enter"||jo.key===" ")&&Ai()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Vo&&!A0?jsx(EmptyState,{className:"mt-5xl",title:Vo.title,description:Vo.description,featuredIconProps:{icon:Vo.icon,color:"gray"},primaryButton:Vo.primaryButton,secondaryButton:Vo.secondaryButton?ws(cs({},Vo.secondaryButton),{onClick:Ai}):void 0}):jsxs(Fragment,{children:[!K0?.item&&Vr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),K0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:ni(O0>=0?K0.item.filter((jo,ii)=>{const Ko=J0.current[O0];return(No.current.get(Ko)||[Ko]).includes(ii)}):K0?.item||[])})]})]}),Ci.current&&Fe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Y,l,e)=>{"use strict";e.d(l,{l:()=>p});var n=e(31085),t=e(14041),r=e(36087),s=e(76260),o=e(25624),i=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,b)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[f]=b,d=(h,f)=>{for(var b in f||(f={}))y.call(f,b)&&m(h,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(h,b,f[b]);return h},O=(h,f)=>g(h,c(f));const v=({selected:h,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},p=({item:h,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,i.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,C=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,o.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),E=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,o.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),R=N=>{var w,V;if(!b)return!1;const q=(0,o.MU)(b,N);return((V=(w=q?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>C.some(N=>R(N.linkId)),[C,b]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||C.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,C.length,x,z]),(0,t.useEffect)(()=>{E.forEach(N=>{var w,V;const q=b?(0,o.MU)(b,N.linkId):void 0;(!q||((V=(w=q.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[E]),(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:C.map(N=>{var w,V,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Y,l,e)=>{"use strict";e.d(l,{v:()=>i});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const o=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},i=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,p;if(!c)return!1;const h=(0,s.MU)(c,O);return((p=(v=h?.answer)==null?void 0:v[0])==null?void 0:p.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var v;const p=m(O.linkId);return(0,n.jsx)(o,{label:(v=O.text)!=null?v:"",selected:p,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Y,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(76260);const s=({item:o})=>{var i,a,g,c;const u=o.text||"",y=(a=(i=o.extension)==null?void 0:i.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=o.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":o.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Y,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),o=Object.defineProperty,i=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?o(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,A=(p,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(p,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(p,f,h[f]);return p},m=(p,h)=>i(p,a(h));const d=(0,t.createContext)(void 0),O=()=>{const p=(0,t.useContext)(d);if(!p)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return p},v=({children:p,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[C,E]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),oe=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!h)return;const he=h[ne];if(!he)return;let ce;if(Array.isArray(he))if(me)ce=he.find(Ee=>Ee.inputType===me);else{console.warn(`Multiple analytics configs found for linkId "${ne}" but no inputType provided. Skipping tracking.`);return}else{if(me&&he.inputType&&he.inputType!==me)return;ce=he}if(!ce)return;let ue=A({},ae);ce.valueTransform&&(ue=Object.keys(ae).reduce((Ee,De)=>{var ze;const Ie=(ze=ce.valueTransform)==null?void 0:ze[De];return Ee[De]=Ie?applyValueTransform(ae[De],Ie):ae[De],Ee},{}));let re=A({},ue);ce.propertyMapping&&(re=Object.keys(ue).reduce((Ee,De)=>{var ze;const Ie=((ze=ce.propertyMapping)==null?void 0:ze[De])||De;return Ee[Ie]=ue[De],Ee},{}));const J=ce.eventName,ve=ce.description;f(J,m(A(A({},re),ce.properties),{_event_metadata:ve?{description:ve}:void 0}))},[h,f]),ge={isCurrentFormValid:T,currentGroupLinkId:C,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:E,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:oe,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:p})}},35473:(Y,l,e)=>{"use strict";var n=e(28058),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var o=e(25624),i=e(76260),a=e(7630),g=e(72866),c=e(65735)},61388:(Y,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:o,onActionButtonClick:i,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),o&&i&&(0,n.jsx)(t.Button,{color:"link-color",onClick:i,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:o})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Y,l,e)=>{"use strict";e.d(l,{d:()=>o});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const o=({infoDetails:i,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>y(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:i.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const p=Array.isArray(d.value)?d.value:[d.value];return p.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:p.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(p[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Y,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Y,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Y,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Y,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),o=e(76808),i=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,p=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&p(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&p(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,C)=>{var E=P=>{try{L(T.next(P))}catch(D){C(D)}},R=P=>{try{L(T.throw(P))}catch(D){C(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(E,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:C})=>{const{locationPermission:E,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{w(f(h({},N),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:E||""}))},[E,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!E||[a.Ef.GRANTED].includes(E)&&I.get()||[a.Ef.PROMPT].includes(E)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(E)))},[S,E,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,o.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield L(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&C?C():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,C]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&C?C():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,C,I,G]),oe=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&C?C():q(!1)},[D,P,w,N,I,S,C]),te=(0,t.useCallback)(()=>oe("close"),[oe]),pe=(0,t.useCallback)(()=>oe("cancel"),[oe]);return(0,n.jsx)(i.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Y,l,e)=>{"use strict";var n=e(26877)},98741:(Y,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))o.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))i.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const p=c(y);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:p})}catch(p){console.error("Failed to load Lottie animation:",p)}return()=>{var p;(p=v.current)==null||p.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Y,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const o=y=>y*1609.34;var i=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:p})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:p||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:o(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,i.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,i.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,i.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Y,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Y,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Y,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:i,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:i,size:"md",initials:getInitials(i),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:i}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},o=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Y,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:o,fullImageHeader:i=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[i?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),o&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:o})]}),s]})]})}),r=null},51254:(Y,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:o,icon:i})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:i.icon,color:(a=i.color)!=null?a:"brand",size:"lg",className:i.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),o&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:o})]})]})}},69092:()=>{},33457:(Y,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Y,l,e)=>{"use strict";e.d(l,{i:()=>Ye});var n=e(31085),t=e(36087),r=e(14041);const s=({size:Qe=24,color:Pt="currentColor",...hn})=>r.createElement("svg",{viewBox:"0 0 24 24",width:Qe,height:Qe,stroke:Pt,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...hn},r.createElement("path",{d:"M9.5 7h5m-5 4h5m-5 4h5m3.5 6V6.2c0-1.12 0-1.68-.218-2.108a2 2 0 0 0-.874-.874C16.48 3 15.92 3 14.8 3H9.2c-1.12 0-1.68 0-2.108.218a2 2 0 0 0-.874.874C6 4.52 6 5.08 6 6.2V21m14 0H4"}));s.displayName="Building04";var o=e(14449),i=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Qe){Qe()}let y=null;const A=Qe=>y=Qe,m=()=>y,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Qe=>{h=Qe},b=(Qe,Pt)=>Qe===Pt;function M(Qe=d){const Pt=Qe===d?v:()=>(0,r.useContext)(Qe);return function(Sn,et=b){const{store:Rt,subscription:kt,getServerState:Bn}=Pt(),Or=h(kt.addNestedSub,Rt.getState,Bn||Rt.getState,Sn,et);return(0,r.useDebugValue)(Or),Or}}const x=M();var z=e(75985),T=e(524);function S(){const Qe=getBatch();let Pt=null,hn=null;return{clear(){Pt=null,hn=null},notify(){Qe(()=>{let Sn=Pt;for(;Sn;)Sn.callback(),Sn=Sn.next})},get(){let Sn=[],et=Pt;for(;et;)Sn.push(et),et=et.next;return Sn},subscribe(Sn){let et=!0,Rt=hn={callback:Sn,next:null,prev:hn};return Rt.prev?Rt.prev.next=Rt:Pt=Rt,function(){!et||Pt===null||(et=!1,Rt.next?Rt.next.prev=Rt.prev:hn=Rt.prev,Rt.prev?Rt.prev.next=Rt.next:Pt=Rt.next)}}}}const C={notify(){},get:()=>[]};function E(Qe,Pt){let hn,Sn=C;function et(fr){return Or(),Sn.subscribe(fr)}function Rt(){Sn.notify()}function kt(){Ln.onStateChange&&Ln.onStateChange()}function Bn(){return Boolean(hn)}function Or(){hn||(hn=Pt?Pt.addNestedSub(kt):Qe.subscribe(kt),Sn=S())}function mn(){hn&&(hn(),hn=void 0,Sn.clear(),Sn=C)}const Ln={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:kt,isSubscribed:Bn,trySubscribe:Or,tryUnsubscribe:mn,getListeners:()=>Sn};return Ln}const R=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",L=null,P=null;let D=null;const N=Qe=>{D=Qe},w=null,V=null,q=Qe=>{try{return JSON.stringify(Qe)}catch{return String(Qe)}};function I(Qe,Pt,hn){useIsomorphicLayoutEffect(()=>Qe(...Pt),hn)}function k(Qe,Pt,hn,Sn,et,Rt){Qe.current=Sn,hn.current=!1,et.current&&(et.current=null,Rt())}function U(Qe,Pt,hn,Sn,et,Rt,kt,Bn,Or,mn,Ln){if(!Qe)return()=>{};let fr=!1,Wn=null;const Fr=()=>{if(fr||!Bn.current)return;const It=Pt.getState();let $e,ot;try{$e=Sn(It,et.current)}catch(Je){ot=Je,Wn=Je}ot||(Wn=null),$e===Rt.current?kt.current||mn():(Rt.current=$e,Or.current=$e,kt.current=!0,Ln())};return hn.onStateChange=Fr,hn.trySubscribe(),Fr(),()=>{if(fr=!0,hn.tryUnsubscribe(),hn.onStateChange=null,Wn)throw Wn}}const F=()=>w;function K(Qe,Pt){return Qe===Pt}let G=!1;function se(Qe,Pt,hn,{pure:Sn,areStatesEqual:et=K,areOwnPropsEqual:Rt=shallowEqual,areStatePropsEqual:kt=shallowEqual,areMergedPropsEqual:Bn=shallowEqual,forwardRef:Or=!1,context:mn=ReactReduxContext}={}){const Ln=mn,fr=mapStateToPropsFactory(Qe),Wn=mapDispatchToPropsFactory(Pt),Fr=mergePropsFactory(hn),Jr=Boolean(Qe);return $e=>{const ot=$e.displayName||$e.name||"Component",Je=`Connect(${ot})`,tt={shouldHandleStateChanges:Jr,displayName:Je,wrappedComponentName:ot,WrappedComponent:$e,initMapStateToProps:fr,initMapDispatchToProps:Wn,initMergeProps:Fr,areStatesEqual:et,areStatePropsEqual:kt,areOwnPropsEqual:Rt,areMergedPropsEqual:Bn};function rt(st){const[le,ye,Ue]=useMemo(()=>{const{reactReduxForwardedRef:Rn}=st,Pn=_objectWithoutPropertiesLoose(st,P);return[st.context,Rn,Pn]},[st]),Te=useMemo(()=>le&&le.Consumer&&isContextConsumer(React.createElement(le.Consumer,null))?le:Ln,[le,Ln]),zt=useContext(Te),Gt=Boolean(st.store)&&Boolean(st.store.getState)&&Boolean(st.store.dispatch),vn=Boolean(zt)&&Boolean(zt.store),zn=Gt?st.store:zt.store,ir=vn?zt.getServerState:zn.getState,Dt=useMemo(()=>defaultSelectorFactory(zn.dispatch,tt),[zn]),[we,Ze]=useMemo(()=>{if(!Jr)return V;const Rn=createSubscription(zn,Gt?void 0:zt.subscription),Pn=Rn.notifyNestedSubs.bind(Rn);return[Rn,Pn]},[zn,Gt,zt]),At=useMemo(()=>Gt?zt:_extends({},zt,{subscription:we}),[Gt,zt,we]),en=useRef(),nn=useRef(Ue),fn=useRef(),mt=useRef(!1),Qt=useRef(!1),qt=useRef(!1),Lt=useRef();useIsomorphicLayoutEffect(()=>(qt.current=!0,()=>{qt.current=!1}),[]);const $t=useMemo(()=>()=>fn.current&&Ue===nn.current?fn.current:Dt(zn.getState(),Ue),[zn,Ue]),Yt=useMemo(()=>Pn=>we?U(Jr,zn,we,Dt,nn,en,mt,qt,fn,Ze,Pn):()=>{},[we]);I(k,[nn,en,mt,Ue,fn,Ze]);let On;try{On=D(Yt,$t,ir?()=>Dt(ir(),Ue):$t)}catch(Rn){throw Lt.current&&(Rn.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.1132.
|
|
1
|
+
import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1132.2",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.13.1"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1383.0",D="@icanbwell/composite. repo version: 0.1383.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
|