@instincthub/react-ui 0.1.50 → 0.1.52

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 (237) hide show
  1. package/dist/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js +2 -2
  2. package/dist/node_modules/.pnpm/xlsx@https___cdn.sheetjs.com_xlsx-0.20.3_xlsx-0.20.3.tgz/node_modules/xlsx/xlsx.mjs.js.map +1 -1
  3. package/dist/src/assets/css/forms/input-fields.css +163 -11
  4. package/dist/src/components/auth/LoginForm.js +1 -1
  5. package/dist/src/components/auth/ReactClientProviders.js +1 -1
  6. package/dist/src/components/forms/ChipsInput.js +1 -1
  7. package/dist/src/components/forms/PhoneNumberInput.js +1 -1
  8. package/dist/src/components/forms/SearchFieldDB.js +1 -1
  9. package/dist/src/components/forms/SearchObjectsFromDB.js +1 -1
  10. package/dist/src/components/forms/SearchableDropdown.js +1 -1
  11. package/dist/src/components/forms/uploads/S3MultiUploader.js +1 -1
  12. package/dist/src/components/lib/index.js +1 -1
  13. package/dist/src/components/lib/index.js.map +1 -1
  14. package/dist/src/components/lib/phoneUtils.js +2 -0
  15. package/dist/src/components/lib/phoneUtils.js.map +1 -0
  16. package/dist/src/components/navbar/ChannelListAvatar.js +1 -1
  17. package/dist/src/components/navbar/SideNavbar.js +1 -1
  18. package/dist/src/components/status/ModalExamples.js +1 -1
  19. package/dist/src/components/ui/ComponentLists.js +1 -1
  20. package/dist/src/components/ui/pagination/Pagination.js +1 -1
  21. package/dist/src/components/ui/pagination/PaginationDemo.js +1 -1
  22. package/dist/src/components/ui/tables/IHubTable.js +1 -1
  23. package/dist/src/components/ui/tables/IHubTableServer.js +1 -1
  24. package/dist/src/components/ui/tables/utils/exportValues.js +2 -0
  25. package/dist/src/components/ui/tables/utils/exportValues.js.map +1 -0
  26. package/dist/src/components/ui/tables/utils/exportWriters.js +2 -0
  27. package/dist/src/components/ui/tables/utils/exportWriters.js.map +1 -0
  28. package/dist/src/components/ui/tables/utils/tableExport.js +2 -0
  29. package/dist/src/components/ui/tables/utils/tableExport.js.map +1 -0
  30. package/dist/src/types/__examples__/.next/types/app/components/forms/layout.d.ts +13 -0
  31. package/dist/src/types/__examples__/.next/types/app/components/forms/phone-number-input/page.d.ts +13 -0
  32. package/dist/src/types/__examples__/.next/types/app/components/layout.d.ts +13 -0
  33. package/dist/src/types/__examples__/.next/types/app/components/page.d.ts +13 -0
  34. package/dist/src/types/__examples__/.next/types/app/components/ui/s3-multi-uploader/page.d.ts +13 -0
  35. package/dist/src/types/__examples__/.next/types/app/layout.d.ts +13 -0
  36. package/dist/src/types/__examples__/.next/types/app/page.d.ts +13 -0
  37. package/dist/src/types/__examples__/.next/types/validator.d.ts +1 -0
  38. package/dist/src/types/__examples__/next.config.d.ts +3 -0
  39. package/dist/src/types/__examples__/src/app/api/auth/[...nextauth]/route.d.ts +1 -0
  40. package/dist/src/types/__examples__/src/app/api/auth/login/route.d.ts +2 -0
  41. package/dist/src/types/__examples__/src/app/api/components/docs/route.d.ts +14 -0
  42. package/dist/src/types/__examples__/src/app/api/components/recommend/route.d.ts +14 -0
  43. package/dist/src/types/__examples__/src/app/api/components/search/route.d.ts +50 -0
  44. package/dist/src/types/__examples__/src/app/api/fallback/route.d.ts +34 -0
  45. package/dist/src/types/__examples__/src/app/api/generate/route.d.ts +14 -0
  46. package/dist/src/types/__examples__/src/app/api/help/route.d.ts +14 -0
  47. package/dist/src/types/__examples__/src/app/api/mcp/route.d.ts +10 -0
  48. package/dist/src/types/__examples__/src/app/auth/layout.d.ts +4 -0
  49. package/dist/src/types/__examples__/src/app/auth/login/page.d.ts +2 -0
  50. package/dist/src/types/__examples__/src/app/auth/password-match/page.d.ts +1 -0
  51. package/dist/src/types/__examples__/src/app/code-display/layout.d.ts +4 -0
  52. package/dist/src/types/__examples__/src/app/code-display/page.d.ts +3 -0
  53. package/dist/src/types/__examples__/src/app/components/auth/client-detector/page.d.ts +1 -0
  54. package/dist/src/types/__examples__/src/app/components/auth/login-form/page.d.ts +2 -0
  55. package/dist/src/types/__examples__/src/app/components/auth/signup-form/page.d.ts +1 -0
  56. package/dist/src/types/__examples__/src/app/components/auth/username-email-checker/page.d.ts +1 -0
  57. package/dist/src/types/__examples__/src/app/components/charts/page.d.ts +1 -0
  58. package/dist/src/types/__examples__/src/app/components/forms/action-dropdown/page.d.ts +1 -0
  59. package/dist/src/types/__examples__/src/app/components/forms/animated-box/page.d.ts +1 -0
  60. package/dist/src/types/__examples__/src/app/components/forms/checkboxes/page.d.ts +1 -0
  61. package/dist/src/types/__examples__/src/app/components/forms/chips-input/page.d.ts +1 -0
  62. package/dist/src/types/__examples__/src/app/components/forms/date-input/page.d.ts +1 -0
  63. package/dist/src/types/__examples__/src/app/components/forms/date-input-picker/page.d.ts +1 -0
  64. package/dist/src/types/__examples__/src/app/components/forms/date-range-picker/page.d.ts +1 -0
  65. package/dist/src/types/__examples__/src/app/components/forms/drop-file/page.d.ts +1 -0
  66. package/dist/src/types/__examples__/src/app/components/forms/email-list/page.d.ts +1 -0
  67. package/dist/src/types/__examples__/src/app/components/forms/file-uploader/page.d.ts +1 -0
  68. package/dist/src/types/__examples__/src/app/components/forms/filter-array/page.d.ts +1 -0
  69. package/dist/src/types/__examples__/src/app/components/forms/filter-objects/page.d.ts +1 -0
  70. package/dist/src/types/__examples__/src/app/components/forms/form-error/page.d.ts +1 -0
  71. package/dist/src/types/__examples__/src/app/components/forms/input-amount/page.d.ts +1 -0
  72. package/dist/src/types/__examples__/src/app/components/forms/input-number/page.d.ts +1 -0
  73. package/dist/src/types/__examples__/src/app/components/forms/input-text/page.d.ts +1 -0
  74. package/dist/src/types/__examples__/src/app/components/forms/input-textarea/page.d.ts +1 -0
  75. package/dist/src/types/__examples__/src/app/components/forms/layout.d.ts +4 -0
  76. package/dist/src/types/__examples__/src/app/components/forms/message-display/page.d.ts +1 -0
  77. package/dist/src/types/__examples__/src/app/components/forms/multiple-email/page.d.ts +1 -0
  78. package/dist/src/types/__examples__/src/app/components/forms/password-field/page.d.ts +1 -0
  79. package/dist/src/types/__examples__/src/app/components/forms/phone-number-input/page.d.ts +1 -0
  80. package/dist/src/types/__examples__/src/app/components/forms/radio-button/page.d.ts +1 -0
  81. package/dist/src/types/__examples__/src/app/components/forms/search-field/page.d.ts +1 -0
  82. package/dist/src/types/__examples__/src/app/components/forms/search-objects-from-db/page.d.ts +1 -0
  83. package/dist/src/types/__examples__/src/app/components/forms/searchable-dropdown/page.d.ts +1 -0
  84. package/dist/src/types/__examples__/src/app/components/forms/time-picker/page.d.ts +1 -0
  85. package/dist/src/types/__examples__/src/app/components/forms/toggle-button/page.d.ts +1 -0
  86. package/dist/src/types/__examples__/src/app/components/forms/uploads/ihub-file-uploader/page.d.ts +1 -0
  87. package/dist/src/types/__examples__/src/app/components/layout.d.ts +4 -0
  88. package/dist/src/types/__examples__/src/app/components/navbars/breadcrumb/page.d.ts +1 -0
  89. package/dist/src/types/__examples__/src/app/components/navbars/responsive-navbar/page.d.ts +2 -0
  90. package/dist/src/types/__examples__/src/app/components/navbars/sidenav/page.d.ts +2 -0
  91. package/dist/src/types/__examples__/src/app/components/navbars/tabs/page.d.ts +1 -0
  92. package/dist/src/types/__examples__/src/app/components/page.d.ts +1 -0
  93. package/dist/src/types/__examples__/src/app/components/ui/actions/page.d.ts +1 -0
  94. package/dist/src/types/__examples__/src/app/components/ui/badges/page.d.ts +1 -0
  95. package/dist/src/types/__examples__/src/app/components/ui/card-grid/page.d.ts +1 -0
  96. package/dist/src/types/__examples__/src/app/components/ui/card-list/page.d.ts +1 -0
  97. package/dist/src/types/__examples__/src/app/components/ui/cards/page.d.ts +1 -0
  98. package/dist/src/types/__examples__/src/app/components/ui/color-picker/page.d.ts +1 -0
  99. package/dist/src/types/__examples__/src/app/components/ui/content-view-or-edit/page.d.ts +1 -0
  100. package/dist/src/types/__examples__/src/app/components/ui/content-viewer/page.d.ts +1 -0
  101. package/dist/src/types/__examples__/src/app/components/ui/create-button/page.d.ts +1 -0
  102. package/dist/src/types/__examples__/src/app/components/ui/dangerous-renderer/page.d.ts +1 -0
  103. package/dist/src/types/__examples__/src/app/components/ui/dialogs/page.d.ts +1 -0
  104. package/dist/src/types/__examples__/src/app/components/ui/dropdowns/page.d.ts +1 -0
  105. package/dist/src/types/__examples__/src/app/components/ui/ihub-text-editor/page.d.ts +1 -0
  106. package/dist/src/types/__examples__/src/app/components/ui/modals/page.d.ts +1 -0
  107. package/dist/src/types/__examples__/src/app/components/ui/or-divider/page.d.ts +1 -0
  108. package/dist/src/types/__examples__/src/app/components/ui/pagination/page.d.ts +1 -0
  109. package/dist/src/types/__examples__/src/app/components/ui/random-gradient-image/page.d.ts +1 -0
  110. package/dist/src/types/__examples__/src/app/components/ui/s3-multi-uploader/page.d.ts +1 -0
  111. package/dist/src/types/__examples__/src/app/components/ui/table-examples/page.d.ts +1 -0
  112. package/dist/src/types/__examples__/src/app/components/ui/table-server-examples/page.d.ts +1 -0
  113. package/dist/src/types/__examples__/src/app/components/ui/text-editor/page.d.ts +1 -0
  114. package/dist/src/types/__examples__/src/app/cursors/page.d.ts +2 -0
  115. package/dist/src/types/__examples__/src/app/examples/page.d.ts +1 -0
  116. package/dist/src/types/__examples__/src/app/layout.d.ts +11 -0
  117. package/dist/src/types/__examples__/src/app/libs/examples/loadscript/page.d.ts +8 -0
  118. package/dist/src/types/__examples__/src/app/libs/examples/modals/page.d.ts +1 -0
  119. package/dist/src/types/__examples__/src/app/libs/examples/paystacks/page.d.ts +1 -0
  120. package/dist/src/types/__examples__/src/app/libs/page.d.ts +1 -0
  121. package/dist/src/types/__examples__/src/app/page.d.ts +1 -0
  122. package/dist/src/types/__examples__/src/components/ComponentListing.d.ts +1 -0
  123. package/dist/src/types/__examples__/src/components/Forms.d.ts +2 -0
  124. package/dist/src/types/__examples__/src/components/Modals.d.ts +1 -0
  125. package/dist/src/types/__examples__/src/components/TestComponent.d.ts +1 -0
  126. package/dist/src/types/__examples__/src/components/TestPage.d.ts +2 -0
  127. package/dist/src/types/__examples__/src/components/auth/ClientDetectorExample.d.ts +3 -0
  128. package/dist/src/types/__examples__/src/components/auth/IsUsernameEmailTakenExample.d.ts +3 -0
  129. package/dist/src/types/__examples__/src/components/auth/LoginFormExample.d.ts +4 -0
  130. package/dist/src/types/__examples__/src/components/auth/SignUpFormExample.d.ts +3 -0
  131. package/dist/src/types/__examples__/src/components/auths/LoginExample.d.ts +4 -0
  132. package/dist/src/types/__examples__/src/components/auths/PasswordsMatchExample.d.ts +2 -0
  133. package/dist/src/types/__examples__/src/components/forms/ActionDropdownExample.d.ts +3 -0
  134. package/dist/src/types/__examples__/src/components/forms/AnimatedBoxExample.d.ts +3 -0
  135. package/dist/src/types/__examples__/src/components/forms/CheckboxesFieldExamples.d.ts +3 -0
  136. package/dist/src/types/__examples__/src/components/forms/ChipsInputExample.d.ts +6 -0
  137. package/dist/src/types/__examples__/src/components/forms/DateInputExample.d.ts +3 -0
  138. package/dist/src/types/__examples__/src/components/forms/DateInputPickerExample.d.ts +3 -0
  139. package/dist/src/types/__examples__/src/components/forms/DateInputPickerTimeExample.d.ts +10 -0
  140. package/dist/src/types/__examples__/src/components/forms/DateRangePickerExample.d.ts +3 -0
  141. package/dist/src/types/__examples__/src/components/forms/DateTimePickerExample.d.ts +3 -0
  142. package/dist/src/types/__examples__/src/components/forms/DropFileExample.d.ts +3 -0
  143. package/dist/src/types/__examples__/src/components/forms/EmailListExample.d.ts +3 -0
  144. package/dist/src/types/__examples__/src/components/forms/FileUploaderExample.d.ts +3 -0
  145. package/dist/src/types/__examples__/src/components/forms/FilterArrayExample.d.ts +3 -0
  146. package/dist/src/types/__examples__/src/components/forms/FilterObjectsExample.d.ts +3 -0
  147. package/dist/src/types/__examples__/src/components/forms/FormErrorExample.d.ts +3 -0
  148. package/dist/src/types/__examples__/src/components/forms/InputAmountExample.d.ts +3 -0
  149. package/dist/src/types/__examples__/src/components/forms/InputNumberExample.d.ts +3 -0
  150. package/dist/src/types/__examples__/src/components/forms/InputTextExample.d.ts +3 -0
  151. package/dist/src/types/__examples__/src/components/forms/InputTextareaExample.d.ts +3 -0
  152. package/dist/src/types/__examples__/src/components/forms/MessageDisplayExample.d.ts +3 -0
  153. package/dist/src/types/__examples__/src/components/forms/MultipleEmailExample.d.ts +3 -0
  154. package/dist/src/types/__examples__/src/components/forms/PasswordFieldExample.d.ts +3 -0
  155. package/dist/src/types/__examples__/src/components/forms/PhoneNumberInputExample.d.ts +3 -0
  156. package/dist/src/types/__examples__/src/components/forms/RadioButtonExample.d.ts +6 -0
  157. package/dist/src/types/__examples__/src/components/forms/SearchFieldExample.d.ts +3 -0
  158. package/dist/src/types/__examples__/src/components/forms/SearchObjectsFromDBExample.d.ts +1 -0
  159. package/dist/src/types/__examples__/src/components/forms/SearchableDropdownExample.d.ts +3 -0
  160. package/dist/src/types/__examples__/src/components/forms/SignUpFormExample.d.ts +6 -0
  161. package/dist/src/types/__examples__/src/components/forms/SubmitBtnExample.d.ts +3 -0
  162. package/dist/src/types/__examples__/src/components/forms/TextFieldExample.d.ts +3 -0
  163. package/dist/src/types/__examples__/src/components/forms/TimePickerExample.d.ts +3 -0
  164. package/dist/src/types/__examples__/src/components/forms/ToggleButtonExample.d.ts +1 -0
  165. package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderDocs.d.ts +3 -0
  166. package/dist/src/types/__examples__/src/components/forms/uploads/IhubFileUploaderSample.d.ts +6 -0
  167. package/dist/src/types/__examples__/src/components/navbars/BreadcrumbExample.d.ts +1 -0
  168. package/dist/src/types/__examples__/src/components/navbars/CursorProviders.d.ts +1 -0
  169. package/dist/src/types/__examples__/src/components/navbars/MainFooter.d.ts +2 -0
  170. package/dist/src/types/__examples__/src/components/navbars/MainNavigation.d.ts +2 -0
  171. package/dist/src/types/__examples__/src/components/navbars/PageNavigation.d.ts +2 -0
  172. package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarControlledExample.d.ts +1 -0
  173. package/dist/src/types/__examples__/src/components/navbars/ResponsiveNavbarExample.d.ts +2 -0
  174. package/dist/src/types/__examples__/src/components/navbars/SideNavbarExample.d.ts +3 -0
  175. package/dist/src/types/__examples__/src/components/navbars/TabsExample.d.ts +1 -0
  176. package/dist/src/types/__examples__/src/components/tabs/TabsDemo.d.ts +2 -0
  177. package/dist/src/types/__examples__/src/components/tabs/TabsExample.d.ts +3 -0
  178. package/dist/src/types/__examples__/src/components/tabs/VerticalTabsExample.d.ts +3 -0
  179. package/dist/src/types/__examples__/src/components/ui/ActionExamples.d.ts +2 -0
  180. package/dist/src/types/__examples__/src/components/ui/BadgeExamples.d.ts +3 -0
  181. package/dist/src/types/__examples__/src/components/ui/CardExamples.d.ts +1 -0
  182. package/dist/src/types/__examples__/src/components/ui/CardGridExample.d.ts +3 -0
  183. package/dist/src/types/__examples__/src/components/ui/CardListExample.d.ts +3 -0
  184. package/dist/src/types/__examples__/src/components/ui/ChartExamples.d.ts +3 -0
  185. package/dist/src/types/__examples__/src/components/ui/CodebaseLink.d.ts +4 -0
  186. package/dist/src/types/__examples__/src/components/ui/ColorPickerExample.d.ts +3 -0
  187. package/dist/src/types/__examples__/src/components/ui/ContentFormTextEditor.d.ts +1 -0
  188. package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditExample.d.ts +3 -0
  189. package/dist/src/types/__examples__/src/components/ui/ContentViewOrEditSample.d.ts +1 -0
  190. package/dist/src/types/__examples__/src/components/ui/ContentViewerExample.d.ts +3 -0
  191. package/dist/src/types/__examples__/src/components/ui/CreateButtonExample.d.ts +3 -0
  192. package/dist/src/types/__examples__/src/components/ui/CustomTextEditorExample.d.ts +3 -0
  193. package/dist/src/types/__examples__/src/components/ui/DangerousRendererExample.d.ts +1 -0
  194. package/dist/src/types/__examples__/src/components/ui/DialogExample.d.ts +3 -0
  195. package/dist/src/types/__examples__/src/components/ui/DropdownExamples.d.ts +2 -0
  196. package/dist/src/types/__examples__/src/components/ui/IHubTextEditorExample.d.ts +3 -0
  197. package/dist/src/types/__examples__/src/components/ui/ListStylesDemo.d.ts +1 -0
  198. package/dist/src/types/__examples__/src/components/ui/ListStylesDemoTwo.d.ts +1 -0
  199. package/dist/src/types/__examples__/src/components/ui/OrDividerExample.d.ts +3 -0
  200. package/dist/src/types/__examples__/src/components/ui/PaginationExample.d.ts +3 -0
  201. package/dist/src/types/__examples__/src/components/ui/RandomGradientImageExample.d.ts +3 -0
  202. package/dist/src/types/__examples__/src/components/ui/S3MultiUploaderExample.d.ts +3 -0
  203. package/dist/src/types/__examples__/src/components/ui/StatusIconExample.d.ts +3 -0
  204. package/dist/src/types/__examples__/src/components/ui/TableExamples.d.ts +3 -0
  205. package/dist/src/types/__examples__/src/components/ui/TableServerExamples.d.ts +1 -0
  206. package/dist/src/types/__examples__/src/lib/api.d.ts +29 -0
  207. package/dist/src/types/__examples__/src/lib/hooks.d.ts +76 -0
  208. package/dist/src/types/__examples__/src/types/components.d.ts +144 -0
  209. package/dist/src/types/assets/svgs/SVGs.d.ts +36 -0
  210. package/dist/src/types/components/forms/PhoneNumberInput.d.ts +56 -13
  211. package/dist/src/types/components/forms/uploads/S3MultiUploader.d.ts +12 -6
  212. package/dist/src/types/components/lib/index.d.ts +1 -0
  213. package/dist/src/types/components/lib/phoneUtils.d.ts +99 -0
  214. package/dist/src/types/components/lib/redux/slices/channelSlice/channelDetails.d.ts +1 -1
  215. package/dist/src/types/components/lib/redux/slices/channelSlice/instructorChannelList.d.ts +3 -2
  216. package/dist/src/types/components/lib/redux/slices/courseSlice/courseDetails.d.ts +1 -1
  217. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterDuration.d.ts +2 -2
  218. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterLevel.d.ts +2 -2
  219. package/dist/src/types/components/lib/redux/slices/courseSlice/courseFilterSubject.d.ts +2 -2
  220. package/dist/src/types/components/lib/redux/slices/courseSlice/courseModules.d.ts +3 -3
  221. package/dist/src/types/components/lib/redux/slices/courseSlice/courseOverview.d.ts +1 -1
  222. package/dist/src/types/components/lib/redux/slices/courseSlice/courseSearch.d.ts +1 -1
  223. package/dist/src/types/components/lib/redux/slices/courseSlice/stepContent.d.ts +1 -1
  224. package/dist/src/types/components/lib/redux/slices/courseSlice/stepQuestions.d.ts +6 -6
  225. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestamp.d.ts +1 -1
  226. package/dist/src/types/components/lib/redux/slices/courseSlice/videoTimestampObject.d.ts +1 -1
  227. package/dist/src/types/components/lib/redux/slices/navigationSlice/IPAdress.d.ts +1 -1
  228. package/dist/src/types/components/ui/tables/IHubTable.d.ts +5 -8
  229. package/dist/src/types/components/ui/tables/IHubTableServer.d.ts +5 -8
  230. package/dist/src/types/components/ui/tables/utils/exportValues.d.ts +32 -0
  231. package/dist/src/types/components/ui/tables/utils/exportWriters.d.ts +17 -0
  232. package/dist/src/types/components/ui/tables/utils/tableExport.d.ts +48 -0
  233. package/dist/src/types/index.d.ts +3 -1
  234. package/dist/src/types/types/index.d.ts +91 -15
  235. package/dist/tsconfig.build.tsbuildinfo +1 -1
  236. package/dist/tsconfig.tsbuildinfo +1 -0
  237. package/package.json +17 -17
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("@aws-sdk/client-s3"),s=require("@aws-sdk/lib-storage"),i=require("../../lib/helpFunction.js"),o=require("../../lib/modals/modals.js"),a=function(e){return e<1048576?"".concat((e/1024).toFixed(0)," KB"):"".concat((e/1048576).toFixed(1)," MB")},c=function(){return n.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 16 12 12 8 16"}),n.jsx("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),n.jsx("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"})]})},l=function(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})},u=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin",children:[n.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),n.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),n.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),n.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),n.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),n.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),n.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),n.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]})},d=function(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})},m=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})},x=function(e){var t=e.size,r=void 0===t?13:t;return n.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};exports.default=function(f){var p=f.accepts,h=f.maxFileSizeBytes,j=void 0===h?524288e3:h,v=f.maxFiles,y=f.concurrency,g=void 0===y?1:y,k=f.username,N=f.location,C=f.cdnBase,b=f.label,_=void 0===b?"Drop files here or click to browse":b,w=f.hint,L=f.onFileComplete,S=f.onQueueComplete,A=f.onError,B=f.disabled,E=void 0!==B&&B,T=f.className,q=void 0===T?"":T,U=t.useState([]),D=e.slicedToArray(U,2),I=D[0],W=D[1],z=t.useState(!1),M=e.slicedToArray(z,2),F=M[0],P=M[1],K=t.useState(""),O=e.slicedToArray(K,2),R=O[0],X=O[1],G=t.useRef(null),Q=t.useRef(0),Y=t.useRef([]);Y.current=I;var H=Math.min(Math.max(g,1),4),V=t.useCallback(function(n,t){W(function(r){return r.map(function(r){return r.id===n?e.objectSpread2(e.objectSpread2({},r),t):r})})},[]),J=t.useCallback(function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){var o,a,c,l,u,d,m,x,f,p,h,j;return e.regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:return V(t.id,{status:"uploading",progress:0}),o=new r.S3Client({region:process.env.NEXT_PUBLIC_AWS_REGION,endpoint:process.env.NEXT_PUBLIC_AWS_S3_ENDPOINT_URL,credentials:{accessKeyId:process.env.NEXT_PUBLIC_AWS_ACCESS_KEY_ID||"",secretAccessKey:process.env.NEXT_PUBLIC_AWS_SECRET_ACCESS_KEY||""}}),a=(new Date).toISOString(),c=i.slugifyFileName("".concat(k,"-").concat(a,"-").concat(t.file.name)),l=i.IN_DEV_MODE?"test-env__".concat(c):c,u="".concat(N,"/").concat(l),d=process.env.NEXT_PUBLIC_AWS_BUCKET_NAME||"",e.p=1,e.n=2,t.file.arrayBuffer();case 2:return m=e.v,x=new Uint8Array(m),(f=new s.Upload({client:o,partSize:5242880,queueSize:2,params:{Bucket:d,Key:u,Body:x,ContentType:t.file.type,ACL:"public-read"}})).on("httpUploadProgress",function(e){if(e.total){var n=Math.round(e.loaded/e.total*100);V(t.id,{progress:n})}}),e.n=3,f.done();case 3:p={bucket:d,title:t.file.name,key:l,content_type:t.file.type,size:t.file.size,location:"".concat(C).concat(l)},V(t.id,{status:"complete",progress:100}),L(p),e.n=5;break;case 4:e.p=4,j=e.v,h=j instanceof Error?j.message:"Upload failed",V(t.id,{status:"error",error:h}),null==A||A(t.file.name,h);case 5:return e.a(2)}},n,null,[[1,4]])}));return function(e){return n.apply(this,arguments)}}(),[k,N,C,V,L,A]),Z=t.useCallback(e.asyncToGenerator(e.regenerator().m(function n(){var t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(!(Q.current>=H)){e.n=1;break}return e.a(2);case 1:if(t=Y.current.find(function(e){return"queued"===e.status})){e.n=2;break}return 0===Q.current&&Y.current.length>0&&Y.current.every(function(e){return"complete"===e.status||"error"===e.status})&&(null==S||S()),e.a(2);case 2:return Q.current+=1,e.n=3,J(t);case 3:Q.current-=1,Z();case 4:return e.a(2)}},n)})),[H,J,S]),$=t.useCallback(function(n){var t=n.filter(function(e){return e.size<=j});if(v&&v>0){var r=Y.current.length,s=v-r;if(s<=0)return void o.openToast("Maximum ".concat(v," file").concat(1!==v?"s":""," allowed"),400);t.length>s&&(o.openToast("Only ".concat(s," more file").concat(1!==s?"s":""," allowed (limit: ").concat(v,"). First ").concat(s," selected."),400),t=t.slice(0,s))}if(t.length){var i=t.map(function(e){return{id:crypto.randomUUID(),file:e,status:"queued",progress:0}});W(function(n){var t=[].concat(e.toConsumableArray(n),e.toConsumableArray(i));Y.current=t;for(var r=0;r<H;r++)setTimeout(Z,0);return t})}},[j,v,H,Z]),ee=I.filter(function(e){return"complete"===e.status}).length,ne=I.some(function(e){return"uploading"===e.status||"queued"===e.status}),te=R?I.filter(function(e){return e.file.name.toLowerCase().includes(R.toLowerCase())}):I;return n.jsxs("div",{className:"s3mu-root".concat(E?" s3mu-disabled":""," ").concat(q).trim(),children:[n.jsxs("div",{className:"s3mu-dropzone".concat(F?" dragging":""),onDragOver:function(e){e.preventDefault(),E||P(!0)},onDragLeave:function(){return P(!1)},onDrop:function(e){e.preventDefault(),P(!1),E||$(Array.from(e.dataTransfer.files))},onClick:function(){var e;return!E&&(null===(e=G.current)||void 0===e?void 0:e.click())},children:[n.jsx("input",{ref:G,type:"file",accept:p,multiple:!0,disabled:E,style:{display:"none"},onChange:function(e){e.target.files&&$(Array.from(e.target.files)),e.target.value=""}}),n.jsx("div",{className:"s3mu-drop-icon",children:n.jsx(c,{})}),n.jsx("p",{className:"s3mu-drop-label",children:_}),w&&n.jsx("p",{className:"s3mu-drop-hint",children:w}),n.jsxs("p",{className:"s3mu-drop-hint",children:["Max ",a(j)," per file"]}),v&&v>0&&n.jsxs("span",{className:"s3mu-maxfiles-badge",children:["Up to ",v," file",1!==v?"s":""]})]}),I.length>0&&n.jsxs("div",{className:"s3mu-queue",children:[n.jsxs("div",{className:"s3mu-queue-header",children:[n.jsx("span",{children:R&&te.length!==I.length?"".concat(te.length," of ").concat(I.length," file").concat(1!==I.length?"s":""):"".concat(I.length," file").concat(1!==I.length?"s":"")}),ee>0&&!ne&&n.jsx("button",{type:"button",className:"s3mu-clear-btn",onClick:function(){W(function(e){return e.filter(function(e){return"complete"!==e.status})})},children:"Clear completed"})]}),I.length>=5&&n.jsxs("div",{className:"s3mu-filter",children:[n.jsx(l,{}),n.jsx("input",{type:"text",placeholder:"Filter files…",value:R,onChange:function(e){return X(e.target.value)}})]}),te.map(function(e){return n.jsxs("div",{className:"s3mu-item s3mu-item--".concat(e.status),children:[n.jsxs("div",{className:"s3mu-item-icon",children:["complete"===e.status&&n.jsx(d,{}),"error"===e.status&&n.jsx(m,{}),"uploading"===e.status&&n.jsx(u,{}),"queued"===e.status&&n.jsx("div",{className:"s3mu-queued-dot"})]}),n.jsxs("div",{className:"s3mu-item-body",children:[n.jsxs("div",{className:"s3mu-item-name-row",children:[n.jsx("span",{className:"s3mu-item-name",title:e.file.name,children:e.file.name}),n.jsx("span",{className:"s3mu-item-size",children:a(e.file.size)})]}),("uploading"===e.status||"complete"===e.status)&&n.jsx("div",{className:"s3mu-bar-wrap",children:n.jsx("div",{className:"s3mu-bar-fill",style:{width:"".concat(e.progress,"%")}})}),"uploading"===e.status&&n.jsxs("span",{className:"s3mu-item-pct",children:[e.progress,"%"]}),"error"===e.status&&n.jsx("span",{className:"s3mu-item-err",children:e.error}),"queued"===e.status&&n.jsx("span",{className:"s3mu-item-pct",style:{opacity:.5},children:"Queued"})]}),"uploading"!==e.status&&n.jsx("button",{type:"button",className:"s3mu-item-remove",onClick:function(){return n=e.id,void W(function(e){return e.filter(function(e){return e.id!==n})});var n},title:"Remove",children:n.jsx(x,{})})]},e.id)})]})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),t=require("react"),r=require("../../lib/modals/modals.js"),s=function(e){return e<1048576?"".concat((e/1024).toFixed(0)," KB"):"".concat((e/1048576).toFixed(1)," MB")},i=function(){return n.jsxs("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("polyline",{points:"16 16 12 12 8 16"}),n.jsx("line",{x1:"12",y1:"12",x2:"12",y2:"21"}),n.jsx("path",{d:"M20.39 18.39A5 5 0 0 0 18 9h-1.26A8 8 0 1 0 3 16.3"})]})},o=function(){return n.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"11",cy:"11",r:"8"}),n.jsx("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})},a=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"spin",children:[n.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"6"}),n.jsx("line",{x1:"12",y1:"18",x2:"12",y2:"22"}),n.jsx("line",{x1:"4.93",y1:"4.93",x2:"7.76",y2:"7.76"}),n.jsx("line",{x1:"16.24",y1:"16.24",x2:"19.07",y2:"19.07"}),n.jsx("line",{x1:"2",y1:"12",x2:"6",y2:"12"}),n.jsx("line",{x1:"18",y1:"12",x2:"22",y2:"12"}),n.jsx("line",{x1:"4.93",y1:"19.07",x2:"7.76",y2:"16.24"}),n.jsx("line",{x1:"16.24",y1:"7.76",x2:"19.07",y2:"4.93"})]})},u=function(){return n.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:n.jsx("polyline",{points:"20 6 9 17 4 12"})})},l=function(){return n.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("circle",{cx:"12",cy:"12",r:"10"}),n.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),n.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})},c=function(e){var t=e.size,r=void 0===t?13:t;return n.jsxs("svg",{width:r,height:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[n.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})};function d(e,n,t,r){return new Promise(function(s,i){var o=new XMLHttpRequest;o.upload.onprogress=function(e){e.lengthComputable&&r(Math.round(e.loaded/e.total*100))},o.onload=function(){o.status>=200&&o.status<300?s():i(new Error("Upload failed: HTTP ".concat(o.status)))},o.onerror=function(){return i(new Error("Network error during upload"))},o.ontimeout=function(){return i(new Error("Upload timed out"))},o.open("PUT",e),o.setRequestHeader("Content-Type",t),o.send(n)})}exports.default=function(m){var f=m.accepts,x=m.maxFileSizeBytes,p=void 0===x?524288e3:x,h=m.maxFiles,j=m.concurrency,v=void 0===j?1:j,y=m.getPresignedUrl,g=m.label,k=void 0===g?"Drop files here or click to browse":g,b=m.hint,w=m.onFileComplete,N=m.onQueueComplete,C=m.onError,L=m.disabled,q=void 0!==L&&L,T=m.className,B=void 0===T?"":T,A=t.useState([]),M=e.slicedToArray(A,2),U=M[0],z=M[1],D=t.useState(!1),F=e.slicedToArray(D,2),P=F[0],R=F[1],S=t.useState(""),W=e.slicedToArray(S,2),E=W[0],_=W[1],H=t.useRef(null),O=t.useRef(0),G=t.useRef([]);G.current=U;var Q=Math.min(Math.max(v,1),4),I=t.useCallback(function(n,t){z(function(r){return r.map(function(r){return r.id===n?e.objectSpread2(e.objectSpread2({},r),t):r})})},[]),K=t.useCallback(function(){var n=e.asyncToGenerator(e.regenerator().m(function n(t){var r,s,i,o,a,u,l,c;return e.regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:return I(t.id,{status:"uploading",progress:0}),e.p=1,e.n=2,y(t.file);case 2:return r=e.v,s=r.url,i=r.key,o=r.cdnUrl,a=r.contentType,e.n=3,d(s,t.file,a,function(e){I(t.id,{progress:e})});case 3:u={title:t.file.name,key:i,content_type:a,size:t.file.size,location:o},I(t.id,{status:"complete",progress:100}),w(u),e.n=5;break;case 4:e.p=4,c=e.v,l=c instanceof Error?c.message:"Upload failed",I(t.id,{status:"error",error:l}),null==C||C(t.file.name,l);case 5:return e.a(2)}},n,null,[[1,4]])}));return function(e){return n.apply(this,arguments)}}(),[y,I,w,C]),X=t.useCallback(e.asyncToGenerator(e.regenerator().m(function n(){var t;return e.regenerator().w(function(e){for(;;)switch(e.n){case 0:if(!(O.current>=Q)){e.n=1;break}return e.a(2);case 1:if(t=G.current.find(function(e){return"queued"===e.status})){e.n=2;break}return 0===O.current&&G.current.length>0&&G.current.every(function(e){return"complete"===e.status||"error"===e.status})&&(null==N||N()),e.a(2);case 2:return O.current+=1,e.n=3,K(t);case 3:O.current-=1,X();case 4:return e.a(2)}},n)})),[Q,K,N]),J=t.useCallback(function(n){var t=n.filter(function(e){return e.size<=p});if(h&&h>0){var s=G.current.length,i=h-s;if(i<=0)return void r.openToast("Maximum ".concat(h," file").concat(1!==h?"s":""," allowed"),400);t.length>i&&(r.openToast("Only ".concat(i," more file").concat(1!==i?"s":""," allowed (limit: ").concat(h,"). First ").concat(i," selected."),400),t=t.slice(0,i))}if(t.length){var o=t.map(function(e){return{id:crypto.randomUUID(),file:e,status:"queued",progress:0}});z(function(n){var t=[].concat(e.toConsumableArray(n),e.toConsumableArray(o));G.current=t;for(var r=0;r<Q;r++)setTimeout(X,0);return t})}},[p,h,Q,X]),V=U.filter(function(e){return"complete"===e.status}).length,Y=U.some(function(e){return"uploading"===e.status||"queued"===e.status}),Z=E?U.filter(function(e){return e.file.name.toLowerCase().includes(E.toLowerCase())}):U;return n.jsxs("div",{className:"s3mu-root".concat(q?" s3mu-disabled":""," ").concat(B).trim(),children:[n.jsxs("div",{className:"s3mu-dropzone".concat(P?" dragging":""),onDragOver:function(e){e.preventDefault(),q||R(!0)},onDragLeave:function(){return R(!1)},onDrop:function(e){e.preventDefault(),R(!1),q||J(Array.from(e.dataTransfer.files))},onClick:function(){var e;return!q&&(null===(e=H.current)||void 0===e?void 0:e.click())},children:[n.jsx("input",{ref:H,type:"file",accept:f,multiple:!0,disabled:q,style:{display:"none"},onChange:function(e){e.target.files&&J(Array.from(e.target.files)),e.target.value=""}}),n.jsx("div",{className:"s3mu-drop-icon",children:n.jsx(i,{})}),n.jsx("p",{className:"s3mu-drop-label",children:k}),b&&n.jsx("p",{className:"s3mu-drop-hint",children:b}),n.jsxs("p",{className:"s3mu-drop-hint",children:["Max ",s(p)," per file"]}),h&&h>0&&n.jsxs("span",{className:"s3mu-maxfiles-badge",children:["Up to ",h," file",1!==h?"s":""]})]}),U.length>0&&n.jsxs("div",{className:"s3mu-queue",children:[n.jsxs("div",{className:"s3mu-queue-header",children:[n.jsx("span",{children:E&&Z.length!==U.length?"".concat(Z.length," of ").concat(U.length," file").concat(1!==U.length?"s":""):"".concat(U.length," file").concat(1!==U.length?"s":"")}),V>0&&!Y&&n.jsx("button",{type:"button",className:"s3mu-clear-btn",onClick:function(){z(function(e){return e.filter(function(e){return"complete"!==e.status})})},children:"Clear completed"})]}),U.length>=5&&n.jsxs("div",{className:"s3mu-filter",children:[n.jsx(o,{}),n.jsx("input",{type:"text",placeholder:"Filter files…",value:E,onChange:function(e){return _(e.target.value)}})]}),Z.map(function(e){return n.jsxs("div",{className:"s3mu-item s3mu-item--".concat(e.status),children:[n.jsxs("div",{className:"s3mu-item-icon",children:["complete"===e.status&&n.jsx(u,{}),"error"===e.status&&n.jsx(l,{}),"uploading"===e.status&&n.jsx(a,{}),"queued"===e.status&&n.jsx("div",{className:"s3mu-queued-dot"})]}),n.jsxs("div",{className:"s3mu-item-body",children:[n.jsxs("div",{className:"s3mu-item-name-row",children:[n.jsx("span",{className:"s3mu-item-name",title:e.file.name,children:e.file.name}),n.jsx("span",{className:"s3mu-item-size",children:s(e.file.size)})]}),("uploading"===e.status||"complete"===e.status)&&n.jsx("div",{className:"s3mu-bar-wrap",children:n.jsx("div",{className:"s3mu-bar-fill",style:{width:"".concat(e.progress,"%")}})}),"uploading"===e.status&&n.jsxs("span",{className:"s3mu-item-pct",children:[e.progress,"%"]}),"error"===e.status&&n.jsx("span",{className:"s3mu-item-err",children:e.error}),"queued"===e.status&&n.jsx("span",{className:"s3mu-item-pct",style:{opacity:.5},children:"Queued"})]}),"uploading"!==e.status&&n.jsx("button",{type:"button",className:"s3mu-item-remove",onClick:function(){return n=e.id,void z(function(e){return e.filter(function(e){return e.id!==n})});var n},title:"Remove",children:n.jsx(c,{})})]},e.id)})]})]})};
2
2
  //# sourceMappingURL=S3MultiUploader.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./auth/dbRequestst.js"),t=require("./roles.js"),r=require("./json/accounts.js"),o=require("./json/unsplashDefaultObject.js"),s=require("./createSubscription.js"),a=require("./elementIsVisibleInViewport.js"),i=require("./formError.js"),p=require("./fileToBase64.js"),E=require("./getPriceObjects.js"),n=require("./convertArrayToObject.js"),l=require("./loadScript.js"),x=require("./format.js"),u=require("./helpFunction.js"),N=require("./oauth_json.js"),_=require("./paystack.js"),S=require("./permissions.js"),O=require("./utils.js"),R=require("./queryParameters/index.js"),T=require("./charts.js"),m=require("./modals/modals.js"),c=require("./modals/openConfirmDelete.js");exports.getChannel=e.getChannel,exports.getData=e.getData,exports.INSTRUCTOR_TYPE=t.INSTRUCTOR_TYPE,exports.ROLE_GROUPING=t.ROLE_GROUPING,exports.adminAccessValidation=t.adminAccessValidation,exports.AllCoursesdataList=r.AllCoursesdataList,exports.COMMENTS_BY=r.COMMENTS_BY,exports.DataList=r.DataList,exports.accounts=r.accounts,exports.dataList=r.dataList,exports.pending=r.pending,exports.projectStartHistory=r.projectStartHistory,exports.statesNigeria=r.statesNigeria,exports.unsplashDefaultObject=o.unsplashDefaultObject,exports.createSubscription=s.default,exports.elementIsVisibleInViewport=a.default,exports.handleFormErrors=i.default,exports.fileToBase64=p.default,exports.getPriceObjects=E.default,exports.convertArrayToObject=n.default,exports.loadScript=l.default,exports.formatTime=x.formatTime,exports.API_HOST_URL=u.API_HOST_URL,exports.CODECS_URL_M3U8=u.CODECS_URL_M3U8,exports.FILE_URL=u.FILE_URL,exports.IN_DEV_MODE=u.IN_DEV_MODE,exports.TrackViewPort=u.TrackViewPort,exports.VIDEO_URL=u.VIDEO_URL,exports.abbreviateNumber=u.abbreviateNumber,exports.addUserDomain=u.addUserDomain,exports.calculateAmountAfterDeduction=u.calculateAmountAfterDeduction,exports.calculateAverageRating=u.calculateAverageRating,exports.calculateCouponDeduction=u.calculateCouponDeduction,exports.calculateTotalCredits=u.calculateTotalCredits,exports.convertArrayToFormData=u.convertArrayToFormData,exports.convertToFloat=u.convertToFloat,exports.convertToSlug=u.convertToSlug,exports.extractSubDomain=u.extractSubDomain,exports.fetchAPI=u.fetchAPI,exports.fetchData=u.fetchData,exports.findNullOrEmptyKeys=u.findNullOrEmptyKeys,exports.formatDateToWord=u.formatDateToWord,exports.formatDuration=u.formatDuration,exports.formatNumberWithCommas=u.formatNumberWithCommas,exports.getCookie=u.getCookie,exports.getNestedValue=u.getNestedValue,exports.handleError=u.handleError,exports.handleInvalid=u.handleInvalid,exports.handleResendOTP=u.handleResendOTP,exports.handleStatusError=u.handleStatusError,exports.hostUrlEncode=u.hostUrlEncode,exports.inputTagErrorEvent=u.inputTagErrorEvent,exports.isValidAlphanumeric=u.isValidAlphanumeric,exports.isValidEmail=u.isValidEmail,exports.objectIsEmpty=u.objectIsEmpty,exports.printErr=u.printErr,exports.printErrNew=u.printErrNew,exports.removeCookie=u.removeCookie,exports.removeErrMsg=u.removeErrMsg,exports.reqOptions=u.reqOptions,exports.romansFigure=u.romansFigure,exports.setCookie=u.setCookie,exports.slugifyFileName=u.slugifyFileName,exports.spinBtn=u.spinBtn,exports.stripCommaFromNumber=u.stripCommaFromNumber,exports.stripHtmlTags=u.stripHtmlTags,exports.toTitleCase=u.toTitleCase,exports.truncateHtml=u.truncateHtml,exports.paystackHook=N.paystackHook,exports.profile_goggle_provider=N.profile_goggle_provider,exports.chargeAuthorization=_.chargeAuthorization,exports.handlePaymentSubmit=_.handlePaymentSubmit,exports.handlePaymentWithoutUserData=_.handlePaymentWithoutUserData,exports.payWithPaystack=_.payWithPaystack,exports.paystackDataConfig=_.paystackDataConfig,exports.CHANNEL_ADMIN_ROLES=S.CHANNEL_ADMIN_ROLES,exports.CHANNEL_BLOGGER_ROLES=S.CHANNEL_BLOGGER_ROLES,exports.CHANNEL_EVENT_ROLES=S.CHANNEL_EVENT_ROLES,exports.CHANNEL_FINANCE_ROLES=S.CHANNEL_FINANCE_ROLES,exports.CHANNEL_INSTRUCTOR_ROLES=S.CHANNEL_INSTRUCTOR_ROLES,exports.CHANNEL_LEARNER_ROLES=S.CHANNEL_LEARNER_ROLES,exports.CHANNEL_MODERATOR_ROLES=S.CHANNEL_MODERATOR_ROLES,exports.CHANNEL_REGISTRAR_ROLES=S.CHANNEL_REGISTRAR_ROLES,exports.CHANNEL_SUPER_ADMIN_ROLES=S.CHANNEL_SUPER_ADMIN_ROLES,exports.ROLE_MAP=S.ROLE_MAP,exports.findPermissions=S.findPermissions,exports.hasUserPermission=S.hasUserPermission,exports.headerKeyPermission=S.headerKeyPermission,exports.headerUsernamePermission=S.headerUsernamePermission,exports.ADMIN_PERMISSION=O.ADMIN_PERMISSION,exports.APPLICATION_FEE_TYPE_OPTIONS=O.APPLICATION_FEE_TYPE_OPTIONS,exports.CODE_LANGUAGES=O.CODE_LANGUAGES,exports.COMPANY_SIZES_CHOICES=O.COMPANY_SIZES_CHOICES,exports.CONTENT_TYPE_OPTIONS=O.CONTENT_TYPE_OPTIONS,exports.COURSE_REWARD_OPTIONS=O.COURSE_REWARD_OPTIONS,exports.CREDENTIALS=O.CREDENTIALS,exports.CURRENCY_SYMBOL=O.CURRENCY_SYMBOL,exports.DURATION_FILTERS=O.DURATION_FILTERS,exports.INDUSTRIES=O.INDUSTRIES,exports.KEYWORD_DESCRIPTION=O.KEYWORD_DESCRIPTION,exports.NEXT_AUTH_SESSION_DATA_DUMMY=O.NEXT_AUTH_SESSION_DATA_DUMMY,exports.NIGERIA_BANKS=O.NIGERIA_BANKS,exports.PAYMENT_PROCESSING_OPTIONS=O.PAYMENT_PROCESSING_OPTIONS,exports.PRIVACY=O.PRIVACY,exports.PROGRAM_LEVELS=O.PROGRAM_LEVELS,exports.REGISTRAR_PERMISSION=O.REGISTRAR_PERMISSION,exports.SCOREBOARD_DURATION=O.SCOREBOARD_DURATION,exports.SKILLS_LEVELS=O.SKILLS_LEVELS,exports.STUDENT_STATUS=O.STUDENT_STATUS,exports.SUBSCRIPTION_OPTION=O.SUBSCRIPTION_OPTION,exports.SUPER_PERMISSION=O.SUPER_PERMISSION,exports.TRUE_FALSE=O.TRUE_FALSE,exports.VIDEO_PLAYER_OPTIONS=O.VIDEO_PLAYER_OPTIONS,exports.YES_NO=O.YES_NO,exports.gaugeData=O.gaugeData,exports.buildDataFilterUrl=R.buildDataFilterUrl,exports.buildPaginationUrl=R.buildPaginationUrl,exports.buildUrl=R.buildUrl,exports.cleanUrl=R.cleanUrl,exports.getQueryParam=R.getQueryParam,exports.getQueryParams=R.getQueryParams,exports.hasQueryParam=R.hasQueryParam,exports.navigateWithQuery=R.navigateWithQuery,exports.urlQueryHelper=R.urlQueryHelper,exports.calculatePercentageChange=T.calculatePercentageChange,exports.createTimeSeriesTemplate=T.createTimeSeriesTemplate,exports.formatChartValue=T.formatChartValue,exports.formatDateForChart=T.formatDateForChart,exports.generateChartColors=T.generateChartColors,exports.groupAndAggregateData=T.groupAndAggregateData,exports.transformChartData=T.transformChartData,exports.getUserEmailInputModal=m.getUserEmailInputModal,exports.openConfirmModal=m.openConfirmModal,exports.openToast=m.openToast,exports.openConfirmDelete=c.openConfirmDelete,exports.instinctHubLogoUrl="/assets/logo/instincthub-logo-color.png",exports.instinctHubLogoUrlBlack="/assets/logo/instincthub-logo-black.png",exports.instinctHubLogoUrlWhite="/assets/logo/instincthub-logo-white.png",exports.instinctHubThumbnailLogo="/assets/logo/instincthub-logo-thumbnail.png";
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./auth/dbRequestst.js"),r=require("./roles.js"),t=require("./json/accounts.js"),o=require("./json/unsplashDefaultObject.js"),s=require("./createSubscription.js"),a=require("./elementIsVisibleInViewport.js"),i=require("./formError.js"),p=require("./fileToBase64.js"),n=require("./getPriceObjects.js"),l=require("./convertArrayToObject.js"),E=require("./loadScript.js"),x=require("./format.js"),u=require("./phoneUtils.js"),N=require("./helpFunction.js"),_=require("./oauth_json.js"),S=require("./paystack.js"),O=require("./permissions.js"),I=require("./utils.js"),R=require("./queryParameters/index.js"),T=require("./charts.js"),m=require("./modals/modals.js"),C=require("./modals/openConfirmDelete.js");exports.getChannel=e.getChannel,exports.getData=e.getData,exports.INSTRUCTOR_TYPE=r.INSTRUCTOR_TYPE,exports.ROLE_GROUPING=r.ROLE_GROUPING,exports.adminAccessValidation=r.adminAccessValidation,exports.AllCoursesdataList=t.AllCoursesdataList,exports.COMMENTS_BY=t.COMMENTS_BY,exports.DataList=t.DataList,exports.accounts=t.accounts,exports.dataList=t.dataList,exports.pending=t.pending,exports.projectStartHistory=t.projectStartHistory,exports.statesNigeria=t.statesNigeria,exports.unsplashDefaultObject=o.unsplashDefaultObject,exports.createSubscription=s.default,exports.elementIsVisibleInViewport=a.default,exports.handleFormErrors=i.default,exports.fileToBase64=p.default,exports.getPriceObjects=n.default,exports.convertArrayToObject=l.default,exports.loadScript=E.default,exports.formatTime=x.formatTime,exports.E164_MAX_DIGITS=u.E164_MAX_DIGITS,exports.MAX_NATIONAL_DIGITS=u.MAX_NATIONAL_DIGITS,exports.MIN_NATIONAL_DIGITS=u.MIN_NATIONAL_DIGITS,exports.PHONE_COUNTRIES=u.PHONE_COUNTRIES,exports.buildPhoneValue=u.buildPhoneValue,exports.digitsOnly=u.digitsOnly,exports.findCountryByDialCode=u.findCountryByDialCode,exports.findCountryByIso=u.findCountryByIso,exports.formatNationalNumber=u.formatNationalNumber,exports.matchDialCode=u.matchDialCode,exports.maxNationalDigits=u.maxNationalDigits,exports.normalizeDialCode=u.normalizeDialCode,exports.parsePhoneNumber=u.parsePhoneNumber,exports.resolveCountry=u.resolveCountry,exports.searchCountries=u.searchCountries,exports.withPreferredCountries=u.withPreferredCountries,exports.API_HOST_URL=N.API_HOST_URL,exports.CODECS_URL_M3U8=N.CODECS_URL_M3U8,exports.FILE_URL=N.FILE_URL,exports.IN_DEV_MODE=N.IN_DEV_MODE,exports.TrackViewPort=N.TrackViewPort,exports.VIDEO_URL=N.VIDEO_URL,exports.abbreviateNumber=N.abbreviateNumber,exports.addUserDomain=N.addUserDomain,exports.calculateAmountAfterDeduction=N.calculateAmountAfterDeduction,exports.calculateAverageRating=N.calculateAverageRating,exports.calculateCouponDeduction=N.calculateCouponDeduction,exports.calculateTotalCredits=N.calculateTotalCredits,exports.convertArrayToFormData=N.convertArrayToFormData,exports.convertToFloat=N.convertToFloat,exports.convertToSlug=N.convertToSlug,exports.extractSubDomain=N.extractSubDomain,exports.fetchAPI=N.fetchAPI,exports.fetchData=N.fetchData,exports.findNullOrEmptyKeys=N.findNullOrEmptyKeys,exports.formatDateToWord=N.formatDateToWord,exports.formatDuration=N.formatDuration,exports.formatNumberWithCommas=N.formatNumberWithCommas,exports.getCookie=N.getCookie,exports.getNestedValue=N.getNestedValue,exports.handleError=N.handleError,exports.handleInvalid=N.handleInvalid,exports.handleResendOTP=N.handleResendOTP,exports.handleStatusError=N.handleStatusError,exports.hostUrlEncode=N.hostUrlEncode,exports.inputTagErrorEvent=N.inputTagErrorEvent,exports.isValidAlphanumeric=N.isValidAlphanumeric,exports.isValidEmail=N.isValidEmail,exports.objectIsEmpty=N.objectIsEmpty,exports.printErr=N.printErr,exports.printErrNew=N.printErrNew,exports.removeCookie=N.removeCookie,exports.removeErrMsg=N.removeErrMsg,exports.reqOptions=N.reqOptions,exports.romansFigure=N.romansFigure,exports.setCookie=N.setCookie,exports.slugifyFileName=N.slugifyFileName,exports.spinBtn=N.spinBtn,exports.stripCommaFromNumber=N.stripCommaFromNumber,exports.stripHtmlTags=N.stripHtmlTags,exports.toTitleCase=N.toTitleCase,exports.truncateHtml=N.truncateHtml,exports.paystackHook=_.paystackHook,exports.profile_goggle_provider=_.profile_goggle_provider,exports.chargeAuthorization=S.chargeAuthorization,exports.handlePaymentSubmit=S.handlePaymentSubmit,exports.handlePaymentWithoutUserData=S.handlePaymentWithoutUserData,exports.payWithPaystack=S.payWithPaystack,exports.paystackDataConfig=S.paystackDataConfig,exports.CHANNEL_ADMIN_ROLES=O.CHANNEL_ADMIN_ROLES,exports.CHANNEL_BLOGGER_ROLES=O.CHANNEL_BLOGGER_ROLES,exports.CHANNEL_EVENT_ROLES=O.CHANNEL_EVENT_ROLES,exports.CHANNEL_FINANCE_ROLES=O.CHANNEL_FINANCE_ROLES,exports.CHANNEL_INSTRUCTOR_ROLES=O.CHANNEL_INSTRUCTOR_ROLES,exports.CHANNEL_LEARNER_ROLES=O.CHANNEL_LEARNER_ROLES,exports.CHANNEL_MODERATOR_ROLES=O.CHANNEL_MODERATOR_ROLES,exports.CHANNEL_REGISTRAR_ROLES=O.CHANNEL_REGISTRAR_ROLES,exports.CHANNEL_SUPER_ADMIN_ROLES=O.CHANNEL_SUPER_ADMIN_ROLES,exports.ROLE_MAP=O.ROLE_MAP,exports.findPermissions=O.findPermissions,exports.hasUserPermission=O.hasUserPermission,exports.headerKeyPermission=O.headerKeyPermission,exports.headerUsernamePermission=O.headerUsernamePermission,exports.ADMIN_PERMISSION=I.ADMIN_PERMISSION,exports.APPLICATION_FEE_TYPE_OPTIONS=I.APPLICATION_FEE_TYPE_OPTIONS,exports.CODE_LANGUAGES=I.CODE_LANGUAGES,exports.COMPANY_SIZES_CHOICES=I.COMPANY_SIZES_CHOICES,exports.CONTENT_TYPE_OPTIONS=I.CONTENT_TYPE_OPTIONS,exports.COURSE_REWARD_OPTIONS=I.COURSE_REWARD_OPTIONS,exports.CREDENTIALS=I.CREDENTIALS,exports.CURRENCY_SYMBOL=I.CURRENCY_SYMBOL,exports.DURATION_FILTERS=I.DURATION_FILTERS,exports.INDUSTRIES=I.INDUSTRIES,exports.KEYWORD_DESCRIPTION=I.KEYWORD_DESCRIPTION,exports.NEXT_AUTH_SESSION_DATA_DUMMY=I.NEXT_AUTH_SESSION_DATA_DUMMY,exports.NIGERIA_BANKS=I.NIGERIA_BANKS,exports.PAYMENT_PROCESSING_OPTIONS=I.PAYMENT_PROCESSING_OPTIONS,exports.PRIVACY=I.PRIVACY,exports.PROGRAM_LEVELS=I.PROGRAM_LEVELS,exports.REGISTRAR_PERMISSION=I.REGISTRAR_PERMISSION,exports.SCOREBOARD_DURATION=I.SCOREBOARD_DURATION,exports.SKILLS_LEVELS=I.SKILLS_LEVELS,exports.STUDENT_STATUS=I.STUDENT_STATUS,exports.SUBSCRIPTION_OPTION=I.SUBSCRIPTION_OPTION,exports.SUPER_PERMISSION=I.SUPER_PERMISSION,exports.TRUE_FALSE=I.TRUE_FALSE,exports.VIDEO_PLAYER_OPTIONS=I.VIDEO_PLAYER_OPTIONS,exports.YES_NO=I.YES_NO,exports.gaugeData=I.gaugeData,exports.buildDataFilterUrl=R.buildDataFilterUrl,exports.buildPaginationUrl=R.buildPaginationUrl,exports.buildUrl=R.buildUrl,exports.cleanUrl=R.cleanUrl,exports.getQueryParam=R.getQueryParam,exports.getQueryParams=R.getQueryParams,exports.hasQueryParam=R.hasQueryParam,exports.navigateWithQuery=R.navigateWithQuery,exports.urlQueryHelper=R.urlQueryHelper,exports.calculatePercentageChange=T.calculatePercentageChange,exports.createTimeSeriesTemplate=T.createTimeSeriesTemplate,exports.formatChartValue=T.formatChartValue,exports.formatDateForChart=T.formatDateForChart,exports.generateChartColors=T.generateChartColors,exports.groupAndAggregateData=T.groupAndAggregateData,exports.transformChartData=T.transformChartData,exports.getUserEmailInputModal=m.getUserEmailInputModal,exports.openConfirmModal=m.openConfirmModal,exports.openToast=m.openToast,exports.openConfirmDelete=C.openConfirmDelete,exports.instinctHubLogoUrl="/assets/logo/instincthub-logo-color.png",exports.instinctHubLogoUrlBlack="/assets/logo/instincthub-logo-black.png",exports.instinctHubLogoUrlWhite="/assets/logo/instincthub-logo-white.png",exports.instinctHubThumbnailLogo="/assets/logo/instincthub-logo-thumbnail.png";
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../../src/components/lib/index.ts"],"sourcesContent":["// src/components/lib/index.ts\n\nexport * from \"./auth/dbRequestst\";\nexport * from \"./roles\";\n\n// JSON exports\nexport * from \"./json/accounts\";\nexport * from \"./json/countryNigeria\";\nexport * from \"./json/countryObjects\";\nexport * from \"./json/educationLevels\";\nexport * from \"./json/unsplashDefaultObject\";\n\n// Utility functions\nexport { default as createSubscription } from \"./createSubscription\";\nexport { default as elementIsVisibleInViewport } from \"./elementIsVisibleInViewport\";\nexport { default as handleFormErrors } from \"./formError\";\nexport { default as fileToBase64 } from \"./fileToBase64\";\nexport { default as getPriceObjects } from \"./getPriceObjects\";\nexport {default as convertArrayToObject} from \"./convertArrayToObject\";\nexport {default as loadScript} from \"./loadScript\";\nexport * from \"./format\";\nexport * from \"./helpFunction\";\nexport * from \"./oauth_json\";\nexport * from \"./paystack\";\nexport * from \"./permissions\";\nexport * from \"./utils\";\nexport * from \"./queryParameters\";\n\n// Charts\nexport * from \"./charts\";\n\n// Modals\nexport * from \"./modals/modals\";\nexport * from \"./modals/openConfirmDelete\";\n\n// Logo\nexport const instinctHubLogoUrl = \"/assets/logo/instincthub-logo-color.png\";\nexport const instinctHubLogoUrlWhite =\n \"/assets/logo/instincthub-logo-white.png\";\nexport const instinctHubLogoUrlBlack =\n \"/assets/logo/instincthub-logo-black.png\";\nexport const instinctHubThumbnailLogo =\n \"/assets/logo/instincthub-logo-thumbnail.png\";\n"],"names":[],"mappings":"w7MAoCkC,0EAIhC,0EAFA,2EAIA"}
1
+ {"version":3,"file":"index.js","sources":["../../../../src/components/lib/index.ts"],"sourcesContent":["// src/components/lib/index.ts\n\nexport * from \"./auth/dbRequestst\";\nexport * from \"./roles\";\n\n// JSON exports\nexport * from \"./json/accounts\";\nexport * from \"./json/countryNigeria\";\nexport * from \"./json/countryObjects\";\nexport * from \"./json/educationLevels\";\nexport * from \"./json/unsplashDefaultObject\";\n\n// Utility functions\nexport { default as createSubscription } from \"./createSubscription\";\nexport { default as elementIsVisibleInViewport } from \"./elementIsVisibleInViewport\";\nexport { default as handleFormErrors } from \"./formError\";\nexport { default as fileToBase64 } from \"./fileToBase64\";\nexport { default as getPriceObjects } from \"./getPriceObjects\";\nexport {default as convertArrayToObject} from \"./convertArrayToObject\";\nexport {default as loadScript} from \"./loadScript\";\nexport * from \"./format\";\nexport * from \"./phoneUtils\";\nexport * from \"./helpFunction\";\nexport * from \"./oauth_json\";\nexport * from \"./paystack\";\nexport * from \"./permissions\";\nexport * from \"./utils\";\nexport * from \"./queryParameters\";\n\n// Charts\nexport * from \"./charts\";\n\n// Modals\nexport * from \"./modals/modals\";\nexport * from \"./modals/openConfirmDelete\";\n\n// Logo\nexport const instinctHubLogoUrl = \"/assets/logo/instincthub-logo-color.png\";\nexport const instinctHubLogoUrlWhite =\n \"/assets/logo/instincthub-logo-white.png\";\nexport const instinctHubLogoUrlBlack =\n \"/assets/logo/instincthub-logo-black.png\";\nexport const instinctHubThumbnailLogo =\n \"/assets/logo/instincthub-logo-thumbnail.png\";\n"],"names":[],"mappings":"qqOAqCkC,0EAIhC,0EAFA,2EAIA"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("../../../_virtual/_rollupPluginBabelHelpers.js"),e=require("./json/countryObjects.js"),t={1:"US",7:"RU",39:"IT",44:"GB",47:"NO",61:"AU",212:"MA",262:"RE",290:"SH",358:"FI",500:"FK",590:"GP",599:"CW",672:"NF"},n=function(r){if(!r)return"";var e=String(r).split(/\s+and\s+/i)[0].replace(/\D/g,"");return e.replace(/^0+/,"")||e},o=e.default.map(function(e){return r.objectSpread2(r.objectSpread2({},e),{},{dialCode:n(e.phonecode)})}).filter(function(r){return r.dialCode.length>0}).sort(function(r,e){return r.name.localeCompare(e.name)}),a=Array.from(new Set(o.map(function(r){return r.dialCode}))).sort(function(r,e){return e.length-r.length}),i=function(r){return String(null!=r?r:"").replace(/\D/g,"")},u=function(r){return Math.max(4,15-((null==r?void 0:r.length)||0))},l=function(r){if(r){var e=String(r).trim().toUpperCase();return o.find(function(r){return r.isoCode===e})}},c=function(r,e){var n=o.filter(function(e){return e.dialCode===r});if(0!==n.length){if(1===n.length)return n[0];var a=e?n.find(function(r){return r.isoCode===e.toUpperCase()}):void 0;if(a)return a;var i=t[r];return(i?n.find(function(r){return r.isoCode===i}):void 0)||n[0]}},s=function(e,t){var n,o=r.createForOfIteratorHelper(a);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(e.startsWith(i)){var u=c(i,t);if(u)return{country:u,dialCode:i,nationalNumber:e.slice(i.length),matchedCountryCode:!0}}}}catch(r){o.e(r)}finally{o.f()}return null},d=function(e){var t=i(e);if(t.length<=6)return t;var n=t.slice(-4),o=t.slice(0,-4).match(/.{1,3}/g)||[];return[].concat(r.toConsumableArray(o),[n]).join(" ")};exports.E164_MAX_DIGITS=15,exports.MAX_NATIONAL_DIGITS=11,exports.MIN_NATIONAL_DIGITS=4,exports.PHONE_COUNTRIES=o,exports.buildPhoneValue=function(r,e){var t=i(e),n=r.dialCode,o=t.length>=4&&t.length<=u(n);return{phoneCode:"+".concat(n),dialCode:n,nationalNumber:t,e164:t?"+".concat(n).concat(t):"",formatted:t?"+".concat(n," ").concat(d(t)):"+".concat(n),isoCode:r.isoCode,countryName:r.name,flag:r.flag,isValid:o}},exports.digitsOnly=i,exports.findCountryByDialCode=c,exports.findCountryByIso=l,exports.formatNationalNumber=d,exports.matchDialCode=s,exports.maxNationalDigits=u,exports.normalizeDialCode=n,exports.parsePhoneNumber=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=e.currentCountry,n=e.aggressive,o=void 0!==n&&n,a=null==t?void 0:t.isoCode,u=String(null!=r?r:"").trim(),l=i(u);if(!l)return{nationalNumber:"",matchedCountryCode:!1};var c=u.startsWith("+"),d=!c&&/^00[1-9]/.test(l),f=d?l.replace(/^00/,""):l;if(c||d)return s(f,a)||{nationalNumber:f,matchedCountryCode:!1};if(f.startsWith("0"))return{nationalNumber:f.replace(/^0+/,""),matchedCountryCode:!1};if(o){var C=function(r){return r.length>=4&&r.length<=11},m=null==t?void 0:t.dialCode;if(m&&f.startsWith(m)){var h=f.slice(m.length);if(C(h))return{country:t,dialCode:m,nationalNumber:h,matchedCountryCode:!0}}if(f.length>11){var p=s(f,a);if(p&&C(p.nationalNumber))return p}}return{nationalNumber:f,matchedCountryCode:!1}},exports.resolveCountry=function(r,e){var t=String(null!=r?r:"").trim();if(t){var a=l(t);if(a)return a;var i=n(t);if(i){var u=c(i,e);if(u)return u}var s=t.toLowerCase();return o.find(function(r){return r.name.toLowerCase()===s})}},exports.searchCountries=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o,t=String(null!=r?r:"").trim().toLowerCase();if(!t)return e;var n=i(t),a=[];return e.forEach(function(r){var e=r.name.toLowerCase(),o=r.isoCode.toLowerCase(),i=-1;e===t?i=0:o===t?i=1:e.startsWith(t)?i=2:n&&r.dialCode===n?i=3:n&&r.dialCode.startsWith(n)?i=4:e.includes(t)&&(i=5),i>=0&&a.push({country:r,score:i})}),a.sort(function(r,e){return r.score-e.score||r.country.name.localeCompare(e.country.name)}).map(function(r){return r.country})},exports.withPreferredCountries=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o;if(!e||0===e.length)return t;var n=e.map(function(r){return l(r)}).filter(function(r){return Boolean(r)});if(0===n.length)return t;var a=new Set(n.map(function(r){return r.isoCode}));return[].concat(r.toConsumableArray(n),r.toConsumableArray(t.filter(function(r){return!a.has(r.isoCode)})))};
2
+ //# sourceMappingURL=phoneUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phoneUtils.js","sources":["../../../../src/components/lib/phoneUtils.ts"],"sourcesContent":["import countryObjects from \"./json/countryObjects\";\n\n/**\n * A country entry augmented with a normalised, digits-only dial code.\n * The raw dataset stores `phonecode` inconsistently (\"234\", \"+1-242\",\n * \"0055\", \"+1-787 and 1-939\"), so `dialCode` is the value to rely on.\n */\nexport interface PhoneCountryType {\n name: string;\n isoCode: string;\n flag: string;\n phonecode: string;\n dialCode: string;\n [key: string]: any;\n}\n\nexport interface ParsedPhoneNumberType {\n /** Country detected from an explicit dial code, if any. */\n country?: PhoneCountryType;\n /** Digits-only dial code that was stripped off, if any. */\n dialCode?: string;\n /** Subscriber number with the dial code and trunk prefix removed. */\n nationalNumber: string;\n /** True when a dial code was found and removed from the input. */\n matchedCountryCode: boolean;\n}\n\nexport interface PhoneNumberValueType {\n /** Display form of the dial code, e.g. \"+234\". */\n phoneCode: string;\n /** Digits-only dial code, e.g. \"234\". */\n dialCode: string;\n /** Subscriber number without dial code or trunk prefix, e.g. \"8031234567\". */\n nationalNumber: string;\n /** Storage form, e.g. \"+2348031234567\". Empty when there is no number. */\n e164: string;\n /** Human readable form, e.g. \"+234 803 123 4567\". */\n formatted: string;\n isoCode: string;\n countryName: string;\n flag: string;\n isValid: boolean;\n}\n\n/** E.164 caps dial code + national number at 15 digits. */\nexport const E164_MAX_DIGITS = 15;\n\n/** Shortest national number we treat as plausible when splitting a paste. */\nexport const MIN_NATIONAL_DIGITS = 4;\n\n/**\n * A national number (no dial code) never exceeds this in practice. Anything\n * longer that was pasted without a \"+\" almost certainly embeds a dial code.\n */\nexport const MAX_NATIONAL_DIGITS = 11;\n\n/**\n * Several countries share a dial code. When a number is parsed we cannot know\n * which one was meant, so pick the most populous holder of the code.\n */\nconst AMBIGUOUS_DIAL_CODE_PREFERENCE: Record<string, string> = {\n \"1\": \"US\",\n \"7\": \"RU\",\n \"39\": \"IT\",\n \"44\": \"GB\",\n \"47\": \"NO\",\n \"61\": \"AU\",\n \"212\": \"MA\",\n \"262\": \"RE\",\n \"290\": \"SH\",\n \"358\": \"FI\",\n \"500\": \"FK\",\n \"590\": \"GP\",\n \"599\": \"CW\",\n \"672\": \"NF\",\n};\n\n/**\n * Reduce a raw `phonecode` to digits only.\n * \"+1-242\" -> \"1242\", \"0055\" -> \"55\", \"+1-787 and 1-939\" -> \"1787\".\n */\nexport const normalizeDialCode = (phonecode?: string | null): string => {\n if (!phonecode) return \"\";\n const primary = String(phonecode).split(/\\s+and\\s+/i)[0];\n const digits = primary.replace(/\\D/g, \"\");\n return digits.replace(/^0+/, \"\") || digits;\n};\n\n/** Every country, with a usable `dialCode`, sorted alphabetically by name. */\nexport const PHONE_COUNTRIES: PhoneCountryType[] = (countryObjects as any[])\n .map((country) => ({\n ...country,\n dialCode: normalizeDialCode(country.phonecode),\n }))\n .filter((country) => country.dialCode.length > 0)\n .sort((a, b) => a.name.localeCompare(b.name));\n\n/** Unique dial codes, longest first, so prefix matching is greedy. */\nconst DIAL_CODES_LONGEST_FIRST: string[] = Array.from(\n new Set(PHONE_COUNTRIES.map((country) => country.dialCode))\n).sort((a, b) => b.length - a.length);\n\n/** Strip everything except digits. */\nexport const digitsOnly = (value?: string | null): string =>\n String(value ?? \"\").replace(/\\D/g, \"\");\n\n/** Longest national number allowed for a dial code, per E.164. */\nexport const maxNationalDigits = (dialCode?: string | null): number =>\n Math.max(MIN_NATIONAL_DIGITS, E164_MAX_DIGITS - (dialCode?.length || 0));\n\nexport const findCountryByIso = (\n isoCode?: string | null\n): PhoneCountryType | undefined => {\n if (!isoCode) return undefined;\n const iso = String(isoCode).trim().toUpperCase();\n return PHONE_COUNTRIES.find((country) => country.isoCode === iso);\n};\n\n/**\n * Resolve the country that owns a dial code. `preferIso` wins when it is one\n * of the holders, which keeps the current selection stable while typing.\n */\nexport const findCountryByDialCode = (\n dialCode: string,\n preferIso?: string | null\n): PhoneCountryType | undefined => {\n const matches = PHONE_COUNTRIES.filter(\n (country) => country.dialCode === dialCode\n );\n if (matches.length === 0) return undefined;\n if (matches.length === 1) return matches[0];\n\n const preferred = preferIso\n ? matches.find((country) => country.isoCode === preferIso.toUpperCase())\n : undefined;\n if (preferred) return preferred;\n\n const fallbackIso = AMBIGUOUS_DIAL_CODE_PREFERENCE[dialCode];\n const fallback = fallbackIso\n ? matches.find((country) => country.isoCode === fallbackIso)\n : undefined;\n\n return fallback || matches[0];\n};\n\n/**\n * Accepts anything a caller might pass as a country: \"234\", \"+234\", \"+1-242\",\n * \"NG\", \"ng\" or \"Nigeria\".\n */\nexport const resolveCountry = (\n value?: string | null,\n preferIso?: string | null\n): PhoneCountryType | undefined => {\n const raw = String(value ?? \"\").trim();\n if (!raw) return undefined;\n\n const byIso = findCountryByIso(raw);\n if (byIso) return byIso;\n\n const dialCode = normalizeDialCode(raw);\n if (dialCode) {\n const byDialCode = findCountryByDialCode(dialCode, preferIso);\n if (byDialCode) return byDialCode;\n }\n\n const lowered = raw.toLowerCase();\n return PHONE_COUNTRIES.find(\n (country) => country.name.toLowerCase() === lowered\n );\n};\n\n/** Greedy longest-prefix dial code match against a digits-only string. */\nexport const matchDialCode = (\n digits: string,\n preferIso?: string | null\n): ParsedPhoneNumberType | null => {\n for (const dialCode of DIAL_CODES_LONGEST_FIRST) {\n if (!digits.startsWith(dialCode)) continue;\n const country = findCountryByDialCode(dialCode, preferIso);\n if (!country) continue;\n return {\n country,\n dialCode,\n nationalNumber: digits.slice(dialCode.length),\n matchedCountryCode: true,\n };\n }\n return null;\n};\n\n/**\n * Split a phone number into a country and a national number.\n *\n * Explicit international input (\"+234…\" or \"00234…\") always attempts a dial\n * code match. Input without that prefix is treated as national — a leading\n * trunk \"0\" is dropped and the current country is kept — unless `aggressive`\n * is set, which is what paste and blur use to also recognise a bare\n * \"2348031234567\".\n */\nexport const parsePhoneNumber = (\n raw: string,\n options: {\n currentCountry?: PhoneCountryType | null;\n aggressive?: boolean;\n } = {}\n): ParsedPhoneNumberType => {\n const { currentCountry, aggressive = false } = options;\n const preferIso = currentCountry?.isoCode;\n const text = String(raw ?? \"\").trim();\n const digits = digitsOnly(text);\n\n if (!digits) return { nationalNumber: \"\", matchedCountryCode: false };\n\n const hasPlus = text.startsWith(\"+\");\n const hasIddPrefix = !hasPlus && /^00[1-9]/.test(digits);\n const body = hasIddPrefix ? digits.replace(/^00/, \"\") : digits;\n\n if (hasPlus || hasIddPrefix) {\n return (\n matchDialCode(body, preferIso) || {\n nationalNumber: body,\n matchedCountryCode: false,\n }\n );\n }\n\n // Trunk prefix: \"08031234567\" is a national number, not a country code.\n if (body.startsWith(\"0\")) {\n return {\n nationalNumber: body.replace(/^0+/, \"\"),\n matchedCountryCode: false,\n };\n }\n\n if (aggressive) {\n // A dial code only counts when what is left behind is itself a plausible\n // national number. Without the upper bound, a long run of digits would\n // match some country and drag the selection with it.\n const isPlausibleRemainder = (remainder: string) =>\n remainder.length >= MIN_NATIONAL_DIGITS &&\n remainder.length <= MAX_NATIONAL_DIGITS;\n\n // \"2348031234567\" pasted without a \"+\", for the country already selected.\n const currentDialCode = currentCountry?.dialCode;\n if (currentDialCode && body.startsWith(currentDialCode)) {\n const remainder = body.slice(currentDialCode.length);\n if (isPlausibleRemainder(remainder)) {\n return {\n country: currentCountry as PhoneCountryType,\n dialCode: currentDialCode,\n nationalNumber: remainder,\n matchedCountryCode: true,\n };\n }\n }\n\n // Too long to be national on its own, so it must carry a dial code.\n if (body.length > MAX_NATIONAL_DIGITS) {\n const matched = matchDialCode(body, preferIso);\n if (matched && isPlausibleRemainder(matched.nationalNumber)) {\n return matched;\n }\n }\n }\n\n return { nationalNumber: body, matchedCountryCode: false };\n};\n\n/** Group a national number for display: \"8031234567\" -> \"803 123 4567\". */\nexport const formatNationalNumber = (nationalNumber?: string | null): string => {\n const digits = digitsOnly(nationalNumber);\n if (digits.length <= 6) return digits;\n const tail = digits.slice(-4);\n const head = digits.slice(0, -4);\n const groups = head.match(/.{1,3}/g) || [];\n return [...groups, tail].join(\" \");\n};\n\n/** Build the full value object a consumer stores or submits. */\nexport const buildPhoneValue = (\n country: PhoneCountryType,\n nationalNumber?: string | null\n): PhoneNumberValueType => {\n const digits = digitsOnly(nationalNumber);\n const dialCode = country.dialCode;\n const isValid =\n digits.length >= MIN_NATIONAL_DIGITS &&\n digits.length <= maxNationalDigits(dialCode);\n\n return {\n phoneCode: `+${dialCode}`,\n dialCode,\n nationalNumber: digits,\n e164: digits ? `+${dialCode}${digits}` : \"\",\n formatted: digits\n ? `+${dialCode} ${formatNationalNumber(digits)}`\n : `+${dialCode}`,\n isoCode: country.isoCode,\n countryName: country.name,\n flag: country.flag,\n isValid,\n };\n};\n\n/**\n * Filter countries by name, ISO code or dial code, ranked so the most likely\n * match sorts first. \"ng\", \"nigeria\", \"234\" and \"+234\" all find Nigeria.\n */\nexport const searchCountries = (\n query?: string | null,\n countries: PhoneCountryType[] = PHONE_COUNTRIES\n): PhoneCountryType[] => {\n const term = String(query ?? \"\")\n .trim()\n .toLowerCase();\n if (!term) return countries;\n\n const digitTerm = digitsOnly(term);\n const ranked: Array<{ country: PhoneCountryType; score: number }> = [];\n\n countries.forEach((country) => {\n const name = country.name.toLowerCase();\n const iso = country.isoCode.toLowerCase();\n let score = -1;\n\n if (name === term) score = 0;\n else if (iso === term) score = 1;\n else if (name.startsWith(term)) score = 2;\n else if (digitTerm && country.dialCode === digitTerm) score = 3;\n else if (digitTerm && country.dialCode.startsWith(digitTerm)) score = 4;\n else if (name.includes(term)) score = 5;\n\n if (score >= 0) ranked.push({ country, score });\n });\n\n return ranked\n .sort(\n (a, b) =>\n a.score - b.score || a.country.name.localeCompare(b.country.name)\n )\n .map((entry) => entry.country);\n};\n\n/**\n * Move a set of ISO codes to the top of the list, preserving their given\n * order. Used for the `preferredCountries` prop.\n */\nexport const withPreferredCountries = (\n preferredIsoCodes?: string[] | null,\n countries: PhoneCountryType[] = PHONE_COUNTRIES\n): PhoneCountryType[] => {\n if (!preferredIsoCodes || preferredIsoCodes.length === 0) return countries;\n\n const preferred = preferredIsoCodes\n .map((iso) => findCountryByIso(iso))\n .filter((country): country is PhoneCountryType => Boolean(country));\n\n if (preferred.length === 0) return countries;\n\n const preferredIsoSet = new Set(preferred.map((country) => country.isoCode));\n return [\n ...preferred,\n ...countries.filter((country) => !preferredIsoSet.has(country.isoCode)),\n ];\n};\n"],"names":["AMBIGUOUS_DIAL_CODE_PREFERENCE","normalizeDialCode","phonecode","digits","String","split","replace","PHONE_COUNTRIES","countryObjects","map","country","_objectSpread","objectSpread2","dialCode","filter","length","sort","a","b","name","localeCompare","DIAL_CODES_LONGEST_FIRST","Array","from","Set","digitsOnly","value","maxNationalDigits","Math","max","findCountryByIso","isoCode","iso","trim","toUpperCase","find","findCountryByDialCode","preferIso","matches","preferred","undefined","fallbackIso","matchDialCode","_step","_iterator","_createForOfIteratorHelper","createForOfIteratorHelper","s","n","done","startsWith","nationalNumber","slice","matchedCountryCode","err","e","f","formatNationalNumber","tail","groups","match","concat","_toConsumableArray","join","isValid","phoneCode","e164","formatted","countryName","flag","raw","options","arguments","currentCountry","_options$aggressive","aggressive","text","hasPlus","hasIddPrefix","test","body","isPlausibleRemainder","remainder","currentDialCode","matched","byIso","byDialCode","lowered","toLowerCase","query","countries","term","digitTerm","ranked","forEach","score","includes","push","entry","preferredIsoCodes","Boolean","preferredIsoSet","has"],"mappings":"0KA4DMA,EAAyD,CAC7D,EAAK,KACL,EAAK,KACL,GAAM,KACN,GAAM,KACN,GAAM,KACN,GAAM,KACN,IAAO,KACP,IAAO,KACP,IAAO,KACP,IAAO,KACP,IAAO,KACP,IAAO,KACP,IAAO,KACP,IAAO,MAOIC,EAAoB,SAACC,GAChC,IAAKA,EAAW,MAAO,GACvB,IACMC,EADUC,OAAOF,GAAWG,MAAM,cAAc,GAC/BC,QAAQ,MAAO,IACtC,OAAOH,EAAOG,QAAQ,MAAO,KAAOH,CACtC,EAGaI,EAAuCC,EAAwB,QACzEC,IAAI,SAACC,GAAO,OAAAC,EAAAC,cAAAD,EAAAC,cAAA,CAAA,EACRF,GAAO,CAAA,EAAA,CACVG,SAAUZ,EAAkBS,EAAQR,YAAU,GAE/CY,OAAO,SAACJ,GAAO,OAAKA,EAAQG,SAASE,OAAS,CAAC,GAC/CC,KAAK,SAACC,EAAGC,GAAC,OAAKD,EAAEE,KAAKC,cAAcF,EAAEC,KAAK,GAGxCE,EAAqCC,MAAMC,KAC/C,IAAIC,IAAIjB,EAAgBE,IAAI,SAACC,GAAO,OAAKA,EAAQG,QAAQ,KACzDG,KAAK,SAACC,EAAGC,GAAC,OAAKA,EAAEH,OAASE,EAAEF,MAAM,GAGvBU,EAAa,SAACC,GAAqB,OAC9CtB,OAAOsB,QAAAA,EAAS,IAAIpB,QAAQ,MAAO,GAAG,EAG3BqB,EAAoB,SAACd,GAAwB,OACxDe,KAAKC,IA5D4B,EAHJ,KA+DoBhB,eAAAA,EAAUE,SAAU,GAAG,EAE7De,EAAmB,SAC9BC,GAEA,GAAKA,EAAL,CACA,IAAMC,EAAM5B,OAAO2B,GAASE,OAAOC,cACnC,OAAO3B,EAAgB4B,KAAK,SAACzB,GAAO,OAAKA,EAAQqB,UAAYC,GAF/B,CAGhC,EAMaI,EAAwB,SACnCvB,EACAwB,GAEA,IAAMC,EAAU/B,EAAgBO,OAC9B,SAACJ,GAAO,OAAKA,EAAQG,WAAaA,IAEpC,GAAuB,IAAnByB,EAAQvB,OAAZ,CACA,GAAuB,IAAnBuB,EAAQvB,OAAc,OAAOuB,EAAQ,GAEzC,IAAMC,EAAYF,EACdC,EAAQH,KAAK,SAACzB,GAAO,OAAKA,EAAQqB,UAAYM,EAAUH,aAAa,QACrEM,EACJ,GAAID,EAAW,OAAOA,EAEtB,IAAME,EAAczC,EAA+Ba,GAKnD,OAJiB4B,EACbH,EAAQH,KAAK,SAACzB,GAAO,OAAKA,EAAQqB,UAAYU,CAAW,QACzDD,IAEeF,EAAQ,EAbe,CAc5C,EA6BaI,EAAgB,SAC3BvC,EACAkC,GACgC,IACeM,EADfC,EAAAC,EAAAC,0BACTzB,GAAwB,IAA/C,IAAAuB,EAAAG,MAAAJ,EAAAC,EAAAI,KAAAC,MAAiD,CAAA,IAAtCpC,EAAQ8B,EAAAjB,MACjB,GAAKvB,EAAO+C,WAAWrC,GAAvB,CACA,IAAMH,EAAU0B,EAAsBvB,EAAUwB,GAChD,GAAK3B,EACL,MAAO,CACLA,QAAAA,EACAG,SAAAA,EACAsC,eAAgBhD,EAAOiD,MAAMvC,EAASE,QACtCsC,oBAAoB,EAPY,CASnC,CAAA,CAAA,MAAAC,GAAAV,EAAAW,EAAAD,EAAA,CAAA,QAAAV,EAAAY,GAAA,CACD,OAAO,IACT,EAiFaC,EAAuB,SAACN,GACnC,IAAMhD,EAASsB,EAAW0B,GAC1B,GAAIhD,EAAOY,QAAU,EAAG,OAAOZ,EAC/B,IAAMuD,EAAOvD,EAAOiD,OAAO,GAErBO,EADOxD,EAAOiD,MAAM,GAAI,GACVQ,MAAM,YAAc,GACxC,MAAO,GAAAC,OAAAC,EAAAA,kBAAIH,GAAQD,CAAAA,IAAMK,KAAK,IAChC,0BAvO+B,+BASI,+BANA,oDAuOJ,SAC7BrD,EACAyC,GAEA,IAAMhD,EAASsB,EAAW0B,GACpBtC,EAAWH,EAAQG,SACnBmD,EACJ7D,EAAOY,QA9OwB,GA+O/BZ,EAAOY,QAAUY,EAAkBd,GAErC,MAAO,CACLoD,UAASJ,IAAAA,OAAMhD,GACfA,SAAAA,EACAsC,eAAgBhD,EAChB+D,KAAM/D,EAAM,IAAA0D,OAAOhD,GAAQgD,OAAG1D,GAAW,GACzCgE,UAAWhE,EAAM,IAAA0D,OACThD,EAAQgD,KAAAA,OAAIJ,EAAqBtD,QAAO0D,OACxChD,GACRkB,QAASrB,EAAQqB,QACjBqC,YAAa1D,EAAQS,KACrBkD,KAAM3D,EAAQ2D,KACdL,QAAAA,EAEJ,0NAvGgC,SAC9BM,GAKyB,IAJzBC,EAAAC,UAAAzD,OAAA,QAAAyB,IAAAgC,UAAA,GAAAA,UAAA,GAGI,CAAA,EAEIC,EAAuCF,EAAvCE,eAAcC,EAAyBH,EAAvBI,WAAAA,OAAa,IAAHD,GAAQA,EACpCrC,EAAYoC,aAAAA,EAAAA,EAAgB1C,QAC5B6C,EAAOxE,OAAOkE,QAAAA,EAAO,IAAIrC,OACzB9B,EAASsB,EAAWmD,GAE1B,IAAKzE,EAAQ,MAAO,CAAEgD,eAAgB,GAAIE,oBAAoB,GAE9D,IAAMwB,EAAUD,EAAK1B,WAAW,KAC1B4B,GAAgBD,GAAW,WAAWE,KAAK5E,GAC3C6E,EAAOF,EAAe3E,EAAOG,QAAQ,MAAO,IAAMH,EAExD,GAAI0E,GAAWC,EACb,OACEpC,EAAcsC,EAAM3C,IAAc,CAChCc,eAAgB6B,EAChB3B,oBAAoB,GAM1B,GAAI2B,EAAK9B,WAAW,KAClB,MAAO,CACLC,eAAgB6B,EAAK1E,QAAQ,MAAO,IACpC+C,oBAAoB,GAIxB,GAAIsB,EAAY,CAId,IAAMM,EAAuB,SAACC,GAAiB,OAC7CA,EAAUnE,QA/LmB,GAgM7BmE,EAAUnE,QA1LmB,EA0LU,EAGnCoE,EAAkBV,aAAAA,EAAAA,EAAgB5D,SACxC,GAAIsE,GAAmBH,EAAK9B,WAAWiC,GAAkB,CACvD,IAAMD,EAAYF,EAAK5B,MAAM+B,EAAgBpE,QAC7C,GAAIkE,EAAqBC,GACvB,MAAO,CACLxE,QAAS+D,EACT5D,SAAUsE,EACVhC,eAAgB+B,EAChB7B,oBAAoB,EAGzB,CAGD,GAAI2B,EAAKjE,OA3MsB,GA2MQ,CACrC,IAAMqE,EAAU1C,EAAcsC,EAAM3C,GACpC,GAAI+C,GAAWH,EAAqBG,EAAQjC,gBAC1C,OAAOiC,CAEV,CACF,CAED,MAAO,CAAEjC,eAAgB6B,EAAM3B,oBAAoB,EACrD,yBArH8B,SAC5B3B,EACAW,GAEA,IAAMiC,EAAMlE,OAAOsB,QAAAA,EAAS,IAAIO,OAChC,GAAKqC,EAAL,CAEA,IAAMe,EAAQvD,EAAiBwC,GAC/B,GAAIe,EAAO,OAAOA,EAElB,IAAMxE,EAAWZ,EAAkBqE,GACnC,GAAIzD,EAAU,CACZ,IAAMyE,EAAalD,EAAsBvB,EAAUwB,GACnD,GAAIiD,EAAY,OAAOA,CACxB,CAED,IAAMC,EAAUjB,EAAIkB,cACpB,OAAOjF,EAAgB4B,KACrB,SAACzB,GAAO,OAAKA,EAAQS,KAAKqE,gBAAkBD,GAbpB,CAe5B,0BA2I+B,SAC7BE,GAEsB,IADtBC,EAAAlB,UAAAzD,OAAA,QAAAyB,IAAAgC,UAAA,GAAAA,UAAA,GAAgCjE,EAE1BoF,EAAOvF,OAAOqF,QAAAA,EAAS,IAC1BxD,OACAuD,cACH,IAAKG,EAAM,OAAOD,EAElB,IAAME,EAAYnE,EAAWkE,GACvBE,EAA8D,GAiBpE,OAfAH,EAAUI,QAAQ,SAACpF,GACjB,IAAMS,EAAOT,EAAQS,KAAKqE,cACpBxD,EAAMtB,EAAQqB,QAAQyD,cACxBO,GAAS,EAET5E,IAASwE,EAAMI,EAAQ,EAClB/D,IAAQ2D,EAAMI,EAAQ,EACtB5E,EAAK+B,WAAWyC,GAAOI,EAAQ,EAC/BH,GAAalF,EAAQG,WAAa+E,EAAWG,EAAQ,EACrDH,GAAalF,EAAQG,SAASqC,WAAW0C,GAAYG,EAAQ,EAC7D5E,EAAK6E,SAASL,KAAOI,EAAQ,GAElCA,GAAS,GAAGF,EAAOI,KAAK,CAAEvF,QAAAA,EAASqF,MAAAA,GACzC,GAEOF,EACJ7E,KACC,SAACC,EAAGC,GAAC,OACHD,EAAE8E,MAAQ7E,EAAE6E,OAAS9E,EAAEP,QAAQS,KAAKC,cAAcF,EAAER,QAAQS,KAAK,GAEpEV,IAAI,SAACyF,GAAK,OAAKA,EAAMxF,SAC1B,iCAMsC,SACpCyF,GAEsB,IADtBT,EAAAlB,UAAAzD,OAAA,QAAAyB,IAAAgC,UAAA,GAAAA,UAAA,GAAgCjE,EAEhC,IAAK4F,GAAkD,IAA7BA,EAAkBpF,OAAc,OAAO2E,EAEjE,IAAMnD,EAAY4D,EACf1F,IAAI,SAACuB,GAAG,OAAKF,EAAiBE,EAAI,GAClClB,OAAO,SAACJ,GAAO,OAAkC0F,QAAQ1F,KAE5D,GAAyB,IAArB6B,EAAUxB,OAAc,OAAO2E,EAEnC,IAAMW,EAAkB,IAAI7E,IAAIe,EAAU9B,IAAI,SAACC,GAAO,OAAKA,EAAQqB,OAAO,IAC1E,MAAA,GAAA8B,OAAAC,EAAAA,kBACKvB,GAASuB,EAAAA,kBACT4B,EAAU5E,OAAO,SAACJ,GAAO,OAAM2F,EAAgBC,IAAI5F,EAAQqB,QAAS,IAE3E"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),a=require("react"),l=require("../lib/helpFunction.js");require("../lib/utils.js");var r=require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),i=require("next/navigation");exports.default=function(s){var c,t,u=s.className,o=void 0===u?"":u,d=s.apiPath,h=void 0===d?"channels/instructor-channel/list/":d,m=i.useRouter(),v=i.usePathname(),p=i.useParams().channel||"",f=r.useSession().data,x=null==f?void 0:f.accessToken,_=null==f?void 0:f.channels,j=null==_?void 0:_.active,b=null==j?void 0:j.username,q=a.useState({}),N=e.slicedToArray(q,2),P=N[0],w=N[1],A=a.useState({result:[]}),T=e.slicedToArray(A,2),g=T[0],y=T[1];return a.useEffect(function(){if(x){var e="".concat(l.API_HOST_URL).concat(h),n=l.reqOptions("GET",null,x);l.fetchAPI(w,e,n,!0)}},[x]),a.useEffect(function(){var e=null==g?void 0:g.username;if(b&&e&&b===e){var n=window.location.origin,a=window.location.href.replace(n,"").replace(p,e);m.replace(a)}},[b,g,p,m,v]),a.useEffect(function(){(null==g?void 0:g.username)===p&&(window.location.reload(),y({}))},[p,g]),n.jsxs("div",{className:"".concat(o," commentator ihub-channel-list-avatar"),children:[n.jsxs("div",{className:"item nameTruce",children:[null!=j&&j.thumbnail?n.jsx("img",{src:j.thumbnail.split("?")[0],alt:j.name||"Channel thumbnail"}):n.jsx("p",{className:"char_avatar",children:(null==j||null===(c=j.name)||void 0===c?void 0:c.charAt(0))||"?"}),n.jsxs("div",{className:"name",children:[n.jsx("h3",{children:null==j?void 0:j.name}),n.jsxs("p",{children:["@",null==j?void 0:j.username]})]})]}),null==P||null===(t=P.results)||void 0===t?void 0:t.map(function(e,a){var l,r;return e.channel.username!==b&&n.jsxs("ul",{className:"item ff_layer",onClick:function(){return n=e.channel,a=v.replace(p,"".concat(n.username)),void m.push(a);var n,a},children:[null!==(l=e.channel)&&void 0!==l&&l.thumbnail?n.jsx("img",{src:e.channel.thumbnail.split("?")[0],alt:e.channel.name||"Channel thumbnail"}):n.jsx("p",{className:"char_avatar",children:(null===(r=e.channel.name)||void 0===r?void 0:r.charAt(0))||"?"}),n.jsxs("div",{className:"name",children:[n.jsx("h3",{children:e.channel.name}),n.jsxs("p",{children:["@",e.channel.username]})]})]},a)})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),n=require("react/jsx-runtime"),a=require("react"),l=require("../lib/helpFunction.js");require("../lib/utils.js"),require("../lib/phoneUtils.js");var r=require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),i=require("next/navigation");exports.default=function(s){var c,t,u=s.className,o=void 0===u?"":u,d=s.apiPath,h=void 0===d?"channels/instructor-channel/list/":d,m=i.useRouter(),v=i.usePathname(),p=i.useParams().channel||"",f=r.useSession().data,j=null==f?void 0:f.accessToken,x=null==f?void 0:f.channels,_=null==x?void 0:x.active,b=null==_?void 0:_.username,q=a.useState({}),N=e.slicedToArray(q,2),P=N[0],w=N[1],A=a.useState({result:[]}),T=e.slicedToArray(A,2),g=T[0],y=T[1];return a.useEffect(function(){if(j){var e="".concat(l.API_HOST_URL).concat(h),n=l.reqOptions("GET",null,j);l.fetchAPI(w,e,n,!0)}},[j]),a.useEffect(function(){var e=null==g?void 0:g.username;if(b&&e&&b===e){var n=window.location.origin,a=window.location.href.replace(n,"").replace(p,e);m.replace(a)}},[b,g,p,m,v]),a.useEffect(function(){(null==g?void 0:g.username)===p&&(window.location.reload(),y({}))},[p,g]),n.jsxs("div",{className:"".concat(o," commentator ihub-channel-list-avatar"),children:[n.jsxs("div",{className:"item nameTruce",children:[null!=_&&_.thumbnail?n.jsx("img",{src:_.thumbnail.split("?")[0],alt:_.name||"Channel thumbnail"}):n.jsx("p",{className:"char_avatar",children:(null==_||null===(c=_.name)||void 0===c?void 0:c.charAt(0))||"?"}),n.jsxs("div",{className:"name",children:[n.jsx("h3",{children:null==_?void 0:_.name}),n.jsxs("p",{children:["@",null==_?void 0:_.username]})]})]}),null==P||null===(t=P.results)||void 0===t?void 0:t.map(function(e,a){var l,r;return e.channel.username!==b&&n.jsxs("ul",{className:"item ff_layer",onClick:function(){return n=e.channel,a=v.replace(p,"".concat(n.username)),void m.push(a);var n,a},children:[null!==(l=e.channel)&&void 0!==l&&l.thumbnail?n.jsx("img",{src:e.channel.thumbnail.split("?")[0],alt:e.channel.name||"Channel thumbnail"}):n.jsx("p",{className:"char_avatar",children:(null===(r=e.channel.name)||void 0===r?void 0:r.charAt(0))||"?"}),n.jsxs("div",{className:"name",children:[n.jsx("h3",{children:e.channel.name}),n.jsxs("p",{children:["@",e.channel.username]})]})]},a)})]})};
2
2
  //# sourceMappingURL=ChannelListAvatar.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),i=require("react/jsx-runtime"),n=require("react"),s=require("next/link"),a=require("next/image"),r=require("@mui/icons-material/ChevronLeft"),t=require("@mui/icons-material/ChevronRight"),c=require("../auth/ClientOnly.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../lib/helpFunction.js"),require("@mui/icons-material/Visibility"),require("@mui/icons-material/VisibilityOff"),require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),require("next/navigation"),require("../lib/utils.js"),require("../ui/OrDivider.js"),require("../forms/SubmitButton.js"),require("react-redux"),require("../lib/redux/store.js"),require("../lib/redux/slices/courseSlice/courseFilterSubject.js"),require("../lib/redux/slices/courseSlice/courseFilterLevel.js"),require("../lib/redux/slices/courseSlice/courseFilterDuration.js"),require("../lib/redux/slices/courseSlice/courseSearch.js"),require("../lib/redux/slices/courseSlice/stepQuestions.js"),require("../lib/redux/slices/courseSlice/stepContent.js"),require("../lib/redux/slices/courseSlice/courseDetails.js"),require("../lib/redux/slices/courseSlice/videoTimestamp.js"),require("../lib/redux/slices/courseSlice/videoEndCountdown.js"),require("../lib/redux/slices/courseSlice/videoTimestampObject.js"),require("../lib/redux/slices/courseSlice/courseModules.js"),require("../lib/redux/slices/courseSlice/courseOverview.js"),require("../lib/redux/slices/courseSlice/selectedCourses.js"),require("../lib/redux/slices/navigationSlice/appToggle.js"),require("../lib/redux/slices/navigationSlice/toggleCreateCourse.js"),require("../lib/redux/slices/navigationSlice/toggleCreateCohort.js"),require("../lib/redux/slices/navigationSlice/confirmDelete.js"),require("../lib/redux/slices/navigationSlice/IPAdress.js"),require("../lib/redux/slices/navigationSlice/settingsToggle.js"),require("../lib/redux/slices/navigationSlice/userLocation.js"),require("../lib/redux/slices/navigationSlice/searchValue.js"),require("../lib/redux/slices/navigationSlice/currentPromo.js"),require("../lib/redux/slices/navigationSlice/courseNextStep.js"),require("../lib/redux/slices/channelSlice/activeChannel.js"),require("../lib/redux/slices/channelSlice/channelDetails.js"),require("../lib/redux/slices/channelSlice/instructorChannelList.js"),require("../lib/redux/slices/channelSlice/channelHandle.js"),require("../lib/redux/slices/generics/objectSlice.js"),require("../lib/redux/slices/generics/arraySlice.js"),require("../lib/redux/slices/messageSlice/feedbackToggle.js"),require("../lib/redux/slices/messageSlice/statusMessageState.js"),require("../lib/redux/slices/utilsSlice/screenSize.js"),require("../lib/redux/slices/authSlice/channelCallbackUrl.js"),require("../lib/redux/slices/authSlice/unsplashObject.js"),require("@mui/icons-material/DoneOutlined"),require("@mui/icons-material/ContentCopyOutlined"),require("../status/MultiPurposeModal.js");var u=l(n),d=l(s),o=l(a),h=l(r),v=l(t);exports.default=function(s){var a,r=s.items,t=s.defaultExpanded,l=void 0===t||t,b=s.isExpanded,f=s.onExpandedChange,m=s.position,x=void 0===m?"left":m,j=s.variant,p=void 0===j?"default":j,g=s.expandedWidth,S=void 0===g?240:g,q=s.collapsedWidth,N=void 0===q?64:q,w=s.animation,y=void 0===w?"slide":w,C=s.logo,k=s.footer,E=s.className,D=void 0===E?"":E,A=s.darkMode,_=void 0!==A&&A,T=s.positioning,L=s.resizable,M=void 0!==L&&L,z=s.maxWidth,O=void 0===z?400:z,F=s.minWidth,I=void 0===F?180:F,W=s.onNavigate,B=s.autoCollapseOnMobile,P=void 0===B||B,U=s.showBackdrop,K=void 0===U||U,R=s.onBackdropClick,X=s.enableTouchGestures,H=void 0===X||X,V=s.persistState,G=void 0===V||V,Q=s.persistStateKey,J=void 0===Q?"ihub-sidenav-expanded":Q,Y=s.lazyRender,Z=void 0!==Y&&Y,$=s.renderItem,ee=s.tooltip,ie=s.toggleShortcut,ne=s.contentContainerClassName,se=void 0===ne?"":ne,ae=s.children,re=void 0!==b,te=n.useState(l),ce=e.slicedToArray(te,2),le=ce[0],ue=ce[1];n.useEffect(function(){if(re)ue(b);else if(G&&"undefined"!=typeof window){var e=localStorage.getItem(J);null!==e&&ue("true"===e)}},[re,b,G,J]),n.useEffect(function(){re&&ue(b)},[re,b]);var de=function(){return re?b:le},oe=function(e){re||(ue(e),G&&"undefined"!=typeof window&&localStorage.setItem(J,String(e))),null==f||f(e)},he=function(){return oe(!de())},ve=n.useState(null),be=e.slicedToArray(ve,2),fe=be[0],me=be[1],xe=n.useState(new Set),je=e.slicedToArray(xe,2),pe=je[0],ge=je[1];n.useEffect(function(){var e=new Set,i=function(n){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.forEach(function(n){if("group"===n.type){var a=n;(a.defaultExpanded||s||a.children.some(function(e){return"isActive"in e&&e.isActive||"group"===e.type&&e.defaultExpanded}))&&(e.add(n.id),i(a.children,!0))}})};i(r),ge(e)},[r]),n.useEffect(function(){var i=function(n){var s,a=e.createForOfIteratorHelper(n);try{var r,t=function(){var n=s.value;if("isActive"in n&&n.isActive)return{v:n.id};if("group"===n.type){var a=i(n.children);if(a)return ge(function(i){return new Set([].concat(e.toConsumableArray(i),[n.id]))}),{v:a}}};for(a.s();!(s=a.n()).done;)if(r=t())return r.v}catch(e){a.e(e)}finally{a.f()}return null},n=i(r);n&&me(n)},[r]);var Se=n.useCallback(function(e,i){"button"===e.type&&e.onClick(i),me(e.id),null==W||W(e,i),P&&window.innerWidth<=768&&oe(!1)},[W,P,oe]),qe=n.useState(!1),Ne=e.slicedToArray(qe,2),we=Ne[0],ye=Ne[1];n.useEffect(function(){var e=function(){ye(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),n.useEffect(function(){if(ie){var e=function(e){var i=ie.toLowerCase().split("+"),n=i.filter(function(e){return["ctrl","alt","shift","meta"].includes(e)}),s=i.find(function(e){return!["ctrl","alt","shift","meta"].includes(e)});s&&(e.key||"").toLowerCase()===s&&n.every(function(i){switch(i){case"ctrl":return e.ctrlKey;case"alt":return e.altKey;case"shift":return e.shiftKey;case"meta":return e.metaKey;default:return!1}})&&(e.preventDefault(),he())};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}},[ie,he]);var Ce=n.useState(de()?S:N),ke=e.slicedToArray(Ce,2),Ee=ke[0],De=ke[1],Ae=n.useRef(!1),_e=n.useRef(null);n.useEffect(function(){De(de()?S:N)},[de,S,N]);var Te=n.useRef(null),Le=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if($)return $(e,i);switch(e.type){case"link":return Me(e,i);case"group":return ze(e,i);case"button":return Oe(e,i);case"divider":return Fe(e);default:return null}},Me=function(e,n){if(e.hasAccess&&!e.hasAccess())return null;var s=e.id===fe,a=n>0?"ihub-sidenav-indent-".concat(n):"",r=i.jsxs(i.Fragment,{children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content})]});return e.isExternal?i.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"ihub-sidenav-item ihub-sidenav-link ".concat(a," ").concat(s?"ihub-sidenav-active":""," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,children:r}):i.jsx(d.default,{href:e.href,className:"ihub-sidenav-item ihub-sidenav-link ".concat(a," ").concat(e.isActive&&0===n?"ihub-sidenav-active":e.isActive?"ihub-sidenav-child-active":""," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,children:r})},ze=function(e,n){var s=pe.has(e.id),a=e.children.some(function(e){return e.id===fe||"group"===e.type&&e.children.some(function(e){return e.id===fe})}),r=n>0?"ihub-sidenav-indent-".concat(n):"";return e.hideGroupTitle?i.jsx("div",{className:"ihub-sidenav-group ".concat(e.className||""),children:e.children.map(function(e,s){return i.jsx(u.default.Fragment,{children:Le(e,n)},e.id||"group-child-".concat(s))})}):i.jsxs("div",{className:"ihub-sidenav-group ".concat(e.className||""," ").concat(a?"ihub-sidenav-group-active":""),children:[i.jsxs("div",{className:"ihub-sidenav-item ihub-sidenav-group-header ".concat(e.isActive?"ihub-sidenav-active":""," ").concat(r," ").concat(e.isDisabled?"ihub-sidenav-disabled":""),onClick:function(){return!e.isDisabled&&(i=e.id,void ge(function(e){var n=new Set(e);return n.has(i)?n.delete(i):n.add(i),n}));var i},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,"aria-expanded":s,children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content}),i.jsx("span",{className:"ihub-sidenav-arrow ".concat(s?"ihub-sidenav-arrow-expanded":""," ").concat(de()?"":"ihub-sidenav-arrow-hidden")})]}),(s||!de())&&i.jsx("div",{className:"ihub-sidenav-group-items ".concat(s?"ihub-sidenav-group-expanded":""," ").concat(de()?"":"ihub-sidenav-group-collapsed"),children:(!Z||s||!de())&&e.children.map(function(e,s){return i.jsx(u.default.Fragment,{children:Le(e,n+1)},e.id||"group-child-".concat(s))})})]})},Oe=function(e,n){var s=n>0?"ihub-sidenav-indent-".concat(n):"";return i.jsxs("button",{className:"ihub-sidenav-item ihub-sidenav-button ".concat(s," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,disabled:e.isDisabled,children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content})]})},Fe=function(e,n){return i.jsx("div",{className:"ihub-sidenav-divider",children:e.title&&de()&&i.jsx("span",{className:"ihub-sidenav-divider-text",children:e.title})})},Ie=["ihub-sidenav","ihub-sidenav-".concat(x),"ihub-sidenav-".concat(p),de()?"ihub-sidenav-expanded":"ihub-sidenav-collapsed",_?"ihub-sidenav-dark":"",M&&de()?"ihub-sidenav-resizable":"",we?"ihub-sidenav-mobile":"","none"!==y?"ihub-sidenav-".concat(y):"",D].filter(Boolean).join(" "),We=e.objectSpread2(e.objectSpread2(e.objectSpread2({width:"number"==typeof Ee?"".concat(Ee,"px"):Ee},null!=T&&T.fixed?{position:"fixed"}:{}),void 0!==(null==T?void 0:T.top)?{top:T.top}:{}),void 0!==(null==T?void 0:T.zIndex)?{zIndex:T.zIndex}:{}),Be=["ihub-sidenav-container","ihub-sidenav-container-".concat(x),de()?"ihub-sidenav-container-expanded":"ihub-sidenav-container-collapsed",se].filter(Boolean).join(" "),Pe={"--ihub-sidenav-width":"number"==typeof Ee?"".concat(Ee,"px"):Ee};return i.jsxs("div",{className:Be,style:Pe,children:[we&&de()&&K&&i.jsx("div",{className:"ihub-sidenav-backdrop",onClick:function(){oe(!1),null==R||R()}}),i.jsxs("div",{ref:_e,className:Ie,style:We,onTouchStart:function(e){H&&we&&(Te.current=e.touches[0].clientX)},onTouchMove:function(e){if(H&&we&&null!==Te.current){var i=e.touches[0].clientX-Te.current;Math.abs(i)>=50&&(oe("left"===x&&i>0||"right"===x&&i<0),Te.current=null)}},onTouchEnd:function(){Te.current=null},children:[i.jsx("button",{className:"ihub-sidenav-toggle",onClick:he,"aria-expanded":de(),"aria-label":de()?"Collapse sidebar":"Expand sidebar",children:"left"===x?de()?i.jsx(h.default,{}):i.jsx(v.default,{className:"ihub-ml-2"}):de()?i.jsx(v.default,{}):i.jsx(h.default,{className:"ihub-mr-2"})}),(null==C?void 0:C.href)&&i.jsx("div",{className:"ihub-sidenav-logo",children:i.jsx(d.default,{href:C.href||"",children:de()||!C.src?i.jsx(o.default,{src:C.src,alt:C.alt,width:C.width||120,height:C.height||40}):C.miniSrc&&i.jsx(o.default,{src:C.miniSrc,alt:C.alt,width:C.height||40,height:C.height||40})})}),M&&de()&&i.jsx("div",{className:"ihub-sidenav-resize-handle ihub-sidenav-resize-handle-".concat(x),onMouseDown:function(e){if(M&&de()){e.preventDefault(),Ae.current=!0;var i=function(e){var i;Ae.current&&(i="left"===x?e.clientX:window.innerWidth-e.clientX,i=Math.max(Number(I),Math.min(Number(O),i)),De(i))},n=function(){Ae.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)}}}),i.jsx("div",{className:"ihub-sidenav-content ihub-scrollbar-thin-light ".concat(null!=C&&C.href?"":"ihub-mt-2"),children:i.jsx("nav",{className:"ihub-sidenav-nav",children:r.map(function(e,n){return i.jsx(u.default.Fragment,{children:Le(e)},e.id||"nav-item-".concat(n))})})}),k&&i.jsxs("div",{className:"ihub-sidenav-footer",children:[i.jsx(c.default,{fallback:i.jsxs("div",{className:"ihub-sidenav-user",children:[i.jsx("div",{className:"ihub-sidenav-user-initials",children:"U"}),i.jsx("div",{className:"ihub-sidenav-user-info",children:i.jsx("div",{className:"ihub-sidenav-user-name",children:"User"})})]}),children:k.showUserProfile&&k.user&&de()&&i.jsxs("div",{className:"ihub-sidenav-user",children:[k.user.avatar?i.jsx(o.default,{src:"".concat(k.user.avatar),alt:k.user.name||"User",width:40,height:40,className:"ihub-sidenav-user-avatar"}):i.jsx("div",{className:"ihub-sidenav-user-initials",children:(null===(a=k.user.name)||void 0===a?void 0:a.charAt(0))||"U"}),i.jsxs("div",{className:"ihub-sidenav-user-info",children:[k.user.name&&i.jsx("div",{className:"ihub-sidenav-user-name",children:k.user.name}),k.user.role&&i.jsx("div",{className:"ihub-sidenav-user-role",children:k.user.role})]})]})}),k.actions&&i.jsx("div",{className:"ihub-sidenav-footer-actions",children:k.actions.map(function(e,n){return i.jsx(u.default.Fragment,{children:Oe(e,0)},e.id||"footer-action-".concat(n))})}),k.content&&i.jsx("div",{className:"ihub-sidenav-footer-content",children:de()?k.content:null})]})]}),i.jsx("div",{className:"ihub-sidenav-main",children:ae})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),i=require("react/jsx-runtime"),n=require("react"),s=require("next/link"),a=require("next/image"),r=require("@mui/icons-material/ChevronLeft"),t=require("@mui/icons-material/ChevronRight"),c=require("../auth/ClientOnly.js");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("../lib/helpFunction.js"),require("@mui/icons-material/Visibility"),require("@mui/icons-material/VisibilityOff"),require("../../../node_modules/.pnpm/next-auth@5.0.0-beta.30_next@15.5.6_@babel_core@7.28.5_react-dom@19.2.0_react@19.2.0__react@19.2.0__react@19.2.0/node_modules/next-auth/react.js"),require("next/navigation"),require("../lib/utils.js"),require("../lib/phoneUtils.js"),require("../ui/OrDivider.js"),require("../forms/SubmitButton.js"),require("react-redux"),require("../lib/redux/store.js"),require("../lib/redux/slices/courseSlice/courseFilterSubject.js"),require("../lib/redux/slices/courseSlice/courseFilterLevel.js"),require("../lib/redux/slices/courseSlice/courseFilterDuration.js"),require("../lib/redux/slices/courseSlice/courseSearch.js"),require("../lib/redux/slices/courseSlice/stepQuestions.js"),require("../lib/redux/slices/courseSlice/stepContent.js"),require("../lib/redux/slices/courseSlice/courseDetails.js"),require("../lib/redux/slices/courseSlice/videoTimestamp.js"),require("../lib/redux/slices/courseSlice/videoEndCountdown.js"),require("../lib/redux/slices/courseSlice/videoTimestampObject.js"),require("../lib/redux/slices/courseSlice/courseModules.js"),require("../lib/redux/slices/courseSlice/courseOverview.js"),require("../lib/redux/slices/courseSlice/selectedCourses.js"),require("../lib/redux/slices/navigationSlice/appToggle.js"),require("../lib/redux/slices/navigationSlice/toggleCreateCourse.js"),require("../lib/redux/slices/navigationSlice/toggleCreateCohort.js"),require("../lib/redux/slices/navigationSlice/confirmDelete.js"),require("../lib/redux/slices/navigationSlice/IPAdress.js"),require("../lib/redux/slices/navigationSlice/settingsToggle.js"),require("../lib/redux/slices/navigationSlice/userLocation.js"),require("../lib/redux/slices/navigationSlice/searchValue.js"),require("../lib/redux/slices/navigationSlice/currentPromo.js"),require("../lib/redux/slices/navigationSlice/courseNextStep.js"),require("../lib/redux/slices/channelSlice/activeChannel.js"),require("../lib/redux/slices/channelSlice/channelDetails.js"),require("../lib/redux/slices/channelSlice/instructorChannelList.js"),require("../lib/redux/slices/channelSlice/channelHandle.js"),require("../lib/redux/slices/generics/objectSlice.js"),require("../lib/redux/slices/generics/arraySlice.js"),require("../lib/redux/slices/messageSlice/feedbackToggle.js"),require("../lib/redux/slices/messageSlice/statusMessageState.js"),require("../lib/redux/slices/utilsSlice/screenSize.js"),require("../lib/redux/slices/authSlice/channelCallbackUrl.js"),require("../lib/redux/slices/authSlice/unsplashObject.js"),require("@mui/icons-material/DoneOutlined"),require("@mui/icons-material/ContentCopyOutlined"),require("../status/MultiPurposeModal.js");var u=l(n),d=l(s),o=l(a),h=l(r),v=l(t);exports.default=function(s){var a,r=s.items,t=s.defaultExpanded,l=void 0===t||t,b=s.isExpanded,f=s.onExpandedChange,m=s.position,x=void 0===m?"left":m,j=s.variant,p=void 0===j?"default":j,g=s.expandedWidth,S=void 0===g?240:g,q=s.collapsedWidth,N=void 0===q?64:q,w=s.animation,y=void 0===w?"slide":w,C=s.logo,k=s.footer,E=s.className,D=void 0===E?"":E,A=s.darkMode,_=void 0!==A&&A,T=s.positioning,L=s.resizable,M=void 0!==L&&L,z=s.maxWidth,O=void 0===z?400:z,F=s.minWidth,I=void 0===F?180:F,U=s.onNavigate,W=s.autoCollapseOnMobile,B=void 0===W||W,P=s.showBackdrop,K=void 0===P||P,R=s.onBackdropClick,X=s.enableTouchGestures,H=void 0===X||X,V=s.persistState,G=void 0===V||V,Q=s.persistStateKey,J=void 0===Q?"ihub-sidenav-expanded":Q,Y=s.lazyRender,Z=void 0!==Y&&Y,$=s.renderItem,ee=s.tooltip,ie=s.toggleShortcut,ne=s.contentContainerClassName,se=void 0===ne?"":ne,ae=s.children,re=void 0!==b,te=n.useState(l),ce=e.slicedToArray(te,2),le=ce[0],ue=ce[1];n.useEffect(function(){if(re)ue(b);else if(G&&"undefined"!=typeof window){var e=localStorage.getItem(J);null!==e&&ue("true"===e)}},[re,b,G,J]),n.useEffect(function(){re&&ue(b)},[re,b]);var de=function(){return re?b:le},oe=function(e){re||(ue(e),G&&"undefined"!=typeof window&&localStorage.setItem(J,String(e))),null==f||f(e)},he=function(){return oe(!de())},ve=n.useState(null),be=e.slicedToArray(ve,2),fe=be[0],me=be[1],xe=n.useState(new Set),je=e.slicedToArray(xe,2),pe=je[0],ge=je[1];n.useEffect(function(){var e=new Set,i=function(n){var s=arguments.length>1&&void 0!==arguments[1]&&arguments[1];n.forEach(function(n){if("group"===n.type){var a=n;(a.defaultExpanded||s||a.children.some(function(e){return"isActive"in e&&e.isActive||"group"===e.type&&e.defaultExpanded}))&&(e.add(n.id),i(a.children,!0))}})};i(r),ge(e)},[r]),n.useEffect(function(){var i=function(n){var s,a=e.createForOfIteratorHelper(n);try{var r,t=function(){var n=s.value;if("isActive"in n&&n.isActive)return{v:n.id};if("group"===n.type){var a=i(n.children);if(a)return ge(function(i){return new Set([].concat(e.toConsumableArray(i),[n.id]))}),{v:a}}};for(a.s();!(s=a.n()).done;)if(r=t())return r.v}catch(e){a.e(e)}finally{a.f()}return null},n=i(r);n&&me(n)},[r]);var Se=n.useCallback(function(e,i){"button"===e.type&&e.onClick(i),me(e.id),null==U||U(e,i),B&&window.innerWidth<=768&&oe(!1)},[U,B,oe]),qe=n.useState(!1),Ne=e.slicedToArray(qe,2),we=Ne[0],ye=Ne[1];n.useEffect(function(){var e=function(){ye(window.innerWidth<=768)};return e(),window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}},[]),n.useEffect(function(){if(ie){var e=function(e){var i=ie.toLowerCase().split("+"),n=i.filter(function(e){return["ctrl","alt","shift","meta"].includes(e)}),s=i.find(function(e){return!["ctrl","alt","shift","meta"].includes(e)});s&&(e.key||"").toLowerCase()===s&&n.every(function(i){switch(i){case"ctrl":return e.ctrlKey;case"alt":return e.altKey;case"shift":return e.shiftKey;case"meta":return e.metaKey;default:return!1}})&&(e.preventDefault(),he())};return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}}},[ie,he]);var Ce=n.useState(de()?S:N),ke=e.slicedToArray(Ce,2),Ee=ke[0],De=ke[1],Ae=n.useRef(!1),_e=n.useRef(null);n.useEffect(function(){De(de()?S:N)},[de,S,N]);var Te=n.useRef(null),Le=function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if($)return $(e,i);switch(e.type){case"link":return Me(e,i);case"group":return ze(e,i);case"button":return Oe(e,i);case"divider":return Fe(e);default:return null}},Me=function(e,n){if(e.hasAccess&&!e.hasAccess())return null;var s=e.id===fe,a=n>0?"ihub-sidenav-indent-".concat(n):"",r=i.jsxs(i.Fragment,{children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content})]});return e.isExternal?i.jsx("a",{href:e.href,target:"_blank",rel:"noopener noreferrer",className:"ihub-sidenav-item ihub-sidenav-link ".concat(a," ").concat(s?"ihub-sidenav-active":""," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,children:r}):i.jsx(d.default,{href:e.href,className:"ihub-sidenav-item ihub-sidenav-link ".concat(a," ").concat(e.isActive&&0===n?"ihub-sidenav-active":e.isActive?"ihub-sidenav-child-active":""," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,children:r})},ze=function(e,n){var s=pe.has(e.id),a=e.children.some(function(e){return e.id===fe||"group"===e.type&&e.children.some(function(e){return e.id===fe})}),r=n>0?"ihub-sidenav-indent-".concat(n):"";return e.hideGroupTitle?i.jsx("div",{className:"ihub-sidenav-group ".concat(e.className||""),children:e.children.map(function(e,s){return i.jsx(u.default.Fragment,{children:Le(e,n)},e.id||"group-child-".concat(s))})}):i.jsxs("div",{className:"ihub-sidenav-group ".concat(e.className||""," ").concat(a?"ihub-sidenav-group-active":""),children:[i.jsxs("div",{className:"ihub-sidenav-item ihub-sidenav-group-header ".concat(e.isActive?"ihub-sidenav-active":""," ").concat(r," ").concat(e.isDisabled?"ihub-sidenav-disabled":""),onClick:function(){return!e.isDisabled&&(i=e.id,void ge(function(e){var n=new Set(e);return n.has(i)?n.delete(i):n.add(i),n}));var i},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,"aria-disabled":e.isDisabled,"aria-expanded":s,children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content}),i.jsx("span",{className:"ihub-sidenav-arrow ".concat(s?"ihub-sidenav-arrow-expanded":""," ").concat(de()?"":"ihub-sidenav-arrow-hidden")})]}),(s||!de())&&i.jsx("div",{className:"ihub-sidenav-group-items ".concat(s?"ihub-sidenav-group-expanded":""," ").concat(de()?"":"ihub-sidenav-group-collapsed"),children:(!Z||s||!de())&&e.children.map(function(e,s){return i.jsx(u.default.Fragment,{children:Le(e,n+1)},e.id||"group-child-".concat(s))})})]})},Oe=function(e,n){var s=n>0?"ihub-sidenav-indent-".concat(n):"";return i.jsxs("button",{className:"ihub-sidenav-item ihub-sidenav-button ".concat(s," ").concat(e.isDisabled?"ihub-sidenav-disabled":""," ").concat(e.className||""),onClick:function(i){return!e.isDisabled&&Se(e,i)},"data-tooltip":!de()&&null!=ee&&ee.enabled?e.title:void 0,disabled:e.isDisabled,children:[e.icon&&i.jsx("span",{className:"ihub-sidenav-icon",children:"string"==typeof e.icon?i.jsx(o.default,{src:e.icon,alt:"",width:24,height:24}):e.icon}),i.jsx("span",{className:"ihub-sidenav-text ".concat(de()?"":"ihub-sidenav-text-hidden"),children:e.title}),e.badge&&i.jsx("span",{className:"ihub-sidenav-badge ihub-sidenav-badge-".concat(e.badge.variant||"default"),children:e.badge.content})]})},Fe=function(e,n){return i.jsx("div",{className:"ihub-sidenav-divider",children:e.title&&de()&&i.jsx("span",{className:"ihub-sidenav-divider-text",children:e.title})})},Ie=["ihub-sidenav","ihub-sidenav-".concat(x),"ihub-sidenav-".concat(p),de()?"ihub-sidenav-expanded":"ihub-sidenav-collapsed",_?"ihub-sidenav-dark":"",M&&de()?"ihub-sidenav-resizable":"",we?"ihub-sidenav-mobile":"","none"!==y?"ihub-sidenav-".concat(y):"",D].filter(Boolean).join(" "),Ue=e.objectSpread2(e.objectSpread2(e.objectSpread2({width:"number"==typeof Ee?"".concat(Ee,"px"):Ee},null!=T&&T.fixed?{position:"fixed"}:{}),void 0!==(null==T?void 0:T.top)?{top:T.top}:{}),void 0!==(null==T?void 0:T.zIndex)?{zIndex:T.zIndex}:{}),We=["ihub-sidenav-container","ihub-sidenav-container-".concat(x),de()?"ihub-sidenav-container-expanded":"ihub-sidenav-container-collapsed",se].filter(Boolean).join(" "),Be={"--ihub-sidenav-width":"number"==typeof Ee?"".concat(Ee,"px"):Ee};return i.jsxs("div",{className:We,style:Be,children:[we&&de()&&K&&i.jsx("div",{className:"ihub-sidenav-backdrop",onClick:function(){oe(!1),null==R||R()}}),i.jsxs("div",{ref:_e,className:Ie,style:Ue,onTouchStart:function(e){H&&we&&(Te.current=e.touches[0].clientX)},onTouchMove:function(e){if(H&&we&&null!==Te.current){var i=e.touches[0].clientX-Te.current;Math.abs(i)>=50&&(oe("left"===x&&i>0||"right"===x&&i<0),Te.current=null)}},onTouchEnd:function(){Te.current=null},children:[i.jsx("button",{className:"ihub-sidenav-toggle",onClick:he,"aria-expanded":de(),"aria-label":de()?"Collapse sidebar":"Expand sidebar",children:"left"===x?de()?i.jsx(h.default,{}):i.jsx(v.default,{className:"ihub-ml-2"}):de()?i.jsx(v.default,{}):i.jsx(h.default,{className:"ihub-mr-2"})}),(null==C?void 0:C.href)&&i.jsx("div",{className:"ihub-sidenav-logo",children:i.jsx(d.default,{href:C.href||"",children:de()||!C.src?i.jsx(o.default,{src:C.src,alt:C.alt,width:C.width||120,height:C.height||40}):C.miniSrc&&i.jsx(o.default,{src:C.miniSrc,alt:C.alt,width:C.height||40,height:C.height||40})})}),M&&de()&&i.jsx("div",{className:"ihub-sidenav-resize-handle ihub-sidenav-resize-handle-".concat(x),onMouseDown:function(e){if(M&&de()){e.preventDefault(),Ae.current=!0;var i=function(e){var i;Ae.current&&(i="left"===x?e.clientX:window.innerWidth-e.clientX,i=Math.max(Number(I),Math.min(Number(O),i)),De(i))},n=function(){Ae.current=!1,document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",n)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",n)}}}),i.jsx("div",{className:"ihub-sidenav-content ihub-scrollbar-thin-light ".concat(null!=C&&C.href?"":"ihub-mt-2"),children:i.jsx("nav",{className:"ihub-sidenav-nav",children:r.map(function(e,n){return i.jsx(u.default.Fragment,{children:Le(e)},e.id||"nav-item-".concat(n))})})}),k&&i.jsxs("div",{className:"ihub-sidenav-footer",children:[i.jsx(c.default,{fallback:i.jsxs("div",{className:"ihub-sidenav-user",children:[i.jsx("div",{className:"ihub-sidenav-user-initials",children:"U"}),i.jsx("div",{className:"ihub-sidenav-user-info",children:i.jsx("div",{className:"ihub-sidenav-user-name",children:"User"})})]}),children:k.showUserProfile&&k.user&&de()&&i.jsxs("div",{className:"ihub-sidenav-user",children:[k.user.avatar?i.jsx(o.default,{src:"".concat(k.user.avatar),alt:k.user.name||"User",width:40,height:40,className:"ihub-sidenav-user-avatar"}):i.jsx("div",{className:"ihub-sidenav-user-initials",children:(null===(a=k.user.name)||void 0===a?void 0:a.charAt(0))||"U"}),i.jsxs("div",{className:"ihub-sidenav-user-info",children:[k.user.name&&i.jsx("div",{className:"ihub-sidenav-user-name",children:k.user.name}),k.user.role&&i.jsx("div",{className:"ihub-sidenav-user-role",children:k.user.role})]})]})}),k.actions&&i.jsx("div",{className:"ihub-sidenav-footer-actions",children:k.actions.map(function(e,n){return i.jsx(u.default.Fragment,{children:Oe(e,0)},e.id||"footer-action-".concat(n))})}),k.content&&i.jsx("div",{className:"ihub-sidenav-footer-content",children:de()?k.content:null})]})]}),i.jsx("div",{className:"ihub-sidenav-main",children:ae})]})};
2
2
  //# sourceMappingURL=SideNavbar.js.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),i=require("react/jsx-runtime"),t=require("react"),n=require("./MultiPurposeModal.js"),l=require("../forms/SubmitButton.js");require("../lib/helpFunction.js");var s=require("../lib/modals/modals.js");require("../lib/utils.js");var a=require("../forms/InputText.js");exports.default=function(){var r=t.useState(!1),o=e.slicedToArray(r,2),u=o[0],c=o[1],d=t.useState(!1),m=e.slicedToArray(d,2),h=m[0],b=m[1],x=t.useState(!1),j=e.slicedToArray(x,2),f=j[0],p=j[1],v=t.useState(!1),C=e.slicedToArray(v,2),N=C[0],y=C[1],S=t.useState(!1),F=e.slicedToArray(S,2),g=F[0],k=F[1],q=t.useState(1),M=e.slicedToArray(q,2),O=M[0];M[1];var T=t.useState({name:"",email:""}),w=e.slicedToArray(T,2),A=w[0],z=w[1],B=function(i){var t=i.target,n=t.name,l=t.value;z(function(i){return e.objectSpread2(e.objectSpread2({},i),{},e.defineProperty({},n,l))})};return i.jsxs("div",{className:"ihub-container ihub-mt-5",children:[i.jsx("h1",{children:"Modal Examples"}),i.jsxs("div",{className:"ihub-d-flex ihub-py-5",style:{gap:"20px",flexWrap:"wrap"},children:[i.jsx("button",{className:"ihub-important-btn",onClick:function(){return c(!0)},children:"Open Basic Modal"}),i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!0)},children:"Open Form Modal"}),i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return k(!0)},children:"Open Form Modal Event"}),i.jsx("button",{className:"ihub-primary-btn",onClick:function(){return p(!0)},children:"Open Custom Modal"}),i.jsx("button",{className:"ihub-danger-btn",onClick:function(){return y(!0)},children:"Open Full Screen Modal"})]}),i.jsxs(n.default,{isOpen:u,onClose:function(){return c(!1)},title:"Basic Information Modal",size:"small",showFooter:!0,children:[i.jsx("p",{children:"This is a basic modal with default settings. It includes:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"A title in the header"}),i.jsx("li",{children:"Content in the body"}),i.jsx("li",{children:"A footer with default buttons"}),i.jsx("li",{children:"Small size (400px max width)"})]})]}),i.jsxs(n.default,{isOpen:h,onClose:function(){return b(!1)},title:"User Information Form",size:"medium",showFooter:!0,footerContent:i.jsxs("div",{className:"ihub-buttons",children:[i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!1)},children:"Cancel"}),i.jsx("button",{className:"ihub-important-btn",onClick:function(){console.log("Form submitted with data:",A),b(!1)},disabled:!A.name||!A.email,children:"Submit"})]}),children:[i.jsx(a.default,{label:"Full Name",id:"name",name:"name",type:"text",value:A.name,onChange:B,className:"ihub-input",required:!0}),i.jsx(a.default,{label:"Email Address",id:"email",name:"email",type:"email",value:A.email,onChange:B,className:"ihub-input",required:!0})]}),i.jsxs(n.default,{title:"Form Modal with event",isOpen:g,onClose:function(){return k(!1)},size:"medium",showFooter:!0,handleSubmit:function(e){e.preventDefault(),console.log("Form event:",e),s.openToast("Check console for form data")},footerContent:i.jsxs("div",{className:"ihub-buttons",children:[i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!1)},children:"Cancel"}),i.jsx(l.default,{label:"Submit",type:"submit",status:O})]}),children:[i.jsx(a.default,{label:"Full Name",id:"name",name:"name",type:"text",value:A.name,onChange:B,className:"ihub-input",required:!0}),i.jsx(a.default,{label:"Email Address",id:"email",name:"email",type:"email",value:A.email,onChange:B,className:"ihub-input",required:!0})]}),i.jsx(n.default,{isOpen:f,onClose:function(){return p(!1)},size:"large",showCloseButton:!0,closeOnOverlayClick:!1,className:"ihub-custom-modal",children:i.jsxs("div",{className:"ihub-py-3",children:[i.jsx("h2",{className:"ihub-mb-3",children:"Custom Modal Without Header"}),i.jsx("p",{children:"This modal demonstrates:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"No formal header section (title is in the body)"}),i.jsx("li",{children:"Custom close button still included"}),i.jsx("li",{children:"Large size variant (900px max width)"}),i.jsx("li",{children:"Overlay click is disabled (can only close via button)"}),i.jsx("li",{children:"No footer section"})]}),i.jsx("div",{className:"ihub-d-flex ihub-justify-content-center ihub-mt-4",children:i.jsx("button",{className:"ihub-important-btn",onClick:function(){return p(!1)},children:"Close This Modal"})})]})}),i.jsx(n.default,{isOpen:N,onClose:function(){return y(!1)},title:"Full Screen Experience",size:"full",showFooter:!1,children:i.jsxs("div",{style:{minHeight:"80vh"},children:[i.jsx("h3",{children:"This is a full-screen modal"}),i.jsx("p",{children:"Perfect for immersive experiences, detailed forms, or content that requires maximum screen real estate. This modal takes over the entire viewport."}),i.jsx("div",{className:"ihub-mt-5",children:i.jsx("button",{className:"ihub-danger-btn",onClick:function(){return y(!1)},children:"Close Full Screen Modal"})})]})})]})};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../_virtual/_rollupPluginBabelHelpers.js"),i=require("react/jsx-runtime"),t=require("react"),n=require("./MultiPurposeModal.js"),l=require("../forms/SubmitButton.js");require("../lib/helpFunction.js");var s=require("../lib/modals/modals.js");require("../lib/utils.js"),require("../lib/phoneUtils.js");var a=require("../forms/InputText.js");exports.default=function(){var r=t.useState(!1),o=e.slicedToArray(r,2),u=o[0],c=o[1],d=t.useState(!1),m=e.slicedToArray(d,2),h=m[0],b=m[1],x=t.useState(!1),j=e.slicedToArray(x,2),f=j[0],p=j[1],v=t.useState(!1),C=e.slicedToArray(v,2),N=C[0],y=C[1],S=t.useState(!1),F=e.slicedToArray(S,2),g=F[0],q=F[1],k=t.useState(1),M=e.slicedToArray(k,2),O=M[0];M[1];var T=t.useState({name:"",email:""}),w=e.slicedToArray(T,2),A=w[0],z=w[1],B=function(i){var t=i.target,n=t.name,l=t.value;z(function(i){return e.objectSpread2(e.objectSpread2({},i),{},e.defineProperty({},n,l))})};return i.jsxs("div",{className:"ihub-container ihub-mt-5",children:[i.jsx("h1",{children:"Modal Examples"}),i.jsxs("div",{className:"ihub-d-flex ihub-py-5",style:{gap:"20px",flexWrap:"wrap"},children:[i.jsx("button",{className:"ihub-important-btn",onClick:function(){return c(!0)},children:"Open Basic Modal"}),i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!0)},children:"Open Form Modal"}),i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return q(!0)},children:"Open Form Modal Event"}),i.jsx("button",{className:"ihub-primary-btn",onClick:function(){return p(!0)},children:"Open Custom Modal"}),i.jsx("button",{className:"ihub-danger-btn",onClick:function(){return y(!0)},children:"Open Full Screen Modal"})]}),i.jsxs(n.default,{isOpen:u,onClose:function(){return c(!1)},title:"Basic Information Modal",size:"small",showFooter:!0,children:[i.jsx("p",{children:"This is a basic modal with default settings. It includes:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"A title in the header"}),i.jsx("li",{children:"Content in the body"}),i.jsx("li",{children:"A footer with default buttons"}),i.jsx("li",{children:"Small size (400px max width)"})]})]}),i.jsxs(n.default,{isOpen:h,onClose:function(){return b(!1)},title:"User Information Form",size:"medium",showFooter:!0,footerContent:i.jsxs("div",{className:"ihub-buttons",children:[i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!1)},children:"Cancel"}),i.jsx("button",{className:"ihub-important-btn",onClick:function(){console.log("Form submitted with data:",A),b(!1)},disabled:!A.name||!A.email,children:"Submit"})]}),children:[i.jsx(a.default,{label:"Full Name",id:"name",name:"name",type:"text",value:A.name,onChange:B,className:"ihub-input",required:!0}),i.jsx(a.default,{label:"Email Address",id:"email",name:"email",type:"email",value:A.email,onChange:B,className:"ihub-input",required:!0})]}),i.jsxs(n.default,{title:"Form Modal with event",isOpen:g,onClose:function(){return q(!1)},size:"medium",showFooter:!0,handleSubmit:function(e){e.preventDefault(),console.log("Form event:",e),s.openToast("Check console for form data")},footerContent:i.jsxs("div",{className:"ihub-buttons",children:[i.jsx("button",{className:"ihub-outlined-btn",onClick:function(){return b(!1)},children:"Cancel"}),i.jsx(l.default,{label:"Submit",type:"submit",status:O})]}),children:[i.jsx(a.default,{label:"Full Name",id:"name",name:"name",type:"text",value:A.name,onChange:B,className:"ihub-input",required:!0}),i.jsx(a.default,{label:"Email Address",id:"email",name:"email",type:"email",value:A.email,onChange:B,className:"ihub-input",required:!0})]}),i.jsx(n.default,{isOpen:f,onClose:function(){return p(!1)},size:"large",showCloseButton:!0,closeOnOverlayClick:!1,className:"ihub-custom-modal",children:i.jsxs("div",{className:"ihub-py-3",children:[i.jsx("h2",{className:"ihub-mb-3",children:"Custom Modal Without Header"}),i.jsx("p",{children:"This modal demonstrates:"}),i.jsxs("ul",{children:[i.jsx("li",{children:"No formal header section (title is in the body)"}),i.jsx("li",{children:"Custom close button still included"}),i.jsx("li",{children:"Large size variant (900px max width)"}),i.jsx("li",{children:"Overlay click is disabled (can only close via button)"}),i.jsx("li",{children:"No footer section"})]}),i.jsx("div",{className:"ihub-d-flex ihub-justify-content-center ihub-mt-4",children:i.jsx("button",{className:"ihub-important-btn",onClick:function(){return p(!1)},children:"Close This Modal"})})]})}),i.jsx(n.default,{isOpen:N,onClose:function(){return y(!1)},title:"Full Screen Experience",size:"full",showFooter:!1,children:i.jsxs("div",{style:{minHeight:"80vh"},children:[i.jsx("h3",{children:"This is a full-screen modal"}),i.jsx("p",{children:"Perfect for immersive experiences, detailed forms, or content that requires maximum screen real estate. This modal takes over the entire viewport."}),i.jsx("div",{className:"ihub-mt-5",children:i.jsx("button",{className:"ihub-danger-btn",onClick:function(){return y(!1)},children:"Close Full Screen Modal"})})]})})]})};
2
2
  //# sourceMappingURL=ModalExamples.js.map