@adminide-stack/yantra-mobile 12.0.196-alpha.0 → 12.0.196

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 (382) hide show
  1. package/lib/components/CustomDrawer.js +17 -1
  2. package/lib/components/CustomDrawer.js.map +1 -1
  3. package/lib/compute.js +57 -1
  4. package/lib/compute.js.map +1 -1
  5. package/lib/config/env-config.js +11 -1
  6. package/lib/config/env-config.js.map +1 -1
  7. package/lib/features/agent-chat/NativeAgentChat.js +7 -0
  8. package/lib/features/agent-chat/NativeAgentChat.js.map +1 -1
  9. package/lib/features/canvas/extendVideo.js +5 -1
  10. package/lib/features/canvas/extendVideo.js.map +1 -1
  11. package/lib/features/canvas/workflow/StepSheet.js +18 -1
  12. package/lib/features/canvas/workflow/StepSheet.js.map +1 -1
  13. package/lib/features/canvas/workflow/workflowSteps.js +102 -31
  14. package/lib/features/canvas/workflow/workflowSteps.js.map +1 -1
  15. package/lib/features/chat/ComposerMicSend.js +35 -0
  16. package/lib/features/chat/ComposerMicSend.js.map +1 -0
  17. package/lib/features/chat/ComposerModeSwitch.js +64 -1
  18. package/lib/features/chat/ComposerModeSwitch.js.map +1 -1
  19. package/lib/features/chat/askUser.js +6 -1
  20. package/lib/features/chat/askUser.js.map +1 -1
  21. package/lib/features/connectors/ConnectorSheet.js +443 -0
  22. package/lib/features/connectors/ConnectorSheet.js.map +1 -0
  23. package/lib/features/connectors/ConnectorsPage.js +320 -0
  24. package/lib/features/connectors/ConnectorsPage.js.map +1 -0
  25. package/lib/features/connectors/connectConnector.js +278 -0
  26. package/lib/features/connectors/connectConnector.js.map +1 -0
  27. package/lib/features/connectors/connectorCatalog.js +222 -0
  28. package/lib/features/connectors/connectorCatalog.js.map +1 -0
  29. package/lib/features/connectors/useConnectorCatalog.js +153 -0
  30. package/lib/features/connectors/useConnectorCatalog.js.map +1 -0
  31. package/lib/features/home/needsYou/HomeNeedsYou.js +618 -0
  32. package/lib/features/home/needsYou/HomeNeedsYou.js.map +1 -0
  33. package/lib/features/home/needsYou/chatFollowUps.js +333 -0
  34. package/lib/features/home/needsYou/chatFollowUps.js.map +1 -0
  35. package/lib/features/home/needsYou/format.js +47 -0
  36. package/lib/features/home/needsYou/format.js.map +1 -0
  37. package/lib/features/home/needsYou/historyText.js +40 -0
  38. package/lib/features/home/needsYou/historyText.js.map +1 -0
  39. package/lib/features/home/needsYou/inboxHighlights.js +152 -0
  40. package/lib/features/home/needsYou/inboxHighlights.js.map +1 -0
  41. package/lib/features/home/needsYou/panelsSettings.js +71 -0
  42. package/lib/features/home/needsYou/panelsSettings.js.map +1 -0
  43. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js +13 -0
  44. package/lib/features/home/needsYou/ported/commandConfirmProtocol.js.map +1 -0
  45. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js +91 -0
  46. package/lib/features/home/needsYou/ported/paymentApprovalProtocol.js.map +1 -0
  47. package/lib/features/home/needsYou/ported/resultCardModels.js +659 -0
  48. package/lib/features/home/needsYou/ported/resultCardModels.js.map +1 -0
  49. package/lib/features/home/needsYou/types.js +1 -0
  50. package/lib/features/home/needsYou/types.js.map +1 -0
  51. package/lib/features/home/needsYou/useChatFollowUps.js +149 -0
  52. package/lib/features/home/needsYou/useChatFollowUps.js.map +1 -0
  53. package/lib/features/home/needsYou/useHomeBriefing.js +68 -0
  54. package/lib/features/home/needsYou/useHomeBriefing.js.map +1 -0
  55. package/lib/features/home/needsYou/useInboxHighlights.js +173 -0
  56. package/lib/features/home/needsYou/useInboxHighlights.js.map +1 -0
  57. package/lib/features/home/needsYou/usePanelsSettings.js +105 -0
  58. package/lib/features/home/needsYou/usePanelsSettings.js.map +1 -0
  59. package/lib/features/shopping/DealCard.js +8 -1
  60. package/lib/features/shopping/DealCard.js.map +1 -1
  61. package/lib/features/shopping/DealRails.js +24 -7
  62. package/lib/features/shopping/DealRails.js.map +1 -1
  63. package/lib/features/shopping/DealsPanel.js +1 -1
  64. package/lib/features/shopping/DealsPanel.js.map +1 -1
  65. package/lib/features/shopping/HolidayDealsPanel.js +529 -0
  66. package/lib/features/shopping/HolidayDealsPanel.js.map +1 -0
  67. package/lib/features/shopping/HolidayDealsParts.js +954 -0
  68. package/lib/features/shopping/HolidayDealsParts.js.map +1 -0
  69. package/lib/features/shopping/HolidayOffers.js +351 -0
  70. package/lib/features/shopping/HolidayOffers.js.map +1 -0
  71. package/lib/features/shopping/ProductCard.js +80 -14
  72. package/lib/features/shopping/ProductCard.js.map +1 -1
  73. package/lib/features/shopping/ProductDetailSheet.js +22 -3
  74. package/lib/features/shopping/ProductDetailSheet.js.map +1 -1
  75. package/lib/features/shopping/SavedPanel.js +341 -5
  76. package/lib/features/shopping/SavedPanel.js.map +1 -1
  77. package/lib/features/shopping/SearchResults.js +8 -2
  78. package/lib/features/shopping/SearchResults.js.map +1 -1
  79. package/lib/features/shopping/ShoppingAgentChatPane.js +12 -0
  80. package/lib/features/shopping/ShoppingAgentChatPane.js.map +1 -1
  81. package/lib/features/shopping/ShoppingExperience.js +56 -19
  82. package/lib/features/shopping/ShoppingExperience.js.map +1 -1
  83. package/lib/features/shopping/TrendingSections.js +13 -4
  84. package/lib/features/shopping/TrendingSections.js.map +1 -1
  85. package/lib/features/shopping/WatchlistPanel.js +61 -5
  86. package/lib/features/shopping/WatchlistPanel.js.map +1 -1
  87. package/lib/features/shopping/catalog.js +41 -2
  88. package/lib/features/shopping/catalog.js.map +1 -1
  89. package/lib/features/shopping/chat/brainRouter.js +14 -0
  90. package/lib/features/shopping/chat/brainRouter.js.map +1 -1
  91. package/lib/features/shopping/chat/shoppingTurn.js +88 -16
  92. package/lib/features/shopping/chat/shoppingTurn.js.map +1 -1
  93. package/lib/features/shopping/hooks/useHolidayDeals.js +388 -0
  94. package/lib/features/shopping/hooks/useHolidayDeals.js.map +1 -0
  95. package/lib/features/shopping/hooks/useProductMedia.js +33 -6
  96. package/lib/features/shopping/hooks/useProductMedia.js.map +1 -1
  97. package/lib/features/shopping/hooks/useShoppingHistorySync.js +8 -4
  98. package/lib/features/shopping/hooks/useShoppingHistorySync.js.map +1 -1
  99. package/lib/features/shopping/hooks/useTrendingProducts.js +11 -3
  100. package/lib/features/shopping/hooks/useTrendingProducts.js.map +1 -1
  101. package/lib/features/shopping/savedProducts.js +76 -6
  102. package/lib/features/shopping/savedProducts.js.map +1 -1
  103. package/lib/features/shopping/services/aiRelevance.js +212 -0
  104. package/lib/features/shopping/services/aiRelevance.js.map +1 -0
  105. package/lib/features/shopping/services/blackFriday.js +301 -0
  106. package/lib/features/shopping/services/blackFriday.js.map +1 -0
  107. package/lib/features/shopping/services/blackFridayBrowserSites.js +137 -0
  108. package/lib/features/shopping/services/blackFridayBrowserSites.js.map +1 -0
  109. package/lib/features/shopping/services/catalogProductSearch.js +21 -3
  110. package/lib/features/shopping/services/catalogProductSearch.js.map +1 -1
  111. package/lib/features/shopping/services/holidayDeals.js +143 -0
  112. package/lib/features/shopping/services/holidayDeals.js.map +1 -0
  113. package/lib/features/shopping/services/mediaShape.js +7 -0
  114. package/lib/features/shopping/services/mediaShape.js.map +1 -0
  115. package/lib/features/shopping/services/modelStep.js +95 -0
  116. package/lib/features/shopping/services/modelStep.js.map +1 -0
  117. package/lib/features/shopping/services/modelWords.js +14 -0
  118. package/lib/features/shopping/services/modelWords.js.map +1 -0
  119. package/lib/features/shopping/services/productAvailability.js +5 -1
  120. package/lib/features/shopping/services/productAvailability.js.map +1 -1
  121. package/lib/features/shopping/services/productFilters.js +2 -2
  122. package/lib/features/shopping/services/productFilters.js.map +1 -1
  123. package/lib/features/shopping/services/productMedia.js +103 -18
  124. package/lib/features/shopping/services/productMedia.js.map +1 -1
  125. package/lib/features/shopping/services/retailerUrl.js +11 -8
  126. package/lib/features/shopping/services/retailerUrl.js.map +1 -1
  127. package/lib/features/shopping/services/salesDealsStore.js +3 -2
  128. package/lib/features/shopping/services/salesDealsStore.js.map +1 -1
  129. package/lib/features/shopping/services/savedReads.js +82 -0
  130. package/lib/features/shopping/services/savedReads.js.map +1 -0
  131. package/lib/features/shopping/services/searchCardFields.js +2 -0
  132. package/lib/features/shopping/services/searchCardFields.js.map +1 -1
  133. package/lib/features/shopping/services/searchRelevance.js +154 -24
  134. package/lib/features/shopping/services/searchRelevance.js.map +1 -1
  135. package/lib/features/shopping/services/secondHand.js +12 -0
  136. package/lib/features/shopping/services/secondHand.js.map +1 -0
  137. package/lib/features/shopping/services/shoppingProductSearch.js +82 -10
  138. package/lib/features/shopping/services/shoppingProductSearch.js.map +1 -1
  139. package/lib/features/shopping/services/shoppingSearchConnectorClient.js +14 -1
  140. package/lib/features/shopping/services/shoppingSearchConnectorClient.js.map +1 -1
  141. package/lib/features/shopping/services/shoppingSubgraph.js +2 -1
  142. package/lib/features/shopping/services/shoppingSubgraph.js.map +1 -1
  143. package/lib/features/shopping/services/storedGalleries.js +130 -0
  144. package/lib/features/shopping/services/storedGalleries.js.map +1 -0
  145. package/lib/features/shopping/services/usedSites.js +263 -0
  146. package/lib/features/shopping/services/usedSites.js.map +1 -0
  147. package/lib/features/shopping/services/verifyProducts.js +3 -3
  148. package/lib/features/shopping/services/verifyProducts.js.map +1 -1
  149. package/lib/features/shopping/services/watchDeal.js +61 -0
  150. package/lib/features/shopping/services/watchDeal.js.map +1 -0
  151. package/lib/features/shopping/shoppingRuntime.js +7 -2
  152. package/lib/features/shopping/shoppingRuntime.js.map +1 -1
  153. package/lib/features/shopping/state/accountCaches.js +20 -0
  154. package/lib/features/shopping/state/accountCaches.js.map +1 -0
  155. package/lib/features/shopping/state/holidayDealsRequest.js +22 -0
  156. package/lib/features/shopping/state/holidayDealsRequest.js.map +1 -0
  157. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js +1 -1
  158. package/lib/features/shopping/tutorials/ShoppingTutorialDock.js.map +1 -1
  159. package/lib/features/shopping/tutorials/shoppingTutorials.js +2 -0
  160. package/lib/features/shopping/tutorials/shoppingTutorials.js.map +1 -1
  161. package/lib/features/shopping/useShoppingSearch.js +74 -18
  162. package/lib/features/shopping/useShoppingSearch.js.map +1 -1
  163. package/lib/features/team-chat/TeamChatExperience.js +474 -0
  164. package/lib/features/team-chat/TeamChatExperience.js.map +1 -0
  165. package/lib/features/team-chat/api/client.js +198 -0
  166. package/lib/features/team-chat/api/client.js.map +1 -0
  167. package/lib/features/team-chat/api/live.js +160 -0
  168. package/lib/features/team-chat/api/live.js.map +1 -0
  169. package/lib/features/team-chat/api/ops.js +241 -0
  170. package/lib/features/team-chat/api/ops.js.map +1 -0
  171. package/lib/features/team-chat/app.js +12 -0
  172. package/lib/features/team-chat/app.js.map +1 -0
  173. package/lib/features/team-chat/components/Avatar.js +107 -0
  174. package/lib/features/team-chat/components/Avatar.js.map +1 -0
  175. package/lib/features/team-chat/components/Composer.js +641 -0
  176. package/lib/features/team-chat/components/Composer.js.map +1 -0
  177. package/lib/features/team-chat/components/Dialogs.js +598 -0
  178. package/lib/features/team-chat/components/Dialogs.js.map +1 -0
  179. package/lib/features/team-chat/components/EmojiPicker.js +165 -0
  180. package/lib/features/team-chat/components/EmojiPicker.js.map +1 -0
  181. package/lib/features/team-chat/components/MessageItem.js +658 -0
  182. package/lib/features/team-chat/components/MessageItem.js.map +1 -0
  183. package/lib/features/team-chat/components/MessageList.js +248 -0
  184. package/lib/features/team-chat/components/MessageList.js.map +1 -0
  185. package/lib/features/team-chat/components/Mrkdwn.js +228 -0
  186. package/lib/features/team-chat/components/Mrkdwn.js.map +1 -0
  187. package/lib/features/team-chat/components/QuickSwitcher.js +215 -0
  188. package/lib/features/team-chat/components/QuickSwitcher.js.map +1 -0
  189. package/lib/features/team-chat/components/ui.js +662 -0
  190. package/lib/features/team-chat/components/ui.js.map +1 -0
  191. package/lib/features/team-chat/nativeTeamChatRegistry.js +15 -0
  192. package/lib/features/team-chat/nativeTeamChatRegistry.js.map +1 -0
  193. package/lib/features/team-chat/state/fetched.js +39 -0
  194. package/lib/features/team-chat/state/fetched.js.map +1 -0
  195. package/lib/features/team-chat/state/lists.js +230 -0
  196. package/lib/features/team-chat/state/lists.js.map +1 -0
  197. package/lib/features/team-chat/state/store.js +1108 -0
  198. package/lib/features/team-chat/state/store.js.map +1 -0
  199. package/lib/features/team-chat/state/useChannelDirectory.js +21 -0
  200. package/lib/features/team-chat/state/useChannelDirectory.js.map +1 -0
  201. package/lib/features/team-chat/theme.js +77 -0
  202. package/lib/features/team-chat/theme.js.map +1 -0
  203. package/lib/features/team-chat/utils/composeText.js +72 -0
  204. package/lib/features/team-chat/utils/composeText.js.map +1 -0
  205. package/lib/features/team-chat/utils/emoji.js +369 -0
  206. package/lib/features/team-chat/utils/emoji.js.map +1 -0
  207. package/lib/features/team-chat/utils/format.js +109 -0
  208. package/lib/features/team-chat/utils/format.js.map +1 -0
  209. package/lib/features/team-chat/utils/messageRows.js +24 -0
  210. package/lib/features/team-chat/utils/messageRows.js.map +1 -0
  211. package/lib/features/team-chat/utils/mrkdwn.js +222 -0
  212. package/lib/features/team-chat/utils/mrkdwn.js.map +1 -0
  213. package/lib/features/team-chat/utils/notify.js +47 -0
  214. package/lib/features/team-chat/utils/notify.js.map +1 -0
  215. package/lib/features/team-chat/utils/pickFiles.js +81 -0
  216. package/lib/features/team-chat/utils/pickFiles.js.map +1 -0
  217. package/lib/features/team-chat/views/ActivityView.js +235 -0
  218. package/lib/features/team-chat/views/ActivityView.js.map +1 -0
  219. package/lib/features/team-chat/views/BrowseView.js +179 -0
  220. package/lib/features/team-chat/views/BrowseView.js.map +1 -0
  221. package/lib/features/team-chat/views/ChannelView.js +475 -0
  222. package/lib/features/team-chat/views/ChannelView.js.map +1 -0
  223. package/lib/features/team-chat/views/DetailsPane.js +816 -0
  224. package/lib/features/team-chat/views/DetailsPane.js.map +1 -0
  225. package/lib/features/team-chat/views/DraftsView.js +212 -0
  226. package/lib/features/team-chat/views/DraftsView.js.map +1 -0
  227. package/lib/features/team-chat/views/FilesView.js +152 -0
  228. package/lib/features/team-chat/views/FilesView.js.map +1 -0
  229. package/lib/features/team-chat/views/NewMessageView.js +286 -0
  230. package/lib/features/team-chat/views/NewMessageView.js.map +1 -0
  231. package/lib/features/team-chat/views/PeopleView.js +118 -0
  232. package/lib/features/team-chat/views/PeopleView.js.map +1 -0
  233. package/lib/features/team-chat/views/ProfilePane.js +220 -0
  234. package/lib/features/team-chat/views/ProfilePane.js.map +1 -0
  235. package/lib/features/team-chat/views/SavedView.js +113 -0
  236. package/lib/features/team-chat/views/SavedView.js.map +1 -0
  237. package/lib/features/team-chat/views/SearchView.js +307 -0
  238. package/lib/features/team-chat/views/SearchView.js.map +1 -0
  239. package/lib/features/team-chat/views/Sidebar.js +368 -0
  240. package/lib/features/team-chat/views/Sidebar.js.map +1 -0
  241. package/lib/features/team-chat/views/ThreadPane.js +139 -0
  242. package/lib/features/team-chat/views/ThreadPane.js.map +1 -0
  243. package/lib/features/team-chat/views/ThreadsView.js +157 -0
  244. package/lib/features/team-chat/views/ThreadsView.js.map +1 -0
  245. package/lib/features/webbuilder/WebBuilderExperience.js +276 -42
  246. package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
  247. package/lib/features/webbuilder/buildFragments.js +10 -4
  248. package/lib/features/webbuilder/buildFragments.js.map +1 -1
  249. package/lib/features/webbuilder/components/AssetChips.js +61 -0
  250. package/lib/features/webbuilder/components/AssetChips.js.map +1 -0
  251. package/lib/features/webbuilder/components/AssetSiteChooser.js +100 -0
  252. package/lib/features/webbuilder/components/AssetSiteChooser.js.map +1 -0
  253. package/lib/features/webbuilder/components/CommentsLayer.js +485 -0
  254. package/lib/features/webbuilder/components/CommentsLayer.js.map +1 -0
  255. package/lib/features/webbuilder/components/Composer.js +16 -2
  256. package/lib/features/webbuilder/components/Composer.js.map +1 -1
  257. package/lib/features/webbuilder/components/ComposerModeSwitch.js +71 -0
  258. package/lib/features/webbuilder/components/ComposerModeSwitch.js.map +1 -0
  259. package/lib/features/webbuilder/components/MyAssetsPicker.js +500 -0
  260. package/lib/features/webbuilder/components/MyAssetsPicker.js.map +1 -0
  261. package/lib/features/webbuilder/components/PlanDocument.js +165 -0
  262. package/lib/features/webbuilder/components/PlanDocument.js.map +1 -0
  263. package/lib/features/webbuilder/components/PlanDraftCard.js +205 -0
  264. package/lib/features/webbuilder/components/PlanDraftCard.js.map +1 -0
  265. package/lib/features/webbuilder/components/PlanView.js +788 -0
  266. package/lib/features/webbuilder/components/PlanView.js.map +1 -0
  267. package/lib/features/webbuilder/components/PreviewConsoleSheet.js +334 -0
  268. package/lib/features/webbuilder/components/PreviewConsoleSheet.js.map +1 -0
  269. package/lib/features/webbuilder/components/PreviewFrame.js +45 -3
  270. package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
  271. package/lib/features/webbuilder/components/PreviewScreen.js +94 -10
  272. package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
  273. package/lib/features/webbuilder/components/ProjectChat.js +84 -14
  274. package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
  275. package/lib/features/webbuilder/components/StudioHome.js +69 -6
  276. package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
  277. package/lib/features/webbuilder/components/StyleDirectionsSheet.js +291 -0
  278. package/lib/features/webbuilder/components/StyleDirectionsSheet.js.map +1 -0
  279. package/lib/features/webbuilder/components/VersionChangesView.js +574 -0
  280. package/lib/features/webbuilder/components/VersionChangesView.js.map +1 -0
  281. package/lib/features/webbuilder/components/VersionPreviewView.js +186 -0
  282. package/lib/features/webbuilder/components/VersionPreviewView.js.map +1 -0
  283. package/lib/features/webbuilder/components/VersionsSheet.js +673 -16
  284. package/lib/features/webbuilder/components/VersionsSheet.js.map +1 -1
  285. package/lib/features/webbuilder/connectorTemplates.js +6 -1
  286. package/lib/features/webbuilder/connectorTemplates.js.map +1 -1
  287. package/lib/features/webbuilder/myAssets.js +101 -0
  288. package/lib/features/webbuilder/myAssets.js.map +1 -0
  289. package/lib/features/webbuilder/planChat.js +146 -0
  290. package/lib/features/webbuilder/planChat.js.map +1 -0
  291. package/lib/features/webbuilder/planDocument.js +89 -0
  292. package/lib/features/webbuilder/planDocument.js.map +1 -0
  293. package/lib/features/webbuilder/planStore.js +55 -0
  294. package/lib/features/webbuilder/planStore.js.map +1 -0
  295. package/lib/features/webbuilder/previewCommentsScript.js +218 -0
  296. package/lib/features/webbuilder/previewCommentsScript.js.map +1 -0
  297. package/lib/features/webbuilder/previewConsoleScript.js +39 -0
  298. package/lib/features/webbuilder/previewConsoleScript.js.map +1 -0
  299. package/lib/features/webbuilder/styleDirections.js +85 -0
  300. package/lib/features/webbuilder/styleDirections.js.map +1 -0
  301. package/lib/features/webbuilder/useCanvasComments.js +335 -0
  302. package/lib/features/webbuilder/useCanvasComments.js.map +1 -0
  303. package/lib/features/webbuilder/useCatalogTemplates.js +37 -0
  304. package/lib/features/webbuilder/useCatalogTemplates.js.map +1 -0
  305. package/lib/features/webbuilder/usePlanMode.js +145 -0
  306. package/lib/features/webbuilder/usePlanMode.js.map +1 -0
  307. package/lib/features/webbuilder/useStyleDirections.js +112 -0
  308. package/lib/features/webbuilder/useStyleDirections.js.map +1 -0
  309. package/lib/features/webbuilder/web/assets/assetsApi.js +174 -0
  310. package/lib/features/webbuilder/web/assets/assetsApi.js.map +1 -0
  311. package/lib/features/webbuilder/web/assets/assetsApi.ts +173 -0
  312. package/lib/features/webbuilder/web/assets/myAssets.js +341 -0
  313. package/lib/features/webbuilder/web/assets/myAssets.js.map +1 -0
  314. package/lib/features/webbuilder/web/assets/myAssets.ts +396 -0
  315. package/lib/features/webbuilder/web/canvas/elementName.js +46 -0
  316. package/lib/features/webbuilder/web/canvas/elementName.js.map +1 -0
  317. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js +95 -0
  318. package/lib/features/webbuilder/web/canvas/visualEditorBridge.js.map +1 -0
  319. package/lib/features/webbuilder/web/chat/agentTurn.js +24 -0
  320. package/lib/features/webbuilder/web/chat/agentTurn.js.map +1 -0
  321. package/lib/features/webbuilder/web/chat/planMode.js +164 -0
  322. package/lib/features/webbuilder/web/chat/planMode.js.map +1 -0
  323. package/lib/features/webbuilder/web/chat/realPlans.js +66 -0
  324. package/lib/features/webbuilder/web/chat/realPlans.js.map +1 -0
  325. package/lib/features/webbuilder/web/comments/comments.js +336 -0
  326. package/lib/features/webbuilder/web/comments/comments.js.map +1 -0
  327. package/lib/features/webbuilder/web/comments/commentsApi.js +59 -0
  328. package/lib/features/webbuilder/web/comments/commentsApi.js.map +1 -0
  329. package/lib/features/webbuilder/web/components/planView.js +21 -0
  330. package/lib/features/webbuilder/web/components/planView.js.map +1 -0
  331. package/lib/features/webbuilder/web/console/consolePanel.js +43 -0
  332. package/lib/features/webbuilder/web/console/consolePanel.js.map +1 -0
  333. package/lib/features/webbuilder/web/console/previewConsole.js +256 -0
  334. package/lib/features/webbuilder/web/console/previewConsole.js.map +1 -0
  335. package/lib/features/webbuilder/web/console/usePreviewConsole.js +147 -0
  336. package/lib/features/webbuilder/web/console/usePreviewConsole.js.map +1 -0
  337. package/lib/features/webbuilder/web/design/directions.js +419 -1
  338. package/lib/features/webbuilder/web/design/directions.js.map +1 -1
  339. package/lib/features/webbuilder/web/history/diffActions.js +222 -0
  340. package/lib/features/webbuilder/web/history/diffActions.js.map +1 -0
  341. package/lib/features/webbuilder/web/history/diffHighlight.js +18 -0
  342. package/lib/features/webbuilder/web/history/diffHighlight.js.map +1 -0
  343. package/lib/features/webbuilder/web/history/versionActions.js +272 -0
  344. package/lib/features/webbuilder/web/history/versionActions.js.map +1 -0
  345. package/lib/features/webbuilder/web/history/versionDiff.js +338 -0
  346. package/lib/features/webbuilder/web/history/versionDiff.js.map +1 -0
  347. package/lib/features/webbuilder/web/history/versionPreview.js +83 -0
  348. package/lib/features/webbuilder/web/history/versionPreview.js.map +1 -0
  349. package/lib/features/webbuilder/web/history/versionPreviewMachine.js +150 -0
  350. package/lib/features/webbuilder/web/history/versionPreviewMachine.js.map +1 -0
  351. package/lib/features/webbuilder/web/history/versions.js +326 -1
  352. package/lib/features/webbuilder/web/history/versions.js.map +1 -1
  353. package/lib/features/webbuilder/web/hosted/hostedTurn.js +36 -0
  354. package/lib/features/webbuilder/web/hosted/hostedTurn.js.map +1 -0
  355. package/lib/features/webbuilder/web/studio/brandKit.js +25 -0
  356. package/lib/features/webbuilder/web/studio/brandKit.js.map +1 -0
  357. package/lib/features/webbuilder/web/utils/promptSafe.js +15 -0
  358. package/lib/features/webbuilder/web/utils/promptSafe.js.map +1 -0
  359. package/lib/features/webbuilder/web/webServices.js +3 -1
  360. package/lib/features/webbuilder/web/webServices.js.map +1 -1
  361. package/lib/index.js +1 -1
  362. package/lib/index.js.map +1 -1
  363. package/lib/routes.json +55 -0
  364. package/lib/screens/Account/index.js +13 -5
  365. package/lib/screens/Account/index.js.map +1 -1
  366. package/lib/screens/Chat/index.js +16 -0
  367. package/lib/screens/Chat/index.js.map +1 -1
  368. package/lib/screens/Home/HomeScreen.js +202 -39
  369. package/lib/screens/Home/HomeScreen.js.map +1 -1
  370. package/lib/screens/Home/components/HomeHero.js +52 -38
  371. package/lib/screens/Home/components/HomeHero.js.map +1 -1
  372. package/lib/screens/Home/components/homeCatalog.js +8 -1
  373. package/lib/screens/Home/components/homeCatalog.js.map +1 -1
  374. package/lib/screens/TeamChat/index.js +41 -0
  375. package/lib/screens/TeamChat/index.js.map +1 -0
  376. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +9 -2
  377. package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
  378. package/lib/screens/WebBuilderNative/index.js +13 -3
  379. package/lib/screens/WebBuilderNative/index.js.map +1 -1
  380. package/lib/screens/WebBuilderNative/useConnectorTemplates.js +2 -2
  381. package/lib/screens/WebBuilderNative/useConnectorTemplates.js.map +1 -1
  382. package/package.json +4 -4
@@ -0,0 +1,659 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defProps = Object.defineProperties;
3
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
+ var __spreadValues = (a, b) => {
9
+ for (var prop in b || (b = {}))
10
+ if (__hasOwnProp.call(b, prop))
11
+ __defNormalProp(a, prop, b[prop]);
12
+ if (__getOwnPropSymbols)
13
+ for (var prop of __getOwnPropSymbols(b)) {
14
+ if (__propIsEnum.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ }
17
+ return a;
18
+ };
19
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
+ const text = (value) => typeof value === "string" && value.trim() ? value.trim() : void 0;
21
+ const num = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
22
+ const BARE_CODE_LABEL = /^(?:[A-Z]{3}\s?[\d,.]+|[\d,.]+\s?[A-Z]{3})$/;
23
+ function formatAmount(value, currency, label) {
24
+ var _a, _b, _c, _d;
25
+ const given = text(label);
26
+ if (given && !BARE_CODE_LABEL.test(given)) return given;
27
+ const source = value != null ? value : given == null ? void 0 : given.replace(/[A-Z]{3}/, "").trim();
28
+ const amount = (_a = num(source)) != null ? _a : typeof source === "string" ? Number(source.replace(/[^0-9.-]/g, "")) : void 0;
29
+ if (amount === void 0 || !Number.isFinite(amount)) return given;
30
+ const code = (_d = (_c = text(currency)) != null ? _c : (_b = given == null ? void 0 : given.match(/[A-Z]{3}/)) == null ? void 0 : _b[0]) == null ? void 0 : _d.toUpperCase();
31
+ if (code && /^[A-Z]{3}$/.test(code)) {
32
+ try {
33
+ return new Intl.NumberFormat(void 0, {
34
+ style: "currency",
35
+ currency: code,
36
+ maximumFractionDigits: Number.isInteger(amount) ? 0 : 2
37
+ }).format(amount);
38
+ } catch (e) {
39
+ }
40
+ }
41
+ return amount.toLocaleString(void 0, {
42
+ maximumFractionDigits: 2
43
+ });
44
+ }
45
+ function wallClock(iso) {
46
+ const m = iso == null ? void 0 : iso.match(/T(\d{2}):(\d{2})/);
47
+ if (!m) return void 0;
48
+ return new Date(Date.UTC(2e3, 0, 1, Number(m[1]), Number(m[2]))).toLocaleTimeString(void 0, {
49
+ hour: "numeric",
50
+ minute: "2-digit",
51
+ timeZone: "UTC"
52
+ });
53
+ }
54
+ function datePart(iso) {
55
+ const m = iso == null ? void 0 : iso.match(/^(\d{4})-(\d{2})-(\d{2})/);
56
+ return m ? [Number(m[1]), Number(m[2]), Number(m[3])] : void 0;
57
+ }
58
+ function dateLabel(iso) {
59
+ const parts = datePart(iso);
60
+ if (!parts) return void 0;
61
+ return new Date(Date.UTC(parts[0], parts[1] - 1, parts[2])).toLocaleDateString(void 0, {
62
+ weekday: "short",
63
+ month: "short",
64
+ day: "numeric",
65
+ timeZone: "UTC"
66
+ });
67
+ }
68
+ function dayOffset(departAt, arriveAt) {
69
+ const from = datePart(departAt);
70
+ const to = datePart(arriveAt);
71
+ if (!from || !to) return void 0;
72
+ const days = Math.round((Date.UTC(to[0], to[1] - 1, to[2]) - Date.UTC(from[0], from[1] - 1, from[2])) / 864e5);
73
+ return days > 0 ? `+${days}` : void 0;
74
+ }
75
+ function durationLabel(minutes) {
76
+ if (minutes === void 0 || !Number.isFinite(minutes) || minutes <= 0) return void 0;
77
+ const h = Math.floor(minutes / 60);
78
+ const m = Math.round(minutes % 60);
79
+ if (!h) return `${m}m`;
80
+ return m ? `${h}h ${m}m` : `${h}h`;
81
+ }
82
+ function stopsLabel(stops) {
83
+ if (stops === void 0 || !Number.isFinite(stops) || stops < 0) return void 0;
84
+ if (stops === 0) return "Nonstop";
85
+ return stops === 1 ? "1 stop" : `${stops} stops`;
86
+ }
87
+ function compactCount(count) {
88
+ if (count === void 0 || !Number.isFinite(count) || count <= 0) return void 0;
89
+ return new Intl.NumberFormat(void 0, {
90
+ notation: "compact",
91
+ maximumFractionDigits: 1
92
+ }).format(count);
93
+ }
94
+ const HOSTNAME_RE = /^(?=.{3,253}$)([a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,24}$/;
95
+ function cleanDomain(raw) {
96
+ var _a;
97
+ const host = (_a = text(raw)) == null ? void 0 : _a.toLowerCase().replace(/^[a-z]+:\/\//, "").replace(/^www\./, "").split(/[/?#:]/)[0];
98
+ return host && HOSTNAME_RE.test(host) ? host : void 0;
99
+ }
100
+ const FAVICON_SERVICE = "https://www.google.com/s2/favicons";
101
+ function faviconUrl(domain) {
102
+ return `${FAVICON_SERVICE}?domain=${encodeURIComponent(domain)}&sz=64`;
103
+ }
104
+ function brandLogo(logo, domain, knownLogo) {
105
+ const url = text(logo);
106
+ if (url && /^https:\/\//i.test(url)) return url;
107
+ if (knownLogo) return knownLogo;
108
+ const host = cleanDomain(domain);
109
+ return host ? faviconUrl(host) : void 0;
110
+ }
111
+ function carrierCode(flightNumber) {
112
+ var _a, _b;
113
+ return (_b = (_a = flightNumber == null ? void 0 : flightNumber.match(/^\s*([A-Z0-9]{2})\s*\d/i)) == null ? void 0 : _a[1]) == null ? void 0 : _b.toUpperCase();
114
+ }
115
+ function monogram(name, flightNumber) {
116
+ var _a;
117
+ const code = carrierCode(flightNumber);
118
+ if (code) return code;
119
+ const words = name.replace(/[^\p{L}\p{N}\s]/gu, " ").split(/\s+/).filter(Boolean);
120
+ return (words.length > 1 ? words[0][0] + words[1][0] : ((_a = words[0]) != null ? _a : "?").slice(0, 2)).toUpperCase();
121
+ }
122
+ const AIRLINES = {
123
+ akasaair: {
124
+ domain: "akasaair.com",
125
+ code: "QP"
126
+ },
127
+ akasa: {
128
+ domain: "akasaair.com",
129
+ code: "QP"
130
+ },
131
+ indigo: {
132
+ domain: "goindigo.in",
133
+ code: "6E"
134
+ },
135
+ airindia: {
136
+ domain: "airindia.com",
137
+ code: "AI"
138
+ },
139
+ airindiaexpress: {
140
+ domain: "airindiaexpress.com",
141
+ code: "IX"
142
+ },
143
+ spicejet: {
144
+ domain: "spicejet.com",
145
+ code: "SG"
146
+ },
147
+ vistara: {
148
+ domain: "airvistara.com"
149
+ },
150
+ allianceair: {
151
+ domain: "allianceair.in"
152
+ },
153
+ starair: {
154
+ domain: "starair.in"
155
+ },
156
+ emirates: {
157
+ domain: "emirates.com",
158
+ code: "EK"
159
+ },
160
+ qatarairways: {
161
+ domain: "qatarairways.com",
162
+ code: "QR"
163
+ },
164
+ etihad: {
165
+ domain: "etihad.com",
166
+ code: "EY"
167
+ },
168
+ etihadairways: {
169
+ domain: "etihad.com",
170
+ code: "EY"
171
+ },
172
+ singaporeairlines: {
173
+ domain: "singaporeair.com",
174
+ code: "SQ"
175
+ },
176
+ lufthansa: {
177
+ domain: "lufthansa.com",
178
+ code: "LH"
179
+ },
180
+ britishairways: {
181
+ domain: "britishairways.com",
182
+ code: "BA"
183
+ },
184
+ united: {
185
+ domain: "united.com",
186
+ code: "UA"
187
+ },
188
+ unitedairlines: {
189
+ domain: "united.com",
190
+ code: "UA"
191
+ },
192
+ delta: {
193
+ domain: "delta.com",
194
+ code: "DL"
195
+ },
196
+ deltaairlines: {
197
+ domain: "delta.com",
198
+ code: "DL"
199
+ },
200
+ american: {
201
+ domain: "aa.com",
202
+ code: "AA"
203
+ },
204
+ americanairlines: {
205
+ domain: "aa.com",
206
+ code: "AA"
207
+ },
208
+ jetblue: {
209
+ domain: "jetblue.com",
210
+ code: "B6"
211
+ },
212
+ southwest: {
213
+ domain: "southwest.com",
214
+ code: "WN"
215
+ },
216
+ southwestairlines: {
217
+ domain: "southwest.com",
218
+ code: "WN"
219
+ },
220
+ alaska: {
221
+ domain: "alaskaair.com",
222
+ code: "AS"
223
+ },
224
+ alaskaairlines: {
225
+ domain: "alaskaair.com",
226
+ code: "AS"
227
+ },
228
+ hawaiian: {
229
+ domain: "hawaiianairlines.com",
230
+ code: "HA"
231
+ },
232
+ hawaiianairlines: {
233
+ domain: "hawaiianairlines.com",
234
+ code: "HA"
235
+ },
236
+ allegiant: {
237
+ domain: "allegiantair.com",
238
+ code: "G4"
239
+ },
240
+ allegiantair: {
241
+ domain: "allegiantair.com",
242
+ code: "G4"
243
+ },
244
+ suncountry: {
245
+ domain: "suncountry.com",
246
+ code: "SY"
247
+ },
248
+ suncountryairlines: {
249
+ domain: "suncountry.com",
250
+ code: "SY"
251
+ },
252
+ aircanada: {
253
+ domain: "aircanada.com",
254
+ code: "AC"
255
+ },
256
+ westjet: {
257
+ domain: "westjet.com",
258
+ code: "WS"
259
+ },
260
+ ana: {
261
+ domain: "ana.co.jp",
262
+ code: "NH"
263
+ },
264
+ allnipponairways: {
265
+ domain: "ana.co.jp",
266
+ code: "NH"
267
+ },
268
+ jal: {
269
+ domain: "jal.co.jp",
270
+ code: "JL"
271
+ },
272
+ japanairlines: {
273
+ domain: "jal.co.jp",
274
+ code: "JL"
275
+ },
276
+ cathaypacific: {
277
+ domain: "cathaypacific.com",
278
+ code: "CX"
279
+ },
280
+ thaiairways: {
281
+ domain: "thaiairways.com",
282
+ code: "TG"
283
+ },
284
+ turkishairlines: {
285
+ domain: "turkishairlines.com",
286
+ code: "TK"
287
+ },
288
+ klm: {
289
+ domain: "klm.com",
290
+ code: "KL"
291
+ },
292
+ airfrance: {
293
+ domain: "airfrance.com",
294
+ code: "AF"
295
+ },
296
+ ryanair: {
297
+ domain: "ryanair.com",
298
+ code: "FR"
299
+ },
300
+ easyjet: {
301
+ domain: "easyjet.com",
302
+ code: "U2"
303
+ },
304
+ qantas: {
305
+ domain: "qantas.com",
306
+ code: "QF"
307
+ },
308
+ virginatlantic: {
309
+ domain: "virginatlantic.com",
310
+ code: "VS"
311
+ },
312
+ frontier: {
313
+ domain: "flyfrontier.com",
314
+ code: "F9"
315
+ },
316
+ frontierairlines: {
317
+ domain: "flyfrontier.com",
318
+ code: "F9"
319
+ },
320
+ spirit: {
321
+ domain: "spirit.com",
322
+ code: "NK"
323
+ },
324
+ spiritairlines: {
325
+ domain: "spirit.com",
326
+ code: "NK"
327
+ }
328
+ };
329
+ const AIRLINE_LOGO_SERVICE = "https://www.gstatic.com/flights/airline_logos/70px";
330
+ const AIRLINE_LOGO_CODES = new Set(Object.values(AIRLINES).flatMap(({
331
+ code
332
+ }) => code ? [code] : []));
333
+ function airlineEntry(airline) {
334
+ return airline ? AIRLINES[airline.toLowerCase().replace(/[^a-z]/g, "")] : void 0;
335
+ }
336
+ function airlineDomain(airline) {
337
+ var _a;
338
+ return (_a = airlineEntry(airline)) == null ? void 0 : _a.domain;
339
+ }
340
+ function airlineLogoUrl(airline, flightNumber) {
341
+ var _a;
342
+ const fromNumber = carrierCode(flightNumber);
343
+ const code = fromNumber && AIRLINE_LOGO_CODES.has(fromNumber) ? fromNumber : (_a = airlineEntry(airline)) == null ? void 0 : _a.code;
344
+ return code ? `${AIRLINE_LOGO_SERVICE}/${code}.png` : void 0;
345
+ }
346
+ const GOOGLE_FLIGHTS = "https://www.google.com/travel/flights";
347
+ function flightSearchUrl(from, to, departDate, returnDate) {
348
+ const trip = returnDate ? `through ${returnDate}` : "one way";
349
+ return `${GOOGLE_FLIGHTS}?q=${encodeURIComponent(`Flights from ${from} to ${to} on ${departDate} ${trip}`)}`;
350
+ }
351
+ const isoDay = (iso) => {
352
+ var _a;
353
+ return (_a = iso == null ? void 0 : iso.match(/^\d{4}-\d{2}-\d{2}/)) == null ? void 0 : _a[0];
354
+ };
355
+ function flightLink(url, flight, departAt, returnAt) {
356
+ if (url) {
357
+ const site = /^https?:\/\/(www\.)?google\.[a-z.]+\/travel\/flights/i.test(url) ? "Google Flights" : cleanDomain(url);
358
+ const name = [flight.airline, flight.flightNumber].filter(Boolean).join(" ");
359
+ return {
360
+ href: url,
361
+ label: `Book ${name} on ${site != null ? site : "its site"}`,
362
+ exact: true
363
+ };
364
+ }
365
+ const day = isoDay(departAt);
366
+ if (!flight.from || !flight.to || !day) return void 0;
367
+ return {
368
+ href: flightSearchUrl(flight.from, flight.to, day, isoDay(returnAt)),
369
+ label: `Find the ${flight.departs ? `${flight.departs} ` : ""}${flight.airline} flight on Google Flights`,
370
+ exact: false
371
+ };
372
+ }
373
+ function flightTitle(rows, firstDepart) {
374
+ const first = rows[0];
375
+ const route = (first == null ? void 0 : first.from) && (first == null ? void 0 : first.to) ? `${first.from} \u2192 ${first.to}` : "Flights";
376
+ const date = dateLabel(firstDepart);
377
+ return date ? `${route} \xB7 ${date}` : route;
378
+ }
379
+ function standoutLowest(values) {
380
+ const known = values.filter((value) => value !== void 0);
381
+ const lowest = Math.min(...known);
382
+ return known.some((value) => value !== lowest) ? lowest : void 0;
383
+ }
384
+ function toFlightResults(attachment, limit = 6) {
385
+ var _a, _b, _c, _d, _e;
386
+ const set = attachment != null ? attachment : {};
387
+ const offers = (Array.isArray(set.properties) ? set.properties : []).filter((offer) => {
388
+ var _a2, _b2, _c2;
389
+ return ((_c2 = (_b2 = (_a2 = offer == null ? void 0 : offer.flight) == null ? void 0 : _a2.slices) == null ? void 0 : _b2.length) != null ? _c2 : 0) > 0;
390
+ });
391
+ if (offers.length === 0) return null;
392
+ const prices = [];
393
+ const minutes = [];
394
+ const rows = offers.slice(0, limit).map((offer, index) => {
395
+ var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j;
396
+ const flight = (_a2 = offer.flight) != null ? _a2 : {};
397
+ const out = (_c2 = (_b2 = flight.slices) == null ? void 0 : _b2[0]) != null ? _c2 : {};
398
+ const back = flight.slices && flight.slices.length > 1 ? flight.slices[flight.slices.length - 1] : void 0;
399
+ const airline = (_e2 = (_d2 = text(flight.airline)) != null ? _d2 : text(offer.title)) != null ? _e2 : "Flight";
400
+ const flightNumber = text((_f = flight.flightNumbers) == null ? void 0 : _f[0]);
401
+ const price = formatAmount(offer.price, set.currency, offer.priceLabel);
402
+ const departs = wallClock(out.departAt);
403
+ const from = (_g = text(out.origin)) == null ? void 0 : _g.toUpperCase();
404
+ const to = (_h = text(out.destination)) == null ? void 0 : _h.toUpperCase();
405
+ prices.push(num(offer.price));
406
+ minutes.push(num(out.durationMinutes));
407
+ const backDeparts = wallClock(back == null ? void 0 : back.departAt);
408
+ const backArrives = wallClock(back == null ? void 0 : back.arriveAt);
409
+ const when = dateLabel(out.departAt);
410
+ const url = text(offer.url);
411
+ const link = flightLink(url && /^https?:\/\//i.test(url) ? url : void 0, {
412
+ airline,
413
+ flightNumber,
414
+ departs,
415
+ from,
416
+ to
417
+ }, out.departAt, back == null ? void 0 : back.departAt);
418
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
419
+ key: (_i = text(offer.id)) != null ? _i : `${airline}-${flightNumber != null ? flightNumber : index}-${index}`,
420
+ airline,
421
+ logo: brandLogo(flight.airlineLogo, (_j = flight.airlineDomain) != null ? _j : airlineDomain(airline), airlineLogoUrl(airline, flightNumber)),
422
+ monogram: monogram(airline, flightNumber)
423
+ }, flightNumber ? {
424
+ flightNumber
425
+ } : {}), from ? {
426
+ from
427
+ } : {}), to ? {
428
+ to
429
+ } : {}), departs ? {
430
+ departs
431
+ } : {}), wallClock(out.arriveAt) ? {
432
+ arrives: wallClock(out.arriveAt)
433
+ } : {}), dayOffset(out.departAt, out.arriveAt) ? {
434
+ arrivesDayOffset: dayOffset(out.departAt, out.arriveAt)
435
+ } : {}), durationLabel(out.durationMinutes) ? {
436
+ duration: durationLabel(out.durationMinutes)
437
+ } : {}), stopsLabel(out.stops) ? {
438
+ stops: stopsLabel(out.stops)
439
+ } : {}), price ? {
440
+ price
441
+ } : {}), link ? {
442
+ link
443
+ } : {}), backDeparts ? {
444
+ returnLeg: `Return ${backDeparts}${backArrives ? ` \u2192 ${backArrives}` : ""}`
445
+ } : {}), {
446
+ badges: [],
447
+ reply: [`Book the ${departs ? `${departs} ` : ""}${airline} flight`, flightNumber ? ` ${flightNumber}` : "", from && to ? ` from ${from} to ${to}` : "", when ? ` on ${when}` : "", price ? ` (${price})` : "", "."].join("")
448
+ });
449
+ });
450
+ if (rows.length > 1) rows[0].badges.push("best");
451
+ const lowest = standoutLowest(prices.slice(0, rows.length));
452
+ const quickest = standoutLowest(minutes.slice(0, rows.length));
453
+ rows.forEach((row, index) => {
454
+ if (lowest !== void 0 && prices[index] === lowest) row.badges.push("cheapest");
455
+ if (quickest !== void 0 && minutes[index] === quickest) row.badges.push("fastest");
456
+ });
457
+ const firstDepart = (_c = (_b = (_a = offers[0].flight) == null ? void 0 : _a.slices) == null ? void 0 : _b[0]) == null ? void 0 : _c.departAt;
458
+ const allNonstop = offers.every((offer) => {
459
+ var _a2, _b2;
460
+ return (_b2 = (_a2 = offer.flight) == null ? void 0 : _a2.slices) == null ? void 0 : _b2.every((slice) => slice.stops === 0);
461
+ });
462
+ const total = Math.max((_d = num(set.totalCount)) != null ? _d : 0, offers.length);
463
+ const title = (_e = text(set.title)) != null ? _e : flightTitle(rows, firstDepart);
464
+ const origins = new Set(rows.map((row) => row.from));
465
+ const [origin] = origins;
466
+ const originInTitle = origins.size === 1 && !!origin && /^[A-Z]{3}$/.test(origin) && new RegExp(`\\b${origin}\\b`).test(title.toUpperCase());
467
+ return {
468
+ title,
469
+ subtitle: [`${total} ${total === 1 ? "flight" : "flights"}`, allNonstop ? "nonstop" : void 0].filter(Boolean).join(" \xB7 "),
470
+ rows,
471
+ totalCount: total,
472
+ columns: {
473
+ from: rows.some((row) => row.from) && !originInTitle,
474
+ departs: rows.some((row) => row.departs),
475
+ arrives: rows.some((row) => row.arrives),
476
+ duration: rows.some((row) => row.duration),
477
+ stops: !allNonstop && rows.some((row) => row.stops),
478
+ price: rows.some((row) => row.price)
479
+ }
480
+ };
481
+ }
482
+ const GENERIC_SOURCES = /^(shopping[-_ ]?search|search|web|chat|yantra.*)$/i;
483
+ function storeName(item) {
484
+ var _a, _b;
485
+ const name = (_b = (_a = text(item.sourceLabel)) != null ? _a : text(item.provider)) != null ? _b : text(item.source);
486
+ if (!name || GENERIC_SOURCES.test(name)) return void 0;
487
+ return name.charAt(0).toUpperCase() + name.slice(1);
488
+ }
489
+ function capitalize(value) {
490
+ return value.charAt(0).toUpperCase() + value.slice(1);
491
+ }
492
+ function toProductResults(attachment, limit = 5) {
493
+ var _a, _b;
494
+ const set = attachment != null ? attachment : {};
495
+ const items = (Array.isArray(set.properties) ? set.properties : []).filter((item) => text(item == null ? void 0 : item.title));
496
+ if (items.length === 0) return null;
497
+ const prices = [];
498
+ const rows = items.slice(0, limit).map((item, index) => {
499
+ var _a2, _b2, _c, _d, _e;
500
+ const title = text(item.title);
501
+ const currency = (_a2 = text(item.currency)) != null ? _a2 : set.currency;
502
+ const price = formatAmount(item.price, currency, item.priceLabel);
503
+ const wasPrice = formatAmount(item.wasPrice, currency, item.wasPriceLabel);
504
+ const rating = num(item.rating);
505
+ const reviews = compactCount((_b2 = num(item.reviewCount)) != null ? _b2 : num(item.reviews));
506
+ prices.push(num(item.price));
507
+ return __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({
508
+ key: (_c = text(item.id)) != null ? _c : `${title}-${index}`,
509
+ title
510
+ }, text(item.imageUrl) && /^https?:\/\//i.test(item.imageUrl) ? {
511
+ imageUrl: item.imageUrl
512
+ } : {}), rating !== void 0 && rating > 0 ? {
513
+ rating: rating.toFixed(1)
514
+ } : {}), reviews ? {
515
+ reviews
516
+ } : {}), ((_d = text(item.note)) != null ? _d : text(item.detail)) ? {
517
+ detail: (_e = text(item.note)) != null ? _e : text(item.detail)
518
+ } : {}), price ? {
519
+ price
520
+ } : {}), wasPrice && wasPrice !== price ? {
521
+ wasPrice
522
+ } : {}), text(item.url) && /^https?:\/\//i.test(item.url) ? {
523
+ url: item.url
524
+ } : {}), {
525
+ badges: [],
526
+ reply: `I'll take the ${title}${price ? ` (${price})` : ""}.`
527
+ });
528
+ });
529
+ if (rows.length > 1) {
530
+ rows[0].badges.push("best");
531
+ const lowest = standoutLowest(prices);
532
+ rows.forEach((row, index) => {
533
+ if (lowest !== void 0 && prices[index] === lowest) row.badges.push("cheapest");
534
+ });
535
+ }
536
+ const store = storeName(items[0]);
537
+ const total = Math.max((_a = num(set.totalCount)) != null ? _a : 0, items.length);
538
+ return {
539
+ title: (_b = text(set.title)) != null ? _b : text(set.query) ? capitalize(text(set.query)) : "Products",
540
+ subtitle: [`${total} ${total === 1 ? "result" : "results"}`, store ? `on ${store}` : void 0].filter(Boolean).join(" \xB7 "),
541
+ rows,
542
+ totalCount: total
543
+ };
544
+ }
545
+ const BOOKING_STATUSES = ["review", "processing", "payment_due", "declined", "confirmed", "cancelled"];
546
+ const BOOKING_KINDS = ["flight", "stay", "order", "other"];
547
+ function bookingKind(a) {
548
+ if (BOOKING_KINDS.includes(a.kind)) return a.kind;
549
+ return a.trip ? "flight" : "order";
550
+ }
551
+ const GO_AHEAD = {
552
+ flight: "book it",
553
+ stay: "book it",
554
+ order: "place the order",
555
+ other: "go ahead"
556
+ };
557
+ function bookingStatusLabel(status, kind, note, reference) {
558
+ if (status === "processing") return kind === "order" ? "Placing your order\u2026" : "Booking\u2026";
559
+ if (status === "payment_due") return note != null ? note : `${kind === "order" ? "Order placed" : "Reserved"}${reference ? ` \xB7 ${reference}` : ""} \xB7 waiting for payment`;
560
+ if (status === "declined") return note != null ? note : "Payment declined";
561
+ if (status === "confirmed") return `${kind === "order" ? "Order placed" : "Booked"}${reference ? ` \xB7 ${reference}` : ""}`;
562
+ if (status === "cancelled") return note != null ? note : "Cancelled";
563
+ return note;
564
+ }
565
+ function toBookingView(attachment) {
566
+ var _a, _b, _c, _d;
567
+ const a = attachment != null ? attachment : {};
568
+ const vendor = text(a.vendor);
569
+ const total = formatAmount(a.total, a.currency, a.totalLabel);
570
+ if (!vendor && !total) return null;
571
+ const kind = bookingKind(a);
572
+ const status = BOOKING_STATUSES.includes(a.status) ? a.status : "review";
573
+ const name = vendor != null ? vendor : "Your booking";
574
+ const {
575
+ trip
576
+ } = a;
577
+ const tripView = trip ? __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, text(trip.origin) ? {
578
+ from: text(trip.origin).toUpperCase()
579
+ } : {}), text(trip.destination) ? {
580
+ to: text(trip.destination).toUpperCase()
581
+ } : {}), wallClock(trip.departAt) ? {
582
+ departs: wallClock(trip.departAt)
583
+ } : {}), wallClock(trip.arriveAt) ? {
584
+ arrives: wallClock(trip.arriveAt)
585
+ } : {}), dayOffset(trip.departAt, trip.arriveAt) ? {
586
+ arrivesDayOffset: dayOffset(trip.departAt, trip.arriveAt)
587
+ } : {}), durationLabel(trip.durationMinutes) ? {
588
+ duration: durationLabel(trip.durationMinutes)
589
+ } : {}), stopsLabel(trip.stops) ? {
590
+ stops: stopsLabel(trip.stops)
591
+ } : {}), text(trip.flightNumber) ? {
592
+ flightNumber: text(trip.flightNumber)
593
+ } : {}) : void 0;
594
+ const date = (_b = (_a = dateLabel(a.date)) != null ? _a : dateLabel(trip == null ? void 0 : trip.departAt)) != null ? _b : text(a.date);
595
+ const reference = text(a.reference);
596
+ const what = [name, text(a.title), date ? `on ${date}` : void 0].filter(Boolean).join(", ");
597
+ let action = null;
598
+ if (status === "review") {
599
+ action = {
600
+ // The go-ahead, not the payment: the card's money moves later, on the payment page or the
601
+ // payment card, so the button never says "pay".
602
+ label: (_c = text(a.confirmLabel)) != null ? _c : `${capitalize(GO_AHEAD[kind])}${total ? ` \xB7 ${total}` : ""}`,
603
+ reply: `Yes, ${GO_AHEAD[kind]}: ${what}${total ? `, ${total} total` : ""}.`
604
+ };
605
+ } else if (status === "declined") {
606
+ action = {
607
+ label: total ? `Retry ${total}` : "Retry payment",
608
+ reply: `Retry the payment: ${what}${total ? `, ${total} total` : ""}.`
609
+ };
610
+ }
611
+ const statusLabel = bookingStatusLabel(status, kind, text(a.statusNote), reference);
612
+ return __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues(__spreadValues({
613
+ kind,
614
+ vendor: name,
615
+ logo: brandLogo(a.vendorLogo, (_d = a.vendorDomain) != null ? _d : kind === "flight" ? airlineDomain(vendor) : void 0, kind === "flight" ? airlineLogoUrl(vendor, tripView == null ? void 0 : tripView.flightNumber) : void 0),
616
+ monogram: monogram(name, tripView == null ? void 0 : tripView.flightNumber)
617
+ }, text(a.title) ? {
618
+ title: text(a.title)
619
+ } : {}), date ? {
620
+ date
621
+ } : {}), tripView && Object.keys(tripView).length > 0 ? {
622
+ trip: tripView
623
+ } : {}), {
624
+ items: (Array.isArray(a.items) ? a.items : []).filter((item) => text(item == null ? void 0 : item.title)).map((item, index) => __spreadValues(__spreadValues(__spreadValues(__spreadValues({
625
+ key: `${text(item.title)}-${index}`,
626
+ title: text(item.title)
627
+ }, text(item.detail) ? {
628
+ detail: text(item.detail)
629
+ } : {}), num(item.quantity) && item.quantity > 1 ? {
630
+ quantity: item.quantity
631
+ } : {}), formatAmount(item.price, a.currency, item.priceLabel) ? {
632
+ price: formatAmount(item.price, a.currency, item.priceLabel)
633
+ } : {}), text(item.imageUrl) && /^https?:\/\//i.test(item.imageUrl) ? {
634
+ imageUrl: item.imageUrl
635
+ } : {})),
636
+ lines: (Array.isArray(a.lines) ? a.lines : []).filter((line) => text(line == null ? void 0 : line.label) && text(line == null ? void 0 : line.value)).map((line) => ({
637
+ label: text(line.label),
638
+ value: text(line.value)
639
+ })),
640
+ charges: (Array.isArray(a.charges) ? a.charges : []).flatMap((charge) => {
641
+ const label = text(charge == null ? void 0 : charge.label);
642
+ const amount = formatAmount(charge == null ? void 0 : charge.amount, a.currency, charge == null ? void 0 : charge.amountLabel);
643
+ return label && amount ? [{
644
+ label,
645
+ amount
646
+ }] : [];
647
+ })
648
+ }), total ? {
649
+ total
650
+ } : {}), {
651
+ status
652
+ }), statusLabel ? {
653
+ statusLabel
654
+ } : {}), reference ? {
655
+ reference
656
+ } : {}), {
657
+ action
658
+ });
659
+ }export{airlineDomain,airlineLogoUrl,brandLogo,cleanDomain,compactCount,dateLabel,dayOffset,durationLabel,faviconUrl,flightSearchUrl,formatAmount,monogram,stopsLabel,toBookingView,toFlightResults,toProductResults,wallClock};//# sourceMappingURL=resultCardModels.js.map