@bigbinary/neeto-molecules 1.1.16 → 1.1.17

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 (392) hide show
  1. package/dist/AutoSaveInput.js +658 -0
  2. package/dist/AutoSaveInput.js.map +1 -0
  3. package/dist/Breadcrumbs.js +38 -0
  4. package/dist/Breadcrumbs.js.map +1 -0
  5. package/dist/BrowserSupport.js +418 -0
  6. package/dist/BrowserSupport.js.map +1 -0
  7. package/dist/Builder.js +662 -0
  8. package/dist/Builder.js.map +1 -0
  9. package/dist/CalendarView.js +538 -0
  10. package/dist/CalendarView.js.map +1 -0
  11. package/dist/Codeblock.js +236 -0
  12. package/dist/Codeblock.js.map +1 -0
  13. package/dist/{Columns/index.js → Columns.js} +130 -13
  14. package/dist/Columns.js.map +1 -0
  15. package/dist/{ConfirmationModal/index.js → ConfirmationModal.js} +20 -8
  16. package/dist/ConfirmationModal.js.map +1 -0
  17. package/dist/Container.js +1211 -0
  18. package/dist/Container.js.map +1 -0
  19. package/dist/CopyToClipboardButton.js +209 -0
  20. package/dist/CopyToClipboardButton.js.map +1 -0
  21. package/dist/CustomDomain.js +688 -0
  22. package/dist/CustomDomain.js.map +1 -0
  23. package/dist/CustomDomainDashboard.js +2283 -0
  24. package/dist/CustomDomainDashboard.js.map +1 -0
  25. package/dist/{DateFormat/index.js → DateFormat.js} +25 -8
  26. package/dist/DateFormat.js.map +1 -0
  27. package/dist/DateRangeFilter.js +229 -0
  28. package/dist/DateRangeFilter.js.map +1 -0
  29. package/dist/DynamicVariables.js +183 -0
  30. package/dist/DynamicVariables.js.map +1 -0
  31. package/dist/EmailForm.js +2291 -0
  32. package/dist/EmailForm.js.map +1 -0
  33. package/dist/EmailPreview.js +1353 -0
  34. package/dist/EmailPreview.js.map +1 -0
  35. package/dist/{ErrorPage/constants.js → ErrorPage.js} +137 -36
  36. package/dist/ErrorPage.js.map +1 -0
  37. package/dist/Header.js +122 -0
  38. package/dist/Header.js.map +1 -0
  39. package/dist/IconPicker.js +313 -0
  40. package/dist/IconPicker.js.map +1 -0
  41. package/dist/ImageWithFallback.js +181 -0
  42. package/dist/ImageWithFallback.js.map +1 -0
  43. package/dist/IntegrationCard.js +343 -0
  44. package/dist/IntegrationCard.js.map +1 -0
  45. package/dist/IntegrationDisconnectAlert.js +80 -0
  46. package/dist/IntegrationDisconnectAlert.js.map +1 -0
  47. package/dist/{IntegrationWalkthroughModal/index.js → IntegrationWalkthroughModal.js} +8 -6
  48. package/dist/IntegrationWalkthroughModal.js.map +1 -0
  49. package/dist/IpRestriction.js +857 -0
  50. package/dist/IpRestriction.js.map +1 -0
  51. package/dist/KeyboardShortcuts.js +359 -0
  52. package/dist/KeyboardShortcuts.js.map +1 -0
  53. package/dist/LoginPage.js +593 -0
  54. package/dist/LoginPage.js.map +1 -0
  55. package/dist/MenuBar.js +1461 -0
  56. package/dist/MenuBar.js.map +1 -0
  57. package/dist/Metadata.js +206 -0
  58. package/dist/Metadata.js.map +1 -0
  59. package/dist/{MoreDropdown/index.js → MoreDropdown.js} +102 -9
  60. package/dist/MoreDropdown.js.map +1 -0
  61. package/dist/NavigationHeader.js +690 -0
  62. package/dist/NavigationHeader.js.map +1 -0
  63. package/dist/NeetoWidget.js +1333 -0
  64. package/dist/NeetoWidget.js.map +1 -0
  65. package/dist/PageLoader.js +134 -0
  66. package/dist/PageLoader.js.map +1 -0
  67. package/dist/PhoneNumber.js +365 -0
  68. package/dist/PhoneNumber.js.map +1 -0
  69. package/dist/PublishBlock.js +158 -0
  70. package/dist/PublishBlock.js.map +1 -0
  71. package/dist/Rename.js +450 -0
  72. package/dist/Rename.js.map +1 -0
  73. package/dist/ResponsiveDevicePicker.js +194 -0
  74. package/dist/ResponsiveDevicePicker.js.map +1 -0
  75. package/dist/Schedule.js +1046 -0
  76. package/dist/Schedule.js.map +1 -0
  77. package/dist/Scrollable.js +122 -0
  78. package/dist/Scrollable.js.map +1 -0
  79. package/dist/Search.js +151 -0
  80. package/dist/Search.js.map +1 -0
  81. package/dist/Security.js +1835 -0
  82. package/dist/Security.js.map +1 -0
  83. package/dist/SendToFields.js +601 -0
  84. package/dist/SendToFields.js.map +1 -0
  85. package/dist/Settings.js +435 -0
  86. package/dist/Settings.js.map +1 -0
  87. package/dist/ShareViaEmail.js +2277 -0
  88. package/dist/ShareViaEmail.js.map +1 -0
  89. package/dist/ShareViaLink.js +628 -0
  90. package/dist/ShareViaLink.js.map +1 -0
  91. package/dist/Sidebar.js +972 -0
  92. package/dist/Sidebar.js.map +1 -0
  93. package/dist/SubHeader.js +216 -0
  94. package/dist/SubHeader.js.map +1 -0
  95. package/dist/{TableWrapper/index.js → TableWrapper.js} +6 -3
  96. package/dist/TableWrapper.js.map +1 -0
  97. package/dist/ThemeSidebar.js +1984 -0
  98. package/dist/ThemeSidebar.js.map +1 -0
  99. package/dist/TimeFormat.js +47 -0
  100. package/dist/TimeFormat.js.map +1 -0
  101. package/dist/TimezoneMismatchModal.js +168 -0
  102. package/dist/TimezoneMismatchModal.js.map +1 -0
  103. package/dist/ToggleFeatureCard.js +323 -0
  104. package/dist/ToggleFeatureCard.js.map +1 -0
  105. package/package.json +22 -13
  106. package/dist/AutoSaveInput/autosaveinput.scss +0 -15
  107. package/dist/AutoSaveInput/constants.js +0 -13
  108. package/dist/AutoSaveInput/index.js +0 -124
  109. package/dist/AutoSaveInput/utils.js +0 -10
  110. package/dist/Breadcrumbs/breadcrumbs.scss +0 -33
  111. package/dist/Breadcrumbs/index.js +0 -31
  112. package/dist/BrowserSupport/Callout.js +0 -15
  113. package/dist/BrowserSupport/ContactUs.js +0 -21
  114. package/dist/BrowserSupport/DownloadLink.js +0 -17
  115. package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +0 -17
  116. package/dist/BrowserSupport/UnknownBrowser.js +0 -13
  117. package/dist/BrowserSupport/UnsupportedBrowser.js +0 -24
  118. package/dist/BrowserSupport/UnsupportedBrowserMessage.js +0 -22
  119. package/dist/BrowserSupport/UnsupportedBrowserVersion.js +0 -27
  120. package/dist/BrowserSupport/UnsupportedVersionMessage.js +0 -30
  121. package/dist/BrowserSupport/browsersupport.scss +0 -71
  122. package/dist/BrowserSupport/constants.js +0 -63
  123. package/dist/BrowserSupport/index.js +0 -58
  124. package/dist/BrowserSupport/utils.js +0 -32
  125. package/dist/Builder/Body.js +0 -9
  126. package/dist/Builder/ElementsPanel/ElementsList/Element.js +0 -27
  127. package/dist/Builder/ElementsPanel/ElementsList/Section.js +0 -28
  128. package/dist/Builder/ElementsPanel/ElementsList/TitleBar.js +0 -28
  129. package/dist/Builder/ElementsPanel/ElementsList/index.js +0 -63
  130. package/dist/Builder/ElementsPanel/SelectedElementsList/SelectedElement.js +0 -73
  131. package/dist/Builder/ElementsPanel/SelectedElementsList/TitleBar.js +0 -50
  132. package/dist/Builder/ElementsPanel/SelectedElementsList/index.js +0 -91
  133. package/dist/Builder/ElementsPanel/index.js +0 -70
  134. package/dist/Builder/PropertiesPanel/EmptyProperty.js +0 -21
  135. package/dist/Builder/PropertiesPanel/Skeleton.js +0 -24
  136. package/dist/Builder/PropertiesPanel/index.js +0 -12
  137. package/dist/Builder/index.js +0 -3
  138. package/dist/Builder/styles.scss +0 -84
  139. package/dist/CalendarView/CustomDatePicker.js +0 -87
  140. package/dist/CalendarView/Header.js +0 -53
  141. package/dist/CalendarView/constants.js +0 -19
  142. package/dist/CalendarView/index.js +0 -83
  143. package/dist/CalendarView/utils.js +0 -50
  144. package/dist/Codeblock/index.js +0 -30
  145. package/dist/Columns/utils.js +0 -20
  146. package/dist/ConfirmationModal/constants.js +0 -3
  147. package/dist/ConfirmationModal/utils.js +0 -6
  148. package/dist/Container/container.scss +0 -21
  149. package/dist/Container/index.js +0 -23
  150. package/dist/CopyToClipboardButton/constants.js +0 -13
  151. package/dist/CopyToClipboardButton/copyToClipboard.scss +0 -22
  152. package/dist/CopyToClipboardButton/index.js +0 -59
  153. package/dist/CustomDomain/index.js +0 -98
  154. package/dist/CustomDomainDashboard/DeleteAlert.js +0 -28
  155. package/dist/CustomDomainDashboard/Header.js +0 -32
  156. package/dist/CustomDomainDashboard/Manage/Record.js +0 -42
  157. package/dist/CustomDomainDashboard/Manage/StatusInfo.js +0 -21
  158. package/dist/CustomDomainDashboard/Manage/TagBlock.js +0 -36
  159. package/dist/CustomDomainDashboard/Manage/constants.js +0 -4
  160. package/dist/CustomDomainDashboard/Manage/index.js +0 -125
  161. package/dist/CustomDomainDashboard/Manage/utils.js +0 -8
  162. package/dist/CustomDomainDashboard/api.js +0 -35
  163. package/dist/CustomDomainDashboard/constants.js +0 -2
  164. package/dist/CustomDomainDashboard/index.js +0 -118
  165. package/dist/CustomDomainDashboard/useCustomDomainApi.js +0 -71
  166. package/dist/CustomDomainDashboard/utils.js +0 -84
  167. package/dist/DateRangeFilter/index.js +0 -60
  168. package/dist/DateRangeFilter/utils.js +0 -113
  169. package/dist/DynamicVariables/dynamic-variables.scss +0 -34
  170. package/dist/DynamicVariables/index.js +0 -59
  171. package/dist/DynamicVariables/utils.js +0 -37
  172. package/dist/EmailForm/EmailForm.js +0 -98
  173. package/dist/EmailForm/EmailFormProvider.js +0 -45
  174. package/dist/EmailForm/EmailPreview.js +0 -129
  175. package/dist/EmailForm/ReplyToField.js +0 -55
  176. package/dist/EmailForm/SendToField.js +0 -28
  177. package/dist/EmailForm/SubjectField.js +0 -64
  178. package/dist/EmailForm/constants.js +0 -33
  179. package/dist/EmailForm/contexts/EmailForm.js +0 -7
  180. package/dist/EmailForm/index.js +0 -4
  181. package/dist/EmailForm/utils.js +0 -10
  182. package/dist/EmailPreview/index.js +0 -2
  183. package/dist/ErrorPage/index.js +0 -78
  184. package/dist/Header/Breadcrumbs.js +0 -31
  185. package/dist/Header/Dropdown.js +0 -12
  186. package/dist/Header/constants.js +0 -6
  187. package/dist/Header/header.scss +0 -121
  188. package/dist/Header/index.js +0 -61
  189. package/dist/IconPicker/Icon.js +0 -34
  190. package/dist/IconPicker/NoResults.js +0 -12
  191. package/dist/IconPicker/constants.js +0 -8
  192. package/dist/IconPicker/icon-picker.scss +0 -1
  193. package/dist/IconPicker/index.js +0 -164
  194. package/dist/ImageWithFallback/ImagePlaceholder.js +0 -16
  195. package/dist/ImageWithFallback/index.js +0 -31
  196. package/dist/IntegrationCard/Dropdown.js +0 -45
  197. package/dist/IntegrationCard/Status.js +0 -25
  198. package/dist/IntegrationCard/index.js +0 -128
  199. package/dist/IntegrationDisconnectAlert/index.js +0 -36
  200. package/dist/IpRestriction/AllowedIpRanges.js +0 -75
  201. package/dist/IpRestriction/CurrentIp.js +0 -26
  202. package/dist/IpRestriction/FormRow.js +0 -84
  203. package/dist/IpRestriction/Row.js +0 -91
  204. package/dist/IpRestriction/apis/allowed_ip_ranges.js +0 -28
  205. package/dist/IpRestriction/apis/current_ip.js +0 -11
  206. package/dist/IpRestriction/apis/ip_restriction.js +0 -16
  207. package/dist/IpRestriction/constants.js +0 -20
  208. package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +0 -34
  209. package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +0 -10
  210. package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +0 -18
  211. package/dist/IpRestriction/index.js +0 -102
  212. package/dist/IpRestriction/utils.js +0 -85
  213. package/dist/KeyboardShortcuts/Pane/HotKey.js +0 -44
  214. package/dist/KeyboardShortcuts/Pane/HotKeyList.js +0 -42
  215. package/dist/KeyboardShortcuts/Pane/constants.js +0 -25
  216. package/dist/KeyboardShortcuts/Pane/index.js +0 -61
  217. package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +0 -5
  218. package/dist/KeyboardShortcuts/Pane/utils.js +0 -66
  219. package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +0 -31
  220. package/dist/KeyboardShortcuts/index.js +0 -9
  221. package/dist/LoginPage/Form.js +0 -57
  222. package/dist/LoginPage/constants.js +0 -12
  223. package/dist/LoginPage/index.js +0 -103
  224. package/dist/MenuBar/AddNew.js +0 -25
  225. package/dist/MenuBar/Block.js +0 -60
  226. package/dist/MenuBar/Item.js +0 -32
  227. package/dist/MenuBar/Search.js +0 -39
  228. package/dist/MenuBar/SubTitle.js +0 -23
  229. package/dist/MenuBar/index.js +0 -46
  230. package/dist/MenuBar/menubar.scss +0 -154
  231. package/dist/Metadata/Block.js +0 -30
  232. package/dist/Metadata/DetailsBlock.js +0 -86
  233. package/dist/Metadata/constants.js +0 -9
  234. package/dist/Metadata/index.js +0 -29
  235. package/dist/Metadata/metadata.scss +0 -15
  236. package/dist/MoreDropdown/constants.js +0 -25
  237. package/dist/NavigationHeader/LeftBlock.js +0 -32
  238. package/dist/NavigationHeader/Navigation.js +0 -24
  239. package/dist/NavigationHeader/RightBlock.js +0 -68
  240. package/dist/NavigationHeader/constants.js +0 -11
  241. package/dist/NavigationHeader/index.js +0 -19
  242. package/dist/NavigationHeader/navigation-header.scss +0 -3
  243. package/dist/NeetoWidget/CodeBlock.js +0 -57
  244. package/dist/NeetoWidget/CodeSnippet.js +0 -119
  245. package/dist/NeetoWidget/EmbedCode.js +0 -281
  246. package/dist/NeetoWidget/Main.js +0 -19
  247. package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +0 -25
  248. package/dist/NeetoWidget/SelectionSwitches/index.js +0 -44
  249. package/dist/NeetoWidget/SyntaxHighlighter.js +0 -17
  250. package/dist/NeetoWidget/api.js +0 -20
  251. package/dist/NeetoWidget/constants.js +0 -62
  252. package/dist/NeetoWidget/hooks/useForceUpdate.js +0 -14
  253. package/dist/NeetoWidget/index.js +0 -7
  254. package/dist/NeetoWidget/mutations.js +0 -9
  255. package/dist/NeetoWidget/queries.js +0 -32
  256. package/dist/NeetoWidget/utils.js +0 -83
  257. package/dist/PageLoader/index.js +0 -81
  258. package/dist/PageLoader/page-loader.scss +0 -95
  259. package/dist/PhoneNumber/CountryPicker/SingleValue.js +0 -21
  260. package/dist/PhoneNumber/CountryPicker/constants.js +0 -26
  261. package/dist/PhoneNumber/CountryPicker/index.js +0 -59
  262. package/dist/PhoneNumber/FormikPhoneNumberInput.js +0 -21
  263. package/dist/PhoneNumber/PhoneNumber.js +0 -30
  264. package/dist/PhoneNumber/PhoneNumberInput.js +0 -79
  265. package/dist/PhoneNumber/index.js +0 -5
  266. package/dist/PhoneNumber/utils.js +0 -55
  267. package/dist/PublishBlock/AlertBlock.js +0 -14
  268. package/dist/PublishBlock/index.js +0 -100
  269. package/dist/PublishBlock/publish-block.scss +0 -25
  270. package/dist/Rename/DummySpan.js +0 -21
  271. package/dist/Rename/constants.js +0 -1
  272. package/dist/Rename/index.js +0 -191
  273. package/dist/Rename/rename.scss +0 -69
  274. package/dist/Rename/utils.js +0 -10
  275. package/dist/ResponsiveDevicePicker/constants.js +0 -19
  276. package/dist/ResponsiveDevicePicker/index.js +0 -36
  277. package/dist/Schedule/DisplayAvailability.js +0 -58
  278. package/dist/Schedule/Fields.js +0 -43
  279. package/dist/Schedule/Form/ScheduleRow.js +0 -125
  280. package/dist/Schedule/Form/constants.js +0 -20
  281. package/dist/Schedule/Form/index.js +0 -144
  282. package/dist/Schedule/Form/utils.js +0 -63
  283. package/dist/Schedule/Header.js +0 -76
  284. package/dist/Schedule/ScheduleContext.js +0 -8
  285. package/dist/Schedule/constants.js +0 -8
  286. package/dist/Schedule/dayjsExtended/constants.js +0 -1
  287. package/dist/Schedule/dayjsExtended/index.js +0 -14
  288. package/dist/Schedule/dayjsExtended/range.js +0 -73
  289. package/dist/Schedule/index.js +0 -80
  290. package/dist/Schedule/utils.js +0 -152
  291. package/dist/Scrollable/constants.js +0 -8
  292. package/dist/Scrollable/index.js +0 -26
  293. package/dist/Scrollable/scrollable.scss +0 -32
  294. package/dist/Search/index.js +0 -52
  295. package/dist/Security/AllowedKeywords/Add.js +0 -38
  296. package/dist/Security/AllowedKeywords/index.js +0 -38
  297. package/dist/Security/PasswordBlock.js +0 -31
  298. package/dist/Security/RadioBlock.js +0 -38
  299. package/dist/Security/api.js +0 -12
  300. package/dist/Security/constants.js +0 -58
  301. package/dist/Security/index.js +0 -68
  302. package/dist/Security/useSecurityApi.js +0 -22
  303. package/dist/Security/utils.js +0 -31
  304. package/dist/SendToFields/FilePicker.js +0 -34
  305. package/dist/SendToFields/constants.js +0 -6
  306. package/dist/SendToFields/index.js +0 -102
  307. package/dist/SendToFields/utils.js +0 -54
  308. package/dist/Settings/Category.js +0 -30
  309. package/dist/Settings/Item.js +0 -38
  310. package/dist/Settings/index.js +0 -37
  311. package/dist/Settings/utils.js +0 -4
  312. package/dist/ShareViaEmail/EmailBodyEditor.js +0 -22
  313. package/dist/ShareViaEmail/FilePicker.js +0 -43
  314. package/dist/ShareViaEmail/Form.js +0 -105
  315. package/dist/ShareViaEmail/FormikDatePicker.js +0 -24
  316. package/dist/ShareViaEmail/constants.js +0 -14
  317. package/dist/ShareViaEmail/index.js +0 -92
  318. package/dist/ShareViaEmail/utils.js +0 -72
  319. package/dist/ShareViaLink/EditURL.js +0 -74
  320. package/dist/ShareViaLink/Link.js +0 -105
  321. package/dist/ShareViaLink/QRCode.js +0 -41
  322. package/dist/ShareViaLink/RegenerateURL.js +0 -47
  323. package/dist/ShareViaLink/SocialMedia.js +0 -52
  324. package/dist/ShareViaLink/constants.js +0 -25
  325. package/dist/ShareViaLink/edit-url.scss +0 -8
  326. package/dist/ShareViaLink/index.js +0 -46
  327. package/dist/ShareViaLink/utils.js +0 -47
  328. package/dist/Sidebar/AppSwitcher/AppLink.js +0 -45
  329. package/dist/Sidebar/AppSwitcher/Backdrop.js +0 -13
  330. package/dist/Sidebar/AppSwitcher/Body.js +0 -65
  331. package/dist/Sidebar/AppSwitcher/Portal.js +0 -27
  332. package/dist/Sidebar/AppSwitcher/appswitcher.scss +0 -164
  333. package/dist/Sidebar/AppSwitcher/index.js +0 -47
  334. package/dist/Sidebar/AppSwitcher/utils.js +0 -25
  335. package/dist/Sidebar/Chevron.js +0 -14
  336. package/dist/Sidebar/FeaturedTooltip.js +0 -19
  337. package/dist/Sidebar/Footer/AppSwitcherButton.js +0 -48
  338. package/dist/Sidebar/Footer/ProfileButton.js +0 -30
  339. package/dist/Sidebar/Footer/index.js +0 -56
  340. package/dist/Sidebar/Footer/utils.js +0 -39
  341. package/dist/Sidebar/Header.js +0 -33
  342. package/dist/Sidebar/HelpSection/HelpSectionMenu.js +0 -52
  343. package/dist/Sidebar/HelpSection/index.js +0 -32
  344. package/dist/Sidebar/Links.js +0 -112
  345. package/dist/Sidebar/NavIconWrapper.js +0 -20
  346. package/dist/Sidebar/ProfileSection/LinkSection.js +0 -36
  347. package/dist/Sidebar/ProfileSection/ProfileMenu.js +0 -48
  348. package/dist/Sidebar/ProfileSection/index.js +0 -42
  349. package/dist/Sidebar/constants.js +0 -40
  350. package/dist/Sidebar/index.js +0 -94
  351. package/dist/Sidebar/sidebar.scss +0 -379
  352. package/dist/Sidebar/utils.js +0 -18
  353. package/dist/SubHeader/RightBlock/Columns.js +0 -35
  354. package/dist/SubHeader/RightBlock/Download.js +0 -28
  355. package/dist/SubHeader/RightBlock/Filter.js +0 -31
  356. package/dist/SubHeader/RightBlock/index.js +0 -21
  357. package/dist/SubHeader/RightBlock/utils.js +0 -13
  358. package/dist/SubHeader/index.js +0 -28
  359. package/dist/SubHeader/subheader.scss +0 -78
  360. package/dist/ThemeSidebar/Customize/Logo.js +0 -39
  361. package/dist/ThemeSidebar/Customize/Properties.js +0 -170
  362. package/dist/ThemeSidebar/Customize/index.js +0 -66
  363. package/dist/ThemeSidebar/Themes/ThemeCard.js +0 -135
  364. package/dist/ThemeSidebar/Themes/index.js +0 -110
  365. package/dist/ThemeSidebar/TitleBar.js +0 -62
  366. package/dist/ThemeSidebar/constants.js +0 -127
  367. package/dist/ThemeSidebar/fields/AlignmentBlock.js +0 -50
  368. package/dist/ThemeSidebar/fields/Card.js +0 -19
  369. package/dist/ThemeSidebar/fields/ColorBlock.js +0 -19
  370. package/dist/ThemeSidebar/fields/FontPickerBlock.js +0 -35
  371. package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +0 -67
  372. package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +0 -22
  373. package/dist/ThemeSidebar/fields/ImageBlock/index.js +0 -55
  374. package/dist/ThemeSidebar/fields/SelectBlock.js +0 -24
  375. package/dist/ThemeSidebar/fields/SliderBlock.js +0 -30
  376. package/dist/ThemeSidebar/fields/SwitchBlock.js +0 -17
  377. package/dist/ThemeSidebar/fields/TextBlock.js +0 -13
  378. package/dist/ThemeSidebar/fields/slider.scss +0 -199
  379. package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +0 -149
  380. package/dist/ThemeSidebar/index.js +0 -118
  381. package/dist/ThemeSidebar/themeSidebar.scss +0 -45
  382. package/dist/ThemeSidebar/utils.js +0 -169
  383. package/dist/TimeFormat/index.js +0 -3
  384. package/dist/TimezoneMismatchModal/apis/time_zone.js +0 -9
  385. package/dist/TimezoneMismatchModal/index.js +0 -83
  386. package/dist/TimezoneMismatchModal/useTimeZoneApi.js +0 -10
  387. package/dist/TimezoneMismatchModal/utils.js +0 -12
  388. package/dist/ToggleFeatureCard/ToolTipSwitch.js +0 -31
  389. package/dist/ToggleFeatureCard/constants.js +0 -5
  390. package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +0 -11
  391. package/dist/ToggleFeatureCard/index.js +0 -148
  392. package/dist/ToggleFeatureCard/toggleFeatureCard.scss +0 -4
@@ -0,0 +1,2291 @@
1
+ import React, { useRef, useState, useContext } from 'react';
2
+ import classnames from 'classnames';
3
+ import { useFormikContext, Field } from 'formik';
4
+ import { isEditorEmpty, FormikEditor, EditorContent } from '@bigbinary/neeto-editor';
5
+ import { Toastr, Button, Input as Input$1, Typography } from '@bigbinary/neetoui';
6
+ import { Select, Input, MultiEmailInput, ActionBlock, Form } from '@bigbinary/neetoui/formik';
7
+ import { useTranslation, Trans } from 'react-i18next';
8
+ import { t } from 'i18next';
9
+ import { prop } from 'ramda';
10
+ import * as yup from 'yup';
11
+ import { string } from 'yup';
12
+ import { isNotEmpty, noop, isPresent } from '@bigbinary/neeto-commons-frontend/pure';
13
+ import { Info, Upload } from '@bigbinary/neeto-icons';
14
+ import { withT } from '@bigbinary/neeto-commons-frontend/react-utils';
15
+ import Papa from 'papaparse';
16
+ import { withEventTargetValue } from '@bigbinary/neeto-commons-frontend/utils';
17
+ import DynamicVariables from '@bigbinary/neeto-molecules/DynamicVariables';
18
+
19
+ function _typeof$1(obj) {
20
+ "@babel/helpers - typeof";
21
+
22
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
23
+ return typeof obj;
24
+ } : function (obj) {
25
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
26
+ }, _typeof$1(obj);
27
+ }
28
+
29
+ function _toPrimitive(input, hint) {
30
+ if (_typeof$1(input) !== "object" || input === null) return input;
31
+ var prim = input[Symbol.toPrimitive];
32
+ if (prim !== undefined) {
33
+ var res = prim.call(input, hint || "default");
34
+ if (_typeof$1(res) !== "object") return res;
35
+ throw new TypeError("@@toPrimitive must return a primitive value.");
36
+ }
37
+ return (hint === "string" ? String : Number)(input);
38
+ }
39
+
40
+ function _toPropertyKey(arg) {
41
+ var key = _toPrimitive(arg, "string");
42
+ return _typeof$1(key) === "symbol" ? key : String(key);
43
+ }
44
+
45
+ function _defineProperty(obj, key, value) {
46
+ key = _toPropertyKey(key);
47
+ if (key in obj) {
48
+ Object.defineProperty(obj, key, {
49
+ value: value,
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true
53
+ });
54
+ } else {
55
+ obj[key] = value;
56
+ }
57
+ return obj;
58
+ }
59
+
60
+ var INITIAL_FORM_VALUES = {
61
+ sendTo: [],
62
+ sendToCc: [],
63
+ sendToBcc: [],
64
+ replyTo: "",
65
+ showCopyEmails: false,
66
+ subject: "",
67
+ message: ""
68
+ };
69
+ var EMAIL_FORM_VALIDATION_SCHEMA = yup.object({
70
+ subject: yup.string().required(t("neetoMolecules.emailForm.errors.subjectRequired")),
71
+ message: yup.string().test("message", t("neetoMolecules.emailForm.errors.messageRequired"), function (value) {
72
+ return !isEditorEmpty(value);
73
+ })
74
+ });
75
+ var SEND_TO_FIELD_VALIDATION = yup.object({
76
+ sendTo: yup.array().min(1, t("neetoMolecules.emailForm.errors.required", {
77
+ entity: t("neetoMolecules.emailForm.fields.sendToEmailAddress")
78
+ })).test("all-emails-valid", t("neetoMolecules.emailForm.errors.invalidEmailAddress"), function (emails) {
79
+ return emails === null || emails === void 0 ? void 0 : emails.every(prop("valid"));
80
+ }).nullable()
81
+ });
82
+ var REPLY_TO_FIELD_VALIDATION = yup.object({
83
+ replyTo: yup.string().nullable().email(t("neetoMolecules.emailForm.errors.invalidEmailAddress")).required(t("neetoMolecules.emailForm.errors.required", {
84
+ entity: t("neetoMolecules.emailForm.fields.replyToEmailAddress")
85
+ }))
86
+ });
87
+ var EDITOR_ADDONS = ["highlight", "emoji", "code-block", "block-quote", "image-upload", "divider", "video-embed"];
88
+
89
+ /* eslint-disable @bigbinary/neeto/use-zustand-for-global-state-management */
90
+ var EmailFormContext = /*#__PURE__*/React.createContext({
91
+ showSendToField: false,
92
+ showReplyToField: false
93
+ });
94
+
95
+ var ReplyToField = function ReplyToField(_ref) {
96
+ var _helpIconProps2;
97
+ var replyToOptions = _ref.replyToOptions;
98
+ var _useTranslation = useTranslation(),
99
+ t = _useTranslation.t;
100
+ var isDropdownField = isNotEmpty(replyToOptions);
101
+ var _useFormikContext = useFormikContext(),
102
+ setFieldValue = _useFormikContext.setFieldValue;
103
+ if (isDropdownField) {
104
+ var _helpIconProps;
105
+ return /*#__PURE__*/React.createElement(Select, {
106
+ className: "w-full",
107
+ "data-testid": "replyToOptions",
108
+ label: t("neetoMolecules.emailForm.labels.replyTo"),
109
+ name: "replyTo",
110
+ options: replyToOptions,
111
+ labelProps: {
112
+ helpIconProps: (_helpIconProps = {
113
+ icon: Info
114
+ }, _defineProperty(_helpIconProps, "data-testid", "reply-to-tooltip"), _defineProperty(_helpIconProps, "tooltipProps", {
115
+ content: t("neetoMolecules.emailForm.tooltips.replyTo")
116
+ }), _helpIconProps)
117
+ },
118
+ onChange: function onChange(_ref2) {
119
+ var value = _ref2.value;
120
+ return setFieldValue("replyTo", value);
121
+ }
122
+ });
123
+ }
124
+ return /*#__PURE__*/React.createElement(Input, {
125
+ autoFocus: true,
126
+ required: true,
127
+ className: "w-full",
128
+ "data-testid": "replyToInput",
129
+ label: t("neetoMolecules.emailForm.labels.replyTo"),
130
+ name: "replyTo",
131
+ placeholder: t("neetoMolecules.emailForm.placeholders.emailPlaceholder"),
132
+ size: "large",
133
+ labelProps: {
134
+ helpIconProps: (_helpIconProps2 = {
135
+ icon: Info
136
+ }, _defineProperty(_helpIconProps2, "data-testid", "reply-to-tooltip"), _defineProperty(_helpIconProps2, "tooltipProps", {
137
+ content: t("neetoMolecules.emailForm.tooltips.replyTo")
138
+ }), _helpIconProps2)
139
+ }
140
+ });
141
+ };
142
+
143
+ function _extends() {
144
+ _extends = Object.assign ? Object.assign.bind() : function (target) {
145
+ for (var i = 1; i < arguments.length; i++) {
146
+ var source = arguments[i];
147
+ for (var key in source) {
148
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
149
+ target[key] = source[key];
150
+ }
151
+ }
152
+ }
153
+ return target;
154
+ };
155
+ return _extends.apply(this, arguments);
156
+ }
157
+
158
+ function _arrayLikeToArray(arr, len) {
159
+ if (len == null || len > arr.length) len = arr.length;
160
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
161
+ return arr2;
162
+ }
163
+
164
+ function _arrayWithoutHoles(arr) {
165
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
166
+ }
167
+
168
+ function _iterableToArray(iter) {
169
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
170
+ }
171
+
172
+ function _unsupportedIterableToArray(o, minLen) {
173
+ if (!o) return;
174
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
175
+ var n = Object.prototype.toString.call(o).slice(8, -1);
176
+ if (n === "Object" && o.constructor) n = o.constructor.name;
177
+ if (n === "Map" || n === "Set") return Array.from(o);
178
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
179
+ }
180
+
181
+ function _nonIterableSpread() {
182
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
183
+ }
184
+
185
+ function _toConsumableArray(arr) {
186
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
187
+ }
188
+
189
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
190
+ try {
191
+ var info = gen[key](arg);
192
+ var value = info.value;
193
+ } catch (error) {
194
+ reject(error);
195
+ return;
196
+ }
197
+ if (info.done) {
198
+ resolve(value);
199
+ } else {
200
+ Promise.resolve(value).then(_next, _throw);
201
+ }
202
+ }
203
+ function _asyncToGenerator(fn) {
204
+ return function () {
205
+ var self = this,
206
+ args = arguments;
207
+ return new Promise(function (resolve, reject) {
208
+ var gen = fn.apply(self, args);
209
+ function _next(value) {
210
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
211
+ }
212
+ function _throw(err) {
213
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
214
+ }
215
+ _next(undefined);
216
+ });
217
+ };
218
+ }
219
+
220
+ var regeneratorRuntime$1 = {exports: {}};
221
+
222
+ var _typeof = {exports: {}};
223
+
224
+ (function (module) {
225
+ function _typeof(obj) {
226
+ "@babel/helpers - typeof";
227
+
228
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
229
+ return typeof obj;
230
+ } : function (obj) {
231
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
232
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
233
+ }
234
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
235
+ } (_typeof));
236
+
237
+ (function (module) {
238
+ var _typeof$1 = _typeof.exports["default"];
239
+ function _regeneratorRuntime() {
240
+ module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
241
+ return exports;
242
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
243
+ var exports = {},
244
+ Op = Object.prototype,
245
+ hasOwn = Op.hasOwnProperty,
246
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
247
+ obj[key] = desc.value;
248
+ },
249
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
250
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
251
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
252
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
253
+ function define(obj, key, value) {
254
+ return Object.defineProperty(obj, key, {
255
+ value: value,
256
+ enumerable: !0,
257
+ configurable: !0,
258
+ writable: !0
259
+ }), obj[key];
260
+ }
261
+ try {
262
+ define({}, "");
263
+ } catch (err) {
264
+ define = function define(obj, key, value) {
265
+ return obj[key] = value;
266
+ };
267
+ }
268
+ function wrap(innerFn, outerFn, self, tryLocsList) {
269
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
270
+ generator = Object.create(protoGenerator.prototype),
271
+ context = new Context(tryLocsList || []);
272
+ return defineProperty(generator, "_invoke", {
273
+ value: makeInvokeMethod(innerFn, self, context)
274
+ }), generator;
275
+ }
276
+ function tryCatch(fn, obj, arg) {
277
+ try {
278
+ return {
279
+ type: "normal",
280
+ arg: fn.call(obj, arg)
281
+ };
282
+ } catch (err) {
283
+ return {
284
+ type: "throw",
285
+ arg: err
286
+ };
287
+ }
288
+ }
289
+ exports.wrap = wrap;
290
+ var ContinueSentinel = {};
291
+ function Generator() {}
292
+ function GeneratorFunction() {}
293
+ function GeneratorFunctionPrototype() {}
294
+ var IteratorPrototype = {};
295
+ define(IteratorPrototype, iteratorSymbol, function () {
296
+ return this;
297
+ });
298
+ var getProto = Object.getPrototypeOf,
299
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
300
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
301
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
302
+ function defineIteratorMethods(prototype) {
303
+ ["next", "throw", "return"].forEach(function (method) {
304
+ define(prototype, method, function (arg) {
305
+ return this._invoke(method, arg);
306
+ });
307
+ });
308
+ }
309
+ function AsyncIterator(generator, PromiseImpl) {
310
+ function invoke(method, arg, resolve, reject) {
311
+ var record = tryCatch(generator[method], generator, arg);
312
+ if ("throw" !== record.type) {
313
+ var result = record.arg,
314
+ value = result.value;
315
+ return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
316
+ invoke("next", value, resolve, reject);
317
+ }, function (err) {
318
+ invoke("throw", err, resolve, reject);
319
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
320
+ result.value = unwrapped, resolve(result);
321
+ }, function (error) {
322
+ return invoke("throw", error, resolve, reject);
323
+ });
324
+ }
325
+ reject(record.arg);
326
+ }
327
+ var previousPromise;
328
+ defineProperty(this, "_invoke", {
329
+ value: function value(method, arg) {
330
+ function callInvokeWithMethodAndArg() {
331
+ return new PromiseImpl(function (resolve, reject) {
332
+ invoke(method, arg, resolve, reject);
333
+ });
334
+ }
335
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
336
+ }
337
+ });
338
+ }
339
+ function makeInvokeMethod(innerFn, self, context) {
340
+ var state = "suspendedStart";
341
+ return function (method, arg) {
342
+ if ("executing" === state) throw new Error("Generator is already running");
343
+ if ("completed" === state) {
344
+ if ("throw" === method) throw arg;
345
+ return doneResult();
346
+ }
347
+ for (context.method = method, context.arg = arg;;) {
348
+ var delegate = context.delegate;
349
+ if (delegate) {
350
+ var delegateResult = maybeInvokeDelegate(delegate, context);
351
+ if (delegateResult) {
352
+ if (delegateResult === ContinueSentinel) continue;
353
+ return delegateResult;
354
+ }
355
+ }
356
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
357
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
358
+ context.dispatchException(context.arg);
359
+ } else "return" === context.method && context.abrupt("return", context.arg);
360
+ state = "executing";
361
+ var record = tryCatch(innerFn, self, context);
362
+ if ("normal" === record.type) {
363
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
364
+ return {
365
+ value: record.arg,
366
+ done: context.done
367
+ };
368
+ }
369
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
370
+ }
371
+ };
372
+ }
373
+ function maybeInvokeDelegate(delegate, context) {
374
+ var methodName = context.method,
375
+ method = delegate.iterator[methodName];
376
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
377
+ var record = tryCatch(method, delegate.iterator, context.arg);
378
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
379
+ var info = record.arg;
380
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
381
+ }
382
+ function pushTryEntry(locs) {
383
+ var entry = {
384
+ tryLoc: locs[0]
385
+ };
386
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
387
+ }
388
+ function resetTryEntry(entry) {
389
+ var record = entry.completion || {};
390
+ record.type = "normal", delete record.arg, entry.completion = record;
391
+ }
392
+ function Context(tryLocsList) {
393
+ this.tryEntries = [{
394
+ tryLoc: "root"
395
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
396
+ }
397
+ function values(iterable) {
398
+ if (iterable) {
399
+ var iteratorMethod = iterable[iteratorSymbol];
400
+ if (iteratorMethod) return iteratorMethod.call(iterable);
401
+ if ("function" == typeof iterable.next) return iterable;
402
+ if (!isNaN(iterable.length)) {
403
+ var i = -1,
404
+ next = function next() {
405
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
406
+ return next.value = undefined, next.done = !0, next;
407
+ };
408
+ return next.next = next;
409
+ }
410
+ }
411
+ return {
412
+ next: doneResult
413
+ };
414
+ }
415
+ function doneResult() {
416
+ return {
417
+ value: undefined,
418
+ done: !0
419
+ };
420
+ }
421
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
422
+ value: GeneratorFunctionPrototype,
423
+ configurable: !0
424
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
425
+ value: GeneratorFunction,
426
+ configurable: !0
427
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
428
+ var ctor = "function" == typeof genFun && genFun.constructor;
429
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
430
+ }, exports.mark = function (genFun) {
431
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
432
+ }, exports.awrap = function (arg) {
433
+ return {
434
+ __await: arg
435
+ };
436
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
437
+ return this;
438
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
439
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
440
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
441
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
442
+ return result.done ? result.value : iter.next();
443
+ });
444
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
445
+ return this;
446
+ }), define(Gp, "toString", function () {
447
+ return "[object Generator]";
448
+ }), exports.keys = function (val) {
449
+ var object = Object(val),
450
+ keys = [];
451
+ for (var key in object) keys.push(key);
452
+ return keys.reverse(), function next() {
453
+ for (; keys.length;) {
454
+ var key = keys.pop();
455
+ if (key in object) return next.value = key, next.done = !1, next;
456
+ }
457
+ return next.done = !0, next;
458
+ };
459
+ }, exports.values = values, Context.prototype = {
460
+ constructor: Context,
461
+ reset: function reset(skipTempReset) {
462
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
463
+ },
464
+ stop: function stop() {
465
+ this.done = !0;
466
+ var rootRecord = this.tryEntries[0].completion;
467
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
468
+ return this.rval;
469
+ },
470
+ dispatchException: function dispatchException(exception) {
471
+ if (this.done) throw exception;
472
+ var context = this;
473
+ function handle(loc, caught) {
474
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
475
+ }
476
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
477
+ var entry = this.tryEntries[i],
478
+ record = entry.completion;
479
+ if ("root" === entry.tryLoc) return handle("end");
480
+ if (entry.tryLoc <= this.prev) {
481
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
482
+ hasFinally = hasOwn.call(entry, "finallyLoc");
483
+ if (hasCatch && hasFinally) {
484
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
485
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
486
+ } else if (hasCatch) {
487
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
488
+ } else {
489
+ if (!hasFinally) throw new Error("try statement without catch or finally");
490
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
491
+ }
492
+ }
493
+ }
494
+ },
495
+ abrupt: function abrupt(type, arg) {
496
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
497
+ var entry = this.tryEntries[i];
498
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
499
+ var finallyEntry = entry;
500
+ break;
501
+ }
502
+ }
503
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
504
+ var record = finallyEntry ? finallyEntry.completion : {};
505
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
506
+ },
507
+ complete: function complete(record, afterLoc) {
508
+ if ("throw" === record.type) throw record.arg;
509
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
510
+ },
511
+ finish: function finish(finallyLoc) {
512
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
513
+ var entry = this.tryEntries[i];
514
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
515
+ }
516
+ },
517
+ "catch": function _catch(tryLoc) {
518
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
519
+ var entry = this.tryEntries[i];
520
+ if (entry.tryLoc === tryLoc) {
521
+ var record = entry.completion;
522
+ if ("throw" === record.type) {
523
+ var thrown = record.arg;
524
+ resetTryEntry(entry);
525
+ }
526
+ return thrown;
527
+ }
528
+ }
529
+ throw new Error("illegal catch attempt");
530
+ },
531
+ delegateYield: function delegateYield(iterable, resultName, nextLoc) {
532
+ return this.delegate = {
533
+ iterator: values(iterable),
534
+ resultName: resultName,
535
+ nextLoc: nextLoc
536
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
537
+ }
538
+ }, exports;
539
+ }
540
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
541
+ } (regeneratorRuntime$1));
542
+
543
+ // TODO(Babel 8): Remove this file.
544
+
545
+ var runtime = regeneratorRuntime$1.exports();
546
+ var regenerator = runtime;
547
+
548
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
549
+ try {
550
+ regeneratorRuntime = runtime;
551
+ } catch (accidentalStrictMode) {
552
+ if (typeof globalThis === "object") {
553
+ globalThis.regeneratorRuntime = runtime;
554
+ } else {
555
+ Function("r", "regeneratorRuntime = r")(runtime);
556
+ }
557
+ }
558
+
559
+ var ALLOWED_FILE_PICKER_TYPES = [".csv"];
560
+
561
+ var FilePicker = function FilePicker(_ref) {
562
+ var _ref$types = _ref.types,
563
+ types = _ref$types === void 0 ? [] : _ref$types,
564
+ onChange = _ref.onChange,
565
+ children = _ref.children;
566
+ var inputRef = useRef();
567
+ var accept = types.reduce(function (acc, ext) {
568
+ return "".concat(acc, ", ").concat(ext);
569
+ }, "");
570
+ var handleInputChange = function handleInputChange(_ref2) {
571
+ var target = _ref2.target;
572
+ if (!target.files) return;
573
+ onChange(target.files);
574
+
575
+ // This will trigger handleClick when same file is uploaded again.
576
+ inputRef.current.value = "";
577
+ handleClick();
578
+ };
579
+ var handleClick = function handleClick() {
580
+ if (!inputRef.current) return;
581
+ inputRef.current.click();
582
+ };
583
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
584
+ onClick: handleClick
585
+ }, children), /*#__PURE__*/React.createElement("input", {
586
+ accept: accept,
587
+ className: "hidden",
588
+ ref: inputRef,
589
+ type: "file",
590
+ onChange: handleInputChange
591
+ }));
592
+ };
593
+
594
+ var isValidEmail = function isValidEmail(email) {
595
+ return string().email().isValidSync(email);
596
+ };
597
+ var createEmailOptions = function createEmailOptions() {
598
+ var emails = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
599
+ return emails.map(function (email) {
600
+ return {
601
+ label: email,
602
+ value: email,
603
+ valid: isValidEmail(email)
604
+ };
605
+ });
606
+ };
607
+ var parseCsvEmails = /*#__PURE__*/function () {
608
+ var _ref = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(file, onSuccess) {
609
+ return regenerator.wrap(function _callee$(_context) {
610
+ while (1) switch (_context.prev = _context.next) {
611
+ case 0:
612
+ Papa.parse(file, {
613
+ header: true,
614
+ skipEmptyLines: true,
615
+ transformHeader: function transformHeader(h) {
616
+ return h.toLowerCase().replace(/\W/g, "");
617
+ },
618
+ complete: function complete(results) {
619
+ var _results$meta$fields;
620
+ var isEmailFieldPresent = (_results$meta$fields = results.meta.fields) === null || _results$meta$fields === void 0 ? void 0 : _results$meta$fields.includes("email");
621
+ if (isEmailFieldPresent) {
622
+ var emails = results.data.filter(prop("email")).map(function (item) {
623
+ return item.email.trim();
624
+ });
625
+ onSuccess(createEmailOptions(emails));
626
+ } else {
627
+ Toastr.error(t("neetoMolecules.sendToFields.errors.invalidCsv"));
628
+ }
629
+ }
630
+ });
631
+ case 1:
632
+ case "end":
633
+ return _context.stop();
634
+ }
635
+ }, _callee);
636
+ }));
637
+ return function parseCsvEmails(_x, _x2) {
638
+ return _ref.apply(this, arguments);
639
+ };
640
+ }();
641
+
642
+ var SendToFields = function SendToFields(_ref) {
643
+ var emailInputProps = _ref.emailInputProps,
644
+ ccInputProps = _ref.ccInputProps,
645
+ bccInputProps = _ref.bccInputProps,
646
+ _ref$showUploadCsvBut = _ref.showUploadCsvButton,
647
+ showUploadCsvButton = _ref$showUploadCsvBut === void 0 ? false : _ref$showUploadCsvBut,
648
+ _ref$showCcBccButton = _ref.showCcBccButton,
649
+ showCcBccButton = _ref$showCcBccButton === void 0 ? false : _ref$showCcBccButton;
650
+ var sendToFieldRef = useRef();
651
+ var _useFormikContext = useFormikContext(),
652
+ _useFormikContext$val = _useFormikContext.values,
653
+ showCopyEmails = _useFormikContext$val.showCopyEmails,
654
+ existingSendToEmails = _useFormikContext$val[emailInputProps.name || "sendTo"],
655
+ setFieldValue = _useFormikContext.setFieldValue;
656
+ var _useTranslation = useTranslation(),
657
+ t = _useTranslation.t;
658
+ var handleCSVFile = /*#__PURE__*/function () {
659
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(files) {
660
+ var _sendToFieldRef$curre, onSuccess;
661
+ return regenerator.wrap(function _callee$(_context) {
662
+ while (1) switch (_context.prev = _context.next) {
663
+ case 0:
664
+ _context.prev = 0;
665
+ onSuccess = function onSuccess(values) {
666
+ return setFieldValue(emailInputProps.name || "sendTo", [].concat(_toConsumableArray(existingSendToEmails), _toConsumableArray(values)));
667
+ };
668
+ _context.next = 4;
669
+ return parseCsvEmails(files[0], onSuccess);
670
+ case 4:
671
+ (_sendToFieldRef$curre = sendToFieldRef.current) === null || _sendToFieldRef$curre === void 0 ? void 0 : _sendToFieldRef$curre.focus();
672
+ _context.next = 10;
673
+ break;
674
+ case 7:
675
+ _context.prev = 7;
676
+ _context.t0 = _context["catch"](0);
677
+ Toastr.error(_context.t0);
678
+ case 10:
679
+ case "end":
680
+ return _context.stop();
681
+ }
682
+ }, _callee, null, [[0, 7]]);
683
+ }));
684
+ return function handleCSVFile(_x) {
685
+ return _ref2.apply(this, arguments);
686
+ };
687
+ }();
688
+ var handelCcBccButtonClick = function handelCcBccButtonClick(e) {
689
+ e.stopPropagation();
690
+ setFieldValue("showCopyEmails", !showCopyEmails);
691
+ };
692
+ return /*#__PURE__*/React.createElement("div", {
693
+ className: "relative w-full flex-col gap-2"
694
+ }, showUploadCsvButton && /*#__PURE__*/React.createElement("div", {
695
+ className: "absolute top-0 right-1"
696
+ }, /*#__PURE__*/React.createElement(FilePicker, {
697
+ types: ALLOWED_FILE_PICKER_TYPES,
698
+ onChange: handleCSVFile
699
+ }, /*#__PURE__*/React.createElement(Button, {
700
+ "data-cy": "upload-csv-button",
701
+ icon: Upload,
702
+ label: t("neetoMolecules.emailForm.uploadCSV"),
703
+ size: "small",
704
+ style: "link",
705
+ tooltipProps: {
706
+ content: t("neetoMolecules.sendToFields.uploadCsvTooltip"),
707
+ position: "right"
708
+ }
709
+ }))), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
710
+ "data-testid": "emails",
711
+ name: "sendTo",
712
+ ref: sendToFieldRef
713
+ }, emailInputProps, {
714
+ suffix: showCcBccButton && /*#__PURE__*/React.createElement(Button, {
715
+ "data-cy": "cc-bcc-button",
716
+ "data-testid": "cc-bcc-button",
717
+ label: t("neetoMolecules.emailForm.labels.ccBcc"),
718
+ size: "small",
719
+ style: "link",
720
+ onClick: handelCcBccButtonClick
721
+ })
722
+ })), showCopyEmails && /*#__PURE__*/React.createElement("div", {
723
+ className: "mt-5 flex w-full flex-col gap-6"
724
+ }, /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
725
+ name: "sendToBcc"
726
+ }, ccInputProps)), /*#__PURE__*/React.createElement(MultiEmailInput, _extends({
727
+ name: "sendToCc"
728
+ }, bccInputProps))));
729
+ };
730
+
731
+ var SendToField = withT(function (_ref) {
732
+ var t = _ref.t;
733
+ return /*#__PURE__*/React.createElement(SendToFields, {
734
+ showCcBccButton: true,
735
+ showUploadCsvButton: true,
736
+ bccInputProps: {
737
+ label: t("neetoMolecules.emailForm.labels.bCc"),
738
+ name: "sendToBcc",
739
+ placeholder: t("neetoMolecules.emailForm.placeholders.commaSeparatedEmails")
740
+ },
741
+ ccInputProps: {
742
+ label: t("neetoMolecules.emailForm.labels.cc"),
743
+ name: "sendToCc",
744
+ placeholder: t("neetoMolecules.emailForm.placeholders.commaSeparatedEmails")
745
+ },
746
+ emailInputProps: {
747
+ id: "sendTo",
748
+ name: "sendTo",
749
+ label: t("neetoMolecules.emailForm.labels.sendTo"),
750
+ placeholder: t("neetoMolecules.emailForm.placeholders.commaSeparatedEmails"),
751
+ required: true
752
+ }
753
+ });
754
+ });
755
+
756
+ function _arrayWithHoles(arr) {
757
+ if (Array.isArray(arr)) return arr;
758
+ }
759
+
760
+ function _iterableToArrayLimit(arr, i) {
761
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
762
+ if (null != _i) {
763
+ var _s,
764
+ _e,
765
+ _x,
766
+ _r,
767
+ _arr = [],
768
+ _n = !0,
769
+ _d = !1;
770
+ try {
771
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
772
+ if (Object(_i) !== _i) return;
773
+ _n = !1;
774
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
775
+ } catch (err) {
776
+ _d = !0, _e = err;
777
+ } finally {
778
+ try {
779
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
780
+ } finally {
781
+ if (_d) throw _e;
782
+ }
783
+ }
784
+ return _arr;
785
+ }
786
+ }
787
+
788
+ function _nonIterableRest() {
789
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
790
+ }
791
+
792
+ function _slicedToArray(arr, i) {
793
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
794
+ }
795
+
796
+ var SubjectField = function SubjectField(_ref) {
797
+ var name = _ref.name,
798
+ text = _ref.text,
799
+ updateText = _ref.updateText,
800
+ _ref$subjectVariables = _ref.subjectVariables,
801
+ subjectVariables = _ref$subjectVariables === void 0 ? [] : _ref$subjectVariables,
802
+ error = _ref.error,
803
+ _ref$required = _ref.required,
804
+ required = _ref$required === void 0 ? false : _ref$required;
805
+ var _useState = useState(false),
806
+ _useState2 = _slicedToArray(_useState, 2),
807
+ isFieldFocusedOnce = _useState2[0],
808
+ setIsFieldFocusedOnce = _useState2[1];
809
+ var _useTranslation = useTranslation(),
810
+ t = _useTranslation.t;
811
+ var tagClickHandler = function tagClickHandler(_ref2) {
812
+ var slug = _ref2.key;
813
+ var textAreaElement = document.querySelector("textarea[name=".concat(name, "]"));
814
+ var splitIndex = isFieldFocusedOnce && textAreaElement ? textAreaElement.selectionEnd : text.length;
815
+ var updatedSubject = [text.slice(0, splitIndex), " {{".concat(slug, "}}"), text.slice(splitIndex)].join("");
816
+ updateText(updatedSubject);
817
+ };
818
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Input$1, {
819
+ error: error,
820
+ name: name,
821
+ required: required,
822
+ label: t("neetoMolecules.emailForm.labels.subject"),
823
+ size: "large",
824
+ value: text,
825
+ suffix: /*#__PURE__*/React.createElement(DynamicVariables, {
826
+ variables: subjectVariables,
827
+ dropdownProps: {
828
+ className: "neeto-ui-dropdown__popup overflow-y-auto",
829
+ buttonSize: "small"
830
+ },
831
+ onVariableClick: tagClickHandler
832
+ }),
833
+ onChange: withEventTargetValue(updateText),
834
+ onFocus: function onFocus() {
835
+ return setIsFieldFocusedOnce(true);
836
+ }
837
+ }), /*#__PURE__*/React.createElement(Typography, {
838
+ className: "neeto-ui-text-gray-600 mt-2",
839
+ "data-cy": "subject-input-variable-label",
840
+ style: "body3"
841
+ }, /*#__PURE__*/React.createElement(Trans, {
842
+ components: {
843
+ span: /*#__PURE__*/React.createElement("span", {
844
+ className: "font-semibold"
845
+ })
846
+ },
847
+ i18nKey: "neetoMolecules.emailForm.helpText",
848
+ values: {
849
+ type: "subject"
850
+ }
851
+ })));
852
+ };
853
+
854
+ var EmailForm = function EmailForm(_ref) {
855
+ var _ref$messageVariables = _ref.messageVariables,
856
+ messageVariables = _ref$messageVariables === void 0 ? [] : _ref$messageVariables,
857
+ _ref$subjectVariables = _ref.subjectVariables,
858
+ subjectVariables = _ref$subjectVariables === void 0 ? [] : _ref$subjectVariables,
859
+ handleCancel = _ref.handleCancel,
860
+ isLoading = _ref.isLoading,
861
+ _ref$replyToOptions = _ref.replyToOptions,
862
+ replyToOptions = _ref$replyToOptions === void 0 ? [] : _ref$replyToOptions,
863
+ _ref$isUpdating = _ref.isUpdating,
864
+ isUpdating = _ref$isUpdating === void 0 ? false : _ref$isUpdating,
865
+ _ref$showFields = _ref.showFields,
866
+ showFields = _ref$showFields === void 0 ? true : _ref$showFields,
867
+ _ref$className = _ref.className,
868
+ className = _ref$className === void 0 ? "" : _ref$className;
869
+ var _useTranslation = useTranslation(),
870
+ t = _useTranslation.t;
871
+ var _useContext = useContext(EmailFormContext),
872
+ showSendToField = _useContext.showSendToField,
873
+ showReplyToField = _useContext.showReplyToField;
874
+ var _useFormikContext = useFormikContext(),
875
+ setFieldValue = _useFormikContext.setFieldValue,
876
+ dirty = _useFormikContext.dirty;
877
+ return /*#__PURE__*/React.createElement("div", {
878
+ "data-testid": "email-form",
879
+ className: classnames("flex flex-1 flex-col items-start gap-2", _defineProperty({}, className, className))
880
+ }, showFields && /*#__PURE__*/React.createElement("div", {
881
+ className: "flex w-full flex-col items-start justify-start gap-6"
882
+ }, /*#__PURE__*/React.createElement(Field, {
883
+ name: "subject"
884
+ }, function (_ref2) {
885
+ var value = _ref2.field.value,
886
+ error = _ref2.meta.error;
887
+ return /*#__PURE__*/React.createElement("div", {
888
+ className: "w-full"
889
+ }, /*#__PURE__*/React.createElement(SubjectField, {
890
+ error: t(error),
891
+ name: "subject",
892
+ subjectVariables: subjectVariables,
893
+ required: true,
894
+ text: value,
895
+ updateText: function updateText(text) {
896
+ return setFieldValue("subject", text);
897
+ }
898
+ }));
899
+ }), showSendToField && /*#__PURE__*/React.createElement(SendToField, null), showReplyToField && /*#__PURE__*/React.createElement(ReplyToField, {
900
+ replyToOptions: replyToOptions
901
+ }), /*#__PURE__*/React.createElement("div", {
902
+ className: "w-full"
903
+ }, /*#__PURE__*/React.createElement(FormikEditor, {
904
+ required: true,
905
+ addons: EDITOR_ADDONS,
906
+ "data-cy": "message-input-field",
907
+ id: "form_message",
908
+ label: t("neetoMolecules.emailForm.labels.message"),
909
+ name: "message",
910
+ variables: messageVariables
911
+ }), /*#__PURE__*/React.createElement(Typography, {
912
+ className: "neeto-ui-text-gray-500 mt-2",
913
+ "data-cy": "message-input-variable-label",
914
+ style: "body3"
915
+ }, /*#__PURE__*/React.createElement(Trans, {
916
+ i18nKey: "neetoMolecules.emailForm.helpText",
917
+ values: {
918
+ type: "message"
919
+ },
920
+ components: {
921
+ span: /*#__PURE__*/React.createElement("span", {
922
+ className: "font-semibold"
923
+ })
924
+ }
925
+ })))), /*#__PURE__*/React.createElement(ActionBlock, {
926
+ className: "mt-6 w-full justify-start",
927
+ cancelButtonProps: {
928
+ disabled: false,
929
+ onClick: handleCancel,
930
+ className: "ml-3"
931
+ },
932
+ submitButtonProps: {
933
+ loading: isLoading,
934
+ disabled: !dirty || isUpdating
935
+ }
936
+ }));
937
+ };
938
+
939
+ var getValidationSchema = function getValidationSchema(_ref) {
940
+ var showSendToField = _ref.showSendToField,
941
+ showReplyToField = _ref.showReplyToField,
942
+ customValidations = _ref.customValidations;
943
+ var schema = EMAIL_FORM_VALIDATION_SCHEMA.clone();
944
+ if (showSendToField) schema = schema.concat(SEND_TO_FIELD_VALIDATION);
945
+ if (showReplyToField) schema = schema.concat(REPLY_TO_FIELD_VALIDATION);
946
+ return schema.shape(customValidations);
947
+ };
948
+
949
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
950
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
951
+ var EmailFormProvider = function EmailFormProvider(_ref) {
952
+ var _ref$onSubmit = _ref.onSubmit,
953
+ onSubmit = _ref$onSubmit === void 0 ? noop : _ref$onSubmit,
954
+ _ref$initialValues = _ref.initialValues,
955
+ initialValues = _ref$initialValues === void 0 ? INITIAL_FORM_VALUES : _ref$initialValues,
956
+ children = _ref.children,
957
+ formikProps = _ref.formikProps,
958
+ _ref$validationSchema = _ref.validationSchema,
959
+ customValidations = _ref$validationSchema === void 0 ? {} : _ref$validationSchema,
960
+ _ref$showSendToField = _ref.showSendToField,
961
+ showSendToField = _ref$showSendToField === void 0 ? false : _ref$showSendToField,
962
+ _ref$showReplyToField = _ref.showReplyToField,
963
+ showReplyToField = _ref$showReplyToField === void 0 ? false : _ref$showReplyToField;
964
+ return /*#__PURE__*/React.createElement("div", {
965
+ "data-testid": "email-form-provider"
966
+ }, /*#__PURE__*/React.createElement(EmailFormContext.Provider, {
967
+ value: {
968
+ showSendToField: showSendToField,
969
+ showReplyToField: showReplyToField
970
+ }
971
+ }, /*#__PURE__*/React.createElement(Form, {
972
+ formikProps: _objectSpread({
973
+ enableReinitialize: true,
974
+ validationSchema: getValidationSchema({
975
+ showSendToField: showSendToField,
976
+ showReplyToField: showReplyToField,
977
+ customValidations: customValidations
978
+ }),
979
+ initialValues: _objectSpread(_objectSpread({}, initialValues), {}, {
980
+ replyTo: initialValues.replyTo || globalProps.user.email
981
+ }),
982
+ onSubmit: onSubmit
983
+ }, formikProps)
984
+ }, children)));
985
+ };
986
+
987
+ var propTypes = {exports: {}};
988
+
989
+ var reactIs = {exports: {}};
990
+
991
+ var reactIs_production_min = {};
992
+
993
+ /** @license React v16.13.1
994
+ * react-is.production.min.js
995
+ *
996
+ * Copyright (c) Facebook, Inc. and its affiliates.
997
+ *
998
+ * This source code is licensed under the MIT license found in the
999
+ * LICENSE file in the root directory of this source tree.
1000
+ */
1001
+
1002
+ var hasRequiredReactIs_production_min;
1003
+
1004
+ function requireReactIs_production_min () {
1005
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
1006
+ hasRequiredReactIs_production_min = 1;
1007
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
1008
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
1009
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
1010
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
1011
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
1012
+ reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
1013
+ return reactIs_production_min;
1014
+ }
1015
+
1016
+ var reactIs_development = {};
1017
+
1018
+ /** @license React v16.13.1
1019
+ * react-is.development.js
1020
+ *
1021
+ * Copyright (c) Facebook, Inc. and its affiliates.
1022
+ *
1023
+ * This source code is licensed under the MIT license found in the
1024
+ * LICENSE file in the root directory of this source tree.
1025
+ */
1026
+
1027
+ var hasRequiredReactIs_development;
1028
+
1029
+ function requireReactIs_development () {
1030
+ if (hasRequiredReactIs_development) return reactIs_development;
1031
+ hasRequiredReactIs_development = 1;
1032
+
1033
+
1034
+
1035
+ if (process.env.NODE_ENV !== "production") {
1036
+ (function() {
1037
+
1038
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
1039
+ // nor polyfill, then a plain number is used for performance.
1040
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
1041
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
1042
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
1043
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
1044
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
1045
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
1046
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
1047
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
1048
+ // (unstable) APIs that have been removed. Can we remove the symbols?
1049
+
1050
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
1051
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
1052
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
1053
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
1054
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
1055
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
1056
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
1057
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
1058
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
1059
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
1060
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
1061
+
1062
+ function isValidElementType(type) {
1063
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
1064
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
1065
+ }
1066
+
1067
+ function typeOf(object) {
1068
+ if (typeof object === 'object' && object !== null) {
1069
+ var $$typeof = object.$$typeof;
1070
+
1071
+ switch ($$typeof) {
1072
+ case REACT_ELEMENT_TYPE:
1073
+ var type = object.type;
1074
+
1075
+ switch (type) {
1076
+ case REACT_ASYNC_MODE_TYPE:
1077
+ case REACT_CONCURRENT_MODE_TYPE:
1078
+ case REACT_FRAGMENT_TYPE:
1079
+ case REACT_PROFILER_TYPE:
1080
+ case REACT_STRICT_MODE_TYPE:
1081
+ case REACT_SUSPENSE_TYPE:
1082
+ return type;
1083
+
1084
+ default:
1085
+ var $$typeofType = type && type.$$typeof;
1086
+
1087
+ switch ($$typeofType) {
1088
+ case REACT_CONTEXT_TYPE:
1089
+ case REACT_FORWARD_REF_TYPE:
1090
+ case REACT_LAZY_TYPE:
1091
+ case REACT_MEMO_TYPE:
1092
+ case REACT_PROVIDER_TYPE:
1093
+ return $$typeofType;
1094
+
1095
+ default:
1096
+ return $$typeof;
1097
+ }
1098
+
1099
+ }
1100
+
1101
+ case REACT_PORTAL_TYPE:
1102
+ return $$typeof;
1103
+ }
1104
+ }
1105
+
1106
+ return undefined;
1107
+ } // AsyncMode is deprecated along with isAsyncMode
1108
+
1109
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
1110
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
1111
+ var ContextConsumer = REACT_CONTEXT_TYPE;
1112
+ var ContextProvider = REACT_PROVIDER_TYPE;
1113
+ var Element = REACT_ELEMENT_TYPE;
1114
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
1115
+ var Fragment = REACT_FRAGMENT_TYPE;
1116
+ var Lazy = REACT_LAZY_TYPE;
1117
+ var Memo = REACT_MEMO_TYPE;
1118
+ var Portal = REACT_PORTAL_TYPE;
1119
+ var Profiler = REACT_PROFILER_TYPE;
1120
+ var StrictMode = REACT_STRICT_MODE_TYPE;
1121
+ var Suspense = REACT_SUSPENSE_TYPE;
1122
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
1123
+
1124
+ function isAsyncMode(object) {
1125
+ {
1126
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
1127
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
1128
+
1129
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
1130
+ }
1131
+ }
1132
+
1133
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
1134
+ }
1135
+ function isConcurrentMode(object) {
1136
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
1137
+ }
1138
+ function isContextConsumer(object) {
1139
+ return typeOf(object) === REACT_CONTEXT_TYPE;
1140
+ }
1141
+ function isContextProvider(object) {
1142
+ return typeOf(object) === REACT_PROVIDER_TYPE;
1143
+ }
1144
+ function isElement(object) {
1145
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
1146
+ }
1147
+ function isForwardRef(object) {
1148
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
1149
+ }
1150
+ function isFragment(object) {
1151
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
1152
+ }
1153
+ function isLazy(object) {
1154
+ return typeOf(object) === REACT_LAZY_TYPE;
1155
+ }
1156
+ function isMemo(object) {
1157
+ return typeOf(object) === REACT_MEMO_TYPE;
1158
+ }
1159
+ function isPortal(object) {
1160
+ return typeOf(object) === REACT_PORTAL_TYPE;
1161
+ }
1162
+ function isProfiler(object) {
1163
+ return typeOf(object) === REACT_PROFILER_TYPE;
1164
+ }
1165
+ function isStrictMode(object) {
1166
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
1167
+ }
1168
+ function isSuspense(object) {
1169
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
1170
+ }
1171
+
1172
+ reactIs_development.AsyncMode = AsyncMode;
1173
+ reactIs_development.ConcurrentMode = ConcurrentMode;
1174
+ reactIs_development.ContextConsumer = ContextConsumer;
1175
+ reactIs_development.ContextProvider = ContextProvider;
1176
+ reactIs_development.Element = Element;
1177
+ reactIs_development.ForwardRef = ForwardRef;
1178
+ reactIs_development.Fragment = Fragment;
1179
+ reactIs_development.Lazy = Lazy;
1180
+ reactIs_development.Memo = Memo;
1181
+ reactIs_development.Portal = Portal;
1182
+ reactIs_development.Profiler = Profiler;
1183
+ reactIs_development.StrictMode = StrictMode;
1184
+ reactIs_development.Suspense = Suspense;
1185
+ reactIs_development.isAsyncMode = isAsyncMode;
1186
+ reactIs_development.isConcurrentMode = isConcurrentMode;
1187
+ reactIs_development.isContextConsumer = isContextConsumer;
1188
+ reactIs_development.isContextProvider = isContextProvider;
1189
+ reactIs_development.isElement = isElement;
1190
+ reactIs_development.isForwardRef = isForwardRef;
1191
+ reactIs_development.isFragment = isFragment;
1192
+ reactIs_development.isLazy = isLazy;
1193
+ reactIs_development.isMemo = isMemo;
1194
+ reactIs_development.isPortal = isPortal;
1195
+ reactIs_development.isProfiler = isProfiler;
1196
+ reactIs_development.isStrictMode = isStrictMode;
1197
+ reactIs_development.isSuspense = isSuspense;
1198
+ reactIs_development.isValidElementType = isValidElementType;
1199
+ reactIs_development.typeOf = typeOf;
1200
+ })();
1201
+ }
1202
+ return reactIs_development;
1203
+ }
1204
+
1205
+ var hasRequiredReactIs;
1206
+
1207
+ function requireReactIs () {
1208
+ if (hasRequiredReactIs) return reactIs.exports;
1209
+ hasRequiredReactIs = 1;
1210
+ (function (module) {
1211
+
1212
+ if (process.env.NODE_ENV === 'production') {
1213
+ module.exports = requireReactIs_production_min();
1214
+ } else {
1215
+ module.exports = requireReactIs_development();
1216
+ }
1217
+ } (reactIs));
1218
+ return reactIs.exports;
1219
+ }
1220
+
1221
+ /*
1222
+ object-assign
1223
+ (c) Sindre Sorhus
1224
+ @license MIT
1225
+ */
1226
+
1227
+ var objectAssign;
1228
+ var hasRequiredObjectAssign;
1229
+
1230
+ function requireObjectAssign () {
1231
+ if (hasRequiredObjectAssign) return objectAssign;
1232
+ hasRequiredObjectAssign = 1;
1233
+ /* eslint-disable no-unused-vars */
1234
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
1235
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
1236
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
1237
+
1238
+ function toObject(val) {
1239
+ if (val === null || val === undefined) {
1240
+ throw new TypeError('Object.assign cannot be called with null or undefined');
1241
+ }
1242
+
1243
+ return Object(val);
1244
+ }
1245
+
1246
+ function shouldUseNative() {
1247
+ try {
1248
+ if (!Object.assign) {
1249
+ return false;
1250
+ }
1251
+
1252
+ // Detect buggy property enumeration order in older V8 versions.
1253
+
1254
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
1255
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
1256
+ test1[5] = 'de';
1257
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
1258
+ return false;
1259
+ }
1260
+
1261
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1262
+ var test2 = {};
1263
+ for (var i = 0; i < 10; i++) {
1264
+ test2['_' + String.fromCharCode(i)] = i;
1265
+ }
1266
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
1267
+ return test2[n];
1268
+ });
1269
+ if (order2.join('') !== '0123456789') {
1270
+ return false;
1271
+ }
1272
+
1273
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
1274
+ var test3 = {};
1275
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
1276
+ test3[letter] = letter;
1277
+ });
1278
+ if (Object.keys(Object.assign({}, test3)).join('') !==
1279
+ 'abcdefghijklmnopqrst') {
1280
+ return false;
1281
+ }
1282
+
1283
+ return true;
1284
+ } catch (err) {
1285
+ // We don't expect any of the above to throw, but better to be safe.
1286
+ return false;
1287
+ }
1288
+ }
1289
+
1290
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
1291
+ var from;
1292
+ var to = toObject(target);
1293
+ var symbols;
1294
+
1295
+ for (var s = 1; s < arguments.length; s++) {
1296
+ from = Object(arguments[s]);
1297
+
1298
+ for (var key in from) {
1299
+ if (hasOwnProperty.call(from, key)) {
1300
+ to[key] = from[key];
1301
+ }
1302
+ }
1303
+
1304
+ if (getOwnPropertySymbols) {
1305
+ symbols = getOwnPropertySymbols(from);
1306
+ for (var i = 0; i < symbols.length; i++) {
1307
+ if (propIsEnumerable.call(from, symbols[i])) {
1308
+ to[symbols[i]] = from[symbols[i]];
1309
+ }
1310
+ }
1311
+ }
1312
+ }
1313
+
1314
+ return to;
1315
+ };
1316
+ return objectAssign;
1317
+ }
1318
+
1319
+ /**
1320
+ * Copyright (c) 2013-present, Facebook, Inc.
1321
+ *
1322
+ * This source code is licensed under the MIT license found in the
1323
+ * LICENSE file in the root directory of this source tree.
1324
+ */
1325
+
1326
+ var ReactPropTypesSecret_1;
1327
+ var hasRequiredReactPropTypesSecret;
1328
+
1329
+ function requireReactPropTypesSecret () {
1330
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
1331
+ hasRequiredReactPropTypesSecret = 1;
1332
+
1333
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
1334
+
1335
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
1336
+ return ReactPropTypesSecret_1;
1337
+ }
1338
+
1339
+ var has;
1340
+ var hasRequiredHas;
1341
+
1342
+ function requireHas () {
1343
+ if (hasRequiredHas) return has;
1344
+ hasRequiredHas = 1;
1345
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
1346
+ return has;
1347
+ }
1348
+
1349
+ /**
1350
+ * Copyright (c) 2013-present, Facebook, Inc.
1351
+ *
1352
+ * This source code is licensed under the MIT license found in the
1353
+ * LICENSE file in the root directory of this source tree.
1354
+ */
1355
+
1356
+ var checkPropTypes_1;
1357
+ var hasRequiredCheckPropTypes;
1358
+
1359
+ function requireCheckPropTypes () {
1360
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
1361
+ hasRequiredCheckPropTypes = 1;
1362
+
1363
+ var printWarning = function() {};
1364
+
1365
+ if (process.env.NODE_ENV !== 'production') {
1366
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1367
+ var loggedTypeFailures = {};
1368
+ var has = requireHas();
1369
+
1370
+ printWarning = function(text) {
1371
+ var message = 'Warning: ' + text;
1372
+ if (typeof console !== 'undefined') {
1373
+ console.error(message);
1374
+ }
1375
+ try {
1376
+ // --- Welcome to debugging React ---
1377
+ // This error was thrown as a convenience so that you can use this stack
1378
+ // to find the callsite that caused this warning to fire.
1379
+ throw new Error(message);
1380
+ } catch (x) { /**/ }
1381
+ };
1382
+ }
1383
+
1384
+ /**
1385
+ * Assert that the values match with the type specs.
1386
+ * Error messages are memorized and will only be shown once.
1387
+ *
1388
+ * @param {object} typeSpecs Map of name to a ReactPropType
1389
+ * @param {object} values Runtime values that need to be type-checked
1390
+ * @param {string} location e.g. "prop", "context", "child context"
1391
+ * @param {string} componentName Name of the component for error messages.
1392
+ * @param {?Function} getStack Returns the component stack.
1393
+ * @private
1394
+ */
1395
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
1396
+ if (process.env.NODE_ENV !== 'production') {
1397
+ for (var typeSpecName in typeSpecs) {
1398
+ if (has(typeSpecs, typeSpecName)) {
1399
+ var error;
1400
+ // Prop type validation may throw. In case they do, we don't want to
1401
+ // fail the render phase where it didn't fail before. So we log it.
1402
+ // After these have been cleaned up, we'll let them throw.
1403
+ try {
1404
+ // This is intentionally an invariant that gets caught. It's the same
1405
+ // behavior as without this statement except with a better message.
1406
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
1407
+ var err = Error(
1408
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
1409
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
1410
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
1411
+ );
1412
+ err.name = 'Invariant Violation';
1413
+ throw err;
1414
+ }
1415
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
1416
+ } catch (ex) {
1417
+ error = ex;
1418
+ }
1419
+ if (error && !(error instanceof Error)) {
1420
+ printWarning(
1421
+ (componentName || 'React class') + ': type specification of ' +
1422
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
1423
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
1424
+ 'You may have forgotten to pass an argument to the type checker ' +
1425
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
1426
+ 'shape all require an argument).'
1427
+ );
1428
+ }
1429
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
1430
+ // Only monitor this failure once because there tends to be a lot of the
1431
+ // same error.
1432
+ loggedTypeFailures[error.message] = true;
1433
+
1434
+ var stack = getStack ? getStack() : '';
1435
+
1436
+ printWarning(
1437
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
1438
+ );
1439
+ }
1440
+ }
1441
+ }
1442
+ }
1443
+ }
1444
+
1445
+ /**
1446
+ * Resets warning cache when testing.
1447
+ *
1448
+ * @private
1449
+ */
1450
+ checkPropTypes.resetWarningCache = function() {
1451
+ if (process.env.NODE_ENV !== 'production') {
1452
+ loggedTypeFailures = {};
1453
+ }
1454
+ };
1455
+
1456
+ checkPropTypes_1 = checkPropTypes;
1457
+ return checkPropTypes_1;
1458
+ }
1459
+
1460
+ /**
1461
+ * Copyright (c) 2013-present, Facebook, Inc.
1462
+ *
1463
+ * This source code is licensed under the MIT license found in the
1464
+ * LICENSE file in the root directory of this source tree.
1465
+ */
1466
+
1467
+ var factoryWithTypeCheckers;
1468
+ var hasRequiredFactoryWithTypeCheckers;
1469
+
1470
+ function requireFactoryWithTypeCheckers () {
1471
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
1472
+ hasRequiredFactoryWithTypeCheckers = 1;
1473
+
1474
+ var ReactIs = requireReactIs();
1475
+ var assign = requireObjectAssign();
1476
+
1477
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
1478
+ var has = requireHas();
1479
+ var checkPropTypes = requireCheckPropTypes();
1480
+
1481
+ var printWarning = function() {};
1482
+
1483
+ if (process.env.NODE_ENV !== 'production') {
1484
+ printWarning = function(text) {
1485
+ var message = 'Warning: ' + text;
1486
+ if (typeof console !== 'undefined') {
1487
+ console.error(message);
1488
+ }
1489
+ try {
1490
+ // --- Welcome to debugging React ---
1491
+ // This error was thrown as a convenience so that you can use this stack
1492
+ // to find the callsite that caused this warning to fire.
1493
+ throw new Error(message);
1494
+ } catch (x) {}
1495
+ };
1496
+ }
1497
+
1498
+ function emptyFunctionThatReturnsNull() {
1499
+ return null;
1500
+ }
1501
+
1502
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
1503
+ /* global Symbol */
1504
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
1505
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
1506
+
1507
+ /**
1508
+ * Returns the iterator method function contained on the iterable object.
1509
+ *
1510
+ * Be sure to invoke the function with the iterable as context:
1511
+ *
1512
+ * var iteratorFn = getIteratorFn(myIterable);
1513
+ * if (iteratorFn) {
1514
+ * var iterator = iteratorFn.call(myIterable);
1515
+ * ...
1516
+ * }
1517
+ *
1518
+ * @param {?object} maybeIterable
1519
+ * @return {?function}
1520
+ */
1521
+ function getIteratorFn(maybeIterable) {
1522
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
1523
+ if (typeof iteratorFn === 'function') {
1524
+ return iteratorFn;
1525
+ }
1526
+ }
1527
+
1528
+ /**
1529
+ * Collection of methods that allow declaration and validation of props that are
1530
+ * supplied to React components. Example usage:
1531
+ *
1532
+ * var Props = require('ReactPropTypes');
1533
+ * var MyArticle = React.createClass({
1534
+ * propTypes: {
1535
+ * // An optional string prop named "description".
1536
+ * description: Props.string,
1537
+ *
1538
+ * // A required enum prop named "category".
1539
+ * category: Props.oneOf(['News','Photos']).isRequired,
1540
+ *
1541
+ * // A prop named "dialog" that requires an instance of Dialog.
1542
+ * dialog: Props.instanceOf(Dialog).isRequired
1543
+ * },
1544
+ * render: function() { ... }
1545
+ * });
1546
+ *
1547
+ * A more formal specification of how these methods are used:
1548
+ *
1549
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
1550
+ * decl := ReactPropTypes.{type}(.isRequired)?
1551
+ *
1552
+ * Each and every declaration produces a function with the same signature. This
1553
+ * allows the creation of custom validation functions. For example:
1554
+ *
1555
+ * var MyLink = React.createClass({
1556
+ * propTypes: {
1557
+ * // An optional string or URI prop named "href".
1558
+ * href: function(props, propName, componentName) {
1559
+ * var propValue = props[propName];
1560
+ * if (propValue != null && typeof propValue !== 'string' &&
1561
+ * !(propValue instanceof URI)) {
1562
+ * return new Error(
1563
+ * 'Expected a string or an URI for ' + propName + ' in ' +
1564
+ * componentName
1565
+ * );
1566
+ * }
1567
+ * }
1568
+ * },
1569
+ * render: function() {...}
1570
+ * });
1571
+ *
1572
+ * @internal
1573
+ */
1574
+
1575
+ var ANONYMOUS = '<<anonymous>>';
1576
+
1577
+ // Important!
1578
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
1579
+ var ReactPropTypes = {
1580
+ array: createPrimitiveTypeChecker('array'),
1581
+ bigint: createPrimitiveTypeChecker('bigint'),
1582
+ bool: createPrimitiveTypeChecker('boolean'),
1583
+ func: createPrimitiveTypeChecker('function'),
1584
+ number: createPrimitiveTypeChecker('number'),
1585
+ object: createPrimitiveTypeChecker('object'),
1586
+ string: createPrimitiveTypeChecker('string'),
1587
+ symbol: createPrimitiveTypeChecker('symbol'),
1588
+
1589
+ any: createAnyTypeChecker(),
1590
+ arrayOf: createArrayOfTypeChecker,
1591
+ element: createElementTypeChecker(),
1592
+ elementType: createElementTypeTypeChecker(),
1593
+ instanceOf: createInstanceTypeChecker,
1594
+ node: createNodeChecker(),
1595
+ objectOf: createObjectOfTypeChecker,
1596
+ oneOf: createEnumTypeChecker,
1597
+ oneOfType: createUnionTypeChecker,
1598
+ shape: createShapeTypeChecker,
1599
+ exact: createStrictShapeTypeChecker,
1600
+ };
1601
+
1602
+ /**
1603
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
1604
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
1605
+ */
1606
+ /*eslint-disable no-self-compare*/
1607
+ function is(x, y) {
1608
+ // SameValue algorithm
1609
+ if (x === y) {
1610
+ // Steps 1-5, 7-10
1611
+ // Steps 6.b-6.e: +0 != -0
1612
+ return x !== 0 || 1 / x === 1 / y;
1613
+ } else {
1614
+ // Step 6.a: NaN == NaN
1615
+ return x !== x && y !== y;
1616
+ }
1617
+ }
1618
+ /*eslint-enable no-self-compare*/
1619
+
1620
+ /**
1621
+ * We use an Error-like object for backward compatibility as people may call
1622
+ * PropTypes directly and inspect their output. However, we don't use real
1623
+ * Errors anymore. We don't inspect their stack anyway, and creating them
1624
+ * is prohibitively expensive if they are created too often, such as what
1625
+ * happens in oneOfType() for any type before the one that matched.
1626
+ */
1627
+ function PropTypeError(message, data) {
1628
+ this.message = message;
1629
+ this.data = data && typeof data === 'object' ? data: {};
1630
+ this.stack = '';
1631
+ }
1632
+ // Make `instanceof Error` still work for returned errors.
1633
+ PropTypeError.prototype = Error.prototype;
1634
+
1635
+ function createChainableTypeChecker(validate) {
1636
+ if (process.env.NODE_ENV !== 'production') {
1637
+ var manualPropTypeCallCache = {};
1638
+ var manualPropTypeWarningCount = 0;
1639
+ }
1640
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1641
+ componentName = componentName || ANONYMOUS;
1642
+ propFullName = propFullName || propName;
1643
+
1644
+ if (secret !== ReactPropTypesSecret) {
1645
+ if (throwOnDirectAccess) {
1646
+ // New behavior only for users of `prop-types` package
1647
+ var err = new Error(
1648
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1649
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
1650
+ 'Read more at http://fb.me/use-check-prop-types'
1651
+ );
1652
+ err.name = 'Invariant Violation';
1653
+ throw err;
1654
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1655
+ // Old behavior for people using React.PropTypes
1656
+ var cacheKey = componentName + ':' + propName;
1657
+ if (
1658
+ !manualPropTypeCallCache[cacheKey] &&
1659
+ // Avoid spamming the console because they are often not actionable except for lib authors
1660
+ manualPropTypeWarningCount < 3
1661
+ ) {
1662
+ printWarning(
1663
+ 'You are manually calling a React.PropTypes validation ' +
1664
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1665
+ 'and will throw in the standalone `prop-types` package. ' +
1666
+ 'You may be seeing this warning due to a third-party PropTypes ' +
1667
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1668
+ );
1669
+ manualPropTypeCallCache[cacheKey] = true;
1670
+ manualPropTypeWarningCount++;
1671
+ }
1672
+ }
1673
+ }
1674
+ if (props[propName] == null) {
1675
+ if (isRequired) {
1676
+ if (props[propName] === null) {
1677
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1678
+ }
1679
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1680
+ }
1681
+ return null;
1682
+ } else {
1683
+ return validate(props, propName, componentName, location, propFullName);
1684
+ }
1685
+ }
1686
+
1687
+ var chainedCheckType = checkType.bind(null, false);
1688
+ chainedCheckType.isRequired = checkType.bind(null, true);
1689
+
1690
+ return chainedCheckType;
1691
+ }
1692
+
1693
+ function createPrimitiveTypeChecker(expectedType) {
1694
+ function validate(props, propName, componentName, location, propFullName, secret) {
1695
+ var propValue = props[propName];
1696
+ var propType = getPropType(propValue);
1697
+ if (propType !== expectedType) {
1698
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
1699
+ // check, but we can offer a more precise error message here rather than
1700
+ // 'of type `object`'.
1701
+ var preciseType = getPreciseType(propValue);
1702
+
1703
+ return new PropTypeError(
1704
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
1705
+ {expectedType: expectedType}
1706
+ );
1707
+ }
1708
+ return null;
1709
+ }
1710
+ return createChainableTypeChecker(validate);
1711
+ }
1712
+
1713
+ function createAnyTypeChecker() {
1714
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1715
+ }
1716
+
1717
+ function createArrayOfTypeChecker(typeChecker) {
1718
+ function validate(props, propName, componentName, location, propFullName) {
1719
+ if (typeof typeChecker !== 'function') {
1720
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1721
+ }
1722
+ var propValue = props[propName];
1723
+ if (!Array.isArray(propValue)) {
1724
+ var propType = getPropType(propValue);
1725
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1726
+ }
1727
+ for (var i = 0; i < propValue.length; i++) {
1728
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1729
+ if (error instanceof Error) {
1730
+ return error;
1731
+ }
1732
+ }
1733
+ return null;
1734
+ }
1735
+ return createChainableTypeChecker(validate);
1736
+ }
1737
+
1738
+ function createElementTypeChecker() {
1739
+ function validate(props, propName, componentName, location, propFullName) {
1740
+ var propValue = props[propName];
1741
+ if (!isValidElement(propValue)) {
1742
+ var propType = getPropType(propValue);
1743
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1744
+ }
1745
+ return null;
1746
+ }
1747
+ return createChainableTypeChecker(validate);
1748
+ }
1749
+
1750
+ function createElementTypeTypeChecker() {
1751
+ function validate(props, propName, componentName, location, propFullName) {
1752
+ var propValue = props[propName];
1753
+ if (!ReactIs.isValidElementType(propValue)) {
1754
+ var propType = getPropType(propValue);
1755
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1756
+ }
1757
+ return null;
1758
+ }
1759
+ return createChainableTypeChecker(validate);
1760
+ }
1761
+
1762
+ function createInstanceTypeChecker(expectedClass) {
1763
+ function validate(props, propName, componentName, location, propFullName) {
1764
+ if (!(props[propName] instanceof expectedClass)) {
1765
+ var expectedClassName = expectedClass.name || ANONYMOUS;
1766
+ var actualClassName = getClassName(props[propName]);
1767
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1768
+ }
1769
+ return null;
1770
+ }
1771
+ return createChainableTypeChecker(validate);
1772
+ }
1773
+
1774
+ function createEnumTypeChecker(expectedValues) {
1775
+ if (!Array.isArray(expectedValues)) {
1776
+ if (process.env.NODE_ENV !== 'production') {
1777
+ if (arguments.length > 1) {
1778
+ printWarning(
1779
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1780
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1781
+ );
1782
+ } else {
1783
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
1784
+ }
1785
+ }
1786
+ return emptyFunctionThatReturnsNull;
1787
+ }
1788
+
1789
+ function validate(props, propName, componentName, location, propFullName) {
1790
+ var propValue = props[propName];
1791
+ for (var i = 0; i < expectedValues.length; i++) {
1792
+ if (is(propValue, expectedValues[i])) {
1793
+ return null;
1794
+ }
1795
+ }
1796
+
1797
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1798
+ var type = getPreciseType(value);
1799
+ if (type === 'symbol') {
1800
+ return String(value);
1801
+ }
1802
+ return value;
1803
+ });
1804
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1805
+ }
1806
+ return createChainableTypeChecker(validate);
1807
+ }
1808
+
1809
+ function createObjectOfTypeChecker(typeChecker) {
1810
+ function validate(props, propName, componentName, location, propFullName) {
1811
+ if (typeof typeChecker !== 'function') {
1812
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1813
+ }
1814
+ var propValue = props[propName];
1815
+ var propType = getPropType(propValue);
1816
+ if (propType !== 'object') {
1817
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1818
+ }
1819
+ for (var key in propValue) {
1820
+ if (has(propValue, key)) {
1821
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1822
+ if (error instanceof Error) {
1823
+ return error;
1824
+ }
1825
+ }
1826
+ }
1827
+ return null;
1828
+ }
1829
+ return createChainableTypeChecker(validate);
1830
+ }
1831
+
1832
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
1833
+ if (!Array.isArray(arrayOfTypeCheckers)) {
1834
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1835
+ return emptyFunctionThatReturnsNull;
1836
+ }
1837
+
1838
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1839
+ var checker = arrayOfTypeCheckers[i];
1840
+ if (typeof checker !== 'function') {
1841
+ printWarning(
1842
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1843
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1844
+ );
1845
+ return emptyFunctionThatReturnsNull;
1846
+ }
1847
+ }
1848
+
1849
+ function validate(props, propName, componentName, location, propFullName) {
1850
+ var expectedTypes = [];
1851
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1852
+ var checker = arrayOfTypeCheckers[i];
1853
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1854
+ if (checkerResult == null) {
1855
+ return null;
1856
+ }
1857
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1858
+ expectedTypes.push(checkerResult.data.expectedType);
1859
+ }
1860
+ }
1861
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1862
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1863
+ }
1864
+ return createChainableTypeChecker(validate);
1865
+ }
1866
+
1867
+ function createNodeChecker() {
1868
+ function validate(props, propName, componentName, location, propFullName) {
1869
+ if (!isNode(props[propName])) {
1870
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1871
+ }
1872
+ return null;
1873
+ }
1874
+ return createChainableTypeChecker(validate);
1875
+ }
1876
+
1877
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1878
+ return new PropTypeError(
1879
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1880
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1881
+ );
1882
+ }
1883
+
1884
+ function createShapeTypeChecker(shapeTypes) {
1885
+ function validate(props, propName, componentName, location, propFullName) {
1886
+ var propValue = props[propName];
1887
+ var propType = getPropType(propValue);
1888
+ if (propType !== 'object') {
1889
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1890
+ }
1891
+ for (var key in shapeTypes) {
1892
+ var checker = shapeTypes[key];
1893
+ if (typeof checker !== 'function') {
1894
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1895
+ }
1896
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1897
+ if (error) {
1898
+ return error;
1899
+ }
1900
+ }
1901
+ return null;
1902
+ }
1903
+ return createChainableTypeChecker(validate);
1904
+ }
1905
+
1906
+ function createStrictShapeTypeChecker(shapeTypes) {
1907
+ function validate(props, propName, componentName, location, propFullName) {
1908
+ var propValue = props[propName];
1909
+ var propType = getPropType(propValue);
1910
+ if (propType !== 'object') {
1911
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1912
+ }
1913
+ // We need to check all keys in case some are required but missing from props.
1914
+ var allKeys = assign({}, props[propName], shapeTypes);
1915
+ for (var key in allKeys) {
1916
+ var checker = shapeTypes[key];
1917
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1918
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1919
+ }
1920
+ if (!checker) {
1921
+ return new PropTypeError(
1922
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1923
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1924
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1925
+ );
1926
+ }
1927
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1928
+ if (error) {
1929
+ return error;
1930
+ }
1931
+ }
1932
+ return null;
1933
+ }
1934
+
1935
+ return createChainableTypeChecker(validate);
1936
+ }
1937
+
1938
+ function isNode(propValue) {
1939
+ switch (typeof propValue) {
1940
+ case 'number':
1941
+ case 'string':
1942
+ case 'undefined':
1943
+ return true;
1944
+ case 'boolean':
1945
+ return !propValue;
1946
+ case 'object':
1947
+ if (Array.isArray(propValue)) {
1948
+ return propValue.every(isNode);
1949
+ }
1950
+ if (propValue === null || isValidElement(propValue)) {
1951
+ return true;
1952
+ }
1953
+
1954
+ var iteratorFn = getIteratorFn(propValue);
1955
+ if (iteratorFn) {
1956
+ var iterator = iteratorFn.call(propValue);
1957
+ var step;
1958
+ if (iteratorFn !== propValue.entries) {
1959
+ while (!(step = iterator.next()).done) {
1960
+ if (!isNode(step.value)) {
1961
+ return false;
1962
+ }
1963
+ }
1964
+ } else {
1965
+ // Iterator will provide entry [k,v] tuples rather than values.
1966
+ while (!(step = iterator.next()).done) {
1967
+ var entry = step.value;
1968
+ if (entry) {
1969
+ if (!isNode(entry[1])) {
1970
+ return false;
1971
+ }
1972
+ }
1973
+ }
1974
+ }
1975
+ } else {
1976
+ return false;
1977
+ }
1978
+
1979
+ return true;
1980
+ default:
1981
+ return false;
1982
+ }
1983
+ }
1984
+
1985
+ function isSymbol(propType, propValue) {
1986
+ // Native Symbol.
1987
+ if (propType === 'symbol') {
1988
+ return true;
1989
+ }
1990
+
1991
+ // falsy value can't be a Symbol
1992
+ if (!propValue) {
1993
+ return false;
1994
+ }
1995
+
1996
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1997
+ if (propValue['@@toStringTag'] === 'Symbol') {
1998
+ return true;
1999
+ }
2000
+
2001
+ // Fallback for non-spec compliant Symbols which are polyfilled.
2002
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
2003
+ return true;
2004
+ }
2005
+
2006
+ return false;
2007
+ }
2008
+
2009
+ // Equivalent of `typeof` but with special handling for array and regexp.
2010
+ function getPropType(propValue) {
2011
+ var propType = typeof propValue;
2012
+ if (Array.isArray(propValue)) {
2013
+ return 'array';
2014
+ }
2015
+ if (propValue instanceof RegExp) {
2016
+ // Old webkits (at least until Android 4.0) return 'function' rather than
2017
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
2018
+ // passes PropTypes.object.
2019
+ return 'object';
2020
+ }
2021
+ if (isSymbol(propType, propValue)) {
2022
+ return 'symbol';
2023
+ }
2024
+ return propType;
2025
+ }
2026
+
2027
+ // This handles more types than `getPropType`. Only used for error messages.
2028
+ // See `createPrimitiveTypeChecker`.
2029
+ function getPreciseType(propValue) {
2030
+ if (typeof propValue === 'undefined' || propValue === null) {
2031
+ return '' + propValue;
2032
+ }
2033
+ var propType = getPropType(propValue);
2034
+ if (propType === 'object') {
2035
+ if (propValue instanceof Date) {
2036
+ return 'date';
2037
+ } else if (propValue instanceof RegExp) {
2038
+ return 'regexp';
2039
+ }
2040
+ }
2041
+ return propType;
2042
+ }
2043
+
2044
+ // Returns a string that is postfixed to a warning about an invalid type.
2045
+ // For example, "undefined" or "of type array"
2046
+ function getPostfixForTypeWarning(value) {
2047
+ var type = getPreciseType(value);
2048
+ switch (type) {
2049
+ case 'array':
2050
+ case 'object':
2051
+ return 'an ' + type;
2052
+ case 'boolean':
2053
+ case 'date':
2054
+ case 'regexp':
2055
+ return 'a ' + type;
2056
+ default:
2057
+ return type;
2058
+ }
2059
+ }
2060
+
2061
+ // Returns class name of the object, if any.
2062
+ function getClassName(propValue) {
2063
+ if (!propValue.constructor || !propValue.constructor.name) {
2064
+ return ANONYMOUS;
2065
+ }
2066
+ return propValue.constructor.name;
2067
+ }
2068
+
2069
+ ReactPropTypes.checkPropTypes = checkPropTypes;
2070
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
2071
+ ReactPropTypes.PropTypes = ReactPropTypes;
2072
+
2073
+ return ReactPropTypes;
2074
+ };
2075
+ return factoryWithTypeCheckers;
2076
+ }
2077
+
2078
+ /**
2079
+ * Copyright (c) 2013-present, Facebook, Inc.
2080
+ *
2081
+ * This source code is licensed under the MIT license found in the
2082
+ * LICENSE file in the root directory of this source tree.
2083
+ */
2084
+
2085
+ var factoryWithThrowingShims;
2086
+ var hasRequiredFactoryWithThrowingShims;
2087
+
2088
+ function requireFactoryWithThrowingShims () {
2089
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
2090
+ hasRequiredFactoryWithThrowingShims = 1;
2091
+
2092
+ var ReactPropTypesSecret = requireReactPropTypesSecret();
2093
+
2094
+ function emptyFunction() {}
2095
+ function emptyFunctionWithReset() {}
2096
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
2097
+
2098
+ factoryWithThrowingShims = function() {
2099
+ function shim(props, propName, componentName, location, propFullName, secret) {
2100
+ if (secret === ReactPropTypesSecret) {
2101
+ // It is still safe when called from React.
2102
+ return;
2103
+ }
2104
+ var err = new Error(
2105
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
2106
+ 'Use PropTypes.checkPropTypes() to call them. ' +
2107
+ 'Read more at http://fb.me/use-check-prop-types'
2108
+ );
2109
+ err.name = 'Invariant Violation';
2110
+ throw err;
2111
+ } shim.isRequired = shim;
2112
+ function getShim() {
2113
+ return shim;
2114
+ } // Important!
2115
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
2116
+ var ReactPropTypes = {
2117
+ array: shim,
2118
+ bigint: shim,
2119
+ bool: shim,
2120
+ func: shim,
2121
+ number: shim,
2122
+ object: shim,
2123
+ string: shim,
2124
+ symbol: shim,
2125
+
2126
+ any: shim,
2127
+ arrayOf: getShim,
2128
+ element: shim,
2129
+ elementType: shim,
2130
+ instanceOf: getShim,
2131
+ node: shim,
2132
+ objectOf: getShim,
2133
+ oneOf: getShim,
2134
+ oneOfType: getShim,
2135
+ shape: getShim,
2136
+ exact: getShim,
2137
+
2138
+ checkPropTypes: emptyFunctionWithReset,
2139
+ resetWarningCache: emptyFunction
2140
+ };
2141
+
2142
+ ReactPropTypes.PropTypes = ReactPropTypes;
2143
+
2144
+ return ReactPropTypes;
2145
+ };
2146
+ return factoryWithThrowingShims;
2147
+ }
2148
+
2149
+ /**
2150
+ * Copyright (c) 2013-present, Facebook, Inc.
2151
+ *
2152
+ * This source code is licensed under the MIT license found in the
2153
+ * LICENSE file in the root directory of this source tree.
2154
+ */
2155
+
2156
+ if (process.env.NODE_ENV !== 'production') {
2157
+ var ReactIs = requireReactIs();
2158
+
2159
+ // By explicitly using `prop-types` you are opting into new development behavior.
2160
+ // http://fb.me/prop-types-in-prod
2161
+ var throwOnDirectAccess = true;
2162
+ propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
2163
+ } else {
2164
+ // By explicitly using `prop-types` you are opting into new production behavior.
2165
+ // http://fb.me/prop-types-in-prod
2166
+ propTypes.exports = requireFactoryWithThrowingShims()();
2167
+ }
2168
+
2169
+ var MemoizedEditorContent = /*#__PURE__*/React.memo(EditorContent);
2170
+ var EmailPreview = withT(function (_ref) {
2171
+ var t = _ref.t,
2172
+ _ref$to = _ref.to,
2173
+ to = _ref$to === void 0 ? [] : _ref$to,
2174
+ from = _ref.from,
2175
+ subject = _ref.subject,
2176
+ body = _ref.body,
2177
+ productName = _ref.productName,
2178
+ actionButtonText = _ref.actionButtonText,
2179
+ logo = _ref.logo,
2180
+ _ref$className = _ref.className,
2181
+ className = _ref$className === void 0 ? "" : _ref$className;
2182
+ return /*#__PURE__*/React.createElement("div", {
2183
+ "data-cy": "email-preview-card",
2184
+ "data-testid": "email-preview",
2185
+ className: classnames("neeto-ui-border-gray-300 neeto-ui-shadow-m neeto-ui-bg-white flex flex-1 flex-col border", _defineProperty({}, className, className))
2186
+ }, /*#__PURE__*/React.createElement("div", {
2187
+ className: "neeto-ui-border-gray-300 space-y-3 divide-y divide-gray-200 border-b p-6"
2188
+ }, /*#__PURE__*/React.createElement("div", {
2189
+ className: "flex gap-2",
2190
+ "data-cy": "email-send-to-preview",
2191
+ "data-testid": "email-to-block"
2192
+ }, /*#__PURE__*/React.createElement(Typography, {
2193
+ className: "neeto-ui-text-gray-500",
2194
+ lineHeight: "normal",
2195
+ style: "body2"
2196
+ }, t("neetoMolecules.emailPreview.to"), ":"), isPresent(to) && isNotEmpty(to) ? /*#__PURE__*/React.createElement(Typography, {
2197
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
2198
+ lineHeight: "normal",
2199
+ style: "body2"
2200
+ }, to.join(", ")) : /*#__PURE__*/React.createElement("div", {
2201
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full mt-2 h-2 w-40"
2202
+ })), from && /*#__PURE__*/React.createElement("div", {
2203
+ className: "flex items-center gap-2 pt-3"
2204
+ }, /*#__PURE__*/React.createElement(Typography, {
2205
+ className: "neeto-ui-text-gray-500",
2206
+ lineHeight: "normal",
2207
+ style: "body2"
2208
+ }, t("neetoMolecules.emailPreview.from"), ":"), /*#__PURE__*/React.createElement(Typography, {
2209
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
2210
+ "data-cy": "email-send-from-preview",
2211
+ lineHeight: "normal",
2212
+ style: "body2"
2213
+ }, from)), /*#__PURE__*/React.createElement("div", {
2214
+ className: "flex items-center gap-2 pt-3"
2215
+ }, /*#__PURE__*/React.createElement(Typography, {
2216
+ className: "neeto-ui-text-gray-500",
2217
+ lineHeight: "normal",
2218
+ style: "body2"
2219
+ }, t("neetoMolecules.emailPreview.subject"), ":"), /*#__PURE__*/React.createElement(Typography, {
2220
+ className: "neeto-ui-text-gray-800 min-w-0 flex-grow break-words",
2221
+ "data-cy": "email-subject-preview",
2222
+ lineHeight: "normal",
2223
+ style: "body2"
2224
+ }, subject || /*#__PURE__*/React.createElement("span", {
2225
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-40"
2226
+ })))), /*#__PURE__*/React.createElement("div", {
2227
+ className: "neeto-ui-text-gray-800 flex flex-1 flex-col justify-between space-y-6 p-6 pr-10 text-base leading-relaxed",
2228
+ "data-cy": "email-body-preview-container"
2229
+ }, body ? /*#__PURE__*/React.createElement(MemoizedEditorContent, {
2230
+ content: body
2231
+ }) : /*#__PURE__*/React.createElement("div", {
2232
+ className: "space-y-4"
2233
+ }, /*#__PURE__*/React.createElement("div", {
2234
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
2235
+ }), /*#__PURE__*/React.createElement("div", {
2236
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-72"
2237
+ }), /*#__PURE__*/React.createElement("div", {
2238
+ className: "neeto-ui-bg-gray-300 neeto-ui-rounded-full h-2 w-80"
2239
+ })), actionButtonText && /*#__PURE__*/React.createElement("div", {
2240
+ className: "mt-6 flex w-full items-center justify-center"
2241
+ }, /*#__PURE__*/React.createElement(Button, {
2242
+ className: "pointer-events-none",
2243
+ label: actionButtonText
2244
+ })), logo && /*#__PURE__*/React.createElement("img", {
2245
+ alt: t("neetoMolecules.emailPreview.logoAltText"),
2246
+ className: "h-20 w-36 object-cover",
2247
+ "data-cy": "company-logo-preview",
2248
+ src: logo
2249
+ })), productName && /*#__PURE__*/React.createElement("div", {
2250
+ className: "neeto-ui-bg-gray-100 mt-auto p-2",
2251
+ "data-testid": "product-name-block"
2252
+ }, /*#__PURE__*/React.createElement(Typography, {
2253
+ className: "neeto-ui-text-gray-600 text-center leading-6",
2254
+ style: "body3"
2255
+ }, t("neetoMolecules.emailPreview.poweredBy"), /*#__PURE__*/React.createElement("span", {
2256
+ className: "neeto-ui-text-gray-800 font-medium"
2257
+ }, productName))));
2258
+ });
2259
+ EmailPreview.propTypes = {
2260
+ /**
2261
+ * The value of the send-to field.
2262
+ */
2263
+ to: propTypes.exports.arrayOf(propTypes.exports.string),
2264
+ /**
2265
+ * The value of the send-from field.
2266
+ */
2267
+ from: propTypes.exports.string,
2268
+ /**
2269
+ * The subject of the email.
2270
+ */
2271
+ subject: propTypes.exports.string,
2272
+ /**
2273
+ * The body of the email.
2274
+ */
2275
+ body: propTypes.exports.string,
2276
+ /**
2277
+ * The name of the neeto product to be previewed.
2278
+ */
2279
+ productName: propTypes.exports.string,
2280
+ /**
2281
+ * The text to be shown in the action button.
2282
+ */
2283
+ actionButtonText: propTypes.exports.string,
2284
+ /**
2285
+ * Source link for the company logo.
2286
+ */
2287
+ logo: propTypes.exports.string
2288
+ };
2289
+
2290
+ export { EmailForm, EmailFormProvider, EmailPreview };
2291
+ //# sourceMappingURL=EmailForm.js.map