@bigbinary/neeto-molecules 1.1.9 → 1.1.11

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 (474) hide show
  1. package/dist/AutoSaveInput/autosaveinput.scss +15 -0
  2. package/dist/AutoSaveInput/constants.js +13 -0
  3. package/dist/AutoSaveInput/index.js +124 -0
  4. package/dist/AutoSaveInput/utils.js +10 -0
  5. package/dist/Breadcrumbs/breadcrumbs.scss +33 -0
  6. package/dist/Breadcrumbs/index.js +31 -0
  7. package/dist/BrowserSupport/Callout.js +15 -0
  8. package/dist/BrowserSupport/ContactUs.js +21 -0
  9. package/dist/BrowserSupport/DownloadLink.js +17 -0
  10. package/dist/BrowserSupport/PartialSupportedBrowserVersion.js +17 -0
  11. package/dist/BrowserSupport/UnknownBrowser.js +13 -0
  12. package/dist/BrowserSupport/UnsupportedBrowser.js +24 -0
  13. package/dist/BrowserSupport/UnsupportedBrowserMessage.js +22 -0
  14. package/dist/BrowserSupport/UnsupportedBrowserVersion.js +27 -0
  15. package/dist/BrowserSupport/UnsupportedVersionMessage.js +30 -0
  16. package/dist/BrowserSupport/browsersupport.scss +71 -0
  17. package/dist/BrowserSupport/constants.js +63 -0
  18. package/dist/BrowserSupport/index.js +58 -0
  19. package/dist/BrowserSupport/utils.js +32 -0
  20. package/dist/CalendarView/CustomDatePicker.js +87 -0
  21. package/dist/CalendarView/Header.js +53 -0
  22. package/dist/CalendarView/constants.js +19 -0
  23. package/dist/CalendarView/index.js +83 -0
  24. package/dist/CalendarView/utils.js +50 -0
  25. package/dist/Codeblock/index.js +30 -0
  26. package/dist/{Columns.js → Columns/index.js} +13 -130
  27. package/dist/Columns/utils.js +20 -0
  28. package/dist/ConfirmationModal/constants.js +3 -0
  29. package/dist/{ConfirmationModal.js → ConfirmationModal/index.js} +7 -23
  30. package/dist/ConfirmationModal/utils.js +10 -0
  31. package/dist/Container/container.scss +21 -0
  32. package/dist/Container/index.js +23 -0
  33. package/dist/CopyToClipboardButton/constants.js +13 -0
  34. package/dist/CopyToClipboardButton/copyToClipboard.scss +22 -0
  35. package/dist/CopyToClipboardButton/index.js +59 -0
  36. package/dist/CustomDomain/index.js +98 -0
  37. package/dist/CustomDomainDashboard/DeleteAlert.js +28 -0
  38. package/dist/CustomDomainDashboard/Header.js +32 -0
  39. package/dist/CustomDomainDashboard/Manage/Record.js +42 -0
  40. package/dist/CustomDomainDashboard/Manage/StatusInfo.js +21 -0
  41. package/dist/CustomDomainDashboard/Manage/TagBlock.js +36 -0
  42. package/dist/CustomDomainDashboard/Manage/constants.js +4 -0
  43. package/dist/CustomDomainDashboard/Manage/index.js +124 -0
  44. package/dist/CustomDomainDashboard/Manage/utils.js +8 -0
  45. package/dist/CustomDomainDashboard/api.js +35 -0
  46. package/dist/CustomDomainDashboard/constants.js +2 -0
  47. package/dist/CustomDomainDashboard/index.js +118 -0
  48. package/dist/CustomDomainDashboard/useCustomDomainApi.js +71 -0
  49. package/dist/CustomDomainDashboard/utils.js +84 -0
  50. package/dist/{DateFormat.js → DateFormat/index.js} +8 -25
  51. package/dist/DateRangeFilter/index.js +60 -0
  52. package/dist/DateRangeFilter/utils.js +113 -0
  53. package/dist/DynamicVariables/dynamic-variables.scss +34 -0
  54. package/dist/DynamicVariables/index.js +59 -0
  55. package/dist/DynamicVariables/utils.js +37 -0
  56. package/dist/EmailForm/EmailForm.js +97 -0
  57. package/dist/EmailForm/EmailFormProvider.js +45 -0
  58. package/dist/EmailForm/EmailPreview.js +129 -0
  59. package/dist/EmailForm/ReplyToField.js +55 -0
  60. package/dist/EmailForm/SendToField.js +27 -0
  61. package/dist/EmailForm/SubjectField.js +64 -0
  62. package/dist/EmailForm/constants.js +33 -0
  63. package/dist/EmailForm/contexts/EmailForm.js +7 -0
  64. package/dist/EmailForm/index.js +4 -0
  65. package/dist/EmailForm/utils.js +10 -0
  66. package/dist/EmailPreview/index.js +2 -0
  67. package/dist/{ErrorPage.js → ErrorPage/constants.js} +36 -175
  68. package/dist/ErrorPage/index.js +78 -0
  69. package/dist/Header/Breadcrumbs.js +31 -0
  70. package/dist/Header/Dropdown.js +12 -0
  71. package/dist/Header/constants.js +6 -0
  72. package/dist/Header/header.scss +121 -0
  73. package/dist/Header/index.js +61 -0
  74. package/dist/IconPicker/Icon.js +34 -0
  75. package/dist/IconPicker/NoResults.js +12 -0
  76. package/dist/IconPicker/constants.js +8 -0
  77. package/dist/IconPicker/icon-picker.scss +1 -0
  78. package/dist/IconPicker/index.js +164 -0
  79. package/dist/ImageWithFallback/ImagePlaceholder.js +16 -0
  80. package/dist/ImageWithFallback/index.js +31 -0
  81. package/dist/IntegrationCard/Dropdown.js +45 -0
  82. package/dist/IntegrationCard/Status.js +25 -0
  83. package/dist/IntegrationCard/index.js +128 -0
  84. package/dist/IntegrationDisconnectAlert/index.js +36 -0
  85. package/dist/{IntegrationWalkthroughModal.js → IntegrationWalkthroughModal/index.js} +6 -8
  86. package/dist/IpRestriction/AllowedIpRanges.js +72 -0
  87. package/dist/IpRestriction/CurrentIp.js +26 -0
  88. package/dist/IpRestriction/FormRow.js +77 -0
  89. package/dist/IpRestriction/Row.js +86 -0
  90. package/dist/IpRestriction/apis/allowed_ip_ranges.js +28 -0
  91. package/dist/IpRestriction/apis/current_ip.js +11 -0
  92. package/dist/IpRestriction/apis/ip_restriction.js +16 -0
  93. package/dist/IpRestriction/constants.js +11 -0
  94. package/dist/IpRestriction/hooks/reactQuery/useAllowedIpRanges.js +34 -0
  95. package/dist/IpRestriction/hooks/reactQuery/useCurrentIp.js +10 -0
  96. package/dist/IpRestriction/hooks/reactQuery/useIpRestrictions.js +18 -0
  97. package/dist/IpRestriction/index.js +102 -0
  98. package/dist/IpRestriction/utils.js +67 -0
  99. package/dist/KeyboardShortcuts/Pane/HotKey.js +44 -0
  100. package/dist/KeyboardShortcuts/Pane/HotKeyList.js +42 -0
  101. package/dist/KeyboardShortcuts/Pane/constants.js +25 -0
  102. package/dist/KeyboardShortcuts/Pane/index.js +61 -0
  103. package/dist/KeyboardShortcuts/Pane/keyboard-shortcuts.scss +5 -0
  104. package/dist/KeyboardShortcuts/Pane/utils.js +66 -0
  105. package/dist/KeyboardShortcuts/hooks/useKeyboardShortcutsPaneState.js +31 -0
  106. package/dist/KeyboardShortcuts/index.js +9 -0
  107. package/dist/LoginPage/Form.js +57 -0
  108. package/dist/LoginPage/constants.js +12 -0
  109. package/dist/LoginPage/index.js +103 -0
  110. package/dist/MenuBar/AddNew.js +25 -0
  111. package/dist/MenuBar/Block.js +60 -0
  112. package/dist/MenuBar/Item.js +32 -0
  113. package/dist/MenuBar/Search.js +39 -0
  114. package/dist/MenuBar/SubTitle.js +23 -0
  115. package/dist/MenuBar/index.js +46 -0
  116. package/dist/MenuBar/menubar.scss +154 -0
  117. package/dist/Metadata/Block.js +30 -0
  118. package/dist/Metadata/DetailsBlock.js +86 -0
  119. package/dist/Metadata/constants.js +9 -0
  120. package/dist/Metadata/index.js +29 -0
  121. package/dist/Metadata/metadata.scss +15 -0
  122. package/dist/MoreDropdown/constants.js +25 -0
  123. package/dist/{MoreDropdown.js → MoreDropdown/index.js} +9 -102
  124. package/dist/NavigationHeader/LeftBlock.js +32 -0
  125. package/dist/NavigationHeader/Navigation.js +24 -0
  126. package/dist/NavigationHeader/RightBlock.js +68 -0
  127. package/dist/NavigationHeader/constants.js +11 -0
  128. package/dist/NavigationHeader/index.js +19 -0
  129. package/dist/NavigationHeader/navigation-header.scss +3 -0
  130. package/dist/NeetoWidget/CodeBlock.js +57 -0
  131. package/dist/NeetoWidget/CodeSnippet.js +119 -0
  132. package/dist/NeetoWidget/EmbedCode.js +281 -0
  133. package/dist/NeetoWidget/Main.js +19 -0
  134. package/dist/NeetoWidget/SelectionSwitches/TooltipSwitch.js +25 -0
  135. package/dist/NeetoWidget/SelectionSwitches/index.js +44 -0
  136. package/dist/NeetoWidget/SyntaxHighlighter.js +17 -0
  137. package/dist/NeetoWidget/api.js +20 -0
  138. package/dist/NeetoWidget/constants.js +62 -0
  139. package/dist/NeetoWidget/hooks/useForceUpdate.js +14 -0
  140. package/dist/NeetoWidget/index.js +7 -0
  141. package/dist/NeetoWidget/mutations.js +9 -0
  142. package/dist/NeetoWidget/queries.js +32 -0
  143. package/dist/NeetoWidget/utils.js +83 -0
  144. package/dist/PageLoader/index.js +81 -0
  145. package/dist/PageLoader/page-loader.scss +95 -0
  146. package/dist/PhoneNumber/CountryPicker/SingleValue.js +21 -0
  147. package/dist/PhoneNumber/CountryPicker/constants.js +26 -0
  148. package/dist/PhoneNumber/CountryPicker/index.js +59 -0
  149. package/dist/PhoneNumber/FormikPhoneNumberInput.js +21 -0
  150. package/dist/PhoneNumber/PhoneNumber.js +30 -0
  151. package/dist/PhoneNumber/PhoneNumberInput.js +79 -0
  152. package/dist/PhoneNumber/index.js +5 -0
  153. package/dist/PhoneNumber/utils.js +55 -0
  154. package/dist/PublishBlock/AlertBlock.js +14 -0
  155. package/dist/PublishBlock/index.js +100 -0
  156. package/dist/PublishBlock/publish-block.scss +25 -0
  157. package/dist/Rename/DummySpan.js +21 -0
  158. package/dist/Rename/constants.js +1 -0
  159. package/dist/Rename/index.js +191 -0
  160. package/dist/Rename/rename.scss +69 -0
  161. package/dist/Rename/utils.js +10 -0
  162. package/dist/ResponsiveDevicePicker/constants.js +19 -0
  163. package/dist/ResponsiveDevicePicker/index.js +36 -0
  164. package/dist/Schedule/DisplayAvailability.js +58 -0
  165. package/dist/Schedule/Fields.js +43 -0
  166. package/dist/Schedule/Form/ScheduleRow.js +125 -0
  167. package/dist/Schedule/Form/constants.js +20 -0
  168. package/dist/Schedule/Form/index.js +144 -0
  169. package/dist/Schedule/Form/utils.js +63 -0
  170. package/dist/Schedule/Header.js +76 -0
  171. package/dist/Schedule/ScheduleContext.js +8 -0
  172. package/dist/Schedule/constants.js +8 -0
  173. package/dist/Schedule/dayjsExtended/constants.js +1 -0
  174. package/dist/Schedule/dayjsExtended/index.js +14 -0
  175. package/dist/Schedule/dayjsExtended/range.js +73 -0
  176. package/dist/Schedule/index.js +80 -0
  177. package/dist/Schedule/utils.js +152 -0
  178. package/dist/Scrollable/constants.js +8 -0
  179. package/dist/Scrollable/index.js +26 -0
  180. package/dist/Scrollable/scrollable.scss +32 -0
  181. package/dist/Security/AllowedKeywords/Add.js +38 -0
  182. package/dist/Security/AllowedKeywords/index.js +38 -0
  183. package/dist/Security/PasswordBlock.js +31 -0
  184. package/dist/Security/RadioBlock.js +38 -0
  185. package/dist/Security/api.js +12 -0
  186. package/dist/Security/constants.js +58 -0
  187. package/dist/Security/index.js +68 -0
  188. package/dist/Security/useSecurityApi.js +22 -0
  189. package/dist/Security/utils.js +31 -0
  190. package/dist/SendToFields/FilePicker.js +34 -0
  191. package/dist/SendToFields/constants.js +6 -0
  192. package/dist/SendToFields/index.js +102 -0
  193. package/dist/SendToFields/utils.js +54 -0
  194. package/dist/Settings/Category.js +30 -0
  195. package/dist/Settings/Item.js +38 -0
  196. package/dist/Settings/index.js +37 -0
  197. package/dist/Settings/utils.js +4 -0
  198. package/dist/ShareViaEmail/EmailBodyEditor.js +22 -0
  199. package/dist/ShareViaEmail/FilePicker.js +43 -0
  200. package/dist/ShareViaEmail/Form.js +101 -0
  201. package/dist/ShareViaEmail/FormikDatePicker.js +24 -0
  202. package/dist/ShareViaEmail/constants.js +14 -0
  203. package/dist/ShareViaEmail/index.js +89 -0
  204. package/dist/ShareViaEmail/utils.js +72 -0
  205. package/dist/ShareViaLink/EditURL.js +74 -0
  206. package/dist/ShareViaLink/Link.js +105 -0
  207. package/dist/ShareViaLink/QRCode.js +41 -0
  208. package/dist/ShareViaLink/RegenerateURL.js +47 -0
  209. package/dist/ShareViaLink/SocialMedia.js +52 -0
  210. package/dist/ShareViaLink/constants.js +25 -0
  211. package/dist/ShareViaLink/edit-url.scss +8 -0
  212. package/dist/ShareViaLink/index.js +46 -0
  213. package/dist/ShareViaLink/utils.js +47 -0
  214. package/dist/Sidebar/AppSwitcher/AppLink.js +45 -0
  215. package/dist/Sidebar/AppSwitcher/Backdrop.js +13 -0
  216. package/dist/Sidebar/AppSwitcher/Body.js +65 -0
  217. package/dist/Sidebar/AppSwitcher/Portal.js +27 -0
  218. package/dist/Sidebar/AppSwitcher/appswitcher.scss +164 -0
  219. package/dist/Sidebar/AppSwitcher/index.js +47 -0
  220. package/dist/Sidebar/AppSwitcher/utils.js +25 -0
  221. package/dist/Sidebar/Chevron.js +14 -0
  222. package/dist/Sidebar/FeaturedTooltip.js +19 -0
  223. package/dist/Sidebar/Footer/AppSwitcherButton.js +48 -0
  224. package/dist/Sidebar/Footer/ProfileButton.js +30 -0
  225. package/dist/Sidebar/Footer/index.js +56 -0
  226. package/dist/Sidebar/Footer/utils.js +39 -0
  227. package/dist/Sidebar/Header.js +33 -0
  228. package/dist/Sidebar/HelpSection/HelpSectionMenu.js +52 -0
  229. package/dist/Sidebar/HelpSection/index.js +32 -0
  230. package/dist/Sidebar/Links.js +112 -0
  231. package/dist/Sidebar/NavIconWrapper.js +20 -0
  232. package/dist/Sidebar/ProfileSection/LinkSection.js +36 -0
  233. package/dist/Sidebar/ProfileSection/ProfileMenu.js +48 -0
  234. package/dist/Sidebar/ProfileSection/index.js +42 -0
  235. package/dist/Sidebar/constants.js +40 -0
  236. package/dist/Sidebar/index.js +94 -0
  237. package/dist/Sidebar/sidebar.scss +379 -0
  238. package/dist/Sidebar/utils.js +18 -0
  239. package/dist/SubHeader/RightBlock/Columns.js +35 -0
  240. package/dist/SubHeader/RightBlock/Download.js +28 -0
  241. package/dist/SubHeader/RightBlock/Filter.js +31 -0
  242. package/dist/SubHeader/RightBlock/index.js +21 -0
  243. package/dist/SubHeader/RightBlock/utils.js +13 -0
  244. package/dist/SubHeader/index.js +28 -0
  245. package/dist/SubHeader/subheader.scss +78 -0
  246. package/dist/TableWrapper/index.js +18 -0
  247. package/dist/ThemeSidebar/Customize/Logo.js +39 -0
  248. package/dist/ThemeSidebar/Customize/Properties.js +170 -0
  249. package/dist/ThemeSidebar/Customize/index.js +66 -0
  250. package/dist/ThemeSidebar/Themes/ThemeCard.js +135 -0
  251. package/dist/ThemeSidebar/Themes/index.js +110 -0
  252. package/dist/ThemeSidebar/TitleBar.js +62 -0
  253. package/dist/ThemeSidebar/constants.js +127 -0
  254. package/dist/ThemeSidebar/fields/AlignmentBlock.js +50 -0
  255. package/dist/ThemeSidebar/fields/Card.js +19 -0
  256. package/dist/ThemeSidebar/fields/ColorBlock.js +19 -0
  257. package/dist/ThemeSidebar/fields/FontPickerBlock.js +35 -0
  258. package/dist/ThemeSidebar/fields/ImageBlock/ImageUploader.js +67 -0
  259. package/dist/ThemeSidebar/fields/ImageBlock/ProgressBar.js +22 -0
  260. package/dist/ThemeSidebar/fields/ImageBlock/index.js +55 -0
  261. package/dist/ThemeSidebar/fields/SelectBlock.js +24 -0
  262. package/dist/ThemeSidebar/fields/SliderBlock.js +30 -0
  263. package/dist/ThemeSidebar/fields/SwitchBlock.js +17 -0
  264. package/dist/ThemeSidebar/fields/TextBlock.js +13 -0
  265. package/dist/ThemeSidebar/fields/slider.scss +199 -0
  266. package/dist/ThemeSidebar/hooks/useDirectUploadDropzone.js +149 -0
  267. package/dist/ThemeSidebar/index.js +118 -0
  268. package/dist/ThemeSidebar/themeSidebar.scss +45 -0
  269. package/dist/ThemeSidebar/utils.js +169 -0
  270. package/dist/TimeFormat/index.js +3 -0
  271. package/dist/TimezoneMismatchModal/apis/time_zone.js +9 -0
  272. package/dist/TimezoneMismatchModal/index.js +83 -0
  273. package/dist/TimezoneMismatchModal/useTimeZoneApi.js +10 -0
  274. package/dist/TimezoneMismatchModal/utils.js +12 -0
  275. package/dist/ToggleFeatureCard/ToolTipSwitch.js +31 -0
  276. package/dist/ToggleFeatureCard/constants.js +5 -0
  277. package/dist/ToggleFeatureCard/hooks/useScrollIntoView.js +11 -0
  278. package/dist/ToggleFeatureCard/index.js +148 -0
  279. package/dist/ToggleFeatureCard/toggleFeatureCard.scss +4 -0
  280. package/package.json +28 -35
  281. package/dist/AutoSaveInput.cjs.js +0 -724
  282. package/dist/AutoSaveInput.cjs.js.map +0 -1
  283. package/dist/AutoSaveInput.js +0 -718
  284. package/dist/AutoSaveInput.js.map +0 -1
  285. package/dist/Breadcrumbs.cjs.js +0 -44
  286. package/dist/Breadcrumbs.cjs.js.map +0 -1
  287. package/dist/Breadcrumbs.js +0 -38
  288. package/dist/Breadcrumbs.js.map +0 -1
  289. package/dist/BrowserSupport.cjs.js +0 -1731
  290. package/dist/BrowserSupport.cjs.js.map +0 -1
  291. package/dist/BrowserSupport.js +0 -1725
  292. package/dist/BrowserSupport.js.map +0 -1
  293. package/dist/CalendarView.cjs.js +0 -610
  294. package/dist/CalendarView.cjs.js.map +0 -1
  295. package/dist/CalendarView.js +0 -598
  296. package/dist/CalendarView.js.map +0 -1
  297. package/dist/Codeblock.cjs.js +0 -302
  298. package/dist/Codeblock.cjs.js.map +0 -1
  299. package/dist/Codeblock.js +0 -296
  300. package/dist/Codeblock.js.map +0 -1
  301. package/dist/Columns.cjs.js +0 -248
  302. package/dist/Columns.cjs.js.map +0 -1
  303. package/dist/Columns.js.map +0 -1
  304. package/dist/ConfirmationModal.cjs.js +0 -87
  305. package/dist/ConfirmationModal.cjs.js.map +0 -1
  306. package/dist/ConfirmationModal.js.map +0 -1
  307. package/dist/Container.cjs.js +0 -1277
  308. package/dist/Container.cjs.js.map +0 -1
  309. package/dist/Container.js +0 -1271
  310. package/dist/Container.js.map +0 -1
  311. package/dist/CopyToClipboardButton.cjs.js +0 -275
  312. package/dist/CopyToClipboardButton.cjs.js.map +0 -1
  313. package/dist/CopyToClipboardButton.js +0 -269
  314. package/dist/CopyToClipboardButton.js.map +0 -1
  315. package/dist/CustomDomain.cjs.js +0 -774
  316. package/dist/CustomDomain.cjs.js.map +0 -1
  317. package/dist/CustomDomain.js +0 -747
  318. package/dist/CustomDomain.js.map +0 -1
  319. package/dist/CustomDomainDashboard.cjs.js +0 -2370
  320. package/dist/CustomDomainDashboard.cjs.js.map +0 -1
  321. package/dist/CustomDomainDashboard.js +0 -2342
  322. package/dist/CustomDomainDashboard.js.map +0 -1
  323. package/dist/DateFormat.cjs.js +0 -51
  324. package/dist/DateFormat.cjs.js.map +0 -1
  325. package/dist/DateFormat.js.map +0 -1
  326. package/dist/DateRangeFilter.cjs.js +0 -236
  327. package/dist/DateRangeFilter.cjs.js.map +0 -1
  328. package/dist/DateRangeFilter.js +0 -229
  329. package/dist/DateRangeFilter.js.map +0 -1
  330. package/dist/DynamicVariables.cjs.js +0 -189
  331. package/dist/DynamicVariables.cjs.js.map +0 -1
  332. package/dist/DynamicVariables.js +0 -183
  333. package/dist/DynamicVariables.js.map +0 -1
  334. package/dist/EmailForm.cjs.js +0 -4295
  335. package/dist/EmailForm.cjs.js.map +0 -1
  336. package/dist/EmailForm.js +0 -4265
  337. package/dist/EmailForm.js.map +0 -1
  338. package/dist/EmailPreview.cjs.js +0 -1419
  339. package/dist/EmailPreview.cjs.js.map +0 -1
  340. package/dist/EmailPreview.js +0 -1413
  341. package/dist/EmailPreview.js.map +0 -1
  342. package/dist/ErrorPage.cjs.js +0 -226
  343. package/dist/ErrorPage.cjs.js.map +0 -1
  344. package/dist/ErrorPage.js.map +0 -1
  345. package/dist/Header.cjs.js +0 -188
  346. package/dist/Header.cjs.js.map +0 -1
  347. package/dist/Header.js +0 -182
  348. package/dist/Header.js.map +0 -1
  349. package/dist/IconPicker.cjs.js +0 -1308
  350. package/dist/IconPicker.cjs.js.map +0 -1
  351. package/dist/IconPicker.js +0 -1302
  352. package/dist/IconPicker.js.map +0 -1
  353. package/dist/ImageWithFallback.cjs.js +0 -247
  354. package/dist/ImageWithFallback.cjs.js.map +0 -1
  355. package/dist/ImageWithFallback.js +0 -241
  356. package/dist/ImageWithFallback.js.map +0 -1
  357. package/dist/IntegrationCard.cjs.js +0 -409
  358. package/dist/IntegrationCard.cjs.js.map +0 -1
  359. package/dist/IntegrationCard.js +0 -403
  360. package/dist/IntegrationCard.js.map +0 -1
  361. package/dist/IntegrationDisconnectAlert.cjs.js +0 -89
  362. package/dist/IntegrationDisconnectAlert.cjs.js.map +0 -1
  363. package/dist/IntegrationDisconnectAlert.js +0 -80
  364. package/dist/IntegrationDisconnectAlert.js.map +0 -1
  365. package/dist/IntegrationWalkthroughModal.cjs.js +0 -50
  366. package/dist/IntegrationWalkthroughModal.cjs.js.map +0 -1
  367. package/dist/IntegrationWalkthroughModal.js.map +0 -1
  368. package/dist/IpRestriction.cjs.js +0 -3931
  369. package/dist/IpRestriction.cjs.js.map +0 -1
  370. package/dist/IpRestriction.js +0 -3905
  371. package/dist/IpRestriction.js.map +0 -1
  372. package/dist/KeyboardShortcuts.cjs.js +0 -2244
  373. package/dist/KeyboardShortcuts.cjs.js.map +0 -1
  374. package/dist/KeyboardShortcuts.js +0 -2237
  375. package/dist/KeyboardShortcuts.js.map +0 -1
  376. package/dist/LoginPage.cjs.js +0 -618
  377. package/dist/LoginPage.cjs.js.map +0 -1
  378. package/dist/LoginPage.js +0 -593
  379. package/dist/LoginPage.js.map +0 -1
  380. package/dist/MenuBar.cjs.js +0 -34273
  381. package/dist/MenuBar.cjs.js.map +0 -1
  382. package/dist/MenuBar.js +0 -34267
  383. package/dist/MenuBar.js.map +0 -1
  384. package/dist/Metadata.cjs.js +0 -272
  385. package/dist/Metadata.cjs.js.map +0 -1
  386. package/dist/Metadata.js +0 -266
  387. package/dist/Metadata.js.map +0 -1
  388. package/dist/MoreDropdown.cjs.js +0 -168
  389. package/dist/MoreDropdown.cjs.js.map +0 -1
  390. package/dist/MoreDropdown.js.map +0 -1
  391. package/dist/NavigationHeader.cjs.js +0 -756
  392. package/dist/NavigationHeader.cjs.js.map +0 -1
  393. package/dist/NavigationHeader.js +0 -750
  394. package/dist/NavigationHeader.js.map +0 -1
  395. package/dist/NeetoWidget.cjs.js +0 -3375
  396. package/dist/NeetoWidget.cjs.js.map +0 -1
  397. package/dist/NeetoWidget.js +0 -3348
  398. package/dist/NeetoWidget.js.map +0 -1
  399. package/dist/PageLoader.cjs.js +0 -158
  400. package/dist/PageLoader.cjs.js.map +0 -1
  401. package/dist/PageLoader.js +0 -134
  402. package/dist/PageLoader.js.map +0 -1
  403. package/dist/PhoneNumber.cjs.js +0 -7021
  404. package/dist/PhoneNumber.cjs.js.map +0 -1
  405. package/dist/PhoneNumber.js +0 -6989
  406. package/dist/PhoneNumber.js.map +0 -1
  407. package/dist/PublishBlock.cjs.js +0 -224
  408. package/dist/PublishBlock.cjs.js.map +0 -1
  409. package/dist/PublishBlock.js +0 -218
  410. package/dist/PublishBlock.js.map +0 -1
  411. package/dist/Rename.cjs.js +0 -516
  412. package/dist/Rename.cjs.js.map +0 -1
  413. package/dist/Rename.js +0 -510
  414. package/dist/Rename.js.map +0 -1
  415. package/dist/ResponsiveDevicePicker.cjs.js +0 -260
  416. package/dist/ResponsiveDevicePicker.cjs.js.map +0 -1
  417. package/dist/ResponsiveDevicePicker.js +0 -254
  418. package/dist/ResponsiveDevicePicker.js.map +0 -1
  419. package/dist/Schedule.cjs.js +0 -1077
  420. package/dist/Schedule.cjs.js.map +0 -1
  421. package/dist/Schedule.js +0 -1046
  422. package/dist/Schedule.js.map +0 -1
  423. package/dist/Scrollable.cjs.js +0 -188
  424. package/dist/Scrollable.cjs.js.map +0 -1
  425. package/dist/Scrollable.js +0 -182
  426. package/dist/Scrollable.js.map +0 -1
  427. package/dist/Security.cjs.js +0 -1921
  428. package/dist/Security.cjs.js.map +0 -1
  429. package/dist/Security.js +0 -1895
  430. package/dist/Security.js.map +0 -1
  431. package/dist/SendToFields.cjs.js +0 -2524
  432. package/dist/SendToFields.cjs.js.map +0 -1
  433. package/dist/SendToFields.js +0 -2517
  434. package/dist/SendToFields.js.map +0 -1
  435. package/dist/Settings.cjs.js +0 -501
  436. package/dist/Settings.cjs.js.map +0 -1
  437. package/dist/Settings.js +0 -495
  438. package/dist/Settings.js.map +0 -1
  439. package/dist/ShareViaEmail.cjs.js +0 -4272
  440. package/dist/ShareViaEmail.cjs.js.map +0 -1
  441. package/dist/ShareViaEmail.js +0 -4246
  442. package/dist/ShareViaEmail.js.map +0 -1
  443. package/dist/ShareViaLink.cjs.js +0 -1512
  444. package/dist/ShareViaLink.cjs.js.map +0 -1
  445. package/dist/ShareViaLink.js +0 -1486
  446. package/dist/ShareViaLink.js.map +0 -1
  447. package/dist/Sidebar.cjs.js +0 -34985
  448. package/dist/Sidebar.cjs.js.map +0 -1
  449. package/dist/Sidebar.js +0 -34959
  450. package/dist/Sidebar.js.map +0 -1
  451. package/dist/SubHeader.cjs.js +0 -283
  452. package/dist/SubHeader.cjs.js.map +0 -1
  453. package/dist/SubHeader.js +0 -276
  454. package/dist/SubHeader.js.map +0 -1
  455. package/dist/TableWrapper.cjs.js +0 -87
  456. package/dist/TableWrapper.cjs.js.map +0 -1
  457. package/dist/TableWrapper.js +0 -81
  458. package/dist/TableWrapper.js.map +0 -1
  459. package/dist/ThemeSidebar.cjs.js +0 -13705
  460. package/dist/ThemeSidebar.cjs.js.map +0 -1
  461. package/dist/ThemeSidebar.js +0 -13680
  462. package/dist/ThemeSidebar.js.map +0 -1
  463. package/dist/TimeFormat.cjs.js +0 -53
  464. package/dist/TimeFormat.cjs.js.map +0 -1
  465. package/dist/TimeFormat.js +0 -47
  466. package/dist/TimeFormat.js.map +0 -1
  467. package/dist/TimezoneMismatchModal.cjs.js +0 -176
  468. package/dist/TimezoneMismatchModal.cjs.js.map +0 -1
  469. package/dist/TimezoneMismatchModal.js +0 -168
  470. package/dist/TimezoneMismatchModal.js.map +0 -1
  471. package/dist/ToggleFeatureCard.cjs.js +0 -389
  472. package/dist/ToggleFeatureCard.cjs.js.map +0 -1
  473. package/dist/ToggleFeatureCard.js +0 -383
  474. package/dist/ToggleFeatureCard.js.map +0 -1
@@ -1,3375 +0,0 @@
1
- 'use strict';
2
-
3
- var ramda = require('ramda');
4
- var React = require('react');
5
- var neetoIcons = require('@bigbinary/neeto-icons');
6
- var neetoui = require('@bigbinary/neetoui');
7
- var reactI18next = require('react-i18next');
8
- var reactQuery = require('react-query');
9
- var pure = require('@bigbinary/neeto-commons-frontend/pure');
10
- var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
11
- var CopyToClipboardButton = require('@bigbinary/neeto-molecules/CopyToClipboardButton');
12
- var formik = require('formik');
13
- var formik$1 = require('@bigbinary/neetoui/formik');
14
- var i18next = require('i18next');
15
- var yup = require('yup');
16
-
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- function _interopNamespace(e) {
20
- if (e && e.__esModule) return e;
21
- var n = Object.create(null);
22
- if (e) {
23
- Object.keys(e).forEach(function (k) {
24
- if (k !== 'default') {
25
- var d = Object.getOwnPropertyDescriptor(e, k);
26
- Object.defineProperty(n, k, d.get ? d : {
27
- enumerable: true,
28
- get: function () { return e[k]; }
29
- });
30
- }
31
- });
32
- }
33
- n["default"] = e;
34
- return Object.freeze(n);
35
- }
36
-
37
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
38
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
39
- var CopyToClipboardButton__default = /*#__PURE__*/_interopDefaultLegacy(CopyToClipboardButton);
40
- var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
41
- var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
42
-
43
- function _typeof$1(obj) {
44
- "@babel/helpers - typeof";
45
-
46
- return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
47
- return typeof obj;
48
- } : function (obj) {
49
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
50
- }, _typeof$1(obj);
51
- }
52
-
53
- function _toPrimitive(input, hint) {
54
- if (_typeof$1(input) !== "object" || input === null) return input;
55
- var prim = input[Symbol.toPrimitive];
56
- if (prim !== undefined) {
57
- var res = prim.call(input, hint || "default");
58
- if (_typeof$1(res) !== "object") return res;
59
- throw new TypeError("@@toPrimitive must return a primitive value.");
60
- }
61
- return (hint === "string" ? String : Number)(input);
62
- }
63
-
64
- function _toPropertyKey(arg) {
65
- var key = _toPrimitive(arg, "string");
66
- return _typeof$1(key) === "symbol" ? key : String(key);
67
- }
68
-
69
- function _defineProperty(obj, key, value) {
70
- key = _toPropertyKey(key);
71
- if (key in obj) {
72
- Object.defineProperty(obj, key, {
73
- value: value,
74
- enumerable: true,
75
- configurable: true,
76
- writable: true
77
- });
78
- } else {
79
- obj[key] = value;
80
- }
81
- return obj;
82
- }
83
-
84
- var _SAMPLE_USER_IDENTITY;
85
- var NEETO_WIDGET_USER_IDENTITY_KEY = "NeetoWidgetUserIdentity";
86
- var SESSION_CONTEXT_KEY = "NeetoReplayWidgetSessionContext";
87
- var INSTALLATION_HELP_EMAIL = "support@neeto.com";
88
- var SAMPLE_CONTEXT_CODE_STRING = "window.".concat(SESSION_CONTEXT_KEY, " = {\n key1: \"value\",\n key2: [\"array\", \"of\", \"values\"],\n /* More key-value pairs */\n}");
89
- var WIDGET_TYPES = {
90
- changelog: "changelog",
91
- chat: "chat",
92
- replay: "replay"
93
- };
94
- var WIDGET_TYPES_VALUES = ramda.values(WIDGET_TYPES);
95
- var QUERY_KEYS = {
96
- apiKey: "neetoWidgetApiKey",
97
- configuration: "neetoWidgetConfiguration"
98
- };
99
- var DEFAULT_QUERY_STALE_TIME = 60 * 60 * 1000; // 1 hour in milliseconds
100
-
101
- var EMAIL_TYPES = {
102
- embedCode: "embedCode",
103
- userIdentity: "userIdentity",
104
- sessionContext: "sessionContext",
105
- "null": ""
106
- };
107
- var RAILS_ENV = {
108
- production: "production",
109
- staging: "staging",
110
- development: "development"
111
- };
112
- var NEETO_WIDGET_SCRIPT_URL = {
113
- staging: "https://d13nryxs46eypn.cloudfront.net/neeto-widget-staging.js",
114
- production: "https://d13nryxs46eypn.cloudfront.net/neeto-widget.js"
115
- };
116
- var AVAILABLE_FRAMEWORK_OPTIONS = Object.freeze({
117
- rails: "rails",
118
- django: "django",
119
- php: "php"
120
- });
121
- var FRAMEWORK_SELECT_OPTIONS = [{
122
- label: "Ruby(Rails)",
123
- value: AVAILABLE_FRAMEWORK_OPTIONS.rails
124
- }, {
125
- label: "Python(Django)",
126
- value: AVAILABLE_FRAMEWORK_OPTIONS.django
127
- }, {
128
- label: "PHP",
129
- value: AVAILABLE_FRAMEWORK_OPTIONS.php
130
- }];
131
- var SAMPLE_USER_IDENTITY_CODE_STRING = (_SAMPLE_USER_IDENTITY = {}, _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.rails, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: \"<%= current_user.id %>\", // User identifier\"\n name: \"<%= current_user.name %>\", // Full name\n email: \"<%= current_user.email %>\", // Email address\n started_at: \"<%= current_user.created_at.to_i %>\" // Signup date as a Unix timestamp ,\n}")), _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.django, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: \"{{ request.user.id|escapejs }}\", // User identifier\n name: \"{{ request.user.name|escapejs }}\", // Full name\n email: \"{{ request.user.email|escapejs }}\", // Email address\n started_at: \"{{ request.user.created_at|date:'U' }}\" // Signup date as a Unix timestamp\"\n}")), _defineProperty(_SAMPLE_USER_IDENTITY, AVAILABLE_FRAMEWORK_OPTIONS.php, "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {\n user_identifier: <?php echo json_encode($current_user->id) ?>, // User identifier\n name: <?php echo json_encode($current_user->name) ?>, // Full name\n email: <?php echo json_encode($current_user->email) ?>, // Email address\n started_at: <?php echo strtotime($current_user->created_at) ?> // Signup date as a Unix timestamp\" ,\n}")), _SAMPLE_USER_IDENTITY);
132
- var WIDGET_CONFIG_URL = "api/widget/v1/neeto_widget_tokens";
133
- var EMBED_CODE_EMAIL_URL = "api/widget/v1/email_snippets";
134
- var CHAT_WIDGET_KB_BASE_URL = "https://help.neetochat.com";
135
- var CHANGELOG_WIDGET_KB_BASE_URL = "https://help.neetochangelog.com";
136
- var REPLAY_WIDGET_KB_BASE_URL = "https://help.neetoreplay.com";
137
- var NEETO_REPLAY_CONFIGURE_URL = "".concat(REPLAY_WIDGET_KB_BASE_URL, "/articles/configure-widget");
138
- var NEETO_CHAT_USER_IDENTITY_URL = "".concat(CHAT_WIDGET_KB_BASE_URL, "/articles/info-about-logged-in-users");
139
- var WIDGET_KB_HELP_URL = {
140
- changelog: "".concat(CHANGELOG_WIDGET_KB_BASE_URL, "/categories/widget-installation-usage"),
141
- chat: "".concat(CHAT_WIDGET_KB_BASE_URL, "/categories/installation"),
142
- replay: "".concat(REPLAY_WIDGET_KB_BASE_URL, "/categories/widget-installation-usage")
143
- };
144
-
145
- function _extends$1() {
146
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
147
- for (var i = 1; i < arguments.length; i++) {
148
- var source = arguments[i];
149
- for (var key in source) {
150
- if (Object.prototype.hasOwnProperty.call(source, key)) {
151
- target[key] = source[key];
152
- }
153
- }
154
- }
155
- return target;
156
- };
157
- return _extends$1.apply(this, arguments);
158
- }
159
-
160
- function _arrayWithHoles(arr) {
161
- if (Array.isArray(arr)) return arr;
162
- }
163
-
164
- function _iterableToArrayLimit(arr, i) {
165
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
166
- if (null != _i) {
167
- var _s,
168
- _e,
169
- _x,
170
- _r,
171
- _arr = [],
172
- _n = !0,
173
- _d = !1;
174
- try {
175
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
176
- if (Object(_i) !== _i) return;
177
- _n = !1;
178
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
179
- } catch (err) {
180
- _d = !0, _e = err;
181
- } finally {
182
- try {
183
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
184
- } finally {
185
- if (_d) throw _e;
186
- }
187
- }
188
- return _arr;
189
- }
190
- }
191
-
192
- function _arrayLikeToArray(arr, len) {
193
- if (len == null || len > arr.length) len = arr.length;
194
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
195
- return arr2;
196
- }
197
-
198
- function _unsupportedIterableToArray(o, minLen) {
199
- if (!o) return;
200
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
201
- var n = Object.prototype.toString.call(o).slice(8, -1);
202
- if (n === "Object" && o.constructor) n = o.constructor.name;
203
- if (n === "Map" || n === "Set") return Array.from(o);
204
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
205
- }
206
-
207
- function _nonIterableRest() {
208
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
209
- }
210
-
211
- function _slicedToArray(arr, i) {
212
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
213
- }
214
-
215
- var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
216
-
217
- var classnames$1 = {exports: {}};
218
-
219
- /*!
220
- Copyright (c) 2018 Jed Watson.
221
- Licensed under the MIT License (MIT), see
222
- http://jedwatson.github.io/classnames
223
- */
224
-
225
- (function (module) {
226
- /* global define */
227
-
228
- (function () {
229
-
230
- var hasOwn = {}.hasOwnProperty;
231
-
232
- function classNames() {
233
- var classes = [];
234
-
235
- for (var i = 0; i < arguments.length; i++) {
236
- var arg = arguments[i];
237
- if (!arg) continue;
238
-
239
- var argType = typeof arg;
240
-
241
- if (argType === 'string' || argType === 'number') {
242
- classes.push(arg);
243
- } else if (Array.isArray(arg)) {
244
- if (arg.length) {
245
- var inner = classNames.apply(null, arg);
246
- if (inner) {
247
- classes.push(inner);
248
- }
249
- }
250
- } else if (argType === 'object') {
251
- if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
252
- classes.push(arg.toString());
253
- continue;
254
- }
255
-
256
- for (var key in arg) {
257
- if (hasOwn.call(arg, key) && arg[key]) {
258
- classes.push(key);
259
- }
260
- }
261
- }
262
- }
263
-
264
- return classes.join(' ');
265
- }
266
-
267
- if (module.exports) {
268
- classNames.default = classNames;
269
- module.exports = classNames;
270
- } else {
271
- window.classNames = classNames;
272
- }
273
- }());
274
- } (classnames$1));
275
-
276
- var classnames = classnames$1.exports;
277
-
278
- function _objectWithoutPropertiesLoose(source, excluded) {
279
- if (source == null) return {};
280
- var target = {};
281
- var sourceKeys = Object.keys(source);
282
- var key, i;
283
- for (i = 0; i < sourceKeys.length; i++) {
284
- key = sourceKeys[i];
285
- if (excluded.indexOf(key) >= 0) continue;
286
- target[key] = source[key];
287
- }
288
- return target;
289
- }
290
-
291
- function _objectWithoutProperties(source, excluded) {
292
- if (source == null) return {};
293
- var target = _objectWithoutPropertiesLoose(source, excluded);
294
- var key, i;
295
- if (Object.getOwnPropertySymbols) {
296
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
297
- for (i = 0; i < sourceSymbolKeys.length; i++) {
298
- key = sourceSymbolKeys[i];
299
- if (excluded.indexOf(key) >= 0) continue;
300
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
301
- target[key] = source[key];
302
- }
303
- }
304
- return target;
305
- }
306
-
307
- var _path, _path2, _g, _defs;
308
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
309
- var SvgNeeto = function SvgNeeto(props) {
310
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
311
- width: 50,
312
- height: 50,
313
- viewBox: "0 0 415 415",
314
- fill: "none",
315
- xmlns: "http://www.w3.org/2000/svg"
316
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
317
- d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
318
- fill: "#0043AC"
319
- })), /*#__PURE__*/React__namespace.createElement("mask", {
320
- id: "neeto_svg__a",
321
- style: {
322
- maskType: "alpha"
323
- },
324
- maskUnits: "userSpaceOnUse",
325
- x: 0,
326
- y: 0,
327
- width: 415,
328
- height: 415
329
- }, _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
330
- d: "M414.989 207.495C414.989 92.899 322.091 0 207.495 0H0v414.989h414.989V207.495Z",
331
- fill: "#0043AC"
332
- }))), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
333
- mask: "url(#neeto_svg__a)"
334
- }, /*#__PURE__*/React__namespace.createElement("path", {
335
- d: "M233.747 348.74c88.579 101.145 172.015 116.411 202.661 111.401v32.491H-8.032V230.487c43.685-2.726 153.2 17.108 241.779 118.253Z",
336
- fill: "url(#neeto_svg__b)"
337
- }))), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("radialGradient", {
338
- id: "neeto_svg__b",
339
- cx: 0,
340
- cy: 0,
341
- r: 1,
342
- gradientUnits: "userSpaceOnUse",
343
- gradientTransform: "rotate(47.118 -220.556 214.818) scale(427.964 725.049)"
344
- }, /*#__PURE__*/React__namespace.createElement("stop", {
345
- stopColor: "#0043AC"
346
- }), /*#__PURE__*/React__namespace.createElement("stop", {
347
- offset: 1,
348
- stopColor: "#3DB1CA",
349
- stopOpacity: 0.8
350
- })))));
351
- };
352
-
353
- var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
354
-
355
- var css$1 = ".neeto-molecules-pageloader__wrapper{height:100%;position:relative;width:100%}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader{height:100%;left:0;position:absolute;top:0;width:100%}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader__content{height:66px;margin-bottom:16px;overflow:hidden;padding:8px;position:relative;width:66px}.neeto-molecules-pageloader__wrapper .neeto-molecules-pageloader__text{color:rgb(var(--neeto-ui-gray-800));font-size:1.25rem;line-height:1.75rem;margin-bottom:4rem;text-align:center}.neeto-molecules-pageloader__spinner{display:flex;gap:2px;height:25px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.neeto-molecules-pageloader__spinner>div{animation:neeto-ui-stretch-delay 1.2s ease-in-out infinite;background-color:#fff;border-radius:2px;display:inline-flex;height:100%;width:2px}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect2{animation-delay:-1.1s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect3{animation-delay:-1s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect4{animation-delay:-.9s}.neeto-molecules-pageloader__spinner .neeto-molecules-pageloader__rect5{animation-delay:-.8s}@keyframes neeto-ui-stretch-delay{0%,40%,to{transform:scaleY(.4);-webkit-transform:scaleY(.4)}20%{transform:scaleY(1);-webkit-transform:scaleY(1)}}";
356
- n(css$1,{});
357
-
358
- var _excluded = ["text"];
359
- var PageLoader = function PageLoader(_ref) {
360
- var _ref$text = _ref.text,
361
- text = _ref$text === void 0 ? "" : _ref$text,
362
- otherProps = _objectWithoutProperties(_ref, _excluded);
363
- return /*#__PURE__*/React__default["default"].createElement("div", _extends$1({
364
- className: "neeto-molecules-pageloader__wrapper"
365
- }, otherProps), /*#__PURE__*/React__default["default"].createElement("div", {
366
- className: "neeto-molecules-pageloader neeto-ui-flex neeto-ui-flex-col neeto-ui-items-center neeto-ui-justify-center"
367
- }, /*#__PURE__*/React__default["default"].createElement("div", {
368
- className: "neeto-molecules-pageloader__content neeto-ui-flex neeto-ui-flex-shrink-0 neeto-ui-items-center neeto-ui-justify-center"
369
- }, /*#__PURE__*/React__default["default"].createElement(SvgNeeto, {
370
- className: "neeto-molecules-pageloader__logo",
371
- size: 50
372
- }), /*#__PURE__*/React__default["default"].createElement("div", {
373
- className: "neeto-molecules-pageloader__spinner"
374
- }, /*#__PURE__*/React__default["default"].createElement("div", {
375
- className: "neeto-molecules-pageloader__rect1"
376
- }), /*#__PURE__*/React__default["default"].createElement("div", {
377
- className: "neeto-molecules-pageloader__rect2"
378
- }), /*#__PURE__*/React__default["default"].createElement("div", {
379
- className: "neeto-molecules-pageloader__rect3"
380
- }), /*#__PURE__*/React__default["default"].createElement("div", {
381
- className: "neeto-molecules-pageloader__rect4"
382
- }), /*#__PURE__*/React__default["default"].createElement("div", {
383
- className: "neeto-molecules-pageloader__rect5"
384
- }))), text && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
385
- style: "h5",
386
- weight: "semibold"
387
- }, text)));
388
- };
389
- var PageLoader$1 = /*#__PURE__*/React__default["default"].memo(PageLoader);
390
-
391
- var prism = {exports: {}};
392
-
393
- (function (module) {
394
- /* **********************************************
395
- Begin prism-core.js
396
- ********************************************** */
397
-
398
- /// <reference lib="WebWorker"/>
399
-
400
- var _self = (typeof window !== 'undefined')
401
- ? window // if in browser
402
- : (
403
- (typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope)
404
- ? self // if in worker
405
- : {} // if in node js
406
- );
407
-
408
- /**
409
- * Prism: Lightweight, robust, elegant syntax highlighting
410
- *
411
- * @license MIT <https://opensource.org/licenses/MIT>
412
- * @author Lea Verou <https://lea.verou.me>
413
- * @namespace
414
- * @public
415
- */
416
- var Prism = (function (_self) {
417
-
418
- // Private helper vars
419
- var lang = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i;
420
- var uniqueId = 0;
421
-
422
- // The grammar object for plaintext
423
- var plainTextGrammar = {};
424
-
425
-
426
- var _ = {
427
- /**
428
- * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
429
- * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
430
- * additional languages or plugins yourself.
431
- *
432
- * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
433
- *
434
- * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
435
- * empty Prism object into the global scope before loading the Prism script like this:
436
- *
437
- * ```js
438
- * window.Prism = window.Prism || {};
439
- * Prism.manual = true;
440
- * // add a new <script> to load Prism's script
441
- * ```
442
- *
443
- * @default false
444
- * @type {boolean}
445
- * @memberof Prism
446
- * @public
447
- */
448
- manual: _self.Prism && _self.Prism.manual,
449
- /**
450
- * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
451
- * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
452
- * own worker, you don't want it to do this.
453
- *
454
- * By setting this value to `true`, Prism will not add its own listeners to the worker.
455
- *
456
- * You obviously have to change this value before Prism executes. To do this, you can add an
457
- * empty Prism object into the global scope before loading the Prism script like this:
458
- *
459
- * ```js
460
- * window.Prism = window.Prism || {};
461
- * Prism.disableWorkerMessageHandler = true;
462
- * // Load Prism's script
463
- * ```
464
- *
465
- * @default false
466
- * @type {boolean}
467
- * @memberof Prism
468
- * @public
469
- */
470
- disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler,
471
-
472
- /**
473
- * A namespace for utility methods.
474
- *
475
- * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
476
- * change or disappear at any time.
477
- *
478
- * @namespace
479
- * @memberof Prism
480
- */
481
- util: {
482
- encode: function encode(tokens) {
483
- if (tokens instanceof Token) {
484
- return new Token(tokens.type, encode(tokens.content), tokens.alias);
485
- } else if (Array.isArray(tokens)) {
486
- return tokens.map(encode);
487
- } else {
488
- return tokens.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/\u00a0/g, ' ');
489
- }
490
- },
491
-
492
- /**
493
- * Returns the name of the type of the given value.
494
- *
495
- * @param {any} o
496
- * @returns {string}
497
- * @example
498
- * type(null) === 'Null'
499
- * type(undefined) === 'Undefined'
500
- * type(123) === 'Number'
501
- * type('foo') === 'String'
502
- * type(true) === 'Boolean'
503
- * type([1, 2]) === 'Array'
504
- * type({}) === 'Object'
505
- * type(String) === 'Function'
506
- * type(/abc+/) === 'RegExp'
507
- */
508
- type: function (o) {
509
- return Object.prototype.toString.call(o).slice(8, -1);
510
- },
511
-
512
- /**
513
- * Returns a unique number for the given object. Later calls will still return the same number.
514
- *
515
- * @param {Object} obj
516
- * @returns {number}
517
- */
518
- objId: function (obj) {
519
- if (!obj['__id']) {
520
- Object.defineProperty(obj, '__id', { value: ++uniqueId });
521
- }
522
- return obj['__id'];
523
- },
524
-
525
- /**
526
- * Creates a deep clone of the given object.
527
- *
528
- * The main intended use of this function is to clone language definitions.
529
- *
530
- * @param {T} o
531
- * @param {Record<number, any>} [visited]
532
- * @returns {T}
533
- * @template T
534
- */
535
- clone: function deepClone(o, visited) {
536
- visited = visited || {};
537
-
538
- var clone; var id;
539
- switch (_.util.type(o)) {
540
- case 'Object':
541
- id = _.util.objId(o);
542
- if (visited[id]) {
543
- return visited[id];
544
- }
545
- clone = /** @type {Record<string, any>} */ ({});
546
- visited[id] = clone;
547
-
548
- for (var key in o) {
549
- if (o.hasOwnProperty(key)) {
550
- clone[key] = deepClone(o[key], visited);
551
- }
552
- }
553
-
554
- return /** @type {any} */ (clone);
555
-
556
- case 'Array':
557
- id = _.util.objId(o);
558
- if (visited[id]) {
559
- return visited[id];
560
- }
561
- clone = [];
562
- visited[id] = clone;
563
-
564
- (/** @type {Array} */(/** @type {any} */(o))).forEach(function (v, i) {
565
- clone[i] = deepClone(v, visited);
566
- });
567
-
568
- return /** @type {any} */ (clone);
569
-
570
- default:
571
- return o;
572
- }
573
- },
574
-
575
- /**
576
- * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
577
- *
578
- * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
579
- *
580
- * @param {Element} element
581
- * @returns {string}
582
- */
583
- getLanguage: function (element) {
584
- while (element) {
585
- var m = lang.exec(element.className);
586
- if (m) {
587
- return m[1].toLowerCase();
588
- }
589
- element = element.parentElement;
590
- }
591
- return 'none';
592
- },
593
-
594
- /**
595
- * Sets the Prism `language-xxxx` class of the given element.
596
- *
597
- * @param {Element} element
598
- * @param {string} language
599
- * @returns {void}
600
- */
601
- setLanguage: function (element, language) {
602
- // remove all `language-xxxx` classes
603
- // (this might leave behind a leading space)
604
- element.className = element.className.replace(RegExp(lang, 'gi'), '');
605
-
606
- // add the new `language-xxxx` class
607
- // (using `classList` will automatically clean up spaces for us)
608
- element.classList.add('language-' + language);
609
- },
610
-
611
- /**
612
- * Returns the script element that is currently executing.
613
- *
614
- * This does __not__ work for line script element.
615
- *
616
- * @returns {HTMLScriptElement | null}
617
- */
618
- currentScript: function () {
619
- if (typeof document === 'undefined') {
620
- return null;
621
- }
622
- if ('currentScript' in document && 1 < 2 /* hack to trip TS' flow analysis */) {
623
- return /** @type {any} */ (document.currentScript);
624
- }
625
-
626
- // IE11 workaround
627
- // we'll get the src of the current script by parsing IE11's error stack trace
628
- // this will not work for inline scripts
629
-
630
- try {
631
- throw new Error();
632
- } catch (err) {
633
- // Get file src url from stack. Specifically works with the format of stack traces in IE.
634
- // A stack will look like this:
635
- //
636
- // Error
637
- // at _.util.currentScript (http://localhost/components/prism-core.js:119:5)
638
- // at Global code (http://localhost/components/prism-core.js:606:1)
639
-
640
- var src = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(err.stack) || [])[1];
641
- if (src) {
642
- var scripts = document.getElementsByTagName('script');
643
- for (var i in scripts) {
644
- if (scripts[i].src == src) {
645
- return scripts[i];
646
- }
647
- }
648
- }
649
- return null;
650
- }
651
- },
652
-
653
- /**
654
- * Returns whether a given class is active for `element`.
655
- *
656
- * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
657
- * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
658
- * given class is just the given class with a `no-` prefix.
659
- *
660
- * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
661
- * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
662
- * ancestors have the given class or the negated version of it, then the default activation will be returned.
663
- *
664
- * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
665
- * version of it, the class is considered active.
666
- *
667
- * @param {Element} element
668
- * @param {string} className
669
- * @param {boolean} [defaultActivation=false]
670
- * @returns {boolean}
671
- */
672
- isActive: function (element, className, defaultActivation) {
673
- var no = 'no-' + className;
674
-
675
- while (element) {
676
- var classList = element.classList;
677
- if (classList.contains(className)) {
678
- return true;
679
- }
680
- if (classList.contains(no)) {
681
- return false;
682
- }
683
- element = element.parentElement;
684
- }
685
- return !!defaultActivation;
686
- }
687
- },
688
-
689
- /**
690
- * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
691
- *
692
- * @namespace
693
- * @memberof Prism
694
- * @public
695
- */
696
- languages: {
697
- /**
698
- * The grammar for plain, unformatted text.
699
- */
700
- plain: plainTextGrammar,
701
- plaintext: plainTextGrammar,
702
- text: plainTextGrammar,
703
- txt: plainTextGrammar,
704
-
705
- /**
706
- * Creates a deep copy of the language with the given id and appends the given tokens.
707
- *
708
- * If a token in `redef` also appears in the copied language, then the existing token in the copied language
709
- * will be overwritten at its original position.
710
- *
711
- * ## Best practices
712
- *
713
- * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
714
- * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
715
- * understand the language definition because, normally, the order of tokens matters in Prism grammars.
716
- *
717
- * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
718
- * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
719
- *
720
- * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
721
- * @param {Grammar} redef The new tokens to append.
722
- * @returns {Grammar} The new language created.
723
- * @public
724
- * @example
725
- * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
726
- * // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
727
- * // at its original position
728
- * 'comment': { ... },
729
- * // CSS doesn't have a 'color' token, so this token will be appended
730
- * 'color': /\b(?:red|green|blue)\b/
731
- * });
732
- */
733
- extend: function (id, redef) {
734
- var lang = _.util.clone(_.languages[id]);
735
-
736
- for (var key in redef) {
737
- lang[key] = redef[key];
738
- }
739
-
740
- return lang;
741
- },
742
-
743
- /**
744
- * Inserts tokens _before_ another token in a language definition or any other grammar.
745
- *
746
- * ## Usage
747
- *
748
- * This helper method makes it easy to modify existing languages. For example, the CSS language definition
749
- * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
750
- * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
751
- * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
752
- * this:
753
- *
754
- * ```js
755
- * Prism.languages.markup.style = {
756
- * // token
757
- * };
758
- * ```
759
- *
760
- * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
761
- * before existing tokens. For the CSS example above, you would use it like this:
762
- *
763
- * ```js
764
- * Prism.languages.insertBefore('markup', 'cdata', {
765
- * 'style': {
766
- * // token
767
- * }
768
- * });
769
- * ```
770
- *
771
- * ## Special cases
772
- *
773
- * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
774
- * will be ignored.
775
- *
776
- * This behavior can be used to insert tokens after `before`:
777
- *
778
- * ```js
779
- * Prism.languages.insertBefore('markup', 'comment', {
780
- * 'comment': Prism.languages.markup.comment,
781
- * // tokens after 'comment'
782
- * });
783
- * ```
784
- *
785
- * ## Limitations
786
- *
787
- * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
788
- * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
789
- * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
790
- * deleting properties which is necessary to insert at arbitrary positions.
791
- *
792
- * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
793
- * Instead, it will create a new object and replace all references to the target object with the new one. This
794
- * can be done without temporarily deleting properties, so the iteration order is well-defined.
795
- *
796
- * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
797
- * you hold the target object in a variable, then the value of the variable will not change.
798
- *
799
- * ```js
800
- * var oldMarkup = Prism.languages.markup;
801
- * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
802
- *
803
- * assert(oldMarkup !== Prism.languages.markup);
804
- * assert(newMarkup === Prism.languages.markup);
805
- * ```
806
- *
807
- * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
808
- * object to be modified.
809
- * @param {string} before The key to insert before.
810
- * @param {Grammar} insert An object containing the key-value pairs to be inserted.
811
- * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
812
- * object to be modified.
813
- *
814
- * Defaults to `Prism.languages`.
815
- * @returns {Grammar} The new grammar object.
816
- * @public
817
- */
818
- insertBefore: function (inside, before, insert, root) {
819
- root = root || /** @type {any} */ (_.languages);
820
- var grammar = root[inside];
821
- /** @type {Grammar} */
822
- var ret = {};
823
-
824
- for (var token in grammar) {
825
- if (grammar.hasOwnProperty(token)) {
826
-
827
- if (token == before) {
828
- for (var newToken in insert) {
829
- if (insert.hasOwnProperty(newToken)) {
830
- ret[newToken] = insert[newToken];
831
- }
832
- }
833
- }
834
-
835
- // Do not insert token which also occur in insert. See #1525
836
- if (!insert.hasOwnProperty(token)) {
837
- ret[token] = grammar[token];
838
- }
839
- }
840
- }
841
-
842
- var old = root[inside];
843
- root[inside] = ret;
844
-
845
- // Update references in other language definitions
846
- _.languages.DFS(_.languages, function (key, value) {
847
- if (value === old && key != inside) {
848
- this[key] = ret;
849
- }
850
- });
851
-
852
- return ret;
853
- },
854
-
855
- // Traverse a language definition with Depth First Search
856
- DFS: function DFS(o, callback, type, visited) {
857
- visited = visited || {};
858
-
859
- var objId = _.util.objId;
860
-
861
- for (var i in o) {
862
- if (o.hasOwnProperty(i)) {
863
- callback.call(o, i, o[i], type || i);
864
-
865
- var property = o[i];
866
- var propertyType = _.util.type(property);
867
-
868
- if (propertyType === 'Object' && !visited[objId(property)]) {
869
- visited[objId(property)] = true;
870
- DFS(property, callback, null, visited);
871
- } else if (propertyType === 'Array' && !visited[objId(property)]) {
872
- visited[objId(property)] = true;
873
- DFS(property, callback, i, visited);
874
- }
875
- }
876
- }
877
- }
878
- },
879
-
880
- plugins: {},
881
-
882
- /**
883
- * This is the most high-level function in Prism’s API.
884
- * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
885
- * each one of them.
886
- *
887
- * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
888
- *
889
- * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
890
- * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
891
- * @memberof Prism
892
- * @public
893
- */
894
- highlightAll: function (async, callback) {
895
- _.highlightAllUnder(document, async, callback);
896
- },
897
-
898
- /**
899
- * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
900
- * {@link Prism.highlightElement} on each one of them.
901
- *
902
- * The following hooks will be run:
903
- * 1. `before-highlightall`
904
- * 2. `before-all-elements-highlight`
905
- * 3. All hooks of {@link Prism.highlightElement} for each element.
906
- *
907
- * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
908
- * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
909
- * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
910
- * @memberof Prism
911
- * @public
912
- */
913
- highlightAllUnder: function (container, async, callback) {
914
- var env = {
915
- callback: callback,
916
- container: container,
917
- selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
918
- };
919
-
920
- _.hooks.run('before-highlightall', env);
921
-
922
- env.elements = Array.prototype.slice.apply(env.container.querySelectorAll(env.selector));
923
-
924
- _.hooks.run('before-all-elements-highlight', env);
925
-
926
- for (var i = 0, element; (element = env.elements[i++]);) {
927
- _.highlightElement(element, async === true, env.callback);
928
- }
929
- },
930
-
931
- /**
932
- * Highlights the code inside a single element.
933
- *
934
- * The following hooks will be run:
935
- * 1. `before-sanity-check`
936
- * 2. `before-highlight`
937
- * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
938
- * 4. `before-insert`
939
- * 5. `after-highlight`
940
- * 6. `complete`
941
- *
942
- * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
943
- * the element's language.
944
- *
945
- * @param {Element} element The element containing the code.
946
- * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
947
- * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
948
- * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
949
- * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
950
- *
951
- * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
952
- * asynchronous highlighting to work. You can build your own bundle on the
953
- * [Download page](https://prismjs.com/download.html).
954
- * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
955
- * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
956
- * @memberof Prism
957
- * @public
958
- */
959
- highlightElement: function (element, async, callback) {
960
- // Find language
961
- var language = _.util.getLanguage(element);
962
- var grammar = _.languages[language];
963
-
964
- // Set language on the element, if not present
965
- _.util.setLanguage(element, language);
966
-
967
- // Set language on the parent, for styling
968
- var parent = element.parentElement;
969
- if (parent && parent.nodeName.toLowerCase() === 'pre') {
970
- _.util.setLanguage(parent, language);
971
- }
972
-
973
- var code = element.textContent;
974
-
975
- var env = {
976
- element: element,
977
- language: language,
978
- grammar: grammar,
979
- code: code
980
- };
981
-
982
- function insertHighlightedCode(highlightedCode) {
983
- env.highlightedCode = highlightedCode;
984
-
985
- _.hooks.run('before-insert', env);
986
-
987
- env.element.innerHTML = env.highlightedCode;
988
-
989
- _.hooks.run('after-highlight', env);
990
- _.hooks.run('complete', env);
991
- callback && callback.call(env.element);
992
- }
993
-
994
- _.hooks.run('before-sanity-check', env);
995
-
996
- // plugins may change/add the parent/element
997
- parent = env.element.parentElement;
998
- if (parent && parent.nodeName.toLowerCase() === 'pre' && !parent.hasAttribute('tabindex')) {
999
- parent.setAttribute('tabindex', '0');
1000
- }
1001
-
1002
- if (!env.code) {
1003
- _.hooks.run('complete', env);
1004
- callback && callback.call(env.element);
1005
- return;
1006
- }
1007
-
1008
- _.hooks.run('before-highlight', env);
1009
-
1010
- if (!env.grammar) {
1011
- insertHighlightedCode(_.util.encode(env.code));
1012
- return;
1013
- }
1014
-
1015
- if (async && _self.Worker) {
1016
- var worker = new Worker(_.filename);
1017
-
1018
- worker.onmessage = function (evt) {
1019
- insertHighlightedCode(evt.data);
1020
- };
1021
-
1022
- worker.postMessage(JSON.stringify({
1023
- language: env.language,
1024
- code: env.code,
1025
- immediateClose: true
1026
- }));
1027
- } else {
1028
- insertHighlightedCode(_.highlight(env.code, env.grammar, env.language));
1029
- }
1030
- },
1031
-
1032
- /**
1033
- * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
1034
- * and the language definitions to use, and returns a string with the HTML produced.
1035
- *
1036
- * The following hooks will be run:
1037
- * 1. `before-tokenize`
1038
- * 2. `after-tokenize`
1039
- * 3. `wrap`: On each {@link Token}.
1040
- *
1041
- * @param {string} text A string with the code to be highlighted.
1042
- * @param {Grammar} grammar An object containing the tokens to use.
1043
- *
1044
- * Usually a language definition like `Prism.languages.markup`.
1045
- * @param {string} language The name of the language definition passed to `grammar`.
1046
- * @returns {string} The highlighted HTML.
1047
- * @memberof Prism
1048
- * @public
1049
- * @example
1050
- * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
1051
- */
1052
- highlight: function (text, grammar, language) {
1053
- var env = {
1054
- code: text,
1055
- grammar: grammar,
1056
- language: language
1057
- };
1058
- _.hooks.run('before-tokenize', env);
1059
- if (!env.grammar) {
1060
- throw new Error('The language "' + env.language + '" has no grammar.');
1061
- }
1062
- env.tokens = _.tokenize(env.code, env.grammar);
1063
- _.hooks.run('after-tokenize', env);
1064
- return Token.stringify(_.util.encode(env.tokens), env.language);
1065
- },
1066
-
1067
- /**
1068
- * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
1069
- * and the language definitions to use, and returns an array with the tokenized code.
1070
- *
1071
- * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
1072
- *
1073
- * This method could be useful in other contexts as well, as a very crude parser.
1074
- *
1075
- * @param {string} text A string with the code to be highlighted.
1076
- * @param {Grammar} grammar An object containing the tokens to use.
1077
- *
1078
- * Usually a language definition like `Prism.languages.markup`.
1079
- * @returns {TokenStream} An array of strings and tokens, a token stream.
1080
- * @memberof Prism
1081
- * @public
1082
- * @example
1083
- * let code = `var foo = 0;`;
1084
- * let tokens = Prism.tokenize(code, Prism.languages.javascript);
1085
- * tokens.forEach(token => {
1086
- * if (token instanceof Prism.Token && token.type === 'number') {
1087
- * console.log(`Found numeric literal: ${token.content}`);
1088
- * }
1089
- * });
1090
- */
1091
- tokenize: function (text, grammar) {
1092
- var rest = grammar.rest;
1093
- if (rest) {
1094
- for (var token in rest) {
1095
- grammar[token] = rest[token];
1096
- }
1097
-
1098
- delete grammar.rest;
1099
- }
1100
-
1101
- var tokenList = new LinkedList();
1102
- addAfter(tokenList, tokenList.head, text);
1103
-
1104
- matchGrammar(text, tokenList, grammar, tokenList.head, 0);
1105
-
1106
- return toArray(tokenList);
1107
- },
1108
-
1109
- /**
1110
- * @namespace
1111
- * @memberof Prism
1112
- * @public
1113
- */
1114
- hooks: {
1115
- all: {},
1116
-
1117
- /**
1118
- * Adds the given callback to the list of callbacks for the given hook.
1119
- *
1120
- * The callback will be invoked when the hook it is registered for is run.
1121
- * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
1122
- *
1123
- * One callback function can be registered to multiple hooks and the same hook multiple times.
1124
- *
1125
- * @param {string} name The name of the hook.
1126
- * @param {HookCallback} callback The callback function which is given environment variables.
1127
- * @public
1128
- */
1129
- add: function (name, callback) {
1130
- var hooks = _.hooks.all;
1131
-
1132
- hooks[name] = hooks[name] || [];
1133
-
1134
- hooks[name].push(callback);
1135
- },
1136
-
1137
- /**
1138
- * Runs a hook invoking all registered callbacks with the given environment variables.
1139
- *
1140
- * Callbacks will be invoked synchronously and in the order in which they were registered.
1141
- *
1142
- * @param {string} name The name of the hook.
1143
- * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
1144
- * @public
1145
- */
1146
- run: function (name, env) {
1147
- var callbacks = _.hooks.all[name];
1148
-
1149
- if (!callbacks || !callbacks.length) {
1150
- return;
1151
- }
1152
-
1153
- for (var i = 0, callback; (callback = callbacks[i++]);) {
1154
- callback(env);
1155
- }
1156
- }
1157
- },
1158
-
1159
- Token: Token
1160
- };
1161
- _self.Prism = _;
1162
-
1163
-
1164
- // Typescript note:
1165
- // The following can be used to import the Token type in JSDoc:
1166
- //
1167
- // @typedef {InstanceType<import("./prism-core")["Token"]>} Token
1168
-
1169
- /**
1170
- * Creates a new token.
1171
- *
1172
- * @param {string} type See {@link Token#type type}
1173
- * @param {string | TokenStream} content See {@link Token#content content}
1174
- * @param {string|string[]} [alias] The alias(es) of the token.
1175
- * @param {string} [matchedStr=""] A copy of the full string this token was created from.
1176
- * @class
1177
- * @global
1178
- * @public
1179
- */
1180
- function Token(type, content, alias, matchedStr) {
1181
- /**
1182
- * The type of the token.
1183
- *
1184
- * This is usually the key of a pattern in a {@link Grammar}.
1185
- *
1186
- * @type {string}
1187
- * @see GrammarToken
1188
- * @public
1189
- */
1190
- this.type = type;
1191
- /**
1192
- * The strings or tokens contained by this token.
1193
- *
1194
- * This will be a token stream if the pattern matched also defined an `inside` grammar.
1195
- *
1196
- * @type {string | TokenStream}
1197
- * @public
1198
- */
1199
- this.content = content;
1200
- /**
1201
- * The alias(es) of the token.
1202
- *
1203
- * @type {string|string[]}
1204
- * @see GrammarToken
1205
- * @public
1206
- */
1207
- this.alias = alias;
1208
- // Copy of the full string this token was created from
1209
- this.length = (matchedStr || '').length | 0;
1210
- }
1211
-
1212
- /**
1213
- * A token stream is an array of strings and {@link Token Token} objects.
1214
- *
1215
- * Token streams have to fulfill a few properties that are assumed by most functions (mostly internal ones) that process
1216
- * them.
1217
- *
1218
- * 1. No adjacent strings.
1219
- * 2. No empty strings.
1220
- *
1221
- * The only exception here is the token stream that only contains the empty string and nothing else.
1222
- *
1223
- * @typedef {Array<string | Token>} TokenStream
1224
- * @global
1225
- * @public
1226
- */
1227
-
1228
- /**
1229
- * Converts the given token or token stream to an HTML representation.
1230
- *
1231
- * The following hooks will be run:
1232
- * 1. `wrap`: On each {@link Token}.
1233
- *
1234
- * @param {string | Token | TokenStream} o The token or token stream to be converted.
1235
- * @param {string} language The name of current language.
1236
- * @returns {string} The HTML representation of the token or token stream.
1237
- * @memberof Token
1238
- * @static
1239
- */
1240
- Token.stringify = function stringify(o, language) {
1241
- if (typeof o == 'string') {
1242
- return o;
1243
- }
1244
- if (Array.isArray(o)) {
1245
- var s = '';
1246
- o.forEach(function (e) {
1247
- s += stringify(e, language);
1248
- });
1249
- return s;
1250
- }
1251
-
1252
- var env = {
1253
- type: o.type,
1254
- content: stringify(o.content, language),
1255
- tag: 'span',
1256
- classes: ['token', o.type],
1257
- attributes: {},
1258
- language: language
1259
- };
1260
-
1261
- var aliases = o.alias;
1262
- if (aliases) {
1263
- if (Array.isArray(aliases)) {
1264
- Array.prototype.push.apply(env.classes, aliases);
1265
- } else {
1266
- env.classes.push(aliases);
1267
- }
1268
- }
1269
-
1270
- _.hooks.run('wrap', env);
1271
-
1272
- var attributes = '';
1273
- for (var name in env.attributes) {
1274
- attributes += ' ' + name + '="' + (env.attributes[name] || '').replace(/"/g, '&quot;') + '"';
1275
- }
1276
-
1277
- return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + attributes + '>' + env.content + '</' + env.tag + '>';
1278
- };
1279
-
1280
- /**
1281
- * @param {RegExp} pattern
1282
- * @param {number} pos
1283
- * @param {string} text
1284
- * @param {boolean} lookbehind
1285
- * @returns {RegExpExecArray | null}
1286
- */
1287
- function matchPattern(pattern, pos, text, lookbehind) {
1288
- pattern.lastIndex = pos;
1289
- var match = pattern.exec(text);
1290
- if (match && lookbehind && match[1]) {
1291
- // change the match to remove the text matched by the Prism lookbehind group
1292
- var lookbehindLength = match[1].length;
1293
- match.index += lookbehindLength;
1294
- match[0] = match[0].slice(lookbehindLength);
1295
- }
1296
- return match;
1297
- }
1298
-
1299
- /**
1300
- * @param {string} text
1301
- * @param {LinkedList<string | Token>} tokenList
1302
- * @param {any} grammar
1303
- * @param {LinkedListNode<string | Token>} startNode
1304
- * @param {number} startPos
1305
- * @param {RematchOptions} [rematch]
1306
- * @returns {void}
1307
- * @private
1308
- *
1309
- * @typedef RematchOptions
1310
- * @property {string} cause
1311
- * @property {number} reach
1312
- */
1313
- function matchGrammar(text, tokenList, grammar, startNode, startPos, rematch) {
1314
- for (var token in grammar) {
1315
- if (!grammar.hasOwnProperty(token) || !grammar[token]) {
1316
- continue;
1317
- }
1318
-
1319
- var patterns = grammar[token];
1320
- patterns = Array.isArray(patterns) ? patterns : [patterns];
1321
-
1322
- for (var j = 0; j < patterns.length; ++j) {
1323
- if (rematch && rematch.cause == token + ',' + j) {
1324
- return;
1325
- }
1326
-
1327
- var patternObj = patterns[j];
1328
- var inside = patternObj.inside;
1329
- var lookbehind = !!patternObj.lookbehind;
1330
- var greedy = !!patternObj.greedy;
1331
- var alias = patternObj.alias;
1332
-
1333
- if (greedy && !patternObj.pattern.global) {
1334
- // Without the global flag, lastIndex won't work
1335
- var flags = patternObj.pattern.toString().match(/[imsuy]*$/)[0];
1336
- patternObj.pattern = RegExp(patternObj.pattern.source, flags + 'g');
1337
- }
1338
-
1339
- /** @type {RegExp} */
1340
- var pattern = patternObj.pattern || patternObj;
1341
-
1342
- for ( // iterate the token list and keep track of the current token/string position
1343
- var currentNode = startNode.next, pos = startPos;
1344
- currentNode !== tokenList.tail;
1345
- pos += currentNode.value.length, currentNode = currentNode.next
1346
- ) {
1347
-
1348
- if (rematch && pos >= rematch.reach) {
1349
- break;
1350
- }
1351
-
1352
- var str = currentNode.value;
1353
-
1354
- if (tokenList.length > text.length) {
1355
- // Something went terribly wrong, ABORT, ABORT!
1356
- return;
1357
- }
1358
-
1359
- if (str instanceof Token) {
1360
- continue;
1361
- }
1362
-
1363
- var removeCount = 1; // this is the to parameter of removeBetween
1364
- var match;
1365
-
1366
- if (greedy) {
1367
- match = matchPattern(pattern, pos, text, lookbehind);
1368
- if (!match || match.index >= text.length) {
1369
- break;
1370
- }
1371
-
1372
- var from = match.index;
1373
- var to = match.index + match[0].length;
1374
- var p = pos;
1375
-
1376
- // find the node that contains the match
1377
- p += currentNode.value.length;
1378
- while (from >= p) {
1379
- currentNode = currentNode.next;
1380
- p += currentNode.value.length;
1381
- }
1382
- // adjust pos (and p)
1383
- p -= currentNode.value.length;
1384
- pos = p;
1385
-
1386
- // the current node is a Token, then the match starts inside another Token, which is invalid
1387
- if (currentNode.value instanceof Token) {
1388
- continue;
1389
- }
1390
-
1391
- // find the last node which is affected by this match
1392
- for (
1393
- var k = currentNode;
1394
- k !== tokenList.tail && (p < to || typeof k.value === 'string');
1395
- k = k.next
1396
- ) {
1397
- removeCount++;
1398
- p += k.value.length;
1399
- }
1400
- removeCount--;
1401
-
1402
- // replace with the new match
1403
- str = text.slice(pos, p);
1404
- match.index -= pos;
1405
- } else {
1406
- match = matchPattern(pattern, 0, str, lookbehind);
1407
- if (!match) {
1408
- continue;
1409
- }
1410
- }
1411
-
1412
- // eslint-disable-next-line no-redeclare
1413
- var from = match.index;
1414
- var matchStr = match[0];
1415
- var before = str.slice(0, from);
1416
- var after = str.slice(from + matchStr.length);
1417
-
1418
- var reach = pos + str.length;
1419
- if (rematch && reach > rematch.reach) {
1420
- rematch.reach = reach;
1421
- }
1422
-
1423
- var removeFrom = currentNode.prev;
1424
-
1425
- if (before) {
1426
- removeFrom = addAfter(tokenList, removeFrom, before);
1427
- pos += before.length;
1428
- }
1429
-
1430
- removeRange(tokenList, removeFrom, removeCount);
1431
-
1432
- var wrapped = new Token(token, inside ? _.tokenize(matchStr, inside) : matchStr, alias, matchStr);
1433
- currentNode = addAfter(tokenList, removeFrom, wrapped);
1434
-
1435
- if (after) {
1436
- addAfter(tokenList, currentNode, after);
1437
- }
1438
-
1439
- if (removeCount > 1) {
1440
- // at least one Token object was removed, so we have to do some rematching
1441
- // this can only happen if the current pattern is greedy
1442
-
1443
- /** @type {RematchOptions} */
1444
- var nestedRematch = {
1445
- cause: token + ',' + j,
1446
- reach: reach
1447
- };
1448
- matchGrammar(text, tokenList, grammar, currentNode.prev, pos, nestedRematch);
1449
-
1450
- // the reach might have been extended because of the rematching
1451
- if (rematch && nestedRematch.reach > rematch.reach) {
1452
- rematch.reach = nestedRematch.reach;
1453
- }
1454
- }
1455
- }
1456
- }
1457
- }
1458
- }
1459
-
1460
- /**
1461
- * @typedef LinkedListNode
1462
- * @property {T} value
1463
- * @property {LinkedListNode<T> | null} prev The previous node.
1464
- * @property {LinkedListNode<T> | null} next The next node.
1465
- * @template T
1466
- * @private
1467
- */
1468
-
1469
- /**
1470
- * @template T
1471
- * @private
1472
- */
1473
- function LinkedList() {
1474
- /** @type {LinkedListNode<T>} */
1475
- var head = { value: null, prev: null, next: null };
1476
- /** @type {LinkedListNode<T>} */
1477
- var tail = { value: null, prev: head, next: null };
1478
- head.next = tail;
1479
-
1480
- /** @type {LinkedListNode<T>} */
1481
- this.head = head;
1482
- /** @type {LinkedListNode<T>} */
1483
- this.tail = tail;
1484
- this.length = 0;
1485
- }
1486
-
1487
- /**
1488
- * Adds a new node with the given value to the list.
1489
- *
1490
- * @param {LinkedList<T>} list
1491
- * @param {LinkedListNode<T>} node
1492
- * @param {T} value
1493
- * @returns {LinkedListNode<T>} The added node.
1494
- * @template T
1495
- */
1496
- function addAfter(list, node, value) {
1497
- // assumes that node != list.tail && values.length >= 0
1498
- var next = node.next;
1499
-
1500
- var newNode = { value: value, prev: node, next: next };
1501
- node.next = newNode;
1502
- next.prev = newNode;
1503
- list.length++;
1504
-
1505
- return newNode;
1506
- }
1507
- /**
1508
- * Removes `count` nodes after the given node. The given node will not be removed.
1509
- *
1510
- * @param {LinkedList<T>} list
1511
- * @param {LinkedListNode<T>} node
1512
- * @param {number} count
1513
- * @template T
1514
- */
1515
- function removeRange(list, node, count) {
1516
- var next = node.next;
1517
- for (var i = 0; i < count && next !== list.tail; i++) {
1518
- next = next.next;
1519
- }
1520
- node.next = next;
1521
- next.prev = node;
1522
- list.length -= i;
1523
- }
1524
- /**
1525
- * @param {LinkedList<T>} list
1526
- * @returns {T[]}
1527
- * @template T
1528
- */
1529
- function toArray(list) {
1530
- var array = [];
1531
- var node = list.head.next;
1532
- while (node !== list.tail) {
1533
- array.push(node.value);
1534
- node = node.next;
1535
- }
1536
- return array;
1537
- }
1538
-
1539
-
1540
- if (!_self.document) {
1541
- if (!_self.addEventListener) {
1542
- // in Node.js
1543
- return _;
1544
- }
1545
-
1546
- if (!_.disableWorkerMessageHandler) {
1547
- // In worker
1548
- _self.addEventListener('message', function (evt) {
1549
- var message = JSON.parse(evt.data);
1550
- var lang = message.language;
1551
- var code = message.code;
1552
- var immediateClose = message.immediateClose;
1553
-
1554
- _self.postMessage(_.highlight(code, _.languages[lang], lang));
1555
- if (immediateClose) {
1556
- _self.close();
1557
- }
1558
- }, false);
1559
- }
1560
-
1561
- return _;
1562
- }
1563
-
1564
- // Get current script and highlight
1565
- var script = _.util.currentScript();
1566
-
1567
- if (script) {
1568
- _.filename = script.src;
1569
-
1570
- if (script.hasAttribute('data-manual')) {
1571
- _.manual = true;
1572
- }
1573
- }
1574
-
1575
- function highlightAutomaticallyCallback() {
1576
- if (!_.manual) {
1577
- _.highlightAll();
1578
- }
1579
- }
1580
-
1581
- if (!_.manual) {
1582
- // If the document state is "loading", then we'll use DOMContentLoaded.
1583
- // If the document state is "interactive" and the prism.js script is deferred, then we'll also use the
1584
- // DOMContentLoaded event because there might be some plugins or languages which have also been deferred and they
1585
- // might take longer one animation frame to execute which can create a race condition where only some plugins have
1586
- // been loaded when Prism.highlightAll() is executed, depending on how fast resources are loaded.
1587
- // See https://github.com/PrismJS/prism/issues/2102
1588
- var readyState = document.readyState;
1589
- if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) {
1590
- document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback);
1591
- } else {
1592
- if (window.requestAnimationFrame) {
1593
- window.requestAnimationFrame(highlightAutomaticallyCallback);
1594
- } else {
1595
- window.setTimeout(highlightAutomaticallyCallback, 16);
1596
- }
1597
- }
1598
- }
1599
-
1600
- return _;
1601
-
1602
- }(_self));
1603
-
1604
- if (module.exports) {
1605
- module.exports = Prism;
1606
- }
1607
-
1608
- // hack for components to work correctly in node.js
1609
- if (typeof commonjsGlobal !== 'undefined') {
1610
- commonjsGlobal.Prism = Prism;
1611
- }
1612
-
1613
- // some additional documentation/types
1614
-
1615
- /**
1616
- * The expansion of a simple `RegExp` literal to support additional properties.
1617
- *
1618
- * @typedef GrammarToken
1619
- * @property {RegExp} pattern The regular expression of the token.
1620
- * @property {boolean} [lookbehind=false] If `true`, then the first capturing group of `pattern` will (effectively)
1621
- * behave as a lookbehind group meaning that the captured text will not be part of the matched text of the new token.
1622
- * @property {boolean} [greedy=false] Whether the token is greedy.
1623
- * @property {string|string[]} [alias] An optional alias or list of aliases.
1624
- * @property {Grammar} [inside] The nested grammar of this token.
1625
- *
1626
- * The `inside` grammar will be used to tokenize the text value of each token of this kind.
1627
- *
1628
- * This can be used to make nested and even recursive language definitions.
1629
- *
1630
- * Note: This can cause infinite recursion. Be careful when you embed different languages or even the same language into
1631
- * each another.
1632
- * @global
1633
- * @public
1634
- */
1635
-
1636
- /**
1637
- * @typedef Grammar
1638
- * @type {Object<string, RegExp | GrammarToken | Array<RegExp | GrammarToken>>}
1639
- * @property {Grammar} [rest] An optional grammar object that will be appended to this grammar.
1640
- * @global
1641
- * @public
1642
- */
1643
-
1644
- /**
1645
- * A function which will invoked after an element was successfully highlighted.
1646
- *
1647
- * @callback HighlightCallback
1648
- * @param {Element} element The element successfully highlighted.
1649
- * @returns {void}
1650
- * @global
1651
- * @public
1652
- */
1653
-
1654
- /**
1655
- * @callback HookCallback
1656
- * @param {Object<string, any>} env The environment variables of the hook.
1657
- * @returns {void}
1658
- * @global
1659
- * @public
1660
- */
1661
-
1662
-
1663
- /* **********************************************
1664
- Begin prism-markup.js
1665
- ********************************************** */
1666
-
1667
- Prism.languages.markup = {
1668
- 'comment': {
1669
- pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
1670
- greedy: true
1671
- },
1672
- 'prolog': {
1673
- pattern: /<\?[\s\S]+?\?>/,
1674
- greedy: true
1675
- },
1676
- 'doctype': {
1677
- // https://www.w3.org/TR/xml/#NT-doctypedecl
1678
- pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
1679
- greedy: true,
1680
- inside: {
1681
- 'internal-subset': {
1682
- pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
1683
- lookbehind: true,
1684
- greedy: true,
1685
- inside: null // see below
1686
- },
1687
- 'string': {
1688
- pattern: /"[^"]*"|'[^']*'/,
1689
- greedy: true
1690
- },
1691
- 'punctuation': /^<!|>$|[[\]]/,
1692
- 'doctype-tag': /^DOCTYPE/i,
1693
- 'name': /[^\s<>'"]+/
1694
- }
1695
- },
1696
- 'cdata': {
1697
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1698
- greedy: true
1699
- },
1700
- 'tag': {
1701
- pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
1702
- greedy: true,
1703
- inside: {
1704
- 'tag': {
1705
- pattern: /^<\/?[^\s>\/]+/,
1706
- inside: {
1707
- 'punctuation': /^<\/?/,
1708
- 'namespace': /^[^\s>\/:]+:/
1709
- }
1710
- },
1711
- 'special-attr': [],
1712
- 'attr-value': {
1713
- pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
1714
- inside: {
1715
- 'punctuation': [
1716
- {
1717
- pattern: /^=/,
1718
- alias: 'attr-equals'
1719
- },
1720
- {
1721
- pattern: /^(\s*)["']|["']$/,
1722
- lookbehind: true
1723
- }
1724
- ]
1725
- }
1726
- },
1727
- 'punctuation': /\/?>/,
1728
- 'attr-name': {
1729
- pattern: /[^\s>\/]+/,
1730
- inside: {
1731
- 'namespace': /^[^\s>\/:]+:/
1732
- }
1733
- }
1734
-
1735
- }
1736
- },
1737
- 'entity': [
1738
- {
1739
- pattern: /&[\da-z]{1,8};/i,
1740
- alias: 'named-entity'
1741
- },
1742
- /&#x?[\da-f]{1,8};/i
1743
- ]
1744
- };
1745
-
1746
- Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] =
1747
- Prism.languages.markup['entity'];
1748
- Prism.languages.markup['doctype'].inside['internal-subset'].inside = Prism.languages.markup;
1749
-
1750
- // Plugin to make entity title show the real entity, idea by Roman Komarov
1751
- Prism.hooks.add('wrap', function (env) {
1752
-
1753
- if (env.type === 'entity') {
1754
- env.attributes['title'] = env.content.replace(/&amp;/, '&');
1755
- }
1756
- });
1757
-
1758
- Object.defineProperty(Prism.languages.markup.tag, 'addInlined', {
1759
- /**
1760
- * Adds an inlined language to markup.
1761
- *
1762
- * An example of an inlined language is CSS with `<style>` tags.
1763
- *
1764
- * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
1765
- * case insensitive.
1766
- * @param {string} lang The language key.
1767
- * @example
1768
- * addInlined('style', 'css');
1769
- */
1770
- value: function addInlined(tagName, lang) {
1771
- var includedCdataInside = {};
1772
- includedCdataInside['language-' + lang] = {
1773
- pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
1774
- lookbehind: true,
1775
- inside: Prism.languages[lang]
1776
- };
1777
- includedCdataInside['cdata'] = /^<!\[CDATA\[|\]\]>$/i;
1778
-
1779
- var inside = {
1780
- 'included-cdata': {
1781
- pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
1782
- inside: includedCdataInside
1783
- }
1784
- };
1785
- inside['language-' + lang] = {
1786
- pattern: /[\s\S]+/,
1787
- inside: Prism.languages[lang]
1788
- };
1789
-
1790
- var def = {};
1791
- def[tagName] = {
1792
- pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function () { return tagName; }), 'i'),
1793
- lookbehind: true,
1794
- greedy: true,
1795
- inside: inside
1796
- };
1797
-
1798
- Prism.languages.insertBefore('markup', 'cdata', def);
1799
- }
1800
- });
1801
- Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
1802
- /**
1803
- * Adds an pattern to highlight languages embedded in HTML attributes.
1804
- *
1805
- * An example of an inlined language is CSS with `style` attributes.
1806
- *
1807
- * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
1808
- * case insensitive.
1809
- * @param {string} lang The language key.
1810
- * @example
1811
- * addAttribute('style', 'css');
1812
- */
1813
- value: function (attrName, lang) {
1814
- Prism.languages.markup.tag.inside['special-attr'].push({
1815
- pattern: RegExp(
1816
- /(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
1817
- 'i'
1818
- ),
1819
- lookbehind: true,
1820
- inside: {
1821
- 'attr-name': /^[^\s=]+/,
1822
- 'attr-value': {
1823
- pattern: /=[\s\S]+/,
1824
- inside: {
1825
- 'value': {
1826
- pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
1827
- lookbehind: true,
1828
- alias: [lang, 'language-' + lang],
1829
- inside: Prism.languages[lang]
1830
- },
1831
- 'punctuation': [
1832
- {
1833
- pattern: /^=/,
1834
- alias: 'attr-equals'
1835
- },
1836
- /"|'/
1837
- ]
1838
- }
1839
- }
1840
- }
1841
- });
1842
- }
1843
- });
1844
-
1845
- Prism.languages.html = Prism.languages.markup;
1846
- Prism.languages.mathml = Prism.languages.markup;
1847
- Prism.languages.svg = Prism.languages.markup;
1848
-
1849
- Prism.languages.xml = Prism.languages.extend('markup', {});
1850
- Prism.languages.ssml = Prism.languages.xml;
1851
- Prism.languages.atom = Prism.languages.xml;
1852
- Prism.languages.rss = Prism.languages.xml;
1853
-
1854
-
1855
- /* **********************************************
1856
- Begin prism-css.js
1857
- ********************************************** */
1858
-
1859
- (function (Prism) {
1860
-
1861
- var string = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
1862
-
1863
- Prism.languages.css = {
1864
- 'comment': /\/\*[\s\S]*?\*\//,
1865
- 'atrule': {
1866
- pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source),
1867
- inside: {
1868
- 'rule': /^@[\w-]+/,
1869
- 'selector-function-argument': {
1870
- pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
1871
- lookbehind: true,
1872
- alias: 'selector'
1873
- },
1874
- 'keyword': {
1875
- pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
1876
- lookbehind: true
1877
- }
1878
- // See rest below
1879
- }
1880
- },
1881
- 'url': {
1882
- // https://drafts.csswg.org/css-values-3/#urls
1883
- pattern: RegExp('\\burl\\((?:' + string.source + '|' + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ')\\)', 'i'),
1884
- greedy: true,
1885
- inside: {
1886
- 'function': /^url/i,
1887
- 'punctuation': /^\(|\)$/,
1888
- 'string': {
1889
- pattern: RegExp('^' + string.source + '$'),
1890
- alias: 'url'
1891
- }
1892
- }
1893
- },
1894
- 'selector': {
1895
- pattern: RegExp('(^|[{}\\s])[^{}\\s](?:[^{};"\'\\s]|\\s+(?![\\s{])|' + string.source + ')*(?=\\s*\\{)'),
1896
- lookbehind: true
1897
- },
1898
- 'string': {
1899
- pattern: string,
1900
- greedy: true
1901
- },
1902
- 'property': {
1903
- pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
1904
- lookbehind: true
1905
- },
1906
- 'important': /!important\b/i,
1907
- 'function': {
1908
- pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
1909
- lookbehind: true
1910
- },
1911
- 'punctuation': /[(){};:,]/
1912
- };
1913
-
1914
- Prism.languages.css['atrule'].inside.rest = Prism.languages.css;
1915
-
1916
- var markup = Prism.languages.markup;
1917
- if (markup) {
1918
- markup.tag.addInlined('style', 'css');
1919
- markup.tag.addAttribute('style', 'css');
1920
- }
1921
-
1922
- }(Prism));
1923
-
1924
-
1925
- /* **********************************************
1926
- Begin prism-clike.js
1927
- ********************************************** */
1928
-
1929
- Prism.languages.clike = {
1930
- 'comment': [
1931
- {
1932
- pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
1933
- lookbehind: true,
1934
- greedy: true
1935
- },
1936
- {
1937
- pattern: /(^|[^\\:])\/\/.*/,
1938
- lookbehind: true,
1939
- greedy: true
1940
- }
1941
- ],
1942
- 'string': {
1943
- pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
1944
- greedy: true
1945
- },
1946
- 'class-name': {
1947
- pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
1948
- lookbehind: true,
1949
- inside: {
1950
- 'punctuation': /[.\\]/
1951
- }
1952
- },
1953
- 'keyword': /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
1954
- 'boolean': /\b(?:false|true)\b/,
1955
- 'function': /\b\w+(?=\()/,
1956
- 'number': /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
1957
- 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
1958
- 'punctuation': /[{}[\];(),.:]/
1959
- };
1960
-
1961
-
1962
- /* **********************************************
1963
- Begin prism-javascript.js
1964
- ********************************************** */
1965
-
1966
- Prism.languages.javascript = Prism.languages.extend('clike', {
1967
- 'class-name': [
1968
- Prism.languages.clike['class-name'],
1969
- {
1970
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
1971
- lookbehind: true
1972
- }
1973
- ],
1974
- 'keyword': [
1975
- {
1976
- pattern: /((?:^|\})\s*)catch\b/,
1977
- lookbehind: true
1978
- },
1979
- {
1980
- pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
1981
- lookbehind: true
1982
- },
1983
- ],
1984
- // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
1985
- 'function': /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
1986
- 'number': {
1987
- pattern: RegExp(
1988
- /(^|[^\w$])/.source +
1989
- '(?:' +
1990
- (
1991
- // constant
1992
- /NaN|Infinity/.source +
1993
- '|' +
1994
- // binary integer
1995
- /0[bB][01]+(?:_[01]+)*n?/.source +
1996
- '|' +
1997
- // octal integer
1998
- /0[oO][0-7]+(?:_[0-7]+)*n?/.source +
1999
- '|' +
2000
- // hexadecimal integer
2001
- /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source +
2002
- '|' +
2003
- // decimal bigint
2004
- /\d+(?:_\d+)*n/.source +
2005
- '|' +
2006
- // decimal number (integer or float) but no bigint
2007
- /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source
2008
- ) +
2009
- ')' +
2010
- /(?![\w$])/.source
2011
- ),
2012
- lookbehind: true
2013
- },
2014
- 'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
2015
- });
2016
-
2017
- Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/;
2018
-
2019
- Prism.languages.insertBefore('javascript', 'keyword', {
2020
- 'regex': {
2021
- pattern: RegExp(
2022
- // lookbehind
2023
- // eslint-disable-next-line regexp/no-dupe-characters-character-class
2024
- /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source +
2025
- // Regex pattern:
2026
- // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
2027
- // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
2028
- // with the only syntax, so we have to define 2 different regex patterns.
2029
- /\//.source +
2030
- '(?:' +
2031
- /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source +
2032
- '|' +
2033
- // `v` flag syntax. This supports 3 levels of nested character classes.
2034
- /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source +
2035
- ')' +
2036
- // lookahead
2037
- /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
2038
- ),
2039
- lookbehind: true,
2040
- greedy: true,
2041
- inside: {
2042
- 'regex-source': {
2043
- pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
2044
- lookbehind: true,
2045
- alias: 'language-regex',
2046
- inside: Prism.languages.regex
2047
- },
2048
- 'regex-delimiter': /^\/|\/$/,
2049
- 'regex-flags': /^[a-z]+$/,
2050
- }
2051
- },
2052
- // This must be declared before keyword because we use "function" inside the look-forward
2053
- 'function-variable': {
2054
- pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
2055
- alias: 'function'
2056
- },
2057
- 'parameter': [
2058
- {
2059
- pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
2060
- lookbehind: true,
2061
- inside: Prism.languages.javascript
2062
- },
2063
- {
2064
- pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
2065
- lookbehind: true,
2066
- inside: Prism.languages.javascript
2067
- },
2068
- {
2069
- pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
2070
- lookbehind: true,
2071
- inside: Prism.languages.javascript
2072
- },
2073
- {
2074
- pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
2075
- lookbehind: true,
2076
- inside: Prism.languages.javascript
2077
- }
2078
- ],
2079
- 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/
2080
- });
2081
-
2082
- Prism.languages.insertBefore('javascript', 'string', {
2083
- 'hashbang': {
2084
- pattern: /^#!.*/,
2085
- greedy: true,
2086
- alias: 'comment'
2087
- },
2088
- 'template-string': {
2089
- pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
2090
- greedy: true,
2091
- inside: {
2092
- 'template-punctuation': {
2093
- pattern: /^`|`$/,
2094
- alias: 'string'
2095
- },
2096
- 'interpolation': {
2097
- pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
2098
- lookbehind: true,
2099
- inside: {
2100
- 'interpolation-punctuation': {
2101
- pattern: /^\$\{|\}$/,
2102
- alias: 'punctuation'
2103
- },
2104
- rest: Prism.languages.javascript
2105
- }
2106
- },
2107
- 'string': /[\s\S]+/
2108
- }
2109
- },
2110
- 'string-property': {
2111
- pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
2112
- lookbehind: true,
2113
- greedy: true,
2114
- alias: 'property'
2115
- }
2116
- });
2117
-
2118
- Prism.languages.insertBefore('javascript', 'operator', {
2119
- 'literal-property': {
2120
- pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
2121
- lookbehind: true,
2122
- alias: 'property'
2123
- },
2124
- });
2125
-
2126
- if (Prism.languages.markup) {
2127
- Prism.languages.markup.tag.addInlined('script', 'javascript');
2128
-
2129
- // add attribute support for all DOM events.
2130
- // https://developer.mozilla.org/en-US/docs/Web/Events#Standard_events
2131
- Prism.languages.markup.tag.addAttribute(
2132
- /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
2133
- 'javascript'
2134
- );
2135
- }
2136
-
2137
- Prism.languages.js = Prism.languages.javascript;
2138
-
2139
-
2140
- /* **********************************************
2141
- Begin prism-file-highlight.js
2142
- ********************************************** */
2143
-
2144
- (function () {
2145
-
2146
- if (typeof Prism === 'undefined' || typeof document === 'undefined') {
2147
- return;
2148
- }
2149
-
2150
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/matches#Polyfill
2151
- if (!Element.prototype.matches) {
2152
- Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;
2153
- }
2154
-
2155
- var LOADING_MESSAGE = 'Loading…';
2156
- var FAILURE_MESSAGE = function (status, message) {
2157
- return '✖ Error ' + status + ' while fetching file: ' + message;
2158
- };
2159
- var FAILURE_EMPTY_MESSAGE = '✖ Error: File does not exist or is empty';
2160
-
2161
- var EXTENSIONS = {
2162
- 'js': 'javascript',
2163
- 'py': 'python',
2164
- 'rb': 'ruby',
2165
- 'ps1': 'powershell',
2166
- 'psm1': 'powershell',
2167
- 'sh': 'bash',
2168
- 'bat': 'batch',
2169
- 'h': 'c',
2170
- 'tex': 'latex'
2171
- };
2172
-
2173
- var STATUS_ATTR = 'data-src-status';
2174
- var STATUS_LOADING = 'loading';
2175
- var STATUS_LOADED = 'loaded';
2176
- var STATUS_FAILED = 'failed';
2177
-
2178
- var SELECTOR = 'pre[data-src]:not([' + STATUS_ATTR + '="' + STATUS_LOADED + '"])'
2179
- + ':not([' + STATUS_ATTR + '="' + STATUS_LOADING + '"])';
2180
-
2181
- /**
2182
- * Loads the given file.
2183
- *
2184
- * @param {string} src The URL or path of the source file to load.
2185
- * @param {(result: string) => void} success
2186
- * @param {(reason: string) => void} error
2187
- */
2188
- function loadFile(src, success, error) {
2189
- var xhr = new XMLHttpRequest();
2190
- xhr.open('GET', src, true);
2191
- xhr.onreadystatechange = function () {
2192
- if (xhr.readyState == 4) {
2193
- if (xhr.status < 400 && xhr.responseText) {
2194
- success(xhr.responseText);
2195
- } else {
2196
- if (xhr.status >= 400) {
2197
- error(FAILURE_MESSAGE(xhr.status, xhr.statusText));
2198
- } else {
2199
- error(FAILURE_EMPTY_MESSAGE);
2200
- }
2201
- }
2202
- }
2203
- };
2204
- xhr.send(null);
2205
- }
2206
-
2207
- /**
2208
- * Parses the given range.
2209
- *
2210
- * This returns a range with inclusive ends.
2211
- *
2212
- * @param {string | null | undefined} range
2213
- * @returns {[number, number | undefined] | undefined}
2214
- */
2215
- function parseRange(range) {
2216
- var m = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(range || '');
2217
- if (m) {
2218
- var start = Number(m[1]);
2219
- var comma = m[2];
2220
- var end = m[3];
2221
-
2222
- if (!comma) {
2223
- return [start, start];
2224
- }
2225
- if (!end) {
2226
- return [start, undefined];
2227
- }
2228
- return [start, Number(end)];
2229
- }
2230
- return undefined;
2231
- }
2232
-
2233
- Prism.hooks.add('before-highlightall', function (env) {
2234
- env.selector += ', ' + SELECTOR;
2235
- });
2236
-
2237
- Prism.hooks.add('before-sanity-check', function (env) {
2238
- var pre = /** @type {HTMLPreElement} */ (env.element);
2239
- if (pre.matches(SELECTOR)) {
2240
- env.code = ''; // fast-path the whole thing and go to complete
2241
-
2242
- pre.setAttribute(STATUS_ATTR, STATUS_LOADING); // mark as loading
2243
-
2244
- // add code element with loading message
2245
- var code = pre.appendChild(document.createElement('CODE'));
2246
- code.textContent = LOADING_MESSAGE;
2247
-
2248
- var src = pre.getAttribute('data-src');
2249
-
2250
- var language = env.language;
2251
- if (language === 'none') {
2252
- // the language might be 'none' because there is no language set;
2253
- // in this case, we want to use the extension as the language
2254
- var extension = (/\.(\w+)$/.exec(src) || [, 'none'])[1];
2255
- language = EXTENSIONS[extension] || extension;
2256
- }
2257
-
2258
- // set language classes
2259
- Prism.util.setLanguage(code, language);
2260
- Prism.util.setLanguage(pre, language);
2261
-
2262
- // preload the language
2263
- var autoloader = Prism.plugins.autoloader;
2264
- if (autoloader) {
2265
- autoloader.loadLanguages(language);
2266
- }
2267
-
2268
- // load file
2269
- loadFile(
2270
- src,
2271
- function (text) {
2272
- // mark as loaded
2273
- pre.setAttribute(STATUS_ATTR, STATUS_LOADED);
2274
-
2275
- // handle data-range
2276
- var range = parseRange(pre.getAttribute('data-range'));
2277
- if (range) {
2278
- var lines = text.split(/\r\n?|\n/g);
2279
-
2280
- // the range is one-based and inclusive on both ends
2281
- var start = range[0];
2282
- var end = range[1] == null ? lines.length : range[1];
2283
-
2284
- if (start < 0) { start += lines.length; }
2285
- start = Math.max(0, Math.min(start - 1, lines.length));
2286
- if (end < 0) { end += lines.length; }
2287
- end = Math.max(0, Math.min(end, lines.length));
2288
-
2289
- text = lines.slice(start, end).join('\n');
2290
-
2291
- // add data-start for line numbers
2292
- if (!pre.hasAttribute('data-start')) {
2293
- pre.setAttribute('data-start', String(start + 1));
2294
- }
2295
- }
2296
-
2297
- // highlight code
2298
- code.textContent = text;
2299
- Prism.highlightElement(code);
2300
- },
2301
- function (error) {
2302
- // mark as failed
2303
- pre.setAttribute(STATUS_ATTR, STATUS_FAILED);
2304
-
2305
- code.textContent = error;
2306
- }
2307
- );
2308
- }
2309
- });
2310
-
2311
- Prism.plugins.fileHighlight = {
2312
- /**
2313
- * Executes the File Highlight plugin for all matching `pre` elements under the given container.
2314
- *
2315
- * Note: Elements which are already loaded or currently loading will not be touched by this method.
2316
- *
2317
- * @param {ParentNode} [container=document]
2318
- */
2319
- highlight: function highlight(container) {
2320
- var elements = (container || document).querySelectorAll(SELECTOR);
2321
-
2322
- for (var i = 0, element; (element = elements[i++]);) {
2323
- Prism.highlightElement(element);
2324
- }
2325
- }
2326
- };
2327
-
2328
- var logged = false;
2329
- /** @deprecated Use `Prism.plugins.fileHighlight.highlight` instead. */
2330
- Prism.fileHighlight = function () {
2331
- if (!logged) {
2332
- console.warn('Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead.');
2333
- logged = true;
2334
- }
2335
- Prism.plugins.fileHighlight.highlight.apply(this, arguments);
2336
- };
2337
-
2338
- }());
2339
- } (prism));
2340
-
2341
- var Prism = prism.exports;
2342
-
2343
- var css = "code[class*=language-],pre[class*=language-]{word-wrap:normal;background:none;color:#ccc;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;font-size:1em;-webkit-hyphens:none;hyphens:none;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;white-space:pre;word-break:normal;word-spacing:normal}pre[class*=language-]{margin:.5em 0;overflow:auto;padding:1em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#2d2d2d}:not(pre)>code[class*=language-]{border-radius:.3em;padding:.1em;white-space:normal}.token.block-comment,.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#999}.token.punctuation{color:#ccc}.token.attr-name,.token.deleted,.token.namespace,.token.tag{color:#e2777a}.token.function-name{color:#6196cc}.token.boolean,.token.function,.token.number{color:#f08d49}.token.class-name,.token.constant,.token.property,.token.symbol{color:#f8c555}.token.atrule,.token.builtin,.token.important,.token.keyword,.token.selector{color:#cc99cd}.token.attr-value,.token.char,.token.regex,.token.string,.token.variable{color:#7ec699}.token.entity,.token.operator,.token.url{color:#67cdcc}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.token.inserted{color:green}";
2344
- n(css,{});
2345
-
2346
- var SyntaxHighlighter = function SyntaxHighlighter(_ref) {
2347
- var className = _ref.className,
2348
- code = _ref.code,
2349
- language = _ref.language;
2350
- React.useEffect(function () {
2351
- Prism.highlightAll();
2352
- }, [code]);
2353
- return /*#__PURE__*/React__default["default"].createElement("pre", {
2354
- className: className
2355
- }, /*#__PURE__*/React__default["default"].createElement("code", {
2356
- className: "language-".concat(language)
2357
- }, code));
2358
- };
2359
- var SyntaxHighlighter$1 = /*#__PURE__*/React__default["default"].memo(SyntaxHighlighter);
2360
-
2361
- var CodeBlock = function CodeBlock(_ref) {
2362
- var _ref$title = _ref.title,
2363
- title = _ref$title === void 0 ? /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
2364
- i18nKey: "neetoMolecules.codeblock.codeSnippet"
2365
- })) : _ref$title,
2366
- codeString = _ref.codeString,
2367
- _ref$showCopyButton = _ref.showCopyButton,
2368
- showCopyButton = _ref$showCopyButton === void 0 ? true : _ref$showCopyButton,
2369
- _ref$className = _ref.className,
2370
- className = _ref$className === void 0 ? "" : _ref$className,
2371
- _ref$sendViaEmail = _ref.sendViaEmail,
2372
- sendViaEmail = _ref$sendViaEmail === void 0 ? undefined : _ref$sendViaEmail,
2373
- _ref$frameworkProps = _ref.frameworkProps,
2374
- frameworkProps = _ref$frameworkProps === void 0 ? {} : _ref$frameworkProps;
2375
- var _useTranslation = reactI18next.useTranslation(),
2376
- t = _useTranslation.t;
2377
- var _ref2 = frameworkProps !== null && frameworkProps !== void 0 ? frameworkProps : {},
2378
- selectedFramework = _ref2.selectedFramework,
2379
- setSelectedFramework = _ref2.setSelectedFramework;
2380
- return /*#__PURE__*/React__default["default"].createElement("div", {
2381
- className: classnames(["relative", className])
2382
- }, /*#__PURE__*/React__default["default"].createElement("div", {
2383
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg flex w-full flex-wrap items-center justify-between gap-2 rounded-b-none p-3"
2384
- }, title && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2385
- className: "m-0 flex-shrink-0",
2386
- "data-cy": "code-block-title-text",
2387
- style: "h4"
2388
- }, title), selectedFramework && /*#__PURE__*/React__default["default"].createElement(neetoui.Select, {
2389
- className: "w-40",
2390
- "data-testid": "framework-select",
2391
- options: FRAMEWORK_SELECT_OPTIONS,
2392
- value: selectedFramework,
2393
- onChange: setSelectedFramework
2394
- }), /*#__PURE__*/React__default["default"].createElement("div", {
2395
- className: "ml-auto flex flex-shrink-0 items-center justify-end gap-2"
2396
- }, sendViaEmail ? /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2397
- style: "text",
2398
- label: t("neetoMolecules.widget.installation.snippet.sendViaEmail"),
2399
- onClick: sendViaEmail
2400
- }) : null, showCopyButton && /*#__PURE__*/React__default["default"].createElement(CopyToClipboardButton__default["default"], {
2401
- label: t("neetoMolecules.widget.installation.snippet.copy"),
2402
- style: "primary",
2403
- value: codeString
2404
- }))), /*#__PURE__*/React__default["default"].createElement(SyntaxHighlighter$1, {
2405
- className: "neeto-ui-bg-gray-800 neeto-ui-rounded-lg m-0 rounded-t-none",
2406
- code: codeString,
2407
- language: "javascript"
2408
- }));
2409
- };
2410
-
2411
- function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
2412
- try {
2413
- var info = gen[key](arg);
2414
- var value = info.value;
2415
- } catch (error) {
2416
- reject(error);
2417
- return;
2418
- }
2419
- if (info.done) {
2420
- resolve(value);
2421
- } else {
2422
- Promise.resolve(value).then(_next, _throw);
2423
- }
2424
- }
2425
- function _asyncToGenerator(fn) {
2426
- return function () {
2427
- var self = this,
2428
- args = arguments;
2429
- return new Promise(function (resolve, reject) {
2430
- var gen = fn.apply(self, args);
2431
- function _next(value) {
2432
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
2433
- }
2434
- function _throw(err) {
2435
- asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
2436
- }
2437
- _next(undefined);
2438
- });
2439
- };
2440
- }
2441
-
2442
- var regeneratorRuntime$1 = {exports: {}};
2443
-
2444
- var _typeof = {exports: {}};
2445
-
2446
- (function (module) {
2447
- function _typeof(obj) {
2448
- "@babel/helpers - typeof";
2449
-
2450
- return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
2451
- return typeof obj;
2452
- } : function (obj) {
2453
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
2454
- }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
2455
- }
2456
- module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2457
- } (_typeof));
2458
-
2459
- (function (module) {
2460
- var _typeof$1 = _typeof.exports["default"];
2461
- function _regeneratorRuntime() {
2462
- module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2463
- return exports;
2464
- }, module.exports.__esModule = true, module.exports["default"] = module.exports;
2465
- var exports = {},
2466
- Op = Object.prototype,
2467
- hasOwn = Op.hasOwnProperty,
2468
- defineProperty = Object.defineProperty || function (obj, key, desc) {
2469
- obj[key] = desc.value;
2470
- },
2471
- $Symbol = "function" == typeof Symbol ? Symbol : {},
2472
- iteratorSymbol = $Symbol.iterator || "@@iterator",
2473
- asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
2474
- toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
2475
- function define(obj, key, value) {
2476
- return Object.defineProperty(obj, key, {
2477
- value: value,
2478
- enumerable: !0,
2479
- configurable: !0,
2480
- writable: !0
2481
- }), obj[key];
2482
- }
2483
- try {
2484
- define({}, "");
2485
- } catch (err) {
2486
- define = function define(obj, key, value) {
2487
- return obj[key] = value;
2488
- };
2489
- }
2490
- function wrap(innerFn, outerFn, self, tryLocsList) {
2491
- var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
2492
- generator = Object.create(protoGenerator.prototype),
2493
- context = new Context(tryLocsList || []);
2494
- return defineProperty(generator, "_invoke", {
2495
- value: makeInvokeMethod(innerFn, self, context)
2496
- }), generator;
2497
- }
2498
- function tryCatch(fn, obj, arg) {
2499
- try {
2500
- return {
2501
- type: "normal",
2502
- arg: fn.call(obj, arg)
2503
- };
2504
- } catch (err) {
2505
- return {
2506
- type: "throw",
2507
- arg: err
2508
- };
2509
- }
2510
- }
2511
- exports.wrap = wrap;
2512
- var ContinueSentinel = {};
2513
- function Generator() {}
2514
- function GeneratorFunction() {}
2515
- function GeneratorFunctionPrototype() {}
2516
- var IteratorPrototype = {};
2517
- define(IteratorPrototype, iteratorSymbol, function () {
2518
- return this;
2519
- });
2520
- var getProto = Object.getPrototypeOf,
2521
- NativeIteratorPrototype = getProto && getProto(getProto(values([])));
2522
- NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
2523
- var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
2524
- function defineIteratorMethods(prototype) {
2525
- ["next", "throw", "return"].forEach(function (method) {
2526
- define(prototype, method, function (arg) {
2527
- return this._invoke(method, arg);
2528
- });
2529
- });
2530
- }
2531
- function AsyncIterator(generator, PromiseImpl) {
2532
- function invoke(method, arg, resolve, reject) {
2533
- var record = tryCatch(generator[method], generator, arg);
2534
- if ("throw" !== record.type) {
2535
- var result = record.arg,
2536
- value = result.value;
2537
- return value && "object" == _typeof$1(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
2538
- invoke("next", value, resolve, reject);
2539
- }, function (err) {
2540
- invoke("throw", err, resolve, reject);
2541
- }) : PromiseImpl.resolve(value).then(function (unwrapped) {
2542
- result.value = unwrapped, resolve(result);
2543
- }, function (error) {
2544
- return invoke("throw", error, resolve, reject);
2545
- });
2546
- }
2547
- reject(record.arg);
2548
- }
2549
- var previousPromise;
2550
- defineProperty(this, "_invoke", {
2551
- value: function value(method, arg) {
2552
- function callInvokeWithMethodAndArg() {
2553
- return new PromiseImpl(function (resolve, reject) {
2554
- invoke(method, arg, resolve, reject);
2555
- });
2556
- }
2557
- return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
2558
- }
2559
- });
2560
- }
2561
- function makeInvokeMethod(innerFn, self, context) {
2562
- var state = "suspendedStart";
2563
- return function (method, arg) {
2564
- if ("executing" === state) throw new Error("Generator is already running");
2565
- if ("completed" === state) {
2566
- if ("throw" === method) throw arg;
2567
- return doneResult();
2568
- }
2569
- for (context.method = method, context.arg = arg;;) {
2570
- var delegate = context.delegate;
2571
- if (delegate) {
2572
- var delegateResult = maybeInvokeDelegate(delegate, context);
2573
- if (delegateResult) {
2574
- if (delegateResult === ContinueSentinel) continue;
2575
- return delegateResult;
2576
- }
2577
- }
2578
- if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
2579
- if ("suspendedStart" === state) throw state = "completed", context.arg;
2580
- context.dispatchException(context.arg);
2581
- } else "return" === context.method && context.abrupt("return", context.arg);
2582
- state = "executing";
2583
- var record = tryCatch(innerFn, self, context);
2584
- if ("normal" === record.type) {
2585
- if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
2586
- return {
2587
- value: record.arg,
2588
- done: context.done
2589
- };
2590
- }
2591
- "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
2592
- }
2593
- };
2594
- }
2595
- function maybeInvokeDelegate(delegate, context) {
2596
- var methodName = context.method,
2597
- method = delegate.iterator[methodName];
2598
- 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;
2599
- var record = tryCatch(method, delegate.iterator, context.arg);
2600
- if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
2601
- var info = record.arg;
2602
- 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);
2603
- }
2604
- function pushTryEntry(locs) {
2605
- var entry = {
2606
- tryLoc: locs[0]
2607
- };
2608
- 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
2609
- }
2610
- function resetTryEntry(entry) {
2611
- var record = entry.completion || {};
2612
- record.type = "normal", delete record.arg, entry.completion = record;
2613
- }
2614
- function Context(tryLocsList) {
2615
- this.tryEntries = [{
2616
- tryLoc: "root"
2617
- }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
2618
- }
2619
- function values(iterable) {
2620
- if (iterable) {
2621
- var iteratorMethod = iterable[iteratorSymbol];
2622
- if (iteratorMethod) return iteratorMethod.call(iterable);
2623
- if ("function" == typeof iterable.next) return iterable;
2624
- if (!isNaN(iterable.length)) {
2625
- var i = -1,
2626
- next = function next() {
2627
- for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
2628
- return next.value = undefined, next.done = !0, next;
2629
- };
2630
- return next.next = next;
2631
- }
2632
- }
2633
- return {
2634
- next: doneResult
2635
- };
2636
- }
2637
- function doneResult() {
2638
- return {
2639
- value: undefined,
2640
- done: !0
2641
- };
2642
- }
2643
- return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
2644
- value: GeneratorFunctionPrototype,
2645
- configurable: !0
2646
- }), defineProperty(GeneratorFunctionPrototype, "constructor", {
2647
- value: GeneratorFunction,
2648
- configurable: !0
2649
- }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
2650
- var ctor = "function" == typeof genFun && genFun.constructor;
2651
- return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
2652
- }, exports.mark = function (genFun) {
2653
- return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
2654
- }, exports.awrap = function (arg) {
2655
- return {
2656
- __await: arg
2657
- };
2658
- }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
2659
- return this;
2660
- }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
2661
- void 0 === PromiseImpl && (PromiseImpl = Promise);
2662
- var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
2663
- return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
2664
- return result.done ? result.value : iter.next();
2665
- });
2666
- }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
2667
- return this;
2668
- }), define(Gp, "toString", function () {
2669
- return "[object Generator]";
2670
- }), exports.keys = function (val) {
2671
- var object = Object(val),
2672
- keys = [];
2673
- for (var key in object) keys.push(key);
2674
- return keys.reverse(), function next() {
2675
- for (; keys.length;) {
2676
- var key = keys.pop();
2677
- if (key in object) return next.value = key, next.done = !1, next;
2678
- }
2679
- return next.done = !0, next;
2680
- };
2681
- }, exports.values = values, Context.prototype = {
2682
- constructor: Context,
2683
- reset: function reset(skipTempReset) {
2684
- 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);
2685
- },
2686
- stop: function stop() {
2687
- this.done = !0;
2688
- var rootRecord = this.tryEntries[0].completion;
2689
- if ("throw" === rootRecord.type) throw rootRecord.arg;
2690
- return this.rval;
2691
- },
2692
- dispatchException: function dispatchException(exception) {
2693
- if (this.done) throw exception;
2694
- var context = this;
2695
- function handle(loc, caught) {
2696
- return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
2697
- }
2698
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2699
- var entry = this.tryEntries[i],
2700
- record = entry.completion;
2701
- if ("root" === entry.tryLoc) return handle("end");
2702
- if (entry.tryLoc <= this.prev) {
2703
- var hasCatch = hasOwn.call(entry, "catchLoc"),
2704
- hasFinally = hasOwn.call(entry, "finallyLoc");
2705
- if (hasCatch && hasFinally) {
2706
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
2707
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
2708
- } else if (hasCatch) {
2709
- if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
2710
- } else {
2711
- if (!hasFinally) throw new Error("try statement without catch or finally");
2712
- if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
2713
- }
2714
- }
2715
- }
2716
- },
2717
- abrupt: function abrupt(type, arg) {
2718
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2719
- var entry = this.tryEntries[i];
2720
- if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
2721
- var finallyEntry = entry;
2722
- break;
2723
- }
2724
- }
2725
- finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
2726
- var record = finallyEntry ? finallyEntry.completion : {};
2727
- return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
2728
- },
2729
- complete: function complete(record, afterLoc) {
2730
- if ("throw" === record.type) throw record.arg;
2731
- 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;
2732
- },
2733
- finish: function finish(finallyLoc) {
2734
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2735
- var entry = this.tryEntries[i];
2736
- if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
2737
- }
2738
- },
2739
- "catch": function _catch(tryLoc) {
2740
- for (var i = this.tryEntries.length - 1; i >= 0; --i) {
2741
- var entry = this.tryEntries[i];
2742
- if (entry.tryLoc === tryLoc) {
2743
- var record = entry.completion;
2744
- if ("throw" === record.type) {
2745
- var thrown = record.arg;
2746
- resetTryEntry(entry);
2747
- }
2748
- return thrown;
2749
- }
2750
- }
2751
- throw new Error("illegal catch attempt");
2752
- },
2753
- delegateYield: function delegateYield(iterable, resultName, nextLoc) {
2754
- return this.delegate = {
2755
- iterator: values(iterable),
2756
- resultName: resultName,
2757
- nextLoc: nextLoc
2758
- }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
2759
- }
2760
- }, exports;
2761
- }
2762
- module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2763
- } (regeneratorRuntime$1));
2764
-
2765
- // TODO(Babel 8): Remove this file.
2766
-
2767
- var runtime = regeneratorRuntime$1.exports();
2768
- var regenerator = runtime;
2769
-
2770
- // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2771
- try {
2772
- regeneratorRuntime = runtime;
2773
- } catch (accidentalStrictMode) {
2774
- if (typeof globalThis === "object") {
2775
- globalThis.regeneratorRuntime = runtime;
2776
- } else {
2777
- Function("r", "regeneratorRuntime = r")(runtime);
2778
- }
2779
- }
2780
-
2781
- var buildEmbedWidgetScript = function buildEmbedWidgetScript() {
2782
- var widgetScriptUrl = window.globalProps.railsEnv === RAILS_ENV.production ? NEETO_WIDGET_SCRIPT_URL.production : NEETO_WIDGET_SCRIPT_URL.staging;
2783
- return "<script src=\"".concat(widgetScriptUrl, "\"></script>");
2784
- };
2785
- var indentAndFormat = function indentAndFormat(str) {
2786
- var formatter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ramda.identity;
2787
- return str.split("\n").map(formatter).join("\n ");
2788
- };
2789
- var getCommentedCommand = function getCommentedCommand(command, isEnabled) {
2790
- return isEnabled ? command : "/// ".concat(command);
2791
- };
2792
- var embedWidgetEnvironment = function embedWidgetEnvironment() {
2793
- switch (window.globalProps.railsEnv) {
2794
- case RAILS_ENV.production:
2795
- return "";
2796
- case RAILS_ENV.development:
2797
- return "environment: \"".concat(RAILS_ENV.development, "\",");
2798
- case RAILS_ENV.staging:
2799
- return "environment: \"".concat(RAILS_ENV.staging, "\",");
2800
- default:
2801
- return "/* Unidentified RAILS_ENV, */";
2802
- }
2803
- };
2804
- var embedWidgetApiKey = function embedWidgetApiKey(apiKey) {
2805
- return "apiKey: \"".concat(apiKey, "\",");
2806
- };
2807
- var addChangelogOptions = function addChangelogOptions() {
2808
- return "neetoChangelogOptions: {\n elementId: \"neetochangelog-trigger\",\n},";
2809
- };
2810
- var wrapBlockInOnLoad = function wrapBlockInOnLoad(codeBlock) {
2811
- return "window.addEventListener(\"load\", () => ".concat(codeBlock, ");");
2812
- };
2813
- var embedWidgetFunctionCall = function embedWidgetFunctionCall(enabledWidgets, apiKey) {
2814
- return "embedNeetoWidget({\n ".concat(embedWidgetEnvironment(), "\n ").concat(indentAndFormat(embedWidgetApiKey(apiKey)), "\n ").concat(indentAndFormat(addChangelogOptions(), function (cmd) {
2815
- return getCommentedCommand(cmd, enabledWidgets.changelog);
2816
- }), "\n})");
2817
- };
2818
- var filterMarkedCommands = function filterMarkedCommands(queryString) {
2819
- return queryString.split("\n").filter(function (line) {
2820
- return !line.includes("///") && line.trim();
2821
- }).join("\n");
2822
- };
2823
- var getSampleUserIdentity = function getSampleUserIdentity(enabledWidgets, selectedFramework) {
2824
- var splitCodeLines = SAMPLE_USER_IDENTITY_CODE_STRING[selectedFramework].split("\n");
2825
- return filterMarkedCommands(splitCodeLines.map(function (cmd) {
2826
- var isEmailKey = cmd.includes("email");
2827
- var isObjectStartLine = cmd === splitCodeLines[0];
2828
- var isObjectEndLine = cmd === ramda.last(splitCodeLines);
2829
- var isLineHidden = !isEmailKey && !isObjectStartLine && !isObjectEndLine;
2830
- if (!enabledWidgets.chat && isLineHidden || !enabledWidgets.chat && !enabledWidgets.replay) {
2831
- return null;
2832
- }
2833
- return cmd;
2834
- }).join("\n"));
2835
- };
2836
- var sampleConsolidatedCodeString = function sampleConsolidatedCodeString(enabledWidgets, apiKey) {
2837
- return filterMarkedCommands("".concat(buildEmbedWidgetScript(), "\n<script>\n ").concat(enabledWidgets.chat || enabledWidgets.replay ? "window.".concat(NEETO_WIDGET_USER_IDENTITY_KEY, " = {};") : "", "\n ").concat(enabledWidgets.replay ? "window.".concat(SESSION_CONTEXT_KEY, " = {};") : "", "\n\n ").concat(indentAndFormat(wrapBlockInOnLoad(embedWidgetFunctionCall(enabledWidgets, apiKey))), "\n</script>"));
2838
- };
2839
- var getEmailWidgetSnippetFormInitialValues = function getEmailWidgetSnippetFormInitialValues(subject) {
2840
- return {
2841
- emails: "",
2842
- subject: subject
2843
- };
2844
- };
2845
- var getSortedPrefixedWidgets = function getSortedPrefixedWidgets(widgets) {
2846
- return widgets.sort().map(function (widget) {
2847
- return "neeto".concat(pure.capitalize(widget));
2848
- });
2849
- };
2850
- var getEmailWidgetSnippetValidationSchema = function getEmailWidgetSnippetValidationSchema() {
2851
- return yup__namespace.object({
2852
- emails: yup__namespace.array().required().label(i18next__default["default"].t("neetoMolecules.widget.email.fields.emails.label")),
2853
- subject: yup__namespace.string().required().label(i18next__default["default"].t("neetoMolecules.widget.email.fields.subject.label"))
2854
- });
2855
- };
2856
- var getWidgetApiKeyUrl = function getWidgetApiKeyUrl() {
2857
- return "api/widget/v1/api_keys/".concat(window.globalProps.organization.subdomain);
2858
- };
2859
-
2860
- var _require = require("axios"),
2861
- axios = _require["default"];
2862
- var queryWidgetApiKey = function queryWidgetApiKey() {
2863
- return axios.get(getWidgetApiKeyUrl(), {
2864
- showToastr: false
2865
- });
2866
- };
2867
- var emailWidgetSnippet = function emailWidgetSnippet(data) {
2868
- return axios.post(EMBED_CODE_EMAIL_URL, data);
2869
- };
2870
- var fetchWidgetConfiguration = function fetchWidgetConfiguration() {
2871
- return axios.get(WIDGET_CONFIG_URL);
2872
- };
2873
- var updateWidgetConfiguration = function updateWidgetConfiguration(_ref) {
2874
- var id = _ref.id,
2875
- payload = _ref.payload;
2876
- return axios.put("".concat(WIDGET_CONFIG_URL, "/").concat(id), payload);
2877
- };
2878
-
2879
- var useEmailEmbedCode = function useEmailEmbedCode(onSuccess) {
2880
- return reactQuery.useMutation(function (emailData) {
2881
- return emailWidgetSnippet(emailData);
2882
- }, {
2883
- onSuccess: onSuccess
2884
- });
2885
- };
2886
-
2887
- var CodeSnippet = function CodeSnippet(_ref) {
2888
- var isPaneOpen = _ref.isPaneOpen,
2889
- onClose = _ref.onClose,
2890
- _ref$onSent = _ref.onSent,
2891
- onSent = _ref$onSent === void 0 ? pure.noop : _ref$onSent,
2892
- codeString = _ref.codeString,
2893
- _ref$subject = _ref.subject,
2894
- subject = _ref$subject === void 0 ? "" : _ref$subject,
2895
- _ref$body = _ref.body,
2896
- body = _ref$body === void 0 ? "" : _ref$body,
2897
- _ref$emailType = _ref.emailType,
2898
- emailType = _ref$emailType === void 0 ? EMAIL_TYPES.embedCode : _ref$emailType,
2899
- _ref$enabledWidgets = _ref.enabledWidgets,
2900
- enabledWidgets = _ref$enabledWidgets === void 0 ? {} : _ref$enabledWidgets;
2901
- var _useTranslation = reactI18next.useTranslation(),
2902
- t = _useTranslation.t;
2903
- var _useState = React.useState(FRAMEWORK_SELECT_OPTIONS[0]),
2904
- _useState2 = _slicedToArray(_useState, 2),
2905
- selectedFramework = _useState2[0],
2906
- setSelectedFramework = _useState2[1];
2907
- var emailMutation = useEmailEmbedCode(onSent);
2908
- var codeToDisplay = emailType === EMAIL_TYPES.userIdentity ? getSampleUserIdentity(enabledWidgets, selectedFramework.value) : codeString;
2909
- var handleSubmit = /*#__PURE__*/function () {
2910
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(formData) {
2911
- var _body$ref$current$inn, _body$ref;
2912
- return regenerator.wrap(function _callee$(_context) {
2913
- while (1) switch (_context.prev = _context.next) {
2914
- case 0:
2915
- if (!ramda.any(function (_ref3) {
2916
- var valid = _ref3.valid;
2917
- return !valid;
2918
- }, formData.emails)) {
2919
- _context.next = 3;
2920
- break;
2921
- }
2922
- neetoui.Toastr.error(t("neetoMolecules.widget.email.fields.emails.invalidError"));
2923
- return _context.abrupt("return");
2924
- case 3:
2925
- emailMutation.mutate({
2926
- subject: formData.subject,
2927
- emails: ramda.pluck("value", formData.emails),
2928
- message: (_body$ref$current$inn = (_body$ref = body.ref) === null || _body$ref === void 0 ? void 0 : _body$ref.current.innerHTML) !== null && _body$ref$current$inn !== void 0 ? _body$ref$current$inn : body,
2929
- snippet: codeToDisplay
2930
- });
2931
- case 4:
2932
- case "end":
2933
- return _context.stop();
2934
- }
2935
- }, _callee);
2936
- }));
2937
- return function handleSubmit(_x) {
2938
- return _ref2.apply(this, arguments);
2939
- };
2940
- }();
2941
- var renderCodeBlockProps = function renderCodeBlockProps() {
2942
- var props = {
2943
- codeString: codeToDisplay,
2944
- showCopyButton: false,
2945
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg"
2946
- };
2947
- if (emailType === EMAIL_TYPES.userIdentity) {
2948
- props = ramda.assoc("frameworkProps", {
2949
- selectedFramework: selectedFramework,
2950
- setSelectedFramework: setSelectedFramework
2951
- }, props);
2952
- }
2953
- return props;
2954
- };
2955
- return /*#__PURE__*/React__default["default"].createElement(neetoui.Pane, {
2956
- isOpen: isPaneOpen,
2957
- onClose: onClose
2958
- }, /*#__PURE__*/React__default["default"].createElement(formik.Formik, {
2959
- initialValues: getEmailWidgetSnippetFormInitialValues(subject),
2960
- validationSchema: getEmailWidgetSnippetValidationSchema(),
2961
- onSubmit: handleSubmit
2962
- }, /*#__PURE__*/React__default["default"].createElement(formik.Form, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Header, null, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2963
- style: "h2"
2964
- }, t("neetoMolecules.widget.email.title"))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Body, null, /*#__PURE__*/React__default["default"].createElement("div", {
2965
- className: "w-full space-y-4"
2966
- }, /*#__PURE__*/React__default["default"].createElement(formik$1.MultiEmailInput, {
2967
- required: true,
2968
- label: t("neetoMolecules.widget.email.fields.emails.label"),
2969
- name: "emails",
2970
- placeholder: t("neetoMolecules.widget.email.fields.emails.placeholder")
2971
- }), /*#__PURE__*/React__default["default"].createElement(formik$1.Input, {
2972
- required: true,
2973
- label: t("neetoMolecules.widget.email.fields.subject.label"),
2974
- name: "subject",
2975
- type: "text"
2976
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
2977
- style: "body2"
2978
- }, body), /*#__PURE__*/React__default["default"].createElement(CodeBlock, renderCodeBlockProps()))), /*#__PURE__*/React__default["default"].createElement(neetoui.Pane.Footer, {
2979
- className: "gap-x-2"
2980
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2981
- disabled: emailMutation.isLoading,
2982
- label: t("neetoMolecules.widget.email.actions.send"),
2983
- loading: emailMutation.isLoading,
2984
- type: "submit"
2985
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
2986
- label: t("neetoMolecules.widget.email.actions.cancel"),
2987
- style: "text",
2988
- onClick: onClose
2989
- })))));
2990
- };
2991
-
2992
- var useForceUpdate = function useForceUpdate() {
2993
- // eslint-disable-next-line react/hook-use-state
2994
- var _useState = React.useState(0),
2995
- _useState2 = _slicedToArray(_useState, 2),
2996
- setValue = _useState2[1];
2997
- return function () {
2998
- return setValue(function (value) {
2999
- return value + 1;
3000
- });
3001
- };
3002
- };
3003
-
3004
- 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; }
3005
- 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; }
3006
- var useFetchApiKey = function useFetchApiKey() {
3007
- return reactQuery.useQuery(QUERY_KEYS.apiKey, function () {
3008
- if (window.globalProps.railsEnv === "heroku" || !process.env.ENABLE_SSO) {
3009
- return Promise.resolve({
3010
- widgetApiKey: "placeholder-api-key"
3011
- });
3012
- }
3013
- return queryWidgetApiKey();
3014
- }, {
3015
- staleTime: DEFAULT_QUERY_STALE_TIME
3016
- });
3017
- };
3018
- var useFetchConfigurations = function useFetchConfigurations() {
3019
- return reactQuery.useQuery(QUERY_KEYS.configuration, fetchWidgetConfiguration, {
3020
- staleTime: DEFAULT_QUERY_STALE_TIME
3021
- });
3022
- };
3023
- var useUpdateConfigurations = function useUpdateConfigurations() {
3024
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3025
- var queryClient = reactQuery.useQueryClient();
3026
- return reactQuery.useMutation(updateWidgetConfiguration, _objectSpread(_objectSpread({}, options), {}, {
3027
- onSuccess: function onSuccess() {
3028
- return queryClient.invalidateQueries(QUERY_KEYS.configuration);
3029
- }
3030
- }));
3031
- };
3032
-
3033
- var TooltipSwitch = reactUtils.withT(function (_ref) {
3034
- var t = _ref.t,
3035
- enabledClientApps = _ref.enabledClientApps,
3036
- widget = _ref.widget,
3037
- selectedWidgets = _ref.selectedWidgets,
3038
- updateSelectedWidgets = _ref.updateSelectedWidgets;
3039
- return /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, {
3040
- disabled: enabledClientApps.includes(widget),
3041
- placement: "right",
3042
- content: t("neetoMolecules.widget.tooltips.productIsDisabled", {
3043
- productName: "neeto".concat(pure.capitalize(widget))
3044
- })
3045
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Switch, {
3046
- checked: selectedWidgets.includes(widget),
3047
- disabled: !enabledClientApps.includes(widget),
3048
- onChange: function onChange() {
3049
- return updateSelectedWidgets(widget);
3050
- }
3051
- }));
3052
- });
3053
-
3054
- var SelectionSwitches = function SelectionSwitches(_ref) {
3055
- var selectedWidgets = _ref.selectedWidgets,
3056
- updateSelectedWidgets = _ref.updateSelectedWidgets,
3057
- primaryApp = _ref.primaryApp,
3058
- enabledClientApps = _ref.enabledClientApps;
3059
- var primaryWidget = WIDGET_TYPES_VALUES.includes(primaryApp) ? primaryApp : "";
3060
- return /*#__PURE__*/React__default["default"].createElement("div", {
3061
- className: "mb-4 flex w-full items-center justify-between gap-2"
3062
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3063
- className: "flex items-center space-x-2"
3064
- }, pure.isNotEmpty(primaryWidget) && /*#__PURE__*/React__default["default"].createElement(TooltipSwitch, {
3065
- enabledClientApps: enabledClientApps,
3066
- selectedWidgets: selectedWidgets,
3067
- updateSelectedWidgets: updateSelectedWidgets,
3068
- widget: primaryWidget
3069
- }), /*#__PURE__*/React__default["default"].createElement("div", {
3070
- className: "flex items-center space-x-1"
3071
- }, /*#__PURE__*/React__default["default"].createElement(neetoui.Label, null, "neeto", pure.capitalize(primaryWidget)), /*#__PURE__*/React__default["default"].createElement("a", {
3072
- href: WIDGET_KB_HELP_URL[primaryApp],
3073
- rel: "noreferrer",
3074
- target: "_blank"
3075
- }, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, {
3076
- size: 16
3077
- })))), /*#__PURE__*/React__default["default"].createElement("div", {
3078
- className: "flex items-center justify-end gap-6"
3079
- }, WIDGET_TYPES_VALUES.map(function (widget, index) {
3080
- return primaryApp !== widget && /*#__PURE__*/React__default["default"].createElement("div", {
3081
- className: "flex items-center space-x-2",
3082
- key: index
3083
- }, /*#__PURE__*/React__default["default"].createElement(TooltipSwitch, {
3084
- enabledClientApps: enabledClientApps,
3085
- selectedWidgets: selectedWidgets,
3086
- updateSelectedWidgets: updateSelectedWidgets,
3087
- widget: widget
3088
- }), /*#__PURE__*/React__default["default"].createElement(neetoui.Label, null, "neeto", pure.capitalize(widget)));
3089
- })));
3090
- };
3091
-
3092
- var EmbedCode = function EmbedCode(_ref) {
3093
- var showSessionContext = _ref.showSessionContext,
3094
- showUserIdentity = _ref.showUserIdentity,
3095
- _ref$primaryApp = _ref.primaryApp,
3096
- primaryApp = _ref$primaryApp === void 0 ? "" : _ref$primaryApp,
3097
- _ref$maxWidth = _ref.maxWidth,
3098
- maxWidth = _ref$maxWidth === void 0 ? "max-w-3xl" : _ref$maxWidth;
3099
- var _useState = React.useState(EMAIL_TYPES["null"]),
3100
- _useState2 = _slicedToArray(_useState, 2),
3101
- emailType = _useState2[0],
3102
- setEmailType = _useState2[1];
3103
- var _useState3 = React.useState(FRAMEWORK_SELECT_OPTIONS[0]),
3104
- _useState4 = _slicedToArray(_useState3, 2),
3105
- selectedFramework = _useState4[0],
3106
- setSelectedFramework = _useState4[1];
3107
- var _useTranslation = reactI18next.useTranslation(),
3108
- t = _useTranslation.t;
3109
- var bodyRef = React.useRef();
3110
- var forceUpdate = useForceUpdate();
3111
- React.useEffect(function () {
3112
- forceUpdate();
3113
- }, []);
3114
- var _useFetchApiKey = useFetchApiKey(),
3115
- _useFetchApiKey$data = _useFetchApiKey.data,
3116
- _useFetchApiKey$data2 = _useFetchApiKey$data === void 0 ? {} : _useFetchApiKey$data,
3117
- _useFetchApiKey$data3 = _useFetchApiKey$data2.widgetApiKey,
3118
- widgetApiKey = _useFetchApiKey$data3 === void 0 ? "" : _useFetchApiKey$data3,
3119
- isLoadingApiKey = _useFetchApiKey.isLoading;
3120
- var _useFetchConfiguratio = useFetchConfigurations(),
3121
- _useFetchConfiguratio2 = _useFetchConfiguratio.data,
3122
- _useFetchConfiguratio3 = _useFetchConfiguratio2 === void 0 ? {} : _useFetchConfiguratio2,
3123
- _useFetchConfiguratio4 = _useFetchConfiguratio3.neetoWidgetTokens,
3124
- neetoWidgetTokens = _useFetchConfiguratio4 === void 0 ? [] : _useFetchConfiguratio4,
3125
- isLoadingConfigurations = _useFetchConfiguratio.isLoading;
3126
- var _useUpdateConfigurati = useUpdateConfigurations(),
3127
- updateWidgetConfiguration = _useUpdateConfigurati.mutate;
3128
- var previousEmailType = reactUtils.usePrevious(emailType);
3129
- var selectedWidgets = neetoWidgetTokens.filter(ramda.prop("enabled")).map(function (item) {
3130
- return item.clientApplicationName.toLowerCase();
3131
- });
3132
- var enabledClientApps = neetoWidgetTokens.filter(ramda.prop("clientApplicationEnabled")).map(function (item) {
3133
- return item.clientApplicationName.toLowerCase();
3134
- });
3135
- var enabledWidgets = ramda.fromPairs(selectedWidgets.map(function (widget) {
3136
- return [widget, true];
3137
- }));
3138
- var shouldShowUserIdentity = showUserIdentity !== null && showUserIdentity !== void 0 ? showUserIdentity : enabledWidgets.chat || enabledWidgets.replay;
3139
- var shouldShowSessionContext = showSessionContext !== null && showSessionContext !== void 0 ? showSessionContext : enabledWidgets.replay;
3140
- var updateSelectedWidgets = function updateSelectedWidgets(widget) {
3141
- var widgetId = neetoWidgetTokens.find(function (item) {
3142
- return item.clientApplicationName.toLowerCase() === widget;
3143
- }).id;
3144
- var isEnabled = !selectedWidgets.includes(widget);
3145
- updateWidgetConfiguration({
3146
- id: widgetId,
3147
- payload: {
3148
- enabled: isEnabled
3149
- }
3150
- }, {
3151
- onSuccess: function onSuccess() {
3152
- var productName = "neeto".concat(pure.capitalize(widget));
3153
- var response = isEnabled ? "neetoMolecules.widget.installation.enabled" : "neetoMolecules.widget.installation.disabled";
3154
- neetoui.Toastr.success(t(response, {
3155
- productName: productName
3156
- }));
3157
- }
3158
- });
3159
- };
3160
- var getEmbedCodeString = function getEmbedCodeString() {
3161
- return pure.isNotEmpty(widgetApiKey) ? sampleConsolidatedCodeString(enabledWidgets, widgetApiKey) : "";
3162
- };
3163
- var getSnippetProps = function getSnippetProps(selectedEmailType) {
3164
- switch (selectedEmailType) {
3165
- case EMAIL_TYPES.embedCode:
3166
- return {
3167
- codeString: getEmbedCodeString(),
3168
- subject: t("neetoMolecules.widget.email.fields.subject.values.embedCode"),
3169
- body: /*#__PURE__*/React__default["default"].createElement("div", {
3170
- ref: bodyRef
3171
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
3172
- i18nKey: "neetoMolecules.widget.email.body.values.embedCode",
3173
- components: {
3174
- p: /*#__PURE__*/React__default["default"].createElement("p", {
3175
- style: {
3176
- marginBottom: "8px"
3177
- }
3178
- }),
3179
- mail: /*#__PURE__*/React__default["default"].createElement("a", {
3180
- className: "neeto-ui-text-primary-800",
3181
- href: "mailto:".concat(INSTALLATION_HELP_EMAIL),
3182
- rel: "noreferrer",
3183
- target: "_blank"
3184
- })
3185
- },
3186
- values: {
3187
- val: getSortedPrefixedWidgets(selectedWidgets),
3188
- helpEmail: INSTALLATION_HELP_EMAIL
3189
- }
3190
- }))
3191
- };
3192
- case EMAIL_TYPES.userIdentity:
3193
- return {
3194
- emailType: EMAIL_TYPES.userIdentity,
3195
- enabledWidgets: enabledWidgets,
3196
- subject: t("neetoMolecules.widget.email.fields.subject.values.userIdentity"),
3197
- body: /*#__PURE__*/React__default["default"].createElement("div", {
3198
- ref: bodyRef
3199
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
3200
- i18nKey: "neetoMolecules.widget.email.body.values.userIdentity",
3201
- components: {
3202
- p: /*#__PURE__*/React__default["default"].createElement("p", {
3203
- style: {
3204
- marginBottom: "8px"
3205
- }
3206
- }),
3207
- configureLink: /*#__PURE__*/React__default["default"].createElement("a", {
3208
- className: "neeto-ui-text-primary-800",
3209
- rel: "noreferrer",
3210
- target: "_blank",
3211
- href: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3212
- })
3213
- },
3214
- values: {
3215
- userIdentityKbUrl: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3216
- }
3217
- }))
3218
- };
3219
- case EMAIL_TYPES.sessionContext:
3220
- return {
3221
- codeString: SAMPLE_CONTEXT_CODE_STRING,
3222
- subject: t("neetoMolecules.widget.email.fields.subject.values.sessionContext"),
3223
- body: /*#__PURE__*/React__default["default"].createElement("div", {
3224
- ref: bodyRef
3225
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
3226
- i18nKey: "neetoMolecules.widget.email.body.values.sessionContext",
3227
- values: {
3228
- sessionContextKbUrl: NEETO_REPLAY_CONFIGURE_URL
3229
- },
3230
- components: {
3231
- p: /*#__PURE__*/React__default["default"].createElement("p", {
3232
- style: {
3233
- marginBottom: "8px"
3234
- }
3235
- }),
3236
- configureLink: /*#__PURE__*/React__default["default"].createElement("a", {
3237
- className: "neeto-ui-text-primary-800",
3238
- href: NEETO_REPLAY_CONFIGURE_URL,
3239
- rel: "noreferrer",
3240
- target: "_blank"
3241
- })
3242
- }
3243
- }))
3244
- };
3245
- case EMAIL_TYPES["null"]:
3246
- return previousEmailType !== EMAIL_TYPES["null"] ? getSnippetProps(previousEmailType) : {};
3247
- default:
3248
- throw new Error(t("neetoMolecules.widget.email.invalidType"));
3249
- }
3250
- };
3251
- var handleSendViaEmail = function handleSendViaEmail(selectedEmail) {
3252
- if (ramda.isEmpty(selectedWidgets)) {
3253
- neetoui.Toastr.error(t("neetoMolecules.widget.installation.snippet.disabledError"));
3254
- return;
3255
- }
3256
- setEmailType(selectedEmail);
3257
- };
3258
- if (isLoadingApiKey || isLoadingConfigurations) {
3259
- return /*#__PURE__*/React__default["default"].createElement("div", {
3260
- className: "h-full w-full"
3261
- }, /*#__PURE__*/React__default["default"].createElement(PageLoader$1, null));
3262
- }
3263
- return /*#__PURE__*/React__default["default"].createElement("div", {
3264
- className: "mx-auto mb-10 w-full flex-col items-center justify-start"
3265
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3266
- className: classnames("mx-auto", maxWidth)
3267
- }, /*#__PURE__*/React__default["default"].createElement(SelectionSwitches, {
3268
- enabledClientApps: enabledClientApps,
3269
- primaryApp: primaryApp,
3270
- selectedWidgets: selectedWidgets,
3271
- updateSelectedWidgets: updateSelectedWidgets
3272
- }), /*#__PURE__*/React__default["default"].createElement("div", {
3273
- className: "mb-8 w-full flex-grow flex-col items-center justify-start"
3274
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3275
- className: "mx-auto mb-2 w-full",
3276
- "data-testid": "embed-code-block"
3277
- }, /*#__PURE__*/React__default["default"].createElement(CodeBlock, {
3278
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3279
- codeString: getEmbedCodeString(),
3280
- sendViaEmail: function sendViaEmail() {
3281
- return handleSendViaEmail(EMAIL_TYPES.embedCode);
3282
- },
3283
- title: /*#__PURE__*/React__default["default"].createElement("div", null, t("neetoMolecules.widget.title.embedCode"))
3284
- })), /*#__PURE__*/React__default["default"].createElement("div", {
3285
- className: "w-full"
3286
- }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
3287
- values: {
3288
- val: getSortedPrefixedWidgets(selectedWidgets)
3289
- },
3290
- components: {
3291
- fontBold: /*#__PURE__*/React__default["default"].createElement("span", {
3292
- className: "font-semibold"
3293
- }),
3294
- fontNormal: /*#__PURE__*/React__default["default"].createElement("span", {
3295
- className: "font-normal"
3296
- })
3297
- },
3298
- i18nKey: pure.isNotEmpty(selectedWidgets) ? "neetoMolecules.widget.installation.instructions.placement.selectedWidgets" : "neetoMolecules.widget.installation.instructions.placement.noneOfThese"
3299
- }))), shouldShowUserIdentity ? /*#__PURE__*/React__default["default"].createElement("div", {
3300
- className: "mb-8 w-full flex-grow flex-col items-center justify-start"
3301
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3302
- className: "mx-auto mb-2 w-full"
3303
- }, /*#__PURE__*/React__default["default"].createElement(CodeBlock, {
3304
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3305
- frameworkProps: {
3306
- selectedFramework: selectedFramework,
3307
- setSelectedFramework: setSelectedFramework
3308
- },
3309
- codeString: getSampleUserIdentity(enabledWidgets, selectedFramework.value),
3310
- sendViaEmail: function sendViaEmail() {
3311
- return handleSendViaEmail(EMAIL_TYPES.userIdentity);
3312
- },
3313
- title: /*#__PURE__*/React__default["default"].createElement("div", {
3314
- className: "flex items-center justify-start"
3315
- }, /*#__PURE__*/React__default["default"].createElement("div", null, t("neetoMolecules.widget.title.userIdentity")), /*#__PURE__*/React__default["default"].createElement("a", {
3316
- className: "ml-1",
3317
- rel: "noreferrer",
3318
- target: "_blank",
3319
- href: enabledWidgets.chat ? NEETO_CHAT_USER_IDENTITY_URL : NEETO_REPLAY_CONFIGURE_URL
3320
- }, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, {
3321
- size: 16
3322
- })))
3323
- })), /*#__PURE__*/React__default["default"].createElement("div", {
3324
- className: "w-full"
3325
- }, t("neetoMolecules.widget.installation.instructions.userIdentity"))) : null, shouldShowSessionContext ? /*#__PURE__*/React__default["default"].createElement("div", {
3326
- className: "w-full flex-grow flex-col items-center justify-start"
3327
- }, /*#__PURE__*/React__default["default"].createElement("div", {
3328
- className: "mx-auto mb-2 w-full"
3329
- }, /*#__PURE__*/React__default["default"].createElement(CodeBlock, {
3330
- className: "neeto-ui-bg-primary-100 neeto-ui-rounded-lg",
3331
- codeString: SAMPLE_CONTEXT_CODE_STRING,
3332
- sendViaEmail: function sendViaEmail() {
3333
- return handleSendViaEmail(EMAIL_TYPES.sessionContext);
3334
- },
3335
- title: /*#__PURE__*/React__default["default"].createElement("div", {
3336
- className: "flex items-center justify-start"
3337
- }, /*#__PURE__*/React__default["default"].createElement("div", null, t("neetoMolecules.widget.title.sessionContext")), /*#__PURE__*/React__default["default"].createElement("a", {
3338
- className: "ml-1",
3339
- href: NEETO_REPLAY_CONFIGURE_URL,
3340
- rel: "noreferrer",
3341
- target: "_blank"
3342
- }, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, {
3343
- size: 16
3344
- })))
3345
- })), /*#__PURE__*/React__default["default"].createElement("div", {
3346
- className: "w-full"
3347
- }, t("neetoMolecules.widget.installation.instructions.sessionContext"))) : null), /*#__PURE__*/React__default["default"].createElement(CodeSnippet, _extends$1({
3348
- isPaneOpen: !!emailType && pure.isNotEmpty(selectedWidgets),
3349
- onClose: function onClose() {
3350
- return setEmailType(EMAIL_TYPES["null"]);
3351
- }
3352
- }, getSnippetProps(emailType))));
3353
- };
3354
- var EmbedCode$1 = /*#__PURE__*/React__default["default"].memo(EmbedCode);
3355
-
3356
- var queryClient = new reactQuery.QueryClient();
3357
- var Main = function Main(props) {
3358
- var _useTranslation = reactI18next.useTranslation(),
3359
- t = _useTranslation.t;
3360
- var shouldRenderEmbedCode = window.globalProps.ssoEnabled;
3361
- return shouldRenderEmbedCode ? /*#__PURE__*/React__default["default"].createElement(reactQuery.QueryClientProvider, {
3362
- client: queryClient
3363
- }, /*#__PURE__*/React__default["default"].createElement(EmbedCode$1, props)) : /*#__PURE__*/React__default["default"].createElement(neetoui.Callout, {
3364
- icon: neetoIcons.Info,
3365
- style: "info"
3366
- }, t("neetoMolecules.widget.developmentInfo"));
3367
- };
3368
-
3369
- var NeetoWidget = {
3370
- EmbedCode: Main,
3371
- WIDGET_TYPES: WIDGET_TYPES
3372
- };
3373
-
3374
- module.exports = NeetoWidget;
3375
- //# sourceMappingURL=NeetoWidget.cjs.js.map