@photonhealth/elements 0.8.2 → 0.8.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 +18 -3
- package/dist/index.mjs +20 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1185,6 +1185,21 @@ Description:
|
|
|
1185
1185
|
mutation RecentOrdersCombineDialogUpdateOrder($orderId: ID!, $fills: [FillInput!]!) {
|
|
1186
1186
|
updateOrder(id: $orderId, fills: $fills) {
|
|
1187
1187
|
id
|
|
1188
|
+
createdAt
|
|
1189
|
+
fills {
|
|
1190
|
+
id
|
|
1191
|
+
prescription {
|
|
1192
|
+
id
|
|
1193
|
+
dispenseQuantity
|
|
1194
|
+
dispenseUnit
|
|
1195
|
+
fillsAllowed
|
|
1196
|
+
instructions
|
|
1197
|
+
notes
|
|
1198
|
+
}
|
|
1199
|
+
treatment {
|
|
1200
|
+
name
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1188
1203
|
}
|
|
1189
1204
|
}
|
|
1190
1205
|
`,Pj=Ln`
|
|
@@ -1197,7 +1212,7 @@ Description:
|
|
|
1197
1212
|
id
|
|
1198
1213
|
}
|
|
1199
1214
|
}
|
|
1200
|
-
`;function Aj(){let e;const t=zn(),[n,r]=$a(),[i,o]=B(!1),[a,s]=B(!1),[l]=Al(Tj,{client:t.apollo}),[d]=Al(Nj,{client:t.apollo}),[c]=Al(Pj,{client:t.apollo}),u=b=>{const x=new CustomEvent("photon-order-combined",{composed:!0,bubbles:!0,detail:{
|
|
1215
|
+
`;function Aj(){let e;const t=zn(),[n,r]=$a(),[i,o]=B(!1),[a,s]=B(!1),[l]=Al(Tj,{client:t.apollo}),[d]=Al(Nj,{client:t.apollo}),[c]=Al(Pj,{client:t.apollo}),u=b=>{const x=new CustomEvent("photon-order-combined",{composed:!0,bubbles:!0,detail:{order:b}});e?.dispatchEvent(x)},f=b=>{const x=new CustomEvent("photon-order-created",{composed:!0,bubbles:!0,detail:{order:b}});e?.dispatchEvent(x)};pe(()=>{n.isCombineDialogOpen&&Gn("prescribe-combine-dialog-open",{},e)});const h=Q(()=>n.orders.find(b=>b.state==="ROUTING")),p=Q(()=>{const b=h();return b?J6(b):[]}),v=async()=>l({variables:{prescriptions:(n.draftPrescriptions||[]).map(b=>({daysSupply:b.daysSupply,dispenseAsWritten:b.dispenseAsWritten,dispenseQuantity:b.dispenseQuantity,dispenseUnit:b.dispenseUnit,effectiveDate:b.effectiveDate,instructions:b.instructions,notes:b.notes,patientId:n.patientId,fillsAllowed:b.refillsInput?b.refillsInput+1:1,treatmentId:b.treatment.id}))}}),y=async(b,x)=>d({variables:{orderId:b,fills:x.map(O=>({prescriptionId:O}))}}),k=async(b,x,O)=>c({variables:{patientId:b,fills:x.map(N=>({prescriptionId:N})),address:O}}),_=async()=>{const b=h();if(!b)return;s(!0),Gn("prescribe-combine-dialog-combining",{},e);let x;try{x=await v()}catch{dr({header:"Error Creating Prescriptions",body:"The prescriptions have not been created.",status:"info"}),s(!1);return}try{const O=await y(b.id,x.createPrescriptions.map(N=>N.id));u(O.updateOrder),s(!1);return}catch{try{if(!n?.address||!n?.patientId)throw new Error("No address provided");const O=await k(n.patientId,x.createPrescriptions.map(N=>N.id),n.address);f(O.createOrder),s(!1)}catch{dr({header:"Error Creating Order",body:"The prescription was created but not turned into an order.",status:"info"}),s(!1);return}}};return g(ba,{get open(){return n.isCombineDialogOpen},onClose:()=>{Gn("prescribe-combine-dialog-exit",{},e),r.setIsCombineDialogOpen(!1)},get children(){const b=Oj.cloneNode(!0),x=b.firstChild,O=x.firstChild,N=x.nextSibling,P=N.firstChild,A=P.firstChild,z=P.nextSibling,U=z.firstChild,W=N.nextSibling,R=e;return typeof R=="function"?Nr(R,b):e=b,S(O,g(rt,{name:"exclamationCircle"})),S(x,g(we,{bold:!0,children:"Add prescription to recent order?"}),null),S(P,g(we,{children:"This patient currently has an order for:"}),A),S(A,g(It,{get each(){return p()},children:L=>(()=>{const q=W3.cloneNode(!0),I=q.firstChild;return S(q,g(we,{size:"sm",get children(){return L?.treatment?.name}}),I),S(q,g(we,{size:"sm",color:"gray",get children(){return oa({dispenseQuantity:L?.prescription?.dispenseQuantity,dispenseUnit:L?.prescription?.dispenseUnit,fillsAllowed:L?.prescription?.fillsAllowed,instructions:L?.prescription?.instructions})}}),null),q})()})),S(z,g(we,{children:"Select YES to combine orders and enable the patient to send it to the same pharmacy:"}),U),S(U,g(It,{get each(){return n.draftPrescriptions},children:L=>(()=>{const q=W3.cloneNode(!0),I=q.firstChild;return S(q,g(we,{size:"sm",get children(){return L.treatment.name}}),I),S(q,g(we,{size:"sm",color:"gray",get children(){return oa({dispenseQuantity:L?.dispenseQuantity??0,dispenseUnit:L?.dispenseUnit??"",fillsAllowed:L?.fillsAllowed??0,instructions:L?.instructions??""})}}),null),q})()})),S(W,g(Ze,{size:"xl",onClick:_,get disabled(){return a()},get loading(){return a()},children:"Yes, combine orders"}),null),S(W,g(Ze,{variant:"secondary",size:"xl",onClick:()=>{Gn("prescribe-combine-dialog-not-combining",{},e),n.createOrder?.(),o(!0)},get disabled(){return i()},get loading(){return i()},get children(){return i()?"Creating order...":"No, send new order"}}),null),b}})}const Ij=st`
|
|
1201
1216
|
query GetPatientOrders($patientId: ID!) {
|
|
1202
1217
|
patient(id: $patientId) {
|
|
1203
1218
|
id
|
|
@@ -1265,7 +1280,7 @@ Description:
|
|
|
1265
1280
|
}
|
|
1266
1281
|
}
|
|
1267
1282
|
}
|
|
1268
|
-
`,tV={CatalogTreatmentsFieldsElementsFragment:eV};class nV{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,n=!1){this.sdk=t,this.autoLogin=n;const[r,i]=Ci({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=r,this.authentication={state:r.authentication,handleRedirect:async o=>{try{const a=await this.sdk.authentication.handleRedirect(o);Jj(a?.appState)}catch(a){const l=new URLSearchParams(window.location.search).get("error_description");a.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):l?.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:a.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:r.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:r.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:r.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:r.patients,getPatients:this.getPatients.bind(this)},patient:{state:r.patient,getPatient:this.getPatient.bind(this)},prescription:{state:r.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 n=await this.sdk.authentication.getUser(),r=!!this.sdk?.organization&&!!n?.org_id;let i=[];if(this.autoLogin||t)try{const o=await this.sdk.authentication.getAccessToken();i=a9(o)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:n,isLoading:!1,isInOrg:t&&r&&this.sdk.organization===n.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:n}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?n.patients:this.store.patients.patients.concat(n.patients),finished:n.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:n.patient}),n.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:n}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:tV});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:n.catalog.treatments.map(r=>r)||[],templates:n.catalog.templates.map(r=>r)||[]})}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((n,r)=>({id:String(r),...n}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const n=this.sdk.clinical.prescription.createPrescription({});try{const{data:r,errors:i}=await n({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),r?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:r.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:r,errors:i}}catch(r){return this.setStore("prescription",{...this.store.prescription,error:r,isLoading:!1}),{data:null,errors:[]}}}}const rV=/[?&]code=[^&]+/,iV=/[?&]state=[^&]+/,oV=/[?&]error=[^&]+/,aV=(e=window.location.search)=>(rV.test(e)||oV.test(e))&&iV.test(e),sV=e=>/^\d+$/.test(e)&&e.length>=5,s9=Rn(),Nn=()=>xn(s9),lV="@photonhealth/elements",dV="0.8.2",cV="",uV="dist/index.js",fV="./dist/index.d.ts",hV={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"},pV={access:"public"},mV=["dist","package.json"],gV=[],vV="",yV="ISC",bV={"@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",rimraf:"^3.0.2",vite:"^3.0.6","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},$V={"@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"},wV={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},_V="3283ed3794cd092af27cfc26db5ad4535853caf8",xV={name:lV,version:dV,description:cV,main:uV,types:fV,scripts:hV,publishConfig:pV,files:mV,keywords:gV,author:vV,license:yV,devDependencies:bV,dependencies:$V,exports:wV,gitHead:_V},kV=G("<slot></slot>"),CV=G("<div></div>"),EV=xV?.version??"unknown",SV=e=>{let t;const n=new Cw({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:e.redirectUri?e.redirectUri:window.location.origin,organization:e.org,developmentMode:e.developmentMode},EV),r=new nV(n,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[i]=B(r),o=async()=>{await i()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},a=async()=>{await i()?.authentication.checkSession(),qj(async()=>{await i()?.authentication.checkSession()},6e4,setInterval)};return pe(()=>{aV()&&i()?o():i()&&a()}),pe(()=>{if(!i()?.authentication.state.isLoading){if(!i()?.authentication.state.isAuthenticated&&e.autoLogin){const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}else if(e.externalUserId!=null&&i().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){i()?.authentication.logout();const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}}}),(()=>{const s=CV.cloneNode(!0),l=t;return typeof l=="function"?He(l,s):t=s,T(s,g(s9.Provider,{get value(){return i()},get children(){return g(GD,{client:n,get children(){const d=kV.cloneNode(!0);return d._$owner=ce(),d}})}})),s})()};lt("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}},SV);const Mt=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{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,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}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-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-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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}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: }::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: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-8{margin-top:2rem;margin-bottom:2rem}.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-2{margin-top:.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.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-full{height:100%}.h-screen{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}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.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-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-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.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-24{padding-bottom:6rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,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-light{font-weight:300}.font-medium{font-weight:500}.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\\: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}.sm\\:text-right{text-align:right}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:\\!w-auto{width:auto!important}.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}}
|
|
1283
|
+
`,tV={CatalogTreatmentsFieldsElementsFragment:eV};class nV{sdk;setStore;store;authentication;getSDK;clinical;autoLogin;constructor(t,n=!1){this.sdk=t,this.autoLogin=n;const[r,i]=Ci({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=r,this.authentication={state:r.authentication,handleRedirect:async o=>{try{const a=await this.sdk.authentication.handleRedirect(o);Jj(a?.appState)}catch(a){const l=new URLSearchParams(window.location.search).get("error_description");a.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):l?.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:a.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:r.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:r.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:r.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:r.patients,getPatients:this.getPatients.bind(this)},patient:{state:r.patient,getPatient:this.getPatient.bind(this)},prescription:{state:r.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 n=await this.sdk.authentication.getUser(),r=!!this.sdk?.organization&&!!n?.org_id;let i=[];if(this.autoLogin||t)try{const o=await this.sdk.authentication.getAccessToken();i=a9(o)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:n,isLoading:!1,isInOrg:t&&r&&this.sdk.organization===n.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:n}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?n.patients:this.store.patients.patients.concat(n.patients),finished:n.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:n.patient}),n.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:n}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:tV});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:n.catalog.treatments.map(r=>r)||[],templates:n.catalog.templates.map(r=>r)||[]})}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((n,r)=>({id:String(r),...n}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const n=this.sdk.clinical.prescription.createPrescription({});try{const{data:r,errors:i}=await n({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),r?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:r.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:r,errors:i}}catch(r){return this.setStore("prescription",{...this.store.prescription,error:r,isLoading:!1}),{data:null,errors:[]}}}}const rV=/[?&]code=[^&]+/,iV=/[?&]state=[^&]+/,oV=/[?&]error=[^&]+/,aV=(e=window.location.search)=>(rV.test(e)||oV.test(e))&&iV.test(e),sV=e=>/^\d+$/.test(e)&&e.length>=5,s9=Rn(),Nn=()=>xn(s9),lV="@photonhealth/elements",dV="0.8.4",cV="",uV="dist/index.js",fV="./dist/index.d.ts",hV={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"},pV={access:"public"},mV=["dist","package.json"],gV=[],vV="",yV="ISC",bV={"@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",rimraf:"^3.0.2",vite:"^3.0.6","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},$V={"@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"},wV={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},_V="3283ed3794cd092af27cfc26db5ad4535853caf8",xV={name:lV,version:dV,description:cV,main:uV,types:fV,scripts:hV,publishConfig:pV,files:mV,keywords:gV,author:vV,license:yV,devDependencies:bV,dependencies:$V,exports:wV,gitHead:_V},kV=G("<slot></slot>"),CV=G("<div></div>"),EV=xV?.version??"unknown",SV=e=>{let t;const n=new Cw({env:e.env,domain:e.domain,audience:e.audience,connection:e.connection,uri:e.uri,clientId:e.id,redirectURI:e.redirectUri?e.redirectUri:window.location.origin,organization:e.org,developmentMode:e.developmentMode},EV),r=new nV(n,e.autoLogin);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[i]=B(r),o=async()=>{await i()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},a=async()=>{await i()?.authentication.checkSession(),qj(async()=>{await i()?.authentication.checkSession()},6e4,setInterval)};return pe(()=>{aV()&&i()?o():i()&&a()}),pe(()=>{if(!i()?.authentication.state.isLoading){if(!i()?.authentication.state.isAuthenticated&&e.autoLogin){const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}else if(e.externalUserId!=null&&i().authentication.state.user?.sub?.split("|").reverse()[0]!==e.externalUserId){i()?.authentication.logout();const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}}}),(()=>{const s=CV.cloneNode(!0),l=t;return typeof l=="function"?He(l,s):t=s,T(s,g(s9.Provider,{get value(){return i()},get children(){return g(GD,{client:n,get children(){const d=kV.cloneNode(!0);return d._$owner=ce(),d}})}})),s})()};lt("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}},SV);const Mt=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{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,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}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-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-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[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}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: }::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: }.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-8{margin-top:2rem;margin-bottom:2rem}.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-2{margin-top:.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.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-full{height:100%}.h-screen{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}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.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-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-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.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-24{padding-bottom:6rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pr-2{padding-right:.5rem}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,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-light{font-weight:300}.font-medium{font-weight:500}.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\\: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}.sm\\:text-right{text-align:right}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:\\!w-auto{width:auto!important}.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}}
|
|
1269
1284
|
`,OV=G("<style></style>"),TV=G('<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"></button>'),NV=e=>{const t=Nn();return pe(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{const n=OV.cloneNode(!0);return T(n,Mt),n})(),t?(()=>{const n=TV.cloneNode(!0);return n.$$click=async()=>{const r={appState:{}};e.redirectPath&&(r.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(r)},T(n,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),ee(()=>n.disabled=t.authentication.state.isLoading),n})():null]};lt("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},NV);Hc(["click"]);const PV=G("<style></style>"),AV=G(`<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></photon-auth-button></div>`),IV=e=>{const t=Nn();return pe(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{const n=PV.cloneNode(!0);return T(n,Mt),n})(),(()=>{const n=se(()=>document.importNode(AV,!0)),r=n.firstChild,i=r.nextSibling,o=i.nextSibling,a=o.nextSibling;return a._$owner=ce(),ee(()=>a.redirectPath=e.redirectPath),n})()]};lt("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},IV);var Fh=(e,t)=>{let n;const r=()=>clearTimeout(n);return ce()&&bn(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>e(...o),t)},{clear:r})},Il=window,Rh=Il.ShadowRoot&&(Il.ShadyCSS===void 0||Il.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Lh=Symbol(),Q3=new WeakMap,l9=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Lh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Rh&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=Q3.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&Q3.set(t,e))}return e}toString(){return this.cssText}},MV=e=>new l9(typeof e=="string"?e:e+"",void 0,Lh),Zt=(e,...t)=>{const n=e.length===1?e[0]:t.reduce((r,i,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new l9(n,e,Lh)},DV=(e,t)=>{Rh?e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet):t.forEach(n=>{const r=document.createElement("style"),i=Il.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,e.appendChild(r)})},K3=Rh?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const r of t.cssRules)n+=r.cssText;return MV(n)})(e):e,v0,Kd=window,Y3=Kd.trustedTypes,FV=Y3?Y3.emptyScript:"",Z3=Kd.reactiveElementPolyfillSupport,_s={toAttribute(e,t){switch(t){case Boolean:e=e?FV:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},d9=(e,t)=>t!==e&&(t==t||e==e),y0={attribute:!0,type:String,converter:_s,reflect:!1,hasChanged:d9},Ao=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const r=this._$Ep(n,t);r!==void 0&&(this._$Ev.set(r,n),e.push(r))}),e}static createProperty(e,t=y0){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Object.defineProperty(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(r){const i=this[e];this[t]=r,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||y0}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of n)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)t.unshift(K3(r))}else e!==void 0&&t.push(K3(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return DV(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=y0){var r;const i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){const o=(((r=n.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?n.converter:_s).toAttribute(t,n.type);this._$El=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(e,t){var n;const r=this.constructor,i=r._$Ev.get(e);if(i!==void 0&&this._$El!==i){const o=r.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:_s;this._$El=i,this[i]=a.fromAttribute(t,o.type),this._$El=null}}requestUpdate(e,t,n){let r=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||d9)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,i)=>this[i]=r),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostUpdate)===null||i===void 0?void 0:i.call(r)}),this.update(n)):this._$Ek()}catch(r){throw t=!1,this._$Ek(),r}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(n=>{var r;return(r=n.hostUpdated)===null||r===void 0?void 0:r.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};Ao.finalized=!0,Ao.elementProperties=new Map,Ao.elementStyles=[],Ao.shadowRootOptions={mode:"open"},Z3?.({ReactiveElement:Ao}),((v0=Kd.reactiveElementVersions)!==null&&v0!==void 0?v0:Kd.reactiveElementVersions=[]).push("1.6.1");var b0,Yd=window,sa=Yd.trustedTypes,X3=sa?sa.createPolicy("lit-html",{createHTML:e=>e}):void 0,si=`lit$${(Math.random()+"").slice(9)}$`,c9="?"+si,RV=`<${c9}>`,la=document,xs=(e="")=>la.createComment(e),ks=e=>e===null||typeof e!="object"&&typeof e!="function",u9=Array.isArray,LV=e=>u9(e)||typeof e?.[Symbol.iterator]=="function",ja=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,J3=/-->/g,e4=/>/g,Ai=RegExp(`>|[
|
|
1270
1285
|
\f\r](?:([^\\s"'>=/]+)([
|
|
1271
1286
|
\f\r]*=[
|
|
@@ -3473,7 +3488,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3473
3488
|
</slot>
|
|
3474
3489
|
</sl-popup>
|
|
3475
3490
|
`}};rn.styles=OK;C([Dt("slot:not([name])")],rn.prototype,"defaultSlot",2);C([Dt(".tooltip__body")],rn.prototype,"body",2);C([Dt("sl-popup")],rn.prototype,"popup",2);C([D()],rn.prototype,"content",2);C([D()],rn.prototype,"placement",2);C([D({type:Boolean,reflect:!0})],rn.prototype,"disabled",2);C([D({type:Number})],rn.prototype,"distance",2);C([D({type:Boolean,reflect:!0})],rn.prototype,"open",2);C([D({type:Number})],rn.prototype,"skidding",2);C([D()],rn.prototype,"trigger",2);C([D({type:Boolean})],rn.prototype,"hoist",2);C([mt("open",{waitUntilFirstUpdate:!0})],rn.prototype,"handleOpenChange",1);C([mt(["content","distance","hoist","placement","skidding"])],rn.prototype,"handleOptionsChange",1);C([mt("disabled")],rn.prototype,"handleDisabledChange",1);rn=C([un("sl-tooltip")],rn);mr("tooltip.show",{keyframes:[{opacity:0,scale:.8},{opacity:1,scale:1}],options:{duration:150,easing:"ease"}});mr("tooltip.hide",{keyframes:[{opacity:1,scale:1},{opacity:0,scale:.8}],options:{duration:150,easing:"ease"}});const L0=G("<style></style>"),TK=G('<sl-tooltip><sl-icon name="info-circle"></sl-icon></sl-tooltip>');qt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");const t7=e=>{const t=Fe({placement:"top",maxWidth:"200px"},e);return[(()=>{const n=L0.cloneNode(!0);return T(n,Mt),n})(),(()=>{const n=L0.cloneNode(!0);return T(n,Jn),n})(),(()=>{const n=L0.cloneNode(!0);return T(n,er),n})(),(()=>{const n=se(()=>document.importNode(TK,!0)),r=n.firstChild;return n._$owner=ce(),r._$owner=ce(),ee(i=>{const o=t.tip,a=t.placement,s=t.maxWidth;return o!==i._v$&&(n.content=i._v$=o),a!==i._v$2&&(n.placement=i._v$2=a),s!==i._v$3&&n.style.setProperty("--max-width",i._v$3=s),i},{_v$:void 0,_v$2:void 0,_v$3:void 0}),n})()]},NK=G('<div class="flex items-center space-x-2 text-slate-500"></div>'),PK=G('<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.</p></photon-dialog></div>'),AK=zt(pi(xB(zs()),1,1/0),"You must add at least 1 Prescription"),IK=e=>{const[t,n]=B(!1),[r,i]=B(!1),[o,a]=B(void 0),[s,l]=B();e.actions.registerValidator({key:"draftPrescriptions",validator:AK});const d=()=>{o().treatment&&(e7(e.actions,o()),e.actions.updateFormValue({key:"catalogId",value:o().catalogId}),e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(v=>v.id!==o().id)}),window.scrollTo({behavior:"smooth",top:(e.prescriptionRef?.getBoundingClientRect().top||0)-document.body.getBoundingClientRect().top-70}))},c=v=>{const y=e.store.draftPrescriptions.value.find(k=>k.id===v);a(y),e.store.treatment.value?i(!0):(e.setIsEditing(!0),d())},u=()=>{d(),i(!1),a(void 0)},f=()=>{i(!1),a(void 0)},h=()=>{e.actions.updateFormValue({key:"draftPrescriptions",value:e.store.draftPrescriptions.value.filter(v=>v.id!==s())}),n(!1),l(void 0),e.store.draftPrescriptions?.value?.length===0&&e.setIsEditing(!0)},p=()=>{n(!1),l(void 0)};return(()=>{const v=se(()=>document.importNode(PK,!0)),y=v.firstChild,k=y.nextSibling,_=k.nextSibling;return T(y,Kr),k.addEventListener("photon-dialog-confirmed",u),k.addEventListener("photon-dialog-canceled",f),k.addEventListener("photon-dialog-alt",f),k._$owner=ce(),_.addEventListener("photon-dialog-confirmed",h),_.addEventListener("photon-dialog-canceled",p),_.addEventListener("photon-dialog-alt",p),_._$owner=ce(),T(v,g(yn,{get children(){return[(()=>{const b=NK.cloneNode(!0);return T(b,g(we,{color:"gray",class:"pr-2",children:"Pending Order"}),null),T(b,g(t7,{maxWidth:"300px",tip:"Each prescription will include the prescriber\u2019s digital signature and the date it was written when the order is sent to the pharmacy."}),null),b})(),g(AL,{get draftPrescriptions(){return e.store.draftPrescriptions?.value??[]},handleDelete:b=>{n(!0),l(b)},handleEdit:b=>{c(b)},get templateIds(){return e.templateIds},get templateOverrides(){return e.templateOverrides},get prescriptionIds(){return e.prescriptionIds},setDraftPrescriptions:b=>{e.actions.updateFormValue({key:"draftPrescriptions",value:b})},get error(){return e.store.draftPrescriptions?.error}})]}}),null),ee(b=>{const x=r(),O=t();return x!==b._v$&&(k.open=b._v$=x),O!==b._v$2&&(_.open=b._v$2=O),b},{_v$:void 0,_v$2:void 0}),v})()},MK=G('<div class="flex items-center justify-between"></div>'),DK=G("<div><style></style></div>"),FK=e=>{const t=Q(()=>e.store.patient?.value?[e.store.patient?.value?.id]:[]),n=Q(()=>{const r=e.store.patient?.value?.address;return r?`${r.street1} ${r.street2||""} ${r.city}, ${r.state} ${r.postalCode}`:""});return(()=>{const r=DK.cloneNode(!0),i=r.firstChild;return T(i,Kr),T(r,g(yn,{get children(){return[(()=>{const o=MK.cloneNode(!0);return T(o,g(we,{color:"gray",children:"Select Pharmacy"})),o})(),g(Xz,{get enableSendToPatient(){return e.enableSendToPatient},get enableLocalPickup(){return e.enableLocalPickup||!e?.enableSendToPatient&&!e?.mailOrderIds},get mailOrderPharmacyIds(){return Q(()=>!!e.mailOrderIds)()?e.mailOrderIds.split(","):void 0},get patientIds(){return t()},get address(){return n()},setFufillmentType:o=>{e.actions.updateFormValue({key:"fulfillmentType",value:o||""})},setPreferredPharmacy:(o=!1)=>{e.actions.updateFormValue({key:"updatePreferredPharmacy",value:o})},setPharmacyId:o=>{e.actions.updateFormValue({key:"pharmacy",value:o})}})]}}),null),r})()},RK=G('<div class="flex items-center justify-between"></div>'),LK=G("<photon-patient-select></photon-patient-select>"),zK=G("<div><photon-patient-dialog></photon-patient-dialog></div>"),jK=G('<div><photon-med-search-dialog title="Add Medication History"></photon-med-search-dialog></div>'),VK=G('<div class="flex flex-col gap-8"></div>'),UK=zt(qh(Mn(),zs()),"Please select a patient..."),BK=zt(qh(Mn(),zs()),"Please enter an address for patient..."),HK=e=>{const[t,n]=B(void 0),[r,i]=B(!1),[o,a]=B(!1),{actions:s,store:l}=vu;at(()=>{e.actions.registerValidator({key:"patient",validator:UK}),e.enableOrder&&e.actions.registerValidator({key:"address",validator:BK}),e?.patientId&&s.getSelectedPatient(e.client.getSDK(),e.patientId)});const d=f=>{e.actions.updateFormValue({key:"patient",value:f.detail.patient}),e.enableOrder&&!e.address&&e.actions.updateFormValue({key:"address",value:f.detail.patient.address})};pe(()=>{l?.selectedPatient?.data&&e?.patientId&&d({detail:{patient:l?.selectedPatient?.data}})});const c=Q(()=>e.store.patient?.value?.id||e?.patientId),u=Q(()=>e.store.patient?.value?.id&&!e.store.patient?.value?.address&&e.enableOrder);return(()=>{const f=VK.cloneNode(!0);return T(f,g(oe,{get when(){return!e?.patientId},get children(){return g(yn,{get children(){return[(()=>{const h=RK.cloneNode(!0);return T(h,g(we,{color:"gray",get children(){return e?.patientId?"Patient":"Select Patient"}})),h})(),(()=>{const h=se(()=>document.importNode(LK,!0));return h.addEventListener("photon-patient-selected",d),h._$owner=ce(),ee(p=>{const v=e.store.patient?.error??!1,y=e.store.patient?.error,k=e.store.patient?.value?.id??e.patientId,_=e.client.getSDK();return v!==p._v$&&(h.invalid=p._v$=v),y!==p._v$2&&(h.helpText=p._v$2=y),k!==p._v$3&&(h.selected=p._v$3=k),_!==p._v$4&&(h.sdk=p._v$4=_),p},{_v$:void 0,_v$2:void 0,_v$3:void 0,_v$4:void 0}),h})()]}})}}),null),T(f,g(oe,{get when(){return c()},get children(){const h=se(()=>document.importNode(zK,!0)),p=h.firstChild;return T(h,g(HL,{get patientId(){return c()},get weight(){return e?.weight},get weightUnit(){return e?.weightUnit},get editPatient(){return e?.enableOrder&&!u()?()=>i(!0):void 0},get address(){return e?.address||e.store.patient?.value?.address}}),p),p.hideCreatePrescription=!0,p.addEventListener("photon-patient-updated",()=>{s.getSelectedPatient(e.client.getSDK(),e.store.patient?.value?.id),i(!1)}),p.addEventListener("photon-patient-closed",()=>{i(!1)}),p._$owner=ce(),ee(v=>{const y=r(),k=c();return y!==v._v$5&&(p.open=v._v$5=y),k!==v._v$6&&(p.patientId=v._v$6=k),v},{_v$5:void 0,_v$6:void 0}),h}}),null),T(f,g(oe,{get when(){return Q(()=>!!e.enableMedHistory)()&&c()},get children(){const h=se(()=>document.importNode(jK,!0)),p=h.firstChild;return T(h,g(sz,{get patientId(){return c()},openAddMedication:()=>a(!0),get newMedication(){return t()}}),p),p.withConcept=!0,p.addEventListener("photon-medication-selected",v=>{n(v.detail.medication),a(!1)}),p.addEventListener("photon-medication-closed",()=>{a(!1)}),p._$owner=ce(),ee(()=>p.open=o()),h}}),null),T(f,g(oe,{get when(){return u()},get children(){return g(PF,{get patientId(){return c()},setAddress:h=>{e.actions.updateFormValue({key:"address",value:h}),e.actions.updateFormValue({key:"patient",value:{...e.store.patient.value,address:h}})}})}}),null),f})()},qK=G("<span>, </span>"),WK=G('<div class="flex flex-col items-start"></div>'),GK=G('<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</p></div></div></photon-card>'),QK=e=>{const t=Nn(),[n,r]=B(null),i=async o=>{if(o&&t){const{data:a}=await t.getSDK().clinical.pharmacy.getPharmacy({id:o});r(a.pharmacy)}};return pe(()=>{e.pharmacyId&&i(e.pharmacyId)}),(()=>{const o=se(()=>document.importNode(GK,!0)),a=o.firstChild;return a.firstChild,o._$owner=ce(),T(a,g(oe,{get when(){return n()},get children(){return g($s,{label:"Pharmacies",get initSelected(){return e?.pharmacyId||""},get children(){return g($s.Option,{get value(){return e?.pharmacyId||""},get children(){const s=WK.cloneNode(!0);return T(s,g(we,{get loading(){return!n()},sampleLoadingText:"Loading Name",get children(){return n()?.name}}),null),T(s,g(we,{get loading(){return!n()},color:"gray",size:"sm",sampleLoadingText:"Cityville, ST",get children(){const l=qK.cloneNode(!0),d=l.firstChild;return T(l,()=>n()?.address?.city,d),T(l,()=>n()?.address?.state,null),l}}),null),s}})}})}}),null),o})()},KK=`.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}
|
|
3476
|
-
`,YK=G('<div class="w-full flex justify-center"></div>'),ZK=G("<div></div>"),XK=G('<div class="m-3"></div>'),JK=G('<div class="flex flex-row justify-end gap-2"></div>'),eY=G('<div><style></style><style></style><style></style><style></style><style></style><div><div class="flex flex-col gap-8"></div></div></div>'),tY=G("<div>No errors...</div>"),nY=G('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>Error with <!>: </strong><br><br></sl-alert>');qt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");function rY(e){let t;const n=Nn(),[r,i]=B(!e.templateIds&&!e.prescriptionIds),[o,a]=B([]),[s,l]=B(!0),[d,c]=B(!1),[u,f]=B(n?.authentication.state.isAuthenticated||!1),[,h]=$a();at(()=>{e.address&&e.formActions.updateFormValue({key:"address",value:e.address}),t.addEventListener("photon-ticket-created-duplicate",()=>{Pf(e.formActions,e.weight?{notes:es(e.weight,e?.weightUnit)}:void 0)})}),pe(()=>{!n?.authentication.state.isAuthenticated&&!n?.authentication.state.isLoading&&!n?.authentication.state.error&&n?.autoLogin&&n?.authentication.login({appState:{returnTo:window.location.pathname}})}),pe(()=>{l(n?.authentication.state.isLoading||!1)}),pe(()=>{f(n?.authentication.state.isAuthenticated||!1)});const p=Q(()=>{const z=e.formStore?.address?.value??e.formStore?.patient?.value?.address??{},{__typename:U,name:W,...R}=z;return{street2:"",country:"US",...R}}),v=z=>{const U=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{prescriptions:z}});t?.dispatchEvent(U)},y=z=>{const U=new CustomEvent("photon-order-created",{composed:!0,bubbles:!0,detail:{order:z}});t?.dispatchEvent(U)},k=z=>{const U=new CustomEvent("photon-prescriptions-error",{composed:!0,bubbles:!0,detail:{errors:z}});t?.dispatchEvent(U)},_=(z=[])=>{const U=new CustomEvent("photon-order-error",{composed:!0,bubbles:!0,detail:{errors:z}});t?.dispatchEvent(U)},b=z=>{const U=new CustomEvent("photon-form-validate",{composed:!0,bubbles:!0,detail:{canSubmit:z,form:e.formStore,actions:e.formActions}});t?.dispatchEvent(U)},x=()=>(_(),h.setIsCombineDialogOpen(!0,()=>O(e.enableOrder),e.formStore.draftPrescriptions.value,p())),O=async z=>{a([]);const U=z?["patient","draftPrescriptions","pharmacy","address"]:["patient","draftPrescriptions"];e.formActions.validate(U);const W=e.formActions.getErrors(U);if(W.length===0){l(!0),e.formActions.updateFormValue({key:"errors",value:[]});const R=n.getSDK().clinical.order.createOrder({}),L=n.getSDK().clinical.patient.removePatientPreferredPharmacy({}),q=n.getSDK().clinical.patient.updatePatient({}),I=n.getSDK().clinical.prescription.createPrescriptions({}),ne=[],ie=n.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({});for(const Z of e.formStore.draftPrescriptions.value){const te={daysSupply:Z.daysSupply,dispenseAsWritten:Z.dispenseAsWritten,dispenseQuantity:Z.dispenseQuantity,dispenseUnit:Z.dispenseUnit,effectiveDate:Z.effectiveDate,instructions:Z.instructions,notes:Z.notes,patientId:e.formStore.patient?.value.id,fillsAllowed:Z.refillsInput?Z.refillsInput+1:1,treatmentId:Z.treatment.id};if(Z.addToTemplates)try{const{errors:V}=await ie({variables:{...te,catalogId:Z.catalogId,isPrivate:!0},awaitRefetchQueries:!1});V&&_(V)}catch(V){_([V])}ne.push(te)}const{data:j,errors:re}=await I({variables:{prescriptions:ne},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder||l(!1),re){k(re);return}if(v(j.createPrescriptions),e.enableOrder){if(e.formStore.updatePreferredPharmacy?.value&&e.formStore.pharmacy?.value&&e.formStore.fulfillmentType?.value==="PICK_UP"){const V=e.formStore.patient?.value;V?.preferredPharmacies&&V?.preferredPharmacies?.length>0&&L({variables:{patientId:V.id,pharmacyId:V?.preferredPharmacies?.[0]?.id},awaitRefetchQueries:!1}),q({variables:{id:V.id,preferredPharmacies:[e.formStore.pharmacy?.value]},awaitRefetchQueries:!1})}const{data:Z,errors:te}=await R({variables:{...e.externalOrderId?{externalId:e.externalOrderId}:{},patientId:e.formStore.patient?.value.id,pharmacyId:e?.pharmacyId||e.formStore.pharmacy?.value||"",fulfillmentType:e.formStore.fulfillmentType?.value||"",address:p(),fills:j?.createPrescriptions.map(V=>({prescriptionId:V.id}))},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder&&l(!1),te){_(te);return}y(Z.createOrder)}}else a(W)},N=()=>e.enableCombineAndDuplicate&&h.hasRoutingOrder()?x():O(e.enableOrder);pe(()=>{e.triggerSubmit&&N()}),pe(()=>{b(Boolean(e.formStore.draftPrescriptions?.value?.length>0&&e.formStore.patient?.value))});const P=n.sdk.apolloClinical;let A;return(()=>{const z=eY.cloneNode(!0),U=z.firstChild,W=U.nextSibling,R=W.nextSibling,L=R.nextSibling,q=L.nextSibling,I=q.nextSibling,ne=I.firstChild,ie=t;return typeof ie=="function"?He(ie,z):t=z,T(U,Mt),T(W,Jn),T(R,er),T(L,KK),T(q,Kr),T(z,g(oe,{get when(){return e.enableCombineAndDuplicate},get children(){return[g(Vr.DuplicateDialog,{}),g(Vr.CombineDialog,{}),g(Vr.IssueDialog,{})]}}),I),T(I,g(Mj,{get buffer(){return e?.toastBuffer||0}}),ne),T(ne,g(oe,{get when(){return Q(()=>!!(!n||s()))()&&!u()},get children(){const j=YK.cloneNode(!0);return T(j,g(Qr,{color:"green"})),j}}),null),T(ne,g(R9,{permissions:["write:prescription"],get children(){return g(Bj,{client:P,get children(){return[g(HK,{get actions(){return e.formActions},get store(){return e.formStore},get patientId(){return e.patientId},client:n,get enableOrder(){return e.enableOrder},get address(){return e.address},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get enableMedHistory(){return e.enableMedHistory}}),g(oe,{get when(){return e.formStore.patient?.value?.address||e.formStore.patient?.value?.id&&!e.enableOrder},get children(){return[g(oe,{get when(){return e.enableCombineAndDuplicate},get children(){return g(Vr.Card,{})}}),g(oe,{get when(){return r()||d()},get children(){const j=ZK.cloneNode(!0),re=A;return typeof re=="function"?He(re,j):A=j,T(j,g(SK,{get hideAddToTemplates(){return e.hideTemplates},get actions(){return e.formActions},get store(){return e.formStore},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get enableCombineAndDuplicate(){return e.enableCombineAndDuplicate}})),j}}),g(IK,{get templateIds(){return e.templateIds?.split(",")||[]},get templateOverrides(){return e.templateOverrides||{}},get prescriptionIds(){return e.prescriptionIds?.split(",")||[]},prescriptionRef:A,get actions(){return e.formActions},get store(){return e.formStore},setIsEditing:c}),g(oe,{get when(){return e.enableOrder&&!e.pharmacyId},get children(){return g(FK,{get store(){return e.formStore},get actions(){return e.formActions},get enableLocalPickup(){return e.enableLocalPickup},get enableSendToPatient(){return e.enableSendToPatient},get mailOrderIds(){return e.mailOrderIds}})}}),g(oe,{get when(){return e.enableOrder&&e.pharmacyId},get children(){return g(QK,{get pharmacyId(){return e.pharmacyId}})}}),g(oe,{get when(){return!e.hideSubmit},get children(){return[g(oe,{get when(){return o().length>0&&e.enableOrder},get children(){const j=XK.cloneNode(!0);return T(j,g(It,{get each(){return o()},get fallback(){return tY.cloneNode(!0)},children:({key:re,error:Z})=>(()=>{const te=se(()=>document.importNode(nY,!0)),V=te.firstChild,_e=V.nextSibling,Te=_e.firstChild,je=Te.nextSibling;je.nextSibling;const ae=_e.nextSibling,Ee=ae.nextSibling;return te._$owner=ce(),V._$owner=ce(),T(_e,re,je),T(te,Z,Ee),T(te,()=>JSON.stringify(e.formStore?.[re]?.value||{}),null),te})()})),j}}),(()=>{const j=JK.cloneNode(!0);return T(j,g(oe,{get when(){return!r()},get children(){return g(Ze,{variant:"secondary",onClick:()=>i(!0),children:"Add Prescription"})}}),null),T(j,g(Ze,{get loading(){return s()},onClick:N,get children(){return e.enableOrder?"Send Order":"Save Prescriptions"}}),null),j})()]}})]}})]}})}}),null),z})()}const iY=e=>{const{store:t,actions:n}=D9({dispenseAsWritten:!1,patient:void 0,treatment:void 0,draftPrescriptions:[],pharmacy:void 0,errors:[],address:void 0});return g(Vr,{get patientId(){return t.patient?.value?.id},get children(){return g(rY,{get patientId(){return e.patientId},get templateIds(){return e.templateIds},get templateOverrides(){return e.templateOverrides},get prescriptionIds(){return e.prescriptionIds},get hideSubmit(){return e.hideSubmit},get hideTemplates(){return e.hideTemplates},get enableOrder(){return e.enableOrder},get enableLocalPickup(){return e.enableLocalPickup},get enableSendToPatient(){return e.enableSendToPatient},get enableMedHistory(){return e.enableMedHistory},get enableCombineAndDuplicate(){return e.enableCombineAndDuplicate},get mailOrderIds(){return e.mailOrderIds},get pharmacyId(){return e.pharmacyId},get loading(){return e.loading},get address(){return e.address},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get triggerSubmit(){return e.triggerSubmit},get toastBuffer(){return e.toastBuffer},formStore:t,formActions:n,get externalOrderId(){return e.externalOrderId}})}})};lt("photon-prescribe-workflow",{patientId:void 0,templateIds:void 0,templateOverrides:void 0,prescriptionIds:void 0,hideSubmit:!1,hideTemplates:!1,enableOrder:!1,enableLocalPickup:!1,enableSendToPatient:!1,enableCombineAndDuplicate:!1,enableMedHistory:!1,mailOrderIds:void 0,pharmacyId:void 0,loading:!1,address:void 0,weight:void 0,weightUnit:"lbs",triggerSubmit:!1,setTriggerSubmit:void 0,toastBuffer:0,externalOrderId:void 0},iY);const oY=G('<p class="font-sans text-l font-medium mb-2"></p>'),aY=G('<sl-icon-button class="self-start"></sl-icon-button>'),sY=G("<style></style>"),lY=G('<div class="rounded-lg bg-white p-4 shadow-card border border-gray-200"></div>'),dY=G('<div class="flex flex-row justify-between"></div>'),cY=G("<slot></slot>"),uY=e=>{const[t,n]=B(!0);let r=null,i=null;return e.title&&(r=(()=>{const o=oY.cloneNode(!0);return T(o,()=>e.title),o})()),e.collapsable&&(i=(()=>{const o=se(()=>document.importNode(aY,!0));return o.addEventListener("click",()=>{n(!t())}),o._$owner=ce(),ee(()=>o.name=t()?"chevron-right":"chevron-down"),o})()),[(()=>{const o=sY.cloneNode(!0);return T(o,Mt),o})(),(()=>{const o=lY.cloneNode(!0);return T(o,r||i?(()=>{const a=dY.cloneNode(!0);return T(a,r,null),T(a,i,null),a})():null,null),T(o,(()=>{const a=Q(()=>!!(e.collapsable&&t()));return()=>a()?null:(()=>{const s=cY.cloneNode(!0);return s._$owner=ce(),s})()})(),null),ee(a=>{const s=!!e.invalid,l=!!e.invalid;return s!==a._v$&&o.classList.toggle("border-red-400",a._v$=s),l!==a._v$2&&o.classList.toggle("border-2",a._v$2=l),a},{_v$:void 0,_v$2:void 0}),o})()]};lt("photon-card",{invalid:!1,title:null,collapsable:!1},uY);const fY=tu`
|
|
3491
|
+
`,YK=G('<div class="w-full flex justify-center"></div>'),ZK=G("<div></div>"),XK=G('<div class="m-3"></div>'),JK=G('<div class="flex flex-row justify-end gap-2"></div>'),eY=G('<div><style></style><style></style><style></style><style></style><style></style><div><div class="flex flex-col gap-8"></div></div></div>'),tY=G("<div>No errors...</div>"),nY=G('<sl-alert variant="warning" open><sl-icon slot="icon" name="exclamation-triangle"></sl-icon><strong>Error with <!>: </strong><br><br></sl-alert>');qt("https://cdn.jsdelivr.net/npm/@shoelace-style/shoelace@2.4.0/dist/");function rY(e){let t;const n=Nn(),[r,i]=B(!e.templateIds&&!e.prescriptionIds),[o,a]=B([]),[s,l]=B(!0),[d,c]=B(!1),[u,f]=B(n?.authentication.state.isAuthenticated||!1),[,h]=$a();at(()=>{e.address&&e.formActions.updateFormValue({key:"address",value:e.address}),t.addEventListener("photon-ticket-created-duplicate",()=>{Pf(e.formActions,e.weight?{notes:es(e.weight,e?.weightUnit)}:void 0)})}),pe(()=>{!n?.authentication.state.isAuthenticated&&!n?.authentication.state.isLoading&&!n?.authentication.state.error&&n?.autoLogin&&n?.authentication.login({appState:{returnTo:window.location.pathname}})}),pe(()=>{l(n?.authentication.state.isLoading||!1)}),pe(()=>{f(n?.authentication.state.isAuthenticated||!1)});const p=Q(()=>{const z=e.formStore?.address?.value??e.formStore?.patient?.value?.address??{},{__typename:U,name:W,...R}=z;return{street2:"",country:"US",...R}}),v=z=>{const U=new CustomEvent("photon-prescriptions-created",{composed:!0,bubbles:!0,detail:{prescriptions:z}});t?.dispatchEvent(U)},y=z=>{const U=new CustomEvent("photon-order-created",{composed:!0,bubbles:!0,detail:{order:z}});t?.dispatchEvent(U)},k=z=>{const U=new CustomEvent("photon-prescriptions-error",{composed:!0,bubbles:!0,detail:{errors:z}});t?.dispatchEvent(U)},_=(z=[])=>{const U=new CustomEvent("photon-order-error",{composed:!0,bubbles:!0,detail:{errors:z}});t?.dispatchEvent(U)},b=z=>{const U=new CustomEvent("photon-form-validate",{composed:!0,bubbles:!0,detail:{canSubmit:z,form:e.formStore,actions:e.formActions}});t?.dispatchEvent(U)},x=()=>h.setIsCombineDialogOpen(!0,()=>O(e.enableOrder),e.formStore.draftPrescriptions.value,p()),O=async z=>{a([]);const U=z?["patient","draftPrescriptions","pharmacy","address"]:["patient","draftPrescriptions"];e.formActions.validate(U);const W=e.formActions.getErrors(U);if(W.length===0){l(!0),e.formActions.updateFormValue({key:"errors",value:[]});const R=n.getSDK().clinical.order.createOrder({}),L=n.getSDK().clinical.patient.removePatientPreferredPharmacy({}),q=n.getSDK().clinical.patient.updatePatient({}),I=n.getSDK().clinical.prescription.createPrescriptions({}),ne=[],ie=n.getSDK().clinical.prescriptionTemplate.createPrescriptionTemplate({});for(const Z of e.formStore.draftPrescriptions.value){const te={daysSupply:Z.daysSupply,dispenseAsWritten:Z.dispenseAsWritten,dispenseQuantity:Z.dispenseQuantity,dispenseUnit:Z.dispenseUnit,effectiveDate:Z.effectiveDate,instructions:Z.instructions,notes:Z.notes,patientId:e.formStore.patient?.value.id,fillsAllowed:Z.refillsInput?Z.refillsInput+1:1,treatmentId:Z.treatment.id};if(Z.addToTemplates)try{const{errors:V}=await ie({variables:{...te,catalogId:Z.catalogId,isPrivate:!0},awaitRefetchQueries:!1});V&&_(V)}catch(V){_([V])}ne.push(te)}const{data:j,errors:re}=await I({variables:{prescriptions:ne},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder||l(!1),re){k(re);return}if(v(j.createPrescriptions),e.enableOrder){if(e.formStore.updatePreferredPharmacy?.value&&e.formStore.pharmacy?.value&&e.formStore.fulfillmentType?.value==="PICK_UP"){const V=e.formStore.patient?.value;V?.preferredPharmacies&&V?.preferredPharmacies?.length>0&&L({variables:{patientId:V.id,pharmacyId:V?.preferredPharmacies?.[0]?.id},awaitRefetchQueries:!1}),q({variables:{id:V.id,preferredPharmacies:[e.formStore.pharmacy?.value]},awaitRefetchQueries:!1})}const{data:Z,errors:te}=await R({variables:{...e.externalOrderId?{externalId:e.externalOrderId}:{},patientId:e.formStore.patient?.value.id,pharmacyId:e?.pharmacyId||e.formStore.pharmacy?.value||"",fulfillmentType:e.formStore.fulfillmentType?.value||"",address:p(),fills:j?.createPrescriptions.map(V=>({prescriptionId:V.id}))},refetchQueries:[],awaitRefetchQueries:!1});if(e.enableOrder&&l(!1),te){_(te);return}y(Z.createOrder)}}else a(W)},N=()=>e.enableCombineAndDuplicate&&h.hasRoutingOrder()?x():O(e.enableOrder);pe(()=>{e.triggerSubmit&&N()}),pe(()=>{b(Boolean(e.formStore.draftPrescriptions?.value?.length>0&&e.formStore.patient?.value))});const P=n.sdk.apolloClinical;let A;return(()=>{const z=eY.cloneNode(!0),U=z.firstChild,W=U.nextSibling,R=W.nextSibling,L=R.nextSibling,q=L.nextSibling,I=q.nextSibling,ne=I.firstChild,ie=t;return typeof ie=="function"?He(ie,z):t=z,T(U,Mt),T(W,Jn),T(R,er),T(L,KK),T(q,Kr),T(z,g(oe,{get when(){return e.enableCombineAndDuplicate},get children(){return[g(Vr.DuplicateDialog,{}),g(Vr.CombineDialog,{}),g(Vr.IssueDialog,{})]}}),I),T(I,g(Mj,{get buffer(){return e?.toastBuffer||0}}),ne),T(ne,g(oe,{get when(){return Q(()=>!!(!n||s()))()&&!u()},get children(){const j=YK.cloneNode(!0);return T(j,g(Qr,{color:"green"})),j}}),null),T(ne,g(R9,{permissions:["write:prescription"],get children(){return g(Bj,{client:P,get children(){return[g(HK,{get actions(){return e.formActions},get store(){return e.formStore},get patientId(){return e.patientId},client:n,get enableOrder(){return e.enableOrder},get address(){return e.address},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get enableMedHistory(){return e.enableMedHistory}}),g(oe,{get when(){return e.formStore.patient?.value?.address||e.formStore.patient?.value?.id&&!e.enableOrder},get children(){return[g(oe,{get when(){return e.enableCombineAndDuplicate},get children(){return g(Vr.Card,{})}}),g(oe,{get when(){return r()||d()},get children(){const j=ZK.cloneNode(!0),re=A;return typeof re=="function"?He(re,j):A=j,T(j,g(SK,{get hideAddToTemplates(){return e.hideTemplates},get actions(){return e.formActions},get store(){return e.formStore},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get enableCombineAndDuplicate(){return e.enableCombineAndDuplicate}})),j}}),g(IK,{get templateIds(){return e.templateIds?.split(",")||[]},get templateOverrides(){return e.templateOverrides||{}},get prescriptionIds(){return e.prescriptionIds?.split(",")||[]},prescriptionRef:A,get actions(){return e.formActions},get store(){return e.formStore},setIsEditing:c}),g(oe,{get when(){return e.enableOrder&&!e.pharmacyId},get children(){return g(FK,{get store(){return e.formStore},get actions(){return e.formActions},get enableLocalPickup(){return e.enableLocalPickup},get enableSendToPatient(){return e.enableSendToPatient},get mailOrderIds(){return e.mailOrderIds}})}}),g(oe,{get when(){return e.enableOrder&&e.pharmacyId},get children(){return g(QK,{get pharmacyId(){return e.pharmacyId}})}}),g(oe,{get when(){return!e.hideSubmit},get children(){return[g(oe,{get when(){return o().length>0&&e.enableOrder},get children(){const j=XK.cloneNode(!0);return T(j,g(It,{get each(){return o()},get fallback(){return tY.cloneNode(!0)},children:({key:re,error:Z})=>(()=>{const te=se(()=>document.importNode(nY,!0)),V=te.firstChild,_e=V.nextSibling,Te=_e.firstChild,je=Te.nextSibling;je.nextSibling;const ae=_e.nextSibling,Ee=ae.nextSibling;return te._$owner=ce(),V._$owner=ce(),T(_e,re,je),T(te,Z,Ee),T(te,()=>JSON.stringify(e.formStore?.[re]?.value||{}),null),te})()})),j}}),(()=>{const j=JK.cloneNode(!0);return T(j,g(oe,{get when(){return!r()},get children(){return g(Ze,{variant:"secondary",onClick:()=>i(!0),children:"Add Prescription"})}}),null),T(j,g(Ze,{get loading(){return s()},onClick:N,get children(){return e.enableOrder?"Send Order":"Save Prescriptions"}}),null),j})()]}})]}})]}})}}),null),z})()}const iY=e=>{const{store:t,actions:n}=D9({dispenseAsWritten:!1,patient:void 0,treatment:void 0,draftPrescriptions:[],pharmacy:void 0,errors:[],address:void 0});return g(Vr,{get patientId(){return t.patient?.value?.id},get children(){return g(rY,{get patientId(){return e.patientId},get templateIds(){return e.templateIds},get templateOverrides(){return e.templateOverrides},get prescriptionIds(){return e.prescriptionIds},get hideSubmit(){return e.hideSubmit},get hideTemplates(){return e.hideTemplates},get enableOrder(){return e.enableOrder},get enableLocalPickup(){return e.enableLocalPickup},get enableSendToPatient(){return e.enableSendToPatient},get enableMedHistory(){return e.enableMedHistory},get enableCombineAndDuplicate(){return e.enableCombineAndDuplicate},get mailOrderIds(){return e.mailOrderIds},get pharmacyId(){return e.pharmacyId},get loading(){return e.loading},get address(){return e.address},get weight(){return e.weight},get weightUnit(){return e.weightUnit},get triggerSubmit(){return e.triggerSubmit},get toastBuffer(){return e.toastBuffer},formStore:t,formActions:n,get externalOrderId(){return e.externalOrderId}})}})};lt("photon-prescribe-workflow",{patientId:void 0,templateIds:void 0,templateOverrides:void 0,prescriptionIds:void 0,hideSubmit:!1,hideTemplates:!1,enableOrder:!1,enableLocalPickup:!1,enableSendToPatient:!1,enableCombineAndDuplicate:!1,enableMedHistory:!1,mailOrderIds:void 0,pharmacyId:void 0,loading:!1,address:void 0,weight:void 0,weightUnit:"lbs",triggerSubmit:!1,setTriggerSubmit:void 0,toastBuffer:0,externalOrderId:void 0},iY);const oY=G('<p class="font-sans text-l font-medium mb-2"></p>'),aY=G('<sl-icon-button class="self-start"></sl-icon-button>'),sY=G("<style></style>"),lY=G('<div class="rounded-lg bg-white p-4 shadow-card border border-gray-200"></div>'),dY=G('<div class="flex flex-row justify-between"></div>'),cY=G("<slot></slot>"),uY=e=>{const[t,n]=B(!0);let r=null,i=null;return e.title&&(r=(()=>{const o=oY.cloneNode(!0);return T(o,()=>e.title),o})()),e.collapsable&&(i=(()=>{const o=se(()=>document.importNode(aY,!0));return o.addEventListener("click",()=>{n(!t())}),o._$owner=ce(),ee(()=>o.name=t()?"chevron-right":"chevron-down"),o})()),[(()=>{const o=sY.cloneNode(!0);return T(o,Mt),o})(),(()=>{const o=lY.cloneNode(!0);return T(o,r||i?(()=>{const a=dY.cloneNode(!0);return T(a,r,null),T(a,i,null),a})():null,null),T(o,(()=>{const a=Q(()=>!!(e.collapsable&&t()));return()=>a()?null:(()=>{const s=cY.cloneNode(!0);return s._$owner=ce(),s})()})(),null),ee(a=>{const s=!!e.invalid,l=!!e.invalid;return s!==a._v$&&o.classList.toggle("border-red-400",a._v$=s),l!==a._v$2&&o.classList.toggle("border-2",a._v$2=l),a},{_v$:void 0,_v$2:void 0}),o})()]};lt("photon-card",{invalid:!1,title:null,collapsable:!1},uY);const fY=tu`
|
|
3477
3492
|
fragment CatalogTreatmentsFields on Catalog {
|
|
3478
3493
|
id
|
|
3479
3494
|
treatments {
|
package/dist/index.mjs
CHANGED
|
@@ -30595,6 +30595,21 @@ const Oj = /* @__PURE__ */ $('<div class="flex flex-col gap-6"><div><div class="
|
|
|
30595
30595
|
mutation RecentOrdersCombineDialogUpdateOrder($orderId: ID!, $fills: [FillInput!]!) {
|
|
30596
30596
|
updateOrder(id: $orderId, fills: $fills) {
|
|
30597
30597
|
id
|
|
30598
|
+
createdAt
|
|
30599
|
+
fills {
|
|
30600
|
+
id
|
|
30601
|
+
prescription {
|
|
30602
|
+
id
|
|
30603
|
+
dispenseQuantity
|
|
30604
|
+
dispenseUnit
|
|
30605
|
+
fillsAllowed
|
|
30606
|
+
instructions
|
|
30607
|
+
notes
|
|
30608
|
+
}
|
|
30609
|
+
treatment {
|
|
30610
|
+
name
|
|
30611
|
+
}
|
|
30612
|
+
}
|
|
30598
30613
|
}
|
|
30599
30614
|
}
|
|
30600
30615
|
`, Pj = Ln`
|
|
@@ -30621,7 +30636,7 @@ function Aj() {
|
|
|
30621
30636
|
composed: !0,
|
|
30622
30637
|
bubbles: !0,
|
|
30623
30638
|
detail: {
|
|
30624
|
-
|
|
30639
|
+
order: b
|
|
30625
30640
|
}
|
|
30626
30641
|
});
|
|
30627
30642
|
e?.dispatchEvent(x);
|
|
@@ -30689,14 +30704,14 @@ function Aj() {
|
|
|
30689
30704
|
}
|
|
30690
30705
|
try {
|
|
30691
30706
|
const O = await y(b.id, x.createPrescriptions.map((N) => N.id));
|
|
30692
|
-
u(O.updateOrder
|
|
30707
|
+
u(O.updateOrder), s(!1);
|
|
30693
30708
|
return;
|
|
30694
30709
|
} catch {
|
|
30695
30710
|
try {
|
|
30696
30711
|
if (!n?.address || !n?.patientId)
|
|
30697
30712
|
throw new Error("No address provided");
|
|
30698
30713
|
const O = await k(n.patientId, x.createPrescriptions.map((N) => N.id), n.address);
|
|
30699
|
-
f(O.createOrder);
|
|
30714
|
+
f(O.createOrder), s(!1);
|
|
30700
30715
|
} catch {
|
|
30701
30716
|
dr({
|
|
30702
30717
|
header: "Error Creating Order",
|
|
@@ -31700,7 +31715,7 @@ class nV {
|
|
|
31700
31715
|
}
|
|
31701
31716
|
}
|
|
31702
31717
|
}
|
|
31703
|
-
const rV = /[?&]code=[^&]+/, iV = /[?&]state=[^&]+/, oV = /[?&]error=[^&]+/, aV = (e = window.location.search) => (rV.test(e) || oV.test(e)) && iV.test(e), sV = (e) => /^\d+$/.test(e) && e.length >= 5, s9 = Rn(), Nn = () => xn(s9), lV = "@photonhealth/elements", dV = "0.8.
|
|
31718
|
+
const rV = /[?&]code=[^&]+/, iV = /[?&]state=[^&]+/, oV = /[?&]error=[^&]+/, aV = (e = window.location.search) => (rV.test(e) || oV.test(e)) && iV.test(e), sV = (e) => /^\d+$/.test(e) && e.length >= 5, s9 = Rn(), Nn = () => xn(s9), lV = "@photonhealth/elements", dV = "0.8.4", cV = "", uV = "dist/index.js", fV = "./dist/index.d.ts", hV = {
|
|
31704
31719
|
start: "vite --port 3000",
|
|
31705
31720
|
build: "rimraf dist && NODE_ENV=development vite build",
|
|
31706
31721
|
"build:prod": "npx nx run elements:build",
|
|
@@ -44510,7 +44525,7 @@ function rY(e) {
|
|
|
44510
44525
|
}
|
|
44511
44526
|
});
|
|
44512
44527
|
t?.dispatchEvent(U);
|
|
44513
|
-
}, x = () =>
|
|
44528
|
+
}, x = () => h.setIsCombineDialogOpen(!0, () => O(e.enableOrder), e.formStore.draftPrescriptions.value, p()), O = async (z) => {
|
|
44514
44529
|
a([]);
|
|
44515
44530
|
const U = z ? ["patient", "draftPrescriptions", "pharmacy", "address"] : ["patient", "draftPrescriptions"];
|
|
44516
44531
|
e.formActions.validate(U);
|