PageSourceSearch

https://portal.startzion.com/build/assets/ProductForm-2j0a0R3k.js

js startzion.com collected 2026-10-05 23:10:29 UTC 40,579 bytes, 1 lines download raw bytes

1import{r as o,y as oe,j as e,a as M}from"./app-og3UcCOq.js";import{u as de}from"./formik.esm-DECec9eh.js";import{c as ce,a as y,f as I}from"./index.esm-B_kFYYL3.js";import{D as me}from"./DeleteModal-DqClnJWB.js";import he from"./SyncProductFieldsModal-CRNITMNE.js";import{c as ue}from"./index-Dy3vKPdY.js";import{d as xe,C as _e}from"./ckeditor-D1kV-aj2.js";import{S as R}from"./react-select.esm-pMgP3Xr0.js";import{R as u}from"./Row-a8QSTfPD.js";import{C as t}from"./Col-r5uuNBwP.js";import{T as f}from"./Tab-8mhisjtv.js";import{F as n}from"./Form-DXkSD0ru.js";import{C as r}from"./Card-GLwuYV3U.js";import{O as m,T as h}from"./OverlayTrigger-DlRZf_IH.js";import"./_baseClone-DuoU3J0m.js";import"./isObject-U9U2HXiq.js";import"./hoist-non-react-statics.cjs-TBEAlDBy.js";import"./Modal-226cgUlx.js";import"./ThemeProvider-XXxKa9H6.js";import"./listen-DOhMskc_.js";import"./useCallbackRef-CN7XmZF4.js";import"./useEventCallback-Co4Qhe_M.js";import"./useMergedRefs-Df2MWX4p.js";import"./useWillUnmount-jfyJ8na6.js";import"./TransitionWrapper-R9Qq9DSf.js";import"./Transition-DP5N--C6.js";import"./objectWithoutPropertiesLoose-CAYKN5F1.js";import"./setPrototypeOf-DgZC2w_0.js";import"./AbstractModalHeader-DvYtqNJs.js";import"./useWindow-BUkqYofp.js";import"./useMounted-CXXHI717.js";import"./usePrevious-C0XVXT_4.js";import"./ImperativeTransition-oNlr0R4e.js";import"./NoopTransition-BoRmH6Wq.js";import"./Fade-D16tu4pN.js";import"./removeClass-loOrDRrx.js";import"./hasClass-D5ZjVvBY.js";import"./querySelectorAll-Cwpyv69p.js";import"./DataKey-DjdvojM5.js";import"./CloseButton-D361Dxa_.js";import"./index-B3ZnK1RF.js";import"./divWithClassName-BIVfRb28.js";import"./react-toastify.esm-CqWJ5ynP.js";import"./throttle-DYmlJeqf.js";import"./extends-DOlrE4t7.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B9jnkVVz.js";import"./SSRProvider-DyyXP3Po.js";import"./TabContext-DSvvazcJ.js";import"./SelectableContext-D-p1kfN2.js";import"./ElementChildren-C4b93nt5.js";import"./CardHeaderContext-CcVCC6Jo.js";import"./useTimeout-u_fGObgJ.js";import"./hook-B3K3K1Fz.js";import"./mergeOptionsWithPopperConfig-_of6GqcK.js";const ga=({product:l,pharmacies:V,errors:g,productGenericGroups:H,productGenericNames:A,productTreatments:O,productRxDrugForms:Q,questionnaires:j,products:N})=>{const c=!!(l!=null&&l.id),[p,C]=o.useState(null),[G,k]=o.useState(!1),[$,F]=o.useState(!1),B=o.useMemo(()=>N.map(s=>({value:s.id,label:s.label})),[N]),[U,X]=o.useState(l&&l.bundle_items&&l.bundle_items.length>0?l.bundle_items.map(s=>{const i=B.find(d=>d.value===s.product_id);return i||null}).filter(Boolean):[]),z=s=>{X(s);const i=s.map(d=>d.value);a.setFieldValue("bundle_items",i)},K=s=>{const i=s.target.files[0];if(i){if(i.size>2*1024*1024){alert("Image size must be less than 2MB.");return}a.setFieldValue("product_image",i);const d=new FileReader;d.onload=b=>{C(b.target.result)},d.readAsDataURL(i)}},Y=()=>{},a=de({enableReinitialize:!0,initialValues:{name:(l==null?void 0:l.name)??"",description:(l==null?void 0:l.description)??"",short_name:(l==null?void 0:l.short_name)??"",generic_name:(l==null?void 0:l.generic_name)??"",generic_group:(l==null?void 0:l.generic_group)??"",brand_name:(l==null?void 0:l.brand_name)??"",price:(l==null?void 0:l.price)??"",weight:(l==null?void 0:l.weight)??0,consult_price:(l==null?void 0:l.consult_price)??0,shipping_cost:(l==null?void 0:l.shipping_cost)??0,shipping_cost_patient:(l==null?void 0:l.shipping_cost_patient)??0,cost_nimbus:(l==null?void 0:l.cost_nimbus)??0,shipping_cost_nimbus:(l==null?void 0:l.shipping_cost_nimbus)??0,ndc:(l==null?void 0:l.ndc)??"",carrier_code:(l==null?void 0:l.carrier_code)??"",otc_or_rx:(l==null?void 0:l.otc_or_rx)??"RX",disapproved_states:(l==null?void 0:l.disapproved_states)??[],important_safety_info:(l==null?void 0:l.important_safety_info)??"",how_to_use:(l==null?void 0:l.how_to_use)??"",category:(l==null?void 0:l.category)??"",follow_up_questionnaire:(l==null?void 0:l.follow_up_questionnaire)??"",learn_more:(l==null?void 0:l.learn_more)??"",side_effects:(l==null?void 0:l.side_effects)??"",product_image:(l==null?void 0:l.product_image)??null,pharmacy_id:(l==null?void 0:l.pharmacy_id)??"",sync_to_existing_tenants:!1,add_to_new_tenant:c?l.add_to_new_tenant:!0,beluga_medId:(l==null?void 0:l.beluga_medId)??"",beluga_product_addon_id:(l==null?void 0:l.beluga_product_addon_id)??"",strength:(l==null?void 0:l.strength)??"",quantity:(l==null?void 0:l.quantity)??1,rx_quantity:(l==null?void 0:l.rx_quantity)??2,refills:(l==null?void 0:l.refills)??0,requires_video_visit:(l==null?void 0:l.requires_video_visit)??!1,provider_network_id:(l==null?void 0:l.provider_network_id)??2,purchase_type:(l==null?void 0:l.purchase_type)??"one_time",billing_cycle:(l==null?void 0:l.billing_cycle)??"",number_of_billing_cycles:(l==null?void 0:l.number_of_billing_cycles)??"",treatment_type:(l==null?void 0:l.treatment_type)??"",lfProductId:(l==null?void 0:l.lfProductId)??"",rx_quantityUnits:(l==null?void 0:l.rx_quantityUnits)??"",rx_drug
1Strength:(l==null?void 0:l.rx_drugStrength)??"",rx_daysSupply:(l==null?void 0:l.rx_daysSupply)??"",rx_drugForm:(l==null?void 0:l.rx_drugForm)??"",VSDH_sku:(l==null?void 0:l.VSDH_sku)||"",follow_up_days:(l==null?void 0:l.follow_up_days)??"",base_onboarding_qnnaire_name:(l==null?void 0:l.base_onboarding_qnnaire_name)??"",base_followup_qnnaire_name:(l==null?void 0:l.base_followup_qnnaire_name)??"",environment:(l==null?void 0:l.environment)??"test",rx_push_api:(l==null?void 0:l.rx_push_api)??"",type:(l==null?void 0:l.type)??"single",bundle_items:c?l.bundle_items.map(s=>s.product_id):[],is_addon:(l==null?void 0:l.is_addon)??!1,treatment_addons:c&&l.treatment_addons?l.treatment_addons.map(s=>s.treatment):[],base_pre_qualify_qnnaire:(l==null?void 0:l.base_pre_qualify_qnnaire)??"",base_post_qualify_qnnaire:(l==null?void 0:l.base_post_qualify_qnnaire)??""},validationSchema:ce({name:y().required("Please Enter a Product Title"),treatment_type:y().required("This field is required"),billing_cycle:I().nullable().when("purchase_type",{is:s=>s==="subscription",then:s=>s.required("Billing Cycle is required for subscriptions"),otherwise:s=>s.nullable()}),number_of_billing_cycles:I().nullable(),pharmacy_id:y().required("This field is required")}),onSubmit:s=>{s.product_image instanceof File||(s.product_image=null);const i=c?route("central.products.update",l.id):route("central.products.store");oe.post(i,s,{onStart:()=>F(!0),onFinish:()=>F(!1),preserveState:!1})}});o.useEffect(()=>{if(g&&Object.keys(g).length>0){const s=Object.entries(g).reduce((i,[d,b])=>(i[d]=Array.isArray(b)?b.join(", "):b,i),{});a.setErrors(s)}},[g]);const J=async()=>{if(C(null),a.setFieldValue("product_image",null),l!=null&&l.product_image){l.product_image=null;try{await window.axios.post(route("central.products.remove-image",l.id))}catch{}}},[v,q]=o.useState(H??[]),[x,w]=o.useState(A??[]),[_,S]=o.useState(O??[]),[P,W]=o.useState(Q??[]);o.useEffect(()=>{l!=null&&l.generic_group&&!v.includes(l.generic_group)&&q(s=>[...s,l.generic_group]),l!=null&&l.generic_name&&!x.includes(l.generic_name)&&w(s=>[...s,l.generic_name]),l!=null&&l.treatment_type&&!_.includes(l.treatment_type)&&S(s=>[...s,l.treatment_type])},[l]);const Z=()=>{let s=window.prompt("Add a new generic group:");s=s.trim(),s&&!v.includes(s)?(q(i=>[...i,s]),a.setFieldValue("generic_group",s)):alert("Either blank name provided or Same named generic group exists!")},ee=()=>{let s=window.prompt("Add a new generic name:");s=s.trim(),s&&!x.includes(s)?(w(i=>[...i,s]),a.setFieldValue("generic_name",s)):alert("Either blank name provided or Same named generic name exists!")},ae=()=>{let s=window.prompt("Add a new treatment:");s?(s=s.trim(),s&&!_.includes(s)?(S(i=>[...i,s]),a.setFieldValue("treatment_type",s)):alert("Either a blank name was provided or a treatment with the same name already exists!")):alert("No name was provided!")},le=()=>{let s=window.prompt("Add a new Drug Form:");s?(s=s.trim(),s&&!P.includes(s)?(W(i=>[...i,s]),a.setFieldValue("rx_drugForm",s)):alert("Either a blank name was provided or a Drug Form with same name already exists!")):alert("No name was provided!")},[L,se]=o.useState(!1),D=()=>{se(!L)},ne=o.useMemo(()=>_.map(i=>({value:i,label:i})),[_]),[ie,re]=o.useState(l&&l.treatment_addons&&l.treatment_addons.length>0?l.treatment_addons.map(s=>({value:s.treatment,label:s.treatment})):[]),te=s=>{re(s);const i=s.map(d=>d.value);a.setFieldValue("treatment_addons",i)},[E,T]=o.useState(!0);return o.useEffect(()=>{if(E){if(Object.keys(a.errors).length>0){const s=Object.keys(a.errors)[0],i=document.querySelector(`[name="${s}"]`);i&&i.scrollIntoView({behavior:"smooth",block:"center"})}T(!1)}},[E]),e.jsxs(u,{children:[e.jsx(u,{children:e.jsx(t,{xs:12,children:e.jsxs("div",{className:"page-title-box d-sm-flex align-items-center justify-content-between",children:[e.jsx("h4",{className:"mb-sm-0",children:c?"Edit Product":"Create Product"}),e.jsx("div",{className:"page-title-right",children:e.jsxs("ol",{className:"breadcrumb m-0",children:[e.jsx("li",{className:"breadcrumb-item",children:e.jsx(M,{href:route("central.products.index"),children:"Products"})}),e.jsx("li",{className:"breadcrumb-item active",children:c?"Edit Product":"Create Product"})]})})]})})}),e.jsx(me,{show:G,onDeleteClick:Y,onCloseClick:()=>{k(!1)},recordId:"Are you sure you want to delete this product?"}),e.jsx(f.Container,{defaultActiveKey:"1",children:e.jsx(f.Content,{className:"text-muted",children:e.jsxs(f.Pane,{eventKey:"1",id:"pill-justified-home-1",children:[c&&e.jsxs("div",{className:"d-flex align-items-center gap-3 mb-2",children:[e.jsx("button",{type:"button",className:"btn btn-sm btn-primary",onClick:D,children:"Sync Product Fields To Tenants"}),e.jsx(he,{productId:l==null?void 0:l.id,toggleModal:D,show:L}),e.jsxs(M,{href:route("central.products.create",{duplicate_product_id:l.id}),title:"Duplicate Product",className:"btn btn-outline-primary btn-sm",children:[e.jsx("i",{className:"me-1 ri-file-copy-line"})," Duplicate Product"]})]}),e.jsxs(u,{children:[e.jsx(t,{lg:8,children:e.jsxs(n,{onSubmit:s=>{T(!0),s.preventDefault(),a.handleSubmit()},children:[e.jsx(r,{children:e.jsxs(r.Body,{children:[e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"product-title-input",children:["Product Name",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsx(n.Control,{type:"text",className:"form-control",id:"product-title-input",placeholder:"Enter product name",name:"name",value:a.values.name||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.name&&a.touched.name?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.name}):null]}),e.jsxs("div",{children:[e.jsx(n.Label,{children:"Product Description"}),e.jsx("textarea",{name:"description",onChange:a.handleChange,value:a.values.description??"",className:"form-control",placeholder:"",rows:3})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(n.Label,{children:"Application Directions"}),e.jsx("textarea",{name:"how_to_use",onChange:a.handleChange,value:a.values.how_to_use??"",className:"form-control",placeholder:"",rows:3})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(n.Label,{children:"Learn more"}),e.jsx(xe.CKEditor,{onChange:(s,i)=>{const d=i.getData();a.setFieldValue("learn_more",d)},editor:_e,data:a.values.learn_more,onReady:s=>
1{}})]})]})}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsx("h5",{className:"card-title mb-0",children:"Media"})}),e.jsx(r.Body,{children:e.jsxs("div",{className:"mb-4",children:[e.jsxs("h5",{className:"fs-14 mb-1",children:["Product main Image:"," ",e.jsx("span",{className:"text-muted ms-2 fs-13",children:"Max size: 2MB"})]}),e.jsx("p",{className:"text-muted",children:"Add Product main Image."}),e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"position-relative d-inline-block",children:[e.jsxs("div",{className:"position-absolute top-100 start-100 translate-middle",children:[e.jsx(n.Label,{htmlFor:"product-img-input",className:"mb-0","data-bs-toggle":"tooltip","data-bs-placement":"right",title:"Select Image",children:e.jsx("div",{className:"avatar-xs cursor-pointer",children:e.jsx("div",{className:"avatar-title bg-light border rounded-circle text-muted",children:e.jsx("i",{className:"ri-image-fill"})})})}),e.jsx(n.Control,{name:"product_image",className:"form-control d-none",id:"product-img-input",type:"file",accept:"image/png, image/gif, image/jpeg",onChange:K})]}),e.jsx("div",{className:"avatar-lg",children:e.jsx("div",{className:"avatar-title bg-light rounded",children:(p||(l==null?void 0:l.product_image))&&e.jsx("img",{src:p??(l==null?void 0:l.product_image),id:"product-img",alt:"",className:"avatar-md h-auto"})})}),(p||(l==null?void 0:l.product_image))&&e.jsx("div",{className:"position-absolute top-0 start-100 translate-middle",title:"Remove image",onClick:J,children:e.jsx("div",{className:"avatar-xs cursor-pointer",children:e.jsx("div",{className:"avatar-title bg-light border rounded-circle text-danger",children:e.jsx("i",{className:"ri-delete-bin-line"})})})})]}),a.errors.product_image&&a.touched.product_image?e.jsxs(n.Control.Feedback,{type:"invalid",children:[" ",a.errors.product_image," "]}):null]})]})})]}),e.jsx(r,{className:"my-3",children:e.jsxs(r.Body,{children:[e.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"type",children:"Product Type"}),e.jsxs(n.Select,{className:"form-control w-auto",id:"type",name:"type",value:a.values.type,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"single",children:"Single or Bundle of the Same(Dose) Medications"}),e.jsx("option",{value:"bundle",children:"Bundle of Different(Dose) Medications"})]})]}),a.values.type=="bundle"&&e.jsx(u,{children:e.jsx(t,{md:12,children:e.jsxs("div",{className:"mt-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"products",children:"Select Existing Products to Include in Bundle"}),e.jsx(R,{isMulti:!0,value:U,onChange:s=>{z(s)},options:B,placeholder:""})]})})})]})}),e.jsx(r,{children:e.jsxs(r.Body,{children:[a.values.type=="single"&&e.jsxs(u,{children:[e.jsx(t,{lg:6,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"manufacturer-name-input",children:"NDIC #"}),e.jsx(n.Control,{type:"text",className:"form-control",id:"manufacturer-name-input",name:"ndc",placeholder:"Enter NDIC number",value:a.values.ndc||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.ndc&&a.touched.ndc?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.ndc}):null]})}),e.jsx(t,{lg:6,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"manufacturer-brand-input",children:"Manufacturer Name"}),e.jsx(n.Control,{type:"text",className:"form-control",id:"manufacturer-brand-input",name:"brand_name",placeholder:"Enter manufacturer brand",value:a.values.brand_name||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.brand_name&&a.touched.brand_name?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.brand_name}):null]})})]}),e.jsxs(u,{children:[e.jsx(t,{sm:4,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"purchase_type",children:"Product Purchase Type"}),e.jsxs(n.Select,{className:"form-control",id:"purchase_type",name:"purchase_type",value:a.values.purchase_type,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"one_time",children:"Pay Every Visit"}),e.jsx("option",{value:"subscription",children:"Subscription"})]})]})}),a.values.purchase_type=="subscription"&&e.jsxs(e.Fragment,{children:[e.jsx(t,{sm:4,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"billing_cycle",children:"Subscription/Billing Cycle"}),e.jsxs(n.Select,{className:"form-control",id:"billing_cycle",name:"billing_cycle",value:a.values.billing_cycle,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"",children:"--Select--"}),e.jsx("option",{value:"1",children:"Monthly"}),e.jsx("option",{value:"2",children:"Every 2 Months"}),e.jsx("option",{value:"3",children:"Every 3 Months"}),e.jsx("option",{value:"4",children:"Every 4 Months"}),e.jsx("option",{value:"5",children:"Every 5 Months"}),e.jsx("option",{value:"6",children:"Every 6 Months"}),e.jsx("option",{value:"7",children:"Every 7 Months"}),e.jsx("option",{value:"8",children:"Every 8 Months"}),e.jsx("option",{value:"9",children:"Every 9 Months"}),e.jsx("option",{value:"10",children:"Every 10 Months"}),e.jsx("option",{value:"11",children:"Every 11 Months"}),e.jsx("option",{value:"12",children:"Every Year"})]}),a.errors.billing_cycle&&a.touched.billing_cycle?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.billing_cycle}):null]})}),e.jsx(t,{sm:4,children:e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"number_of_billing_cycles",children:["Number of Billing Cycles",e.jsx(m,{overlay:e.jsx(h,{children:"Number of billing cycles after which the subscription should end. Leave it blank to keep the subscription renewing every billing cycle indefinitely."}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsx(n.Control,{type:"number",className:"form-control",id:"number_of_billing_cycles",placeholder:"Leave it blank if it is indefinite",name:"number_of_billing_cycles",value:a.values.number_of_billing_cycles,onBlur:a.handleBlur,onChange:a.handleChange})]})})]})]}),e.jsxs(u,{children:[e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"product-price-input",children:["Base Price",e.jsx(m,{overlay:e.jsx(h,{children:"Refers to the one-time price or the price per billing cycle of the product."}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"product-price-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-price-input",placeholder:"Enter price",name:"price","aria-label":"Price","aria-describedby":"product-price-addon",value:a.values.price||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.price&&a.touched.price?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.price}):null]})]})}),e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"product-price-input",children:"Cost To Client"}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"product-price-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-price-input",placeholder:"Enter price",name:"consult_price","aria-label":"Price","aria-describedby":"product-price-addon",value:a.values.consult_price||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.consult_price&&a.touched.consult_price?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.consult_price}):null]})]})}),e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"product-cost_nimbus-input",children:"Cost To NimbusRX"}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"product-cost_nimbus-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-cost_nimbus-input",n
1ame:"cost_nimbus","aria-label":"Cost Nimbus","aria-describedby":"product-cost_nimbus-addon",value:a.values.cost_nimbus||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.cost_nimbus&&a.touched.cost_nimbus?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.cost_nimbus}):null]})]})}),e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"product-price-input",children:["Shipping Cost To Client",e.jsx(m,{overlay:e.jsx(h,{children:"Refers to the shipping fee charged by the NimbusRx to the client."}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"product-price-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-price-input",placeholder:"Enter price",name:"shipping_cost","aria-label":"Price","aria-describedby":"product-price-addon",value:a.values.shipping_cost||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.shipping_cost&&a.touched.shipping_cost?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.shipping_cost}):null]})]})}),e.jsx(t,{sm:4,children:e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"product-shipping_cost_nimbus-input",children:["Shipping Cost To NimbusRX",e.jsx(m,{overlay:e.jsx(h,{children:"Refers to the shipping fee charged by the pharmacy to NimbusRx"}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"product-shipping_cost_nimbus-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-shipping_cost_nimbus-input",name:"shipping_cost_nimbus","aria-label":"Shipping Cost To NimbusRX","aria-describedby":"product-shipping_cost_nimbus-addon",value:a.values.shipping_cost_nimbus||"",onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.shipping_cost_nimbus&&a.touched.shipping_cost_nimbus?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.shipping_cost_nimbus}):null]})]})}),e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"shipping_cost_patient",children:["Shipping Fee(Patient)",e.jsx(m,{overlay:e.jsx(h,{children:"Refers to the shipping fee charged by the healthcare provider to the patient"}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsxs("div",{className:"input-group mb-3",children:[e.jsx("span",{className:"input-group-text",id:"shipping-cost-patient-addon",children:"$"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"shipping_cost_patient",placeholder:"Enter price",name:"shipping_cost_patient","aria-label":"Price","aria-describedby":"product-price-addon",value:a.values.shipping_cost_patient,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.shipping_cost_patient&&a.touched.shipping_cost_patient?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.shipping_cost_patient}):null]})]})}),e.jsx(t,{sm:3,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"product-strength-input",children:"Dose per intake"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-strength-input",name:"strength",value:a.values.strength,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.strength&&a.touched.strength&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.strength})]})}),e.jsx(t,{sm:2,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"product-quantity-input",children:"Quantity"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-quantity-input",name:"quantity",value:a.values.quantity,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.quantity&&a.touched.quantity&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.quantity})]})}),a.values.type=="single"&&e.jsxs(e.Fragment,{children:[e.jsx(t,{sm:2,children:e.jsxs("div",{className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"product-refills-input",children:"Refills"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"product-refills-input",n
1ame:"refills",value:a.values.refills,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.refills&&a.touched.refills&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.refills})]})}),e.jsxs(t,{sm:3,className:"mb-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"product-rx-quantity",children:["Rx Quantity",e.jsx(m,{overlay:e.jsx(h,{children:"Quantity/Bottles of product pharmacy ships to the patient"}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsx(n.Control,{type:"text",className:"form-control",id:"product-rx-quantity",name:"rx_quantity",value:a.values.rx_quantity,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.rx_quantity&&a.touched.rx_quantity&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.rx_quantity})]}),e.jsxs(t,{sm:3,className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"rx-quantity-units",children:"Rx Quantity Units"}),e.jsx(n.Control,{type:"text",className:"form-control",id:"rx-quantity-units",name:"rx_quantityUnits",value:a.values.rx_quantityUnits,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.rx_quantityUnits&&a.touched.rx_quantityUnits&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.rx_quantityUnits})]}),e.jsxs(t,{sm:4,className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"rx-drug-strength",children:"Rx Drug Strength"}),e.jsx(n.Control,{type:"text",className:"form-control",id:"rx-drug-strength",name:"rx_drugStrength",value:a.values.rx_drugStrength,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.rx_drugStrength&&a.touched.rx_drugStrength&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.rx_drugStrength})]}),e.jsxs(t,{sm:4,className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"rx_drugForm",children:"Rx Drug Form"}),e.jsxs("div",{className:"d-flex gap-1 align-items-enter justify-content-between",children:[e.jsxs(n.Select,{className:"form-control",id:"rx_drugForm",name:"rx_drugForm",value:a.values.rx_drugForm,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"",children:"--Select--"}),P.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx("button",{className:"btn btn-primary",type:"button",title:"Click to add new",onClick:le,children:e.jsx("i",{className:"ri-add-fill"})})]}),a.errors.rx_drugForm&&a.touched.rx_drugForm&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.rx_drugForm})]}),e.jsxs(t,{sm:2,className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"rx-days-supply",children:"Rx Days Supply"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"rx-days-supply",name:"rx_daysSupply",value:a.values.rx_daysSupply,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.rx_daysSupply&&a.touched.rx_daysSupply&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.rx_daysSupply})]}),e.jsxs(t,{sm:3,className:"mb-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"lf-product-id",children:"LifeFile Product ID"}),e.jsx(n.Control,{type:"number",className:"form-control",id:"lf-product-id",name:"lfProductId",value:a.values.lfProductId,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.lfProductId&&a.touched.lfProductId&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.lfProductId})]})]})]}),e.jsx(r,{className:"my-3",children:e.jsxs(r.Body,{children:[e.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsx(n.Check,{type:"checkbox",id:"is_addon",label:"Available as an add-on product for treatments?",value:a.values.is_addon,onBlur:a.handleBlur,onChange:a.handleChange,checked:a.values.is_addon}),a.touched.is_addon&&a.errors.is_addon&&e.jsx(n.Control.Feedback,{type:"invalid",children:a.errors.is_addon})]}),a.values.is_addon&&e.jsx(e.Fragment,{children:e.jsxs("div",{className:"mt-2 d-flex flex-column gap-2 flex-md-row align-items-start align-items-md-center",children:[e.jsx(n.Label,{className:"form-label text-nowrap",htmlFor:"addon-treatments",children:"Select Treatments:"}),e.jsx("div",{className:"w-100",children:e.jsx(R,{isMulti:!0,value:ie,onChange:s=>{te(s)},options:ne,placeholder:"",styles:{control:s=>({...s,width:"100%"})}})})]})})]})}),e.jsx(r,{className:"my-3",children:e.jsx(r.Body,{children:e.jsxs("div",{className:"d-flex gap-2 align-items-center",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"environment",children:["Environment",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsxs(n.Select,{className:"form-control w-auto",id:"environment",name:"environment",value:a.values.environment,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"test",children:"Test"}),e.jsx("option",{value:"live",children:"Live"})]})]})})}),!c&&e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsxs("h5",{className:"card-title mb-0 d-flex gap-1 align-items-center",children:[e.jsx(ue,{size:20}),"Sync To Tenants Settings"]})}),e.jsx(r.Body,{children:e.jsx(u,{children:e.jsx(t,{md:12,className:"mb-3",children:e.jsx(n.Check,{type:"checkbox",id:"sync_to_existing_tenants",label:"Add this product to all existing clients or tenants.",name:"sync_to_existing_tenants",onBlur:a.handleBlur,onChange:a.handleChange,checked:a.values.sync_to_existing_tenants})})})})]})]})}),e.jsxs("div",{className:"text-end mb-3",children:[c&&e.jsx("button",{type:"button",className:"btn btn-soft-danger w-sm me-3",id:"btn-delete-event",onClick:()=>{k(!0)},children:"Delete"}),e.jsx("button",{type:"submit",className:"btn btn-primary w-sm",disabled:$,children:"Submit"})]}),c&&e.jsx(u,{children:e.jsx(t,{md:12,className:"mb-3 text-end",children:'Note: After saving, please make sure to manually sync the updated fields to the tenants using the button "Sync Product Fields To Tenants" at the top of the page.'})})]})}),e.jsxs(t,{lg:4,children:[e.jsx(r,{children:e.jsxs(r.Body,{children:[e.jsxs("div",{className:"",children:[e.jsxs(n.Label,{htmlFor:"treatment_type",className:"form-label",children:["Treatment",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsxs("div",{className:"d-flex gap-2 align-items-enter justify-content-between",children:[e.jsxs(n.Select,{className:"form-control",id:"treatment_type",name:"treatment_type",value:a.values.treatment_type,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"",children:"--Select--"}),_.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx("button",{className:"btn btn-primary",type:"button",title:"Click to add new",onClick:ae,children:e.jsx("i",{className:"ri-add-fill"})})]}),a.errors.treatment_type&&a.touched.treatment_type?e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.treatment_type}):null]}),e.jsxs("div",{className:"mt-2",children:[e.jsx(n.Label,{htmlFor:"state",className:"form-label",children:"RX Or OTC"}),e.jsxs(n.Select,{className:"form-control",id:"otc_or_rx",name:"otc_or_rx",value:a.values.otc_or_rx,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"RX",children:"RX"}),e.jsx("option",{value:"OTC",children:"OTC"})]})]}),e.jsxs("div",{className:"mt-2",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"follow_up_days",children:["Follow-up Days After",e.jsx(m,{overlay:e.jsx(h,{children:"How many days after the initial appointment should the follow-up take place?"}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsx(n.Control,{type:"number",className:"form-control",id:"follow_up_days",name:"follow_up_days",value:a.values.follow_up_days,onBlur:a.handleBlur,onChange:a.handleChange}),a.errors.follow_up_days&&a.touched.follow_up_days&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.follow_up_days})]})]})}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsx("h5",{className:"card-title mb-0",children:"Provider"})}),e.jsxs(r.Body,{children:[e.jsx(n.Check,{type:"checkbox",id:"requires_video_visit",label:"Requires video visit?",value:a.values.requires_video_visit,onBlur:a.handleBlur,onChange:a.handleChange,checked:a.values.requires_video_visit}),a.touched.requires_video_visit&&a.errors.requires_video_visit&&e.jsx(n.Control.Feedback,{type:"invalid",children:a.errors.requires_video_visit}),e.jsxs("div",{className:"mt-3",children:[e.jsxs(n.Label,{htmlFor:"provider_network_id",className:"form-label",children:["Provider Network",e.jsx("span",{className:"text-danger",children:"*"})]}),e.jsxs("select",{name:"provider_network_id",className:"form-select",id:"provider_network_id",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.provider_network_id,children:[e.jsx("option",{value:"1",children:"Beluga Health"}),e.jsx("option",{value:"2",children:"StratusMD"}),e.jsx("option",{value:"3",children:"RXCompound"})]}),a.errors.provider_network_id&&a.touched.provider_network_id&&e.jsxs(n.Control.Feedback,{type:"invalid",className:"d-block",children:[" ",a.errors.provider_network_id," "]})]})]})]}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsx("h5",{className:"card-title mb-0",children:"Pharmacy"})}),e.jsxs(r.Body,{children:[e.jsxs("div",{children:[e.jsxs("select",{name:"pharmacy_id",className:"form-select",id:"pharmacy_id-field",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.pharmacy_id,children:[e.jsx("option",{value:""}),V.map(s=>e.jsx("option",{value:s.id,children:s.name},s.id))]}),a.touched.pharmacy_id&&a.errors.pharmacy_id&&e.jsx(n.Control.Feedback,{className:"d-block",type:"invalid",children:a.errors.pharmacy_id})]}),e.jsxs("div",{className:"mt-2",children:[e.jsxs(n.Label,{htmlFor:"rx-product-id",className:"form-label",children:["Beluga Medicine ID",e.jsx(m,{overlay:e.jsx(h,{children:"Refers to Medicine Id of Beluga Products"}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsx(n.Control,{type:"text",className:"form-control",id:"rx-product-id",name:"beluga_medId",value:a.values.beluga_medId,onChange:a.handleChange,onBlur:a.handleBlur}),a.touched.beluga_medId&&a.errors.beluga_medId&&e.jsx(n.Control.Feedback,{type:"invalid",children:a.errors.beluga_medId})]}),e.jsxs("div",{className:"mt-2",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"VSDH_sku",children:"VirtualClinicO Medication Code, RxRoute Product Name / VS Digital Health Product SKU"}),e.jsx(n.Control,{type:"text",className:"form-control",id:"VSDH_sku",name:"VSDH_sku",value:a.values.VSDH_sku,onBlur:a.handleBlur,onChange:a.handleChange,as:"textarea",rows:3}),a.errors.VSDH_sku&&a.touched.VSDH_sku&&e.jsx(n.Control.Feedback,{type:"invalid",className:"d-block",children:a.errors.VSDH_sku})]}),e.jsxs("div",{className:"mt-2",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"rx_push_api",children:"Pharmacy API"}),e.jsxs(n.Select,{className:"form-control",id:"rx_push_api",name:"rx_push_api",value:a.values.rx_push_api,onBlur:a.handleBlur,onChange:a.handleChange,children:[e.jsx("option",{value:"",children:"Inherit from Pharmacy"}),e.jsx("option",{value:"lifefile",children:"Life File"}),e.jsx("option",{value:"rxroute",children:"Rx Route"}),e.jsx("option",{value:"VSDigitalHealth",children:"VS Digital Health"}),e.jsx("option",{value:"MDToolBox",children:"MDToolBox"})]})]}),e.jsxs("div",{className:"mt-2",children:[e.jsx(n.Label,{htmlFor:"generic_name",className:"form-label",children:"Product's Generic Name"}),e.jsxs("div",{className:"d-flex gap-2 align-items-enter justify-content-between",children:[e.jsxs("select",{name:"generic_name",className:"form-select",id:"generic_name",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.generic_name,children:[e.jsx("option",{value:""}),x==null?void 0:x.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx("button",{className:"btn btn-primary",type:"button",title:"Click to add new",onClick:ee,children:e.jsx("i",{className:"ri-add-fill"})})]}),a.errors.generic_name&&a.touched.generic_name&&e.jsxs(n.Control.Feedback,{type:"invalid",className:"d-block",children:[" ",a.errors.generic_name," "]})]}),e.jsxs("div",{className:"mt-2",children:[e.jsx(n.Label,{htmlFor:"generic_group",className:"form-label",children:"Product's Generic Group"}),e.jsxs("div",{className:"d-flex gap-2 align-items-enter justify-content-between",children:[e.jsxs("select",{name:"generic_group",className:"form-select",id:"generic_group",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.generic_group,children:[e.jsx("option",{value:""}),v.map(s=>e.jsx("option",{value:s,children:s},s))]}),e.jsx("button",{className:"btn btn-primary",type:"button",title:"Click to add new",onClick:Z,children:e.jsx("i",{className:"ri-add-fill"})})]}),a.errors.generic_group&&a.touched.generic_group&&e.jsxs(n.Control.Feedback,{type:"invalid",className:"d-block",children:[" ",a.errors.generic_group," "]})]})]})]}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsxs("h5",{className:"card-title mb-0",children:["Questionnaires",e.jsx(m,{overlay:e.jsx(h,{children:'Questionnaires on fillout.com with names starting with "Base Template" or "Base Form". Make sure to sync all the Questionnaires to nimbus system from fillout.com.'}),children:e.jsx("i",{className:"ri-question-fill"})})]})}),e.jsxs(r.Body,{children:[e.jsxs("div",{children:[e.jsx(n.Label,{className:"form-label",htmlFor:"VSDH_sku",children:"Onboarding Questionnaire"}),e.jsxs("select",{name:"base_onboarding_qnnaire_name",className:"form-select",id:"base_onboarding_qnnaire_name",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.base_onboarding_qnnaire_name,children:[e.jsx("option",{value:""}),j.map((s,i)=>e.jsx("option",{value:s.name,children:s.name},i))]}),a.touched.base_onboarding_qnnaire_name&&a.errors.base_onboarding_qnnaire_name&&e.jsx(n.Control.Feedback,{className:"d-block",type:"invalid",children:a.errors.base_onboarding_qnnaire_name})]}),e.jsxs("div",{className:"mt-3",children:[e.jsxs(n.Label,{className:"form-label",htmlFor:"base_pre_qualify_qnnaire",children:["Pre-qualification / Entry Questionnaire",e.jsx(m,{overlay:e.jsx(h,{children:"This questionnnaire will take precedence over standard Onboarding Questionnaire if its available on clients portal."}),children:e.jsx("i",{className:"ri-question-fill"})})]}),e.jsxs("select",{name:"base_pre_qualify_qnnaire",className:"form-select",id:"base_pre_qualify_qnnaire",onCh
1ange:a.handleChange,onBlur:a.handleBlur,value:a.values.base_pre_qualify_qnnaire,children:[e.jsx("option",{value:""}),j.map((s,i)=>e.jsx("option",{value:s.name,children:s.name},i))]}),a.touched.base_pre_qualify_qnnaire&&a.errors.base_pre_qualify_qnnaire&&e.jsx(n.Control.Feedback,{className:"d-block",type:"invalid",children:a.errors.base_pre_qualify_qnnaire})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"base_post_qualify_qnnaire",children:"Post-qualification / Final Questionnaire"}),e.jsxs("select",{name:"base_post_qualify_qnnaire",className:"form-select",id:"base_post_qualify_qnnaire",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.base_post_qualify_qnnaire,children:[e.jsx("option",{value:""}),j.map((s,i)=>e.jsx("option",{value:s.name,children:s.name},i))]}),a.touched.base_post_qualify_qnnaire&&a.errors.base_post_qualify_qnnaire&&e.jsx(n.Control.Feedback,{className:"d-block",type:"invalid",children:a.errors.base_post_qualify_qnnaire})]}),e.jsxs("div",{className:"mt-3",children:[e.jsx(n.Label,{className:"form-label",htmlFor:"VSDH_sku",children:"Follow-up Questionnaire"}),e.jsxs("select",{name:"base_followup_qnnaire_name",className:"form-select",id:"base_followup_qnnaire_name",onChange:a.handleChange,onBlur:a.handleBlur,value:a.values.base_followup_qnnaire_name,children:[e.jsx("option",{value:""}),j.map((s,i)=>e.jsx("option",{value:s.name,children:s.name},i))]}),a.touched.base_followup_qnnaire_name&&a.errors.base_followup_qnnaire_name&&e.jsx(n.Control.Feedback,{className:"d-block",type:"invalid",children:a.errors.base_followup_qnnaire_name})]})]})]}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsx("h5",{className:"card-title mb-0",children:"Safety Information"})}),e.jsxs(r.Body,{children:[e.jsx("p",{className:"text-muted mb-2",children:"Add important safety information"}),e.jsx("textarea",{name:"important_safety_info",onChange:a.handleChange,value:a.values.important_safety_info??"",className:"form-control",placeholder:"",rows:7})]})]}),e.jsxs(r,{children:[e.jsx(r.Header,{children:e.jsx("h5",{className:"card-title mb-0",children:"Side Effects"})}),e.jsxs(r.Body,{children:[e.jsx("p",{className:"text-muted mb-2"}),e.jsx("textarea",{name:"side_effects",onChange:a.handleChange,value:a.values.side_effects??"",className:"form-control",placeholder:"",rows:3})]})]})]})]})]})})})]})};export{ga as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.