hplx-feature-library 1.0.172 → 1.0.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/dist/APIAction-DP4YAX6k.cjs +1 -0
  2. package/dist/APIAction-DsHApdnW.js +161 -0
  3. package/dist/AllInvestigations/index.js +1 -1
  4. package/dist/AllInvestigationsTable-C7uQ56B0.cjs +79 -0
  5. package/dist/{AllInvestigationsTable-C7jrmW8z.js → AllInvestigationsTable-txmu7PTJ.js} +5853 -6144
  6. package/dist/Attachments/components/document-canvas/document-pen-tool.d.ts +1 -1
  7. package/dist/Attachments/components/drag-drop-overlay.d.ts +1 -1
  8. package/dist/Attachments/components/edit-document-modal.d.ts +1 -1
  9. package/dist/Attachments/components/uploading-toast.d.ts +1 -1
  10. package/dist/Attachments/context/index.d.ts +2 -2
  11. package/dist/Attachments/hooks/useDropdownPosition.d.ts +1 -1
  12. package/dist/Attachments/index.js +512 -534
  13. package/dist/CameraCapture/index.d.ts +1 -1
  14. package/dist/NetworkInstance-CPW2SeAM.cjs +9 -0
  15. package/dist/NetworkInstance-D0jiwhQe.js +3597 -0
  16. package/dist/PatientAddEdit/index.js +1663 -0
  17. package/dist/PatientPopup/action/APIAction.d.ts +65 -0
  18. package/dist/PatientPopup/app/PatientPopupContainer.d.ts +6 -0
  19. package/dist/PatientPopup/app/PatientPopupContext.d.ts +30 -0
  20. package/dist/PatientPopup/common/common.d.ts +14 -0
  21. package/dist/PatientPopup/components/Lab/HPLXLab.d.ts +8 -0
  22. package/dist/PatientPopup/components/Lab/LISLab.d.ts +8 -0
  23. package/dist/PatientPopup/components/Lab/LabTable.d.ts +5 -0
  24. package/dist/PatientPopup/components/Lab/index.d.ts +5 -0
  25. package/dist/PatientPopup/components/Loader/Loader.d.ts +2 -0
  26. package/dist/PatientPopup/components/Pagination.d.ts +9 -0
  27. package/dist/PatientPopup/components/Profile/Abha.d.ts +11 -0
  28. package/dist/PatientPopup/components/Profile/PatientDetailsModal.d.ts +1 -0
  29. package/dist/PatientPopup/components/Profile/Profile.d.ts +11 -0
  30. package/dist/PatientPopup/components/Profile/Sms.d.ts +2 -0
  31. package/dist/PatientPopup/components/Visits/Table.d.ts +11 -0
  32. package/dist/PatientPopup/components/Visits/index.d.ts +15 -0
  33. package/dist/PatientPopup/components/addBills/AddBillFooter.d.ts +2 -0
  34. package/dist/PatientPopup/components/addBills/AddBills.d.ts +5 -0
  35. package/dist/PatientPopup/components/addBills/AddBillsTable.d.ts +17 -0
  36. package/dist/PatientPopup/components/addBills/DropDown.d.ts +15 -0
  37. package/dist/PatientPopup/components/appointment/AllAppts.d.ts +8 -0
  38. package/dist/PatientPopup/components/appointment/Appointment.d.ts +2 -0
  39. package/dist/PatientPopup/components/appointment/AppointmentsTable.d.ts +10 -0
  40. package/dist/PatientPopup/components/bills/Bills.d.ts +6 -0
  41. package/dist/PatientPopup/components/bills/BillsTable.d.ts +11 -0
  42. package/dist/PatientPopup/components/deposit/DepositSection.d.ts +9 -0
  43. package/dist/PatientPopup/components/mainNavItem/MainNavItem.d.ts +13 -0
  44. package/dist/PatientPopup/components/patientPopupBody/PatientPopupBody.d.ts +8 -0
  45. package/dist/PatientPopup/components/patientPopupHeader/PatientPopupHeader.d.ts +10 -0
  46. package/dist/PatientPopup/components/patientPopupSummary/BillSummary.d.ts +19 -0
  47. package/dist/PatientPopup/components/patientPopupSummary/ConsultationDetails.d.ts +14 -0
  48. package/dist/PatientPopup/components/patientPopupSummary/DeleteItem.d.ts +11 -0
  49. package/dist/PatientPopup/components/patientPopupSummary/DepositRefundSummary.d.ts +8 -0
  50. package/dist/PatientPopup/components/patientPopupSummary/LabServiceDetails.d.ts +13 -0
  51. package/dist/PatientPopup/components/patientPopupSummary/OtherServiceDetails.d.ts +13 -0
  52. package/dist/PatientPopup/components/patientPopupSummary/PatientPopupSummary.d.ts +8 -0
  53. package/dist/PatientPopup/components/patientPopupSummary/PaymentCard.d.ts +25 -0
  54. package/dist/PatientPopup/components/patientPopupSummary/ServiceLevelBillSummary.d.ts +18 -0
  55. package/dist/PatientPopup/components/payments/DepositRefundTable.d.ts +14 -0
  56. package/dist/PatientPopup/components/payments/OtherServicesTable.d.ts +16 -0
  57. package/dist/PatientPopup/components/payments/PaymentEditModal.d.ts +15 -0
  58. package/dist/PatientPopup/components/payments/PaymentHeader.d.ts +7 -0
  59. package/dist/PatientPopup/components/payments/Payments.d.ts +5 -0
  60. package/dist/PatientPopup/components/payments/PaymentsTable.d.ts +14 -0
  61. package/dist/PatientPopup/constants/AppConstants.d.ts +123 -0
  62. package/dist/PatientPopup/index.d.ts +1 -0
  63. package/dist/PatientPopup/index.js +14681 -0
  64. package/dist/PatientPopup/types/hplxAPITypes.d.ts +37 -0
  65. package/dist/PatientPopup/utils/PrintFontLoader.d.ts +4 -0
  66. package/dist/PatientPopup/utils/helperFunctions.d.ts +3 -0
  67. package/dist/PediatricsCalculator/components/PediatricsCalculatorTableContext.d.ts +1 -1
  68. package/dist/PediatricsCalculator/index.js +1 -1
  69. package/dist/PediatricsCalculatorTable-B4fTy1J5.cjs +9 -0
  70. package/dist/PediatricsCalculatorTable-CNWwNxCr.js +1167 -0
  71. package/dist/PrintModal-9636D2oo.js +120749 -0
  72. package/dist/PrintModal-BZmh4_Md.cjs +425 -0
  73. package/dist/ReusableModal-BteIK-YX.js +29 -0
  74. package/dist/ReusableModal-CIgDYOWZ.cjs +1 -0
  75. package/dist/ReusableTable/context/TableContextBase.d.ts +1 -1
  76. package/dist/Subscription/components/SubscriptionBadge.d.ts +2 -0
  77. package/dist/TrendGraphs/context/index.d.ts +1 -1
  78. package/dist/changePasswordModal/APIAction/APIActions.d.ts +8 -0
  79. package/dist/changePasswordModal/component/ChangePasswordModal.d.ts +14 -0
  80. package/dist/clsx-C11secjj.cjs +1 -0
  81. package/dist/clsx-OuTLNxxd.js +16 -0
  82. package/dist/common/APIAction/APIAction.d.ts +28 -0
  83. package/dist/common/components/BorderFullWidth.d.ts +2 -0
  84. package/dist/common/components/table/ExistingPatients.d.ts +17 -0
  85. package/dist/common/editRibbon/EditRibbon.d.ts +9 -0
  86. package/dist/common/utils/NetworkInstance.d.ts +4 -0
  87. package/dist/common/utils/common-utils.d.ts +36 -0
  88. package/dist/components/CustomDropdown.d.ts +1 -1
  89. package/dist/components/PatientAddEdit.d.ts +3 -0
  90. package/dist/constants/CommonConstant.d.ts +70 -0
  91. package/dist/dayjs.min-B2cg6pUo.js +284 -0
  92. package/dist/dayjs.min-DXp74Ozx.cjs +1 -0
  93. package/dist/fonts/AnekMalayalam-Bold.ttf +0 -0
  94. package/dist/fonts/AnekMalayalam-Regular.ttf +0 -0
  95. package/dist/fonts/Arial-Bold-Italic.ttf +0 -0
  96. package/dist/fonts/Arial-Bold.ttf +0 -0
  97. package/dist/fonts/Arial-Italic.ttf +0 -0
  98. package/dist/fonts/Arial.ttf +0 -0
  99. package/dist/fonts/IndianRupee.ttf +0 -0
  100. package/dist/fonts/MuktaMaheePunjabi-Bold.ttf +0 -0
  101. package/dist/fonts/MuktaMaheePunjabi-Regular.ttf +0 -0
  102. package/dist/fonts/Noto-Sans-Telugu-Bold.ttf +0 -0
  103. package/dist/fonts/Noto-Sans-Telugu-Regular.ttf +0 -0
  104. package/dist/fonts/NotoNastaliqUrdu-Bold.ttf +0 -0
  105. package/dist/fonts/NotoNastaliqUrdu-Regular.ttf +0 -0
  106. package/dist/fonts/NotoSansArabic-Bold.ttf +0 -0
  107. package/dist/fonts/NotoSansArabic.ttf +0 -0
  108. package/dist/fonts/NotoSansHindi-Bold.ttf +0 -0
  109. package/dist/fonts/NotoSansHindi.ttf +0 -0
  110. package/dist/fonts/NotoSansKannada-Bold.ttf +0 -0
  111. package/dist/fonts/NotoSansKannada.ttf +0 -0
  112. package/dist/fonts/NotoSansOriya-Bold.ttf +0 -0
  113. package/dist/fonts/NotoSansOriya.ttf +0 -0
  114. package/dist/fonts/NotoSansTamil-Bold.ttf +0 -0
  115. package/dist/fonts/NotoSansTamil.ttf +0 -0
  116. package/dist/fonts/NotoSerifGujarati-Bold.ttf +0 -0
  117. package/dist/fonts/NotoSerifGujarati-Regular.ttf +0 -0
  118. package/dist/fonts/Roboto-Regular.ttf +0 -0
  119. package/dist/fonts/Times-Bold-Italic.ttf +0 -0
  120. package/dist/fonts/Times-Bold.ttf +0 -0
  121. package/dist/fonts/Times-Italic.ttf +0 -0
  122. package/dist/fonts/Times.ttf +0 -0
  123. package/dist/fonts/TiroBangla-Bold.ttf +0 -0
  124. package/dist/fonts/TiroBangla-Regular.ttf +0 -0
  125. package/dist/fonts/Verdana-Bold-Italic.ttf +0 -0
  126. package/dist/fonts/Verdana-Bold.ttf +0 -0
  127. package/dist/fonts/Verdana-Italic.ttf +0 -0
  128. package/dist/fonts/Verdana.ttf +0 -0
  129. package/dist/hooks/useMediaQuery.d.ts +1 -0
  130. package/dist/hplx-feature-library.css +1 -1
  131. package/dist/index-BUI6-03D.js +7242 -0
  132. package/dist/index-DQlbIHh3.cjs +102 -0
  133. package/dist/index-DXvmjJBJ.js +961 -0
  134. package/dist/index-DkA8S5IK.cjs +32 -0
  135. package/dist/index.js +2 -2
  136. package/dist/nineDots/NineDotsTypes.d.ts +22 -0
  137. package/dist/nineDots/NineDotsUtils.d.ts +3 -0
  138. package/dist/nineDots/nineDots.d.ts +3 -0
  139. package/dist/print-pdf/index.js +4 -0
  140. package/dist/searchPatients/SearchPatients.d.ts +11 -0
  141. package/dist/types/APIEndPoints.d.ts +11 -0
  142. package/dist/types/ApiResponseTypes.d.ts +290 -0
  143. package/dist/types/CommonTypes.d.ts +255 -0
  144. package/dist/types/PatientAddEditTypes/index.js +1 -0
  145. package/dist/types/PatientAddEditTypes.d.ts +7 -0
  146. package/dist/types/PatientPopupTypes/index.js +1 -0
  147. package/dist/types/PatientPopupTypes.d.ts +836 -0
  148. package/dist/userProfile/APIAction/APIActions.d.ts +18 -0
  149. package/dist/userProfile/UserProfile.d.ts +18 -0
  150. package/dist/userProfile/UserProfileItem.d.ts +7 -0
  151. package/dist/warning-BozzKWdr.js +38 -0
  152. package/dist/warning-W0tkkrLJ.cjs +1 -0
  153. package/package.json +31 -5
  154. package/dist/AllInvestigationsTable-C3aTtdGN.cjs +0 -79
  155. package/dist/PediatricsCalculatorTable-Be2H_OXh.js +0 -2156
  156. package/dist/PediatricsCalculatorTable-fk_QinWG.cjs +0 -40
  157. package/dist/index-4whwJbrk.js +0 -6867
  158. package/dist/index-C6KQLMQs.cjs +0 -92
@@ -1,40 +0,0 @@
1
- "use strict";const t=require("./index-C6KQLMQs.cjs"),C=require("react"),z=require("./constants/PediatricsCalculatorConstants/index.js"),ut=require("./useClickOutside-DsVG12Cs.cjs"),ct=require("./useOutsideClick-CicUjzPP.cjs"),ft=require("react-dom"),Ke=C.createContext(null),Ye=()=>{const o=C.useContext(Ke);if(!o)throw new Error("usePediatricsCalculatorTableContext must be used inside a MedicineTableProvider");return o},dt=({effectiveEditMode:o,rowData:r,isSavedToLibrary:b,onSave:c,onCancel:f,onEdit:v,onCheckboxToggle:m})=>{const{variant:n,externallyTriggeredEditMode:w,setRowToDelete:y,openPopupForRow:h}=Ye();return n==="standard"?o?t.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg ",children:[t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hfl-border-r-1 hover:hfl-bg-Primary-50",onClick:c,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"hfl-text-Blue_gray-800",children:"Save"})}),t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Error-600 hover:hfl-bg-Error-50",onClick:f,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Cancel"})})]}):t.jsxRuntimeExports.jsxs("div",{className:"hfl-grid hfl-grid-cols-[1fr_1fr_1fr] hfl-border-1 hfl-border-Gray-200 hfl-rounded-lg",children:[t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-1 hfl-text-Blue_gray-800 hover:hfl-bg-Primary-50",onClick:v,children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Edit"})}),t.jsxRuntimeExports.jsx("button",{className:"hfl-px-3 hfl-py-2 hfl-text-Blue_gray-800 hfl-border-x-1 hover:hfl-bg-Primary-50",onClick:()=>h?.(r),children:t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xs",className:"",children:"Copy"})}),t.jsxRuntimeExports.jsx("button",{className:"hx_delete hfl-px-3 hfl-py-2 hfl-text-Error-500 hover:hfl-bg-Error-50",onClick:()=>y?.(r.rowId)})]}):t.jsxRuntimeExports.jsx(t.Os,{disabled:!w,text:"Save this to Pediatric Calculator Library ",id:r.rowId,size:"md",onClick:m,isMarked:b??!1,checkboxClasses:"hfl-mt-2",checkBoxInnerDivClasses:"hfl-text-Blue-600 hfl-bg-Blue-50"},r.rowId)};function pt(o){const{options:r,selectedOption:b,onChangeHandler:c}=o;return t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-gap-2 hfl-h-full hfl-items-center hfl-px-4 hfl-justify-center hfl-py-1",children:r?.map(f=>t.jsxRuntimeExports.jsx("div",{className:"hfl-bg-White hfl-rounded-lg",children:t.jsxRuntimeExports.jsx(t.Ku,{onClick:()=>c&&c(f),hierarchy:b?.label===f.label?"Primary":"Secondary-Grey",size:"sm",textField:f.label,className:b?.label===f.label?"hfl-bg-Blue-600":""})},f.label))})}const ht="data:image/svg+xml,%3csvg%20width='10'%20height='6'%20viewBox='0%200%2010%206'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M0.480062%200.819173C0.650418%200.648817%200.92662%200.648817%201.09698%200.819173L4.71454%204.43674L8.3321%200.819173C8.50246%200.648817%208.77866%200.648817%208.94902%200.819173C9.11937%200.98953%209.11937%201.26573%208.94902%201.43609L5.023%205.36211C4.85264%205.53246%204.57644%205.53246%204.40608%205.36211L0.480062%201.43609C0.309706%201.26573%200.309706%200.98953%200.480062%200.819173Z'%20fill='%23667085'/%3e%3c/svg%3e";function U(o){const{label:r,labelClassName:b,hideDropdownIcon:c,showClearOption:f,isRequiredField:v,btnClassName:m,placeholder:n,options:w,selectedOption:y,onChangeHandler:h,inputValue:a,inputChangeHandler:g,onInputFocusOutEvent:x,inputClassName:s,isSearchable:E,inputType:S,showInput:D,inputSuffix:A,selectedLabel:B,suffixPadding:W,disableInputAutoSize:R,selectedOptions:I,isMulti:T,dropDownItemClickHandler:F,showToggle:q,toggleChangeHandler:L,selectedToggleOption:p,toggleOptionsList:l,border:j,height:i,disabled:u,fieldColor:O,errorMsg:e,showErrorMsg:d,placeholderStyle:_,onInputKeyDown:N,showEmptyDropdownPopup:M=!0,isDropdownFixed:H=!1,dropdownClassName:V="",wrapperClass:ee="",maxInputLength:se,alternateListBgStyle:oe,showLabelTooltip:P=!1,labelToolTipContent:X="",inputContainerClasses:ne="",onInputFocus:ie}=o,[le,ce]=C.useState(!1),[fe,rt]=C.useState(null),me=C.useRef(null),be=C.useRef(null),Se=C.useRef(null),_e=C.useRef([]),ot=C.useMemo(()=>w?.filter(k=>k?k.label.toLowerCase().includes((a??"").toLowerCase()):void 0),[a,w]),[lt,Ee]=C.useState(!1),at=()=>{ce(!1),T&&g&&g(""),rt(null)},Me=C.useCallback(k=>{k.stopPropagation(),u||ce($=>!$)},[u]),Te=(a?.length||0)+2+Number(W||0);ct.useOutsideClick(me,at),C.useEffect(()=>{fe!==null&&_e.current[fe]&&_e.current[fe].scrollIntoView({block:"nearest"})},[fe]);const de=C.useCallback(()=>{if(H&&le){const k=D?be.current:Se.current,$=me.current;if(k&&$){const Z=k.getBoundingClientRect();$.style.position="fixed",$.style.top=`${window.scrollY?Z.bottom+window.scrollY:Z.bottom}px`,$.style.left=`${Z.left}px`,$.style.width=`${Z.width}px`}}},[H,le,D]);C.useEffect(()=>{if(H)return le?(de(),window.addEventListener("scroll",de,!0)):window.removeEventListener("scroll",de,!0),()=>{window.removeEventListener("scroll",de,!0)}},[H,de,le]),ut.useClickOutside(me,()=>{lt&&x&&x()});const De=k=>{if(T&&F){const $=I?.some(Z=>Z.value===k.value);F(!!$,k)}},st=C.useCallback(async k=>{k.stopPropagation(),le||ce(!0),ie&&await ie()},[ie,le]);return t.jsxRuntimeExports.jsxs("div",{className:`hfl-relative hfl-inline-block hfl-text-left ${ee||""}`,children:[!!r&&t.jsxRuntimeExports.jsxs("div",{className:"hfl-text-Gray-700 hfl-mb-1 hfl-flex",children:[t.jsxRuntimeExports.jsx(t.bs,{type:"Text sm",variant:"Medium",className:b||"",children:`${r}`}),v&&t.jsxRuntimeExports.jsx("span",{className:"hfl-ml-1 hfl-text-Error-600",children:"*"}),P&&t.jsxRuntimeExports.jsx(t.Nu,{variant:"Right",text:X,theme:"dark",children:t.jsxRuntimeExports.jsx("i",{className:"hx_info-filled"})})]}),D?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsxs("div",{className:`hfl-flex hfl-items-center hfl-shadow-xs hfl-px-2 ${ne||""} ${j||"hfl-border-1"} hfl-rounded-lg hfl-overflow-x-auto ${e?"hfl-border-Error-300":"hfl-border-Gray-300"} ${i||"hfl-h-10"} ${u?"!hfl-bg-Gray-50 !hfl-pointer-events-none":O||"hfl-bg-White"} hover:hfl-border-Primary-300 hover:hfl-shadow-xs-primary`,onClick:u?()=>{}:Me,children:[I?.map((k,$)=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Blue-100 hfl-mr-2 hfl-py-1 hfl-px-2 hfl-rounded-sm hfl-font-inter-0 hfl-text-nowrap",children:[t.jsxRuntimeExports.jsx("span",{className:"hfl-pointer-events-none",children:k.label}),t.jsxRuntimeExports.jsx("span",{onClick:Z=>{Z.stopPropagation(),De(k)},className:"hx_close hfl-text-Gray-500 hfl-my-0 hfl-text-[14px] hfl-ml-[1px] hfl-cursor-pointer"})]},`${k.label}-${$}`)),Object.keys(_||{}).length>0&&t.jsxRuntimeExports.jsx("style",{children:`
2
- input.input-placeholder::placeholder {
3
- font-family: ${_?.fontFamily};
4
- font-weight: ${_?.fontWeight};
5
- line-height: ${_?.lineHeight};
6
- font-size: ${_?.fontSize};
7
- color: ${_?.color};
8
- }
9
- `}),t.jsxRuntimeExports.jsx("input",{ref:be,style:R?{}:{width:`${Number(a?.length)>4?(a?.length||0)+5:12}ch`},type:S,placeholder:n,value:a,className:`input-placeholder hfl-flex-1 hfl-pl-2 hfl-placeholder hfl-py-1 focus-visible:hfl-outline-0 focus-visible:hfl-outline-none hfl-border-0 focus:hfl-border-0 ${u?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":O||"hfl-bg-White"} ${s||""}`,onChange:k=>{g&&g(k.target.value),Ee(!0)},onClick:st,onKeyDown:k=>N&&N(k,ce,be),maxLength:se??se,...o.inputProps||{}}),!c&&!f&&t.jsxRuntimeExports.jsx("i",{className:"hx_down hfl-mx-2"}),f&&t.jsxRuntimeExports.jsx("i",{className:`${a?"hx_close hfl-cursor-pointer":"hx_down"} hfl-mx-2`,onClick:()=>{(y?.value||a)&&(g&&g(""),Ee(!0))}}),A?t.jsxRuntimeExports.jsx("span",{style:{left:`${Te<2?"3":Te}ch`},className:"hfl-absolute hfl-top-1/2 hfl--translate-y-1/2 hfl-pointer-events-none",children:A}):null]}),d&&t.jsxRuntimeExports.jsx("span",{className:"hfl-text-0 hfl-text-Error-600",children:e})]}):t.jsxRuntimeExports.jsxs("button",{ref:Se,onClick:Me,className:`hfl-w-full hfl-bg-White hfl-py-[6px] hfl-px-4 hfl-rounded-lg hfl-inline-flex hfl-justify-between hfl-items-center ${m||""} ${j||"hfl-border-1"} ${e?"hfl-border-Error-300":"hfl-border-Gray-300"} ${i||"hfl-h-[40px]"} ${u?"!hfl-bg-Gray-50 !hfl-cursor-not-allowed":""}`,style:B||y?.label?{}:_?{fontFamily:_?.fontFamily,fontSize:_?.fontSize,fontWeight:_?.fontWeight,lineHeight:_?.lineHeight,color:_?.color}:{},children:[t.jsxRuntimeExports.jsx("span",{className:"hfl-pr-4",children:B||y?.label||n||"Select an option"}),t.jsxRuntimeExports.jsx("img",{src:ht,alt:"down arrow"})]}),w&&w?.length>=0&&t.jsxRuntimeExports.jsxs("ul",{ref:me,className:`custom-dropdown-menu ${le?"hfl-visible":"hfl-invisible"} hfl-absolute hfl-z-50 hfl-grid hfl-gap-1 hfl-mt-3 hfl-w-full hfl-rounded-lg hfl-shadow-lg hfl-bg-White hfl-font-inter-0 hfl-p-1 hfl-px-2 ${T?"hfl-min-w-[20em]":"hfl-min-w-[16em]"} hfl-max-h-[330px] hfl-overflow-y-scroll ${V}`,role:"menu","aria-orientation":"vertical","aria-labelledby":"options-menu",children:[q?t.jsxRuntimeExports.jsx(pt,{onChangeHandler:L,selectedOption:p,options:l}):!1,(E?ot:w)?.map((k,$)=>{const Z=T?!!I?.some(we=>we.value===k?.value):!1,Ie=y?.value===k?.value,it=fe===$;return k?t.jsxRuntimeExports.jsx("li",{onClick:()=>{T?De(k):(h&&h(k),ce(!1),Ee(!1))},className:`hfl-text-1 hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item ${oe?"odd:hfl-bg-Gray-100":""} ${Ie?"hfl-bg-Blue-50 hfl-text-Blue-500":""}`,role:"menuitem","aria-selected":Ie,tabIndex:it?0:-1,ref:we=>{_e.current[$]=we},children:T?t.jsxRuntimeExports.jsx(t.Os,{size:"sm",disabled:!1,text:t.jsxRuntimeExports.jsx("span",{children:k.label}),secondaryText:"",id:`${k.label}-${$}`,isMarked:Z}):k.label},`${k.label}-${$}`):null}),w?.length===0&&M&&t.jsxRuntimeExports.jsx("li",{className:"hfl-block hfl-px-4 hfl-py-2 hfl-rounded-md hover:hfl-bg-Blue-50 hfl-cursor-pointer custom_dropdown_item",children:"No items found, please change the search criteria"})]})]})}var je,Fe;function mt(){if(Fe)return je;Fe=1;var o="Expected a function",r=NaN,b="[object Symbol]",c=/^\s+|\s+$/g,f=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,m=/^0o[0-7]+$/i,n=parseInt,w=typeof t.commonjsGlobal=="object"&&t.commonjsGlobal&&t.commonjsGlobal.Object===Object&&t.commonjsGlobal,y=typeof self=="object"&&self&&self.Object===Object&&self,h=w||y||Function("return this")(),a=Object.prototype,g=a.toString,x=Math.max,s=Math.min,E=function(){return h.Date.now()};function S(R,I,T){var F,q,L,p,l,j,i=0,u=!1,O=!1,e=!0;if(typeof R!="function")throw new TypeError(o);I=W(I)||0,D(T)&&(u=!!T.leading,O="maxWait"in T,L=O?x(W(T.maxWait)||0,I):L,e="trailing"in T?!!T.trailing:e);function d(P){var X=F,ne=q;return F=q=void 0,i=P,p=R.apply(ne,X),p}function _(P){return i=P,l=setTimeout(H,I),u?d(P):p}function N(P){var X=P-j,ne=P-i,ie=I-X;return O?s(ie,L-ne):ie}function M(P){var X=P-j,ne=P-i;return j===void 0||X>=I||X<0||O&&ne>=L}function H(){var P=E();if(M(P))return V(P);l=setTimeout(H,N(P))}function V(P){return l=void 0,e&&F?d(P):(F=q=void 0,p)}function ee(){l!==void 0&&clearTimeout(l),i=0,F=j=q=l=void 0}function se(){return l===void 0?p:V(E())}function oe(){var P=E(),X=M(P);if(F=arguments,q=this,j=P,X){if(l===void 0)return _(j);if(O)return l=setTimeout(H,I),d(j)}return l===void 0&&(l=setTimeout(H,I)),p}return oe.cancel=ee,oe.flush=se,oe}function D(R){var I=typeof R;return!!R&&(I=="object"||I=="function")}function A(R){return!!R&&typeof R=="object"}function B(R){return typeof R=="symbol"||A(R)&&g.call(R)==b}function W(R){if(typeof R=="number")return R;if(B(R))return r;if(D(R)){var I=typeof R.valueOf=="function"?R.valueOf():R;R=D(I)?I+"":I}if(typeof R!="string")return R===0?R:+R;R=R.replace(c,"");var T=v.test(R);return T||m.test(R)?n(R.slice(2),T?2:8):f.test(R)?r:+R}return je=S,je}var xt=mt();const gt=t.getDefaultExportFromCjs(xt),Ce=(o,r)=>{const b=parseFloat(o),c=parseFloat(r);if(!o||!r||isNaN(b)||isNaN(c)||c===0)return"";const f=b/c;return Number.isInteger(f)?f.toString(10):f.toFixed(3).replace(/\.?0+$/,"")},te=o=>/^(\d+)?(\.)?(\d*)?$/.test(o),K=({label:o,children:r})=>t.jsxRuntimeExports.jsxs(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-grid hfl-grid-cols-2 hfl-items-center hfl-text-Blue_gray-800 hfl-justify-between hfl-gap-8",children:[t.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[o,":"]}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex-1 hfl-min-w-0",children:r})]}),Y=({label:o,value:r})=>t.jsxRuntimeExports.jsxs(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-flex hfl-text-Blue_gray-800 hfl-gap-1",children:[t.jsxRuntimeExports.jsxs("span",{className:"hfl-flex-shrink-0",children:[o,":"]}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Bold",type:"Text sm",className:"hfl-text-Blue_gray-800 hfl-break-words hfl-min-w-0",children:r||"--"})]}),pe=({children:o,className:r=""})=>t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:`hfl-text-Blue_gray-800 hfl-px-2 hfl-break-words hfl-overflow-wrap-anywhere hfl-min-w-0 ${r}`,children:o}),vt=C.memo(function({rowData:r,isEditing:b,setIsEditing:c,onSaveRow:f,allowCustomMedicineInput:v}){const{variant:m,externallyTriggeredEditMode:n,externallyTriggeredEditRowIds:w,getMedicineOptions:y,onRowChange:h,onRowDelete:a}=Ye(),[g,x]=C.useState([]),[s,E]=C.useState(r),[S,D]=C.useState(r.medicine_name);C.useEffect(()=>{b||D(r.medicine_name)},[r.medicine_name,b]),C.useEffect(()=>{b||E(r)},[r,b]);const A=async e=>(await y?.(e))?.map(_=>({label:_.doctorMedicineName,value:_}))||[],W=n||w?.includes(r.rowId)||b,R=C.useMemo(()=>s.out_of_range||r.out_of_range,[s.out_of_range,r.out_of_range]),I=C.useMemo(()=>s?.isDosageMismatch||r?.isDosageMismatch,[s?.isDosageMismatch,r?.isDosageMismatch]),T=C.useMemo(()=>s.calculation_type===z.C_MedicineCalculatorList[0]?s.calculation_fields:null,[s.calculation_fields,s.calculation_type]),F=C.useMemo(()=>s.calculation_type===z.C_MedicineCalculatorList[1]?s.calculation_fields:null,[s.calculation_fields,s.calculation_type]),q=(e,d)=>{let _;if(e==="calculation_type"){const N=d,M={frequency:s.calculation_fields.frequency,pedia_dosage:m==="standard"?s.calculation_fields.pedia_dosage:s.pedia_dosage};_={...s,calculation_type:N,calculation_fields:N==="mg/kg/dose"?{...z.C_DefaultMgKgFields,...M}:{...z.C_DefaultMlKgFields,...M}}}else _={...s,[e]:d};E(_),m==="prescription"&&L(_,e)},L=C.useMemo(()=>gt((e,d)=>{h?.(e,d||void 0)},500),[h]),p=C.useMemo(()=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-mb-1 hfl-flex hfl-w-max hfl-items-center hfl-rounded hfl-border-1 hfl-border-Warning-400 hfl-bg-Warning-50 hfl-p-1 hfl-px-2",children:[t.jsxRuntimeExports.jsx("div",{className:"hx_warning hfl-text-Error-400"}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-px-2 hfl-text-1 hfl-text-Error-500",children:"Dosage exceed safety limits"})]}),[]);C.useEffect(()=>()=>{L.cancel()},[L]);const l=C.useCallback((e,d)=>{E(_=>{let N={..._.calculation_fields,[e]:d};if(e==="frequency"&&m==="standard"){const H=z.C_FrequencyDosageMap[d]||[];H.length>0&&(N={...N,pedia_dosage:H[0]})}const M={..._,calculation_fields:N};return m==="prescription"&&L(M,e),M})},[L,m]),j=async()=>{const e={...s,calculation_fields:{...s.calculation_fields}};await f?.(e)&&L({...e,isNewlyAdded:!1,isEditing:!1})},i=async()=>{if(!r.medicine_name||r.medicine_name.trim()===""){a?.(r.rowId);return}E(r),m==="standard"&&c(!1)},u=e=>m==="prescription"&&(e==="medicine_name"||e==="generic_name"||e==="type"||e==="calculation_type")?!1:W,O=()=>{const e=!(s?.isSavedToLibrary??!1),d={...s,isSavedToLibrary:e};E(d),L(d,"isSavedToLibrary")};return t.jsxRuntimeExports.jsxs("div",{className:`medicine-row hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-px-2 hfl-py-1 hfl-border-b-1 hfl-border-Gray-200 ${W?"hfl-bg-gradient-to-b hfl-from-White_20 hfl-to-Primary-50":""} ${m==="prescription"&&!s.pedia_data_available?"hfl-hidden":""}`,children:[t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("medicine_name")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",inputValue:s.medicine_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:async e=>{if(q("medicine_name",e),e.trim()){const d=await A(e);x(d)}else x([])},onInputFocus:async()=>{const e=await A(s.medicine_name);x(e)},onChangeHandler:e=>{const d=e.value,_=z.C_MedicineTypeList.find(N=>N.val===d.medicineType);E(N=>({...N,medicine_name:d.doctorMedicineName,medicine_id:d.medicineId,generic_name:d.doctorGenericName,type:_?.type??""})),D(d.doctorMedicineName)},options:g,isSearchable:!0,placeholder:"Search medicine",disabled:!s?.isNewlyAdded,inputProps:{onBlur:e=>{const d=e.relatedTarget;if(!(d&&d.closest(".custom-dropdown-menu"))&&!v){const _=s.medicine_name?.trim()||"";g.some(M=>M.label===_)||E(M=>({...M,medicine_name:S}))}}}}):t.jsxRuntimeExports.jsx(pe,{children:r.medicine_name})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("generic_name")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",inputClassName:"hfl-w-full",btnClassName:"hfl-w-full",inputValue:s.generic_name,showInput:!0,disableInputAutoSize:!0,inputChangeHandler:e=>q("generic_name",e),hideDropdownIcon:!0}):t.jsxRuntimeExports.jsx(pe,{children:r.generic_name})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("type")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:(()=>{const e=z.C_MedicineTypeList.find(d=>d.type===s.type);return e?{label:e.type,value:e.type}:void 0})(),options:z.C_MedicineTypeList.map(e=>({label:e.type,value:e.type})),onChangeHandler:e=>q("type",e.value)}):t.jsxRuntimeExports.jsx(pe,{children:r.type||""})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("calculation_type")?t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",placeholder:"Select",showInput:!1,disableInputAutoSize:!0,selectedOption:{label:s.calculation_type,value:s.calculation_type},options:z.C_MedicineCalculatorList.map(e=>({label:e,value:e})),onChangeHandler:e=>q("calculation_type",e.value)}):t.jsxRuntimeExports.jsx(pe,{children:r.calculation_type})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-w-full hfl-flex-col hfl-gap-2 hfl-py-2.5 hfl-px-2",children:u("calculation_fields")?t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[T&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(K,{label:"Drug Strength",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.drug_strength||"",inputChangeHandler:e=>{te(e)&&l("drug_strength",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mg/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.dose_mg_kg||"",inputChangeHandler:e=>{te(e)&&l("dose_mg_kg",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Frequency",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:s.calculation_fields.frequency?{label:s.calculation_fields.frequency,value:s.calculation_fields.frequency}:void 0,options:z.C_MedicineFrequencyList.map(e=>({label:e,value:e})),onChangeHandler:e=>{l("frequency",e.value)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Dose (mg)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mg/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.max_mg_dose||"",inputChangeHandler:e=>{te(e)&&l("max_mg_dose",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Day (mg)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mg/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:T.max_mg_day||"",inputChangeHandler:e=>{te(e)&&l("max_mg_day",e)}})})]}),F&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(K,{label:"Drug Strength/mL",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 250",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.drug_strength||"",inputChangeHandler:e=>{te(e)&&(l("drug_strength",e),l("dose_ml_kg",Ce(F.dose_mg_kg,e)))}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mg/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"e.g., 15",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.dose_mg_kg||"",inputChangeHandler:e=>{te(e)&&(l("dose_mg_kg",e),l("dose_ml_kg",Ce(e,F.drug_strength)))}})}),t.jsxRuntimeExports.jsx(K,{label:"Dose/mL/kg",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",disabled:!0,placeholder:"e.g., 5",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:Ce(F.dose_mg_kg,F.drug_strength)||"",inputChangeHandler:e=>{te(e)&&l("dose_ml_kg",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Frequency",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Frequency",showInput:!1,selectedOption:s.calculation_fields.frequency?{label:s.calculation_fields.frequency,value:s.calculation_fields.frequency}:void 0,options:z.C_MedicineFrequencyList.map(e=>({label:e,value:e})),onChangeHandler:e=>{l("frequency",e.value)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Dose (mL)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mL/dose",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.max_ml_dose||"",inputChangeHandler:e=>{te(e)&&l("max_ml_dose",e)}})}),t.jsxRuntimeExports.jsx(K,{label:"Max Day (mL)",children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",placeholder:"Max mL/day",showInput:!0,hideDropdownIcon:!0,disableInputAutoSize:!0,inputType:"text",inputValue:F.max_ml_day||"",inputChangeHandler:e=>{te(e)&&l("max_ml_day",e)}})})]})]}):t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[T&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y,{label:"Drug Strength",value:T.drug_strength}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mg/kg",value:T.dose_mg_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Frequency",value:T.frequency}),t.jsxRuntimeExports.jsx(Y,{label:"Max Dose (mg)",value:T.max_mg_dose}),t.jsxRuntimeExports.jsx(Y,{label:"Max Day (mg)",value:T.max_mg_day})]}),F&&t.jsxRuntimeExports.jsxs(t.jsxRuntimeExports.Fragment,{children:[t.jsxRuntimeExports.jsx(Y,{label:"Drug Strength/mL",value:F.drug_strength}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mg/kg",value:F.dose_mg_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Dose/mL/kg",value:F.dose_ml_kg}),t.jsxRuntimeExports.jsx(Y,{label:"Frequency",value:F.frequency}),t.jsxRuntimeExports.jsx(Y,{label:"Max Dose (mL)",value:F.max_ml_dose}),t.jsxRuntimeExports.jsx(Y,{label:"Max Day (mL)",value:F.max_ml_day})]})]})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:u("pedia_dosage")?(()=>{const e=s.calculation_fields.frequency,d=z.C_FrequencyDosageMap[e]||[];return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsx(U,{wrapperClass:"hfl-w-full",btnClassName:"hfl-w-full",inputClassName:"hfl-w-full",placeholder:"Select",showInput:m!=="standard",disableInputAutoSize:!0,inputValue:m==="standard"?s.calculation_fields.pedia_dosage:s.pedia_dosage,inputChangeHandler:_=>m==="prescription"?q("pedia_dosage",_):l("pedia_dosage",_),selectedOption:m==="standard"?{label:s.calculation_fields.pedia_dosage,value:s.calculation_fields.pedia_dosage}:void 0,options:m!=="prescription"?d.map(_=>({label:_,value:_})):void 0,onChangeHandler:m!=="prescription"?_=>l("pedia_dosage",_.value):void 0,hideDropdownIcon:m==="prescription",showEmptyDropdownPopup:m!=="prescription",showErrorMsg:m==="prescription"?R||I:!1,errorMsg:m==="prescription"&&R?"Dosage Exceeds Safety Limits":m==="prescription"&&I?"Dosage is in mismatch with selected type of Frequency":""})})})():t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-flex-col hfl-h-full hfl-justify-between hfl-min-w-0",children:[t.jsxRuntimeExports.jsx(pe,{children:m==="prescription"?r.pedia_dosage:r.calculation_fields.pedia_dosage}),R&&p]})}),t.jsxRuntimeExports.jsx("div",{className:"hfl-w-full hfl-py-2.5 hfl-min-w-0",children:t.jsxRuntimeExports.jsx(dt,{effectiveEditMode:W,rowData:r,isSavedToLibrary:s.isSavedToLibrary??!1,onSave:j,onCancel:i,onEdit:()=>c(!0),onCheckboxToggle:O})})]})},(o,r)=>o.isEditing===r.isEditing&&o.rowData.rowId===r.rowData.rowId&&o.rowData.isEditing===r.rowData.isEditing&&o.rowData.medicine_name===r.rowData.medicine_name&&o.rowData.generic_name===r.rowData.generic_name&&o.rowData.type===r.rowData.type&&o.rowData.pedia_dosage===r.rowData.pedia_dosage&&o.rowData.calculation_type===r.rowData.calculation_type&&JSON.stringify(o.rowData.calculation_fields)===JSON.stringify(r.rowData.calculation_fields)&&o.rowData.out_of_range===r.rowData.out_of_range&&o.rowData.isDosageMismatch===r.rowData.isDosageMismatch&&o.rowData.calculation_fields.pedia_dosage===r.rowData.calculation_fields.pedia_dosage&&o.rowData?.isNewlyAdded===r.rowData?.isNewlyAdded&&o.rowData?.pedia_data_available===r.rowData?.pedia_data_available);var xe={exports:{}},re={},ge={exports:{}},G={},ve={exports:{}},ke;function Je(){return ke||(ke=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=h;/*!
10
- * Adapted from jQuery UI core
11
- *
12
- * http://jqueryui.com
13
- *
14
- * Copyright 2014 jQuery Foundation and other contributors
15
- * Released under the MIT license.
16
- * http://jquery.org/license
17
- *
18
- * http://api.jqueryui.com/category/ui-core/
19
- */var b="none",c="contents",f=/^(input|select|textarea|button|object|iframe)$/;function v(a,g){return g.getPropertyValue("overflow")!=="visible"||a.scrollWidth<=0&&a.scrollHeight<=0}function m(a){var g=a.offsetWidth<=0&&a.offsetHeight<=0;if(g&&!a.innerHTML)return!0;try{var x=window.getComputedStyle(a),s=x.getPropertyValue("display");return g?s!==c&&v(a,x):s===b}catch{return console.warn("Failed to inspect element style"),!1}}function n(a){for(var g=a,x=a.getRootNode&&a.getRootNode();g&&g!==document.body;){if(x&&g===x&&(g=x.host.parentNode),m(g))return!1;g=g.parentNode}return!0}function w(a,g){var x=a.nodeName.toLowerCase(),s=f.test(x)&&!a.disabled||x==="a"&&a.href||g;return s&&n(a)}function y(a){var g=a.getAttribute("tabindex");g===null&&(g=void 0);var x=isNaN(g);return(x||g>=0)&&w(a,!x)}function h(a){var g=[].slice.call(a.querySelectorAll("*"),0).reduce(function(x,s){return x.concat(s.shadowRoot?h(s.shadowRoot):[s])},[]);return g.filter(y)}o.exports=r.default}(ve,ve.exports)),ve.exports}var Ae;function yt(){if(Ae)return G;Ae=1,Object.defineProperty(G,"__esModule",{value:!0}),G.resetState=m,G.log=n,G.handleBlur=w,G.handleFocus=y,G.markForFocusLater=h,G.returnFocus=a,G.popWithoutFocus=g,G.setupScopedFocus=x,G.teardownScopedFocus=s;var o=Je(),r=b(o);function b(E){return E&&E.__esModule?E:{default:E}}var c=[],f=null,v=!1;function m(){c=[]}function n(){process.env.NODE_ENV!=="production"&&(console.log("focusManager ----------"),c.forEach(function(E){var S=E||{};console.log(S.nodeName,S.className,S.id)}),console.log("end focusManager ----------"))}function w(){v=!0}function y(){if(v){if(v=!1,!f)return;setTimeout(function(){if(!f.contains(document.activeElement)){var E=(0,r.default)(f)[0]||f;E.focus()}},0)}}function h(){c.push(document.activeElement)}function a(){var E=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,S=null;try{c.length!==0&&(S=c.pop(),S.focus({preventScroll:E}));return}catch{console.warn(["You tried to return focus to",S,"but it is not in the DOM anymore"].join(" "))}}function g(){c.length>0&&c.pop()}function x(E){f=E,window.addEventListener?(window.addEventListener("blur",w,!1),document.addEventListener("focus",y,!0)):(window.attachEvent("onBlur",w),document.attachEvent("onFocus",y))}function s(){f=null,window.addEventListener?(window.removeEventListener("blur",w),document.removeEventListener("focus",y)):(window.detachEvent("onBlur",w),document.detachEvent("onFocus",y))}return G}var ye={exports:{}},Le;function bt(){return Le||(Le=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=m;var b=Je(),c=f(b);function f(n){return n&&n.__esModule?n:{default:n}}function v(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;return n.activeElement.shadowRoot?v(n.activeElement.shadowRoot):n.activeElement}function m(n,w){var y=(0,c.default)(n);if(!y.length){w.preventDefault();return}var h=void 0,a=w.shiftKey,g=y[0],x=y[y.length-1],s=v();if(n===s){if(!a)return;h=x}if(x===s&&!a&&(h=g),g===s&&a&&(h=x),h){w.preventDefault(),h.focus();return}var E=/(\bChrome\b|\bSafari\b)\//.exec(navigator.userAgent),S=E!=null&&E[1]!="Chrome"&&/\biPod\b|\biPad\b/g.exec(navigator.userAgent)==null;if(S){var D=y.indexOf(s);if(D>-1&&(D+=a?-1:1),h=y[D],typeof h>"u"){w.preventDefault(),h=a?x:g,h.focus();return}w.preventDefault(),h.focus()}}o.exports=r.default}(ye,ye.exports)),ye.exports}var J={},Re,qe;function _t(){if(qe)return Re;qe=1;var o=process.env.NODE_ENV!=="production",r=function(){};if(o){var b=function(f,v){var m=arguments.length;v=new Array(m>1?m-1:0);for(var n=1;n<m;n++)v[n-1]=arguments[n];var w=0,y="Warning: "+f.replace(/%s/g,function(){return v[w++]});typeof console<"u"&&console.error(y);try{throw new Error(y)}catch{}};r=function(c,f,v){var m=arguments.length;v=new Array(m>2?m-2:0);for(var n=2;n<m;n++)v[n-2]=arguments[n];if(f===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");c||b.apply(null,[f].concat(v))}}return Re=r,Re}var Q={},Oe={exports:{}};/*!
20
- Copyright (c) 2015 Jed Watson.
21
- Based on code that is Copyright 2013-2015, Facebook, Inc.
22
- All rights reserved.
23
- */var Pe;function Et(){return Pe||(Pe=1,function(o){(function(){var r=!!(typeof window<"u"&&window.document&&window.document.createElement),b={canUseDOM:r,canUseWorkers:typeof Worker<"u",canUseEventListeners:r&&!!(window.addEventListener||window.attachEvent),canUseViewport:r&&!!window.screen};o.exports?o.exports=b:window.ExecutionEnvironment=b})()}(Oe)),Oe.exports}var He;function Ne(){if(He)return Q;He=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.canUseDOM=Q.SafeNodeList=Q.SafeHTMLCollection=void 0;var o=Et(),r=b(o);function b(v){return v&&v.__esModule?v:{default:v}}var c=r.default,f=c.canUseDOM?window.HTMLElement:{};return Q.SafeHTMLCollection=c.canUseDOM?window.HTMLCollection:{},Q.SafeNodeList=c.canUseDOM?window.NodeList:{},Q.canUseDOM=c.canUseDOM,Q.default=f,Q}var We;function Xe(){if(We)return J;We=1,Object.defineProperty(J,"__esModule",{value:!0}),J.resetState=v,J.log=m,J.assertNodeList=n,J.setElement=w,J.validateElement=y,J.hide=h,J.show=a,J.documentNotReadyOrSSRTesting=g;var o=_t(),r=c(o),b=Ne();function c(x){return x&&x.__esModule?x:{default:x}}var f=null;function v(){f&&(f.removeAttribute?f.removeAttribute("aria-hidden"):f.length!=null?f.forEach(function(x){return x.removeAttribute("aria-hidden")}):document.querySelectorAll(f).forEach(function(x){return x.removeAttribute("aria-hidden")})),f=null}function m(){if(process.env.NODE_ENV!=="production"){var x=f||{};console.log("ariaAppHider ----------"),console.log(x.nodeName,x.className,x.id),console.log("end ariaAppHider ----------")}}function n(x,s){if(!x||!x.length)throw new Error("react-modal: No elements were found for selector "+s+".")}function w(x){var s=x;if(typeof s=="string"&&b.canUseDOM){var E=document.querySelectorAll(s);n(E,s),s=E}return f=s||f,f}function y(x){var s=x||f;return s?Array.isArray(s)||s instanceof HTMLCollection||s instanceof NodeList?s:[s]:((0,r.default)(!1,["react-modal: App element is not defined.","Please use `Modal.setAppElement(el)` or set `appElement={el}`.","This is needed so screen readers don't see main content","when modal is opened. It is not recommended, but you can opt-out","by setting `ariaHideApp={false}`."].join(" ")),[])}function h(x){var s=!0,E=!1,S=void 0;try{for(var D=y(x)[Symbol.iterator](),A;!(s=(A=D.next()).done);s=!0){var B=A.value;B.setAttribute("aria-hidden","true")}}catch(W){E=!0,S=W}finally{try{!s&&D.return&&D.return()}finally{if(E)throw S}}}function a(x){var s=!0,E=!1,S=void 0;try{for(var D=y(x)[Symbol.iterator](),A;!(s=(A=D.next()).done);s=!0){var B=A.value;B.removeAttribute("aria-hidden")}}catch(W){E=!0,S=W}finally{try{!s&&D.return&&D.return()}finally{if(E)throw S}}}function g(){f=null}return J}var ae={},Be;function wt(){if(Be)return ae;Be=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.resetState=c,ae.log=f;var o={},r={};function b(y,h){y.classList.remove(h)}function c(){var y=document.getElementsByTagName("html")[0];for(var h in o)b(y,o[h]);var a=document.body;for(var g in r)b(a,r[g]);o={},r={}}function f(){if(process.env.NODE_ENV!=="production"){var y=document.getElementsByTagName("html")[0].className,h=`Show tracked classes:
24
-
25
- `;h+="<html /> ("+y+`):
26
- `;for(var a in o)h+=" "+a+" "+o[a]+`
27
- `;y=document.body.className,h+=`
28
-
29
- doc.body (`+y+`):
30
- `;for(var g in r)h+=" "+g+" "+r[g]+`
31
- `;h+=`
32
- `,console.log(h)}}var v=function(h,a){return h[a]||(h[a]=0),h[a]+=1,a},m=function(h,a){return h[a]&&(h[a]-=1),a},n=function(h,a,g){g.forEach(function(x){v(a,x),h.add(x)})},w=function(h,a,g){g.forEach(function(x){m(a,x),a[x]===0&&h.remove(x)})};return ae.add=function(h,a){return n(h.classList,h.nodeName.toLowerCase()=="html"?o:r,a.split(" "))},ae.remove=function(h,a){return w(h.classList,h.nodeName.toLowerCase()=="html"?o:r,a.split(" "))},ae}var ue={},Ue;function Ze(){if(Ue)return ue;Ue=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.log=c,ue.resetState=f;function o(v,m){if(!(v instanceof m))throw new TypeError("Cannot call a class as a function")}var r=function v(){var m=this;o(this,v),this.register=function(n){if(m.openInstances.indexOf(n)!==-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Cannot register modal instance that's already open");return}m.openInstances.push(n),m.emit("register")},this.deregister=function(n){var w=m.openInstances.indexOf(n);if(w===-1){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Unable to deregister "+n+" as it was never registered");return}m.openInstances.splice(w,1),m.emit("deregister")},this.subscribe=function(n){m.subscribers.push(n)},this.emit=function(n){m.subscribers.forEach(function(w){return w(n,m.openInstances.slice())})},this.openInstances=[],this.subscribers=[]},b=new r;function c(){console.log("portalOpenInstances ----------"),console.log(b.openInstances.length),b.openInstances.forEach(function(v){return console.log(v)}),console.log("end portalOpenInstances ----------")}function f(){b=new r}return ue.default=b,ue}var he={},$e;function jt(){if($e)return he;$e=1,Object.defineProperty(he,"__esModule",{value:!0}),he.resetState=m,he.log=n;var o=Ze(),r=b(o);function b(h){return h&&h.__esModule?h:{default:h}}var c=void 0,f=void 0,v=[];function m(){for(var h=[c,f],a=0;a<h.length;a++){var g=h[a];g&&g.parentNode&&g.parentNode.removeChild(g)}c=f=null,v=[]}function n(){console.log("bodyTrap ----------"),console.log(v.length);for(var h=[c,f],a=0;a<h.length;a++){var g=h[a],x=g||{};console.log(x.nodeName,x.className,x.id)}console.log("edn bodyTrap ----------")}function w(){if(v.length===0){process.env.NODE_ENV!=="production"&&console.warn("React-Modal: Open instances > 0 expected");return}v[v.length-1].focusContent()}function y(h,a){!c&&!f&&(c=document.createElement("div"),c.setAttribute("data-react-modal-body-trap",""),c.style.position="absolute",c.style.opacity="0",c.setAttribute("tabindex","0"),c.addEventListener("focus",w),f=c.cloneNode(),f.addEventListener("focus",w)),v=a,v.length>0?(document.body.firstChild!==c&&document.body.insertBefore(c,document.body.firstChild),document.body.lastChild!==f&&document.body.appendChild(f)):(c.parentElement&&c.parentElement.removeChild(c),f.parentElement&&f.parentElement.removeChild(f))}return r.default.subscribe(y),he}var ze;function Ct(){return ze||(ze=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var b=Object.assign||function(i){for(var u=1;u<arguments.length;u++){var O=arguments[u];for(var e in O)Object.prototype.hasOwnProperty.call(O,e)&&(i[e]=O[e])}return i},c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},f=function(){function i(u,O){for(var e=0;e<O.length;e++){var d=O[e];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(u,d.key,d)}}return function(u,O,e){return O&&i(u.prototype,O),e&&i(u,e),u}}(),v=C,m=t.requirePropTypes(),n=R(m),w=yt(),y=W(w),h=bt(),a=R(h),g=Xe(),x=W(g),s=wt(),E=W(s),S=Ne(),D=R(S),A=Ze(),B=R(A);jt();function W(i){if(i&&i.__esModule)return i;var u={};if(i!=null)for(var O in i)Object.prototype.hasOwnProperty.call(i,O)&&(u[O]=i[O]);return u.default=i,u}function R(i){return i&&i.__esModule?i:{default:i}}function I(i,u){if(!(i instanceof u))throw new TypeError("Cannot call a class as a function")}function T(i,u){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:i}function F(i,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);i.prototype=Object.create(u&&u.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(i,u):i.__proto__=u)}var q={overlay:"ReactModal__Overlay",content:"ReactModal__Content"},L=function(u){return u.code==="Tab"||u.keyCode===9},p=function(u){return u.code==="Escape"||u.keyCode===27},l=0,j=function(i){F(u,i);function u(O){I(this,u);var e=T(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,O));return e.setOverlayRef=function(d){e.overlay=d,e.props.overlayRef&&e.props.overlayRef(d)},e.setContentRef=function(d){e.content=d,e.props.contentRef&&e.props.contentRef(d)},e.afterClose=function(){var d=e.props,_=d.appElement,N=d.ariaHideApp,M=d.htmlOpenClassName,H=d.bodyOpenClassName,V=d.parentSelector,ee=V&&V().ownerDocument||document;H&&E.remove(ee.body,H),M&&E.remove(ee.getElementsByTagName("html")[0],M),N&&l>0&&(l-=1,l===0&&x.show(_)),e.props.shouldFocusAfterRender&&(e.props.shouldReturnFocusAfterClose?(y.returnFocus(e.props.preventScroll),y.teardownScopedFocus()):y.popWithoutFocus()),e.props.onAfterClose&&e.props.onAfterClose(),B.default.deregister(e)},e.open=function(){e.beforeOpen(),e.state.afterOpen&&e.state.beforeClose?(clearTimeout(e.closeTimer),e.setState({beforeClose:!1})):(e.props.shouldFocusAfterRender&&(y.setupScopedFocus(e.node),y.markForFocusLater()),e.setState({isOpen:!0},function(){e.openAnimationFrame=requestAnimationFrame(function(){e.setState({afterOpen:!0}),e.props.isOpen&&e.props.onAfterOpen&&e.props.onAfterOpen({overlayEl:e.overlay,contentEl:e.content})})}))},e.close=function(){e.props.closeTimeoutMS>0?e.closeWithTimeout():e.closeWithoutTimeout()},e.focusContent=function(){return e.content&&!e.contentHasFocus()&&e.content.focus({preventScroll:!0})},e.closeWithTimeout=function(){var d=Date.now()+e.props.closeTimeoutMS;e.setState({beforeClose:!0,closesAt:d},function(){e.closeTimer=setTimeout(e.closeWithoutTimeout,e.state.closesAt-Date.now())})},e.closeWithoutTimeout=function(){e.setState({beforeClose:!1,isOpen:!1,afterOpen:!1,closesAt:null},e.afterClose)},e.handleKeyDown=function(d){L(d)&&(0,a.default)(e.content,d),e.props.shouldCloseOnEsc&&p(d)&&(d.stopPropagation(),e.requestClose(d))},e.handleOverlayOnClick=function(d){e.shouldClose===null&&(e.shouldClose=!0),e.shouldClose&&e.props.shouldCloseOnOverlayClick&&(e.ownerHandlesClose()?e.requestClose(d):e.focusContent()),e.shouldClose=null},e.handleContentOnMouseUp=function(){e.shouldClose=!1},e.handleOverlayOnMouseDown=function(d){!e.props.shouldCloseOnOverlayClick&&d.target==e.overlay&&d.preventDefault()},e.handleContentOnClick=function(){e.shouldClose=!1},e.handleContentOnMouseDown=function(){e.shouldClose=!1},e.requestClose=function(d){return e.ownerHandlesClose()&&e.props.onRequestClose(d)},e.ownerHandlesClose=function(){return e.props.onRequestClose},e.shouldBeClosed=function(){return!e.state.isOpen&&!e.state.beforeClose},e.contentHasFocus=function(){return document.activeElement===e.content||e.content.contains(document.activeElement)},e.buildClassName=function(d,_){var N=(typeof _>"u"?"undefined":c(_))==="object"?_:{base:q[d],afterOpen:q[d]+"--after-open",beforeClose:q[d]+"--before-close"},M=N.base;return e.state.afterOpen&&(M=M+" "+N.afterOpen),e.state.beforeClose&&(M=M+" "+N.beforeClose),typeof _=="string"&&_?M+" "+_:M},e.attributesFromObject=function(d,_){return Object.keys(_).reduce(function(N,M){return N[d+"-"+M]=_[M],N},{})},e.state={afterOpen:!1,beforeClose:!1},e.shouldClose=null,e.moveFromContentToOverlay=null,e}return f(u,[{key:"componentDidMount",value:function(){this.props.isOpen&&this.open()}},{key:"componentDidUpdate",value:function(e,d){process.env.NODE_ENV!=="production"&&(e.bodyOpenClassName!==this.props.bodyOpenClassName&&console.warn('React-Modal: "bodyOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.'),e.htmlOpenClassName!==this.props.htmlOpenClassName&&console.warn('React-Modal: "htmlOpenClassName" prop has been modified. This may cause unexpected behavior when multiple modals are open.')),this.props.isOpen&&!e.isOpen?this.open():!this.props.isOpen&&e.isOpen&&this.close(),this.props.shouldFocusAfterRender&&this.state.isOpen&&!d.isOpen&&this.focusContent()}},{key:"componentWillUnmount",value:function(){this.state.isOpen&&this.afterClose(),clearTimeout(this.closeTimer),cancelAnimationFrame(this.openAnimationFrame)}},{key:"beforeOpen",value:function(){var e=this.props,d=e.appElement,_=e.ariaHideApp,N=e.htmlOpenClassName,M=e.bodyOpenClassName,H=e.parentSelector,V=H&&H().ownerDocument||document;M&&E.add(V.body,M),N&&E.add(V.getElementsByTagName("html")[0],N),_&&(l+=1,x.hide(d)),B.default.register(this)}},{key:"render",value:function(){var e=this.props,d=e.id,_=e.className,N=e.overlayClassName,M=e.defaultStyles,H=e.children,V=_?{}:M.content,ee=N?{}:M.overlay;if(this.shouldBeClosed())return null;var se={ref:this.setOverlayRef,className:this.buildClassName("overlay",N),style:b({},ee,this.props.style.overlay),onClick:this.handleOverlayOnClick,onMouseDown:this.handleOverlayOnMouseDown},oe=b({id:d,ref:this.setContentRef,style:b({},V,this.props.style.content),className:this.buildClassName("content",_),tabIndex:"-1",onKeyDown:this.handleKeyDown,onMouseDown:this.handleContentOnMouseDown,onMouseUp:this.handleContentOnMouseUp,onClick:this.handleContentOnClick,role:this.props.role,"aria-label":this.props.contentLabel},this.attributesFromObject("aria",b({modal:!0},this.props.aria)),this.attributesFromObject("data",this.props.data||{}),{"data-testid":this.props.testId}),P=this.props.contentElement(oe,H);return this.props.overlayElement(se,P)}}]),u}(v.Component);j.defaultProps={style:{overlay:{},content:{}},defaultStyles:{}},j.propTypes={isOpen:n.default.bool.isRequired,defaultStyles:n.default.shape({content:n.default.object,overlay:n.default.object}),style:n.default.shape({content:n.default.object,overlay:n.default.object}),className:n.default.oneOfType([n.default.string,n.default.object]),overlayClassName:n.default.oneOfType([n.default.string,n.default.object]),parentSelector:n.default.func,bodyOpenClassName:n.default.string,htmlOpenClassName:n.default.string,ariaHideApp:n.default.bool,appElement:n.default.oneOfType([n.default.instanceOf(D.default),n.default.instanceOf(S.SafeHTMLCollection),n.default.instanceOf(S.SafeNodeList),n.default.arrayOf(n.default.instanceOf(D.default))]),onAfterOpen:n.default.func,onAfterClose:n.default.func,onRequestClose:n.default.func,closeTimeoutMS:n.default.number,shouldFocusAfterRender:n.default.bool,shouldCloseOnOverlayClick:n.default.bool,shouldReturnFocusAfterClose:n.default.bool,preventScroll:n.default.bool,role:n.default.string,contentLabel:n.default.string,aria:n.default.object,data:n.default.object,children:n.default.node,shouldCloseOnEsc:n.default.bool,overlayRef:n.default.func,contentRef:n.default.func,id:n.default.string,overlayElement:n.default.func,contentElement:n.default.func,testId:n.default.string},r.default=j,o.exports=r.default}(ge,ge.exports)),ge.exports}function Qe(){var o=this.constructor.getDerivedStateFromProps(this.props,this.state);o!=null&&this.setState(o)}function et(o){function r(b){var c=this.constructor.getDerivedStateFromProps(o,b);return c??null}this.setState(r.bind(this))}function tt(o,r){try{var b=this.props,c=this.state;this.props=o,this.state=r,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(b,c)}finally{this.props=b,this.state=c}}Qe.__suppressDeprecationWarning=!0;et.__suppressDeprecationWarning=!0;tt.__suppressDeprecationWarning=!0;function Rt(o){var r=o.prototype;if(!r||!r.isReactComponent)throw new Error("Can only polyfill class components");if(typeof o.getDerivedStateFromProps!="function"&&typeof r.getSnapshotBeforeUpdate!="function")return o;var b=null,c=null,f=null;if(typeof r.componentWillMount=="function"?b="componentWillMount":typeof r.UNSAFE_componentWillMount=="function"&&(b="UNSAFE_componentWillMount"),typeof r.componentWillReceiveProps=="function"?c="componentWillReceiveProps":typeof r.UNSAFE_componentWillReceiveProps=="function"&&(c="UNSAFE_componentWillReceiveProps"),typeof r.componentWillUpdate=="function"?f="componentWillUpdate":typeof r.UNSAFE_componentWillUpdate=="function"&&(f="UNSAFE_componentWillUpdate"),b!==null||c!==null||f!==null){var v=o.displayName||o.name,m=typeof o.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
33
-
34
- `+v+" uses "+m+" but also contains the following legacy lifecycles:"+(b!==null?`
35
- `+b:"")+(c!==null?`
36
- `+c:"")+(f!==null?`
37
- `+f:"")+`
38
-
39
- The above lifecycles should be removed. Learn more about this warning here:
40
- https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof o.getDerivedStateFromProps=="function"&&(r.componentWillMount=Qe,r.componentWillReceiveProps=et),typeof r.getSnapshotBeforeUpdate=="function"){if(typeof r.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");r.componentWillUpdate=tt;var n=r.componentDidUpdate;r.componentDidUpdate=function(y,h,a){var g=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:a;n.call(this,y,h,g)}}return o}const Ot=Object.freeze(Object.defineProperty({__proto__:null,polyfill:Rt},Symbol.toStringTag,{value:"Module"})),Nt=t.getAugmentedNamespace(Ot);var Ve;function St(){if(Ve)return re;Ve=1,Object.defineProperty(re,"__esModule",{value:!0}),re.bodyOpenClassName=re.portalClassName=void 0;var o=Object.assign||function(p){for(var l=1;l<arguments.length;l++){var j=arguments[l];for(var i in j)Object.prototype.hasOwnProperty.call(j,i)&&(p[i]=j[i])}return p},r=function(){function p(l,j){for(var i=0;i<j.length;i++){var u=j[i];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(l,u.key,u)}}return function(l,j,i){return j&&p(l.prototype,j),i&&p(l,i),l}}(),b=C,c=S(b),f=ft,v=S(f),m=t.requirePropTypes(),n=S(m),w=Ct(),y=S(w),h=Xe(),a=E(h),g=Ne(),x=S(g),s=Nt;function E(p){if(p&&p.__esModule)return p;var l={};if(p!=null)for(var j in p)Object.prototype.hasOwnProperty.call(p,j)&&(l[j]=p[j]);return l.default=p,l}function S(p){return p&&p.__esModule?p:{default:p}}function D(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function A(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function B(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var W=re.portalClassName="ReactModalPortal",R=re.bodyOpenClassName="ReactModal__Body--open",I=g.canUseDOM&&v.default.createPortal!==void 0,T=function(l){return document.createElement(l)},F=function(){return I?v.default.createPortal:v.default.unstable_renderSubtreeIntoContainer};function q(p){return p()}var L=function(p){B(l,p);function l(){var j,i,u,O;D(this,l);for(var e=arguments.length,d=Array(e),_=0;_<e;_++)d[_]=arguments[_];return O=(i=(u=A(this,(j=l.__proto__||Object.getPrototypeOf(l)).call.apply(j,[this].concat(d))),u),u.removePortal=function(){!I&&v.default.unmountComponentAtNode(u.node);var N=q(u.props.parentSelector);N&&N.contains(u.node)?N.removeChild(u.node):console.warn('React-Modal: "parentSelector" prop did not returned any DOM element. Make sure that the parent element is unmounted to avoid any memory leaks.')},u.portalRef=function(N){u.portal=N},u.renderPortal=function(N){var M=F(),H=M(u,c.default.createElement(y.default,o({defaultStyles:l.defaultStyles},N)),u.node);u.portalRef(H)},i),A(u,O)}return r(l,[{key:"componentDidMount",value:function(){if(g.canUseDOM){I||(this.node=T("div")),this.node.className=this.props.portalClassName;var i=q(this.props.parentSelector);i.appendChild(this.node),!I&&this.renderPortal(this.props)}}},{key:"getSnapshotBeforeUpdate",value:function(i){var u=q(i.parentSelector),O=q(this.props.parentSelector);return{prevParent:u,nextParent:O}}},{key:"componentDidUpdate",value:function(i,u,O){if(g.canUseDOM){var e=this.props,d=e.isOpen,_=e.portalClassName;i.portalClassName!==_&&(this.node.className=_);var N=O.prevParent,M=O.nextParent;M!==N&&(N.removeChild(this.node),M.appendChild(this.node)),!(!i.isOpen&&!d)&&!I&&this.renderPortal(this.props)}}},{key:"componentWillUnmount",value:function(){if(!(!g.canUseDOM||!this.node||!this.portal)){var i=this.portal.state,u=Date.now(),O=i.isOpen&&this.props.closeTimeoutMS&&(i.closesAt||u+this.props.closeTimeoutMS);O?(i.beforeClose||this.portal.closeWithTimeout(),setTimeout(this.removePortal,O-u)):this.removePortal()}}},{key:"render",value:function(){if(!g.canUseDOM||!I)return null;!this.node&&I&&(this.node=T("div"));var i=F();return i(c.default.createElement(y.default,o({ref:this.portalRef,defaultStyles:l.defaultStyles},this.props)),this.node)}}],[{key:"setAppElement",value:function(i){a.setElement(i)}}]),l}(b.Component);return L.propTypes={isOpen:n.default.bool.isRequired,style:n.default.shape({content:n.default.object,overlay:n.default.object}),portalClassName:n.default.string,bodyOpenClassName:n.default.string,htmlOpenClassName:n.default.string,className:n.default.oneOfType([n.default.string,n.default.shape({base:n.default.string.isRequired,afterOpen:n.default.string.isRequired,beforeClose:n.default.string.isRequired})]),overlayClassName:n.default.oneOfType([n.default.string,n.default.shape({base:n.default.string.isRequired,afterOpen:n.default.string.isRequired,beforeClose:n.default.string.isRequired})]),appElement:n.default.oneOfType([n.default.instanceOf(x.default),n.default.instanceOf(g.SafeHTMLCollection),n.default.instanceOf(g.SafeNodeList),n.default.arrayOf(n.default.instanceOf(x.default))]),onAfterOpen:n.default.func,onRequestClose:n.default.func,closeTimeoutMS:n.default.number,ariaHideApp:n.default.bool,shouldFocusAfterRender:n.default.bool,shouldCloseOnOverlayClick:n.default.bool,shouldReturnFocusAfterClose:n.default.bool,preventScroll:n.default.bool,parentSelector:n.default.func,aria:n.default.object,data:n.default.object,role:n.default.string,contentLabel:n.default.string,shouldCloseOnEsc:n.default.bool,overlayRef:n.default.func,contentRef:n.default.func,id:n.default.string,overlayElement:n.default.func,contentElement:n.default.func},L.defaultProps={isOpen:!1,portalClassName:W,bodyOpenClassName:R,role:"dialog",ariaHideApp:!0,closeTimeoutMS:0,shouldFocusAfterRender:!0,shouldCloseOnEsc:!0,shouldCloseOnOverlayClick:!0,shouldReturnFocusAfterClose:!0,preventScroll:!1,parentSelector:function(){return document.body},overlayElement:function(l,j){return c.default.createElement("div",l,j)},contentElement:function(l,j){return c.default.createElement("div",l,j)}},L.defaultStyles={overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(255, 255, 255, 0.75)"},content:{position:"absolute",top:"40px",left:"40px",right:"40px",bottom:"40px",border:"1px solid #ccc",background:"#fff",overflow:"auto",WebkitOverflowScrolling:"touch",borderRadius:"4px",outline:"none",padding:"20px"}},(0,s.polyfill)(L),process.env.NODE_ENV!=="production"&&(L.setCreateHTMLElement=function(p){return T=p}),re.default=L,re}var Ge;function Mt(){return Ge||(Ge=1,function(o,r){Object.defineProperty(r,"__esModule",{value:!0});var b=St(),c=f(b);function f(v){return v&&v.__esModule?v:{default:v}}r.default=c.default,o.exports=r.default}(xe,xe.exports)),xe.exports}var Tt=Mt();const nt=t.getDefaultExportFromCjs(Tt),Dt=o=>{const{openState:r,closePopupCallback:b,headingIconFile:c,headingText:f,subHeadingText:v,positiveButtonText:m,negativeButtonText:n,classNamePositiveBtn:w,classNameNegativeBtn:y,positiveActionCallback:h,negativeActionCallback:a}=o;return t.jsxRuntimeExports.jsxs(nt,{isOpen:r,onRequestClose:b,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",position:"fixed",alignContent:"center",justifyContent:"center",zIndex:1030,display:r?"block":"none"},content:{zIndex:1030,padding:"24px",maxWidth:"750px",maxHeight:"600px",width:"400px",height:"fit-content",margin:"auto",borderRadius:"12px",overflow:"unset",display:r?"block":"none"}},children:[c=="warning"&&t.jsxRuntimeExports.jsx("div",{className:"hfl-hx_warning hfl-mb-4 hfl-flex hfl-h-12 hfl-w-12 hfl-items-center hfl-justify-center hfl-rounded-full hfl-border-8 hfl-border-Warning-50 hfl-bg-Warning-100 hfl-text-Warning-600",children:t.jsxRuntimeExports.jsx("i",{className:"hx_warning hfl-text-5"})}),t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text xl",className:"hfl-mt-5 hfl-text-Gray-900",children:f}),v&&t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-mt-1 hfl-text-Gray-500 ",children:v}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-mt-4 hfl-flex hfl-items-center hfl-justify-center hfl-gap-4",children:[n&&t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:n,hierarchy:"Primary",className:y||"",onClick:a,"data-qa":"negative-action"}),m&&t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:m,hierarchy:"Secondary",className:w||"",onClick:h,"data-qa":"positive-action"})]})]})},It=({open:o,onCancel:r,onCopySave:b,rowMedicineData:c,getMedicineOptions:f})=>{const[v,m]=C.useState([]),[n,w]=C.useState(""),[y,h]=C.useState([]),a=C.useCallback(async E=>{const D=(await f?.(E))?.map(A=>({label:A.doctorMedicineName,value:A}));h(D||[])},[f]);C.useEffect(()=>{o&&a(n)},[n,a,o]);const g=E=>{const S=E.value;v.some(A=>A.medicineId===S.medicineId&&A.doctorMedicineName.trim().toLowerCase()===S.doctorMedicineName.trim().toLowerCase())||m(A=>[...A,S]),w(""),h([])},x=E=>{m(S=>S.filter(D=>D.medicineId!==E))},s=async()=>{n.trim()||await a("")};return t.jsxRuntimeExports.jsxs(nt,{isOpen:o,onRequestClose:r,shouldCloseOnOverlayClick:!1,style:{overlay:{backgroundColor:"rgba(52, 64, 84, 0.5)",zIndex:1030},content:{zIndex:1031,maxWidth:"600px",maxHeight:"50vh",height:"auto",margin:"auto",borderRadius:"12px",padding:"0px",display:"flex",flexDirection:"column"}},children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Bold",type:"Text lg",className:"hfl-text-White hfl-bg-gradient_primary_600_500_90 hfl-px-6 hfl-py-2",children:"Please select medicine to copy"}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-px-6 hfl-py-5 hfl-flex hfl-flex-col hfl-gap-6 hfl-overflow-y-auto hfl-flex-1",children:[t.jsxRuntimeExports.jsx(U,{inputValue:n,showInput:!0,isSearchable:!0,disableInputAutoSize:!0,inputChangeHandler:w,onChangeHandler:g,onInputFocus:s,options:y,placeholder:"Search for medicines"}),t.jsxRuntimeExports.jsx("div",{className:"hfl-flex hfl-flex-wrap hfl-gap-2",children:v.map(E=>t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-items-center hfl-bg-Gray-100 hfl-px-2 hfl-py-0.5 hfl-rounded-md hfl-gap-1",children:[t.jsxRuntimeExports.jsx(t.bs,{variant:"Regular",type:"Text sm",className:"hfl-text-nowrap",children:E.doctorMedicineName}),t.jsxRuntimeExports.jsx("button",{className:"hfl-text-Blue_gray-800",onClick:()=>x(E.medicineId),children:t.jsxRuntimeExports.jsx("i",{className:"hx_close"})})]},E.doctorMedicineName+E.medicineId))})]}),t.jsxRuntimeExports.jsxs("div",{className:"hfl-flex hfl-justify-end hfl-gap-2.5 hfl-bg-Gray-50 hfl-px-7 hfl-py-3 hfl-border-t hfl-border-Gray-200",children:[t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:"Cancel",onClick:r,hierarchy:"Secondary-Grey"}),t.jsxRuntimeExports.jsx(t.Ku,{size:"md",textField:"Save",disabled:!v||v.length==0,onClick:async()=>{await b(c,v)&&r()},className:"hfl-bg-Primary-600 hfl-text-White disabled:hfl-opacity-50 disabled:hfl-cursor-not-allowed",hierarchy:"Primary"})]})]})},Ft=C.forwardRef(({data:o=[],variant:r,externallyTriggeredEditRowIds:b=[],externallyTriggeredEditMode:c=!1,allowCustomMedicineInput:f=!0,getMedicineOptions:v,onRowChange:m,onRowDelete:n,onRowCopy:w,onSaveRow:y,externalSaveTrigger:h,setSearchDisabled:a},g)=>{const[x,s]=C.useState(null),[E,S]=C.useState(!1),[D,A]=C.useState(),B=C.useCallback((p,l,j)=>{const i=o.find(O=>O.rowId===p);if(!i)return;const u={...i,...l};m?.(u,j||void 0)},[o,m]),W=C.useCallback(async()=>{const p=o.filter(l=>l.isEditing&&l.medicine_name);if(p.length!==0)try{await y?.(p)&&p.forEach(j=>{m?.({...j,isEditing:!1})})}catch(l){console.error("Bulk save failed",l)}finally{a?.(!1)}},[o,y,m,a]);C.useEffect(()=>{h&&W()},[h,W]),C.useEffect(()=>{const p=o.some(l=>l.isEditing);a?.(p)},[o,a]);const R=C.useCallback(p=>{A(p),S(!0)},[]),I=C.useCallback(async()=>{if(x)try{await n?.(x)}catch(p){console.error("Delete failed",p)}finally{s(null)}},[x,n]),T=C.useCallback(()=>{s(null)},[]),F=C.useCallback(async p=>{try{return await y?.([p])?(m?.({...p,isEditing:!1}),!0):!1}catch(l){return console.error("Save row failed",l),!1}},[y,m]),q=C.useCallback(async()=>{const p=o.filter(l=>l.isEditing&&l.medicine_name);if(p.length===0)return!0;try{const l=await y?.(p);return l&&o.map(i=>i.isEditing?{...i,isEditing:!1}:i).forEach(i=>m?.(i)),!!l}catch(l){return console.error("External bulk save failed",l),!1}},[o,y,m]);C.useImperativeHandle(g,()=>({triggerExternalSave:q}));const L={variant:r,externallyTriggeredEditMode:c,externallyTriggeredEditRowIds:b,getMedicineOptions:v,onRowChange:(p,l)=>{B(p.rowId,p,l),m?.(p,l)},onRowDelete:n,onRowCopy:w,setRowToDelete:s,openPopupForRow:R};return t.jsxRuntimeExports.jsxs("div",{className:"hfl-border-1 hfl-border-Gray-200",children:[t.jsxRuntimeExports.jsx("div",{className:"table-header hfl-grid hfl-grid-cols-[1.36fr_1.36fr_1.02fr_1.25fr_2.27fr_1.36fr_1.36fr] hfl-gap-2 hfl-py-2 hfl-px-2 hfl-font-bold hfl-border-b-1 hfl-border-Gray-200 hfl-bg-Blue_gray-50",children:z.C_Table_Column_Name.map(p=>t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600",children:p},p))}),t.jsxRuntimeExports.jsxs(Ke.Provider,{value:L,children:[t.jsxRuntimeExports.jsx("div",{className:"table-body",children:o.length===0?t.jsxRuntimeExports.jsx(t.bs,{variant:"Medium",type:"Text sm",className:"hfl-text-Blue_gray-600 hfl-px-2 hfl-py-3",children:"No medicines added"}):o.map(p=>t.jsxRuntimeExports.jsx(vt,{rowData:p,isEditing:p.isEditing||!1,setIsEditing:l=>B(p.rowId,{isEditing:l}),onSaveRow:F,allowCustomMedicineInput:f},p.rowId))}),t.jsxRuntimeExports.jsx(Dt,{headingText:"Delete Medicine",subHeadingText:"Are you sure you want to delete this medicine?",openState:!!x,positiveButtonText:"Delete",negativeButtonText:"Cancel",positiveActionCallback:I,negativeActionCallback:T,classNameNegativeBtn:"hfl-bg-Blue-600",classNamePositiveBtn:"hfl-bg-Error-500 hover:hfl-bg-Error-700 hfl-text-White",closePopupCallback:T}),t.jsxRuntimeExports.jsx(It,{open:E,onCancel:()=>S(!1),onCopySave:w,rowMedicineData:D,getMedicineOptions:v})]})]})});exports.PediatricsCalculatorTable=Ft;