@icanbwell/composite 1.674.3 → 1.675.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.
package/473.index.js CHANGED
@@ -5341,7 +5341,7 @@ Take a look at the reducer(s) handling this action type: `+We.type+`.
5341
5341
  questionnaireName
5342
5342
  }
5343
5343
  }
5344
- `));function hwe(e){const t=Object.assign(Object.assign({},el),e);return Apollo.useQuery(k$,t)}function Swe(e){const t=Object.assign(Object.assign({},el),e);return Apollo.useLazyQuery(k$,t)}const Ewe=e=>useMutation(CreateOauthThirdPartyConnection,e),vwe=e=>useMutation(DisconnectUserToken,e),mwe=e=>useMutation(CreateConnectionStatus,e),Twe=e=>useQuery(GetMemberConnections,e),Awe=e=>useQuery(GetConnections,e),gwe=e=>useQuery(GetConnection,e),ywe=e=>useLazyQuery(GetConnection,e),Rwe=e=>useQuery(GetOauthGeneratedUrl,e);var j$=h(46),Hp,Sm;class H${constructor(){this.type="backend",Hp.set(this,void 0),Sm.set(this,void 0)}init(t,{clientSlug:r,apiClient:n}){if(!n)throw t.logger.error('"apiClient" not supplied to "QueryBackend".'),new Error('"apiClient" required for "QueryBackend".');wu(this,Hp,r,"f"),wu(this,Sm,fU(n),"f")}read(t,r,n){return om(this,void 0,void 0,function*(){try{const{translation:i}=yield Jr(this,Sm,"f").getClientTranslations({name:Jr(this,Hp,"f"),key:r,lang:t});n(null,i?.json||{})}catch{const a=`Error fetching translation with key "${r}" and client "${Jr(this,Hp,"f")||"N/A"}".`;n(a,null)}})}}Hp=new WeakMap,Sm=new WeakMap,H$.type="backend";var Xf;class Y${constructor(t){this.type="logger",Xf.set(this,void 0),wu(this,Xf,t,"f")}log([t,r,...n]){Jr(this,Xf,"f").info({meta:r},t,...n)}warn([t,r,...n]){Jr(this,Xf,"f").error({meta:r},t,...n)}error([t,r,...n]){Jr(this,Xf,"f").error({meta:r},t,...n)}}Xf=new WeakMap,Y$.type="logger";var Em,vm,tl,Yp,Ii,rl;const q$="appLanguage";class Pa{constructor({keys:t,nativeBridge:r,fallbackKeys:n=[],defaultLanguage:i="en",logger:a,parent:u,debug:c=!1,remoteConfig:E={}}){tl.set(this,void 0),Yp.set(this,void 0),Ii.set(this,void 0),rl.set(this,void 0),wu(this,tl,t,"f"),wu(this,Yp,n,"f"),wu(this,rl,r,"f");const _={lng:i,fallbackNS:Jr(this,Yp,"f"),debug:c,defaultNS:t,returnNull:!1};u?wu(this,Ii,u.cloneInstance(_),"f"):(wu(this,Ii,ea.createInstance(),"f"),a&&Jr(this,Ii,"f").use(new Y$(a.child({library:"@icanbwell/i18n"}))),E.apiClient&&Jr(this,Ii,"f").use(H$),Jr(this,Ii,"f").init(Object.assign(Object.assign({},_),{fallbackLng:!1,partialBundledLanguages:!0,ns:[],resources:{},backend:E,saveMissing:!0,missingKeyHandler:(p,L,W)=>Jr(this,Ii,"f").services.logger.error(`missing key: ${W}; language: ${p}; key: ${L}`)}))),this.t=Jr(this,Ii,"f").t,Pa.resolvedLanguage=Jr(this,Ii,"f").resolvedLanguage||i}load(){var t;return om(this,void 0,void 0,function*(){const r=(yield(t=Jr(this,rl,"f"))===null||t===void 0?void 0:t.storage.getItem(q$))||Pa.resolvedLanguage;r!==Pa.resolvedLanguage&&(yield Jr(this,Ii,"f").changeLanguage(r),Pa.resolvedLanguage=r),yield Jr(this,Ii,"f").loadNamespaces(Jr(this,tl,"f"));const n=Jr(this,tl,"f").filter(i=>!Jr(this,Ii,"f").hasResourceBundle(r,i));if(n.length)throw new Error(`Error loading translations for key(s): ${n.join(", ")}`);return Jr(Pa,Em,"f",vm).emit("changeLanguage",r),this})}child(t){return new Pa(Object.assign(Object.assign({},t),{nativeBridge:Jr(this,rl,"f"),fallbackKeys:[...Jr(this,Yp,"f"),...Jr(this,tl,"f")],parent:Jr(this,Ii,"f"),defaultLanguage:Jr(this,Ii,"f").language}))}get isLoaded(){return Jr(this,tl,"f").every(t=>Jr(this,Ii,"f").hasResourceBundle(Jr(this,Ii,"f").language,t))}changeLanguage(t){var r;return om(this,void 0,void 0,function*(){Pa.resolvedLanguage=t,yield Jr(this,Ii,"f").changeLanguage(t),Jr(Pa,Em,"f",vm).emit("changeLanguage",t),yield(r=Jr(this,rl,"f"))===null||r===void 0?void 0:r.storage.setItem(q$,t),Jr(this,rl,"f").reloadView()})}get resolvedLanguage(){return Pa.resolvedLanguage}onChangeLanguage(t){Jr(Pa,Em,"f",vm).on("changeLanguage",t)}}Em=Pa,tl=new WeakMap,Yp=new WeakMap,Ii=new WeakMap,rl=new WeakMap,vm={value:new j$},Pa.resolvedLanguage="en";var NC=h(1827),qp;(function(e){e.one="1.0.0"})(qp||(qp={}));const mm="orchestrator:native-bridge",E9={id:mm,dependencies:{featureServices:{}},create:()=>({[qp.one]:()=>({featureService:NC.b})})};var Kp;(function(e){e.one="1.0.0"})(Kp||(Kp={}));const Tm="orchestrator:translation-service",v9={id:Tm,dependencies:{featureServices:{[za]:Nr.one,[ks]:Mu.one,[Wn]:vi.one,[Mp]:kf.one,[mm]:qp.one}},create:({featureServices:e})=>{const t=e[za],r=e[ks],n=e[Mp],{slug:i}=e[Wn].getClientContext(),a=e[mm],u=new Pa({keys:[],nativeBridge:a,defaultLanguage:"en",logger:r,remoteConfig:{clientSlug:i,apiClient:t}});return n.setProfileProperties({language:u.resolvedLanguage}),u.onChangeLanguage(c=>n.setProfileProperties({language:c})),{[Kp.one]:()=>({featureService:u})}}};var Jf,Zf,Am,nl;const gm="tokens";class m9{constructor({apiClient:t,stateService:r,identityGatewaySdk:n,storage:i}){Jf.set(this,void 0),Zf.set(this,void 0),Am.set(this,void 0),nl.set(this,void 0),(0,F.GG)(this,Jf,t,"f"),(0,F.GG)(this,Zf,r,"f"),(0,F.GG)(this,Am,n,"f"),(0,F.GG)(this,nl,i,"f")}getStoredTokens(){const t=(0,F.gn)(this,nl,"f").getItem(gm);return t?JSON.parse(t):void 0}removeStoredTokens(){(0,F.gn)(this,nl,"f").removeItem(gm)}storeTokens(t){(0,F.gn)(this,nl,"f").setItem(gm,JSON.stringify(t))}logout(){return(0,F.sH)(this,void 0,void 0,function*(){const t=(0,F.gn)(this,Zf,"f").getUserTokenData().accessToken.jwtToken,{key:r,variant:n}=(0,F.gn)(this,Zf,"f").getClientContext();n!==te.GUEST&&(yield(0,F.gn)(this,Am,"f").logout({accessToken:t},{context:{headers:{clientKey:r}}})),(0,F.gn)(this,Jf,"f").stop(),(0,F.gn)(this,Jf,"f").clearAuth(),yield(0,F.gn)(this,Jf,"f").clearStore(),(0,F.gn)(this,Zf,"f").logoutUser(),(0,F.gn)(this,nl,"f").removeItem(gm)})}}Jf=new WeakMap,Zf=new WeakMap,Am=new WeakMap,nl=new WeakMap;var ym;(function(e){e.one="1.0.0"})(ym||(ym={}));const K$="orchestrator:identity-utils",T9={id:K$,dependencies:{featureServices:{[za]:Nr.one,[ks]:Mu.one,[Wn]:vi.one,[Mp]:kf.one}},create:({featureServices:e})=>{const t=e[za];return{[ym.one]:()=>({featureService:new m9({apiClient:t,stateService:e[Wn],identityGatewaySdk:mx(t),storage:window.sessionStorage})})}}};var Rm;(function(e){e.one="1.0.0"})(Rm||(Rm={}));const W$="orchestrator:globaleventemitter-service",A9=e=>({id:W$,create:()=>({[Rm.one]:()=>({featureService:e})})});var Om;(function(e){e.one="1.0.0"})(Om||(Om={}));const Q$="orchestrator:reboot-controller",g9=e=>({id:Q$,create:()=>({[Om.one]:()=>({featureService:e})})});class ki extends Error{constructor(t,r){super(t),this.name="BWellError",r?.cause&&(this.cause=r.cause)}static isBwellError(t){return t instanceof ki}}class Owe extends ki{constructor(t="Authentication Error"){super(t),this.name="AuthenticationError"}}class bwe extends ki{constructor(t="Illegal Argument Error"){super(t),this.name="IllegalArgumentError"}}class Cwe extends ki{constructor(t="Illegal State Error"){super(t),this.name="IllegalStateError"}}class y9 extends ki{constructor(t="Invalid Client Key Error"){super(t),this.name="InvalidClientKeyError"}}class LC extends ki{constructor(t,r){super(t),this.credentials=r,this.name="InvalidCredentialsTypeError"}}class e_ extends ki{constructor(t="Invalid Token Error"){super(t),this.name="InvalidTokenError"}}class R9 extends ki{constructor(t,r){super(t),this.status=r,this.name="NetworkError"}}class O9 extends ki{constructor(t){super(t.message()),this.operationOutcome=t,this.name="OperationOutcomeError"}}class DC extends ki{constructor(t,r){super(t),this.data=r,this.name="UnknownError"}}class b9 extends ki{constructor(t){super(t.join(". ")),this.errors=t,this.name="ValidationError"}}class tr{constructor(t,r){this.data=t,r!==null&&(this.error=r)}hasError(){return this.error!==void 0}static error(t){return new tr(void 0,t)}}var z$=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},bm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Wp,Qp;class Kt{static success(t){return new C9(t)}static failure(t){return new Cm(t)}}class C9 extends Kt{constructor(t){super(),Wp.set(this,void 0),z$(this,Wp,t,"f")}data(){return bm(this,Wp,"f")}error(){throw bm(this,Wp,"f")}success(){return!0}failure(){return!1}toQueryResult(){return new tr(this.data())}}Wp=new WeakMap;class Cm extends Kt{constructor(t){super(),Qp.set(this,void 0),z$(this,Qp,t,"f")}data(){throw bm(this,Qp,"f")}error(){return bm(this,Qp,"f")}success(){return!1}failure(){return!0}intoFailure(){return Kt.failure(this.error())}toQueryResult(){return new tr(void 0,this.error())}}Qp=new WeakMap;var wC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zp;class P9{constructor(){zp.set(this,[])}add(t){wC(this,zp,"f").push(t)}errors(){return wC(this,zp,"f")}hasErrors(){return wC(this,zp,"f").length>0}}zp=new WeakMap;var X$=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},UC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Xp,Pm;class M9{constructor(t){Xp.set(this,void 0),Pm.set(this,void 0),X$(this,Pm,t,"f"),X$(this,Xp,this.transformInput(t),"f")}validate(){return Kt.success(null)}data(){return UC(this,Xp,"f")}toJSON(){return UC(this,Xp,"f")}transformInput(t){return t}input(){return UC(this,Pm,"f")}}Xp=new WeakMap,Pm=new WeakMap;class sa extends M9{validate(){const t=new P9;return this.validator.validate(this.input(),t),t.hasErrors()?Kt.failure(new b9(t.errors())):Kt.success(null)}}var J$=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Mm,Z$,eV;const tV=100,I9=20;class Ys{constructor(){Mm.add(this)}validate(t,r){J$(this,Mm,"m",Z$).call(this,t.page,r),J$(this,Mm,"m",eV).call(this,t.pageSize,r)}}Mm=new WeakSet,Z$=function(t,r){t<0&&r.add("page must be a positive number")},eV=function(t,r){t!==void 0&&(t<=0&&r.add("Page size must be greater than 0"),t>tV&&r.add(`Page size must not exceed ${tV}`))};class qs extends sa{constructor(){super(...arguments),this.validator=new Ys}transformInput(t){return Object.assign({pageSize:I9},t)}}function N9(){var e;return!(typeof process>"u"||((e=process.versions)===null||e===void 0?void 0:e.node)===void 0)}function L9(){return typeof window<"u"}function rV(){if(L9())return"browser";if(N9())return"node";throw new Error("Invalid runtime")}function D9(e){switch(rV()){case"browser":return e.browser();case"node":return e.node()}}function nV(e){switch(rV()){case"node":return Buffer.from(e,"base64").toString("utf-8");case"browser":return atob(e)}}function Fn(e){return e!=null}function Fo(e){return e==null}function Pwe(e){return Fn(e)&&e!==""}function Ks(e){return e==null||e===""}function ka(e){return e===void 0}function ji(e){return e!==void 0}function w9(e){return JSON.parse(nV(e)).env}const U9=3;function iV(e){const t=e.split("."),r=t[1];if(r===void 0||t.length!==U9)throw new e_("Token is missing data and may be corrupted");try{return JSON.parse(nV(r))}catch(n){const i=n;throw new e_(`Unable to parse token payload: ${i.name} - ${i.message}`)}}function x9(e){const r=iV(e).exp;if(typeof r!="number")throw new e_("The access token is missing an expiration date and is most likely corrupted.");return r*1e3}const F9="custom:clientFhirPersonId",$9="custom:bwellFhirPatientId";function V9(e){const t=iV(e),r=t[$9],n=t[F9];return Fn(r)&&Fn(n)?{bwellFhirPersonId:r,clientFhirPersonId:n}:null}function $o(e){return e.trim()===""}const G9="1.36.4";function B9(){return G9}var xC;(function(e){e.Arrived="ARRIVED",e.Booked="BOOKED",e.Cancelled="CANCELLED",e.CheckedIn="CHECKED_IN",e.EnteredInError="ENTERED_IN_ERROR",e.Fulfilled="FULFILLED",e.Noshow="NOSHOW",e.Pending="PENDING",e.Proposed="PROPOSED",e.Waitlist="WAITLIST"})(xC||(xC={}));var aV;(function(e){e.Guest="GUEST"})(aV||(aV={}));var Im;(function(e){e.CommunicationPreferencesPhi="COMMUNICATION_PREFERENCES_PHI",e.DataSharing="DATA_SHARING",e.HealthCircleAdolescent="HEALTH_CIRCLE_ADOLESCENT",e.HealthCircleMinor="HEALTH_CIRCLE_MINOR",e.HealthMatch="HEALTH_MATCH",e.IasImportRecords="IAS_IMPORT_RECORDS",e.MobileCommunicationPreferences="MOBILE_COMMUNICATION_PREFERENCES",e.PersonalizedHealthOffersAndAds="PERSONALIZED_HEALTH_OFFERS_AND_ADS",e.ProaAttestation="PROA_ATTESTATION",e.Tos="TOS"})(Im||(Im={}));var oV;(function(e){e.Bwell="bwell"})(oV||(oV={}));var sV;(function(e){e.Bwell="BWELL"})(sV||(sV={}));var uV;(function(e){e.Basic="BASIC",e.Oauth="OAUTH"})(uV||(uV={}));var FC;(function(e){e.Deny="DENY",e.Permit="PERMIT"})(FC||(FC={}));var $C;(function(e){e.Active="ACTIVE",e.Draft="DRAFT",e.EnteredInError="ENTERED_IN_ERROR",e.Inactive="INACTIVE",e.Proposed="PROPOSED",e.Rejected="REJECTED"})($C||($C={}));var cV;(function(e){e.Home="home",e.Mobile="mobile",e.Work="work"})(cV||(cV={}));var lV;(function(e){e.Usd="USD"})(lV||(lV={}));var fV;(function(e){e.Connected="CONNECTED",e.Deleted="DELETED",e.Disconnected="DISCONNECTED",e.Error="ERROR",e.Expired="EXPIRED"})(fV||(fV={}));var _V;(function(e){e.Clinical="CLINICAL",e.Insurance="INSURANCE",e.Lab="LAB",e.Pharmacy="PHARMACY",e.Practitioner="PRACTITIONER"})(_V||(_V={}));var Nm;(function(e){e.Connecthub="connecthub",e.Nppes="nppes"})(Nm||(Nm={}));var dV;(function(e){e.Connecthub="CONNECTHUB",e.Nppes="NPPES"})(dV||(dV={}));var pV;(function(e){e.BwellPatient="BWELL_PATIENT",e.BwellPerson="BWELL_PERSON",e.ClientPatient="CLIENT_PATIENT",e.ClientPerson="CLIENT_PERSON"})(pV||(pV={}));var hV;(function(e){e.Active="active",e.EnteredInError="entered_in_error",e.Error="error",e.Off="off",e.Suspended="suspended",e.Test="test"})(hV||(hV={}));var SV;(function(e){e.Active="ACTIVE",e.EnteredInError="ENTERED_IN_ERROR",e.Error="ERROR",e.Off="OFF",e.Suspended="SUSPENDED",e.Test="TEST"})(SV||(SV={}));var VC;(function(e){e.CustomEvent="CUSTOM_EVENT",e.MobilePushOpen="MOBILE_PUSH_OPEN"})(VC||(VC={}));var GC;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(GC||(GC={}));var BC;(function(e){e.Person="Person"})(BC||(BC={}));var kC;(function(e){e.Characteristic="characteristic",e.Communication="communication",e.Gender="gender",e.Specialty="specialty"})(kC||(kC={}));var EV;(function(e){e.Characteristic="CHARACTERISTIC",e.Communication="COMMUNICATION",e.Gender="GENDER",e.Specialty="SPECIALTY"})(EV||(EV={}));var vV;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(vV||(vV={}));var mV;(function(e){e.Female="FEMALE",e.Male="MALE",e.Other="OTHER",e.Unknown="UNKNOWN"})(mV||(mV={}));var TV;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(TV||(TV={}));var AV;(function(e){e.AllergyIntolerance="ALLERGY_INTOLERANCE",e.CarePlan="CARE_PLAN",e.Condition="CONDITION",e.Encounter="ENCOUNTER",e.Immunization="IMMUNIZATION",e.Labs="LABS",e.Medications="MEDICATIONS",e.Procedure="PROCEDURE",e.VitalSigns="VITAL_SIGNS"})(AV||(AV={}));var gV;(function(e){e.Official="_official",e.Old="_old",e.Secondary="_secondary",e.Temp="_temp",e.Usual="_usual"})(gV||(gV={}));var yV;(function(e){e.Clicked="clicked"})(yV||(yV={}));var RV;(function(e){e.Clicked="CLICKED"})(RV||(RV={}));var jC;(function(e){e.Debug="DEBUG",e.Error="ERROR",e.Info="INFO",e.Verbose="VERBOSE",e.Warn="WARN"})(jC||(jC={}));var OV;(function(e){e.Activity="ACTIVITY",e.Exam="EXAM",e.Imaging="IMAGING",e.Laboratory="LABORATORY",e.Procedure="PROCEDURE",e.SocialHistory="SOCIAL_HISTORY",e.Survey="SURVEY",e.Therapy="THERAPY",e.VitalSigns="VITAL_SIGNS"})(OV||(OV={}));var bV;(function(e){e.CancelDelete="CANCEL_DELETE",e.ConfirmDelete="CONFIRM_DELETE",e.DeletionInProgress="DELETION_IN_PROGRESS",e.ImmediateExecution="IMMEDIATE_EXECUTION",e.RequestDelete="REQUEST_DELETE"})(bV||(bV={}));var HC;(function(e){e.C19Vaccine="C19Vaccine",e.Device="Device",e.Insurance="Insurance",e.Laboratory="Laboratory",e.Pharmacy="Pharmacy",e.Provider="Provider",e.Bus="bus",e.Cg="cg",e.Crs="crs",e.Dept="dept",e.Edu="edu",e.Govt="govt",e.Ins="ins",e.Other="other",e.Pay="pay",e.Prov="prov",e.Reli="reli",e.Team="team"})(HC||(HC={}));var CV;(function(e){e.Bus="BUS",e.C19Vaccine="C19VACCINE",e.Cg="CG",e.Crs="CRS",e.Dept="DEPT",e.Device="DEVICE",e.Edu="EDU",e.Govt="GOVT",e.Ins="INS",e.Insurance="INSURANCE",e.Laboratory="LABORATORY",e.Other="OTHER",e.Pay="PAY",e.Pharmacy="PHARMACY",e.Prov="PROV",e.Provider="PROVIDER",e.Reli="RELI",e.Team="TEAM"})(CV||(CV={}));var PV;(function(e){e.Add="add",e.Copy="copy",e.Move="move",e.Remove="remove",e.Replace="replace",e.Test="test"})(PV||(PV={}));var MV;(function(e){e.Patient="Patient",e.Person="Person"})(MV||(MV={}));var IV;(function(e){e.Practice="practice",e.Practitioner="practitioner"})(IV||(IV={}));var NV;(function(e){e.Practice="PRACTICE",e.Practitioner="PRACTITIONER"})(NV||(NV={}));var LV;(function(e){e.QuestionnaireResponse="QuestionnaireResponse"})(LV||(LV={}));var DV;(function(e){e.AllergyIntolerance="ALLERGY_INTOLERANCE",e.CarePlan="CARE_PLAN",e.Condition="CONDITION",e.Encounter="ENCOUNTER",e.Immunization="IMMUNIZATION",e.MedicationDispense="MEDICATION_DISPENSE",e.MedicationRequest="MEDICATION_REQUEST",e.MedicationStatement="MEDICATION_STATEMENT",e.Observation="OBSERVATION",e.Procedure="PROCEDURE"})(DV||(DV={}));var wV;(function(e){e.Insurance="INSURANCE",e.Laboratory="LABORATORY",e.Pharmacy="PHARMACY",e.Practice="PRACTICE",e.Practitioner="PRACTITIONER"})(wV||(wV={}));var YC;(function(e){e.Content="content",e.Distance="distance",e.Relevance="relevance"})(YC||(YC={}));var UV;(function(e){e.Content="CONTENT",e.DataSourceRank="DATA_SOURCE_RANK",e.Distance="DISTANCE",e.Relevance="RELEVANCE"})(UV||(UV={}));var qC;(function(e){e.Asc="asc",e.Desc="desc"})(qC||(qC={}));var xV;(function(e){e.Asc="ASC",e.Desc="DESC"})(xV||(xV={}));var FV;(function(e){e.CareSearch="CARE_SEARCH",e.Proa="PROA",e.ProviderDetails="PROVIDER_DETAILS",e.Sayt="SAYT",e.Unspecified="UNSPECIFIED"})(FV||(FV={}));var $V;(function(e){e.Error="ERROR",e.Pending="PENDING",e.Retrieved="RETRIEVED",e.Retrieving="RETRIEVING"})($V||($V={}));var KC;(function(e){e.Accepted="ACCEPTED",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Draft="DRAFT",e.EnteredInError="ENTERED_IN_ERROR",e.Failed="FAILED",e.InProgress="IN_PROGRESS",e.OnHold="ON_HOLD",e.Ready="READY",e.Received="RECEIVED",e.Rejected="REJECTED",e.Requested="REQUESTED"})(KC||(KC={}));var VV;(function(e){e.Accurate="accurate",e.Estimate="estimate"})(VV||(VV={}));const k9=new Set(Object.values(GC));function GV(e){return k9.has(e)}const j9=new Set(Object.values($C));function H9(e){return j9.has(e)}const Y9=new Set(Object.values(Im));function BV(e){return Y9.has(e)}const q9=new Set(Object.values(FC));function K9(e){return q9.has(e)}class W9{validate(t,r){!ka(t.gender)&&!GV(t.gender)&&r.add(`Invalid gender value: "${t.gender}"`)}}class Mwe extends sa{constructor(){super(...arguments),this.validator=new W9}}class Q9{validate(t,r){BV(t.category)||r.add(`Invalid consent category code: "${t.category}"`)}}class Iwe extends sa{constructor(){super(...arguments),this.validator=new Q9}}class z9{validate(t,r){H9(t.status)||r.add(`Invalid consent status: "${t.status}"`),K9(t.provision)||r.add(`Invalid consent provision type: "${t.provision}"`),BV(t.category)||r.add(`Invalid consent category code: "${t.category}"`),!ka(t.organizationId)&&$o(t.organizationId)&&r.add("organizationId cannot be empty"),t.category===Im.ProaAttestation&&ka(t.organizationId)&&r.add("organizationId must be provided when category is PROA_ATTESTATION")}}class Nwe extends sa{constructor(){super(...arguments),this.validator=new z9}}class X9{validate(t,r){Ks(t.exportId)&&r.add("exportId is required"),Ks(t.password)&&r.add("password is required")}}class Lwe extends sa{constructor(){super(...arguments),this.validator=new X9}}class Dwe extends null{}var ja=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ua,xu,kV,jV,HV,YV,qV,KV;class WC{constructor(){ua.add(this)}validate(t,r){if(!t.values||t.values.length===0){r.add("At least one SearchDateValue must be set to instantiate a SearchDate");return}for(const n of t.values)ja(this,ua,"m",kV).call(this,n,r)}}ua=new WeakSet,xu=function(t,r){t&&t!==null&&isNaN(t.getTime())&&r.add("The date is not valid")},kV=function(t,r){const{equals:n,notEquals:i,greaterThan:a,greaterThanOrEqualTo:u,lessThan:c,lessThanOrEqualTo:E,approximately:_}=t,L=[n,i,a,u,c,E,_].filter(W=>W!=null).length;if(L===0){r.add("At least one SearchDateValue must be set to instantiate a SearchDate");return}ja(this,ua,"m",jV).call(this,t,L,r),ja(this,ua,"m",qV).call(this,t,r),ja(this,ua,"m",KV).call(this,t,r)},jV=function(t,r,n){const{equals:i,notEquals:a,approximately:u}=t;if(i&&r>1){n.add("The equals value cannot be set with any other values");return}if(a&&r>1){n.add("The notEquals value cannot be set with any other values");return}if(u&&r>1){n.add("The approximately value cannot be set with any other values");return}ja(this,ua,"m",HV).call(this,t,n),ja(this,ua,"m",YV).call(this,t,n)},HV=function(t,r){t.greaterThan&&t.greaterThanOrEqualTo&&r.add("The greaterThan/greaterThanOrEqualTo value cannot be set with both values")},YV=function(t,r){t.lessThan&&t.lessThanOrEqualTo&&r.add("The lessThan/lessThanOrEqualTo value cannot be set with both values")},qV=function(t,r){const{equals:n,notEquals:i,greaterThan:a,greaterThanOrEqualTo:u,lessThan:c,lessThanOrEqualTo:E,approximately:_}=t;n&&ja(this,ua,"m",xu).call(this,n,r),i&&ja(this,ua,"m",xu).call(this,i,r),a&&ja(this,ua,"m",xu).call(this,a,r),u&&ja(this,ua,"m",xu).call(this,u,r),c&&ja(this,ua,"m",xu).call(this,c,r),E&&ja(this,ua,"m",xu).call(this,E,r),_&&ja(this,ua,"m",xu).call(this,_,r)},KV=function(t,r){const{greaterThan:n,greaterThanOrEqualTo:i,lessThan:a,lessThanOrEqualTo:u}=t;n&&u&&n>=u&&r.add("The greaterThan value must be less than the lessThanOrEqualTo value"),i&&a&&i>=a&&r.add("The greaterThanOrEqualTo value must be less than the lessThan value"),n&&a&&n>=a&&r.add("The greaterThan value must be less than the lessThan value"),i&&u&&i>=u&&r.add("The greaterThanOrEqualTo value must be less than the lessThanOrEqualTo value")};var QC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Jp;class Lm{constructor(){Jp.set(this,new J9)}validate(t,r){var n;if(t.value===void 0&&t.values===void 0&&t.notEquals===void 0){r.add("Either SearchToken value or values or notEquals must be provided");return}if(t.value!==void 0&&QC(this,Jp,"f").validate(t.value,r),t.values!==void 0&&t.values.length===0){r.add("At least one Coding must be set to instantiate a SearchToken");return}for(const i of(n=t.values)!==null&&n!==void 0?n:[])QC(this,Jp,"f").validate(i,r);if(t.notEquals!==void 0){if(t.notEquals.values!==void 0){if(t.notEquals.values.length===0){r.add("If notEquals values are provided, at least one Coding must be set");return}for(const i of t.notEquals.values)QC(this,Jp,"f").validate(i,r)}t.notEquals.code===void 0&&t.notEquals.value===void 0&&t.notEquals.system===void 0&&t.notEquals.values===void 0&&r.add("NotEquals must have at least one non-null property (code, value, system, or values)")}}}Jp=new WeakMap;class J9{validate(t,r){!t.system&&!t.code&&r.add("Each Coding in the list must have at least one non-null and non-empty value for system or code")}}var t_=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zC,XC,JC,ZC,eP,tP;class WV extends Ys{constructor(){super(...arguments),zC.set(this,new Lm),XC.set(this,new WC)}validate(t,r){super.validate(t,r),t.groupCode&&t_(this,zC,"f").validate(t.groupCode,r),t.lastUpdated&&t_(this,XC,"f").validate(t.lastUpdated,r)}}zC=new WeakMap,XC=new WeakMap;class Z9{validate(t,r){t.length===0&&r.add("Prescription array must not be empty.")}}class QV extends Ys{constructor(){super(...arguments),JC.set(this,new Z9),ZC.set(this,new WC)}validate(t,r){super.validate(t,r),t.lastUpdated!==void 0&&t_(this,ZC,"f").validate(t.lastUpdated,r),t.prescription!==void 0&&t_(this,JC,"f").validate(t.prescription,r)}}JC=new WeakMap,ZC=new WeakMap;class eZ extends Ys{validate(t,r){var n;super.validate(t,r),!((n=t?.ids)===null||n===void 0)&&n.length||r.add("ids must not be empty")}}class tZ extends qs{constructor(){super(...arguments),this.validator=new WV}}class wwe extends null{}class Uwe extends null{}class xwe extends null{}class Fwe extends null{}class $we extends null{}class Vwe extends null{}class Gwe extends null{}class Bwe extends null{}class kwe extends null{}class jwe extends null{}class Hwe extends null{}class Ywe extends null{}class qwe extends null{}class Kwe extends null{}class Wwe extends null{}class Qwe extends null{}class zwe extends null{}class Xwe extends null{}class Jwe extends null{}class rZ extends QV{constructor(){super(...arguments),eP.set(this,new Lm)}validate(t,r){super.validate(t,r),t.medicationCode!==void 0&&t_(this,eP,"f").validate(t.medicationCode,r)}}eP=new WeakMap;class Zwe extends qs{constructor(){super(...arguments),this.validator=new QV}}class eUe extends qs{constructor(){super(...arguments),this.validator=new rZ}}class nZ extends WV{constructor(){super(...arguments),tP.set(this,new Lm)}validate(t,r){super.validate(t,r),t.medicationCode!==void 0&&t_(this,tP,"f").validate(t.medicationCode,r)}}tP=new WeakMap;class tUe extends tZ{constructor(){super(...arguments),this.validator=new nZ}}class rUe extends null{}class nUe extends qs{constructor(){super(...arguments),this.validator=new eZ}}class iUe extends null{}class iZ{validate(t,r){$o(t.medicationStatementId)&&r.add("The medication pricing request must possess a medication statement id.")}}class aUe extends sa{constructor(){super(...arguments),this.validator=new iZ}}class aZ extends Ys{validate(t,r){$o(t.medicationStatementId)&&r.add("The medication knowledge request must possess a medication statement id."),super.validate(t,r)}}class oUe extends qs{constructor(){super(...arguments),this.validator=new aZ}}class oZ extends Ys{validate(t,r){$o(t.labId)&&r.add("The lab knowledge request must contain a lab id."),super.validate(t,r)}}class sUe extends qs{constructor(){super(...arguments),this.validator=new oZ}}const sZ=new Set(Object.values(KC));function zV(e){return sZ.has(e)}var uZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},rP,XV;class cZ extends Ys{constructor(){super(...arguments),rP.add(this)}validate(t,r){if(super.validate(t,r),!ka(t.status)){const n=Array.isArray(t.status)?t.status:[t.status];for(const i of n)uZ(this,rP,"m",XV).call(this,i,r)}}}rP=new WeakSet,XV=function(t,r){zV(t)||r.add(`Invalid task status: "${t}"`)};class uUe extends qs{constructor(){super(...arguments),this.validator=new cZ}}class lZ{validate(t,r){zV(t.newStatus)||r.add(`Invalid task status: "${t.newStatus}"`)}}class cUe extends sa{constructor(){super(...arguments),this.validator=new lZ}}var Dm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},r_,JV,ZV,eG,tG;class lUe extends qs{constructor(){super(...arguments),this.validator=new fZ}}class fZ extends Ys{constructor(){super(...arguments),r_.add(this)}validate(t,r){super.validate(t,r),ji(t.organizationTypeFilters)&&Dm(this,r_,"m",JV).call(this,t.organizationTypeFilters,r),ji(t.sortBy)&&Dm(this,r_,"m",ZV).call(this,t.sortBy,r),ji(t.filterFields)&&Dm(this,r_,"m",eG).call(this,t.filterFields,r),ji(t.gender)&&Dm(this,r_,"m",tG).call(this,t.gender,r)}}r_=new WeakSet,JV=function(t,r){for(const n of t)dZ(n)||r.add(`Invalid organizationTypeFilters value: "${n}"`)},ZV=function(t,r){ji(t.field)&&!hZ(t.field)&&r.add(`Invalid sortBy.field value: "${t.field}"`),ji(t.order)&&!EZ(t.order)&&r.add(`Invalid sortBy.order value: "${t.order}"`)},eG=function(t,r){for(const n of t)mZ(n)||r.add(`Invalid filterField value: "${n}"`)},tG=function(t,r){GV(t)||r.add(`Invalid gender value: "${t}"`)};const _Z=new Set(Object.values(HC));function dZ(e){return _Z.has(e)}const pZ=new Set(Object.values(YC));function hZ(e){return pZ.has(e)}const SZ=new Set(Object.values(qC));function EZ(e){return SZ.has(e)}const vZ=new Set(Object.values(kC));function mZ(e){return vZ.has(e)}class fUe extends null{}class _Ue extends qs{constructor(){super(...arguments),this.validator=new TZ}}class TZ extends Ys{validate(t,r){super.validate(t,r)}}const AZ="data-connection-status";var gZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},nP;const yZ="connectionId cannot be null or empty",RZ="username cannot be null or empty",OZ="password cannot be null or empty";class rG{validate(t,r){t.connectionId===""&&r.add(yZ)}}class bZ{constructor(){nP.set(this,new rG)}validate(t,r){gZ(this,nP,"f").validate(t,r),t.username===""&&r.add(RZ),t.password===""&&r.add(OZ)}}nP=new WeakMap;class CZ extends sa{constructor(){super(...arguments),this.validator=new rG}}class dUe extends null{}class pUe extends CZ{constructor(){super(...arguments),this.validator=new bZ}}const PZ="deviceToken is required",MZ="platformName must be a valid DevicePlatform value",IZ="applicationName is required";var iP;(function(e){e.IOS="IOS",e.ANDROID="ANDROID"})(iP||(iP={}));const NZ=new Set(Object.values(iP));function LZ(e){return NZ.has(e)}function DZ(e){return!LZ(e)}class nG{validate(t,r){$o(t.deviceToken)&&r.add(PZ)}}class wZ extends nG{validate(t,r){super.validate(t,r),DZ(t.platformName.toUpperCase())&&r.add(MZ),$o(t.applicationName)&&r.add(IZ)}}class hUe extends sa{constructor(){super(...arguments),this.validator=new wZ}}class SUe extends sa{constructor(){super(...arguments),this.validator=new nG}}const UZ="string parameter serializedNotification must be provided",xZ="serialized notification must have a non-empty notification_id field of type string",iG="serialized notification must have an itbl object containing a non-empty messageId field of type string",FZ="parsed notification must be a non-null object.",$Z="serialized notification is not valid JSON.";class VZ{validate(t,r){if(ka(t.serializedNotification)||typeof t.serializedNotification!="string"||$o(t.serializedNotification)){r.add(UZ);return}let n=null;try{n=JSON.parse(t.serializedNotification)}catch{r.add($Z);return}if(typeof n!="object"||n===null){r.add(FZ);return}const{itbl:i,notification_id:a}=n;if((ka(a)||typeof a!="string"||$o(a))&&r.add(xZ),typeof i!="object"||Fo(i)){r.add(iG);return}(ka(i.messageId)||typeof i.messageId!="string"||$o(i.messageId))&&r.add(iG)}}class EUe extends sa{constructor(){super(...arguments),this.validator=new VZ}}const GZ="SearchStringValue should be a non-empty string";class BZ{validate(t,r){if(Fo(t.values))return;let n=!1;for(const i of t.values)$o(i)&&(n=!0);n&&r.add(GZ)}}var aP=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},oP,sP,uP;class kZ{constructor(){oP.set(this,new WC),sP.set(this,new BZ),uP.set(this,new Lm)}validate(t,r){var n;Fn(t._source)&&aP(this,sP,"f").validate(t._source,r),Fn(t.date)&&aP(this,oP,"f").validate(t.date,r),Fn(t._count)&&t._count<0&&r.add("Value of count cannot be less than 0"),Fn(t._getpagesoffset)&&t._getpagesoffset<0&&r.add("Value of getpagesoffset cannot be less than 0"),Fn((n=t.supporting_info)===null||n===void 0?void 0:n.value)&&$o(t.supporting_info.value)&&r.add("Supporting Information must have a non-empty value."),Fn(t.status)&&aP(this,uP,"f").validate(t.status,r)}}oP=new WeakMap,sP=new WeakMap,uP=new WeakMap;class vUe extends sa{constructor(){super(...arguments),this.validator=new kZ}}class jZ{validate(t,r){if(!Fo(t.cancelationReason)){if(Fo(t.cancelationReason.coding)||t.cancelationReason.coding.length===0){r.add("cancelationReason must have at least one coding");return}for(const n of t.cancelationReason.coding)(Fo(n?.code)||Fo(n?.system))&&r.add("cancelationReason.coding must have a code and a system")}}}class mUe extends sa{constructor(){super(...arguments),this.validator=new jZ}}class HZ{validate(t,r){var n;Ks((n=t.organization.value)===null||n===void 0?void 0:n.trim())&&r.add("Organization reference is required and must have a non-empty value.")}}class TUe extends sa{constructor(){super(...arguments),this.validator=new HZ}}class YZ{validate(t,r){const n=t.questionnaireResponse;if(Fo(n)){r.add("questionnaireResponse is required");return}if((Ks(n.resourceType)||n.resourceType!=="QuestionnaireResponse")&&r.add('questionnaireResponse.resourceType must be "QuestionnaireResponse"'),Ks(n.status)&&r.add("questionnaireResponse.status is required"),Ks(n.questionnaire)&&r.add("questionnaireResponse.questionnaire is required"),Fo(n.contained)||n.contained.length===0)r.add("questionnaireResponse.contained must have at least one item");else{let i=null;for(const a of n.contained){if(Fo(a)){r.add("questionnaireResponse.contained item cannot be null or undefined");break}if(a.resourceType==="Questionnaire"){i=a;break}}if(Fo(i)){r.add("questionnaireResponse.contained must contain a Questionnaire resource");return}Ks(i.id)&&r.add("questionnaireResponse.contained Questionnaire resource must have an id")}}}class AUe extends sa{constructor(){super(...arguments),this.validator=new YZ}}var cP=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(p){try{_(n.next(p))}catch(L){u(L)}}function E(p){try{_(n.throw(p))}catch(L){u(L)}}function _(p){p.done?a(p.value):i(p.value).then(c,E)}_((n=n.apply(e,t||[])).next())})};class aG{constructor(t=new Map){this.storage=t}get(t){return cP(this,void 0,void 0,function*(){return this.storage.get(t)})}set(t,r){return cP(this,void 0,void 0,function*(){this.storage.set(t,r)})}delete(t){return cP(this,void 0,void 0,function*(){return this.storage.delete(t)})}}const qZ={logLevel:jC.Error,timeout:3e4,retryPolicy:{attempts:3,interval:1e3},telemetryEnabled:!1,tokenStorage:new aG,language:null,overrides:{unauthedApiUrl:null,authedApiUrl:null}};var Ws;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Ws||(Ws={}));var KZ=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},oG=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Zp,Mr;(function(e){e[e.VERBOSE=0]="VERBOSE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.FATAL=5]="FATAL"})(Mr||(Mr={}));const WZ={[Mr.VERBOSE]:"VERBOSE",[Mr.DEBUG]:"DEBUG",[Mr.INFO]:"INFO",[Mr.WARN]:"WARN",[Mr.ERROR]:"ERROR",[Mr.FATAL]:"FATAL"};class n_{constructor(t){Zp.set(this,void 0),KZ(this,Zp,t,"f")}get severity(){return oG(this,Zp,"f")}shouldLog(t){return t>=oG(this,Zp,"f")}static severityText(t){return WZ[t]}static severityFromText(t){switch(t){case"VERBOSE":return Mr.VERBOSE;case"DEBUG":return Mr.DEBUG;case"INFO":return Mr.INFO;case"WARN":return Mr.WARN;case"ERROR":return Mr.ERROR;case"FATAL":return Mr.FATAL;default:throw new Error(`Invalid severity text: ${t}`)}}}Zp=new WeakMap;var lP=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Es=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Fu,sG,wm,eh,Um,il;class uG{constructor(t,r,n){Fu.add(this),wm.set(this,void 0),eh.set(this,void 0),Um.set(this,void 0),lP(this,wm,n,"f"),lP(this,eh,new n_(t),"f"),lP(this,Um,r,"f")}name(){return Es(this,wm,"f")}severity(){return Es(this,eh,"f").severity}verbose(t,r){Es(this,Fu,"m",il).call(this,Mr.VERBOSE,t,r)}debug(t,r){Es(this,Fu,"m",il).call(this,Mr.DEBUG,t,r)}info(t,r){Es(this,Fu,"m",il).call(this,Mr.INFO,t,r)}warn(t,r){Es(this,Fu,"m",il).call(this,Mr.WARN,t,r)}error(t,r){let n;r instanceof Kt&&(n={error:r.failure()?r.error().message:r.data()}),r instanceof Error&&(n={error:r.message}),n===void 0&&(n=r),Es(this,Fu,"m",il).call(this,Mr.ERROR,t,n)}fatal(t,r){Es(this,Fu,"m",il).call(this,Mr.FATAL,t,r)}static otelSeverityNumber(t){switch(t){case Mr.VERBOSE:return Ws.TRACE;case Mr.DEBUG:return Ws.DEBUG;case Mr.INFO:return Ws.INFO;case Mr.WARN:return Ws.WARN;case Mr.ERROR:return Ws.ERROR;case Mr.FATAL:return Ws.FATAL;default:return Ws.UNSPECIFIED}}}sG=uG,wm=new WeakMap,eh=new WeakMap,Um=new WeakMap,Fu=new WeakSet,il=function(t,r,n){!Es(this,eh,"f").shouldLog(t)||Es(this,Um,"f").emit({timestamp:Date.now(),severityNumber:sG.otelSeverityNumber(t),severityText:n_.severityText(t),body:r,attributes:n??{}})};var cG=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},lG=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xm,Fm;class QZ{constructor(t,r){xm.set(this,void 0),Fm.set(this,void 0),cG(this,Fm,t,"f"),cG(this,xm,r.loggerProvider(),"f")}getLogger(t){const r=t??"default",n=lG(this,xm,"f").getLogger(r);return new uG(lG(this,Fm,"f"),n,r)}}xm=new WeakMap,Fm=new WeakMap;class zZ{format(t,r,n,i){let u=`[${new Date().toISOString()}] ${n_.severityText(t)}`;return n!==void 0&&(u+=` (${n})`),u+=`: ${r}`,i===void 0?[u]:[u,i]}}var fP=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},di=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},vs,ms,Qs;class XZ{constructor(t,r){vs.set(this,void 0),ms.set(this,void 0),Qs.set(this,void 0),fP(this,ms,new n_(t),"f"),fP(this,vs,r,"f"),fP(this,Qs,new zZ,"f")}name(){return di(this,vs,"f")}severity(){return di(this,ms,"f").severity}verbose(t,r){di(this,ms,"f").shouldLog(Mr.VERBOSE)&&console.debug(...di(this,Qs,"f").format(Mr.VERBOSE,t,di(this,vs,"f"),r))}debug(t,r){di(this,ms,"f").shouldLog(Mr.DEBUG)&&console.debug(...di(this,Qs,"f").format(Mr.DEBUG,t,di(this,vs,"f"),r))}info(t,r){di(this,ms,"f").shouldLog(Mr.INFO)&&console.info(...di(this,Qs,"f").format(Mr.INFO,t,di(this,vs,"f"),r))}warn(t,r){di(this,ms,"f").shouldLog(Mr.WARN)&&console.warn(...di(this,Qs,"f").format(Mr.WARN,t,di(this,vs,"f"),r))}error(t,r){let n=r;r instanceof Kt&&(n=r.failure()?r.error():r.data()),di(this,ms,"f").shouldLog(Mr.ERROR)&&console.error(...di(this,Qs,"f").format(Mr.ERROR,t,di(this,vs,"f"),n))}fatal(t,r){di(this,ms,"f").shouldLog(Mr.FATAL)&&console.error(...di(this,Qs,"f").format(Mr.FATAL,t,di(this,vs,"f"),r))}}vs=new WeakMap,ms=new WeakMap,Qs=new WeakMap;var JZ=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ZZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},$m;class Hi{constructor(t=Mr.FATAL){$m.set(this,void 0),JZ(this,$m,t,"f")}getLogger(t){return new XZ(ZZ(this,$m,"f"),t)}}$m=new WeakMap;var eee=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},_P,fG;class tee{constructor(){_P.add(this)}createLogProvider(t,r){switch(eee(this,_P,"m",fG).call(this,t)){case"otel":if(r===void 0)throw new Error('telemetry is required for "otel" logging');return new QZ(t.logLevel,r);case"console":return new Hi(t.logLevel)}}}_P=new WeakSet,fG=function(t){return t.telemetry.enabled?"otel":"console"};var Nn=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zs=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ao,i_,$u,a_,Vu,al,_G,dG,pG,hG,SG,EG,vG,mG,TG,AG;class Vm{constructor(t){ao.add(this),i_.set(this,void 0),$u.set(this,void 0),a_.set(this,void 0),Vu.set(this,void 0),al.set(this,void 0),this.bwellConfig=Nn(this,ao,"m",SG).call(this,t),zs(this,i_,n_.severityFromText(this.bwellConfig.logLevel),"f"),zs(this,al,Nn(this,ao,"m",AG).call(this),"f"),zs(this,a_,Nn(this,ao,"m",vG).call(this),"f"),zs(this,$u,Nn(this,ao,"m",mG).call(this),"f"),zs(this,Vu,Nn(this,ao,"m",TG).call(this),"f")}static initialize(t){try{const r=new Vm(t);return Kt.success(r)}catch(r){if(ki.isBwellError(r))return Kt.failure(r);throw r}}get logLevel(){return Nn(this,i_,"f")}get graphQL(){return Nn(this,a_,"f")}get telemetry(){return Nn(this,$u,"f")}get http(){return Nn(this,Vu,"f")}get context(){return Nn(this,al,"f")}setContextUser(t){Nn(this,al,"f").user=t}mergeRemoteConfig(t){zs(this,i_,Nn(this,ao,"m",_G).call(this,t),"f"),zs(this,a_,Nn(this,ao,"m",dG).call(this,t),"f"),zs(this,$u,Object.freeze(Nn(this,ao,"m",pG).call(this,t)),"f"),zs(this,Vu,Object.freeze(Nn(this,ao,"m",hG).call(this,t)),"f")}}i_=new WeakMap,$u=new WeakMap,a_=new WeakMap,Vu=new WeakMap,al=new WeakMap,ao=new WeakSet,_G=function(t){var r;const n=(r=t?.logLevel)!==null&&r!==void 0?r:null;return n===null?Nn(this,i_,"f"):n_.severityFromText(n)},dG=function(t){var r;const n=(r=t?.graphQLClient)!==null&&r!==void 0?r:null;if(n===null)return Nn(this,a_,"f");const{authedApiUrl:i,unauthedApiUrl:a}=this.bwellConfig.overrides;return{unauthApiUrl:a??n.url,apiUrl:i??n.authUrl}},pG=function(t){var r,n;const i=(r=t?.telemetry)!==null&&r!==void 0?r:null;if(i===null)return Nn(this,$u,"f");const a=(n=i.enabled)!==null&&n!==void 0?n:Nn(this,$u,"f").enabled;if(i.collectorUrl.endsWith("/"))throw new Error('Telemetry config "collectorUrl" cannot end with a trailing slash.');let u;try{u=new URL(i.collectorUrl)}catch{throw new Error('Telemetry config "collectorUrl" malformed/is not a proper URL.')}if(u.pathname!=="/")throw new Error('Telemetry config "collectorUrl" cannot contain a path.');return Object.assign(Object.assign({},Nn(this,$u,"f")),{enabled:a,collectorUrl:i.collectorUrl})},hG=function(t){var r,n,i;const a=(r=t?.httpClient)!==null&&r!==void 0?r:null;return a===null?Nn(this,Vu,"f"):{timeout:(n=a.requestTimeout)!==null&&n!==void 0?n:Nn(this,Vu,"f").timeout,retryPolicy:(i=a.retry)!==null&&i!==void 0?i:Nn(this,Vu,"f").retryPolicy}},SG=function(t){return Object.assign(Object.assign({},qZ),t)},EG=function(){try{return w9(this.bwellConfig.clientKey)}catch{throw new y9("It appears there is a problem with your Client Key. Contact b.well support for further assistance.")}},vG=function(){var t,r;return{apiUrl:(t=this.bwellConfig.overrides.authedApiUrl)!==null&&t!==void 0?t:`https://api-gateway.${Nn(this,al,"f").env}.icanbwell.com/federated-graph-authed/graphql`,unauthApiUrl:(r=this.bwellConfig.overrides.unauthedApiUrl)!==null&&r!==void 0?r:`https://api-gateway.${Nn(this,al,"f").env}.icanbwell.com/federated-graph/graphql`}},mG=function(){return{collectorUrl:"https://collector.services.icanbwell.com",enabled:this.bwellConfig.telemetryEnabled,timeout:this.bwellConfig.timeout}},TG=function(){return{timeout:this.bwellConfig.timeout,retryPolicy:{attempts:this.bwellConfig.retryPolicy.attempts,interval:this.bwellConfig.retryPolicy.interval}}},AG=function(){return{clientKey:this.bwellConfig.clientKey,env:Nn(this,ao,"m",EG).call(this),user:null}};var ree=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(p){try{_(n.next(p))}catch(L){u(L)}}function E(p){try{_(n.throw(p))}catch(L){u(L)}}function _(p){p.done?a(p.value):i(p.value).then(c,E)}_((n=n.apply(e,t||[])).next())})},gG=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Gm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},o_,Bm;class nee{constructor(t,r=new Hi){o_.set(this,void 0),Bm.set(this,void 0),gG(this,Bm,t,"f"),gG(this,o_,r.getLogger("ConfigManager"),"f")}initialize(t){return ree(this,void 0,void 0,function*(){const r=Vm.initialize(t);if(r.failure())return r;const n=r.data();Gm(this,o_,"f").verbose("Initializing SDK Configuration");const i=yield Gm(this,Bm,"f").initialize(n.context.clientKey);if(i.failure())return i.intoFailure();const a=i.data();try{n.mergeRemoteConfig(a)}catch(u){Gm(this,o_,"f").error("Error merging SDK config with remote config.",u)}return Gm(this,o_,"f").info("Remote SDK Configuration merged with user config"),Kt.success(n)})}}o_=new WeakMap,Bm=new WeakMap;const dP=JSON,iee=e=>e.toUpperCase(),aee=e=>{const t={};return e.forEach((r,n)=>{t[n]=r}),t},oee=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},see=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},uee=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},gUe=(e,t,...r)=>{const[n,i]=r;return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},yUe=(e,t,...r)=>{const[n,i]=r;return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}};var cee=h(5157),lee=h(2704);const yG=e=>{let t;const r=e.definitions.filter(n=>n.kind==="OperationDefinition");return r.length===1&&(t=r[0]?.name?.value),t},km=e=>{if(typeof e=="string"){let r;try{const n=(0,cee.qg)(e);r=yG(n)}catch{}return{query:e,operationName:r}}const t=yG(e);return{query:(0,lee.y)(e),operationName:t}};class Gu extends Error{constructor(t,r){const n=`${Gu.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,Gu.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Gu)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${t.status})`}}var s_=h(288),fee=h.t(s_,2);const _ee="connection_init",dee="connection_ack",RG="ping",OG="pong",pee="subscribe",hee="next",See="error",bG="complete";class Bu{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(t,r,n){this._type=t,this._payload=r,this._id=n}get text(){const t={type:this.type};return this.id!=null&&this.id!=null&&(t.id=this.id),this.payload!=null&&this.payload!=null&&(t.payload=this.payload),JSON.stringify(t)}static parse(t,r){const{type:n,payload:i,id:a}=JSON.parse(t);return new Bu(n,r(i),a)}}class Eee{constructor(t,{onInit:r,onAcknowledged:n,onPing:i,onPong:a}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=t,t.addEventListener("open",async u=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},t.send(mee(r?await r():null).text)}),t.addEventListener("close",u=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}}),t.addEventListener("error",u=>{console.error(u)}),t.addEventListener("message",u=>{try{const c=vee(u.data);switch(c.type){case dee:{this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,n&&n(c.payload));return}case RG:{i?i(c.payload).then(L=>t.send(CG(L).text)):t.send(CG(null).text);return}case OG:{a&&a(c.payload);return}}if(!this.socketState.acknowledged||c.id===void 0||c.id===null||!this.socketState.subscriptions[c.id])return;const{query:E,variables:_,subscriber:p}=this.socketState.subscriptions[c.id];switch(c.type){case hee:{!c.payload.errors&&c.payload.data&&p.next&&p.next(c.payload.data),c.payload.errors&&p.error&&p.error(new Gu({...c.payload,status:200},{query:E,variables:_}));return}case See:{p.error&&p.error(new Gu({errors:c.payload,status:200},{query:E,variables:_}));return}case bG:{p.complete&&p.complete(),delete this.socketState.subscriptions[c.id];return}}}catch(c){console.error(c),t.close(1006)}t.close(4400,"Unknown graphql-ws message.")})}makeSubscribe(t,r,n,i){const a=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[a]={query:t,variables:i,subscriber:n},this.socket.send(Aee(a,{query:t,operationName:r,variables:i}).text),()=>{this.socket.send(gee(a).text),delete this.socketState.subscriptions[a]}}rawRequest(t,r){return new Promise((n,i)=>{let a;this.rawSubscribe(t,{next:(u,c)=>a={data:u,extensions:c},error:i,complete:()=>n(a)},r)})}request(t,r){return new Promise((n,i)=>{let a;this.subscribe(t,{next:u=>a=u,error:i,complete:()=>n(a)},r)})}subscribe(t,r,n){const{query:i,operationName:a}=km(t);return this.makeSubscribe(i,a,r,n)}rawSubscribe(t,r,n){return this.makeSubscribe(t,void 0,r,n)}ping(t){this.socket.send(Tee(t).text)}close(){this.socket.close(1e3)}}Eee.PROTOCOL="graphql-transport-ws";function vee(e,t=r=>r){return Bu.parse(e,t)}function mee(e){return new Bu(_ee,e)}function Tee(e){return new Bu(RG,e,void 0)}function CG(e){return new Bu(OG,e,void 0)}function Aee(e,t){return new Bu(pee,t,e)}function gee(e){return new Bu(bG,void 0,e)}const u_=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||fee&&s_.Headers&&e instanceof s_.Headers?t=aee(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):t=e),t},PG=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),yee=e=>{if(!Array.isArray(e.query)){const n=e,i=[`query=${encodeURIComponent(PG(n.query))}`];return e.variables&&i.push(`variables=${encodeURIComponent(n.jsonSerializer.stringify(n.variables))}`),n.operationName&&i.push(`operationName=${encodeURIComponent(n.operationName)}`),i.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce((n,i,a)=>(n.push({query:PG(i),variables:t.variables?t.jsonSerializer.stringify(t.variables[a]):void 0}),n),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`},Ree=e=>async t=>{const{url:r,query:n,variables:i,operationName:a,fetch:u,fetchOptions:c,middleware:E}=t,_={...t.headers};let p="",L;e==="POST"?(L=bee(n,i,a,c.jsonSerializer),typeof L=="string"&&(_["Content-Type"]="application/json")):p=yee({query:n,variables:i,operationName:a,jsonSerializer:c.jsonSerializer??dP});const W={method:e,headers:_,body:L,...c};let ve=r,me=W;if(E){const Oe=await Promise.resolve(E({...W,url:r,operationName:a,variables:i})),{url:He,...qe}=Oe;ve=He,me=qe}return p&&(ve=`${ve}?${p}`),await u(ve,me)};class jm{constructor(t,r={}){this.url=t,this.requestConfig=r,this.rawRequest=async(...n)=>{const[i,a,u]=n,c=see(i,a,u),{headers:E,fetch:_=s_,method:p="POST",requestMiddleware:L,responseMiddleware:W,...ve}=this.requestConfig,{url:me}=this;c.signal!==void 0&&(ve.signal=c.signal);const{operationName:Oe}=km(c.query);return pP({url:me,query:c.query,variables:c.variables,headers:{...u_(hP(E)),...u_(c.requestHeaders)},operationName:Oe,fetch:_,method:p,fetchOptions:ve,middleware:L}).then(He=>(W&&W(He),He)).catch(He=>{throw W&&W(He),He})}}async request(t,...r){const[n,i]=r,a=oee(t,n,i),{headers:u,fetch:c=s_,method:E="POST",requestMiddleware:_,responseMiddleware:p,...L}=this.requestConfig,{url:W}=this;a.signal!==void 0&&(L.signal=a.signal);const{query:ve,operationName:me}=km(a.document);return pP({url:W,query:ve,variables:a.variables,headers:{...u_(hP(u)),...u_(a.requestHeaders)},operationName:me,fetch:c,method:E,fetchOptions:L,middleware:_}).then(Oe=>(p&&p(Oe),Oe.data)).catch(Oe=>{throw p&&p(Oe),Oe})}batchRequests(t,r){const n=uee(t,r),{headers:i,...a}=this.requestConfig;n.signal!==void 0&&(a.signal=n.signal);const u=n.documents.map(({document:E})=>km(E).query),c=n.documents.map(({variables:E})=>E);return pP({url:this.url,query:u,variables:c,headers:{...u_(hP(i)),...u_(n.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??s_,method:this.requestConfig.method||"POST",fetchOptions:a,middleware:this.requestConfig.requestMiddleware}).then(E=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(E),E.data)).catch(E=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(E),E})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){const{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}}const pP=async e=>{const{query:t,variables:r,fetchOptions:n}=e,i=Ree(iee(e.method??"post")),a=Array.isArray(e.query),u=await i(e),c=await Cee(u,n.jsonSerializer??dP),E=Array.isArray(c)?!c.some(({data:p})=>!p):Boolean(c.data),_=Array.isArray(c)||!c.errors||Array.isArray(c.errors)&&!c.errors.length||n.errorPolicy==="all"||n.errorPolicy==="ignore";if(u.ok&&_&&E){const{errors:p,...L}=(Array.isArray(c),c),W=n.errorPolicy==="ignore"?L:c;return{...a?{data:W}:W,headers:u.headers,status:u.status}}else{const p=typeof c=="string"?{error:c}:c;throw new Gu({...p,status:u.status,headers:u.headers},{query:t,variables:r})}},RUe=async(...e)=>{const[t,r,...n]=e,i=parseRawRequestExtendedArgs(t,r,...n);return new jm(i.url).rawRequest({...i})};async function OUe(e,t,...r){const n=parseRequestExtendedArgs(e,t,...r);return new jm(n.url).request({...n})}const bUe=async(...e)=>{const t=Oee(e);return new jm(t.url).batchRequests(t)},Oee=e=>e.length===1?e[0]:{url:e[0],documents:e[1],requestHeaders:e[2],signal:void 0},bee=(e,t,r,n)=>{const i=n??dP;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const a=e.reduce((u,c,E)=>(u.push({query:c,variables:t?t[E]:void 0}),u),[]);return i.stringify(a)},Cee=async(e,t)=>{let r;return e.headers.forEach((n,i)=>{i.toLowerCase()==="content-type"&&(r=n)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},hP=e=>typeof e=="function"?e():e,CUe=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,""),PUe=null,Ni=`
5344
+ `));function hwe(e){const t=Object.assign(Object.assign({},el),e);return Apollo.useQuery(k$,t)}function Swe(e){const t=Object.assign(Object.assign({},el),e);return Apollo.useLazyQuery(k$,t)}const Ewe=e=>useMutation(CreateOauthThirdPartyConnection,e),vwe=e=>useMutation(DisconnectUserToken,e),mwe=e=>useMutation(CreateConnectionStatus,e),Twe=e=>useQuery(GetMemberConnections,e),Awe=e=>useQuery(GetConnections,e),gwe=e=>useQuery(GetConnection,e),ywe=e=>useLazyQuery(GetConnection,e),Rwe=e=>useQuery(GetOauthGeneratedUrl,e);var j$=h(46),Hp,Sm;class H${constructor(){this.type="backend",Hp.set(this,void 0),Sm.set(this,void 0)}init(t,{clientSlug:r,apiClient:n}){if(!n)throw t.logger.error('"apiClient" not supplied to "QueryBackend".'),new Error('"apiClient" required for "QueryBackend".');wu(this,Hp,r,"f"),wu(this,Sm,fU(n),"f")}read(t,r,n){return om(this,void 0,void 0,function*(){try{const{translation:i}=yield Jr(this,Sm,"f").getClientTranslations({name:Jr(this,Hp,"f"),key:r,lang:t});n(null,i?.json||{})}catch{const a=`Error fetching translation with key "${r}" and client "${Jr(this,Hp,"f")||"N/A"}".`;n(a,null)}})}}Hp=new WeakMap,Sm=new WeakMap,H$.type="backend";var Xf;class Y${constructor(t){this.type="logger",Xf.set(this,void 0),wu(this,Xf,t,"f")}log([t,r,...n]){Jr(this,Xf,"f").info({meta:r},t,...n)}warn([t,r,...n]){Jr(this,Xf,"f").error({meta:r},t,...n)}error([t,r,...n]){Jr(this,Xf,"f").error({meta:r},t,...n)}}Xf=new WeakMap,Y$.type="logger";var Em,vm,tl,Yp,Ii,rl;const q$="appLanguage";class Pa{constructor({keys:t,nativeBridge:r,fallbackKeys:n=[],defaultLanguage:i="en",logger:a,parent:u,debug:c=!1,remoteConfig:E={}}){tl.set(this,void 0),Yp.set(this,void 0),Ii.set(this,void 0),rl.set(this,void 0),wu(this,tl,t,"f"),wu(this,Yp,n,"f"),wu(this,rl,r,"f");const _={lng:i,fallbackNS:Jr(this,Yp,"f"),debug:c,defaultNS:t,returnNull:!1};u?wu(this,Ii,u.cloneInstance(_),"f"):(wu(this,Ii,ea.createInstance(),"f"),a&&Jr(this,Ii,"f").use(new Y$(a.child({library:"@icanbwell/i18n"}))),E.apiClient&&Jr(this,Ii,"f").use(H$),Jr(this,Ii,"f").init(Object.assign(Object.assign({},_),{fallbackLng:!1,partialBundledLanguages:!0,ns:[],resources:{},backend:E,saveMissing:!0,missingKeyHandler:(p,L,W)=>Jr(this,Ii,"f").services.logger.error(`missing key: ${W}; language: ${p}; key: ${L}`)}))),this.t=Jr(this,Ii,"f").t,Pa.resolvedLanguage=Jr(this,Ii,"f").resolvedLanguage||i}load(){var t;return om(this,void 0,void 0,function*(){const r=(yield(t=Jr(this,rl,"f"))===null||t===void 0?void 0:t.storage.getItem(q$))||Pa.resolvedLanguage;r!==Pa.resolvedLanguage&&(yield Jr(this,Ii,"f").changeLanguage(r),Pa.resolvedLanguage=r),yield Jr(this,Ii,"f").loadNamespaces(Jr(this,tl,"f"));const n=Jr(this,tl,"f").filter(i=>!Jr(this,Ii,"f").hasResourceBundle(r,i));if(n.length)throw new Error(`Error loading translations for key(s): ${n.join(", ")}`);return Jr(Pa,Em,"f",vm).emit("changeLanguage",r),this})}child(t){return new Pa(Object.assign(Object.assign({},t),{nativeBridge:Jr(this,rl,"f"),fallbackKeys:[...Jr(this,Yp,"f"),...Jr(this,tl,"f")],parent:Jr(this,Ii,"f"),defaultLanguage:Jr(this,Ii,"f").language}))}get isLoaded(){return Jr(this,tl,"f").every(t=>Jr(this,Ii,"f").hasResourceBundle(Jr(this,Ii,"f").language,t))}changeLanguage(t){var r;return om(this,void 0,void 0,function*(){Pa.resolvedLanguage=t,yield Jr(this,Ii,"f").changeLanguage(t),Jr(Pa,Em,"f",vm).emit("changeLanguage",t),yield(r=Jr(this,rl,"f"))===null||r===void 0?void 0:r.storage.setItem(q$,t),Jr(this,rl,"f").reloadView()})}get resolvedLanguage(){return Pa.resolvedLanguage}onChangeLanguage(t){Jr(Pa,Em,"f",vm).on("changeLanguage",t)}}Em=Pa,tl=new WeakMap,Yp=new WeakMap,Ii=new WeakMap,rl=new WeakMap,vm={value:new j$},Pa.resolvedLanguage="en";var NC=h(1827),qp;(function(e){e.one="1.0.0"})(qp||(qp={}));const mm="orchestrator:native-bridge",E9={id:mm,dependencies:{featureServices:{}},create:()=>({[qp.one]:()=>({featureService:NC.b})})};var Kp;(function(e){e.one="1.0.0"})(Kp||(Kp={}));const Tm="orchestrator:translation-service",v9={id:Tm,dependencies:{featureServices:{[za]:Nr.one,[ks]:Mu.one,[Wn]:vi.one,[Mp]:kf.one,[mm]:qp.one}},create:({featureServices:e})=>{const t=e[za],r=e[ks],n=e[Mp],{slug:i}=e[Wn].getClientContext(),a=e[mm],u=new Pa({keys:[],nativeBridge:a,defaultLanguage:"en",logger:r,remoteConfig:{clientSlug:i,apiClient:t}});return n.setProfileProperties({language:u.resolvedLanguage}),u.onChangeLanguage(c=>n.setProfileProperties({language:c})),{[Kp.one]:()=>({featureService:u})}}};var Jf,Zf,Am,nl;const gm="tokens";class m9{constructor({apiClient:t,stateService:r,identityGatewaySdk:n,storage:i}){Jf.set(this,void 0),Zf.set(this,void 0),Am.set(this,void 0),nl.set(this,void 0),(0,F.GG)(this,Jf,t,"f"),(0,F.GG)(this,Zf,r,"f"),(0,F.GG)(this,Am,n,"f"),(0,F.GG)(this,nl,i,"f")}getStoredTokens(){const t=(0,F.gn)(this,nl,"f").getItem(gm);return t?JSON.parse(t):void 0}removeStoredTokens(){(0,F.gn)(this,nl,"f").removeItem(gm)}storeTokens(t){(0,F.gn)(this,nl,"f").setItem(gm,JSON.stringify(t))}logout(){return(0,F.sH)(this,void 0,void 0,function*(){const t=(0,F.gn)(this,Zf,"f").getUserTokenData().accessToken.jwtToken,{key:r,variant:n}=(0,F.gn)(this,Zf,"f").getClientContext();n!==te.GUEST&&(yield(0,F.gn)(this,Am,"f").logout({accessToken:t},{context:{headers:{clientKey:r}}})),(0,F.gn)(this,Jf,"f").stop(),(0,F.gn)(this,Jf,"f").clearAuth(),yield(0,F.gn)(this,Jf,"f").clearStore(),(0,F.gn)(this,Zf,"f").logoutUser(),(0,F.gn)(this,nl,"f").removeItem(gm)})}}Jf=new WeakMap,Zf=new WeakMap,Am=new WeakMap,nl=new WeakMap;var ym;(function(e){e.one="1.0.0"})(ym||(ym={}));const K$="orchestrator:identity-utils",T9={id:K$,dependencies:{featureServices:{[za]:Nr.one,[ks]:Mu.one,[Wn]:vi.one,[Mp]:kf.one}},create:({featureServices:e})=>{const t=e[za];return{[ym.one]:()=>({featureService:new m9({apiClient:t,stateService:e[Wn],identityGatewaySdk:mx(t),storage:window.sessionStorage})})}}};var Rm;(function(e){e.one="1.0.0"})(Rm||(Rm={}));const W$="orchestrator:globaleventemitter-service",A9=e=>({id:W$,create:()=>({[Rm.one]:()=>({featureService:e})})});var Om;(function(e){e.one="1.0.0"})(Om||(Om={}));const Q$="orchestrator:reboot-controller",g9=e=>({id:Q$,create:()=>({[Om.one]:()=>({featureService:e})})});class ki extends Error{constructor(t,r){super(t),this.name="BWellError",r?.cause&&(this.cause=r.cause)}static isBwellError(t){return t instanceof ki}}class Owe extends ki{constructor(t="Authentication Error"){super(t),this.name="AuthenticationError"}}class bwe extends ki{constructor(t="Illegal Argument Error"){super(t),this.name="IllegalArgumentError"}}class Cwe extends ki{constructor(t="Illegal State Error"){super(t),this.name="IllegalStateError"}}class y9 extends ki{constructor(t="Invalid Client Key Error"){super(t),this.name="InvalidClientKeyError"}}class LC extends ki{constructor(t,r){super(t),this.credentials=r,this.name="InvalidCredentialsTypeError"}}class e_ extends ki{constructor(t="Invalid Token Error"){super(t),this.name="InvalidTokenError"}}class R9 extends ki{constructor(t,r){super(t),this.status=r,this.name="NetworkError"}}class O9 extends ki{constructor(t){super(t.message()),this.operationOutcome=t,this.name="OperationOutcomeError"}}class DC extends ki{constructor(t,r){super(t),this.data=r,this.name="UnknownError"}}class b9 extends ki{constructor(t){super(t.join(". ")),this.errors=t,this.name="ValidationError"}}class tr{constructor(t,r){this.data=t,r!==null&&(this.error=r)}hasError(){return this.error!==void 0}static error(t){return new tr(void 0,t)}}var z$=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},bm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Wp,Qp;class Kt{static success(t){return new C9(t)}static failure(t){return new Cm(t)}}class C9 extends Kt{constructor(t){super(),Wp.set(this,void 0),z$(this,Wp,t,"f")}data(){return bm(this,Wp,"f")}error(){throw bm(this,Wp,"f")}success(){return!0}failure(){return!1}toQueryResult(){return new tr(this.data())}}Wp=new WeakMap;class Cm extends Kt{constructor(t){super(),Qp.set(this,void 0),z$(this,Qp,t,"f")}data(){throw bm(this,Qp,"f")}error(){return bm(this,Qp,"f")}success(){return!1}failure(){return!0}intoFailure(){return Kt.failure(this.error())}toQueryResult(){return new tr(void 0,this.error())}}Qp=new WeakMap;var wC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zp;class P9{constructor(){zp.set(this,[])}add(t){wC(this,zp,"f").push(t)}errors(){return wC(this,zp,"f")}hasErrors(){return wC(this,zp,"f").length>0}}zp=new WeakMap;var X$=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},UC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Xp,Pm;class M9{constructor(t){Xp.set(this,void 0),Pm.set(this,void 0),X$(this,Pm,t,"f"),X$(this,Xp,this.transformInput(t),"f")}validate(){return Kt.success(null)}data(){return UC(this,Xp,"f")}toJSON(){return UC(this,Xp,"f")}transformInput(t){return t}input(){return UC(this,Pm,"f")}}Xp=new WeakMap,Pm=new WeakMap;class sa extends M9{validate(){const t=new P9;return this.validator.validate(this.input(),t),t.hasErrors()?Kt.failure(new b9(t.errors())):Kt.success(null)}}var J$=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Mm,Z$,eV;const tV=100,I9=20;class Ys{constructor(){Mm.add(this)}validate(t,r){J$(this,Mm,"m",Z$).call(this,t.page,r),J$(this,Mm,"m",eV).call(this,t.pageSize,r)}}Mm=new WeakSet,Z$=function(t,r){t<0&&r.add("page must be a positive number")},eV=function(t,r){t!==void 0&&(t<=0&&r.add("Page size must be greater than 0"),t>tV&&r.add(`Page size must not exceed ${tV}`))};class qs extends sa{constructor(){super(...arguments),this.validator=new Ys}transformInput(t){return Object.assign({pageSize:I9},t)}}function N9(){var e;return!(typeof process>"u"||((e=process.versions)===null||e===void 0?void 0:e.node)===void 0)}function L9(){return typeof window<"u"}function rV(){if(L9())return"browser";if(N9())return"node";throw new Error("Invalid runtime")}function D9(e){switch(rV()){case"browser":return e.browser();case"node":return e.node()}}function nV(e){switch(rV()){case"node":return Buffer.from(e,"base64").toString("utf-8");case"browser":return atob(e)}}function Fn(e){return e!=null}function Fo(e){return e==null}function Pwe(e){return Fn(e)&&e!==""}function Ks(e){return e==null||e===""}function ka(e){return e===void 0}function ji(e){return e!==void 0}function w9(e){return JSON.parse(nV(e)).env}const U9=3;function iV(e){const t=e.split("."),r=t[1];if(r===void 0||t.length!==U9)throw new e_("Token is missing data and may be corrupted");try{return JSON.parse(nV(r))}catch(n){const i=n;throw new e_(`Unable to parse token payload: ${i.name} - ${i.message}`)}}function x9(e){const r=iV(e).exp;if(typeof r!="number")throw new e_("The access token is missing an expiration date and is most likely corrupted.");return r*1e3}const F9="custom:clientFhirPersonId",$9="custom:bwellFhirPatientId";function V9(e){const t=iV(e),r=t[$9],n=t[F9];return Fn(r)&&Fn(n)?{bwellFhirPersonId:r,clientFhirPersonId:n}:null}function $o(e){return e.trim()===""}const G9="1.37.0";function B9(){return G9}var xC;(function(e){e.Arrived="ARRIVED",e.Booked="BOOKED",e.Cancelled="CANCELLED",e.CheckedIn="CHECKED_IN",e.EnteredInError="ENTERED_IN_ERROR",e.Fulfilled="FULFILLED",e.Noshow="NOSHOW",e.Pending="PENDING",e.Proposed="PROPOSED",e.Waitlist="WAITLIST"})(xC||(xC={}));var aV;(function(e){e.Guest="GUEST"})(aV||(aV={}));var Im;(function(e){e.CommunicationPreferencesPhi="COMMUNICATION_PREFERENCES_PHI",e.DataSharing="DATA_SHARING",e.HealthCircleAdolescent="HEALTH_CIRCLE_ADOLESCENT",e.HealthCircleMinor="HEALTH_CIRCLE_MINOR",e.HealthMatch="HEALTH_MATCH",e.IasImportRecords="IAS_IMPORT_RECORDS",e.MobileCommunicationPreferences="MOBILE_COMMUNICATION_PREFERENCES",e.PersonalizedHealthOffersAndAds="PERSONALIZED_HEALTH_OFFERS_AND_ADS",e.ProaAttestation="PROA_ATTESTATION",e.Tos="TOS"})(Im||(Im={}));var oV;(function(e){e.Bwell="bwell"})(oV||(oV={}));var sV;(function(e){e.Bwell="BWELL"})(sV||(sV={}));var uV;(function(e){e.Basic="BASIC",e.Oauth="OAUTH"})(uV||(uV={}));var FC;(function(e){e.Deny="DENY",e.Permit="PERMIT"})(FC||(FC={}));var $C;(function(e){e.Active="ACTIVE",e.Draft="DRAFT",e.EnteredInError="ENTERED_IN_ERROR",e.Inactive="INACTIVE",e.Proposed="PROPOSED",e.Rejected="REJECTED"})($C||($C={}));var cV;(function(e){e.Home="home",e.Mobile="mobile",e.Work="work"})(cV||(cV={}));var lV;(function(e){e.Usd="USD"})(lV||(lV={}));var fV;(function(e){e.Connected="CONNECTED",e.Deleted="DELETED",e.Disconnected="DISCONNECTED",e.Error="ERROR",e.Expired="EXPIRED"})(fV||(fV={}));var _V;(function(e){e.Clinical="CLINICAL",e.Insurance="INSURANCE",e.Lab="LAB",e.Pharmacy="PHARMACY",e.Practitioner="PRACTITIONER"})(_V||(_V={}));var Nm;(function(e){e.Connecthub="connecthub",e.Nppes="nppes"})(Nm||(Nm={}));var dV;(function(e){e.Connecthub="CONNECTHUB",e.Nppes="NPPES"})(dV||(dV={}));var pV;(function(e){e.BwellPatient="BWELL_PATIENT",e.BwellPerson="BWELL_PERSON",e.ClientPatient="CLIENT_PATIENT",e.ClientPerson="CLIENT_PERSON"})(pV||(pV={}));var hV;(function(e){e.Active="active",e.EnteredInError="entered_in_error",e.Error="error",e.Off="off",e.Suspended="suspended",e.Test="test"})(hV||(hV={}));var SV;(function(e){e.Active="ACTIVE",e.EnteredInError="ENTERED_IN_ERROR",e.Error="ERROR",e.Off="OFF",e.Suspended="SUSPENDED",e.Test="TEST"})(SV||(SV={}));var VC;(function(e){e.CustomEvent="CUSTOM_EVENT",e.MobilePushOpen="MOBILE_PUSH_OPEN"})(VC||(VC={}));var GC;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(GC||(GC={}));var BC;(function(e){e.Person="Person"})(BC||(BC={}));var kC;(function(e){e.Characteristic="characteristic",e.Communication="communication",e.Gender="gender",e.Specialty="specialty"})(kC||(kC={}));var EV;(function(e){e.Characteristic="CHARACTERISTIC",e.Communication="COMMUNICATION",e.Gender="GENDER",e.Specialty="SPECIALTY"})(EV||(EV={}));var vV;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(vV||(vV={}));var mV;(function(e){e.Female="FEMALE",e.Male="MALE",e.Other="OTHER",e.Unknown="UNKNOWN"})(mV||(mV={}));var TV;(function(e){e.Female="female",e.Male="male",e.Other="other",e.Unknown="unknown"})(TV||(TV={}));var AV;(function(e){e.AllergyIntolerance="ALLERGY_INTOLERANCE",e.CarePlan="CARE_PLAN",e.Condition="CONDITION",e.Encounter="ENCOUNTER",e.Immunization="IMMUNIZATION",e.Labs="LABS",e.Medications="MEDICATIONS",e.Procedure="PROCEDURE",e.VitalSigns="VITAL_SIGNS"})(AV||(AV={}));var gV;(function(e){e.Official="_official",e.Old="_old",e.Secondary="_secondary",e.Temp="_temp",e.Usual="_usual"})(gV||(gV={}));var yV;(function(e){e.Clicked="clicked"})(yV||(yV={}));var RV;(function(e){e.Clicked="CLICKED"})(RV||(RV={}));var jC;(function(e){e.Debug="DEBUG",e.Error="ERROR",e.Info="INFO",e.Verbose="VERBOSE",e.Warn="WARN"})(jC||(jC={}));var OV;(function(e){e.Activity="ACTIVITY",e.Exam="EXAM",e.Imaging="IMAGING",e.Laboratory="LABORATORY",e.Procedure="PROCEDURE",e.SocialHistory="SOCIAL_HISTORY",e.Survey="SURVEY",e.Therapy="THERAPY",e.VitalSigns="VITAL_SIGNS"})(OV||(OV={}));var bV;(function(e){e.CancelDelete="CANCEL_DELETE",e.ConfirmDelete="CONFIRM_DELETE",e.DeletionInProgress="DELETION_IN_PROGRESS",e.ImmediateExecution="IMMEDIATE_EXECUTION",e.RequestDelete="REQUEST_DELETE"})(bV||(bV={}));var HC;(function(e){e.C19Vaccine="C19Vaccine",e.Device="Device",e.Insurance="Insurance",e.Laboratory="Laboratory",e.Pharmacy="Pharmacy",e.Provider="Provider",e.Bus="bus",e.Cg="cg",e.Crs="crs",e.Dept="dept",e.Edu="edu",e.Govt="govt",e.Ins="ins",e.Other="other",e.Pay="pay",e.Prov="prov",e.Reli="reli",e.Team="team"})(HC||(HC={}));var CV;(function(e){e.Bus="BUS",e.C19Vaccine="C19VACCINE",e.Cg="CG",e.Crs="CRS",e.Dept="DEPT",e.Device="DEVICE",e.Edu="EDU",e.Govt="GOVT",e.Ins="INS",e.Insurance="INSURANCE",e.Laboratory="LABORATORY",e.Other="OTHER",e.Pay="PAY",e.Pharmacy="PHARMACY",e.Prov="PROV",e.Provider="PROVIDER",e.Reli="RELI",e.Team="TEAM"})(CV||(CV={}));var PV;(function(e){e.Add="add",e.Copy="copy",e.Move="move",e.Remove="remove",e.Replace="replace",e.Test="test"})(PV||(PV={}));var MV;(function(e){e.Patient="Patient",e.Person="Person"})(MV||(MV={}));var IV;(function(e){e.Practice="practice",e.Practitioner="practitioner"})(IV||(IV={}));var NV;(function(e){e.Practice="PRACTICE",e.Practitioner="PRACTITIONER"})(NV||(NV={}));var LV;(function(e){e.QuestionnaireResponse="QuestionnaireResponse"})(LV||(LV={}));var DV;(function(e){e.AllergyIntolerance="ALLERGY_INTOLERANCE",e.CarePlan="CARE_PLAN",e.Condition="CONDITION",e.Encounter="ENCOUNTER",e.Immunization="IMMUNIZATION",e.MedicationDispense="MEDICATION_DISPENSE",e.MedicationRequest="MEDICATION_REQUEST",e.MedicationStatement="MEDICATION_STATEMENT",e.Observation="OBSERVATION",e.Procedure="PROCEDURE"})(DV||(DV={}));var wV;(function(e){e.Insurance="INSURANCE",e.Laboratory="LABORATORY",e.Pharmacy="PHARMACY",e.Practice="PRACTICE",e.Practitioner="PRACTITIONER"})(wV||(wV={}));var YC;(function(e){e.Content="content",e.Distance="distance",e.Relevance="relevance"})(YC||(YC={}));var UV;(function(e){e.Content="CONTENT",e.DataSourceRank="DATA_SOURCE_RANK",e.Distance="DISTANCE",e.Relevance="RELEVANCE"})(UV||(UV={}));var qC;(function(e){e.Asc="asc",e.Desc="desc"})(qC||(qC={}));var xV;(function(e){e.Asc="ASC",e.Desc="DESC"})(xV||(xV={}));var FV;(function(e){e.CareSearch="CARE_SEARCH",e.Proa="PROA",e.ProviderDetails="PROVIDER_DETAILS",e.Sayt="SAYT",e.Unspecified="UNSPECIFIED"})(FV||(FV={}));var $V;(function(e){e.Error="ERROR",e.Pending="PENDING",e.Retrieved="RETRIEVED",e.Retrieving="RETRIEVING"})($V||($V={}));var KC;(function(e){e.Accepted="ACCEPTED",e.Cancelled="CANCELLED",e.Completed="COMPLETED",e.Draft="DRAFT",e.EnteredInError="ENTERED_IN_ERROR",e.Failed="FAILED",e.InProgress="IN_PROGRESS",e.OnHold="ON_HOLD",e.Ready="READY",e.Received="RECEIVED",e.Rejected="REJECTED",e.Requested="REQUESTED"})(KC||(KC={}));var VV;(function(e){e.Accurate="accurate",e.Estimate="estimate"})(VV||(VV={}));const k9=new Set(Object.values(GC));function GV(e){return k9.has(e)}const j9=new Set(Object.values($C));function H9(e){return j9.has(e)}const Y9=new Set(Object.values(Im));function BV(e){return Y9.has(e)}const q9=new Set(Object.values(FC));function K9(e){return q9.has(e)}class W9{validate(t,r){!ka(t.gender)&&!GV(t.gender)&&r.add(`Invalid gender value: "${t.gender}"`)}}class Mwe extends sa{constructor(){super(...arguments),this.validator=new W9}}class Q9{validate(t,r){BV(t.category)||r.add(`Invalid consent category code: "${t.category}"`)}}class Iwe extends sa{constructor(){super(...arguments),this.validator=new Q9}}class z9{validate(t,r){H9(t.status)||r.add(`Invalid consent status: "${t.status}"`),K9(t.provision)||r.add(`Invalid consent provision type: "${t.provision}"`),BV(t.category)||r.add(`Invalid consent category code: "${t.category}"`),!ka(t.organizationId)&&$o(t.organizationId)&&r.add("organizationId cannot be empty"),t.category===Im.ProaAttestation&&ka(t.organizationId)&&r.add("organizationId must be provided when category is PROA_ATTESTATION")}}class Nwe extends sa{constructor(){super(...arguments),this.validator=new z9}}class X9{validate(t,r){Ks(t.exportId)&&r.add("exportId is required"),Ks(t.password)&&r.add("password is required")}}class Lwe extends sa{constructor(){super(...arguments),this.validator=new X9}}class Dwe extends null{}var ja=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},ua,xu,kV,jV,HV,YV,qV,KV;class WC{constructor(){ua.add(this)}validate(t,r){if(!t.values||t.values.length===0){r.add("At least one SearchDateValue must be set to instantiate a SearchDate");return}for(const n of t.values)ja(this,ua,"m",kV).call(this,n,r)}}ua=new WeakSet,xu=function(t,r){t&&t!==null&&isNaN(t.getTime())&&r.add("The date is not valid")},kV=function(t,r){const{equals:n,notEquals:i,greaterThan:a,greaterThanOrEqualTo:u,lessThan:c,lessThanOrEqualTo:E,approximately:_}=t,L=[n,i,a,u,c,E,_].filter(W=>W!=null).length;if(L===0){r.add("At least one SearchDateValue must be set to instantiate a SearchDate");return}ja(this,ua,"m",jV).call(this,t,L,r),ja(this,ua,"m",qV).call(this,t,r),ja(this,ua,"m",KV).call(this,t,r)},jV=function(t,r,n){const{equals:i,notEquals:a,approximately:u}=t;if(i&&r>1){n.add("The equals value cannot be set with any other values");return}if(a&&r>1){n.add("The notEquals value cannot be set with any other values");return}if(u&&r>1){n.add("The approximately value cannot be set with any other values");return}ja(this,ua,"m",HV).call(this,t,n),ja(this,ua,"m",YV).call(this,t,n)},HV=function(t,r){t.greaterThan&&t.greaterThanOrEqualTo&&r.add("The greaterThan/greaterThanOrEqualTo value cannot be set with both values")},YV=function(t,r){t.lessThan&&t.lessThanOrEqualTo&&r.add("The lessThan/lessThanOrEqualTo value cannot be set with both values")},qV=function(t,r){const{equals:n,notEquals:i,greaterThan:a,greaterThanOrEqualTo:u,lessThan:c,lessThanOrEqualTo:E,approximately:_}=t;n&&ja(this,ua,"m",xu).call(this,n,r),i&&ja(this,ua,"m",xu).call(this,i,r),a&&ja(this,ua,"m",xu).call(this,a,r),u&&ja(this,ua,"m",xu).call(this,u,r),c&&ja(this,ua,"m",xu).call(this,c,r),E&&ja(this,ua,"m",xu).call(this,E,r),_&&ja(this,ua,"m",xu).call(this,_,r)},KV=function(t,r){const{greaterThan:n,greaterThanOrEqualTo:i,lessThan:a,lessThanOrEqualTo:u}=t;n&&u&&n>=u&&r.add("The greaterThan value must be less than the lessThanOrEqualTo value"),i&&a&&i>=a&&r.add("The greaterThanOrEqualTo value must be less than the lessThan value"),n&&a&&n>=a&&r.add("The greaterThan value must be less than the lessThan value"),i&&u&&i>=u&&r.add("The greaterThanOrEqualTo value must be less than the lessThanOrEqualTo value")};var QC=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Jp;class Lm{constructor(){Jp.set(this,new J9)}validate(t,r){var n;if(t.value===void 0&&t.values===void 0&&t.notEquals===void 0){r.add("Either SearchToken value or values or notEquals must be provided");return}if(t.value!==void 0&&QC(this,Jp,"f").validate(t.value,r),t.values!==void 0&&t.values.length===0){r.add("At least one Coding must be set to instantiate a SearchToken");return}for(const i of(n=t.values)!==null&&n!==void 0?n:[])QC(this,Jp,"f").validate(i,r);if(t.notEquals!==void 0){if(t.notEquals.values!==void 0){if(t.notEquals.values.length===0){r.add("If notEquals values are provided, at least one Coding must be set");return}for(const i of t.notEquals.values)QC(this,Jp,"f").validate(i,r)}t.notEquals.code===void 0&&t.notEquals.value===void 0&&t.notEquals.system===void 0&&t.notEquals.values===void 0&&r.add("NotEquals must have at least one non-null property (code, value, system, or values)")}}}Jp=new WeakMap;class J9{validate(t,r){!t.system&&!t.code&&r.add("Each Coding in the list must have at least one non-null and non-empty value for system or code")}}var t_=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zC,XC,JC,ZC,eP,tP;class WV extends Ys{constructor(){super(...arguments),zC.set(this,new Lm),XC.set(this,new WC)}validate(t,r){super.validate(t,r),t.groupCode&&t_(this,zC,"f").validate(t.groupCode,r),t.lastUpdated&&t_(this,XC,"f").validate(t.lastUpdated,r)}}zC=new WeakMap,XC=new WeakMap;class Z9{validate(t,r){t.length===0&&r.add("Prescription array must not be empty.")}}class QV extends Ys{constructor(){super(...arguments),JC.set(this,new Z9),ZC.set(this,new WC)}validate(t,r){super.validate(t,r),t.lastUpdated!==void 0&&t_(this,ZC,"f").validate(t.lastUpdated,r),t.prescription!==void 0&&t_(this,JC,"f").validate(t.prescription,r)}}JC=new WeakMap,ZC=new WeakMap;class eZ extends Ys{validate(t,r){var n;super.validate(t,r),!((n=t?.ids)===null||n===void 0)&&n.length||r.add("ids must not be empty")}}class tZ extends qs{constructor(){super(...arguments),this.validator=new WV}}class wwe extends null{}class Uwe extends null{}class xwe extends null{}class Fwe extends null{}class $we extends null{}class Vwe extends null{}class Gwe extends null{}class Bwe extends null{}class kwe extends null{}class jwe extends null{}class Hwe extends null{}class Ywe extends null{}class qwe extends null{}class Kwe extends null{}class Wwe extends null{}class Qwe extends null{}class zwe extends null{}class Xwe extends null{}class Jwe extends null{}class rZ extends QV{constructor(){super(...arguments),eP.set(this,new Lm)}validate(t,r){super.validate(t,r),t.medicationCode!==void 0&&t_(this,eP,"f").validate(t.medicationCode,r)}}eP=new WeakMap;class Zwe extends qs{constructor(){super(...arguments),this.validator=new QV}}class eUe extends qs{constructor(){super(...arguments),this.validator=new rZ}}class nZ extends WV{constructor(){super(...arguments),tP.set(this,new Lm)}validate(t,r){super.validate(t,r),t.medicationCode!==void 0&&t_(this,tP,"f").validate(t.medicationCode,r)}}tP=new WeakMap;class tUe extends tZ{constructor(){super(...arguments),this.validator=new nZ}}class rUe extends null{}class nUe extends qs{constructor(){super(...arguments),this.validator=new eZ}}class iUe extends null{}class iZ{validate(t,r){$o(t.medicationStatementId)&&r.add("The medication pricing request must possess a medication statement id.")}}class aUe extends sa{constructor(){super(...arguments),this.validator=new iZ}}class aZ extends Ys{validate(t,r){$o(t.medicationStatementId)&&r.add("The medication knowledge request must possess a medication statement id."),super.validate(t,r)}}class oUe extends qs{constructor(){super(...arguments),this.validator=new aZ}}class oZ extends Ys{validate(t,r){$o(t.labId)&&r.add("The lab knowledge request must contain a lab id."),super.validate(t,r)}}class sUe extends qs{constructor(){super(...arguments),this.validator=new oZ}}const sZ=new Set(Object.values(KC));function zV(e){return sZ.has(e)}var uZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},rP,XV;class cZ extends Ys{constructor(){super(...arguments),rP.add(this)}validate(t,r){if(super.validate(t,r),!ka(t.status)){const n=Array.isArray(t.status)?t.status:[t.status];for(const i of n)uZ(this,rP,"m",XV).call(this,i,r)}}}rP=new WeakSet,XV=function(t,r){zV(t)||r.add(`Invalid task status: "${t}"`)};class uUe extends qs{constructor(){super(...arguments),this.validator=new cZ}}class lZ{validate(t,r){zV(t.newStatus)||r.add(`Invalid task status: "${t.newStatus}"`)}}class cUe extends sa{constructor(){super(...arguments),this.validator=new lZ}}var Dm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},r_,JV,ZV,eG,tG;class lUe extends qs{constructor(){super(...arguments),this.validator=new fZ}}class fZ extends Ys{constructor(){super(...arguments),r_.add(this)}validate(t,r){super.validate(t,r),ji(t.organizationTypeFilters)&&Dm(this,r_,"m",JV).call(this,t.organizationTypeFilters,r),ji(t.sortBy)&&Dm(this,r_,"m",ZV).call(this,t.sortBy,r),ji(t.filterFields)&&Dm(this,r_,"m",eG).call(this,t.filterFields,r),ji(t.gender)&&Dm(this,r_,"m",tG).call(this,t.gender,r)}}r_=new WeakSet,JV=function(t,r){for(const n of t)dZ(n)||r.add(`Invalid organizationTypeFilters value: "${n}"`)},ZV=function(t,r){ji(t.field)&&!hZ(t.field)&&r.add(`Invalid sortBy.field value: "${t.field}"`),ji(t.order)&&!EZ(t.order)&&r.add(`Invalid sortBy.order value: "${t.order}"`)},eG=function(t,r){for(const n of t)mZ(n)||r.add(`Invalid filterField value: "${n}"`)},tG=function(t,r){GV(t)||r.add(`Invalid gender value: "${t}"`)};const _Z=new Set(Object.values(HC));function dZ(e){return _Z.has(e)}const pZ=new Set(Object.values(YC));function hZ(e){return pZ.has(e)}const SZ=new Set(Object.values(qC));function EZ(e){return SZ.has(e)}const vZ=new Set(Object.values(kC));function mZ(e){return vZ.has(e)}class fUe extends null{}class _Ue extends qs{constructor(){super(...arguments),this.validator=new TZ}}class TZ extends Ys{validate(t,r){super.validate(t,r)}}const AZ="data-connection-status";var gZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},nP;const yZ="connectionId cannot be null or empty",RZ="username cannot be null or empty",OZ="password cannot be null or empty";class rG{validate(t,r){t.connectionId===""&&r.add(yZ)}}class bZ{constructor(){nP.set(this,new rG)}validate(t,r){gZ(this,nP,"f").validate(t,r),t.username===""&&r.add(RZ),t.password===""&&r.add(OZ)}}nP=new WeakMap;class CZ extends sa{constructor(){super(...arguments),this.validator=new rG}}class dUe extends null{}class pUe extends CZ{constructor(){super(...arguments),this.validator=new bZ}}const PZ="deviceToken is required",MZ="platformName must be a valid DevicePlatform value",IZ="applicationName is required";var iP;(function(e){e.IOS="IOS",e.ANDROID="ANDROID"})(iP||(iP={}));const NZ=new Set(Object.values(iP));function LZ(e){return NZ.has(e)}function DZ(e){return!LZ(e)}class nG{validate(t,r){$o(t.deviceToken)&&r.add(PZ)}}class wZ extends nG{validate(t,r){super.validate(t,r),DZ(t.platformName.toUpperCase())&&r.add(MZ),$o(t.applicationName)&&r.add(IZ)}}class hUe extends sa{constructor(){super(...arguments),this.validator=new wZ}}class SUe extends sa{constructor(){super(...arguments),this.validator=new nG}}const UZ="string parameter serializedNotification must be provided",xZ="serialized notification must have a non-empty notification_id field of type string",iG="serialized notification must have an itbl object containing a non-empty messageId field of type string",FZ="parsed notification must be a non-null object.",$Z="serialized notification is not valid JSON.";class VZ{validate(t,r){if(ka(t.serializedNotification)||typeof t.serializedNotification!="string"||$o(t.serializedNotification)){r.add(UZ);return}let n=null;try{n=JSON.parse(t.serializedNotification)}catch{r.add($Z);return}if(typeof n!="object"||n===null){r.add(FZ);return}const{itbl:i,notification_id:a}=n;if((ka(a)||typeof a!="string"||$o(a))&&r.add(xZ),typeof i!="object"||Fo(i)){r.add(iG);return}(ka(i.messageId)||typeof i.messageId!="string"||$o(i.messageId))&&r.add(iG)}}class EUe extends sa{constructor(){super(...arguments),this.validator=new VZ}}const GZ="SearchStringValue should be a non-empty string";class BZ{validate(t,r){if(Fo(t.values))return;let n=!1;for(const i of t.values)$o(i)&&(n=!0);n&&r.add(GZ)}}var aP=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},oP,sP,uP;class kZ{constructor(){oP.set(this,new WC),sP.set(this,new BZ),uP.set(this,new Lm)}validate(t,r){var n;Fn(t._source)&&aP(this,sP,"f").validate(t._source,r),Fn(t.date)&&aP(this,oP,"f").validate(t.date,r),Fn(t._count)&&t._count<0&&r.add("Value of count cannot be less than 0"),Fn(t._getpagesoffset)&&t._getpagesoffset<0&&r.add("Value of getpagesoffset cannot be less than 0"),Fn((n=t.supporting_info)===null||n===void 0?void 0:n.value)&&$o(t.supporting_info.value)&&r.add("Supporting Information must have a non-empty value."),Fn(t.status)&&aP(this,uP,"f").validate(t.status,r)}}oP=new WeakMap,sP=new WeakMap,uP=new WeakMap;class vUe extends sa{constructor(){super(...arguments),this.validator=new kZ}}class jZ{validate(t,r){if(!Fo(t.cancelationReason)){if(Fo(t.cancelationReason.coding)||t.cancelationReason.coding.length===0){r.add("cancelationReason must have at least one coding");return}for(const n of t.cancelationReason.coding)(Fo(n?.code)||Fo(n?.system))&&r.add("cancelationReason.coding must have a code and a system")}}}class mUe extends sa{constructor(){super(...arguments),this.validator=new jZ}}class HZ{validate(t,r){var n;Ks((n=t.organization.value)===null||n===void 0?void 0:n.trim())&&r.add("Organization reference is required and must have a non-empty value.")}}class TUe extends sa{constructor(){super(...arguments),this.validator=new HZ}}class YZ{validate(t,r){const n=t.questionnaireResponse;if(Fo(n)){r.add("questionnaireResponse is required");return}if((Ks(n.resourceType)||n.resourceType!=="QuestionnaireResponse")&&r.add('questionnaireResponse.resourceType must be "QuestionnaireResponse"'),Ks(n.status)&&r.add("questionnaireResponse.status is required"),Ks(n.questionnaire)&&r.add("questionnaireResponse.questionnaire is required"),Fo(n.contained)||n.contained.length===0)r.add("questionnaireResponse.contained must have at least one item");else{let i=null;for(const a of n.contained){if(Fo(a)){r.add("questionnaireResponse.contained item cannot be null or undefined");break}if(a.resourceType==="Questionnaire"){i=a;break}}if(Fo(i)){r.add("questionnaireResponse.contained must contain a Questionnaire resource");return}Ks(i.id)&&r.add("questionnaireResponse.contained Questionnaire resource must have an id")}}}class AUe extends sa{constructor(){super(...arguments),this.validator=new YZ}}var cP=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(p){try{_(n.next(p))}catch(L){u(L)}}function E(p){try{_(n.throw(p))}catch(L){u(L)}}function _(p){p.done?a(p.value):i(p.value).then(c,E)}_((n=n.apply(e,t||[])).next())})};class aG{constructor(t=new Map){this.storage=t}get(t){return cP(this,void 0,void 0,function*(){return this.storage.get(t)})}set(t,r){return cP(this,void 0,void 0,function*(){this.storage.set(t,r)})}delete(t){return cP(this,void 0,void 0,function*(){return this.storage.delete(t)})}}const qZ={logLevel:jC.Error,timeout:3e4,retryPolicy:{attempts:3,interval:1e3},telemetryEnabled:!1,tokenStorage:new aG,language:null,overrides:{unauthedApiUrl:null,authedApiUrl:null}};var Ws;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Ws||(Ws={}));var KZ=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},oG=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Zp,Mr;(function(e){e[e.VERBOSE=0]="VERBOSE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.FATAL=5]="FATAL"})(Mr||(Mr={}));const WZ={[Mr.VERBOSE]:"VERBOSE",[Mr.DEBUG]:"DEBUG",[Mr.INFO]:"INFO",[Mr.WARN]:"WARN",[Mr.ERROR]:"ERROR",[Mr.FATAL]:"FATAL"};class n_{constructor(t){Zp.set(this,void 0),KZ(this,Zp,t,"f")}get severity(){return oG(this,Zp,"f")}shouldLog(t){return t>=oG(this,Zp,"f")}static severityText(t){return WZ[t]}static severityFromText(t){switch(t){case"VERBOSE":return Mr.VERBOSE;case"DEBUG":return Mr.DEBUG;case"INFO":return Mr.INFO;case"WARN":return Mr.WARN;case"ERROR":return Mr.ERROR;case"FATAL":return Mr.FATAL;default:throw new Error(`Invalid severity text: ${t}`)}}}Zp=new WeakMap;var lP=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Es=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},Fu,sG,wm,eh,Um,il;class uG{constructor(t,r,n){Fu.add(this),wm.set(this,void 0),eh.set(this,void 0),Um.set(this,void 0),lP(this,wm,n,"f"),lP(this,eh,new n_(t),"f"),lP(this,Um,r,"f")}name(){return Es(this,wm,"f")}severity(){return Es(this,eh,"f").severity}verbose(t,r){Es(this,Fu,"m",il).call(this,Mr.VERBOSE,t,r)}debug(t,r){Es(this,Fu,"m",il).call(this,Mr.DEBUG,t,r)}info(t,r){Es(this,Fu,"m",il).call(this,Mr.INFO,t,r)}warn(t,r){Es(this,Fu,"m",il).call(this,Mr.WARN,t,r)}error(t,r){let n;r instanceof Kt&&(n={error:r.failure()?r.error().message:r.data()}),r instanceof Error&&(n={error:r.message}),n===void 0&&(n=r),Es(this,Fu,"m",il).call(this,Mr.ERROR,t,n)}fatal(t,r){Es(this,Fu,"m",il).call(this,Mr.FATAL,t,r)}static otelSeverityNumber(t){switch(t){case Mr.VERBOSE:return Ws.TRACE;case Mr.DEBUG:return Ws.DEBUG;case Mr.INFO:return Ws.INFO;case Mr.WARN:return Ws.WARN;case Mr.ERROR:return Ws.ERROR;case Mr.FATAL:return Ws.FATAL;default:return Ws.UNSPECIFIED}}}sG=uG,wm=new WeakMap,eh=new WeakMap,Um=new WeakMap,Fu=new WeakSet,il=function(t,r,n){!Es(this,eh,"f").shouldLog(t)||Es(this,Um,"f").emit({timestamp:Date.now(),severityNumber:sG.otelSeverityNumber(t),severityText:n_.severityText(t),body:r,attributes:n??{}})};var cG=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},lG=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},xm,Fm;class QZ{constructor(t,r){xm.set(this,void 0),Fm.set(this,void 0),cG(this,Fm,t,"f"),cG(this,xm,r.loggerProvider(),"f")}getLogger(t){const r=t??"default",n=lG(this,xm,"f").getLogger(r);return new uG(lG(this,Fm,"f"),n,r)}}xm=new WeakMap,Fm=new WeakMap;class zZ{format(t,r,n,i){let u=`[${new Date().toISOString()}] ${n_.severityText(t)}`;return n!==void 0&&(u+=` (${n})`),u+=`: ${r}`,i===void 0?[u]:[u,i]}}var fP=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},di=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},vs,ms,Qs;class XZ{constructor(t,r){vs.set(this,void 0),ms.set(this,void 0),Qs.set(this,void 0),fP(this,ms,new n_(t),"f"),fP(this,vs,r,"f"),fP(this,Qs,new zZ,"f")}name(){return di(this,vs,"f")}severity(){return di(this,ms,"f").severity}verbose(t,r){di(this,ms,"f").shouldLog(Mr.VERBOSE)&&console.debug(...di(this,Qs,"f").format(Mr.VERBOSE,t,di(this,vs,"f"),r))}debug(t,r){di(this,ms,"f").shouldLog(Mr.DEBUG)&&console.debug(...di(this,Qs,"f").format(Mr.DEBUG,t,di(this,vs,"f"),r))}info(t,r){di(this,ms,"f").shouldLog(Mr.INFO)&&console.info(...di(this,Qs,"f").format(Mr.INFO,t,di(this,vs,"f"),r))}warn(t,r){di(this,ms,"f").shouldLog(Mr.WARN)&&console.warn(...di(this,Qs,"f").format(Mr.WARN,t,di(this,vs,"f"),r))}error(t,r){let n=r;r instanceof Kt&&(n=r.failure()?r.error():r.data()),di(this,ms,"f").shouldLog(Mr.ERROR)&&console.error(...di(this,Qs,"f").format(Mr.ERROR,t,di(this,vs,"f"),n))}fatal(t,r){di(this,ms,"f").shouldLog(Mr.FATAL)&&console.error(...di(this,Qs,"f").format(Mr.FATAL,t,di(this,vs,"f"),r))}}vs=new WeakMap,ms=new WeakMap,Qs=new WeakMap;var JZ=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ZZ=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},$m;class Hi{constructor(t=Mr.FATAL){$m.set(this,void 0),JZ(this,$m,t,"f")}getLogger(t){return new XZ(ZZ(this,$m,"f"),t)}}$m=new WeakMap;var eee=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},_P,fG;class tee{constructor(){_P.add(this)}createLogProvider(t,r){switch(eee(this,_P,"m",fG).call(this,t)){case"otel":if(r===void 0)throw new Error('telemetry is required for "otel" logging');return new QZ(t.logLevel,r);case"console":return new Hi(t.logLevel)}}}_P=new WeakSet,fG=function(t){return t.telemetry.enabled?"otel":"console"};var Nn=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},zs=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},ao,i_,$u,a_,Vu,al,_G,dG,pG,hG,SG,EG,vG,mG,TG,AG;class Vm{constructor(t){ao.add(this),i_.set(this,void 0),$u.set(this,void 0),a_.set(this,void 0),Vu.set(this,void 0),al.set(this,void 0),this.bwellConfig=Nn(this,ao,"m",SG).call(this,t),zs(this,i_,n_.severityFromText(this.bwellConfig.logLevel),"f"),zs(this,al,Nn(this,ao,"m",AG).call(this),"f"),zs(this,a_,Nn(this,ao,"m",vG).call(this),"f"),zs(this,$u,Nn(this,ao,"m",mG).call(this),"f"),zs(this,Vu,Nn(this,ao,"m",TG).call(this),"f")}static initialize(t){try{const r=new Vm(t);return Kt.success(r)}catch(r){if(ki.isBwellError(r))return Kt.failure(r);throw r}}get logLevel(){return Nn(this,i_,"f")}get graphQL(){return Nn(this,a_,"f")}get telemetry(){return Nn(this,$u,"f")}get http(){return Nn(this,Vu,"f")}get context(){return Nn(this,al,"f")}setContextUser(t){Nn(this,al,"f").user=t}mergeRemoteConfig(t){zs(this,i_,Nn(this,ao,"m",_G).call(this,t),"f"),zs(this,a_,Nn(this,ao,"m",dG).call(this,t),"f"),zs(this,$u,Object.freeze(Nn(this,ao,"m",pG).call(this,t)),"f"),zs(this,Vu,Object.freeze(Nn(this,ao,"m",hG).call(this,t)),"f")}}i_=new WeakMap,$u=new WeakMap,a_=new WeakMap,Vu=new WeakMap,al=new WeakMap,ao=new WeakSet,_G=function(t){var r;const n=(r=t?.logLevel)!==null&&r!==void 0?r:null;return n===null?Nn(this,i_,"f"):n_.severityFromText(n)},dG=function(t){var r;const n=(r=t?.graphQLClient)!==null&&r!==void 0?r:null;if(n===null)return Nn(this,a_,"f");const{authedApiUrl:i,unauthedApiUrl:a}=this.bwellConfig.overrides;return{unauthApiUrl:a??n.url,apiUrl:i??n.authUrl}},pG=function(t){var r,n;const i=(r=t?.telemetry)!==null&&r!==void 0?r:null;if(i===null)return Nn(this,$u,"f");const a=(n=i.enabled)!==null&&n!==void 0?n:Nn(this,$u,"f").enabled;if(i.collectorUrl.endsWith("/"))throw new Error('Telemetry config "collectorUrl" cannot end with a trailing slash.');let u;try{u=new URL(i.collectorUrl)}catch{throw new Error('Telemetry config "collectorUrl" malformed/is not a proper URL.')}if(u.pathname!=="/")throw new Error('Telemetry config "collectorUrl" cannot contain a path.');return Object.assign(Object.assign({},Nn(this,$u,"f")),{enabled:a,collectorUrl:i.collectorUrl})},hG=function(t){var r,n,i;const a=(r=t?.httpClient)!==null&&r!==void 0?r:null;return a===null?Nn(this,Vu,"f"):{timeout:(n=a.requestTimeout)!==null&&n!==void 0?n:Nn(this,Vu,"f").timeout,retryPolicy:(i=a.retry)!==null&&i!==void 0?i:Nn(this,Vu,"f").retryPolicy}},SG=function(t){return Object.assign(Object.assign({},qZ),t)},EG=function(){try{return w9(this.bwellConfig.clientKey)}catch{throw new y9("It appears there is a problem with your Client Key. Contact b.well support for further assistance.")}},vG=function(){var t,r;return{apiUrl:(t=this.bwellConfig.overrides.authedApiUrl)!==null&&t!==void 0?t:`https://api-gateway.${Nn(this,al,"f").env}.icanbwell.com/federated-graph-authed/graphql`,unauthApiUrl:(r=this.bwellConfig.overrides.unauthedApiUrl)!==null&&r!==void 0?r:`https://api-gateway.${Nn(this,al,"f").env}.icanbwell.com/federated-graph/graphql`}},mG=function(){return{collectorUrl:"https://collector.services.icanbwell.com",enabled:this.bwellConfig.telemetryEnabled,timeout:this.bwellConfig.timeout}},TG=function(){return{timeout:this.bwellConfig.timeout,retryPolicy:{attempts:this.bwellConfig.retryPolicy.attempts,interval:this.bwellConfig.retryPolicy.interval}}},AG=function(){return{clientKey:this.bwellConfig.clientKey,env:Nn(this,ao,"m",EG).call(this),user:null}};var ree=function(e,t,r,n){function i(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(p){try{_(n.next(p))}catch(L){u(L)}}function E(p){try{_(n.throw(p))}catch(L){u(L)}}function _(p){p.done?a(p.value):i(p.value).then(c,E)}_((n=n.apply(e,t||[])).next())})},gG=function(e,t,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(e,r):i?i.value=r:t.set(e,r),r},Gm=function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},o_,Bm;class nee{constructor(t,r=new Hi){o_.set(this,void 0),Bm.set(this,void 0),gG(this,Bm,t,"f"),gG(this,o_,r.getLogger("ConfigManager"),"f")}initialize(t){return ree(this,void 0,void 0,function*(){const r=Vm.initialize(t);if(r.failure())return r;const n=r.data();Gm(this,o_,"f").verbose("Initializing SDK Configuration");const i=yield Gm(this,Bm,"f").initialize(n.context.clientKey);if(i.failure())return i.intoFailure();const a=i.data();try{n.mergeRemoteConfig(a)}catch(u){Gm(this,o_,"f").error("Error merging SDK config with remote config.",u)}return Gm(this,o_,"f").info("Remote SDK Configuration merged with user config"),Kt.success(n)})}}o_=new WeakMap,Bm=new WeakMap;const dP=JSON,iee=e=>e.toUpperCase(),aee=e=>{const t={};return e.forEach((r,n)=>{t[n]=r}),t},oee=(e,t,r)=>e.document?e:{document:e,variables:t,requestHeaders:r,signal:void 0},see=(e,t,r)=>e.query?e:{query:e,variables:t,requestHeaders:r,signal:void 0},uee=(e,t)=>e.documents?e:{documents:e,requestHeaders:t,signal:void 0},gUe=(e,t,...r)=>{const[n,i]=r;return e.document?e:{url:e,document:t,variables:n,requestHeaders:i,signal:void 0}},yUe=(e,t,...r)=>{const[n,i]=r;return e.query?e:{url:e,query:t,variables:n,requestHeaders:i,signal:void 0}};var cee=h(5157),lee=h(2704);const yG=e=>{let t;const r=e.definitions.filter(n=>n.kind==="OperationDefinition");return r.length===1&&(t=r[0]?.name?.value),t},km=e=>{if(typeof e=="string"){let r;try{const n=(0,cee.qg)(e);r=yG(n)}catch{}return{query:e,operationName:r}}const t=yG(e);return{query:(0,lee.y)(e),operationName:t}};class Gu extends Error{constructor(t,r){const n=`${Gu.extractMessage(t)}: ${JSON.stringify({response:t,request:r})}`;super(n),Object.setPrototypeOf(this,Gu.prototype),this.response=t,this.request=r,typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Gu)}static extractMessage(t){return t.errors?.[0]?.message??`GraphQL Error (Code: ${t.status})`}}var s_=h(288),fee=h.t(s_,2);const _ee="connection_init",dee="connection_ack",RG="ping",OG="pong",pee="subscribe",hee="next",See="error",bG="complete";class Bu{get type(){return this._type}get id(){return this._id}get payload(){return this._payload}constructor(t,r,n){this._type=t,this._payload=r,this._id=n}get text(){const t={type:this.type};return this.id!=null&&this.id!=null&&(t.id=this.id),this.payload!=null&&this.payload!=null&&(t.payload=this.payload),JSON.stringify(t)}static parse(t,r){const{type:n,payload:i,id:a}=JSON.parse(t);return new Bu(n,r(i),a)}}class Eee{constructor(t,{onInit:r,onAcknowledged:n,onPing:i,onPong:a}){this.socketState={acknowledged:!1,lastRequestId:0,subscriptions:{}},this.socket=t,t.addEventListener("open",async u=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={},t.send(mee(r?await r():null).text)}),t.addEventListener("close",u=>{this.socketState.acknowledged=!1,this.socketState.subscriptions={}}),t.addEventListener("error",u=>{console.error(u)}),t.addEventListener("message",u=>{try{const c=vee(u.data);switch(c.type){case dee:{this.socketState.acknowledged?console.warn("Duplicate CONNECTION_ACK message ignored"):(this.socketState.acknowledged=!0,n&&n(c.payload));return}case RG:{i?i(c.payload).then(L=>t.send(CG(L).text)):t.send(CG(null).text);return}case OG:{a&&a(c.payload);return}}if(!this.socketState.acknowledged||c.id===void 0||c.id===null||!this.socketState.subscriptions[c.id])return;const{query:E,variables:_,subscriber:p}=this.socketState.subscriptions[c.id];switch(c.type){case hee:{!c.payload.errors&&c.payload.data&&p.next&&p.next(c.payload.data),c.payload.errors&&p.error&&p.error(new Gu({...c.payload,status:200},{query:E,variables:_}));return}case See:{p.error&&p.error(new Gu({errors:c.payload,status:200},{query:E,variables:_}));return}case bG:{p.complete&&p.complete(),delete this.socketState.subscriptions[c.id];return}}}catch(c){console.error(c),t.close(1006)}t.close(4400,"Unknown graphql-ws message.")})}makeSubscribe(t,r,n,i){const a=(this.socketState.lastRequestId++).toString();return this.socketState.subscriptions[a]={query:t,variables:i,subscriber:n},this.socket.send(Aee(a,{query:t,operationName:r,variables:i}).text),()=>{this.socket.send(gee(a).text),delete this.socketState.subscriptions[a]}}rawRequest(t,r){return new Promise((n,i)=>{let a;this.rawSubscribe(t,{next:(u,c)=>a={data:u,extensions:c},error:i,complete:()=>n(a)},r)})}request(t,r){return new Promise((n,i)=>{let a;this.subscribe(t,{next:u=>a=u,error:i,complete:()=>n(a)},r)})}subscribe(t,r,n){const{query:i,operationName:a}=km(t);return this.makeSubscribe(i,a,r,n)}rawSubscribe(t,r,n){return this.makeSubscribe(t,void 0,r,n)}ping(t){this.socket.send(Tee(t).text)}close(){this.socket.close(1e3)}}Eee.PROTOCOL="graphql-transport-ws";function vee(e,t=r=>r){return Bu.parse(e,t)}function mee(e){return new Bu(_ee,e)}function Tee(e){return new Bu(RG,e,void 0)}function CG(e){return new Bu(OG,e,void 0)}function Aee(e,t){return new Bu(pee,t,e)}function gee(e){return new Bu(bG,void 0,e)}const u_=e=>{let t={};return e&&(typeof Headers<"u"&&e instanceof Headers||fee&&s_.Headers&&e instanceof s_.Headers?t=aee(e):Array.isArray(e)?e.forEach(([r,n])=>{r&&n!==void 0&&(t[r]=n)}):t=e),t},PG=e=>e.replace(/([\s,]|#[^\n\r]+)+/g," ").trim(),yee=e=>{if(!Array.isArray(e.query)){const n=e,i=[`query=${encodeURIComponent(PG(n.query))}`];return e.variables&&i.push(`variables=${encodeURIComponent(n.jsonSerializer.stringify(n.variables))}`),n.operationName&&i.push(`operationName=${encodeURIComponent(n.operationName)}`),i.join("&")}if(typeof e.variables<"u"&&!Array.isArray(e.variables))throw new Error("Cannot create query with given variable type, array expected");const t=e,r=e.query.reduce((n,i,a)=>(n.push({query:PG(i),variables:t.variables?t.jsonSerializer.stringify(t.variables[a]):void 0}),n),[]);return`query=${encodeURIComponent(t.jsonSerializer.stringify(r))}`},Ree=e=>async t=>{const{url:r,query:n,variables:i,operationName:a,fetch:u,fetchOptions:c,middleware:E}=t,_={...t.headers};let p="",L;e==="POST"?(L=bee(n,i,a,c.jsonSerializer),typeof L=="string"&&(_["Content-Type"]="application/json")):p=yee({query:n,variables:i,operationName:a,jsonSerializer:c.jsonSerializer??dP});const W={method:e,headers:_,body:L,...c};let ve=r,me=W;if(E){const Oe=await Promise.resolve(E({...W,url:r,operationName:a,variables:i})),{url:He,...qe}=Oe;ve=He,me=qe}return p&&(ve=`${ve}?${p}`),await u(ve,me)};class jm{constructor(t,r={}){this.url=t,this.requestConfig=r,this.rawRequest=async(...n)=>{const[i,a,u]=n,c=see(i,a,u),{headers:E,fetch:_=s_,method:p="POST",requestMiddleware:L,responseMiddleware:W,...ve}=this.requestConfig,{url:me}=this;c.signal!==void 0&&(ve.signal=c.signal);const{operationName:Oe}=km(c.query);return pP({url:me,query:c.query,variables:c.variables,headers:{...u_(hP(E)),...u_(c.requestHeaders)},operationName:Oe,fetch:_,method:p,fetchOptions:ve,middleware:L}).then(He=>(W&&W(He),He)).catch(He=>{throw W&&W(He),He})}}async request(t,...r){const[n,i]=r,a=oee(t,n,i),{headers:u,fetch:c=s_,method:E="POST",requestMiddleware:_,responseMiddleware:p,...L}=this.requestConfig,{url:W}=this;a.signal!==void 0&&(L.signal=a.signal);const{query:ve,operationName:me}=km(a.document);return pP({url:W,query:ve,variables:a.variables,headers:{...u_(hP(u)),...u_(a.requestHeaders)},operationName:me,fetch:c,method:E,fetchOptions:L,middleware:_}).then(Oe=>(p&&p(Oe),Oe.data)).catch(Oe=>{throw p&&p(Oe),Oe})}batchRequests(t,r){const n=uee(t,r),{headers:i,...a}=this.requestConfig;n.signal!==void 0&&(a.signal=n.signal);const u=n.documents.map(({document:E})=>km(E).query),c=n.documents.map(({variables:E})=>E);return pP({url:this.url,query:u,variables:c,headers:{...u_(hP(i)),...u_(n.requestHeaders)},operationName:void 0,fetch:this.requestConfig.fetch??s_,method:this.requestConfig.method||"POST",fetchOptions:a,middleware:this.requestConfig.requestMiddleware}).then(E=>(this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(E),E.data)).catch(E=>{throw this.requestConfig.responseMiddleware&&this.requestConfig.responseMiddleware(E),E})}setHeaders(t){return this.requestConfig.headers=t,this}setHeader(t,r){const{headers:n}=this.requestConfig;return n?n[t]=r:this.requestConfig.headers={[t]:r},this}setEndpoint(t){return this.url=t,this}}const pP=async e=>{const{query:t,variables:r,fetchOptions:n}=e,i=Ree(iee(e.method??"post")),a=Array.isArray(e.query),u=await i(e),c=await Cee(u,n.jsonSerializer??dP),E=Array.isArray(c)?!c.some(({data:p})=>!p):Boolean(c.data),_=Array.isArray(c)||!c.errors||Array.isArray(c.errors)&&!c.errors.length||n.errorPolicy==="all"||n.errorPolicy==="ignore";if(u.ok&&_&&E){const{errors:p,...L}=(Array.isArray(c),c),W=n.errorPolicy==="ignore"?L:c;return{...a?{data:W}:W,headers:u.headers,status:u.status}}else{const p=typeof c=="string"?{error:c}:c;throw new Gu({...p,status:u.status,headers:u.headers},{query:t,variables:r})}},RUe=async(...e)=>{const[t,r,...n]=e,i=parseRawRequestExtendedArgs(t,r,...n);return new jm(i.url).rawRequest({...i})};async function OUe(e,t,...r){const n=parseRequestExtendedArgs(e,t,...r);return new jm(n.url).request({...n})}const bUe=async(...e)=>{const t=Oee(e);return new jm(t.url).batchRequests(t)},Oee=e=>e.length===1?e[0]:{url:e[0],documents:e[1],requestHeaders:e[2],signal:void 0},bee=(e,t,r,n)=>{const i=n??dP;if(!Array.isArray(e))return i.stringify({query:e,variables:t,operationName:r});if(typeof t<"u"&&!Array.isArray(t))throw new Error("Cannot create request body with given variable type, array expected");const a=e.reduce((u,c,E)=>(u.push({query:c,variables:t?t[E]:void 0}),u),[]);return i.stringify(a)},Cee=async(e,t)=>{let r;return e.headers.forEach((n,i)=>{i.toLowerCase()==="content-type"&&(r=n)}),r&&(r.toLowerCase().startsWith("application/json")||r.toLowerCase().startsWith("application/graphql+json")||r.toLowerCase().startsWith("application/graphql-response+json"))?t.parse(await e.text()):e.text()},hP=e=>typeof e=="function"?e():e,CUe=(e,...t)=>e.reduce((r,n,i)=>`${r}${n}${i in t?String(t[i]):""}`,""),PUe=null,Ni=`
5345
5345
  fragment CodingFields on Coding {
5346
5346
  system
5347
5347
  code
@@ -6615,6 +6615,11 @@ ${Xee}`,Zee=`
6615
6615
  contained {
6616
6616
  ...QuestionnaireFields
6617
6617
  }
6618
+ subject {
6619
+ reference
6620
+ type
6621
+ display
6622
+ }
6618
6623
  }
6619
6624
  ${yi}
6620
6625
  ${bn}