@icanbwell/composite 1.1113.0 → 1.1114.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +1 -1
  2. package/native.js +1 -1
  3. package/package.json +3 -3
package/index.js CHANGED
@@ -866,7 +866,7 @@ https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_liter
866
866
  <div class="wrapper">
867
867
  <bwell-error-component />
868
868
  </div>
869
- `}}customElements.get(Ee)===void 0&&customElements.define(Ee,De);const ze=[{name:"loader",defaultElement:document.createElement(J)},{name:"error",defaultElement:document.createElement(Ee)}],Ie=["error","loading"],xe={error:"error",loading:"loader"},_e=({src: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,Ut,wn,yr,mn,Ln,dr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Wn=`bwell-${Kt}`;if(customElements.get(Wn)!==void 0)return;class Wr 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),Ut.set(this,void 0),wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:it,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(it),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,wn,{slots: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",yr).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",dr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",dr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,wn=new WeakMap,We=new WeakSet,yr=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,wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,Ut,"f")(),(0,p.__classPrivateFieldSet)(this,Ut,void 0,"f")},dr=function(It){return $e=>{const it=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,it).some(tt=>(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,Ut,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,Ut,(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,Ut,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,Ut,(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Wn,Wr)}),at={rE:"1.1113.0"},ht="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${ht}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ht,version:at.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(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,Ut,wn,yr,mn,Ln;if(F(Kt),G(Kt),ie(!1),Kt&&typeof Kt=="string"){const dr=be.find(tt=>tt.id===Kt),Wn=dr?.label||V;if(!dr)return;q(Wn),k(Wn),setTimeout(()=>{const tt=[{id:dr.id,label:dr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Kt}}),Yr=(Xe=(Ct=Wr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",it=((hn=(Pt=Wr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Wr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Yr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Yr),longitude:String(It)}}),rt=((Ut=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ut.zipCode)||"",lt=((yr=(wn=tt?.data)==null?void 0:wn.geocodingByLatLon)==null?void 0:yr.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Yr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Wn,value:Kt})}else T({latitude:Yr,longitude:It,zipCode:$e,state:it,stateCode:Je,placeId:Kt,description:Wn,value:Kt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(ie(!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},ht=()=>{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,Ut,wn,yr,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 dr=yield ae({variables:{placeId:N}}),Wn=(Xe=(Ct=dr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(Ot=(We=dr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Yr=((Qe=(Ye=dr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=dr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=dr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Wn&&Wr)if(!Yr||!It||!$e){const it=yield ce({variables:{latitude:String(Wn),longitude:String(Wr)}}),Je=((Ut=(Rt=it?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ut.zipCode)||"",tt=((yr=(wn=it?.data)==null?void 0:wn.geocodingByLatLon)==null?void 0:yr.state)||"",rt=((Ln=(mn=it?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Wn,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Wn,longitude:Wr,zipCode:Yr,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)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:ht,isInvalid: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)(i.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:(Z,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition: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:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Z,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:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Yr,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_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>ht,VF:()=>Ln,vf:()=>wn,PV:()=>dr,PS:()=>Ut,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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 i=({size:zn=24,color:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:zn=24,color:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",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",ht="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",Ut="http://icanbwell.com/fhir/StructureDefinition/trigger-text",wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",yr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",dr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Wn="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Yr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",it="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",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":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Z,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),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,kt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:kt}):mt[Qt]=kt,f=(mt,Qt)=>{for(var kt in Qt||(Qt={}))v.call(Qt,kt)&&h(mt,kt,Qt[kt]);if(O)for(var kt of O(Qt))p.call(Qt,kt)&&h(mt,kt,Qt[kt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(kt=>kt.url.includes("questionnaire-itemControl")).flatMap(kt=>{var Lt,Ft;return(Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?Ft:[]}).find(kt=>{var Lt;return(Lt=kt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return kt?.valueCode||"off"},z=(mt,Qt,kt)=>{const Lt=(0,u.A)(kt);return mt&&Qt&&kt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(kt=>kt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(kt=>kt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(mt,Qt)=>{const kt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return kt?.valueString||Qt&&E[Qt]||C},L=mt=>{const Qt=mt?.find(kt=>kt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(kt=>kt.url===y.GT&&kt.valueCode).map(kt=>y.hr[kt.valueCode]||kt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,Ft,Yt)=>Yt.indexOf(Lt)===Ft).join(", "),N=(mt,Qt,kt)=>{const Lt=D(mt),Ft=Lt.lastIndexOf(","),Yt=Ft!==-1?`${Lt.substring(0,Ft)} or${Lt.substring(Ft+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,kt&&`upto ${kt} file${kt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(kt=>kt?.url===y.zD||kt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var kt,Lt,Ft;const Yt=Qt?.find(On=>On.url.includes(mt));return(Ft=(Lt=(kt=Yt?.valueInteger)!=null?kt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?Ft:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,o.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const kt=Qt[0];if(kt instanceof Date&&!isNaN(kt.getTime())){const Lt=kt.getFullYear(),Ft=String(kt.getMonth()+1).padStart(2,"0"),Yt=String(kt.getDate()).padStart(2,"0");return`${Lt}-${Ft}-${Yt}`}if(typeof kt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(kt))return kt}}catch{}}},I=(mt,Qt)=>{var kt,Lt;const Ft=Qt?.find(On=>On.url===mt);if(!Ft)return;const Yt=(kt=Ft.valueString)!=null?kt:Ft.valueDate;return Yt||q((Lt=Ft.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const kt of mt){const Lt=V(Qt,kt.extension);if(Lt!==void 0)return Lt;if(kt.item&&kt.item.length>0){const Ft=k(kt.item,Qt);if(Ft!==void 0)return Ft}}},U=(mt,Qt)=>{try{const kt=String(mt??Qt);let Lt;if(kt.includes("/"))Lt=(0,n.A)(kt,"MM/dd/yyyy",new Date);else{const Ft=kt.split("T")[0];Lt=(0,t.A)(Ft)}return(0,r.A)(Lt)}catch(kt){return console.error("Date parsing error:",kt,mt),null}},F=(mt,Qt)=>{var kt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((kt=Lt.item)!=null&&kt.length){const Ft=F(Lt.item,Qt);if(Ft!==void 0)return Ft}}},K=(mt,Qt)=>{var kt;const Lt=[];for(const Ft of mt)if(Ft.linkId===Qt&&Lt.push(Ft),(kt=Ft.item)!=null&&kt.length){const Yt=K(Ft.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,kt=0)=>K(mt,Qt)[kt];function se(mt){return mt!=null}const ie=(mt,Qt)=>{var kt,Lt,Ft;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((Ft=(Lt=(kt=Qt?.valueDate)!=null?kt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?Ft:""),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,kt)=>{const Lt=Ft=>{const Yt=K(kt,Ft.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?ie(Ft,void 0):Yt.some(On=>{var Sr;return(Sr=On.answer)==null?void 0:Sr.some(jr=>ie(Ft,jr&&Object.keys(jr).length>0?jr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some(Ft=>Lt(Ft)):mt?.every(Ft=>Lt(Ft)):!0},pe=(mt,Qt,kt,Lt,Ft)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var Sr;let jr;if(Lt&&typeof Ft=="number"){const Pn=kt.filter(rn=>rn.linkId===Lt)[Ft];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(Sr=rn?.answer)==null?void 0:Sr.some(bt=>ie(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!jr){const Rn=K(kt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>ie(On,bt&&Object.keys(bt).length>0?bt:void 0))});jr=void 0}return ie(On,jr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var kt;if(!!((kt=mt?.valueExpression)!=null&&kt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some(Ft=>Boolean(Ft)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var kt;const Lt=(kt=mt.extension)==null?void 0:kt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Ft=be(Lt,Qt);return b(f({},mt),{readOnly:Ft??mt.readOnly})},ge=(mt,Qt,kt)=>{const{required:Lt,maxLength:Ft,type:Yt,extension:On,enableWhen:Sr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=mt;if(!te(Sr,jr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,kt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,kt,rn):he(On,Yt,Lt,Ft,kt,Pn)},ne=(mt,Qt,kt)=>{const{required:Lt}=mt;if(Lt){if(!kt||kt.length===0)return"At least one item is required";let Ft=!1;for(let Yt=0;Yt<kt.length;Yt++){const On=kt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){Ft=!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(!Ft)return"At least one item is required"}else if(kt&&kt.length>0)for(let Ft=0;Ft<kt.length;Ft++){const Yt=kt[Ft];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(Sr=>Sr!=null&&Sr!==""&&(Array.isArray(Sr)?Sr.length>0:!0))){const Sr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(Sr)return`Item ${Ft+1}: ${Sr}`;if(mt.item&&mt.item.length>0){const jr=ae(mt.item,Qt,mt.linkId,Ft);if(jr)return`Item ${Ft+1}: ${jr}`}}}return""},ae=(mt,Qt,kt,Lt)=>{var Ft,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,kt,Lt))continue;const Sr=F(Qt,kt),jr=(Ft=Sr?.item)==null?void 0:Ft.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,kt,Lt,Ft,Yt)=>{var On,Sr,jr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Xn,wr;return En.url===y.gD&&((wr=(Xn=En.valueCodeableConcept)==null?void 0:Xn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=Ft?.[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":((Sr=St?.valueCoding)==null?void 0:Sr.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:()=>kt&&(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),Xn=V("regexError",mt),wr=Xn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Xn=new RegExp(En),wr=V("regexError",mt),$r=wr??"Please enter a valid input";return Xn&&un&&!Xn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Xn=new Date(En);return isNaN(Xn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const wr=I(y.dU,mt),$r=U(wr??"01/01/1900","01/01/1900"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,s.A)(Kr,$r)){const d0=(En=mt?.find(Di=>Di.url===y.Ck))==null?void 0:En.valueString;return d0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Xn=V("minValue",mt);return Xn!=null&&un!==null&&un!==void 0&&un<Xn?`Input should not be less than ${Xn}`:""},maxValue:()=>{var En;if(Qt==="date"){const wr=I(y.bK,mt),$r=U(wr??"01/01/2100","01/01/2100"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,i.A)(Kr,$r)){const d0=(En=mt?.find(Di=>Di.url===y.Cx))==null?void 0:En.valueString;return d0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Xn=V("maxValue",mt);return Xn!=null&&un!==null&&un!==void 0&&un>Xn?`Input should not exceed ${Xn}`:""}};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 kt of Qt)if(kt.item){if(kt.item.find(Yt=>Yt.linkId===mt.linkId))return kt;const Ft=ce(mt,kt.item);if(Ft)return Ft}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const kt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(kt&&kt.answer&&kt.answer.length>1)return!0}return!1},re=(mt,Qt,kt,Lt)=>{var Ft,Yt;const{required:On}=mt,Sr=(Ft=Lt.item)==null?void 0:Ft.find(Pn=>Pn.linkId===mt.linkId),jr=Sr?.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 kt of mt){if(kt?.linkId===Qt)return kt;if(kt?.item&&kt.item.length>0){const Lt=J(kt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>kt.url===y.oA&&kt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===y.gD&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>kt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&kt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return kt?.valueInteger},at=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return kt?.valueInteger},ht=mt=>{var Qt;const kt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return kt?.valueInteger},xt=(mt,Qt,kt,Lt,Ft,Yt)=>{const On=jr=>Qt.filter(Rn=>Rn.linkId===jr),Sr=new Set;return mt.map(jr=>{if(Sr.has(jr.linkId)||ve(jr))return null;const Pn=On(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(Sr.add(jr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(kt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&Ft&&Ft.length>0){const En=St?.item||[];on=[...En],Ft.forEach(Xn=>{const wr=on.findIndex($r=>$r.linkId===Xn.linkId);wr>=0?on[wr]=b(f({},En[wr]),{answer:Xn.answer}):on.push(Xn)})}else jr.item&&(on=xt(jr.item,St?.item||[],kt,Lt,Ft,Zt));kt===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)}),kt===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&&Ft&&Ft.length>0?Zt.item=Ft: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"&&kt===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||[],kt,Lt,Ft,Yt):void 0,Zt=St&&St.length>0,un={linkId:jr.linkId,text:jr.text};return kt&&jr.linkId===kt&&typeof Yt!="number"?(Lt||!Lt&&!Ft?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),Ft?un.item=Ft: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 kt of mt)if(kt.linkId===Qt||kt.item&&Xt(kt.item,Qt))return kt.linkId;return null},Kt=(mt,Qt,kt,Lt)=>{var Ft;const Yt=(Ft=mt?.item)!=null?Ft:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var Sr;const jr=K(Qt,On.linkId);if(jr.length===0){const Rn=(Sr=F(Qt,On.linkId))==null?void 0:Sr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&kt.includes(On.linkId))return!1}else for(const Rn of jr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&kt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,kt):!0})},Ct=(mt,Qt,kt=!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,kt))return!0;return!1},Xe=(mt,Qt,kt=0)=>{const Lt=mt.filter(Ft=>Ft.linkId===Qt);if(Lt.length>kt){const Ft=Lt[kt];if(Ft.answer&&Ft.answer.length>0)return Ft.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if(Ft.item&&Ft.item.length>0)return Ct(Ft.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const kt=Lt=>{var Ft;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(!((Ft=Yt?.answer)!=null&&Ft.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(kt(Yt))return!0}return!1};for(const Lt of mt.item)if(kt(Lt))return!0;return!1},Ot=mt=>{var Qt,kt,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(((kt=mt.valueReference)==null?void 0:kt.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 kt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);kt.length>0&&(Qt.answer=kt)}if(mt.item&&mt.item.length>0){const kt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const Ft=Object.keys(Lt);return Ft.length>1||Ft.length===1&&Ft[0]!=="linkId"});kt.length>0&&(Qt.item=kt)}return Qt},Qe=(mt,Qt,kt,Lt,Ft,Yt)=>{var On;const Sr=(On=Qt?.item)==null?void 0:On[kt[Lt]],jr=Sr?.linkId;if(!jr)return!1;const Rn=K(mt,jr),Pn=K(Ft,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,kt)=>kt&&kt.length>0&&!(kt.length===1&&Object.keys(kt[0]).length===0)&&ge(mt,Qt,kt)||null,hn=(mt,Qt)=>{const kt={},Lt=Ft=>{Ft.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let Sr=0;Sr<On.length;Sr++){const jr=On[Sr];if(jr?.answer&&jr.answer.length>0){const Rn=Pt(Yt,Qt,jr.answer);Rn&&(kt[Yt.linkId]=b(f({},kt[Yt.linkId]),{[Sr]:Rn}))}}else{const Sr=F(Qt,Yt.linkId);if(Sr?.answer&&Sr.answer.length>0){const jr=Pt(Yt,Qt,Sr.answer);jr&&(kt[Yt.linkId]={0:jr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),kt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[kt,Lt,Ft]=Qt;return`${kt.slice(-4)}-${Lt}-${Ft}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const kt=(Lt,Ft)=>{for(const Yt of Lt){if(Yt.linkId===Ft)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=kt(Yt.item,Ft);if(On!==void 0)return On}}};return kt(mt,Qt)},Ut=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const kt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const Sr of Ft){const jr=[...On,Sr];if(Sr.item){if(Sr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>rn.repeats===!0)?Sr:null;if(Lt(Sr.item,Yt,jr))return Sr}}return null};return Lt(Qt,kt)},wn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const kt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const Sr of Ft){const jr=[...On,Sr];if(Sr.item){if(Sr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(Sr.item,Yt,jr))return!0}}return!1};return Lt(Qt,kt)},yr=(mt,Qt,kt)=>{const Lt={};if(!mt)return Lt;const{linkId:Ft}=Qt;if(mt[Ft]){const Yt=mt[Ft];Lt[Ft]=Yt[kt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[kt]||""}}),Lt},mn=(mt,Qt)=>{const kt={};if(!mt||!mt[Qt])return kt;const Lt=mt[Qt];return kt[Qt]=Lt[0]||"",kt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),kt=Qt>=0?[Qt]:[],Lt=new Map;let Ft=null;if(mt.forEach((Yt,On)=>{const Sr=ze(Yt);if(Sr&&Yt.type==="group")On!==Qt&&kt.push(On),Lt.set(On,[On]),Ft=On;else if(Ft!==null&&!Sr){const jr=Lt.get(Ft)||[];Lt.set(Ft,[...jr,On])}}),mt.length>0&&kt.length>0){const Yt=kt[0];if(!Lt.has(Yt)){const On=kt.find(jr=>jr>Yt),Sr=[];for(let jr=Yt;jr<(On??mt.length);jr++)Sr.push(jr);Lt.set(Yt,Sr)}}return{groupIndices:kt,itemsToRenderMap:Lt}},dr=(mt,Qt,kt,Lt)=>{let Ft=[...Lt];const Yt=(On,Sr)=>{On.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,Sr))&&jr.initial&&!Ct(Sr,jr.linkId))if(jr.repeats){const Rn=Sr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(Sr,jr.linkId,rn)||(Ft=xt(kt,Ft,jr.linkId,jr.initial,void 0,rn))}):Ft=xt(kt,Ft,jr.linkId,jr.initial)}else Ft=xt(kt,Ft,jr.linkId,jr.initial);jr.item&&Yt(jr.item,Sr)})};return Yt(mt,Qt),Ft},Wn=(mt,Qt,kt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,kt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach(Ft)};return mt.forEach(Ft),Lt},Wr=(mt,Qt)=>mt.every(kt=>{var Lt;const Ft=K(Qt,kt.linkId);if(Ft.length>0)return Ft.every(Yt=>!ge(kt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,kt.linkId))==null?void 0:Lt.answer;return!ge(kt,Qt,Yt)}}),Yr=(mt,Qt)=>{let kt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){kt=Lt;break}return kt},It=(mt,Qt)=>mt.filter(kt=>kt.linkId!==Qt).map(kt=>kt.item&&kt.item.length>0?b(f({},kt),{item:It(kt.item,Qt)}):kt),$e=(mt,Qt,kt=mt)=>mt.reduce((Lt,Ft)=>{const Yt=J(Qt,Ft.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,kt)||(Ft.item&&Ft.item.length>0?Lt.push(b(f({},Ft),{item:$e(Ft.item,Qt,kt)})):Lt.push(Ft)),Lt},[]),it=(mt,Qt,kt=[])=>{const Lt=[],Ft=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&Ft(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const Sr=mt.slice(0,Yt+1),jr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,bt)=>{const St=J(kt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,Sr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return Ft(Pn),{trimmedData:[...Sr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const Sr=it(On.item,Qt,kt);if(Sr.found){const jr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...jr,b(f({},On),{item:Sr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(kt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return Ft(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...Sr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(kt=>!Qt.includes(kt.linkId)).map(kt=>kt.item&&kt.item.length>0?b(f({},kt),{item:Je(kt.item,Qt)}):kt),tt=mt=>{var Qt;if(!mt)return"empty";const kt=y.Z$.find(({patterns:Lt})=>Lt.some(Ft=>mt.includes(Ft)));return(Qt=kt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:kt}=Ln(mt),Lt=mt.findIndex(Ft=>Ft.linkId===Qt);return Lt!==-1?kt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=kt=>{const Lt=mt.find(Yt=>Yt.url===kt&&Yt.valueString);if(!Lt?.valueString)return null;const Ft=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,Ut,wn,yr,mn,Ln,dr;window.bwell||(window.bwell=new re({metadata:{version:Ct}}));const Wn=`bwell-${Kt}`;if(customElements.get(Wn)!==void 0)return;class Wr 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),Ut.set(this,void 0),wn.set(this,void 0),this.attachShadow({mode:"open"});const It=new be(ze).attachToShadowRoot(this.shadowRoot);It.addEventListener("visibilitychange",({visibility:$e,container:it,name:Je})=>{Je==="error"&&$e==="visible"&&window.bwell._registerEmbeddableContent(it),(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=$e==="hidden"?"unset":"hidden"}),(0,p.__classPrivateFieldSet)(this,wn,{slots: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",yr).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",dr).call(this,"error"),"f"),(0,p.__classPrivateFieldSet)(this,Rt,(0,p.__classPrivateFieldGet)(this,We,"m",dr).call(this,"loading"),"f")}connectedCallback(){return(0,p.__awaiter)(this,void 0,void 0,function*(){(0,p.__classPrivateFieldGet)(this,et,"f").call(this,(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get("error")),(0,p.__classPrivateFieldGet)(this,Rt,"f").call(this,(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get("loading")),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.addEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.addChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.addChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("loader");try{yield window.bwell.validateLoad()}catch{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}(0,p.__classPrivateFieldSet)(this,Ot,this.id||(0,p.__classPrivateFieldGet)(this,Ot,"f"),"f"),(0,p.__classPrivateFieldSet)(this,Ye,new T((0,p.__classPrivateFieldGet)(this,Ot,"f")),"f"),(0,p.__classPrivateFieldGet)(this,Ye,"f").registerDispatcher(It=>this.dispatchEvent(It)),window.bwell.isInitialized?(0,p.__classPrivateFieldGet)(this,hn,"f").call(this):(window.bwell.once("initialized",(0,p.__classPrivateFieldGet)(this,hn,"f")),window.bwell.once("error",()=>{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}),Xe&&(0,h.h)(Xt).catch(()=>{(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlot("error")}))})}disconnectedCallback(){var It;(0,p.__classPrivateFieldGet)(this,Pt,"f").emit("disconnect"),(0,p.__classPrivateFieldGet)(this,wn,"f").slots.removeEventListener("visibilitychange",(0,p.__classPrivateFieldGet)(this,Sn,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.removeChangeListener("error",(0,p.__classPrivateFieldGet)(this,et,"f")),(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.removeChangeListener("loading",(0,p.__classPrivateFieldGet)(this,Rt,"f")),(It=(0,p.__classPrivateFieldGet)(this,Ye,"f"))===null||It===void 0||It.deregister(),(0,p.__classPrivateFieldGet)(this,Pt,"f").removeAllListeners()}}Ot=new WeakMap,Ye=new WeakMap,Qe=new WeakMap,Pt=new WeakMap,hn=new WeakMap,Sn=new WeakMap,et=new WeakMap,Rt=new WeakMap,Ut=new WeakMap,wn=new WeakMap,We=new WeakSet,yr=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,wn,"f")},this.shadowRoot.appendChild((0,p.__classPrivateFieldGet)(this,Qe,"f"))},mn=function({visibility:It,name:$e}){(0,p.__classPrivateFieldGet)(this,Qe,"f").style.display=It==="hidden"?"unset":"hidden"},Ln=function(It){(0,p.__classPrivateFieldGet)(this,Ut,"f")(),(0,p.__classPrivateFieldSet)(this,Ut,void 0,"f")},dr=function(It){return $e=>{const it=Ie.findIndex(tt=>tt===It);if(!Ie.slice(0,it).some(tt=>(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get(tt)!==null)){if($e!==null)(0,p.__classPrivateFieldGet)(this,Ut,"f")&&(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It),(0,p.__classPrivateFieldSet)(this,Ut,(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlotLocked(xe[It]),"f");else if($e===null&&(0,p.__classPrivateFieldGet)(this,Ut,"f")){(0,p.__classPrivateFieldGet)(this,We,"m",Ln).call(this,It);const tt=Ie.find(rt=>(0,p.__classPrivateFieldGet)(this,wn,"f").attributes.get(rt)!==null);tt&&(0,p.__classPrivateFieldSet)(this,Ut,(0,p.__classPrivateFieldGet)(this,wn,"f").slots.showSlotLocked(xe[tt]),"f")}}}},customElements.define(Wn,Wr)}),at={rE:"1.1114.0"},ht="composite";var xt=e(67321);_e({src:`https://embeddables.prod.icanbwell.com/${ht}/${at.rE}/scripts/embeddable.federated.js`,elementNameSuffix:ht,version:at.rE,prefetchFeatureApp:!0})},79566:(Z,l,e)=>{"use strict";var n=e(31085),t=e(45250),r=e(35473),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(v,p,h)=>p in v?i(v,p,{enumerable:!0,configurable:!0,writable:!0,value:h}):v[p]=h,A=(v,p)=>{for(var h in p||(p={}))c.call(p,h)&&y(v,h,p[h]);if(g)for(var h of g(p))u.call(p,h)&&y(v,h,p[h]);return v},m=(v,p)=>o(v,a(p));const d=(v,p,h)=>{const f=_.cloneDeep(v);if(!f.contained||p<0)return f;const b=f.contained.findIndex(M=>M.resourceType==="Questionnaire");if(b!==-1&&!h){const M=f.contained[b];if(M.item){if(!M.item.some(S=>isPageExtensionPresent(S)))return f;let z=0,T=M.item.length;for(let S=0;S<M.item.length;S++){const E=M.item[S];if(isPageExtensionPresent(E)){if(z===p+1){T=S;break}z++}}M.item=M.item.slice(0,T),f.contained[b]=M}}else h&&b!==-1&&(f.contained[b]=m(A({},f.contained[b]),{item:h}));return f},O=({formId:v,questionnaireResponse:p,showQuestionPrefix:h,nextQuestion:f,onGoBack:b,handleHiddenQuestion:M,errorConfig:x,onClearError:z,customErrorConfigurations:T,showStepper:S,hideBackButton:E,onFormDataChange:C,externalComponentRenderMap:R,children:L})=>{var P,D,N;const{currentGroupIndex:w,hasCustomError:V}=useFHIRQuestionnaire(),q=(P=p.questionnaire)==null?void 0:P.replace("#",""),I=(D=p?.contained)==null?void 0:D.find(U=>U.id===q&&U.resourceType==="Questionnaire"),k=(U,F,K)=>{let G=_.cloneDeep(p);G.item=U,G=trimQuestionnaireItems(G,w,K),f(G,F)};return jsx("div",{className:`${V?"mb-3":"mb-8"} flex w-full flex-col gap-8`,children:jsx(FHIRQuestionnaire,{formId:v,onFormDataChange:C,questionnaireResponseItem:(N=p?.item)!=null?N:[],questionnaireSchema:I,status:p.status,showQuestionPrefix:h,errorConfig:x,customErrorConfigurations:T,isAdaptiveFlow:!0,onComplete:k,onGoBack:b,onClearError:z,handleHiddenQuestion:M,showStepper:S,hideBackButton:E,externalComponentRenderMap:R,children:L})})}},19622:(Z,l,e)=>{"use strict";e.d(l,{K:()=>b});var n=e(31085),t=e(14041),r=e(94043),s=e(76323),i=e(36087),o=e(56192),a=e(76808),g=e(66267),c=Object.defineProperty,u=Object.defineProperties,y=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,O=(M,x,z)=>x in M?c(M,x,{enumerable:!0,configurable:!0,writable:!0,value:z}):M[x]=z,v=(M,x)=>{for(var z in x||(x={}))m.call(x,z)&&O(M,z,x[z]);if(A)for(var z of A(x))d.call(x,z)&&O(M,z,x[z]);return M},p=(M,x)=>u(M,y(x)),h=(M,x,z)=>new Promise((T,S)=>{var E=L=>{try{R(z.next(L))}catch(P){S(P)}},C=L=>{try{R(z.throw(L))}catch(P){S(P)}},R=L=>L.done?T(L.value):Promise.resolve(L.value).then(E,C);R((z=z.apply(M,x)).next())});const f=10,b=({id:M="location-filter-desktop",initialValue:x,onInputChange:z,onValueChange:T,isDisabled:S=!1,className:E="",setIsLoading:C,errorText:R})=>{const L=(0,a.Ul)(),{i18n:{t:P},loading:D}=(0,g.E_)({keys:["shared-translations"]}),N=x?.placeId,w=x?.description,[V,q]=(0,t.useState)(""),[I,k]=(0,t.useState)(""),[U,F]=(0,t.useState)(null),[K,G]=(0,t.useState)(null),[se,ie]=(0,t.useState)(!1),te=(0,t.useRef)(!1),pe=[{id:"placeholder",label:"No Locations",isDisabled:!0}],[be,Se]=(0,t.useState)(pe),[ge,ne]=(0,t.useState)(pe),[ae,{loading:me,error:he}]=(0,o.Ncb)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode data")}}),[ce,{loading:ue,error:re}]=(0,o.qtq)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch geocode by lat/lon data")}}),[J,{loading:ve,error:Ee}]=(0,o.zUC)({fetchPolicy:"cache-first",onError:()=>{L?.error("Failed to fetch place autocomplete data"),Se(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,Ut,wn,yr,mn,Ln;if(F(Kt),G(Kt),ie(!1),Kt&&typeof Kt=="string"){const dr=be.find(tt=>tt.id===Kt),Wn=dr?.label||V;if(!dr)return;q(Wn),k(Wn),setTimeout(()=>{const tt=[{id:dr.id,label:dr.label}];Se(tt),ne(tt)},f);const Wr=yield ae({variables:{placeId:Kt}}),Yr=(Xe=(Ct=Wr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,It=(Ot=(We=Wr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,$e=((Qe=(Ye=Wr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",it=((hn=(Pt=Wr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",Je=((et=(Sn=Wr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Yr&&It)if(!$e||!Je){const tt=yield ce({variables:{latitude:String(Yr),longitude:String(It)}}),rt=((Ut=(Rt=tt?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ut.zipCode)||"",lt=((yr=(wn=tt?.data)==null?void 0:wn.geocodingByLatLon)==null?void 0:yr.state)||"",Et=((Ln=(mn=tt?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Yr,longitude:It,zipCode:rt,state:lt,stateCode:Et,placeId:Kt,description:Wn,value:Kt})}else T({latitude:Yr,longitude:It,zipCode:$e,state:it,stateCode:Je,placeId:Kt,description:Wn,value:Kt});else ie(!0)}}),Ie=()=>!0,xe=(0,s.useDebounce)(Kt=>h(void 0,null,function*(){return yield J({variables:{input:Kt,types:"geocode"}})})),_e=Kt=>h(void 0,null,function*(){if(ie(!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},ht=()=>{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,Ut,wn,yr,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 dr=yield ae({variables:{placeId:N}}),Wn=(Xe=(Ct=dr?.data)==null?void 0:Ct.geocodingByPlaceId)==null?void 0:Xe.latitude,Wr=(Ot=(We=dr?.data)==null?void 0:We.geocodingByPlaceId)==null?void 0:Ot.longitude,Yr=((Qe=(Ye=dr?.data)==null?void 0:Ye.geocodingByPlaceId)==null?void 0:Qe.zipCode)||"",It=((hn=(Pt=dr?.data)==null?void 0:Pt.geocodingByPlaceId)==null?void 0:hn.state)||"",$e=((et=(Sn=dr?.data)==null?void 0:Sn.geocodingByPlaceId)==null?void 0:et.stateCode)||"";if(Wn&&Wr)if(!Yr||!It||!$e){const it=yield ce({variables:{latitude:String(Wn),longitude:String(Wr)}}),Je=((Ut=(Rt=it?.data)==null?void 0:Rt.geocodingByLatLon)==null?void 0:Ut.zipCode)||"",tt=((yr=(wn=it?.data)==null?void 0:wn.geocodingByLatLon)==null?void 0:yr.state)||"",rt=((Ln=(mn=it?.data)==null?void 0:mn.geocodingByLatLon)==null?void 0:Ln.stateCode)||"";T({latitude:Wn,longitude:Wr,zipCode:Je,state:tt,stateCode:rt,placeId:N,description:w,value:N})}else T({latitude:Wn,longitude:Wr,zipCode:Yr,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)(()=>{C&&C(me||ue||D)},[C,me,ue,D]),(0,n.jsx)("div",{className:E,children:(0,n.jsx)(i.Select.ComboBox,{id:M,size:"md",isDisabled:S,inputValue:V,isLoading:ve||me||ue,placeholder:P("ADDRESS_AUTO_COMPLETE_PLACEHOLDER"),items:De,selectedKey:U,onSelectionChange:ze,onInputChange:_e,defaultFilter:Ie,onOpenChange:at,onBlur:ht,isInvalid: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)(i.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:(Z,l,e)=>{"use strict";e.d(l,{AddressTypeahead:()=>n.K});var n=e(19622),t=e(18077),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"DeviceLocationProvider")&&e.d(l,{DeviceLocationProvider:function(){return t.DeviceLocationProvider}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useDeviceLocationContext")&&e.d(l,{useDeviceLocationContext:function(){return t.useDeviceLocationContext}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},52113:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(87896);const s=({icon:i,title:o})=>{const{isSmallScreen:a}=useDeviceDetection();return jsx("div",{className:`tw-preflight mb-5 flex justify-center ${a?"-mx-5 -mt-5":""}`,children:jsxs("div",{className:`max-w bg-utility-blue-50 border-utility-blue-200 flex h-12 w-full flex-row items-center gap-3 border-t border-b pl-5 ${a?"":"rounded-lg border-r border-l"}`,children:[i??jsx(FileSearch02,{size:20}),jsxs(Typography,{className:"text-md text-primary font-normal",tag:"h3",children:[o,jsx("span",{className:"animate-pulse",children:"..."})]})]})})}},87858:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087),r=e(66267),s=e(64081),i=e(52449);const o=({className:a})=>{const{pathname:g}=useLocation(),c=useNavigationService(),u=useBreadcrumbsConfig(),{overrides:y}=useBreadcrumbsOverrideContext(),{loading:A,i18n:{t:m}}=useI18nChild({keys:["shared"]}),d=getPathSegments(g).flatMap(O=>{const v=c.getId(O),p=c.getRouteMeta(v)||{},h=getBreadcrumbTitleKey(v,p,u);if(!h||p.breadcrumbHide)return[];const f=y[v];let b=c.getHref(v),M=h;return f&&(f.href?b=f.href:f.search&&(b=c.getHref({id:v,search:f.search})),f.titleKey&&(M=f.titleKey)),[{routeId:v,href:b,label:m(M),onClick:f?.onClick}]});return A||d.length<=1?null:jsx(BreadcrumbsBase,{type:"button",className:cx("tw-preflight hidden lg:block",a),children:d.map(O=>jsx(BreadcrumbsBase.Item,{href:O.href,onClick:O.onClick,children:O.label},O.routeId))})}},85449:(Z,l,e)=>{"use strict";e.d(l,{rJ:()=>E,GU:()=>S});var n=e(31085),t=e(14041),r=e(76323),s=e(78579),i=e(76808),o=e(5380),a=e(87896),g=e(26877);const c=(C,R)=>new Promise((L,P)=>setTimeout(()=>P(new Error(R)),C)),u=(C,R,L)=>Promise.race([C,c(R,L)]),y=5e3,A=1e4;var m=Object.defineProperty,d=Object.defineProperties,O=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,f=(C,R,L)=>R in C?m(C,R,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[R]=L,b=(C,R)=>{for(var L in R||(R={}))p.call(R,L)&&f(C,L,R[L]);if(v)for(var L of v(R))h.call(R,L)&&f(C,L,R[L]);return C},M=(C,R)=>d(C,O(R)),x=(C,R,L)=>new Promise((P,D)=>{var N=q=>{try{V(L.next(q))}catch(I){D(I)}},w=q=>{try{V(L.throw(q))}catch(I){D(I)}},V=q=>q.done?P(q.value):Promise.resolve(q.value).then(N,w);V((L=L.apply(C,R)).next())});const z={enableHighAccuracy:!0,maximumAge:3e4,timeout:15e3},T=(0,t.createContext)({loading:!1,overrideSearchSettings:()=>Promise.resolve(),locationPermission:void 0,setLocationPermission:()=>{},position:void 0,refreshPosition:()=>Promise.resolve(void 0),requestPosition:()=>Promise.resolve(void 0),requestCurrentLocation:()=>Promise.resolve(),checkLocaitonPermission:()=>Promise.resolve(void 0)}),S=()=>(0,t.useContext)(T),E=({children:C})=>{var R;const{mobileOS:L}=(0,r.useDeviceDetection)(),P=(0,i.Ul)(),{geolocation:D}=(0,s.c)(),{queryParams:N,setQueryParams:w}=(0,a.useSearchQueryParams)(),V=(0,t.useRef)(!1),q=(0,t.useRef)(N);(0,t.useEffect)(()=>{q.current=N},[N]);const[I,k]=(0,t.useState)(!1),[U,F]=(0,t.useState)((R=N.locationPermission)!=null?R:void 0),[K,G]=(0,t.useState)(),[se,ie]=(0,t.useState)(!1),te=(0,t.useCallback)(ve=>{F(ve);try{w(M(b({},q.current),{locationPermission:ve||o.Ef.UNAVAILABLE}))}catch(Ee){Ee instanceof Error?P?.error(Ee,"Failed to update query params"):P?.error(`Failed to update query params - ${JSON.stringify(Ee)}`)}},[w,P]),pe=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return yield D.isAvailable()}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking geolocation availability"):P?.error(`Error checking geolocation availability - ${JSON.stringify(ve)}`),!1}}),[D,P]),be=(0,t.useCallback)(ve=>x(void 0,null,function*(){const Ee=D.getCurrentPosition(ve).then(De=>{if(!De||!De.coords)throw new Error("Location data is invalid or unavailable");return De});try{return yield u(Ee,y,"Location request timed out. Please check that location services are enabled.")}catch(De){throw De instanceof Error&&P?.error(De,"Geolocation timeout or error"),De}}),[D,P]),Se=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.checkPermission(),y,"Check permission timed out")}),[D]),ge=(0,t.useCallback)(()=>x(void 0,null,function*(){return u(D.requestPermission(),A,"Permission request timed out - user did not respond to permission dialog")}),[D]),ne=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield pe()))return P?.error("Location services not available"),!1;const Ee=yield Se();return Ee!==o.Ef.GRANTED&&Ee!==o.Ef.PROMPT?(P?.error(`Location permission not granted: ${Ee}`),!1):!0}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location services"):P?.error(`Error checking location services - ${JSON.stringify(ve)}`),!1}}),[pe,P,Se]);(0,t.useEffect)(()=>{if(V.current)return;V.current=!0,(()=>x(void 0,null,function*(){const Ee=N.locationPermission;if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){F(Ee);return}k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}if(Ee===o.Ef.GRANTED){try{const Ie=yield Se();if(Ie===o.Ef.GRANTED){const xe=yield be(z);xe&&(G(xe),te(o.Ef.GRANTED))}else Ie===o.Ef.PROMPT?(te(Ie),ie(!0)):te(Ie)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location with granted permission"):P?.error(`Error getting initial location with granted permission - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}return}const ze=yield Se();if(te(ze),ze===o.Ef.GRANTED)try{const Ie=yield be(z);Ie?G(Ie):te(o.Ef.UNAVAILABLE)}catch(Ie){Ie instanceof Error?P?.error(Ie,"Error getting initial location"):P?.error(`Error getting initial location - ${JSON.stringify(Ie)}`),te(o.Ef.UNAVAILABLE)}else ze===o.Ef.PROMPT&&ie(!0)}catch(De){De instanceof Error?P?.error(De,"Error initializing location permission"):P?.error(`Error initializing location permission - ${JSON.stringify(De)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}))()},[]);const ae=(0,t.useCallback)(()=>x(void 0,null,function*(){try{if(!(yield ne())){te(o.Ef.UNAVAILABLE);return}k(!0);let Ee=yield Se();if(te(Ee),Ee===o.Ef.GRANTED||Ee===o.Ef.PROMPT){if(L==="Android"&&Ee===o.Ef.GRANTED)try{Ee=yield ge(),te(Ee)}catch(De){De instanceof Error?P?.error(De,"Error re-requesting Android permission"):P?.error(`Error re-requesting Android permission - ${JSON.stringify(De)}`);return}if(Ee!==o.Ef.UNAVAILABLE){const De=yield be(z);return G(De),De}}return}catch(ve){te(o.Ef.UNAVAILABLE),ve instanceof Error?P?.error(ve,"Error refreshing location"):P?.error(`Error refreshing location - ${JSON.stringify(ve)}`);return}finally{k(!1)}}),[ne,P,L,te,be,Se,ge]),me=(0,t.useCallback)(()=>x(void 0,null,function*(){try{return(yield pe())?yield Se():o.Ef.UNAVAILABLE}catch(ve){return ve instanceof Error?P?.error(ve,"Error checking location permission"):P?.error(`Error checking location permission - ${JSON.stringify(ve)}`),o.Ef.UNAVAILABLE}}),[pe,P,Se]),he=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();te(Ee)}catch(ve){ve instanceof Error?P?.error(ve,"Error checking and setting location permission"):P?.error(`Error checking and setting location permission - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE)}finally{k(!1)}}),[pe,P,te,Se]),ce=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield Se();if(Ee===o.Ef.DENIED||Ee===o.Ef.BLOCKED||Ee===o.Ef.UNAVAILABLE){te(Ee);return}const De=yield ge();if(te(De),["granted","prompt"].includes(De)){const ze=yield be(z);return G(ze),ze}return}catch(ve){if(ve instanceof Error)ve.message.includes("User denied Geolocation")||P?.error(ve,"Error requesting location");else{const Ee=ve&&typeof ve=="object"&&"message"in ve?ve.message:JSON.stringify(ve);Ee?.includes("User denied Geolocation")||P?.error(`Error requesting location - ${Ee}`)}te(o.Ef.UNAVAILABLE);return}finally{k(!1)}}),[pe,P,te,be,ge,Se]),ue=(0,t.useCallback)(()=>x(void 0,null,function*(){k(!0);try{if(!(yield pe())){te(o.Ef.UNAVAILABLE);return}const Ee=yield be(z);Ee&&(G(Ee),F(o.Ef.GRANTED),w(M(b({},q.current),{location:`${Ee.coords.latitude},${Ee.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${Ee.coords.latitude}`,lng:`${Ee.coords.longitude}`,locationPermission:o.Ef.GRANTED})))}catch(ve){throw ve instanceof Error?P?.error(ve,"Error requesting current location"):P?.error(`Error requesting current location - ${JSON.stringify(ve)}`),te(o.Ef.UNAVAILABLE),ve}finally{k(!1)}}),[pe,P,w,te,be]),re=(0,t.useCallback)(()=>x(void 0,null,function*(){try{k(!0);const ve=yield ae();ve&&w(M(b({},q.current),{location:`${ve.coords.latitude},${ve.coords.longitude}`,locationType:o.iF.CURRENT_LOCATION,lat:`${ve.coords.latitude}`,lng:`${ve.coords.longitude}`,locationPermission:U||o.Ef.UNAVAILABLE}))}catch(ve){ve instanceof Error?P?.error(ve,"Error overriding search settings"):P?.error(`Error overriding search settings - ${JSON.stringify(ve)}`)}finally{k(!1)}}),[P,U,ae,w]),J=(0,t.useMemo)(()=>({loading:I,overrideSearchSettings:re,locationPermission:U,setLocationPermission:F,position:K,refreshPosition:ae,requestPosition: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:()=>ie(!1),title:"Find results nearby",description:"Enable location services to see results near you. We'll only use your location while you're searching."}),C]})}},82825:(Z,l,e)=>{"use strict";e.d(l,{GU:()=>n.GU,rJ:()=>n.rJ});var n=e(85449)},76260:(Z,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:()=>E,gD:()=>T,Vp:()=>Wr,Cx:()=>D,bK:()=>L,gi:()=>Yr,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_:()=>C,zO:()=>pe,UZ:()=>U,$7:()=>at,rb:()=>V,_W:()=>xt,WS:()=>ht,VF:()=>Ln,vf:()=>wn,PV:()=>dr,PS:()=>Ut,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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 i=({size:zn=24,color:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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"}));i.displayName="UserPlus01";var o=e(8957);const a=({size:zn=24,color:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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:sr="currentColor",...Dt})=>t.createElement("svg",{viewBox:"0 0 24 24",width:zn,height:zn,stroke:sr,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",E="http://hl7.org/fhir/questionnaire-item-control",C="http://hl7.org/fhir/StructureDefinition/questionnaire-maxOccurs",R="http://hl7.org/fhir/StructureDefinition/minValue",L="http://hl7.org/fhir/StructureDefinition/maxValue",P="http://icanbwell.com/fhir/StructureDefinition/minValue-error-message",D="http://icanbwell.com/fhir/StructureDefinition/maxValue-error-message",N="http://icanbwell.com/fhir/StructureDefinition/questionnaire-readOnlyExpression",w="http://icanbwell.com/fhir/StructureDefinition/navigation-linkId",V="http://hl7.org/fhir/StructureDefinition/questionnaire-supportLink",q="http://icanbwell.com/fhir/StructureDefinition/questionnaire-autocomplete",I="http://hl7.org/fhir/StructureDefinition/entryFormat",k="http://hl7.org/fhir/StructureDefinition/tz-code",U="tz-code",F="footer",K="check-box",G="header",se="page",ie="http://icanbwell.com/fhir/StructureDefinition/questionnaire-callNextQuestion",te="http://icanbwell.com/fhir/StructureDefinition/questionnaire-currentStep",pe="http://icanbwell.com/fhir/StructureDefinition/questionnaire-totalSteps",be=[{patterns:["pdf"],type:"pdf"},{patterns:["word","document"],type:"doc"},{patterns:["excel","spreadsheet"],type:"xlsx"},{patterns:["powerpoint","presentation"],type:"ppt"},{patterns:["image/jpeg"],type:"jpg"},{patterns:["image/png"],type:"png"},{patterns:["image/gif"],type:"gif"},{patterns:["image/svg"],type:"svg"},{patterns:["text/plain"],type:"txt"},{patterns:["zip"],type:"zip"},{patterns:["csv"],type:"csv"}],Se={"image/*":"image/*","application/pdf":".pdf","application/msword":".doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":".docx","image/jpeg":"image/jpeg","image/jpg":"image/jpg","image/png":"image/png","image/gif":"image/gif","image/webp":"image/webp","image/heic":"image/heic","image/heif":"image/heif","image/svg+xml":"image/svg+xml"},ge={"image/*":"Images",".pdf":"PDF",".doc":"DOCX",".docx":"DOCX","image/jpeg":"JPEG","image/jpg":"JPG","image/png":"PNG","image/gif":"GIF","image/webp":"WEBP","image/heic":"HEIC","image/heif":"HEIF","image/svg+xml":"SVG"},ne="ui-toolkit/CoordinatePicker",ae="ui-toolkit/DetailsInfo",me="ui-toolkit/ServiceChoice",he="ui-toolkit/InfoBanner",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",ht="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",Ut="http://icanbwell.com/fhir/StructureDefinition/trigger-text",wn="http://icanbwell.com/fhir/StructureDefinition/trigger-icon-name",yr="http://icanbwell.com/fhir/StructureDefinition/primary-button-text",mn="http://icanbwell.com/fhir/StructureDefinition/trigger-variant",Ln="http://icanbwell.com/fhir/StructureDefinition/trigger-color",dr="http://icanbwell.com/fhir/StructureDefinition/trigger-size",Wn="http://hl7.org/fhir/StructureDefinition/mimeType",Wr="http://hl7.org/fhir/StructureDefinition/maxSize",Yr="http://icanbwell.com/fhir/StructureDefinition/message-severity",It="http://icanbwell.com/fhir/StructureDefinition/alert-color",$e="http://icanbwell.com/fhir/StructureDefinition/hideLabel",it="http://icanbwell.com/fhir/StructureDefinition/placeholder",Je="http://icanbwell.com/fhir/StructureDefinition/hint-text",tt="ui-toolkit/PrefilledMemberDemographicsAlert",rt="http://hl7.org/fhir/issue-severity",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":i,"user-01":o.f,"user-x":a,"users-01":g,"search-sm":c,"info-circle":u.d,"help-circle":y.m,x:A.X,hash:m,"hash-02":d,"folder-heart":n.FolderHeart,"medical-cross":O,virus:v,pill:n.Pill,vaccine:n.Vaccine,"face-mask":n.FaceMask,"heart-beat":n.HeartBeat,"credit-card-02":p,"link-03":h,"search-lg":f.q,"clipboard-check":b,"clipboard-plus":M,route:x}},25624:(Z,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),i=e(91595),o=e(27779),a=e.n(o),g=e(45250),c=e.n(g),u=e(18807),y=e(76260),A=Object.defineProperty,m=Object.defineProperties,d=Object.getOwnPropertyDescriptors,O=Object.getOwnPropertySymbols,v=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,h=(mt,Qt,kt)=>Qt in mt?A(mt,Qt,{enumerable:!0,configurable:!0,writable:!0,value:kt}):mt[Qt]=kt,f=(mt,Qt)=>{for(var kt in Qt||(Qt={}))v.call(Qt,kt)&&h(mt,kt,Qt[kt]);if(O)for(var kt of O(Qt))p.call(Qt,kt)&&h(mt,kt,Qt[kt]);return mt},b=(mt,Qt)=>m(mt,d(Qt));const M=mt=>{var Qt;return(Qt=mt.filter(kt=>kt.url.includes("questionnaire-itemControl")).flatMap(kt=>{var Lt,Ft;return(Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)!=null?Ft:[]}).find(kt=>{var Lt;return(Lt=kt.code)==null?void 0:Lt.startsWith("ui-toolkit/")}))==null?void 0:Qt.code},x=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.V7);return kt?.valueCode||"off"},z=(mt,Qt,kt)=>{const Lt=(0,u.A)(kt);return mt&&Qt&&kt?Lt.replace("<p>",`<span>${Qt} `).replace("</p>","</span>").trim():Lt.replace("<p>","<span>").replace("</p>","</span>").trim()},T=mt=>{const Qt=mt?.find(kt=>kt.url===y.Vp);return Qt?.valueInteger},S=mt=>{const Qt=mt?.find(kt=>kt.url===y.Z_);return Qt?.valueInteger},E={date:"MM/DD/YYYY",choice:"Select an option"},C="Type your response here...",R=(mt,Qt)=>{const kt=mt?.find(Lt=>Lt.url===PLACEHOLDER_EXTENSION_URL);return kt?.valueString||Qt&&E[Qt]||C},L=mt=>{const Qt=mt?.find(kt=>kt.url===HINT_TEXT_EXTENSION_URL);return Qt?.valueString},P=mt=>{const Qt=mt?.filter(kt=>kt.url===y.GT&&kt.valueCode).map(kt=>y.hr[kt.valueCode]||kt.valueCode);return Qt?.length?Qt.join(","):void 0},D=mt=>mt.split(",").map(Lt=>Lt.trim()).map(Lt=>y.JL[Lt]||Lt).filter((Lt,Ft,Yt)=>Yt.indexOf(Lt)===Ft).join(", "),N=(mt,Qt,kt)=>{const Lt=D(mt),Ft=Lt.lastIndexOf(","),Yt=Ft!==-1?`${Lt.substring(0,Ft)} or${Lt.substring(Ft+1)}`:Lt,On=[Qt&&`max. ${(Qt/(1e3*1e3)).toFixed(0)}MB`,kt&&`upto ${kt} file${kt>1?"s":""}`].filter(Boolean);return On.length>0?`${Yt} (${On.join(", ")})`:Yt},w=mt=>{const Qt=mt?.find(kt=>kt?.url===y.zD||kt?.url===y.UZ);return Qt?.valueCode||Intl.DateTimeFormat().resolvedOptions().timeZone},V=(mt,Qt)=>{var kt,Lt,Ft;const Yt=Qt?.find(On=>On.url.includes(mt));return(Ft=(Lt=(kt=Yt?.valueInteger)!=null?kt:Yt?.valueDecimal)!=null?Lt:Yt?.valueString)!=null?Ft:Yt?.valueDate},q=mt=>{if(!!mt){if(/^\d{4}-\d{2}-\d{2}$/.test(mt))return mt;try{const Qt=(0,o.evaluate)({},mt);if(Array.isArray(Qt)&&Qt.length>0){const kt=Qt[0];if(kt instanceof Date&&!isNaN(kt.getTime())){const Lt=kt.getFullYear(),Ft=String(kt.getMonth()+1).padStart(2,"0"),Yt=String(kt.getDate()).padStart(2,"0");return`${Lt}-${Ft}-${Yt}`}if(typeof kt=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(kt))return kt}}catch{}}},I=(mt,Qt)=>{var kt,Lt;const Ft=Qt?.find(On=>On.url===mt);if(!Ft)return;const Yt=(kt=Ft.valueString)!=null?kt:Ft.valueDate;return Yt||q((Lt=Ft.valueExpression)==null?void 0:Lt.expression)},k=(mt,Qt)=>{if(!(!mt||mt.length===0))for(const kt of mt){const Lt=V(Qt,kt.extension);if(Lt!==void 0)return Lt;if(kt.item&&kt.item.length>0){const Ft=k(kt.item,Qt);if(Ft!==void 0)return Ft}}},U=(mt,Qt)=>{try{const kt=String(mt??Qt);let Lt;if(kt.includes("/"))Lt=(0,n.A)(kt,"MM/dd/yyyy",new Date);else{const Ft=kt.split("T")[0];Lt=(0,t.A)(Ft)}return(0,r.A)(Lt)}catch(kt){return console.error("Date parsing error:",kt,mt),null}},F=(mt,Qt)=>{var kt;for(const Lt of mt){if(Lt.linkId===Qt)return Lt;if((kt=Lt.item)!=null&&kt.length){const Ft=F(Lt.item,Qt);if(Ft!==void 0)return Ft}}},K=(mt,Qt)=>{var kt;const Lt=[];for(const Ft of mt)if(Ft.linkId===Qt&&Lt.push(Ft),(kt=Ft.item)!=null&&kt.length){const Yt=K(Ft.item,Qt);Lt.push(...Yt)}return Lt},G=(mt,Qt,kt=0)=>K(mt,Qt)[kt];function se(mt){return mt!=null}const ie=(mt,Qt)=>{var kt,Lt,Ft;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((Ft=(Lt=(kt=Qt?.valueDate)!=null?kt:Qt?.valueDateTime)!=null?Lt:Qt?.valueTime)!=null?Ft:""),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,kt)=>{const Lt=Ft=>{const Yt=K(kt,Ft.question);return Yt.length===0||Yt.every(On=>!On.answer||On.answer.length===0)?ie(Ft,void 0):Yt.some(On=>{var Sr;return(Sr=On.answer)==null?void 0:Sr.some(jr=>ie(Ft,jr&&Object.keys(jr).length>0?jr:void 0))})};return mt&&mt?.length>0?Qt==="any"?mt?.some(Ft=>Lt(Ft)):mt?.every(Ft=>Lt(Ft)):!0},pe=(mt,Qt,kt,Lt,Ft)=>{if(!mt||mt.length===0)return!0;const Yt=On=>{var Sr;let jr;if(Lt&&typeof Ft=="number"){const Pn=kt.filter(rn=>rn.linkId===Lt)[Ft];if(Pn?.item){const rn=Pn.item.find(bt=>bt.linkId===On.question);if(rn?.answer&&rn.answer.length>0)return(Sr=rn?.answer)==null?void 0:Sr.some(bt=>ie(On,bt&&Object.keys(bt).length>0?bt:void 0))}}if(!jr){const Rn=K(kt,On.question);if(Rn.length>0)return Rn.some(Pn=>{var rn;return(rn=Pn.answer)==null?void 0:rn.some(bt=>ie(On,bt&&Object.keys(bt).length>0?bt:void 0))});jr=void 0}return ie(On,jr)};return Qt==="any"?mt.some(On=>Yt(On)):mt.every(On=>Yt(On))},be=(mt,Qt)=>{var kt;if(!!((kt=mt?.valueExpression)!=null&&kt.expression))try{const Lt=evaluate(Qt,mt.valueExpression.expression);return Array.isArray(Lt)?Lt.some(Ft=>Boolean(Ft)):Boolean(Lt)}catch{return}},Se=(mt,Qt)=>{var kt;const Lt=(kt=mt.extension)==null?void 0:kt.find(Yt=>Yt.url===READ_ONLY_EXPRESSION_EXTENSION_URL),Ft=be(Lt,Qt);return b(f({},mt),{readOnly:Ft??mt.readOnly})},ge=(mt,Qt,kt)=>{const{required:Lt,maxLength:Ft,type:Yt,extension:On,enableWhen:Sr,enableBehavior:jr,repeats:Rn,answerOption:Pn}=mt;if(!te(Sr,jr,Qt)||mt.type==="group"||mt.type==="display")return"";if(Rn)return ne(mt,Qt,kt);const rn=ce(mt,Qt);return rn&&ue(rn,mt)?re(mt,Qt,kt,rn):he(On,Yt,Lt,Ft,kt,Pn)},ne=(mt,Qt,kt)=>{const{required:Lt}=mt;if(Lt){if(!kt||kt.length===0)return"At least one item is required";let Ft=!1;for(let Yt=0;Yt<kt.length;Yt++){const On=kt[Yt];if(On&&Object.keys(On).length>0&&Object.values(On).some(jr=>jr!=null&&jr!==""&&(Array.isArray(jr)?jr.length>0:!0))){Ft=!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(!Ft)return"At least one item is required"}else if(kt&&kt.length>0)for(let Ft=0;Ft<kt.length;Ft++){const Yt=kt[Ft];if(Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(Sr=>Sr!=null&&Sr!==""&&(Array.isArray(Sr)?Sr.length>0:!0))){const Sr=he(mt.extension,mt.type,!1,mt.maxLength,[Yt],mt.answerOption);if(Sr)return`Item ${Ft+1}: ${Sr}`;if(mt.item&&mt.item.length>0){const jr=ae(mt.item,Qt,mt.linkId,Ft);if(jr)return`Item ${Ft+1}: ${jr}`}}}return""},ae=(mt,Qt,kt,Lt)=>{var Ft,Yt;for(const On of mt){if(!pe(On.enableWhen,On.enableBehavior,Qt,kt,Lt))continue;const Sr=F(Qt,kt),jr=(Ft=Sr?.item)==null?void 0:Ft.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,kt,Lt,Ft,Yt)=>{var On,Sr,jr,Rn,Pn;let rn="";const bt=!!mt?.find(En=>{var Xn,wr;return En.url===y.gD&&((wr=(Xn=En.valueCodeableConcept)==null?void 0:Xn.coding)==null?void 0:wr.some($r=>$r.system===y.n4&&$r.code===y.GI))}),St=Ft?.[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":((Sr=St?.valueCoding)==null?void 0:Sr.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:()=>kt&&(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),Xn=V("regexError",mt),wr=Xn??"Please enter a valid url starting from http:// and https://";return En&&Qt==="url"&&un&&!En.test(un)?String(wr):""},regex:()=>{const En=V("regex",mt);if(!En||typeof un!="string")return"";const Xn=new RegExp(En),wr=V("regexError",mt),$r=wr??"Please enter a valid input";return Xn&&un&&!Xn.test(un)?String($r):""},dateTime:()=>{if(Qt==="dateTime"&&un){const En=un?.toString(),Xn=new Date(En);return isNaN(Xn.getTime())?"Please enter a valid date-time":""}return""},date:()=>{if(Qt!=="date"||!un)return"";const En=un.replace(/\D/g,"");return En.length>0&&En.length<8||isNaN(new Date(un).getTime())?"Invalid date":""},minValue:()=>{var En;if(Qt==="date"){const wr=I(y.dU,mt),$r=U(wr??"01/01/1900","01/01/1900"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,s.A)(Kr,$r)){const d0=(En=mt?.find(Di=>Di.url===y.Ck))==null?void 0:En.valueString;return d0??`Date should not be before ${wr??"01/01/1900"}`}return""}const Xn=V("minValue",mt);return Xn!=null&&un!==null&&un!==void 0&&un<Xn?`Input should not be less than ${Xn}`:""},maxValue:()=>{var En;if(Qt==="date"){const wr=I(y.bK,mt),$r=U(wr??"01/01/2100","01/01/2100"),Kr=U(un,"");if(!$r||!Kr)return"";if((0,i.A)(Kr,$r)){const d0=(En=mt?.find(Di=>Di.url===y.Cx))==null?void 0:En.valueString;return d0??`Date should not be after ${wr??"01/01/2100"}`}return""}const Xn=V("maxValue",mt);return Xn!=null&&un!==null&&un!==void 0&&un>Xn?`Input should not exceed ${Xn}`:""}};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 kt of Qt)if(kt.item){if(kt.item.find(Yt=>Yt.linkId===mt.linkId))return kt;const Ft=ce(mt,kt.item);if(Ft)return Ft}return null},ue=(mt,Qt)=>{if(mt.answer&&mt.answer.length>1)return!0;if(mt.item){const kt=mt.item.find(Lt=>Lt.linkId===Qt.linkId);if(kt&&kt.answer&&kt.answer.length>1)return!0}return!1},re=(mt,Qt,kt,Lt)=>{var Ft,Yt;const{required:On}=mt,Sr=(Ft=Lt.item)==null?void 0:Ft.find(Pn=>Pn.linkId===mt.linkId),jr=Sr?.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 kt of mt){if(kt?.linkId===Qt)return kt;if(kt?.item&&kt.item.length>0){const Lt=J(kt.item,Qt);if(Lt)return Lt}}},ve=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===FOOTER_CODE))}))},Ee=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>kt.url===y.oA&&kt.valueBoolean))},De=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===HEADER_CODE))}))},ze=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===y.gD&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===y.n4&&Yt.code===y._l))}))},Ie=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>kt.url===QUESTIONNAIRE_CALL_NEXT_QUESTION_EXTENSION_URL&&kt.valueBoolean))},xe=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>{var Lt,Ft;return kt.url===ITEM_CONTROL_EXTENSION_URL&&((Ft=(Lt=kt.valueCodeableConcept)==null?void 0:Lt.coding)==null?void 0:Ft.some(Yt=>Yt.system===ITEM_CONTROL_EXTENSION_CODING_SYSTEM&&Yt.code===CHECKBOX_CODE))}))},_e=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.fe);return kt?.valueInteger},at=mt=>{var Qt;const kt=(Qt=mt.extension)==null?void 0:Qt.find(Lt=>Lt.url===y.zO);return kt?.valueInteger},ht=mt=>{var Qt;const kt=(Qt=mt?.extension)==null?void 0:Qt.find(Lt=>Lt.url===QUESTIONNAIRE_TOTAL_STEPS_EXTENSION_URL);return kt?.valueInteger},xt=(mt,Qt,kt,Lt,Ft,Yt)=>{const On=jr=>Qt.filter(Rn=>Rn.linkId===jr),Sr=new Set;return mt.map(jr=>{if(Sr.has(jr.linkId)||ve(jr))return null;const Pn=On(jr.linkId),rn=jr.type==="group"&&jr.repeats;if(Sr.add(jr.linkId),rn){const bt=[];if(Pn.forEach((St,Zt)=>{const un={linkId:jr.linkId,text:jr.text};let on;if(kt===jr.linkId&&typeof Yt=="number"&&Yt===Zt&&Ft&&Ft.length>0){const En=St?.item||[];on=[...En],Ft.forEach(Xn=>{const wr=on.findIndex($r=>$r.linkId===Xn.linkId);wr>=0?on[wr]=b(f({},En[wr]),{answer:Xn.answer}):on.push(Xn)})}else jr.item&&(on=xt(jr.item,St?.item||[],kt,Lt,Ft,Zt));kt===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)}),kt===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&&Ft&&Ft.length>0?Zt.item=Ft: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"&&kt===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||[],kt,Lt,Ft,Yt):void 0,Zt=St&&St.length>0,un={linkId:jr.linkId,text:jr.text};return kt&&jr.linkId===kt&&typeof Yt!="number"?(Lt||!Lt&&!Ft?un.answer=Lt:bt?.answer&&(un.answer=bt.answer),Ft?un.item=Ft: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 kt of mt)if(kt.linkId===Qt||kt.item&&Xt(kt.item,Qt))return kt.linkId;return null},Kt=(mt,Qt,kt,Lt)=>{var Ft;const Yt=(Ft=mt?.item)!=null?Ft:Lt;return!Yt||Yt.length===0?!0:Yt.every(On=>{var Sr;const jr=K(Qt,On.linkId);if(jr.length===0){const Rn=(Sr=F(Qt,On.linkId))==null?void 0:Sr.answer;if(ge(On,Qt,Rn)&&te(On.enableWhen,On.enableBehavior,Qt)&&kt.includes(On.linkId))return!1}else for(const Rn of jr)if(ge(On,Qt,Rn.answer)&&te(On.enableWhen,On.enableBehavior,Qt)&&kt.includes(On.linkId))return!1;return On.item?Kt(On,Qt,kt):!0})},Ct=(mt,Qt,kt=!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,kt))return!0;return!1},Xe=(mt,Qt,kt=0)=>{const Lt=mt.filter(Ft=>Ft.linkId===Qt);if(Lt.length>kt){const Ft=Lt[kt];if(Ft.answer&&Ft.answer.length>0)return Ft.answer.some(Yt=>Yt&&Object.keys(Yt).length>0&&Object.values(Yt).some(On=>On!=null&&On!==""));if(Ft.item&&Ft.item.length>0)return Ct(Ft.item,Qt,!1)}return Ct(mt,Qt,!1)},We=(mt,Qt)=>{if(!mt||!mt.item)return!1;const kt=Lt=>{var Ft;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(!((Ft=Yt?.answer)!=null&&Ft.length)||On)return!0}if(Lt.item){for(const Yt of Lt.item)if(kt(Yt))return!0}return!1};for(const Lt of mt.item)if(kt(Lt))return!0;return!1},Ot=mt=>{var Qt,kt,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(((kt=mt.valueReference)==null?void 0:kt.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 kt=mt.answer.map(Lt=>Ot(Lt)).filter(Lt=>Lt!==void 0);kt.length>0&&(Qt.answer=kt)}if(mt.item&&mt.item.length>0){const kt=mt.item.map(Lt=>Ye(Lt)).filter(Lt=>{const Ft=Object.keys(Lt);return Ft.length>1||Ft.length===1&&Ft[0]!=="linkId"});kt.length>0&&(Qt.item=kt)}return Qt},Qe=(mt,Qt,kt,Lt,Ft,Yt)=>{var On;const Sr=(On=Qt?.item)==null?void 0:On[kt[Lt]],jr=Sr?.linkId;if(!jr)return!1;const Rn=K(mt,jr),Pn=K(Ft,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,kt)=>kt&&kt.length>0&&!(kt.length===1&&Object.keys(kt[0]).length===0)&&ge(mt,Qt,kt)||null,hn=(mt,Qt)=>{const kt={},Lt=Ft=>{Ft.forEach(Yt=>{const On=K(Qt,Yt.linkId);if(st(Yt,mt)||Yt.repeats)for(let Sr=0;Sr<On.length;Sr++){const jr=On[Sr];if(jr?.answer&&jr.answer.length>0){const Rn=Pt(Yt,Qt,jr.answer);Rn&&(kt[Yt.linkId]=b(f({},kt[Yt.linkId]),{[Sr]:Rn}))}}else{const Sr=F(Qt,Yt.linkId);if(Sr?.answer&&Sr.answer.length>0){const jr=Pt(Yt,Qt,Sr.answer);jr&&(kt[Yt.linkId]={0:jr})}}Yt.item&&Yt.item.length>0&&Lt(Yt.item)})};return Lt(mt),kt},Sn=mt=>{if(!mt)return"";const Qt=mt.split("-");if(Qt.length===3){const[kt,Lt,Ft]=Qt;return`${kt.slice(-4)}-${Lt}-${Ft}`}return""},et=mt=>mt.trim().replace(/[A-Za-z]+/g,""),Rt=(mt,Qt)=>{const kt=(Lt,Ft)=>{for(const Yt of Lt){if(Yt.linkId===Ft)return Yt.answer;if(Yt.item&&Yt.item.length>0){const On=kt(Yt.item,Ft);if(On!==void 0)return On}}};return kt(mt,Qt)},Ut=(mt,Qt)=>{if(!Qt||Qt.length===0)return null;const kt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const Sr of Ft){const jr=[...On,Sr];if(Sr.item){if(Sr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>rn.repeats===!0)?Sr:null;if(Lt(Sr.item,Yt,jr))return Sr}}return null};return Lt(Qt,kt)},wn=(mt,Qt)=>{if(!Qt||Qt.length===0)return!1;const kt=mt.linkId,Lt=(Ft,Yt,On=[])=>{for(const Sr of Ft){const jr=[...On,Sr];if(Sr.item){if(Sr.item.some(rn=>rn.linkId===Yt))return jr.some(rn=>{const bt=M(rn.extension||[]);return!!bt&&bt!==UI_TOOLKIT_FORM_CONTAINER});if(Lt(Sr.item,Yt,jr))return!0}}return!1};return Lt(Qt,kt)},yr=(mt,Qt,kt)=>{const Lt={};if(!mt)return Lt;const{linkId:Ft}=Qt;if(mt[Ft]){const Yt=mt[Ft];Lt[Ft]=Yt[kt]||""}return Qt.item&&Qt.item.length>0&&Qt.item.forEach(Yt=>{if(mt[Yt.linkId]){const On=mt[Yt.linkId];Lt[Yt.linkId]=On[kt]||""}}),Lt},mn=(mt,Qt)=>{const kt={};if(!mt||!mt[Qt])return kt;const Lt=mt[Qt];return kt[Qt]=Lt[0]||"",kt},Ln=mt=>{const Qt=mt.findIndex(Yt=>!Ee(Yt)),kt=Qt>=0?[Qt]:[],Lt=new Map;let Ft=null;if(mt.forEach((Yt,On)=>{const Sr=ze(Yt);if(Sr&&Yt.type==="group")On!==Qt&&kt.push(On),Lt.set(On,[On]),Ft=On;else if(Ft!==null&&!Sr){const jr=Lt.get(Ft)||[];Lt.set(Ft,[...jr,On])}}),mt.length>0&&kt.length>0){const Yt=kt[0];if(!Lt.has(Yt)){const On=kt.find(jr=>jr>Yt),Sr=[];for(let jr=Yt;jr<(On??mt.length);jr++)Sr.push(jr);Lt.set(Yt,Sr)}}return{groupIndices:kt,itemsToRenderMap:Lt}},dr=(mt,Qt,kt,Lt)=>{let Ft=[...Lt];const Yt=(On,Sr)=>{On.forEach(jr=>{if((!jr?.enableWhen||te(jr?.enableWhen,jr.enableBehavior,Sr))&&jr.initial&&!Ct(Sr,jr.linkId))if(jr.repeats){const Rn=Sr.filter(Pn=>Pn.linkId===jr.linkId);Rn.length>0?Rn.forEach((Pn,rn)=>{Xe(Sr,jr.linkId,rn)||(Ft=xt(kt,Ft,jr.linkId,jr.initial,void 0,rn))}):Ft=xt(kt,Ft,jr.linkId,jr.initial)}else Ft=xt(kt,Ft,jr.linkId,jr.initial);jr.item&&Yt(jr.item,Sr)})};return Yt(mt,Qt),Ft},Wn=(mt,Qt,kt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.required===Qt&&te(Yt.enableWhen,Yt.enableBehavior,kt)&&!Ee(Yt)&&Yt.type!=="display"&&Lt.push(Yt),Yt.item&&Yt.item.length>0&&Yt.item.forEach(Ft)};return mt.forEach(Ft),Lt},Wr=(mt,Qt)=>mt.every(kt=>{var Lt;const Ft=K(Qt,kt.linkId);if(Ft.length>0)return Ft.every(Yt=>!ge(kt,Qt,Yt.answer));{const Yt=(Lt=F(Qt,kt.linkId))==null?void 0:Lt.answer;return!ge(kt,Qt,Yt)}}),Yr=(mt,Qt)=>{let kt=-1;for(let Lt=mt.length-1;Lt>=0;Lt--)if(mt[Lt].linkId===Qt){kt=Lt;break}return kt},It=(mt,Qt)=>mt.filter(kt=>kt.linkId!==Qt).map(kt=>kt.item&&kt.item.length>0?b(f({},kt),{item:It(kt.item,Qt)}):kt),$e=(mt,Qt,kt=mt)=>mt.reduce((Lt,Ft)=>{const Yt=J(Qt,Ft.linkId);return Yt?.enableWhen&&!te(Yt.enableWhen,Yt.enableBehavior,kt)||(Ft.item&&Ft.item.length>0?Lt.push(b(f({},Ft),{item:$e(Ft.item,Qt,kt)})):Lt.push(Ft)),Lt},[]),it=(mt,Qt,kt=[])=>{const Lt=[],Ft=Yt=>{Yt.forEach(On=>{Lt.push(On.linkId),On.item&&On.item.length>0&&Ft(On.item)})};for(let Yt=0;Yt<mt.length;Yt++){const On=mt[Yt];if(On.linkId===Qt){const Sr=mt.slice(0,Yt+1),jr=mt.slice(Yt+1),{kept:Rn,removed:Pn}=jr.reduce((rn,bt)=>{const St=J(kt,bt.linkId);return!St||Ee(St)&&te(St.enableWhen,St.enableBehavior,Sr)?rn.kept.push(bt):rn.removed.push(bt),rn},{kept:[],removed:[]});return Ft(Pn),{trimmedData:[...Sr,...Rn],trimmedLinkIds:Lt,found:!0}}if(On.item&&On.item.length>0){const Sr=it(On.item,Qt,kt);if(Sr.found){const jr=mt.slice(0,Yt),Rn=mt.slice(Yt+1),Pn=[...jr,b(f({},On),{item:Sr.trimmedData})],{kept:rn,removed:bt}=Rn.reduce((St,Zt)=>{const un=J(kt,Zt.linkId);return!un||Ee(un)&&te(un.enableWhen,un.enableBehavior,Pn)?St.kept.push(Zt):St.removed.push(Zt),St},{kept:[],removed:[]});return Ft(bt),{trimmedData:[...Pn,...rn],trimmedLinkIds:[...Sr.trimmedLinkIds,...Lt],found:!0}}}}return{trimmedData:mt,trimmedLinkIds:[],found:!1}},Je=(mt,Qt)=>mt.filter(kt=>!Qt.includes(kt.linkId)).map(kt=>kt.item&&kt.item.length>0?b(f({},kt),{item:Je(kt.item,Qt)}):kt),tt=mt=>{var Qt;if(!mt)return"empty";const kt=y.Z$.find(({patterns:Lt})=>Lt.some(Ft=>mt.includes(Ft)));return(Qt=kt?.type)!=null?Qt:"empty"},rt=(mt,Qt)=>{const{groupIndices:kt}=Ln(mt),Lt=mt.findIndex(Ft=>Ft.linkId===Qt);return Lt!==-1?kt.indexOf(Lt):-1},lt=mt=>{if(!mt)return{restriction:null,warning:null};const Qt=kt=>{const Lt=mt.find(Yt=>Yt.url===kt&&Yt.valueString);if(!Lt?.valueString)return null;const Ft=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 Ft.length===0?null:Ft.length===1?{isList:!1,items:Ft}:{isList:!0,items:Ft}};return{restriction:Qt("restriction"),warning:Qt("warning")}},Et=(mt,Qt)=>{var kt;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((kt=Qt.decimals)!=null?kt: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 kt=mt.linkId,Lt=(Yt,On,Sr=[])=>{for(const jr of Yt){const Rn=[...Sr,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[]},Ft=Lt(Qt,kt);return Ft.length>0?Ft[Ft.length-1]:null},le=(mt,Qt)=>{if(!mt?.item)return[];const kt=[];for(const Lt of mt.item){if(Lt.type!=="group")continue;te(Lt.enableWhen,Lt.enableBehavior,Qt||[])&&Lt.linkId&&kt.push(Lt.linkId)}return kt},ye=(mt,Qt)=>{const kt=le(mt,Qt||void 0);return kt[kt.length-1]},Ue=({questionnaire:mt,extensionUrl:Qt,errorCode:kt})=>{if(!kt||!mt?.item)return;const Lt=mt.item.find(Ft=>{var Yt;return(Yt=Ft.extension)==null?void 0:Yt.some(On=>On.url===Qt&&On.valueString===kt)});return Lt?.linkId},Te=(mt,Qt)=>{var kt;const Lt=(kt=mt.extension)==null?void 0:kt.find(Yt=>Yt.url===y.rb);if(!Lt?.valueString)return;const Ft=Lt.valueString;return J(Qt,Ft)},zt=mt=>{var Qt;return!!((Qt=mt.extension)!=null&&Qt.find(kt=>kt.url===y.rb))},Gt=(mt,Qt)=>mt.filter(kt=>kt.linkId!==Qt).map(kt=>kt.item&&kt.item.length>0?b(f({},kt),{item:Gt(kt.item,Qt)}):kt),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),sr=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 kt,Lt,Ft;if(!mt.answerOption)return;const Yt=F(Qt,mt.linkId),On=(Ft=(Lt=(kt=Yt?.answer)==null?void 0:kt[0])==null?void 0:Lt.valueCoding)==null?void 0:Ft.code;if(!On)return;const Sr=mt.answerOption.find(jr=>{var Rn;return((Rn=jr.valueCoding)==null?void 0:Rn.code)===On});if(!!Sr)return we(Sr.extension)},At=(mt,Qt)=>{const kt={},Lt=Ft=>{if(!!Ft)for(const Yt of Ft){const On=Dt(Yt);if(On){let Sr;switch(Yt.type){case"choice":Sr=Ze(Yt,Qt);break;default:break}Sr&&(kt[On]=Sr)}Yt.item&&Yt.item.length>0&&Lt(Yt.item)}};return Lt(mt.item),kt},en=mt=>!!(mt.initial&&mt.initial.length>0),nn=(mt,Qt,kt)=>{if(!mt)return[];const Lt=[],Ft=Yt=>{Yt.forEach(On=>{if(kt&&kt.includes(On.linkId))return;const Sr=Ee(On),jr=Qt.includes(On.linkId);(jr||Sr&&On.required)&&Lt.push(On),jr&&On.item&&On.item.length>0&&Ft(On.item)})};return Ft(mt),Lt},fn=(mt,Qt,kt,Lt,Ft,Yt)=>{var On;if(kt<0||!Lt?.item)return!0;const Sr=Ft.current[kt],jr=kt+1,Rn=Ft.current[jr],Pn=kt===0?0:Sr,rn=Rn??Lt.item.length,bt=[];for(let En=Pn;En<rn;En++){const Xn=(On=Lt?.item)==null?void 0:On[En];if(Xn){if(Yt&&Yt.includes(Xn.linkId))continue;const wr=Ee(Xn);(Qt.includes(Xn.linkId)||wr&&Xn.required)&&bt.push(Xn),Xn.item&&Xn.item.length>0&&bt.push(...nn(Xn.item,Qt,Yt))}}const St=bt.filter(En=>En.required===!0),Zt=bt.filter(En=>En.required!==!0),un=Wr(St,mt),on=Zt?.every(En=>{var Xn;const wr=(Xn=F(mt,En.linkId))==null?void 0:Xn.answer;return wr?!ge(En,mt,wr):!0});return!St?.length||un&&on}},28058:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=e(36087),s=e(8322),i=e(76260),o=e(25624);const a=({item:fr})=>{const r0=fr.text||"",Fr=fr.extension||[],Ui=ko=>{var Do;return(Do=Fr.find(bo=>bo.url===ko))==null?void 0:Do.valueString},mo=Ui(i.$7),Co=Ui(i.pc)||"default";return(0,n.jsx)(r.AlertFloating,{title:r0,description:mo??"",color:Co})};var g=e(7630),c=e(16212),u=Object.defineProperty,y=Object.getOwnPropertySymbols,A=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,d=(fr,r0,Fr)=>r0 in fr?u(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,O=(fr,r0)=>{for(var Fr in r0||(r0={}))A.call(r0,Fr)&&d(fr,Fr,r0[Fr]);if(y)for(var Fr of y(r0))m.call(r0,Fr)&&d(fr,Fr,r0[Fr]);return fr};const v=({item:fr})=>{const[r0,Fr]=(0,t.useState)(!1),Ui=fr.extension||[],mo=nr=>{var gn;return(gn=Ui.find(Un=>Un.url===nr))==null?void 0:gn.valueString},Co=mo(i.PS)||fr.text||"",ko=mo(i.Iz)||"button",Do=mo(i.VF),bo=mo(i.PV),Ro=mo(i.vf),go=Ro?i.JP[Ro]:void 0,br=mo(i.D_)||"",Qn=mo(i.$e),zr=mo(i.GQ),Le=mo(i.qT)||"gray",Ce=mo(i.hZ),Fe=mo(i.wG),pt=mo(i.q3),qt=zr?i.JP[zr]:void 0,tn=()=>Fr(!0),In=()=>{switch(ko){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":Co||br||void 0,children:[go&&(0,n.jsx)(go,{"aria-hidden":!0,className:"text-fg-tertiary size-5"}),Co&&(0,n.jsx)("span",{className:"text-sm",children:Co})]});default:return(0,n.jsx)(r.Button,{color:Do??"secondary",size:bo??"md",iconLeading:go,onClick:tn,"aria-label":Co,children:Co})}};return(0,n.jsxs)(n.Fragment,{children:[In(),(0,n.jsx)(r.Modal,O(O(O({id:`modal-${fr.linkId}`,isOpen:r0,onOpenChange:Fr,title:{content:br},description:{content:Qn?(0,n.jsx)("div",{className:"tw-preflight [&>ul]:flex [&>ul]:list-disc [&>ul]:flex-col [&>ul]:gap-2.5 [&>ul]:pl-5",dangerouslySetInnerHTML:{__html:c.Wp.sanitizeHtml(Qn)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},qt?{featuredIcon:{icon:qt,color:Le,size:"lg",className:"bg-white"}}:{}),Ce?{primaryButton:{children:Ce,onClick:()=>{var nr,gn;Fe==="open-zendesk"&&((gn=(nr=globalThis.zE)==null?void 0:nr.activate)==null||gn.call(nr,{hideOnClose:!0})),Fr(!1)}}}:{}),pt?{secondaryButton:{children:pt,onClick:()=>Fr(!1)}}:{}))]})};var p=e(18522);const h=({item:fr})=>{var r0,Fr,Ui,mo,Co,ko,Do,bo,Ro,go,br,Qn;const{hasExternalError:zr}=(0,p.c)(),Le=fr.text||"",Ce=(Fr=(r0=fr.extension)==null?void 0:r0.find(Vr=>Vr.url===i.ao))==null?void 0:Fr.valueString,Fe=zr&&Ce?Ce:Le,pt=(mo=(Ui=fr.extension)==null?void 0:Ui.find(Vr=>Vr.url===i.$7))==null?void 0:mo.valueString,qt=(ko=(Co=fr.extension)==null?void 0:Co.find(Vr=>Vr.url===i.el))==null?void 0:ko.valueString,tn=zr&&qt?qt:pt,In=(bo=(Do=fr.extension)==null?void 0:Do.find(Vr=>Vr.url===i.g4))==null?void 0:bo.valueString,nr=(go=(Ro=fr.extension)==null?void 0:Ro.find(Vr=>Vr.url===i.Fp))==null?void 0:go.valueString,gn=In?i.JP[In]:void 0,Un=nr?i.JP[nr]:void 0,cn=zr&&Un?Un:gn,ur=((Qn=(br=fr.extension)==null?void 0:br.find(Vr=>Vr.url===i.WS))==null?void 0:Qn.valueString)===i._W.LEFT,Ir=ur?"items-start":"items-center",t0=ur?"text-left":"text-center",A0=ur?"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:zr&&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] ${t0} ${A0} md:max-w-[352px]`,children:Fe}),(0,n.jsx)("p",{className:`text-md text-secondary ${t0}`,children:tn})]})]})};var f=e(15297),b=e(17814),M=Object.defineProperty,x=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,S=(fr,r0,Fr)=>r0 in fr?M(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,E=(fr,r0)=>{for(var Fr in r0||(r0={}))z.call(r0,Fr)&&S(fr,Fr,r0[Fr]);if(x)for(var Fr of x(r0))T.call(r0,Fr)&&S(fr,Fr,r0[Fr]);return fr};const C=({item:fr})=>{const[r0,Fr]=(0,t.useState)(!1),Ui=(0,b.T$)(),mo=fr.extension||[],Co=Ce=>{var Fe;return(Fe=mo.find(pt=>pt.url===Ce))==null?void 0:Fe.valueString},ko=fr.text||"",Do=Co(i.PS)||"",bo=Co(i.D_)||"",Ro=Co(i.$e),go=Co(i.GQ),br=Co(i.qT)||"gray",Qn=Co(i.hZ),zr=Co(i.q3),Le=go?i.JP[go]: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:ko})]}),Do&&(0,n.jsx)("button",{type:"button",className:"text-link-primary cursor-pointer text-sm font-semibold",onClick:()=>Fr(!0),children:Do})]}),(0,n.jsx)(r.Modal,E(E(E({id:`modal-${fr.linkId}`,isOpen:r0,onOpenChange:Fr,title:{content:bo},description:{content:Ro?(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(Ro)}}):void 0},closeButton:{onCloseClick:()=>Fr(!1)}},Le?{featuredIcon:{icon:Le,color:br,size:"lg",className:"bg-white"}}:{}),Qn?{primaryButton:{children:Qn,onClick:()=>{Fr(!1),Ui.navigate({id:"profile"})}}}:{}),zr?{secondaryButton:{children:zr,onClick:()=>Fr(!1)}}:{}))]})},R=({item:fr,selectedAnswer:r0,handleInputChange:Fr})=>{var Ui,mo,Co;const ko=(Ui=fr.answerOption)!=null?Ui:[],Do=(Co=(mo=r0?.[0])==null?void 0:mo.valueCoding)==null?void 0:Co.code;return(0,n.jsx)("div",{className:"flex flex-col gap-3",children:ko.map(bo=>{var Ro,go,br,Qn,zr,Le,Ce;const Fe=(go=(Ro=bo.valueCoding)==null?void 0:Ro.code)!=null?go:"",pt=(Qn=(br=bo.valueCoding)==null?void 0:br.display)!=null?Qn:"",qt=Do===Fe,tn=(zr=bo.extension)==null?void 0:zr.find(Un=>Un.url===i.g4),In=(Le=bo.extension)==null?void 0:Le.find(Un=>Un.url===i.rz),nr=tn?.valueString?i.JP[tn.valueString]:void 0,gn=(Ce=In?.valueString)!=null?Ce:"";return(0,n.jsx)(r.SelectableOption,{icon:nr,title:pt,description:gn,isSelected:qt,onSelect:()=>{Fr(fr,[{valueCoding:{code:Fe,display:pt}}])}},Fe)})})};var L=e(72866),P=e(94043),D=e(94627);const N=({text:fr,isLabel:r0,required:Fr,className:Ui,id:mo})=>(0,n.jsxs)("p",{id:mo,className:Ui??"mb-md text-md",children:[(0,n.jsx)(r.Content,{as:"span",className:(0,P.cx)(r0&&"text-secondary text-sm font-medium sm:text-sm"),dangerouslySetInnerHTML:{__html:(0,D.p)(fr||"")}}),Fr&&(0,n.jsx)("span",{className:"text-brand-tertiary ml-1 text-sm font-medium","aria-hidden":"true",children:"*"})]}),w="(###) ###-####",V=(fr,r0)=>{const Fr=fr.replace(/\D/g,"");let Ui="",mo=0;for(let Co=0;Co<r0.length&&mo<Fr.length;Co++)r0[Co]==="#"?(Ui+=Fr[mo],mo++):Ui+=r0[Co];return Ui},q=fr=>{if(!fr)return w;const r0=fr.find(Fr=>Fr.url===i.Md);return r0?.valueString||w},I=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{var Do;const{linkId:bo,text:Ro,required:go,prefix:br,readOnly:Qn,extension:zr}=fr,Le=q(zr),Ce=((Do=Fr?.[0])==null?void 0:Do.valueString)||"",[Fe,pt]=(0,t.useState)("");(0,t.useEffect)(()=>{if(Ce){const gn=V(Ce,Le);pt(gn)}},[Ce,Le]);const qt=Ro?(0,o.nt)(mo,br,Ro):"",tn=Co?.[bo]||"",In=gn=>{const Un=V(gn,Le);pt(Un),Ui(fr,[{valueString:Un}])},nr=()=>{r0&&r0(bo)};return(0,n.jsxs)("div",{"data-testid":bo,children:[qt&&(0,n.jsx)(N,{isLabel:!0,text:qt,required:go||!1}),(0,n.jsx)(r.Input,{id:bo,"aria-label":bo,"data-testid":bo,type:"tel",placeholder:"Enter phone number",value:Fe,onChange:In,onBlur:nr,isDisabled:Qn||ko,isRequired:go,hint:tn,isInvalid:!!tn,size:"md"},bo)]})},k=({item:fr,questionnaireSchemaItems:r0})=>{var Fr;const{isLoading:Ui,setCurrentGroupIndex:mo}=(0,p.c)(),Co=(Fr=fr.extension)==null?void 0:Fr.find(Ro=>Ro.url===i.Uf),ko=Co?.valueString,Do=fr.text||"Save & continue",bo=()=>{if(ko){const Ro=(0,o.Ue)(r0||[],ko);Ro!==-1&&mo(Ro)}};return(0,n.jsx)("div",{"data-testid":fr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.Button,{className:"md:w-xxs h-10 w-full text-sm",color:"primary",isLoading:Ui,onClick:bo,isDisabled:fr.readOnly,children:Do})})},U=({size:fr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M10 16h4m-5.2 6h6.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C20 19.72 20 18.88 20 17.2V6.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C17.72 2 16.88 2 15.2 2H8.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C4 4.28 4 5.12 4 6.8v10.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C6.28 22 7.12 22 8.8 22ZM15 9a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}));U.displayName="Passport";var F=e(56327);const K=({size:fr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M5.316 19.438A4.001 4.001 0 0 1 9 17h6a4.001 4.001 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z"}));K.displayName="UserCircle";var G=e(14711);const se=({size:fr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"m2 7 8.165 5.715c.661.463.992.695 1.351.784a2 2 0 0 0 .968 0c.36-.09.69-.32 1.351-.784L22 7M6.8 20h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 17.72 22 16.88 22 15.2V8.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 4 18.88 4 17.2 4H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 6.28 2 7.12 2 8.8v6.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 20 5.12 20 6.8 20Z"}));se.displayName="Mail01";var ie=e(31165),te=e(14449),pe=e(27163);const be=fr=>{try{const r0=fr.match(/^(\d{4})-(\d{2})-(\d{2})/);if(!r0)return fr;const[,Fr,Ui,mo]=r0;return new Date(Date.UTC(parseInt(Fr),parseInt(Ui)-1,parseInt(mo))).toLocaleDateString("en-US",{weekday:"short",year:"numeric",month:"short",day:"numeric",timeZone:"UTC"})}catch{return fr}},Se=fr=>{try{if(fr.includes("AM")||fr.includes("PM"))return fr;const r0=fr.match(/T?(\d{2}):(\d{2}):(\d{2})/);if(!r0)return fr;const[,Fr,Ui]=r0,mo=parseInt(Fr),Co=mo>=12?"PM":"AM";return`${mo%12||12}:${Ui} ${Co}`}catch{return fr}},ge=(fr,r0,Fr=f.d)=>{var Ui;const mo=(Ui=fr.extension)==null?void 0:Ui.find(Co=>Co.url===i.g4);return mo?.valueString&&i.JP[mo.valueString]?i.JP[mo.valueString]:fr.linkId&&r0[fr.linkId]?r0[fr.linkId]:Fr},ne={"appointment-review/first-name":U,"appointment-review/last-name":U,"appointment-review/dob":F.V,"appointment-review/gender":K,"appointment-review/phone":G.b,"appointment-review/email":se,"appointment-review/vaccines":r.Vaccine,"appointment-review/appointment-date":F.V,"appointment-review/appointment-time":ie.z,"appointment-review/facility-name":r.HospitalBuilding,"appointment-review/facility-phone":G.b,"appointment-review/facility-address":te.X},ae=["appointment-review/appointment-date"],me=["appointment-review/appointment-time"],he=["appointment-review/facility-phone"],ce=["appointment-review/facility-address"],ue=["appointment-review/phone","appointment-review/facility-phone"],re=({item:fr,questionnaireSchemaItems:r0})=>{var Fr;const{setCurrentGroupIndex:Ui}=(0,p.c)(),{trackEvent:mo}=(0,s.st)(),Co=fr.item||[];if(Co.length===0)return null;const ko=(Fr=fr.extension)==null?void 0:Fr.find(go=>go.url===i.Uf),Do=ko?.valueString,bo=()=>{if(mo("edit_info_clicked",{section:fr.text,_event_metadata:{description:"When a user clicks the Edit info link on the confirm details page during booking an appointment"}}),Do){const go=(0,o.Ue)(r0||[],Do);go!==-1&&Ui(go)}},Ro=Co.map(go=>{let br="";if(go.initial&&go.initial.length>0){const Le=go.initial.map(Ce=>{var Fe,pt;let qt=((Fe=Ce.valueCoding)==null?void 0:Fe.display)||((pt=Ce.valueReference)==null?void 0:pt.display)||Ce.valueString||"";return qt&&typeof qt=="string"&&(ae.includes(go.linkId)?qt=be(qt):me.includes(go.linkId)&&(qt=Se(qt))),qt}).filter(Boolean);Le.length>1||go.repeats&&Le.length>0?br=Le:Le.length===1&&(br=Le[0])}if(!br||Array.isArray(br)&&br.length===0)return null;let Qn;he.includes(go.linkId)?Qn="phone":ce.includes(go.linkId)&&(Qn="address");let zr;return ue.includes(go.linkId)&&(zr="phone"),{Icon:ge(go,ne),label:go.text||go.linkId,value:br,linkType:Qn,displayType:zr}}).filter(Boolean);return Ro.length===0?null:(0,n.jsx)("div",{"data-testid":fr.linkId,children:(0,n.jsx)(pe.InfoCard,{title:fr.text||"Details",infoDetails:Ro,actionButtonText:Do&&"Edit info",onActionButtonClick:Do?bo:void 0})})},J=({size:fr=24,color:r0="currentColor",...Fr})=>t.createElement("svg",{viewBox:"0 0 24 24",width:fr,height:fr,stroke:r0,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...Fr},t.createElement("path",{d:"M12 9v4m0 4h.01M10.615 3.892 2.39 18.098c-.456.788-.684 1.182-.65 1.506a1 1 0 0 0 .406.705c.263.191.718.191 1.629.191h16.45c.91 0 1.365 0 1.628-.191a1 1 0 0 0 .407-.705c.034-.324-.195-.718-.65-1.506L13.383 3.892c-.454-.785-.681-1.178-.978-1.31a1 1 0 0 0-.813 0c-.296.132-.523.525-.978 1.31Z"}));J.displayName="AlertTriangle";var ve=e(18807);const Ee=({item:fr})=>{const{setHideFooterButton:r0,incrementCustomErrorCount:Fr,decrementCustomErrorCount:Ui}=(0,p.c)();return(0,t.useEffect)(()=>(r0(!0),Fr(),()=>{r0(!1),Ui()}),[r0,Fr,Ui]),(0,n.jsx)("div",{"data-testid":fr.linkId,className:"flex w-full justify-center",children:(0,n.jsx)(r.EmptyState,{className:"mt-5xl",description:(0,n.jsx)(r.Content,{as:"span",dangerouslySetInnerHTML:{__html:(0,ve.p)(fr.text||"")}}),featuredIconProps:{icon:(0,n.jsx)(J,{}),color:"gray",className:"rounded-full shadow-0 ring-bg-primary"}})})},De={information:"info",warning:"warning",error:"error",fatal:"error",success:"success"},ze=({item:fr})=>{var r0,Fr,Ui,mo;const{incrementCustomErrorCount:Co,decrementCustomErrorCount:ko,setHideFooterButton:Do}=(0,p.c)(),[bo,Ro]=(0,t.useState)(!1),go=(r0=fr.extension)==null?void 0:r0.find(Fe=>Fe.url===i.gi),br=(Ui=(Fr=go?.valueCodeableConcept)==null?void 0:Fr.coding)==null?void 0:Ui.find(Fe=>Fe.system===i.tn),Qn=br?.code||"error",zr=De[Qn]||"error";(0,t.useEffect)(()=>{if(zr==="error")return Co(),Do(!0),Ro(!0),()=>{ko(),Do(!1)};Ro(!0)},[zr,Co,ko,Do]);const Le=br?.display||"Error",Ce=(mo=fr.text)!=null?mo:"";return bo?(0,n.jsx)("div",{"data-testid":fr.linkId,children:(0,n.jsx)(r.InfoBanner,{type:zr,title:Le,description:Ce})}):null};var Ie=e(65735);const xe=({configKey:fr,customErrorConfigurations:r0})=>{if(!r0)return null;const Fr=r0[fr];if(!Fr)return null;const{icon:Ui,title:mo,description:Co,primaryButton:ko,secondaryButton:Do}=Fr;return(0,n.jsx)(r.EmptyState,{className:"mt-5xl",title:mo,description:Co,featuredIconProps:{icon:Ui,color:"gray"},primaryButton:ko,secondaryButton:Do})},_e=10,at=({item:fr,customErrorConfigurations:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{var Do,bo,Ro,go;const{trackEvent:br}=(0,s.st)(),{setHideFooterButton:Qn}=(0,p.c)(),{linkId:zr,text:Le,required:Ce,answerOption:Fe,prefix:pt,readOnly:qt}=fr,tn=fr?.type==="reference",In=(Do=Fr?.map(kn=>{var Ur,c0;return tn?(Ur=kn.valueReference)==null?void 0:Ur.display:(c0=kn.valueCoding)==null?void 0:c0.code}).filter(kn=>kn!==void 0))!=null?Do:[],[nr,gn]=(0,t.useState)(In.length),Un=Le?(0,o.nt)(mo,pt,Le):"",cn=(Ro=(bo=fr.extension)==null?void 0:bo.find(kn=>kn.url===i.Z_))==null?void 0:Ro.valueInteger,ur=(go=Fe?.map(kn=>{var Ur,c0,si,z0;return{value:tn?((Ur=kn.valueReference)==null?void 0:Ur.display)||"":((c0=kn.valueCoding)==null?void 0:c0.code)||"",label:tn?((si=kn.valueReference)==null?void 0:si.display)||"":((z0=kn.valueCoding)==null?void 0:z0.display)||"",valueReference:kn.valueReference}}))!=null?go:[],Ir=Co?.[zr],t0=ur.length>_e,A0=t0?ur.slice(0,_e):ur,Vr=t0?ur.slice(_e):[],C0=Vr.some(kn=>In?.includes(kn?.value)),[di,ut]=(0,t.useState)(C0);if(!(fr.answerOption&&fr.answerOption.length>0))return Qn(!0),(0,n.jsx)(xe,{configKey:fr.linkId,customErrorConfigurations:r0});const Mn=ur.filter(kn=>In?.includes(kn?.value)).map(kn=>{var Ur;const{restriction:c0,warning:si}=tn?(0,o.eC)((Ur=kn.valueReference)==null?void 0:Ur.extension):{restriction:null,warning:null};return{label:kn.label,restriction:c0,warning:si}}).filter(kn=>kn.restriction||kn.warning),qn=(kn,Ur)=>{var c0;br("vaccine_type_checkbox_selected",{on_or_off:kn?"on":"off",vaccine:Ur,_event_metadata:{description:"A user clicked the checkbox next to a vaccine type."}});let si;if(kn){const z0=ur.find(Y0=>Y0.value===Ur);si=[...(c0=Fr?.filter(Y0=>Object.keys(Y0).length!==0))!=null?c0:[],tn?{valueReference:z0?.valueReference}:{valueCoding:{code:Ur,display:z0?.label}}],gn(Y0=>Y0+1)}else si=Fr?.filter(z0=>{var Y0,Ii;return tn?((Y0=z0.valueReference)==null?void 0:Y0.display)!==Ur:((Ii=z0.valueCoding)==null?void 0:Ii.code)!==Ur})||[{}],gn(z0=>z0-1);Ui&&Ui(fr,si)};return(0,n.jsxs)("div",{"data-testid":zr,children:[Un&&(0,n.jsx)(N,{text:Un,required:Ce||!1}),t0&&(0,n.jsx)("div",{className:"mt-3xl mb-md text-primary font-medium",children:"Most Popular"}),(0,n.jsx)("div",{children:A0.map((kn,Ur)=>{const c0=In?.includes(kn?.value),si=!c0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:Ur!==A0.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:Ur.toString(),name:kn.label,isInvalid:!!Ir,isSelected:c0,label:kn.label,onChange:z0=>qn(z0,kn.value),isDisabled:qt||ko||si})},Ur)})}),t0&&!di&&!C0&&(0,n.jsx)("div",{className:"mt-3xl flex justify-center",children:(0,n.jsx)(r.Button,{type:"button",onClick:()=>{ut(!0),br("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:qt||ko,children:"See all"})}),t0&&di&&(0,n.jsx)("div",{className:"mt-3xl mb-md font-medium",children:"Other Vaccines"}),t0&&di&&(0,n.jsx)("div",{children:Vr.map((kn,Ur)=>{const c0=In?.includes(kn?.value),si=!c0&&cn?nr>=cn:!1;return(0,n.jsx)("div",{className:Ur!==Vr.length-1?"mb-2xl mx-lg":"mx-lg",children:(0,n.jsx)(r.Checkbox,{size:"md","data-testid":kn.value,id:(_e+Ur).toString(),name:kn.label,isInvalid:!!Ir,isSelected:c0,label:kn.label,onChange:z0=>qn(z0,kn.value),isDisabled:qt||ko||si})},_e+Ur)})}),(0,n.jsx)(r.HintText,{isInvalid:!!Ir,children:Ir}),Mn.length>0&&(0,n.jsx)("div",{className:"mt-3xl space-y-2",children:Mn.map((kn,Ur)=>(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((c0,si)=>(0,n.jsx)("li",{className:"text-sm",children:c0},si))}):(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((c0,si)=>(0,n.jsx)("li",{className:"text-sm",children:c0},si))}):(0,n.jsx)("p",{className:"text-sm",children:kn.warning.items[0]})})})]},Ur))})]})};var ht=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=(fr,r0,Fr)=>r0 in fr?Kt(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,Pt=(fr,r0)=>{for(var Fr in r0||(r0={}))Ot.call(r0,Fr)&&Qe(fr,Fr,r0[Fr]);if(We)for(var Fr of We(r0))Ye.call(r0,Fr)&&Qe(fr,Fr,r0[Fr]);return fr},hn=(fr,r0)=>Ct(fr,Xe(r0)),Sn=(fr,r0,Fr)=>new Promise((Ui,mo)=>{var Co=bo=>{try{Do(Fr.next(bo))}catch(Ro){mo(Ro)}},ko=bo=>{try{Do(Fr.throw(bo))}catch(Ro){mo(Ro)}},Do=bo=>bo.done?Ui(bo.value):Promise.resolve(bo.value).then(Co,ko);Do((Fr=Fr.apply(fr,r0)).next())});const et=({item:fr,handleInputChange:r0,onCompleteHandler:Fr,errors:Ui})=>{const{i18n:{t:mo},loading:Co}=(0,Xt.E_)({keys:["shared-translations"]}),{trackEvent:ko}=(0,s.st)(),{linkId:Do,required:bo,readOnly:Ro}=fr,go=Ui?.[Do]||"",[br,Qn]=(0,t.useState)(ht.LocationType.CURRENT_LOCATION),[zr,Le]=(0,t.useState)(""),Ce=(0,t.useRef)({}),[Fe,pt]=(0,t.useState)([{id:ht.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}]),{isLoading:qt,setIsLoading:tn,setIsCurrentFormValid:In,isCurrentFormValid:nr}=(0,p.c)(),{position:gn,loading:Un,locationPermission:cn}=(0,ht.useDeviceLocationContext)(),{queryParams:ur,setQueryParams:Ir}=(0,ht.useSearchQueryParams)(),[t0,{loading:A0}]=(0,xt.qtq)({fetchPolicy:"cache-first"}),[Vr,{loading:C0}]=(0,xt.YyG)({fetchPolicy:"cache-first"}),di=fr.item?(0,o.Yo)(fr.item,"postal-code"):void 0,ut=fr.item?(0,o.Yo)(fr.item,"state"):void 0,$t=fr.item?(0,o.Yo)(fr.item,"latitude"):void 0,Mn=fr.item?(0,o.Yo)(fr.item,"longitude"):void 0,qn=G0=>{if(!G0||!di)return Le(""),!1;const Ti=(0,o.zj)(di.extension,di.type,!1,di.maxLength,[{valueString:G0}]);return Ti?(Le(br!==ht.LocationType.ZIP_CODE?mo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR"):Ti),!1):(Le(""),!0)},kn=()=>{const{latitude:G0,longitude:Ti,state:K0,zipcode:M0}=Ce.current;return!!(G0&&Ti&&K0&&M0)},Ur=(0,t.useCallback)(G0=>{Ce.current={latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0},fr.item&&(ut&&r0(ut,[{valueString:""}]),$t&&r0($t,[{valueDecimal:void 0}]),Mn&&r0(Mn,[{valueDecimal:void 0}]),di&&r0(di,[{valueString:""}])),Ir({lat:"",lng:"",location:"",zipCode:"",placeId:"",addressDescription:"",locationType:G0,locationPermission:cn}),In&&In(!1),Le("")},[r0,fr.item,$t,cn,Mn,In,Ir,ut,di]);(0,t.useEffect)(()=>{if(!bo)return;!kn()&&In&&In(!1)},[nr,bo,In]);const c0=G0=>{Ce.current=Pt(Pt({},Ce.current),G0),G0.addressDescription&&ko("address_selected",{value:G0.addressDescription,_event_metadata:{description:"A user selected an address from the typeahead."}}),Y0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,Ce.current.zipcode,Ce.current.placeId,Ce.current.addressDescription)},si=G0=>Sn(void 0,null,function*(){var Ti,K0,M0;if(Le(""),Ce.current.zipcode=G0,In&&In(!1),qn(G0)){ko("zip_code_entered",{value:G0,_event_metadata:{description:"A user entered a zip code."}});const bi=yield Vr({variables:{location:G0}}),U0=(Ti=bi?.data)==null?void 0:Ti.geocoding,Bo=bi?.error;if(U0){const wi=U0.stateCode||"",Eo=(K0=U0.latitude)!=null?K0:void 0,Aa=(M0=U0.longitude)!=null?M0:void 0;c0({latitude:Eo,longitude:Aa,state:wi,zipcode:G0,placeId:void 0,addressDescription:void 0})}else Bo&&(c0({latitude:void 0,longitude:void 0,state:void 0,zipcode:G0,placeId:void 0,addressDescription:void 0}),Le(mo("SELECT_DIFFERENT_ZIPCODE_OR_LOCATION_TYPE_ERROR")))}else Y0(Ce.current.latitude,Ce.current.longitude,Ce.current.state,G0)}),z0=()=>{const G0=Ce.current.zipcode||"";!G0||br!==ht.LocationType.ZIP_CODE||qn(G0)};(0,t.useEffect)(()=>{ur.locationType&&(Qn(ur.locationType),ur.locationType===ht.LocationType.ZIP_CODE&&ur.zipCode&&si(ur.zipCode),ur.locationType===ht.LocationType.ADDRESS&&ur.placeId&&ur.addressDescription&&(Ce.current.addressDescription=ur.addressDescription,Ce.current.placeId=ur.placeId))},[]),(0,t.useEffect)(()=>{const G0=[ht.LocationPermissionEnum.DENIED,ht.LocationPermissionEnum.UNAVAILABLE,ht.LocationPermissionEnum.BLOCKED].includes(ur.locationPermission),Ti=[ht.LocationPermissionEnum.GRANTED,ht.LocationPermissionEnum.PROMPT].includes(ur.locationPermission);if(G0&&Fe.length!==2){if(pt([{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}]),br===ht.LocationType.CURRENT_LOCATION||!ur.locationType||ur.locationType===""){const K0=ur.locationType===ht.LocationType.ZIP_CODE?ht.LocationType.ZIP_CODE:ht.LocationType.ADDRESS;Qn(K0),Ir(hn(Pt({},ur),{locationType:K0})),Ur(K0)}Le("")}Ti&&Fe.length!==3&&pt([{id:ht.LocationType.CURRENT_LOCATION,label:"Current Location"},{id:ht.LocationType.ADDRESS,label:"Address"},{id:ht.LocationType.ZIP_CODE,label:"Zip code"}])},[br,cn,Fe.length,ur,Ir,Ur]);const Y0=(G0,Ti,K0,M0,bi,U0)=>{if(!fr.item)return;ut&&r0(ut,[{valueString:K0||""}]),$t&&r0($t,[{valueDecimal:G0}]),Mn&&r0(Mn,[{valueDecimal:Ti}]),di&&r0(di,[{valueString:M0||""}]),Ir(hn(Pt({},ur),{lat:String(G0),lng:String(Ti),location:`${G0},${Ti}`,zipCode:M0||"",placeId:bi||"",addressDescription:U0||"",locationPermission:cn}));const Bo=kn()&&qn(M0||"");In&&In(Bo),Fr&&Fr(Do)};(0,t.useEffect)(()=>{const G0=()=>Sn(void 0,null,function*(){var Ti;try{const K0=yield t0({variables:{latitude:String(gn?.coords.latitude),longitude:String(gn?.coords.longitude)}}),M0=(Ti=K0?.data)==null?void 0:Ti.geocodingByLatLon,bi=M0?.stateCode||"",U0=M0?.zipCode||"";(!U0||!bi)&&Le(mo("SELECT_DIFFERENT_LOCATION_TYPE_ERROR")),c0({latitude:gn?.coords.latitude,longitude:gn?.coords.longitude,state:bi,zipcode:U0,placeId:void 0,addressDescription:void 0})}catch{Qn(ht.LocationType.ADDRESS)}});br===ht.LocationType.CURRENT_LOCATION&&gn&&G0()},[br,gn]);const Ii=G0=>{if(!G0||!G0.latitude||!G0.longitude||!G0.zipCode||!G0.stateCode){c0({latitude:void 0,longitude:void 0,state:void 0,zipcode:void 0,placeId:void 0,addressDescription:void 0}),G0&&typeof G0.value=="string"&&G0.value.trim().length!==0&&Le(mo("SELECT_DIFFERENT_ADDRESS_OR_LOCATION_TYPE_ERROR"));return}c0({latitude:G0.latitude,longitude:G0.longitude,state:G0.stateCode,zipcode:G0.zipCode,placeId:G0.placeId,addressDescription:G0.description})};return(0,t.useEffect)(()=>{tn(Un||A0||C0||Co)},[Un,A0,C0,Co,tn]),(0,t.useEffect)(()=>{ur.locationType!==br&&Ir(hn(Pt({},ur),{locationType:br}))},[br]),(0,n.jsxs)("div",{"data-testid":fr.linkId,children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Location type",required:bo||!1}),(0,n.jsx)(r.Select,{id:Do,"aria-label":Do,"data-testid":Do,isDisabled:Ro||A0||C0||qt,selectedKey:br,onSelectionChange:G0=>{var Ti;ko("location_type_input_selected",{choice:(Ti=Fe.find(({id:K0})=>K0===G0))==null?void 0:Ti.label,_event_metadata:{description:"A user changed the location type input."}}),G0!==br&&(Ur(G0),Qn(G0))},hint:go,isInvalid:!!go,items:Fe,placeholder:"Select an option",isRequired:bo,children:G0=>(0,n.jsx)(r.Select.Item,{id:G0.id,"data-testid":G0.id,value:G0,children:G0.label},G0.id)},Do),br===ht.LocationType.CURRENT_LOCATION&&(0,n.jsx)(r.HintText,{isInvalid:!!zr,children:zr}),br===ht.LocationType.ADDRESS&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Address",required:bo||!1}),(0,n.jsx)(ht.AddressTypeahead,{onValueChange:Ii,isDisabled:qt,setIsLoading:tn,initialValue:{placeId:Ce.current.placeId||"",description:Ce.current.addressDescription||""},errorText:zr||go})]}),br===ht.LocationType.ZIP_CODE&&(0,n.jsxs)("div",{className:"mt-3xl",children:[(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:"Zip code",required:bo||!1}),(0,n.jsx)(r.Input,{isRequired:bo,size:"md","aria-label":"zipcode-input","data-testid":"zipcode-input",id:`${Do}-zipcode`,placeholder:"Type your response here...",value:Ce.current.zipcode||"",onChange:si,onBlur:z0,isDisabled:Ro||C0||qt,hint:zr||go,isInvalid:!!zr||!!go,autoComplete:"postal-code"},`${Do}-zipcode`)]})]})},Rt=fr=>(0,n.jsx)(ht.DeviceLocationProvider,{children:(0,n.jsx)(et,Pt({},fr))}),Ut={[i.cX]:Rt,[i.G6]:re,[i.c3]:at,[i.AA]:ze,[i.mO]:h,[i.PM]:k,[i.HH]:I,[i.Us]:Ee,[i.Tl]:R,[i.G0]:v,[i.m3]:a,[i.PU]:C,[i.XP]:g.l,[i.uH]:L.v,[i.it]:Ie.d};var wn,yr=new Uint8Array(16);function mn(){if(!wn&&(wn=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!wn))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return wn(yr)}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 dr(fr){return typeof fr=="string"&&Ln.test(fr)}const Wn=dr;for(var Wr=[],Yr=0;Yr<256;++Yr)Wr.push((Yr+256).toString(16).substr(1));function It(fr){var r0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Fr=(Wr[fr[r0+0]]+Wr[fr[r0+1]]+Wr[fr[r0+2]]+Wr[fr[r0+3]]+"-"+Wr[fr[r0+4]]+Wr[fr[r0+5]]+"-"+Wr[fr[r0+6]]+Wr[fr[r0+7]]+"-"+Wr[fr[r0+8]]+Wr[fr[r0+9]]+"-"+Wr[fr[r0+10]]+Wr[fr[r0+11]]+Wr[fr[r0+12]]+Wr[fr[r0+13]]+Wr[fr[r0+14]]+Wr[fr[r0+15]]).toLowerCase();if(!Wn(Fr))throw TypeError("Stringified UUID is invalid");return Fr}const $e=It;function it(fr,r0,Fr){fr=fr||{};var Ui=fr.random||(fr.rng||mn)();if(Ui[6]=Ui[6]&15|64,Ui[8]=Ui[8]&63|128,r0){Fr=Fr||0;for(var mo=0;mo<16;++mo)r0[Fr+mo]=Ui[mo];return r0}return $e(Ui)}const Je=it,tt=(fr,r0="application/octet-stream")=>{try{const Fr=window.atob(fr),Ui=new Uint8Array(Fr.length);for(let Co=0;Co<Fr.length;Co++)Ui[Co]=Fr.charCodeAt(Co);return new Blob([Ui],{type:r0}).size}catch{return 0}},rt=(fr,r0)=>`data:${r0};base64,${fr}`,lt=(fr,r0,Fr=512)=>{const Ui=window.atob(fr),mo=[];for(let ko=0;ko<Ui.length;ko+=Fr){const Do=Ui.slice(ko,ko+Fr),bo=new Array(Do.length);for(let go=0;go<Do.length;go++)bo[go]=Do.charCodeAt(go);const Ro=new Uint8Array(bo);mo.push(Ro)}const Co=new Blob(mo,{type:r0});return URL.createObjectURL(Co)},Et=fr=>{const r0=new Date().toISOString().replace(/[:.-]/g,"");return`${fr.split(" ").join("-")}_${r0}`},st=4e3,le=.8,ye=(fr,r0)=>{var Fr,Ui;const mo=(Fr=r0?.maxDimension)!=null?Fr:st,Co=(Ui=r0?.quality)!=null?Ui:le;return new Promise((ko,Do)=>{if(!fr.type.startsWith("image/")){ko(fr);return}const bo=new Image,Ro=new FileReader;Ro.onload=()=>{const go=Ro.result;bo.onload=()=>{let{width:br,height:Qn}=bo;if(br>mo||Qn>mo){const pt=mo/Math.max(br,Qn);br=Math.round(br*pt),Qn=Math.round(Qn*pt)}const zr=document.createElement("canvas");zr.width=br,zr.height=Qn;const Le=zr.getContext("2d");if(!Le){ko(fr);return}Le.drawImage(bo,0,0,br,Qn);const Ce=fr.type==="image/png"?"image/png":"image/jpeg",Fe=fr.type==="image/png"?void 0:Co;zr.toBlob(pt=>{if(!pt||pt.size>=fr.size){ko(fr);return}ko(new File([pt],fr.name,{type:Ce}))},Ce,Fe)},bo.onerror=()=>{Do(new Error(`Failed to load image: ${fr.name}`))},bo.src=go},Ro.onerror=()=>{Do(new Error(`Failed to read file: ${fr.name}`))},Ro.readAsDataURL(fr)})},Ue=50,Te=(fr,r0=Ue)=>{if(fr.length<=r0)return fr;const Fr=fr.lastIndexOf("."),Ui=Fr!==-1?fr.slice(Fr):"",mo=Fr!==-1?fr.slice(0,Fr):fr,Co=r0-Ui.length-1,ko=Math.ceil(Co/2),Do=Math.floor(Co/2);return`${mo.slice(0,ko)}\u2026${mo.slice(-Do)}${Ui}`};var zt=Object.defineProperty,Gt=Object.defineProperties,vn=Object.getOwnPropertyDescriptors,zn=Object.getOwnPropertySymbols,sr=Object.prototype.hasOwnProperty,Dt=Object.prototype.propertyIsEnumerable,we=(fr,r0,Fr)=>r0 in fr?zt(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,Ze=(fr,r0)=>{for(var Fr in r0||(r0={}))sr.call(r0,Fr)&&we(fr,Fr,r0[Fr]);if(zn)for(var Fr of zn(r0))Dt.call(r0,Fr)&&we(fr,Fr,r0[Fr]);return fr},At=(fr,r0)=>Gt(fr,vn(r0)),en=(fr,r0,Fr)=>new Promise((Ui,mo)=>{var Co=bo=>{try{Do(Fr.next(bo))}catch(Ro){mo(Ro)}},ko=bo=>{try{Do(Fr.throw(bo))}catch(Ro){mo(Ro)}},Do=bo=>bo.done?Ui(bo.value):Promise.resolve(bo.value).then(Co,ko);Do((Fr=Fr.apply(fr,r0)).next())});const nn=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{const{linkId:Do,text:bo,required:Ro,prefix:go,readOnly:br,repeats:Qn,extension:zr}=fr,Le=(0,o.Qr)(zr),Ce=(0,o.cz)(zr),Fe=(0,o.$H)(zr)||"image/*,.pdf,.doc,.docx",pt=bo?(0,o.nt)(mo,go,bo):"",qt=Co?.[Do]||"",[tn,In]=(0,t.useState)([]),nr=(0,t.useRef)(Fr||[]);(0,t.useEffect)(()=>{Fr&&(nr.current=Fr)},[Fr]),(0,t.useEffect)(()=>{Fr?.length&&In(t0=>{const A0=t0.filter(C0=>C0.isLoading||C0.failed);return[...Fr.filter(C0=>C0.valueAttachment).map((C0,di)=>{var ut,$t,Mn,qn,kn;const Ur=((ut=C0.valueAttachment)==null?void 0:ut.title)||`attachment-${di}`,c0=($t=C0.valueAttachment)==null?void 0:$t.id,si=t0.find(Ii=>c0&&Ii.id===c0||!c0&&Ii.id===`existing-${di}`),z0=(Mn=C0.valueAttachment)==null?void 0:Mn.data,Y0=z0?tt(z0,(qn=C0.valueAttachment)==null?void 0:qn.contentType):0;return{id:c0||si?.id||`existing-${di}`,name:Ur,size:si?.size||Y0,progress:100,failed:!1,type:(0,o.J4)((kn=C0.valueAttachment)==null?void 0:kn.contentType),isLoading:!1}}),...A0]})},[Fr]);const gn=t0=>{let A0=Array.from(t0);if(Ce!==void 0){const C0=Ce-tn.length;if(C0<=0)return;A0=A0.slice(0,C0)}const Vr=A0.map(C0=>{const di=Le&&C0.size>Le,ut=C0.name.replace(/\s+/g,"-");return{id:Je(),name:ut,size:C0.size,progress:0,type:(0,o.J4)(C0.type),failed:!!di,isLoading:!di,disableRetry:!!di,errorMessage:di?`File size exceeds ${(Le/(1e3*1e3)).toFixed(0)} MB limit`:void 0}});In(C0=>[...C0,...Vr]),Vr.filter(C0=>!C0.failed).forEach(C0=>{const di=A0.find(ut=>ut.name.replace(/\s+/g,"-")===C0.name);di&&Un(di,C0.id)})},Un=(t0,A0)=>en(void 0,null,function*(){try{const Vr=yield ye(t0),C0=yield Ir(Vr),di=Vr.name.replace(/\s+/g,"-");In(qn=>qn.map(kn=>kn.id===A0?At(Ze({},kn),{isLoading:!1,progress:100,failed:!1}):kn));const ut={valueAttachment:{id:A0,contentType:Vr.type,data:C0,title:di}},Mn=[...(nr.current||[]).filter(qn=>qn.valueAttachment||Object.keys(qn).length>0),ut];nr.current=Mn,Ui(fr,Mn),r0(Do)}catch{In(C0=>C0.map(di=>di.id===A0?At(Ze({},di),{isLoading:!1,failed:!0}):di))}}),cn=t0=>{const A0=tn.find(Vr=>Vr.id===t0);if(In(Vr=>Vr.filter(C0=>C0.id!==t0)),A0){const Vr=(nr.current||[]).filter((C0,di)=>{var ut;if(t0.startsWith("existing-")){const $t=parseInt(t0.replace("existing-",""));return di!==$t}return((ut=C0.valueAttachment)==null?void 0:ut.id)!==t0}).filter(C0=>C0.valueAttachment||Object.keys(C0).length>0);nr.current=Vr,Ui(fr,Vr.length>0?Vr:[{}])}},ur=t0=>{const A0=tn.find(Vr=>Vr.id===t0);if(A0){In(C0=>C0.map(di=>di.id===t0?At(Ze({},di),{failed:!1,isLoading:!0,progress:0}):di));const Vr=new File([""],A0.name,{type:"application/octet-stream"});Un(Vr,t0)}},Ir=t0=>new Promise((A0,Vr)=>{const C0=new FileReader;C0.onload=()=>{const ut=C0.result.split(",")[1];A0(ut)},C0.onerror=Vr,C0.readAsDataURL(t0)});return(0,n.jsxs)("div",{children:[pt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:pt,required:Ro||!1}),(0,n.jsx)(r.FileUpload,{files:tn,onDropFiles:gn,onDeleteFile:cn,onRetryFile:ur,onDropUnacceptedFiles:()=>{},hint:(0,o.od)(Fe,Le,Ce),accept:Fe,allowsMultiple:Qn!==!1,isDisabled:br||ko||Ce!==void 0&&tn.length>=Ce,className:"w-full",showDisclosureModal:!0}),qt&&(0,n.jsx)("div",{className:"text-error-primary mt-2 text-sm",children:qt})]})},fn=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{var Do,bo;const{linkId:Ro,text:go,prefix:br,readOnly:Qn,required:zr,extension:Le}=fr,{trackQuestionnaireEvent:Ce}=(0,p.c)(),Fe=go?(0,o.nt)(mo,br,go):"",pt=Co?.[Ro];return Le?.find(tn=>{var In,nr;return tn.url===i.gD&&((nr=(In=tn.valueCodeableConcept)==null?void 0:In.coding)==null?void 0:nr.some(gn=>gn.system===i.n4&&gn.code===i.GI))})?(0,n.jsxs)("div",{"data-testid":Ro,children:[(0,n.jsxs)("div",{className:"flex items-start gap-3","data-testid":Ro,children:[(0,n.jsx)(r.Checkbox,{size:"md",id:Ro,name:Ro,isDisabled:Qn||ko,isSelected:(Do=Fr?.[0])==null?void 0:Do.valueBoolean,"aria-label":Ro,label:"",className:"mt-1",onChange:tn=>{Ce(fr.linkId,{value:tn}),Ui(fr,[{valueBoolean:tn}]),r0(fr.linkId)}}),Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:zr||!1})]}),(0,n.jsx)(r.HintText,{isInvalid:!!pt,children:pt})]}):(0,n.jsxs)("div",{"data-testid":Ro,children:[Fe&&(0,n.jsx)(N,{isLabel:!0,text:Fe,required:zr||!1}),(0,n.jsxs)(r.RadioGroup,{size:"md",id:Ro,name:Ro,"aria-label":Ro,value:String((bo=Fr?.[0])==null?void 0:bo.valueBoolean)||"",onChange:tn=>{Ui(fr,[{valueBoolean:tn==="true"}]),r0(fr.linkId)},isInvalid:!!pt,children:[(0,n.jsx)(r.RadioButton,{size:"md",value:"true",label:"Yes",isDisabled:Qn||ko}),(0,n.jsx)(r.RadioButton,{size:"md",value:"false",label:"No",isDisabled:Qn||ko})]},Ro),pt&&(0,n.jsx)("div",{children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:pt})})]})};var mt=Object.defineProperty,Qt=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,Lt=Object.prototype.propertyIsEnumerable,Ft=(fr,r0,Fr)=>r0 in fr?mt(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,Yt=(fr,r0)=>{for(var Fr in r0||(r0={}))kt.call(r0,Fr)&&Ft(fr,Fr,r0[Fr]);if(Qt)for(var Fr of Qt(r0))Lt.call(r0,Fr)&&Ft(fr,Fr,r0[Fr]);return fr};const On=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro,go,br;const{linkId:Qn,text:zr,required:Le,answerOption:Ce,prefix:Fe,readOnly:pt}=fr,qt=zr?(0,o.nt)(mo,Fe,zr):"",tn=Ce?.map(gn=>{var Un,cn,ur,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:((ur=gn.valueCoding)==null?void 0:ur.code)||gn.valueString||"",extension:gn.extension||[],system:((Ir=gn.valueCoding)==null?void 0:Ir.system)||void 0}})||[],In=((go=(Ro=Fr?.[0])==null?void 0:Ro.valueCoding)==null?void 0:go.code)||((br=Fr?.[0])==null?void 0:br.valueString)||"",nr=Co?.[Qn];return(0,n.jsxs)("div",{children:[qt&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:qt,required:Le||!1}),(0,n.jsx)(r.Select,{id:Qn,"aria-label":Qn,"data-testid":Qn,isDisabled:pt||ko,selectedKey:In,onSelectionChange:gn=>{const Un=String(gn),cn=tn.find(t0=>t0.value===Un),ur=cn?cn.label:"",Ir=Boolean(Ce?.find(t0=>t0.valueString===Un));Ui(fr,[Ir?{valueString:Un}:{valueCoding:Yt({code:Un,display:ur},cn?.system?{system:cn.system}:{}),extension:cn?.extension||[]}]),r0(fr.linkId)},isInvalid:!!nr,hint:nr||bo,items:tn,placeholder:Do,isRequired:Le,children:gn=>(0,n.jsx)(r.Select.Item,{id:gn.id,"data-testid":gn.value,value:gn.value,children:gn.label},gn.id)},Qn)]})};var Sr=Object.defineProperty,jr=Object.getOwnPropertySymbols,Rn=Object.prototype.hasOwnProperty,Pn=Object.prototype.propertyIsEnumerable,rn=(fr,r0,Fr)=>r0 in fr?Sr(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,bt=(fr,r0)=>{for(var Fr in r0||(r0={}))Rn.call(r0,Fr)&&rn(fr,Fr,r0[Fr]);if(jr)for(var Fr of jr(r0))Pn.call(r0,Fr)&&rn(fr,Fr,r0[Fr]);return fr};const St=fr=>{var r0,Fr,Ui;const{item:mo,selectedAnswer:Co,updatedText:ko,required:Do,errorMessage:bo}=fr,Ro=mo?.type==="reference",go=(r0=Co?.map(Ce=>{var Fe,pt;return Ro?(Fe=Ce.valueReference)==null?void 0:Fe.display:(pt=Ce.valueCoding)==null?void 0:pt.code}).filter(Ce=>Ce!==void 0))!=null?r0:[],[br,Qn]=(0,t.useState)(go.length),zr=(Ui=(Fr=mo.extension)==null?void 0:Fr.find(Ce=>Ce.url===i.Z_))==null?void 0:Ui.valueInteger,Le=(Ce,Fe)=>{var pt,qt,tn;let In;if(Ce){const nr=fr.options.find(gn=>gn.value===Fe);In=[...(qt=(pt=fr.selectedAnswer)==null?void 0:pt.filter(gn=>Object.keys(gn).length!==0))!=null?qt:[],Ro?{valueReference:nr?.valueReference}:{valueCoding:bt({code:Fe,display:nr?.label},nr?.system?{system:nr.system}:{}),extension:nr?.extension||[]}],Qn(gn=>gn+1)}else In=((tn=fr.selectedAnswer)==null?void 0:tn.filter(nr=>{var gn,Un;return Ro?((gn=nr.valueReference)==null?void 0:gn.display)!==Fe:((Un=nr.valueCoding)==null?void 0:Un.code)!==Fe}))||[{}],Qn(nr=>nr-1);fr.handleInputChange(fr.item,In)};return(0,n.jsxs)("div",{"data-testid":mo.linkId,children:[ko&&(0,n.jsx)(N,{isLabel:!0,text:ko,required:Do||!1}),(0,n.jsx)("div",{children:fr.options.map((Ce,Fe)=>(0,n.jsx)(r.Checkbox,{size:"md","data-testid":Ce.value,id:Fe.toString(),className:Fe!==fr.options.length-1?"mb-2xl":"",name:Ce.label,isInvalid:!!bo,isSelected:go?.includes(Ce?.value),label:Ce.label,onChange:pt=>Le(pt,Ce.value),isDisabled:fr.readOnly||fr.isLoading||(!go?.includes(Ce?.value)&&zr?br>=zr:!1)},Fe))}),(0,n.jsx)(r.HintText,{isInvalid:!!bo,children:bo})]})},Zt=({item:fr,onCompleteHandler:r0,updatedText:Fr,options:Ui,handleInputChange:mo,errorMessage:Co,readOnly:ko,initialValue:Do,selectedAnswer:bo,isLoading:Ro,required:go})=>{var br,Qn;const zr=`${fr.linkId}-label`,Le=`${fr.linkId}-error`;return(0,n.jsxs)("div",{"data-testid":fr.linkId,children:[Fr&&(0,n.jsx)(N,{id:zr,isLabel:!0,text:Fr,required:go||!1}),(0,n.jsx)(r.RadioGroup,{size:"md",id:fr.linkId,name:fr.linkId,"aria-labelledby":Fr?zr:void 0,"aria-describedby":Co?Le:void 0,isRequired:go,className:Ui.length===2?"flex-row flex-wrap gap-8":"gap-6",value:((Qn=(br=bo?.[0])==null?void 0:br.valueCoding)==null?void 0:Qn.code)||Do||"",onChange:Ce=>{const Fe=Ce,pt=Ui.find(tn=>tn.value===Fe),qt=pt?pt.label:"";mo(fr,[{valueCoding:{code:Fe,display:qt,system:pt?.system||void 0},extension:pt?.extension||[]}]),r0(fr.linkId)},isInvalid:!!Co,children:Ui.map(Ce=>(0,n.jsx)(r.RadioButton,{size:"md","data-testid":Ce.value,isDisabled:ko||Ro,value:Ce.value,label:Ce.label},Ce.value))},fr.linkId),Co&&(0,n.jsx)("div",{id:Le,children:(0,n.jsx)("span",{className:(0,P.cx)("text-error-primary","text-sm","mt-[1.5]"),children:Co})})]})};var un=Object.defineProperty,on=Object.getOwnPropertySymbols,En=Object.prototype.hasOwnProperty,Xn=Object.prototype.propertyIsEnumerable,wr=(fr,r0,Fr)=>r0 in fr?un(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,$r=(fr,r0)=>{for(var Fr in r0||(r0={}))En.call(r0,Fr)&&wr(fr,Fr,r0[Fr]);if(on)for(var Fr of on(r0))Xn.call(r0,Fr)&&wr(fr,Fr,r0[Fr]);return fr};const Kr=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro,go,br,Qn,zr;const{linkId:Le,text:Ce,required:Fe,answerOption:pt,prefix:qt,readOnly:tn}=fr,In=fr?.type==="reference",nr=Ce?(0,o.nt)(mo,qt,Ce):"",Un=(()=>{var Vr,C0;const di=pt?.find(ut=>ut.initialSelected===!0);return di?In?((Vr=di.valueReference)==null?void 0:Vr.display)||"":((C0=di?.valueCoding)==null?void 0:C0.code)||"":""})(),cn=(pt?.map(Vr=>{var C0,di,ut,$t,Mn;return{label:((C0=Vr?.valueCoding)==null?void 0:C0.display)||((di=Vr?.valueReference)==null?void 0:di.display)||"",value:In?((ut=Vr.valueReference)==null?void 0:ut.display)||"":(($t=Vr.valueCoding)==null?void 0:$t.code)||"",valueReference:In?Vr.valueReference:{},extension:Vr.extension||[],system:((Mn=Vr.valueCoding)==null?void 0:Mn.system)||""}})||[]).filter(Vr=>Vr.label),ur=Co?.[Le],Ir=(zr=(Qn=(br=(go=(Ro=fr?.extension)==null?void 0:Ro.find(Vr=>Vr.url.includes("questionnaire-itemControl")))==null?void 0:go.valueCodeableConcept)==null?void 0:br.coding)==null?void 0:Qn[0])==null?void 0:zr.code;let t0=null;const A0={item:fr,onCompleteHandler:r0,updatedText:nr,options:cn,handleInputChange:Ui,errorMessage:ur,required:Fe,readOnly:tn,initialValue:Un,selectedAnswer:Fr,isLoading:ko,showQuestionPrefix:mo,placeholder:Do,hintText:bo};switch(Ir){case"drop-down":t0=(0,n.jsx)(On,$r({},A0));break;case"check-box":t0=(0,n.jsx)(St,$r({},A0));break;case"radio-button":t0=(0,n.jsx)(Zt,$r({},A0));break}return(0,n.jsx)(n.Fragment,{children:t0})};var d0=e(73697),Di=e(71924),_0=e(46776);const li=fr=>`${String(fr.month).padStart(2,"0")}/${String(fr.day).padStart(2,"0")}/${fr.year}`,X0=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro,go,br;const{linkId:Qn,text:zr,required:Le,prefix:Ce,readOnly:Fe}=fr,pt=(0,t.useRef)(null),[qt,tn]=(0,t.useState)(!1),[In,nr]=(0,t.useState)(null),{setIsCurrentFormValid:gn,isCurrentFormValid:Un,trackQuestionnaireEvent:cn}=(0,p.c)(),ur=zr?(0,o.nt)(mo,Ce,zr):"",Ir=Co?.[Qn]||"",t0=(Ro=fr.extension)==null?void 0:Ro.find(K0=>K0.url===i.dU),A0=(go=fr.extension)==null?void 0:go.find(K0=>K0.url===i.bK),Vr=(0,t.useMemo)(()=>{var K0;const M0=t0?.valueString||t0?.valueDate;return M0||(0,o.iI)((K0=t0?.valueExpression)==null?void 0:K0.expression)},[t0]),C0=(0,t.useMemo)(()=>{var K0;const M0=A0?.valueString||A0?.valueDate;return M0||(0,o.iI)((K0=A0?.valueExpression)==null?void 0:K0.expression)},[A0]),di=(0,t.useMemo)(()=>{if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{return(0,d0._U)(Vr)}catch{}return(0,d0._U)("1900-01-01")},[Vr]),ut=(0,t.useMemo)(()=>{if(C0&&/^\d{4}-\d{2}-\d{2}$/.test(C0))try{return(0,d0._U)(C0)}catch(K0){console.warn("Failed to parse maxDateStr:",C0,K0)}return(0,d0._U)("2099-12-31")},[C0]),Mn=(K0=>{if(!K0)return"";const M0=K0.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!M0)return K0;const[,bi,U0,Bo]=M0;return`${U0}/${Bo}/${bi}`})(((br=Fr?.[0])==null?void 0:br.valueDate)||""),qn=K0=>{if(!K0)return"";const M0=K0.replace(/\D/g,"");if(M0.length===0)return"";if(M0.length<=2)return M0.length===2?`${M0}/`:M0;const bi=Bo=>{const wi=Bo.slice(0,2),Eo=Bo.slice(2);return Eo.length===2?`${wi}/${Eo}/`:`${wi}/${Eo}`},U0=Bo=>{const wi=Bo.slice(0,2),Eo=Bo.slice(2,4),Aa=Bo.slice(4,8);return`${wi}/${Eo}/${Aa}`};return M0.length<=4?bi(M0):U0(M0)},kn=()=>{if(Fe||ko)return;if(Mn.match(/^(\d{4})-(\d{2})-(\d{2})$/))try{const M0=(0,d0._U)(Mn);nr(M0)}catch{nr(null)}else{const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(M0){const[,bi,U0,Bo]=M0,wi=parseInt(bi,10),Eo=parseInt(U0,10);if(wi>=1&&wi<=12&&Eo>=1&&Eo<=31)try{const Aa=(0,d0._U)(`${Bo}-${bi}-${U0}`);nr(Aa)}catch{nr(null)}else nr(null)}else nr(null)}tn(!0)},Ur=()=>{if(In){const K0=`${In.year}-${String(In.month).padStart(2,"0")}-${String(In.day).padStart(2,"0")}`;cn(fr.linkId,{value:(0,o.CP)(`${String(In.month).padStart(2,"0")}/${String(In.day).padStart(2,"0")}/${In.year}`)}),Ui(fr,[{valueDate:(0,o.Fy)(K0)}])}tn(!1),nr(null)},c0=()=>{tn(!1),nr(null)},si=K0=>{var M0;const bi=((M0=pt.current)==null?void 0:M0.selectionStart)||0,U0=Mn,Bo=qn(K0),wi=Bo.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(wi){const[,Eo,Aa,Zo]=wi,Ds=parseInt(Eo,10),Fs=parseInt(Aa,10),qo=parseInt(Zo,10);if(z0(Ds,Fs,qo).isValid){const l1=`${Zo}-${Eo}-${Aa}`;cn(fr.linkId,{value:(0,o.CP)(`${Eo}/${Aa}/${Zo}`)}),Ui(fr,[{valueDate:(0,o.Fy)(l1)}])}else Ui(fr,[{valueDate:Bo}])}else Ui(fr,[{valueDate:Bo}]);setTimeout(()=>{if(pt.current){const Eo=U0.replace(/\D/g,""),Aa=Bo.replace(/\D/g,"");let Zo=bi;Bo===U0&&(Zo=bi-1),Aa.length>=Eo.length&&Bo!==U0?Bo[bi-1]==="/"?Zo=bi+1:Zo=bi:Aa.length<Eo.length&&(U0[bi-1]==="/"?Zo=Math.max(0,bi-1):Zo=bi),pt.current.setSelectionRange(Zo,Zo)}},0)},z0=(K0,M0,bi)=>{if(K0<1||K0>12)return{isValid:!1,error:"Month must be between 01 and 12"};if(M0<1||M0>31)return{isValid:!1,error:"Day must be between 01 and 31"};const U0=new Date(bi,K0,0).getDate();if(M0>U0)return{isValid:!1,error:"Invalid day for the selected month"};if(Vr||C0){const Bo=new Di.ng(bi,K0,M0);if(Vr&&/^\d{4}-\d{2}-\d{2}$/.test(Vr))try{const wi=(0,d0._U)(Vr);if(Bo.compare(wi)<0){const Eo=(0,o.di)(i.Ck,fr.extension);if(Eo)return{isValid:!1,error:Eo};const Aa=li(wi);return{isValid:!1,error:`Date must be on or after ${Aa}`}}}catch{}if(C0&&/^\d{4}-\d{2}-\d{2}$/.test(C0))try{const wi=(0,d0._U)(C0);if(Bo.compare(wi)>0){const Eo=(0,o.di)(i.Cx,fr.extension);if(Eo)return{isValid:!1,error:Eo};const Aa=li(wi);return{isValid:!1,error:`Date must be on or before ${Aa}`}}}catch{}}return{isValid:!0,error:""}},Y0=()=>{const K0=Mn.replace(/\D/g,"");if(K0.length>0&&K0.length<8){r0(fr.linkId);return}const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!M0&&K0.length>=6){r0(fr.linkId);return}if(M0){const[,bi,U0,Bo]=M0,wi=parseInt(bi,10),Eo=parseInt(U0,10),Aa=parseInt(Bo,10);if(z0(wi,Eo,Aa).isValid){const Zo=`${Bo}-${bi}-${U0}`;Ui(fr,[{valueDate:(0,o.Fy)(Zo)}])}}r0(fr.linkId)},G0=(()=>{if(!Mn)return"";const K0=Mn.replace(/\D/g,"");if(K0.length>0&&K0.length<8)return"";const M0=Mn.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(!M0&&K0.length>=6)return Un&&gn(!1),"Invalid date";if(M0){const[,bi,U0,Bo]=M0,wi=parseInt(bi,10),Eo=parseInt(U0,10),Aa=parseInt(Bo,10),{isValid:Zo,error:Ds}=z0(wi,Eo,Aa);if(!Zo)return Un&&gn(!1),Ds||"Invalid date"}return""})(),Ti=!!Ir||!!G0;return(0,n.jsxs)("div",{children:[ur&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:ur,required:Le||!1}),(0,n.jsxs)("div",{className:"relative flex flex-row items-center",children:[(0,n.jsx)("button",{type:"button",disabled:Fe||ko,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||ko)&&"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||ko)&&"bg-disabled_subtle")}),(0,n.jsx)(r.Input,{ref:pt,isRequired:Le,size:"md",type:"text",name:Qn,"data-testid":Qn,id:Qn,value:Mn,onChange:si,placeholder:Do,isDisabled:Fe||ko,onBlur:Y0,hint:G0||Ir||bo,isInvalid:Ti,className:(0,P.cx)("[&_input::-webkit-inner-spin-button]:hidden","[&_input::-webkit-clear-button]:hidden","[&_input::-webkit-calendar-picker-indicator]:hidden")},Qn)]}),(0,n.jsx)(r.Modal,{id:"calendar-date-picker-modal",isOpen:qt,onOpenChange:K0=>{K0||c0()},primaryButton:{children:"Apply",onClick:Ur,isDisabled:!In},secondaryButton:{children:"Cancel",onClick:c0},children:(0,n.jsx)(_0.lr,{value:In,onChange:nr,minValue:di,maxValue:ut,children:(0,n.jsx)(r.Calendar,{showDateInput:!1,minValue:di,maxValue:ut,onYearPickerOpen:()=>{nr(null)}})})})]})},zi=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{var Do;const{linkId:bo,text:Ro,required:go,prefix:br,readOnly:Qn}=fr,zr=Ro?(0,o.nt)(mo,br,Ro):"",Le=Co?.[bo]||"";return(0,n.jsxs)("div",{children:[zr&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:zr,required:go||!1}),(0,n.jsx)(r.Input,{isRequired:go,size:"md",type:"datetime-local",id:bo,"aria-label":bo,"data-testid":bo,placeholder:"Type your response here...",value:((Do=Fr?.[0])==null?void 0:Do.valueDateTime)||"",onChange:Ce=>{let Fe=Ce;const[pt,qt]=Fe.split("T");pt&&qt&&(Fe=`${(0,o.Fy)(pt)}T${qt}:00`),Ui(fr,[{valueDateTime:Fe}])},isDisabled:Qn||ko,onBlur:()=>{r0(fr.linkId)},hint:Le,isInvalid:!!Le},bo)]})},vr=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro;const{linkId:go,text:br,required:Qn,prefix:zr,readOnly:Le}=fr,Ce=br?(0,o.nt)(mo,zr,br):"",Fe=Co?.[go]||"",pt=(0,o.a0)(fr),qt=(Ro=Fr?.[0])==null?void 0:Ro.valueDecimal,[tn,In]=(0,t.useState)(String(qt??""));return(0,t.useEffect)(()=>{In(String(qt??""))},[qt]),(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",id:go,"aria-label":go,"data-testid":go,placeholder:Do,value:tn,onChange:nr=>{In(nr)},isDisabled:Le||ko,onBlur:()=>{const nr=parseFloat(tn);In(isNaN(nr)?"":String(nr)),Ui(fr,[{valueDecimal:isNaN(nr)?void 0:nr}]),r0(fr.linkId)},type:"number",hint:Fe||bo,isInvalid:!!Fe,autoComplete:pt},go)]})},mr=({item:fr,showStepper:r0=!1})=>{var Fr;const{text:Ui,linkId:mo,type:Co}=fr,ko=Ui&&(0,o.nt)(!1,"",Ui),Do=(Fr=fr.extension)==null?void 0:Fr.find(br=>br.url===i.Yt),bo=Do?.valueBoolean===!0,Ro=Co==="group"&&(0,o.$O)(fr)!==void 0,go=()=>{const br=(0,o.$O)(fr),Qn=(0,o.t7)(fr);if(br===void 0||Qn===void 0||Qn<=0)return[];const zr=[];for(let Le=1;Le<=Qn;Le++){let Ce="incomplete";Le<br?Ce="complete":Le===br&&(Ce="current"),zr.push({title:"",description:"",status:Ce})}return zr};return ko&&!bo?(0,n.jsxs)("div",{"data-testid":mo,children:[(0,n.jsx)(N,{text:ko,required:!1,className:""}),r0&&Ro&&(0,n.jsx)("div",{className:"mt-xl",children:(0,n.jsx)(r.Progress.MinimalIconsConnected,{orientation:"horizontal",size:"sm",items:go()})})]}):null},Mr=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro;const{linkId:go,text:br,required:Qn,prefix:zr,readOnly:Le}=fr,Ce=br?(0,o.nt)(mo,zr,br):"",Fe=Co?.[go]||"",pt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,"data-testid":go,size:"md",id:go,"aria-label":go,placeholder:Do,value:String((Ro=Fr?.[0])==null?void 0:Ro.valueInteger)||"",onChange:qt=>{Ui(fr,[{valueInteger:Number(qt)}])},isDisabled:Le||ko,onBlur:()=>{r0(fr.linkId)},type:"number",hint:Fe||bo,isInvalid:!!Fe,autoComplete:pt},go)]})},x0=({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro,go,br;const{linkId:Qn,text:zr,extension:Le,required:Ce,prefix:Fe,readOnly:pt}=fr,qt=zr?(0,o.nt)(mo,Fe,zr):"",tn=Le?.find(gn=>gn.url.includes("questionnaire-unitOption")),In=Co?.[Qn],nr=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[qt&&(0,n.jsx)(N,{isLabel:!0,text:qt,required:Ce||!1}),(0,n.jsx)(r.InputGroup,{isRequired:Ce,size:"md",id:Qn,"aria-label":Qn,"data-testid":Qn,value:(Ro=Fr?.[0])!=null&&Ro.valueQuantity?String((go=Fr[0].valueQuantity)==null?void 0:go.value):"",onChange:gn=>{Ui(fr,[{valueQuantity:{value:parseFloat(gn)}}])},isDisabled:pt||ko,onBlur:()=>{var gn,Un,cn;const ur=(gn=Fr?.[0])!=null&&gn.valueQuantity?parseFloat(String((cn=(Un=Fr?.[0])==null?void 0:Un.valueQuantity)==null?void 0:cn.value)).toFixed(2):"";Ui(fr,[{valueQuantity:{value:parseFloat(ur)}}]),r0(fr.linkId)},hint:In||bo,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:(br=tn?.valueCoding)==null?void 0:br.display}),children:(0,n.jsx)(r.InputBase,{type:"number",placeholder:Do,autoComplete:nr})},Qn)]})};var h0=e(61784);const ni="ui-toolkit-modern",Wi={CLOSE_MODAL:"CLOSE_MODAL",PROFILE:"PROFILE",SEARCH:"SEARCH",CALENDAR_PREV_WEEK:"CALENDAR_PREV_WEEK",CALENDAR_NEXT_WEEK:"CALENDAR_NEXT_WEEK",CALENDAR_CANCEL:"CALENDAR_CANCEL",CALENDAR_APPLY:"CALENDAR_APPLY",CALENDAR:"CALENDAR",NEXT_AVAILABLE_APPOINTMENTS:"NEXT_AVAILABLE_APPOINTMENTS",NO_NEXT_AVAILABLE_APPOINTMENTS:"NO_NEXT_AVAILABLE_APPOINTMENTS",TODAY:"TODAY",CLICK_TO_UPLOAD:"CLICK_TO_UPLOAD",OR_DRAG_AND_DROP:"OR_DRAG_AND_DROP",FAILED_TO_UPLOAD:"FAILED_TO_UPLOAD",TRY_AGAIN:"TRY_AGAIN",LOCATIONS_LOWER_CASE:"LOCATIONS_LOWER_CASE",LOCATION_LOWER_CASE:"LOCATION_LOWER_CASE",EXPAND:"EXPAND",COLLAPSE:"COLLAPSE",DISCLOSURE_MODAL_TITLE:"DISCLOSURE_MODAL_TITLE",DISCLOSURE_MODAL_DESCRIPTION:"DISCLOSURE_MODAL_DESCRIPTION",DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE:"DISCLOSURE_MODAL_CAMERA_PERMISSION_BLOCKED_MESSAGE",DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON:"DISCLOSURE_MODAL_REQUEST_CAMERA_ACCESS_BUTTON",FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON:"FILE_DISCLOSURE_TAKE_OR_UPLOAD_PHOTO_BUTTON",FILE_DISCLOSURE_UPLOAD_BUTTON:"FILE_DISCLOSURE_UPLOAD_BUTTON",FILE_UPLOAD_DROPZONE:"FILE_UPLOAD_DROPZONE",DOWNLOAD_DISCLOSURE_TITLE:"DOWNLOAD_DISCLOSURE_TITLE",DOWNLOAD_DISCLOSURE_DESCRIPTION:"DOWNLOAD_DISCLOSURE_DESCRIPTION",DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE:"DOWNLOAD_DISCLOSURE_ACCESS_DENIED_MESSAGE",DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE:"DOWNLOAD_DISCLOSURE_SUCCESS_MESSAGE",DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE:"DOWNLOAD_DISCLOSURE_GENERIC_ERROR_MESSAGE",DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON:"DOWNLOAD_DISCLOSURE_DOWNLOAD_BUTTON",DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON:"DOWNLOAD_DISCLOSURE_CONTINUE_BUTTON",DISMISS:"DISMISS",LOCATION_DISTANCE:"LOCATION_DISTANCE",LOCATION_DISTANCE_AWAY:"LOCATION_DISTANCE_AWAY",MILE:"MILE",MILES:"MILES",ADDRESS:"ADDRESS",CURRENT_LOCATION:"CURRENT_LOCATION",ZIP_CODE:"ZIP_CODE",SEE_ALL:"SEE_ALL",SEE_LESS:"SEE_LESS",SUBMIT:"SUBMIT"},Hi={CURRENT_LOCATION:"current-location",ADDRESS:"address",ZIP_CODE:"zip-code"},so={[Hi.CURRENT_LOCATION]:Wi.CURRENT_LOCATION,[Hi.ZIP_CODE]:Wi.ZIP_CODE,[Hi.ADDRESS]:Wi.ADDRESS},Lo={mi:{singular:Wi.MILE,plural:Wi.MILES}},xo=({resourceData:fr,handleInputChange:r0,item:Fr,questionnaireSchemaItems:Ui})=>{var mo;const{t:Co}=(0,h0.SS)(),{queryParams:ko}=(0,ht.useSearchQueryParams)(),Do=ko.locationType||"",{setCurrentGroupIndex:bo,handleContinueButtonClick:Ro,setHideFooterButton:go}=(0,p.c)(),{trackEvent:br}=(0,s.st)();(0,t.useEffect)(()=>{if(!Fr.readOnly)return go(!0),()=>{go(!1)}},[Fr.readOnly,go]);const Qn=(mo=Fr.extension)==null?void 0:mo.find(Un=>Un.url===i.Uf),zr=Qn?.valueString,Le=()=>{if(zr){const Un=(0,o.Ue)(Ui||[],zr);Un!==-1&&bo(Un)}},Ce=Un=>{const cn=Un.find(ur=>ur.url.includes("description"));return cn?.valueString||""},Fe=Un=>{const cn=Un.find(C0=>C0.url.includes("distance-value")),ur=Un.find(C0=>C0.url.includes("distance-unit")),Ir=cn?.valueString?Number(cn.valueString):NaN,t0=ur?.valueString||"";if(!t0||isNaN(Ir))return null;const A0=Math.round(Ir);let Vr=t0;return Lo[t0]&&(Vr=Co(A0===1?Lo[t0].singular:Lo[t0].plural)),Do&&so[Do]?Co(Wi.LOCATION_DISTANCE,{distance:`${A0} ${Vr}`,locationType:Co(so[Do])}):Co(Wi.LOCATION_DISTANCE_AWAY,{distance:`${A0} ${Vr}`})},pt=Un=>({id:Un.id||"",providerName:Un.name||"",specialty:"",distance:Fe(Un.extension||[])||"",placeholderIcon:r.WalgreensLogo,address:Un.address||"",valueReference:Un.valueReference||{reference:Un.id}}),qt=Un=>{var cn,ur,Ir,t0;const A0=Un;return pt({id:A0.id,name:(cn=A0.name)!=null?cn:"",address:(t0=(Ir=(ur=A0?.address)==null?void 0:ur.line)==null?void 0:Ir[0])!=null?t0:"",extension:A0?.extension,valueReference:{reference:A0.id}})},tn=Un=>pt({id:Un?.reference,name:Un?.display,address:Ce(Un?.extension||[]),extension:Un?.extension,valueReference:Un}),nr=(()=>fr&&Array.isArray(fr)&&fr.length>0?fr.map(qt):Fr.initial&&Array.isArray(Fr.initial)&&Fr.initial.length>0?Fr.initial.map(Un=>tn(Un.valueReference)):Fr.answerOption?Fr.answerOption.map(Un=>tn(Un.valueReference)):[])(),gn=Un=>{r0(Fr,[{valueReference:Un}])};return(0,n.jsx)("div",{className:(0,r.cx)("gap-md flex flex-col",!Fr.readOnly&&"pb-4xl"),children:Fr.readOnly?nr.map(({address:Un,id:cn,providerName:ur,placeholderIcon:Ir,distance:t0})=>(0,n.jsx)(ht.SchedulingLocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},locationName:ur,address:Un,distance:t0,actionButtonText:zr?"Change location":void 0,onActionButtonClick:zr?Le:void 0},cn)):nr.map(({address:Un,id:cn,providerName:ur,placeholderIcon:Ir,specialty:t0,valueReference:A0,distance:Vr})=>(0,n.jsx)(r.LocationCard,{className:"shadow-sm",avatar:{placeholderIcon:Ir},providerName:{content:ur},specialty:{content:t0},location:{address:Un,distance:Vr},actionButton:{children:"Schedule appointment",onClick:()=>{br("schedule_appointment_clicked",{page_on:"Choose your pharmacy",location:Un,_event_metadata:{description:"A user clicked the Schedule appointment cta"}}),gn(A0),Ro?.()}}},cn))})};var lo=e(79079),Io=e(32066),co=e(43915),jo=e(36181),Uo=e(37234),qa=e(59931),Pr=e(65388),tr=Object.defineProperty,Zr=Object.defineProperties,Lr=Object.getOwnPropertyDescriptors,V0=Object.getOwnPropertySymbols,bn=Object.prototype.hasOwnProperty,Vn=Object.prototype.propertyIsEnumerable,Er=(fr,r0,Fr)=>r0 in fr?tr(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,u0=(fr,r0)=>{for(var Fr in r0||(r0={}))bn.call(r0,Fr)&&Er(fr,Fr,r0[Fr]);if(V0)for(var Fr of V0(r0))Vn.call(r0,Fr)&&Er(fr,Fr,r0[Fr]);return fr},Jn=(fr,r0)=>Zr(fr,Lr(r0));const Gn="tz-code",ri={"ui-toolkit/LocationCard":xo,"ui-toolkit/TimeSlotSelection":({resourceData:fr,item:r0,handleInputChange:Fr,selectedAnswer:Ui,questionnaireSchemaItems:mo,formData:Co,onCompleteHandler:ko})=>{var Do,bo;const{t:Ro}=(0,lo.S)(),{trackEvent:go}=(0,s.st)(),{isLoading:br,setIsInlineNextQuestionTriggered:Qn}=(0,p.c)(),zr=M0=>{const bi=M0.match(/^(\d{4}-\d{2}-\d{2})/);return bi?bi[1]:M0},Le=M0=>{const bi=M0.match(/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})/);return bi?`${bi[1]} ${bi[2]}`:M0},Ce=M0=>{const bi=M0.match(/^(\d{4})-(\d{2})-(\d{2})/);if(bi){const[,U0,Bo,wi]=bi;return new Date(parseInt(U0),parseInt(Bo)-1,parseInt(wi))}return new Date},pt=(()=>{var M0;if((M0=Ui?.[0])!=null&&M0.valueReference){const bi=Ui[0].valueReference,U0=bi.display||"",Bo=zr(U0);if(Bo)return{date:Ce(Bo),slotId:bi.reference||""}}return{date:new Date,slotId:""}})(),[qt,tn]=(0,t.useState)(pt.date),[In,nr]=(0,t.useState)(pt.slotId),[gn,Un]=(0,t.useState)(new Set),cn=(0,t.useMemo)(()=>new Di.ng(qt.getFullYear(),qt.getMonth()+1,qt.getDate()),[qt]),ur=M0=>({display:M0.display||"",id:M0.id||"",start:M0.start||"",extension:Array.isArray(M0.extension)?M0.extension:[],identifier:Array.isArray(M0.identifier)?M0.identifier:[],type:M0.type||""}),Ir=M0=>ur({display:M0.start?Le(M0.start):"",id:M0.id,start:M0.start,extension:M0.extension,identifier:M0.identifier}),t0=M0=>ur({display:M0?.display||"",id:M0?.reference,start:M0?.display,extension:M0?.extension,identifier:M0?.identifier,type:M0?.type}),A0=()=>{if(Array.isArray(fr)&&fr.length>0)return fr.filter(M0=>M0.resourceType==="Appointment").map(Ir);if(r0.initial&&Array.isArray(r0.initial)&&r0.initial.length>0)return r0.initial.map(M0=>t0(M0.valueReference));if(r0.answerOption)return r0.answerOption.map(M0=>t0(M0.valueReference))},Vr=(0,t.useMemo)(()=>A0()||[],[fr,Ui,r0]),C0=(0,t.useMemo)(()=>{const M0={};return Vr.forEach(bi=>{if(bi.start&&bi.id){const U0=zr(bi.start);M0[U0]||(M0[U0]=[]),M0[U0].push({display:bi.display,id:bi.id,start:bi.start,extension:bi.extension})}}),M0},[Vr]),di=(0,t.useMemo)(()=>{const M0=Object.keys(C0).sort(),bi=[];if(M0.length===0)return bi.push(cn),gn.forEach(wi=>{const Eo=(0,co.A)(wi);bi.push(new Di.ng(Eo.getFullYear(),Eo.getMonth()+1,Eo.getDate()))}),bi;const U0=(0,co.A)(M0[M0.length-1]),Bo=new Di.ng(U0.getFullYear(),U0.getMonth()+1,U0.getDate());for(let wi=cn;wi.compare(Bo)<=0;wi=wi.add({days:1})){const Eo=`${wi.year}-${String(wi.month).padStart(2,"0")}-${String(wi.day).padStart(2,"0")}`;C0[Eo]||bi.push(wi)}if(!(0,o.mR)(r0)){const wi=(0,Io.Ec)((0,Io.Xj)()).add({days:30});let Eo=Bo.add({days:1});for(;Eo.compare(wi)<=0;)bi.push(Eo),Eo=Eo.add({days:1})}return gn.forEach(wi=>{const Eo=(0,co.A)(wi),Aa=new Di.ng(Eo.getFullYear(),Eo.getMonth()+1,Eo.getDate());bi.some(Zo=>Zo.year===Aa.year&&Zo.month===Aa.month&&Zo.day===Aa.day)||bi.push(Aa)}),bi},[C0,gn,cn,r0]),ut=(0,t.useMemo)(()=>(0,o.mR)(r0)?r.MAX_AVAILABLE_TIME_SLOT_DAYS:30,[r0]),$t=(0,t.useMemo)(()=>Object.keys(C0).map(M0=>{const bi=(0,co.A)(M0);return new Di.ng(bi.getFullYear(),bi.getMonth()+1,bi.getDate())}),[C0]),Mn=(0,jo.A)((0,Uo.A)(qt),"yyyy-MM-dd"),qn=(0,t.useMemo)(()=>C0[Mn]||[],[C0,Mn]);(0,t.useEffect)(()=>{const M0=Object.entries(C0).sort(([bi],[U0])=>bi.localeCompare(U0)).slice(0,3).reduce((bi,[U0,Bo])=>Jn(u0({},bi),{[`${U0} ${si}`]:Bo.map(wi=>{var Eo;return(0,Pr.YX)({time:wi.start,timeZone:(0,o.lv)((Eo=qn[0])==null?void 0:Eo.extension)}).time})}),{});go("slots_returned",{Specialty:"Vaccines",first_three_days_slots:M0,_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),Ur=t.useRef(null),c0=t.useRef(!1);(0,t.useEffect)(()=>{var M0;const bi=Object.keys(C0).sort();bi.length===0||c0.current||(c0.current=!0,(M0=Ui?.[0])!=null&&M0.valueReference||tn((0,co.A)(bi[0])))},[C0]),(0,t.useEffect)(()=>{var M0;const bi=Object.keys(C0).sort();if(bi.length===0)return;const Bo=!(kn.current===null)&&JSON.stringify(kn.current)!==JSON.stringify(C0);if(kn.current=C0,!!Bo&&(Un(new Set),Ur.current)){const wi=Ur.current;if(!(((M0=C0[wi])==null?void 0:M0.length)>0)){const Aa=new Set,Zo=(0,co.A)(wi),Ds=(0,co.A)(bi[0]);let Fs=Zo;for(;Fs<Ds;){const qo=(0,jo.A)(Fs,"yyyy-MM-dd");Aa.add(qo),Fs=new Date(Fs),Fs.setDate(Fs.getDate()+1)}Un(Aa),nr("")}Ur.current=null}},[C0]);const si=(0,t.useMemo)(()=>{var M0;const bi=qn[0];if(!bi?.extension)return"";const U0=bi.extension.find(Bo=>Bo?.url===Gn);try{return(0,qa.formatToTimeZone)(new Date,"(z)",{timeZone:(M0=U0?.valueCode)!=null?M0:""})}catch{return""}},[qn]),z0=(0,t.useMemo)(()=>{const M0=Ro(r.Translations.NEXT_AVAILABLE_APPOINTMENTS);return si?`${M0} ${si}`:M0},[Ro,si]),Y0=(0,t.useMemo)(()=>{const M0=(0,Io.Ec)((0,Io.Xj)()).add({days:ut}),bi=`${M0.year}-${String(M0.month).padStart(2,"0")}-${String(M0.day).padStart(2,"0")}`,Bo=Object.keys(C0).sort().find(wi=>wi>Mn&&wi<=bi);if(Bo){const wi=(0,co.A)(Bo);return new Di.ng(wi.getFullYear(),wi.getMonth()+1,wi.getDate())}return null},[C0,Mn,ut]),Ii=()=>{if(Y0){const M0=Y0.toDate((0,Io.Xj)());tn(M0),nr("")}},G0=M0=>{if(!M0){nr(""),Fr(r0,void 0);return}nr(M0.id);const bi=[{valueReference:{display:M0.display,reference:M0.id,extension:M0.extension,identifier:M0.identifier,type:M0.type}}];Fr(r0,bi)},Ti=M0=>{var bi;if(!M0||br||!c0.current)return;const U0=Object.keys(C0).sort(),Bo=U0[U0.length-1],wi=U0[0],Eo=`${M0.year}-${String(M0.month).padStart(2,"0")}-${String(M0.day).padStart(2,"0")}`;if(Bo&&(Eo>Bo||wi&&Eo<wi)&&(0,o.mR)(r0)&&mo&&!di?.some(Zo=>Zo.compare(M0)===0)){const Zo=(0,o.yQ)(r0,mo);if(Zo){Ur.current=Eo;let Ds="-06:00";if((bi=Vr[0])!=null&&bi.start){const Hs=Vr[0].start.match(/([+-]\d{2}:\d{2})$/);Hs&&(Ds=Hs[1])}const qo=[{valueDateTime:`${Eo}T23:59:59${Ds}`}],l1=Fr(Zo,qo);Fr(r0,void 0,(0,o.Nw)(l1||Co||[],r0.linkId),void 0,!0),Qn(!0),ko(Zo.linkId,!0,!0)}}const Aa=M0.toDate((0,Io.Xj)());tn(Aa),nr("")},K0=M0=>{if(!M0)return;const bi=qn.find(U0=>U0.id===M0);go("slot_selected",{Specialty:"Vaccines",time_slot:bi?(0,Pr.YX)({time:bi.start,timeZone:(0,o.lv)(qn[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."}}),G0(bi??null)};return(0,n.jsx)(r.TimeSlot,{onChange:Ti,disabledDates:di,highlightedDates:$t,loading:br,minValue:(0,Io.Ec)((0,Io.Xj)()),maxValue:(0,Io.Ec)((0,Io.Xj)()).add({days:ut}),value:cn,defaultValue:cn,appointmentSlots:{title:z0,onChange:K0,defaultValue:Ui&&((bo=(Do=Ui[0])==null?void 0:Do.valueReference)==null?void 0:bo.reference)||void 0,value:In||void 0,items:qn.map(M0=>({label:Se(M0.start),value:M0.id}))||[]},nextAppointment:{children:(0,n.jsxs)("p",{className:"text-secondary text-center text-sm font-normal",children:[Ro(r.Translations.NO_NEXT_AVAILABLE_APPOINTMENTS),Y0&&(0,n.jsx)("button",{onClick:Ii,className:"ml-2 cursor-pointer font-normal text-blue-700 underline",children:Ro(r.Translations.GO_TO_NEXT_AVAILABLE_TIMESLOT)})]})}})}};var ki=Object.defineProperty,ta=Object.defineProperties,Go=Object.getOwnPropertyDescriptors,sa=Object.getOwnPropertySymbols,Ci=Object.prototype.hasOwnProperty,S0=Object.prototype.propertyIsEnumerable,Ua=(fr,r0,Fr)=>r0 in fr?ki(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,cs=(fr,r0)=>{for(var Fr in r0||(r0={}))Ci.call(r0,Fr)&&Ua(fr,Fr,r0[Fr]);if(sa)for(var Fr of sa(r0))S0.call(r0,Fr)&&Ua(fr,Fr,r0[Fr]);return fr},vs=(fr,r0)=>ta(fr,Go(r0)),ms=(fr,r0)=>{var Fr={};for(var Ui in fr)Ci.call(fr,Ui)&&r0.indexOf(Ui)<0&&(Fr[Ui]=fr[Ui]);if(fr!=null&&sa)for(var Ui of sa(fr))r0.indexOf(Ui)<0&&S0.call(fr,Ui)&&(Fr[Ui]=fr[Ui]);return Fr};const ss=(fr,r0)=>fr.answerOption?fr.answerOption.map(Fr=>{var Ui,mo;const Co=(mo=(Ui=Fr.valueReference)==null?void 0:Ui.reference)==null?void 0:mo.replace("#","");return r0.find(ko=>ko.id===Co)}).filter(Boolean):[],p1=fr=>{var r0,Fr,Ui;const mo=fr.find(Co=>{var ko,Do;return Co.url.includes("questionnaire-itemControl")&&((Do=(ko=Co.valueCodeableConcept)==null?void 0:ko.coding)==null?void 0:Do.some(bo=>{var Ro;return(Ro=bo.code)==null?void 0:Ro.startsWith("ui-toolkit/")}))});return(Ui=(Fr=(r0=mo?.valueCodeableConcept)==null?void 0:r0.coding)==null?void 0:Fr.find(Co=>{var ko;return(ko=Co.code)==null?void 0:ko.startsWith("ui-toolkit/")}))==null?void 0:Ui.code},jn=fr=>{var{uiToolkitCode:r0,props:Fr}=fr,Ui=Fr,{item:mo,contained:Co=[],customErrorConfigurations:ko}=Ui,Do=ms(Ui,["item","contained","customErrorConfigurations"]);const{setHideFooterButton:bo}=(0,p.c)(),Ro=ri[r0];if(!Ro)return(0,n.jsx)(n.Fragment,{});const go=ss(mo,Co),br=go.length>0;return!(mo.answerOption&&mo.answerOption.length>0)&&!br&&!mo.readOnly?(bo(!0),(0,n.jsx)(xe,{configKey:r0,customErrorConfigurations:ko})):(0,n.jsx)(Ro,vs(cs({},Do),{item:mo,contained:Co,customErrorConfigurations:ko,resourceData:go,"data-testid":mo.linkId}))},F0={attachment:nn,choice:Kr,boolean:fn,integer:Mr,string:({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro;const{linkId:go,text:br,required:Qn,prefix:zr,readOnly:Le}=fr,Ce=br?(0,o.nt)(mo,zr,br):"",Fe=Co?.[go]||"",pt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md","aria-label":go,"data-testid":go,id:go,type:pt==="tel"?"tel":"text",placeholder:Do,value:((Ro=Fr?.[0])==null?void 0:Ro.valueString)||"",onChange:qt=>{Ui(fr,[{valueString:qt}])},isDisabled:Le||ko,onBlur:qt=>{const tn=qt.target.value,In=tn.trim();In!==tn&&Ui(fr,[{valueString:In}]),r0(fr.linkId)},hint:Fe||bo,isInvalid:!!Fe,autoComplete:pt},go)]})},url:({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro;const{linkId:go,text:br,required:Qn,prefix:zr,readOnly:Le}=fr,Ce=br?(0,o.nt)(mo,zr,br):"",Fe=Co?.[go]||"",pt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Ce&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Ce,required:Qn||!1}),(0,n.jsx)(r.Input,{isRequired:Qn,size:"md",type:"url",id:go,"data-testid":go,"aria-label":go,placeholder:Do,value:((Ro=Fr?.[0])==null?void 0:Ro.valueUri)||"",onChange:qt=>{Ui(fr,[{valueUri:qt}])},isDisabled:Le||ko,onBlur:qt=>{const tn=qt.target.value,In=tn.trim();In!==tn&&Ui(fr,[{valueUri:In}]),r0(fr.linkId)},hint:Fe||bo,isInvalid:!!Fe,autoComplete:pt},go)]})},text:({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko,placeholder:Do,hintText:bo})=>{var Ro;const{linkId:go,text:br,required:Qn,prefix:zr,readOnly:Le,maxLength:Ce}=fr,Fe=br?(0,o.nt)(mo,zr,br):"",pt=Co?.[go]||"",qt=(0,o.a0)(fr);return(0,n.jsxs)("div",{children:[Fe&&(0,n.jsx)(N,{isLabel:!0,className:"mb-sm text-md",text:Fe,required:Qn||!1}),(0,n.jsx)(r.TextArea,{isRequired:Qn,id:go,"aria-label":go,"data-testid":go,rows:3,placeholder:Do,value:((Ro=Fr?.[0])==null?void 0:Ro.valueString)||"",onChange:tn=>{Ui(fr,[{valueString:tn}])},isDisabled:Le||ko,onBlur:tn=>{const In=tn.target.value,nr=In.trim();nr!==In&&Ui(fr,[{valueString:nr}]),r0(fr.linkId)},hint:pt||bo,counter:!0,isInvalid:!!pt,maxLength:Ce,autoComplete:qt},go)]})},date:X0,time:({item:fr,onCompleteHandler:r0,selectedAnswer:Fr,handleInputChange:Ui,showQuestionPrefix:mo,errors:Co,isLoading:ko})=>{var Do;const{linkId:bo,text:Ro,required:go,prefix:br,readOnly:Qn}=fr,zr=Ro?(0,o.nt)(mo,br,Ro):"",Le=Co?.[bo]||"";return(0,n.jsxs)("div",{children:[zr&&(0,n.jsx)(N,{isLabel:!0,text:zr,required:go||!1}),(0,n.jsx)(r.Input,{isRequired:go,size:"md",type:"time",id:bo,"data-testid":bo,"aria-label":bo,placeholder:"Type your response here...",value:((Do=Fr?.[0])==null?void 0:Do.valueTime)||"",onChange:Ce=>{Ui(fr,[{valueTime:Ce}])},isDisabled:Qn||ko,onBlur:()=>{r0(fr.linkId)},hint:Le,isInvalid:!!Le},bo)]})},dateTime:zi,quantity:x0,decimal:vr,question:mr,display:mr,group:mr,reference:fr=>{var r0,Fr,Ui,mo,Co;const{setHideFooterButton:ko}=(0,p.c)(),{item:Do,customErrorConfigurations:bo}=fr,Ro=Do.extension||[],go=p1(Ro);return go?(0,n.jsx)(jn,{uiToolkitCode:go,props:fr}):((Co=(mo=(Ui=(Fr=(r0=Do?.extension)==null?void 0:r0.find(Qn=>Qn.url.includes("questionnaire-itemControl")))==null?void 0:Fr.valueCodeableConcept)==null?void 0:Ui.coding)==null?void 0:mo[0])==null?void 0:Co.code)==="check-box"?Do.answerOption&&Do.answerOption.length>0?(0,n.jsx)(Kr,vs(cs({},fr),{item:Do})):(ko(!0),(0,n.jsx)(xe,{configKey:Do.linkId,customErrorConfigurations:bo})):null}};var Bt=(fr,r0,Fr)=>new Promise((Ui,mo)=>{var Co=bo=>{try{Do(Fr.next(bo))}catch(Ro){mo(Ro)}},ko=bo=>{try{Do(Fr.throw(bo))}catch(Ro){mo(Ro)}},Do=bo=>bo.done?Ui(bo.value):Promise.resolve(bo.value).then(Co,ko);Do((Fr=Fr.apply(fr,r0)).next())});const Ke=({item:fr,selectedAnswer:r0,showQuestionPrefix:Fr})=>{const{text:Ui,prefix:mo,required:Co}=fr,ko=Ui?getUpdatedQuestionText(Fr,mo,Ui):"",[Do,bo]=useState(null),[Ro,go]=useState(!1),{documentDownload:br,webview:Qn}=useNativeBridge(),zr=(r0||[]).filter(pt=>{var qt,tn;return((qt=pt.valueAttachment)==null?void 0:qt.data)&&((tn=pt.valueAttachment)==null?void 0:tn.title)}).map((pt,qt)=>{var tn,In,nr,gn,Un,cn,ur;return{id:((tn=pt.valueAttachment)==null?void 0:tn.id)||`preview-${qt}`,fileName:((In=pt.valueAttachment)==null?void 0:In.title)||`attachment-${qt}`,contentType:((nr=pt.valueAttachment)==null?void 0:nr.contentType)||"application/octet-stream",base64Data:((gn=pt.valueAttachment)==null?void 0:gn.data)||"",size:getBase64Size(((Un=pt.valueAttachment)==null?void 0:Un.data)||"",(cn=pt.valueAttachment)==null?void 0:cn.contentType),type:getFileTypeFromMimeType((ur=pt.valueAttachment)==null?void 0:ur.contentType)}}),Le=useCallback(pt=>{const{fileName:qt,contentType:tn,base64Data:In}=pt;if(Qn.isWithin)bo({fileName:qt,contentType:tn,base64Data:In}),go(!0);else{const nr=base64toObjectUrl(In,tn),gn=document.createElement("a");gn.href=nr,gn.download=qt,document.body.appendChild(gn),gn.click(),document.body.removeChild(gn),URL.revokeObjectURL(nr)}},[Qn.isWithin]),Ce=useCallback(()=>Bt(void 0,null,function*(){!Do||(yield br.writeFile(Do.fileName,prepareDataUrl(Do.base64Data,Do.contentType)))}),[Do,br]),Fe=useCallback(()=>{go(!1),bo(null)},[]);return zr.length?jsxs("div",{children:[ko&&jsx(FHIRQuestionnaireQuestionText,{isLabel:!0,className:"mb-sm text-md",text:ko,required:Co||!1}),jsx(FileUploadList,{role:"group",className:"flex-row flex-wrap",children:zr.map(pt=>jsx("button",{type:"button",onClick:()=>Le(pt),className:"max-w-full min-w-0 cursor-pointer border-0 bg-transparent p-0",children:jsx(FileListItemProgressFill,{as:"div",name:truncateFileName(pt.fileName),size:pt.size,type:pt.type})},pt.id))}),jsx(DownloadDisclosureModal,{opened:Ro,onClose:Fe,onDownload:Ce,contentType:Do?.contentType||"",analyticsEventPrefix:"Questionnaire Attachment - Disclosure"})]}):null};var ct=Object.defineProperty,Nt=Object.defineProperties,Dn=Object.getOwnPropertyDescriptors,ar=Object.getOwnPropertySymbols,xr=Object.prototype.hasOwnProperty,T0=Object.prototype.propertyIsEnumerable,q0=(fr,r0,Fr)=>r0 in fr?ct(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,j0=(fr,r0)=>{for(var Fr in r0||(r0={}))xr.call(r0,Fr)&&q0(fr,Fr,r0[Fr]);if(ar)for(var Fr of ar(r0))T0.call(r0,Fr)&&q0(fr,Fr,r0[Fr]);return fr},Qi=(fr,r0)=>Nt(fr,Dn(r0));const Gi=(fr,r0,Fr,Ui)=>{var mo;const Co=fr.extension||[];if(Ui?.[BUTTON_TYPE_EXTERNAL_KEY]&&Co.some(go=>go.url===BUTTON_TYPE_EXTENSION_URL))return Ui[BUTTON_TYPE_EXTERNAL_KEY];if(isHiddenExtensionPresent(fr)||hasParentWithUIToolkitWidget(fr,r0))return null;if(Fr&&fr.type==="attachment")return FHIRQuestionnaireAttachmentPreview;const ko=getUIToolkitCode(Co),Do=Co.filter(go=>go.url.includes("questionnaire-itemControl")).flatMap(go=>{var br,Qn;return(Qn=(br=go.valueCodeableConcept)==null?void 0:br.coding)!=null?Qn:[]})||[];let bo;return Ui&&(bo=(mo=Do.find(go=>go.code&&Ui[go.code]))==null?void 0:mo.code),(bo&&Ui?Ui[bo]:void 0)||UI_TOOLKIT_WIDGET_MAP[ko||""]||typeToRenderFunctionMap[fr.type]||null},oo=fr=>{var r0;const{item:Fr,selectedAnswer:Ui,handleInputChange:mo,showQuestionPrefix:Co,errors:ko,questionnaireSchemaItems:Do,formData:bo,isNestedRepeatedItem:Ro=!1}=fr,{linkId:go,text:br,prefix:Qn,required:zr,repeats:Le}=Fr,Ce=getMaxOccursFromExtensions(Fr.extension),Fe=getPlaceholderFromExtensions(Fr.extension,Fr.type),[pt,qt]=useState(()=>{if(Fr.type==="group"&&Fr.item&&Fr.item.length>0){const Vr=bo?.filter(C0=>C0.linkId===Fr.linkId)||[];if(Vr.length>0)return Vr.map((C0,di)=>di)}else if(Ui&&Ui.length>0)return Ui.map((Vr,C0)=>C0);return[0]}),tn=Ce!==void 0&&pt.length>=Ce,In=br?getUpdatedQuestionText(Co,Qn,br):"",nr=()=>{const Vr=Math.max(...pt,-1)+1,C0=[...pt,Vr];if(qt(C0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const di=Fr.item.map($t=>({linkId:$t.linkId,text:$t.text,answer:[{}]})),ut={linkId:Fr.linkId,text:Fr.text,answer:[{}],item:di};mo(Fr,void 0,[ut])}else{const di=[...Ui||[]];di.push({}),mo(Fr,di)}},gn=Vr=>{if(pt.length<=1)return;const C0=pt.filter((di,ut)=>ut!==pt.length-1);if(qt(C0),Fr.type==="group"&&Fr.item&&Fr.item.length>0){const di=[];if(bo?.forEach((ut,$t)=>{ut.linkId===go&&di.push({item:ut,originalIndex:$t})}),Vr>=0&&Vr<di.length){const ut=di[Vr],$t=bo?.filter((Mn,qn)=>qn!==ut.originalIndex);mo(Fr,void 0,$t,void 0,!0)}}else{const di=Ui?.filter((ut,$t)=>$t!==Vr)||[];mo(Fr,di.length>0?di:[{}])}},Un=Vr=>{if(!bo||!Fr.item)return[];const C0=$t=>{const Mn=[];for(const qn of $t)if(qn.linkId===Fr.linkId&&Mn.push(qn),qn.item&&qn.item.length>0){const kn=C0(qn.item);Mn.push(...kn)}return Mn},ut=C0(bo)[Vr];return ut?.item?ut.item:[]},cn=(Vr,C0)=>{if(isHiddenExtensionPresent(Vr))return null;const di=Un(C0);if(!isQuestionEnabledForInstance(Vr.enableWhen,Vr.enableBehavior,bo||[],Fr.linkId,C0))return null;if(Vr.repeats){const kn=findNestedAnswer(di,Vr.linkId),Ur=Qi(j0({},fr),{item:Vr,selectedAnswer:kn||[{}],errors:getInstanceErrors(ko,Fr,C0),handleInputChange:(c0,si,z0)=>mo(c0,si,z0,C0)});return jsx("div",{children:jsx(oo,Qi(j0({},Ur),{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,bo||[],Fr.linkId,C0))return null;const c0=Gi(kn,Do,fr.isLoading,fr.externalComponentRenderMap);if(!c0)return null;const si=findNestedAnswer(di,kn.linkId),z0=Qi(j0({},fr),{item:kn,selectedAnswer:si,placeholder:getPlaceholderFromExtensions(kn.extension,kn.type),errors:getInstanceErrors(ko,Fr,C0),handleInputChange:(Y0,Ii,G0)=>mo(Y0,Ii,G0,C0)});return createElement(c0,Qi(j0({},z0),{key:kn.linkId}))})})]},Vr.linkId);const $t=Gi(Vr,Do,fr.isLoading,fr.externalComponentRenderMap);if(!$t)return null;const Mn=findNestedAnswer(di,Vr.linkId),qn=Qi(j0({},fr),{item:Vr,selectedAnswer:Mn,placeholder:getPlaceholderFromExtensions(Vr.extension,Vr.type),errors:getInstanceErrors(ko,Fr,C0),handleInputChange:(kn,Ur,c0)=>mo(kn,Ur,c0,C0)});return createElement($t,Qi(j0({},qn),{key:`${Vr.linkId}-${C0}`}))},ur=()=>{const Vr=getDirectErrors(ko,go);return jsxs("div",{className:"flex flex-col gap-2",children:[Vr[go]&&jsx("div",{className:"text-error-primary text-sm font-medium",children:Vr[go]}),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:fr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})},Ir=Vr=>pt.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:fr.isLoading}),t0=Gi(Fr,Do,fr.isLoading,fr.externalComponentRenderMap);return hasRepeatingParent(Fr,Do)&&!Ro?null:!Le||Le&&hasCheckboxExtension(Fr)?t0?jsx(t0,Qi(j0({},fr),{placeholder:Fe,errors:{[Fr.linkId]:((r0=ko?.[Fr.linkId])==null?void 0:r0[0])||""}})):null:Fr.type==="group"&&Fr.item&&Fr.item.length>0&&Fr.repeats?jsxs("div",{"data-testid":`${go}-repeating`,children:[In&&jsx(FHIRQuestionnaireQuestionText,{text:In,required:zr||!1}),pt.map(Vr=>{var C0;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:(C0=Fr.item)==null?void 0:C0.map(di=>cn(di,Vr))})]},`${go}-instance-${Vr}`)}),ur()]}):t0?jsxs("div",{"data-testid":`${go}-repeating`,children:[pt.map(Vr=>{const C0=Ui?.[Vr]?[Ui[Vr]]:void 0,di=Qi(j0({},fr),{item:Fr,selectedAnswer:C0,errors:getInstanceErrors(ko,Fr,Vr),handleInputChange:(ut,$t,Mn)=>mo(ut,$t,Mn,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(t0,j0({},di))]},`${go}-instance-${Vr}`)}),jsxs("div",{children:[(()=>{const C0=getDirectErrors(ko,go)[go];return C0&&jsx("div",{className:"text-error-primary mb-3 text-sm font-medium",children:C0})})(),!tn&&jsx("div",{className:"flex items-center justify-center",children:jsx(Button,{color:"link-color",size:"sm",onClick:nr,className:"mt-4 text-center",isDisabled:fr.isLoading,iconLeading:jsx(Plus,{className:"h-4 w-4"}),children:"Add Item"})})]})]}):null};var wo=Object.defineProperty,ga=Object.defineProperties,Jo=Object.getOwnPropertyDescriptors,va=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,Ka=(fr,r0,Fr)=>r0 in fr?wo(fr,r0,{enumerable:!0,configurable:!0,writable:!0,value:Fr}):fr[r0]=Fr,ts=(fr,r0)=>{for(var Fr in r0||(r0={}))Ya.call(r0,Fr)&&Ka(fr,Fr,r0[Fr]);if(va)for(var Fr of va(r0))Is.call(r0,Fr)&&Ka(fr,Fr,r0[Fr]);return fr},Es=(fr,r0)=>ga(fr,Jo(r0));const Ja=null,Ws=({formId:fr,questionnaireSchema:r0,questionnaireResponseItem:Fr,errorConfig:Ui,customErrorConfigurations:mo,showQuestionPrefix:Co=!0,isAdaptiveFlow:ko=!1,status:Do,hideBackButton:bo=!1,showStepper:Ro=!1,onComplete:go,onClearError:br,handleHiddenQuestion:Qn,onGoBack:zr,onFormDataChange:Le=()=>{},externalComponentRenderMap:Ce,children:Fe})=>{var pt,qt;const{setHandleContinueButtonClick:tn,setHandleBackButtonClick:In,setIsCurrentFormValid:nr,setCurrentGroupLinkId:gn,setCurrentGroupIndex:Un,setTotalSteps:cn,setHideFooterButton:ur,setIsInlineNextQuestionTriggered:Ir,isCurrentFormValid:t0,currentGroupIndex:A0,isLoading:Vr,hasCustomError:C0,groupItemIndicesRef:di}=useFHIRQuestionnaire(),{trackEvent:ut}=useAnalytics(),[$t,Mn]=useState([]),[qn,kn]=useState(new Set),[Ur,c0]=useState([]),[si,z0]=useState([]),Y0=di,Ii=useRef(new Map),G0=useRef(new Set),[Ti,K0]=useState({}),[M0,bi]=useState(!1),[U0,Bo]=useState(r0),wi=useRef(Fr||[]),Eo=useRef(!1),Aa=useRef(!1),Zo=useMemo(()=>getTotalStepsFromQuestionnaire(r0),[r0]),[Ds,Fs]=useState(!1),qo=useRef([]),l1=(qi,to)=>{var Xi,_o,Na,Ia,Tr;if(isCallNextQuestionExtensionPresent(qi))return qi.linkId;const Kn=validateCurrentPage(to,$t,A0,U0,Y0),Hr=Y0.current[A0],el=A0+1,R1=Y0.current[el],pl=A0===0?0:Hr,Kl=(_o=R1??((Xi=U0?.item)==null?void 0:Xi.length))!=null?_o:0;let Ml=-1;for(let $n=pl;$n<Kl;$n++){const To=(Na=U0?.item)==null?void 0:Na[$n];if(To?.linkId===qi.linkId){Ml=$n;break}}const Jl=($n,To=[])=>($n.forEach(Po=>{var Za;if((!Po.enableWhen||isQuestionEnabled(Po.enableWhen,Po.enableBehavior,to))&&isCallNextQuestionExtensionPresent(Po)&&!qo.current.includes(Po.linkId))if(Po.required){const h1=(Za=findResponseItem(to,Po.linkId))==null?void 0:Za.answer;(h1&&h1.length>0&&Object.keys(h1[0]).length>0||Po.initial&&Po.initial.length>0&&!qn.has(Po.linkId))&&To.push(Po.linkId)}else To.push(Po.linkId);Po.item&&Po.item.length>0&&Jl(Po.item,To)}),To),Su=[],Oi=Ml!==-1?Ml+1:Kl;for(let $n=pl;$n<Oi;$n++){const To=(Ia=U0?.item)==null?void 0:Ia[$n];To&&Jl([To],Su)}if(Su.length>0&&Kn){const $n=Su[Su.length-1],To=h1=>h1.flatMap(P1=>[P1,...P1.item?To(P1.item):[]]),Po=To((Tr=U0?.item)!=null?Tr:[]),Za=Po.findIndex(h1=>h1.linkId===$n),Ba=Po.findIndex(h1=>h1.linkId===qi.linkId);return Za!==-1&&Ba>Za?void 0:$n}},Hs=qi=>l1(qi,wi.current)?!0:qi.item&&qi.item.length>0?qi.item.some(Hs):!1,bs=()=>{var qi;if(!ko||A0<0||!U0?.item)return{shouldTriggerInlineLoading:!1,canNavigateToNextGroup:!1,hasMoreGroups:!1};const to=Y0.current[A0],_o=(Ii.current.get(to)||[to]).some(Tr=>{var Kn;const Hr=(Kn=U0.item)==null?void 0:Kn[Tr];return Hr?Hs(Hr):!1}),Na=A0<Y0.current.length-1;let Ia=!1;if(_o&&Na){const Tr=A0+1,Kn=Y0.current[Tr],Hr=(qi=U0?.item)==null?void 0:qi[Kn],el=!Hr?.enableWhen||isQuestionEnabled(Hr.enableWhen,Hr.enableBehavior,wi.current),R1=Hr?isPageExtensionPresent(Hr):!1;Ia=el&&R1}return{shouldTriggerInlineLoading:_o,canNavigateToNextGroup:Ia,hasMoreGroups:Na}},B1=(qi,to,Xi,_o)=>{const Na=getUpdatedFormData(U0?.item||[],wi.current,qi,to,Xi,_o);return wi.current=Na,Le(Na),Na},Or=(qi,to,Xi,_o,Na)=>{B1(to,Xi,_o,Na),_o.forEach(Ia=>{const Tr=getValidationError(Es(ts({},qi),{linkId:Ia.linkId}),wi.current,Ia.answer);Tr&&K0(Kn=>Es(ts({},Kn),{[Ia.linkId]:typeof Na=="number"?Es(ts({},Kn[Ia.linkId]),{[Na]:Tr}):Tr}))})},er=(qi,to,Xi,_o,Na)=>{var Ia;const Tr=B1(to,Xi,_o,Na),Kn=(Ia=findResponseItem(Tr,to))==null?void 0:Ia.answer,Hr=getValidationError(qi,wi.current,Kn);K0(el=>Es(ts({},el),{[to]:typeof Na=="number"?Es(ts({},el[to]),{[Na]:Hr}):Hr}))},Rr=(qi,to)=>{const Xi=validateCurrentPage(to,$t,A0,U0,Y0);if(nr(Xi),U0?.item){const _o=validateAllItemsRecursively(U0.item,to);if(Object.keys(_o).length>0)K0(Na=>ts(ts({},Na),_o));else{const Na=U0.item,Ia={},Tr=Kn=>{Kn.forEach(Hr=>{Ia[Hr.linkId]={},Hr.item&&Tr(Hr.item)})};Tr(Na),K0(Kn=>ts(ts({},Kn),Ia))}}},lr=(qi,to,Xi,_o,Na=!1)=>{var Ia;const{linkId:Tr}=qi;if(Na)return wi.current=Xi||[],Rr(Tr,Xi||[]),wi.current;if(Xi&&Xi.length>0&&qi.type==="group"&&qi.repeats){let R1=wi.current.length;for(let Kl=wi.current.length-1;Kl>=0;Kl--)if(wi.current[Kl].linkId===Tr){R1=Kl+1;break}const pl=[...wi.current.slice(0,R1),...Xi,...wi.current.slice(R1)];return wi.current=pl,Rr(Tr,pl),wi.current}if(typeof _o=="number"&&to){const R1=hasRepeatingParent(qi,U0?.item||[]);if(R1){const pl=wi.current.filter(Ml=>Ml.linkId===R1.linkId);if(_o<pl.length){const Ml=wi.current.map(Jl=>{if(Jl.linkId===R1.linkId&&wi.current.slice(0,wi.current.indexOf(Jl)).filter(Oi=>Oi.linkId===R1.linkId).length===_o){const Oi=(Po,Za)=>{const Ba=new Map(Po.map(P1=>[P1.linkId,P1])),h1=[];return Za?.forEach(P1=>{const hl=Ba.get(P1.linkId);if(P1.linkId===Tr)h1.push(ts({linkId:P1.linkId,text:P1.text,answer:to},hl?.item&&{item:hl.item}));else if(hl)if(P1.item&&P1.item.length>0){const u1=Oi(hl.item||[],P1.item);h1.push(Es(ts({},hl),{item:u1}))}else h1.push(hl);else if(P1.item&&P1.item.length>0){const u1=Oi([],P1.item);u1.some(m1=>m1.linkId===Tr||m1.item&&$n(m1.item,Tr))&&h1.push({linkId:P1.linkId,text:P1.text,answer:[{}],item:u1})}Ba.delete(P1.linkId)}),Ba.forEach(P1=>{h1.push(P1)}),h1},$n=(Po,Za)=>Po.some(Ba=>Ba.linkId===Za||Ba.item&&$n(Ba.item,Za)),To=Oi(Jl.item||[],R1.item);return Es(ts({},Jl),{item:To})}return Jl});wi.current=Ml,Le(Ml)}else{const Ml=_o+1,Jl=pl.length;if(Jl<Ml||Ml===1){const Su=[],Oi=(Po,Za,Ba)=>Po.map(h1=>{const P1={linkId:h1.linkId,text:h1.text,answer:h1.linkId===Za?Ba:[{}]};return h1.item&&h1.item.length>0&&(P1.item=Oi(h1.item,Za,Ba)),P1});for(let Po=Jl;Po<Ml;Po++){const Za=R1.item?Oi(R1.item,Tr,to):[],Ba={linkId:R1.linkId,text:R1.text,answer:[{}],item:Za};Su.push(Ba)}let $n=wi.current.length;for(let Po=wi.current.length-1;Po>=0;Po--)if(wi.current[Po].linkId===R1.linkId){$n=Po+1;break}const To=[...wi.current.slice(0,$n),...Su,...wi.current.slice($n)];wi.current=To,Le(To)}}const Kl=getValidationError(qi,wi.current,to);return K0(Ml=>Es(ts({},Ml),{[Tr]:typeof _o=="number"?Es(ts({},Ml[Tr]),{[_o]:Kl}):Kl})),Rr(Tr,wi.current),wi.current}}if(typeof _o=="number")return Xi&&Xi.length>0?Or(qi,Tr,to,Xi,_o):er(qi,Tr,to,Xi,_o),wi.current;const Kn=B1(Tr,to,Xi),Hr=(Ia=findResponseItem(Kn,Tr))==null?void 0:Ia.answer,el=getValidationError(qi,Kn,Hr);return K0(R1=>Es(ts({},R1),{[Tr]:typeof _o=="number"?Es(ts({},R1[Tr]),{[_o]:el}):el})),Rr(Tr,Kn),wi.current},_r=()=>{var qi;for(let to=A0+1;to<Y0.current.length;to++){const Xi=Y0.current[to],_o=(qi=U0?.item)==null?void 0:qi[Xi];if(!!_o&&(!_o.enableWhen||isQuestionEnabled(_o.enableWhen,_o.enableBehavior,wi.current)))return!0}return!1},B0=()=>{var qi,to,Xi,_o,Na;const Ia=(qi=r0?.item)==null?void 0:qi[Y0.current[A0]];if(Ia){const Hr=(to=getAnalyticsEventName(Ia))!=null?to:"questionnaire_form",el=getAnalyticsPageName(Ia);if(el){const R1=(Xi=getAnalyticsFormName(r0))!=null?Xi:r0.name,pl=collectAnalyticsProperties(Ia,wi.current),Kl={};R1&&(Kl.form_name=R1),Kl.page_name=el,Object.assign(Kl,pl),ut(Hr,Kl)}}const Tr=A0<Y0.current.length-1,Kn=checkCurrentStepDataMatch(wi.current,U0,Y0.current,A0,Fr,Y0.current.length-1);if(ko&&Tr){const Hr=A0+1,el=Y0.current[Hr],R1=(_o=U0?.item)==null?void 0:_o[el],pl=!R1?.enableWhen||isQuestionEnabled(R1.enableWhen,R1.enableBehavior,wi.current),Kl=R1?isPageExtensionPresent(R1):!1;if(pl&&Kl&&Kn){Un(Hr),nr(!1),window.scrollTo(0,0);return}}if(Kn&&Y0.current.length>0){_r()?Un(A0+1):(go(removeDisabledItems(wi.current,U0?.item||[])),nr(!1),window.scrollTo(0,0));return}if(A0<Y0.current.length-1){const Hr=(Na=U0?.item)==null?void 0:Na[Y0.current[A0]];if(!Hr){go(removeDisabledItems(wi.current,U0?.item||[]));return}const el=Hr.linkId,R1=findLastGroupInstanceIndex(wi.current,el),pl=wi.current.slice(0,R1+1);if(!validateCurrentPage(pl,$t,A0,U0,Y0))return;ko?(wi.current=pl,Le(pl),go(wi.current),nr(!1)):Y0.current.length>0&&(_r()?Un(A0+1):(go(removeDisabledItems(wi.current,U0?.item||[])),window.scrollTo(0,0)))}else go(removeDisabledItems(wi.current,U0?.item||[])),nr(!1),window.scrollTo(0,0)};useEffect(()=>{var qi;tn(()=>B0),In(()=>Ao),nr(t0);const to=(qi=U0?.item)==null?void 0:qi[Y0.current[A0]];to&&gn(to.linkId)},[t0,A0]),useEffect(()=>{if(!r0?.item)return;const{groupIndices:qi,itemsToRenderMap:to}=collectGroupItemIndices(r0.item);Y0.current=qi,Ii.current=to;const Xi=Zo??qi.length;cn(Xi),c0(qi),ko?(Aa.current||Un(qi.length>0?qi.length-1:0),Ir(!1),Aa.current=!1):A0===-1&&Un(0)},[r0?.item,Zo]),useEffect(()=>{if(A0<0||!U0?.item)return;const qi=validateCurrentPage(wi.current,$t,A0,U0,Y0);if(!qi){nr(!1);return}const{shouldTriggerInlineLoading:to,canNavigateToNextGroup:Xi,hasMoreGroups:_o}=bs();if(ko&&to){if(!_o){nr(!1);return}if(Xi&&qi){nr(!0);return}else{nr(!1);return}}nr(qi)},[A0,U0?.item,C0,ko,wi.current,$t]),useEffect(()=>{if(!r0?.item||Eo.current)return;const qi=initializeQuestionnaireItems(r0.item,wi.current,r0.item,wi.current);if(qi!==wi.current){wi.current=qi;const Xi=(Na=>{const Ia=new Set,Tr=Kn=>{Kn.forEach(Hr=>{var el;const R1=Hr.initial&&Hr.initial.length>0,pl=(Hr.type==="choice"||Hr.type==="open-choice")&&((el=Hr.answerOption)==null?void 0:el.some(Kl=>Kl.initialSelected===!0));(R1||pl)&&(!Hr.enableWhen||isQuestionEnabled(Hr.enableWhen,Hr.enableBehavior,wi.current))&&Ia.add(Hr.linkId),Hr.item&&Tr(Hr.item)})};return Tr(Na),Ia})(U0?.item||[]);kn(Xi);const _o=validateAllItemsRecursively(U0?.item||[],wi.current);Object.keys(_o).length>0&&K0(Na=>ts(ts({},Na),_o))}Eo.current=!0},[U0?.item,r0]),useEffect(()=>{Bo(r0)},[r0]),useEffect(()=>{A0>=0&&window.scrollTo(0,0)},[A0]),useEffect(()=>{var qi;if(!ko||$t.length===0||Vr||!U0?.item)return;const to=Y0.current[A0];if(to===void 0)return;const Xi=Ii.current.get(to)||[to],_o=[];if(Xi.forEach(Hr=>{var el;const R1=(el=U0?.item)==null?void 0:el[Hr];R1&&hasInitialValue(R1)&&_o.push(R1)}),_o.length===0||!_o.some(Hr=>l1(Hr,wi.current)&&!qo.current.includes(Hr.linkId)?(qo.current.push(Hr.linkId),!0):!1))return;const Ia=validateCurrentPage(wi.current,$t,A0,U0,Y0),Tr=(qi=U0?.item)==null?void 0:qi[to],Kn=isHiddenAnswerInValid(Tr,wi.current);!Ia||Kn||(G0.current.add(A0),Ir(!0),Aa.current=!0,Q0(_o[_o.length-1].linkId))},[A0,$t,ko,Vr,U0]);const Q0=(qi,to=!1,Xi=!1)=>{var _o;if(to){go(removeDisabledItems(wi.current,U0?.item||[]),Xi),nr(!1);return}const Na=findQuestionByLinkId(U0?.item||[],qi);if(!Na)return;const Ia=(_o=findResponseItem(wi.current,qi))==null?void 0:_o.answer;if(getValidationError(Na,wi.current,Ia))return;const Tr=getUpdatedFormData(U0?.item||[],wi.current,qi,Ia),Kn=l1(Na,Tr);if(!Kn)return;nr(!1);const Hr=findRootGroupLinkId(U0?.item||[],qi);let el=Tr,R1=[];const pl=deepTrimFormData(Tr,Kn,U0?.item||[]);el=pl.trimmedData,R1=pl.trimmedLinkIds;const Kl=findQuestionByLinkId(U0?.item||[],Hr||"");wi.current=el;const Ml=findGroupPositionByLinkId(U0?.item||[],qi||""),Jl=Ml!==-1?Ml:A0;if(validateCurrentPage(el,$t,Jl,U0,Y0,R1)&&!isHiddenAnswerInValid(Kl,el)){Ir(!0),Aa.current=!0;let Oi;const $n=(()=>{var Za;const Ba=a1=>a1.flatMap(m1=>[m1,...m1.item?Ba(m1.item):[]]),h1=Ba((Za=U0?.item)!=null?Za:[]),P1=h1.findIndex(a1=>a1.linkId===Kn),hl=new Set;let u1=!0;for(;u1;){u1=!1;for(const a1 of h1){if(hl.has(a1.linkId)||!a1.enableWhen)continue;a1.enableWhen.some(Q1=>{const Vl=h1.findIndex(zl=>zl.linkId===Q1.question);return Vl!==-1&&Vl<=P1||hl.has(Q1.question)})&&(hl.add(a1.linkId),u1=!0)}}return R1.filter(a1=>!hl.has(a1))})();$n.length>0&&(Oi=removeItemsFromSchema(U0?.item||[],$n),Bo(Es(ts({},U0),{item:Oi})));const Po=((Za,Ba)=>{const h1=[];let P1=!1;const hl=u1=>{for(const a1 of u1)P1?(h1.push(a1.linkId),a1.item&&hl(a1.item)):a1.linkId===Ba?P1=!0:a1.item&&hl(a1.item)};return hl(Za),h1})(U0?.item||[],Kn);Po.length>0&&(qo.current=qo.current.filter(Za=>!Po.includes(Za)),kn(Za=>{const Ba=new Set(Za);return Po.forEach(h1=>Ba.delete(h1)),Ba})),qo.current.push(Kn),go(removeDisabledItems(el,U0?.item||[]),!0,Oi)}},Wt=(qi,to,Xi=!1)=>{const _o=updateItemWithReadOnlyExpression(qi,U0),Na={item:_o,selectedAnswer:to,handleInputChange:lr,showQuestionPrefix:Co,onCompleteHandler:Q0,errors:Ti,isLoading:Vr,isCurrentFormValid:t0,contained:U0?.contained,questionnaireSchemaItems:U0?.item,customErrorConfigurations:mo,formData:wi.current,showStepper:Ro,totalStepsFromExtension:Zo,externalComponentRenderMap:Ce,hintText:getHintTextFromExtensions(_o.extension)};if(typeof Qn=="function"&&Xi)Qn(qi,Na,wi.current);else if(qi.type in typeToRenderFunctionMap&&!Xi)return $t.includes(qi.linkId)||Mn(Ia=>[...Ia,qi.linkId]),jsx(RenderFHIRQuestionnaireItem,ts({},Na),qi.linkId);return null},ao=qi=>qi.map(to=>{var Xi,_o;const Na=isHiddenExtensionPresent(to);let Ia=(Xi=findResponseItem(wi.current,to.linkId))==null?void 0:Xi.answer;if((!Ia||Object.keys((_o=Ia?.[0])!=null?_o:{}).length===0)&&!qn.has(to.linkId)){if(to.initial&&to.initial.length>0)Ia=to.initial,kn(Tr=>new Set(Tr).add(to.linkId));else if((to.type==="choice"||to.type==="open-choice")&&to.answerOption){const Tr=to.answerOption.filter(Kn=>Kn.initialSelected===!0);Tr.length>0&&(Ia=Tr.map(Kn=>{let Hr={};return Kn.valueCoding?Hr={valueCoding:{code:Kn.valueCoding.code,display:Kn.valueCoding.display,system:Kn.valueCoding.system}}:Kn.valueReference&&(Hr={valueReference:{reference:Kn.valueReference.reference,display:Kn.valueReference.display}}),Hr}).filter(Kn=>Object.keys(Kn).length>0),kn(Kn=>new Set(Kn).add(to.linkId)))}Ia&&(wi.current=getUpdatedFormData(U0?.item||[],wi.current,to.linkId,Ia))}if(!to?.enableWhen||isQuestionEnabled(to?.enableWhen,to.enableBehavior,wi.current)){const Tr=Ja.includes(to.linkId)||getUIToolkitCode(to.extension||[])===UI_TOOLKIT_FORM_CONTAINER;return jsxs(React.Fragment,{children:[Wt(to,Ia,Na),to.item&&!Na&&(Tr?jsx(FormContainer,{children:jsx("div",{className:"gap-3xl flex flex-col",children:ao(to.item)})}):ao(to.item))]},to.linkId)}else if(to.type==="group"&&!Na)return si.includes(to.linkId)||(Zo===void 0&&cn(Y0.current.length-1||-1),Y0.current=Y0.current.filter((Tr,Kn)=>Kn!==A0),z0(Tr=>[...Tr,to.linkId])),null});if(A0>=0){const qi=[];let to=0,Xi=0;for(;to<Ur.length&&Xi<Y0.current.length;){const _o=Ur[to],Na=Y0.current[Xi];if(_o<Na){const Ia=(pt=U0?.item)==null?void 0:pt[_o];(!Ia?.enableWhen||isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,wi.current))&&qi.push(to),to++}else _o===Na&&to++,Xi++}for(;to<Ur.length;){const _o=Ur[to],Na=(qt=U0?.item)==null?void 0:qt[_o];(!Na?.enableWhen||isQuestionEnabled(Na.enableWhen,Na.enableBehavior,wi.current))&&qi.push(to),to++}if(qi.length>0){Zo===void 0&&cn(Y0.current.length+qi.length),qi.reverse().forEach(Na=>{const Ia=Ur[Na];let Tr=0;for(let Kn=0;Kn<Y0.current.length;Kn++){if(Y0.current[Kn]>Ia){Tr=Kn;break}Tr=Kn+1}Y0.current.splice(Tr,0,Ia)});const _o=qi.map(Na=>{var Ia;const Tr=Ur[Na],Kn=(Ia=U0?.item)==null?void 0:Ia[Tr];return Kn?.linkId}).filter(Boolean);z0(Na=>Na.filter(Ia=>!_o.includes(Ia)))}Ur.forEach(_o=>{var Na;const Ia=(Na=U0?.item)==null?void 0:Na[_o];Ia?.enableWhen&&!isQuestionEnabled(Ia.enableWhen,Ia.enableBehavior,wi.current)&&wi.current.some(Kn=>Kn.linkId===Ia.linkId)&&(wi.current=removeAnswerFromFormData(wi.current,Ia.linkId))})}const Ao=()=>{var qi;if(Ui&&!M0&&A0>0&&Do!=="completed")Un(Y0.current.length-1),bi(!0),ur(!1),br?.();else if(A0>0&&Do!=="completed"){let to=A0-1;for(;to>0;){const Xi=Y0.current[to],_o=(qi=U0?.item)==null?void 0:qi[Xi];if(!_o?.enableWhen||isQuestionEnabled(_o.enableWhen,_o.enableBehavior,wi.current))break;to--}Un(to),nr(!0),ur(!1),br?.()}else zr?.()},Sa=qi=>qi.preventDefault();return useEffect(()=>{const qi=setTimeout(()=>{Fs(!0)},0);return()=>clearTimeout(qi)},[]),Ds?jsxs(Fragment,{children:[jsxs("form",{id:fr,className:"w-full","data-testid":"questionnaire-form",onSubmit:Sa,children:[!bo&&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:()=>Ao(),onKeyDown:qi=>{(qi.key==="Enter"||qi.key===" ")&&Ao()},children:[jsx(ArrowLeft,{}),jsx("span",{className:"group-hover:underline",children:"Back"})]}),Ui&&!M0?jsx(EmptyState,{className:"mt-5xl",title:Ui.title,description:Ui.description,featuredIconProps:{icon:Ui.icon,color:"gray"},primaryButton:Ui.primaryButton,secondaryButton:Ui.secondaryButton?Es(ts({},Ui.secondaryButton),{onClick:Ao}):void 0}):jsxs(Fragment,{children:[!U0?.item&&Vr&&jsx(LoadingIndicator,{size:"md",label:"",testId:"questionnaire-loading-indicator"}),U0?.item&&jsx("div",{className:"gap-3xl flex flex-col",children:ao(A0>=0?U0.item.filter((qi,to)=>{const Xi=Y0.current[A0];return(Ii.current.get(Xi)||[Xi]).includes(to)}):U0?.item||[])})]})]}),Eo.current&&Fe]}):jsx(LoadingIndicator,{})}},78912:()=>{},7630:(Z,l,e)=>{"use strict";e.d(l,{l:()=>p});var n=e(31085),t=e(14041),r=e(36087),s=e(76260),i=e(25624),o=e(18522),a=Object.defineProperty,g=Object.defineProperties,c=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,m=(h,f,b)=>f in h?a(h,f,{enumerable:!0,configurable:!0,writable:!0,value:b}):h[f]=b,d=(h,f)=>{for(var b in f||(f={}))y.call(f,b)&&m(h,b,f[b]);if(u)for(var b of u(f))A.call(f,b)&&m(h,b,f[b]);return h},O=(h,f)=>g(h,c(f));const v=({selected:h,onClick:f,icon:b,title:M,description:x,readOnly:z})=>{const T=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:(0,r.cx)("mr-4 flex h-[64px] w-[64px] items-center justify-center rounded-md",h?"bg-utility-accent-500/20":"bg-gray-100",h?"text-accent-800":"text-quaternary"),children:b}),(0,n.jsxs)("div",{className:"flex flex-1 flex-col",children:[(0,n.jsx)("div",{className:"font-body flex w-full flex-row items-start justify-between",children:(0,n.jsx)("div",{className:"text-md text-secondary font-semibold",children:M})}),(0,n.jsx)("div",{className:"text-sm font-normal text-gray-600",children:x})]})]}),S=(0,r.cx)("p-lg flex w-full items-start rounded-xl border-2 text-left shadow-none transition-colors",z?"cursor-not-allowed":"cursor-pointer",z?"border-gray-200 bg-white":h?"border-blue-700 bg-white":"border-gray-100 bg-white",!z&&!h&&"hover:border-gray-400");return z?(0,n.jsx)("div",{className:S,children:T}):(0,n.jsx)("button",{type:"button",onClick:f,className:S,"aria-pressed":!!h,children:T})},p=({item:h,handleInputChange:f,formData:b,isLoading:M})=>{const{incrementCustomErrorCount:x,decrementCustomErrorCount:z}=(0,o.c)(),T=(0,t.useMemo)(()=>{var N;return(N=h.item)!=null?N:[]},[h.item]),S=h.readOnly===!0,E=(0,t.useMemo)(()=>T.filter(N=>!N.enableWhen||(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),C=(0,t.useMemo)(()=>T.filter(N=>N.enableWhen&&!(0,i.GN)(N.enableWhen,N.enableBehavior,b??[])),[T,b]),R=N=>{var w,V;if(!b)return!1;const q=(0,i.MU)(b,N);return((V=(w=q?.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)===!0},L=(0,t.useMemo)(()=>E.some(N=>R(N.linkId)),[E,b]),P=(0,t.useRef)(!1);(0,t.useEffect)(()=>{if(S||E.length===0){P.current&&(z(),P.current=!1);return}!L&&!P.current?(x(),P.current=!0):L&&P.current&&(z(),P.current=!1)},[L,S,E.length,x,z]),(0,t.useEffect)(()=>{C.forEach(N=>{var w,V;const q=b?(0,i.MU)(b,N.linkId):void 0;(!q||((V=(w=q.answer)==null?void 0:w[0])==null?void 0:V.valueBoolean)!==!1)&&f(N,[{valueBoolean:!1}])})},[C]),(0,t.useEffect)(()=>()=>{P.current&&z()},[]);const D=N=>{const w=R(N.linkId);f(N,[{valueBoolean:!w}])};return(0,n.jsx)("div",O(d({className:"flex flex-col gap-3"},M?{inert:""}:{}),{children:E.map(N=>{var w,V,q,I;const k=R(N.linkId),U=(w=N.extension)==null?void 0:w.find(se=>se.url===s.g4),F=(V=N.extension)==null?void 0:V.find(se=>se.url===s.rz),K=U?.valueString?s.JP[U.valueString]:void 0,G=(q=F?.valueString)!=null?q:"";return(0,n.jsx)(v,{icon:K?(0,n.jsx)(K,{className:"h-6 w-6"}):void 0,title:(I=N.text)!=null?I:"",description:G,selected:k,readOnly:S,onClick:S?void 0:()=>D(N)},N.linkId)})}))}},72866:(Z,l,e)=>{"use strict";e.d(l,{v:()=>o});var n=e(31085),t=e(94627),r=e(36087),s=e(25624);const i=({selected:a,onClick:g,label:c,readOnly:u})=>{const y=(0,r.cx)("rounded-sm border-2 px-3 py-2 text-sm font-medium transition-colors",u?"cursor-default":"cursor-pointer",a?"border-brand bg-brand-50 text-primary":"border-secondary bg-primary text-secondary",!u&&!a&&"hover:border-tertiary");return u?(0,n.jsx)("div",{className:y,children:c}):(0,n.jsx)("button",{type:"button",onClick:g,className:y,"aria-pressed":!!a,children:c})},o=({item:a,handleInputChange:g,formData:c})=>{var u;const y=(u=a.item)!=null?u:[],A=a.readOnly===!0,m=O=>{var v,p;if(!c)return!1;const h=(0,s.MU)(c,O);return((p=(v=h?.answer)==null?void 0:v[0])==null?void 0:p.valueBoolean)===!0},d=O=>{const v=m(O.linkId);g(O,[{valueBoolean:!v}])};return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[a.text&&(0,n.jsx)("p",{className:"text-secondary text-sm",dangerouslySetInnerHTML:{__html:(0,t.p)(a.text)}}),(0,n.jsx)("div",{className:"flex flex-wrap gap-3",children:y.map(O=>{var v;const p=m(O.linkId);return(0,n.jsx)(i,{label:(v=O.text)!=null?v:"",selected:p,readOnly:A,onClick:A?void 0:()=>d(O)},O.linkId)})})]})}},65735:(Z,l,e)=>{"use strict";e.d(l,{d:()=>s});var n=e(31085),t=e(36087),r=e(76260);const s=({item:i})=>{var o,a,g,c;const u=i.text||"",y=(a=(o=i.extension)==null?void 0:o.find(d=>d.url===r.rz))==null?void 0:a.valueString,A=(c=(g=i.extension)==null?void 0:g.find(d=>d.url===r.g4))==null?void 0:c.valueString,m=A?r.JP[A]:void 0;return(0,n.jsxs)("div",{className:"bg-primary flex items-start gap-4 rounded-lg px-4 py-6 shadow-sm","data-testid":i.linkId,children:[m&&(0,n.jsx)(t.FeaturedIcon,{icon:m,color:"brand",size:"lg",className:"text-accent-600 size-14"}),(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[(0,n.jsx)("p",{className:"text-primary text-lg font-semibold",children:u}),y&&(0,n.jsx)("p",{className:"text-secondary text-sm",children:y})]})]})}},18522:(Z,l,e)=>{"use strict";e.d(l,{c:()=>O});var n=e(31085),t=e(14041),r=e(8322),s=e(25624),i=Object.defineProperty,o=Object.defineProperties,a=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,c=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,y=(p,h,f)=>h in p?i(p,h,{enumerable:!0,configurable:!0,writable:!0,value:f}):p[h]=f,A=(p,h)=>{for(var f in h||(h={}))c.call(h,f)&&y(p,f,h[f]);if(g)for(var f of g(h))u.call(h,f)&&y(p,f,h[f]);return p},m=(p,h)=>o(p,a(h));const d=(0,t.createContext)(void 0),O=()=>{const p=(0,t.useContext)(d);if(!p)throw new Error("useFHIRQuestionnaire must be used within an FHIRQuestionnaireProvider");return p},v=({children:p,analyticsConfig:h})=>{const{trackEvent:f}=useAnalytics(),[b,M]=useState(null),[x,z]=useState(null),[T,S]=useState(!1),[E,C]=useState(null),[R,L]=useState(-1),[P,D]=useState(!1),[N,w]=useState(-1),[V,q]=useState(!1),[I,k]=useState(0),[U,F]=useState(!1),[K,G]=useState(!1),se=useRef([]),ie=()=>{k(ne=>ne+1)},te=useCallback(ne=>{F(ne)},[]),pe=()=>{k(ne=>Math.max(0,ne-1))},be=I>0,Se=useCallback((ne,ae,me)=>{if(!h)return;const he=h[ne];if(!he)return;let 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:E,currentGroupIndex:R,hideFooterButton:P,totalSteps:N,isLoading:V,isInlineNextQuestionTriggered:K,hasCustomError:be,analyticsConfig:h,hasExternalError:U,handleContinueButtonClick:b,handleBackButtonClick:x,setHandleContinueButtonClick:M,setHandleBackButtonClick:z,setIsCurrentFormValid:S,setCurrentGroupLinkId:C,setCurrentGroupIndex:L,setHideFooterButton:D,setTotalSteps:w,setIsLoading:q,setIsInlineNextQuestionTriggered:G,incrementCustomErrorCount:ie,decrementCustomErrorCount:pe,trackQuestionnaireEvent:Se,setHasExternalError:te,groupItemIndicesRef:se};return jsx(d.Provider,{value:ge,children:p})}},35473:(Z,l,e)=>{"use strict";var n=e(28058),t=e(18522),r=e(78912),s=e.n(r);e.o(r,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return r.BWELL_STORED_TOKENS_KEY}}),e.o(r,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return r.LocationPermissionEnum}}),e.o(r,"LocationType")&&e.d(l,{LocationType:function(){return r.LocationType}}),e.o(r,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return r.SchedulingLocationCard}}),e.o(r,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return r.formatPhoneNumber}}),e.o(r,"getInitials")&&e.d(l,{getInitials:function(){return r.getInitials}}),e.o(r,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return r.removeAfterLastComma}}),e.o(r,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return r.shouldForceLogoutAfterAuthFailure}}),e.o(r,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return r.unformatPhoneNumber}}),e.o(r,"useDebounce")&&e.d(l,{useDebounce:function(){return r.useDebounce}}),e.o(r,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return r.useDeviceDetection}}),e.o(r,"useRedirect")&&e.d(l,{useRedirect:function(){return r.useRedirect}}),e.o(r,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return r.useSearchQueryParams}});var i=e(25624),o=e(76260),a=e(7630),g=e(72866),c=e(65735)},61388:(Z,l,e)=>{"use strict";e.d(l,{n:()=>s});var n=e(31085),t=e(36087),r=e(33180);const s=({actionButtonText:i,onActionButtonClick:o,title:a,infoDetails:g})=>(0,n.jsxs)("div",{className:"bg-primary py-2xl px-lg rounded-2xl shadow-sm",children:[(0,n.jsxs)("div",{className:"gap-lg mb-2xl flex items-center justify-between",children:[(0,n.jsx)("p",{className:"text-primary text-md font-semibold",children:a}),i&&o&&(0,n.jsx)(t.Button,{color:"link-color",onClick:o,className:"text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary",children:i})]}),(0,n.jsx)(r.InfoCardDetails,{infoDetails:g})]})},79286:()=>{},97257:(Z,l,e)=>{"use strict";e.d(l,{d:()=>i});var n=e(31085),t=e(94043),r=e(76323),s=e(36087);const i=({infoDetails:o,className:a})=>{const{redirectToBook:g,redirectToMap:c,redirectToUrl:u}=(0,r.useRedirect)(),y=(d,O,v)=>{d.preventDefault(),O.linkType==="phone"?g(v):O.linkType==="address"?c({address:v}):O.linkType==="url"&&O.link?u(O.link):O.link&&window.open(O.link,"_blank","noopener,noreferrer")},A=(d,O)=>{switch(O){case"phone":return(0,r.formatPhoneNumber)(d);default:return d}},m=(d,O)=>O.linkType||O.link?(0,n.jsx)(s.Button,{color:"link-color",onClick:v=>y(v,O,d),className:"text-md text-link-primary hover:text-link-primary focus:text-link-primary focus-visible:text-link-primary text-left font-normal! wrap-anywhere underline underline-offset-2",children:A(d,O.displayType)}):(0,n.jsx)("p",{className:"text-primary text-md m-0 wrap-anywhere",children:A(d,O.displayType)});return(0,n.jsx)("div",{className:(0,t.cx)("gap-2xl flex flex-col",a),children:o.map((d,O)=>{const v=d.Icon;return(0,n.jsxs)("div",{className:"gap-md flex items-start",children:[(0,n.jsx)(s.FeaturedIcon,{icon:(0,n.jsx)(v,{className:"text-fg-secondary"}),size:"lg",color:"gray"}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-tertiary m-0 mb-1 text-sm",children:d.label}),(()=>{const p=Array.isArray(d.value)?d.value:[d.value];return p.length>1?(0,n.jsx)("ul",{className:"m-0 list-disc pl-5",children:p.map((h,f)=>(0,n.jsx)("li",{className:"text-primary text-md font-medium",children:m(h,d)},f))}):m(p[0],d)})()]})]},O)})})}},71428:()=>{},3203:(Z,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.d});var n=e(97257),t=e(71428),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},33180:(Z,l,e)=>{"use strict";e.d(l,{InfoCardDetails:()=>n.InfoCardDetails});var n=e(3203);e.o(n,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return n.BWELL_STORED_TOKENS_KEY}}),e.o(n,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return n.LocationPermissionEnum}}),e.o(n,"LocationType")&&e.d(l,{LocationType:function(){return n.LocationType}}),e.o(n,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return n.SchedulingLocationCard}}),e.o(n,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return n.formatPhoneNumber}}),e.o(n,"getInitials")&&e.d(l,{getInitials:function(){return n.getInitials}}),e.o(n,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return n.removeAfterLastComma}}),e.o(n,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return n.shouldForceLogoutAfterAuthFailure}}),e.o(n,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return n.unformatPhoneNumber}}),e.o(n,"useDebounce")&&e.d(l,{useDebounce:function(){return n.useDebounce}}),e.o(n,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return n.useDeviceDetection}}),e.o(n,"useRedirect")&&e.d(l,{useRedirect:function(){return n.useRedirect}}),e.o(n,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return n.useSearchQueryParams}})},27163:(Z,l,e)=>{"use strict";e.d(l,{InfoCard:()=>n.n});var n=e(61388),t=e(79286),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(33180);e.o(s,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return s.BWELL_STORED_TOKENS_KEY}}),e.o(s,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return s.LocationPermissionEnum}}),e.o(s,"LocationType")&&e.d(l,{LocationType:function(){return s.LocationType}}),e.o(s,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return s.SchedulingLocationCard}}),e.o(s,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return s.formatPhoneNumber}}),e.o(s,"getInitials")&&e.d(l,{getInitials:function(){return s.getInitials}}),e.o(s,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return s.removeAfterLastComma}}),e.o(s,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return s.shouldForceLogoutAfterAuthFailure}}),e.o(s,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return s.unformatPhoneNumber}}),e.o(s,"useDebounce")&&e.d(l,{useDebounce:function(){return s.useDebounce}}),e.o(s,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return s.useDeviceDetection}}),e.o(s,"useRedirect")&&e.d(l,{useRedirect:function(){return s.useRedirect}}),e.o(s,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return s.useSearchQueryParams}})},98549:(Z,l,e)=>{"use strict";var n=e(31085);const t=({currentStep:r,totalSteps:s})=>jsx(Stack,{"data-testid":"stepper",width:"100%",children:jsx(LinearProgress,{"aria-label":`Progress bar showing step ${r} of ${s}`,sx:{height:"2px",backgroundColor:"rgba(0,0,0,0.1)","& .MuiLinearProgress-bar":{backgroundColor:"accessibility.info",borderRadius:2}},value:r/s*100,variant:"determinate"})})},26877:(Z,l,e)=>{"use strict";e.d(l,{J:()=>M});var n=e(31085),t=e(14041);const r=({size:x=24,color:z="currentColor",...T})=>t.createElement("svg",{viewBox:"0 0 24 24",width:x,height:x,stroke:z,strokeWidth:"2",fill:"none",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...T},t.createElement("path",{d:"M3.413 10.745c-.595-.232-.893-.348-.98-.515a.5.5 0 0 1 0-.461c.087-.167.385-.283.98-.515L20.3 2.664c.537-.21.806-.315.978-.258a.5.5 0 0 1 .316.316c.057.172-.048.44-.258.977l-6.59 16.888c-.232.595-.348.893-.515.98a.5.5 0 0 1-.462 0c-.167-.088-.282-.385-.514-.98l-2.628-6.759a1.075 1.075 0 0 0-.107-.232.5.5 0 0 0-.116-.117 1.069 1.069 0 0 0-.232-.106l-6.759-2.628Z"}));r.displayName="NavigationPointer01";var s=e(8322),i=e(76808),o=e(92094),a=e(5380),g=e(54783),c=e(53151),u=e(85449),y=Object.defineProperty,A=Object.defineProperties,m=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable,p=(x,z,T)=>z in x?y(x,z,{enumerable:!0,configurable:!0,writable:!0,value:T}):x[z]=T,h=(x,z)=>{for(var T in z||(z={}))O.call(z,T)&&p(x,T,z[T]);if(d)for(var T of d(z))v.call(z,T)&&p(x,T,z[T]);return x},f=(x,z)=>A(x,m(z)),b=(x,z,T)=>new Promise((S,E)=>{var C=P=>{try{L(T.next(P))}catch(D){E(D)}},R=P=>{try{L(T.throw(P))}catch(D){E(D)}},L=P=>P.done?S(P.value):Promise.resolve(P.value).then(C,R);L((T=T.apply(x,z)).next())});const M=({setLocationUpdating:x,title:z,description:T,isOpen:S,onClose:E})=>{const{locationPermission:C,position:R,requestPosition:L,setLocationPermission:P}=(0,u.GU)(),{trackEvent:D}=(0,s.st)(),{queryParams:N,setQueryParams:w}=(0,g.i)(),[V,q]=(0,t.useState)(!1),I=(0,c.s)(a.so.LAST_LOCATION_PROMPT),k=S!==void 0?S:V;(0,t.useEffect)(()=>{(k||S)&&D("location_permissions_modal_loaded",{_event_metadata:{description:"A user was presented with the location permissions modal."}})},[S,k,D]);const U=(0,t.useCallback)(be=>{w(f(h({},N),{location:be,locationType:a.iF.CURRENT_LOCATION,locationPermission:C||""}))},[C,N,w]),F=(0,t.useCallback)(()=>{S===void 0&&(!C||[a.Ef.GRANTED].includes(C)&&I.get()||[a.Ef.PROMPT].includes(C)&&I.get()&&R||q([a.Ef.PROMPT,a.Ef.GRANTED].includes(C)))},[S,C,I,R]);(0,t.useEffect)(()=>{F()},[F]);const K=(0,i.Ul)(),G=(0,t.useCallback)(()=>b(void 0,null,function*(){x&&x(!0);let be;try{be=yield L(),be&&U&&U(`${be.coords.latitude},${be.coords.longitude}`)}catch(Se){Se instanceof Error?K?.error(Se,"Error requesting location"):K?.error(`Error requesting location - ${JSON.stringify(Se)}`),S!==void 0&&E?E():q(!1)}return x&&x(!1),!!be}),[K,U,L,x,S,E]),se=(0,t.useCallback)(()=>b(void 0,null,function*(){D("location_permissions_cta_clicked",{click:"Use my current location",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),S!==void 0&&E?E():q(!1),I.set(new Date().toISOString()),yield G()}),[D,S,E,I,G]),ie=(0,t.useCallback)(be=>{D("location_permissions_cta_clicked",{click:be==="close"?"X":"Search another way",_event_metadata:{description:"A user clicked continue an option on the location permissions modal."}}),P(a.Ef.DENIED),w(f(h({},N),{locationPermission:a.Ef.DENIED})),I.remove(),S!==void 0&&E?E():q(!1)},[D,P,w,N,I,S,E]),te=(0,t.useCallback)(()=>ie("close"),[ie]),pe=(0,t.useCallback)(()=>ie("cancel"),[ie]);return(0,n.jsx)(o.Modal,{id:"location-modal",isOpen:k,className:"sm:max-w-md",title:{content:z,tag:"h1"},featuredIcon:{icon:r,color:"brand",size:"lg"},description:{content:T},closeButton:{onCloseClick:te},primaryButton:{children:"Use my current location",onClick:se},secondaryButton:{children:"Search another way",onClick:pe}})}},35471:(Z,l,e)=>{"use strict";var n=e(26877)},98741:(Z,l,e)=>{"use strict";var n=e(31085),t=e(14041),r=Object.defineProperty,s=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(y,A,m)=>A in y?r(y,A,{enumerable:!0,configurable:!0,writable:!0,value:m}):y[A]=m,g=(y,A)=>{for(var m in A||(A={}))i.call(A,m)&&a(y,m,A[m]);if(s)for(var m of s(A))o.call(A,m)&&a(y,m,A[m]);return y};const c=y=>{if(!y||typeof y!="object")throw new Error("Invalid animation data");const A=m=>{if(!m||typeof m!="object")return m;if(Array.isArray(m))return m.map(A);const d=g({},m);delete d.ef,delete d.expr,typeof d.x=="string"&&delete d.x;for(const O in d)typeof d[O]=="object"&&(d[O]=A(d[O]));return d};return A(y)},u=({animationData:y,loop:A=!0,autoplay:m=!0,className:d=""})=>{const O=useRef(null),v=useRef(null);return useEffect(()=>{if(!!O.current){try{const p=c(y);v.current=lottie.loadAnimation({container:O.current,renderer:"svg",loop:A,autoplay:m,animationData:p})}catch(p){console.error("Failed to load Lottie animation:",p)}return()=>{var p;(p=v.current)==null||p.destroy()}}},[y,A,m]),jsx("div",{ref:O,className:d})}},81304:(Z,l,e)=>{"use strict";e.d(l,{T:()=>u});var n=e(31085),t=e(14041),r=e(78628),s=e(66267);const i=y=>y*1609.34;var o=e(27419);const a={gray50:"#f9fafb",gray100:"#f3f4f6",blue100:"#dbeafe"};var g=e(92469);const c=({center:y,isLoading:A=!1,searchRadius:m,className:d,height:O="350px",width:v="100%",googleMapsApiKey:p})=>{const h=(0,s.Bd)(),{isLoaded:f}=(0,r.KD)({googleMapsApiKey:p||""}),b={height:typeof O=="number"?`${O}px`:O,width:typeof v=="number"?`${v}px`:v},M=(0,t.useCallback)(z=>{google.maps.event.addListenerOnce(z,"idle",()=>{if(m&&y.lat&&y.lng){const S=new google.maps.Circle({center:{lat:y.lat,lng:y.lng},radius:i(m)}).getBounds();S&&z.fitBounds(S,0)}})},[y,m]);if(!f||A)return(0,n.jsx)("div",{className:(0,o.cx)("flex animate-pulse items-center justify-center rounded-lg bg-gray-200",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("LOADING_MAP")})});if(!y.lat||!y.lng)return(0,n.jsx)("div",{className:(0,o.cx)("flex items-center justify-center rounded-lg border-2 border-dashed border-gray-300 bg-gray-100",d),style:b,children:(0,n.jsx)("div",{className:"text-sm text-gray-500",children:h("UNABLE_TO_LOAD_MAP_NO_LOCATION")})});const x={clickableIcons:!1,disableDefaultUI:!0,disableDoubleClickZoom:!0,styles:[{featureType:"poi",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"geometry",stylers:[{color:a.gray50}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:a.gray100}]},{featureType:"water",elementType:"geometry",stylers:[{color:a.blue100}]}]};return(0,n.jsx)("div",{className:(0,o.cx)("overflow-hidden rounded-lg",d),children:(0,n.jsx)(r.u6,{center:{lat:y.lat,lng:y.lng},mapContainerStyle:b,onLoad:M,options:x,zoom:12,children:(0,n.jsx)(g.I,{center:y})})})},u=(0,t.memo)(c)},82184:()=>{},53269:(Z,l,e)=>{"use strict";e.d(l,{Map:()=>n.T});var n=e(81304),t=e(82184),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}});var s=e(92469)},92469:(Z,l,e)=>{"use strict";e.d(l,{I:()=>r});var n=e(31085),t=e(78628);const r=({center:s})=>typeof s?.lat=="number"&&typeof s?.lng=="number"&&!isNaN(s.lat)&&!isNaN(s.lng)?(0,n.jsx)(t.pH,{clickable:!1,"data-testid":"marker-center",position:{lat:s.lat,lng:s.lng}}):null},43743:(Z,l,e)=>{"use strict";var n=e(31085),t=e(76323),r=e(36087);const s=({name:o,profileUrl:a,subTitle:g,variant:c="default",showChevron:u=!0,onClick:y,pendingText:A})=>{const m=!!A,d=!m&&!!y,O=u&&d;return jsxs("button",{type:"button",onClick:d?y:void 0,disabled:!d,className:cx("bg-primary border-primary flex w-full items-center justify-between gap-3 rounded-lg border p-4 text-left",c==="compact"&&"rounded-xl p-3",!O&&"justify-start",d?"cursor-pointer":"cursor-default",m&&"opacity-60"),children:[jsx(Avatar,{src:a,alt:o,size:"md",initials:getInitials(o),className:"[&>span]:text-secondary"}),jsxs("div",{className:"flex flex-col items-start",children:[jsx("span",{className:"text-sm font-semibold",children:o}),m?jsxs("span",{className:"text-secondary flex items-center gap-1.5 text-sm",children:[jsx(LoadingIndicator,{size:"xs"}),A]}):jsx("span",{className:"text-secondary text-sm",children:g})]}),O&&jsx(ChevronRight,{className:"text-quaternary ml-auto size-5"})]})},i=()=>jsx("div",{className:"bg-primary border-primary animate-pulse items-center justify-between rounded-lg border p-4",children:jsxs("div",{className:"flex items-center space-x-4",children:[jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300"}),jsxs("div",{className:"flex-1 space-y-2",children:[jsx("div",{className:"h-4 w-3/4 rounded bg-gray-300"}),jsx("div",{className:"h-3 w-1/2 rounded bg-gray-300"})]})]})})},4062:(Z,l,e)=>{"use strict";var n=e(31085);const t=({children:s,content:i,fullImageHeader:o=!1,header:a,title:g})=>jsx("div",{className:"tw-preflight gap-lg flex h-full w-full items-center justify-center",children:jsxs("div",{className:"max-w-16xl flex h-fit w-full flex-col items-center justify-center self-center overflow-hidden rounded-2xl",children:[o?a:jsx("div",{className:"bg-utility-accent-100 mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-lg",children:a}),jsxs("div",{className:"gap-lg p-sm md:pb-2xl h-fit w-full md:p-[55px]",children:[jsxs("div",{className:"text-center",children:[jsx("h1",{className:"font-display text-primary mb-md px-5 text-3xl leading-[38px] font-normal tracking-tight",children:g}),i&&jsx("h2",{className:"font-body text-secondary leading-xl text-sm font-normal",children:i})]}),s]})]})}),r=null},51254:(Z,l,e)=>{"use strict";var n=e(31085),t=e(36087);const r=({title:s,description:i,icon:o})=>{var a;return jsxs("div",{className:"tw-preflight py-md gap-md flex h-fit w-full flex-row items-start",children:[jsx(FeaturedIcon,{icon:o.icon,color:(a=o.color)!=null?a:"brand",size:"lg",className:o.iconClassName}),jsxs("div",{className:"flex flex-col",children:[jsx("p",{className:"font-body leading-xl text-secondary text-sm font-semibold",children:s}),i&&jsx("p",{className:"font-body leading-xl text-secondary text-sm font-normal",children:i})]})]})}},69092:()=>{},33457:(Z,l,e)=>{"use strict";var n=e(51254),t=e(69092),r=e.n(t);e.o(t,"BWELL_STORED_TOKENS_KEY")&&e.d(l,{BWELL_STORED_TOKENS_KEY:function(){return t.BWELL_STORED_TOKENS_KEY}}),e.o(t,"LocationPermissionEnum")&&e.d(l,{LocationPermissionEnum:function(){return t.LocationPermissionEnum}}),e.o(t,"LocationType")&&e.d(l,{LocationType:function(){return t.LocationType}}),e.o(t,"SchedulingLocationCard")&&e.d(l,{SchedulingLocationCard:function(){return t.SchedulingLocationCard}}),e.o(t,"formatPhoneNumber")&&e.d(l,{formatPhoneNumber:function(){return t.formatPhoneNumber}}),e.o(t,"getInitials")&&e.d(l,{getInitials:function(){return t.getInitials}}),e.o(t,"removeAfterLastComma")&&e.d(l,{removeAfterLastComma:function(){return t.removeAfterLastComma}}),e.o(t,"shouldForceLogoutAfterAuthFailure")&&e.d(l,{shouldForceLogoutAfterAuthFailure:function(){return t.shouldForceLogoutAfterAuthFailure}}),e.o(t,"unformatPhoneNumber")&&e.d(l,{unformatPhoneNumber:function(){return t.unformatPhoneNumber}}),e.o(t,"useDebounce")&&e.d(l,{useDebounce:function(){return t.useDebounce}}),e.o(t,"useDeviceDetection")&&e.d(l,{useDeviceDetection:function(){return t.useDeviceDetection}}),e.o(t,"useRedirect")&&e.d(l,{useRedirect:function(){return t.useRedirect}}),e.o(t,"useSearchQueryParams")&&e.d(l,{useSearchQueryParams:function(){return t.useSearchQueryParams}})},77057:(Z,l,e)=>{"use strict";e.d(l,{i:()=>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 i=e(14449),o=e(14711),a=e(58139),g=e(37121),c=e(43144);function u(Qe){Qe()}let y=null;const A=Qe=>y=Qe,m=()=>y,d=(0,r.createContext)(null),O=null;function v(){return(0,r.useContext)(d)}let h=()=>{throw new Error("uSES not initialized!")};const f=Qe=>{h=Qe},b=(Qe,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:Ut,getServerState:wn}=Pt(),yr=h(Ut.addNestedSub,Rt.getState,wn||Rt.getState,Sn,et);return(0,r.useDebugValue)(yr),yr}}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 E={notify(){},get:()=>[]};function C(Qe,Pt){let hn,Sn=E;function et(dr){return yr(),Sn.subscribe(dr)}function Rt(){Sn.notify()}function Ut(){Ln.onStateChange&&Ln.onStateChange()}function wn(){return Boolean(hn)}function yr(){hn||(hn=Pt?Pt.addNestedSub(Ut):Qe.subscribe(Ut),Sn=S())}function mn(){hn&&(hn(),hn=void 0,Sn.clear(),Sn=E)}const Ln={addNestedSub:et,notifyNestedSubs:Rt,handleChangeWrapper:Ut,isSubscribed:wn,trySubscribe:yr,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,Ut,wn,yr,mn,Ln){if(!Qe)return()=>{};let dr=!1,Wn=null;const Wr=()=>{if(dr||!wn.current)return;const It=Pt.getState();let $e,it;try{$e=Sn(It,et.current)}catch(Je){it=Je,Wn=Je}it||(Wn=null),$e===Rt.current?Ut.current||mn():(Rt.current=$e,yr.current=$e,Ut.current=!0,Ln())};return hn.onStateChange=Wr,hn.trySubscribe(),Wr(),()=>{if(dr=!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:Ut=shallowEqual,areMergedPropsEqual:wn=shallowEqual,forwardRef:yr=!1,context:mn=ReactReduxContext}={}){const Ln=mn,dr=mapStateToPropsFactory(Qe),Wn=mapDispatchToPropsFactory(Pt),Wr=mergePropsFactory(hn),Yr=Boolean(Qe);return $e=>{const it=$e.displayName||$e.name||"Component",Je=`Connect(${it})`,tt={shouldHandleStateChanges:Yr,displayName:Je,wrappedComponentName:it,WrappedComponent:$e,initMapStateToProps:dr,initMapDispatchToProps:Wn,initMergeProps:Wr,areStatesEqual:et,areStatePropsEqual:Ut,areOwnPropsEqual:Rt,areMergedPropsEqual:wn};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,sr=vn?zt.getServerState:zn.getState,Dt=useMemo(()=>defaultSelectorFactory(zn.dispatch,tt),[zn]),[we,Ze]=useMemo(()=>{if(!Yr)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),kt=useRef(!1),Lt=useRef();useIsomorphicLayoutEffect(()=>(kt.current=!0,()=>{kt.current=!1}),[]);const Ft=useMemo(()=>()=>fn.current&&Ue===nn.current?fn.current:Dt(zn.getState(),Ue),[zn,Ue]),Yt=useMemo(()=>Pn=>we?U(Yr,zn,we,Dt,nn,en,mt,kt,fn,Ze,Pn):()=>{},[we]);I(k,[nn,en,mt,Ue,fn,Ze]);let On;try{On=D(Yt,Ft,sr?()=>Dt(sr(),Ue):Ft)}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.1113.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.13.1"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1362.0",D="@icanbwell/composite. repo version: 0.1362.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
1
+ import{jsx as a}from"react/jsx-runtime";import{ComponentView as o}from"@icanbwell/native-components";var s="@icanbwell/composite",p="1.1114.0",c="icanbwell",v="module",l="index.js",m="types/index.d.ts",b="UNLICENSED",d={url:"https://github.com/icanbwell/ui-platform.git"},y={"*":{native:["types/native.d.ts"]}},u={lint:"eslint .","lint:eslint":"npm run lint"},w={"@icanbwell/native-components":"6.13.1"},f={react:"^17.0.0 || ^18.0.0","react-dom":"^17.0.0 || ^18.0.0","react-native":"^0.71.2","react-native-webview":"^11.4.2"},O={"react-native":{optional:!0},react:{optional:!0},"react-dom":{optional:!0},"react-native-webview":{optional:!0}},j="0.1363.0",D="@icanbwell/composite. repo version: 0.1363.0",V={name:s,version:p,author:c,type:v,main:l,types:m,license:b,repository:d,typesVersions:y,scripts:u,dependencies:w,peerDependencies:f,peerDependenciesMeta:O,repoVersion:j,description:D};const g="composite";var h=Object.defineProperty,P=Object.defineProperties,x=Object.getOwnPropertyDescriptors,n=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable,i=(r,e,t)=>e in r?h(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,M=(r,e)=>{for(var t in e||(e={}))C.call(e,t)&&i(r,t,e[t]);if(n)for(var t of n(e))E.call(e,t)&&i(r,t,e[t]);return r},N=(r,e)=>P(r,x(e));const I=r=>a(o,N(M({},r),{version:V.version,name:g}));export{I as Composite};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/composite",
3
- "version": "1.1113.0",
3
+ "version": "1.1114.0",
4
4
  "author": "icanbwell",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -43,6 +43,6 @@
43
43
  "optional": true
44
44
  }
45
45
  },
46
- "repoVersion": "0.1362.0",
47
- "description": "@icanbwell/composite. repo version: 0.1362.0"
46
+ "repoVersion": "0.1363.0",
47
+ "description": "@icanbwell/composite. repo version: 0.1363.0"
48
48
  }