@photonhealth/elements 0.14.3 → 0.14.4

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/dist/index.js CHANGED
@@ -46,7 +46,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
46
46
  `),C=sM(w.slice(0,x)),k=C["content-type"],k&&k.toLowerCase().indexOf("application/json")===-1)throw new Error("Unsupported patch content type: application/json is required.");if(S=w.slice(x),S){if(P=w$(e,S),Object.keys(P).length>1||"data"in P||"incremental"in P||"errors"in P||"payload"in P)if(BD(P)){if(N={},"payload"in P){if(Object.keys(P).length===1&&P.payload===null)return[2];N=te({},P.payload)}"errors"in P&&(N=te(te({},N),{extensions:te(te({},"extensions"in N?N.extensions:null),(F={},F[Kg]=P.errors,F))})),t(N)}else t(P);else if(Object.keys(P).length===1&&"hasNext"in P&&!P.hasNext)return[2]}$=s.indexOf(o)}return[3,1];case 3:return[2]}})})}function sM(e){var t={};return e.split(`
47
47
  `).forEach(function(r){var n=r.indexOf(":");if(n>-1){var i=r.slice(0,n).trim().toLowerCase(),a=r.slice(n+1).trim();t[i]=a}}),t}function w$(e,t){if(e.status>=300){var r=function(){try{return JSON.parse(t)}catch{return t}};b$(e,r(),"Response not successful: Received status code ".concat(e.status))}try{return JSON.parse(t)}catch(i){var n=i;throw n.name="ServerParseError",n.response=e,n.statusCode=e.status,n.bodyText=t,n}}function lM(e,t){e.result&&e.result.errors&&e.result.data&&t.next(e.result),t.error(e)}function dM(e){return function(t){return t.text().then(function(r){return w$(t,r)}).then(function(r){return!Array.isArray(r)&&!s7.call(r,"data")&&!s7.call(r,"errors")&&b$(t,r,"Server response was missing for query '".concat(Array.isArray(e)?e.map(function(n){return n.operationName}):e.operationName,"'.")),r})}}var H5=function(e,t){var r;try{r=JSON.stringify(e)}catch(i){var n=zn(40,t,i.message);throw n.parseError=i,n}return r},cM={includeQuery:!0,includeExtensions:!1,preserveHeaderCase:!1},uM={accept:"*/*","content-type":"application/json"},hM={method:"POST"},fM={http:cM,headers:uM,options:hM},pM=function(e,t){return t(e)};function gM(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i={},a={};r.forEach(function(f){i=te(te(te({},i),f.options),{headers:te(te({},i.headers),f.headers)}),f.credentials&&(i.credentials=f.credentials),a=te(te({},a),f.http)}),i.headers&&(i.headers=mM(i.headers,a.preserveHeaderCase));var o=e.operationName,s=e.extensions,d=e.variables,c=e.query,h={operationName:o,variables:d};return a.includeExtensions&&(h.extensions=s),a.includeQuery&&(h.query=t(c,c2)),{options:i,body:h}}function mM(e,t){if(!t){var r={};return Object.keys(Object(e)).forEach(function(a){r[a.toLowerCase()]=e[a]}),r}var n={};Object.keys(Object(e)).forEach(function(a){n[a.toLowerCase()]={originalName:a,value:e[a]}});var i={};return Object.keys(n).forEach(function(a){i[n[a].originalName]=n[a].value}),i}var vM=function(e){if(!e&&typeof fetch>"u")throw zn(38)},yM=function(e,t){var r=e.getContext(),n=r.uri;return n||(typeof t=="function"?t(e):t||"/graphql")};function bM(e,t){var r=[],n=function(f,p){r.push("".concat(f,"=").concat(encodeURIComponent(p)))};if("query"in t&&n("query",t.query),t.operationName&&n("operationName",t.operationName),t.variables){var i=void 0;try{i=H5(t.variables,"Variables map")}catch(f){return{parseError:f}}n("variables",i)}if(t.extensions){var a=void 0;try{a=H5(t.extensions,"Extensions map")}catch(f){return{parseError:f}}n("extensions",a)}var o="",s=e,d=e.indexOf("#");d!==-1&&(o=e.substr(d),s=e.substr(0,d));var c=s.indexOf("?")===-1?"?":"&",h=s+c+r.join("&")+o;return{newURI:h}}var l7=Ki(function(){return fetch}),$M=function(e){e===void 0&&(e={});var t=e.uri,r=t===void 0?"/graphql":t,n=e.fetch,i=e.print,a=i===void 0?pM:i,o=e.includeExtensions,s=e.preserveHeaderCase,d=e.useGETForQueries,c=e.includeUnusedVariables,h=c===void 0?!1:c,f=ta(e,["uri","fetch","print","includeExtensions","preserveHeaderCase","useGETForQueries","includeUnusedVariables"]);globalThis.__DEV__!==!1&&vM(n||l7);var p={http:{includeExtensions:o,preserveHeaderCase:s},options:f.fetchOptions,credentials:f.credentials,headers:f.headers};return new Od(function(m){var v=yM(m,r),$=m.getContext(),w={};if($.clientAwareness){var x=$.clientAwareness,C=x.name,k=x.version;C&&(w["apollographql-client-name"]=C),k&&(w["apollographql-client-version"]=k)}var S=te(te({},w),$.headers),P={http:$.http,options:$.fetchOptions,credentials:$.credentials,headers:S};if(cu(["client"],m.query)){var N=h$(m.query);if(!N)return pp(new Error("HttpLink: Trying to send a client-only query to the server. To send to the server, ensure a non-client field is added to the query or set the `transformOptions.removeClientFields` option to `true`."));m.query=N}var j=gM(m,a,fM,p,P),F=j.options,W=j.body;W.variables&&!h&&(W.variables=QD(W.variables,m.query));var J;!F.signal&&typeof AbortController<"u"&&(J=new AbortController,F.signal=J.signal);var U=function(X){return X.kind==="OperationDefinition"&&X.operation==="mutation"},G=function(X){return X.kind==="OperationDefinition"&&X.operation==="subscription"},H=G(Ru(m.query)),K=cu(["defer"],m.query);if(d&&!m.query.definitions.some(U)&&(F.method="GET"),K||H){F.headers=F.headers||{};var ee="multipart/mixed;";H&&K&&globalThis.__DEV__!==!1&&tt.warn(39),H?ee+="boundary=graphql;subscriptionSpec=1.0,application/json":K&&(ee+="deferSpec=20220824,application/json"),F.headers.accept=ee}if(F.method==="GET"){var we=bM(v,W),me=we.newURI,re=we.parseError;if(re)return pp(re);v=me}else try{F.body=H5(W,"Payload")}catch(X){return pp(X)}return new cr(function(X){var ne=n||Ki(function(){return fetch})||l7,ke=X.next.bind(X);return ne(v,F).then(function(ie){var Ae;m.setContext({response:ie});var Ie=(Ae=ie.headers)===null||Ae===void 0?void 0:Ae.get("content-type");return Ie!==null&&/^multipart\/mixed/i.test(Ie)?oM(ie,ke):dM(m)(ie).then(ke)}).then(function(){J=void 0,X.complete()}).catch(function(ie){J=void 0,lM(ie,X)}),function(){J&&J.abort()}})})},x$=function(e){ka(t,e);function t(r){r===void 0&&(r={});var n=e.call(this,$M(r).request)||this;return n.options=r,n}return t}(Od);const{toString:d7,hasOwnProperty:wM}=Object.prototype,c7=Function.prototype.toString,W5=new Map;function vr(e,t){try{return Q5(e,t)}finally{W5.clear()}}function Q5(e,t){if(e===t)return!0;const r=d7.call(e),n=d7.call(t);if(r!==n)return!1;switch(r){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":{if(h7(e,t))return!0;const i=u7(e),a=u7(t),o=i.length;if(o!==a.length)return!1;for(let s=0;s<o;++s)if(!wM.call(t,i[s]))return!1;for(let s=0;s<o;++s){const d=i[s];if(!Q5(e[d],t[d]))return!1}return!0}case"[object Error]":return e.name===t.name&&e.message===t.message;case"[object Number]":if(e!==e)return t!==t;case"[object Boolean]":case"[object Date]":return+e==+t;case"[object RegExp]":case"[object String]":return e==`${t}`;case"[object Map]":case"[object Set]":{if(e.size!==t.size)return!1;if(h7(e,t))return!0;const i=e.entries(),a=r==="[object Map]";for(;;){const o=i.next();if(o.done)break;const[s,d]=o.value;if(!t.has(s)||a&&!Q5(d,t.get(s)))return!1}return!0}case"[object Uint16Array]":case"[object Uint8Array]":case"[object Uint32Array]":case"[object Int32Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object ArrayBuffer]":e=new Uint8Array(e),t=new Uint8Array(t);case"[object DataView]":{let i=e.byteLength;if(i===t.byteLength)for(;i--&&e[i]===t[i];);return i===-1}case"[object AsyncFunction]":case"[object GeneratorFunction]":case"[object AsyncGeneratorFunction]":case"[object Function]":{const i=c7.call(e);return i!==c7.call(t)?!1:!kM(i,_M)}}return!1}function u7(e){return Object.keys(e).filter(xM,e)}function xM(e){return this[e]!==void 0}const _M="{ [native code] }";function kM(e,t){const r=e.length-t.length;return r>=0&&e.indexOf(t,r)===r}function h7(e,t){let r=W5.get(e);if(r){if(r.has(t))return!0}else W5.set(e,r=new Set);return r.add(t),!1}function _$(e,t,r,n){var i=t.data,a=ta(t,["data"]),o=r.data,s=ta(r,["data"]);return vr(a,s)&&z1(Ru(e).selectionSet,i,o,{fragmentMap:i2(s2(e)),variables:n})}function z1(e,t,r,n){if(t===r)return!0;var i=new Set;return e.selections.every(function(a){if(i.has(a)||(i.add(a),!Du(a,n.variables))||f7(a))return!0;if(zo(a)){var o=Fo(a),s=t&&t[o],d=r&&r[o],c=a.selectionSet;if(!c)return vr(s,d);var h=Array.isArray(s),f=Array.isArray(d);if(h!==f)return!1;if(h&&f){var p=s.length;if(d.length!==p)return!1;for(var m=0;m<p;++m)if(!z1(c,s[m],d[m],n))return!1;return!0}return z1(c,s,d,n)}else{var v=a2(a,n.fragmentMap);if(v)return f7(v)?!0:z1(v.selectionSet,t,r,n)}})}function f7(e){return!!e.directives&&e.directives.some(CM)}function CM(e){return e.name.value==="nonreactive"}var k$=function(){function e(){this.assumeImmutableResults=!1,this.getFragmentDoc=hu(PN,{max:eo["cache.fragmentQueryDocuments"]||1e3,cache:ch})}return e.prototype.batch=function(t){var r=this,n=typeof t.optimistic=="string"?t.optimistic:t.optimistic===!1?null:void 0,i;return this.performTransaction(function(){return i=t.update(r)},n),i},e.prototype.recordOptimisticTransaction=function(t,r){this.performTransaction(t,r)},e.prototype.transformDocument=function(t){return t},e.prototype.transformForLink=function(t){return t},e.prototype.identify=function(t){},e.prototype.gc=function(){return[]},e.prototype.modify=function(t){return!1},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(te(te({},t),{rootId:t.id||"ROOT_QUERY",optimistic:r}))},e.prototype.watchFragment=function(t){var r=this,n=t.fragment,i=t.fragmentName,a=t.from,o=t.optimistic,s=o===void 0?!0:o,d=ta(t,["fragment","fragmentName","from","optimistic"]),c=this.getFragmentDoc(n,i),h=te(te({},d),{returnPartialData:!0,id:typeof a>"u"||typeof a=="string"?a:this.identify(a),query:c,optimistic:s}),f;return new cr(function(p){return r.watch(te(te({},h),{immediate:!0,callback:function(m){if(!(f&&_$(c,{data:f?.result},{data:m.result}))){var v={data:m.result,complete:!!m.complete};m.missing&&(v.missing=u2(m.missing.map(function($){return $.missing}))),f=m,p.next(v)}}}))})},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!!t.optimistic),this.read(te(te({},t),{query:this.getFragmentDoc(t.fragment,t.fragmentName),rootId:t.id,optimistic:r}))},e.prototype.writeQuery=function(t){var r=t.id,n=t.data,i=ta(t,["id","data"]);return this.write(Object.assign(i,{dataId:r||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(t){var r=t.id,n=t.data,i=t.fragment,a=t.fragmentName,o=ta(t,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(i,a),dataId:r,result:n}))},e.prototype.updateQuery=function(t,r){return this.batch({update:function(n){var i=n.readQuery(t),a=r(i);return a==null?i:(n.writeQuery(te(te({},t),{data:a})),a)}})},e.prototype.updateFragment=function(t,r){return this.batch({update:function(n){var i=n.readFragment(t),a=r(i);return a==null?i:(n.writeFragment(te(te({},t),{data:a})),a)}})},e}();globalThis.__DEV__!==!1&&(k$.prototype.getMemoryInternals=UN);var C$=function(e){ka(t,e);function t(r,n,i,a){var o,s=e.call(this,r)||this;if(s.message=r,s.path=n,s.query=i,s.variables=a,Array.isArray(s.path)){s.missing=s.message;for(var d=s.path.length-1;d>=0;--d)s.missing=(o={},o[s.path[d]]=s.missing,o)}else s.missing=s.path;return s.__proto__=t.prototype,s}return t}(Error),rn=Object.prototype.hasOwnProperty;function xc(e){return e==null}function S$(e,t){var r=e.__typename,n=e.id,i=e._id;if(typeof r=="string"&&(t&&(t.keyObject=xc(n)?xc(i)?void 0:{_id:i}:{id:n}),xc(n)&&!xc(i)&&(n=i),!xc(n)))return"".concat(r,":").concat(typeof n=="number"||typeof n=="string"?n:JSON.stringify(n))}var E$={dataIdFromObject:S$,addTypename:!0,resultCaching:!0,canonizeResults:!1};function SM(e){return gd(E$,e)}function T$(e){var t=e.canonizeResults;return t===void 0?E$.canonizeResults:t}function EM(e,t){return Wt(t)?e.get(t.__ref,"__typename"):t&&t.__typename}var A$=/^[_a-z][_0-9a-z]*/i;function Uo(e){var t=e.match(A$);return t?t[0]:e}function G5(e,t,r){return Or(t)?Pr(t)?t.every(function(n){return G5(e,n,r)}):e.selections.every(function(n){if(zo(n)&&Du(n,r)){var i=Fo(n);return rn.call(t,i)&&(!n.selectionSet||G5(n.selectionSet,t[i],r))}return!0}):!1}function ql(e){return Or(e)&&!Wt(e)&&!Pr(e)}function TM(){return new Vo}function O$(e,t){var r=i2(s2(e));return{fragmentMap:r,lookupFragment:function(n){var i=r[n];return!i&&t&&(i=t.lookup(n)),i||null}}}var j1=Object.create(null),gp=function(){return j1},p7=Object.create(null),fu=function(){function e(t,r){var n=this;this.policies=t,this.group=r,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(i,a){return U5(Wt(i)?n.get(i.__ref,a):i&&i[a])},this.canRead=function(i){return Wt(i)?n.has(i.__ref):typeof i=="object"},this.toReference=function(i,a){if(typeof i=="string")return Xl(i);if(Wt(i))return i;var o=n.policies.identify(i)[0];if(o){var s=Xl(o);return a&&n.merge(o,i),s}}}return e.prototype.toObject=function(){return te({},this.data)},e.prototype.has=function(t){return this.lookup(t,!0)!==void 0},e.prototype.get=function(t,r){if(this.group.depend(t,r),rn.call(this.data,t)){var n=this.data[t];if(n&&rn.call(n,r))return n[r]}if(r==="__typename"&&rn.call(this.policies.rootTypenamesById,t))return this.policies.rootTypenamesById[t];if(this instanceof ko)return this.parent.get(t,r)},e.prototype.lookup=function(t,r){if(r&&this.group.depend(t,"__exists"),rn.call(this.data,t))return this.data[t];if(this instanceof ko)return this.parent.lookup(t,r);if(this.policies.rootTypenamesById[t])return Object.create(null)},e.prototype.merge=function(t,r){var n=this,i;Wt(t)&&(t=t.__ref),Wt(r)&&(r=r.__ref);var a=typeof t=="string"?this.lookup(i=t):t,o=typeof r=="string"?this.lookup(i=r):r;if(o){tt(typeof i=="string",1);var s=new Vo(OM).merge(a,o);if(this.data[i]=s,s!==a&&(delete this.refs[i],this.group.caching)){var d=Object.create(null);a||(d.__exists=1),Object.keys(o).forEach(function(c){if(!a||a[c]!==s[c]){d[c]=1;var h=Uo(c);h!==c&&!n.policies.hasKeyArgs(s.__typename,h)&&(d[h]=1),s[c]===void 0&&!(n instanceof ko)&&delete s[c]}}),d.__typename&&!(a&&a.__typename)&&this.policies.rootTypenamesById[i]===s.__typename&&delete d.__typename,Object.keys(d).forEach(function(c){return n.group.dirty(i,c)})}}},e.prototype.modify=function(t,r){var n=this,i=this.lookup(t);if(i){var a=Object.create(null),o=!1,s=!0,d={DELETE:j1,INVALIDATE:p7,isReference:Wt,toReference:this.toReference,canRead:this.canRead,readField:function(c,h){return n.policies.readField(typeof c=="string"?{fieldName:c,from:h||Xl(t)}:c,{store:n})}};if(Object.keys(i).forEach(function(c){var h=Uo(c),f=i[c];if(f!==void 0){var p=typeof r=="function"?r:r[c]||r[h];if(p){var m=p===gp?j1:p(U5(f),te(te({},d),{fieldName:h,storeFieldName:c,storage:n.getStorage(t,c)}));if(m===p7)n.group.dirty(t,c);else if(m===j1&&(m=void 0),m!==f&&(a[c]=m,o=!0,f=m,globalThis.__DEV__!==!1)){var v=function(P){if(n.lookup(P.__ref)===void 0)return globalThis.__DEV__!==!1&&tt.warn(2,P),!0};if(Wt(m))v(m);else if(Array.isArray(m))for(var $=!1,w=void 0,x=0,C=m;x<C.length;x++){var k=C[x];if(Wt(k)){if($=!0,v(k))break}else if(typeof k=="object"&&k){var S=n.policies.identify(k)[0];S&&(w=k)}if($&&w!==void 0){globalThis.__DEV__!==!1&&tt.warn(3,w);break}}}}f!==void 0&&(s=!1)}}),o)return this.merge(t,a),s&&(this instanceof ko?this.data[t]=void 0:delete this.data[t],this.group.dirty(t,"__exists")),!0}return!1},e.prototype.delete=function(t,r,n){var i,a=this.lookup(t);if(a){var o=this.getFieldValue(a,"__typename"),s=r&&n?this.policies.getStoreFieldName({typename:o,fieldName:r,args:n}):r;return this.modify(t,s?(i={},i[s]=gp,i):gp)}return!1},e.prototype.evict=function(t,r){var n=!1;return t.id&&(rn.call(this.data,t.id)&&(n=this.delete(t.id,t.fieldName,t.args)),this instanceof ko&&this!==r&&(n=this.parent.evict(t,r)||n),(t.fieldName||n)&&this.group.dirty(t.id,t.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var t=this,r=this.toObject(),n=[];return this.getRootIdSet().forEach(function(i){rn.call(t.policies.rootTypenamesById,i)||n.push(i)}),n.length&&(r.__META={extraRootIds:n.sort()}),r},e.prototype.replace=function(t){var r=this;if(Object.keys(this.data).forEach(function(a){t&&rn.call(t,a)||r.delete(a)}),t){var n=t.__META,i=ta(t,["__META"]);Object.keys(i).forEach(function(a){r.merge(a,i[a])}),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(t){return this.rootIds[t]=(this.rootIds[t]||0)+1},e.prototype.release=function(t){if(this.rootIds[t]>0){var r=--this.rootIds[t];return r||delete this.rootIds[t],r}return 0},e.prototype.getRootIdSet=function(t){return t===void 0&&(t=new Set),Object.keys(this.rootIds).forEach(t.add,t),this instanceof ko?this.parent.getRootIdSet(t):Object.keys(this.policies.rootTypenamesById).forEach(t.add,t),t},e.prototype.gc=function(){var t=this,r=this.getRootIdSet(),n=this.toObject();r.forEach(function(o){rn.call(n,o)&&(Object.keys(t.findChildRefIds(o)).forEach(r.add,r),delete n[o])});var i=Object.keys(n);if(i.length){for(var a=this;a instanceof ko;)a=a.parent;i.forEach(function(o){return a.delete(o)})}return i},e.prototype.findChildRefIds=function(t){if(!rn.call(this.refs,t)){var r=this.refs[t]=Object.create(null),n=this.data[t];if(!n)return r;var i=new Set([n]);i.forEach(function(a){Wt(a)&&(r[a.__ref]=!0),Or(a)&&Object.keys(a).forEach(function(o){var s=a[o];Or(s)&&i.add(s)})})}return this.refs[t]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),P$=function(){function e(t,r){r===void 0&&(r=null),this.caching=t,this.parent=r,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?l$():null,this.keyMaker=new Td(Ad)},e.prototype.depend=function(t,r){if(this.d){this.d(mp(t,r));var n=Uo(r);n!==r&&this.d(mp(t,n)),this.parent&&this.parent.depend(t,r)}},e.prototype.dirty=function(t,r){this.d&&this.d.dirty(mp(t,r),r==="__exists"?"forget":"setDirty")},e}();function mp(e,t){return t+"#"+e}function g7(e,t){Zc(e)&&e.group.depend(t,"__exists")}(function(e){var t=function(r){ka(n,r);function n(i){var a=i.policies,o=i.resultCaching,s=o===void 0?!0:o,d=i.seed,c=r.call(this,a,new P$(s))||this;return c.stump=new AM(c),c.storageTrie=new Td(Ad),d&&c.replace(d),c}return n.prototype.addLayer=function(i,a){return this.stump.addLayer(i,a)},n.prototype.removeLayer=function(){return this},n.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},n}(e);e.Root=t})(fu||(fu={}));var ko=function(e){ka(t,e);function t(r,n,i,a){var o=e.call(this,n.policies,a)||this;return o.id=r,o.parent=n,o.replay=i,o.group=a,i(o),o}return t.prototype.addLayer=function(r,n){return new t(r,this,n,this.group)},t.prototype.removeLayer=function(r){var n=this,i=this.parent.removeLayer(r);return r===this.id?(this.group.caching&&Object.keys(this.data).forEach(function(a){var o=n.data[a],s=i.lookup(a);s?o?o!==s&&Object.keys(o).forEach(function(d){vr(o[d],s[d])||n.group.dirty(a,d)}):(n.group.dirty(a,"__exists"),Object.keys(s).forEach(function(d){n.group.dirty(a,d)})):n.delete(a)}),i):i===this.parent?this:i.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return te(te({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(r){var n=this.parent.findChildRefIds(r);return rn.call(this.data,r)?te(te({},n),e.prototype.findChildRefIds.call(this,r)):n},t.prototype.getStorage=function(){for(var r=this.parent;r.parent;)r=r.parent;return r.getStorage.apply(r,arguments)},t}(fu),AM=function(e){ka(t,e);function t(r){return e.call(this,"EntityStore.Stump",r,function(){},new P$(r.group.caching,r.group))||this}return t.prototype.removeLayer=function(){return this},t.prototype.merge=function(r,n){return this.parent.merge(r,n)},t}(ko);function OM(e,t,r){var n=e[r],i=t[r];return vr(n,i)?n:i}function Zc(e){return!!(e instanceof fu&&e.group.caching)}function PM(e){return Or(e)?Pr(e)?e.slice(0):te({__proto__:Object.getPrototypeOf(e)},e):e}var m7=function(){function e(){this.known=new(Vb?WeakSet:Set),this.pool=new Td(Ad),this.passes=new WeakMap,this.keysByJSON=new Map,this.empty=this.admit({})}return e.prototype.isKnown=function(t){return Or(t)&&this.known.has(t)},e.prototype.pass=function(t){if(Or(t)){var r=PM(t);return this.passes.set(r,t),r}return t},e.prototype.admit=function(t){var r=this;if(Or(t)){var n=this.passes.get(t);if(n)return n;var i=Object.getPrototypeOf(t);switch(i){case Array.prototype:{if(this.known.has(t))return t;var a=t.map(this.admit,this),o=this.pool.lookupArray(a);return o.array||(this.known.add(o.array=a),globalThis.__DEV__!==!1&&Object.freeze(a)),o.array}case null:case Object.prototype:{if(this.known.has(t))return t;var s=Object.getPrototypeOf(t),d=[s],c=this.sortedKeys(t);d.push(c.json);var h=d.length;c.sorted.forEach(function(m){d.push(r.admit(t[m]))});var o=this.pool.lookupArray(d);if(!o.object){var f=o.object=Object.create(s);this.known.add(f),c.sorted.forEach(function(m,v){f[m]=d[h+v]}),globalThis.__DEV__!==!1&&Object.freeze(f)}return o.object}}}return t},e.prototype.sortedKeys=function(t){var r=Object.keys(t),n=this.pool.lookupArray(r);if(!n.keys){r.sort();var i=JSON.stringify(r);(n.keys=this.keysByJSON.get(i))||this.keysByJSON.set(i,n.keys={sorted:r,json:i})}return n.keys},e}();function v7(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var IM=function(){function e(t){var r=this;this.knownResults=new(Ad?WeakMap:Map),this.config=gd(t,{addTypename:t.addTypename!==!1,canonizeResults:T$(t)}),this.canon=t.canon||new m7,this.executeSelectionSet=hu(function(n){var i,a=n.context.canonizeResults,o=v7(n);o[3]=!a;var s=(i=r.executeSelectionSet).peek.apply(i,o);return s?a?te(te({},s),{result:r.canon.admit(s.result)}):s:(g7(n.context.store,n.enclosingRef.__ref),r.execSelectionSetImpl(n))},{max:this.config.resultCacheMaxSize||eo["inMemoryCache.executeSelectionSet"]||5e4,keyArgs:v7,makeCacheKey:function(n,i,a,o){if(Zc(a.store))return a.store.makeCacheKey(n,Wt(i)?i.__ref:i,a.varString,o)}}),this.executeSubSelectedArray=hu(function(n){return g7(n.context.store,n.enclosingRef.__ref),r.execSubSelectedArrayImpl(n)},{max:this.config.resultCacheMaxSize||eo["inMemoryCache.executeSubSelectedArray"]||1e4,makeCacheKey:function(n){var i=n.field,a=n.array,o=n.context;if(Zc(o.store))return o.store.makeCacheKey(i,a,o.varString)}})}return e.prototype.resetCanon=function(){this.canon=new m7},e.prototype.diffQueryAgainstStore=function(t){var r=t.store,n=t.query,i=t.rootId,a=i===void 0?"ROOT_QUERY":i,o=t.variables,s=t.returnPartialData,d=s===void 0?!0:s,c=t.canonizeResults,h=c===void 0?this.config.canonizeResults:c,f=this.config.cache.policies;o=te(te({},zg(Yb(n))),o);var p=Xl(a),m=this.executeSelectionSet({selectionSet:Ru(n).selectionSet,objectOrReference:p,enclosingRef:p,context:te({store:r,query:n,policies:f,variables:o,varString:Do(o),canonizeResults:h},O$(n,this.config.fragments))}),v;if(m.missing&&(v=[new C$(NM(m.missing),m.missing,n,o)],!d))throw v[0];return{result:m.result,complete:!v,missing:v}},e.prototype.isFresh=function(t,r,n,i){if(Zc(i.store)&&this.knownResults.get(t)===n){var a=this.executeSelectionSet.peek(n,r,i,this.canon.isKnown(t));if(a&&t===a.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(t){var r=this,n=t.selectionSet,i=t.objectOrReference,a=t.enclosingRef,o=t.context;if(Wt(i)&&!o.policies.rootTypenamesById[i.__ref]&&!o.store.has(i.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(i.__ref," object")};var s=o.variables,d=o.policies,c=o.store,h=c.getFieldValue(i,"__typename"),f=[],p,m=new Vo;this.config.addTypename&&typeof h=="string"&&!d.rootIdsByTypename[h]&&f.push({__typename:h});function v(k,S){var P;return k.missing&&(p=m.merge(p,(P={},P[S]=k.missing,P))),k.result}var $=new Set(n.selections);$.forEach(function(k){var S,P;if(Du(k,s))if(zo(k)){var N=d.readField({fieldName:k.name.value,field:k,variables:o.variables,from:i},o),j=Fo(k);N===void 0?qg.added(k)||(p=m.merge(p,(S={},S[j]="Can't find field '".concat(k.name.value,"' on ").concat(Wt(i)?i.__ref+" object":"object "+JSON.stringify(i,null,2)),S))):Pr(N)?N.length>0&&(N=v(r.executeSubSelectedArray({field:k,array:N,enclosingRef:a,context:o}),j)):k.selectionSet?N!=null&&(N=v(r.executeSelectionSet({selectionSet:k.selectionSet,objectOrReference:N,enclosingRef:Wt(N)?N:a,context:o}),j)):o.canonizeResults&&(N=r.canon.pass(N)),N!==void 0&&f.push((P={},P[j]=N,P))}else{var F=a2(k,o.lookupFragment);if(!F&&k.kind===Ue.FRAGMENT_SPREAD)throw zn(9,k.name.value);F&&d.fragmentMatches(F,h)&&F.selectionSet.selections.forEach($.add,$)}});var w=u2(f),x={result:w,missing:p},C=o.canonizeResults?this.canon.admit(x):U5(x);return C.result&&this.knownResults.set(C.result,n),C},e.prototype.execSubSelectedArrayImpl=function(t){var r=this,n=t.field,i=t.array,a=t.enclosingRef,o=t.context,s,d=new Vo;function c(h,f){var p;return h.missing&&(s=d.merge(s,(p={},p[f]=h.missing,p))),h.result}return n.selectionSet&&(i=i.filter(o.store.canRead)),i=i.map(function(h,f){return h===null?null:Pr(h)?c(r.executeSubSelectedArray({field:n,array:h,enclosingRef:a,context:o}),f):n.selectionSet?c(r.executeSelectionSet({selectionSet:n.selectionSet,objectOrReference:h,enclosingRef:Wt(h)?h:a,context:o}),f):(globalThis.__DEV__!==!1&&DM(o.store,n,h),h)}),{result:o.canonizeResults?this.canon.admit(i):i,missing:s}},e}();function NM(e){try{JSON.stringify(e,function(t,r){if(typeof r=="string")throw r;return r})}catch(t){return t}}function DM(e,t,r){if(!t.selectionSet){var n=new Set([r]);n.forEach(function(i){Or(i)&&(tt(!Wt(i),10,EM(e,i),t.name.value),Object.values(i).forEach(n.add,n))})}}var Yg=new Zb,y7=new WeakMap;function Xc(e){var t=y7.get(e);return t||y7.set(e,t={vars:new Set,dep:l$()}),t}function b7(e){Xc(e).vars.forEach(function(t){return t.forgetCache(e)})}function MM(e){Xc(e).vars.forEach(function(t){return t.attachCache(e)})}function LM(e){var t=new Set,r=new Set,n=function(a){if(arguments.length>0){if(e!==a){e=a,t.forEach(function(d){Xc(d).dep.dirty(n),RM(d)});var o=Array.from(r);r.clear(),o.forEach(function(d){return d(e)})}}else{var s=Yg.getValue();s&&(i(s),Xc(s).dep(n))}return e};n.onNextChange=function(a){return r.add(a),function(){r.delete(a)}};var i=n.attachCache=function(a){return t.add(a),Xc(a).vars.add(n),n};return n.forgetCache=function(a){return t.delete(a)},n}function RM(e){e.broadcastWatches&&e.broadcastWatches()}var $7=Object.create(null);function Zg(e){var t=JSON.stringify(e);return $7[t]||($7[t]=Object.create(null))}function w7(e){var t=Zg(e);return t.keyFieldsFn||(t.keyFieldsFn=function(r,n){var i=function(o,s){return n.readField(s,o)},a=n.keyObject=Xg(e,function(o){var s=ed(n.storeObject,o,i);return s===void 0&&r!==n.storeObject&&rn.call(r,o[0])&&(s=ed(r,o,N$)),tt(s!==void 0,4,o.join("."),r),s});return"".concat(n.typename,":").concat(JSON.stringify(a))})}function x7(e){var t=Zg(e);return t.keyArgsFn||(t.keyArgsFn=function(r,n){var i=n.field,a=n.variables,o=n.fieldName,s=Xg(e,function(c){var h=c[0],f=h.charAt(0);if(f==="@"){if(i&&$a(i.directives)){var p=h.slice(1),m=i.directives.find(function(x){return x.name.value===p}),v=m&&o2(m,a);return v&&ed(v,c.slice(1))}return}if(f==="$"){var $=h.slice(1);if(a&&rn.call(a,$)){var w=c.slice(0);return w[0]=$,ed(a,w)}return}if(r)return ed(r,c)}),d=JSON.stringify(s);return(r||d!=="{}")&&(o+=":"+d),o})}function Xg(e,t){var r=new Vo;return I$(e).reduce(function(n,i){var a,o=t(i);if(o!==void 0){for(var s=i.length-1;s>=0;--s)o=(a={},a[i[s]]=o,a);n=r.merge(n,o)}return n},Object.create(null))}function I$(e){var t=Zg(e);if(!t.paths){var r=t.paths=[],n=[];e.forEach(function(i,a){Pr(i)?(I$(i).forEach(function(o){return r.push(n.concat(o))}),n.length=0):(n.push(i),Pr(e[a+1])||(r.push(n.slice(0)),n.length=0))})}return t.paths}function N$(e,t){return e[t]}function ed(e,t,r){return r=r||N$,D$(t.reduce(function n(i,a){return Pr(i)?i.map(function(o){return n(o,a)}):i&&r(i,a)},e))}function D$(e){return Or(e)?Pr(e)?e.map(D$):Xg(Object.keys(e).sort(),function(t){return ed(e,t)}):e}function K5(e){return e.args!==void 0?e.args:e.field?o2(e.field,e.variables):null}var FM=function(){},_7=function(e,t){return t.fieldName},k7=function(e,t,r){var n=r.mergeObjects;return n(e,t)},C7=function(e,t){return t},zM=function(){function e(t){this.config=t,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=te({dataIdFromObject:S$},t),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),t.possibleTypes&&this.addPossibleTypes(t.possibleTypes),t.typePolicies&&this.addTypePolicies(t.typePolicies)}return e.prototype.identify=function(t,r){var n,i=this,a=r&&(r.typename||((n=r.storeObject)===null||n===void 0?void 0:n.__typename))||t.__typename;if(a===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o=r&&r.storeObject||t,s=te(te({},r),{typename:a,storeObject:o,readField:r&&r.readField||function(){var p=Jg(arguments,o);return i.readField(p,{store:i.cache.data,variables:p.variables})}}),d,c=a&&this.getTypePolicy(a),h=c&&c.keyFn||this.config.dataIdFromObject;h;){var f=h(te(te({},t),o),s);if(Pr(f))h=w7(f);else{d=f;break}}return d=d?String(d):void 0,s.keyObject?[d,s.keyObject]:[d]},e.prototype.addTypePolicies=function(t){var r=this;Object.keys(t).forEach(function(n){var i=t[n],a=i.queryType,o=i.mutationType,s=i.subscriptionType,d=ta(i,["queryType","mutationType","subscriptionType"]);a&&r.setRootTypename("Query",n),o&&r.setRootTypename("Mutation",n),s&&r.setRootTypename("Subscription",n),rn.call(r.toBeAdded,n)?r.toBeAdded[n].push(d):r.toBeAdded[n]=[d]})},e.prototype.updateTypePolicy=function(t,r){var n=this,i=this.getTypePolicy(t),a=r.keyFields,o=r.fields;function s(d,c){d.merge=typeof c=="function"?c:c===!0?k7:c===!1?C7:d.merge}s(i,r.merge),i.keyFn=a===!1?FM:Pr(a)?w7(a):typeof a=="function"?a:i.keyFn,o&&Object.keys(o).forEach(function(d){var c=n.getFieldPolicy(t,d,!0),h=o[d];if(typeof h=="function")c.read=h;else{var f=h.keyArgs,p=h.read,m=h.merge;c.keyFn=f===!1?_7:Pr(f)?x7(f):typeof f=="function"?f:c.keyFn,typeof p=="function"&&(c.read=p),s(c,m)}c.read&&c.merge&&(c.keyFn=c.keyFn||_7)})},e.prototype.setRootTypename=function(t,r){r===void 0&&(r=t);var n="ROOT_"+t.toUpperCase(),i=this.rootTypenamesById[n];r!==i&&(tt(!i||i===t,5,t),i&&delete this.rootIdsByTypename[i],this.rootIdsByTypename[r]=n,this.rootTypenamesById[n]=r)},e.prototype.addPossibleTypes=function(t){var r=this;this.usingPossibleTypes=!0,Object.keys(t).forEach(function(n){r.getSupertypeSet(n,!0),t[n].forEach(function(i){r.getSupertypeSet(i,!0).add(n);var a=i.match(A$);(!a||a[0]!==i)&&r.fuzzySubtypes.set(i,new RegExp(i))})})},e.prototype.getTypePolicy=function(t){var r=this;if(!rn.call(this.typePolicies,t)){var n=this.typePolicies[t]=Object.create(null);n.fields=Object.create(null);var i=this.supertypeMap.get(t);!i&&this.fuzzySubtypes.size&&(i=this.getSupertypeSet(t,!0),this.fuzzySubtypes.forEach(function(o,s){if(o.test(t)){var d=r.supertypeMap.get(s);d&&d.forEach(function(c){return i.add(c)})}})),i&&i.size&&i.forEach(function(o){var s=r.getTypePolicy(o),d=s.fields,c=ta(s,["fields"]);Object.assign(n,c),Object.assign(n.fields,d)})}var a=this.toBeAdded[t];return a&&a.length&&a.splice(0).forEach(function(o){r.updateTypePolicy(t,o)}),this.typePolicies[t]},e.prototype.getFieldPolicy=function(t,r,n){if(t){var i=this.getTypePolicy(t).fields;return i[r]||n&&(i[r]=Object.create(null))}},e.prototype.getSupertypeSet=function(t,r){var n=this.supertypeMap.get(t);return!n&&r&&this.supertypeMap.set(t,n=new Set),n},e.prototype.fragmentMatches=function(t,r,n,i){var a=this;if(!t.typeCondition)return!0;if(!r)return!1;var o=t.typeCondition.name.value;if(r===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var s=this.getSupertypeSet(r,!0),d=[s],c=function(v){var $=a.getSupertypeSet(v,!1);$&&$.size&&d.indexOf($)<0&&d.push($)},h=!!(n&&this.fuzzySubtypes.size),f=!1,p=0;p<d.length;++p){var m=d[p];if(m.has(o))return s.has(o)||(f&&globalThis.__DEV__!==!1&&tt.warn(6,r,o),s.add(o)),!0;m.forEach(c),h&&p===d.length-1&&G5(t.selectionSet,n,i)&&(h=!1,f=!0,this.fuzzySubtypes.forEach(function(v,$){var w=r.match(v);w&&w[0]===r&&c($)}))}return!1},e.prototype.hasKeyArgs=function(t,r){var n=this.getFieldPolicy(t,r,!1);return!!(n&&n.keyFn)},e.prototype.getStoreFieldName=function(t){var r=t.typename,n=t.fieldName,i=this.getFieldPolicy(r,n,!1),a,o=i&&i.keyFn;if(o&&r)for(var s={typename:r,fieldName:n,field:t.field||null,variables:t.variables},d=K5(t);o;){var c=o(d,s);if(Pr(c))o=x7(c);else{a=c||n;break}}return a===void 0&&(a=t.field?aD(t.field,t.variables):Kb(n,K5(t))),a===!1?n:n===Uo(a)?a:n+":"+a},e.prototype.readField=function(t,r){var n=t.from;if(n){var i=t.field||t.fieldName;if(i){if(t.typename===void 0){var a=r.store.getFieldValue(n,"__typename");a&&(t.typename=a)}var o=this.getStoreFieldName(t),s=Uo(o),d=r.store.getFieldValue(n,o),c=this.getFieldPolicy(t.typename,s,!1),h=c&&c.read;if(h){var f=S7(this,n,t,r,r.store.getStorage(Wt(n)?n.__ref:n,o));return Yg.withValue(this.cache,h,[d,f])}return d}}},e.prototype.getReadFunction=function(t,r){var n=this.getFieldPolicy(t,r,!1);return n&&n.read},e.prototype.getMergeFunction=function(t,r,n){var i=this.getFieldPolicy(t,r,!1),a=i&&i.merge;return!a&&n&&(i=this.getTypePolicy(n),a=i&&i.merge),a},e.prototype.runMergeFunction=function(t,r,n,i,a){var o=n.field,s=n.typename,d=n.merge;return d===k7?M$(i.store)(t,r):d===C7?r:(i.overwrite&&(t=void 0),d(t,r,S7(this,void 0,{typename:s,fieldName:o.name.value,field:o,variables:i.variables},i,a||Object.create(null))))},e}();function S7(e,t,r,n,i){var a=e.getStoreFieldName(r),o=Uo(a),s=r.variables||n.variables,d=n.store,c=d.toReference,h=d.canRead;return{args:K5(r),field:r.field||null,fieldName:o,storeFieldName:a,variables:s,isReference:Wt,toReference:c,storage:i,cache:e.cache,canRead:h,readField:function(){return e.readField(Jg(arguments,t,s),n)},mergeObjects:M$(n.store)}}function Jg(e,t,r){var n=e[0],i=e[1],a=e.length,o;return typeof n=="string"?o={fieldName:n,from:a>1?i:t}:(o=te({},n),rn.call(o,"from")||(o.from=t)),globalThis.__DEV__!==!1&&o.from===void 0&&globalThis.__DEV__!==!1&&tt.warn(7,Eb(Array.from(e))),o.variables===void 0&&(o.variables=r),o}function M$(e){return function(r,n){if(Pr(r)||Pr(n))throw zn(8);if(Or(r)&&Or(n)){var i=e.getFieldValue(r,"__typename"),a=e.getFieldValue(n,"__typename"),o=i&&a&&i!==a;if(o)return n;if(Wt(r)&&ql(n))return e.merge(r.__ref,n),r;if(ql(r)&&Wt(n))return e.merge(r,n.__ref),n;if(ql(r)&&ql(n))return te(te({},r),n)}return n}}function vp(e,t,r){var n="".concat(t).concat(r),i=e.flavors.get(n);return i||e.flavors.set(n,i=e.clientOnly===t&&e.deferred===r?e:te(te({},e),{clientOnly:t,deferred:r})),i}var jM=function(){function e(t,r,n){this.cache=t,this.reader=r,this.fragments=n}return e.prototype.writeToStore=function(t,r){var n=this,i=r.query,a=r.result,o=r.dataId,s=r.variables,d=r.overwrite,c=Lu(i),h=TM();s=te(te({},zg(c)),s);var f=te(te({store:t,written:Object.create(null),merge:function(m,v){return h.merge(m,v)},variables:s,varString:Do(s)},O$(i,this.fragments)),{overwrite:!!d,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map}),p=this.processSelectionSet({result:a||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:f});if(!Wt(p))throw zn(11,a);return f.incomingById.forEach(function(m,v){var $=m.storeObject,w=m.mergeTree,x=m.fieldNodeSet,C=Xl(v);if(w&&w.map.size){var k=n.applyMerges(w,C,$,f);if(Wt(k))return;$=k}if(globalThis.__DEV__!==!1&&!f.overwrite){var S=Object.create(null);x.forEach(function(j){j.selectionSet&&(S[j.name.value]=!0)});var P=function(j){return S[Uo(j)]===!0},N=function(j){var F=w&&w.map.get(j);return!!(F&&F.info&&F.info.merge)};Object.keys($).forEach(function(j){P(j)&&!N(j)&&VM(C,$,j,f.store)})}t.merge(v,$)}),t.retain(p.__ref),p},e.prototype.processSelectionSet=function(t){var r=this,n=t.dataId,i=t.result,a=t.selectionSet,o=t.context,s=t.mergeTree,d=this.cache.policies,c=Object.create(null),h=n&&d.rootTypenamesById[n]||R5(i,a,o.fragmentMap)||n&&o.store.get(n,"__typename");typeof h=="string"&&(c.__typename=h);var f=function(){var k=Jg(arguments,c,o.variables);if(Wt(k.from)){var S=o.incomingById.get(k.from.__ref);if(S){var P=d.readField(te(te({},k),{from:S.storeObject}),o);if(P!==void 0)return P}}return d.readField(k,o)},p=new Set;this.flattenFields(a,i,o,h).forEach(function(k,S){var P,N=Fo(S),j=i[N];if(p.add(S),j!==void 0){var F=d.getStoreFieldName({typename:h,fieldName:S.name.value,field:S,variables:k.variables}),W=E7(s,F),J=r.processFieldValue(j,S,S.selectionSet?vp(k,!1,!1):k,W),U=void 0;S.selectionSet&&(Wt(J)||ql(J))&&(U=f("__typename",J));var G=d.getMergeFunction(h,S.name.value,U);G?W.info={field:S,typename:h,merge:G}:T7(s,F),c=k.merge(c,(P={},P[F]=J,P))}else globalThis.__DEV__!==!1&&!k.clientOnly&&!k.deferred&&!qg.added(S)&&!d.getReadFunction(h,S.name.value)&&globalThis.__DEV__!==!1&&tt.error(12,Fo(S),i)});try{var m=d.identify(i,{typename:h,selectionSet:a,fragmentMap:o.fragmentMap,storeObject:c,readField:f}),v=m[0],$=m[1];n=n||v,$&&(c=o.merge(c,$))}catch(k){if(!n)throw k}if(typeof n=="string"){var w=Xl(n),x=o.written[n]||(o.written[n]=[]);if(x.indexOf(a)>=0||(x.push(a),this.reader&&this.reader.isFresh(i,w,a,o)))return w;var C=o.incomingById.get(n);return C?(C.storeObject=o.merge(C.storeObject,c),C.mergeTree=Y5(C.mergeTree,s),p.forEach(function(k){return C.fieldNodeSet.add(k)})):o.incomingById.set(n,{storeObject:c,mergeTree:hh(s)?void 0:s,fieldNodeSet:p}),w}return c},e.prototype.processFieldValue=function(t,r,n,i){var a=this;return!r.selectionSet||t===null?globalThis.__DEV__!==!1?m$(t):t:Pr(t)?t.map(function(o,s){var d=a.processFieldValue(o,r,n,E7(i,s));return T7(i,s),d}):this.processSelectionSet({result:t,selectionSet:r.selectionSet,context:n,mergeTree:i})},e.prototype.flattenFields=function(t,r,n,i){i===void 0&&(i=R5(r,t,n.fragmentMap));var a=new Map,o=this.cache.policies,s=new Td(!1);return function d(c,h){var f=s.lookup(c,h.clientOnly,h.deferred);f.visited||(f.visited=!0,c.selections.forEach(function(p){if(Du(p,n.variables)){var m=h.clientOnly,v=h.deferred;if(!(m&&v)&&$a(p.directives)&&p.directives.forEach(function(x){var C=x.name.value;if(C==="client"&&(m=!0),C==="defer"){var k=o2(x,n.variables);(!k||k.if!==!1)&&(v=!0)}}),zo(p)){var $=a.get(p);$&&(m=m&&$.clientOnly,v=v&&$.deferred),a.set(p,vp(n,m,v))}else{var w=a2(p,n.lookupFragment);if(!w&&p.kind===Ue.FRAGMENT_SPREAD)throw zn(13,p.name.value);w&&o.fragmentMatches(w,i,r,n.variables)&&d(w.selectionSet,vp(n,m,v))}}}))}(t,n),a},e.prototype.applyMerges=function(t,r,n,i,a){var o,s=this;if(t.map.size&&!Wt(n)){var d=!Pr(n)&&(Wt(r)||ql(r))?r:void 0,c=n;d&&!a&&(a=[Wt(d)?d.__ref:d]);var h,f=function(p,m){return Pr(p)?typeof m=="number"?p[m]:void 0:i.store.getFieldValue(p,String(m))};t.map.forEach(function(p,m){var v=f(d,m),$=f(c,m);if($!==void 0){a&&a.push(m);var w=s.applyMerges(p,v,$,i,a);w!==$&&(h=h||new Map,h.set(m,w)),a&&tt(a.pop()===m)}}),h&&(n=Pr(c)?c.slice(0):te({},c),h.forEach(function(p,m){n[m]=p}))}return t.info?this.cache.policies.runMergeFunction(r,n,t.info,i,a&&(o=i.store).getStorage.apply(o,a)):n},e}(),L$=[];function E7(e,t){var r=e.map;return r.has(t)||r.set(t,L$.pop()||{map:new Map}),r.get(t)}function Y5(e,t){if(e===t||!t||hh(t))return e;if(!e||hh(e))return t;var r=e.info&&t.info?te(te({},e.info),t.info):e.info||t.info,n=e.map.size&&t.map.size,i=n?new Map:e.map.size?e.map:t.map,a={info:r,map:i};if(n){var o=new Set(t.map.keys());e.map.forEach(function(s,d){a.map.set(d,Y5(s,t.map.get(d))),o.delete(d)}),o.forEach(function(s){a.map.set(s,Y5(t.map.get(s),e.map.get(s)))})}return a}function hh(e){return!e||!(e.info||e.map.size)}function T7(e,t){var r=e.map,n=r.get(t);n&&hh(n)&&(L$.push(n),r.delete(t))}var A7=new Set;function VM(e,t,r,n){var i=function(f){var p=n.getFieldValue(f,r);return typeof p=="object"&&p},a=i(e);if(a){var o=i(t);if(o&&!Wt(a)&&!vr(a,o)&&!Object.keys(a).every(function(f){return n.getFieldValue(o,f)!==void 0})){var s=n.getFieldValue(e,"__typename")||n.getFieldValue(t,"__typename"),d=Uo(r),c="".concat(s,".").concat(d);if(!A7.has(c)){A7.add(c);var h=[];!Pr(a)&&!Pr(o)&&[a,o].forEach(function(f){var p=n.getFieldValue(f,"__typename");typeof p=="string"&&!h.includes(p)&&h.push(p)}),globalThis.__DEV__!==!1&&tt.warn(14,d,s,h.length?"either ensure all objects of type "+h.join(" and ")+" have an ID or a custom merge function, or ":"",c,te({},a),te({},o))}}}}var R$=function(e){ka(t,e);function t(r){r===void 0&&(r={});var n=e.call(this)||this;return n.watches=new Set,n.addTypenameTransform=new d$(qg),n.assumeImmutableResults=!0,n.makeVar=LM,n.txCount=0,n.config=SM(r),n.addTypename=!!n.config.addTypename,n.policies=new zM({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return t.prototype.init=function(){var r=this.data=new fu.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=r.stump,this.resetResultCache()},t.prototype.resetResultCache=function(r){var n=this,i=this.storeReader,a=this.config.fragments;this.storeWriter=new jM(this,this.storeReader=new IM({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:T$(this.config),canon:r?void 0:i&&i.canon,fragments:a}),a),this.maybeBroadcastWatch=hu(function(o,s){return n.broadcastWatch(o,s)},{max:this.config.resultCacheMaxSize||eo["inMemoryCache.maybeBroadcastWatch"]||5e3,makeCacheKey:function(o){var s=o.optimistic?n.optimisticData:n.data;if(Zc(s)){var d=o.optimistic,c=o.id,h=o.variables;return s.makeCacheKey(o.query,o.callback,Do({optimistic:d,id:c,variables:h}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach(function(o){return o.resetCaching()})},t.prototype.restore=function(r){return this.init(),r&&this.data.replace(r),this},t.prototype.extract=function(r){return r===void 0&&(r=!1),(r?this.optimisticData:this.data).extract()},t.prototype.read=function(r){var n=r.returnPartialData,i=n===void 0?!1:n;try{return this.storeReader.diffQueryAgainstStore(te(te({},r),{store:r.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:i})).result||null}catch(a){if(a instanceof C$)return null;throw a}},t.prototype.write=function(r){try{return++this.txCount,this.storeWriter.writeToStore(this.data,r)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.modify=function(r){if(rn.call(r,"id")&&!r.id)return!1;var n=r.optimistic?this.optimisticData:this.data;try{return++this.txCount,n.modify(r.id||"ROOT_QUERY",r.fields)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.diff=function(r){return this.storeReader.diffQueryAgainstStore(te(te({},r),{store:r.optimistic?this.optimisticData:this.data,rootId:r.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(r){var n=this;return this.watches.size||MM(this),this.watches.add(r),r.immediate&&this.maybeBroadcastWatch(r),function(){n.watches.delete(r)&&!n.watches.size&&b7(n),n.maybeBroadcastWatch.forget(r)}},t.prototype.gc=function(r){var n;Do.reset(),c2.reset(),this.addTypenameTransform.resetCache(),(n=this.config.fragments)===null||n===void 0||n.resetCaches();var i=this.optimisticData.gc();return r&&!this.txCount&&(r.resetResultCache?this.resetResultCache(r.resetResultIdentities):r.resetResultIdentities&&this.storeReader.resetCanon()),i},t.prototype.retain=function(r,n){return(n?this.optimisticData:this.data).retain(r)},t.prototype.release=function(r,n){return(n?this.optimisticData:this.data).release(r)},t.prototype.identify=function(r){if(Wt(r))return r.__ref;try{return this.policies.identify(r)[0]}catch(n){globalThis.__DEV__!==!1&&tt.warn(n)}},t.prototype.evict=function(r){if(!r.id){if(rn.call(r,"id"))return!1;r=te(te({},r),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(r,this.data)}finally{!--this.txCount&&r.broadcast!==!1&&this.broadcastWatches()}},t.prototype.reset=function(r){var n=this;return this.init(),Do.reset(),r&&r.discardWatches?(this.watches.forEach(function(i){return n.maybeBroadcastWatch.forget(i)}),this.watches.clear(),b7(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(r){var n=this.optimisticData.removeLayer(r);n!==this.optimisticData&&(this.optimisticData=n,this.broadcastWatches())},t.prototype.batch=function(r){var n=this,i=r.update,a=r.optimistic,o=a===void 0?!0:a,s=r.removeOptimistic,d=r.onWatchUpdated,c,h=function(p){var m=n,v=m.data,$=m.optimisticData;++n.txCount,p&&(n.data=n.optimisticData=p);try{return c=i(n)}finally{--n.txCount,n.data=v,n.optimisticData=$}},f=new Set;return d&&!this.txCount&&this.broadcastWatches(te(te({},r),{onWatchUpdated:function(p){return f.add(p),!1}})),typeof o=="string"?this.optimisticData=this.optimisticData.addLayer(o,h):o===!1?h(this.data):h(),typeof s=="string"&&(this.optimisticData=this.optimisticData.removeLayer(s)),d&&f.size?(this.broadcastWatches(te(te({},r),{onWatchUpdated:function(p,m){var v=d.call(this,p,m);return v!==!1&&f.delete(p),v}})),f.size&&f.forEach(function(p){return n.maybeBroadcastWatch.dirty(p)})):this.broadcastWatches(r),c},t.prototype.performTransaction=function(r,n){return this.batch({update:r,optimistic:n||n!==null})},t.prototype.transformDocument=function(r){return this.addTypenameToDocument(this.addFragmentsToDocument(r))},t.prototype.broadcastWatches=function(r){var n=this;this.txCount||this.watches.forEach(function(i){return n.maybeBroadcastWatch(i,r)})},t.prototype.addFragmentsToDocument=function(r){var n=this.config.fragments;return n?n.transform(r):r},t.prototype.addTypenameToDocument=function(r){return this.addTypename?this.addTypenameTransform.transformDocument(r):r},t.prototype.broadcastWatch=function(r,n){var i=r.lastDiff,a=this.diff(r);n&&(r.optimistic&&typeof n.optimistic=="string"&&(a.fromOptimisticTransaction=!0),n.onWatchUpdated&&n.onWatchUpdated.call(this,r,a,i)===!1)||(!i||!vr(i.result,a.result))&&r.callback(r.lastDiff=a,i)},t}(k$);globalThis.__DEV__!==!1&&(R$.prototype.getMemoryInternals=VN);var rr;(function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"})(rr||(rr={}));function pu(e){return e?e<7:!1}var O7=Object.assign,UM=Object.hasOwnProperty,Z5=function(e){ka(t,e);function t(r){var n=r.queryManager,i=r.queryInfo,a=r.options,o=e.call(this,function(w){try{var x=w._subscription._observer;x&&!x.error&&(x.error=BM)}catch{}var C=!o.observers.size;o.observers.add(w);var k=o.last;return k&&k.error?w.error&&w.error(k.error):k&&k.result&&w.next&&w.next(k.result),C&&o.reobserve().catch(function(){}),function(){o.observers.delete(w)&&!o.observers.size&&o.tearDownQuery()}})||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=i,o.queryManager=n,o.waitForOwnResult=yp(a.fetchPolicy),o.isTornDown=!1,o.subscribeToMore=o.subscribeToMore.bind(o);var s=n.defaultOptions.watchQuery,d=s===void 0?{}:s,c=d.fetchPolicy,h=c===void 0?"cache-first":c,f=a.fetchPolicy,p=f===void 0?h:f,m=a.initialFetchPolicy,v=m===void 0?p==="standby"?h:p:m;o.options=te(te({},a),{initialFetchPolicy:v,fetchPolicy:p}),o.queryId=i.queryId||n.generateQueryId();var $=Lu(o.query);return o.queryName=$&&$.name&&$.name.value,o}return Object.defineProperty(t.prototype,"query",{get:function(){return this.lastQuery||this.options.query},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var r=this;return new Promise(function(n,i){var a={next:function(s){n(s),r.observers.delete(a),r.observers.size||r.queryManager.removeQuery(r.queryId),setTimeout(function(){o.unsubscribe()},0)},error:i},o=r.subscribe(a)})},t.prototype.resetDiff=function(){this.queryInfo.resetDiff()},t.prototype.getCurrentResult=function(r){r===void 0&&(r=!0);var n=this.getLastResult(!0),i=this.queryInfo.networkStatus||n&&n.networkStatus||rr.ready,a=te(te({},n),{loading:pu(i),networkStatus:i}),o=this.options.fetchPolicy,s=o===void 0?"cache-first":o;if(!(yp(s)||this.queryManager.getDocumentInfo(this.query).hasForcedResolvers))if(this.waitForOwnResult)this.queryInfo.updateWatch();else{var d=this.queryInfo.getDiff();(d.complete||this.options.returnPartialData)&&(a.data=d.result),vr(a.data,{})&&(a.data=void 0),d.complete?(delete a.partial,d.complete&&a.networkStatus===rr.loading&&(s==="cache-first"||s==="cache-only")&&(a.networkStatus=rr.ready,a.loading=!1)):a.partial=!0,globalThis.__DEV__!==!1&&!d.complete&&!this.options.partialRefetch&&!a.loading&&!a.data&&!a.error&&z$(d.missing)}return r&&this.updateLastResult(a),a},t.prototype.isDifferentFromLastResult=function(r,n){if(!this.last)return!0;var i=this.queryManager.getDocumentInfo(this.query).hasNonreactiveDirective?!_$(this.query,this.last.result,r,this.variables):!vr(this.last.result,r);return i||n&&!vr(this.last.variables,n)},t.prototype.getLast=function(r,n){var i=this.last;if(i&&i[r]&&(!n||vr(i.variables,this.variables)))return i[r]},t.prototype.getLastResult=function(r){return this.getLast("result",r)},t.prototype.getLastError=function(r){return this.getLast("error",r)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(r){var n,i={pollInterval:0},a=this.options.fetchPolicy;if(a==="cache-and-network"?i.fetchPolicy=a:a==="no-cache"?i.fetchPolicy="no-cache":i.fetchPolicy="network-only",globalThis.__DEV__!==!1&&r&&UM.call(r,"variables")){var o=Yb(this.query),s=o.variableDefinitions;(!s||!s.some(function(d){return d.variable.name.value==="variables"}))&&globalThis.__DEV__!==!1&&tt.warn(20,r,((n=o.name)===null||n===void 0?void 0:n.value)||o)}return r&&!vr(this.options.variables,r)&&(i.variables=this.options.variables=te(te({},this.options.variables),r)),this.queryInfo.resetLastWrite(),this.reobserve(i,rr.refetch)},t.prototype.fetchMore=function(r){var n=this,i=te(te({},r.query?r:te(te(te(te({},this.options),{query:this.options.query}),r),{variables:te(te({},this.options.variables),r.variables)})),{fetchPolicy:"no-cache"});i.query=this.transformDocument(i.query);var a=this.queryManager.generateQueryId();this.lastQuery=r.query?this.transformDocument(this.options.query):i.query;var o=this.queryInfo,s=o.networkStatus;o.networkStatus=rr.fetchMore,i.notifyOnNetworkStatusChange&&this.observe();var d=new Set,c=r?.updateQuery,h=this.options.fetchPolicy!=="no-cache";return h||tt(c,21),this.queryManager.fetchQuery(a,i,rr.fetchMore).then(function(f){if(n.queryManager.removeQuery(a),o.networkStatus===rr.fetchMore&&(o.networkStatus=s),h)n.queryManager.cache.batch({update:function(v){var $=r.updateQuery;$?v.updateQuery({query:n.query,variables:n.variables,returnPartialData:!0,optimistic:!1},function(w){return $(w,{fetchMoreResult:f.data,variables:i.variables})}):v.writeQuery({query:i.query,variables:i.variables,data:f.data})},onWatchUpdated:function(v){d.add(v.query)}});else{var p=n.getLast("result"),m=c(p.data,{fetchMoreResult:f.data,variables:i.variables});n.reportResult(te(te({},p),{data:m}),n.variables)}return f}).finally(function(){h&&!d.has(n.query)&&F$(n)})},t.prototype.subscribeToMore=function(r){var n=this,i=this.queryManager.startGraphQLSubscription({query:r.document,variables:r.variables,context:r.context}).subscribe({next:function(a){var o=r.updateQuery;o&&n.updateQuery(function(s,d){var c=d.variables;return o(s,{subscriptionData:a,variables:c})})},error:function(a){if(r.onError){r.onError(a);return}globalThis.__DEV__!==!1&&tt.error(22,a)}});return this.subscriptions.add(i),function(){n.subscriptions.delete(i)&&i.unsubscribe()}},t.prototype.setOptions=function(r){return this.reobserve(r)},t.prototype.silentSetOptions=function(r){var n=gd(this.options,r||{});O7(this.options,n)},t.prototype.setVariables=function(r){return vr(this.variables,r)?this.observers.size?this.result():Promise.resolve():(this.options.variables=r,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:r},rr.setVariables):Promise.resolve())},t.prototype.updateQuery=function(r){var n=this.queryManager,i=n.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,a=r(i,{variables:this.variables});a&&(n.cache.writeQuery({query:this.options.query,data:a,variables:this.variables}),n.broadcastQueries())},t.prototype.startPolling=function(r){this.options.pollInterval=r,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(r,n){if(n.nextFetchPolicy){var i=n.fetchPolicy,a=i===void 0?"cache-first":i,o=n.initialFetchPolicy,s=o===void 0?a:o;a==="standby"||(typeof n.nextFetchPolicy=="function"?n.fetchPolicy=n.nextFetchPolicy(a,{reason:r,options:n,observable:this,initialFetchPolicy:s}):r==="variables-changed"?n.fetchPolicy=s:n.fetchPolicy=n.nextFetchPolicy)}return n.fetchPolicy},t.prototype.fetch=function(r,n,i){return this.queryManager.setObservableQuery(this),this.queryManager.fetchConcastWithInfo(this.queryId,r,n,i)},t.prototype.updatePolling=function(){var r=this;if(!this.queryManager.ssrMode){var n=this,i=n.pollingInfo,a=n.options.pollInterval;if(!a||!this.hasObservers()){i&&(clearTimeout(i.timeout),delete this.pollingInfo);return}if(!(i&&i.interval===a)){tt(a,23);var o=i||(this.pollingInfo={});o.interval=a;var s=function(){var c,h;r.pollingInfo&&(!pu(r.queryInfo.networkStatus)&&!(!((h=(c=r.options).skipPollAttempt)===null||h===void 0)&&h.call(c))?r.reobserve({fetchPolicy:r.options.initialFetchPolicy==="no-cache"?"no-cache":"network-only"},rr.poll).then(d,d):d())},d=function(){var c=r.pollingInfo;c&&(clearTimeout(c.timeout),c.timeout=setTimeout(s,c.interval))};d()}}},t.prototype.updateLastResult=function(r,n){n===void 0&&(n=this.variables);var i=this.getLastError();return i&&this.last&&!vr(n,this.last.variables)&&(i=void 0),this.last=te({result:this.queryManager.assumeImmutableResults?r:m$(r),variables:n},i?{error:i}:null)},t.prototype.reobserveAsConcast=function(r,n){var i=this;this.isTornDown=!1;var a=n===rr.refetch||n===rr.fetchMore||n===rr.poll,o=this.options.variables,s=this.options.fetchPolicy,d=gd(this.options,r||{}),c=a?d:O7(this.options,d),h=this.transformDocument(c.query);this.lastQuery=h,a||(this.updatePolling(),r&&r.variables&&!vr(r.variables,o)&&c.fetchPolicy!=="standby"&&(c.fetchPolicy===s||typeof c.nextFetchPolicy=="function")&&(this.applyNextFetchPolicy("variables-changed",c),n===void 0&&(n=rr.setVariables))),this.waitForOwnResult&&(this.waitForOwnResult=yp(c.fetchPolicy));var f=function(){i.concast===v&&(i.waitForOwnResult=!1)},p=c.variables&&te({},c.variables),m=this.fetch(c,n,h),v=m.concast,$=m.fromLink,w={next:function(x){vr(i.variables,p)&&(f(),i.reportResult(x,p))},error:function(x){vr(i.variables,p)&&($$(x)||(x=new ws({networkError:x})),f(),i.reportError(x,p))}};return!a&&($||!this.concast)&&(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=v,this.observer=w),v.addObserver(w),v},t.prototype.reobserve=function(r,n){return this.reobserveAsConcast(r,n).promise},t.prototype.resubscribeAfterError=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this.last;this.resetLastResults();var a=this.subscribe.apply(this,r);return this.last=i,a},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(r,n){var i=this.getLastError(),a=this.isDifferentFromLastResult(r,n);(i||!r.partial||this.options.returnPartialData)&&this.updateLastResult(r,n),(i||a)&&Yc(this.observers,"next",r)},t.prototype.reportError=function(r,n){var i=te(te({},this.getLastResult()),{error:r,errors:r.graphQLErrors,networkStatus:rr.error,loading:!1});this.updateLastResult(i,n),Yc(this.observers,"error",this.last.error=r)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach(function(r){return r.unsubscribe()}),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t.prototype.transformDocument=function(r){return this.queryManager.transform(r)},t}(cr);v$(Z5);function F$(e){var t=e.options,r=t.fetchPolicy,n=t.nextFetchPolicy;return r==="cache-and-network"||r==="network-only"?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(i,a){return this.nextFetchPolicy=n,typeof this.nextFetchPolicy=="function"?this.nextFetchPolicy(i,a):r}}):e.reobserve()}function BM(e){globalThis.__DEV__!==!1&&tt.error(24,e.message,e.stack)}function z$(e){globalThis.__DEV__!==!1&&e&&globalThis.__DEV__!==!1&&tt.debug(25,e)}function yp(e){return e==="network-only"||e==="no-cache"||e==="standby"}var Hl=new(Ad?WeakMap:Map);function bp(e,t){var r=e[t];typeof r=="function"&&(e[t]=function(){return Hl.set(e,(Hl.get(e)+1)%1e15),r.apply(this,arguments)})}function P7(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var $p=function(){function e(t,r){r===void 0&&(r=t.generateQueryId()),this.queryId=r,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=t.cache;Hl.has(n)||(Hl.set(n,0),bp(n,"evict"),bp(n,"modify"),bp(n,"reset"))}return e.prototype.init=function(t){var r=t.networkStatus||rr.loading;return this.variables&&this.networkStatus!==rr.loading&&!vr(this.variables,t.variables)&&(r=rr.setVariables),vr(t.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:t.document,variables:t.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:r}),t.observableQuery&&this.setObservableQuery(t.observableQuery),t.lastRequestId&&(this.lastRequestId=t.lastRequestId),this},e.prototype.reset=function(){P7(this),this.dirty=!1},e.prototype.resetDiff=function(){this.lastDiff=void 0},e.prototype.getDiff=function(){var t=this.getDiffOptions();if(this.lastDiff&&vr(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables);var r=this.observableQuery;if(r&&r.options.fetchPolicy==="no-cache")return{complete:!1};var n=this.cache.diff(t);return this.updateLastDiff(n,t),n},e.prototype.updateLastDiff=function(t,r){this.lastDiff=t?{diff:t,options:r||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(t){var r;return t===void 0&&(t=this.variables),{query:this.document,variables:t,returnPartialData:!0,optimistic:!0,canonizeResults:(r=this.observableQuery)===null||r===void 0?void 0:r.options.canonizeResults}},e.prototype.setDiff=function(t){var r=this,n,i=this.lastDiff&&this.lastDiff.diff;t&&!t.complete&&(!((n=this.observableQuery)===null||n===void 0)&&n.getLastError())||(this.updateLastDiff(t),!this.dirty&&!vr(i&&i.result,t&&t.result)&&(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout(function(){return r.notify()},0))))},e.prototype.setObservableQuery=function(t){var r=this;t!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=t,t?(t.queryInfo=this,this.listeners.add(this.oqListener=function(){var n=r.getDiff();n.fromOptimisticTransaction?t.observe():F$(t)})):delete this.oqListener)},e.prototype.notify=function(){var t=this;P7(this),this.shouldNotify()&&this.listeners.forEach(function(r){return r(t)}),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(pu(this.networkStatus)&&this.observableQuery){var t=this.observableQuery.options.fetchPolicy;if(t!=="cache-only"&&t!=="cache-and-network")return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel;var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(t){var r=this;t===void 0&&(t=this.variables);var n=this.observableQuery;if(!(n&&n.options.fetchPolicy==="no-cache")){var i=te(te({},this.getDiffOptions(t)),{watcher:this,callback:function(a){return r.setDiff(a)}});(!this.lastWatch||!vr(i,this.lastWatch))&&(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=i))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(t,r){var n=this.lastWrite;return!(n&&n.dmCount===Hl.get(this.cache)&&vr(r,n.variables)&&vr(t.data,n.result.data))},e.prototype.markResult=function(t,r,n,i){var a=this,o=new Vo,s=$a(t.errors)?t.errors.slice(0):[];if(this.reset(),"incremental"in t&&$a(t.incremental)){var d=y$(this.getDiff().result,t);t.data=d}else if("hasNext"in t&&t.hasNext){var c=this.getDiff();t.data=o.merge(c.result,t.data)}this.graphQLErrors=s,n.fetchPolicy==="no-cache"?this.updateLastDiff({result:t.data,complete:!0},this.getDiffOptions(n.variables)):i!==0&&(X5(t,n.errorPolicy)?this.cache.performTransaction(function(h){if(a.shouldWrite(t,n.variables))h.writeQuery({query:r,data:t.data,variables:n.variables,overwrite:i===1}),a.lastWrite={result:t,variables:n.variables,dmCount:Hl.get(a.cache)};else if(a.lastDiff&&a.lastDiff.diff.complete){t.data=a.lastDiff.diff.result;return}var f=a.getDiffOptions(n.variables),p=h.diff(f);!a.stopped&&vr(a.variables,n.variables)&&a.updateWatch(n.variables),a.updateLastDiff(p,f),p.complete&&(t.data=p.result)}):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=rr.ready},e.prototype.markError=function(t){return this.networkStatus=rr.error,this.lastWrite=void 0,this.reset(),t.graphQLErrors&&(this.graphQLErrors=t.graphQLErrors),t.networkError&&(this.networkError=t.networkError),t},e}();function X5(e,t){t===void 0&&(t="none");var r=t==="ignore"||t==="all",n=!F1(e);return!n&&r&&e.data&&(n=!0),n}var qM=Object.prototype.hasOwnProperty,I7=Object.create(null),HM=function(){function e(t){var r=this;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new qb(eo["queryManager.getDocumentInfo"]||2e3),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Td(!1);var n=new d$(function(a){return r.cache.transformDocument(a)},{cache:!1});this.cache=t.cache,this.link=t.link,this.defaultOptions=t.defaultOptions,this.queryDeduplication=t.queryDeduplication,this.clientAwareness=t.clientAwareness,this.localState=t.localState,this.ssrMode=t.ssrMode,this.assumeImmutableResults=t.assumeImmutableResults;var i=t.documentTransform;this.documentTransform=i?n.concat(i).concat(n):n,this.defaultContext=t.defaultContext||Object.create(null),(this.onBroadcast=t.onBroadcast)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var t=this;this.queries.forEach(function(r,n){t.stopQueryNoBroadcast(n)}),this.cancelPendingFetches(zn(26))},e.prototype.cancelPendingFetches=function(t){this.fetchCancelFns.forEach(function(r){return r(t)}),this.fetchCancelFns.clear()},e.prototype.mutate=function(t){return lt(this,arguments,void 0,function(r){var n,i,a,o,s,d,c,h=r.mutation,f=r.variables,p=r.optimisticResponse,m=r.updateQueries,v=r.refetchQueries,$=v===void 0?[]:v,w=r.awaitRefetchQueries,x=w===void 0?!1:w,C=r.update,k=r.onQueryUpdated,S=r.fetchPolicy,P=S===void 0?((d=this.defaultOptions.mutate)===null||d===void 0?void 0:d.fetchPolicy)||"network-only":S,N=r.errorPolicy,j=N===void 0?((c=this.defaultOptions.mutate)===null||c===void 0?void 0:c.errorPolicy)||"none":N,F=r.keepRootFields,W=r.context;return Co(this,function(J){switch(J.label){case 0:return tt(h,27),tt(P==="network-only"||P==="no-cache",28),n=this.generateMutationId(),h=this.cache.transformForLink(this.transform(h)),i=this.getDocumentInfo(h).hasClientExports,f=this.getVariables(h,f),i?[4,this.localState.addExportedVariables(h,f,W)]:[3,2];case 1:f=J.sent(),J.label=2;case 2:return a=this.mutationStore&&(this.mutationStore[n]={mutation:h,variables:f,loading:!0,error:null}),o=p&&this.markMutationOptimistic(p,{mutationId:n,document:h,variables:f,fetchPolicy:P,errorPolicy:j,context:W,updateQueries:m,update:C,keepRootFields:F}),this.broadcastQueries(),s=this,[2,new Promise(function(U,G){return hp(s.getObservableFromLink(h,te(te({},W),{optimisticResponse:o?p:void 0}),f,{},!1),function(H){if(F1(H)&&j==="none")throw new ws({graphQLErrors:B5(H)});a&&(a.loading=!1,a.error=null);var K=te({},H);return typeof $=="function"&&($=$(K)),j==="ignore"&&F1(K)&&delete K.errors,s.markMutationResult({mutationId:n,result:K,document:h,variables:f,fetchPolicy:P,errorPolicy:j,context:W,update:C,updateQueries:m,awaitRefetchQueries:x,refetchQueries:$,removeOptimistic:o?n:void 0,onQueryUpdated:k,keepRootFields:F})}).subscribe({next:function(H){s.broadcastQueries(),(!("hasNext"in H)||H.hasNext===!1)&&U(H)},error:function(H){a&&(a.loading=!1,a.error=H),o&&s.cache.removeOptimistic(n),s.broadcastQueries(),G(H instanceof ws?H:new ws({networkError:H}))}})})]}})})},e.prototype.markMutationResult=function(t,r){var n=this;r===void 0&&(r=this.cache);var i=t.result,a=[],o=t.fetchPolicy==="no-cache";if(!o&&X5(i,t.errorPolicy)){if(Jl(i)||a.push({result:i.data,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}),Jl(i)&&$a(i.incremental)){var s=r.diff({id:"ROOT_MUTATION",query:this.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0}),d=void 0;s.result&&(d=y$(s.result,i)),typeof d<"u"&&(i.data=d,a.push({result:d,dataId:"ROOT_MUTATION",query:t.document,variables:t.variables}))}var c=t.updateQueries;c&&this.queries.forEach(function(f,p){var m=f.observableQuery,v=m&&m.queryName;if(!(!v||!qM.call(c,v))){var $=c[v],w=n.queries.get(p),x=w.document,C=w.variables,k=r.diff({query:x,variables:C,returnPartialData:!0,optimistic:!1}),S=k.result,P=k.complete;if(P&&S){var N=$(S,{mutationResult:i,queryName:x&&F5(x)||void 0,queryVariables:C});N&&a.push({result:N,dataId:"ROOT_QUERY",query:x,variables:C})}}})}if(a.length>0||(t.refetchQueries||"").length>0||t.update||t.onQueryUpdated||t.removeOptimistic){var h=[];if(this.refetchQueries({updateCache:function(f){o||a.forEach(function($){return f.write($)});var p=t.update,m=!UD(i)||Jl(i)&&!i.hasNext;if(p){if(!o){var v=f.diff({id:"ROOT_MUTATION",query:n.getDocumentInfo(t.document).asQuery,variables:t.variables,optimistic:!1,returnPartialData:!0});v.complete&&(i=te(te({},i),{data:v.result}),"incremental"in i&&delete i.incremental,"hasNext"in i&&delete i.hasNext)}m&&p(f,i,{context:t.context,variables:t.variables})}!o&&!t.keepRootFields&&m&&f.modify({id:"ROOT_MUTATION",fields:function($,w){var x=w.fieldName,C=w.DELETE;return x==="__typename"?$:C}})},include:t.refetchQueries,optimistic:!1,removeOptimistic:t.removeOptimistic,onQueryUpdated:t.onQueryUpdated||null}).forEach(function(f){return h.push(f)}),t.awaitRefetchQueries||t.onQueryUpdated)return Promise.all(h).then(function(){return i})}return Promise.resolve(i)},e.prototype.markMutationOptimistic=function(t,r){var n=this,i=typeof t=="function"?t(r.variables,{IGNORE:I7}):t;return i===I7?!1:(this.cache.recordOptimisticTransaction(function(a){try{n.markMutationResult(te(te({},r),{result:{data:i}}),a)}catch(o){globalThis.__DEV__!==!1&&tt.error(o)}},r.mutationId),!0)},e.prototype.fetchQuery=function(t,r,n){return this.fetchConcastWithInfo(t,r,n).concast.promise},e.prototype.getQueryStore=function(){var t=Object.create(null);return this.queries.forEach(function(r,n){t[n]={variables:r.variables,networkStatus:r.networkStatus,networkError:r.networkError,graphQLErrors:r.graphQLErrors}}),t},e.prototype.resetErrors=function(t){var r=this.queries.get(t);r&&(r.networkError=void 0,r.graphQLErrors=[])},e.prototype.transform=function(t){return this.documentTransform.transformDocument(t)},e.prototype.getDocumentInfo=function(t){var r=this.transformCache;if(!r.has(t)){var n={hasClientExports:_N(t),hasForcedResolvers:this.localState.shouldForceResolvers(t),hasNonreactiveDirective:cu(["nonreactive"],t),clientQuery:this.localState.clientQuery(t),serverQuery:u$([{name:"client",remove:!0},{name:"connection"},{name:"nonreactive"}],t),defaultVars:zg(Lu(t)),asQuery:te(te({},t),{definitions:t.definitions.map(function(i){return i.kind==="OperationDefinition"&&i.operation!=="query"?te(te({},i),{operation:"query"}):i})})};r.set(t,n)}return r.get(t)},e.prototype.getVariables=function(t,r){return te(te({},this.getDocumentInfo(t).defaultVars),r)},e.prototype.watchQuery=function(t){var r=this.transform(t.query);t=te(te({},t),{variables:this.getVariables(r,t.variables)}),typeof t.notifyOnNetworkStatusChange>"u"&&(t.notifyOnNetworkStatusChange=!1);var n=new $p(this),i=new Z5({queryManager:this,queryInfo:n,options:t});return i.lastQuery=r,this.queries.set(i.queryId,n),n.init({document:r,observableQuery:i,variables:i.variables}),i},e.prototype.query=function(t,r){var n=this;return r===void 0&&(r=this.generateQueryId()),tt(t.query,29),tt(t.query.kind==="Document",30),tt(!t.returnPartialData,31),tt(!t.pollInterval,32),this.fetchQuery(r,te(te({},t),{query:this.transform(t.query)})).finally(function(){return n.stopQuery(r)})},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(t){this.stopQueryInStoreNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(t){var r=this.queries.get(t);r&&r.stop()},e.prototype.clearStore=function(t){return t===void 0&&(t={discardWatches:!0}),this.cancelPendingFetches(zn(33)),this.queries.forEach(function(r){r.observableQuery?r.networkStatus=rr.loading:r.stop()}),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(t)},e.prototype.getObservableQueries=function(t){var r=this;t===void 0&&(t="active");var n=new Map,i=new Map,a=new Set;return Array.isArray(t)&&t.forEach(function(o){typeof o=="string"?i.set(o,!1):KN(o)?i.set(r.transform(o),!1):Or(o)&&o.query&&a.add(o)}),this.queries.forEach(function(o,s){var d=o.observableQuery,c=o.document;if(d){if(t==="all"){n.set(s,d);return}var h=d.queryName,f=d.options.fetchPolicy;if(f==="standby"||t==="active"&&!d.hasObservers())return;(t==="active"||h&&i.has(h)||c&&i.has(c))&&(n.set(s,d),h&&i.set(h,!0),c&&i.set(c,!0))}}),a.size&&a.forEach(function(o){var s=A5("legacyOneTimeQuery"),d=r.getQuery(s).init({document:o.query,variables:o.variables}),c=new Z5({queryManager:r,queryInfo:d,options:te(te({},o),{fetchPolicy:"network-only"})});tt(c.queryId===s),d.setObservableQuery(c),n.set(s,c)}),globalThis.__DEV__!==!1&&i.size&&i.forEach(function(o,s){o||globalThis.__DEV__!==!1&&tt.warn(typeof s=="string"?34:35,s)}),n},e.prototype.reFetchObservableQueries=function(t){var r=this;t===void 0&&(t=!1);var n=[];return this.getObservableQueries(t?"all":"active").forEach(function(i,a){var o=i.options.fetchPolicy;i.resetLastResults(),(t||o!=="standby"&&o!=="cache-only")&&n.push(i.refetch()),r.getQuery(a).setDiff(null)}),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(t){this.getQuery(t.queryId).setObservableQuery(t)},e.prototype.startGraphQLSubscription=function(t){var r=this,n=t.query,i=t.fetchPolicy,a=t.errorPolicy,o=a===void 0?"none":a,s=t.variables,d=t.context,c=d===void 0?{}:d,h=t.extensions,f=h===void 0?{}:h;n=this.transform(n),s=this.getVariables(n,s);var p=function(v){return r.getObservableFromLink(n,c,v,f).map(function($){i!=="no-cache"&&(X5($,o)&&r.cache.write({query:n,result:$.data,dataId:"ROOT_SUBSCRIPTION",variables:v}),r.broadcastQueries());var w=F1($),x=iM($);if(w||x){var C={};if(w&&(C.graphQLErrors=$.errors),x&&(C.protocolErrors=$.extensions[Kg]),o==="none"||x)throw new ws(C)}return o==="ignore"&&delete $.errors,$})};if(this.getDocumentInfo(n).hasClientExports){var m=this.localState.addExportedVariables(n,s,c).then(p);return new cr(function(v){var $=null;return m.then(function(w){return $=w.subscribe(v)},v.error),function(){return $&&$.unsubscribe()}})}return p(s)},e.prototype.stopQuery=function(t){this.stopQueryNoBroadcast(t),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(t){this.stopQueryInStoreNoBroadcast(t),this.removeQuery(t)},e.prototype.removeQuery=function(t){this.fetchCancelFns.delete(t),this.queries.has(t)&&(this.getQuery(t).stop(),this.queries.delete(t))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach(function(t){return t.notify()})},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(t,r,n,i,a){var o=this,s;a===void 0&&(a=(s=r?.queryDeduplication)!==null&&s!==void 0?s:this.queryDeduplication);var d,c=this.getDocumentInfo(t),h=c.serverQuery,f=c.clientQuery;if(h){var p=this,m=p.inFlightLinkObservables,v=p.link,$={query:h,variables:n,operationName:F5(h)||void 0,context:this.prepareContext(te(te({},r),{forceFetch:!a})),extensions:i};if(r=$.context,a){var w=c2(h),x=Do(n),C=m.lookup(w,x);if(d=C.observable,!d){var k=new Il([q5(v,$)]);d=C.observable=k,k.beforeNext(function(){m.remove(w,x)})}}else d=new Il([q5(v,$)])}else d=new Il([cr.of({data:{}})]),r=this.prepareContext(r);return f&&(d=hp(d,function(S){return o.localState.runResolvers({document:f,remoteResult:S,context:r,variables:n})})),d},e.prototype.getResultsFromLink=function(t,r,n){var i=t.lastRequestId=this.generateRequestId(),a=this.cache.transformForLink(n.query);return hp(this.getObservableFromLink(a,n.context,n.variables),function(o){var s=B5(o),d=s.length>0,c=n.errorPolicy;if(i>=t.lastRequestId){if(d&&c==="none")throw t.markError(new ws({graphQLErrors:s}));t.markResult(o,a,n,r),t.markReady()}var h={data:o.data,loading:!1,networkStatus:rr.ready};return d&&c==="none"&&(h.data=void 0),d&&c!=="ignore"&&(h.errors=s,h.networkStatus=rr.error),h},function(o){var s=$$(o)?o:new ws({networkError:o});throw i>=t.lastRequestId&&t.markError(s),s})},e.prototype.fetchConcastWithInfo=function(t,r,n,i){var a=this;n===void 0&&(n=rr.loading),i===void 0&&(i=r.query);var o=this.getVariables(i,r.variables),s=this.getQuery(t),d=this.defaultOptions.watchQuery,c=r.fetchPolicy,h=c===void 0?d&&d.fetchPolicy||"cache-first":c,f=r.errorPolicy,p=f===void 0?d&&d.errorPolicy||"none":f,m=r.returnPartialData,v=m===void 0?!1:m,$=r.notifyOnNetworkStatusChange,w=$===void 0?!1:$,x=r.context,C=x===void 0?{}:x,k=Object.assign({},r,{query:i,variables:o,fetchPolicy:h,errorPolicy:p,returnPartialData:v,notifyOnNetworkStatusChange:w,context:C}),S=function(W){k.variables=W;var J=a.fetchQueryByPolicy(s,k,n);return k.fetchPolicy!=="standby"&&J.sources.length>0&&s.observableQuery&&s.observableQuery.applyNextFetchPolicy("after-fetch",r),J},P=function(){return a.fetchCancelFns.delete(t)};this.fetchCancelFns.set(t,function(W){P(),setTimeout(function(){return N.cancel(W)})});var N,j;if(this.getDocumentInfo(k.query).hasClientExports)N=new Il(this.localState.addExportedVariables(k.query,k.variables,k.context).then(S).then(function(W){return W.sources})),j=!0;else{var F=S(k.variables);j=F.fromLink,N=new Il(F.sources)}return N.promise.then(P,P),{concast:N,fromLink:j}},e.prototype.refetchQueries=function(t){var r=this,n=t.updateCache,i=t.include,a=t.optimistic,o=a===void 0?!1:a,s=t.removeOptimistic,d=s===void 0?o?A5("refetchQueries"):void 0:s,c=t.onQueryUpdated,h=new Map;i&&this.getObservableQueries(i).forEach(function(p,m){h.set(m,{oq:p,lastDiff:r.getQuery(m).getDiff()})});var f=new Map;return n&&this.cache.batch({update:n,optimistic:o&&d||!1,removeOptimistic:d,onWatchUpdated:function(p,m,v){var $=p.watcher instanceof $p&&p.watcher.observableQuery;if($){if(c){h.delete($.queryId);var w=c($,m,v);return w===!0&&(w=$.refetch()),w!==!1&&f.set($,w),w}c!==null&&h.set($.queryId,{oq:$,lastDiff:v,diff:m})}}}),h.size&&h.forEach(function(p,m){var v=p.oq,$=p.lastDiff,w=p.diff,x;if(c){if(!w){var C=v.queryInfo;C.reset(),w=C.getDiff()}x=c(v,w,$)}(!c||x===!0)&&(x=v.refetch()),x!==!1&&f.set(v,x),m.indexOf("legacyOneTimeQuery")>=0&&r.stopQueryNoBroadcast(m)}),d&&this.cache.removeOptimistic(d),f},e.prototype.fetchQueryByPolicy=function(t,r,n){var i=this,a=r.query,o=r.variables,s=r.fetchPolicy,d=r.refetchWritePolicy,c=r.errorPolicy,h=r.returnPartialData,f=r.context,p=r.notifyOnNetworkStatusChange,m=t.networkStatus;t.init({document:a,variables:o,networkStatus:n});var v=function(){return t.getDiff()},$=function(S,P){P===void 0&&(P=t.networkStatus||rr.loading);var N=S.result;globalThis.__DEV__!==!1&&!h&&!vr(N,{})&&z$(S.missing);var j=function(F){return cr.of(te({data:F,loading:pu(P),networkStatus:P},S.complete?null:{partial:!0}))};return N&&i.getDocumentInfo(a).hasForcedResolvers?i.localState.runResolvers({document:a,remoteResult:{data:N},context:f,variables:o,onlyRunForcedResolvers:!0}).then(function(F){return j(F.data||void 0)}):c==="none"&&P===rr.refetch&&Array.isArray(S.missing)?j(void 0):j(N)},w=s==="no-cache"?0:n===rr.refetch&&d!=="merge"?1:2,x=function(){return i.getResultsFromLink(t,w,{query:a,variables:o,context:f,fetchPolicy:s,errorPolicy:c})},C=p&&typeof m=="number"&&m!==n&&pu(n);switch(s){default:case"cache-first":{var k=v();return k.complete?{fromLink:!1,sources:[$(k,t.markReady())]}:h||C?{fromLink:!0,sources:[$(k),x()]}:{fromLink:!0,sources:[x()]}}case"cache-and-network":{var k=v();return k.complete||h||C?{fromLink:!0,sources:[$(k),x()]}:{fromLink:!0,sources:[x()]}}case"cache-only":return{fromLink:!1,sources:[$(v(),t.markReady())]};case"network-only":return C?{fromLink:!0,sources:[$(v()),x()]}:{fromLink:!0,sources:[x()]};case"no-cache":return C?{fromLink:!0,sources:[$(t.getDiff()),x()]}:{fromLink:!0,sources:[x()]};case"standby":return{fromLink:!1,sources:[]}}},e.prototype.getQuery=function(t){return t&&!this.queries.has(t)&&this.queries.set(t,new $p(this,t)),this.queries.get(t)},e.prototype.prepareContext=function(t){t===void 0&&(t={});var r=this.localState.prepareContext(t);return te(te(te({},this.defaultContext),r),{clientAwareness:this.clientAwareness})},e}(),WM=function(){function e(t){var r=t.cache,n=t.client,i=t.resolvers,a=t.fragmentMatcher;this.selectionsToResolveCache=new WeakMap,this.cache=r,n&&(this.client=n),i&&this.addResolvers(i),a&&this.setFragmentMatcher(a)}return e.prototype.addResolvers=function(t){var r=this;this.resolvers=this.resolvers||{},Array.isArray(t)?t.forEach(function(n){r.resolvers=J9(r.resolvers,n)}):this.resolvers=J9(this.resolvers,t)},e.prototype.setResolvers=function(t){this.resolvers={},this.addResolvers(t)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(t){return lt(this,arguments,void 0,function(r){var n=r.document,i=r.remoteResult,a=r.context,o=r.variables,s=r.onlyRunForcedResolvers,d=s===void 0?!1:s;return Co(this,function(c){return n?[2,this.resolveDocument(n,i.data,a,o,this.fragmentMatcher,d).then(function(h){return te(te({},i),{data:h.result})})]:[2,i]})})},e.prototype.setFragmentMatcher=function(t){this.fragmentMatcher=t},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(t){return cu(["client"],t)&&this.resolvers?t:null},e.prototype.serverQuery=function(t){return h$(t)},e.prototype.prepareContext=function(t){var r=this.cache;return te(te({},t),{cache:r,getCacheKey:function(n){return r.identify(n)}})},e.prototype.addExportedVariables=function(t){return lt(this,arguments,void 0,function(r,n,i){return n===void 0&&(n={}),i===void 0&&(i={}),Co(this,function(a){return r?[2,this.resolveDocument(r,this.buildRootValueFromCache(r,n)||{},this.prepareContext(i),n).then(function(o){return te(te({},n),o.exportedVariables)})]:[2,te({},n)]})})},e.prototype.shouldForceResolvers=function(t){var r=!1;return Ja(t,{Directive:{enter:function(n){if(n.name.value==="client"&&n.arguments&&(r=n.arguments.some(function(i){return i.name.value==="always"&&i.value.kind==="BooleanValue"&&i.value.value===!0}),r))return Fg}}}),r},e.prototype.buildRootValueFromCache=function(t,r){return this.cache.diff({query:ED(t),variables:r,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(t,r){return lt(this,arguments,void 0,function(n,i,a,o,s,d){var c,h,f,p,m,v,$,w,x,C,k;return a===void 0&&(a={}),o===void 0&&(o={}),s===void 0&&(s=function(){return!0}),d===void 0&&(d=!1),Co(this,function(S){return c=Ru(n),h=s2(n),f=i2(h),p=this.collectSelectionsToResolve(c,f),m=c.operation,v=m?m.charAt(0).toUpperCase()+m.slice(1):"Query",$=this,w=$.cache,x=$.client,C={fragmentMap:f,context:te(te({},a),{cache:w,client:x}),variables:o,fragmentMatcher:s,defaultOperationType:v,exportedVariables:{},selectionsToResolve:p,onlyRunForcedResolvers:d},k=!1,[2,this.resolveSelectionSet(c.selectionSet,k,i,C).then(function(P){return{result:P,exportedVariables:C.exportedVariables}})]})})},e.prototype.resolveSelectionSet=function(t,r,n,i){return lt(this,void 0,void 0,function(){var a,o,s,d,c,h=this;return Co(this,function(f){return a=i.fragmentMap,o=i.context,s=i.variables,d=[n],c=function(p){return lt(h,void 0,void 0,function(){var m,v;return Co(this,function($){return!r&&!i.selectionsToResolve.has(p)?[2]:Du(p,s)?zo(p)?[2,this.resolveField(p,r,n,i).then(function(w){var x;typeof w<"u"&&d.push((x={},x[Fo(p)]=w,x))})]:(sD(p)?m=p:(m=a[p.name.value],tt(m,18,p.name.value)),m&&m.typeCondition&&(v=m.typeCondition.name.value,i.fragmentMatcher(n,v,o))?[2,this.resolveSelectionSet(m.selectionSet,r,n,i).then(function(w){d.push(w)})]:[2]):[2]})})},[2,Promise.all(t.selections.map(c)).then(function(){return u2(d)})]})})},e.prototype.resolveField=function(t,r,n,i){return lt(this,void 0,void 0,function(){var a,o,s,d,c,h,f,p,m,v=this;return Co(this,function($){return n?(a=i.variables,o=t.name.value,s=Fo(t),d=o!==s,c=n[s]||n[o],h=Promise.resolve(c),(!i.onlyRunForcedResolvers||this.shouldForceResolvers(t))&&(f=n.__typename||i.defaultOperationType,p=this.resolvers&&this.resolvers[f],p&&(m=p[d?o:s],m&&(h=Promise.resolve(Yg.withValue(this.cache,m,[n,o2(t,a),i.context,{field:t,fragmentMap:i.fragmentMap}]))))),[2,h.then(function(w){var x,C;if(w===void 0&&(w=c),t.directives&&t.directives.forEach(function(S){S.name.value==="export"&&S.arguments&&S.arguments.forEach(function(P){P.name.value==="as"&&P.value.kind==="StringValue"&&(i.exportedVariables[P.value.value]=w)})}),!t.selectionSet||w==null)return w;var k=(C=(x=t.directives)===null||x===void 0?void 0:x.some(function(S){return S.name.value==="client"}))!==null&&C!==void 0?C:!1;if(Array.isArray(w))return v.resolveSubSelectedArray(t,r||k,w,i);if(t.selectionSet)return v.resolveSelectionSet(t.selectionSet,r||k,w,i)})]):[2,null]})})},e.prototype.resolveSubSelectedArray=function(t,r,n,i){var a=this;return Promise.all(n.map(function(o){if(o===null)return null;if(Array.isArray(o))return a.resolveSubSelectedArray(t,r,o,i);if(t.selectionSet)return a.resolveSelectionSet(t.selectionSet,r,o,i)}))},e.prototype.collectSelectionsToResolve=function(t,r){var n=function(o){return!Array.isArray(o)},i=this.selectionsToResolveCache;function a(o){if(!i.has(o)){var s=new Set;i.set(o,s),Ja(o,{Directive:function(d,c,h,f,p){d.name.value==="client"&&p.forEach(function(m){n(m)&&B9(m)&&s.add(m)})},FragmentSpread:function(d,c,h,f,p){var m=r[d.name.value];tt(m,19,d.name.value);var v=a(m);v.size>0&&(p.forEach(function($){n($)&&B9($)&&s.add($)}),s.add(d),v.forEach(function($){s.add($)}))}})}return i.get(o)}return a(t)},e}(),N7=!1,j$=function(){function e(t){var r=this;if(this.resetStoreCallbacks=[],this.clearStoreCallbacks=[],!t.cache)throw zn(15);var n=t.uri,i=t.credentials,a=t.headers,o=t.cache,s=t.documentTransform,d=t.ssrMode,c=d===void 0?!1:d,h=t.ssrForceFetchDelay,f=h===void 0?0:h,p=t.connectToDevTools,m=t.queryDeduplication,v=m===void 0?!0:m,$=t.defaultOptions,w=t.defaultContext,x=t.assumeImmutableResults,C=x===void 0?o.assumeImmutableResults:x,k=t.resolvers,S=t.typeDefs,P=t.fragmentMatcher,N=t.name,j=t.version,F=t.devtools,W=t.link;W||(W=n?new x$({uri:n,credentials:i,headers:a}):Od.empty()),this.link=W,this.cache=o,this.disableNetworkFetches=c||f>0,this.queryDeduplication=v,this.defaultOptions=$||Object.create(null),this.typeDefs=S,this.devtoolsConfig=te(te({},F),{enabled:F?.enabled||p}),this.devtoolsConfig.enabled===void 0&&(this.devtoolsConfig.enabled=globalThis.__DEV__!==!1),f&&setTimeout(function(){return r.disableNetworkFetches=!1},f),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.watchFragment=this.watchFragment.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),this.version=Dg,this.localState=new WM({cache:o,client:this,resolvers:k,fragmentMatcher:P}),this.queryManager=new HM({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,defaultContext:w,documentTransform:s,queryDeduplication:v,ssrMode:c,clientAwareness:{name:N,version:j},localState:this.localState,assumeImmutableResults:C,onBroadcast:this.devtoolsConfig.enabled?function(){r.devToolsHookCb&&r.devToolsHookCb({action:{},state:{queries:r.queryManager.getQueryStore(),mutations:r.queryManager.mutationStore||{}},dataWithOptimisticResults:r.cache.extract(!0)})}:void 0}),this.devtoolsConfig.enabled&&this.connectToDevTools()}return e.prototype.connectToDevTools=function(){if(!(typeof window>"u")){var t=window,r=Symbol.for("apollo.devtools");(t[r]=t[r]||[]).push(this),t.__APOLLO_CLIENT__=this,!N7&&globalThis.__DEV__!==!1&&(N7=!0,window.document&&window.top===window.self&&/^(https?|file):$/.test(window.location.protocol)&&setTimeout(function(){if(!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__){var n=window.navigator,i=n&&n.userAgent,a=void 0;typeof i=="string"&&(i.indexOf("Chrome/")>-1?a="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":i.indexOf("Firefox/")>-1&&(a="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),a&&globalThis.__DEV__!==!1&&tt.log("Download the Apollo DevTools for a better development experience: %s",a)}},1e4))}},Object.defineProperty(e.prototype,"documentTransform",{get:function(){return this.queryManager.documentTransform},enumerable:!1,configurable:!0}),e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(t){return this.defaultOptions.watchQuery&&(t=fp(this.defaultOptions.watchQuery,t)),this.disableNetworkFetches&&(t.fetchPolicy==="network-only"||t.fetchPolicy==="cache-and-network")&&(t=te(te({},t),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(t)},e.prototype.query=function(t){return this.defaultOptions.query&&(t=fp(this.defaultOptions.query,t)),tt(t.fetchPolicy!=="cache-and-network",16),this.disableNetworkFetches&&t.fetchPolicy==="network-only"&&(t=te(te({},t),{fetchPolicy:"cache-first"})),this.queryManager.query(t)},e.prototype.mutate=function(t){return this.defaultOptions.mutate&&(t=fp(this.defaultOptions.mutate,t)),this.queryManager.mutate(t)},e.prototype.subscribe=function(t){return this.queryManager.startGraphQLSubscription(t)},e.prototype.readQuery=function(t,r){return r===void 0&&(r=!1),this.cache.readQuery(t,r)},e.prototype.watchFragment=function(t){return this.cache.watchFragment(t)},e.prototype.readFragment=function(t,r){return r===void 0&&(r=!1),this.cache.readFragment(t,r)},e.prototype.writeQuery=function(t){var r=this.cache.writeQuery(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.writeFragment=function(t){var r=this.cache.writeFragment(t);return t.broadcast!==!1&&this.queryManager.broadcastQueries(),r},e.prototype.__actionHookForDevTools=function(t){this.devToolsHookCb=t},e.prototype.__requestRaw=function(t){return q5(this.link,t)},e.prototype.resetStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!1})}).then(function(){return Promise.all(t.resetStoreCallbacks.map(function(r){return r()}))}).then(function(){return t.reFetchObservableQueries()})},e.prototype.clearStore=function(){var t=this;return Promise.resolve().then(function(){return t.queryManager.clearStore({discardWatches:!0})}).then(function(){return Promise.all(t.clearStoreCallbacks.map(function(r){return r()}))})},e.prototype.onResetStore=function(t){var r=this;return this.resetStoreCallbacks.push(t),function(){r.resetStoreCallbacks=r.resetStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.onClearStore=function(t){var r=this;return this.clearStoreCallbacks.push(t),function(){r.clearStoreCallbacks=r.clearStoreCallbacks.filter(function(n){return n!==t})}},e.prototype.reFetchObservableQueries=function(t){return this.queryManager.reFetchObservableQueries(t)},e.prototype.refetchQueries=function(t){var r=this.queryManager.refetchQueries(t),n=[],i=[];r.forEach(function(o,s){n.push(s),i.push(o)});var a=Promise.all(i);return a.queries=n,a.results=i,a.catch(function(o){globalThis.__DEV__!==!1&&tt.debug(17,o)}),a},e.prototype.getObservableQueries=function(t){return t===void 0&&(t="active"),this.queryManager.getObservableQueries(t)},e.prototype.extract=function(t){return this.cache.extract(t)},e.prototype.restore=function(t){return this.cache.restore(t)},e.prototype.addResolvers=function(t){this.localState.addResolvers(t)},e.prototype.setResolvers=function(t){this.localState.setResolvers(t)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(t){this.localState.setFragmentMatcher(t)},e.prototype.setLink=function(t){this.link=this.queryManager.link=t},Object.defineProperty(e.prototype,"defaultContext",{get:function(){return this.queryManager.defaultContext},enumerable:!1,configurable:!0}),e}();globalThis.__DEV__!==!1&&(j$.prototype.getMemoryInternals=jN);var V1=new Map,J5=new Map,V$=!0,fh=!1;function U$(e){return e.replace(/[\s,]+/g," ").trim()}function QM(e){return U$(e.source.body.substring(e.start,e.end))}function GM(e){var t=new Set,r=[];return e.definitions.forEach(function(n){if(n.kind==="FragmentDefinition"){var i=n.name.value,a=QM(n.loc),o=J5.get(i);o&&!o.has(a)?V$&&console.warn("Warning: fragment with name "+i+` already exists.
48
48
  graphql-tag enforces all fragment names across your application to be unique; read more about
49
- this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||J5.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),te(te({},e),{definitions:r})}function KM(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function YM(e){var t=U$(e);if(!V1.has(t)){var r=fN(e,{experimentalFragmentVariables:fh,allowLegacyFragmentVariables:fh});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");V1.set(t,KM(GM(r)))}return V1.get(t)}function Me(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),YM(n)}function ZM(){V1.clear(),J5.clear()}function XM(){V$=!1}function JM(){fh=!0}function eL(){fh=!1}var _c={gql:Me,resetCaches:ZM,disableFragmentWarnings:XM,enableExperimentalFragmentVariables:JM,disableExperimentalFragmentVariables:eL};(function(e){e.gql=_c.gql,e.resetCaches=_c.resetCaches,e.disableFragmentWarnings=_c.disableFragmentWarnings,e.enableExperimentalFragmentVariables=_c.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=_c.disableExperimentalFragmentVariables})(Me||(Me={}));Me.default=Me;var kc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tL(e){return new Od(function(t,r){var n=ta(t,[]);return new cr(function(i){var a,o=!1;return Promise.resolve(n).then(function(s){return e(s,t.getContext())}).then(t.setContext).then(function(){o||(a=r(t).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,a&&a.unsubscribe()}})})}const rL=/[?&]code=[^&]+/,nL=/[?&]state=[^&]+/,iL=/[?&]error=[^&]+/;class wp{constructor({authentication:t,organization:r,audience:n="https://api.photon.health",connection:i}){this._getAccessToken=(...a)=>lt(this,[...a],void 0,function*({audience:o}={audience:this.audience},s=!1){const d={authorizationParams:Object.assign({audience:o||this.audience||void 0},this.organization?{organization:this.organization}:{})};let c;try{c=yield this.authentication.getTokenSilently(d)}catch(h){h.message.includes("Consent required")&&(c=yield this.authentication.getTokenWithPopup(d))}if(!c){const h=Object.assign(Object.assign({},d),{appState:{returnTo:`${window.location.pathname}${window.location.search}`}});if(yield this.authentication.loginWithRedirect(h),s)throw new Error;return yield this._getAccessToken({audience:o},!0)}return c}),this.authentication=t,this.organization=r,this.audience=n,this.connection=i}login(t){return lt(this,arguments,void 0,function*({organizationId:r,invitation:n,appState:i}){const a=Object.assign({authorizationParams:Object.assign(Object.assign(Object.assign(Object.assign({},this.audience?{audience:this.audience}:{}),this.connection?{connection:this.connection}:{}),r||this.organization?{organization:r||this.organization}:{}),n?{invitation:n}:{})},i?{appState:i}:{});return this.authentication.loginWithPopup(a)})}logout(t){return lt(this,arguments,void 0,function*({returnTo:r,federated:n=!1}){const i={logoutParams:Object.assign(Object.assign({},r?{returnTo:r}:{}),n?{federated:n}:{})};return this.authentication.logout(i)})}hasAuthParams(t=window.location.search){return(rL.test(t)||iL.test(t))&&nL.test(t)}getAccessToken(){return lt(this,arguments,void 0,function*({audience:t}={audience:this.audience}){return yield this._getAccessToken({audience:t??this.audience})})}getAccessTokenWithConsent(){return lt(this,arguments,void 0,function*({audience:t}={audience:this.audience}){const r={authorizationParams:Object.assign({audience:t||this.audience||void 0},this.organization?{organization:this.organization}:{})};return this.authentication.getTokenWithPopup(r)})}checkSession(){return lt(this,void 0,void 0,function*(){const t={authorizationParams:Object.assign({audience:this.audience||void 0},this.organization?{organization:this.organization}:{})};return this.authentication.checkSession(t)})}handleRedirect(t){return lt(this,void 0,void 0,function*(){try{return this.authentication.handleRedirectCallback(t)}catch(r){console.error(r)}})}getUser(){return lt(this,void 0,void 0,function*(){return this.authentication.getUser()})}isAuthenticated(){return lt(this,void 0,void 0,function*(){try{return yield this.authentication.checkSession(),yield this.authentication.isAuthenticated()}catch{return!1}})}}const o1=Me`
49
+ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o||J5.set(i,o=new Set),o.add(a),t.has(a)||(t.add(a),r.push(n))}else r.push(n)}),te(te({},e),{definitions:r})}function KM(e){var t=new Set(e.definitions);t.forEach(function(n){n.loc&&delete n.loc,Object.keys(n).forEach(function(i){var a=n[i];a&&typeof a=="object"&&t.add(a)})});var r=e.loc;return r&&(delete r.startToken,delete r.endToken),e}function YM(e){var t=U$(e);if(!V1.has(t)){var r=fN(e,{experimentalFragmentVariables:fh,allowLegacyFragmentVariables:fh});if(!r||r.kind!=="Document")throw new Error("Not a valid GraphQL document.");V1.set(t,KM(GM(r)))}return V1.get(t)}function Me(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];typeof e=="string"&&(e=[e]);var n=e[0];return t.forEach(function(i,a){i&&i.kind==="Document"?n+=i.loc.source.body:n+=i,n+=e[a+1]}),YM(n)}function ZM(){V1.clear(),J5.clear()}function XM(){V$=!1}function JM(){fh=!0}function eL(){fh=!1}var _c={gql:Me,resetCaches:ZM,disableFragmentWarnings:XM,enableExperimentalFragmentVariables:JM,disableExperimentalFragmentVariables:eL};(function(e){e.gql=_c.gql,e.resetCaches=_c.resetCaches,e.disableFragmentWarnings=_c.disableFragmentWarnings,e.enableExperimentalFragmentVariables=_c.enableExperimentalFragmentVariables,e.disableExperimentalFragmentVariables=_c.disableExperimentalFragmentVariables})(Me||(Me={}));Me.default=Me;var kc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tL(e){return new Od(function(t,r){var n=ta(t,[]);return new cr(function(i){var a,o=!1;return Promise.resolve(n).then(function(s){return e(s,t.getContext())}).then(t.setContext).then(function(){o||(a=r(t).subscribe({next:i.next.bind(i),error:i.error.bind(i),complete:i.complete.bind(i)}))}).catch(i.error.bind(i)),function(){o=!0,a&&a.unsubscribe()}})})}const rL=/[?&]code=[^&]+/,nL=/[?&]state=[^&]+/,iL=/[?&]error=[^&]+/;class wp{constructor({authentication:t,organization:r,audience:n="https://api.photon.health",connection:i}){this._getAccessToken=(...a)=>lt(this,[...a],void 0,function*({audience:o}={audience:this.audience},s=!1){const d={authorizationParams:Object.assign({audience:o||this.audience||void 0},this.organization?{organization:this.organization}:{})};let c;try{c=yield this.authentication.getTokenSilently(d)}catch(h){h.message.includes("Consent required")&&(c=yield this.authentication.getTokenWithPopup(d))}if(!c){const h=Object.assign(Object.assign({},d),{appState:{returnTo:`${window.location.pathname}${window.location.search}`}});if(yield this.authentication.loginWithRedirect(h),s)throw new Error;return yield this._getAccessToken({audience:o},!0)}return c}),this.authentication=t,this.organization=r,this.audience=n,this.connection=i}login(t){return lt(this,arguments,void 0,function*({organizationId:r,invitation:n,appState:i}){const a=Object.assign({authorizationParams:Object.assign(Object.assign(Object.assign(Object.assign({},this.audience?{audience:this.audience}:{}),this.connection?{connection:this.connection}:{}),r||this.organization?{organization:r||this.organization}:{}),n?{invitation:n}:{})},i?{appState:i}:{});return this.authentication.loginWithRedirect(a)})}logout(t){return lt(this,arguments,void 0,function*({returnTo:r,federated:n=!1}){const i={logoutParams:Object.assign(Object.assign({},r?{returnTo:r}:{}),n?{federated:n}:{})};return this.authentication.logout(i)})}hasAuthParams(t=window.location.search){return(rL.test(t)||iL.test(t))&&nL.test(t)}getAccessToken(){return lt(this,arguments,void 0,function*({audience:t}={audience:this.audience}){return yield this._getAccessToken({audience:t??this.audience})})}getAccessTokenWithConsent(){return lt(this,arguments,void 0,function*({audience:t}={audience:this.audience}){const r={authorizationParams:Object.assign({audience:t||this.audience||void 0},this.organization?{organization:this.organization}:{})};return this.authentication.getTokenWithPopup(r)})}checkSession(){return lt(this,void 0,void 0,function*(){const t={authorizationParams:Object.assign({audience:this.audience||void 0},this.organization?{organization:this.organization}:{})};return this.authentication.checkSession(t)})}handleRedirect(t){return lt(this,void 0,void 0,function*(){try{return this.authentication.handleRedirectCallback(t)}catch(r){console.error(r)}})}getUser(){return lt(this,void 0,void 0,function*(){return this.authentication.getUser()})}isAuthenticated(){return lt(this,void 0,void 0,function*(){try{return yield this.authentication.checkSession(),yield this.authentication.isAuthenticated()}catch{return!1}})}}const o1=Me`
50
50
  fragment OrganizationFields on Organization {
51
51
  id
52
52
  name
@@ -865,7 +865,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):o
865
865
  id
866
866
  }
867
867
  }
868
- `,Np=e=>_(Kr.Row,{get children(){return[_(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(10,25)},loading:!0})}}),_(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(2,8)},loading:!0})}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(4,8)},loading:!0})}})}})]}});function Qw(e){const t=Ca(),[r,n]=le(void 0),[i,a]=le(!1),o=Z(()=>`${t?.clinicalUrl}/prescriptions/`),s=Z(()=>({variables:{id:e.patientId},client:t.apolloClinical})),d=Mh($1,s),c=f=>(p,m)=>{const v=p?.prescription?.writtenAt?new Date(p.prescription.writtenAt).getTime():-1/0,$=m?.prescription?.writtenAt?new Date(m.prescription.writtenAt).getTime():-1/0;return f?v-$:$-v};Re(()=>{const f=d()?.patient?.treatmentHistory;if(f){const p=f.slice().sort(c(i()));n(p)}!d.loading&&!f&&n([])});const h=async f=>{const p=v=>{const $={__typename:"PatientMedication",treatment:{__typename:"Treatment",...e.newMedication},active:!1,prescription:null},w=v.readQuery({query:$1,variables:{id:e.patientId}})?.patient?.treatmentHistory??[];v.writeQuery({query:$1,variables:{id:e.patientId},data:{patient:{__typename:"Patient",id:e.patientId,treatmentHistory:[$,...w]}}})};await t.apollo.mutate({mutation:Zee,variables:{id:e.patientId,medicationHistory:[{medicationId:f,active:!1}]},update:p,refetchQueries:[{query:$1,variables:{id:e.patientId}}]});const m={active:!1,treatment:e.newMedication,prescription:void 0};n(v=>v?[m,...v]:[m]),on({header:"Medication Added",body:"Medication has been added to patients history.",status:"success"}),e.hideAddMedicationDialog?.()};return Re(()=>{e?.newMedication?.id&&h(e.newMedication.id)}),_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var f=Qee();return D(f,_(Ve,{color:"gray",children:"Medication History"}),null),D(f,_(fe,{get when(){return e?.openAddMedicationDialog},get children(){return _(Ft,{variant:"secondary",size:"sm",get onClick(){return e?.openAddMedicationDialog},children:"+ Add"})}}),null),f})(),(()=>{var f=Kee();return D(f,_(Kr,{get children(){return[_(Kr.Header,{get children(){return[_(Kr.Col,{width:"16rem",children:"Medication"}),_(Kr.Col,{get children(){var p=Gee(),m=p.firstChild,v=m.nextSibling;return p.$$click=()=>a(!i()),D(v,_(fe,{get when(){return i()},get children(){return _(It,{name:"chevronDown",size:"sm"})}}),null),D(v,_(fe,{get when(){return!i()},get children(){return _(It,{name:"chevronUp",size:"sm"})}}),null),p}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Col,{children:"Source"})}})]}}),_(Kr.Body,{get children(){return _(fe,{get when(){return r()},get fallback(){return[_(Np,{get enableLinks(){return e.enableLinks}}),_(Np,{get enableLinks(){return e.enableLinks}}),_(Np,{get enableLinks(){return e.enableLinks}})]},get children(){return _(ur,{get each(){return r()},children:p=>_(Kr.Row,{get children(){return[_(Kr.Cell,{width:"16rem",get children(){return p.treatment?.name}}),_(Kr.Cell,{get children(){return jx(p.prescription?.writtenAt)||"N/A"}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Cell,{get children(){return Z(()=>!!p.prescription?.id)()?(()=>{var m=Yee();return ue(()=>Qt(m,"href",`${o()}${p.prescription?.id}`)),m})():"External"}})}})]}})})}})}})]}})),f})()]}})}ji(["click"]);var Dp="Invariant Violation",e8=Object.setPrototypeOf,Xee=e8===void 0?function(e,t){return e.__proto__=t,e}:e8,Gw=function(e){Fu(t,e);function t(r){r===void 0&&(r=Dp);var n=e.call(this,typeof r=="number"?Dp+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Dp,Xee(n,t.prototype),n}return t}(Error);function Os(e,t){if(!e)throw new Gw(t)}var Kw=["debug","log","warn","error","silent"],Jee=Kw.indexOf("log");function w1(e){return function(){if(Kw.indexOf(e)>=Jee){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=w1("debug"),e.log=w1("log"),e.warn=w1("warn"),e.error=w1("error")})(Os||(Os={}));var hm="3.11.8";function Zi(e){try{return e()}catch{}}const k3=Zi(function(){return globalThis})||Zi(function(){return window})||Zi(function(){return self})||Zi(function(){return global})||Zi(function(){return Zi.constructor("return this")()});var t8=new Map;function C3(e){var t=t8.get(e)||1;return t8.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function ete(e,t){var r=C3("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function x1(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=fm(i),t||(t=pm(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var At=Object.assign(function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e||Os(e,fm(t,r)||pm(t,r))},{debug:x1(Os.debug),log:x1(Os.log),warn:x1(Os.warn),error:x1(Os.error)});function xa(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Gw(fm(e,t)||pm(e,t))}var r8=Symbol.for("ApolloErrorMessageHandler_"+hm);function Yw(e){if(typeof e=="string")return e;try{return ete(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function fm(e,t){if(t===void 0&&(t=[]),!!e)return k3[r8]&&k3[r8](e,t.map(Yw))}function pm(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:hm,message:e,args:t.map(Yw)})))}function Zw(e,t){var r=e.directives;return!r||!r.length?!0:nte(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],At(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function xu(e,t,r){var n=new Set(e),i=n.size;return ro(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return rm}}),r?!n.size:n.size<i}function tte(e){return e&&xu(["client","export"],e,!0)}function rte(e){var t=e.name.value;return t==="skip"||t==="include"}function nte(e){var t=[];return e&&e.length&&e.forEach(function(r){if(rte(r)){var n=r.arguments,i=r.name.value;At(n&&n.length===1,71,i);var a=n[0];At(a.name&&a.name.value==="if",72,i);var o=a.value;At(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const ite=()=>Object.create(null),{forEach:ate,slice:n8}=Array.prototype,{hasOwnProperty:ote}=Object.prototype;let Xw=class Jw{constructor(t=!0,r=ite){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return ate.call(t,n=>r=r.getChildTrie(n)),ote.call(r,"data")?r.data:r.data=this.makeData(n8.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray(n8.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new Jw(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&ste(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function ste(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var lte=Zi(function(){return navigator.product})=="ReactNative",ex=typeof WeakMap=="function"&&!(lte&&!global.HermesInternal),dte=typeof WeakSet=="function",tx=typeof Symbol=="function"&&typeof Symbol.for=="function",x2=tx&&Symbol.asyncIterator;Zi(function(){return window.document.createElement});Zi(function(){return navigator.userAgent.indexOf("jsdom")>=0});function No(e){return e!==null&&typeof e=="object"}function gm(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function cte(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return At(n,76,r),n||null}default:return null}}function ute(){}class S3{constructor(t=1/0,r=ute){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function E3(){}const hte=E3,fte=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},pte=typeof WeakMap<"u"?WeakMap:Map,gte=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:E3,unregister:E3}},mte=10024;class T3{constructor(t=1/0,r=hte){this.max=t,this.dispose=r,this.map=new pte,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<mte;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new fte(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new gte(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Mp=new WeakSet;function rx(e){e.size<=(e.max||-1)||Mp.has(e)||(Mp.add(e),setTimeout(function(){e.clean(),Mp.delete(e)},100))}var nx=function(e,t){var r=new T3(e,t);return r.set=function(n,i){var a=T3.prototype.set.call(this,n,i);return rx(this),a},r},vte=function(e,t){var r=new S3(e,t);return r.set=function(n,i){var a=S3.prototype.set.call(this,n,i);return rx(this),a},r},yte=Symbol.for("apollo.cacheSize"),Hu=_e({},k3[yte]),_s={};function ix(e,t){_s[e]=t}var bte=globalThis.__DEV__!==!1?wte:void 0;function $te(){var e={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(e).map(function(t){var r=t[0],n=t[1];return[r,Hu[r]||n]}))}function wte(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:$te(),sizes:_e({print:(e=_s.print)===null||e===void 0?void 0:e.call(_s),parser:(t=_s.parser)===null||t===void 0?void 0:t.call(_s),canonicalStringify:(r=_s.canonicalStringify)===null||r===void 0?void 0:r.call(_s),links:O3(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:kte(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function xte(e){return!!e&&"dirtyKey"in e}function _te(e){return xte(e)?e.size:void 0}function ax(e){return e!=null}function kte(e){return A3(e).map(function(t){return{cache:t}})}function A3(e){return e?mi(mi([_te(e?.performWork)],A3(e?.left),!0),A3(e?.right),!0).filter(ax):[]}function O3(e){var t;return e?mi(mi([(t=e?.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],O3(e?.left),!0),O3(e?.right),!0).filter(ax):[]}var mm=Object.assign(function(e){return JSON.stringify(e,Cte)},{reset:function(){Ql=new vte(Hu.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&ix("canonicalStringify",function(){return Ql.size});var Ql;mm.reset();function Cte(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Ste))return t;var i=JSON.stringify(n),a=Ql.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Ql.get(o)||n,Ql.set(i,a),Ql.set(o,a)}var s=Object.create(r);return a.forEach(function(d){s[d]=t[d]}),s}}return t}function Ste(e,t,r){return t===0||r[t-1]<=e}function Ete(e){return No(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function Tte(e){return e.kind==="StringValue"}function Ate(e){return e.kind==="BooleanValue"}function Ote(e){return e.kind==="IntValue"}function Pte(e){return e.kind==="FloatValue"}function Ite(e){return e.kind==="Variable"}function Nte(e){return e.kind==="ObjectValue"}function Dte(e){return e.kind==="ListValue"}function Mte(e){return e.kind==="EnumValue"}function Lte(e){return e.kind==="NullValue"}function Ph(e,t,r,n){if(Ote(r)||Pte(r))e[t.value]=Number(r.value);else if(Ate(r)||Tte(r))e[t.value]=r.value;else if(Nte(r)){var i={};r.fields.map(function(o){return Ph(i,o.name,o.value,n)}),e[t.value]=i}else if(Ite(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(Dte(r))e[t.value]=r.values.map(function(o){var s={};return Ph(s,t,o,n),s[t.value]});else if(Mte(r))e[t.value]=r.value;else if(Lte(r))e[t.value]=null;else throw xa(85,t.value,r.kind)}var Rte=["connection","include","skip","client","rest","export","nonreactive"],Oc=mm;Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(Oc(i),")")}else return r.connection.key;var a=e;if(t){var o=Oc(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Rte.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Oc(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=Oc;return Oc=e,t}});function Fte(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return Ph(r,i,a,t)}),r}return null}function P3(e){return e.alias?e.alias.value:e.name.value}function Ih(e){return e.kind==="Field"}function zte(e){return e.kind==="InlineFragment"}function Wu(e){At(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw xa(78,r.kind);return r});return At(t.length<=1,79,t.length),e}function _2(e){return Wu(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function I3(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function vm(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function jte(e){var t=_2(e);return At(t&&t.operation==="query",80),t}function Vte(e){At(e.kind==="Document",81),At(e.definitions.length<=1,82);var t=e.definitions[0];return At(t.kind==="FragmentDefinition",83),t}function k2(e){Wu(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw xa(84)}function Ute(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Ph(t,n.variable.name,n.defaultValue)}),t}const Bte=()=>Object.create(null),{forEach:qte,slice:Hte}=Array.prototype,{hasOwnProperty:Wte}=Object.prototype;class ym{constructor(t=!0,r=Bte){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return qte.call(t,n=>r=r.getChildTrie(n)),Wte.call(r,"data")?r.data:r.data=this.makeData(Hte.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&i8(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&i8(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new ym(this.weakness,this.makeData)),n}}function i8(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let yn=null;const a8={};let Qte=1;const Gte=()=>class{constructor(){this.id=["slot",Qte++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=yn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===a8)break;return e!==yn&&(yn.slots[this.id]=t),!0}return yn&&(yn.slots[this.id]=a8),!1}getValue(){if(this.hasValue())return yn.slots[this.id]}withValue(e,t,r,n){const i={__proto__:null,[this.id]:e},a=yn;yn={parent:a,slots:i};try{return t.apply(n,r)}finally{yn=a}}static bind(e){const t=yn;return function(){const r=yn;try{return yn=t,e.apply(this,arguments)}finally{yn=r}}}static noContext(e,t,r){if(yn){const n=yn;try{return yn=null,e.apply(r,t)}finally{yn=n}}else return e.apply(r,t)}};function o8(e){try{return e()}catch{}}const Lp="@wry/context:Slot",Kte=o8(()=>globalThis)||o8(()=>global)||Object.create(null),s8=Kte,ox=s8[Lp]||Array[Lp]||function(e){try{Object.defineProperty(s8,Lp,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(Gte()),bm=new ox,sx=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function lx(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const _u=[],Yte=100;function $d(e,t){if(!e)throw new Error(t||"assertion failure")}function dx(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function cx(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function ux(e){return e.slice(0)}class C2{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++C2.count}peek(){if(this.value.length===1&&!Ho(this))return l8(this),this.value[0]}recompute(t){return $d(!this.recomputing,"already recomputing"),l8(this),Ho(this)?Zte(this,t):cx(this.value)}setDirty(){this.dirty||(this.dirty=!0,hx(this),lx(this))}dispose(){this.setDirty(),vx(this),$m(this,(t,r)=>{t.setDirty(),yx(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=_u.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(sx(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),_u.push(this.deps),this.deps=null)}}C2.count=0;function l8(e){const t=bm.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Ho(e)?px(t,e):gx(t,e),t}function Zte(e,t){return vx(e),bm.withValue(e,Xte,[e,t]),ere(e,t)&&Jte(e),cx(e.value)}function Xte(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=ux(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!dx(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function Ho(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function Jte(e){e.dirty=!1,!Ho(e)&&fx(e)}function hx(e){$m(e,px)}function fx(e){$m(e,gx)}function $m(e,t){const r=e.parents.size;if(r){const n=sx(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function px(e,t){$d(e.childValues.has(t)),$d(Ho(t));const r=!Ho(e);if(!e.dirtyChildren)e.dirtyChildren=_u.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&hx(e)}function gx(e,t){$d(e.childValues.has(t)),$d(!Ho(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,ux(t.value)):dx(r,t.value)||e.setDirty(),mx(e,t),!Ho(e)&&fx(e)}function mx(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(_u.length<Yte&&_u.push(r),e.dirtyChildren=null))}function vx(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{yx(e,r)}),e.forgetDeps(),$d(e.dirtyChildren===null)}function yx(e,t){t.parents.delete(e),e.childValues.delete(t),mx(e,t)}function ere(e,t){if(typeof e.subscribe=="function")try{lx(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}let d8;function tre(...e){return(d8||(d8=new ym(typeof WeakMap=="function"))).lookupArray(e)}const Rp=new Set;function rre(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=tre,normalizeResult:i,subscribe:a,cache:o=S3}=Object.create(null)){const s=typeof o=="function"?new o(t,p=>p.dispose()):o,d=function(){const p=n.apply(null,r?r.apply(null,arguments):arguments);if(p===void 0)return e.apply(null,arguments);let m=s.get(p);m||(s.set(p,m=new C2(e)),m.normalizeResult=i,m.subscribe=a,m.forget=()=>s.delete(p));const v=m.recompute(Array.prototype.slice.call(arguments));return s.set(p,m),Rp.add(s),bm.hasValue()||(Rp.forEach($=>$.clean()),Rp.clear()),v};Object.defineProperty(d,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(d.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function c(p){const m=p&&s.get(p);m&&m.setDirty()}d.dirtyKey=c,d.dirty=function(){c(n.apply(null,arguments))};function h(p){const m=p&&s.get(p);if(m)return m.peek()}d.peekKey=h,d.peek=function(){return h(n.apply(null,arguments))};function f(p){return p?s.delete(p):!1}return d.forgetKey=f,d.forget=function(){return f(n.apply(null,arguments))},d.makeCacheKey=n,d.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(d)}function nre(e){return e}var ire=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=dte?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(nre,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new Xw(ex);this.performWork=rre(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return At(Array.isArray(i),69),r.lookupArray(i)},max:Hu["documentTransform.cache"],cache:T3})}},e.prototype.performWork=function(t){return Wu(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),eu,wm=Object.assign(function(e){var t=eu.get(e);return t||(t=BF(e),eu.set(e,t)),t},{reset:function(){eu=new nx(Hu.print||2e3)}});wm.reset();globalThis.__DEV__!==!1&&ix("print",function(){return eu?eu.size:0});var are=Array.isArray;function Wo(e){return Array.isArray(e)&&e.length>0}var c8={kind:We.FIELD,name:{kind:We.NAME,value:"__typename"}};function bx(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===We.FRAGMENT_SPREAD&&bx(t[r.name.value],t)})}function ore(e){return bx(_2(e)||Vte(e),gm(vm(e)))?null:e}function sre(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function u8(e){var t=new Map;return function(r){r===void 0&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function $x(e,t){Wu(t);for(var r=u8(""),n=u8(""),i=function(x){for(var C=0,k=void 0;C<x.length&&(k=x[C]);++C)if(!are(k)){if(k.kind===We.OPERATION_DEFINITION)return r(k.name&&k.name.value);if(k.kind===We.FRAGMENT_DEFINITION)return n(k.name.value)}return globalThis.__DEV__!==!1&&At.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===We.OPERATION_DEFINITION&&++a;var s=sre(e),d=function(x){return Wo(x)&&x.map(s).some(function(C){return C&&C.remove})},c=new Map,h=!1,f={enter:function(x){if(d(x.directives))return h=!0,null}},p=ro(t,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(x,C,k,S,P){var N=i(P);N&&N.variables.add(x.name.value)}},FragmentSpread:{enter:function(x,C,k,S,P){if(d(x.directives))return h=!0,null;var N=i(P);N&&N.fragmentSpreads.add(x.name.value)}},FragmentDefinition:{enter:function(x,C,k,S){c.set(JSON.stringify(S),x)},leave:function(x,C,k,S){var P=c.get(JSON.stringify(S));if(x===P)return x;if(a>0&&x.selectionSet.selections.every(function(N){return N.kind===We.FIELD&&N.name.value==="__typename"}))return n(x.name.value).removed=!0,h=!0,null}},Directive:{leave:function(x){if(s(x))return h=!0,null}}});if(!h)return t;var m=function(x){return x.transitiveVars||(x.transitiveVars=new Set(x.variables),x.removed||x.fragmentSpreads.forEach(function(C){m(n(C)).transitiveVars.forEach(function(k){x.transitiveVars.add(k)})})),x},v=new Set;p.definitions.forEach(function(x){x.kind===We.OPERATION_DEFINITION?m(r(x.name&&x.name.value)).fragmentSpreads.forEach(function(C){v.add(C)}):x.kind===We.FRAGMENT_DEFINITION&&a===0&&!n(x.name.value).removed&&v.add(x.name.value)}),v.forEach(function(x){m(n(x)).fragmentSpreads.forEach(function(C){v.add(C)})});var $=function(x){return!!(!v.has(x)||n(x).removed)},w={enter:function(x){if($(x.name.value))return null}};return ore(ro(p,{FragmentSpread:w,FragmentDefinition:w,OperationDefinition:{leave:function(x){if(x.variableDefinitions){var C=m(r(x.name&&x.name.value)).transitiveVars;if(C.size<x.variableDefinitions.length)return _e(_e({},x),{variableDefinitions:x.variableDefinitions.filter(function(k){return C.has(k.variable.name.value)})})}}}}))}Object.assign(function(e){return ro(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===We.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return Ih(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ih(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _e(_e({},t),{selections:mi(mi([],i,!0),[c8],!1)})}}}}}})},{added:function(e){return e===c8}});function lre(e){var t=k2(e),r=t.operation;if(r==="query")return e;var n=ro(e,{OperationDefinition:{enter:function(i){return _e(_e({},i),{operation:"query"})}}});return n}function wx(e){Wu(e);var t=$x([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var dre=Object.prototype.hasOwnProperty;function h8(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xx(e)}function xx(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new xm,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var cre=function(e,t,r){return this.merge(e[r],t[r])},xm=function(){function e(t){t===void 0&&(t=cre),this.reconciler=t,this.isObject=No,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return No(r)&&No(t)?(Object.keys(r).forEach(function(o){if(dre.call(t,o)){var s=t[o];if(r[o]!==s){var d=n.reconciler.apply(n,mi([t,r,o],i,!1));d!==s&&(t=n.shallowCopyForMerge(t),t[o]=d)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return No(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=_e({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function ure(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=hre(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
868
+ `,Np=e=>_(Kr.Row,{get children(){return[_(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(10,25)},loading:!0})}}),_(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(2,8)},loading:!0})}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Cell,{get children(){return _(Ve,{get sampleLoadingText(){return Qp(4,8)},loading:!0})}})}})]}});function Qw(e){const t=Ca(),[r,n]=le(void 0),[i,a]=le(!1),o=Z(()=>`${t?.clinicalUrl}/prescriptions/`),s=Z(()=>({variables:{id:e.patientId},client:t.apolloClinical,skip:!e.patientId,fetchPolicy:"network-only",refetchQueries:[$1]})),d=Mh($1,s),c=f=>(p,m)=>{const v=p?.prescription?.writtenAt?new Date(p.prescription.writtenAt).getTime():-1/0,$=m?.prescription?.writtenAt?new Date(m.prescription.writtenAt).getTime():-1/0;return f?v-$:$-v};Re(()=>{const f=d()?.patient?.treatmentHistory;if(f){const p=f.slice().sort(c(i()));n(p)}!d.loading&&!f&&n([])});const h=async f=>{const p=v=>{const $={__typename:"PatientMedication",treatment:{__typename:"Treatment",...e.newMedication},active:!1,prescription:null},w=v.readQuery({query:$1,variables:{id:e.patientId}})?.patient?.treatmentHistory??[];v.writeQuery({query:$1,variables:{id:e.patientId},data:{patient:{__typename:"Patient",id:e.patientId,treatmentHistory:[$,...w]}}})};await t.apollo.mutate({mutation:Zee,variables:{id:e.patientId,medicationHistory:[{medicationId:f,active:!1}]},update:p});const m={active:!1,treatment:e.newMedication,prescription:void 0};n(v=>v?[m,...v]:[m]),on({header:"Medication Added",body:"Medication has been added to patients history.",status:"success"}),e.hideAddMedicationDialog?.()};return Re(()=>{e?.newMedication?.id&&h(e.newMedication.id)}),_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var f=Qee();return D(f,_(Ve,{color:"gray",children:"Medication History"}),null),D(f,_(fe,{get when(){return e?.openAddMedicationDialog},get children(){return _(Ft,{variant:"secondary",size:"sm",get onClick(){return e?.openAddMedicationDialog},children:"+ Add"})}}),null),f})(),(()=>{var f=Kee();return D(f,_(Kr,{get children(){return[_(Kr.Header,{get children(){return[_(Kr.Col,{width:"16rem",children:"Medication"}),_(Kr.Col,{get children(){var p=Gee(),m=p.firstChild,v=m.nextSibling;return p.$$click=()=>a(!i()),D(v,_(fe,{get when(){return i()},get children(){return _(It,{name:"chevronDown",size:"sm"})}}),null),D(v,_(fe,{get when(){return!i()},get children(){return _(It,{name:"chevronUp",size:"sm"})}}),null),p}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Col,{children:"Source"})}})]}}),_(Kr.Body,{get children(){return _(fe,{get when(){return r()},get fallback(){return[_(Np,{get enableLinks(){return e.enableLinks}}),_(Np,{get enableLinks(){return e.enableLinks}}),_(Np,{get enableLinks(){return e.enableLinks}})]},get children(){return _(ur,{get each(){return r()},children:p=>_(Kr.Row,{get children(){return[_(Kr.Cell,{width:"16rem",get children(){return p.treatment?.name}}),_(Kr.Cell,{get children(){return jx(p.prescription?.writtenAt)||"N/A"}}),_(fe,{get when(){return e.enableLinks},get children(){return _(Kr.Cell,{get children(){return Z(()=>!!p.prescription?.id)()?(()=>{var m=Yee();return ue(()=>Qt(m,"href",`${o()}${p.prescription?.id}`)),m})():"External"}})}})]}})})}})}})]}})),f})()]}})}ji(["click"]);var Dp="Invariant Violation",e8=Object.setPrototypeOf,Xee=e8===void 0?function(e,t){return e.__proto__=t,e}:e8,Gw=function(e){Fu(t,e);function t(r){r===void 0&&(r=Dp);var n=e.call(this,typeof r=="number"?Dp+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return n.framesToPop=1,n.name=Dp,Xee(n,t.prototype),n}return t}(Error);function Os(e,t){if(!e)throw new Gw(t)}var Kw=["debug","log","warn","error","silent"],Jee=Kw.indexOf("log");function w1(e){return function(){if(Kw.indexOf(e)>=Jee){var t=console[e]||console.log;return t.apply(console,arguments)}}}(function(e){e.debug=w1("debug"),e.log=w1("log"),e.warn=w1("warn"),e.error=w1("error")})(Os||(Os={}));var hm="3.11.8";function Zi(e){try{return e()}catch{}}const k3=Zi(function(){return globalThis})||Zi(function(){return window})||Zi(function(){return self})||Zi(function(){return global})||Zi(function(){return Zi.constructor("return this")()});var t8=new Map;function C3(e){var t=t8.get(e)||1;return t8.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function ete(e,t){var r=C3("stringifyForDisplay");return JSON.stringify(e,function(n,i){return i===void 0?r:i},t).split(JSON.stringify(r)).join("<undefined>")}function x1(e){return function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(typeof t=="number"){var i=t;t=fm(i),t||(t=pm(i,r),r=[])}e.apply(void 0,[t].concat(r))}}var At=Object.assign(function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e||Os(e,fm(t,r)||pm(t,r))},{debug:x1(Os.debug),log:x1(Os.log),warn:x1(Os.warn),error:x1(Os.error)});function xa(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return new Gw(fm(e,t)||pm(e,t))}var r8=Symbol.for("ApolloErrorMessageHandler_"+hm);function Yw(e){if(typeof e=="string")return e;try{return ete(e,2).slice(0,1e3)}catch{return"<non-serializable>"}}function fm(e,t){if(t===void 0&&(t=[]),!!e)return k3[r8]&&k3[r8](e,t.map(Yw))}function pm(e,t){if(t===void 0&&(t=[]),!!e)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:hm,message:e,args:t.map(Yw)})))}function Zw(e,t){var r=e.directives;return!r||!r.length?!0:nte(r).every(function(n){var i=n.directive,a=n.ifArgument,o=!1;return a.value.kind==="Variable"?(o=t&&t[a.value.name.value],At(o!==void 0,70,i.name.value)):o=a.value.value,i.name.value==="skip"?!o:o})}function xu(e,t,r){var n=new Set(e),i=n.size;return ro(t,{Directive:function(a){if(n.delete(a.name.value)&&(!r||!n.size))return rm}}),r?!n.size:n.size<i}function tte(e){return e&&xu(["client","export"],e,!0)}function rte(e){var t=e.name.value;return t==="skip"||t==="include"}function nte(e){var t=[];return e&&e.length&&e.forEach(function(r){if(rte(r)){var n=r.arguments,i=r.name.value;At(n&&n.length===1,71,i);var a=n[0];At(a.name&&a.name.value==="if",72,i);var o=a.value;At(o&&(o.kind==="Variable"||o.kind==="BooleanValue"),73,i),t.push({directive:r,ifArgument:a})}}),t}const ite=()=>Object.create(null),{forEach:ate,slice:n8}=Array.prototype,{hasOwnProperty:ote}=Object.prototype;let Xw=class Jw{constructor(t=!0,r=ite){this.weakness=t,this.makeData=r}lookup(){return this.lookupArray(arguments)}lookupArray(t){let r=this;return ate.call(t,n=>r=r.getChildTrie(n)),ote.call(r,"data")?r.data:r.data=this.makeData(n8.call(t))}peek(){return this.peekArray(arguments)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=r.mapFor(t[n],!1);r=a&&a.get(t[n])}return r&&r.data}remove(){return this.removeArray(arguments)}removeArray(t){let r;if(t.length){const n=t[0],i=this.mapFor(n,!1),a=i&&i.get(n);a&&(r=a.removeArray(n8.call(t,1)),!a.data&&!a.weak&&!(a.strong&&a.strong.size)&&i.delete(n))}else r=this.data,delete this.data;return r}getChildTrie(t){const r=this.mapFor(t,!0);let n=r.get(t);return n||r.set(t,n=new Jw(this.weakness,this.makeData)),n}mapFor(t,r){return this.weakness&&ste(t)?this.weak||(r?this.weak=new WeakMap:void 0):this.strong||(r?this.strong=new Map:void 0)}};function ste(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}var lte=Zi(function(){return navigator.product})=="ReactNative",ex=typeof WeakMap=="function"&&!(lte&&!global.HermesInternal),dte=typeof WeakSet=="function",tx=typeof Symbol=="function"&&typeof Symbol.for=="function",x2=tx&&Symbol.asyncIterator;Zi(function(){return window.document.createElement});Zi(function(){return navigator.userAgent.indexOf("jsdom")>=0});function No(e){return e!==null&&typeof e=="object"}function gm(e){e===void 0&&(e=[]);var t={};return e.forEach(function(r){t[r.name.value]=r}),t}function cte(e,t){switch(e.kind){case"InlineFragment":return e;case"FragmentSpread":{var r=e.name.value;if(typeof t=="function")return t(r);var n=t&&t[r];return At(n,76,r),n||null}default:return null}}function ute(){}class S3{constructor(t=1/0,r=ute){this.max=t,this.dispose=r,this.map=new Map,this.newest=null,this.oldest=null}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}get size(){return this.map.size}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(t,n),n.value)}clean(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)}delete(t){const r=this.map.get(t);return r?(r===this.newest&&(this.newest=r.older),r===this.oldest&&(this.oldest=r.newer),r.newer&&(r.newer.older=r.older),r.older&&(r.older.newer=r.newer),this.map.delete(t),this.dispose(r.value,t),!0):!1}}function E3(){}const hte=E3,fte=typeof WeakRef<"u"?WeakRef:function(e){return{deref:()=>e}},pte=typeof WeakMap<"u"?WeakMap:Map,gte=typeof FinalizationRegistry<"u"?FinalizationRegistry:function(){return{register:E3,unregister:E3}},mte=10024;class T3{constructor(t=1/0,r=hte){this.max=t,this.dispose=r,this.map=new pte,this.newest=null,this.oldest=null,this.unfinalizedNodes=new Set,this.finalizationScheduled=!1,this.size=0,this.finalize=()=>{const n=this.unfinalizedNodes.values();for(let i=0;i<mte;i++){const a=n.next().value;if(!a)break;this.unfinalizedNodes.delete(a);const o=a.key;delete a.key,a.keyRef=new fte(o),this.registry.register(o,a,a)}this.unfinalizedNodes.size>0?queueMicrotask(this.finalize):this.finalizationScheduled=!1},this.registry=new gte(this.deleteNode.bind(this))}has(t){return this.map.has(t)}get(t){const r=this.getNode(t);return r&&r.value}getNode(t){const r=this.map.get(t);if(r&&r!==this.newest){const{older:n,newer:i}=r;i&&(i.older=n),n&&(n.newer=i),r.older=this.newest,r.older.newer=r,r.newer=null,this.newest=r,r===this.oldest&&(this.oldest=i)}return r}set(t,r){let n=this.getNode(t);return n?n.value=r:(n={key:t,value:r,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.scheduleFinalization(n),this.map.set(t,n),this.size++,n.value)}clean(){for(;this.oldest&&this.size>this.max;)this.deleteNode(this.oldest)}deleteNode(t){t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.size--;const r=t.key||t.keyRef&&t.keyRef.deref();this.dispose(t.value,r),t.keyRef?this.registry.unregister(t):this.unfinalizedNodes.delete(t),r&&this.map.delete(r)}delete(t){const r=this.map.get(t);return r?(this.deleteNode(r),!0):!1}scheduleFinalization(t){this.unfinalizedNodes.add(t),this.finalizationScheduled||(this.finalizationScheduled=!0,queueMicrotask(this.finalize))}}var Mp=new WeakSet;function rx(e){e.size<=(e.max||-1)||Mp.has(e)||(Mp.add(e),setTimeout(function(){e.clean(),Mp.delete(e)},100))}var nx=function(e,t){var r=new T3(e,t);return r.set=function(n,i){var a=T3.prototype.set.call(this,n,i);return rx(this),a},r},vte=function(e,t){var r=new S3(e,t);return r.set=function(n,i){var a=S3.prototype.set.call(this,n,i);return rx(this),a},r},yte=Symbol.for("apollo.cacheSize"),Hu=_e({},k3[yte]),_s={};function ix(e,t){_s[e]=t}var bte=globalThis.__DEV__!==!1?wte:void 0;function $te(){var e={parser:1e3,canonicalStringify:1e3,print:2e3,"documentTransform.cache":2e3,"queryManager.getDocumentInfo":2e3,"PersistedQueryLink.persistedQueryHashes":2e3,"fragmentRegistry.transform":2e3,"fragmentRegistry.lookup":1e3,"fragmentRegistry.findFragmentSpreads":4e3,"cache.fragmentQueryDocuments":1e3,"removeTypenameFromVariables.getVariableDefinitions":2e3,"inMemoryCache.maybeBroadcastWatch":5e3,"inMemoryCache.executeSelectionSet":5e4,"inMemoryCache.executeSubSelectedArray":1e4};return Object.fromEntries(Object.entries(e).map(function(t){var r=t[0],n=t[1];return[r,Hu[r]||n]}))}function wte(){var e,t,r,n,i;if(globalThis.__DEV__===!1)throw new Error("only supported in development mode");return{limits:$te(),sizes:_e({print:(e=_s.print)===null||e===void 0?void 0:e.call(_s),parser:(t=_s.parser)===null||t===void 0?void 0:t.call(_s),canonicalStringify:(r=_s.canonicalStringify)===null||r===void 0?void 0:r.call(_s),links:O3(this.link),queryManager:{getDocumentInfo:this.queryManager.transformCache.size,documentTransforms:kte(this.queryManager.documentTransform)}},(i=(n=this.cache).getMemoryInternals)===null||i===void 0?void 0:i.call(n))}}function xte(e){return!!e&&"dirtyKey"in e}function _te(e){return xte(e)?e.size:void 0}function ax(e){return e!=null}function kte(e){return A3(e).map(function(t){return{cache:t}})}function A3(e){return e?mi(mi([_te(e?.performWork)],A3(e?.left),!0),A3(e?.right),!0).filter(ax):[]}function O3(e){var t;return e?mi(mi([(t=e?.getMemoryInternals)===null||t===void 0?void 0:t.call(e)],O3(e?.left),!0),O3(e?.right),!0).filter(ax):[]}var mm=Object.assign(function(e){return JSON.stringify(e,Cte)},{reset:function(){Ql=new vte(Hu.canonicalStringify||1e3)}});globalThis.__DEV__!==!1&&ix("canonicalStringify",function(){return Ql.size});var Ql;mm.reset();function Cte(e,t){if(t&&typeof t=="object"){var r=Object.getPrototypeOf(t);if(r===Object.prototype||r===null){var n=Object.keys(t);if(n.every(Ste))return t;var i=JSON.stringify(n),a=Ql.get(i);if(!a){n.sort();var o=JSON.stringify(n);a=Ql.get(o)||n,Ql.set(i,a),Ql.set(o,a)}var s=Object.create(r);return a.forEach(function(d){s[d]=t[d]}),s}}return t}function Ste(e,t,r){return t===0||r[t-1]<=e}function Ete(e){return No(e)&&e.kind==="Document"&&Array.isArray(e.definitions)}function Tte(e){return e.kind==="StringValue"}function Ate(e){return e.kind==="BooleanValue"}function Ote(e){return e.kind==="IntValue"}function Pte(e){return e.kind==="FloatValue"}function Ite(e){return e.kind==="Variable"}function Nte(e){return e.kind==="ObjectValue"}function Dte(e){return e.kind==="ListValue"}function Mte(e){return e.kind==="EnumValue"}function Lte(e){return e.kind==="NullValue"}function Ph(e,t,r,n){if(Ote(r)||Pte(r))e[t.value]=Number(r.value);else if(Ate(r)||Tte(r))e[t.value]=r.value;else if(Nte(r)){var i={};r.fields.map(function(o){return Ph(i,o.name,o.value,n)}),e[t.value]=i}else if(Ite(r)){var a=(n||{})[r.name.value];e[t.value]=a}else if(Dte(r))e[t.value]=r.values.map(function(o){var s={};return Ph(s,t,o,n),s[t.value]});else if(Mte(r))e[t.value]=r.value;else if(Lte(r))e[t.value]=null;else throw xa(85,t.value,r.kind)}var Rte=["connection","include","skip","client","rest","export","nonreactive"],Oc=mm;Object.assign(function(e,t,r){if(t&&r&&r.connection&&r.connection.key)if(r.connection.filter&&r.connection.filter.length>0){var n=r.connection.filter?r.connection.filter:[];n.sort();var i={};return n.forEach(function(s){i[s]=t[s]}),"".concat(r.connection.key,"(").concat(Oc(i),")")}else return r.connection.key;var a=e;if(t){var o=Oc(t);a+="(".concat(o,")")}return r&&Object.keys(r).forEach(function(s){Rte.indexOf(s)===-1&&(r[s]&&Object.keys(r[s]).length?a+="@".concat(s,"(").concat(Oc(r[s]),")"):a+="@".concat(s))}),a},{setStringify:function(e){var t=Oc;return Oc=e,t}});function Fte(e,t){if(e.arguments&&e.arguments.length){var r={};return e.arguments.forEach(function(n){var i=n.name,a=n.value;return Ph(r,i,a,t)}),r}return null}function P3(e){return e.alias?e.alias.value:e.name.value}function Ih(e){return e.kind==="Field"}function zte(e){return e.kind==="InlineFragment"}function Wu(e){At(e&&e.kind==="Document",77);var t=e.definitions.filter(function(r){return r.kind!=="FragmentDefinition"}).map(function(r){if(r.kind!=="OperationDefinition")throw xa(78,r.kind);return r});return At(t.length<=1,79,t.length),e}function _2(e){return Wu(e),e.definitions.filter(function(t){return t.kind==="OperationDefinition"})[0]}function I3(e){return e.definitions.filter(function(t){return t.kind==="OperationDefinition"&&!!t.name}).map(function(t){return t.name.value})[0]||null}function vm(e){return e.definitions.filter(function(t){return t.kind==="FragmentDefinition"})}function jte(e){var t=_2(e);return At(t&&t.operation==="query",80),t}function Vte(e){At(e.kind==="Document",81),At(e.definitions.length<=1,82);var t=e.definitions[0];return At(t.kind==="FragmentDefinition",83),t}function k2(e){Wu(e);for(var t,r=0,n=e.definitions;r<n.length;r++){var i=n[r];if(i.kind==="OperationDefinition"){var a=i.operation;if(a==="query"||a==="mutation"||a==="subscription")return i}i.kind==="FragmentDefinition"&&!t&&(t=i)}if(t)return t;throw xa(84)}function Ute(e){var t=Object.create(null),r=e&&e.variableDefinitions;return r&&r.length&&r.forEach(function(n){n.defaultValue&&Ph(t,n.variable.name,n.defaultValue)}),t}const Bte=()=>Object.create(null),{forEach:qte,slice:Hte}=Array.prototype,{hasOwnProperty:Wte}=Object.prototype;class ym{constructor(t=!0,r=Bte){this.weakness=t,this.makeData=r}lookup(...t){return this.lookupArray(t)}lookupArray(t){let r=this;return qte.call(t,n=>r=r.getChildTrie(n)),Wte.call(r,"data")?r.data:r.data=this.makeData(Hte.call(t))}peek(...t){return this.peekArray(t)}peekArray(t){let r=this;for(let n=0,i=t.length;r&&n<i;++n){const a=this.weakness&&i8(t[n])?r.weak:r.strong;r=a&&a.get(t[n])}return r&&r.data}getChildTrie(t){const r=this.weakness&&i8(t)?this.weak||(this.weak=new WeakMap):this.strong||(this.strong=new Map);let n=r.get(t);return n||r.set(t,n=new ym(this.weakness,this.makeData)),n}}function i8(e){switch(typeof e){case"object":if(e===null)break;case"function":return!0}return!1}let yn=null;const a8={};let Qte=1;const Gte=()=>class{constructor(){this.id=["slot",Qte++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=yn;e;e=e.parent)if(this.id in e.slots){const t=e.slots[this.id];if(t===a8)break;return e!==yn&&(yn.slots[this.id]=t),!0}return yn&&(yn.slots[this.id]=a8),!1}getValue(){if(this.hasValue())return yn.slots[this.id]}withValue(e,t,r,n){const i={__proto__:null,[this.id]:e},a=yn;yn={parent:a,slots:i};try{return t.apply(n,r)}finally{yn=a}}static bind(e){const t=yn;return function(){const r=yn;try{return yn=t,e.apply(this,arguments)}finally{yn=r}}}static noContext(e,t,r){if(yn){const n=yn;try{return yn=null,e.apply(r,t)}finally{yn=n}}else return e.apply(r,t)}};function o8(e){try{return e()}catch{}}const Lp="@wry/context:Slot",Kte=o8(()=>globalThis)||o8(()=>global)||Object.create(null),s8=Kte,ox=s8[Lp]||Array[Lp]||function(e){try{Object.defineProperty(s8,Lp,{value:e,enumerable:!1,writable:!1,configurable:!0})}finally{return e}}(Gte()),bm=new ox,sx=Array.from||function(e){const t=[];return e.forEach(r=>t.push(r)),t};function lx(e){const{unsubscribe:t}=e;typeof t=="function"&&(e.unsubscribe=void 0,t())}const _u=[],Yte=100;function $d(e,t){if(!e)throw new Error(t||"assertion failure")}function dx(e,t){const r=e.length;return r>0&&r===t.length&&e[r-1]===t[r-1]}function cx(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}function ux(e){return e.slice(0)}class C2{constructor(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++C2.count}peek(){if(this.value.length===1&&!Ho(this))return l8(this),this.value[0]}recompute(t){return $d(!this.recomputing,"already recomputing"),l8(this),Ho(this)?Zte(this,t):cx(this.value)}setDirty(){this.dirty||(this.dirty=!0,hx(this),lx(this))}dispose(){this.setDirty(),vx(this),$m(this,(t,r)=>{t.setDirty(),yx(t,this)})}forget(){this.dispose()}dependOn(t){t.add(this),this.deps||(this.deps=_u.pop()||new Set),this.deps.add(t)}forgetDeps(){this.deps&&(sx(this.deps).forEach(t=>t.delete(this)),this.deps.clear(),_u.push(this.deps),this.deps=null)}}C2.count=0;function l8(e){const t=bm.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Ho(e)?px(t,e):gx(t,e),t}function Zte(e,t){return vx(e),bm.withValue(e,Xte,[e,t]),ere(e,t)&&Jte(e),cx(e.value)}function Xte(e,t){e.recomputing=!0;const{normalizeResult:r}=e;let n;r&&e.value.length===1&&(n=ux(e.value)),e.value.length=0;try{if(e.value[0]=e.fn.apply(null,t),r&&n&&!dx(n,e.value))try{e.value[0]=r(e.value[0],n[0])}catch{}}catch(i){e.value[1]=i}e.recomputing=!1}function Ho(e){return e.dirty||!!(e.dirtyChildren&&e.dirtyChildren.size)}function Jte(e){e.dirty=!1,!Ho(e)&&fx(e)}function hx(e){$m(e,px)}function fx(e){$m(e,gx)}function $m(e,t){const r=e.parents.size;if(r){const n=sx(e.parents);for(let i=0;i<r;++i)t(n[i],e)}}function px(e,t){$d(e.childValues.has(t)),$d(Ho(t));const r=!Ho(e);if(!e.dirtyChildren)e.dirtyChildren=_u.pop()||new Set;else if(e.dirtyChildren.has(t))return;e.dirtyChildren.add(t),r&&hx(e)}function gx(e,t){$d(e.childValues.has(t)),$d(!Ho(t));const r=e.childValues.get(t);r.length===0?e.childValues.set(t,ux(t.value)):dx(r,t.value)||e.setDirty(),mx(e,t),!Ho(e)&&fx(e)}function mx(e,t){const r=e.dirtyChildren;r&&(r.delete(t),r.size===0&&(_u.length<Yte&&_u.push(r),e.dirtyChildren=null))}function vx(e){e.childValues.size>0&&e.childValues.forEach((t,r)=>{yx(e,r)}),e.forgetDeps(),$d(e.dirtyChildren===null)}function yx(e,t){t.parents.delete(e),e.childValues.delete(t),mx(e,t)}function ere(e,t){if(typeof e.subscribe=="function")try{lx(e),e.unsubscribe=e.subscribe.apply(null,t)}catch{return e.setDirty(),!1}return!0}let d8;function tre(...e){return(d8||(d8=new ym(typeof WeakMap=="function"))).lookupArray(e)}const Rp=new Set;function rre(e,{max:t=Math.pow(2,16),keyArgs:r,makeCacheKey:n=tre,normalizeResult:i,subscribe:a,cache:o=S3}=Object.create(null)){const s=typeof o=="function"?new o(t,p=>p.dispose()):o,d=function(){const p=n.apply(null,r?r.apply(null,arguments):arguments);if(p===void 0)return e.apply(null,arguments);let m=s.get(p);m||(s.set(p,m=new C2(e)),m.normalizeResult=i,m.subscribe=a,m.forget=()=>s.delete(p));const v=m.recompute(Array.prototype.slice.call(arguments));return s.set(p,m),Rp.add(s),bm.hasValue()||(Rp.forEach($=>$.clean()),Rp.clear()),v};Object.defineProperty(d,"size",{get:()=>s.size,configurable:!1,enumerable:!1}),Object.freeze(d.options={max:t,keyArgs:r,makeCacheKey:n,normalizeResult:i,subscribe:a,cache:s});function c(p){const m=p&&s.get(p);m&&m.setDirty()}d.dirtyKey=c,d.dirty=function(){c(n.apply(null,arguments))};function h(p){const m=p&&s.get(p);if(m)return m.peek()}d.peekKey=h,d.peek=function(){return h(n.apply(null,arguments))};function f(p){return p?s.delete(p):!1}return d.forgetKey=f,d.forget=function(){return f(n.apply(null,arguments))},d.makeCacheKey=n,d.getKey=r?function(){return n.apply(null,r.apply(null,arguments))}:n,Object.freeze(d)}function nre(e){return e}var ire=function(){function e(t,r){r===void 0&&(r=Object.create(null)),this.resultCache=dte?new WeakSet:new Set,this.transform=t,r.getCacheKey&&(this.getCacheKey=r.getCacheKey),this.cached=r.cache!==!1,this.resetCache()}return e.prototype.getCacheKey=function(t){return[t]},e.identity=function(){return new e(nre,{cache:!1})},e.split=function(t,r,n){return n===void 0&&(n=e.identity()),Object.assign(new e(function(i){var a=t(i)?r:n;return a.transformDocument(i)},{cache:!1}),{left:r,right:n})},e.prototype.resetCache=function(){var t=this;if(this.cached){var r=new Xw(ex);this.performWork=rre(e.prototype.performWork.bind(this),{makeCacheKey:function(n){var i=t.getCacheKey(n);if(i)return At(Array.isArray(i),69),r.lookupArray(i)},max:Hu["documentTransform.cache"],cache:T3})}},e.prototype.performWork=function(t){return Wu(t),this.transform(t)},e.prototype.transformDocument=function(t){if(this.resultCache.has(t))return t;var r=this.performWork(t);return this.resultCache.add(r),r},e.prototype.concat=function(t){var r=this;return Object.assign(new e(function(n){return t.transformDocument(r.transformDocument(n))},{cache:!1}),{left:this,right:t})},e}(),eu,wm=Object.assign(function(e){var t=eu.get(e);return t||(t=BF(e),eu.set(e,t)),t},{reset:function(){eu=new nx(Hu.print||2e3)}});wm.reset();globalThis.__DEV__!==!1&&ix("print",function(){return eu?eu.size:0});var are=Array.isArray;function Wo(e){return Array.isArray(e)&&e.length>0}var c8={kind:We.FIELD,name:{kind:We.NAME,value:"__typename"}};function bx(e,t){return!e||e.selectionSet.selections.every(function(r){return r.kind===We.FRAGMENT_SPREAD&&bx(t[r.name.value],t)})}function ore(e){return bx(_2(e)||Vte(e),gm(vm(e)))?null:e}function sre(e){var t=new Map,r=new Map;return e.forEach(function(n){n&&(n.name?t.set(n.name,n):n.test&&r.set(n.test,n))}),function(n){var i=t.get(n.name.value);return!i&&r.size&&r.forEach(function(a,o){o(n)&&(i=a)}),i}}function u8(e){var t=new Map;return function(r){r===void 0&&(r=e);var n=t.get(r);return n||t.set(r,n={variables:new Set,fragmentSpreads:new Set}),n}}function $x(e,t){Wu(t);for(var r=u8(""),n=u8(""),i=function(x){for(var C=0,k=void 0;C<x.length&&(k=x[C]);++C)if(!are(k)){if(k.kind===We.OPERATION_DEFINITION)return r(k.name&&k.name.value);if(k.kind===We.FRAGMENT_DEFINITION)return n(k.name.value)}return globalThis.__DEV__!==!1&&At.error(86),null},a=0,o=t.definitions.length-1;o>=0;--o)t.definitions[o].kind===We.OPERATION_DEFINITION&&++a;var s=sre(e),d=function(x){return Wo(x)&&x.map(s).some(function(C){return C&&C.remove})},c=new Map,h=!1,f={enter:function(x){if(d(x.directives))return h=!0,null}},p=ro(t,{Field:f,InlineFragment:f,VariableDefinition:{enter:function(){return!1}},Variable:{enter:function(x,C,k,S,P){var N=i(P);N&&N.variables.add(x.name.value)}},FragmentSpread:{enter:function(x,C,k,S,P){if(d(x.directives))return h=!0,null;var N=i(P);N&&N.fragmentSpreads.add(x.name.value)}},FragmentDefinition:{enter:function(x,C,k,S){c.set(JSON.stringify(S),x)},leave:function(x,C,k,S){var P=c.get(JSON.stringify(S));if(x===P)return x;if(a>0&&x.selectionSet.selections.every(function(N){return N.kind===We.FIELD&&N.name.value==="__typename"}))return n(x.name.value).removed=!0,h=!0,null}},Directive:{leave:function(x){if(s(x))return h=!0,null}}});if(!h)return t;var m=function(x){return x.transitiveVars||(x.transitiveVars=new Set(x.variables),x.removed||x.fragmentSpreads.forEach(function(C){m(n(C)).transitiveVars.forEach(function(k){x.transitiveVars.add(k)})})),x},v=new Set;p.definitions.forEach(function(x){x.kind===We.OPERATION_DEFINITION?m(r(x.name&&x.name.value)).fragmentSpreads.forEach(function(C){v.add(C)}):x.kind===We.FRAGMENT_DEFINITION&&a===0&&!n(x.name.value).removed&&v.add(x.name.value)}),v.forEach(function(x){m(n(x)).fragmentSpreads.forEach(function(C){v.add(C)})});var $=function(x){return!!(!v.has(x)||n(x).removed)},w={enter:function(x){if($(x.name.value))return null}};return ore(ro(p,{FragmentSpread:w,FragmentDefinition:w,OperationDefinition:{leave:function(x){if(x.variableDefinitions){var C=m(r(x.name&&x.name.value)).transitiveVars;if(C.size<x.variableDefinitions.length)return _e(_e({},x),{variableDefinitions:x.variableDefinitions.filter(function(k){return C.has(k.variable.name.value)})})}}}}))}Object.assign(function(e){return ro(e,{SelectionSet:{enter:function(t,r,n){if(!(n&&n.kind===We.OPERATION_DEFINITION)){var i=t.selections;if(i){var a=i.some(function(s){return Ih(s)&&(s.name.value==="__typename"||s.name.value.lastIndexOf("__",0)===0)});if(!a){var o=n;if(!(Ih(o)&&o.directives&&o.directives.some(function(s){return s.name.value==="export"})))return _e(_e({},t),{selections:mi(mi([],i,!0),[c8],!1)})}}}}}})},{added:function(e){return e===c8}});function lre(e){var t=k2(e),r=t.operation;if(r==="query")return e;var n=ro(e,{OperationDefinition:{enter:function(i){return _e(_e({},i),{operation:"query"})}}});return n}function wx(e){Wu(e);var t=$x([{test:function(r){return r.name.value==="client"},remove:!0}],e);return t}var dre=Object.prototype.hasOwnProperty;function h8(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xx(e)}function xx(e){var t=e[0]||{},r=e.length;if(r>1)for(var n=new xm,i=1;i<r;++i)t=n.merge(t,e[i]);return t}var cre=function(e,t,r){return this.merge(e[r],t[r])},xm=function(){function e(t){t===void 0&&(t=cre),this.reconciler=t,this.isObject=No,this.pastCopies=new Set}return e.prototype.merge=function(t,r){for(var n=this,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];return No(r)&&No(t)?(Object.keys(r).forEach(function(o){if(dre.call(t,o)){var s=t[o];if(r[o]!==s){var d=n.reconciler.apply(n,mi([t,r,o],i,!1));d!==s&&(t=n.shallowCopyForMerge(t),t[o]=d)}}else t=n.shallowCopyForMerge(t),t[o]=r[o]}),t):r},e.prototype.shallowCopyForMerge=function(t){return No(t)&&(this.pastCopies.has(t)||(Array.isArray(t)?t=t.slice(0):t=_e({__proto__:Object.getPrototypeOf(t)},t),this.pastCopies.add(t))),t},e}();function ure(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=hre(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
869
869
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hre(e,t){if(e){if(typeof e=="string")return f8(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f8(e,t)}}function f8(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function p8(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _m(e,t,r){return t&&p8(e.prototype,t),r&&p8(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var km=function(){return typeof Symbol=="function"},Cm=function(e){return km()&&!!Symbol[e]},Sm=function(e){return Cm(e)?Symbol[e]:"@@"+e};km()&&!Cm("observable")&&(Symbol.observable=Symbol("observable"));var fre=Sm("iterator"),N3=Sm("observable"),_x=Sm("species");function Nh(e,t){var r=e[t];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Pc(e){var t=e.constructor;return t!==void 0&&(t=t[_x],t===null&&(t=void 0)),t!==void 0?t:yr}function pre(e){return e instanceof yr}function wd(e){wd.log?wd.log(e):setTimeout(function(){throw e})}function W1(e){Promise.resolve().then(function(){try{e()}catch(t){wd(t)}})}function kx(e){var t=e._cleanup;if(t!==void 0&&(e._cleanup=void 0,!!t))try{if(typeof t=="function")t();else{var r=Nh(t,"unsubscribe");r&&r.call(t)}}catch(n){wd(n)}}function D3(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function gre(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(Cx(e,t[r].type,t[r].value),e._state!=="closed");++r);}}function Cx(e,t,r){e._state="running";var n=e._observer;try{var i=Nh(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(D3(e),i)i.call(n,r);else throw r;break;case"complete":D3(e),i&&i.call(n);break}}catch(a){wd(a)}e._state==="closed"?kx(e):e._state==="running"&&(e._state="ready")}function Fp(e,t,r){if(e._state!=="closed"){if(e._state==="buffering"){e._queue.push({type:t,value:r});return}if(e._state!=="ready"){e._state="buffering",e._queue=[{type:t,value:r}],W1(function(){return gre(e)});return}Cx(e,t,r)}}var mre=function(){function e(r,n){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var i=new vre(this);try{this._cleanup=n.call(void 0,i)}catch(a){i.error(a)}this._state==="initializing"&&(this._state="ready")}var t=e.prototype;return t.unsubscribe=function(){this._state!=="closed"&&(D3(this),kx(this))},_m(e,[{key:"closed",get:function(){return this._state==="closed"}}]),e}(),vre=function(){function e(r){this._subscription=r}var t=e.prototype;return t.next=function(r){Fp(this._subscription,"next",r)},t.error=function(r){Fp(this._subscription,"error",r)},t.complete=function(){Fp(this._subscription,"complete")},_m(e,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),e}(),yr=function(){function e(r){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var t=e.prototype;return t.subscribe=function(r){return(typeof r!="object"||r===null)&&(r={next:r,error:arguments[1],complete:arguments[2]}),new mre(r,this._subscriber)},t.forEach=function(r){var n=this;return new Promise(function(i,a){if(typeof r!="function"){a(new TypeError(r+" is not a function"));return}function o(){s.unsubscribe(),i()}var s=n.subscribe({next:function(d){try{r(d,o)}catch(c){a(c),s.unsubscribe()}},error:a,complete:i})})},t.map=function(r){var n=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var i=Pc(this);return new i(function(a){return n.subscribe({next:function(o){try{o=r(o)}catch(s){return a.error(s)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},t.filter=function(r){var n=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var i=Pc(this);return new i(function(a){return n.subscribe({next:function(o){try{if(!r(o))return}catch(s){return a.error(s)}a.next(o)},error:function(o){a.error(o)},complete:function(){a.complete()}})})},t.reduce=function(r){var n=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var i=Pc(this),a=arguments.length>1,o=!1,s=arguments[1],d=s;return new i(function(c){return n.subscribe({next:function(h){var f=!o;if(o=!0,!f||a)try{d=r(d,h)}catch(p){return c.error(p)}else d=h},error:function(h){c.error(h)},complete:function(){if(!o&&!a)return c.error(new TypeError("Cannot reduce an empty sequence"));c.next(d),c.complete()}})})},t.concat=function(){for(var r=this,n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];var o=Pc(this);return new o(function(s){var d,c=0;function h(f){d=f.subscribe({next:function(p){s.next(p)},error:function(p){s.error(p)},complete:function(){c===i.length?(d=void 0,s.complete()):h(o.from(i[c++]))}})}return h(r),function(){d&&(d.unsubscribe(),d=void 0)}})},t.flatMap=function(r){var n=this;if(typeof r!="function")throw new TypeError(r+" is not a function");var i=Pc(this);return new i(function(a){var o=[],s=n.subscribe({next:function(c){if(r)try{c=r(c)}catch(f){return a.error(f)}var h=i.from(c).subscribe({next:function(f){a.next(f)},error:function(f){a.error(f)},complete:function(){var f=o.indexOf(h);f>=0&&o.splice(f,1),d()}});o.push(h)},error:function(c){a.error(c)},complete:function(){d()}});function d(){s.closed&&o.length===0&&a.complete()}return function(){o.forEach(function(c){return c.unsubscribe()}),s.unsubscribe()}})},t[N3]=function(){return this},e.from=function(r){var n=typeof this=="function"?this:e;if(r==null)throw new TypeError(r+" is not an object");var i=Nh(r,N3);if(i){var a=i.call(r);if(Object(a)!==a)throw new TypeError(a+" is not an object");return pre(a)&&a.constructor===n?a:new n(function(o){return a.subscribe(o)})}if(Cm("iterator")&&(i=Nh(r,fre),i))return new n(function(o){W1(function(){if(!o.closed){for(var s=ure(i.call(r)),d;!(d=s()).done;){var c=d.value;if(o.next(c),o.closed)return}o.complete()}})});if(Array.isArray(r))return new n(function(o){W1(function(){if(!o.closed){for(var s=0;s<r.length;++s)if(o.next(r[s]),o.closed)return;o.complete()}})});throw new TypeError(r+" is not observable")},e.of=function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];var a=typeof this=="function"?this:e;return new a(function(o){W1(function(){if(!o.closed){for(var s=0;s<n.length;++s)if(o.next(n[s]),o.closed)return;o.complete()}})})},_m(e,null,[{key:_x,get:function(){return this}}]),e}();km()&&Object.defineProperty(yr,Symbol("extensions"),{value:{symbol:N3,hostReportError:wd},configurable:!0});function yre(e){var t,r=e.Symbol;if(typeof r=="function")if(r.observable)t=r.observable;else{typeof r.for=="function"?t=r.for("https://github.com/benlesh/symbol-observable"):t=r("https://github.com/benlesh/symbol-observable");try{r.observable=t}catch{}}else t="@@observable";return t}var Fl;typeof self<"u"?Fl=self:typeof window<"u"?Fl=window:typeof global<"u"?Fl=global:typeof module<"u"?Fl=module:Fl=Function("return this")();yre(Fl);var g8=yr.prototype,m8="@@observable";g8[m8]||(g8[m8]=function(){return this});var bre=Object.prototype.toString;function $re(e){return M3(e)}function M3(e,t){switch(bre.call(e)){case"[object Array]":{if(t=t||new Map,t.has(e))return t.get(e);var r=e.slice(0);return t.set(e,r),r.forEach(function(i,a){r[a]=M3(i,t)}),r}case"[object Object]":{if(t=t||new Map,t.has(e))return t.get(e);var n=Object.create(Object.getPrototypeOf(e));return t.set(e,n),Object.keys(e).forEach(function(i){n[i]=M3(e[i],t)}),n}default:return e}}function tu(e,t,r){var n=[];e.forEach(function(i){return i[t]&&n.push(i)}),n.forEach(function(i){return i[t](r)})}function zp(e,t,r){return new yr(function(n){var i={then:function(d){return new Promise(function(c){return c(d())})}};function a(d,c){return function(h){if(d){var f=function(){return n.closed?0:d(h)};i=i.then(f,f).then(function(p){return n.next(p)},function(p){return n.error(p)})}else n[c](h)}}var o={next:a(t,"next"),error:a(r,"error"),complete:function(){i.then(function(){return n.complete()})}},s=e.subscribe(o);return function(){return s.unsubscribe()}})}function Sx(e){function t(r){Object.defineProperty(e,r,{value:yr})}return tx&&Symbol.species&&t(Symbol.species),t("@@species"),e}function v8(e){return e&&typeof e.then=="function"}var zl=function(e){Fu(t,e);function t(r){var n=e.call(this,function(i){return n.addObserver(i),function(){return n.removeObserver(i)}})||this;return n.observers=new Set,n.promise=new Promise(function(i,a){n.resolve=i,n.reject=a}),n.handlers={next:function(i){n.sub!==null&&(n.latest=["next",i],n.notify("next",i),tu(n.observers,"next",i))},error:function(i){var a=n.sub;a!==null&&(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest=["error",i],n.reject(i),n.notify("error",i),tu(n.observers,"error",i))},complete:function(){var i=n,a=i.sub,o=i.sources,s=o===void 0?[]:o;if(a!==null){var d=s.shift();d?v8(d)?d.then(function(c){return n.sub=c.subscribe(n.handlers)},n.handlers.error):n.sub=d.subscribe(n.handlers):(a&&setTimeout(function(){return a.unsubscribe()}),n.sub=null,n.latest&&n.latest[0]==="next"?n.resolve(n.latest[1]):n.resolve(),n.notify("complete"),tu(n.observers,"complete"))}}},n.nextResultListeners=new Set,n.cancel=function(i){n.reject(i),n.sources=[],n.handlers.error(i)},n.promise.catch(function(i){}),typeof r=="function"&&(r=[new yr(r)]),v8(r)?r.then(function(i){return n.start(i)},n.handlers.error):n.start(r),n}return t.prototype.start=function(r){this.sub===void 0&&(this.sources=Array.from(r),this.handlers.complete())},t.prototype.deliverLastMessage=function(r){if(this.latest){var n=this.latest[0],i=r[n];i&&i.call(r,this.latest[1]),this.sub===null&&n==="next"&&r.complete&&r.complete()}},t.prototype.addObserver=function(r){this.observers.has(r)||(this.deliverLastMessage(r),this.observers.add(r))},t.prototype.removeObserver=function(r){this.observers.delete(r)&&this.observers.size<1&&this.handlers.complete()},t.prototype.notify=function(r,n){var i=this.nextResultListeners;i.size&&(this.nextResultListeners=new Set,i.forEach(function(a){return a(r,n)}))},t.prototype.beforeNext=function(r){var n=!1;this.nextResultListeners.add(function(i,a){n||(n=!0,r(i,a))})},t}(yr);Sx(zl);function sd(e){return"incremental"in e}function wre(e){return"hasNext"in e&&"data"in e}function xre(e){return sd(e)||wre(e)}function _re(e){return No(e)&&"payload"in e}function Ex(e,t){var r=e,n=new xm;return sd(t)&&Wo(t.incremental)&&t.incremental.forEach(function(i){for(var a=i.data,o=i.path,s=o.length-1;s>=0;--s){var d=o[s],c=!isNaN(+d),h=c?[]:{};h[d]=a,a=h}r=n.merge(r,a)}),r}function Q1(e){var t=L3(e);return Wo(t)}function L3(e){var t=Wo(e.errors)?e.errors.slice(0):[];return sd(e)&&Wo(e.incremental)&&e.incremental.forEach(function(r){r.errors&&t.push.apply(t,r.errors)}),t}function Dh(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=Object.create(null);return e.forEach(function(n){n&&Object.keys(n).forEach(function(i){var a=n[i];a!==void 0&&(r[i]=a)})}),r}function G1(e,t){return Dh(e,t,t.variables&&{variables:Dh(_e(_e({},e&&e.variables),t.variables))})}function jp(e){return new yr(function(t){t.error(e)})}var Tx=function(e,t,r){var n=new Error(r);throw n.name="ServerError",n.response=e,n.statusCode=e.status,n.result=t,n};function kre(e){for(var t=["query","operationName","variables","extensions","context"],r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(t.indexOf(i)<0)throw xa(44,i)}return e}function Cre(e,t){var r=_e({},e),n=function(a){typeof a=="function"?r=_e(_e({},r),a(r)):r=_e(_e({},r),a)},i=function(){return _e({},r)};return Object.defineProperty(t,"setContext",{enumerable:!1,value:n}),Object.defineProperty(t,"getContext",{enumerable:!1,value:i}),t}function Sre(e){var t={variables:e.variables||{},extensions:e.extensions||{},operationName:e.operationName,query:e.query};return t.operationName||(t.operationName=typeof t.query!="string"?I3(t.query)||void 0:""),t}function Ere(e,t){var r=_e({},e),n=new Set(Object.keys(e));return ro(t,{Variable:function(i,a,o){o&&o.kind!=="VariableDefinition"&&n.delete(i.name.value)}}),n.forEach(function(i){delete r[i]}),r}function y8(e,t){return t?t(e):yr.of()}function Ic(e){return typeof e=="function"?new Qu(e):e}function _1(e){return e.request.length<=1}var Qu=function(){function e(t){t&&(this.request=t)}return e.empty=function(){return new e(function(){return yr.of()})},e.from=function(t){return t.length===0?e.empty():t.map(Ic).reduce(function(r,n){return r.concat(n)})},e.split=function(t,r,n){var i=Ic(r),a=Ic(n||new e(y8)),o;return _1(i)&&_1(a)?o=new e(function(s){return t(s)?i.request(s)||yr.of():a.request(s)||yr.of()}):o=new e(function(s,d){return t(s)?i.request(s,d)||yr.of():a.request(s,d)||yr.of()}),Object.assign(o,{left:i,right:a})},e.execute=function(t,r){return t.request(Cre(r.context,Sre(kre(r))))||yr.of()},e.concat=function(t,r){var n=Ic(t);if(_1(n))return globalThis.__DEV__!==!1&&At.warn(36,n),n;var i=Ic(r),a;return _1(i)?a=new e(function(o){return n.request(o,function(s){return i.request(s)||yr.of()})||yr.of()}):a=new e(function(o,s){return n.request(o,function(d){return i.request(d,s)||yr.of()})||yr.of()}),Object.assign(a,{left:n,right:i})},e.prototype.split=function(t,r,n){return this.concat(e.split(t,r,n||new e(y8)))},e.prototype.concat=function(t){return e.concat(this,t)},e.prototype.request=function(t,r){throw xa(37)},e.prototype.onError=function(t,r){if(r&&r.error)return r.error(t),!1;throw t},e.prototype.setOnError=function(t){return this.onError=t,this},e}(),R3=Qu.execute;function Tre(e){var t,r=e[Symbol.asyncIterator]();return t={next:function(){return r.next()}},t[Symbol.asyncIterator]=function(){return this},t}function Are(e){var t=null,r=null,n=!1,i=[],a=[];function o(f){if(!r){if(a.length){var p=a.shift();if(Array.isArray(p)&&p[0])return p[0]({value:f,done:!1})}i.push(f)}}function s(f){r=f;var p=a.slice();p.forEach(function(m){m[1](f)}),!t||t()}function d(){n=!0;var f=a.slice();f.forEach(function(p){p[0]({value:void 0,done:!0})}),!t||t()}t=function(){t=null,e.removeListener("data",o),e.removeListener("error",s),e.removeListener("end",d),e.removeListener("finish",d),e.removeListener("close",d)},e.on("data",o),e.on("error",s),e.on("end",d),e.on("finish",d),e.on("close",d);function c(){return new Promise(function(f,p){if(r)return p(r);if(i.length)return f({value:i.shift(),done:!1});if(n)return f({value:void 0,done:!0});a.push([f,p])})}var h={next:function(){return c()}};return x2&&(h[Symbol.asyncIterator]=function(){return this}),h}function Ore(e){var t=!1,r={next:function(){return t?Promise.resolve({value:void 0,done:!0}):(t=!0,new Promise(function(n,i){e.then(function(a){n({value:a,done:!1})}).catch(i)}))}};return x2&&(r[Symbol.asyncIterator]=function(){return this}),r}function b8(e){var t={next:function(){return e.read()}};return x2&&(t[Symbol.asyncIterator]=function(){return this}),t}function Pre(e){return!!e.body}function Ire(e){return!!e.getReader}function Nre(e){return!!(x2&&e[Symbol.asyncIterator])}function Dre(e){return!!e.stream}function Mre(e){return!!e.arrayBuffer}function Lre(e){return!!e.pipe}function Rre(e){var t=e;if(Pre(e)&&(t=e.body),Nre(t))return Tre(t);if(Ire(t))return b8(t.getReader());if(Dre(t))return b8(t.stream().getReader());if(Mre(t))return Ore(t.arrayBuffer());if(Lre(t))return Are(t);throw new Error("Unknown body type for responseIterator. Please pass a streamable response.")}var Em=Symbol();function Fre(e){return e.extensions?Array.isArray(e.extensions[Em]):!1}function Ax(e){return e.hasOwnProperty("graphQLErrors")}var zre=function(e){var t=mi(mi(mi([],e.graphQLErrors,!0),e.clientErrors,!0),e.protocolErrors,!0);return e.networkError&&t.push(e.networkError),t.map(function(r){return No(r)&&r.message||"Error message not found."}).join(`
870
870
  `)},ks=function(e){Fu(t,e);function t(r){var n=r.graphQLErrors,i=r.protocolErrors,a=r.clientErrors,o=r.networkError,s=r.errorMessage,d=r.extraInfo,c=e.call(this,s)||this;return c.name="ApolloError",c.graphQLErrors=n||[],c.protocolErrors=i||[],c.clientErrors=a||[],c.networkError=o||null,c.message=s||zre(c),c.extraInfo=d,c.cause=mi(mi(mi([o],n||[],!0),i||[],!0),a||[],!0).find(function(h){return!!h})||null,c.__proto__=t.prototype,c}return t}(Error),$8=Object.prototype.hasOwnProperty;function jre(e,t){return Eo(this,void 0,void 0,function(){var r,n,i,a,o,s,d,c,h,f,p,m,v,$,w,x,C,k,S,P,N,j,F,W;return To(this,function(J){switch(J.label){case 0:if(TextDecoder===void 0)throw new Error("TextDecoder must be defined in the environment: please import a polyfill.");r=new TextDecoder("utf-8"),n=(W=e.headers)===null||W===void 0?void 0:W.get("content-type"),i="boundary=",a=n?.includes(i)?n?.substring(n?.indexOf(i)+i.length).replace(/['"]/g,"").replace(/\;(.*)/gm,"").trim():"-",o=`\r
871
871
  --`.concat(a),s="",d=Rre(e),c=!0,J.label=1;case 1:return c?[4,d.next()]:[3,3];case 2:for(h=J.sent(),f=h.value,p=h.done,m=typeof f=="string"?f:r.decode(f),v=s.length-o.length+1,c=!p,s+=m,$=s.indexOf(o,v);$>-1;){if(w=void 0,j=[s.slice(0,$),s.slice($+o.length)],w=j[0],s=j[1],x=w.indexOf(`\r
@@ -1161,7 +1161,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1161
1161
  `;function Zne(e){const t=Ca(),[r,n]=le(null);async function i(){const{data:a}=await t.apollo.query({query:Yne,variables:{id:e.pharmacyId}});a?.pharmacy&&n(a.pharmacy)}return Vt(()=>{i()}),(()=>{var a=Kne();return D(a,_(Ve,{get loading(){return!r()},sampleLoadingText:"Loading Name",get children(){return r()?.name}}),null),D(a,_(Ve,{get loading(){return!r()},color:"gray",size:"sm",sampleLoadingText:"Cityville, ST",get children(){var o=Gne(),s=o.firstChild;return D(o,()=>r()?.address?.city,s),D(o,()=>r()?.address?.state,null),o}}),null),a})()}const Mh=(e,t)=>{const r=(typeof t=="function"?t():t).client,n=()=>{if(typeof t!="function")return t.skip&&console.warn(`you passed options.skip to createQuery, but the options are not an acccessor.
1162
1162
  This query will never execute!
1163
1163
 
1164
- Replace your options with a function.`),t;const a=typeof t=="function"?t():t;return a.skip?!1:a},[i]=nb(n,a=>{const o=r.watchQuery({query:e,...a}),[s,d]=Nd({});let c=!1;return new Promise((h,f)=>{const p=o.subscribe({error:f,next:({data:m,error:v})=>{v&&f(v),c?d(iY(m)):(c=!0,d(m),h(s))}});Sn(()=>p.unsubscribe())})});return i};var Xne=E("<div><div>"),Jne=E("<div class=mt-4><div>");const C1={patientWillSelect:{badgeColor:"purple",badgeText:"Patient Will Select",text:"Patient will select a pharmacy after you send an order."},recentPharmacy:{badgeColor:"yellow",badgeText:"Recent Pharmacy",text:"This patient selected this pharmacy in the last 8 hours. After you send this order, the patient can change the pharmacy."},preferredPharmacy:{badgeColor:"blue",badgeText:"Preferred Pharmacy",text:"This patient selected this as their preferred pharmacy."}};function eie(e){const t=Ca(),[r,n]=le(C1.patientWillSelect),[i,a]=le(void 0),o=Z(()=>({variables:{id:e.patientId},client:t.apollo})),s=Mh(Mx,o),d=Mh(Lx,o),c=Z(()=>!d.loading&&!s.loading),h=Z(()=>{const f=d()?.orders?.[0];if(f){const p=new Date,m=new Date(p.getTime()-8*60*60*1e3);if(new Date(f.createdAt)>m)return f}});return Re(()=>{if(c()){const f=s()?.patient?.preferredPharmacies,p=h()?.pharmacy;if((f?.length??0)>0){if(n(C1.preferredPharmacy),f&&f.length>0){const m=f[0],v={...m,address:{country:"",postalCode:"",...m.address}};a(v)}}else p?(n(C1.recentPharmacy),a(p)):n(C1.patientWillSelect)}else a(void 0)}),_(fe,{get when(){return c()},get fallback(){return _(oo,{size:"sm"})},get children(){var f=Jne(),p=f.firstChild;return D(p,_(Kl,{get color(){return r().badgeColor},get children(){return r().badgeText}})),D(f,_(Ve,{size:"sm",class:"py-4",get children(){return r().text}}),null),D(f,_(fe,{get when(){return i()},get children(){return _(Fn,{variant:"gray",get children(){var m=Xne(),v=m.firstChild;return D(m,_(Ve,{size:"sm",bold:!0,get children(){return i().name}}),v),D(v,_(Ve,{size:"sm",get children(){return Dx(i().address)}})),m}})}}),null),f}})}var Wp=E("<div>"),tie=E("<div><div class=pt-4>"),rie=E("<div>Please select a patient.");const I8=[{name:"Send to Patient",fulfillmentType:"SEND_TO_PATIENT"},{name:"Local Pickup",fulfillmentType:P8.FulfillmentType.PickUp},{name:"Mail Order",fulfillmentType:P8.FulfillmentType.MailOrder}],N8=e=>e==="SEND_TO_PATIENT"?void 0:e;function nie(e){const[t,r]=le(),[n,i]=le(),[a,o]=le([]),[s,d]=le("Send to Patient");Vt(()=>{o([...e.enableSendToPatient?["Send to Patient"]:[],...e.enableLocalPickup?["Local Pickup"]:[],...e.mailOrderPharmacyIds?["Mail Order"]:[]]);const h=I8.find(f=>f.name===a()[0])?.fulfillmentType;e.setFufillmentType(N8(h)),d(a()[0])});const c=h=>{d(h),a().includes(h)||o([...a(),h]);const f=I8.find(p=>p.name===h)?.fulfillmentType;e.setFufillmentType(N8(f)),h==="Local Pickup"&&t()?e.setPharmacyId(t()):h==="Mail Order"&&n()?e.setPharmacyId(n()):e.setPharmacyId(void 0)};return(()=>{var h=tie(),f=h.firstChild;return D(h,_(Qne,{get tabs(){return a()},get activeTab(){return s()},setActiveTab:c}),f),D(f,_(fe,{get when(){return a().includes("Send to Patient")},get children(){var p=Wp();return D(p,_(fe,{get when(){return(e?.patientIds?.length||0)>0},get fallback(){return rie()},get children(){return _(eie,{get patientId(){return e.patientIds[0]}})}})),ue(()=>Gt(p,s()!=="Send to Patient"?"hidden":"")),p}}),null),D(f,_(fe,{get when(){return a().includes("Local Pickup")},get children(){var p=Wp();return D(p,_(Rx,{get address(){return e?.address||""},get patientId(){return e?.patientIds?.[0]},setPharmacy:m=>{r(m.id),s()==="Local Pickup"&&e.setPharmacyId(m.id)},setPreferred:m=>e?.setPreferredPharmacy?.(m)})),ue(()=>Gt(p,s()!=="Local Pickup"?"hidden":"")),p}}),null),D(f,_(fe,{get when(){return a().includes("Mail Order")},get children(){var p=Wp();return D(p,_(Cu,{label:"Pharmacies",get initSelected(){return e?.mailOrderPharmacyIds?.[0]},setSelected:m=>{i(m),s()==="Mail Order"&&e.setPharmacyId(m)},get children(){return _(ur,{get each(){return e?.mailOrderPharmacyIds||[]},children:m=>_(Cu.Option,{value:m,get children(){return _(Zne,{pharmacyId:m})}})})}})),ue(()=>Gt(p,s()!=="Mail Order"?"hidden":"")),p}}),null),h})()}function jx(e){if(!e)return"";const t=new Date(e),r=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return`${r}/${n}/${i}`}var iie=E('<div class="group relative w-max"><span class="pointer-events-none absolute -bottom-8 left-0 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity group-hover:opacity-100">');function aie(e){return(()=>{var t=iie(),r=t.firstChild;return D(t,()=>e.children,r),D(r,()=>e.text),t})()}var oie=E("<div class=mr-1>");const sie={PLACED:"Placed",ROUTING:"Routing",PENDING:"Pending",CANCELED:"Canceled",COMPLETED:"Completed",ERROR:"Error"},lie={PLACED:"arrowUpRight",ROUTING:"arrowUturnRight",PENDING:"clock",CANCELED:"xCircle",COMPLETED:"checkCircle",ERROR:"questionMarkCircle"},die={SENT:"Sent",RECEIVED:"Received",READY:"Ready",PICKED_UP:"Picked up",FILLING:"Filling",SHIPPED:"Shipped",DELIVERED:"Delivered"},cie={SENT:"Order sent to pharmacy",RECEIVED:"Order received by pharmacy",READY:"Order ready at pharmacy",PICKED_UP:"Order picked up by patient",FILLING:"Mail order being filled",SHIPPED:"Mail order shipped",DELIVERED:"Mail order delivered"},uie={PLACED:"Order has been placed",ROUTING:"Order waiting on patient pharmacy selection",PENDING:"Order is pending",CANCELED:"Order has been canceled",COMPLETED:"Order has been completed",ERROR:"Order has an error"},hie={ERROR:"red",CANCELED:"red",ROUTING:"gray",PLACED:"yellow",PENDING:"yellow",COMPLETED:"green"},fie={SENT:"yellow",RECEIVED:"yellow",FILLING:"yellow",SHIPPED:"yellow",READY:"green",PICKED_UP:"green",DELIVERED:"green"};function pie(e){const t=Z(()=>{if(e.orderState==="PLACED"&&e.fulfillmentState){const r=e.fulfillmentState;return{status:die[r],statusColor:fie[r],statusTip:cie[r]}}else{const r=e.orderState;return{status:sie[r],statusTip:uie[r],statusIcon:lie[r],statusColor:hie[r]}}});return _(fe,{get when(){return t().status},get children(){return _(aie,{get text(){return t().statusTip},get children(){return _(Kl,{get color(){return t().statusColor},get children(){return[_(fe,{get when(){return t().statusIcon},get children(){var r=oie();return D(r,_(It,{get name(){return t().statusIcon},size:"sm"})),r}}),Z(()=>t().status)]}})}})}})}var gie=E('<div class="flex items-center justify-between">'),mie=E('<table class="table-fixed divide-y divide-gray-300 break-words"><tbody class="divide-y divide-gray-200">'),vie=E('<div class="flex flex-col gap-2"><div class="flex gap-x-4">'),yie=E("<div class=mt-4>"),bie=E('<tr><td class="align-top whitespace-nowrap pr-4 py-4 text-sm text-gray-500"></td><td class="py-4 text-sm text-gray-500"><div class=flex><div class=pr-4></div><div>');function $ie(){const[e,t]=Ld();return _(fe,{get when(){return e.orders.length>0},get children(){return _(Fn,{get children(){return[(()=>{var r=gie();return D(r,_(Ve,{color:"gray",children:"Recent Orders"})),r})(),(()=>{var r=mie(),n=r.firstChild;return D(n,_(ur,{get each(){return e.orders},children:i=>{const a=new Set;return i?.fills.forEach(o=>{a.add(o.treatment?.name)}),(()=>{var o=bie(),s=o.firstChild,d=s.nextSibling,c=d.firstChild,h=c.firstChild,f=h.nextSibling;return D(s,_(Ve,{color:"gray",size:"sm",get children(){return jx(i.createdAt)}})),D(h,_(pie,{get orderState(){return i.state}})),D(f,_(ur,{get each(){return[...a]},children:p=>_(Ve,{color:"black",size:"sm",children:p})})),D(d,_(fe,{get when(){return i.state==="ROUTING"},get children(){var p=yie();return D(p,_(qu,{status:"info",withoutIcon:!0,get children(){var m=vie(),v=m.firstChild;return D(m,_(Ve,{size:"sm",color:"black",children:"This order is pending pharmacy selection by the patient"}),v),D(v,_(Ft,{variant:"naked",onClick:()=>t.setIsIssueDialogOpen(!0,i),children:"Report Issue"})),m}})),p}}),null),o})()}})),r})()]}})}})}var wie=E('<div class="flex flex-col gap-6"><div><div class="table bg-red-50 text-red-600 p-2 rounded-full mb-4"></div></div><div class="border border-solid border-gray-200 rounded-lg bg-gray-50 py-3 px-4"><br></div><div class="flex flex-col items-stretch gap-4">');function xie(){let e;const[t,r]=Ld();return Re(()=>{t.isDuplicateDialogOpen&&ni("prescribe-duplicate-dialog-open",{duplicate:t.duplicateFill,order:t.orderWithIssue},e)}),_(el,{get open(){return t.isDuplicateDialogOpen},onClose:()=>{ni("prescribe-duplicate-dialog-exit",{},e),r.setIsDuplicateDialogOpen(!1)},get children(){var n=wie(),i=n.firstChild,a=i.firstChild,o=i.nextSibling,s=o.firstChild,d=o.nextSibling,c=e;return typeof c=="function"?zi(c,n):e=n,D(a,_(It,{name:"exclamationCircle"})),D(i,_(Ve,{bold:!0,class:"mb-2",children:"Looks like a duplicate order"}),null),D(i,_(Ve,{children:"This patient already has an order for the same prescription:"}),null),D(o,_(Ve,{size:"sm",get children(){return t?.duplicateFill?.treatment?.name}}),s),D(o,_(Ve,{size:"sm",color:"gray",get children(){return bd({dispenseQuantity:t?.duplicateFill?.prescription?.dispenseQuantity,dispenseUnit:t?.duplicateFill?.prescription?.dispenseUnit,fillsAllowed:t?.duplicateFill?.prescription?.fillsAllowed,instructions:t?.duplicateFill?.prescription?.instructions})}}),null),D(o,_(Ve,{size:"sm",color:"gray",get children(){return["Written by ",Z(()=>t?.duplicateFill?.prescription?.prescriber?.name?.full)," on"," ",Z(()=>new Date(t?.duplicateFill?.prescription?.writtenAt).toLocaleDateString())]}}),null),D(d,_(Ft,{size:"xl",onClick:()=>{r.setIsDuplicateDialogOpen(!1),r.setIsIssueDialogOpen(!0)},children:"Report Issue"}),null),D(d,_(Ft,{size:"xl",variant:"secondary",onClick:()=>{ni("prescribe-duplicate-dialog-add-anyway",{},e),t?.duplicateDialogContinueCb?.(),r.setIsDuplicateDialogOpen(!1)},children:"Add Prescriptions Anyway"}),null),D(d,_(Ft,{variant:"naked",size:"xl",onClick:()=>{ni("prescribe-duplicate-dialog-exit",{},e),r.setIsDuplicateDialogOpen(!1)},children:"Go Back"}),null),n}})}var _ie=E("<label class=hidden>"),kie=E("<textarea>");function Cie(e){const t=Ns(),r=ht({resize:!1,rows:4,name:"Comment",placeholder:""},e);return[(()=>{var n=_ie();return D(n,()=>r.name),ue(()=>Qt(n,"for",e?.name??t)),n})(),(()=>{var n=kie();return ue(i=>{var a=r.rows,o=e?.name??t,s=e?.name??t,d=`block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm sm:leading-6 ${r.resize?"resize-y":"resize-none"}`,c=r.placeholder;return a!==i.e&&Qt(n,"rows",i.e=a),o!==i.t&&Qt(n,"name",i.t=o),s!==i.a&&Qt(n,"id",i.a=s),d!==i.o&&Gt(n,i.o=d),c!==i.i&&Qt(n,"placeholder",i.i=c),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()]}function Vx(e){const t=new Set;return e.fills.filter(r=>{const n=r.treatment?.name;return!n||t.has(n)?!1:(t.add(n),!0)})}const Y1=(e,t)=>{const r=(typeof t=="function"?t():t).client;let n=null,i=null;const[a,o]=le(!1),[s]=nb(a,async d=>{let c;try{c=await r.mutate(d)}catch(p){throw i&&(i(p),i=null),p}const{data:h,errors:f}=c;if(f)throw i&&(i(f[0]),i=null),f[0];if(h!=null)return n&&(n(h),n=null),h;throw new Error("Mutation did not return any data.")});return[async d=>{const c=G1(d,{mutation:e,...typeof t=="function"?dt(t):t});return o(c),new Promise((h,f)=>{n=h,i=f})},s]};var Sie=E('<div class="flex flex-col gap-6"><div></div><div class="border border-solid border-gray-200 rounded-lg bg-gray-50 py-3 px-4 flex flex-col gap-4"><div class="flex flex-col"></div><div class="flex flex-col"><div class="flex flex-col gap-y-4"></div></div></div><form class=mt-4 id=prescribe-flow-duplicate></form><div class="flex flex-col items-stretch gap-4">'),Eie=E("<div><br>");const Tie=tw({description:Ml().min(1,{message:"A description is required"})}),Aie=wt`
1164
+ Replace your options with a function.`),t;const a=typeof t=="function"?t():t;return a.skip?!1:a},[i]=nb(n,a=>{const o=r.watchQuery({query:e,...a}),[s,d]=Nd({});let c=!1;return new Promise((h,f)=>{const p=o.subscribe({error:f,next:({data:m,error:v})=>{v&&f(v),c?d(iY(m)):(c=!0,d(m),h(s))}});Sn(()=>p.unsubscribe())})});return i};var Xne=E("<div><div>"),Jne=E("<div class=mt-4><div>");const C1={patientWillSelect:{badgeColor:"purple",badgeText:"Patient Will Select",text:"Patient will select a pharmacy after you send an order."},recentPharmacy:{badgeColor:"yellow",badgeText:"Recent Pharmacy",text:"This patient selected this pharmacy in the last 8 hours. After you send this order, the patient can change the pharmacy."},preferredPharmacy:{badgeColor:"blue",badgeText:"Preferred Pharmacy",text:"This patient selected this as their preferred pharmacy."}};function eie(e){const t=Ca(),[r,n]=le(C1.patientWillSelect),[i,a]=le(void 0),o=Z(()=>({variables:{id:e.patientId},client:t.apollo})),s=Mh(Mx,o),d=Mh(Lx,o),c=Z(()=>!d.loading&&!s.loading),h=Z(()=>{const f=d()?.orders?.[0];if(f){const p=new Date,m=new Date(p.getTime()-8*60*60*1e3);if(new Date(f.createdAt)>m)return f}});return Re(()=>{if(c()){const f=s()?.patient?.preferredPharmacies,p=h()?.pharmacy;if((f?.length??0)>0){if(n(C1.preferredPharmacy),f&&f.length>0){const m=f[0],v={...m,address:{country:"",postalCode:"",...m.address}};a(v)}}else p?(n(C1.recentPharmacy),a(p)):n(C1.patientWillSelect)}else a(void 0)}),_(fe,{get when(){return c()},get fallback(){return _(oo,{size:"sm"})},get children(){var f=Jne(),p=f.firstChild;return D(p,_(Kl,{get color(){return r().badgeColor},get children(){return r().badgeText}})),D(f,_(Ve,{size:"sm",class:"py-4",get children(){return r().text}}),null),D(f,_(fe,{get when(){return i()},get children(){return _(Fn,{variant:"gray",get children(){var m=Xne(),v=m.firstChild;return D(m,_(Ve,{size:"sm",bold:!0,get children(){return i().name}}),v),D(v,_(Ve,{size:"sm",get children(){return Dx(i().address)}})),m}})}}),null),f}})}var Wp=E("<div>"),tie=E("<div><div class=pt-4>"),rie=E("<div>Please select a patient.");const I8=[{name:"Send to Patient",fulfillmentType:"SEND_TO_PATIENT"},{name:"Local Pickup",fulfillmentType:P8.FulfillmentType.PickUp},{name:"Mail Order",fulfillmentType:P8.FulfillmentType.MailOrder}],N8=e=>e==="SEND_TO_PATIENT"?void 0:e;function nie(e){const[t,r]=le(),[n,i]=le(),[a,o]=le([]),[s,d]=le("Send to Patient");Vt(()=>{o([...e.enableSendToPatient?["Send to Patient"]:[],...e.enableLocalPickup?["Local Pickup"]:[],...e.mailOrderPharmacyIds?["Mail Order"]:[]]);const h=I8.find(f=>f.name===a()[0])?.fulfillmentType;e.setFufillmentType(N8(h)),d(a()[0])});const c=h=>{d(h),a().includes(h)||o([...a(),h]);const f=I8.find(p=>p.name===h)?.fulfillmentType;e.setFufillmentType(N8(f)),h==="Local Pickup"&&t()?e.setPharmacyId(t()):h==="Mail Order"&&n()?e.setPharmacyId(n()):e.setPharmacyId(void 0)};return(()=>{var h=tie(),f=h.firstChild;return D(h,_(Qne,{get tabs(){return a()},get activeTab(){return s()},setActiveTab:c}),f),D(f,_(fe,{get when(){return a().includes("Send to Patient")},get children(){var p=Wp();return D(p,_(fe,{get when(){return(e?.patientIds?.length||0)>0},get fallback(){return rie()},get children(){return _(eie,{get patientId(){return e.patientIds[0]}})}})),ue(()=>Gt(p,s()!=="Send to Patient"?"hidden":"")),p}}),null),D(f,_(fe,{get when(){return a().includes("Local Pickup")},get children(){var p=Wp();return D(p,_(Rx,{get address(){return e?.address||""},get patientId(){return e?.patientIds?.[0]},setPharmacy:m=>{r(m.id),s()==="Local Pickup"&&e.setPharmacyId(m.id)},setPreferred:m=>e?.setPreferredPharmacy?.(m)})),ue(()=>Gt(p,s()!=="Local Pickup"?"hidden":"")),p}}),null),D(f,_(fe,{get when(){return a().includes("Mail Order")},get children(){var p=Wp();return D(p,_(Cu,{label:"Pharmacies",get initSelected(){return e?.mailOrderPharmacyIds?.[0]},setSelected:m=>{i(m),s()==="Mail Order"&&e.setPharmacyId(m)},get children(){return _(ur,{get each(){return e?.mailOrderPharmacyIds||[]},children:m=>_(Cu.Option,{value:m,get children(){return _(Zne,{pharmacyId:m})}})})}})),ue(()=>Gt(p,s()!=="Mail Order"?"hidden":"")),p}}),null),h})()}function jx(e){if(!e)return"";const t=new Date(e),r=t.getMonth()+1,n=t.getDate(),i=t.getFullYear();return`${r}/${n}/${i}`}var iie=E('<div class="group relative w-max"><span class="pointer-events-none absolute -bottom-8 left-0 w-max rounded bg-gray-900 px-2 py-1 text-sm font-medium text-gray-50 opacity-0 shadow transition-opacity group-hover:opacity-100">');function aie(e){return(()=>{var t=iie(),r=t.firstChild;return D(t,()=>e.children,r),D(r,()=>e.text),t})()}var oie=E("<div class=mr-1>");const sie={PLACED:"Placed",ROUTING:"Routing",PENDING:"Pending",CANCELED:"Canceled",COMPLETED:"Completed",ERROR:"Error"},lie={PLACED:"arrowUpRight",ROUTING:"arrowUturnRight",PENDING:"clock",CANCELED:"xCircle",COMPLETED:"checkCircle",ERROR:"questionMarkCircle"},die={SENT:"Sent",RECEIVED:"Received",READY:"Ready",PICKED_UP:"Picked up",FILLING:"Filling",SHIPPED:"Shipped",DELIVERED:"Delivered"},cie={SENT:"Order sent to pharmacy",RECEIVED:"Order received by pharmacy",READY:"Order ready at pharmacy",PICKED_UP:"Order picked up by patient",FILLING:"Mail order being filled",SHIPPED:"Mail order shipped",DELIVERED:"Mail order delivered"},uie={PLACED:"Order has been placed",ROUTING:"Order waiting on patient pharmacy selection",PENDING:"Order is pending",CANCELED:"Order has been canceled",COMPLETED:"Order has been completed",ERROR:"Order has an error"},hie={ERROR:"red",CANCELED:"red",ROUTING:"gray",PLACED:"yellow",PENDING:"yellow",COMPLETED:"green"},fie={SENT:"yellow",RECEIVED:"yellow",FILLING:"yellow",SHIPPED:"yellow",READY:"green",PICKED_UP:"green",DELIVERED:"green"};function pie(e){const t=Z(()=>{if(e.orderState==="PLACED"&&e.fulfillmentState){const r=e.fulfillmentState;return{status:die[r],statusColor:fie[r],statusTip:cie[r]}}else{const r=e.orderState;return{status:sie[r],statusTip:uie[r],statusIcon:lie[r],statusColor:hie[r]}}});return _(fe,{get when(){return t().status},get children(){return _(aie,{get text(){return t().statusTip},get children(){return _(Kl,{get color(){return t().statusColor},get children(){return[_(fe,{get when(){return t().statusIcon},get children(){var r=oie();return D(r,_(It,{get name(){return t().statusIcon},size:"sm"})),r}}),Z(()=>t().status)]}})}})}})}var gie=E('<div class="flex items-center justify-between">'),mie=E('<table class="table-fixed divide-y divide-gray-300 break-words"><tbody class="divide-y divide-gray-200">'),vie=E('<div class="flex flex-col gap-2"><div class="flex gap-x-4">'),yie=E("<div class=mt-4>"),bie=E('<tr><td class="align-top whitespace-nowrap pr-4 py-4 text-sm text-gray-500"></td><td class="py-4 text-sm text-gray-500"><div class=flex><div class=pr-4></div><div>');function $ie(){const[e,t]=Ld();return _(fe,{get when(){return e.orders.length>0},get children(){return _(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var r=gie();return D(r,_(Ve,{color:"gray",children:"Recent Orders"})),r})(),(()=>{var r=mie(),n=r.firstChild;return D(n,_(ur,{get each(){return e.orders},children:i=>{const a=new Set;return i?.fills.forEach(o=>{a.add(o.treatment?.name)}),(()=>{var o=bie(),s=o.firstChild,d=s.nextSibling,c=d.firstChild,h=c.firstChild,f=h.nextSibling;return D(s,_(Ve,{color:"gray",size:"sm",get children(){return jx(i.createdAt)}})),D(h,_(pie,{get orderState(){return i.state}})),D(f,_(ur,{get each(){return[...a]},children:p=>_(Ve,{color:"black",size:"sm",children:p})})),D(d,_(fe,{get when(){return i.state==="ROUTING"},get children(){var p=yie();return D(p,_(qu,{status:"info",withoutIcon:!0,get children(){var m=vie(),v=m.firstChild;return D(m,_(Ve,{size:"sm",color:"black",children:"This order is pending pharmacy selection by the patient"}),v),D(v,_(Ft,{variant:"naked",onClick:()=>t.setIsIssueDialogOpen(!0,i),children:"Report Issue"})),m}})),p}}),null),o})()}})),r})()]}})}})}var wie=E('<div class="flex flex-col gap-6"><div><div class="table bg-red-50 text-red-600 p-2 rounded-full mb-4"></div></div><div class="border border-solid border-gray-200 rounded-lg bg-gray-50 py-3 px-4"><br></div><div class="flex flex-col items-stretch gap-4">');function xie(){let e;const[t,r]=Ld();return Re(()=>{t.isDuplicateDialogOpen&&ni("prescribe-duplicate-dialog-open",{duplicate:t.duplicateFill,order:t.orderWithIssue},e)}),_(el,{get open(){return t.isDuplicateDialogOpen},onClose:()=>{ni("prescribe-duplicate-dialog-exit",{},e),r.setIsDuplicateDialogOpen(!1)},get children(){var n=wie(),i=n.firstChild,a=i.firstChild,o=i.nextSibling,s=o.firstChild,d=o.nextSibling,c=e;return typeof c=="function"?zi(c,n):e=n,D(a,_(It,{name:"exclamationCircle"})),D(i,_(Ve,{bold:!0,class:"mb-2",children:"Looks like a duplicate order"}),null),D(i,_(Ve,{children:"This patient already has an order for the same prescription:"}),null),D(o,_(Ve,{size:"sm",get children(){return t?.duplicateFill?.treatment?.name}}),s),D(o,_(Ve,{size:"sm",color:"gray",get children(){return bd({dispenseQuantity:t?.duplicateFill?.prescription?.dispenseQuantity,dispenseUnit:t?.duplicateFill?.prescription?.dispenseUnit,fillsAllowed:t?.duplicateFill?.prescription?.fillsAllowed,instructions:t?.duplicateFill?.prescription?.instructions})}}),null),D(o,_(Ve,{size:"sm",color:"gray",get children(){return["Written by ",Z(()=>t?.duplicateFill?.prescription?.prescriber?.name?.full)," on"," ",Z(()=>new Date(t?.duplicateFill?.prescription?.writtenAt).toLocaleDateString())]}}),null),D(d,_(Ft,{size:"xl",onClick:()=>{r.setIsDuplicateDialogOpen(!1),r.setIsIssueDialogOpen(!0)},children:"Report Issue"}),null),D(d,_(Ft,{size:"xl",variant:"secondary",onClick:()=>{ni("prescribe-duplicate-dialog-add-anyway",{},e),t?.duplicateDialogContinueCb?.(),r.setIsDuplicateDialogOpen(!1)},children:"Add Prescriptions Anyway"}),null),D(d,_(Ft,{variant:"naked",size:"xl",onClick:()=>{ni("prescribe-duplicate-dialog-exit",{},e),r.setIsDuplicateDialogOpen(!1)},children:"Go Back"}),null),n}})}var _ie=E("<label class=hidden>"),kie=E("<textarea>");function Cie(e){const t=Ns(),r=ht({resize:!1,rows:4,name:"Comment",placeholder:""},e);return[(()=>{var n=_ie();return D(n,()=>r.name),ue(()=>Qt(n,"for",e?.name??t)),n})(),(()=>{var n=kie();return ue(i=>{var a=r.rows,o=e?.name??t,s=e?.name??t,d=`block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-blue-500 sm:text-sm sm:leading-6 ${r.resize?"resize-y":"resize-none"}`,c=r.placeholder;return a!==i.e&&Qt(n,"rows",i.e=a),o!==i.t&&Qt(n,"name",i.t=o),s!==i.a&&Qt(n,"id",i.a=s),d!==i.o&&Gt(n,i.o=d),c!==i.i&&Qt(n,"placeholder",i.i=c),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()]}function Vx(e){const t=new Set;return e.fills.filter(r=>{const n=r.treatment?.name;return!n||t.has(n)?!1:(t.add(n),!0)})}const Y1=(e,t)=>{const r=(typeof t=="function"?t():t).client;let n=null,i=null;const[a,o]=le(!1),[s]=nb(a,async d=>{let c;try{c=await r.mutate(d)}catch(p){throw i&&(i(p),i=null),p}const{data:h,errors:f}=c;if(f)throw i&&(i(f[0]),i=null),f[0];if(h!=null)return n&&(n(h),n=null),h;throw new Error("Mutation did not return any data.")});return[async d=>{const c=G1(d,{mutation:e,...typeof t=="function"?dt(t):t});return o(c),new Promise((h,f)=>{n=h,i=f})},s]};var Sie=E('<div class="flex flex-col gap-6"><div></div><div class="border border-solid border-gray-200 rounded-lg bg-gray-50 py-3 px-4 flex flex-col gap-4"><div class="flex flex-col"></div><div class="flex flex-col"><div class="flex flex-col gap-y-4"></div></div></div><form class=mt-4 id=prescribe-flow-duplicate></form><div class="flex flex-col items-stretch gap-4">'),Eie=E("<div><br>");const Tie=tw({description:Ml().min(1,{message:"A description is required"})}),Aie=wt`
1165
1165
  mutation CreateTicket($input: TicketInput!) {
1166
1166
  createTicket(input: $input) {
1167
1167
  id
@@ -1299,7 +1299,7 @@ Description:
1299
1299
  }
1300
1300
  }
1301
1301
  }
1302
- `,Eae={CatalogTreatmentsFieldsElementsFragment:Sae};class Tae{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,r=!1){this.sdk=t,this.autoLogin=r;const[n,i]=es({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=i,this.store=n,this.authentication={state:n.authentication,handleRedirect:async a=>{try{const o=await this.sdk.authentication.handleRedirect(a);Cae(o?.appState),await this.authentication.checkSession()}catch(o){const d=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):d?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const r=await this.sdk.authentication.getUser(),n=!!this.sdk?.organization&&!!r?.org_id;let i=[];if(this.autoLogin||t)try{const a=await this.sdk.authentication.getAccessToken();i=a_(a)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:r,isLoading:!1,isInOrg:t&&n&&this.sdk.organization===r.org_id,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?r.patients:this.store.patients.patients.concat(r.patients),finished:r.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:r.patient}),r.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:r}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:Eae});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:r.catalog.treatments.map(n=>n)||[],templates:r.catalog.templates.map(n=>n)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((r,n)=>({id:String(n),...r}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const r=this.sdk.clinical.prescription.createPrescription({});try{const{data:n,errors:i}=await r({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),n?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:n.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:n,errors:i}}catch(n){return this.setStore("prescription",{...this.store.prescription,error:n,isLoading:!1}),{data:null,errors:[]}}}}const Aae=(e=window.location.search)=>{if(!e)return!1;const t=e_.parse(e);return"state"in t&&"photon"in t&&("code"in t||"error"in t)},Oae=e=>/^\d+$/.test(e)&&e.length>=5;function sg(e,t){return e.every(r=>t.includes(r))}const o_=$i(),Bn=()=>Vn(o_),Pae="@photonhealth/elements",Iae="0.14.3",Nae="",Dae="dist/index.js",Mae="./dist/index.d.ts",Lae={start:"vite --port 3000",build:"rimraf dist && NODE_ENV=development vite build","build:prod":"npx nx run elements:build","build:watch":"rimraf dist && vite build --watch",prepublishOnly:"npm run build:prod","upload-s3":"npm run upload-s3:package-json && npm run upload-s3:dist && npm run upload-s3:package-json-latest && npm run upload-s3:dist-latest","upload-s3:package-json":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX","upload-s3:dist":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX/dist","upload-s3:package-json-latest":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST","upload-s3:dist-latest":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST/dist",lint:"eslint src","lint:only-errors":"eslint src --quiet","lint:fix":"eslint src --fix"},Rae={access:"public"},Fae=["dist","package.json"],zae=[],jae="",Vae="ISC",Uae={"@babel/core":"^7.18.13","@csstools/postcss-sass":"^5.0.1","@rollup/plugin-typescript":"^11.0.0","@types/lodash":"^4.14.185","@types/node":"^18.7.18","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1",autoprefixer:"^10.4.13","babel-loader":"^8.2.5","css-has-pseudo":"^4.0.1",eslint:"^8.31.0","eslint-plugin-unused-imports":"^2.0.0","fast-glob":"^3.2.12","open-props":"^1.4.16",postcss:"^8.4.31","postcss-custom-media":"^8.0.2","postcss-jit-props":"^1.0.7","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},Bae={"@photonhealth/components":"*","@photonhealth/sdk":"*","@shoelace-style/shoelace":"^2.4.0","@solid-primitives/scheduled":"^1.2.0","@solid-primitives/timer":"^1.3.4","@tanstack/solid-virtual":"^3.0.0-beta.6","date-fns":"^2.29.3",graphql:"^16.6.0","graphql-tag":"^2.12.6","jwt-decode":"^3.1.2","libphonenumber-js":"^1.10.14","solid-element":"^1.6.4",superstruct:"^1.0.3"},qae={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},Hae="3283ed3794cd092af27cfc26db5ad4535853caf8",Wae={name:Pae,version:Iae,description:Nae,main:Dae,types:Mae,scripts:Lae,publishConfig:Rae,files:Fae,keywords:zae,author:jae,license:Vae,devDependencies:Uae,dependencies:Bae,exports:qae,gitHead:Hae};var Qae=oe("<slot>"),Gae=oe("<div>");const Kae=Wae?.version,Yae=e=>{let t;const r=e.redirectUri?e.redirectUri:window.location.origin,n=e_.stringifyUrl({url:r,query:{photon:!0}}),i=new VL({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:n,organization:e.org,developmentMode:e.developmentMode},Kae),a=new Tae(i,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[o]=le(a),s=async()=>{await o()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},d=async()=>{await o()?.authentication.checkSession(),lae(async()=>{await o()?.authentication.checkSession()},6e4,setInterval)};return Re(()=>{Aae()&&o()?s():o()&&d()}),Re(()=>{if(!o()?.authentication.state.isLoading){if(!o()?.authentication.state.isAuthenticated&&e.autoLogin){const c={appState:{}};e.redirectPath&&(c.appState.returnTo=e.redirectPath),o()?.authentication.login(c)}else if(e.externalUserId!=null&&o().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){o()?.authentication.logout();const c={appState:{}};e.redirectPath&&(c.appState.returnTo=e.redirectPath),o()?.authentication.login(c)}}}),(()=>{var c=Gae(),h=t;return typeof h=="function"?ot(h,c):t=c,M(c,_(o_.Provider,{get value(){return o()},get children(){return _(wZ,{client:i,get children(){var f=Qae();return f._$owner=Se(),f}})}})),c})()};ar("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},connection:{attribute:"connection",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1},externalUserId:{attribute:"user-id",value:void 0,reflect:!0,notify:!0,parse:!1}},Yae);const _r='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';var Zae=oe("<style>"),Xae=oe('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50">');const Jae=e=>{const t=Bn();return Re(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=Zae();return M(r,_r),r})(),t?(()=>{var r=Xae();return r.$$click=async()=>{const n={appState:{}};e.redirectPath&&(n.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(n)},M(r,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),ue(()=>r.disabled=t.authentication.state.isLoading),r})():null]};ar("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},Jae);Js(["click"]);var eoe=oe("<style>"),toe=oe(`<div class="flex flex-col w-screen max-w-sm"><svg viewBox="0 0 305 62.61"xmlns=http://www.w3.org/2000/svg class="h-[28px] pl-[19.75px]"><g fill=#273D52><path d="M0 54.1169H6.81375V35.7722H18.0826C29.5481 35.7722 34.3963 30.3343 34.3963 18.7378V17.4275C34.3963 5.76548 29.417 0.655167 18.0826 0.655167H0V54.1169ZM6.81375 30.1377V6.28961H18.2792C24.7653 6.28961 27.386 8.9758 27.386 16.0516V20.0481C27.386 27.1895 24.7653 30.1377 18.2792 30.1377H6.81375Z"></path><path d="M70.9593 54.1169H77.773V0.655167H70.9593V24.4378H50.8456V0.655167H44.0319V54.1169H50.8456V30.3343H70.9593V54.1169Z"></path><path d="M107.146 54.772C119.528 54.772 125.687 46.5169 125.687 34.9205V19.7861C125.687 8.25511 119.528 0 107.146 0C94.6974 0 88.5388 8.25511 88.5388 19.7861V34.9205C88.5388 46.5169 94.6974 54.772 107.146 54.772ZM95.5491 35.9687V18.8033C95.5491 10.7448 99.4801 5.89651 107.146 5.89651C114.745 5.89651 118.677 10.7448 118.677 18.8033V35.9687C118.677 44.0928 114.745 48.8755 107.146 48.8755C99.4801 48.8755 95.5491 44.0928 95.5491 35.9687Z"></path><path d="M144.295 54.1169H151.109V6.48616H164.54V0.655167H130.864V6.48616H144.295V54.1169Z"></path><path d="M188.299 54.772C200.682 54.772 206.841 46.5169 206.841 34.9205V19.7861C206.841 8.25511 200.682 0 188.299 0C175.851 0 169.693 8.25511 169.693 19.7861V34.9205C169.693 46.5169 175.851 54.772 188.299 54.772ZM176.703 35.9687V18.8033C176.703 10.7448 180.634 5.89651 188.299 5.89651C195.899 5.89651 199.83 10.7448 199.83 18.8033V35.9687C199.83 44.0928 195.899 48.8755 188.299 48.8755C180.634 48.8755 176.703 44.0928 176.703 35.9687Z"></path><path d="M217.6 54.1169H224.021V14.3482L245.576 54.1169H252.608L248.058 45.1084L245.641 40.4239L224.086 0.655167H217.6V54.1169Z"></path></g><g fill=#B35724><circle cx=249.798 cy=5.202 r=5.202></circle></g></svg><h1 class="font-medium text-3xl text-center font-sans mt-6 mb-3">Log in to your account</h1><p class="text-gray-500 font-sans text-center mb-8">Don't have an account? <a href=mailto:rado@photon.health class="text-teal-600 hover:underline hover:cursor-pointer font-sans font-light">Contact Sales</a></p><photon-auth-button>`,!0,!1);const roe=e=>{const t=Bn();return Re(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=eoe();return M(r,_r),r})(),(()=>{var r=toe(),n=r.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return o._$owner=Se(),ue(()=>o.redirectPath=e.redirectPath),r})()]};ar("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},roe);var Gu=(e,t)=>{let r;const n=()=>clearTimeout(r);return Se()&&Sn(n),Object.assign((...a)=>{r!==void 0&&n(),r=setTimeout(()=>e(...a),t)},{clear:n})};/**
1302
+ `,Eae={CatalogTreatmentsFieldsElementsFragment:Sae};class Tae{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,r=!1){this.sdk=t,this.autoLogin=r;const[n,i]=es({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=i,this.store=n,this.authentication={state:n.authentication,handleRedirect:async a=>{try{const o=await this.sdk.authentication.handleRedirect(a);Cae(o?.appState),await this.authentication.checkSession()}catch(o){const d=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):d?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const r=await this.sdk.authentication.getUser(),n=!!this.sdk?.organization&&!!r?.org_id;let i=[];if(this.autoLogin||t)try{const a=await this.sdk.authentication.getAccessToken();i=a_(a)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:r,isLoading:!1,isInOrg:t&&n&&this.sdk.organization===r.org_id,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?r.patients:this.store.patients.patients.concat(r.patients),finished:r.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:r}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:r.patient}),r.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:r}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:Eae});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:r.catalog.treatments.map(n=>n)||[],templates:r.catalog.templates.map(n=>n)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((r,n)=>({id:String(n),...r}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const r=this.sdk.clinical.prescription.createPrescription({});try{const{data:n,errors:i}=await r({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),n?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:n.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:n,errors:i}}catch(n){return this.setStore("prescription",{...this.store.prescription,error:n,isLoading:!1}),{data:null,errors:[]}}}}const Aae=(e=window.location.search)=>{if(!e)return!1;const t=e_.parse(e);return"state"in t&&"photon"in t&&("code"in t||"error"in t)},Oae=e=>/^\d+$/.test(e)&&e.length>=5;function sg(e,t){return e.every(r=>t.includes(r))}const o_=$i(),Bn=()=>Vn(o_),Pae="@photonhealth/elements",Iae="0.14.4",Nae="",Dae="dist/index.js",Mae="./dist/index.d.ts",Lae={start:"vite --port 3000",build:"rimraf dist && NODE_ENV=development vite build","build:prod":"npx nx run elements:build","build:watch":"rimraf dist && vite build --watch",prepublishOnly:"npm run build:prod","upload-s3":"npm run upload-s3:package-json && npm run upload-s3:dist && npm run upload-s3:package-json-latest && npm run upload-s3:dist-latest","upload-s3:package-json":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX","upload-s3:dist":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX/dist","upload-s3:package-json-latest":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST","upload-s3:dist-latest":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST/dist",lint:"eslint src","lint:only-errors":"eslint src --quiet","lint:fix":"eslint src --fix"},Rae={access:"public"},Fae=["dist","package.json"],zae=[],jae="",Vae="ISC",Uae={"@babel/core":"^7.18.13","@csstools/postcss-sass":"^5.0.1","@rollup/plugin-typescript":"^11.0.0","@types/lodash":"^4.14.185","@types/node":"^18.7.18","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1",autoprefixer:"^10.4.13","babel-loader":"^8.2.5","css-has-pseudo":"^4.0.1",eslint:"^8.31.0","eslint-plugin-unused-imports":"^2.0.0","fast-glob":"^3.2.12","open-props":"^1.4.16",postcss:"^8.4.31","postcss-custom-media":"^8.0.2","postcss-jit-props":"^1.0.7","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},Bae={"@photonhealth/components":"*","@photonhealth/sdk":"*","@shoelace-style/shoelace":"^2.4.0","@solid-primitives/scheduled":"^1.2.0","@solid-primitives/timer":"^1.3.4","@tanstack/solid-virtual":"^3.0.0-beta.6","date-fns":"^2.29.3",graphql:"^16.6.0","graphql-tag":"^2.12.6","jwt-decode":"^3.1.2","libphonenumber-js":"^1.10.14","solid-element":"^1.6.4",superstruct:"^1.0.3"},qae={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},Hae="3283ed3794cd092af27cfc26db5ad4535853caf8",Wae={name:Pae,version:Iae,description:Nae,main:Dae,types:Mae,scripts:Lae,publishConfig:Rae,files:Fae,keywords:zae,author:jae,license:Vae,devDependencies:Uae,dependencies:Bae,exports:qae,gitHead:Hae};var Qae=oe("<slot>"),Gae=oe("<div>");const Kae=Wae?.version,Yae=e=>{let t;const r=e.redirectUri?e.redirectUri:window.location.origin,n=e_.stringifyUrl({url:r,query:{photon:!0}}),i=new VL({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:n,organization:e.org,developmentMode:e.developmentMode},Kae),a=new Tae(i,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[o]=le(a),s=async()=>{await o()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},d=async()=>{await o()?.authentication.checkSession(),lae(async()=>{await o()?.authentication.checkSession()},6e4,setInterval)};return Re(()=>{Aae()&&o()?s():o()&&d()}),Re(()=>{if(!o()?.authentication.state.isLoading){if(!o()?.authentication.state.isAuthenticated&&e.autoLogin){const c={appState:{}};e.redirectPath&&(c.appState.returnTo=e.redirectPath),o()?.authentication.login(c)}else if(e.externalUserId!=null&&o().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){o()?.authentication.logout();const c={appState:{}};e.redirectPath&&(c.appState.returnTo=e.redirectPath),o()?.authentication.login(c)}}}),(()=>{var c=Gae(),h=t;return typeof h=="function"?ot(h,c):t=c,M(c,_(o_.Provider,{get value(){return o()},get children(){return _(wZ,{client:i,get children(){var f=Qae();return f._$owner=Se(),f}})}})),c})()};ar("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},connection:{attribute:"connection",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1},externalUserId:{attribute:"user-id",value:void 0,reflect:!0,notify:!0,parse:!1}},Yae);const _r='*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.z-1000{z-index:1000}.z-2000{z-index:2000}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';var Zae=oe("<style>"),Xae=oe('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50">');const Jae=e=>{const t=Bn();return Re(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=Zae();return M(r,_r),r})(),t?(()=>{var r=Xae();return r.$$click=async()=>{const n={appState:{}};e.redirectPath&&(n.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(n)},M(r,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),ue(()=>r.disabled=t.authentication.state.isLoading),r})():null]};ar("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},Jae);Js(["click"]);var eoe=oe("<style>"),toe=oe(`<div class="flex flex-col w-screen max-w-sm"><svg viewBox="0 0 305 62.61"xmlns=http://www.w3.org/2000/svg class="h-[28px] pl-[19.75px]"><g fill=#273D52><path d="M0 54.1169H6.81375V35.7722H18.0826C29.5481 35.7722 34.3963 30.3343 34.3963 18.7378V17.4275C34.3963 5.76548 29.417 0.655167 18.0826 0.655167H0V54.1169ZM6.81375 30.1377V6.28961H18.2792C24.7653 6.28961 27.386 8.9758 27.386 16.0516V20.0481C27.386 27.1895 24.7653 30.1377 18.2792 30.1377H6.81375Z"></path><path d="M70.9593 54.1169H77.773V0.655167H70.9593V24.4378H50.8456V0.655167H44.0319V54.1169H50.8456V30.3343H70.9593V54.1169Z"></path><path d="M107.146 54.772C119.528 54.772 125.687 46.5169 125.687 34.9205V19.7861C125.687 8.25511 119.528 0 107.146 0C94.6974 0 88.5388 8.25511 88.5388 19.7861V34.9205C88.5388 46.5169 94.6974 54.772 107.146 54.772ZM95.5491 35.9687V18.8033C95.5491 10.7448 99.4801 5.89651 107.146 5.89651C114.745 5.89651 118.677 10.7448 118.677 18.8033V35.9687C118.677 44.0928 114.745 48.8755 107.146 48.8755C99.4801 48.8755 95.5491 44.0928 95.5491 35.9687Z"></path><path d="M144.295 54.1169H151.109V6.48616H164.54V0.655167H130.864V6.48616H144.295V54.1169Z"></path><path d="M188.299 54.772C200.682 54.772 206.841 46.5169 206.841 34.9205V19.7861C206.841 8.25511 200.682 0 188.299 0C175.851 0 169.693 8.25511 169.693 19.7861V34.9205C169.693 46.5169 175.851 54.772 188.299 54.772ZM176.703 35.9687V18.8033C176.703 10.7448 180.634 5.89651 188.299 5.89651C195.899 5.89651 199.83 10.7448 199.83 18.8033V35.9687C199.83 44.0928 195.899 48.8755 188.299 48.8755C180.634 48.8755 176.703 44.0928 176.703 35.9687Z"></path><path d="M217.6 54.1169H224.021V14.3482L245.576 54.1169H252.608L248.058 45.1084L245.641 40.4239L224.086 0.655167H217.6V54.1169Z"></path></g><g fill=#B35724><circle cx=249.798 cy=5.202 r=5.202></circle></g></svg><h1 class="font-medium text-3xl text-center font-sans mt-6 mb-3">Log in to your account</h1><p class="text-gray-500 font-sans text-center mb-8">Don't have an account? <a href=mailto:rado@photon.health class="text-teal-600 hover:underline hover:cursor-pointer font-sans font-light">Contact Sales</a></p><photon-auth-button>`,!0,!1);const roe=e=>{const t=Bn();return Re(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{var r=eoe();return M(r,_r),r})(),(()=>{var r=toe(),n=r.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return o._$owner=Se(),ue(()=>o.redirectPath=e.redirectPath),r})()]};ar("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},roe);var Gu=(e,t)=>{let r;const n=()=>clearTimeout(r);return Se()&&Sn(n),Object.assign((...a)=>{r!==void 0&&n(),r=setTimeout(()=>e(...a),t)},{clear:n})};/**
1303
1303
  * @license
1304
1304
  * Copyright 2019 Google LLC
1305
1305
  * SPDX-License-Identifier: BSD-3-Clause
@@ -3384,7 +3384,7 @@ __p += '`),Tt&&(xe+=`' +
3384
3384
  function print() { __p += __j.call(arguments, '') }
3385
3385
  `:`;
3386
3386
  `)+xe+`return __p
3387
- }`;var mt=y9(function(){return jt(I,Ge+"return "+xe).apply(r,L)});if(mt.source=xe,Vf(mt))throw mt;return mt}function CO(l){return Ht(l).toLowerCase()}function SO(l){return Ht(l).toUpperCase()}function EO(l,u,g){if(l=Ht(l),l&&(g||u===r))return Ev(l);if(!l||!(u=di(u)))return l;var y=Ui(l),T=Ui(u),I=Tv(y,T),L=Av(y,T)+1;return vo(y,I,L).join("")}function TO(l,u,g){if(l=Ht(l),l&&(g||u===r))return l.slice(0,Pv(l)+1);if(!l||!(u=di(u)))return l;var y=Ui(l),T=Av(y,Ui(u))+1;return vo(y,0,T).join("")}function AO(l,u,g){if(l=Ht(l),l&&(g||u===r))return l.replace(ol,"");if(!l||!(u=di(u)))return l;var y=Ui(l),T=Tv(y,Ui(u));return vo(y,T).join("")}function OO(l,u){var g=J,y=U;if(kr(u)){var T="separator"in u?u.separator:T;g="length"in u?ft(u.length):g,y="omission"in u?di(u.omission):y}l=Ht(l);var I=l.length;if(dl(l)){var L=Ui(l);I=L.length}if(g>=I)return l;var V=g-cl(y);if(V<1)return y;var q=L?vo(L,0,V).join(""):l.slice(0,V);if(T===r)return q+y;if(L&&(V+=q.length-V),Uf(T)){if(l.slice(V).search(T)){var ge,ye=q;for(T.global||(T=nf(T.source,Ht(Xd.exec(T))+"g")),T.lastIndex=0;ge=T.exec(ye);)var xe=ge.index;q=q.slice(0,xe===r?V:xe)}}else if(l.indexOf(di(T),V)!=V){var Ne=q.lastIndexOf(T);Ne>-1&&(q=q.slice(0,Ne))}return q+y}function PO(l){return l=Ht(l),l&&t0.test(l)?l.replace(Wd,oC):l}var IO=vl(function(l,u,g){return l+(g?" ":"")+u.toUpperCase()}),Hf=b4("toUpperCase");function v9(l,u,g){return l=Ht(l),u=g?r:u,u===r?tC(l)?dC(l):Wk(l):l.match(u)||[]}var y9=$t(function(l,u){try{return si(l,r,u)}catch(g){return Vf(g)?g:new st(g)}}),NO=za(function(l,u){return Ti(u,function(g){g=ha(g),Ra(l,g,zf(l[g],l))}),l});function DO(l){var u=l==null?0:l.length,g=Ze();return l=u?wr(l,function(y){if(typeof y[1]!="function")throw new Ai(o);return[g(y[0]),y[1]]}):[],$t(function(y){for(var T=-1;++T<u;){var I=l[T];if(si(I[0],this,y))return si(I[1],this,y)}})}function MO(l){return oS(Pi(l,f))}function Wf(l){return function(){return l}}function LO(l,u){return l==null||l!==l?u:l}var RO=w4(),FO=w4(!0);function Jn(l){return l}function Qf(l){return Zv(typeof l=="function"?l:Pi(l,f))}function zO(l){return Jv(Pi(l,f))}function jO(l,u){return e4(l,Pi(u,f))}var VO=$t(function(l,u){return function(g){return uc(g,l,u)}}),UO=$t(function(l,u){return function(g){return uc(l,g,u)}});function Gf(l,u,g){var y=tn(u),T=D0(u,y);g==null&&!(kr(u)&&(T.length||!y.length))&&(g=u,u=l,l=this,T=D0(u,tn(u)));var I=!(kr(g)&&"chain"in g)||!!g.chain,L=Va(l);return Ti(T,function(V){var q=u[V];l[V]=q,L&&(l.prototype[V]=function(){var ge=this.__chain__;if(I||ge){var ye=l(this.__wrapped__),xe=ye.__actions__=Yn(this.__actions__);return xe.push({func:q,args:arguments,thisArg:l}),ye.__chain__=ge,ye}return q.apply(l,uo([this.value()],arguments))})}),l}function BO(){return gn._===this&&(gn._=gC),this}function Kf(){}function qO(l){return l=ft(l),$t(function(u){return t4(u,l)})}var HO=Sf(wr),WO=Sf(xv),QO=Sf(Y2);function b9(l){return Nf(l)?Z2(ha(l)):_S(l)}function GO(l){return function(u){return l==null?r:us(l,u)}}var KO=_4(),YO=_4(!0);function Yf(){return[]}function Zf(){return!1}function ZO(){return{}}function XO(){return""}function JO(){return!0}function eP(l,u){if(l=ft(l),l<1||l>re)return[];var g=ke,y=_n(l,ke);u=Ze(u),l-=ke;for(var T=ef(y,u);++g<l;)u(g);return T}function tP(l){return ut(l)?wr(l,ha):ci(l)?[l]:Yn(z4(Ht(l)))}function rP(l){var u=++fC;return Ht(l)+u}var nP=j0(function(l,u){return l+u},0),iP=Ef("ceil"),aP=j0(function(l,u){return l/u},1),oP=Ef("floor");function sP(l){return l&&l.length?N0(l,Jn,hf):r}function lP(l,u){return l&&l.length?N0(l,Ze(u,2),hf):r}function dP(l){return Cv(l,Jn)}function cP(l,u){return Cv(l,Ze(u,2))}function uP(l){return l&&l.length?N0(l,Jn,mf):r}function hP(l,u){return l&&l.length?N0(l,Ze(u,2),mf):r}var fP=j0(function(l,u){return l*u},1),pP=Ef("round"),gP=j0(function(l,u){return l-u},0);function mP(l){return l&&l.length?J2(l,Jn):0}function vP(l,u){return l&&l.length?J2(l,Ze(u,2)):0}return O.after=zT,O.ary=Y4,O.assign=SA,O.assignIn=c9,O.assignInWith=J0,O.assignWith=EA,O.at=TA,O.before=Z4,O.bind=zf,O.bindAll=NO,O.bindKey=X4,O.castArray=ZT,O.chain=Q4,O.chunk=oE,O.compact=sE,O.concat=lE,O.cond=DO,O.conforms=MO,O.constant=Wf,O.countBy=mT,O.create=AA,O.curry=J4,O.curryRight=e9,O.debounce=t9,O.defaults=OA,O.defaultsDeep=PA,O.defer=jT,O.delay=VT,O.difference=dE,O.differenceBy=cE,O.differenceWith=uE,O.drop=hE,O.dropRight=fE,O.dropRightWhile=pE,O.dropWhile=gE,O.fill=mE,O.filter=yT,O.flatMap=wT,O.flatMapDeep=xT,O.flatMapDepth=_T,O.flatten=B4,O.flattenDeep=vE,O.flattenDepth=yE,O.flip=UT,O.flow=RO,O.flowRight=FO,O.fromPairs=bE,O.functions=FA,O.functionsIn=zA,O.groupBy=kT,O.initial=wE,O.intersection=xE,O.intersectionBy=_E,O.intersectionWith=kE,O.invert=VA,O.invertBy=UA,O.invokeMap=ST,O.iteratee=Qf,O.keyBy=ET,O.keys=tn,O.keysIn=Xn,O.map=Q0,O.mapKeys=qA,O.mapValues=HA,O.matches=zO,O.matchesProperty=jO,O.memoize=K0,O.merge=WA,O.mergeWith=u9,O.method=VO,O.methodOf=UO,O.mixin=Gf,O.negate=Y0,O.nthArg=qO,O.omit=QA,O.omitBy=GA,O.once=BT,O.orderBy=TT,O.over=HO,O.overArgs=qT,O.overEvery=WO,O.overSome=QO,O.partial=jf,O.partialRight=r9,O.partition=AT,O.pick=KA,O.pickBy=h9,O.property=b9,O.propertyOf=GO,O.pull=TE,O.pullAll=H4,O.pullAllBy=AE,O.pullAllWith=OE,O.pullAt=PE,O.range=KO,O.rangeRight=YO,O.rearg=HT,O.reject=IT,O.remove=IE,O.rest=WT,O.reverse=Rf,O.sampleSize=DT,O.set=ZA,O.setWith=XA,O.shuffle=MT,O.slice=NE,O.sortBy=FT,O.sortedUniq=jE,O.sortedUniqBy=VE,O.split=wO,O.spread=QT,O.tail=UE,O.take=BE,O.takeRight=qE,O.takeRightWhile=HE,O.takeWhile=WE,O.tap=sT,O.throttle=GT,O.thru=W0,O.toArray=s9,O.toPairs=f9,O.toPairsIn=p9,O.toPath=tP,O.toPlainObject=d9,O.transform=JA,O.unary=KT,O.union=QE,O.unionBy=GE,O.unionWith=KE,O.uniq=YE,O.uniqBy=ZE,O.uniqWith=XE,O.unset=eO,O.unzip=Ff,O.unzipWith=W4,O.update=tO,O.updateWith=rO,O.values=$l,O.valuesIn=nO,O.without=JE,O.words=v9,O.wrap=YT,O.xor=eT,O.xorBy=tT,O.xorWith=rT,O.zip=nT,O.zipObject=iT,O.zipObjectDeep=aT,O.zipWith=oT,O.entries=f9,O.entriesIn=p9,O.extend=c9,O.extendWith=J0,Gf(O,O),O.add=nP,O.attempt=y9,O.camelCase=sO,O.capitalize=g9,O.ceil=iP,O.clamp=iO,O.clone=XT,O.cloneDeep=eA,O.cloneDeepWith=tA,O.cloneWith=JT,O.conformsTo=rA,O.deburr=m9,O.defaultTo=LO,O.divide=aP,O.endsWith=lO,O.eq=qi,O.escape=dO,O.escapeRegExp=cO,O.every=vT,O.find=bT,O.findIndex=V4,O.findKey=IA,O.findLast=$T,O.findLastIndex=U4,O.findLastKey=NA,O.floor=oP,O.forEach=G4,O.forEachRight=K4,O.forIn=DA,O.forInRight=MA,O.forOwn=LA,O.forOwnRight=RA,O.get=Bf,O.gt=nA,O.gte=iA,O.has=jA,O.hasIn=qf,O.head=q4,O.identity=Jn,O.includes=CT,O.indexOf=$E,O.inRange=aO,O.invoke=BA,O.isArguments=ps,O.isArray=ut,O.isArrayBuffer=aA,O.isArrayLike=Zn,O.isArrayLikeObject=Dr,O.isBoolean=oA,O.isBuffer=yo,O.isDate=sA,O.isElement=lA,O.isEmpty=dA,O.isEqual=cA,O.isEqualWith=uA,O.isError=Vf,O.isFinite=hA,O.isFunction=Va,O.isInteger=n9,O.isLength=Z0,O.isMap=i9,O.isMatch=fA,O.isMatchWith=pA,O.isNaN=gA,O.isNative=mA,O.isNil=yA,O.isNull=vA,O.isNumber=a9,O.isObject=kr,O.isObjectLike=Er,O.isPlainObject=vc,O.isRegExp=Uf,O.isSafeInteger=bA,O.isSet=o9,O.isString=X0,O.isSymbol=ci,O.isTypedArray=bl,O.isUndefined=$A,O.isWeakMap=wA,O.isWeakSet=xA,O.join=CE,O.kebabCase=uO,O.last=Ni,O.lastIndexOf=SE,O.lowerCase=hO,O.lowerFirst=fO,O.lt=_A,O.lte=kA,O.max=sP,O.maxBy=lP,O.mean=dP,O.meanBy=cP,O.min=uP,O.minBy=hP,O.stubArray=Yf,O.stubFalse=Zf,O.stubObject=ZO,O.stubString=XO,O.stubTrue=JO,O.multiply=fP,O.nth=EE,O.noConflict=BO,O.noop=Kf,O.now=G0,O.pad=pO,O.padEnd=gO,O.padStart=mO,O.parseInt=vO,O.random=oO,O.reduce=OT,O.reduceRight=PT,O.repeat=yO,O.replace=bO,O.result=YA,O.round=pP,O.runInContext=B,O.sample=NT,O.size=LT,O.snakeCase=$O,O.some=RT,O.sortedIndex=DE,O.sortedIndexBy=ME,O.sortedIndexOf=LE,O.sortedLastIndex=RE,O.sortedLastIndexBy=FE,O.sortedLastIndexOf=zE,O.startCase=xO,O.startsWith=_O,O.subtract=gP,O.sum=mP,O.sumBy=vP,O.template=kO,O.times=eP,O.toFinite=Ua,O.toInteger=ft,O.toLength=l9,O.toLower=CO,O.toNumber=Di,O.toSafeInteger=CA,O.toString=Ht,O.toUpper=SO,O.trim=EO,O.trimEnd=TO,O.trimStart=AO,O.truncate=OO,O.unescape=PO,O.uniqueId=rP,O.upperCase=IO,O.upperFirst=Hf,O.each=G4,O.eachRight=K4,O.first=q4,Gf(O,function(){var l={};return ca(O,function(u,g){Yt.call(O.prototype,g)||(l[g]=u)}),l}(),{chain:!1}),O.VERSION=n,Ti(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){O[l].placeholder=O}),Ti(["drop","take"],function(l,u){Ct.prototype[l]=function(g){g=g===r?1:Gr(ft(g),0);var y=this.__filtered__&&!u?new Ct(this):this.clone();return y.__filtered__?y.__takeCount__=_n(g,y.__takeCount__):y.__views__.push({size:_n(g,ke),type:l+(y.__dir__<0?"Right":"")}),y},Ct.prototype[l+"Right"]=function(g){return this.reverse()[l](g).reverse()}}),Ti(["filter","map","takeWhile"],function(l,u){var g=u+1,y=g==K||g==we;Ct.prototype[l]=function(T){var I=this.clone();return I.__iteratees__.push({iteratee:Ze(T,3),type:g}),I.__filtered__=I.__filtered__||y,I}}),Ti(["head","last"],function(l,u){var g="take"+(u?"Right":"");Ct.prototype[l]=function(){return this[g](1).value()[0]}}),Ti(["initial","tail"],function(l,u){var g="drop"+(u?"":"Right");Ct.prototype[l]=function(){return this.__filtered__?new Ct(this):this[g](1)}}),Ct.prototype.compact=function(){return this.filter(Jn)},Ct.prototype.find=function(l){return this.filter(l).head()},Ct.prototype.findLast=function(l){return this.reverse().find(l)},Ct.prototype.invokeMap=$t(function(l,u){return typeof l=="function"?new Ct(this):this.map(function(g){return uc(g,l,u)})}),Ct.prototype.reject=function(l){return this.filter(Y0(Ze(l)))},Ct.prototype.slice=function(l,u){l=ft(l);var g=this;return g.__filtered__&&(l>0||u<0)?new Ct(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),u!==r&&(u=ft(u),g=u<0?g.dropRight(-u):g.take(u-l)),g)},Ct.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ct.prototype.toArray=function(){return this.take(ke)},ca(Ct.prototype,function(l,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),y=/^(?:head|last)$/.test(u),T=O[y?"take"+(u=="last"?"Right":""):u],I=y||/^find/.test(u);T&&(O.prototype[u]=function(){var L=this.__wrapped__,V=y?[1]:arguments,q=L instanceof Ct,ge=V[0],ye=q||ut(L),xe=function(kt){var Tt=T.apply(O,uo([kt],V));return y&&Ne?Tt[0]:Tt};ye&&g&&typeof ge=="function"&&ge.length!=1&&(q=ye=!1);var Ne=this.__chain__,Ge=!!this.__actions__.length,Xe=I&&!Ne,mt=q&&!Ge;if(!I&&ye){L=mt?L:new Ct(this);var Je=l.apply(L,V);return Je.__actions__.push({func:W0,args:[xe],thisArg:r}),new Oi(Je,Ne)}return Xe&&mt?l.apply(this,V):(Je=this.thru(xe),Xe?y?Je.value()[0]:Je.value():Je)})}),Ti(["pop","push","shift","sort","splice","unshift"],function(l){var u=y0[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",y=/^(?:pop|shift)$/.test(l);O.prototype[l]=function(){var T=arguments;if(y&&!this.__chain__){var I=this.value();return u.apply(ut(I)?I:[],T)}return this[g](function(L){return u.apply(ut(L)?L:[],T)})}}),ca(Ct.prototype,function(l,u){var g=O[u];if(g){var y=g.name+"";Yt.call(pl,y)||(pl[y]=[]),pl[y].push({name:u,func:g})}}),pl[z0(r,x).name]=[{name:"wrapper",func:r}],Ct.prototype.clone=PC,Ct.prototype.reverse=IC,Ct.prototype.value=NC,O.prototype.at=lT,O.prototype.chain=dT,O.prototype.commit=cT,O.prototype.next=uT,O.prototype.plant=fT,O.prototype.reverse=pT,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=gT,O.prototype.first=O.prototype.head,ic&&(O.prototype[ic]=hT),O},ul=cC();os?((os.exports=ul)._=ul,W2._=ul):gn._=ul}).call(kc)})(Qh,Qh.exports);var vue=Qh.exports,yue=oe('<div class="flex items-center space-x-2 text-slate-500">'),bue=oe('<div><style></style><photon-dialog label="Overwrite in progress prescription?"confirm-text="Yes, Overwrite"cancel-text="No, Cancel"><p class="font-sans text-lg xs:text-base">You are editing a prescription that has not been added. This will be overwritten if you edit another prescription.</p></photon-dialog><photon-dialog label="Delete pending prescription?"confirm-text="Yes, Delete"cancel-text="No, Cancel"><p class="font-sans text-lg xs:text-base">Deleting this prescription will remove it from your pending prescriptions. This action cannot be undone.',!0,!1);const $ue=qr(Ro(Hle(Ju()),1,1/0),"You must add at least 1 Prescription"),wue=e=>{let t;const[r,n]=le(!1),[i,a]=le(!1),[o,s]=le(void 0),[d,c]=le();e.actions.registerValidator({key:"draftPrescriptions",validator:$ue});const h=x=>{const C=new CustomEvent("photon-draft-prescription-deleted",{composed:!0,bubbles:!0,detail:{prescription:Gs(x)}});t?.dispatchEvent(C)},f=()=>{o().treatment&&(J_(e.actions,o()),e.actions.updateFormValue({key:"catalogId",value:o().catalogId}),e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(x=>x.id!==o().id)}),window.scrollTo({behavior:"smooth",top:(e.prescriptionRef?.getBoundingClientRect().top||0)-document.body.getBoundingClientRect().top-70}),e.handleDeletedDraftPrescription())},p=x=>{const C=e.store.draftPrescriptions.value.find(k=>k.id===x);s(C),e.store.treatment.value?a(!0):(e.setIsEditing(!0),f())},m=()=>{f(),a(!1),s(void 0)},v=()=>{a(!1),s(void 0)},$=()=>{const[x,C]=vue.partition(e.store.draftPrescriptions.value,k=>k.id===d());e.actions.updateFormValue({key:"draftPrescriptions",value:C}),h(x[0]),n(!1),c(void 0),e.store.draftPrescriptions?.value?.length===0&&e.setIsEditing(!0),e.handleDeletedDraftPrescription()},w=()=>{n(!1),c(void 0)};return(()=>{var x=bue(),C=x.firstChild,k=C.nextSibling,S=k.nextSibling,P=t;return typeof P=="function"?ot(P,x):t=x,M(C,Ta),Ce(k,"photon-dialog-alt",v),Ce(k,"photon-dialog-canceled",v),Ce(k,"photon-dialog-confirmed",m),k._$owner=Se(),Ce(S,"photon-dialog-alt",w),Ce(S,"photon-dialog-canceled",w),Ce(S,"photon-dialog-confirmed",$),S._$owner=Se(),M(x,_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var N=yue();return M(N,_(Ve,{color:"gray",class:"pr-2",get children(){return e.enableOrder?"Pending Order":"Pending Prescriptions"}}),null),M(N,_(ek,{maxWidth:"300px",tip:"Each prescription will include the prescriber’s digital signature and the date it was written when the order is sent to the pharmacy."}),null),N})(),_(Dee,{get draftPrescriptions(){return e.store.draftPrescriptions?.value??[]},handleDelete:N=>{n(!0),c(N)},handleEdit:N=>{p(N)},get templateIds(){return e.templateIds},get templateOverrides(){return e.templateOverrides},get prescriptionIds(){return e.prescriptionIds},setDraftPrescriptions:N=>{e.actions.updateFormValue({key:"draftPrescriptions",value:N})},get error(){return e.store.draftPrescriptions?.error},get screeningAlerts(){return e.screeningAlerts},get enableOrder(){return e.enableOrder}})]}}),null),ue(N=>{var j=i(),F=r();return j!==N.e&&(k.open=N.e=j),F!==N.t&&(S.open=N.t=F),N},{e:void 0,t:void 0}),x})()};var xue=oe('<div class="flex items-center justify-between">'),_ue=oe("<div><style>");const kue=e=>{const t=Z(()=>e.store.patient?.value?[e.store.patient?.value?.id]:[]),r=Z(()=>{const n=e.store.patient?.value?.address;return n?`${n.street1} ${n.street2||""} ${n.city}, ${n.state} ${n.postalCode}`:""});return(()=>{var n=_ue(),i=n.firstChild;return M(i,Ta),M(n,_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var a=xue();return M(a,_(Ve,{color:"gray",children:"Select Pharmacy"})),a})(),_(nie,{get enableSendToPatient(){return e.enableSendToPatient},get enableLocalPickup(){return e.enableLocalPickup||!e?.enableSendToPatient&&!e?.mailOrderIds},get mailOrderPharmacyIds(){return Z(()=>!!e.mailOrderIds)()?e.mailOrderIds.split(","):void 0},get patientIds(){return t()},get address(){return r()},setFufillmentType:a=>{e.actions.updateFormValue({key:"fulfillmentType",value:a||""})},setPreferredPharmacy:(a=!1)=>{e.actions.updateFormValue({key:"updatePreferredPharmacy",value:a})},setPharmacyId:a=>{e.actions.updateFormValue({key:"pharmacy",value:a})}})]}}),null),n})()};var Cue=oe('<div class="flex items-center justify-between">'),Sue=oe("<photon-patient-select>",!0,!1),Eue=oe("<div><photon-patient-dialog>",!0,!1),Tue=oe('<div><photon-add-medication-history-dialog title="Add Medication History">',!0,!1),Aue=oe('<div class="flex flex-col gap-8">');const Oue=qr(Zm(yi(),Ju()),"Please select a patient..."),Pue=qr(Zm(yi(),Ju()),"Please enter an address for patient..."),Iue=e=>{const[t,r]=le(void 0),[n,i]=le(!1),[a,o]=le(!1),{actions:s,store:d}=M2,[c,h]=le(!1);Vt(()=>{e.actions.registerValidator({key:"patient",validator:Oue}),e.enableOrder&&e.actions.registerValidator({key:"address",validator:Pue}),e?.patientId&&s.getSelectedPatient(e.client.getSDK(),e.patientId)});const f=$=>{e.actions.updateFormValue({key:"patient",value:$.detail.patient}),e.enableOrder&&!e.address&&e.actions.updateFormValue({key:"address",value:$.detail.patient.address})};Re(()=>{d?.selectedPatient?.data&&e?.patientId&&f({detail:{patient:d?.selectedPatient?.data}})});const p=Z(()=>e?.patientId||e.store.patient?.value?.id),m=Z(()=>c()?"":p()??""),v=Z(()=>e.store.patient?.value?.id&&!e.store.patient?.value?.address&&e.enableOrder);return(()=>{var $=Aue();return M($,_(fe,{get when(){return!e?.patientId},get children(){return _(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var w=Cue();return M(w,_(Ve,{color:"gray",get children(){return e?.patientId?"Patient":"Select Patient"}})),w})(),(()=>{var w=Sue();return Ce(w,"photon-patient-selected",f),w._$owner=Se(),ue(x=>{var C=e.store.patient?.error??!1,k=e.store.patient?.error,S=e.store.patient?.value?.id??e.patientId,P=e.client.getSDK();return C!==x.e&&(w.invalid=x.e=C),k!==x.t&&(w.helpText=x.t=k),S!==x.a&&(w.selected=x.a=S),P!==x.o&&(w.sdk=x.o=P),x},{e:void 0,t:void 0,a:void 0,o:void 0}),w})()]}})}}),null),M($,_(fe,{get when(){return m()&&!e.hidePatientCard},get children(){var w=Eue(),x=w.firstChild;return M(w,_(Wee,{get patientId(){return m()},get weight(){return e?.weight},get weightUnit(){return e?.weightUnit},get editPatient(){return e?.enableOrder&&!v()?()=>i(!0):void 0},get address(){return e?.address||e.store.patient?.value?.address}}),x),Ce(x,"photon-patient-closed",()=>{i(!1)}),Ce(x,"photon-patient-updated",()=>{h(!0),s.getSelectedPatient(e.client.getSDK(),e.store.patient.value.id),setTimeout(()=>{h(!1),i(!1)},100)}),x.hideCreatePrescription=!0,x._$owner=Se(),ue(C=>{var k=n(),S=m();return k!==C.e&&(x.open=C.e=k),S!==C.t&&(x.patientId=C.t=S),C},{e:void 0,t:void 0}),w}}),null),M($,_(fe,{get when(){return Z(()=>!!e.enableMedHistory)()&&m()},get children(){var w=Tue(),x=w.firstChild;return M(w,_(Qw,{get patientId(){return m()},get newMedication(){return t()},get enableLinks(){return e.enableMedHistoryLinks??!1},openAddMedicationDialog:()=>o(!0),hideAddMedicationDialog:()=>o(!1)}),x),Ce(x,"photon-medication-closed",()=>{o(!1)}),Ce(x,"photon-medication-selected",C=>{r(C.detail.medication)}),x._$owner=Se(),ue(()=>x.open=a()),w}}),null),M($,_(fe,{get when(){return v()},get children(){return _(oX,{get patientId(){return m()},setAddress:w=>{e.actions.updateFormValue({key:"address",value:w}),e.actions.updateFormValue({key:"patient",value:{...e.store.patient.value,address:w}})}})}}),null),$})()};var Nue=oe("<span>, "),Due=oe('<div class="flex flex-col items-start">'),Mue=oe('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Selected Pharmacy',!0,!1);const Lue=e=>{const t=Bn(),[r,n]=le(null),i=async a=>{if(a&&t){const{data:o}=await t.getSDK().clinical.pharmacy.getPharmacy({id:a});n(o.pharmacy)}};return Re(()=>{e.pharmacyId&&i(e.pharmacyId)}),(()=>{var a=Mue(),o=a.firstChild;return o.firstChild,a._$owner=Se(),M(o,_(fe,{get when(){return r()},get children(){return _(Cu,{label:"Pharmacies",get initSelected(){return e?.pharmacyId||""},get children(){return _(Cu.Option,{get value(){return e?.pharmacyId||""},get children(){var s=Due();return M(s,_(Ve,{get loading(){return!r()},sampleLoadingText:"Loading Name",get children(){return r()?.name}}),null),M(s,_(Ve,{get loading(){return!r()},color:"gray",size:"sm",sampleLoadingText:"Cityville, ST",get children(){var d=Nue(),c=d.firstChild;return M(d,()=>r()?.address?.city,c),M(d,()=>r()?.address?.state,null),d}}),null),s}})}})}}),null),a})()},Rue=".remove-icon-button::part(base):hover,.remove-icon-button::part(base):focus{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.edit-icon-button::part(base):hover,.edit-icon-button::part(base):focus{--tw-text-opacity: 1;color:rgb(234,179,8,var(--tw-text-opacity))}.enable-switch{--width: 60px;--height: 32px;--thumb-size: 26px;--sl-color-primary-600: #22c55e}",Fue=(e,t="lb")=>`Patient weight: ${e} ${t}`;Qn.define("sl-icon-button");var zue=dn`
3387
+ }`;var mt=y9(function(){return jt(I,Ge+"return "+xe).apply(r,L)});if(mt.source=xe,Vf(mt))throw mt;return mt}function CO(l){return Ht(l).toLowerCase()}function SO(l){return Ht(l).toUpperCase()}function EO(l,u,g){if(l=Ht(l),l&&(g||u===r))return Ev(l);if(!l||!(u=di(u)))return l;var y=Ui(l),T=Ui(u),I=Tv(y,T),L=Av(y,T)+1;return vo(y,I,L).join("")}function TO(l,u,g){if(l=Ht(l),l&&(g||u===r))return l.slice(0,Pv(l)+1);if(!l||!(u=di(u)))return l;var y=Ui(l),T=Av(y,Ui(u))+1;return vo(y,0,T).join("")}function AO(l,u,g){if(l=Ht(l),l&&(g||u===r))return l.replace(ol,"");if(!l||!(u=di(u)))return l;var y=Ui(l),T=Tv(y,Ui(u));return vo(y,T).join("")}function OO(l,u){var g=J,y=U;if(kr(u)){var T="separator"in u?u.separator:T;g="length"in u?ft(u.length):g,y="omission"in u?di(u.omission):y}l=Ht(l);var I=l.length;if(dl(l)){var L=Ui(l);I=L.length}if(g>=I)return l;var V=g-cl(y);if(V<1)return y;var q=L?vo(L,0,V).join(""):l.slice(0,V);if(T===r)return q+y;if(L&&(V+=q.length-V),Uf(T)){if(l.slice(V).search(T)){var ge,ye=q;for(T.global||(T=nf(T.source,Ht(Xd.exec(T))+"g")),T.lastIndex=0;ge=T.exec(ye);)var xe=ge.index;q=q.slice(0,xe===r?V:xe)}}else if(l.indexOf(di(T),V)!=V){var Ne=q.lastIndexOf(T);Ne>-1&&(q=q.slice(0,Ne))}return q+y}function PO(l){return l=Ht(l),l&&t0.test(l)?l.replace(Wd,oC):l}var IO=vl(function(l,u,g){return l+(g?" ":"")+u.toUpperCase()}),Hf=b4("toUpperCase");function v9(l,u,g){return l=Ht(l),u=g?r:u,u===r?tC(l)?dC(l):Wk(l):l.match(u)||[]}var y9=$t(function(l,u){try{return si(l,r,u)}catch(g){return Vf(g)?g:new st(g)}}),NO=za(function(l,u){return Ti(u,function(g){g=ha(g),Ra(l,g,zf(l[g],l))}),l});function DO(l){var u=l==null?0:l.length,g=Ze();return l=u?wr(l,function(y){if(typeof y[1]!="function")throw new Ai(o);return[g(y[0]),y[1]]}):[],$t(function(y){for(var T=-1;++T<u;){var I=l[T];if(si(I[0],this,y))return si(I[1],this,y)}})}function MO(l){return oS(Pi(l,f))}function Wf(l){return function(){return l}}function LO(l,u){return l==null||l!==l?u:l}var RO=w4(),FO=w4(!0);function Jn(l){return l}function Qf(l){return Zv(typeof l=="function"?l:Pi(l,f))}function zO(l){return Jv(Pi(l,f))}function jO(l,u){return e4(l,Pi(u,f))}var VO=$t(function(l,u){return function(g){return uc(g,l,u)}}),UO=$t(function(l,u){return function(g){return uc(l,g,u)}});function Gf(l,u,g){var y=tn(u),T=D0(u,y);g==null&&!(kr(u)&&(T.length||!y.length))&&(g=u,u=l,l=this,T=D0(u,tn(u)));var I=!(kr(g)&&"chain"in g)||!!g.chain,L=Va(l);return Ti(T,function(V){var q=u[V];l[V]=q,L&&(l.prototype[V]=function(){var ge=this.__chain__;if(I||ge){var ye=l(this.__wrapped__),xe=ye.__actions__=Yn(this.__actions__);return xe.push({func:q,args:arguments,thisArg:l}),ye.__chain__=ge,ye}return q.apply(l,uo([this.value()],arguments))})}),l}function BO(){return gn._===this&&(gn._=gC),this}function Kf(){}function qO(l){return l=ft(l),$t(function(u){return t4(u,l)})}var HO=Sf(wr),WO=Sf(xv),QO=Sf(Y2);function b9(l){return Nf(l)?Z2(ha(l)):_S(l)}function GO(l){return function(u){return l==null?r:us(l,u)}}var KO=_4(),YO=_4(!0);function Yf(){return[]}function Zf(){return!1}function ZO(){return{}}function XO(){return""}function JO(){return!0}function eP(l,u){if(l=ft(l),l<1||l>re)return[];var g=ke,y=_n(l,ke);u=Ze(u),l-=ke;for(var T=ef(y,u);++g<l;)u(g);return T}function tP(l){return ut(l)?wr(l,ha):ci(l)?[l]:Yn(z4(Ht(l)))}function rP(l){var u=++fC;return Ht(l)+u}var nP=j0(function(l,u){return l+u},0),iP=Ef("ceil"),aP=j0(function(l,u){return l/u},1),oP=Ef("floor");function sP(l){return l&&l.length?N0(l,Jn,hf):r}function lP(l,u){return l&&l.length?N0(l,Ze(u,2),hf):r}function dP(l){return Cv(l,Jn)}function cP(l,u){return Cv(l,Ze(u,2))}function uP(l){return l&&l.length?N0(l,Jn,mf):r}function hP(l,u){return l&&l.length?N0(l,Ze(u,2),mf):r}var fP=j0(function(l,u){return l*u},1),pP=Ef("round"),gP=j0(function(l,u){return l-u},0);function mP(l){return l&&l.length?J2(l,Jn):0}function vP(l,u){return l&&l.length?J2(l,Ze(u,2)):0}return O.after=zT,O.ary=Y4,O.assign=SA,O.assignIn=c9,O.assignInWith=J0,O.assignWith=EA,O.at=TA,O.before=Z4,O.bind=zf,O.bindAll=NO,O.bindKey=X4,O.castArray=ZT,O.chain=Q4,O.chunk=oE,O.compact=sE,O.concat=lE,O.cond=DO,O.conforms=MO,O.constant=Wf,O.countBy=mT,O.create=AA,O.curry=J4,O.curryRight=e9,O.debounce=t9,O.defaults=OA,O.defaultsDeep=PA,O.defer=jT,O.delay=VT,O.difference=dE,O.differenceBy=cE,O.differenceWith=uE,O.drop=hE,O.dropRight=fE,O.dropRightWhile=pE,O.dropWhile=gE,O.fill=mE,O.filter=yT,O.flatMap=wT,O.flatMapDeep=xT,O.flatMapDepth=_T,O.flatten=B4,O.flattenDeep=vE,O.flattenDepth=yE,O.flip=UT,O.flow=RO,O.flowRight=FO,O.fromPairs=bE,O.functions=FA,O.functionsIn=zA,O.groupBy=kT,O.initial=wE,O.intersection=xE,O.intersectionBy=_E,O.intersectionWith=kE,O.invert=VA,O.invertBy=UA,O.invokeMap=ST,O.iteratee=Qf,O.keyBy=ET,O.keys=tn,O.keysIn=Xn,O.map=Q0,O.mapKeys=qA,O.mapValues=HA,O.matches=zO,O.matchesProperty=jO,O.memoize=K0,O.merge=WA,O.mergeWith=u9,O.method=VO,O.methodOf=UO,O.mixin=Gf,O.negate=Y0,O.nthArg=qO,O.omit=QA,O.omitBy=GA,O.once=BT,O.orderBy=TT,O.over=HO,O.overArgs=qT,O.overEvery=WO,O.overSome=QO,O.partial=jf,O.partialRight=r9,O.partition=AT,O.pick=KA,O.pickBy=h9,O.property=b9,O.propertyOf=GO,O.pull=TE,O.pullAll=H4,O.pullAllBy=AE,O.pullAllWith=OE,O.pullAt=PE,O.range=KO,O.rangeRight=YO,O.rearg=HT,O.reject=IT,O.remove=IE,O.rest=WT,O.reverse=Rf,O.sampleSize=DT,O.set=ZA,O.setWith=XA,O.shuffle=MT,O.slice=NE,O.sortBy=FT,O.sortedUniq=jE,O.sortedUniqBy=VE,O.split=wO,O.spread=QT,O.tail=UE,O.take=BE,O.takeRight=qE,O.takeRightWhile=HE,O.takeWhile=WE,O.tap=sT,O.throttle=GT,O.thru=W0,O.toArray=s9,O.toPairs=f9,O.toPairsIn=p9,O.toPath=tP,O.toPlainObject=d9,O.transform=JA,O.unary=KT,O.union=QE,O.unionBy=GE,O.unionWith=KE,O.uniq=YE,O.uniqBy=ZE,O.uniqWith=XE,O.unset=eO,O.unzip=Ff,O.unzipWith=W4,O.update=tO,O.updateWith=rO,O.values=$l,O.valuesIn=nO,O.without=JE,O.words=v9,O.wrap=YT,O.xor=eT,O.xorBy=tT,O.xorWith=rT,O.zip=nT,O.zipObject=iT,O.zipObjectDeep=aT,O.zipWith=oT,O.entries=f9,O.entriesIn=p9,O.extend=c9,O.extendWith=J0,Gf(O,O),O.add=nP,O.attempt=y9,O.camelCase=sO,O.capitalize=g9,O.ceil=iP,O.clamp=iO,O.clone=XT,O.cloneDeep=eA,O.cloneDeepWith=tA,O.cloneWith=JT,O.conformsTo=rA,O.deburr=m9,O.defaultTo=LO,O.divide=aP,O.endsWith=lO,O.eq=qi,O.escape=dO,O.escapeRegExp=cO,O.every=vT,O.find=bT,O.findIndex=V4,O.findKey=IA,O.findLast=$T,O.findLastIndex=U4,O.findLastKey=NA,O.floor=oP,O.forEach=G4,O.forEachRight=K4,O.forIn=DA,O.forInRight=MA,O.forOwn=LA,O.forOwnRight=RA,O.get=Bf,O.gt=nA,O.gte=iA,O.has=jA,O.hasIn=qf,O.head=q4,O.identity=Jn,O.includes=CT,O.indexOf=$E,O.inRange=aO,O.invoke=BA,O.isArguments=ps,O.isArray=ut,O.isArrayBuffer=aA,O.isArrayLike=Zn,O.isArrayLikeObject=Dr,O.isBoolean=oA,O.isBuffer=yo,O.isDate=sA,O.isElement=lA,O.isEmpty=dA,O.isEqual=cA,O.isEqualWith=uA,O.isError=Vf,O.isFinite=hA,O.isFunction=Va,O.isInteger=n9,O.isLength=Z0,O.isMap=i9,O.isMatch=fA,O.isMatchWith=pA,O.isNaN=gA,O.isNative=mA,O.isNil=yA,O.isNull=vA,O.isNumber=a9,O.isObject=kr,O.isObjectLike=Er,O.isPlainObject=vc,O.isRegExp=Uf,O.isSafeInteger=bA,O.isSet=o9,O.isString=X0,O.isSymbol=ci,O.isTypedArray=bl,O.isUndefined=$A,O.isWeakMap=wA,O.isWeakSet=xA,O.join=CE,O.kebabCase=uO,O.last=Ni,O.lastIndexOf=SE,O.lowerCase=hO,O.lowerFirst=fO,O.lt=_A,O.lte=kA,O.max=sP,O.maxBy=lP,O.mean=dP,O.meanBy=cP,O.min=uP,O.minBy=hP,O.stubArray=Yf,O.stubFalse=Zf,O.stubObject=ZO,O.stubString=XO,O.stubTrue=JO,O.multiply=fP,O.nth=EE,O.noConflict=BO,O.noop=Kf,O.now=G0,O.pad=pO,O.padEnd=gO,O.padStart=mO,O.parseInt=vO,O.random=oO,O.reduce=OT,O.reduceRight=PT,O.repeat=yO,O.replace=bO,O.result=YA,O.round=pP,O.runInContext=B,O.sample=NT,O.size=LT,O.snakeCase=$O,O.some=RT,O.sortedIndex=DE,O.sortedIndexBy=ME,O.sortedIndexOf=LE,O.sortedLastIndex=RE,O.sortedLastIndexBy=FE,O.sortedLastIndexOf=zE,O.startCase=xO,O.startsWith=_O,O.subtract=gP,O.sum=mP,O.sumBy=vP,O.template=kO,O.times=eP,O.toFinite=Ua,O.toInteger=ft,O.toLength=l9,O.toLower=CO,O.toNumber=Di,O.toSafeInteger=CA,O.toString=Ht,O.toUpper=SO,O.trim=EO,O.trimEnd=TO,O.trimStart=AO,O.truncate=OO,O.unescape=PO,O.uniqueId=rP,O.upperCase=IO,O.upperFirst=Hf,O.each=G4,O.eachRight=K4,O.first=q4,Gf(O,function(){var l={};return ca(O,function(u,g){Yt.call(O.prototype,g)||(l[g]=u)}),l}(),{chain:!1}),O.VERSION=n,Ti(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){O[l].placeholder=O}),Ti(["drop","take"],function(l,u){Ct.prototype[l]=function(g){g=g===r?1:Gr(ft(g),0);var y=this.__filtered__&&!u?new Ct(this):this.clone();return y.__filtered__?y.__takeCount__=_n(g,y.__takeCount__):y.__views__.push({size:_n(g,ke),type:l+(y.__dir__<0?"Right":"")}),y},Ct.prototype[l+"Right"]=function(g){return this.reverse()[l](g).reverse()}}),Ti(["filter","map","takeWhile"],function(l,u){var g=u+1,y=g==K||g==we;Ct.prototype[l]=function(T){var I=this.clone();return I.__iteratees__.push({iteratee:Ze(T,3),type:g}),I.__filtered__=I.__filtered__||y,I}}),Ti(["head","last"],function(l,u){var g="take"+(u?"Right":"");Ct.prototype[l]=function(){return this[g](1).value()[0]}}),Ti(["initial","tail"],function(l,u){var g="drop"+(u?"":"Right");Ct.prototype[l]=function(){return this.__filtered__?new Ct(this):this[g](1)}}),Ct.prototype.compact=function(){return this.filter(Jn)},Ct.prototype.find=function(l){return this.filter(l).head()},Ct.prototype.findLast=function(l){return this.reverse().find(l)},Ct.prototype.invokeMap=$t(function(l,u){return typeof l=="function"?new Ct(this):this.map(function(g){return uc(g,l,u)})}),Ct.prototype.reject=function(l){return this.filter(Y0(Ze(l)))},Ct.prototype.slice=function(l,u){l=ft(l);var g=this;return g.__filtered__&&(l>0||u<0)?new Ct(g):(l<0?g=g.takeRight(-l):l&&(g=g.drop(l)),u!==r&&(u=ft(u),g=u<0?g.dropRight(-u):g.take(u-l)),g)},Ct.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},Ct.prototype.toArray=function(){return this.take(ke)},ca(Ct.prototype,function(l,u){var g=/^(?:filter|find|map|reject)|While$/.test(u),y=/^(?:head|last)$/.test(u),T=O[y?"take"+(u=="last"?"Right":""):u],I=y||/^find/.test(u);T&&(O.prototype[u]=function(){var L=this.__wrapped__,V=y?[1]:arguments,q=L instanceof Ct,ge=V[0],ye=q||ut(L),xe=function(kt){var Tt=T.apply(O,uo([kt],V));return y&&Ne?Tt[0]:Tt};ye&&g&&typeof ge=="function"&&ge.length!=1&&(q=ye=!1);var Ne=this.__chain__,Ge=!!this.__actions__.length,Xe=I&&!Ne,mt=q&&!Ge;if(!I&&ye){L=mt?L:new Ct(this);var Je=l.apply(L,V);return Je.__actions__.push({func:W0,args:[xe],thisArg:r}),new Oi(Je,Ne)}return Xe&&mt?l.apply(this,V):(Je=this.thru(xe),Xe?y?Je.value()[0]:Je.value():Je)})}),Ti(["pop","push","shift","sort","splice","unshift"],function(l){var u=y0[l],g=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",y=/^(?:pop|shift)$/.test(l);O.prototype[l]=function(){var T=arguments;if(y&&!this.__chain__){var I=this.value();return u.apply(ut(I)?I:[],T)}return this[g](function(L){return u.apply(ut(L)?L:[],T)})}}),ca(Ct.prototype,function(l,u){var g=O[u];if(g){var y=g.name+"";Yt.call(pl,y)||(pl[y]=[]),pl[y].push({name:u,func:g})}}),pl[z0(r,x).name]=[{name:"wrapper",func:r}],Ct.prototype.clone=PC,Ct.prototype.reverse=IC,Ct.prototype.value=NC,O.prototype.at=lT,O.prototype.chain=dT,O.prototype.commit=cT,O.prototype.next=uT,O.prototype.plant=fT,O.prototype.reverse=pT,O.prototype.toJSON=O.prototype.valueOf=O.prototype.value=gT,O.prototype.first=O.prototype.head,ic&&(O.prototype[ic]=hT),O},ul=cC();os?((os.exports=ul)._=ul,W2._=ul):gn._=ul}).call(kc)})(Qh,Qh.exports);var vue=Qh.exports,yue=oe('<div class="flex items-center space-x-2 text-slate-500">'),bue=oe('<div><style></style><photon-dialog label="Overwrite in progress prescription?"confirm-text="Yes, Overwrite"cancel-text="No, Cancel"><p class="font-sans text-lg xs:text-base">You are editing a prescription that has not been added. This will be overwritten if you edit another prescription.</p></photon-dialog><photon-dialog label="Delete pending prescription?"confirm-text="Yes, Delete"cancel-text="No, Cancel"><p class="font-sans text-lg xs:text-base">Deleting this prescription will remove it from your pending prescriptions. This action cannot be undone.',!0,!1);const $ue=qr(Ro(Hle(Ju()),1,1/0),"You must add at least 1 Prescription"),wue=e=>{let t;const[r,n]=le(!1),[i,a]=le(!1),[o,s]=le(void 0),[d,c]=le();e.actions.registerValidator({key:"draftPrescriptions",validator:$ue});const h=x=>{const C=new CustomEvent("photon-draft-prescription-deleted",{composed:!0,bubbles:!0,detail:{prescription:Gs(x)}});t?.dispatchEvent(C)},f=()=>{o().treatment&&(J_(e.actions,o()),e.actions.updateFormValue({key:"catalogId",value:o().catalogId}),e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(x=>x.id!==o().id)}),window.scrollTo({behavior:"smooth",top:(e.prescriptionRef?.getBoundingClientRect().top||0)-document.body.getBoundingClientRect().top-70}),e.handleDeletedDraftPrescription())},p=x=>{const C=e.store.draftPrescriptions.value.find(k=>k.id===x);s(C),e.store.treatment.value?a(!0):(e.setIsEditing(!0),f())},m=()=>{f(),a(!1),s(void 0)},v=()=>{a(!1),s(void 0)},$=()=>{const[x,C]=vue.partition(e.store.draftPrescriptions.value,k=>k.id===d());e.actions.updateFormValue({key:"draftPrescriptions",value:C}),h(x[0]),n(!1),c(void 0),e.store.draftPrescriptions?.value?.length===0&&e.setIsEditing(!0),e.handleDeletedDraftPrescription()},w=()=>{n(!1),c(void 0)};return(()=>{var x=bue(),C=x.firstChild,k=C.nextSibling,S=k.nextSibling,P=t;return typeof P=="function"?ot(P,x):t=x,M(C,Ta),Ce(k,"photon-dialog-alt",v),Ce(k,"photon-dialog-canceled",v),Ce(k,"photon-dialog-confirmed",m),k._$owner=Se(),Ce(S,"photon-dialog-alt",w),Ce(S,"photon-dialog-canceled",w),Ce(S,"photon-dialog-confirmed",$),S._$owner=Se(),M(x,_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var N=yue();return M(N,_(Ve,{color:"gray",class:"pr-2",get children(){return e.enableOrder?"Pending Order":"Pending Prescriptions"}}),null),M(N,_(ek,{maxWidth:"300px",tip:"Each prescription will include the prescriber’s digital signature and the date it was written when the order is sent to the pharmacy."}),null),N})(),_(Dee,{get draftPrescriptions(){return e.store.draftPrescriptions?.value??[]},handleDelete:N=>{n(!0),c(N)},handleEdit:N=>{p(N)},get templateIds(){return e.templateIds},get templateOverrides(){return e.templateOverrides},get prescriptionIds(){return e.prescriptionIds},setDraftPrescriptions:N=>{e.actions.updateFormValue({key:"draftPrescriptions",value:N})},get error(){return e.store.draftPrescriptions?.error},get screeningAlerts(){return e.screeningAlerts},get enableOrder(){return e.enableOrder}})]}}),null),ue(N=>{var j=i(),F=r();return j!==N.e&&(k.open=N.e=j),F!==N.t&&(S.open=N.t=F),N},{e:void 0,t:void 0}),x})()};var xue=oe('<div class="flex items-center justify-between">'),_ue=oe("<div><style>");const kue=e=>{const t=Z(()=>e.store.patient?.value?[e.store.patient?.value?.id]:[]),r=Z(()=>{const n=e.store.patient?.value?.address;return n?`${n.street1} ${n.street2||""} ${n.city}, ${n.state} ${n.postalCode}`:""});return(()=>{var n=_ue(),i=n.firstChild;return M(i,Ta),M(n,_(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var a=xue();return M(a,_(Ve,{color:"gray",children:"Select Pharmacy"})),a})(),_(nie,{get enableSendToPatient(){return e.enableSendToPatient},get enableLocalPickup(){return e.enableLocalPickup||!e?.enableSendToPatient&&!e?.mailOrderIds},get mailOrderPharmacyIds(){return Z(()=>!!e.mailOrderIds)()?e.mailOrderIds.split(","):void 0},get patientIds(){return t()},get address(){return r()},setFufillmentType:a=>{e.actions.updateFormValue({key:"fulfillmentType",value:a||""})},setPreferredPharmacy:(a=!1)=>{e.actions.updateFormValue({key:"updatePreferredPharmacy",value:a})},setPharmacyId:a=>{e.actions.updateFormValue({key:"pharmacy",value:a})}})]}}),null),n})()};var Cue=oe('<div class="flex items-center justify-between">'),Sue=oe("<photon-patient-select>",!0,!1),Eue=oe("<div><photon-patient-dialog>",!0,!1),Tue=oe('<div><photon-add-medication-history-dialog title="Add Medication History">',!0,!1),Aue=oe('<div class="flex flex-col gap-8">');const Oue=qr(Zm(yi(),Ju()),"Please select a patient..."),Pue=qr(Zm(yi(),Ju()),"Please enter an address for patient..."),Iue=e=>{const[t,r]=le(),[n,i]=le(!1),[a,o]=le(!1),{actions:s,store:d}=M2,[c,h]=le(!1);Vt(()=>{e.actions.registerValidator({key:"patient",validator:Oue}),e.enableOrder&&e.actions.registerValidator({key:"address",validator:Pue}),e?.patientId&&s.getSelectedPatient(e.client.getSDK(),e.patientId)});const f=$=>{e.actions.updateFormValue({key:"patient",value:$.detail.patient}),e.enableOrder&&!e.address&&e.actions.updateFormValue({key:"address",value:$.detail.patient.address})};Re(()=>{d?.selectedPatient?.data&&e?.patientId&&f({detail:{patient:d?.selectedPatient?.data}})});const p=Z(()=>e?.patientId||e.store.patient?.value?.id),m=Z(()=>c()?"":p()??""),v=Z(()=>e.store.patient?.value?.id&&!e.store.patient?.value?.address&&e.enableOrder);return(()=>{var $=Aue();return M($,_(fe,{get when(){return!e?.patientId},get children(){return _(Fn,{addChildrenDivider:!0,get children(){return[(()=>{var w=Cue();return M(w,_(Ve,{color:"gray",get children(){return e?.patientId?"Patient":"Select Patient"}})),w})(),(()=>{var w=Sue();return Ce(w,"photon-patient-selected",f),w._$owner=Se(),ue(x=>{var C=e.store.patient?.error??!1,k=e.store.patient?.error,S=e.store.patient?.value?.id??e.patientId,P=e.client.getSDK();return C!==x.e&&(w.invalid=x.e=C),k!==x.t&&(w.helpText=x.t=k),S!==x.a&&(w.selected=x.a=S),P!==x.o&&(w.sdk=x.o=P),x},{e:void 0,t:void 0,a:void 0,o:void 0}),w})()]}})}}),null),M($,_(fe,{get when(){return m()&&!e.hidePatientCard},get children(){var w=Eue(),x=w.firstChild;return M(w,_(Wee,{get patientId(){return m()},get weight(){return e?.weight},get weightUnit(){return e?.weightUnit},get editPatient(){return e?.enableOrder&&!v()?()=>i(!0):void 0},get address(){return e?.address||e.store.patient?.value?.address}}),x),Ce(x,"photon-patient-closed",()=>{i(!1)}),Ce(x,"photon-patient-updated",()=>{h(!0),s.getSelectedPatient(e.client.getSDK(),e.store.patient.value.id),setTimeout(()=>{h(!1),i(!1)},100)}),x.hideCreatePrescription=!0,x._$owner=Se(),ue(C=>{var k=n(),S=m();return k!==C.e&&(x.open=C.e=k),S!==C.t&&(x.patientId=C.t=S),C},{e:void 0,t:void 0}),w}}),null),M($,_(fe,{get when(){return Z(()=>!!e.enableMedHistory)()&&m()},get children(){var w=Tue(),x=w.firstChild;return M(w,_(Qw,{get patientId(){return m()},get newMedication(){return t()},get enableLinks(){return e.enableMedHistoryLinks??!1},openAddMedicationDialog:()=>o(!0),hideAddMedicationDialog:()=>o(!1)}),x),Ce(x,"photon-medication-closed",()=>{o(!1)}),Ce(x,"photon-medication-selected",C=>{r(C.detail.medication)}),x._$owner=Se(),ue(()=>x.open=a()),w}}),null),M($,_(fe,{get when(){return v()},get children(){return _(oX,{get patientId(){return m()},setAddress:w=>{e.actions.updateFormValue({key:"address",value:w}),e.actions.updateFormValue({key:"patient",value:{...e.store.patient.value,address:w}})}})}}),null),$})()};var Nue=oe("<span>, "),Due=oe('<div class="flex flex-col items-start">'),Mue=oe('<photon-card><div class="flex flex-col gap-3"><div class="flex flex-row"><p class="font-sans text-l font-medium flex-grow">Selected Pharmacy',!0,!1);const Lue=e=>{const t=Bn(),[r,n]=le(null),i=async a=>{if(a&&t){const{data:o}=await t.getSDK().clinical.pharmacy.getPharmacy({id:a});n(o.pharmacy)}};return Re(()=>{e.pharmacyId&&i(e.pharmacyId)}),(()=>{var a=Mue(),o=a.firstChild;return o.firstChild,a._$owner=Se(),M(o,_(fe,{get when(){return r()},get children(){return _(Cu,{label:"Pharmacies",get initSelected(){return e?.pharmacyId||""},get children(){return _(Cu.Option,{get value(){return e?.pharmacyId||""},get children(){var s=Due();return M(s,_(Ve,{get loading(){return!r()},sampleLoadingText:"Loading Name",get children(){return r()?.name}}),null),M(s,_(Ve,{get loading(){return!r()},color:"gray",size:"sm",sampleLoadingText:"Cityville, ST",get children(){var d=Nue(),c=d.firstChild;return M(d,()=>r()?.address?.city,c),M(d,()=>r()?.address?.state,null),d}}),null),s}})}})}}),null),a})()},Rue=".remove-icon-button::part(base):hover,.remove-icon-button::part(base):focus{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.edit-icon-button::part(base):hover,.edit-icon-button::part(base):focus{--tw-text-opacity: 1;color:rgb(234,179,8,var(--tw-text-opacity))}.enable-switch{--width: 60px;--height: 32px;--thumb-size: 26px;--sl-color-primary-600: #22c55e}",Fue=(e,t="lb")=>`Patient weight: ${e} ${t}`;Qn.define("sl-icon-button");var zue=dn`
3388
3388
  :host {
3389
3389
  display: inline-block;
3390
3390
  }
@@ -4244,7 +4244,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
4244
4244
  phone
4245
4245
  }
4246
4246
  }
4247
- `,lfe=()=>{const[e,t]=es({pharmacies:{data:[],address:void 0,errors:[],isLoading:!1},selectedPharmacy:{data:void 0,errors:[],isLoading:!1},preferredPharmacies:{data:void 0,errors:[],isLoading:!1}}),r=async(c,h,f,p)=>{try{const m=await h.geocode({address:f}),v=m.results[0].geometry.location.lat(),$=m.results[0].geometry.location.lng(),w=m.results[0].formatted_address;if(w&&t("pharmacies",{...e.pharmacies,address:w,errors:[]}),!v||!$){t("pharmacies",{...e.pharmacies,errors:[new Error("An unexpected error occured")]});return}await n(c,{name:p,location:{latitude:v,longitude:$}})}catch(m){console.log("ERR",m),t("pharmacies",{...e.pharmacies,errors:[new Error("The provided address seems invalid. Please revise and try again.")]})}},n=async(c,h)=>{t("pharmacies",{...e.pharmacies,isLoading:!0});const{data:f,errors:p}=await c.clinical.pharmacy.getPharmacies({name:h.name,location:h.location,first:h.first,type:"PICK_UP"});t("pharmacies",{...e.pharmacies,isLoading:!1,data:f.pharmacies,errors:p})};return{store:e,actions:{getPharmacies:n,getPharmaciesByAddress:r,getPharmacy:async(c,h)=>{t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!0});const{data:f,errors:p}=await c.clinical.pharmacy.getPharmacy({id:h});(e.pharmacies.errors||[]).filter(m=>m.message.includes("seems invalid")||m.message.includes("unexpected error")).length>0&&t("pharmacies",{...e.pharmacies,errors:[]}),t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!1,data:f.pharmacy,errors:p})},clearSelectedPharmacy:()=>{t("selectedPharmacy",{...e.selectedPharmacy,data:void 0,errors:[]})},getPreferredPharmacies:async(c,h)=>{t("preferredPharmacies",{...e.preferredPharmacies,isLoading:!0});const{data:f,errors:p}=await c.clinical.patient.getPatient({id:h,fragment:{PatientPharmacyFields:sfe}});t("preferredPharmacies",{...e.selectedPharmacy,isLoading:!1,data:f.patient.preferredPharmacies?.map(m=>m),errors:p})},clearPreferredPharmacies:()=>{t("preferredPharmacies",{...e.selectedPharmacy,data:[],errors:[]})},reset:async()=>{t("pharmacies",{data:[],errors:[],address:void 0,isLoading:!1}),t("selectedPharmacy",{data:void 0,errors:[],isLoading:!1}),t("preferredPharmacies",{data:void 0,errors:[],isLoading:!1})}}}},dfe=lfe();var cfe=oe('<div class="w-full flex justify-center">'),ufe=oe('<div><p class="font-sans text-lg flex-grow">Personal</p><div class="flex flex-col xs:flex-row xs:gap-4"><photon-text-input class="flex-grow min-w-[40%]"debounce-time=0 label="First Name"></photon-text-input><photon-text-input class=min-w-[48%] debounce-time=0 label="Last Name"></photon-text-input></div><div class="flex flex-col xs:flex-row items-center xs:gap-4"><photon-datepicker no-initial-date=true class="flex-grow w-full xs:min-w-[40%]"label="Date of Birth"></photon-datepicker><photon-phone-input class="w-full xs:min-w-[48%]"label="Mobile Number"></photon-phone-input></div><div class="flex flex-col xs:flex-row justify-between xs:gap-4"><div class="flex-grow w-full xs:min-w-[40%]"><photon-gender-input label=Gender required=false></photon-gender-input></div><div class="flex-grow w-full xs:min-w-[40%]"><photon-sex-input label="Sex at Birth"required=false></photon-sex-input></div></div><div class=mt-2><photon-text-input debounce-time=0 label=Email>',!0,!1),hfe=oe('<div><p class="font-sans text-lg flex-grow">Address</p><photon-text-input debounce-time=0 label="Street 1"></photon-text-input><photon-text-input debounce-time=0 label="Street 2"></photon-text-input><photon-text-input debounce-time=0 label=City></photon-text-input><div class="flex gap-4 pb-5 xs:pb-2"><photon-state-input class="flex-grow min-w-[40%]"label=State required=false></photon-state-input><photon-text-input debounce-time=0 class="flex-grow min-w-[40%]"label="Zip Code">',!0,!1),ffe=oe('<div><p class="font-sans text-lg flex-grow">Preferred Local Pharmacy'),pfe=oe('<div class="flex flex-col gap-8">'),gfe=oe('<div class="w-full h-full relative"><style></style><style></style><style></style><style>');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const mfe=(e,t)=>{const r=e.selectedPatient.data?.address;return t.address_zip?.value&&Oae(t.address_zip?.value)&&t.address_zip?.value!=r?.postalCode?t.address_zip?.value:r?`${r.street1} ${r.street2??""} ${r.city}, ${r.state} ${r.postalCode}`:""},vfe=e=>{let t;const r=Bn(),{store:n,actions:i}=M2,{actions:a}=dfe,{store:o,actions:s}=D_({firstName:void 0,lastName:void 0,dateOfBirth:void 0,phone:void 0,gender:void 0,sex:void 0,email:void 0,address_street1:void 0,address_street2:void 0,address_city:void 0,address_state:void 0,address_zip:void 0,preferredPharmacy:void 0});s.registerValidator({key:"firstName",validator:qr(Ro(yi(),1,1/0),"Please enter a first name.")}),s.registerValidator({key:"lastName",validator:qr(Ro(yi(),1,1/0),"Please enter a last name.")}),s.registerValidator({key:"dateOfBirth",validator:qr(i5([iue,s5()]),"Please enter a valid date of birth.")}),s.registerValidator({key:"sex",validator:qr(Wle(Ag.map(c=>c.name)),"Please enter Sex at Birth.")}),s.registerValidator({key:"phone",validator:qr(Ro(yi(),12),"Please enter a valid mobile number.")}),s.registerValidator({key:"email",validator:qr(i5([sue(),s5()]),"Please enter a valid email.")}),s.registerValidator({key:"address_zip",validator:qr(i5([oue(),s5()]),"Please enter a valid zip code...")}),Vt(()=>{e.patientId?i.getSelectedPatient(r.getSDK(),e.patientId):i.clearSelectedPatient()});const d=c=>{const h=new CustomEvent("photon-form-updated",{composed:!0,bubbles:!0,detail:{form:c,actions:s,selected:n,reset:()=>{s.reset(),i.reset(),a.reset()}}});t?.dispatchEvent(h)};return Re(()=>{n.selectedPatient.data&&(s.updateFormValue({key:"firstName",value:n.selectedPatient.data.name.first}),s.updateFormValue({key:"lastName",value:n.selectedPatient.data.name.last}),s.updateFormValue({key:"phone",value:n.selectedPatient.data.phone}),s.updateFormValue({key:"gender",value:n.selectedPatient.data.gender}),s.updateFormValue({key:"sex",value:n.selectedPatient.data.sex}),s.updateFormValue({key:"email",value:n.selectedPatient.data.email}),s.updateFormValue({key:"address_street1",value:n.selectedPatient.data.address?.street1}),s.updateFormValue({key:"address_street2",value:n.selectedPatient.data.address?.street2}),s.updateFormValue({key:"address_city",value:n.selectedPatient.data.address?.city}),s.updateFormValue({key:"address_state",value:n.selectedPatient.data.address?.state}),s.updateFormValue({key:"address_zip",value:n.selectedPatient.data.address?.postalCode}),s.updateFormValue({key:"preferredPharmacy",value:n.selectedPatient.data.preferredPharmacies?.[0]?.id}))}),Re(()=>{d(o)}),Sn(()=>{i.clearSelectedPatient(),s.reset()}),(()=>{var c=gfe(),h=c.firstChild,f=h.nextSibling,p=f.nextSibling,m=p.nextSibling,v=t;return typeof v=="function"?ot(v,c):t=c,M(h,_r),M(f,Hn),M(p,Wn),M(m,Ta),M(c,_(fe,{get when(){return n.selectedPatient.isLoading},get children(){var $=cfe();return M($,_(oo,{color:"green"})),$}}),null),M(c,_(fe,{get when(){return!n.selectedPatient.isLoading},get children(){return _(L_,{permissions:["write:patient"],get children(){var $=pfe();return M($,_(Fn,{get children(){var w=ufe(),x=w.firstChild,C=x.nextSibling,k=C.firstChild,S=k.nextSibling,P=C.nextSibling,N=P.firstChild,j=N.nextSibling,F=P.nextSibling,W=F.firstChild,J=W.firstChild,U=W.nextSibling,G=U.firstChild,H=F.nextSibling,K=H.firstChild;return Ce(k,"photon-input-changed",async ee=>{s.updateFormValue({key:"firstName",value:ee.detail.input})}),k._$owner=Se(),Ce(S,"photon-input-changed",async ee=>{s.updateFormValue({key:"lastName",value:ee.detail.input})}),S._$owner=Se(),Ce(N,"photon-datepicker-selected",async ee=>{s.updateFormValue({key:"dateOfBirth",value:ee.detail.date})}),N._$owner=Se(),Ce(j,"photon-phone-changed",async ee=>{s.updateFormValue({key:"phone",value:ee.detail.phone})}),j._$owner=Se(),Ce(J,"photon-gender-deselected",()=>{s.updateFormValue({key:"gender",value:void 0})}),Ce(J,"photon-gender-selected",ee=>{s.updateFormValue({key:"gender",value:ee.detail.gender})}),J._$owner=Se(),Ce(G,"photon-sex-deselected",()=>{s.updateFormValue({key:"sex",value:void 0})}),Ce(G,"photon-sex-selected",ee=>{s.updateFormValue({key:"sex",value:ee.detail.sex})}),G._$owner=Se(),Ce(K,"photon-input-changed",async ee=>{s.updateFormValue({key:"email",value:ee.detail.input})}),K._$owner=Se(),ue(ee=>{var we=o.firstName?.error,me=o.firstName?.error,re=o.lastName?.error,X=o.lastName?.error,ne=o.dateOfBirth?.error,ke=o.dateOfBirth?.error,ie=o.phone?.error,Ae=o.phone?.error,Ie=o.gender?.error,pe=o.gender?.error!==void 0,ve=n.selectedPatient.data?.gender,Le=o.sex?.error,Ke=o.sex?.error!==void 0,Oe=n.selectedPatient.data?.sex,it=o.email?.error,at=o.email?.error;return we!==ee.e&&(k.invalid=ee.e=we),me!==ee.t&&(k.helpText=ee.t=me),re!==ee.a&&(S.invalid=ee.a=re),X!==ee.o&&(S.helpText=ee.o=X),ne!==ee.i&&(N.invalid=ee.i=ne),ke!==ee.n&&(N.helpText=ee.n=ke),ie!==ee.s&&(j.invalid=ee.s=ie),Ae!==ee.h&&(j.helpText=ee.h=Ae),Ie!==ee.r&&(J.helpText=ee.r=Ie),pe!==ee.d&&(J.invalid=ee.d=pe),ve!==ee.l&&(J.selected=ee.l=ve),Le!==ee.u&&(G.helpText=ee.u=Le),Ke!==ee.c&&(G.invalid=ee.c=Ke),Oe!==ee.w&&(G.selected=ee.w=Oe),it!==ee.m&&(K.invalid=ee.m=it),at!==ee.f&&(K.helpText=ee.f=at),ee},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),ue(()=>k.value=o.firstName?.value??n.selectedPatient.data?.name.first),ue(()=>S.value=o.lastName?.value??n.selectedPatient.data?.name.last),ue(()=>N.value=e.patientId?n.selectedPatient.data?.dateOfBirth:o.dateOfBirth?.value),ue(()=>j.value=o.phone?.value??n.selectedPatient.data?.phone),ue(()=>K.value=o.email?.value??n.selectedPatient.data?.email),w}}),null),M($,_(Fn,{get children(){var w=hfe(),x=w.firstChild,C=x.nextSibling,k=C.nextSibling,S=k.nextSibling,P=S.nextSibling,N=P.firstChild,j=N.nextSibling;return Ce(C,"photon-input-changed",async F=>{s.updateFormValue({key:"address_street1",value:F.detail.input})}),C._$owner=Se(),Ce(k,"photon-input-changed",async F=>{s.updateFormValue({key:"address_street2",value:F.detail.input})}),k.optional=!0,k._$owner=Se(),Ce(S,"photon-input-changed",async F=>{s.updateFormValue({key:"address_city",value:F.detail.input})}),S._$owner=Se(),Ce(N,"photon-state-selected",F=>{s.updateFormValue({key:"address_state",value:F.detail.state})}),N._$owner=Se(),Ce(j,"photon-input-changed",async F=>{s.updateFormValue({key:"address_zip",value:F.detail.input})}),j._$owner=Se(),ue(F=>{var W=o.address_street1?.error,J=o.address_street1?.error,U=o.address_street2?.error,G=o.address_street2?.error,H=o.address_city?.error,K=o.address_city?.error,ee=o.address_state?.error,we=o.address_state?.error!==void 0,me=o.state?.value??n.selectedPatient.data?.address?.state,re=o.address_zip?.error,X=o.address_zip?.error;return W!==F.e&&(C.invalid=F.e=W),J!==F.t&&(C.helpText=F.t=J),U!==F.a&&(k.invalid=F.a=U),G!==F.o&&(k.helpText=F.o=G),H!==F.i&&(S.invalid=F.i=H),K!==F.n&&(S.helpText=F.n=K),ee!==F.s&&(N.helpText=F.s=ee),we!==F.h&&(N.invalid=F.h=we),me!==F.r&&(N.selected=F.r=me),re!==F.d&&(j.invalid=F.d=re),X!==F.l&&(j.helpText=F.l=X),F},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),ue(()=>C.value=o.address_street1?.value??n.selectedPatient.data?.address?.street1),ue(()=>k.value=o.address_street2?.value??n.selectedPatient.data?.address?.street2),ue(()=>S.value=o.address_city?.value??n.selectedPatient.data?.address?.city),ue(()=>j.value=o.address_zip?.value??n.selectedPatient.data?.address?.postalCode),w}}),null),M($,_(Fn,{get children(){var w=ffe();return w.firstChild,M(w,_(Rx,{get address(){return mfe(n,o)},setPharmacy:x=>{s.updateFormValue({key:"preferredPharmacy",value:x.id})},get patientId(){return e.patientId},hidePreferred:!0}),null),w}}),null),$}})}}),null),c})()};ar("photon-patient-form",{patientId:""},vfe);const yfe=".input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}";var bfe=oe("<div><style></style><style>");const m5=[{id:"1",name:"AL"},{id:"2",name:"AK"},{id:"3",name:"AZ"},{id:"4",name:"AR"},{id:"5",name:"CA"},{id:"6",name:"CO"},{id:"7",name:"CT"},{id:"8",name:"DE"},{id:"9",name:"DC"},{id:"10",name:"FL"},{id:"11",name:"GA"},{id:"12",name:"HI"},{id:"13",name:"ID"},{id:"14",name:"IL"},{id:"15",name:"IN"},{id:"16",name:"IA"},{id:"17",name:"KS"},{id:"18",name:"KY"},{id:"19",name:"LA"},{id:"20",name:"ME"},{id:"21",name:"MD"},{id:"22",name:"MA"},{id:"23",name:"MI"},{id:"24",name:"MN"},{id:"25",name:"MS"},{id:"26",name:"MO"},{id:"27",name:"MT"},{id:"28",name:"NE"},{id:"29",name:"NV"},{id:"30",name:"NH"},{id:"31",name:"NJ"},{id:"32",name:"NM"},{id:"33",name:"NY"},{id:"34",name:"NC"},{id:"35",name:"ND"},{id:"36",name:"OH"},{id:"37",name:"OK"},{id:"38",name:"OR"},{id:"39",name:"PA"},{id:"40",name:"PR"},{id:"41",name:"RI"},{id:"42",name:"SC"},{id:"43",name:"SD"},{id:"44",name:"TN"},{id:"45",name:"TX"},{id:"46",name:"UT"},{id:"47",name:"VT"},{id:"48",name:"VA"},{id:"49",name:"WA"},{id:"50",name:"WV"},{id:"51",name:"WI"},{id:"52",name:"WY"}],$fe=e=>{const[t,r]=le("");let n;const i=o=>{const s=new CustomEvent("photon-state-selected",{composed:!0,bubbles:!0,detail:{state:o}});n?.dispatchEvent(s)},a=o=>o.length===0?m5:m5.filter(s=>s.name.toLowerCase().includes(o.toLowerCase()));return(()=>{var o=bfe(),s=o.firstChild,d=s.nextSibling;Ce(o,"photon-data-selected",h=>{i(h.detail.data.name)});var c=n;return typeof c=="function"?ot(c,o):n=o,M(s,_r),M(d,yfe),M(o,_(rl,{get data(){return a(t())},get label(){return e.label},get required(){return e.required},placeholder:"",get disabled(){return e.disabled},get invalid(){return e.invalid},isLoading:!1,hasMore:!1,displayAccessor:h=>h?.name||"",showOverflow:!0,onSearchChange:async h=>{r(h)},onHide:async()=>{r("")},noDataMsg:"",optional:!1,get helpText(){return e.helpText},get selectedData(){return m5.filter(h=>h.name===e.selected)?.[0]}}),null),o})()};ar("photon-state-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1,selected:void 0},$fe);var wfe=oe('<div class="text-black text-xl md:text-3xl">'),xfe=oe("<sl-icon>",!0,!1),_fe=oe('<div class="flex-1 flex justify-end">'),kfe=oe('<div class="fixed top-0 left-0 w-full h-screen z-10 overflow-y-scroll bg-[#F9FAFB]"><style></style><photon-dialog confirm-text="Yes, Close"cancel-text="Keep Editing"><p class="font-sans text-lg xs:text-base"></p></photon-dialog><header class="flex flex-col md:flex-row items-center px-4 py-2 md:px-8 md:py-3 bg-white fixed w-full z-10 shadow-card"><div class="flex justify-start md:flex-1 absolute md:static left-4"></div><div class="mb-2 md:mb-0 flex flex-0 md:flex-1 justify-center md:justify-center items-center"><p class="ml-1 font-sans text-sm md:text-xl font-medium"></p></div><div class="flex flex-col md:flex-row flex-1"></div></header><div class="overflow-y-scroll w-full min-h-screen bg-[#F9FAFB] pt-28 xs:pt-28 lg:pt-20"><div class="px-4 pb-40 md:pt-4 md:pb-52 md:px-4 w-full h-full sm:w-[600px] xs:mx-auto">',!0,!1);const $k=e=>{const t=ht({closeTitle:"Lose unsaved changes?",closeBody:"You will not be able to recover unsaved changes.",checkShouldWarn:()=>!1},e);let r;const[n,i]=le(!1),a=()=>{i(!1),t.onClosed()},o=()=>i(!1);return(()=>{var s=kfe(),d=s.firstChild,c=d.nextSibling,h=c.firstChild,f=c.nextSibling,p=f.firstChild,m=p.nextSibling,v=m.firstChild,$=m.nextSibling,w=f.nextSibling,x=w.firstChild,C=r;return typeof C=="function"?ot(C,s):r=s,M(d,_r),Ce(c,"photon-dialog-alt",o),Ce(c,"photon-dialog-canceled",o),Ce(c,"photon-dialog-confirmed",a),c._$owner=Se(),M(h,()=>t.closeBody),M(p,_(Ft,{variant:"naked",size:"sm",onClick:()=>{t.checkShouldWarn()?i(!0):t.onClosed()},get children(){var k=wfe();return M(k,_(It,{name:"xMark"})),k}})),M(m,_(fe,{get when(){return t.titleIconName},get children(){var k=xfe();return k._$owner=Se(),ue(()=>k.name=t.titleIconName),k}}),v),M(v,()=>t.title),M($,_(fe,{get when(){return t.headerRight},get children(){var k=_fe();return M(k,()=>t.headerRight),k}})),M(x,()=>t.form),ue(k=>{var S=t.closeTitle,P=n();return S!==k.e&&(c.label=k.e=S),P!==k.t&&(c.open=k.t=P),k},{e:void 0,t:void 0}),s})()};var Cfe=oe("<div><style>"),Sfe=oe('<div class="flex flex-row gap-1 lg:gap-2 justify-end items-end">'),Efe=oe('<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4"role=alert><span class="block sm:inline">'),Tfe=oe("<photon-patient-form slot=form>",!0,!1);const Afe=e=>{let t;const r=Bn(),[n,i]=le(!1),[a,o]=le(!1),[s,d]=le(void 0),[c,h]=le(void 0),[f,p]=le(void 0),[m,v]=le(void 0),$=(k,S=!1)=>{const P=new CustomEvent("photon-patient-updated",{composed:!0,bubbles:!0,detail:{patientId:k,createPrescription:S}});t?.dispatchEvent(P)},w=(k,S=!1)=>{const P=new CustomEvent("photon-patient-created",{composed:!0,bubbles:!0,detail:{patientId:k,createPrescription:S}});t?.dispatchEvent(P)},x=()=>{const k=new CustomEvent("photon-patient-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(k)},C=async(k,S,P,N=!1)=>{v(void 0),o(N),i(!0);let j=["firstName","lastName","dateOfBirth","phone","sex","email"];if(k.address_street1?.value!==void 0||k.address_city?.value!==void 0||k.address_state?.value!==void 0||k.address_zip?.value!==void 0)S.registerValidator({key:"address_street1",validator:qr(Ro(yi(),1,1/0),"Please enter a valid Street 1..")}),S.registerValidator({key:"address_city",validator:qr(Ro(yi(),1,1/0),"Please enter a valid City..")}),S.registerValidator({key:"address_state",validator:qr(Ro(yi(),2,2),"Please enter a valid State..")}),j=[...j,"address_zip","address_street1","address_city","address_state"];else{const W=["address_street1","address_city","address_state"];for(const J of W)S.unRegisterValidator(J)}if(S.validate(j),S.hasErrors(j))return i(!1),!0;k.preferredPharmacy.value&&P.selectedPatient.data?.preferredPharmacies&&P.selectedPatient.data?.preferredPharmacies.length!==0&&!P.selectedPatient.data?.preferredPharmacies?.map(W=>W?.id).filter(W=>W!==null).includes(k.preferredPharmacy.value)&&await r.getSDK().clinical.patient.removePatientPreferredPharmacy({})({variables:{patientId:e.patientId,pharmacyId:P.selectedPatient.data?.preferredPharmacies[0].id},awaitRefetchQueries:!1});const F={...e?.patientId?{id:e.patientId}:{},name:{first:k.firstName.value,last:k.lastName.value},gender:k.gender.value,email:k.email.value,phone:k.phone.value,dateOfBirth:k.dateOfBirth.value,sex:k.sex.value,address:k.address_street1.value!==void 0?{street1:k.address_street1.value,street2:k.address_street2.value,city:k.address_city.value,state:k.address_state.value,postalCode:k.address_zip.value,country:"US"}:void 0,preferredPharmacies:k.preferredPharmacy.value?[k.preferredPharmacy.value]:[]};try{if(e?.patientId)await r.getSDK().clinical.patient.updatePatient({})({variables:F,awaitRefetchQueries:!1}),$(e.patientId,N);else{const J=await r.getSDK().clinical.patient.createPatient({})({variables:F,awaitRefetchQueries:!1});w(J?.data?.createPatient?.id||"",N)}i(!1),S.resetStores(),e.open=!1}catch(W){i(!1),v(W?.message||"An error occurred while saving the patient.")}};return(()=>{var k=Cfe(),S=k.firstChild,P=t;return typeof P=="function"?ot(P,k):t=k,M(S,Ta),M(k,_(fe,{get when(){return e.open},get children(){return _($k,{onClosed:()=>{x(),f().resetStores(),e.open=!1},get title(){return e?.patientId?"Update Patient":"Create Patient"},get titleIconName(){return e?.patientId?"pencil-square":"person-plus"},get headerRight(){return(()=>{var N=Sfe();return M(N,_(fe,{get when(){return!e?.hideCreatePrescription},get children(){return _(Ft,{size:"sm",variant:"secondary",get disabled(){return n()},get loading(){return Z(()=>!!n())()&&a()},onClick:()=>C(s(),f(),c(),!0),children:"Save and Create Prescription"})}}),null),M(N,_(Ft,{size:"sm",get disabled(){return n()},get loading(){return Z(()=>!!n())()&&!a()},onClick:()=>C(s(),f(),c(),!1),children:"Save"}),null),N})()},get form(){return[_(fe,{get when(){return m()},get children(){var N=Efe(),j=N.firstChild;return M(j,m),N}}),(()=>{var N=Tfe();return Ce(N,"photon-form-updated",j=>{d(j.detail.form),p(Object.assign({},j.detail.actions,{resetStores:j.detail.reset})),h(j.detail.selected)}),N._$owner=Se(),ue(()=>N.patientId=e.patientId),N})()]}})}}),null),k})()};ar("photon-patient-dialog",{patientId:"",hideCreatePrescription:!1,open:!1},Afe);var Ofe=oe("<photon-patient-dialog>",!0,!1);const Pfe=e=>(console.warn("photon-update-patient-dialog will be deprecated soon. Please use photon-patient-dialog instead."),(()=>{var t=Ofe();return t._$owner=Se(),ue(r=>{var n=e.patientId,i=e.open;return n!==r.e&&(t.patientId=r.e=n),i!==r.t&&(t.open=r.t=i),r},{e:void 0,t:void 0}),t})());ar("photon-update-patient-dialog",{patientId:"",open:!1},Pfe);const Ife=".invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.input::part(base):hover{cursor:pointer}.disabled::part(base):hover{cursor:not-allowed}.selected::part(base){--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.default::part(base):hover{--tw-bg-opacity: 1;background-color:rgb(229,231,235,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity))}.default::part(label){width:100%;overflow:hidden}.group-member::part(base){padding-left:1rem;font-weight:500}.group{background:#d1e9ff;padding-top:.25rem;padding-bottom:.25rem;--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity));font-size:.75rem;font-weight:500}.treatment-option::part(checked-icon){display:none;width:0px}.full-screen-close-btn::part(base){padding:0}.treatment-search::part(input){padding-right:0}.treatment-search::part(input)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.treatment-search::part(input)::placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.dropdown::part(panel){box-shadow:none}";var Nfe=oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>',!0,!1),Dfe=oe('<div><style></style><style></style><style></style><style></style><div class="fixed top-0 left-0 w-full max-h-screen h-screen z-20 bg-white overflow-x-hidden"><div class="flex items-center pb-2 pl-5 pr-5 pt-3"><div class="flex items-center"><sl-icon-button name=x label="Close medication search"class=full-screen-close-btn></sl-icon-button></div></div><sl-input slot=trigger clearable autocomplete=off size=medium class="treatment-search input mb-2 px-4"><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div></sl-input><div class="w-full flex-1">',!0,!1),Mfe=oe('<div class="md:flex flex-1 justify-center items-center pl-2"><div class="flex items-center space-x-2"><p class="text-gray-700 text-sm font-sans inline font-medium">'),Lfe=oe('<p class="pl-1 text-red-400">*'),Rfe=oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'),Ffe=oe("<div class=px-4><p class=text-gray-400>Loading..."),zfe=oe("<div class=px-4><p class=text-gray-400>No treatments found"),jfe=oe('<div class="group uppercase px-4">'),Vfe=oe("<div class=treatment-option>"),Ufe=oe('<p class="text-center text-gray-400 italic px-3">Loading...'),Bfe=oe('<p class="text-center text-gray-400 italic px-3">Nothing more to load'),qfe=oe('<div class="px-4 py-1">');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const Hfe=e=>{let t,r,n;e.actionRef&&(e.actionRef.clear=()=>{n.value="",i(""),s()});const i=Gu(async h=>{e.onSearchChange&&await e.onSearchChange(h)},500),a=h=>{if(h)return e.helpText?e.helpText:e.required?"Please select data...":void 0},o=h=>{const f=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:h}});t?.dispatchEvent(f)},s=()=>{const h=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(h)};Vt(()=>{n&&(n.addEventListener("keydown",h=>{(h.code=="Space"||h.key==" ")&&h.stopImmediatePropagation()}),setTimeout(()=>{n.focus()},100))});const d=Z(()=>e.groups?e.groups.map(h=>{const f=e.data.map((p,m)=>({data:p,allItemsIdx:m})).filter(p=>h.filter(p.data));return f.length>0?[{title:h.label},...f]:[]}).flat():e.data.map((h,f)=>({data:h,allItemsIdx:f}))),c=Z(()=>Km({count:d().length,getScrollElement:()=>r??null,estimateSize:()=>42,overscan:100}));return(()=>{var h=Dfe(),f=h.firstChild,p=f.nextSibling,m=p.nextSibling,v=m.nextSibling,$=v.nextSibling,w=$.firstChild,x=w.firstChild,C=x.firstChild,k=w.nextSibling,S=k.firstChild,P=S.nextSibling,N=P.firstChild,j=k.nextSibling,F=t;typeof F=="function"?ot(F,h):t=h,M(f,_r),M(p,Hn),M(m,Wn),M(v,Ife),x.style.setProperty("font-size","26px"),Ce(C,"click",()=>{e.onClose&&e.onClose()}),C.style.setProperty("padding","0px"),C._$owner=Se(),M(w,(()=>{var U=Z(()=>!!e.label);return()=>U()?(()=>{var G=Mfe(),H=G.firstChild,K=H.firstChild;return M(K,()=>e.label),G})():null})(),null),M(w,(()=>{var U=Z(()=>!!e.required);return()=>U()?Lfe():null})(),null),M(w,(()=>{var U=Z(()=>!!e.optional);return()=>U()?Rfe():null})(),null),Ce(k,"sl-clear",()=>{n.value="",i(""),s()}),Ce(k,"input",U=>{i(U.target.value)});var W=n;typeof W=="function"?ot(W,k):n=k,k.style.setProperty("border-radius","0px"),k.style.setProperty("border","0px"),k._$owner=Se(),M(S,()=>a(e.invalid??!1)),N._$owner=Se(),M(k,_(fe,{get when(){return e.clearable},get children(){var U=Nfe(),G=U.firstChild;return Ce(G,"click",H=>{H.stopImmediatePropagation(),n.value="",i(""),s()}),G._$owner=Se(),ue(()=>U.classList.toggle("hidden",!!(e.isLoading||!e.selectedData))),U}}),null);var J=r;return typeof J=="function"?ot(J,j):r=j,M(j,_(ur,{get each(){return c().getVirtualItems()},get fallback(){return _(Wfe,{get isLoading(){return e.isLoading}})},children:U=>{const G=U.index>d().length-1,H=d()[U.index],K=e.selectedData,ee=!G&&!!K&&"id"in K&&"data"in H&&K.id===H.data.id,we="title"in H?Qfe:Gfe,me="title"in H?{item:H}:{item:U,isLoader:G,isSelected:ee,index:U.index,hasMore:e.hasMore,showOverflow:e.showOverflow,onClick:()=>{G||(n.value="",i(""),o(H.data),e.onClose&&e.onClose())}};return _(XP,ht({component:we},me,{get children(){return Z(()=>"data"in H)()&&e.displayAccessor(H.data,!0)}}))}})),ue(U=>{var G=e.placeholder,H=e.disabled??!1,K=!!(e.invalid??!1),ee=!!(e.disabled??!1),we=e.required,me=!!e.forceLabelSize,re=!e.isLoading;return G!==U.e&&(k.placeholder=U.e=G),H!==U.t&&(k.disabled=U.t=H),K!==U.a&&k.classList.toggle("invalid",U.a=K),ee!==U.o&&k.classList.toggle("disabled",U.o=ee),we!==U.i&&(k.required=U.i=we),me!==U.n&&S.classList.toggle("h-[21px]",U.n=me),re!==U.s&&P.classList.toggle("hidden",U.s=re),U},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),ue(()=>k.value=e.searchText),h})()},Wfe=e=>_(fe,{get when(){return e.isLoading},get fallback(){return zfe()},get children(){return Ffe()}}),Qfe=e=>(()=>{var t=jfe();return t.style.setProperty("position","sticky"),t.style.setProperty("top","0px"),t.style.setProperty("z-index","10"),M(t,()=>e.item.title),t})(),Gfe=e=>(()=>{var t=Vfe();return t.$$click=()=>e.onClick(),M(t,(()=>{var r=Z(()=>!!e.isLoader);return()=>r()?(()=>{var n=Z(()=>!!e.hasMore);return()=>n()?Ufe():Bfe()})():(()=>{var n=qfe();return M(n,()=>e.children),n})()})()),ue(r=>{var n=!!e.isSelected,i=!!e.isSelected;return n!==r.e&&t.classList.toggle("bg-blue-500",r.e=n),i!==r.t&&t.classList.toggle("text-white",r.t=i),r},{e:void 0,t:void 0}),t})();Js(["click"]);const Kfe=".invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.input::part(base):hover{cursor:pointer}.input::part(input){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disabled::part(base):hover{cursor:not-allowed}.selected::part(base){--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.default::part(base):hover{--tw-bg-opacity: 1;background-color:rgb(229,231,235,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity))}.default::part(label){width:100%;overflow:hidden}.group-member::part(base){padding-left:1rem;font-weight:500}.group::part(base){background:#d1e9ff;padding-top:.25rem;padding-bottom:.25rem;--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity));font-size:.75rem;font-weight:600}.dropdown::part(panel){border-radius:var(--photon-border-radius, .5rem)}.dropdown-container{border-radius:var(--photon-border-radius, .5rem)}.group::part(checked-icon){display:none;width:0px}.group::part(label){padding-left:12px;padding-right:12px}.treatment-option::part(checked-icon){display:none;width:0px}";var Yfe=oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>',!0,!1),Zfe=oe('<div><style></style><style></style><style></style><style></style><sl-dropdown class="dropdown relative"hoist><sl-input clearable slot=trigger autocomplete=off size=medium class=input><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div><div slot=suffix class=flex><sl-icon></sl-icon></div></sl-input><div class="border border-gray-200 dropdown-container overflow-hidden relative"><div class="bg-white overflow-x-hidden overflow-y-auto relative"><div>',!0,!1),Xfe=oe('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm font-sans">'),Jfe=oe('<p class="pl-1 text-red-400">*'),epe=oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'),tpe=oe('<sl-menu-item><p class="text-center text-gray-400 italic">Loading...',!0,!1),rpe=oe("<sl-menu-item>",!0,!1),npe=oe('<sl-menu-item class="group uppercase">',!0,!1),ipe=oe("<sl-menu-item class=treatment-option>",!0,!1),ape=oe('<p class="text-center text-gray-400 italic">Loading...'),ope=oe('<p class="text-center text-gray-400 italic">Nothing more to load'),spe=oe('<p class="break-words px-3">');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const lpe=e=>{let t,r,n,i,a;e.actionRef&&(e.actionRef.clear=()=>{c(void 0),f(-1),i.value="",v(""),C()});const[o,s]=le(!1),[d,c]=le(void 0),[h,f]=le(-1),[p,m]=le(),v=Gu(async P=>{e.onSearchChange&&await e.onSearchChange(P)},250),$=new IntersectionObserver(async P=>{P?.at(-1)?.isIntersecting&&e.hasMore&&e.fetchMore&&await e.fetchMore()});Re(()=>{e.data.length===0&&c(void 0)}),Re(()=>{p()&&$.observe(p())});const w=P=>{if(P)return e.helpText?e.helpText:e.required?"Please select data...":void 0},x=P=>{const N=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:P}});t?.dispatchEvent(N)},C=()=>{const P=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(P)};Re(()=>{e.selectedData&&(c(e.selectedData),x(e.selectedData)),e.selectedData===void 0&&c(void 0)}),Vt(()=>{i&&i.addEventListener("keydown",P=>{(P.code=="Space"||P.key==" ")&&P.stopImmediatePropagation()})});const k=Z(()=>e.groups?e.groups.map(P=>{const N=e.data.map((j,F)=>({data:j,allItemsIdx:F})).filter(j=>P.filter(j.data));return N.length>0?[{title:P.label},...N]:[]}).flat():e.data.map((P,N)=>({data:P,allItemsIdx:N}))),S=Z(()=>Km({count:k().length,getScrollElement:()=>n??null,estimateSize:()=>36.8,overscan:100}));return(()=>{var P=Zfe(),N=P.firstChild,j=N.nextSibling,F=j.nextSibling,W=F.nextSibling,J=W.nextSibling,U=J.firstChild,G=U.firstChild,H=G.nextSibling,K=H.firstChild,ee=H.nextSibling,we=ee.firstChild,me=U.nextSibling,re=me.firstChild,X=re.firstChild,ne=t;typeof ne=="function"?ot(ne,P):t=P,M(N,_r),M(j,Hn),M(F,Wn),M(W,Kfe),M(P,(()=>{var pe=Z(()=>!!e.label);return()=>pe()?(()=>{var ve=Xfe(),Le=ve.firstChild;return M(Le,()=>e.label),M(ve,(()=>{var Ke=Z(()=>!!e.required);return()=>Ke()?Jfe():null})(),null),M(ve,(()=>{var Ke=Z(()=>!!e.optional);return()=>Ke()?epe():null})(),null),ve})():null})(),J),Ce(J,"sl-show",async()=>{s(!0),e.onOpen&&await e.onOpen()}),Ce(J,"sl-hide",async()=>{d()||(i.value="",e.onHide&&await e.onHide()),s(!1)});var ke=r;typeof ke=="function"?ot(ke,J):r=J,J.style.setProperty("width","100%"),J._$owner=Se(),Ce(U,"sl-clear",()=>{c(void 0),f(-1),i.value="",v(""),C()}),Ce(U,"sl-focus",pe=>{e.onInputFocus?(e.onInputFocus(),pe.stopImmediatePropagation()):(r.children[1].style.width=`${i.clientWidth}px`,h()>0&&S().scrollToIndex(h()))}),Ce(U,"sl-input",pe=>{o()||r.show(),v(pe.target.value)});var ie=i;typeof ie=="function"?ot(ie,U):i=U,U._$owner=Se(),M(G,()=>w(e.invalid??!1)),K._$owner=Se(),M(U,_(fe,{get when(){return e.clearable},get children(){var pe=Yfe(),ve=pe.firstChild;return Ce(ve,"click",Le=>{Le.stopImmediatePropagation(),c(void 0),f(-1),i.value="",v(""),C(),r.hide()}),ve._$owner=Se(),ue(()=>pe.classList.toggle("hidden",!!(e.isLoading||d()==null))),pe}}),ee),we._$owner=Se(),me.style.setProperty("width","518px");var Ae=a;typeof Ae=="function"?ot(Ae,re):a=re,re.style.setProperty("max-height","500px"),re.style.setProperty("min-height","37px"),re.style.setProperty("width","100%"),re.style.setProperty("display","flex"),re.style.setProperty("flex-direction","column"),re.style.setProperty("justify-content","start");var Ie=n;return typeof Ie=="function"?ot(Ie,X):n=X,X.style.setProperty("width","100%"),M(X,_(ur,{get each(){return S().getVirtualItems()},get fallback(){return _(dpe,{get noDataMsg(){return e.noDataMsg},get isLoading(){return e.isLoading}})},children:pe=>{const ve=pe.index>k().length-1,Le=k()[pe.index],Ke=d(),Oe=!ve&&!!Ke&&"id"in Ke&&"data"in Le&&Ke.id===Le.data.id;return _(e2,{get children(){return[_(Ri,{get when(){return"title"in Le},get children(){return _(cpe,{item:Le})}}),_(Ri,{get when(){return"data"in Le},get children(){return _(upe,{item:pe,isLoader:ve,isSelected:Oe,get index(){return pe.index},get hasMore(){return e.hasMore},get showOverflow(){return e.showOverflow},onClick:()=>{ve||(c(Le.data),f(Le.allItemsIdx),x(Le.data),r.hide())},setLastIndex:m,get children(){return e.displayAccessor(Le.data,!0)}})}})]}})}})),ue(pe=>{var ve=e.forceLabelSize&&!e.invalid?-20:e.invalid?-18:0,Le=e.disabled??!1,Ke=e.placeholder??void 0,Oe=e.disabled??!1,it=!!(e.invalid??!1),at=!!(e.disabled??!1),Lt=!d()&&i.value==="",Pe=e.required,de=!!e.forceLabelSize,He=!e.isLoading,et=!!e.isLoading,yt=o()?"chevron-up":"chevron-down",bt=`${S().getTotalSize()}px`;return ve!==pe.e&&(J.distance=pe.e=ve),Le!==pe.t&&(J.disabled=pe.t=Le),Ke!==pe.a&&(U.placeholder=pe.a=Ke),Oe!==pe.o&&(U.disabled=pe.o=Oe),it!==pe.i&&U.classList.toggle("invalid",pe.i=it),at!==pe.n&&U.classList.toggle("disabled",pe.n=at),Lt!==pe.s&&U.classList.toggle("placeholder",pe.s=Lt),Pe!==pe.h&&(U.required=pe.h=Pe),de!==pe.r&&G.classList.toggle("h-[21px]",pe.r=de),He!==pe.d&&H.classList.toggle("hidden",pe.d=He),et!==pe.l&&ee.classList.toggle("hidden",pe.l=et),yt!==pe.u&&(we.name=pe.u=yt),bt!==pe.c&&((pe.c=bt)!=null?X.style.setProperty("height",bt):X.style.removeProperty("height")),pe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),ue(()=>U.value=e.searchText),P})()},dpe=e=>_(fe,{get when(){return e.isLoading},get fallback(){return(()=>{var t=rpe();return t._$owner=Se(),M(t,()=>e.noDataMsg?e.noDataMsg:"No data found"),t})()},get children(){var t=tpe();return t._$owner=Se(),t}}),cpe=e=>(()=>{var t=npe();return t._$owner=Se(),M(t,()=>e.item.title),t})(),upe=e=>(()=>{var t=ipe();return ot(r=>{e.isLoader&&e.index>0&&e.setLastIndex(r)},t),t.$$click=()=>e.onClick(),t.style.setProperty("width","100%"),t.style.setProperty("white-space","normal"),t._$owner=Se(),M(t,(()=>{var r=Z(()=>!!e.isLoader);return()=>r()?(()=>{var n=Z(()=>!!e.hasMore);return()=>n()?ape():ope()})():(()=>{var n=spe();return M(n,()=>e.children),ue(i=>{var a=!e.showOverflow,o=!e.showOverflow,s=!e.showOverflow,d=!!e.showOverflow;return a!==i.e&&n.classList.toggle("overflow-hidden",i.e=a),o!==i.t&&n.classList.toggle("overflow-ellipsis",i.t=o),s!==i.a&&n.classList.toggle("whitespace-nowrap",i.a=s),d!==i.o&&n.classList.toggle("whitespace-normal",i.o=d),i},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})()),ue(r=>{var n=!!e.isSelected,i=`${e.item.size}px`;return n!==r.e&&t.classList.toggle("selected",r.e=n),i!==r.t&&((r.t=i)!=null?t.style.setProperty("min-height",i):t.style.removeProperty("min-height")),r},{e:void 0,t:void 0}),t})();Js(["click"]);var hpe=oe("<strong class=font-extrabold>"),fpe=oe('<p class="text-sm whitespace-normal leading-snug my-1">'),ppe=oe('<div class=my-1><div class="text-sm whitespace-normal font-medium mb-1"></div><div class="text-xs text-gray-500 truncate"> <!>, <!> <!> supply, <!> <!>, '),gpe=oe("<span class=text-blue-600>(<!>): "),mpe=oe("<div>");function sv(e,t,r){const n=new CustomEvent(t,{composed:!0,bubbles:!0,detail:r});e?.dispatchEvent(n)}function vpe(e,t,r){sv(e,"photon-treatment-selected",{data:t,catalogId:r})}function ype(e){sv(e,"photon-treatment-unselected")}function Mi(e,t){sv(e,"photon-search-text-changed",{text:t})}const bpe=Me`
4247
+ `,lfe=()=>{const[e,t]=es({pharmacies:{data:[],address:void 0,errors:[],isLoading:!1},selectedPharmacy:{data:void 0,errors:[],isLoading:!1},preferredPharmacies:{data:void 0,errors:[],isLoading:!1}}),r=async(c,h,f,p)=>{try{const m=await h.geocode({address:f}),v=m.results[0].geometry.location.lat(),$=m.results[0].geometry.location.lng(),w=m.results[0].formatted_address;if(w&&t("pharmacies",{...e.pharmacies,address:w,errors:[]}),!v||!$){t("pharmacies",{...e.pharmacies,errors:[new Error("An unexpected error occured")]});return}await n(c,{name:p,location:{latitude:v,longitude:$}})}catch(m){console.log("ERR",m),t("pharmacies",{...e.pharmacies,errors:[new Error("The provided address seems invalid. Please revise and try again.")]})}},n=async(c,h)=>{t("pharmacies",{...e.pharmacies,isLoading:!0});const{data:f,errors:p}=await c.clinical.pharmacy.getPharmacies({name:h.name,location:h.location,first:h.first,type:"PICK_UP"});t("pharmacies",{...e.pharmacies,isLoading:!1,data:f.pharmacies,errors:p})};return{store:e,actions:{getPharmacies:n,getPharmaciesByAddress:r,getPharmacy:async(c,h)=>{t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!0});const{data:f,errors:p}=await c.clinical.pharmacy.getPharmacy({id:h});(e.pharmacies.errors||[]).filter(m=>m.message.includes("seems invalid")||m.message.includes("unexpected error")).length>0&&t("pharmacies",{...e.pharmacies,errors:[]}),t("selectedPharmacy",{...e.selectedPharmacy,isLoading:!1,data:f.pharmacy,errors:p})},clearSelectedPharmacy:()=>{t("selectedPharmacy",{...e.selectedPharmacy,data:void 0,errors:[]})},getPreferredPharmacies:async(c,h)=>{t("preferredPharmacies",{...e.preferredPharmacies,isLoading:!0});const{data:f,errors:p}=await c.clinical.patient.getPatient({id:h,fragment:{PatientPharmacyFields:sfe}});t("preferredPharmacies",{...e.selectedPharmacy,isLoading:!1,data:f.patient.preferredPharmacies?.map(m=>m),errors:p})},clearPreferredPharmacies:()=>{t("preferredPharmacies",{...e.selectedPharmacy,data:[],errors:[]})},reset:async()=>{t("pharmacies",{data:[],errors:[],address:void 0,isLoading:!1}),t("selectedPharmacy",{data:void 0,errors:[],isLoading:!1}),t("preferredPharmacies",{data:void 0,errors:[],isLoading:!1})}}}},dfe=lfe();var cfe=oe('<div class="w-full flex justify-center">'),ufe=oe('<div><p class="font-sans text-lg flex-grow">Personal</p><div class="flex flex-col xs:flex-row xs:gap-4"><photon-text-input class="flex-grow min-w-[40%]"debounce-time=0 label="First Name"></photon-text-input><photon-text-input class=min-w-[48%] debounce-time=0 label="Last Name"></photon-text-input></div><div class="flex flex-col xs:flex-row items-center xs:gap-4"><photon-datepicker no-initial-date=true class="flex-grow w-full xs:min-w-[40%]"label="Date of Birth"></photon-datepicker><photon-phone-input class="w-full xs:min-w-[48%]"label="Mobile Number"></photon-phone-input></div><div class="flex flex-col xs:flex-row justify-between xs:gap-4"><div class="flex-grow w-full xs:min-w-[40%]"><photon-gender-input label=Gender required=false></photon-gender-input></div><div class="flex-grow w-full xs:min-w-[40%]"><photon-sex-input label="Sex at Birth"required=false></photon-sex-input></div></div><div class=mt-2><photon-text-input debounce-time=0 label=Email>',!0,!1),hfe=oe('<div><p class="font-sans text-lg flex-grow">Address</p><photon-text-input debounce-time=0 label="Street 1"></photon-text-input><photon-text-input debounce-time=0 label="Street 2"></photon-text-input><photon-text-input debounce-time=0 label=City></photon-text-input><div class="flex gap-4 pb-5 xs:pb-2"><photon-state-input class="flex-grow min-w-[40%]"label=State required=false></photon-state-input><photon-text-input debounce-time=0 class="flex-grow min-w-[40%]"label="Zip Code">',!0,!1),ffe=oe('<div><p class="font-sans text-lg flex-grow">Preferred Local Pharmacy'),pfe=oe('<div class="flex flex-col gap-8">'),gfe=oe('<div class="w-full h-full relative"><style></style><style></style><style></style><style>');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const mfe=(e,t)=>{const r=e.selectedPatient.data?.address;return t.address_zip?.value&&Oae(t.address_zip?.value)&&t.address_zip?.value!=r?.postalCode?t.address_zip?.value:r?`${r.street1} ${r.street2??""} ${r.city}, ${r.state} ${r.postalCode}`:""},vfe=e=>{let t;const r=Bn(),{store:n,actions:i}=M2,{actions:a}=dfe,{store:o,actions:s}=D_({firstName:void 0,lastName:void 0,dateOfBirth:void 0,phone:void 0,gender:void 0,sex:void 0,email:void 0,address_street1:void 0,address_street2:void 0,address_city:void 0,address_state:void 0,address_zip:void 0,preferredPharmacy:void 0});s.registerValidator({key:"firstName",validator:qr(Ro(yi(),1,1/0),"Please enter a first name.")}),s.registerValidator({key:"lastName",validator:qr(Ro(yi(),1,1/0),"Please enter a last name.")}),s.registerValidator({key:"dateOfBirth",validator:qr(i5([iue,s5()]),"Please enter a valid date of birth.")}),s.registerValidator({key:"sex",validator:qr(Wle(Ag.map(c=>c.name)),"Please enter Sex at Birth.")}),s.registerValidator({key:"phone",validator:qr(Ro(yi(),12),"Please enter a valid mobile number.")}),s.registerValidator({key:"email",validator:qr(i5([sue(),s5()]),"Please enter a valid email.")}),s.registerValidator({key:"address_zip",validator:qr(i5([oue(),s5()]),"Please enter a valid zip code...")}),Vt(()=>{e.patientId?i.getSelectedPatient(r.getSDK(),e.patientId):i.clearSelectedPatient()});const d=c=>{const h=new CustomEvent("photon-form-updated",{composed:!0,bubbles:!0,detail:{form:c,actions:s,selected:n,reset:()=>{s.reset(),i.reset(),a.reset()}}});t?.dispatchEvent(h)};return Re(()=>{n.selectedPatient.data&&(s.updateFormValue({key:"firstName",value:n.selectedPatient.data.name.first}),s.updateFormValue({key:"lastName",value:n.selectedPatient.data.name.last}),s.updateFormValue({key:"phone",value:n.selectedPatient.data.phone}),s.updateFormValue({key:"gender",value:n.selectedPatient.data.gender}),s.updateFormValue({key:"sex",value:n.selectedPatient.data.sex}),s.updateFormValue({key:"email",value:n.selectedPatient.data.email}),s.updateFormValue({key:"address_street1",value:n.selectedPatient.data.address?.street1}),s.updateFormValue({key:"address_street2",value:n.selectedPatient.data.address?.street2}),s.updateFormValue({key:"address_city",value:n.selectedPatient.data.address?.city}),s.updateFormValue({key:"address_state",value:n.selectedPatient.data.address?.state}),s.updateFormValue({key:"address_zip",value:n.selectedPatient.data.address?.postalCode}),s.updateFormValue({key:"preferredPharmacy",value:n.selectedPatient.data.preferredPharmacies?.[0]?.id}))}),Re(()=>{d(o)}),Sn(()=>{i.clearSelectedPatient(),s.reset()}),(()=>{var c=gfe(),h=c.firstChild,f=h.nextSibling,p=f.nextSibling,m=p.nextSibling,v=t;return typeof v=="function"?ot(v,c):t=c,M(h,_r),M(f,Hn),M(p,Wn),M(m,Ta),M(c,_(fe,{get when(){return n.selectedPatient.isLoading},get children(){var $=cfe();return M($,_(oo,{color:"green"})),$}}),null),M(c,_(fe,{get when(){return!n.selectedPatient.isLoading},get children(){return _(L_,{permissions:["write:patient"],get children(){var $=pfe();return M($,_(Fn,{get children(){var w=ufe(),x=w.firstChild,C=x.nextSibling,k=C.firstChild,S=k.nextSibling,P=C.nextSibling,N=P.firstChild,j=N.nextSibling,F=P.nextSibling,W=F.firstChild,J=W.firstChild,U=W.nextSibling,G=U.firstChild,H=F.nextSibling,K=H.firstChild;return Ce(k,"photon-input-changed",async ee=>{s.updateFormValue({key:"firstName",value:ee.detail.input})}),k._$owner=Se(),Ce(S,"photon-input-changed",async ee=>{s.updateFormValue({key:"lastName",value:ee.detail.input})}),S._$owner=Se(),Ce(N,"photon-datepicker-selected",async ee=>{s.updateFormValue({key:"dateOfBirth",value:ee.detail.date})}),N._$owner=Se(),Ce(j,"photon-phone-changed",async ee=>{s.updateFormValue({key:"phone",value:ee.detail.phone})}),j._$owner=Se(),Ce(J,"photon-gender-deselected",()=>{s.updateFormValue({key:"gender",value:void 0})}),Ce(J,"photon-gender-selected",ee=>{s.updateFormValue({key:"gender",value:ee.detail.gender})}),J._$owner=Se(),Ce(G,"photon-sex-deselected",()=>{s.updateFormValue({key:"sex",value:void 0})}),Ce(G,"photon-sex-selected",ee=>{s.updateFormValue({key:"sex",value:ee.detail.sex})}),G._$owner=Se(),Ce(K,"photon-input-changed",async ee=>{s.updateFormValue({key:"email",value:ee.detail.input})}),K._$owner=Se(),ue(ee=>{var we=o.firstName?.error,me=o.firstName?.error,re=o.lastName?.error,X=o.lastName?.error,ne=o.dateOfBirth?.error,ke=o.dateOfBirth?.error,ie=o.phone?.error,Ae=o.phone?.error,Ie=o.gender?.error,pe=o.gender?.error!==void 0,ve=n.selectedPatient.data?.gender,Le=o.sex?.error,Ke=o.sex?.error!==void 0,Oe=n.selectedPatient.data?.sex,it=o.email?.error,at=o.email?.error;return we!==ee.e&&(k.invalid=ee.e=we),me!==ee.t&&(k.helpText=ee.t=me),re!==ee.a&&(S.invalid=ee.a=re),X!==ee.o&&(S.helpText=ee.o=X),ne!==ee.i&&(N.invalid=ee.i=ne),ke!==ee.n&&(N.helpText=ee.n=ke),ie!==ee.s&&(j.invalid=ee.s=ie),Ae!==ee.h&&(j.helpText=ee.h=Ae),Ie!==ee.r&&(J.helpText=ee.r=Ie),pe!==ee.d&&(J.invalid=ee.d=pe),ve!==ee.l&&(J.selected=ee.l=ve),Le!==ee.u&&(G.helpText=ee.u=Le),Ke!==ee.c&&(G.invalid=ee.c=Ke),Oe!==ee.w&&(G.selected=ee.w=Oe),it!==ee.m&&(K.invalid=ee.m=it),at!==ee.f&&(K.helpText=ee.f=at),ee},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0,w:void 0,m:void 0,f:void 0}),ue(()=>k.value=o.firstName?.value??n.selectedPatient.data?.name.first),ue(()=>S.value=o.lastName?.value??n.selectedPatient.data?.name.last),ue(()=>N.value=e.patientId?n.selectedPatient.data?.dateOfBirth:o.dateOfBirth?.value),ue(()=>j.value=o.phone?.value??n.selectedPatient.data?.phone),ue(()=>K.value=o.email?.value??n.selectedPatient.data?.email),w}}),null),M($,_(Fn,{get children(){var w=hfe(),x=w.firstChild,C=x.nextSibling,k=C.nextSibling,S=k.nextSibling,P=S.nextSibling,N=P.firstChild,j=N.nextSibling;return Ce(C,"photon-input-changed",async F=>{s.updateFormValue({key:"address_street1",value:F.detail.input})}),C._$owner=Se(),Ce(k,"photon-input-changed",async F=>{s.updateFormValue({key:"address_street2",value:F.detail.input})}),k.optional=!0,k._$owner=Se(),Ce(S,"photon-input-changed",async F=>{s.updateFormValue({key:"address_city",value:F.detail.input})}),S._$owner=Se(),Ce(N,"photon-state-selected",F=>{s.updateFormValue({key:"address_state",value:F.detail.state})}),N._$owner=Se(),Ce(j,"photon-input-changed",async F=>{s.updateFormValue({key:"address_zip",value:F.detail.input})}),j._$owner=Se(),ue(F=>{var W=o.address_street1?.error,J=o.address_street1?.error,U=o.address_street2?.error,G=o.address_street2?.error,H=o.address_city?.error,K=o.address_city?.error,ee=o.address_state?.error,we=o.address_state?.error!==void 0,me=o.state?.value??n.selectedPatient.data?.address?.state,re=o.address_zip?.error,X=o.address_zip?.error;return W!==F.e&&(C.invalid=F.e=W),J!==F.t&&(C.helpText=F.t=J),U!==F.a&&(k.invalid=F.a=U),G!==F.o&&(k.helpText=F.o=G),H!==F.i&&(S.invalid=F.i=H),K!==F.n&&(S.helpText=F.n=K),ee!==F.s&&(N.helpText=F.s=ee),we!==F.h&&(N.invalid=F.h=we),me!==F.r&&(N.selected=F.r=me),re!==F.d&&(j.invalid=F.d=re),X!==F.l&&(j.helpText=F.l=X),F},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0}),ue(()=>C.value=o.address_street1?.value??n.selectedPatient.data?.address?.street1),ue(()=>k.value=o.address_street2?.value??n.selectedPatient.data?.address?.street2),ue(()=>S.value=o.address_city?.value??n.selectedPatient.data?.address?.city),ue(()=>j.value=o.address_zip?.value??n.selectedPatient.data?.address?.postalCode),w}}),null),M($,_(Fn,{get children(){var w=ffe();return w.firstChild,M(w,_(Rx,{get address(){return mfe(n,o)},setPharmacy:x=>{s.updateFormValue({key:"preferredPharmacy",value:x.id})},get patientId(){return e.patientId},hidePreferred:!0}),null),w}}),null),$}})}}),null),c})()};ar("photon-patient-form",{patientId:""},vfe);const yfe=".input::part(base){border-radius:var(--photon-border-radius, .5rem)}.invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.invalid::part(form-control-help-text){--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}";var bfe=oe("<div><style></style><style>");const m5=[{id:"1",name:"AL"},{id:"2",name:"AK"},{id:"3",name:"AZ"},{id:"4",name:"AR"},{id:"5",name:"CA"},{id:"6",name:"CO"},{id:"7",name:"CT"},{id:"8",name:"DE"},{id:"9",name:"DC"},{id:"10",name:"FL"},{id:"11",name:"GA"},{id:"12",name:"HI"},{id:"13",name:"ID"},{id:"14",name:"IL"},{id:"15",name:"IN"},{id:"16",name:"IA"},{id:"17",name:"KS"},{id:"18",name:"KY"},{id:"19",name:"LA"},{id:"20",name:"ME"},{id:"21",name:"MD"},{id:"22",name:"MA"},{id:"23",name:"MI"},{id:"24",name:"MN"},{id:"25",name:"MS"},{id:"26",name:"MO"},{id:"27",name:"MT"},{id:"28",name:"NE"},{id:"29",name:"NV"},{id:"30",name:"NH"},{id:"31",name:"NJ"},{id:"32",name:"NM"},{id:"33",name:"NY"},{id:"34",name:"NC"},{id:"35",name:"ND"},{id:"36",name:"OH"},{id:"37",name:"OK"},{id:"38",name:"OR"},{id:"39",name:"PA"},{id:"40",name:"PR"},{id:"41",name:"RI"},{id:"42",name:"SC"},{id:"43",name:"SD"},{id:"44",name:"TN"},{id:"45",name:"TX"},{id:"46",name:"UT"},{id:"47",name:"VT"},{id:"48",name:"VA"},{id:"49",name:"WA"},{id:"50",name:"WV"},{id:"51",name:"WI"},{id:"52",name:"WY"}],$fe=e=>{const[t,r]=le("");let n;const i=o=>{const s=new CustomEvent("photon-state-selected",{composed:!0,bubbles:!0,detail:{state:o}});n?.dispatchEvent(s)},a=o=>o.length===0?m5:m5.filter(s=>s.name.toLowerCase().includes(o.toLowerCase()));return(()=>{var o=bfe(),s=o.firstChild,d=s.nextSibling;Ce(o,"photon-data-selected",h=>{i(h.detail.data.name)});var c=n;return typeof c=="function"?ot(c,o):n=o,M(s,_r),M(d,yfe),M(o,_(rl,{get data(){return a(t())},get label(){return e.label},get required(){return e.required},placeholder:"",get disabled(){return e.disabled},get invalid(){return e.invalid},isLoading:!1,hasMore:!1,displayAccessor:h=>h?.name||"",showOverflow:!0,onSearchChange:async h=>{r(h)},onHide:async()=>{r("")},noDataMsg:"",optional:!1,get helpText(){return e.helpText},get selectedData(){return m5.filter(h=>h.name===e.selected)?.[0]}}),null),o})()};ar("photon-state-input",{label:void 0,required:!1,value:void 0,invalid:!1,helpText:void 0,disabled:!1,selected:void 0},$fe);var wfe=oe('<div class="text-black text-xl md:text-3xl">'),xfe=oe("<sl-icon>",!0,!1),_fe=oe('<div class="flex-1 flex justify-end">'),kfe=oe('<div class="fixed top-0 left-0 w-full h-screen z-10 overflow-y-scroll bg-[#F9FAFB]"><style></style><photon-dialog confirm-text="Yes, Close"cancel-text="Keep Editing"><p class="font-sans text-lg xs:text-base"></p></photon-dialog><header class="flex flex-col md:flex-row items-center px-4 py-2 md:px-8 md:py-3 bg-white fixed w-full shadow-card z-1000"><div class="flex justify-start md:flex-1 absolute md:static left-4"></div><div class="mb-2 md:mb-0 flex flex-0 md:flex-1 justify-center md:justify-center items-center"><p class="ml-1 font-sans text-sm md:text-xl font-medium"></p></div><div class="flex flex-col md:flex-row flex-1"></div></header><div class="overflow-y-scroll w-full min-h-screen bg-[#F9FAFB] pt-28 xs:pt-28 lg:pt-20"><div class="px-4 pb-40 md:pt-4 md:pb-52 md:px-4 w-full h-full sm:w-[600px] xs:mx-auto">',!0,!1);const $k=e=>{const t=ht({closeTitle:"Lose unsaved changes?",closeBody:"You will not be able to recover unsaved changes.",checkShouldWarn:()=>!1},e);let r;const[n,i]=le(!1),a=()=>{i(!1),t.onClosed()},o=()=>i(!1);return(()=>{var s=kfe(),d=s.firstChild,c=d.nextSibling,h=c.firstChild,f=c.nextSibling,p=f.firstChild,m=p.nextSibling,v=m.firstChild,$=m.nextSibling,w=f.nextSibling,x=w.firstChild,C=r;return typeof C=="function"?ot(C,s):r=s,M(d,_r),Ce(c,"photon-dialog-alt",o),Ce(c,"photon-dialog-canceled",o),Ce(c,"photon-dialog-confirmed",a),c._$owner=Se(),M(h,()=>t.closeBody),M(p,_(Ft,{variant:"naked",size:"sm",onClick:()=>{t.checkShouldWarn()?i(!0):t.onClosed()},get children(){var k=wfe();return M(k,_(It,{name:"xMark"})),k}})),M(m,_(fe,{get when(){return t.titleIconName},get children(){var k=xfe();return k._$owner=Se(),ue(()=>k.name=t.titleIconName),k}}),v),M(v,()=>t.title),M($,_(fe,{get when(){return t.headerRight},get children(){var k=_fe();return M(k,()=>t.headerRight),k}})),M(x,()=>t.form),ue(k=>{var S=t.closeTitle,P=n();return S!==k.e&&(c.label=k.e=S),P!==k.t&&(c.open=k.t=P),k},{e:void 0,t:void 0}),s})()};var Cfe=oe("<div><style>"),Sfe=oe('<div class="flex flex-row gap-1 lg:gap-2 justify-end items-end">'),Efe=oe('<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative mb-4"role=alert><span class="block sm:inline">'),Tfe=oe("<photon-patient-form slot=form>",!0,!1);const Afe=e=>{let t;const r=Bn(),[n,i]=le(!1),[a,o]=le(!1),[s,d]=le(void 0),[c,h]=le(void 0),[f,p]=le(void 0),[m,v]=le(void 0),$=(k,S=!1)=>{const P=new CustomEvent("photon-patient-updated",{composed:!0,bubbles:!0,detail:{patientId:k,createPrescription:S}});t?.dispatchEvent(P)},w=(k,S=!1)=>{const P=new CustomEvent("photon-patient-created",{composed:!0,bubbles:!0,detail:{patientId:k,createPrescription:S}});t?.dispatchEvent(P)},x=()=>{const k=new CustomEvent("photon-patient-closed",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(k)},C=async(k,S,P,N=!1)=>{v(void 0),o(N),i(!0);let j=["firstName","lastName","dateOfBirth","phone","sex","email"];if(k.address_street1?.value!==void 0||k.address_city?.value!==void 0||k.address_state?.value!==void 0||k.address_zip?.value!==void 0)S.registerValidator({key:"address_street1",validator:qr(Ro(yi(),1,1/0),"Please enter a valid Street 1..")}),S.registerValidator({key:"address_city",validator:qr(Ro(yi(),1,1/0),"Please enter a valid City..")}),S.registerValidator({key:"address_state",validator:qr(Ro(yi(),2,2),"Please enter a valid State..")}),j=[...j,"address_zip","address_street1","address_city","address_state"];else{const W=["address_street1","address_city","address_state"];for(const J of W)S.unRegisterValidator(J)}if(S.validate(j),S.hasErrors(j))return i(!1),!0;k.preferredPharmacy.value&&P.selectedPatient.data?.preferredPharmacies&&P.selectedPatient.data?.preferredPharmacies.length!==0&&!P.selectedPatient.data?.preferredPharmacies?.map(W=>W?.id).filter(W=>W!==null).includes(k.preferredPharmacy.value)&&await r.getSDK().clinical.patient.removePatientPreferredPharmacy({})({variables:{patientId:e.patientId,pharmacyId:P.selectedPatient.data?.preferredPharmacies[0].id},awaitRefetchQueries:!1});const F={...e?.patientId?{id:e.patientId}:{},name:{first:k.firstName.value,last:k.lastName.value},gender:k.gender.value,email:k.email.value,phone:k.phone.value,dateOfBirth:k.dateOfBirth.value,sex:k.sex.value,address:k.address_street1.value!==void 0?{street1:k.address_street1.value,street2:k.address_street2.value,city:k.address_city.value,state:k.address_state.value,postalCode:k.address_zip.value,country:"US"}:void 0,preferredPharmacies:k.preferredPharmacy.value?[k.preferredPharmacy.value]:[]};try{if(e?.patientId)await r.getSDK().clinical.patient.updatePatient({})({variables:F,awaitRefetchQueries:!1}),$(e.patientId,N);else{const J=await r.getSDK().clinical.patient.createPatient({})({variables:F,awaitRefetchQueries:!1});w(J?.data?.createPatient?.id||"",N)}i(!1),S.resetStores(),e.open=!1}catch(W){i(!1),v(W?.message||"An error occurred while saving the patient.")}};return(()=>{var k=Cfe(),S=k.firstChild,P=t;return typeof P=="function"?ot(P,k):t=k,M(S,Ta),M(k,_(fe,{get when(){return e.open},get children(){return _($k,{onClosed:()=>{x(),f().resetStores(),e.open=!1},get title(){return e?.patientId?"Update Patient":"Create Patient"},get titleIconName(){return e?.patientId?"pencil-square":"person-plus"},get headerRight(){return(()=>{var N=Sfe();return M(N,_(fe,{get when(){return!e?.hideCreatePrescription},get children(){return _(Ft,{size:"sm",variant:"secondary",get disabled(){return n()},get loading(){return Z(()=>!!n())()&&a()},onClick:()=>C(s(),f(),c(),!0),children:"Save and Create Prescription"})}}),null),M(N,_(Ft,{size:"sm",get disabled(){return n()},get loading(){return Z(()=>!!n())()&&!a()},onClick:()=>C(s(),f(),c(),!1),children:"Save"}),null),N})()},get form(){return[_(fe,{get when(){return m()},get children(){var N=Efe(),j=N.firstChild;return M(j,m),N}}),(()=>{var N=Tfe();return Ce(N,"photon-form-updated",j=>{d(j.detail.form),p(Object.assign({},j.detail.actions,{resetStores:j.detail.reset})),h(j.detail.selected)}),N._$owner=Se(),ue(()=>N.patientId=e.patientId),N})()]}})}}),null),k})()};ar("photon-patient-dialog",{patientId:"",hideCreatePrescription:!1,open:!1},Afe);var Ofe=oe("<photon-patient-dialog>",!0,!1);const Pfe=e=>(console.warn("photon-update-patient-dialog will be deprecated soon. Please use photon-patient-dialog instead."),(()=>{var t=Ofe();return t._$owner=Se(),ue(r=>{var n=e.patientId,i=e.open;return n!==r.e&&(t.patientId=r.e=n),i!==r.t&&(t.open=r.t=i),r},{e:void 0,t:void 0}),t})());ar("photon-update-patient-dialog",{patientId:"",open:!1},Pfe);const Ife=".invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.input::part(base):hover{cursor:pointer}.disabled::part(base):hover{cursor:not-allowed}.selected::part(base){--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.default::part(base):hover{--tw-bg-opacity: 1;background-color:rgb(229,231,235,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity))}.default::part(label){width:100%;overflow:hidden}.group-member::part(base){padding-left:1rem;font-weight:500}.group{background:#d1e9ff;padding-top:.25rem;padding-bottom:.25rem;--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity));font-size:.75rem;font-weight:500}.treatment-option::part(checked-icon){display:none;width:0px}.full-screen-close-btn::part(base){padding:0}.treatment-search::part(input){padding-right:0}.treatment-search::part(input)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.treatment-search::part(input)::placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.dropdown::part(panel){box-shadow:none}";var Nfe=oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>',!0,!1),Dfe=oe('<div><style></style><style></style><style></style><style></style><div class="fixed top-0 left-0 w-full max-h-screen h-screen bg-white overflow-x-hidden z-2000"><div class="flex items-center pb-2 pl-5 pr-5 pt-3"><div class="flex items-center"><sl-icon-button name=x label="Close medication search"class=full-screen-close-btn></sl-icon-button></div></div><sl-input slot=trigger clearable autocomplete=off size=medium class="treatment-search input mb-2 px-4"><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div></sl-input><div class="w-full flex-1">',!0,!1),Mfe=oe('<div class="md:flex flex-1 justify-center items-center pl-2"><div class="flex items-center space-x-2"><p class="text-gray-700 text-sm font-sans inline font-medium">'),Lfe=oe('<p class="pl-1 text-red-400">*'),Rfe=oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'),Ffe=oe("<div class=px-4><p class=text-gray-400>Loading..."),zfe=oe("<div class=px-4><p class=text-gray-400>No treatments found"),jfe=oe('<div class="group uppercase px-4">'),Vfe=oe("<div class=treatment-option>"),Ufe=oe('<p class="text-center text-gray-400 italic px-3">Loading...'),Bfe=oe('<p class="text-center text-gray-400 italic px-3">Nothing more to load'),qfe=oe('<div class="px-4 py-1">');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const Hfe=e=>{let t,r,n;e.actionRef&&(e.actionRef.clear=()=>{n.value="",i(""),s()});const i=Gu(async h=>{e.onSearchChange&&await e.onSearchChange(h)},500),a=h=>{if(h)return e.helpText?e.helpText:e.required?"Please select data...":void 0},o=h=>{const f=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:h}});t?.dispatchEvent(f)},s=()=>{const h=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(h)};Vt(()=>{n&&(n.addEventListener("keydown",h=>{(h.code=="Space"||h.key==" ")&&h.stopImmediatePropagation()}),setTimeout(()=>{n.focus()},100))});const d=Z(()=>e.groups?e.groups.map(h=>{const f=e.data.map((p,m)=>({data:p,allItemsIdx:m})).filter(p=>h.filter(p.data));return f.length>0?[{title:h.label},...f]:[]}).flat():e.data.map((h,f)=>({data:h,allItemsIdx:f}))),c=Z(()=>Km({count:d().length,getScrollElement:()=>r??null,estimateSize:()=>42,overscan:100}));return(()=>{var h=Dfe(),f=h.firstChild,p=f.nextSibling,m=p.nextSibling,v=m.nextSibling,$=v.nextSibling,w=$.firstChild,x=w.firstChild,C=x.firstChild,k=w.nextSibling,S=k.firstChild,P=S.nextSibling,N=P.firstChild,j=k.nextSibling,F=t;typeof F=="function"?ot(F,h):t=h,M(f,_r),M(p,Hn),M(m,Wn),M(v,Ife),x.style.setProperty("font-size","26px"),Ce(C,"click",()=>{e.onClose&&e.onClose()}),C.style.setProperty("padding","0px"),C._$owner=Se(),M(w,(()=>{var U=Z(()=>!!e.label);return()=>U()?(()=>{var G=Mfe(),H=G.firstChild,K=H.firstChild;return M(K,()=>e.label),G})():null})(),null),M(w,(()=>{var U=Z(()=>!!e.required);return()=>U()?Lfe():null})(),null),M(w,(()=>{var U=Z(()=>!!e.optional);return()=>U()?Rfe():null})(),null),Ce(k,"sl-clear",()=>{n.value="",i(""),s()}),Ce(k,"input",U=>{i(U.target.value)});var W=n;typeof W=="function"?ot(W,k):n=k,k.style.setProperty("border-radius","0px"),k.style.setProperty("border","0px"),k._$owner=Se(),M(S,()=>a(e.invalid??!1)),N._$owner=Se(),M(k,_(fe,{get when(){return e.clearable},get children(){var U=Nfe(),G=U.firstChild;return Ce(G,"click",H=>{H.stopImmediatePropagation(),n.value="",i(""),s()}),G._$owner=Se(),ue(()=>U.classList.toggle("hidden",!!(e.isLoading||!e.selectedData))),U}}),null);var J=r;return typeof J=="function"?ot(J,j):r=j,M(j,_(ur,{get each(){return c().getVirtualItems()},get fallback(){return _(Wfe,{get isLoading(){return e.isLoading}})},children:U=>{const G=U.index>d().length-1,H=d()[U.index],K=e.selectedData,ee=!G&&!!K&&"id"in K&&"data"in H&&K.id===H.data.id,we="title"in H?Qfe:Gfe,me="title"in H?{item:H}:{item:U,isLoader:G,isSelected:ee,index:U.index,hasMore:e.hasMore,showOverflow:e.showOverflow,onClick:()=>{G||(n.value="",i(""),o(H.data),e.onClose&&e.onClose())}};return _(XP,ht({component:we},me,{get children(){return Z(()=>"data"in H)()&&e.displayAccessor(H.data,!0)}}))}})),ue(U=>{var G=e.placeholder,H=e.disabled??!1,K=!!(e.invalid??!1),ee=!!(e.disabled??!1),we=e.required,me=!!e.forceLabelSize,re=!e.isLoading;return G!==U.e&&(k.placeholder=U.e=G),H!==U.t&&(k.disabled=U.t=H),K!==U.a&&k.classList.toggle("invalid",U.a=K),ee!==U.o&&k.classList.toggle("disabled",U.o=ee),we!==U.i&&(k.required=U.i=we),me!==U.n&&S.classList.toggle("h-[21px]",U.n=me),re!==U.s&&P.classList.toggle("hidden",U.s=re),U},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),ue(()=>k.value=e.searchText),h})()},Wfe=e=>_(fe,{get when(){return e.isLoading},get fallback(){return zfe()},get children(){return Ffe()}}),Qfe=e=>(()=>{var t=jfe();return t.style.setProperty("position","sticky"),t.style.setProperty("top","0px"),t.style.setProperty("z-index","10"),M(t,()=>e.item.title),t})(),Gfe=e=>(()=>{var t=Vfe();return t.$$click=()=>e.onClick(),M(t,(()=>{var r=Z(()=>!!e.isLoader);return()=>r()?(()=>{var n=Z(()=>!!e.hasMore);return()=>n()?Ufe():Bfe()})():(()=>{var n=qfe();return M(n,()=>e.children),n})()})()),ue(r=>{var n=!!e.isSelected,i=!!e.isSelected;return n!==r.e&&t.classList.toggle("bg-blue-500",r.e=n),i!==r.t&&t.classList.toggle("text-white",r.t=i),r},{e:void 0,t:void 0}),t})();Js(["click"]);const Kfe=".invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.input::part(base):hover{cursor:pointer}.input::part(input){overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.disabled::part(base):hover{cursor:not-allowed}.selected::part(base){--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.default::part(base):hover{--tw-bg-opacity: 1;background-color:rgb(229,231,235,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity))}.default::part(label){width:100%;overflow:hidden}.group-member::part(base){padding-left:1rem;font-weight:500}.group::part(base){background:#d1e9ff;padding-top:.25rem;padding-bottom:.25rem;--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity));font-size:.75rem;font-weight:600}.dropdown::part(panel){border-radius:var(--photon-border-radius, .5rem)}.dropdown-container{border-radius:var(--photon-border-radius, .5rem)}.group::part(checked-icon){display:none;width:0px}.group::part(label){padding-left:12px;padding-right:12px}.treatment-option::part(checked-icon){display:none;width:0px}";var Yfe=oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>',!0,!1),Zfe=oe('<div><style></style><style></style><style></style><style></style><sl-dropdown class="dropdown relative"hoist><sl-input clearable slot=trigger autocomplete=off size=medium class=input><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div><div slot=suffix class=flex><sl-icon></sl-icon></div></sl-input><div class="border border-gray-200 dropdown-container overflow-hidden relative"><div class="bg-white overflow-x-hidden overflow-y-auto relative"><div>',!0,!1),Xfe=oe('<div class="flex items-center pb-2"><p class="text-gray-700 text-sm font-sans">'),Jfe=oe('<p class="pl-1 text-red-400">*'),epe=oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'),tpe=oe('<sl-menu-item><p class="text-center text-gray-400 italic">Loading...',!0,!1),rpe=oe("<sl-menu-item>",!0,!1),npe=oe('<sl-menu-item class="group uppercase">',!0,!1),ipe=oe("<sl-menu-item class=treatment-option>",!0,!1),ape=oe('<p class="text-center text-gray-400 italic">Loading...'),ope=oe('<p class="text-center text-gray-400 italic">Nothing more to load'),spe=oe('<p class="break-words px-3">');zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const lpe=e=>{let t,r,n,i,a;e.actionRef&&(e.actionRef.clear=()=>{c(void 0),f(-1),i.value="",v(""),C()});const[o,s]=le(!1),[d,c]=le(void 0),[h,f]=le(-1),[p,m]=le(),v=Gu(async P=>{e.onSearchChange&&await e.onSearchChange(P)},250),$=new IntersectionObserver(async P=>{P?.at(-1)?.isIntersecting&&e.hasMore&&e.fetchMore&&await e.fetchMore()});Re(()=>{e.data.length===0&&c(void 0)}),Re(()=>{p()&&$.observe(p())});const w=P=>{if(P)return e.helpText?e.helpText:e.required?"Please select data...":void 0},x=P=>{const N=new CustomEvent("photon-data-selected",{composed:!0,bubbles:!0,detail:{data:P}});t?.dispatchEvent(N)},C=()=>{const P=new CustomEvent("photon-data-unselected",{composed:!0,bubbles:!0,detail:{}});t?.dispatchEvent(P)};Re(()=>{e.selectedData&&(c(e.selectedData),x(e.selectedData)),e.selectedData===void 0&&c(void 0)}),Vt(()=>{i&&i.addEventListener("keydown",P=>{(P.code=="Space"||P.key==" ")&&P.stopImmediatePropagation()})});const k=Z(()=>e.groups?e.groups.map(P=>{const N=e.data.map((j,F)=>({data:j,allItemsIdx:F})).filter(j=>P.filter(j.data));return N.length>0?[{title:P.label},...N]:[]}).flat():e.data.map((P,N)=>({data:P,allItemsIdx:N}))),S=Z(()=>Km({count:k().length,getScrollElement:()=>n??null,estimateSize:()=>36.8,overscan:100}));return(()=>{var P=Zfe(),N=P.firstChild,j=N.nextSibling,F=j.nextSibling,W=F.nextSibling,J=W.nextSibling,U=J.firstChild,G=U.firstChild,H=G.nextSibling,K=H.firstChild,ee=H.nextSibling,we=ee.firstChild,me=U.nextSibling,re=me.firstChild,X=re.firstChild,ne=t;typeof ne=="function"?ot(ne,P):t=P,M(N,_r),M(j,Hn),M(F,Wn),M(W,Kfe),M(P,(()=>{var pe=Z(()=>!!e.label);return()=>pe()?(()=>{var ve=Xfe(),Le=ve.firstChild;return M(Le,()=>e.label),M(ve,(()=>{var Ke=Z(()=>!!e.required);return()=>Ke()?Jfe():null})(),null),M(ve,(()=>{var Ke=Z(()=>!!e.optional);return()=>Ke()?epe():null})(),null),ve})():null})(),J),Ce(J,"sl-show",async()=>{s(!0),e.onOpen&&await e.onOpen()}),Ce(J,"sl-hide",async()=>{d()||(i.value="",e.onHide&&await e.onHide()),s(!1)});var ke=r;typeof ke=="function"?ot(ke,J):r=J,J.style.setProperty("width","100%"),J._$owner=Se(),Ce(U,"sl-clear",()=>{c(void 0),f(-1),i.value="",v(""),C()}),Ce(U,"sl-focus",pe=>{e.onInputFocus?(e.onInputFocus(),pe.stopImmediatePropagation()):(r.children[1].style.width=`${i.clientWidth}px`,h()>0&&S().scrollToIndex(h()))}),Ce(U,"sl-input",pe=>{o()||r.show(),v(pe.target.value)});var ie=i;typeof ie=="function"?ot(ie,U):i=U,U._$owner=Se(),M(G,()=>w(e.invalid??!1)),K._$owner=Se(),M(U,_(fe,{get when(){return e.clearable},get children(){var pe=Yfe(),ve=pe.firstChild;return Ce(ve,"click",Le=>{Le.stopImmediatePropagation(),c(void 0),f(-1),i.value="",v(""),C(),r.hide()}),ve._$owner=Se(),ue(()=>pe.classList.toggle("hidden",!!(e.isLoading||d()==null))),pe}}),ee),we._$owner=Se(),me.style.setProperty("width","518px");var Ae=a;typeof Ae=="function"?ot(Ae,re):a=re,re.style.setProperty("max-height","500px"),re.style.setProperty("min-height","37px"),re.style.setProperty("width","100%"),re.style.setProperty("display","flex"),re.style.setProperty("flex-direction","column"),re.style.setProperty("justify-content","start");var Ie=n;return typeof Ie=="function"?ot(Ie,X):n=X,X.style.setProperty("width","100%"),M(X,_(ur,{get each(){return S().getVirtualItems()},get fallback(){return _(dpe,{get noDataMsg(){return e.noDataMsg},get isLoading(){return e.isLoading}})},children:pe=>{const ve=pe.index>k().length-1,Le=k()[pe.index],Ke=d(),Oe=!ve&&!!Ke&&"id"in Ke&&"data"in Le&&Ke.id===Le.data.id;return _(e2,{get children(){return[_(Ri,{get when(){return"title"in Le},get children(){return _(cpe,{item:Le})}}),_(Ri,{get when(){return"data"in Le},get children(){return _(upe,{item:pe,isLoader:ve,isSelected:Oe,get index(){return pe.index},get hasMore(){return e.hasMore},get showOverflow(){return e.showOverflow},onClick:()=>{ve||(c(Le.data),f(Le.allItemsIdx),x(Le.data),r.hide())},setLastIndex:m,get children(){return e.displayAccessor(Le.data,!0)}})}})]}})}})),ue(pe=>{var ve=e.forceLabelSize&&!e.invalid?-20:e.invalid?-18:0,Le=e.disabled??!1,Ke=e.placeholder??void 0,Oe=e.disabled??!1,it=!!(e.invalid??!1),at=!!(e.disabled??!1),Lt=!d()&&i.value==="",Pe=e.required,de=!!e.forceLabelSize,He=!e.isLoading,et=!!e.isLoading,yt=o()?"chevron-up":"chevron-down",bt=`${S().getTotalSize()}px`;return ve!==pe.e&&(J.distance=pe.e=ve),Le!==pe.t&&(J.disabled=pe.t=Le),Ke!==pe.a&&(U.placeholder=pe.a=Ke),Oe!==pe.o&&(U.disabled=pe.o=Oe),it!==pe.i&&U.classList.toggle("invalid",pe.i=it),at!==pe.n&&U.classList.toggle("disabled",pe.n=at),Lt!==pe.s&&U.classList.toggle("placeholder",pe.s=Lt),Pe!==pe.h&&(U.required=pe.h=Pe),de!==pe.r&&G.classList.toggle("h-[21px]",pe.r=de),He!==pe.d&&H.classList.toggle("hidden",pe.d=He),et!==pe.l&&ee.classList.toggle("hidden",pe.l=et),yt!==pe.u&&(we.name=pe.u=yt),bt!==pe.c&&((pe.c=bt)!=null?X.style.setProperty("height",bt):X.style.removeProperty("height")),pe},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0,r:void 0,d:void 0,l:void 0,u:void 0,c:void 0}),ue(()=>U.value=e.searchText),P})()},dpe=e=>_(fe,{get when(){return e.isLoading},get fallback(){return(()=>{var t=rpe();return t._$owner=Se(),M(t,()=>e.noDataMsg?e.noDataMsg:"No data found"),t})()},get children(){var t=tpe();return t._$owner=Se(),t}}),cpe=e=>(()=>{var t=npe();return t._$owner=Se(),M(t,()=>e.item.title),t})(),upe=e=>(()=>{var t=ipe();return ot(r=>{e.isLoader&&e.index>0&&e.setLastIndex(r)},t),t.$$click=()=>e.onClick(),t.style.setProperty("width","100%"),t.style.setProperty("white-space","normal"),t._$owner=Se(),M(t,(()=>{var r=Z(()=>!!e.isLoader);return()=>r()?(()=>{var n=Z(()=>!!e.hasMore);return()=>n()?ape():ope()})():(()=>{var n=spe();return M(n,()=>e.children),ue(i=>{var a=!e.showOverflow,o=!e.showOverflow,s=!e.showOverflow,d=!!e.showOverflow;return a!==i.e&&n.classList.toggle("overflow-hidden",i.e=a),o!==i.t&&n.classList.toggle("overflow-ellipsis",i.t=o),s!==i.a&&n.classList.toggle("whitespace-nowrap",i.a=s),d!==i.o&&n.classList.toggle("whitespace-normal",i.o=d),i},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})()),ue(r=>{var n=!!e.isSelected,i=`${e.item.size}px`;return n!==r.e&&t.classList.toggle("selected",r.e=n),i!==r.t&&((r.t=i)!=null?t.style.setProperty("min-height",i):t.style.removeProperty("min-height")),r},{e:void 0,t:void 0}),t})();Js(["click"]);var hpe=oe("<strong class=font-extrabold>"),fpe=oe('<p class="text-sm whitespace-normal leading-snug my-1">'),ppe=oe('<div class=my-1><div class="text-sm whitespace-normal font-medium mb-1"></div><div class="text-xs text-gray-500 truncate"> <!>, <!> <!> supply, <!> <!>, '),gpe=oe("<span class=text-blue-600>(<!>): "),mpe=oe("<div>");function sv(e,t,r){const n=new CustomEvent(t,{composed:!0,bubbles:!0,detail:r});e?.dispatchEvent(n)}function vpe(e,t,r){sv(e,"photon-treatment-selected",{data:t,catalogId:r})}function ype(e){sv(e,"photon-treatment-unselected")}function Mi(e,t){sv(e,"photon-search-text-changed",{text:t})}const bpe=Me`
4248
4248
  query SearchTreatments($filter: TreatmentFilter!) {
4249
4249
  treatments(filter: $filter) {
4250
4250
  __typename
package/dist/index.mjs CHANGED
@@ -10781,7 +10781,7 @@ class wp {
10781
10781
  login(t) {
10782
10782
  return lt(this, arguments, void 0, function* ({ organizationId: r, invitation: n, appState: i }) {
10783
10783
  const a = Object.assign({ authorizationParams: Object.assign(Object.assign(Object.assign(Object.assign({}, this.audience ? { audience: this.audience } : {}), this.connection ? { connection: this.connection } : {}), r || this.organization ? { organization: r || this.organization } : {}), n ? { invitation: n } : {}) }, i ? { appState: i } : {});
10784
- return this.authentication.loginWithPopup(a);
10784
+ return this.authentication.loginWithRedirect(a);
10785
10785
  });
10786
10786
  }
10787
10787
  /**
@@ -32052,7 +32052,10 @@ function Qw(e) {
32052
32052
  variables: {
32053
32053
  id: e.patientId
32054
32054
  },
32055
- client: t.apolloClinical
32055
+ client: t.apolloClinical,
32056
+ skip: !e.patientId,
32057
+ fetchPolicy: "network-only",
32058
+ refetchQueries: [$1]
32056
32059
  })), d = Mh($1, s), c = (f) => (p, m) => {
32057
32060
  const v = p?.prescription?.writtenAt ? new Date(p.prescription.writtenAt).getTime() : -1 / 0, $ = m?.prescription?.writtenAt ? new Date(m.prescription.writtenAt).getTime() : -1 / 0;
32058
32061
  return f ? v - $ : $ - v;
@@ -32104,13 +32107,7 @@ function Qw(e) {
32104
32107
  active: !1
32105
32108
  }]
32106
32109
  },
32107
- update: p,
32108
- refetchQueries: [{
32109
- query: $1,
32110
- variables: {
32111
- id: e.patientId
32112
- }
32113
- }]
32110
+ update: p
32114
32111
  });
32115
32112
  const m = {
32116
32113
  active: !1,
@@ -38179,6 +38176,7 @@ function $ie() {
38179
38176
  },
38180
38177
  get children() {
38181
38178
  return _(Fn, {
38179
+ addChildrenDivider: !0,
38182
38180
  get children() {
38183
38181
  return [(() => {
38184
38182
  var r = gie();
@@ -40110,7 +40108,7 @@ const Aae = (e = window.location.search) => {
40110
40108
  function sg(e, t) {
40111
40109
  return e.every((r) => t.includes(r));
40112
40110
  }
40113
- const o_ = $i(), Bn = () => Vn(o_), Pae = "@photonhealth/elements", Iae = "0.14.3", Nae = "", Dae = "dist/index.js", Mae = "./dist/index.d.ts", Lae = {
40111
+ const o_ = $i(), Bn = () => Vn(o_), Pae = "@photonhealth/elements", Iae = "0.14.4", Nae = "", Dae = "dist/index.js", Mae = "./dist/index.d.ts", Lae = {
40114
40112
  start: "vite --port 3000",
40115
40113
  build: "rimraf dist && NODE_ENV=development vite build",
40116
40114
  "build:prod": "npx nx run elements:build",
@@ -40346,7 +40344,7 @@ ar("photon-client", {
40346
40344
  parse: !1
40347
40345
  }
40348
40346
  }, Yae);
40349
- const _r = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';
40347
+ const _r = '*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%}@media (min-width: 475px){.container{max-width:475px}}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.z-1000{z-index:1000}.z-2000{z-index:2000}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-0{margin-top:0}.mt-2{margin-top:.5rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.max-h-screen{max-height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * (1 - var(--tw-space-x-reverse)))}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-none{border-style:none}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229,231,235,var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249,250,251,var(--tw-bg-opacity))}.bg-blue-500{--tw-bg-opacity: 1;background-color:rgb(59,130,246,var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254,226,226,var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255,255,255,var(--tw-bg-opacity))}.p-0{padding:0}.p-4{padding:1rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-4{padding-bottom:1rem}.pb-40{padding-bottom:10rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pr-5{padding-right:1.25rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.pt-3{padding-top:.75rem}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-light{font-weight:300}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0,0,0,var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37,99,235,var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156,163,175,var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107,114,128,var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55,65,81,var(--tw-text-opacity))}.text-red-400{--tw-text-opacity: 1;color:rgb(248,113,113,var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185,28,28,var(--tw-text-opacity))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100,116,139,var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13,148,136,var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29,78,216,var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43,108,176,var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75,85,99,var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107,114,128,var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:\\!w-auto{width:auto!important}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:flex{display:flex}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}';
40350
40348
  var Zae = /* @__PURE__ */ oe("<style>"), Xae = /* @__PURE__ */ oe('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50">');
40351
40349
  const Jae = (e) => {
40352
40350
  const t = Bn();
@@ -55144,7 +55142,7 @@ const kue = (e) => {
55144
55142
  };
55145
55143
  var Cue = /* @__PURE__ */ oe('<div class="flex items-center justify-between">'), Sue = /* @__PURE__ */ oe("<photon-patient-select>", !0, !1), Eue = /* @__PURE__ */ oe("<div><photon-patient-dialog>", !0, !1), Tue = /* @__PURE__ */ oe('<div><photon-add-medication-history-dialog title="Add Medication History">', !0, !1), Aue = /* @__PURE__ */ oe('<div class="flex flex-col gap-8">');
55146
55144
  const Oue = qr(Zm(yi(), Ju()), "Please select a patient..."), Pue = qr(Zm(yi(), Ju()), "Please enter an address for patient..."), Iue = (e) => {
55147
- const [t, r] = le(void 0), [n, i] = le(!1), [a, o] = le(!1), {
55145
+ const [t, r] = le(), [n, i] = le(!1), [a, o] = le(!1), {
55148
55146
  actions: s,
55149
55147
  store: d
55150
55148
  } = M2, [c, h] = le(!1);
@@ -62083,7 +62081,7 @@ ar("photon-state-input", {
62083
62081
  disabled: !1,
62084
62082
  selected: void 0
62085
62083
  }, $fe);
62086
- var wfe = /* @__PURE__ */ oe('<div class="text-black text-xl md:text-3xl">'), xfe = /* @__PURE__ */ oe("<sl-icon>", !0, !1), _fe = /* @__PURE__ */ oe('<div class="flex-1 flex justify-end">'), kfe = /* @__PURE__ */ oe('<div class="fixed top-0 left-0 w-full h-screen z-10 overflow-y-scroll bg-[#F9FAFB]"><style></style><photon-dialog confirm-text="Yes, Close"cancel-text="Keep Editing"><p class="font-sans text-lg xs:text-base"></p></photon-dialog><header class="flex flex-col md:flex-row items-center px-4 py-2 md:px-8 md:py-3 bg-white fixed w-full z-10 shadow-card"><div class="flex justify-start md:flex-1 absolute md:static left-4"></div><div class="mb-2 md:mb-0 flex flex-0 md:flex-1 justify-center md:justify-center items-center"><p class="ml-1 font-sans text-sm md:text-xl font-medium"></p></div><div class="flex flex-col md:flex-row flex-1"></div></header><div class="overflow-y-scroll w-full min-h-screen bg-[#F9FAFB] pt-28 xs:pt-28 lg:pt-20"><div class="px-4 pb-40 md:pt-4 md:pb-52 md:px-4 w-full h-full sm:w-[600px] xs:mx-auto">', !0, !1);
62084
+ var wfe = /* @__PURE__ */ oe('<div class="text-black text-xl md:text-3xl">'), xfe = /* @__PURE__ */ oe("<sl-icon>", !0, !1), _fe = /* @__PURE__ */ oe('<div class="flex-1 flex justify-end">'), kfe = /* @__PURE__ */ oe('<div class="fixed top-0 left-0 w-full h-screen z-10 overflow-y-scroll bg-[#F9FAFB]"><style></style><photon-dialog confirm-text="Yes, Close"cancel-text="Keep Editing"><p class="font-sans text-lg xs:text-base"></p></photon-dialog><header class="flex flex-col md:flex-row items-center px-4 py-2 md:px-8 md:py-3 bg-white fixed w-full shadow-card z-1000"><div class="flex justify-start md:flex-1 absolute md:static left-4"></div><div class="mb-2 md:mb-0 flex flex-0 md:flex-1 justify-center md:justify-center items-center"><p class="ml-1 font-sans text-sm md:text-xl font-medium"></p></div><div class="flex flex-col md:flex-row flex-1"></div></header><div class="overflow-y-scroll w-full min-h-screen bg-[#F9FAFB] pt-28 xs:pt-28 lg:pt-20"><div class="px-4 pb-40 md:pt-4 md:pb-52 md:px-4 w-full h-full sm:w-[600px] xs:mx-auto">', !0, !1);
62087
62085
  const $k = (e) => {
62088
62086
  const t = ht({
62089
62087
  closeTitle: "Lose unsaved changes?",
@@ -62327,7 +62325,7 @@ ar("photon-update-patient-dialog", {
62327
62325
  open: !1
62328
62326
  }, Pfe);
62329
62327
  const Ife = ".invalid::part(base){--tw-border-opacity: 1;border-color:rgb(248,113,113,var(--tw-border-opacity));border-width:2px}.input::part(base){border-radius:var(--photon-border-radius, .5rem)}.input::part(base):hover{cursor:pointer}.disabled::part(base):hover{cursor:not-allowed}.selected::part(base){--tw-bg-opacity: 1;background-color:rgb(49,130,206,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(255,255,255,var(--tw-text-opacity))}.default::part(base):hover{--tw-bg-opacity: 1;background-color:rgb(229,231,235,var(--tw-bg-opacity));--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity))}.default::part(label){width:100%;overflow:hidden}.group-member::part(base){padding-left:1rem;font-weight:500}.group{background:#d1e9ff;padding-top:.25rem;padding-bottom:.25rem;--tw-text-opacity: 1;color:rgb(31,41,55,var(--tw-text-opacity));font-size:.75rem;font-weight:500}.treatment-option::part(checked-icon){display:none;width:0px}.full-screen-close-btn::part(base){padding:0}.treatment-search::part(input){padding-right:0}.treatment-search::part(input)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.treatment-search::part(input)::placeholder{--tw-text-opacity: 1;color:rgb(209,213,219,var(--tw-text-opacity))}.dropdown::part(panel){box-shadow:none}";
62330
- var Nfe = /* @__PURE__ */ oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>', !0, !1), Dfe = /* @__PURE__ */ oe('<div><style></style><style></style><style></style><style></style><div class="fixed top-0 left-0 w-full max-h-screen h-screen z-20 bg-white overflow-x-hidden"><div class="flex items-center pb-2 pl-5 pr-5 pt-3"><div class="flex items-center"><sl-icon-button name=x label="Close medication search"class=full-screen-close-btn></sl-icon-button></div></div><sl-input slot=trigger clearable autocomplete=off size=medium class="treatment-search input mb-2 px-4"><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div></sl-input><div class="w-full flex-1">', !0, !1), Mfe = /* @__PURE__ */ oe('<div class="md:flex flex-1 justify-center items-center pl-2"><div class="flex items-center space-x-2"><p class="text-gray-700 text-sm font-sans inline font-medium">'), Lfe = /* @__PURE__ */ oe('<p class="pl-1 text-red-400">*'), Rfe = /* @__PURE__ */ oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'), Ffe = /* @__PURE__ */ oe("<div class=px-4><p class=text-gray-400>Loading..."), zfe = /* @__PURE__ */ oe("<div class=px-4><p class=text-gray-400>No treatments found"), jfe = /* @__PURE__ */ oe('<div class="group uppercase px-4">'), Vfe = /* @__PURE__ */ oe("<div class=treatment-option>"), Ufe = /* @__PURE__ */ oe('<p class="text-center text-gray-400 italic px-3">Loading...'), Bfe = /* @__PURE__ */ oe('<p class="text-center text-gray-400 italic px-3">Nothing more to load'), qfe = /* @__PURE__ */ oe('<div class="px-4 py-1">');
62328
+ var Nfe = /* @__PURE__ */ oe('<div slot=suffix class=flex><sl-icon class="text-gray-400 hover:text-gray-600"name=x-circle-fill>', !0, !1), Dfe = /* @__PURE__ */ oe('<div><style></style><style></style><style></style><style></style><div class="fixed top-0 left-0 w-full max-h-screen h-screen bg-white overflow-x-hidden z-2000"><div class="flex items-center pb-2 pl-5 pr-5 pt-3"><div class="flex items-center"><sl-icon-button name=x label="Close medication search"class=full-screen-close-btn></sl-icon-button></div></div><sl-input slot=trigger clearable autocomplete=off size=medium class="treatment-search input mb-2 px-4"><p slot=help-text class="text-red-400 pt-1 font-sans"></p><div slot=suffix class=flex><sl-spinner slot=suffix></sl-spinner></div></sl-input><div class="w-full flex-1">', !0, !1), Mfe = /* @__PURE__ */ oe('<div class="md:flex flex-1 justify-center items-center pl-2"><div class="flex items-center space-x-2"><p class="text-gray-700 text-sm font-sans inline font-medium">'), Lfe = /* @__PURE__ */ oe('<p class="pl-1 text-red-400">*'), Rfe = /* @__PURE__ */ oe('<p class="text-gray-400 text-xs pl-2 font-sans">Optional'), Ffe = /* @__PURE__ */ oe("<div class=px-4><p class=text-gray-400>Loading..."), zfe = /* @__PURE__ */ oe("<div class=px-4><p class=text-gray-400>No treatments found"), jfe = /* @__PURE__ */ oe('<div class="group uppercase px-4">'), Vfe = /* @__PURE__ */ oe("<div class=treatment-option>"), Ufe = /* @__PURE__ */ oe('<p class="text-center text-gray-400 italic px-3">Loading...'), Bfe = /* @__PURE__ */ oe('<p class="text-center text-gray-400 italic px-3">Nothing more to load'), qfe = /* @__PURE__ */ oe('<div class="px-4 py-1">');
62331
62329
  zr("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");
62332
62330
  const Hfe = (e) => {
62333
62331
  let t, r, n;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.14.3",
3
+ "version": "0.14.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",