@bunnyapp/components 1.0.0 → 1.0.1

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 (332) hide show
  1. package/dist/cjs/index.js +1279 -967
  2. package/dist/cjs/playground/main.d.ts +1 -0
  3. package/dist/cjs/{types/src → src}/components/BunnyProvider.d.ts +5 -3
  4. package/dist/cjs/src/components/Card.d.ts +7 -0
  5. package/dist/cjs/src/components/Checkout/InvoiceCheckout.d.ts +27 -0
  6. package/dist/cjs/src/components/Footer.d.ts +4 -0
  7. package/dist/cjs/src/components/Icons/ArrowDownToLine.d.ts +5 -0
  8. package/dist/{esm/types → cjs}/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -0
  9. package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentOption.d.ts +1 -1
  10. package/dist/cjs/src/components/Signup/PaymentForms.d.ts +18 -0
  11. package/dist/cjs/src/components/Signup/PaymentSuccess.d.ts +7 -0
  12. package/dist/cjs/src/components/Signup/PriceListDisplay.d.ts +6 -0
  13. package/dist/cjs/src/components/Signup/Signup.d.ts +5 -0
  14. package/dist/cjs/src/components/Signup/Signup.stories.d.ts +8 -0
  15. package/dist/cjs/src/components/Signup/index.d.ts +1 -0
  16. package/dist/cjs/{types/src → src}/components/Subscriptions/Subscriptions.d.ts +1 -1
  17. package/dist/cjs/{types/src → src}/components/Transactions/Transactions.d.ts +4 -3
  18. package/dist/{esm/types → cjs}/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  19. package/dist/cjs/{types/src → src}/components/index.d.ts +1 -0
  20. package/dist/cjs/src/contexts/PaymentContext.d.ts +6 -0
  21. package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +12 -0
  22. package/dist/cjs/src/graphql/mutations/portalSessionCreate.d.ts +8 -0
  23. package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
  24. package/dist/{esm/types → cjs}/src/graphql/mutations/quoteCompose.d.ts +5 -3
  25. package/dist/cjs/src/graphql/mutations/quoteCreate.d.ts +9 -0
  26. package/dist/cjs/src/graphql/queries/getAccount.d.ts +7 -0
  27. package/dist/cjs/src/graphql/queries/getFormattedQuote.d.ts +7 -0
  28. package/dist/cjs/src/graphql/queries/getPriceList.d.ts +7 -0
  29. package/dist/cjs/src/graphql/queries/getSubscription.d.ts +12 -0
  30. package/dist/cjs/{types/src → src}/mocks/handlers.d.ts +1 -1
  31. package/dist/esm/index.js +1280 -970
  32. package/dist/esm/playground/main.d.ts +1 -0
  33. package/dist/esm/{types/src → src}/components/BunnyProvider.d.ts +5 -3
  34. package/dist/esm/src/components/Card.d.ts +7 -0
  35. package/dist/esm/src/components/Checkout/InvoiceCheckout.d.ts +27 -0
  36. package/dist/esm/src/components/Footer.d.ts +4 -0
  37. package/dist/esm/src/components/Icons/ArrowDownToLine.d.ts +5 -0
  38. package/dist/{cjs/types → esm}/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -0
  39. package/dist/esm/{types/src → src}/components/PaymentForm/PaymentOption.d.ts +1 -1
  40. package/dist/esm/src/components/Signup/PaymentForms.d.ts +18 -0
  41. package/dist/esm/src/components/Signup/PaymentSuccess.d.ts +7 -0
  42. package/dist/esm/src/components/Signup/PriceListDisplay.d.ts +6 -0
  43. package/dist/esm/src/components/Signup/Signup.d.ts +5 -0
  44. package/dist/esm/src/components/Signup/Signup.stories.d.ts +8 -0
  45. package/dist/esm/src/components/Signup/index.d.ts +1 -0
  46. package/dist/esm/{types/src → src}/components/Subscriptions/Subscriptions.d.ts +1 -1
  47. package/dist/esm/{types/src → src}/components/Transactions/Transactions.d.ts +4 -3
  48. package/dist/{cjs/types → esm}/src/components/Transactions/TransactionsListContext.d.ts +1 -0
  49. package/dist/esm/{types/src → src}/components/index.d.ts +1 -0
  50. package/dist/esm/src/contexts/PaymentContext.d.ts +6 -0
  51. package/dist/esm/src/graphql/mutations/accountSignup.d.ts +12 -0
  52. package/dist/esm/src/graphql/mutations/portalSessionCreate.d.ts +8 -0
  53. package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +14 -0
  54. package/dist/{cjs/types → esm}/src/graphql/mutations/quoteCompose.d.ts +5 -3
  55. package/dist/esm/src/graphql/mutations/quoteCreate.d.ts +9 -0
  56. package/dist/esm/src/graphql/queries/getAccount.d.ts +7 -0
  57. package/dist/esm/src/graphql/queries/getFormattedQuote.d.ts +7 -0
  58. package/dist/esm/src/graphql/queries/getPriceList.d.ts +7 -0
  59. package/dist/esm/src/graphql/queries/getSubscription.d.ts +12 -0
  60. package/dist/esm/{types/src → src}/mocks/handlers.d.ts +1 -1
  61. package/dist/index.d.ts +14 -9
  62. package/package.json +16 -10
  63. package/dist/cjs/types/playground/main.d.ts +0 -1
  64. package/dist/cjs/types/src/components/Card.d.ts +0 -5
  65. package/dist/cjs/types/src/components/Checkout/InvoiceCheckout.d.ts +0 -7
  66. package/dist/cjs/types/src/components/Footer.d.ts +0 -2
  67. package/dist/cjs/types/src/components/Quote/QuoteContext.d.ts +0 -5
  68. package/dist/cjs/types/src/graphql/queries/getFormattedQuote.d.ts +0 -3
  69. package/dist/esm/types/playground/main.d.ts +0 -1
  70. package/dist/esm/types/src/components/Card.d.ts +0 -5
  71. package/dist/esm/types/src/components/Checkout/InvoiceCheckout.d.ts +0 -7
  72. package/dist/esm/types/src/components/Footer.d.ts +0 -2
  73. package/dist/esm/types/src/components/Quote/QuoteContext.d.ts +0 -5
  74. package/dist/esm/types/src/graphql/queries/getFormattedQuote.d.ts +0 -3
  75. /package/dist/cjs/{types/src → src}/atoms/pageContentRefAtom.d.ts +0 -0
  76. /package/dist/cjs/{types/src → src}/atoms/planPickerQuoteDataAtom.d.ts +0 -0
  77. /package/dist/cjs/{types/src → src}/atoms/updatingChargeQuantityIdAtom.d.ts +0 -0
  78. /package/dist/cjs/{types/src → src}/components/Checkout/Checkout.d.ts +0 -0
  79. /package/dist/cjs/{types/src → src}/components/Checkout/CouponComponent.d.ts +0 -0
  80. /package/dist/cjs/{types/src → src}/components/Checkout/QuoteCheckout.d.ts +0 -0
  81. /package/dist/cjs/{types/src → src}/components/Checkout/checkoutUtils.d.ts +0 -0
  82. /package/dist/cjs/{types/src → src}/components/Checkout/index.d.ts +0 -0
  83. /package/dist/cjs/{types/src → src}/components/DrawerHeader.d.ts +0 -0
  84. /package/dist/cjs/{types/src → src}/components/Error.d.ts +0 -0
  85. /package/dist/cjs/{types/src → src}/components/FeatureUsageGraph.d.ts +0 -0
  86. /package/dist/cjs/{types/src → src}/components/HeaderModalWrapper.d.ts +0 -0
  87. /package/dist/cjs/{types/src → src}/components/Icons/BunnyFooterIcon.d.ts +0 -0
  88. /package/dist/cjs/{types/src → src}/components/Icons/CardIcon.d.ts +0 -0
  89. /package/dist/cjs/{types/src → src}/components/Invoice/Invoice.d.ts +0 -0
  90. /package/dist/cjs/{types/src → src}/components/Invoice/Invoice.stories.d.ts +0 -0
  91. /package/dist/cjs/{types/src → src}/components/Invoice/InvoiceQuoteView.d.ts +0 -0
  92. /package/dist/cjs/{types/src → src}/components/Invoice/index.d.ts +0 -0
  93. /package/dist/cjs/{types/src → src}/components/LegacyInvoicePDF.d.ts +0 -0
  94. /package/dist/cjs/{types/src → src}/components/PageContent.d.ts +0 -0
  95. /package/dist/cjs/{types/src → src}/components/PageHeaderWithActions.d.ts +0 -0
  96. /package/dist/cjs/{types/src → src}/components/PageWrapper.d.ts +0 -0
  97. /package/dist/cjs/{types/src → src}/components/PandadocPollingModal.d.ts +0 -0
  98. /package/dist/cjs/{types/src → src}/components/PaymentForm/CheckoutFooter.d.ts +0 -0
  99. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +0 -0
  100. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +0 -0
  101. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +0 -0
  102. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/DemoPayForm.d.ts +0 -0
  103. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/demoPayUtils.d.ts +0 -0
  104. /package/dist/cjs/{types/src → src}/components/PaymentForm/DemoPay/index.d.ts +0 -0
  105. /package/dist/cjs/{types/src → src}/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -0
  106. /package/dist/cjs/{types/src → src}/components/PaymentForm/Finix/index.d.ts +0 -0
  107. /package/dist/cjs/{types/src → src}/components/PaymentForm/FinixAch.d.ts +0 -0
  108. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentForm.d.ts +0 -0
  109. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentFormTypes.d.ts +0 -0
  110. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +0 -0
  111. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +0 -0
  112. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +0 -0
  113. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -0
  114. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethod/index.d.ts +0 -0
  115. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethodForm.d.ts +0 -0
  116. /package/dist/cjs/{types/src → src}/components/PaymentForm/PaymentMethodSelector.d.ts +0 -0
  117. /package/dist/cjs/{types/src → src}/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -0
  118. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -0
  119. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -0
  120. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/StripeForm.d.ts +0 -0
  121. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/index.d.ts +0 -0
  122. /package/dist/cjs/{types/src → src}/components/PaymentForm/Stripe/stripeUtils.d.ts +0 -0
  123. /package/dist/cjs/{types/src → src}/components/PaymentForm/index.d.ts +0 -0
  124. /package/dist/cjs/{types/src → src}/components/PaymentForm/paymentUtils.d.ts +0 -0
  125. /package/dist/cjs/{types/src → src}/components/Quote/AcceptQuoteModal.d.ts +0 -0
  126. /package/dist/cjs/{types/src → src}/components/Quote/DocumentNameEnum.d.ts +0 -0
  127. /package/dist/cjs/{types/src → src}/components/Quote/Quote.d.ts +0 -0
  128. /package/dist/cjs/{types/src → src}/components/Quote/Quote.stories.d.ts +0 -0
  129. /package/dist/cjs/{types/src → src}/components/Quote/StyledModal.d.ts +0 -0
  130. /package/dist/cjs/{types/src → src}/components/Quote/index.d.ts +0 -0
  131. /package/dist/cjs/{types/src → src}/components/StateTag.d.ts +0 -0
  132. /package/dist/cjs/{types/src → src}/components/Subscriptions/index.d.ts +0 -0
  133. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +0 -0
  134. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +0 -0
  135. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -0
  136. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +0 -0
  137. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +0 -0
  138. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +0 -0
  139. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +0 -0
  140. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +0 -0
  141. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +0 -0
  142. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +0 -0
  143. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +0 -0
  144. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +0 -0
  145. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +0 -0
  146. /package/dist/cjs/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -0
  147. /package/dist/cjs/{types/src → src}/components/TaxationForm.d.ts +0 -0
  148. /package/dist/cjs/{types/src → src}/components/Transactions/DocumentNameEnum.d.ts +0 -0
  149. /package/dist/cjs/{types/src → src}/components/Transactions/Transactions.stories.d.ts +0 -0
  150. /package/dist/cjs/{types/src → src}/components/Transactions/index.d.ts +0 -0
  151. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionDate.d.ts +0 -0
  152. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionDownload.d.ts +0 -0
  153. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -0
  154. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionTitle.d.ts +0 -0
  155. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -0
  156. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -0
  157. /package/dist/cjs/{types/src → src}/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -0
  158. /package/dist/cjs/{types/src → src}/consts/paymentConsts.d.ts +0 -0
  159. /package/dist/cjs/{types/src → src}/contexts/BrandContext.d.ts +0 -0
  160. /package/dist/cjs/{types/src → src}/contexts/NavigationContext.d.ts +0 -0
  161. /package/dist/cjs/{types/src → src}/enums/SubscriptionState.d.ts +0 -0
  162. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -0
  163. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -0
  164. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuantityInput.d.ts +0 -0
  165. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -0
  166. /package/dist/cjs/{types/src → src}/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -0
  167. /package/dist/cjs/{types/src → src}/graphql/QuoteRequests.d.ts +0 -0
  168. /package/dist/cjs/{types/src → src}/graphql/SubscriptionRequests.d.ts +0 -0
  169. /package/dist/cjs/{types/src → src}/graphql/mutations/accountUpdate.d.ts +0 -0
  170. /package/dist/cjs/{types/src → src}/graphql/mutations/checkout.d.ts +0 -0
  171. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteAddCoupon.d.ts +0 -0
  172. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteRecalculateTaxes.d.ts +0 -0
  173. /package/dist/cjs/{types/src → src}/graphql/mutations/quoteSubscriptionReinstate.d.ts +0 -0
  174. /package/dist/cjs/{types/src → src}/graphql/queries/getBranding.d.ts +0 -0
  175. /package/dist/cjs/{types/src → src}/graphql/queries/getCurrentUserData.d.ts +0 -0
  176. /package/dist/cjs/{types/src → src}/graphql/queries/getFeatureUsage.d.ts +0 -0
  177. /package/dist/cjs/{types/src → src}/graphql/queries/getFormattedInvoice.d.ts +0 -0
  178. /package/dist/cjs/{types/src → src}/graphql/queries/getInvoice.d.ts +0 -0
  179. /package/dist/cjs/{types/src → src}/graphql/queries/getPlanChangeOptions.d.ts +0 -0
  180. /package/dist/cjs/{types/src → src}/graphql/queries/getQuote.d.ts +0 -0
  181. /package/dist/cjs/{types/src → src}/graphql/queries/getSubscriptions.d.ts +0 -0
  182. /package/dist/cjs/{types/src → src}/graphql/queries/getTransactions.d.ts +0 -0
  183. /package/dist/cjs/{types/src → src}/hooks/index.d.ts +0 -0
  184. /package/dist/cjs/{types/src → src}/hooks/quotes/useSendAcceptQuote.d.ts +0 -0
  185. /package/dist/cjs/{types/src → src}/hooks/quotes/useSigningComplete.d.ts +0 -0
  186. /package/dist/cjs/{types/src → src}/hooks/subscriptions/useSubscriptions.d.ts +0 -0
  187. /package/dist/cjs/{types/src → src}/hooks/useCurrentUserData.d.ts +0 -0
  188. /package/dist/cjs/{types/src → src}/hooks/useFocusFirstInput.d.ts +0 -0
  189. /package/dist/cjs/{types/src → src}/hooks/useHasTaxPlugin.d.ts +0 -0
  190. /package/dist/cjs/{types/src → src}/hooks/useIsExpired.d.ts +0 -0
  191. /package/dist/cjs/{types/src → src}/hooks/useIsMobile.d.ts +0 -0
  192. /package/dist/cjs/{types/src → src}/hooks/usePaymentMethod.d.ts +0 -0
  193. /package/dist/cjs/{types/src → src}/hooks/useSigningPlugins.d.ts +0 -0
  194. /package/dist/cjs/{types/src → src}/index.d.ts +0 -0
  195. /package/dist/cjs/{types/src → src}/mocks/browser.d.ts +0 -0
  196. /package/dist/cjs/{types/src → src}/stories/Button.d.ts +0 -0
  197. /package/dist/cjs/{types/src → src}/stories/Button.stories.d.ts +0 -0
  198. /package/dist/cjs/{types/src → src}/stories/Header.d.ts +0 -0
  199. /package/dist/cjs/{types/src → src}/stories/Header.stories.d.ts +0 -0
  200. /package/dist/cjs/{types/src → src}/stories/Page.d.ts +0 -0
  201. /package/dist/cjs/{types/src → src}/stories/Page.stories.d.ts +0 -0
  202. /package/dist/cjs/{types/src → src}/utils.d.ts +0 -0
  203. /package/dist/cjs/{types/vite.config.d.ts → vite.config.d.ts} +0 -0
  204. /package/dist/esm/{types/src → src}/atoms/pageContentRefAtom.d.ts +0 -0
  205. /package/dist/esm/{types/src → src}/atoms/planPickerQuoteDataAtom.d.ts +0 -0
  206. /package/dist/esm/{types/src → src}/atoms/updatingChargeQuantityIdAtom.d.ts +0 -0
  207. /package/dist/esm/{types/src → src}/components/Checkout/Checkout.d.ts +0 -0
  208. /package/dist/esm/{types/src → src}/components/Checkout/CouponComponent.d.ts +0 -0
  209. /package/dist/esm/{types/src → src}/components/Checkout/QuoteCheckout.d.ts +0 -0
  210. /package/dist/esm/{types/src → src}/components/Checkout/checkoutUtils.d.ts +0 -0
  211. /package/dist/esm/{types/src → src}/components/Checkout/index.d.ts +0 -0
  212. /package/dist/esm/{types/src → src}/components/DrawerHeader.d.ts +0 -0
  213. /package/dist/esm/{types/src → src}/components/Error.d.ts +0 -0
  214. /package/dist/esm/{types/src → src}/components/FeatureUsageGraph.d.ts +0 -0
  215. /package/dist/esm/{types/src → src}/components/HeaderModalWrapper.d.ts +0 -0
  216. /package/dist/esm/{types/src → src}/components/Icons/BunnyFooterIcon.d.ts +0 -0
  217. /package/dist/esm/{types/src → src}/components/Icons/CardIcon.d.ts +0 -0
  218. /package/dist/esm/{types/src → src}/components/Invoice/Invoice.d.ts +0 -0
  219. /package/dist/esm/{types/src → src}/components/Invoice/Invoice.stories.d.ts +0 -0
  220. /package/dist/esm/{types/src → src}/components/Invoice/InvoiceQuoteView.d.ts +0 -0
  221. /package/dist/esm/{types/src → src}/components/Invoice/index.d.ts +0 -0
  222. /package/dist/esm/{types/src → src}/components/LegacyInvoicePDF.d.ts +0 -0
  223. /package/dist/esm/{types/src → src}/components/PageContent.d.ts +0 -0
  224. /package/dist/esm/{types/src → src}/components/PageHeaderWithActions.d.ts +0 -0
  225. /package/dist/esm/{types/src → src}/components/PageWrapper.d.ts +0 -0
  226. /package/dist/esm/{types/src → src}/components/PandadocPollingModal.d.ts +0 -0
  227. /package/dist/esm/{types/src → src}/components/PaymentForm/CheckoutFooter.d.ts +0 -0
  228. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardCvc.d.ts +0 -0
  229. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayCardNumber.d.ts +0 -0
  230. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayExpiry.d.ts +0 -0
  231. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/DemoPayForm.d.ts +0 -0
  232. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/demoPayUtils.d.ts +0 -0
  233. /package/dist/esm/{types/src → src}/components/PaymentForm/DemoPay/index.d.ts +0 -0
  234. /package/dist/esm/{types/src → src}/components/PaymentForm/Finix/FinixCardForm.d.ts +0 -0
  235. /package/dist/esm/{types/src → src}/components/PaymentForm/Finix/index.d.ts +0 -0
  236. /package/dist/esm/{types/src → src}/components/PaymentForm/FinixAch.d.ts +0 -0
  237. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentForm.d.ts +0 -0
  238. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentFormTypes.d.ts +0 -0
  239. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/CreditCard.d.ts +0 -0
  240. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/LargCardIcon.d.ts +0 -0
  241. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/CreditCard/PlusIcon.d.ts +0 -0
  242. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/PaymentMethodContext.d.ts +0 -0
  243. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethod/index.d.ts +0 -0
  244. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethodForm.d.ts +0 -0
  245. /package/dist/esm/{types/src → src}/components/PaymentForm/PaymentMethodSelector.d.ts +0 -0
  246. /package/dist/esm/{types/src → src}/components/PaymentForm/StoredPaymentMethod/StoredPaymentMethodForm.d.ts +0 -0
  247. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/CheckoutForm.d.ts +0 -0
  248. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/PaymentMethodForm.d.ts +0 -0
  249. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/StripeForm.d.ts +0 -0
  250. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/index.d.ts +0 -0
  251. /package/dist/esm/{types/src → src}/components/PaymentForm/Stripe/stripeUtils.d.ts +0 -0
  252. /package/dist/esm/{types/src → src}/components/PaymentForm/index.d.ts +0 -0
  253. /package/dist/esm/{types/src → src}/components/PaymentForm/paymentUtils.d.ts +0 -0
  254. /package/dist/esm/{types/src → src}/components/Quote/AcceptQuoteModal.d.ts +0 -0
  255. /package/dist/esm/{types/src → src}/components/Quote/DocumentNameEnum.d.ts +0 -0
  256. /package/dist/esm/{types/src → src}/components/Quote/Quote.d.ts +0 -0
  257. /package/dist/esm/{types/src → src}/components/Quote/Quote.stories.d.ts +0 -0
  258. /package/dist/esm/{types/src → src}/components/Quote/StyledModal.d.ts +0 -0
  259. /package/dist/esm/{types/src → src}/components/Quote/index.d.ts +0 -0
  260. /package/dist/esm/{types/src → src}/components/StateTag.d.ts +0 -0
  261. /package/dist/esm/{types/src → src}/components/Subscriptions/index.d.ts +0 -0
  262. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/ChangeQuantitiesButton.d.ts +0 -0
  263. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/HideExpiredToggle.d.ts +0 -0
  264. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardActions.d.ts +0 -0
  265. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionCardHeader.d.ts +0 -0
  266. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +0 -0
  267. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +0 -0
  268. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsList.d.ts +0 -0
  269. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/SubscriptionsNavigation.d.ts +0 -0
  270. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardColumnHeaders.d.ts +0 -0
  271. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +0 -0
  272. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionsCardCell.d.ts +0 -0
  273. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardCellMobile.d.ts +0 -0
  274. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +0 -0
  275. /package/dist/esm/{types/src → src}/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +0 -0
  276. /package/dist/esm/{types/src → src}/components/TaxationForm.d.ts +0 -0
  277. /package/dist/esm/{types/src → src}/components/Transactions/DocumentNameEnum.d.ts +0 -0
  278. /package/dist/esm/{types/src → src}/components/Transactions/Transactions.stories.d.ts +0 -0
  279. /package/dist/esm/{types/src → src}/components/Transactions/index.d.ts +0 -0
  280. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionDate.d.ts +0 -0
  281. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionDownload.d.ts +0 -0
  282. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -0
  283. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionTitle.d.ts +0 -0
  284. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -0
  285. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -0
  286. /package/dist/esm/{types/src → src}/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -0
  287. /package/dist/esm/{types/src → src}/consts/paymentConsts.d.ts +0 -0
  288. /package/dist/esm/{types/src → src}/contexts/BrandContext.d.ts +0 -0
  289. /package/dist/esm/{types/src → src}/contexts/NavigationContext.d.ts +0 -0
  290. /package/dist/esm/{types/src → src}/enums/SubscriptionState.d.ts +0 -0
  291. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridRow.d.ts +0 -0
  292. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityChangeGridTitle.d.ts +0 -0
  293. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuantityInput.d.ts +0 -0
  294. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/QuoteChangeSummarySection.d.ts +0 -0
  295. /package/dist/esm/{types/src → src}/features/quantityChangeDrawer/quantityChangeDrawerDesktop/QuantityChangeDrawerDesktop.d.ts +0 -0
  296. /package/dist/esm/{types/src → src}/graphql/QuoteRequests.d.ts +0 -0
  297. /package/dist/esm/{types/src → src}/graphql/SubscriptionRequests.d.ts +0 -0
  298. /package/dist/esm/{types/src → src}/graphql/mutations/accountUpdate.d.ts +0 -0
  299. /package/dist/esm/{types/src → src}/graphql/mutations/checkout.d.ts +0 -0
  300. /package/dist/esm/{types/src → src}/graphql/mutations/quoteAddCoupon.d.ts +0 -0
  301. /package/dist/esm/{types/src → src}/graphql/mutations/quoteRecalculateTaxes.d.ts +0 -0
  302. /package/dist/esm/{types/src → src}/graphql/mutations/quoteSubscriptionReinstate.d.ts +0 -0
  303. /package/dist/esm/{types/src → src}/graphql/queries/getBranding.d.ts +0 -0
  304. /package/dist/esm/{types/src → src}/graphql/queries/getCurrentUserData.d.ts +0 -0
  305. /package/dist/esm/{types/src → src}/graphql/queries/getFeatureUsage.d.ts +0 -0
  306. /package/dist/esm/{types/src → src}/graphql/queries/getFormattedInvoice.d.ts +0 -0
  307. /package/dist/esm/{types/src → src}/graphql/queries/getInvoice.d.ts +0 -0
  308. /package/dist/esm/{types/src → src}/graphql/queries/getPlanChangeOptions.d.ts +0 -0
  309. /package/dist/esm/{types/src → src}/graphql/queries/getQuote.d.ts +0 -0
  310. /package/dist/esm/{types/src → src}/graphql/queries/getSubscriptions.d.ts +0 -0
  311. /package/dist/esm/{types/src → src}/graphql/queries/getTransactions.d.ts +0 -0
  312. /package/dist/esm/{types/src → src}/hooks/index.d.ts +0 -0
  313. /package/dist/esm/{types/src → src}/hooks/quotes/useSendAcceptQuote.d.ts +0 -0
  314. /package/dist/esm/{types/src → src}/hooks/quotes/useSigningComplete.d.ts +0 -0
  315. /package/dist/esm/{types/src → src}/hooks/subscriptions/useSubscriptions.d.ts +0 -0
  316. /package/dist/esm/{types/src → src}/hooks/useCurrentUserData.d.ts +0 -0
  317. /package/dist/esm/{types/src → src}/hooks/useFocusFirstInput.d.ts +0 -0
  318. /package/dist/esm/{types/src → src}/hooks/useHasTaxPlugin.d.ts +0 -0
  319. /package/dist/esm/{types/src → src}/hooks/useIsExpired.d.ts +0 -0
  320. /package/dist/esm/{types/src → src}/hooks/useIsMobile.d.ts +0 -0
  321. /package/dist/esm/{types/src → src}/hooks/usePaymentMethod.d.ts +0 -0
  322. /package/dist/esm/{types/src → src}/hooks/useSigningPlugins.d.ts +0 -0
  323. /package/dist/esm/{types/src → src}/index.d.ts +0 -0
  324. /package/dist/esm/{types/src → src}/mocks/browser.d.ts +0 -0
  325. /package/dist/esm/{types/src → src}/stories/Button.d.ts +0 -0
  326. /package/dist/esm/{types/src → src}/stories/Button.stories.d.ts +0 -0
  327. /package/dist/esm/{types/src → src}/stories/Header.d.ts +0 -0
  328. /package/dist/esm/{types/src → src}/stories/Header.stories.d.ts +0 -0
  329. /package/dist/esm/{types/src → src}/stories/Page.d.ts +0 -0
  330. /package/dist/esm/{types/src → src}/stories/Page.stories.d.ts +0 -0
  331. /package/dist/esm/{types/src → src}/utils.d.ts +0 -0
  332. /package/dist/esm/{types/vite.config.d.ts → vite.config.d.ts} +0 -0
package/dist/cjs/index.js CHANGED
@@ -10,6 +10,7 @@ var styled = require('styled-components');
10
10
  var common = require('@bunnyapp/common');
11
11
  var reactQuery = require('@tanstack/react-query');
12
12
  var recoil = require('recoil');
13
+ var theme = require('antd/lib/theme');
13
14
  var reactStripeJs = require('@stripe/react-stripe-js');
14
15
  var pure = require('@stripe/stripe-js/pure');
15
16
  var lodash = require('lodash');
@@ -40,6 +41,7 @@ function _interopNamespace(e) {
40
41
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
41
42
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
42
43
  var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
44
+ var theme__default = /*#__PURE__*/_interopDefaultLegacy(theme);
43
45
  var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
44
46
 
45
47
  /******************************************************************************
@@ -79,8 +81,8 @@ function __awaiter(thisArg, _arguments, P, generator) {
79
81
  }
80
82
 
81
83
  function __generator(thisArg, body) {
82
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
83
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
84
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
85
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
84
86
  function verb(n) { return function (v) { return step([n, v]); }; }
85
87
  function step(op) {
86
88
  if (f) throw new TypeError("Generator is already executing.");
@@ -320,563 +322,535 @@ var classnames = {exports: {}};
320
322
 
321
323
  var classNames = classnames.exports;
322
324
 
325
+ const round = Math.round;
326
+
323
327
  /**
324
- * Take input from [0, n] and return it as [0, 1]
325
- * @hidden
326
- */
327
- function bound01(n, max) {
328
- if (isOnePointZero(n)) {
329
- n = '100%';
330
- }
331
- var isPercent = isPercentage(n);
332
- n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
333
- // Automatically convert percentage into number
334
- if (isPercent) {
335
- n = parseInt(String(n * max), 10) / 100;
336
- }
337
- // Handle floating point rounding errors
338
- if (Math.abs(n - max) < 0.000001) {
339
- return 1;
340
- }
341
- // Convert into [0, 1] range if it isn't already
342
- if (max === 360) {
343
- // If n is a hue given in degrees,
344
- // wrap around out-of-range values into [0, 360] range
345
- // then convert into [0, 1].
346
- n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
347
- }
348
- else {
349
- // If n not a hue given in degrees
350
- // Convert into [0, 1] range if it isn't already.
351
- n = (n % max) / parseFloat(String(max));
352
- }
353
- return n;
354
- }
355
- /**
356
- * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
357
- * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
358
- * @hidden
359
- */
360
- function isOnePointZero(n) {
361
- return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
362
- }
363
- /**
364
- * Check to see if string passed in is a percentage
365
- * @hidden
366
- */
367
- function isPercentage(n) {
368
- return typeof n === 'string' && n.indexOf('%') !== -1;
369
- }
370
- /**
371
- * Return a valid alpha value [0,1] with all invalid values being set to 1
372
- * @hidden
373
- */
374
- function boundAlpha(a) {
375
- a = parseFloat(a);
376
- if (isNaN(a) || a < 0 || a > 1) {
377
- a = 1;
378
- }
379
- return a;
380
- }
381
- /**
382
- * Replace a decimal with it's percentage value
383
- * @hidden
384
- */
385
- function convertToPercentage(n) {
386
- if (n <= 1) {
387
- return "".concat(Number(n) * 100, "%");
388
- }
389
- return n;
390
- }
391
- /**
392
- * Force a hex value to have 2 characters
393
- * @hidden
328
+ * Support format, alpha unit will check the % mark:
329
+ * - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
330
+ * - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
331
+ * - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
332
+ * - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
333
+ * - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
334
+ *
335
+ * When `base` is provided, the percentage value will be divided by `base`.
394
336
  */
395
- function pad2(c) {
396
- return c.length === 1 ? '0' + c : String(c);
337
+ function splitColorStr(str, parseNum) {
338
+ const match = str
339
+ // Remove str before `(`
340
+ .replace(/^[^(]*\((.*)/, '$1')
341
+ // Remove str after `)`
342
+ .replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
343
+ const numList = match.map(item => parseFloat(item));
344
+ for (let i = 0; i < 3; i += 1) {
345
+ numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
346
+ }
347
+
348
+ // For alpha. 50% should be 0.5
349
+ if (match[3]) {
350
+ numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
351
+ } else {
352
+ // By default, alpha is 1
353
+ numList[3] = 1;
354
+ }
355
+ return numList;
397
356
  }
357
+ const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
398
358
 
399
- // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
400
- // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
401
- /**
402
- * Handle bounds / percentage checking to conform to CSS color spec
403
- * <http://www.w3.org/TR/css3-color/>
404
- * *Assumes:* r, g, b in [0, 255] or [0, 1]
405
- * *Returns:* { r, g, b } in [0, 255]
406
- */
407
- function rgbToRgb(r, g, b) {
408
- return {
409
- r: bound01(r, 255) * 255,
410
- g: bound01(g, 255) * 255,
411
- b: bound01(b, 255) * 255,
412
- };
359
+ /** round and limit number to integer between 0-255 */
360
+ function limitRange(value, max) {
361
+ const mergedMax = max || 255;
362
+ if (value > mergedMax) {
363
+ return mergedMax;
364
+ }
365
+ if (value < 0) {
366
+ return 0;
367
+ }
368
+ return value;
413
369
  }
414
- function hue2rgb(p, q, t) {
415
- if (t < 0) {
416
- t += 1;
370
+ class FastColor {
371
+ constructor(input) {
372
+ /**
373
+ * All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
374
+ */
375
+ _defineProperty(this, "isValid", true);
376
+ /**
377
+ * Red, R in RGB
378
+ */
379
+ _defineProperty(this, "r", 0);
380
+ /**
381
+ * Green, G in RGB
382
+ */
383
+ _defineProperty(this, "g", 0);
384
+ /**
385
+ * Blue, B in RGB
386
+ */
387
+ _defineProperty(this, "b", 0);
388
+ /**
389
+ * Alpha/Opacity, A in RGBA/HSLA
390
+ */
391
+ _defineProperty(this, "a", 1);
392
+ // HSV privates
393
+ _defineProperty(this, "_h", void 0);
394
+ _defineProperty(this, "_s", void 0);
395
+ _defineProperty(this, "_l", void 0);
396
+ _defineProperty(this, "_v", void 0);
397
+ // intermediate variables to calculate HSL/HSV
398
+ _defineProperty(this, "_max", void 0);
399
+ _defineProperty(this, "_min", void 0);
400
+ _defineProperty(this, "_brightness", void 0);
401
+ /**
402
+ * Always check 3 char in the object to determine the format.
403
+ * We not use function in check to save bundle size.
404
+ * e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
405
+ */
406
+ function matchFormat(str) {
407
+ return str[0] in input && str[1] in input && str[2] in input;
417
408
  }
418
- if (t > 1) {
419
- t -= 1;
409
+ if (!input) ; else if (typeof input === 'string') {
410
+ const trimStr = input.trim();
411
+ function matchPrefix(prefix) {
412
+ return trimStr.startsWith(prefix);
413
+ }
414
+ if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
415
+ this.fromHexString(trimStr);
416
+ } else if (matchPrefix('rgb')) {
417
+ this.fromRgbString(trimStr);
418
+ } else if (matchPrefix('hsl')) {
419
+ this.fromHslString(trimStr);
420
+ } else if (matchPrefix('hsv') || matchPrefix('hsb')) {
421
+ this.fromHsvString(trimStr);
422
+ }
423
+ } else if (input instanceof FastColor) {
424
+ this.r = input.r;
425
+ this.g = input.g;
426
+ this.b = input.b;
427
+ this.a = input.a;
428
+ this._h = input._h;
429
+ this._s = input._s;
430
+ this._l = input._l;
431
+ this._v = input._v;
432
+ } else if (matchFormat('rgb')) {
433
+ this.r = limitRange(input.r);
434
+ this.g = limitRange(input.g);
435
+ this.b = limitRange(input.b);
436
+ this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
437
+ } else if (matchFormat('hsl')) {
438
+ this.fromHsl(input);
439
+ } else if (matchFormat('hsv')) {
440
+ this.fromHsv(input);
441
+ } else {
442
+ throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
420
443
  }
421
- if (t < 1 / 6) {
422
- return p + (q - p) * (6 * t);
444
+ }
445
+
446
+ // ======================= Setter =======================
447
+
448
+ setR(value) {
449
+ return this._sc('r', value);
450
+ }
451
+ setG(value) {
452
+ return this._sc('g', value);
453
+ }
454
+ setB(value) {
455
+ return this._sc('b', value);
456
+ }
457
+ setA(value) {
458
+ return this._sc('a', value, 1);
459
+ }
460
+ setHue(value) {
461
+ const hsv = this.toHsv();
462
+ hsv.h = value;
463
+ return this._c(hsv);
464
+ }
465
+
466
+ // ======================= Getter =======================
467
+ /**
468
+ * Returns the perceived luminance of a color, from 0-1.
469
+ * @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
470
+ */
471
+ getLuminance() {
472
+ function adjustGamma(raw) {
473
+ const val = raw / 255;
474
+ return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
423
475
  }
424
- if (t < 1 / 2) {
425
- return q;
476
+ const R = adjustGamma(this.r);
477
+ const G = adjustGamma(this.g);
478
+ const B = adjustGamma(this.b);
479
+ return 0.2126 * R + 0.7152 * G + 0.0722 * B;
480
+ }
481
+ getHue() {
482
+ if (typeof this._h === 'undefined') {
483
+ const delta = this.getMax() - this.getMin();
484
+ if (delta === 0) {
485
+ this._h = 0;
486
+ } else {
487
+ this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
488
+ }
426
489
  }
427
- if (t < 2 / 3) {
428
- return p + (q - p) * (2 / 3 - t) * 6;
490
+ return this._h;
491
+ }
492
+ getSaturation() {
493
+ if (typeof this._s === 'undefined') {
494
+ const delta = this.getMax() - this.getMin();
495
+ if (delta === 0) {
496
+ this._s = 0;
497
+ } else {
498
+ this._s = delta / this.getMax();
499
+ }
429
500
  }
430
- return p;
431
- }
432
- /**
433
- * Converts an HSL color value to RGB.
434
- *
435
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
436
- * *Returns:* { r, g, b } in the set [0, 255]
437
- */
438
- function hslToRgb(h, s, l) {
439
- var r;
440
- var g;
441
- var b;
442
- h = bound01(h, 360);
443
- s = bound01(s, 100);
444
- l = bound01(l, 100);
445
- if (s === 0) {
446
- // achromatic
447
- g = l;
448
- b = l;
449
- r = l;
501
+ return this._s;
502
+ }
503
+ getLightness() {
504
+ if (typeof this._l === 'undefined') {
505
+ this._l = (this.getMax() + this.getMin()) / 510;
450
506
  }
451
- else {
452
- var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
453
- var p = 2 * l - q;
454
- r = hue2rgb(p, q, h + 1 / 3);
455
- g = hue2rgb(p, q, h);
456
- b = hue2rgb(p, q, h - 1 / 3);
507
+ return this._l;
508
+ }
509
+ getValue() {
510
+ if (typeof this._v === 'undefined') {
511
+ this._v = this.getMax() / 255;
457
512
  }
458
- return { r: r * 255, g: g * 255, b: b * 255 };
459
- }
460
- /**
461
- * Converts an RGB color value to HSV
462
- *
463
- * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
464
- * *Returns:* { h, s, v } in [0,1]
465
- */
466
- function rgbToHsv(r, g, b) {
467
- r = bound01(r, 255);
468
- g = bound01(g, 255);
469
- b = bound01(b, 255);
470
- var max = Math.max(r, g, b);
471
- var min = Math.min(r, g, b);
472
- var h = 0;
473
- var v = max;
474
- var d = max - min;
475
- var s = max === 0 ? 0 : d / max;
476
- if (max === min) {
477
- h = 0; // achromatic
513
+ return this._v;
514
+ }
515
+
516
+ /**
517
+ * Returns the perceived brightness of the color, from 0-255.
518
+ * Note: this is not the b of HSB
519
+ * @see http://www.w3.org/TR/AERT#color-contrast
520
+ */
521
+ getBrightness() {
522
+ if (typeof this._brightness === 'undefined') {
523
+ this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
478
524
  }
479
- else {
480
- switch (max) {
481
- case r:
482
- h = (g - b) / d + (g < b ? 6 : 0);
483
- break;
484
- case g:
485
- h = (b - r) / d + 2;
486
- break;
487
- case b:
488
- h = (r - g) / d + 4;
489
- break;
490
- }
491
- h /= 6;
525
+ return this._brightness;
526
+ }
527
+
528
+ // ======================== Func ========================
529
+
530
+ darken(amount = 10) {
531
+ const h = this.getHue();
532
+ const s = this.getSaturation();
533
+ let l = this.getLightness() - amount / 100;
534
+ if (l < 0) {
535
+ l = 0;
492
536
  }
493
- return { h: h, s: s, v: v };
494
- }
495
- /**
496
- * Converts an HSV color value to RGB.
497
- *
498
- * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
499
- * *Returns:* { r, g, b } in the set [0, 255]
500
- */
501
- function hsvToRgb(h, s, v) {
502
- h = bound01(h, 360) * 6;
503
- s = bound01(s, 100);
504
- v = bound01(v, 100);
505
- var i = Math.floor(h);
506
- var f = h - i;
507
- var p = v * (1 - s);
508
- var q = v * (1 - f * s);
509
- var t = v * (1 - (1 - f) * s);
510
- var mod = i % 6;
511
- var r = [v, q, p, p, t, v][mod];
512
- var g = [t, v, v, q, p, p][mod];
513
- var b = [p, p, t, v, v, q][mod];
514
- return { r: r * 255, g: g * 255, b: b * 255 };
515
- }
516
- /**
517
- * Converts an RGB color to hex
518
- *
519
- * Assumes r, g, and b are contained in the set [0, 255]
520
- * Returns a 3 or 6 character hex
521
- */
522
- function rgbToHex(r, g, b, allow3Char) {
523
- var hex = [
524
- pad2(Math.round(r).toString(16)),
525
- pad2(Math.round(g).toString(16)),
526
- pad2(Math.round(b).toString(16)),
527
- ];
528
- // Return a 3 character hex if possible
529
- if (allow3Char &&
530
- hex[0].startsWith(hex[0].charAt(1)) &&
531
- hex[1].startsWith(hex[1].charAt(1)) &&
532
- hex[2].startsWith(hex[2].charAt(1))) {
533
- return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
537
+ return this._c({
538
+ h,
539
+ s,
540
+ l,
541
+ a: this.a
542
+ });
543
+ }
544
+ lighten(amount = 10) {
545
+ const h = this.getHue();
546
+ const s = this.getSaturation();
547
+ let l = this.getLightness() + amount / 100;
548
+ if (l > 1) {
549
+ l = 1;
534
550
  }
535
- return hex.join('');
536
- }
537
- /** Converts a hex value to a decimal */
538
- function convertHexToDecimal(h) {
539
- return parseIntFromHex(h) / 255;
540
- }
541
- /** Parse a base-16 hex value into a base-10 integer */
542
- function parseIntFromHex(val) {
543
- return parseInt(val, 16);
544
- }
551
+ return this._c({
552
+ h,
553
+ s,
554
+ l,
555
+ a: this.a
556
+ });
557
+ }
545
558
 
546
- // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
547
- /**
548
- * @hidden
549
- */
550
- var names = {
551
- aliceblue: '#f0f8ff',
552
- antiquewhite: '#faebd7',
553
- aqua: '#00ffff',
554
- aquamarine: '#7fffd4',
555
- azure: '#f0ffff',
556
- beige: '#f5f5dc',
557
- bisque: '#ffe4c4',
558
- black: '#000000',
559
- blanchedalmond: '#ffebcd',
560
- blue: '#0000ff',
561
- blueviolet: '#8a2be2',
562
- brown: '#a52a2a',
563
- burlywood: '#deb887',
564
- cadetblue: '#5f9ea0',
565
- chartreuse: '#7fff00',
566
- chocolate: '#d2691e',
567
- coral: '#ff7f50',
568
- cornflowerblue: '#6495ed',
569
- cornsilk: '#fff8dc',
570
- crimson: '#dc143c',
571
- cyan: '#00ffff',
572
- darkblue: '#00008b',
573
- darkcyan: '#008b8b',
574
- darkgoldenrod: '#b8860b',
575
- darkgray: '#a9a9a9',
576
- darkgreen: '#006400',
577
- darkgrey: '#a9a9a9',
578
- darkkhaki: '#bdb76b',
579
- darkmagenta: '#8b008b',
580
- darkolivegreen: '#556b2f',
581
- darkorange: '#ff8c00',
582
- darkorchid: '#9932cc',
583
- darkred: '#8b0000',
584
- darksalmon: '#e9967a',
585
- darkseagreen: '#8fbc8f',
586
- darkslateblue: '#483d8b',
587
- darkslategray: '#2f4f4f',
588
- darkslategrey: '#2f4f4f',
589
- darkturquoise: '#00ced1',
590
- darkviolet: '#9400d3',
591
- deeppink: '#ff1493',
592
- deepskyblue: '#00bfff',
593
- dimgray: '#696969',
594
- dimgrey: '#696969',
595
- dodgerblue: '#1e90ff',
596
- firebrick: '#b22222',
597
- floralwhite: '#fffaf0',
598
- forestgreen: '#228b22',
599
- fuchsia: '#ff00ff',
600
- gainsboro: '#dcdcdc',
601
- ghostwhite: '#f8f8ff',
602
- goldenrod: '#daa520',
603
- gold: '#ffd700',
604
- gray: '#808080',
605
- green: '#008000',
606
- greenyellow: '#adff2f',
607
- grey: '#808080',
608
- honeydew: '#f0fff0',
609
- hotpink: '#ff69b4',
610
- indianred: '#cd5c5c',
611
- indigo: '#4b0082',
612
- ivory: '#fffff0',
613
- khaki: '#f0e68c',
614
- lavenderblush: '#fff0f5',
615
- lavender: '#e6e6fa',
616
- lawngreen: '#7cfc00',
617
- lemonchiffon: '#fffacd',
618
- lightblue: '#add8e6',
619
- lightcoral: '#f08080',
620
- lightcyan: '#e0ffff',
621
- lightgoldenrodyellow: '#fafad2',
622
- lightgray: '#d3d3d3',
623
- lightgreen: '#90ee90',
624
- lightgrey: '#d3d3d3',
625
- lightpink: '#ffb6c1',
626
- lightsalmon: '#ffa07a',
627
- lightseagreen: '#20b2aa',
628
- lightskyblue: '#87cefa',
629
- lightslategray: '#778899',
630
- lightslategrey: '#778899',
631
- lightsteelblue: '#b0c4de',
632
- lightyellow: '#ffffe0',
633
- lime: '#00ff00',
634
- limegreen: '#32cd32',
635
- linen: '#faf0e6',
636
- magenta: '#ff00ff',
637
- maroon: '#800000',
638
- mediumaquamarine: '#66cdaa',
639
- mediumblue: '#0000cd',
640
- mediumorchid: '#ba55d3',
641
- mediumpurple: '#9370db',
642
- mediumseagreen: '#3cb371',
643
- mediumslateblue: '#7b68ee',
644
- mediumspringgreen: '#00fa9a',
645
- mediumturquoise: '#48d1cc',
646
- mediumvioletred: '#c71585',
647
- midnightblue: '#191970',
648
- mintcream: '#f5fffa',
649
- mistyrose: '#ffe4e1',
650
- moccasin: '#ffe4b5',
651
- navajowhite: '#ffdead',
652
- navy: '#000080',
653
- oldlace: '#fdf5e6',
654
- olive: '#808000',
655
- olivedrab: '#6b8e23',
656
- orange: '#ffa500',
657
- orangered: '#ff4500',
658
- orchid: '#da70d6',
659
- palegoldenrod: '#eee8aa',
660
- palegreen: '#98fb98',
661
- paleturquoise: '#afeeee',
662
- palevioletred: '#db7093',
663
- papayawhip: '#ffefd5',
664
- peachpuff: '#ffdab9',
665
- peru: '#cd853f',
666
- pink: '#ffc0cb',
667
- plum: '#dda0dd',
668
- powderblue: '#b0e0e6',
669
- purple: '#800080',
670
- rebeccapurple: '#663399',
671
- red: '#ff0000',
672
- rosybrown: '#bc8f8f',
673
- royalblue: '#4169e1',
674
- saddlebrown: '#8b4513',
675
- salmon: '#fa8072',
676
- sandybrown: '#f4a460',
677
- seagreen: '#2e8b57',
678
- seashell: '#fff5ee',
679
- sienna: '#a0522d',
680
- silver: '#c0c0c0',
681
- skyblue: '#87ceeb',
682
- slateblue: '#6a5acd',
683
- slategray: '#708090',
684
- slategrey: '#708090',
685
- snow: '#fffafa',
686
- springgreen: '#00ff7f',
687
- steelblue: '#4682b4',
688
- tan: '#d2b48c',
689
- teal: '#008080',
690
- thistle: '#d8bfd8',
691
- tomato: '#ff6347',
692
- turquoise: '#40e0d0',
693
- violet: '#ee82ee',
694
- wheat: '#f5deb3',
695
- white: '#ffffff',
696
- whitesmoke: '#f5f5f5',
697
- yellow: '#ffff00',
698
- yellowgreen: '#9acd32',
699
- };
700
-
701
- /* eslint-disable @typescript-eslint/no-redundant-type-constituents */
702
- /**
703
- * Given a string or object, convert that input to RGB
704
- *
705
- * Possible string inputs:
706
- * ```
707
- * "red"
708
- * "#f00" or "f00"
709
- * "#ff0000" or "ff0000"
710
- * "#ff000000" or "ff000000"
711
- * "rgb 255 0 0" or "rgb (255, 0, 0)"
712
- * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
713
- * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
714
- * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
715
- * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
716
- * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
717
- * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
718
- * ```
719
- */
720
- function inputToRGB(color) {
721
- var rgb = { r: 0, g: 0, b: 0 };
722
- var a = 1;
723
- var s = null;
724
- var v = null;
725
- var l = null;
726
- var ok = false;
727
- var format = false;
728
- if (typeof color === 'string') {
729
- color = stringInputToObject(color);
730
- }
731
- if (typeof color === 'object') {
732
- if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
733
- rgb = rgbToRgb(color.r, color.g, color.b);
734
- ok = true;
735
- format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
736
- }
737
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
738
- s = convertToPercentage(color.s);
739
- v = convertToPercentage(color.v);
740
- rgb = hsvToRgb(color.h, s, v);
741
- ok = true;
742
- format = 'hsv';
743
- }
744
- else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
745
- s = convertToPercentage(color.s);
746
- l = convertToPercentage(color.l);
747
- rgb = hslToRgb(color.h, s, l);
748
- ok = true;
749
- format = 'hsl';
750
- }
751
- if (Object.prototype.hasOwnProperty.call(color, 'a')) {
752
- a = color.a;
753
- }
559
+ /**
560
+ * Mix the current color a given amount with another color, from 0 to 100.
561
+ * 0 means no mixing (return current color).
562
+ */
563
+ mix(input, amount = 50) {
564
+ const color = this._c(input);
565
+ const p = amount / 100;
566
+ const calc = key => (color[key] - this[key]) * p + this[key];
567
+ const rgba = {
568
+ r: round(calc('r')),
569
+ g: round(calc('g')),
570
+ b: round(calc('b')),
571
+ a: round(calc('a') * 100) / 100
572
+ };
573
+ return this._c(rgba);
574
+ }
575
+
576
+ /**
577
+ * Mix the color with pure white, from 0 to 100.
578
+ * Providing 0 will do nothing, providing 100 will always return white.
579
+ */
580
+ tint(amount = 10) {
581
+ return this.mix({
582
+ r: 255,
583
+ g: 255,
584
+ b: 255,
585
+ a: 1
586
+ }, amount);
587
+ }
588
+
589
+ /**
590
+ * Mix the color with pure black, from 0 to 100.
591
+ * Providing 0 will do nothing, providing 100 will always return black.
592
+ */
593
+ shade(amount = 10) {
594
+ return this.mix({
595
+ r: 0,
596
+ g: 0,
597
+ b: 0,
598
+ a: 1
599
+ }, amount);
600
+ }
601
+ onBackground(background) {
602
+ const bg = this._c(background);
603
+ const alpha = this.a + bg.a * (1 - this.a);
604
+ const calc = key => {
605
+ return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
606
+ };
607
+ return this._c({
608
+ r: calc('r'),
609
+ g: calc('g'),
610
+ b: calc('b'),
611
+ a: alpha
612
+ });
613
+ }
614
+
615
+ // ======================= Status =======================
616
+ isDark() {
617
+ return this.getBrightness() < 128;
618
+ }
619
+ isLight() {
620
+ return this.getBrightness() >= 128;
621
+ }
622
+
623
+ // ======================== MISC ========================
624
+ equals(other) {
625
+ return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
626
+ }
627
+ clone() {
628
+ return this._c(this);
629
+ }
630
+
631
+ // ======================= Format =======================
632
+ toHexString() {
633
+ let hex = '#';
634
+ const rHex = (this.r || 0).toString(16);
635
+ hex += rHex.length === 2 ? rHex : '0' + rHex;
636
+ const gHex = (this.g || 0).toString(16);
637
+ hex += gHex.length === 2 ? gHex : '0' + gHex;
638
+ const bHex = (this.b || 0).toString(16);
639
+ hex += bHex.length === 2 ? bHex : '0' + bHex;
640
+ if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
641
+ const aHex = round(this.a * 255).toString(16);
642
+ hex += aHex.length === 2 ? aHex : '0' + aHex;
754
643
  }
755
- a = boundAlpha(a);
644
+ return hex;
645
+ }
646
+
647
+ /** CSS support color pattern */
648
+ toHsl() {
756
649
  return {
757
- ok: ok,
758
- format: color.format || format,
759
- r: Math.min(255, Math.max(rgb.r, 0)),
760
- g: Math.min(255, Math.max(rgb.g, 0)),
761
- b: Math.min(255, Math.max(rgb.b, 0)),
762
- a: a,
650
+ h: this.getHue(),
651
+ s: this.getSaturation(),
652
+ l: this.getLightness(),
653
+ a: this.a
763
654
  };
764
- }
765
- // <http://www.w3.org/TR/css3-values/#integers>
766
- var CSS_INTEGER = '[-\\+]?\\d+%?';
767
- // <http://www.w3.org/TR/css3-values/#number-value>
768
- var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
769
- // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
770
- var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
771
- // Actual matching.
772
- // Parentheses and commas are optional, but not required.
773
- // Whitespace can take the place of commas or opening paren
774
- var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
775
- var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
776
- var matchers = {
777
- CSS_UNIT: new RegExp(CSS_UNIT),
778
- rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
779
- rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
780
- hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
781
- hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
782
- hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
783
- hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
784
- hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
785
- hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
786
- hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
787
- hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
788
- };
789
- /**
790
- * Permissive string parsing. Take in a number of formats, and output an object
791
- * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
792
- */
793
- function stringInputToObject(color) {
794
- color = color.trim().toLowerCase();
795
- if (color.length === 0) {
796
- return false;
797
- }
798
- var named = false;
799
- if (names[color]) {
800
- color = names[color];
801
- named = true;
802
- }
803
- else if (color === 'transparent') {
804
- return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
805
- }
806
- // Try to match string input using regular expressions.
807
- // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
808
- // Just return an object and let the conversion functions handle that.
809
- // This way the result will be the same whether the tinycolor is initialized with string or object.
810
- var match = matchers.rgb.exec(color);
811
- if (match) {
812
- return { r: match[1], g: match[2], b: match[3] };
813
- }
814
- match = matchers.rgba.exec(color);
815
- if (match) {
816
- return { r: match[1], g: match[2], b: match[3], a: match[4] };
817
- }
818
- match = matchers.hsl.exec(color);
819
- if (match) {
820
- return { h: match[1], s: match[2], l: match[3] };
655
+ }
656
+
657
+ /** CSS support color pattern */
658
+ toHslString() {
659
+ const h = this.getHue();
660
+ const s = round(this.getSaturation() * 100);
661
+ const l = round(this.getLightness() * 100);
662
+ return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
663
+ }
664
+
665
+ /** Same as toHsb */
666
+ toHsv() {
667
+ return {
668
+ h: this.getHue(),
669
+ s: this.getSaturation(),
670
+ v: this.getValue(),
671
+ a: this.a
672
+ };
673
+ }
674
+ toRgb() {
675
+ return {
676
+ r: this.r,
677
+ g: this.g,
678
+ b: this.b,
679
+ a: this.a
680
+ };
681
+ }
682
+ toRgbString() {
683
+ return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
684
+ }
685
+ toString() {
686
+ return this.toRgbString();
687
+ }
688
+
689
+ // ====================== Privates ======================
690
+ /** Return a new FastColor object with one channel changed */
691
+ _sc(rgb, value, max) {
692
+ const clone = this.clone();
693
+ clone[rgb] = limitRange(value, max);
694
+ return clone;
695
+ }
696
+ _c(input) {
697
+ return new this.constructor(input);
698
+ }
699
+ getMax() {
700
+ if (typeof this._max === 'undefined') {
701
+ this._max = Math.max(this.r, this.g, this.b);
821
702
  }
822
- match = matchers.hsla.exec(color);
823
- if (match) {
824
- return { h: match[1], s: match[2], l: match[3], a: match[4] };
703
+ return this._max;
704
+ }
705
+ getMin() {
706
+ if (typeof this._min === 'undefined') {
707
+ this._min = Math.min(this.r, this.g, this.b);
825
708
  }
826
- match = matchers.hsv.exec(color);
827
- if (match) {
828
- return { h: match[1], s: match[2], v: match[3] };
709
+ return this._min;
710
+ }
711
+ fromHexString(trimStr) {
712
+ const withoutPrefix = trimStr.replace('#', '');
713
+ function connectNum(index1, index2) {
714
+ return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
829
715
  }
830
- match = matchers.hsva.exec(color);
831
- if (match) {
832
- return { h: match[1], s: match[2], v: match[3], a: match[4] };
716
+ if (withoutPrefix.length < 6) {
717
+ // #rgb or #rgba
718
+ this.r = connectNum(0);
719
+ this.g = connectNum(1);
720
+ this.b = connectNum(2);
721
+ this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
722
+ } else {
723
+ // #rrggbb or #rrggbbaa
724
+ this.r = connectNum(0, 1);
725
+ this.g = connectNum(2, 3);
726
+ this.b = connectNum(4, 5);
727
+ this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
833
728
  }
834
- match = matchers.hex8.exec(color);
835
- if (match) {
836
- return {
837
- r: parseIntFromHex(match[1]),
838
- g: parseIntFromHex(match[2]),
839
- b: parseIntFromHex(match[3]),
840
- a: convertHexToDecimal(match[4]),
841
- format: named ? 'name' : 'hex8',
842
- };
729
+ }
730
+ fromHsl({
731
+ h,
732
+ s,
733
+ l,
734
+ a
735
+ }) {
736
+ this._h = h % 360;
737
+ this._s = s;
738
+ this._l = l;
739
+ this.a = typeof a === 'number' ? a : 1;
740
+ if (s <= 0) {
741
+ const rgb = round(l * 255);
742
+ this.r = rgb;
743
+ this.g = rgb;
744
+ this.b = rgb;
843
745
  }
844
- match = matchers.hex6.exec(color);
845
- if (match) {
846
- return {
847
- r: parseIntFromHex(match[1]),
848
- g: parseIntFromHex(match[2]),
849
- b: parseIntFromHex(match[3]),
850
- format: named ? 'name' : 'hex',
851
- };
746
+ let r = 0,
747
+ g = 0,
748
+ b = 0;
749
+ const huePrime = h / 60;
750
+ const chroma = (1 - Math.abs(2 * l - 1)) * s;
751
+ const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
752
+ if (huePrime >= 0 && huePrime < 1) {
753
+ r = chroma;
754
+ g = secondComponent;
755
+ } else if (huePrime >= 1 && huePrime < 2) {
756
+ r = secondComponent;
757
+ g = chroma;
758
+ } else if (huePrime >= 2 && huePrime < 3) {
759
+ g = chroma;
760
+ b = secondComponent;
761
+ } else if (huePrime >= 3 && huePrime < 4) {
762
+ g = secondComponent;
763
+ b = chroma;
764
+ } else if (huePrime >= 4 && huePrime < 5) {
765
+ r = secondComponent;
766
+ b = chroma;
767
+ } else if (huePrime >= 5 && huePrime < 6) {
768
+ r = chroma;
769
+ b = secondComponent;
852
770
  }
853
- match = matchers.hex4.exec(color);
854
- if (match) {
855
- return {
856
- r: parseIntFromHex(match[1] + match[1]),
857
- g: parseIntFromHex(match[2] + match[2]),
858
- b: parseIntFromHex(match[3] + match[3]),
859
- a: convertHexToDecimal(match[4] + match[4]),
860
- format: named ? 'name' : 'hex8',
861
- };
771
+ const lightnessModification = l - chroma / 2;
772
+ this.r = round((r + lightnessModification) * 255);
773
+ this.g = round((g + lightnessModification) * 255);
774
+ this.b = round((b + lightnessModification) * 255);
775
+ }
776
+ fromHsv({
777
+ h,
778
+ s,
779
+ v,
780
+ a
781
+ }) {
782
+ this._h = h % 360;
783
+ this._s = s;
784
+ this._v = v;
785
+ this.a = typeof a === 'number' ? a : 1;
786
+ const vv = round(v * 255);
787
+ this.r = vv;
788
+ this.g = vv;
789
+ this.b = vv;
790
+ if (s <= 0) {
791
+ return;
862
792
  }
863
- match = matchers.hex3.exec(color);
864
- if (match) {
865
- return {
866
- r: parseIntFromHex(match[1] + match[1]),
867
- g: parseIntFromHex(match[2] + match[2]),
868
- b: parseIntFromHex(match[3] + match[3]),
869
- format: named ? 'name' : 'hex',
870
- };
793
+ const hh = h / 60;
794
+ const i = Math.floor(hh);
795
+ const ff = hh - i;
796
+ const p = round(v * (1.0 - s) * 255);
797
+ const q = round(v * (1.0 - s * ff) * 255);
798
+ const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
799
+ switch (i) {
800
+ case 0:
801
+ this.g = t;
802
+ this.b = p;
803
+ break;
804
+ case 1:
805
+ this.r = q;
806
+ this.b = p;
807
+ break;
808
+ case 2:
809
+ this.r = p;
810
+ this.b = t;
811
+ break;
812
+ case 3:
813
+ this.r = p;
814
+ this.g = q;
815
+ break;
816
+ case 4:
817
+ this.r = t;
818
+ this.g = p;
819
+ break;
820
+ case 5:
821
+ default:
822
+ this.g = p;
823
+ this.b = q;
824
+ break;
871
825
  }
872
- return false;
873
- }
874
- /**
875
- * Check to see if it looks like a CSS unit
876
- * (see `matchers` above for definition).
877
- */
878
- function isValidCSSUnit(color) {
879
- return Boolean(matchers.CSS_UNIT.exec(String(color)));
826
+ }
827
+ fromHsvString(trimStr) {
828
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
829
+ this.fromHsv({
830
+ h: cells[0],
831
+ s: cells[1],
832
+ v: cells[2],
833
+ a: cells[3]
834
+ });
835
+ }
836
+ fromHslString(trimStr) {
837
+ const cells = splitColorStr(trimStr, parseHSVorHSL);
838
+ this.fromHsl({
839
+ h: cells[0],
840
+ s: cells[1],
841
+ l: cells[2],
842
+ a: cells[3]
843
+ });
844
+ }
845
+ fromRgbString(trimStr) {
846
+ const cells = splitColorStr(trimStr, (num, txt) =>
847
+ // Convert percentage to number. e.g. 50% -> 128
848
+ txt.includes('%') ? round(num / 100 * 255) : num);
849
+ this.r = cells[0];
850
+ this.g = cells[1];
851
+ this.b = cells[2];
852
+ this.a = cells[3];
853
+ }
880
854
  }
881
855
 
882
856
  var hueStep = 2; // 色相阶梯
@@ -886,73 +860,39 @@ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
886
860
  var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
887
861
  var lightColorCount = 5; // 浅色数量,主色上
888
862
  var darkColorCount = 4; // 深色数量,主色下
863
+
889
864
  // 暗色主题颜色映射关系表
890
865
  var darkColorMap = [{
891
866
  index: 7,
892
- opacity: 0.15
867
+ amount: 15
893
868
  }, {
894
869
  index: 6,
895
- opacity: 0.25
870
+ amount: 25
896
871
  }, {
897
872
  index: 5,
898
- opacity: 0.3
873
+ amount: 30
899
874
  }, {
900
875
  index: 5,
901
- opacity: 0.45
876
+ amount: 45
902
877
  }, {
903
878
  index: 5,
904
- opacity: 0.65
879
+ amount: 65
905
880
  }, {
906
881
  index: 5,
907
- opacity: 0.85
882
+ amount: 85
908
883
  }, {
909
884
  index: 4,
910
- opacity: 0.9
885
+ amount: 90
911
886
  }, {
912
887
  index: 3,
913
- opacity: 0.95
888
+ amount: 95
914
889
  }, {
915
890
  index: 2,
916
- opacity: 0.97
891
+ amount: 97
917
892
  }, {
918
893
  index: 1,
919
- opacity: 0.98
894
+ amount: 98
920
895
  }];
921
- // Wrapper function ported from TinyColor.prototype.toHsv
922
- // Keep it here because of `hsv.h * 360`
923
- function toHsv(_ref) {
924
- var r = _ref.r,
925
- g = _ref.g,
926
- b = _ref.b;
927
- var hsv = rgbToHsv(r, g, b);
928
- return {
929
- h: hsv.h * 360,
930
- s: hsv.s,
931
- v: hsv.v
932
- };
933
- }
934
-
935
- // Wrapper function ported from TinyColor.prototype.toHexString
936
- // Keep it here because of the prefix `#`
937
- function toHex(_ref2) {
938
- var r = _ref2.r,
939
- g = _ref2.g,
940
- b = _ref2.b;
941
- return "#".concat(rgbToHex(r, g, b, false));
942
- }
943
-
944
- // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
945
- // Amount in range [0, 1]
946
- // Assume color1 & color2 has no alpha, since the following src code did so.
947
- function mix(rgb1, rgb2, amount) {
948
- var p = amount / 100;
949
- var rgb = {
950
- r: (rgb2.r - rgb1.r) * p + rgb1.r,
951
- g: (rgb2.g - rgb1.g) * p + rgb1.g,
952
- b: (rgb2.b - rgb1.b) * p + rgb1.b
953
- };
954
- return rgb;
955
- }
956
896
  function getHue(hsv, i, light) {
957
897
  var hue;
958
898
  // 根据色相不同,色相转向不同
@@ -992,7 +932,7 @@ function getSaturation(hsv, i, light) {
992
932
  if (saturation < 0.06) {
993
933
  saturation = 0.06;
994
934
  }
995
- return Number(saturation.toFixed(2));
935
+ return Math.round(saturation * 100) / 100;
996
936
  }
997
937
  function getValue(hsv, i, light) {
998
938
  var value;
@@ -1001,45 +941,44 @@ function getValue(hsv, i, light) {
1001
941
  } else {
1002
942
  value = hsv.v - brightnessStep2 * i;
1003
943
  }
1004
- if (value > 1) {
1005
- value = 1;
1006
- }
1007
- return Number(value.toFixed(2));
944
+ // Clamp value between 0 and 1
945
+ value = Math.max(0, Math.min(1, value));
946
+ return Math.round(value * 100) / 100;
1008
947
  }
1009
948
  function generate$1(color) {
1010
949
  var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1011
950
  var patterns = [];
1012
- var pColor = inputToRGB(color);
951
+ var pColor = new FastColor(color);
952
+ var hsv = pColor.toHsv();
1013
953
  for (var i = lightColorCount; i > 0; i -= 1) {
1014
- var hsv = toHsv(pColor);
1015
- var colorString = toHex(inputToRGB({
954
+ var c = new FastColor({
1016
955
  h: getHue(hsv, i, true),
1017
956
  s: getSaturation(hsv, i, true),
1018
957
  v: getValue(hsv, i, true)
1019
- }));
1020
- patterns.push(colorString);
958
+ });
959
+ patterns.push(c);
1021
960
  }
1022
- patterns.push(toHex(pColor));
961
+ patterns.push(pColor);
1023
962
  for (var _i = 1; _i <= darkColorCount; _i += 1) {
1024
- var _hsv = toHsv(pColor);
1025
- var _colorString = toHex(inputToRGB({
1026
- h: getHue(_hsv, _i),
1027
- s: getSaturation(_hsv, _i),
1028
- v: getValue(_hsv, _i)
1029
- }));
1030
- patterns.push(_colorString);
963
+ var _c = new FastColor({
964
+ h: getHue(hsv, _i),
965
+ s: getSaturation(hsv, _i),
966
+ v: getValue(hsv, _i)
967
+ });
968
+ patterns.push(_c);
1031
969
  }
1032
970
 
1033
971
  // dark theme patterns
1034
972
  if (opts.theme === 'dark') {
1035
- return darkColorMap.map(function (_ref3) {
1036
- var index = _ref3.index,
1037
- opacity = _ref3.opacity;
1038
- var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
1039
- return darkColorString;
973
+ return darkColorMap.map(function (_ref) {
974
+ var index = _ref.index,
975
+ amount = _ref.amount;
976
+ return new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
1040
977
  });
1041
978
  }
1042
- return patterns;
979
+ return patterns.map(function (c) {
980
+ return c.toHexString();
981
+ });
1043
982
  }
1044
983
 
1045
984
  // Generated by script. Do NOT modify!
@@ -1526,11 +1465,29 @@ var BankOutlined = function BankOutlined(props, ref) {
1526
1465
  };
1527
1466
 
1528
1467
  /**![bank](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTg5NCA0NjJjMzAuOSAwIDQzLjgtMzkuNyAxOC43LTU4TDUzMC44IDEyNi4yYTMxLjgxIDMxLjgxIDAgMDAtMzcuNiAwTDExMS4zIDQwNGMtMjUuMSAxOC4yLTEyLjIgNTggMTguOCA1OEgxOTJ2Mzc0aC03MmMtNC40IDAtOCAzLjYtOCA4djUyYzAgNC40IDMuNiA4IDggOGg3ODRjNC40IDAgOC0zLjYgOC04di01MmMwLTQuNC0zLjYtOC04LThoLTcyVjQ2Mmg2MnpNNTEyIDE5Ni43bDI3MS4xIDE5Ny4ySDI0MC45TDUxMiAxOTYuN3pNMjY0IDQ2MmgxMTd2Mzc0SDI2NFY0NjJ6bTE4OSAwaDExN3YzNzRINDUzVjQ2MnptMzA3IDM3NEg2NDJWNDYyaDExOHYzNzR6IiAvPjwvc3ZnPg==) */
1529
- var RefIcon$3 = /*#__PURE__*/React__namespace.forwardRef(BankOutlined);
1468
+ var RefIcon$4 = /*#__PURE__*/React__namespace.forwardRef(BankOutlined);
1469
+ if (process.env.NODE_ENV !== 'production') {
1470
+ RefIcon$4.displayName = 'BankOutlined';
1471
+ }
1472
+ var BankOutlined$1 = RefIcon$4;
1473
+
1474
+ // This icon file is generated automatically.
1475
+ var CheckCircleFilled$2 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm193.5 301.7l-210.6 292a31.8 31.8 0 01-51.7 0L318.5 484.9c-3.8-5.3 0-12.7 6.5-12.7h46.9c10.2 0 19.9 4.9 25.9 13.3l71.2 98.8 157.2-218c6-8.3 15.6-13.3 25.9-13.3H699c6.5 0 10.3 7.4 6.5 12.7z" } }] }, "name": "check-circle", "theme": "filled" };
1476
+ var CheckCircleFilledSvg = CheckCircleFilled$2;
1477
+
1478
+ var CheckCircleFilled = function CheckCircleFilled(props, ref) {
1479
+ return /*#__PURE__*/React__namespace.createElement(AntdIcon, _extends({}, props, {
1480
+ ref: ref,
1481
+ icon: CheckCircleFilledSvg
1482
+ }));
1483
+ };
1484
+
1485
+ /**![check-circle](data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTAiIGhlaWdodD0iNTAiIGZpbGw9IiNjYWNhY2EiIHZpZXdCb3g9IjY0IDY0IDg5NiA4OTYiIGZvY3VzYWJsZT0iZmFsc2UiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTUxMiA2NEMyNjQuNiA2NCA2NCAyNjQuNiA2NCA1MTJzMjAwLjYgNDQ4IDQ0OCA0NDggNDQ4LTIwMC42IDQ0OC00NDhTNzU5LjQgNjQgNTEyIDY0em0xOTMuNSAzMDEuN2wtMjEwLjYgMjkyYTMxLjggMzEuOCAwIDAxLTUxLjcgMEwzMTguNSA0ODQuOWMtMy44LTUuMyAwLTEyLjcgNi41LTEyLjdoNDYuOWMxMC4yIDAgMTkuOSA0LjkgMjUuOSAxMy4zbDcxLjIgOTguOCAxNTcuMi0yMThjNi04LjMgMTUuNi0xMy4zIDI1LjktMTMuM0g2OTljNi41IDAgMTAuMyA3LjQgNi41IDEyLjd6IiAvPjwvc3ZnPg==) */
1486
+ var RefIcon$3 = /*#__PURE__*/React__namespace.forwardRef(CheckCircleFilled);
1530
1487
  if (process.env.NODE_ENV !== 'production') {
1531
- RefIcon$3.displayName = 'BankOutlined';
1488
+ RefIcon$3.displayName = 'CheckCircleFilled';
1532
1489
  }
1533
- var BankOutlined$1 = RefIcon$3;
1490
+ var CheckCircleFilled$1 = RefIcon$3;
1534
1491
 
1535
1492
  // This icon file is generated automatically.
1536
1493
  var CloseOutlined$2 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M799.86 166.31c.02 0 .04.02.08.06l57.69 57.7c.04.03.05.05.06.08a.12.12 0 010 .06c0 .03-.02.05-.06.09L569.93 512l287.7 287.7c.04.04.05.06.06.09a.12.12 0 010 .07c0 .02-.02.04-.06.08l-57.7 57.69c-.03.04-.05.05-.07.06a.12.12 0 01-.07 0c-.03 0-.05-.02-.09-.06L512 569.93l-287.7 287.7c-.04.04-.06.05-.09.06a.12.12 0 01-.07 0c-.02 0-.04-.02-.08-.06l-57.69-57.7c-.04-.03-.05-.05-.06-.07a.12.12 0 010-.07c0-.03.02-.05.06-.09L454.07 512l-287.7-287.7c-.04-.04-.05-.06-.06-.09a.12.12 0 010-.07c0-.02.02-.04.06-.08l57.7-57.69c.03-.04.05-.05.07-.06a.12.12 0 01.07 0c.03 0 .05.02.09.06L512 454.07l287.7-287.7c.04-.04.06-.05.09-.06a.12.12 0 01.07 0z" } }] }, "name": "close", "theme": "outlined" };
@@ -1593,14 +1550,14 @@ var BrandContext = React.createContext({
1593
1550
  topNavImageUrl: common.DEFAULT_TOP_NAV_IMAGE_URL,
1594
1551
  });
1595
1552
 
1596
- var MUTATION$4 = "{\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }";
1553
+ var MUTATION$8 = "{\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }";
1597
1554
  var getBranding = function (_a) {
1598
1555
  var token = _a.token, subdomain = _a.subdomain;
1599
1556
  return __awaiter(void 0, void 0, void 0, function () {
1600
1557
  var response;
1601
1558
  return __generator(this, function (_b) {
1602
1559
  switch (_b.label) {
1603
- case 0: return [4 /*yield*/, common.gqlRequest({ query: MUTATION$4, token: token, subdomain: subdomain })];
1560
+ case 0: return [4 /*yield*/, common.gqlRequest({ query: MUTATION$8, token: token, subdomain: subdomain })];
1604
1561
  case 1:
1605
1562
  response = _b.sent();
1606
1563
  return [2 /*return*/, response === null || response === void 0 ? void 0 : response.entityBranding];
@@ -1678,10 +1635,10 @@ var BunnyContext = React.createContext({});
1678
1635
  var queryClient$1 = new reactQuery.QueryClient();
1679
1636
  // Every component shares similar props and functionality, which this wrapper handles.
1680
1637
  function BunnyProvider(_a) {
1681
- var children = _a.children, token = _a.token, subdomain = _a.subdomain, window = _a.window, accountId = _a.accountId;
1638
+ var children = _a.children, token = _a.token, subdomain = _a.subdomain, window = _a.window, accountId = _a.accountId, _b = _a.darkMode, darkMode = _b === void 0 ? false : _b;
1682
1639
  var graphQLClient = common.createGraphQLClient(subdomain || "", window, token);
1683
1640
  var isMobile = useIsMobile(window);
1684
- var _b = React.useState(undefined), branding = _b[0], setBranding = _b[1];
1641
+ var _c = React.useState(undefined), branding = _c[0], setBranding = _c[1];
1685
1642
  // ====== START - Copied straight from PageContainer.tsx ========
1686
1643
  var entityBranding = React.useMemo(function () {
1687
1644
  var _a;
@@ -1711,16 +1668,36 @@ function BunnyProvider(_a) {
1711
1668
  document.getElementsByTagName("head")[0].removeChild(script);
1712
1669
  };
1713
1670
  }, []);
1714
- return (jsxRuntime.jsx(BunnyContext.Provider, __assign({ value: { subdomain: subdomain, graphQLClient: graphQLClient, window: window, token: token, accountId: accountId } }, { children: jsxRuntime.jsx(reactQuery.QueryClientProvider, __assign({ client: queryClient$1 }, { children: jsxRuntime.jsx(recoil.RecoilRoot, { children: jsxRuntime.jsx(BrandContext.Provider, __assign({ value: entityBranding }, { children: jsxRuntime.jsx(antd.ConfigProvider, __assign({ theme: {
1671
+ return (jsxRuntime.jsx(BunnyContext.Provider, __assign({ value: {
1672
+ subdomain: subdomain,
1673
+ graphQLClient: graphQLClient,
1674
+ window: window,
1675
+ token: token,
1676
+ accountId: accountId,
1677
+ darkMode: darkMode,
1678
+ } }, { children: jsxRuntime.jsx(reactQuery.QueryClientProvider, __assign({ client: queryClient$1 }, { children: jsxRuntime.jsx(recoil.RecoilRoot, { children: jsxRuntime.jsx(BrandContext.Provider, __assign({ value: entityBranding }, { children: jsxRuntime.jsx(antd.ConfigProvider, __assign({ theme: {
1679
+ algorithm: darkMode
1680
+ ? theme__default["default"].darkAlgorithm
1681
+ : theme__default["default"].defaultAlgorithm,
1715
1682
  token: {
1716
1683
  borderRadius: 4,
1717
1684
  colorPrimary: entityBranding.brandColor,
1718
1685
  colorLink: entityBranding.brandColor,
1719
1686
  colorLinkActive: entityBranding.brandColor,
1720
1687
  colorLinkHover: entityBranding.brandColor,
1721
- fontFamily: common.MARK_PRO,
1688
+ fontFamily: "Inter",
1722
1689
  colorBorder: common.INPUT_BORDER_COLOR,
1723
1690
  },
1691
+ components: {
1692
+ Drawer: {
1693
+ colorBgElevated: darkMode
1694
+ ? "var(--row-background-dark)"
1695
+ : common.SLATE_50,
1696
+ },
1697
+ Divider: {
1698
+ colorSplit: darkMode ? common.SLATE_400 : common.SLATE_200,
1699
+ },
1700
+ },
1724
1701
  } }, { children: jsxRuntime.jsx(SecondaryWrapper, __assign({ setBranding: setBranding }, { children: children })) })) })) }) })) })));
1725
1702
  }
1726
1703
  function SecondaryWrapper(_a) {
@@ -1730,10 +1707,10 @@ function SecondaryWrapper(_a) {
1730
1707
  queryKey: common.QueryKeyFactory.default.brandingKey,
1731
1708
  queryFn: function () { return getBranding({ token: token, subdomain: subdomain }); },
1732
1709
  }).data;
1733
- reactQuery.useQuery({
1710
+ var _c = reactQuery.useQuery({
1734
1711
  queryKey: common.QueryKeyFactory.default.currentUserKey,
1735
- queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
1736
- });
1712
+ queryFn: function () { return getCurrentUserData({ token: token }); },
1713
+ }); _c.data; _c.isLoading;
1737
1714
  React.useEffect(function () {
1738
1715
  if (brandingData) {
1739
1716
  setBranding(brandingData);
@@ -1748,11 +1725,11 @@ var InvoiceQuoteView = function (_a) {
1748
1725
  var downloadFile = common.useDownloadFile(formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.id, onDownloadError);
1749
1726
  var secondaryColor = React.useContext(BrandContext).secondaryColor;
1750
1727
  var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
1751
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [formattedInvoice && (jsxRuntime.jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "shadow-padding-x" : ""), id: "acceptance" }, { children: [jsxRuntime.jsx("div", { children: onBackButtonClick && (jsxRuntime.jsx(antd.Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
1728
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [formattedInvoice ? (jsxRuntime.jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "shadow-padding-x" : ""), id: "acceptance" }, { children: [jsxRuntime.jsx("div", { children: onBackButtonClick ? (jsxRuntime.jsx(antd.Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
1752
1729
  color: secondaryColor,
1753
- }, type: "link" }, { children: backButtonName || "Back" }))) }), jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(DownloadOutlined$1, {}), onClick: function () {
1730
+ }, type: "link" }, { children: backButtonName || "Back" }))) : null }), jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(DownloadOutlined$1, {}), onClick: function () {
1754
1731
  return downloadFile(subdomain + "/api/pdf/invoice/" + formattedInvoice.id, token);
1755
- } }, { children: "Download" }))] }))), isMobile ? (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full shadow-padding-xb overflow-auto" }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] }))) : (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-2 w-full bg-white shadow-md rounded-md", style: {
1732
+ } }, { children: "Download" }))] }))) : null, isMobile ? (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full shadow-padding-xb overflow-auto" }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] }))) : (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-2 w-full bg-white shadow-md rounded-md", style: {
1756
1733
  minWidth: "750px",
1757
1734
  } }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] })))] })));
1758
1735
  };
@@ -1785,7 +1762,7 @@ function styleInject(css, ref) {
1785
1762
  }
1786
1763
  }
1787
1764
 
1788
- var css_248z = ".ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.ant-btn {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-size: 0.875rem;\n font-weight: normal;\n}\n.ant-btn > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-lg {\n height: 44px !important;\n}\n.ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.ant-btn-link {\n border: none !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link:disabled {\n background-color: transparent !important;\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input,\n.ant-picker,\n.ant-select,\n.ant-input-affix-wrapper {\n font-size: 0.875rem;\n color: #232323;\n background: white;\n box-shadow: none !important;\n border: 1px solid #e2e8f0;\n}\n.ant-input:not(:focus) {\n border-color: #e2e8f0 !important;\n}\n.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-focused) .ant-input-prefix {\n color: rgba(0, 0, 0, 0.25) !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-select-selector {\n box-shadow: none !important;\n background-color: transparent !important;\n border: none !important;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-divider {\n margin: 0;\n border-block-color: #e2e8f0 !important;\n border-inline-color: #e2e8f0 !important;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-body {\n background-color: #f8fafc !important;\n}\n.ant-drawer-header {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.fixed {\n position: fixed;\n}\n.top-0 {\n top: 0;\n}\n.right-0 {\n right: 0;\n}\n.bottom-0 {\n bottom: 0;\n}\n.left-0 {\n left: 0;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-visible {\n overflow: visible;\n}\n.z-50 {\n z-index: 50;\n}\n.-top-1\\/10 {\n top: -10%;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-tr {\n border-top-right-radius: 0.25rem;\n}\n.rounded-br {\n border-bottom-right-radius: 0.25rem;\n}\n.rounded-bl {\n border-bottom-left-radius: 0.25rem;\n}\n.rounded-tl {\n border-top-left-radius: 0.25rem;\n}\n.rounded-t {\n border-top-right-radius: 0.25rem;\n border-top-left-radius: 0.25rem;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.flex {\n display: flex;\n}\n.flex-col {\n flex-direction: column;\n}\n.flex-wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex-grow: 1;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.basis-0 {\n flex-basis: 0;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.items-center {\n align-items: center;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.underline {\n text-decoration: underline;\n}\n.no-underline {\n text-decoration: none;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-white {\n color: white;\n}\n.text-xxs {\n font-size: 0.625rem;\n}\n.text-xs {\n font-size: 0.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n}\n.text-base {\n font-size: 1rem;\n}\n.text-lg {\n font-size: 1.125rem;\n}\n.text-xl {\n font-size: 1.25rem;\n}\n.text-2xl {\n font-size: 1.5rem;\n}\n.text-3xl {\n font-size: 2rem;\n}\n.text-4xl {\n font-size: 2.5rem;\n}\n.text-5xl {\n font-size: 3rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-gray {\n color: #808080 !important;\n}\n.text-blue-gray {\n color: #717d94;\n}\n.text-primary {\n color: #ff6e1c;\n}\n.text-secondary {\n color: #4956dc;\n}\n.capitalize {\n text-transform: capitalize !important;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-bold {\n font-weight: 700;\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n background-color: white;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.border-t-solid {\n border-top-style: solid;\n}\n.border-b-solid {\n border-bottom-style: solid;\n}\n.border-t-1 {\n border-top-width: 1px;\n}\n.border-b-1 {\n border-bottom-width: 1px;\n}\n.gap-0 {\n gap: 0 !important;\n}\n.gap-0\\.5 {\n gap: 0.125rem;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem !important;\n}\n.gap-5 {\n gap: 1.25rem;\n}\n.gap-6 {\n gap: 1.5rem !important;\n}\n.gap-8 {\n gap: 2rem !important;\n}\n.gap-12 {\n gap: 3rem !important;\n}\n/* Padding Utilities */\n.p-0 {\n padding: 0;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-5 {\n padding: 1.25rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n/* Padding X Utilities */\n.px-0 {\n padding-right: 0;\n padding-left: 0;\n}\n.px-1 {\n padding-right: 0.25rem;\n padding-left: 0.25rem;\n}\n.px-2 {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n}\n.px-3 {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n.px-4 {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.px-5 {\n padding-right: 1.25rem;\n padding-left: 1.25rem;\n}\n.px-6 {\n padding-right: 1.5rem;\n padding-left: 1.5rem;\n}\n.px-8 {\n padding-right: 2rem;\n padding-left: 2rem;\n}\n.px-12 {\n padding-right: 3rem;\n padding-left: 3rem;\n}\n/* Padding Y Utilities */\n.py-0 {\n padding-top: 0;\n padding-bottom: 0;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n/* Padding Top Utilities */\n.pt-0 {\n padding-top: 0;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n/* Padding Right Utilities */\n.pr-0 {\n padding-right: 0;\n}\n.pr-4 {\n padding-right: 1rem;\n}\n.pr-8 {\n padding-right: 2rem;\n}\n/* Padding Bottom Utilities */\n.pb-0 {\n padding-bottom: 0;\n}\n.pb-1 {\n padding-bottom: 0.25rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-3 {\n padding-bottom: 0.75rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-5 {\n padding-bottom: 1.25rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n/* Padding Left Utilities */\n.pl-0 {\n padding-left: 0;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pl-8 {\n padding-left: 2rem;\n}\n/* Margin Utilities */\n.ml-2 {\n margin-left: 0.5rem;\n}\n.ml-6 {\n margin-left: 1.5rem;\n}\n.ml-8 {\n margin-left: 2rem;\n}\n.mb-0 {\n margin-bottom: 0;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-3 {\n margin-bottom: 0.75rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-5 {\n margin-bottom: 1.25rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-6 {\n margin-right: 1.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-5 {\n margin-top: 1.25rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.w-full {\n width: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-14 {\n width: 3.5rem;\n /* 56px */\n}\n.w-20 {\n width: 5rem;\n /* 80px */\n}\n.h-full {\n height: 100%;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-14 {\n height: 3.5rem;\n /* 56px */\n}\n.h-80 {\n height: 20rem;\n}\n.h-96 {\n height: 24rem;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.cursor-not-allowed {\n cursor: not-allowed;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.grid-cols-4 {\n grid-template-columns: repeat(4, minMax(0, 1fr));\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-4 {\n grid-column: span 4 / span 4;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n/* Background colors */\n.bg-black {\n background-color: #000000;\n}\n.bg-slate-50 {\n background-color: #f8fafc;\n}\n.bg-slate-100 {\n background-color: #f1f5f9;\n}\n.bg-slate-200 {\n background-color: #e2e8f0;\n}\n.bg-slate-300 {\n background-color: #cbd5e1;\n}\n.bg-slate-400 {\n background-color: #94a3b8;\n}\n.bg-slate-500 {\n background-color: #64748b;\n}\n.bg-slate-600 {\n background-color: #475569;\n}\n.bg-slate-700 {\n background-color: #334155;\n}\n.bg-slate-800 {\n background-color: #1e293b;\n}\n.bg-slate-900 {\n background-color: #0f172a;\n}\n.bg-slate-950 {\n background-color: #020617;\n}\n.bg-gray-50 {\n background-color: #f9fafb;\n}\n.bg-gray-100 {\n background-color: #f3f4f6;\n}\n.bg-gray-200 {\n background-color: #e5e7eb;\n}\n.bg-gray-300 {\n background-color: #d1d5db;\n}\n.bg-gray-400 {\n background-color: #9ca3af;\n}\n.bg-gray-500 {\n background-color: #6b7280;\n}\n.bg-gray-600 {\n background-color: #4b5563;\n}\n.bg-gray-700 {\n background-color: #374151;\n}\n.bg-gray-800 {\n background-color: #1f2937;\n}\n.bg-gray-900 {\n background-color: #111827;\n}\n.bg-gray-950 {\n background-color: #030712;\n}\n.bg-green-200 {\n background-color: #a7f3d0;\n}\n.bg-blue-50 {\n background-color: #eff6ff;\n}\n.bg-blue-100 {\n background-color: #dbeafe;\n}\n.bg-blue-200 {\n background-color: #bfdbfe;\n}\n.bg-blue-300 {\n background-color: #93c5fd;\n}\n.bg-blue-400 {\n background-color: #60a5fa;\n}\n.bg-blue-500 {\n background-color: #3b82f6;\n}\n.bg-blue-600 {\n background-color: #2563eb;\n}\n.bg-blue-700 {\n background-color: #1d4ed8;\n}\n.bg-blue-800 {\n background-color: #1e40af;\n}\n.bg-blue-900 {\n background-color: #1e3a8a;\n}\n.bg-blue-950 {\n background-color: #172554;\n}\n.bg-orange-50 {\n background-color: #fff7ed;\n}\n.bg-orange-100 {\n background-color: #ffedd5;\n}\n.bg-orange-200 {\n background-color: #fed7aa;\n}\n.bg-orange-300 {\n background-color: #fdba74;\n}\n.bg-orange-400 {\n background-color: #fb923c;\n}\n.bg-orange-500 {\n background-color: #f97316;\n}\n.bg-orange-600 {\n background-color: #ea580c;\n}\n.bg-orange-700 {\n background-color: #c2410c;\n}\n.bg-orange-800 {\n background-color: #9a3412;\n}\n.bg-orange-900 {\n background-color: #7c2d12;\n}\n.bg-orange-950 {\n background-color: #431407;\n}\n.bg-yellow-200 {\n background-color: #fde68a;\n}\n.bg-red-200 {\n background-color: #fecaca;\n}\n/* Text colors */\n.text-black {\n color: #000000;\n}\n.text-white {\n color: #ffffff;\n}\n.text-slate-50 {\n color: #f8fafc;\n}\n.text-slate-100 {\n color: #f1f5f9;\n}\n.text-slate-200 {\n color: #e2e8f0;\n}\n.text-slate-300 {\n color: #cbd5e1;\n}\n.text-slate-400 {\n color: #94a3b8;\n}\n.text-slate-500 {\n color: #64748b;\n}\n.text-slate-600 {\n color: #475569;\n}\n.text-slate-700 {\n color: #334155;\n}\n.text-slate-800 {\n color: #1e293b;\n}\n.text-slate-900 {\n color: #0f172a;\n}\n.text-slate-950 {\n color: #020617;\n}\n.text-gray-50 {\n color: #f9fafb;\n}\n.text-gray-100 {\n color: #f3f4f6;\n}\n.text-gray-200 {\n color: #e5e7eb;\n}\n.text-gray-300 {\n color: #d1d5db;\n}\n.text-gray-400 {\n color: #9ca3af;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.text-gray-600 {\n color: #4b5563;\n}\n.text-gray-700 {\n color: #374151;\n}\n.text-gray-800 {\n color: #1f2937;\n}\n.text-gray-900 {\n color: #111827;\n}\n.text-gray-950 {\n color: #030712;\n}\n.text-green-600 {\n color: #059669;\n}\n.text-green-700 {\n color: #047857;\n}\n.text-blue-50 {\n color: #eff6ff;\n}\n.text-blue-100 {\n color: #dbeafe;\n}\n.text-blue-200 {\n color: #bfdbfe;\n}\n.text-blue-300 {\n color: #93c5fd;\n}\n.text-blue-400 {\n color: #60a5fa;\n}\n.text-blue-500 {\n color: #3b82f6;\n}\n.text-blue-600 {\n color: #2563eb;\n}\n.text-blue-700 {\n color: #1d4ed8;\n}\n.text-blue-800 {\n color: #1e40af;\n}\n.text-blue-900 {\n color: #1e3a8a;\n}\n.text-blue-950 {\n color: #172554;\n}\n.text-orange-50 {\n color: #fff7ed;\n}\n.text-orange-100 {\n color: #ffedd5;\n}\n.text-orange-200 {\n color: #fed7aa;\n}\n.text-orange-300 {\n color: #fdba74;\n}\n.text-orange-400 {\n color: #fb923c;\n}\n.text-orange-500 {\n color: #f97316;\n}\n.text-orange-600 {\n color: #ea580c;\n}\n.text-orange-700 {\n color: #c2410c;\n}\n.text-orange-800 {\n color: #9a3412;\n}\n.text-orange-900 {\n color: #7c2d12;\n}\n.text-orange-950 {\n color: #431407;\n}\n.text-yellow-500 {\n color: #f59e0b;\n}\n.text-yellow-700 {\n color: #b45309;\n}\n.text-red-500 {\n color: #ef4444;\n}\n.text-red-700 {\n color: #b91c1c;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-l {\n border-left-width: 1px;\n}\n.border-dashed {\n border-style: dashed;\n}\n.border-solid {\n border-style: solid;\n}\n.border-slate-50 {\n border-color: #f8fafc;\n}\n.border-slate-100 {\n border-color: #f1f5f9;\n}\n.border-slate-200 {\n border-color: #e2e8f0;\n}\n.border-slate-300 {\n border-color: #cbd5e1;\n}\n.border-slate-400 {\n border-color: #94a3b8;\n}\n.border-slate-500 {\n border-color: #64748b;\n}\n.border-slate-600 {\n border-color: #475569;\n}\n.border-slate-700 {\n border-color: #334155;\n}\n.border-slate-800 {\n border-color: #1e293b;\n}\n.border-slate-900 {\n border-color: #0f172a;\n}\n.border-slate-950 {\n border-color: #020617;\n}\n.origin-center {\n transform-origin: center;\n}\n.rotate-45 {\n transform: rotate(45deg);\n}\n.translate-x-2\\/4 {\n transform: translateX(50%);\n}\n.-translate-x-2\\/4 {\n transform: translateX(-50%);\n}\n.translate-y-2\\/4 {\n transform: translateY(50%);\n}\n.translate-y-full {\n transform: translateY(100%);\n}\n.-translate-y-full {\n transform: translateY(-100%);\n}\n.shadow-sm {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow {\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n}\n.shadow-md {\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n}\n.shadow-lg {\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.shadow-xl {\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n}\n.shadow-2xl {\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n}\n.shadow-inner {\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow-none {\n box-shadow: 0 0 #0000;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
1765
+ var css_248z = "@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 400;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuLyfMZg.ttf) format('truetype');\n}\n@font-face {\n font-family: 'Inter';\n font-style: normal;\n font-weight: 600;\n font-display: swap;\n src: url(https://fonts.gstatic.com/s/inter/v18/UcCO3FwrK3iLTeHuS_nVMrMxCp50SjIw2boKoduKmMEVuGKYMZg.ttf) format('truetype');\n}\n.ant-tag {\n border: none;\n border-radius: 14px;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n white-space: nowrap;\n margin: 0;\n}\n.ant-tag-blue {\n color: #3b82f6 !important;\n background: #bfdbfe !important;\n}\n.ant-tag-green {\n color: #059669 !important;\n background: #a7f3d0 !important;\n}\n.ant-tag-red {\n color: #ef4444 !important;\n background: #fecaca !important;\n}\n.ant-tag-orange {\n color: #f97316 !important;\n background: #fed7aa !important;\n}\n.ant-tag-yellow {\n color: #f59e0b !important;\n background: #fde68a !important;\n}\n.ant-tag-purple {\n color: #8b5cf6 !important;\n background: #ddd6fe !important;\n}\n.ant-tag-black {\n color: white !important;\n background: black !important;\n}\n.ant-popover {\n z-index: 1050;\n}\n.ant-popover-inner-content {\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n max-width: 300px;\n}\n.ant-popover-message-title {\n padding: 0;\n text-align: center;\n font-size: 1rem;\n}\n.ant-popover-buttons {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n.ant-btn-primary:disabled {\n background: #eef0f2 !important;\n color: rgba(0, 0, 0, 0.25) !important;\n border: none;\n}\n.ant-btn {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n font-weight: 500;\n box-shadow: none;\n text-shadow: none;\n outline: none !important;\n line-height: 1;\n font-size: 0.875rem;\n font-weight: normal;\n}\n.ant-btn > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-lg {\n height: 44px !important;\n}\n.ant-btn-default:disabled {\n border-color: rgba(113, 125, 148, 0.2) !important;\n}\n.ant-btn-link {\n border: none !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link > span {\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n}\n.ant-btn-link:disabled {\n background-color: transparent !important;\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\n}\n.ant-input-affix-wrapper .ant-input-prefix {\n transition: color 0.3s;\n}\n.ant-select-selector {\n box-shadow: none !important;\n background-color: transparent !important;\n border: none !important;\n}\n.ant-form-item-label {\n text-transform: none !important;\n font-size: 0.75rem;\n padding-bottom: 2px !important;\n}\n.ant-form-item-label > label {\n width: 100%;\n color: #4b5563 !important;\n}\n.ant-form-item-explain-error {\n font-size: 11px;\n min-height: 11px;\n line-height: 11px;\n padding-top: 2px;\n}\n.ant-form-item {\n margin-bottom: 0;\n}\n.ant-notification {\n width: min-content;\n}\n.ant-notification-topRight {\n right: 0 !important;\n left: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n}\n.ant-notification-notice-wrapper {\n width: 350px !important;\n overflow: hidden !important;\n}\n.ant-notification-notice {\n padding: 16px !important;\n width: 350px !important;\n display: flex !important;\n box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.08), 0px 1px 18px rgba(0, 0, 0, 0.08), 0px 3px 5px rgba(0, 0, 0, 0.16) !important;\n}\n.ant-notification-notice-description {\n padding: 0 14px 0 0 !important;\n color: #232323 !important;\n font-size: 14px !important;\n word-break: break-all !important;\n overflow-wrap: break-word !important;\n}\n.ant-notification-notice-success {\n background-color: #edfffa !important;\n}\n.ant-notification-notice-error {\n background-color: #fff8f4 !important;\n}\n.ant-notification-notice-error .ant-notification-notice-message {\n color: #ff6e1c !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-error .ant-notification-notice-icon {\n color: #ff6e1c;\n}\n.ant-notification-notice-success .ant-notification-notice-message {\n color: #00b76a !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji !important;\n font-weight: 500;\n}\n.ant-notification-notice-success .ant-notification-notice-icon {\n color: #00b76a !important;\n}\n.ant-notification-notice-message {\n margin-bottom: 0 !important;\n}\n.ant-notification-notice-close {\n top: 16px !important;\n right: 16px !important;\n}\n.ant-divider {\n margin: 0;\n}\n.ant-menu-submenu-popup > .ant-menu .ant-menu-item {\n display: flex !important;\n align-items: center !important;\n}\n.ant-menu-submenu::after {\n display: none !important;\n}\n.ant-drawer-title {\n font-weight: 400 !important;\n}\n.ant-drawer-header-title {\n flex-direction: row-reverse !important;\n align-items: start !important ;\n}\n.ant-drawer-close {\n margin-inline-end: 0 !important;\n}\n@media (min-width: 768px) {\n .ant-input,\n .ant-picker,\n .ant-select,\n .ant-input-affix-wrapper {\n font-size: 1rem !important;\n }\n .ant-drawer-header {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n}\n:root {\n --row-background: #ffffff;\n --row-background-alternate: rgba(100, 116, 139, 0.04);\n --row-background-dark: #121212;\n --row-background-alternate-dark: #1e1e1e;\n}\n.plan-step-line {\n height: 1px;\n min-width: 128px;\n background: #717d94;\n}\n.plan-step-number {\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9999px;\n border: 1px solid #717d94;\n background: white;\n width: 24px;\n height: 24px;\n color: #717d94;\n}\n.plan-step-number.active {\n border: none;\n color: white;\n background: #ff6e1c;\n}\n.hidden {\n display: none;\n}\n.cardElement {\n padding: 8px 11px;\n border: 1px solid #e5e7eb;\n background-color: white;\n font-family: Inter !important;\n}\n.tooltip {\n visibility: hidden;\n position: absolute !important;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\n}\n.show-on-hover {\n opacity: 0;\n}\n.show-on-hover-container:hover .show-on-hover {\n opacity: 1;\n}\n.pdf-only {\n display: none !important;\n}\n.notes p {\n margin: 0;\n padding: 0;\n padding-bottom: 0.25rem;\n}\n#form-element #finix-form-container .field-holder label {\n color: #717d94 !important;\n font-size: 12px !important;\n}\n#form-element #finix-form-container > *:first-child,\n#form-element #finix-form-container > *:last-child {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container > *:not(:first-child):not(:last-child) {\n margin-top: 12px !important;\n}\n#form-element #finix-form-container .field-array > * {\n margin-top: 0 !important;\n}\n#form-element #finix-form-container .field-holder .field,\n#form-element #finix-form-container iframe {\n height: 34px !important;\n}\n#form-element #finix-form-container .field {\n margin-top: 0 !important;\n padding-top: 2px !important;\n}\n#form-element #finix-form-container .field-holder .validation {\n font-size: 11px !important;\n color: #ff4d4f !important;\n}\n.icon-path {\n transition: fill 0.3s;\n}\n.shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.shadow-padding-xb {\n padding-right: 1rem;\n padding-left: 1rem;\n padding-bottom: 0.5rem;\n}\n.content-container {\n width: 100%;\n margin: 0 auto;\n}\n@media (min-width: 1220px) {\n .content-container {\n width: 1220px !important;\n margin: 0 auto;\n }\n}\n@media (min-width: 768px) {\n .shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .shadow-padding-xb {\n padding-right: 2rem;\n padding-left: 2rem;\n padding-bottom: 0.5rem;\n }\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n.relative {\n position: relative;\n}\n.absolute {\n position: absolute;\n}\n.fixed {\n position: fixed;\n}\n.top-0 {\n top: 0;\n}\n.right-0 {\n right: 0;\n}\n.bottom-0 {\n bottom: 0;\n}\n.left-0 {\n left: 0;\n}\n.overflow-hidden {\n overflow: hidden !important;\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-visible {\n overflow: visible;\n}\n.z-50 {\n z-index: 50;\n}\n.-top-1\\/10 {\n top: -10%;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-xl {\n border-radius: 0.75rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-tr {\n border-top-right-radius: 0.25rem;\n}\n.rounded-br {\n border-bottom-right-radius: 0.25rem;\n}\n.rounded-bl {\n border-bottom-left-radius: 0.25rem;\n}\n.rounded-tl {\n border-top-left-radius: 0.25rem;\n}\n.rounded-t {\n border-top-right-radius: 0.25rem;\n border-top-left-radius: 0.25rem;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.flex {\n display: flex;\n}\n.flex-col {\n flex-direction: column;\n}\n.flex-wrap {\n flex-wrap: wrap;\n}\n.grow {\n flex-grow: 1;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.basis-0 {\n flex-basis: 0;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.items-center {\n align-items: center;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-start {\n align-items: flex-start;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.underline {\n text-decoration: underline;\n}\n.no-underline {\n text-decoration: none;\n}\n.text-nowrap {\n white-space: nowrap;\n}\n.text-white {\n color: white;\n}\n.text-xxs {\n font-size: 0.625rem;\n}\n.text-xs {\n font-size: 0.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n}\n.text-base {\n font-size: 1rem;\n}\n.text-lg {\n font-size: 1.125rem;\n}\n.text-xl {\n font-size: 1.25rem;\n}\n.text-2xl {\n font-size: 1.5rem;\n}\n.text-3xl {\n font-size: 2rem;\n}\n.text-4xl {\n font-size: 2.5rem;\n}\n.text-5xl {\n font-size: 3rem;\n}\n.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.text-gray {\n color: #808080 !important;\n}\n.text-gray-400 {\n color: #9ca3af !important;\n}\n.text-gray-500 {\n color: #6b7280 !important;\n}\n.text-blue-gray {\n color: #717d94;\n}\n.text-primary {\n color: #ff6e1c;\n}\n.text-secondary {\n color: #4956dc;\n}\n.capitalize {\n text-transform: capitalize !important;\n}\n.font-normal {\n font-weight: 400;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-bold {\n font-weight: 700;\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n background-color: white;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.border-t-solid {\n border-top-style: solid;\n}\n.border-b-solid {\n border-bottom-style: solid;\n}\n.border-t-1 {\n border-top-width: 1px;\n}\n.border-b-1 {\n border-bottom-width: 1px;\n}\n.gap-0 {\n gap: 0 !important;\n}\n.gap-0\\.5 {\n gap: 0.125rem;\n}\n.gap-1 {\n gap: 0.25rem;\n}\n.gap-2 {\n gap: 0.5rem;\n}\n.gap-3 {\n gap: 0.75rem;\n}\n.gap-4 {\n gap: 1rem !important;\n}\n.gap-5 {\n gap: 1.25rem;\n}\n.gap-6 {\n gap: 1.5rem !important;\n}\n.gap-8 {\n gap: 2rem !important;\n}\n.gap-12 {\n gap: 3rem !important;\n}\n/* Padding Utilities */\n.p-0 {\n padding: 0;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-3 {\n padding: 0.75rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-5 {\n padding: 1.25rem;\n}\n.p-6 {\n padding: 1.5rem;\n}\n.p-8 {\n padding: 2rem;\n}\n/* Padding X Utilities */\n.px-0 {\n padding-right: 0;\n padding-left: 0;\n}\n.px-1 {\n padding-right: 0.25rem;\n padding-left: 0.25rem;\n}\n.px-2 {\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n}\n.px-3 {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n.px-4 {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.px-5 {\n padding-right: 1.25rem;\n padding-left: 1.25rem;\n}\n.px-6 {\n padding-right: 1.5rem;\n padding-left: 1.5rem;\n}\n.px-8 {\n padding-right: 2rem;\n padding-left: 2rem;\n}\n.px-12 {\n padding-right: 3rem;\n padding-left: 3rem;\n}\n/* Padding Y Utilities */\n.py-0 {\n padding-top: 0;\n padding-bottom: 0;\n}\n.py-1 {\n padding-top: 0.25rem;\n padding-bottom: 0.25rem;\n}\n.py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.py-3 {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n}\n.py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n/* Padding Top Utilities */\n.pt-0 {\n padding-top: 0;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\n}\n.pt-3 {\n padding-top: 0.75rem;\n}\n.pt-4 {\n padding-top: 1rem;\n}\n.pt-5 {\n padding-top: 1.25rem;\n}\n.pt-6 {\n padding-top: 1.5rem;\n}\n.pt-8 {\n padding-top: 2rem;\n}\n/* Padding Right Utilities */\n.pr-0 {\n padding-right: 0;\n}\n.pr-4 {\n padding-right: 1rem;\n}\n.pr-8 {\n padding-right: 2rem;\n}\n/* Padding Bottom Utilities */\n.pb-0 {\n padding-bottom: 0;\n}\n.pb-1 {\n padding-bottom: 0.25rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-3 {\n padding-bottom: 0.75rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-5 {\n padding-bottom: 1.25rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n/* Padding Left Utilities */\n.pl-0 {\n padding-left: 0;\n}\n.pl-1 {\n padding-left: 0.25rem;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pl-8 {\n padding-left: 2rem;\n}\n/* Space Utilities */\n.space-y-2 {\n gap: 0.5rem;\n}\n.space-y-4 {\n gap: 1rem;\n}\n.space-y-8 {\n gap: 2rem;\n}\n/* Margin Utilities */\n.ml-2 {\n margin-left: 0.5rem;\n}\n.ml-6 {\n margin-left: 1.5rem;\n}\n.ml-8 {\n margin-left: 2rem;\n}\n.mb-0 {\n margin-bottom: 0;\n}\n.mb-1 {\n margin-bottom: 0.25rem;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-3 {\n margin-bottom: 0.75rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-5 {\n margin-bottom: 1.25rem;\n}\n.mb-6 {\n margin-bottom: 1.5rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.mr-2 {\n margin-right: 0.5rem;\n}\n.mr-4 {\n margin-right: 1rem;\n}\n.mr-6 {\n margin-right: 1.5rem;\n}\n.mr-8 {\n margin-right: 2rem;\n}\n.mt-0 {\n margin-top: 0;\n}\n.mt-1 {\n margin-top: 0.25rem;\n}\n.mt-2 {\n margin-top: 0.5rem;\n}\n.mt-4 {\n margin-top: 1rem;\n}\n.mt-5 {\n margin-top: 1.25rem;\n}\n.mt-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.my-1 {\n margin-top: 0.25rem;\n margin-bottom: 0.25rem;\n}\n.my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.my-8 {\n margin-top: 2rem;\n margin-bottom: 2rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\n}\n.mx-2 {\n margin-left: 0.5rem;\n margin-right: 0.5rem;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.mx-8 {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n.w-full {\n width: 100%;\n}\n.w-1\\/2 {\n width: 50%;\n}\n.w-1\\/3 {\n width: 33.333333%;\n}\n.w-2\\/3 {\n width: 66.666667%;\n}\n.w-4 {\n width: 1rem;\n}\n.w-14 {\n width: 3.5rem;\n /* 56px */\n}\n.w-20 {\n width: 5rem;\n /* 80px */\n}\n.h-full {\n height: 100%;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-6 {\n height: 1.5rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-14 {\n height: 3.5rem;\n /* 56px */\n}\n.h-80 {\n height: 20rem;\n}\n.h-96 {\n height: 24rem;\n}\n.cursor-pointer {\n cursor: pointer;\n}\n.cursor-not-allowed {\n cursor: not-allowed;\n}\n.grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.grid-cols-4 {\n grid-template-columns: repeat(4, minMax(0, 1fr));\n}\n.col-span-2 {\n grid-column: span 2 / span 2;\n}\n.col-span-3 {\n grid-column: span 3 / span 3;\n}\n.col-span-4 {\n grid-column: span 4 / span 4;\n}\n.col-span-full {\n grid-column: 1 / -1;\n}\n/* Background colors */\n.bg-black {\n background-color: #000000;\n}\n.bg-slate-50 {\n background-color: #f8fafc;\n}\n.bg-slate-100 {\n background-color: #f1f5f9;\n}\n.bg-slate-200 {\n background-color: #e2e8f0;\n}\n.bg-slate-300 {\n background-color: #cbd5e1;\n}\n.bg-slate-400 {\n background-color: #94a3b8;\n}\n.bg-slate-500 {\n background-color: #64748b;\n}\n.bg-slate-600 {\n background-color: #475569;\n}\n.bg-slate-700 {\n background-color: #334155;\n}\n.bg-slate-800 {\n background-color: #1e293b;\n}\n.bg-slate-900 {\n background-color: #0f172a;\n}\n.bg-slate-950 {\n background-color: #020617;\n}\n.bg-gray-50 {\n background-color: #f9fafb;\n}\n.bg-gray-100 {\n background-color: #f3f4f6;\n}\n.bg-gray-200 {\n background-color: #e5e7eb;\n}\n.bg-gray-300 {\n background-color: #d1d5db;\n}\n.bg-gray-400 {\n background-color: #9ca3af;\n}\n.bg-gray-500 {\n background-color: #6b7280;\n}\n.bg-gray-600 {\n background-color: #4b5563;\n}\n.bg-gray-700 {\n background-color: #374151;\n}\n.bg-gray-800 {\n background-color: #1f2937;\n}\n.bg-gray-900 {\n background-color: #111827;\n}\n.bg-gray-950 {\n background-color: #030712;\n}\n.bg-green-200 {\n background-color: #a7f3d0;\n}\n.bg-green-500 {\n background-color: #10b981;\n}\n.bg-blue-50 {\n background-color: #eff6ff;\n}\n.bg-blue-100 {\n background-color: #dbeafe;\n}\n.bg-blue-200 {\n background-color: #bfdbfe;\n}\n.bg-blue-300 {\n background-color: #93c5fd;\n}\n.bg-blue-400 {\n background-color: #60a5fa;\n}\n.bg-blue-500 {\n background-color: #3b82f6;\n}\n.bg-blue-600 {\n background-color: #2563eb;\n}\n.bg-blue-700 {\n background-color: #1d4ed8;\n}\n.bg-blue-800 {\n background-color: #1e40af;\n}\n.bg-blue-900 {\n background-color: #1e3a8a;\n}\n.bg-blue-950 {\n background-color: #172554;\n}\n.bg-orange-50 {\n background-color: #fff7ed;\n}\n.bg-orange-100 {\n background-color: #ffedd5;\n}\n.bg-orange-200 {\n background-color: #fed7aa;\n}\n.bg-orange-300 {\n background-color: #fdba74;\n}\n.bg-orange-400 {\n background-color: #fb923c;\n}\n.bg-orange-500 {\n background-color: #f97316;\n}\n.bg-orange-600 {\n background-color: #ea580c;\n}\n.bg-orange-700 {\n background-color: #c2410c;\n}\n.bg-orange-800 {\n background-color: #9a3412;\n}\n.bg-orange-900 {\n background-color: #7c2d12;\n}\n.bg-orange-950 {\n background-color: #431407;\n}\n.bg-yellow-200 {\n background-color: #fde68a;\n}\n.bg-red-200 {\n background-color: #fecaca;\n}\n/* Text colors */\n.text-black {\n color: #000000;\n}\n.text-white {\n color: #ffffff;\n}\n.text-slate-50 {\n color: #f8fafc;\n}\n.text-slate-100 {\n color: #f1f5f9;\n}\n.text-slate-200 {\n color: #e2e8f0;\n}\n.text-slate-300 {\n color: #cbd5e1;\n}\n.text-slate-400 {\n color: #94a3b8;\n}\n.text-slate-500 {\n color: #64748b;\n}\n.text-slate-600 {\n color: #475569;\n}\n.text-slate-700 {\n color: #334155;\n}\n.text-slate-800 {\n color: #1e293b;\n}\n.text-slate-900 {\n color: #0f172a;\n}\n.text-slate-950 {\n color: #020617;\n}\n.text-gray-50 {\n color: #f9fafb;\n}\n.text-gray-100 {\n color: #f3f4f6;\n}\n.text-gray-200 {\n color: #e5e7eb;\n}\n.text-gray-300 {\n color: #d1d5db;\n}\n.text-gray-400 {\n color: #9ca3af;\n}\n.text-gray-500 {\n color: #6b7280;\n}\n.text-gray-600 {\n color: #4b5563;\n}\n.text-gray-700 {\n color: #374151;\n}\n.text-gray-800 {\n color: #1f2937;\n}\n.text-gray-900 {\n color: #111827;\n}\n.text-gray-950 {\n color: #030712;\n}\n.text-green-600 {\n color: #059669;\n}\n.text-green-700 {\n color: #047857;\n}\n.text-blue-50 {\n color: #eff6ff;\n}\n.text-blue-100 {\n color: #dbeafe;\n}\n.text-blue-200 {\n color: #bfdbfe;\n}\n.text-blue-300 {\n color: #93c5fd;\n}\n.text-blue-400 {\n color: #60a5fa;\n}\n.text-blue-500 {\n color: #3b82f6;\n}\n.text-blue-600 {\n color: #2563eb;\n}\n.text-blue-700 {\n color: #1d4ed8;\n}\n.text-blue-800 {\n color: #1e40af;\n}\n.text-blue-900 {\n color: #1e3a8a;\n}\n.text-blue-950 {\n color: #172554;\n}\n.text-orange-50 {\n color: #fff7ed;\n}\n.text-orange-100 {\n color: #ffedd5;\n}\n.text-orange-200 {\n color: #fed7aa;\n}\n.text-orange-300 {\n color: #fdba74;\n}\n.text-orange-400 {\n color: #fb923c;\n}\n.text-orange-500 {\n color: #f97316;\n}\n.text-orange-600 {\n color: #ea580c;\n}\n.text-orange-700 {\n color: #c2410c;\n}\n.text-orange-800 {\n color: #9a3412;\n}\n.text-orange-900 {\n color: #7c2d12;\n}\n.text-orange-950 {\n color: #431407;\n}\n.text-yellow-500 {\n color: #f59e0b;\n}\n.text-yellow-700 {\n color: #b45309;\n}\n.text-red-500 {\n color: #ef4444;\n}\n.text-red-700 {\n color: #b91c1c;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-l {\n border-left-width: 1px;\n}\n.border-dashed {\n border-style: dashed;\n}\n.border-solid {\n border-style: solid;\n}\n.border-slate-50 {\n border-color: #f8fafc;\n}\n.border-slate-100 {\n border-color: #f1f5f9;\n}\n.border-slate-200 {\n border-color: #e2e8f0;\n}\n.border-slate-300 {\n border-color: #cbd5e1;\n}\n.border-slate-400 {\n border-color: #94a3b8;\n}\n.border-slate-500 {\n border-color: #64748b;\n}\n.border-slate-600 {\n border-color: #475569;\n}\n.border-slate-700 {\n border-color: #334155;\n}\n.border-slate-800 {\n border-color: #1e293b;\n}\n.border-slate-900 {\n border-color: #0f172a;\n}\n.border-slate-950 {\n border-color: #020617;\n}\n.border-gray-400 {\n border-color: #9ca3af;\n}\n.border-gray-500 {\n border-color: #6b7280;\n}\n.origin-center {\n transform-origin: center;\n}\n.rotate-45 {\n transform: rotate(45deg);\n}\n.translate-x-2\\/4 {\n transform: translateX(50%);\n}\n.-translate-x-2\\/4 {\n transform: translateX(-50%);\n}\n.translate-y-2\\/4 {\n transform: translateY(50%);\n}\n.translate-y-full {\n transform: translateY(100%);\n}\n.-translate-y-full {\n transform: translateY(-100%);\n}\n.shadow-sm {\n box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow {\n box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n}\n.shadow-md {\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n}\n.shadow-lg {\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.shadow-xl {\n box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n}\n.shadow-2xl {\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n}\n.shadow-inner {\n box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);\n}\n.shadow-none {\n box-shadow: 0 0 #0000;\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex !important;\n }\n .sm\\:hidden {\n display: none !important;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\n font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;\n line-height: 1.15;\n}\nbody {\n color: #232323;\n background-color: #f8fafc;\n}\nth {\n font-weight: normal;\n}\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\", monospace;\n}\n@media only screen and (max-width: 768px) {\n select,\n textarea,\n input[type=\"text\"],\n input[type=\"password\"],\n input[type=\"datetime\"],\n input[type=\"datetime-local\"],\n input[type=\"date\"],\n input[type=\"month\"],\n input[type=\"time\"],\n input[type=\"week\"],\n input[type=\"number\"],\n input[type=\"email\"],\n input[type=\"url\"],\n input[type=\"search\"],\n input[type=\"tel\"],\n input[type=\"color\"] {\n font-size: 16px !important;\n }\n}\n@keyframes App-logo-spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
1789
1766
  styleInject(css_248z);
1790
1767
 
1791
1768
  var paymentMethodsQuery = "query paymentMethods ($filter: String, $first: Int, $sort: String) {\n paymentMethods (filter: $filter, first: $first, sort: $sort) {\n nodes {\n id\n disabled\n pluginId\n accountId\n expirationDate\n plugin {\n guid\n id\n }\n state\n metadata {\n issuer\n identifier\n kind\n description\n icon\n }\n }\n }\n}";
@@ -1813,12 +1790,16 @@ var CardIcon = function () {
1813
1790
  return (jsxRuntime.jsxs("svg", __assign({ width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("path", { d: "M15 3.75H3C2.17157 3.75 1.5 4.42157 1.5 5.25V12.75C1.5 13.5784 2.17157 14.25 3 14.25H15C15.8284 14.25 16.5 13.5784 16.5 12.75V5.25C16.5 4.42157 15.8284 3.75 15 3.75Z", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M1.5 7.5H16.5", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
1814
1791
  };
1815
1792
 
1793
+ var Text$d = antd.Typography.Text;
1816
1794
  var PaymentOption = function (_a) {
1817
1795
  var selected = _a.selected, paymentOption = _a.paymentOption, onClick = _a.onClick, name = _a.name;
1818
1796
  var brandColor = React.useContext(BrandContext).brandColor;
1797
+ var darkMode = React.useContext(BunnyContext).darkMode;
1819
1798
  var isAch = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("ach");
1820
1799
  var isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes("card");
1821
- return (jsxRuntime.jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid border-slate-200 bg-slate-50 border", onClick: function () { return onClick(paymentOption); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected }), jsxRuntime.jsx("div", __assign({ className: "text-gray-900" }, { children: name }))] })), isAch ? (jsxRuntime.jsx(BankOutlined$1, { className: "text-slate-400" })) : isCard ? (jsxRuntime.jsx(CardIcon, {})) : (jsxRuntime.jsx(CardIcon, {}))] })));
1800
+ return (jsxRuntime.jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "flex justify-between items-center w-full cursor-pointer py-2 px-4 rounded border-solid ".concat(darkMode
1801
+ ? "var(--row-background-dark) border-gray-500"
1802
+ : "bg-slate-50 border-slate-200", " border"), onClick: function () { return onClick(paymentOption); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex gap-2 items-center" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? "border-gray-400" : "" }), jsxRuntime.jsx(Text$d, { children: name })] })), isAch ? (jsxRuntime.jsx(BankOutlined$1, { className: "text-slate-400" })) : isCard ? (jsxRuntime.jsx(CardIcon, {})) : (jsxRuntime.jsx(CardIcon, {}))] })));
1822
1803
  };
1823
1804
  var PaymentOptionContainer = styled__default["default"].div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"])), function (_a) {
1824
1805
  var $brandColor = _a.$brandColor, $selected = _a.$selected;
@@ -1935,16 +1916,28 @@ var useStripePlugin = function (plugin, token, subdomain, accountId) {
1935
1916
  return stripe;
1936
1917
  };
1937
1918
 
1919
+ var PaymentContext = React.createContext({});
1920
+
1938
1921
  var CheckoutFooter = function (_a) {
1939
1922
  var amountDue = _a.amountDue, currencyId = _a.currencyId, isSaving = _a.isSaving, onPaymentSubmit = _a.onPaymentSubmit, onlySavePaymentMethod = _a.onlySavePaymentMethod, noPadding = _a.noPadding;
1940
1923
  var isMobile = common.useIsMobile();
1941
- return (jsxRuntime.jsx("div", __assign({ className: "flex justify-end gap-2 ".concat(noPadding ? "" : "pt-6") }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "w-full", disabled: isSaving, onClick: onPaymentSubmit, size: isMobile ? "large" : "middle", type: "primary" }, { children: "".concat(onlySavePaymentMethod
1942
- ? isSaving
1943
- ? "Saving"
1944
- : "Save"
1945
- : isSaving
1946
- ? "Paying"
1947
- : "Pay").concat(amountDue && currencyId
1924
+ var invoice = React.useContext(InvoiceCheckoutContext).invoice;
1925
+ var displayPayButtonNameAnyways = React.useContext(PaymentContext).displayPayButtonNameAnyways;
1926
+ var buttonName = function () {
1927
+ return onlySavePaymentMethod && !displayPayButtonNameAnyways
1928
+ ? isSaving
1929
+ ? "Saving"
1930
+ : "Save"
1931
+ : isSaving
1932
+ ? "Paying"
1933
+ : "Pay";
1934
+ };
1935
+ React.useEffect(function () {
1936
+ if (invoice) {
1937
+ onPaymentSubmit();
1938
+ }
1939
+ }, [invoice]);
1940
+ return (jsxRuntime.jsx("div", __assign({ className: "flex justify-end gap-2 ".concat(noPadding ? "" : "pt-6") }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "w-full", disabled: isSaving, onClick: onPaymentSubmit, size: isMobile ? "large" : "middle", type: "primary" }, { children: "".concat(buttonName()).concat(amountDue && currencyId
1948
1941
  ? " ".concat(common.Misc.formatCurrency(amountDue, currencyId))
1949
1942
  : "") })) })));
1950
1943
  };
@@ -2036,10 +2029,11 @@ var PaymentMethodForm$1 = function (_a) {
2036
2029
  // Hooks
2037
2030
  var elements = reactStripeJs.useElements();
2038
2031
  var stripe = reactStripeJs.useStripe();
2039
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2032
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2033
+ var accountId = React.useContext(PaymentContext).accountId;
2040
2034
  // Handlers
2041
2035
  var onSubmit = function () { return __awaiter(void 0, void 0, void 0, function () {
2042
- var submitError, response, clientSecret, intentResponse, paymentMethodId, error_1;
2036
+ var submitError, response, clientSecret, intentResponse, paymentMethodId, paymentMethodResponse, error_1;
2043
2037
  var _a, _b;
2044
2038
  return __generator(this, function (_c) {
2045
2039
  switch (_c.label) {
@@ -2087,8 +2081,17 @@ var PaymentMethodForm$1 = function (_a) {
2087
2081
  accountId: accountId,
2088
2082
  })];
2089
2083
  case 4:
2090
- _c.sent();
2091
- onPaymentSuccess({});
2084
+ paymentMethodResponse = _c.sent();
2085
+ onPaymentSuccess({
2086
+ pluginPaymentResponse: {
2087
+ savePaymentMethod: true,
2088
+ plugin: plugin,
2089
+ token: paymentMethodResponse.token,
2090
+ },
2091
+ savedPaymentMethodResponse: {
2092
+ paymentMethodId: paymentMethodResponse.payload[0].id,
2093
+ },
2094
+ });
2092
2095
  return [3 /*break*/, 6];
2093
2096
  case 5:
2094
2097
  error_1 = _c.sent();
@@ -2104,7 +2107,8 @@ var PaymentMethodForm$1 = function (_a) {
2104
2107
  // This is just a wrapper to fetch the stripe object and pass it to the form
2105
2108
  var StripeForm = function (_a) {
2106
2109
  var payable = _a.payable, plugin = _a.plugin, isSaving = _a.isSaving, setIsSaving = _a.setIsSaving, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess;
2107
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2110
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2111
+ var accountId = React.useContext(PaymentContext).accountId;
2108
2112
  var stripe = useStripePlugin(plugin, token, subdomain, accountId);
2109
2113
  var onlySavePaymentMethod = !payable;
2110
2114
  if (!stripe)
@@ -2132,6 +2136,10 @@ var StripeForm = function (_a) {
2132
2136
  }
2133
2137
  };
2134
2138
 
2139
+ var getQuoteAmountDue = function (quote) {
2140
+ return quote.amountDue;
2141
+ };
2142
+
2135
2143
  // Simulated payment creation and confirmation
2136
2144
  var confirmPayment = function (_a) {
2137
2145
  var amount = _a.amount, currency = _a.currency, cardDetails = _a.cardDetails;
@@ -2198,34 +2206,34 @@ var storePayment = function (options, plugin, accountId, subdomain) { return __a
2198
2206
  });
2199
2207
  }); };
2200
2208
 
2201
- var CARD_NUMBER_MAX_LENGTH = 19; // Why 19 instead of 16? Because we add spaces
2202
- var formatCardNumber = function (cardNumber) {
2203
- return cardNumber.replace(/(\d{4})(?=\d)/g, "$1 ");
2204
- };
2205
- var DemoPayCardNumber = function (_a) {
2209
+ var DemoPayCardCvc = function (_a) {
2206
2210
  var autoFocus = _a.autoFocus, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value;
2207
2211
  var onKeyPress = function (event) {
2208
2212
  if (!isDigit(event.key) && !isValidKey(event.keyCode))
2209
2213
  event.preventDefault();
2210
2214
  };
2211
2215
  var onNumberChange = function (event) {
2212
- var number = event.target.value.replace(/\s/g, "");
2213
- onChange(number);
2216
+ var cvc = event.target.value.replace(/\D/g, "");
2217
+ onChange(cvc);
2214
2218
  };
2215
- return (jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: autoFocus, maxLength: CARD_NUMBER_MAX_LENGTH, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, placeholder: placeholder || "Card Number", value: formatCardNumber(value) }) })));
2219
+ return (jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: value, maxLength: 3, placeholder: placeholder || "CVC" }) })));
2216
2220
  };
2217
2221
 
2218
- var DemoPayCardCvc = function (_a) {
2222
+ var CARD_NUMBER_MAX_LENGTH = 19; // Why 19 instead of 16? Because we add spaces
2223
+ var formatCardNumber = function (cardNumber) {
2224
+ return cardNumber.replace(/(\d{4})(?=\d)/g, "$1 ");
2225
+ };
2226
+ var DemoPayCardNumber = function (_a) {
2219
2227
  var autoFocus = _a.autoFocus, onChange = _a.onChange, placeholder = _a.placeholder, value = _a.value;
2220
2228
  var onKeyPress = function (event) {
2221
2229
  if (!isDigit(event.key) && !isValidKey(event.keyCode))
2222
2230
  event.preventDefault();
2223
2231
  };
2224
2232
  var onNumberChange = function (event) {
2225
- var cvc = event.target.value.replace(/\D/g, "");
2226
- onChange(cvc);
2233
+ var number = event.target.value.replace(/\s/g, "");
2234
+ onChange(number);
2227
2235
  };
2228
- return (jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: value, maxLength: 3, placeholder: placeholder || "CVC" }) })));
2236
+ return (jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: autoFocus, maxLength: CARD_NUMBER_MAX_LENGTH, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, placeholder: placeholder || "Card Number", value: formatCardNumber(value) }) })));
2229
2237
  };
2230
2238
 
2231
2239
  var DemoPayExpiry = function (_a) {
@@ -2241,15 +2249,13 @@ var DemoPayExpiry = function (_a) {
2241
2249
  return (jsxRuntime.jsx("div", __assign({ className: "grow" }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: autoFocus, onKeyDown: onKeyPress, onKeyUp: onKeyPress, onChange: onNumberChange, value: formatCardExpiry(value), maxLength: 5, placeholder: placeholder || "MM/YY" }) })));
2242
2250
  };
2243
2251
 
2244
- var getQuoteAmountDue = function (quote) {
2245
- return quote.amountDue;
2246
- };
2247
-
2252
+ var Text$c = antd.Typography.Text;
2248
2253
  var TEST_CARD = "4242424242424242";
2249
2254
  var DemoPayForm = function (_a) {
2250
2255
  var isSaving = _a.isSaving, invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, plugin = _a.plugin, quote = _a.quote, setIsSaving = _a.setIsSaving;
2251
2256
  // Context
2252
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2257
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
2258
+ var accountId = React.useContext(PaymentContext).accountId;
2253
2259
  // Local state
2254
2260
  var _c = React.useState(false), savePaymentMethod = _c[0], setSavePaymentMethod = _c[1];
2255
2261
  var _d = React.useState({
@@ -2261,12 +2267,13 @@ var DemoPayForm = function (_a) {
2261
2267
  var currencyId = (quote === null || quote === void 0 ? void 0 : quote.currencyId) || (invoice === null || invoice === void 0 ? void 0 : invoice.currency);
2262
2268
  var onlySavePaymentMethod = !quote && !invoice;
2263
2269
  var onPaymentSubmit = function () { return __awaiter(void 0, void 0, void 0, function () {
2264
- var response, response, error_1;
2270
+ var response, paymentMethodId, response, error_1;
2265
2271
  return __generator(this, function (_a) {
2266
2272
  switch (_a.label) {
2267
2273
  case 0:
2268
2274
  _a.trys.push([0, 6, , 7]);
2269
2275
  if (!onlySavePaymentMethod) return [3 /*break*/, 2];
2276
+ setIsSaving(true);
2270
2277
  return [4 /*yield*/, storePayment({
2271
2278
  testCreditCardNumber: unformatCardNumber(cardDetails.number),
2272
2279
  testCreditCardCvc: cardDetails.cvc.toString(),
@@ -2275,12 +2282,22 @@ var DemoPayForm = function (_a) {
2275
2282
  }, plugin, accountId, subdomain)];
2276
2283
  case 1:
2277
2284
  response = _a.sent();
2285
+ paymentMethodId = response.payload[0].id;
2278
2286
  if (response.status !== "success")
2279
2287
  throw new Error(response === null || response === void 0 ? void 0 : response.message);
2280
- onPaymentSuccess({});
2281
- return [3 /*break*/, 5];
2282
- case 2:
2283
- if (!(amountDue !== undefined && currencyId)) return [3 /*break*/, 4];
2288
+ onPaymentSuccess({
2289
+ pluginPaymentResponse: {
2290
+ plugin: plugin,
2291
+ token: response.token,
2292
+ savePaymentMethod: savePaymentMethod,
2293
+ },
2294
+ savedPaymentMethodResponse: {
2295
+ paymentMethodId: paymentMethodId,
2296
+ },
2297
+ });
2298
+ return [3 /*break*/, 5];
2299
+ case 2:
2300
+ if (!(amountDue !== undefined && currencyId)) return [3 /*break*/, 4];
2284
2301
  setIsSaving(true);
2285
2302
  if (cardDetails.number !== TEST_CARD)
2286
2303
  throw new Error("Only the card number 4242 4242 4242 4242 will be accepted.");
@@ -2304,6 +2321,7 @@ var DemoPayForm = function (_a) {
2304
2321
  savePaymentMethod: savePaymentMethod,
2305
2322
  },
2306
2323
  });
2324
+ setIsSaving(false);
2307
2325
  return [3 /*break*/, 5];
2308
2326
  case 4:
2309
2327
  onFail(new Error("No amount or currencyId"));
@@ -2326,9 +2344,15 @@ var DemoPayForm = function (_a) {
2326
2344
  var onCardCvcChange = function (cvc) {
2327
2345
  setCardDetails(__assign(__assign({}, cardDetails), { cvc: cvc }));
2328
2346
  };
2329
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx("div", __assign({ className: "text-xs text-gray-700" }, { children: "DemoPay is for testing only." })), !onlySavePaymentMethod && (jsxRuntime.jsx(antd.Checkbox, __assign({ className: "mt-2", onChange: function (e) { return setSavePaymentMethod(e.target.checked); } }, { children: "Save as primary payment method" }))), jsxRuntime.jsx(CheckoutFooter, { amountDue: amountDue, currencyId: currencyId, isSaving: isSaving, onPaymentSubmit: onPaymentSubmit, onlySavePaymentMethod: onlySavePaymentMethod })] })));
2347
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "flex flex-col gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx(Text$c, __assign({ className: "text-xs" }, { children: "DemoPay is for testing only." })), !onlySavePaymentMethod && (jsxRuntime.jsx(antd.Checkbox, __assign({ className: "mt-2", onChange: function (e) { return setSavePaymentMethod(e.target.checked); } }, { children: "Save as primary payment method" }))), jsxRuntime.jsx(CheckoutFooter, { amountDue: amountDue, currencyId: currencyId, isSaving: isSaving, onPaymentSubmit: onPaymentSubmit, onlySavePaymentMethod: onlySavePaymentMethod })] })));
2330
2348
  };
2331
- var StyledInputs = styled__default["default"].div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n .ant-input {\n background-color: white !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: white !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), common.GRAY_200);
2349
+ var StyledInputs = styled__default["default"].div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), function (_a) {
2350
+ var darkMode = _a.darkMode;
2351
+ return darkMode ? "var(--row-background-dark)" : "white";
2352
+ }, function (_a) {
2353
+ var darkMode = _a.darkMode;
2354
+ return darkMode ? common.GRAY_500 : common.GRAY_200;
2355
+ });
2332
2356
  var templateObject_1$7;
2333
2357
 
2334
2358
  var finixStyles = function (isMobile) { return ({
@@ -2419,7 +2443,8 @@ var formatFinixError = function (response) {
2419
2443
  var FinixCardPaymentForm = function (_a) {
2420
2444
  var finixConfig = _a.formData, invoice = _a.invoice, isSaving = _a.isSaving, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, plugin = _a.plugin, quote = _a.quote, setIsSaving = _a.setIsSaving;
2421
2445
  // Context
2422
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, accountId = _b.accountId;
2446
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
2447
+ var accountId = React.useContext(PaymentContext).accountId;
2423
2448
  var isMobile = common.useIsMobile();
2424
2449
  // Local state
2425
2450
  var _c = React.useState(false), savePaymentMethod = _c[0], setSavePaymentMethod = _c[1];
@@ -2761,7 +2786,7 @@ var PaymentForm = function (_a) {
2761
2786
  return (jsxRuntime.jsx(ActualPaymentForm, { invoice: invoice, isSaving: isSaving, onFail: onFail, onPaymentSuccess: onPaymentSuccess, quote: quote, setIsSaving: setIsSaving }));
2762
2787
  };
2763
2788
 
2764
- var MUTATION$3 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
2789
+ var MUTATION$7 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
2765
2790
  var checkout = function (_a) {
2766
2791
  var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, subdomain = _a.subdomain;
2767
2792
  return __awaiter(void 0, void 0, void 0, function () {
@@ -2778,7 +2803,7 @@ var checkout = function (_a) {
2778
2803
  mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
2779
2804
  }
2780
2805
  return [4 /*yield*/, common.gqlRequest({
2781
- query: MUTATION$3,
2806
+ query: MUTATION$7,
2782
2807
  token: token,
2783
2808
  vars: mutationVars,
2784
2809
  subdomain: subdomain,
@@ -2796,8 +2821,9 @@ var checkout = function (_a) {
2796
2821
  });
2797
2822
  };
2798
2823
 
2824
+ var InvoiceCheckoutContext = React.createContext({});
2799
2825
  var InvoiceCheckout = function (_a) {
2800
- var isSaving = _a.isSaving, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, setIsSaving = _a.setIsSaving;
2826
+ var isSaving = _a.isSaving, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, setIsSaving = _a.setIsSaving, preCheckout = _a.preCheckout, setIsPreCheckoutLoading = _a.setIsPreCheckoutLoading, isPreCheckoutLoading = _a.isPreCheckoutLoading, payImmediatelyGivenInvoice = _a.payImmediatelyGivenInvoice, checkoutButtonName = _a.checkoutButtonName;
2801
2827
  var _b = React.useContext(BunnyContext), subdomain = _b.subdomain, token = _b.token;
2802
2828
  var checkoutMutation = reactQuery.useMutation({
2803
2829
  mutationFn: function (_a) {
@@ -2805,7 +2831,7 @@ var InvoiceCheckout = function (_a) {
2805
2831
  if (savedPaymentMethod) {
2806
2832
  var paymentMethodId = savedPaymentMethod.paymentMethodId;
2807
2833
  return checkout({
2808
- invoiceId: invoice.id,
2834
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
2809
2835
  paymentMethodId: paymentMethodId,
2810
2836
  token: token,
2811
2837
  subdomain: subdomain,
@@ -2815,7 +2841,7 @@ var InvoiceCheckout = function (_a) {
2815
2841
  var plugin = pluginPaymentMethod.plugin, savePaymentMethod = pluginPaymentMethod.savePaymentMethod, metadata = pluginPaymentMethod.metadata;
2816
2842
  var paymentToken = pluginPaymentMethod.token;
2817
2843
  return checkout({
2818
- invoiceId: invoice.id,
2844
+ invoiceId: invoice === null || invoice === void 0 ? void 0 : invoice.id,
2819
2845
  paymentMethodData: {
2820
2846
  metadata: metadata,
2821
2847
  pluginGuid: plugin.guid,
@@ -2861,7 +2887,14 @@ var InvoiceCheckout = function (_a) {
2861
2887
  });
2862
2888
  });
2863
2889
  };
2864
- return (jsxRuntime.jsx(PaymentForm, { isSaving: isSaving, onPaymentSuccess: handleCheckout, onFail: onFail, invoice: invoice, setIsSaving: setIsSaving }));
2890
+ return (jsxRuntime.jsx(InvoiceCheckoutContext.Provider, __assign({ value: {
2891
+ preCheckout: preCheckout,
2892
+ payImmediatelyGivenInvoice: payImmediatelyGivenInvoice,
2893
+ checkoutButtonName: checkoutButtonName,
2894
+ invoice: invoice,
2895
+ setIsPreCheckoutLoading: setIsPreCheckoutLoading,
2896
+ isPreCheckoutLoading: isPreCheckoutLoading,
2897
+ } }, { children: jsxRuntime.jsx(PaymentForm, { isSaving: isSaving, onPaymentSuccess: handleCheckout, onFail: onFail, invoice: invoice, setIsSaving: setIsSaving }) })));
2865
2898
  };
2866
2899
 
2867
2900
  var fetchPDF = function (window, apiEndpoint, invoiceUuid) { return __awaiter(void 0, void 0, void 0, function () {
@@ -2907,7 +2940,7 @@ function InvoicePDF(_a) {
2907
2940
  }, title: "Invoice PDF", width: "100%" }));
2908
2941
  }
2909
2942
 
2910
- var MUTATION$2 = "\nquery FormattedInvoice($id: ID) {\n formattedInvoice(id: $id) {\n amount\n amountDue\n amountPaid\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n createdAt\n credits\n currency\n currencyId\n currencySymbol\n customerBillingCity\n customerBillingContact\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n dueAt\n html\n id\n isLegacy\n netPaymentDays\n number\n payableId\n poNumber\n printedState\n smallUnitAmountDue\n state\n subscriptionEndDate\n subscriptionStartDate\n subtotal\n taxAmount\n taxNumber\n uuid\n vendorName\n formattedLines {\n amount\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n lineText\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListName\n prorationRate\n quantity\n unitOfMeasure\n priceTiers {\n price\n starts\n }\n }\n }\n}";
2943
+ var MUTATION$6 = "\nquery FormattedInvoice($id: ID) {\n formattedInvoice(id: $id) {\n amount\n amountDue\n amountPaid\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n createdAt\n credits\n currency\n currencyId\n currencySymbol\n customerBillingCity\n customerBillingContact\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n dueAt\n html\n id\n isLegacy\n netPaymentDays\n number\n payableId\n poNumber\n printedState\n smallUnitAmountDue\n state\n subscriptionEndDate\n subscriptionStartDate\n subtotal\n taxAmount\n taxNumber\n uuid\n vendorName\n formattedLines {\n amount\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n lineText\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListName\n prorationRate\n quantity\n unitOfMeasure\n priceTiers {\n price\n starts\n }\n }\n }\n}";
2911
2944
  var getFormattedInvoice = function (_a) {
2912
2945
  var id = _a.id, token = _a.token, subdomain = _a.subdomain;
2913
2946
  return __awaiter(void 0, void 0, void 0, function () {
@@ -2917,7 +2950,7 @@ var getFormattedInvoice = function (_a) {
2917
2950
  case 0:
2918
2951
  vars = { id: id };
2919
2952
  return [4 /*yield*/, common.gqlRequest({
2920
- query: MUTATION$2,
2953
+ query: MUTATION$6,
2921
2954
  token: token,
2922
2955
  vars: vars,
2923
2956
  subdomain: subdomain,
@@ -2973,7 +3006,7 @@ function ActualInvoice(_a) {
2973
3006
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs(reactHelmetAsync.Helmet, { children: [jsxRuntime.jsxs("title", { children: [formattedInvoice.vendorName, " ", common.DOCUMENT_NAME.INVOICE] }), jsxRuntime.jsx("meta", { name: "description", content: common.QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) }), jsxRuntime.jsx("meta", { property: "og:type", content: "website" }), jsxRuntime.jsx("meta", { property: "og:title", content: common.QuoteInvoiceUtils.quoteMetaTitle({
2974
3007
  vendorName: formattedInvoice.vendorName,
2975
3008
  documentName: common.DOCUMENT_NAME.INVOICE,
2976
- }) }), jsxRuntime.jsx("meta", { property: "og:description", content: common.QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "flex justify-center w-full bg-red-500" }, { children: jsxRuntime.jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, subdomain: subdomain }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, isMobile: isMobile, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), !isMobile && isInvoicePayable && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), isInvoicePayable && (jsxRuntime.jsx(InvoiceCheckout, { invoice: formattedInvoice, isSaving: isSaving, onFail: function (error) {
3009
+ }) }), jsxRuntime.jsx("meta", { property: "og:description", content: common.QuoteInvoiceUtils.quoteMetaDescription(formattedInvoice.vendorName) })] }), jsxRuntime.jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsxRuntime.jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, subdomain: subdomain }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, isMobile: isMobile, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), !isMobile && isInvoicePayable && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), isInvoicePayable && (jsxRuntime.jsx(InvoiceCheckout, { invoice: formattedInvoice, isSaving: isSaving, onFail: function (error) {
2977
3010
  onFail(error);
2978
3011
  setIsSaving(false);
2979
3012
  }, onSuccess: onSuccess, setIsSaving: setIsSaving }))] }))] }));
@@ -2983,8 +3016,6 @@ function Invoice(_a) {
2983
3016
  return (jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(ActualInvoice, { id: id, invoiceQuoteViewComponent: invoiceQuoteViewComponent, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick, onPaymentSuccess: onPaymentSuccess }) }));
2984
3017
  }
2985
3018
 
2986
- var QuoteContext = React.createContext({});
2987
-
2988
3019
  var DOCUMENT_NAME;
2989
3020
  (function (DOCUMENT_NAME) {
2990
3021
  DOCUMENT_NAME["INVOICE"] = "invoice";
@@ -3110,7 +3141,7 @@ var useSigningComplete = function (_a) {
3110
3141
  var queryClient = reactQuery.useQueryClient();
3111
3142
  var searchParams = React.useContext(NavigationContext).searchParams;
3112
3143
  // Check for return param from docusign and show cosmetic quote acceptance
3113
- var eventParam = searchParams.get("event");
3144
+ var eventParam = searchParams ? searchParams.get("event") : null;
3114
3145
  React.useEffect(function () {
3115
3146
  if (data && eventParam === "signing_complete") {
3116
3147
  data.state = "ACCEPTED";
@@ -3194,8 +3225,6 @@ var PandadocPollingModal = function (_a) {
3194
3225
  handleAllErrorFormats(rsp.errors);
3195
3226
  else if (rsp.data.quotePollSigningUrl.status === "document.sent") {
3196
3227
  setVisible(false);
3197
- console.log("rsp", rsp);
3198
- console.log("rsp.data.quotePollSigningUrl.redirectUri", rsp.data.quotePollSigningUrl.redirectUri);
3199
3228
  window.location.href = rsp.data.quotePollSigningUrl.redirectUri;
3200
3229
  }
3201
3230
  setInfoMessage(rsp.data.quotePollSigningUrl.infoMessage || "");
@@ -3215,55 +3244,42 @@ var PandadocPollingModal = function (_a) {
3215
3244
  return (jsxRuntime.jsxs(antd.Modal, __assign({ title: "Uploading quote to Pandadoc", open: isVisible, closable: false, footer: null }, { children: [jsxRuntime.jsxs("div", __assign({ className: "py-4 text-center" }, { children: ["This may take a few seconds", ".".repeat(numberOfPolls)] })), jsxRuntime.jsx("div", __assign({ className: "text-center" }, { children: infoMessage }))] })));
3216
3245
  };
3217
3246
 
3218
- var formattedQuoteMutation = function () { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }"; };
3219
- var getFormattedQuote = function (token, apiEndpoint, id) { return __awaiter(void 0, void 0, void 0, function () {
3220
- var response, _a, data, errors, formattedLines, decimals;
3221
- return __generator(this, function (_b) {
3222
- switch (_b.label) {
3223
- case 0: return [4 /*yield*/, fetch(apiEndpoint + "/graphql", {
3224
- method: "POST",
3225
- headers: {
3226
- "Content-type": "application/json; charset=utf-8",
3227
- Authorization: "Bearer ".concat(token),
3228
- },
3229
- body: JSON.stringify({
3230
- query: formattedQuoteMutation(),
3231
- variables: {
3232
- id: id,
3233
- },
3234
- }),
3235
- })];
3236
- case 1:
3237
- response = _b.sent();
3238
- return [4 /*yield*/, response.json()];
3239
- case 2:
3240
- _a = _b.sent(), data = _a.data, errors = _a.errors;
3241
- if (errors) {
3242
- throw new Error(errors[0].message);
3243
- }
3244
- formattedLines = data.formattedQuote.formattedLines;
3245
- decimals = Math.max.apply(Math, formattedLines.map(function (x) { return x.priceDecimals; }));
3246
- formattedLines.forEach(function (line) {
3247
- line.priceDecimals = decimals;
3248
- });
3249
- return [2 /*return*/, data === null || data === void 0 ? void 0 : data.formattedQuote];
3250
- }
3247
+ var MUTATION$5 = "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\n object { documents { id filename size date url } }\n billingCity\n billingCountry\n billingState\n billingStreet\n billingZip\n contactName\n currency\n customerBillingCity\n customerBillingCountry\n customerBillingState\n customerBillingStreet\n customerBillingZip\n customerName\n discount\n discountValue\n duration\n endDate\n expiresAt\n html\n formattedLines {\n amount\n amountsByPeriod {\n quantity\n id\n name\n startDate\n endDate\n amount\n amountsByTier {\n id\n tier {\n starts\n ends\n price\n }\n quantity\n amount\n }\n prorationRate\n }\n billingPeriodEnd\n billingPeriodStart\n chargeType\n discount\n frequency\n isRamp\n periods\n planName\n position\n price\n priceDecimals\n priceListChargeId\n priceListChargeName\n priceListId\n priceListName\n priceTiers {\n price\n starts\n }\n pricingModel\n productName\n prorationRate\n quantity\n showProductNameOnLineItem\n taxCode\n trialEndDate\n trialStartDate\n unitOfMeasure\n vatCode\n }\n netPaymentDays\n notes\n number\n poNumberRequired\n salesContactEmail\n sharedAt\n startDate\n state\n subtotal\n taxAmount\n taxNumberLabel\n taxNumberRequired\n vendorName\n }\n }";
3248
+ var getFormattedQuote = function (_a) {
3249
+ var id = _a.id, token = _a.token, subdomain = _a.subdomain;
3250
+ return __awaiter(void 0, void 0, void 0, function () {
3251
+ var vars, response;
3252
+ return __generator(this, function (_b) {
3253
+ switch (_b.label) {
3254
+ case 0:
3255
+ vars = { id: id };
3256
+ return [4 /*yield*/, common.gqlRequest({
3257
+ query: MUTATION$5,
3258
+ token: token,
3259
+ vars: vars,
3260
+ subdomain: subdomain,
3261
+ })];
3262
+ case 1:
3263
+ response = _b.sent();
3264
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.formattedQuote];
3265
+ }
3266
+ });
3251
3267
  });
3252
- }); };
3268
+ };
3253
3269
 
3254
3270
  var documentName = DOCUMENT_NAME.QUOTE;
3255
- function ActualQuote() {
3256
- var _a, _b;
3257
- var id = React.useContext(QuoteContext).id;
3258
- var _c = React.useContext(BunnyContext), token = _c.token, subdomain = _c.subdomain;
3271
+ function ActualQuote(_a) {
3272
+ var _b, _c;
3273
+ var id = _a.id;
3274
+ var _d = React.useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
3259
3275
  var entityBranding = React.useContext(BrandContext);
3260
3276
  var isMobile = common.useIsMobile();
3261
3277
  // Queries
3262
- var data = reactQuery.useQuery({
3278
+ var _e = reactQuery.useQuery({
3263
3279
  queryKey: common.QueryKeyFactory.default.createQuoteKey(token),
3264
- queryFn: function () { return getFormattedQuote(token, subdomain, id); },
3280
+ queryFn: function () { return getFormattedQuote({ token: token, subdomain: subdomain, id: id }); },
3265
3281
  placeholderData: reactQuery.keepPreviousData,
3266
- }).data;
3282
+ }), data = _e.data; _e.isLoading; _e.isError; _e.error;
3267
3283
  reactQuery.useQuery({
3268
3284
  queryKey: common.QueryKeyFactory.default.currentUserKey,
3269
3285
  queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
@@ -3272,7 +3288,7 @@ function ActualQuote() {
3272
3288
  // Hooks
3273
3289
  var downloadFile = common.useDownloadFile(id);
3274
3290
  var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
3275
- var _d = useSendAcceptQuote(token, subdomain, id), acceptBoxVisible = _d.acceptBoxVisible, isAccepting = _d.isAccepting, sendAccept = _d.sendAccept, setAcceptBoxVisible = _d.setAcceptBoxVisible, setIsAccepting = _d.setIsAccepting, startAcceptance = _d.startAcceptance, pandadocPollingModalVisible = _d.pandadocPollingModalVisible, setPandadocPollingModalVisible = _d.setPandadocPollingModalVisible;
3291
+ var _f = useSendAcceptQuote(token, subdomain, id), acceptBoxVisible = _f.acceptBoxVisible, isAccepting = _f.isAccepting, sendAccept = _f.sendAccept, setAcceptBoxVisible = _f.setAcceptBoxVisible, setIsAccepting = _f.setIsAccepting, startAcceptance = _f.startAcceptance, pandadocPollingModalVisible = _f.pandadocPollingModalVisible, setPandadocPollingModalVisible = _f.setPandadocPollingModalVisible;
3276
3292
  useSigningComplete({ data: formattedQuote, token: token });
3277
3293
  if (!formattedQuote) {
3278
3294
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
@@ -3282,25 +3298,30 @@ function ActualQuote() {
3282
3298
  documentName: documentName,
3283
3299
  }) }), jsxRuntime.jsx("meta", { property: "og:description", content: common.QuoteInvoiceUtils.quoteMetaDescription(formattedQuote.vendorName) })] }), jsxRuntime.jsxs("div", __assign({ className: "flex shadow-padding-x ".concat(isMobile ? "flex-col gap-1" : "items-center gap-2", " justify-end pb-4"), id: "acceptance", style: {
3284
3300
  color: entityBranding.secondaryColor,
3285
- } }, { children: [(formattedQuote.state === "ACCEPTED" ||
3286
- formattedQuote.state === "APPLIED") && (jsxRuntime.jsxs("div", { children: [formattedQuote.state === "ACCEPTED" &&
3301
+ } }, { children: [formattedQuote.state === "ACCEPTED" ||
3302
+ formattedQuote.state === "APPLIED" ? (jsxRuntime.jsxs("div", { children: [formattedQuote.state === "ACCEPTED" &&
3287
3303
  formattedQuote.acceptedAt &&
3288
3304
  "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.Misc.formatDate(formattedQuote.acceptedAt)), formattedQuote.state === "APPLIED" &&
3289
3305
  formattedQuote.acceptedAt &&
3290
- "Quote is now applied. Accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.Misc.formatDate(formattedQuote.acceptedAt))] })), jsxRuntime.jsxs("div", __assign({ className: isMobile
3306
+ "Quote is now applied. Accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.Misc.formatDate(formattedQuote.acceptedAt))] })) : null, jsxRuntime.jsxs("div", __assign({ className: isMobile
3291
3307
  ? "flex w-full justify-between gap-2"
3292
- : "flex items-center justify-end gap-2" }, { children: [!isMobile && (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(DownloadOutlined$1, {}), onClick: function () { return downloadFile(subdomain + "/api/pdf/quote", token); } }, { children: "Download" }))), formattedQuote.state !== "ACCEPTED" &&
3293
- formattedQuote.state !== "APPLIED" && (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" })))] }))] })), jsxRuntime.jsx("div", __assign({ className: "flex ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, isMobile: isMobile }, { children: ((_b = (_a = formattedQuote.object) === null || _a === void 0 ? void 0 : _a.documents) === null || _b === void 0 ? void 0 : _b.length) > 0 && (jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-end" }, { children: formattedQuote.object.documents.map(function (doc, index) {
3308
+ : "flex items-center justify-end gap-2" }, { children: [!isMobile ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(DownloadOutlined$1, {}), onClick: function () { return downloadFile(subdomain + "/api/pdf/quote", token); } }, { children: "Download" }))) : null, formattedQuote.state !== "ACCEPTED" &&
3309
+ formattedQuote.state !== "APPLIED" ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] }))] })), jsxRuntime.jsx("div", __assign({ className: "flex ".concat(isMobile ? "flex-col w-full overflow-hidden" : "shadow-padding-xb") }, { children: jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, isMobile: isMobile }, { children: ((_c = (_b = formattedQuote.object) === null || _b === void 0 ? void 0 : _b.documents) === null || _c === void 0 ? void 0 : _c.length) > 0 ? (jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-end" }, { children: formattedQuote.object.documents.map(function (doc, index) {
3294
3310
  return (jsxRuntime.jsx(antd.Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
3295
- }) }))) })) })), jsxRuntime.jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsxRuntime.jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
3311
+ }) }))) : null })) })), jsxRuntime.jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsxRuntime.jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
3296
3312
  }
3297
3313
  styled__default["default"].div(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
3298
3314
  function Quote(_a) {
3299
3315
  var id = _a.id;
3300
- return (jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(QuoteContext.Provider, __assign({ value: { id: id } }, { children: jsxRuntime.jsx(ActualQuote, {}) })) }));
3316
+ return (jsxRuntime.jsx(reactHelmetAsync.HelmetProvider, { children: jsxRuntime.jsx(ActualQuote, { id: id }) }));
3301
3317
  }
3302
3318
  var templateObject_1$5;
3303
3319
 
3320
+ var DrawerHeader = function (_a) {
3321
+ var description = _a.description, onClose = _a.onClose, title = _a.title;
3322
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-xl" }, { children: title })), jsxRuntime.jsx("button", __assign({ onClick: onClose, className: "ant-drawer-close" }, { children: jsxRuntime.jsx(CloseOutlined$1, {}) }))] })), description && jsxRuntime.jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
3323
+ };
3324
+
3304
3325
  var LargeCardIcon = function () {
3305
3326
  return (jsxRuntime.jsx("svg", __assign({ width: "72", height: "56", viewBox: "0 0 72 56", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: jsxRuntime.jsx("path", { d: "M8 0H64C68.375 0 72 3.625 72 8V12H0V8C0 3.625 3.5 0 8 0ZM72 24V48C72 52.5 68.375 56 64 56H8C3.5 56 0 52.5 0 48V24H72ZM14 40C12.875 40 12 41 12 42C12 43.125 12.875 44 14 44H22C23 44 24 43.125 24 42C24 41 23 40 22 40H14ZM28 42C28 43.125 28.875 44 30 44H46C47 44 48 43.125 48 42C48 41 47 40 46 40H30C28.875 40 28 41 28 42Z", fill: "#E2E8F0" }) })));
3306
3327
  };
@@ -3312,11 +3333,15 @@ var PlusIcon = function (_a) {
3312
3333
 
3313
3334
  var PaymentMethodContext = React.createContext({});
3314
3335
 
3315
- // TODO: remove this eventually
3316
- var Card$1 = function (_a) {
3317
- var children = _a.children, className = _a.className;
3318
- return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col bg-white rounded-md shadow-md ".concat(className) }, { children: children })));
3336
+ var Card = function (_a) {
3337
+ var children = _a.children, className = _a.className, style = _a.style;
3338
+ var darkMode = React.useContext(BunnyContext).darkMode;
3339
+ return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col rounded-md shadow-md ".concat(className), style: __assign(__assign({}, style), { backgroundColor: darkMode
3340
+ ? "var(--row-background-dark)"
3341
+ : "var(--row-background)" }) }, { children: children })));
3319
3342
  };
3343
+
3344
+ var Text$b = antd.Typography.Text;
3320
3345
  var CreditCard = function (_a) {
3321
3346
  var _b, _c, _d;
3322
3347
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData;
@@ -3327,11 +3352,11 @@ var CreditCard = function (_a) {
3327
3352
  };
3328
3353
  var isMobile = common.useIsMobile();
3329
3354
  var processPublicUrl = React.useContext(PaymentMethodContext).processPublicUrl;
3330
- return (jsxRuntime.jsxs(Card$1, __assign({ className: "shadow-md m-0" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [getCardImage((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) && (jsxRuntime.jsx("img", { alt: "Card", width: "24px", src: "".concat(processPublicUrl, "/").concat(getCardImage((_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.issuer)) })), jsxRuntime.jsx("div", { children: (_d = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _d === void 0 ? void 0 : _d.description })] })), jsxRuntime.jsx(antd.Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(antd.Divider, {}), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(CardAttribute, { title: "EXPIRATION", value: dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).format("MM/YY") }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
3355
+ return (jsxRuntime.jsxs(Card, __assign({ className: "shadow-md m-0" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-4 p-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [getCardImage((_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer) && (jsxRuntime.jsx("img", { alt: "Card", width: "24px", src: "".concat(processPublicUrl, "/").concat(getCardImage((_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.issuer)) })), jsxRuntime.jsx(Text$b, { children: (_d = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _d === void 0 ? void 0 : _d.description })] })), jsxRuntime.jsx(antd.Tag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })), !isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] })), dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).isValid() && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(antd.Divider, {}), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(CardAttribute, { title: "EXPIRATION", value: dayjs(paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.expirationDate).format("MM/YY") }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
3331
3356
  };
3332
3357
  var CardAttribute = function (_a) {
3333
3358
  var title = _a.title, value = _a.value;
3334
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsxRuntime.jsx("div", { children: value })] })));
3359
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: title })), jsxRuntime.jsx(Text$b, { children: value })] })));
3335
3360
  };
3336
3361
  var CardActions = function (_a) {
3337
3362
  var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate;
@@ -3350,14 +3375,9 @@ var getCardImage = function (issuer) {
3350
3375
  return "mc_symbol_opt_73_3x.png";
3351
3376
  };
3352
3377
 
3353
- var DrawerHeader = function (_a) {
3354
- var description = _a.description, onClose = _a.onClose, title = _a.title;
3355
- return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between gap-2" }, { children: [jsxRuntime.jsx("div", __assign({ className: "text-xl" }, { children: title })), jsxRuntime.jsx("button", __assign({ onClick: onClose, className: "ant-drawer-close" }, { children: jsxRuntime.jsx(CloseOutlined$1, {}) }))] })), description && jsxRuntime.jsx("div", __assign({ className: "text-xs" }, { children: description }))] })));
3356
- };
3357
-
3358
3378
  var ActualPaymentMethod = function () {
3359
- var _a = React.useContext(BunnyContext), token = _a.token, subdomain = _a.subdomain, graphQLClient = _a.graphQLClient, accountId = _a.accountId;
3360
- var footer = React.useContext(PaymentMethodContext).footer;
3379
+ var _a = React.useContext(BunnyContext), token = _a.token, subdomain = _a.subdomain, graphQLClient = _a.graphQLClient;
3380
+ var accountId = React.useContext(PaymentContext).accountId;
3361
3381
  // Hooks
3362
3382
  var queryClient = reactQuery.useQueryClient();
3363
3383
  var paymentPlugins = common.usePaymentPlugins({ subdomain: subdomain, token: token }).paymentPlugins;
@@ -3407,7 +3427,7 @@ var ActualPaymentMethod = function () {
3407
3427
  };
3408
3428
  if (data === undefined)
3409
3429
  return jsxRuntime.jsx(jsxRuntime.Fragment, {});
3410
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [data ? (jsxRuntime.jsx(CreditCard, { onClickRemove: onClickRemove, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data })) : (jsxRuntime.jsx(EmptyCard, { onClick: function () { return setShowModal(true); } })), footer, jsxRuntime.jsx(antd.Drawer, __assign({ closeIcon: null, onClose: function () { return setShowModal(false); }, open: showModal, styles: {
3430
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [data ? (jsxRuntime.jsx(CreditCard, { onClickRemove: onClickRemove, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data })) : (jsxRuntime.jsx(EmptyCard, { onClick: function () { return setShowModal(true); } })), jsxRuntime.jsx(antd.Drawer, __assign({ closeIcon: null, onClose: function () { return setShowModal(false); }, open: showModal, styles: {
3411
3431
  body: isMobile
3412
3432
  ? {
3413
3433
  padding: "1rem 0 0",
@@ -3427,7 +3447,7 @@ function PaymentMethod(_a) {
3427
3447
  return (jsxRuntime.jsx(PaymentMethodContext.Provider, __assign({ value: { footer: footer, processPublicUrl: processPublicUrl } }, { children: jsxRuntime.jsx(ActualPaymentMethod, {}) })));
3428
3448
  }
3429
3449
 
3430
- var MUTATION$1 = "\nmutation accountUpdate(\n $id: ID!,\n $attributes: AccountAttributes!) {\n accountUpdate(\n id: $id,\n attributes: $attributes\n ) {\n account { id }\n errors\n }\n }\n";
3450
+ var MUTATION$4 = "\nmutation accountUpdate(\n $id: ID!,\n $attributes: AccountAttributes!) {\n accountUpdate(\n id: $id,\n attributes: $attributes\n ) {\n account { id }\n errors\n }\n }\n";
3431
3451
  var accountUpdate = function (_a) {
3432
3452
  var accountId = _a.accountId, attributes = _a.attributes, token = _a.token;
3433
3453
  return __awaiter(void 0, void 0, void 0, function () {
@@ -3437,7 +3457,7 @@ var accountUpdate = function (_a) {
3437
3457
  switch (_c.label) {
3438
3458
  case 0:
3439
3459
  vars = { id: accountId, attributes: attributes };
3440
- return [4 /*yield*/, common.gqlRequest({ query: MUTATION$1, token: token, vars: vars })];
3460
+ return [4 /*yield*/, common.gqlRequest({ query: MUTATION$4, token: token, vars: vars })];
3441
3461
  case 1:
3442
3462
  response = _c.sent();
3443
3463
  errors = (_b = response === null || response === void 0 ? void 0 : response.accountUpdate) === null || _b === void 0 ? void 0 : _b.errors;
@@ -3501,6 +3521,8 @@ var QuoteCheckout = function (_a) {
3501
3521
  var checkoutMutation = reactQuery.useMutation({
3502
3522
  mutationFn: function (_a) {
3503
3523
  var pluginPaymentMethod = _a.pluginPaymentMethod, savedPaymentMethod = _a.storedPaymentMethod;
3524
+ if (!quote)
3525
+ throw new Error("Quote is required");
3504
3526
  if (!paymentRequired)
3505
3527
  return checkout({ quoteId: quote.id, token: token, subdomain: subdomain });
3506
3528
  if (savedPaymentMethod) {
@@ -3703,6 +3725,277 @@ var Checkout = function (_a) {
3703
3725
  }, setIsSaving: setIsSaving }))] }))] })) })));
3704
3726
  };
3705
3727
 
3728
+ var MUTATION$3 = function () { return "\nmutation AccountSignup (\n $entityId: ID!,\n $pluginId: String!,\n $paymentMethodId: String,\n $priceListCode: String!,\n $accountId: ID!,\n $quoteId: ID!\n) {\n accountSignup(\n entityId: $entityId,\n pluginId: $pluginId,\n paymentMethodId: $paymentMethodId,\n priceListCode: $priceListCode,\n accountId: $accountId,\n quoteId: $quoteId\n ) {\n errors\n quote {\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\n backdatedPeriods\n backdatedQuote\n billingDay\n contactId\n createdAt\n credits\n currencyId\n dealId\n discount\n discountValue\n endDate\n evergreen\n expiresAt\n id\n invoiceImmediately\n invoiceImmediatelyAvailable\n invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n number\n ownerId\n payableId\n periodAmount\n poNumber\n requiresApproval\n smallUnitAmountDue\n splitInvoice\n startDate\n state\n subtotal\n taxAmount\n taxCode\n updatedAt\n uuid\n }\n }\n}"; };
3729
+ var accountSignup = function (_a) {
3730
+ var token = _a.token, subdomain = _a.subdomain, entityId = _a.entityId, accountId = _a.accountId, quoteId = _a.quoteId, paymentToken = _a.paymentToken, paymentMethodId = _a.paymentMethodId, pluginId = _a.pluginId, priceListCode = _a.priceListCode;
3731
+ return __awaiter(void 0, void 0, void 0, function () {
3732
+ var vars, response, errors;
3733
+ var _b;
3734
+ return __generator(this, function (_c) {
3735
+ switch (_c.label) {
3736
+ case 0:
3737
+ vars = {
3738
+ entityId: entityId,
3739
+ accountId: accountId,
3740
+ quoteId: quoteId,
3741
+ paymentToken: paymentToken,
3742
+ pluginId: pluginId,
3743
+ paymentMethodId: paymentMethodId,
3744
+ priceListCode: priceListCode,
3745
+ };
3746
+ return [4 /*yield*/, common.gqlRequest({
3747
+ query: MUTATION$3(),
3748
+ token: token,
3749
+ vars: vars,
3750
+ subdomain: subdomain,
3751
+ })];
3752
+ case 1:
3753
+ response = _c.sent();
3754
+ errors = (_b = response === null || response === void 0 ? void 0 : response.accountSignup) === null || _b === void 0 ? void 0 : _b.errors;
3755
+ if (errors)
3756
+ throw errors;
3757
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.accountSignup];
3758
+ }
3759
+ });
3760
+ });
3761
+ };
3762
+
3763
+ var MUTATION$2 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $entityId: ID!,\n $priceListCode: String!\n) {\n quoteAccountSignup(\n entityId: $entityId,\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact\n ) {\n account {\n id\n }\n amount\n currencyId\n quoteId\n errors\n }\n}"; };
3764
+ var quoteAccountSignup = function (_a) {
3765
+ var token = _a.token, subdomain = _a.subdomain, entityId = _a.entityId, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact;
3766
+ return __awaiter(void 0, void 0, void 0, function () {
3767
+ var vars, response, errors;
3768
+ var _b;
3769
+ return __generator(this, function (_c) {
3770
+ switch (_c.label) {
3771
+ case 0:
3772
+ vars = {
3773
+ entityId: entityId,
3774
+ priceListCode: priceListCode,
3775
+ accountName: accountName,
3776
+ billingContact: billingContact,
3777
+ };
3778
+ return [4 /*yield*/, common.gqlRequest({
3779
+ query: MUTATION$2(),
3780
+ token: token,
3781
+ vars: vars,
3782
+ subdomain: subdomain,
3783
+ })];
3784
+ case 1:
3785
+ response = _c.sent();
3786
+ errors = (_b = response === null || response === void 0 ? void 0 : response.quoteAccountSignup) === null || _b === void 0 ? void 0 : _b.errors;
3787
+ if (errors)
3788
+ throw errors;
3789
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quoteAccountSignup];
3790
+ }
3791
+ });
3792
+ });
3793
+ };
3794
+
3795
+ var MUTATION$1 = function () { return "\nquery PriceList($code: String!) {\n priceList (code: $code) {\n basePrice\n code\n createdAt\n currencyId\n id\n isVisible\n name\n periodMonths\n planId\n priceDescription\n productId\n sku\n trialAllowed\n trialLengthDays\n updatedAt\n }\n}"; };
3796
+ var getPriceList = function (_a) {
3797
+ var token = _a.token, code = _a.code, subdomain = _a.subdomain;
3798
+ return __awaiter(void 0, void 0, void 0, function () {
3799
+ var response;
3800
+ return __generator(this, function (_b) {
3801
+ switch (_b.label) {
3802
+ case 0: return [4 /*yield*/, common.gqlRequest({
3803
+ query: MUTATION$1(),
3804
+ token: token,
3805
+ vars: { code: code },
3806
+ subdomain: subdomain,
3807
+ })];
3808
+ case 1:
3809
+ response = _b.sent();
3810
+ return [2 /*return*/, response === null || response === void 0 ? void 0 : response.priceList];
3811
+ }
3812
+ });
3813
+ });
3814
+ };
3815
+
3816
+ function PaymentForms(_a) {
3817
+ var quote = _a.quote, paying = _a.paying, setIsPaying = _a.setIsPaying, handlePaymentSaveSuccess = _a.handlePaymentSaveSuccess, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId;
3818
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: accountId && (jsxRuntime.jsx(PaymentContext.Provider, __assign({ value: { accountId: accountId, displayPayButtonNameAnyways: true } }, { children: jsxRuntime.jsx(PaymentForm, { isSaving: paying, setIsSaving: setIsPaying, onFail: function () {
3819
+ console.log("payment saving failed darn");
3820
+ }, onPaymentSuccess: handlePaymentSaveSuccess }) }))) })) : (jsxRuntime.jsx(InitialSignupForm, { onSubmit: handleSubmit, submitting: proceedingToPayment })) }));
3821
+ }
3822
+ function InitialSignupForm(_a) {
3823
+ var onSubmit = _a.onSubmit, submitting = _a.submitting;
3824
+ var _b = React.useState({
3825
+ firstName: "",
3826
+ lastName: "",
3827
+ email: "",
3828
+ accountName: "",
3829
+ }), formData = _b[0], setFormData = _b[1];
3830
+ var handleInputChange = function (e) {
3831
+ var _a;
3832
+ var _b = e.target, name = _b.name, value = _b.value;
3833
+ setFormData(__assign(__assign({}, formData), (_a = {}, _a[name] = value, _a)));
3834
+ };
3835
+ return (jsxRuntime.jsxs(antd.Form, __assign({ className: "flex w-1/2 flex-col justify-between h-full", onFinish: function () { return onSubmit(formData); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col space-y-2" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ rules: [{ required: true, message: "Please input your first name!" }], initialValue: formData.firstName }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "First name", value: formData.firstName, onChange: function (e) {
3836
+ handleInputChange(e);
3837
+ setFormData(__assign(__assign({}, formData), { firstName: e.target.value }));
3838
+ } }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ rules: [{ required: true, message: "Please input your last name!" }], initialValue: formData.lastName }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name", value: formData.lastName, onChange: function (e) {
3839
+ handleInputChange(e);
3840
+ setFormData(__assign(__assign({}, formData), { lastName: e.target.value }));
3841
+ } }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ rules: [
3842
+ { required: true, message: "Please input your email!" },
3843
+ { type: "email", message: "Please enter a valid email!" },
3844
+ ], initialValue: formData.email }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Email", value: formData.email, onChange: function (e) {
3845
+ handleInputChange(e);
3846
+ setFormData(__assign(__assign({}, formData), { email: e.target.value }));
3847
+ } }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ rules: [
3848
+ { required: true, message: "Please input your account name!" },
3849
+ ], initialValue: formData.accountName }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Account name", value: formData.accountName, onChange: function (e) {
3850
+ handleInputChange(e);
3851
+ setFormData(__assign(__assign({}, formData), { accountName: e.target.value }));
3852
+ } }) }))] })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", htmlType: "submit", loading: submitting, className: "w-full mt-4" }, { children: "Proceed to payment" })) })] })));
3853
+ }
3854
+
3855
+ var Title = antd.Typography.Title, Text$a = antd.Typography.Text;
3856
+ function PaymentSuccessDisplay(_a) {
3857
+ var className = _a.className, amountPaid = _a.amountPaid, style = _a.style, redirectUrl = _a.redirectUrl;
3858
+ var window = React.useContext(BunnyContext).window;
3859
+ var companyName = common.useCurrentUserData().companyName;
3860
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col items-center justify-center h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(CheckCircleFilled$1, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "mt-2 m-0" }, { children: ["Payment of ", common.Misc.formatCurrency(amountPaid, "USD"), " successful"] })), redirectUrl && (jsxRuntime.jsxs(Text$a, __assign({ className: "text-slate-500 cursor-pointer underline", onClick: function () { return (window.location.href = redirectUrl); } }, { children: ["Back to ", companyName] })))] })));
3861
+ }
3862
+
3863
+ var Text$9 = antd.Typography.Text;
3864
+ function PriceListDisplay(_a) {
3865
+ var priceListData = _a.priceListData, topNavImageUrl = _a.topNavImageUrl;
3866
+ if (!priceListData)
3867
+ return null;
3868
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", __assign({ className: "flex flex-col justify-between h-full my-12" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col space-y-8" }, { children: [jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false }), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsx(Text$9, __assign({ className: "text-slate-500 font-bold text-lg" }, { children: priceListData.name })), jsxRuntime.jsxs(Text$9, __assign({ className: "font-bold text-xl" }, { children: [common.Misc.formatCurrency(priceListData.basePrice, priceListData.currencyId), " ", "/ month"] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex flex-col" }, { children: [jsxRuntime.jsxs(Text$9, __assign({ style: { fontSize: "16px" }, className: "text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$9, __assign({ className: "text-slate-500", style: { fontSize: "12px" } }, { children: "You will not be charged until the last day of the trial." }))] }))] })) })) }));
3869
+ }
3870
+
3871
+ var BunnyFooterIcon = function (_a) {
3872
+ var color = _a.color;
3873
+ return (jsxRuntime.jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsxRuntime.jsx("path", { className: "icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
3874
+ };
3875
+
3876
+ var Footer = function (_a) {
3877
+ var className = _a.className;
3878
+ var _b = common.useCurrentUserData(), privacyUrl = _b.privacyUrl, termsUrl = _b.termsUrl;
3879
+ var window = React.useContext(BunnyContext).window;
3880
+ var isMobile = useIsMobile(window);
3881
+ var quotePreviewData = recoil.useRecoilValue(planPickerQuoteDataState);
3882
+ var selectedPriceList = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList;
3883
+ if (selectedPriceList && isMobile)
3884
+ return null;
3885
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between shrink-0 ".concat(className, " ").concat(isMobile ? "flex-col gap-2 grow" : "") }, { children: [(termsUrl || privacyUrl) && (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [termsUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Terms" }))), privacyUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Privacy" })))] }))), jsxRuntime.jsx(BunnyMarketingLink, {})] })));
3886
+ };
3887
+ var BunnyMarketingLink = function () {
3888
+ var _a = React.useState(false), isHovered = _a[0], setIsHovered = _a[1];
3889
+ var window = React.useContext(BunnyContext).window;
3890
+ var isMobile = useIsMobile(window);
3891
+ return (jsxRuntime.jsx("div", __assign({ className: "flex items-end justify-end ".concat(isMobile ? "" : "grow") }, { children: jsxRuntime.jsx(StyledBunnyLink, __assign({ className: "flex items-end justify-end text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: ["Powered by\u00A0", jsxRuntime.jsx("div", __assign({ style: { paddingTop: "5px" } }, { children: jsxRuntime.jsx(BunnyFooterIcon, { color: isHovered ? common.PRIMARY_COLOR : common.SLATE_400 }) }))] })) })) })));
3892
+ };
3893
+ var StyedLink = styled__default["default"].a(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"], ["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"])), common.SLATE_400, common.SLATE_500);
3894
+ var StyledBunnyLink = styled__default["default"](StyedLink)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), common.PRIMARY_COLOR);
3895
+ var templateObject_1$4, templateObject_2;
3896
+
3897
+ function Signup(_a) {
3898
+ var priceListCode = _a.priceListCode, redirectUrl = _a.redirectUrl;
3899
+ // Hooks
3900
+ var _b = React.useContext(BunnyContext), subdomain = _b.subdomain, token = _b.token, window = _b.window;
3901
+ reactQuery.useQuery({
3902
+ queryKey: common.QueryKeyFactory.default.currentUserKey,
3903
+ queryFn: function () { return getCurrentUserData({ token: token, subdomain: subdomain }); },
3904
+ });
3905
+ var isMobile = useIsMobile(window);
3906
+ var topNavImageUrl = React.useContext(BrandContext).topNavImageUrl;
3907
+ var entityId = common.useCurrentUserData().entityId;
3908
+ var _c = React.useState(undefined), quote = _c[0], setQuote = _c[1];
3909
+ var _d = React.useState(undefined), accountId = _d[0], setAccountId = _d[1];
3910
+ var _e = React.useState(undefined), quoteId = _e[0], setQuoteId = _e[1];
3911
+ var _f = React.useState(undefined), formData = _f[0], setFormData = _f[1];
3912
+ var _g = React.useState(false), proceedingToPayment = _g[0], setProceedingToPayment = _g[1];
3913
+ var _h = React.useState(false), paying = _h[0], setIsPaying = _h[1];
3914
+ var _j = React.useState(false), purchaseSucceeded = _j[0], setPurchaseSucceeded = _j[1];
3915
+ // Queries
3916
+ var priceListData = reactQuery.useQuery({
3917
+ queryKey: ["priceList", priceListCode],
3918
+ queryFn: function () { return getPriceList({ token: token, subdomain: subdomain, code: priceListCode }); },
3919
+ }).data;
3920
+ function handleSubmit(formData) {
3921
+ return __awaiter(this, void 0, void 0, function () {
3922
+ var data;
3923
+ return __generator(this, function (_a) {
3924
+ switch (_a.label) {
3925
+ case 0:
3926
+ setProceedingToPayment(true);
3927
+ setFormData(formData);
3928
+ return [4 /*yield*/, quoteAccountSignup({
3929
+ token: token,
3930
+ subdomain: subdomain,
3931
+ entityId: entityId,
3932
+ priceListCode: priceListCode,
3933
+ accountName: formData.accountName,
3934
+ billingContact: {
3935
+ firstName: formData.firstName,
3936
+ lastName: formData.lastName,
3937
+ email: formData.email,
3938
+ },
3939
+ })];
3940
+ case 1:
3941
+ data = _a.sent();
3942
+ setAccountId(data.account.id);
3943
+ setQuoteId(data.quoteId);
3944
+ setProceedingToPayment(false);
3945
+ setQuote({
3946
+ amountDue: data.amount,
3947
+ currencyId: data.currencyId,
3948
+ });
3949
+ return [2 /*return*/];
3950
+ }
3951
+ });
3952
+ });
3953
+ }
3954
+ function handlePaymentSaveSuccess(paymentSuccess) {
3955
+ var _a;
3956
+ return __awaiter(this, void 0, void 0, function () {
3957
+ var response, plugin;
3958
+ return __generator(this, function (_b) {
3959
+ switch (_b.label) {
3960
+ case 0:
3961
+ if (!formData) {
3962
+ throw new Error("Form data is required");
3963
+ }
3964
+ response = paymentSuccess.pluginPaymentResponse;
3965
+ plugin = response === null || response === void 0 ? void 0 : response.plugin;
3966
+ if (!(plugin === null || plugin === void 0 ? void 0 : plugin.id)) {
3967
+ throw new Error("Plugin ID is required");
3968
+ }
3969
+ if (!accountId) {
3970
+ throw new Error("Account ID is required");
3971
+ }
3972
+ return [4 /*yield*/, accountSignup({
3973
+ token: token,
3974
+ subdomain: subdomain,
3975
+ entityId: entityId,
3976
+ quoteId: quoteId,
3977
+ paymentMethodId: (_a = paymentSuccess.savedPaymentMethodResponse) === null || _a === void 0 ? void 0 : _a.paymentMethodId.toString(),
3978
+ pluginId: plugin.id.toString(),
3979
+ priceListCode: priceListCode,
3980
+ accountId: accountId,
3981
+ })];
3982
+ case 1:
3983
+ _b.sent();
3984
+ setIsPaying(false);
3985
+ setPurchaseSucceeded(true);
3986
+ return [2 /*return*/];
3987
+ }
3988
+ });
3989
+ });
3990
+ }
3991
+ if (isMobile) {
3992
+ return (jsxRuntime.jsx(Card, __assign({ className: "p-4 flex flex-col" }, { children: purchaseSucceeded ? (jsxRuntime.jsx(PaymentSuccessDisplay, { className: "w-full", amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, redirectUrl: redirectUrl })) : (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col" : "flex-row", " h-full w-full") }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-center" }, { children: jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsxRuntime.jsx("div", __assign({ className: "mx-8" }, { children: jsxRuntime.jsx(antd.Divider, { className: "h-full" }) })), jsxRuntime.jsx("div", __assign({ className: "flex items-center justify-center my-12" }, { children: jsxRuntime.jsx(PaymentForms, { quote: quote, paying: paying, setIsPaying: setIsPaying, handlePaymentSaveSuccess: handlePaymentSaveSuccess, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId || "" }) }))] }))) })));
3993
+ }
3994
+ else {
3995
+ return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Card, __assign({ className: "p-4 flex flex-col w-screen h-screen" }, { children: purchaseSucceeded ? (jsxRuntime.jsx(PaymentSuccessDisplay, { className: "w-full", amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, redirectUrl: redirectUrl })) : (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col" : "flex-row", " h-full w-full") }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-col w-1/2 items-center" }, { children: jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsxRuntime.jsx("div", __assign({ className: "my-4" }, { children: jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" }) })), jsxRuntime.jsx("div", __assign({ className: "flex w-1/2 items-center justify-center my-12" }, { children: jsxRuntime.jsx(PaymentForms, { quote: quote, paying: paying, setIsPaying: setIsPaying, handlePaymentSaveSuccess: handlePaymentSaveSuccess, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId || "" }) }))] }))) })), jsxRuntime.jsx(Footer, {})] }));
3996
+ }
3997
+ }
3998
+
3706
3999
  var StateTag = function (_a) {
3707
4000
  var state = _a.state;
3708
4001
  return jsxRuntime.jsx(antd.Tag, __assign({ color: getColor(state) }, { children: lodash.capitalize(lodash.startCase(state)) }));
@@ -3737,12 +4030,13 @@ var TransactionGridCell = styled__default["default"].div.withConfig({
3737
4030
  shouldForwardProp: function (prop) {
3738
4031
  return !["gridColumn", "padding", "right"].includes(prop);
3739
4032
  },
3740
- })(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"], ["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"])), function (props) { return props.gridColumn && "grid-column: ".concat(props.gridColumn, ";"); }, function (props) { return (props.right ? "flex-end" : "flex-start"); }, function (props) { return (props.right ? "right" : "left"); }, common.SLATE_600);
3741
- var templateObject_1$4;
4033
+ })(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"], ["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"])), function (props) { return props.gridColumn && "grid-column: ".concat(props.gridColumn, ";"); }, function (props) { return (props.right ? "flex-end" : "flex-start"); }, function (props) { return (props.right ? "right" : "left"); }, common.SLATE_600);
4034
+ var templateObject_1$3;
3742
4035
 
4036
+ var Text$8 = antd.Typography.Text;
3743
4037
  var TransactionDate = function (_a) {
3744
4038
  var date = _a.date;
3745
- return jsxRuntime.jsx("div", { children: common.Misc.formatDate(date) });
4039
+ return jsxRuntime.jsx(Text$8, __assign({ className: "text-sm" }, { children: common.Misc.formatDate(date) }));
3746
4040
  };
3747
4041
 
3748
4042
  var isInvoice = function (transaction) {
@@ -3757,8 +4051,15 @@ var TransactionRowTitle = function (_a) {
3757
4051
  return (jsxRuntime.jsx("span", __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: invoice.number })));
3758
4052
  };
3759
4053
 
4054
+ // TODO: delete
4055
+ var ArrowDownToLine = function (_a) {
4056
+ var className = _a.className, _b = _a.color, color = _b === void 0 ? common.SLATE_600 : _b;
4057
+ return (jsxRuntime.jsxs("svg", __assign({ className: className, fill: "none", height: "16", viewBox: "0 0 16 16", width: "16", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("path", { d: "M8 11.3333V2", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M4 7.33301L8 11.333L12 7.33301", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M12.6654 14H3.33203", stroke: color, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
4058
+ };
4059
+
3760
4060
  var TransactionDownload = function (_a) {
3761
4061
  var transaction = _a.transaction, token = _a.token, subdomain = _a.subdomain;
4062
+ var darkMode = React.useContext(BunnyContext).darkMode;
3762
4063
  var downloadFile = common.useDownloadFile();
3763
4064
  var isMobile = common.useIsMobile();
3764
4065
  var isClickable = transaction.kind === "INVOICE";
@@ -3767,11 +4068,12 @@ var TransactionDownload = function (_a) {
3767
4068
  return (jsxRuntime.jsx("div", __assign({ onClick: function (e) {
3768
4069
  e.stopPropagation();
3769
4070
  downloadFile("".concat(subdomain, "/api/pdf/invoice/").concat(transaction.transactionableId), token);
3770
- } }, { children: jsxRuntime.jsx(common.ArrowDownToLine, { className: isMobile ? "" : "show-on-hover" }) })));
4071
+ } }, { children: jsxRuntime.jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "show-on-hover"), color: darkMode ? common.WHITE : common.SLATE_600 }) })));
3771
4072
  };
3772
4073
 
4074
+ var Text$7 = antd.Typography.Text;
3773
4075
  var TransactionsEmptyState = function () {
3774
- return (jsxRuntime.jsx("div", __assign({ className: "flex justify-center p-4 text-base" }, { children: "There are no invoices" })));
4076
+ return (jsxRuntime.jsx(Text$7, __assign({ className: "flex justify-center p-4 text-base" }, { children: "There are no invoices" })));
3775
4077
  };
3776
4078
 
3777
4079
  var TransactionsListContext = React.createContext({});
@@ -3835,10 +4137,11 @@ var useGraphQLRequest = function () { return function (query, token, variables)
3835
4137
  });
3836
4138
  }); }; };
3837
4139
 
4140
+ var Text$6 = antd.Typography.Text;
3838
4141
  var TransactionsListDesktop = function (_a) {
3839
4142
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
3840
4143
  var columns = React.useContext(TransactionsListContext).columns;
3841
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
4144
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
3842
4145
  var showAmount = columns.includes("amount");
3843
4146
  var showDateAndTitle = columns.includes("date-and-title");
3844
4147
  var showDownload = columns.includes("download");
@@ -3850,15 +4153,18 @@ var TransactionsListDesktop = function (_a) {
3850
4153
  return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
3851
4154
  onTransactionClick(transaction);
3852
4155
  }, style: {
3853
- backgroundColor: index % 2 === 0 ? "white" : "rgba(100, 116, 139, 0.04)",
3854
- } }, { children: [showDateAndTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(TransactionDate, { date: transaction.createdAt }) })), jsxRuntime.jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx("div", { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] }))] })), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })), showState && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(StateTag, { state: transaction.state }) }))), showAmount && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: common.Misc.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) })))] }), index));
4156
+ backgroundColor: index % 2 === 0
4157
+ ? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
4158
+ : "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
4159
+ } }, { children: [showDateAndTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(TransactionDate, { date: transaction.createdAt }) })), jsxRuntime.jsxs(TransactionGridCell, __assign({ right: false, className: "flex items-center gap-2" }, { children: [jsxRuntime.jsx(Text$6, { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] }))] })), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })), showState && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(StateTag, { state: transaction.state }) }))), showAmount && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(Text$6, { children: common.Misc.formatCurrency(transaction.transactionable.amount || transaction.amount, transaction.currencyId) }) })))] }), index));
3855
4160
  });
3856
4161
  };
3857
4162
 
4163
+ var Text$5 = antd.Typography.Text;
3858
4164
  var TransactionsListMobile = function (_a) {
3859
4165
  var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
3860
4166
  var columns = React.useContext(TransactionsListContext).columns;
3861
- var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
4167
+ var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain, darkMode = _b.darkMode;
3862
4168
  var showAmount = columns.includes("amount");
3863
4169
  var showDateAndTitle = columns.includes("date-and-title");
3864
4170
  var showDownload = columns.includes("download");
@@ -3870,8 +4176,10 @@ var TransactionsListMobile = function (_a) {
3870
4176
  return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
3871
4177
  onTransactionClick(transaction);
3872
4178
  }, style: {
3873
- backgroundColor: index % 2 === 0 ? "white" : "rgba(100, 116, 139, 0.04)",
3874
- } }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxRuntime.jsx(TransactionDate, { date: transaction.createdAt })), showAmount && showDateAndTitle && jsxRuntime.jsx("div", { children: "\u00B7" }), showAmount && (jsxRuntime.jsx("div", { children: common.Misc.formatCurrency(transaction.transactionable.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })))] }), index));
4179
+ backgroundColor: index % 2 === 0
4180
+ ? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
4181
+ : "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
4182
+ } }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$5, { children: capitalizeFirstLetter(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-2" }, { children: [showDateAndTitle && (jsxRuntime.jsx(TransactionDate, { date: transaction.createdAt })), showAmount && showDateAndTitle && jsxRuntime.jsx(Text$5, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$5, { children: common.Misc.formatCurrency(transaction.transactionable.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, subdomain: subdomain }) })))] }), index));
3875
4183
  });
3876
4184
  };
3877
4185
 
@@ -3893,6 +4201,7 @@ var getTransactions = function (filter, token, subdomain, kindsToShow) { return
3893
4201
  })];
3894
4202
  case 1:
3895
4203
  response = _d.sent();
4204
+ console.log("response", response);
3896
4205
  return [4 /*yield*/, response.json()];
3897
4206
  case 2:
3898
4207
  _a = _d.sent(), data = _a.data, errors = _a.errors;
@@ -3920,6 +4229,7 @@ var PageContent = function (_a) {
3920
4229
  return (jsxRuntime.jsx("div", __assign({ className: className, ref: pageContentRef, style: style }, { children: children })));
3921
4230
  };
3922
4231
 
4232
+ var Text$4 = antd.Typography.Text;
3923
4233
  var PageHeaderWithActions = function (_a) {
3924
4234
  var children = _a.children, title = _a.title;
3925
4235
  var isMobile = common.useIsMobile();
@@ -3928,11 +4238,12 @@ var PageHeaderWithActions = function (_a) {
3928
4238
  var PageSubTitle = function (_a) {
3929
4239
  var title = _a.title;
3930
4240
  var secondaryColor = React.useContext(BrandContext).secondaryColor;
3931
- return (jsxRuntime.jsx("div", __assign({ className: "shrink-0 font-medium", style: { color: secondaryColor } }, { children: title })));
4241
+ var darkMode = React.useContext(BunnyContext).darkMode;
4242
+ return (jsxRuntime.jsx(Text$4, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title })));
3932
4243
  };
3933
4244
 
3934
4245
  function ActualTransactions() {
3935
- var _a = React.useContext(TransactionsListContext), showSearchBar = _a.showSearchBar, showTitle = _a.showTitle, transactionComponent = _a.transactionComponent, useModal = _a.useModal, onTransactionClick = _a.onTransactionClick, suppressTransactionDisplay = _a.suppressTransactionDisplay, kindsToShow = _a.kindsToShow, className = _a.className, shadow = _a.shadow, searchBarClassName = _a.searchBarClassName;
4246
+ var _a = React.useContext(TransactionsListContext), showSearchBar = _a.showSearchBar, showTitle = _a.showTitle, transactionComponent = _a.transactionComponent, useModal = _a.useModal, onTransactionClick = _a.onTransactionClick, suppressTransactionDisplay = _a.suppressTransactionDisplay, kindsToShow = _a.kindsToShow, className = _a.className, shadow = _a.shadow; _a.searchBarClassName; var style = _a.style;
3936
4247
  // Context
3937
4248
  var columns = React.useContext(TransactionsListContext).columns;
3938
4249
  var _b = React.useContext(BunnyContext), token = _b.token, subdomain = _b.subdomain;
@@ -3993,16 +4304,26 @@ function ActualTransactions() {
3993
4304
  }
3994
4305
  return templateColumns.join(" ");
3995
4306
  };
3996
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: showTitle ? "Past transactions" : undefined }, { children: showSearchBar && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName
3997
- ? searchBarClassName
3998
- : "bg-white border border-slate-200", onChange: function (e) {
4307
+ return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: showTitle ? "Past transactions" : undefined }, { children: showSearchBar && (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(antd.Input
4308
+ // className={
4309
+ // searchBarClassName
4310
+ // ? searchBarClassName
4311
+ // : "border border-slate-200"
4312
+ // }
4313
+ , {
4314
+ // className={
4315
+ // searchBarClassName
4316
+ // ? searchBarClassName
4317
+ // : "border border-slate-200"
4318
+ // }
4319
+ onChange: function (e) {
3999
4320
  if (isNaN(Number(e.target.value))) {
4000
4321
  return;
4001
4322
  }
4002
4323
  setSearch(e.target.value);
4003
4324
  }, prefix: jsxRuntime.jsx(SearchOutlined$1, {}), placeholder: "Search by id #", style: {
4004
4325
  minWidth: "300px",
4005
- }, value: search }) })) })), jsxRuntime.jsx(PageContent, __assign({ className: "flex w-full shadow-padding-xb ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: jsxRuntime.jsx("div", __assign({ className: "grid w-full bg-white rounded-md overflow-auto ".concat("shadow-".concat(shadow)), style: {
4326
+ }, value: search }) })) })), jsxRuntime.jsx(PageContent, __assign({ className: "flex w-full shadow-padding-xb ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: jsxRuntime.jsx("div", __assign({ className: "grid w-full rounded-md overflow-auto ".concat("shadow-".concat(shadow)), style: {
4006
4327
  gridTemplateColumns: gridTemplateColumns(),
4007
4328
  } }, { children: isMobile ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: TransactionsListMobile({
4008
4329
  transactions: transactions,
@@ -4010,7 +4331,7 @@ function ActualTransactions() {
4010
4331
  }) })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: TransactionsListDesktop({
4011
4332
  transactions: transactions,
4012
4333
  onTransactionClick: handleTransactionClick,
4013
- }) })) })) })), useModal ? (jsxRuntime.jsx(antd.Modal, __assign({ title: "Basic Modal", open: drawerOpen, onOk: function () { return setDrawerOpen(false); }, onCancel: function () { return setDrawerOpen(false); }, width: 900, footer: null }, { children: jsxRuntime.jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsxRuntime.jsx(antd.Drawer, __assign({ title: "Invoice", onClose: function () { return setDrawerOpen(false); }, open: drawerOpen, width: 900 }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsxRuntime.jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsxRuntime.jsx("div", { children: "Not an invoice, or no transaction selected" })) })))] }));
4334
+ }) })) })) })), useModal ? (jsxRuntime.jsx(antd.Modal, __assign({ title: "Basic Modal", open: drawerOpen, onOk: function () { return setDrawerOpen(false); }, onCancel: function () { return setDrawerOpen(false); }, width: 900, footer: null }, { children: jsxRuntime.jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsxRuntime.jsx(antd.Drawer, __assign({ title: "Invoice", onClose: function () { return setDrawerOpen(false); }, open: drawerOpen, width: 900 }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsxRuntime.jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsxRuntime.jsx("div", { children: "Not an invoice, or no transaction selected" })) })))] })));
4014
4335
  }
4015
4336
  // Create a client
4016
4337
  var queryClient = new reactQuery.QueryClient();
@@ -4020,7 +4341,7 @@ function Transactions(_a) {
4020
4341
  common.TransactionKind.PAYMENT,
4021
4342
  common.TransactionKind.REFUND,
4022
4343
  common.TransactionKind.WRITE_OFF,
4023
- ] : _h;
4344
+ ] : _h, style = _a.style;
4024
4345
  var contextValues = {
4025
4346
  showSearchBar: showSearchBar,
4026
4347
  showTitle: showTitle,
@@ -4033,6 +4354,7 @@ function Transactions(_a) {
4033
4354
  onTransactionClick: onTransactionClick,
4034
4355
  suppressTransactionDisplay: suppressTransactionDisplay,
4035
4356
  kindsToShow: kindsToShow,
4357
+ style: style,
4036
4358
  };
4037
4359
  return (jsxRuntime.jsx(reactQuery.QueryClientProvider, __assign({ client: queryClient }, { children: jsxRuntime.jsx(TransactionsListContext.Provider, __assign({ value: contextValues }, { children: jsxRuntime.jsx(ActualTransactions, {}) })) })));
4038
4360
  }
@@ -4498,29 +4820,7 @@ var ErrorView = function (_a) {
4498
4820
  return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full", style: { marginTop: "80px" } }, { children: [jsxRuntime.jsx("div", __assign({ style: { fontSize: "32px" } }, { children: message })), children] })));
4499
4821
  };
4500
4822
 
4501
- var BunnyFooterIcon = function (_a) {
4502
- var color = _a.color;
4503
- return (jsxRuntime.jsxs("svg", __assign({ width: "45", height: "15", viewBox: "0 0 39 13", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsxs("g", __assign({ clipPath: "url(#clip0_6_851)" }, { children: [jsxRuntime.jsx("path", { className: "icon-path", d: "M14.5898 7.19708C14.5898 9.35053 13.0926 10.325 11.2495 10.325C9.39955 10.325 7.90234 9.35001 7.90234 7.18967V3.26221H10.1125V7.00052C10.1125 7.87719 10.5855 8.27725 11.2495 8.27725C11.9061 8.27725 12.3865 7.87719 12.3865 7.00052V3.26221H14.5898V7.19708Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M31.8943 12.9625H29.4793L31.8523 8.62816L28.9355 3.26221H31.4708L33.0457 6.35524L34.5924 3.26221H37.0075L31.8943 12.9625Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M15.1602 5.96827C15.1602 3.8148 16.6574 2.84033 18.5005 2.84033C20.3504 2.84033 21.8476 3.81533 21.8476 5.97568V10.1473H19.6374V6.16483C19.6374 5.28815 19.1645 4.8881 18.5005 4.8881C17.8439 4.8881 17.3634 5.28815 17.3634 6.16483V10.1473H15.1602V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M22.4316 5.96827C22.4316 3.8148 23.9289 2.84033 25.7719 2.84033C27.6219 2.84033 29.1191 3.81533 29.1191 5.97568V10.1473H26.9089V6.16483C26.9089 5.28815 26.4359 4.8881 25.7719 4.8881C25.1154 4.8881 24.6349 5.28815 24.6349 6.16483V10.1473H22.4316V5.96827Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M7.40511 6.68957C7.40511 8.7236 6.02815 10.3227 4.17816 10.3227C3.23907 10.3227 2.61071 9.94378 2.19358 9.40371V10.1404H0.0605469V0.0405273H2.26381V3.91939C2.68041 3.42158 3.28802 3.07069 4.17763 3.07069C6.02759 3.07069 7.40511 4.66981 7.40511 6.68957ZM2.17229 6.69642C2.17229 7.60802 2.77937 8.2744 3.64823 8.2744C4.53783 8.2744 5.13107 7.59372 5.13107 6.69642C5.13107 5.79912 4.53783 5.11844 3.64823 5.11844C2.77937 5.11844 2.17229 5.78482 2.17229 6.69642Z", fill: color }), jsxRuntime.jsx("path", { className: "icon-path", d: "M38.966 8.94801C38.966 9.76181 38.2668 10.4631 37.4618 10.4631C36.6499 10.4631 35.9434 9.76181 35.9434 8.94801C35.9434 8.14846 36.6494 7.46094 37.4618 7.46094C38.2668 7.46094 38.966 8.14846 38.966 8.94801Z", fill: color })] })), jsxRuntime.jsx("defs", { children: jsxRuntime.jsx("clipPath", __assign({ id: "clip0_6_851" }, { children: jsxRuntime.jsx("rect", { width: "39", height: "13", fill: "white" }) })) })] })));
4504
- };
4505
-
4506
- var Footer = function () {
4507
- var _a = common.useCurrentUserData(), privacyUrl = _a.privacyUrl, termsUrl = _a.termsUrl;
4508
- var isMobile = common.useIsMobile();
4509
- var quotePreviewData = recoil.useRecoilValue(planPickerQuoteDataState);
4510
- var selectedPriceList = quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList;
4511
- if (selectedPriceList && isMobile)
4512
- return null;
4513
- return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between shrink-0 ".concat(isMobile ? "flex-col gap-2 grow" : "px-12") }, { children: [(termsUrl || privacyUrl) && (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-3" }, { children: [termsUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Terms" }))), privacyUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "text-xs text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Privacy" })))] }))), jsxRuntime.jsx(BunnyMarketingLink, {})] })));
4514
- };
4515
- var BunnyMarketingLink = function () {
4516
- var _a = React.useState(false), isHovered = _a[0], setIsHovered = _a[1];
4517
- var isMobile = common.useIsMobile();
4518
- return (jsxRuntime.jsx("div", __assign({ className: "flex items-end justify-end ".concat(isMobile ? "" : "grow") }, { children: jsxRuntime.jsx(StyledBunnyLink, __assign({ className: "flex items-end justify-end text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: ["Powered by\u00A0", jsxRuntime.jsx("div", __assign({ style: { paddingTop: "5px" } }, { children: jsxRuntime.jsx(BunnyFooterIcon, { color: isHovered ? common.PRIMARY_COLOR : common.SLATE_400 }) }))] })) })) })));
4519
- };
4520
- var StyedLink = styled__default["default"].a(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"], ["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n"])), common.SLATE_400, common.SLATE_500);
4521
- var StyledBunnyLink = styled__default["default"](StyedLink)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), common.PRIMARY_COLOR);
4522
- var templateObject_1$3, templateObject_2;
4523
-
4823
+ var Text$3 = antd.Typography.Text;
4524
4824
  var HideExpiredToggle = function (_a) {
4525
4825
  var hideExpired = _a.hideExpired, setHideExpired = _a.setHideExpired, subscriptions = _a.subscriptions;
4526
4826
  var isMobile = common.useIsMobile();
@@ -4534,16 +4834,11 @@ var HideExpiredToggle = function (_a) {
4534
4834
  return null;
4535
4835
  return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4 pl-4" }, { children: [!isMobile && jsxRuntime.jsx(antd.Divider, { className: "h-5", type: "vertical" }), jsxRuntime.jsx(StyledCheckbox, { children: jsxRuntime.jsx(antd.Checkbox, __assign({ checked: hideExpired, onChange: function (e) { return setHideExpired(e.target.checked); }, style: {
4536
4836
  color: secondaryColor,
4537
- } }, { children: isMobile ? "Hide inactive" : "Hide inactive subscriptions" })) })] })));
4837
+ } }, { children: jsxRuntime.jsx(Text$3, { children: isMobile ? "Hide inactive" : "Hide inactive subscriptions" }) })) })] })));
4538
4838
  };
4539
4839
  var StyledCheckbox = styled__default["default"].div(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n .ant-checkbox-wrapper span {\n padding-inline-end: 0 !important;\n }\n"], ["\n .ant-checkbox-wrapper span {\n padding-inline-end: 0 !important;\n }\n"])));
4540
4840
  var templateObject_1$2;
4541
4841
 
4542
- var SubscriptionsListCell = function (_a) {
4543
- var children = _a.children, className = _a.className, gridColumn = _a.gridColumn, right = _a.right, style = _a.style;
4544
- return (jsxRuntime.jsx("div", __assign({ className: "flex items-center text-sm whitespace-nowrap ".concat(className), style: __assign({ gridColumn: gridColumn, textAlign: right ? "right" : "left", justifyContent: right ? "flex-end" : "flex-start" }, style) }, { children: children })));
4545
- };
4546
-
4547
4842
  var SubscriptionState;
4548
4843
  (function (SubscriptionState) {
4549
4844
  SubscriptionState["ACTIVE"] = "ACTIVE";
@@ -4554,195 +4849,20 @@ var SubscriptionState;
4554
4849
  })(SubscriptionState || (SubscriptionState = {}));
4555
4850
  var SubscriptionState$1 = SubscriptionState;
4556
4851
 
4557
- var Card = function (_a) {
4558
- var children = _a.children, className = _a.className;
4559
- return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col bg-white rounded-md shadow-md ".concat(className) }, { children: children })));
4560
- };
4561
-
4562
- var MUTATION = "\nmutation quoteSubscriptionReinstate($ids: [ID!]!) {\n quoteSubscriptionReinstate(ids: $ids) {\n quote {\n id\n uuid\n accountId\n dealId\n name\n amount\n taxAmount\n discount\n netPaymentDays\n acceptedByName\n acceptedByTitle\n state\n billingDay\n evergreen\n requiresApproval\n isPendingApprovalRequest\n poNumber\n kind\n currencyId\n ownerId\n contactId\n quoteChanges {\n id\n priceListId\n charges {\n id\n pricingModel\n chargeType\n billingPeriod\n price\n priceDecimals\n tieredAveragePrice\n quantity\n quantityMin\n quantityMax\n discount\n amount\n prorationRate\n name\n invoiceLineText\n createdAt\n updatedAt\n startDate\n endDate\n billingPeriodAmounts { id amount prorationRate }\n currencyId\n couponId\n feature { id name code isUnit unitName }\n priceTiers { starts price }\n }\n }\n expiresAt\n createdAt\n updatedAt\n startDate\n endDate\n invoiceUntil\n applicationDate\n applied\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n notes\n message\n amountsByPeriod {\n id\n name\n amount\n }\n subtotal\n credits\n discountValue\n }\n }\n}\n";
4563
- var getGuoteSubscriptionReinstate = function (_a) {
4564
- var ids = _a.ids, token = _a.token, subdomain = _a.subdomain;
4852
+ var FEATURE_USAGE_MUTATION = "\nquery GetFeatureUsage($id: ID!) {\n featureUsageHistogram(subscriptionChargeId: $id) {\n subscriptionCharge { \n id\n name\n amount\n currentPeriodPriceByTiers { \n tier { starts price } \n quantity\n amount\n }\n }\n feature { id name }\n periodRange\n dataInterval\n data {\n periodStart\n periodEnd\n intervals {\n intervalStart\n intervalUsage\n }\n intervalsTotal\n }\n }\n}\n";
4853
+ var getFeatureUsage = function (_a) {
4854
+ var subscriptionChargeId = _a.subscriptionChargeId; _a.startDate; _a.endDate; _a.dataInterval; var token = _a.token;
4565
4855
  return __awaiter(void 0, void 0, void 0, function () {
4566
- var vars, response, _b, errors, quote;
4856
+ var vars, response;
4857
+ var _b;
4567
4858
  return __generator(this, function (_c) {
4568
4859
  switch (_c.label) {
4569
4860
  case 0:
4570
- vars = { ids: ids };
4861
+ vars = {
4862
+ id: subscriptionChargeId,
4863
+ };
4571
4864
  return [4 /*yield*/, common.gqlRequest({
4572
- query: MUTATION,
4573
- token: token,
4574
- vars: vars,
4575
- subdomain: subdomain,
4576
- })];
4577
- case 1:
4578
- response = _c.sent();
4579
- _b = response === null || response === void 0 ? void 0 : response.quoteSubscriptionReinstate, errors = _b.errors, quote = _b.quote;
4580
- if (errors)
4581
- throw errors;
4582
- return [2 /*return*/, quote];
4583
- }
4584
- });
4585
- });
4586
- };
4587
-
4588
- var useCancelSubscription = function () {
4589
- var graphQLRequest = useGraphQLRequest();
4590
- return function (subscriptionIds, token) { return __awaiter(void 0, void 0, void 0, function () {
4591
- var data;
4592
- var _a;
4593
- return __generator(this, function (_b) {
4594
- switch (_b.label) {
4595
- case 0: return [4 /*yield*/, graphQLRequest("\n mutation SubscriptionCancel($subscriptionIds: [ID!]!) {\n subscriptionCancel(ids: $subscriptionIds) {\n subscriptions {\n accountId\n state\n }\n }\n }", token, { subscriptionIds: subscriptionIds })];
4596
- case 1:
4597
- data = _b.sent();
4598
- return [2 /*return*/, (_a = data === null || data === void 0 ? void 0 : data.subscriptions) === null || _a === void 0 ? void 0 : _a.nodes];
4599
- }
4600
- });
4601
- }); };
4602
- };
4603
-
4604
- var SubscriptionCardActions = function (_a) {
4605
- var _b, _c;
4606
- var planChangeOptions = _a.planChangeOptions, subscription = _a.subscription, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible;
4607
- // Context
4608
- var _d = React.useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
4609
- var _e = React.useContext(SubscriptionsContext), onChangePlanClick = _e.onChangePlanClick, onClickUpgrade = _e.onClickUpgrade, isTempViewOnly = _e.isTempViewOnly;
4610
- // Hooks
4611
- var showSuccessNotification = common.NotificationUtils.useSuccessNotification();
4612
- var cancelSubscription = useCancelSubscription();
4613
- var queryClient = reactQuery.useQueryClient();
4614
- // const navigate = usePortalNavigate();
4615
- // const handleUpgradingSubscriptionChange =
4616
- // useHandleUpgradingSubscriptionChange();
4617
- // Derived state
4618
- var canShowCancelButton = subscription.plan.selfServiceCancel;
4619
- var productPlans = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.filter(function (plan) { var _a; return ((_a = plan.priceLists) === null || _a === void 0 ? void 0 : _a.length) > 0 && plan.productId === subscription.product.id; });
4620
- var canShowChangePlanButton = ((productPlans === null || productPlans === void 0 ? void 0 : productPlans.length) || 0) > 0;
4621
- // Mutations
4622
- var subscriptionCancel = reactQuery.useMutation({
4623
- mutationFn: function () { return cancelSubscription([subscription.id], token); },
4624
- onSuccess: function () {
4625
- queryClient.invalidateQueries({
4626
- queryKey: common.QueryKeyFactory.default.createTableKey("subscriptions"),
4627
- });
4628
- showSuccessNotification("Subscription canceled");
4629
- },
4630
- });
4631
- reactQuery.useMutation({
4632
- mutationFn: function () {
4633
- return getGuoteSubscriptionReinstate({
4634
- ids: [subscription.id],
4635
- token: token,
4636
- subdomain: subdomain,
4637
- });
4638
- },
4639
- onSuccess: function (quote) {
4640
- setEditingQuoteData({ id: quote.id, isTrial: false });
4641
- setPayModalVisible(true);
4642
- },
4643
- });
4644
- // Handlers
4645
- var handleChangePlanClick = function () {
4646
- // handleUpgradingSubscriptionChange({
4647
- // subscription,
4648
- // });
4649
- console.log("handleChangePlanClick handleUpgradingSubscriptionChange not implemented");
4650
- // navigate("plan-manager", {
4651
- // subscriptionUpgradeId: subscription.id,
4652
- // });
4653
- onChangePlanClick();
4654
- };
4655
- return (canShowChangePlanButton || canShowCancelButton) &&
4656
- canShowSubscriptionActions(subscription) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!isTempViewOnly && canShowCancelButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ icon: null, onConfirm: function () { return subscriptionCancel.mutate(); }, title: "Cancel subscription" }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "p-0", type: "link" }, { children: "Cancel subscription" })) }))), !isTempViewOnly && canShowChangePlanButton && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return handleChangePlanClick(); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === common.SubscriptionState.TRIAL ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isTempViewOnly && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () {
4657
- // handleUpgradingSubscriptionChange({
4658
- // subscription,
4659
- // });
4660
- console.log("onClickUpgrade handleUpgradingSubscriptionChange not implemented");
4661
- // navigate("plan-manager", {
4662
- // subscriptionUpgradeId: subscription.id,
4663
- // });
4664
- onClickUpgrade();
4665
- }, type: "primary" }, { children: "Upgrade" }))) })) : null;
4666
- };
4667
-
4668
- var getSubscriptionStatusText = function (subscription) {
4669
- var cancellationDate = subscription.cancellationDate, state = subscription.state, evergreen = subscription.evergreen, endDate = subscription.endDate;
4670
- if (cancellationDate &&
4671
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.CANCELED &&
4672
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.EXPIRED) {
4673
- return (jsxRuntime.jsxs(antd.Tag, __assign({ color: "red" }, { children: ["Canceled - ends on ", common.Misc.formatDate(cancellationDate)] })));
4674
- }
4675
- if (evergreen) {
4676
- return "Renews on ".concat(common.Misc.formatDate(endDate));
4677
- }
4678
- if ((state === null || state === void 0 ? void 0 : state.toUpperCase()) === common.SubscriptionState.CANCELED ||
4679
- (state === null || state === void 0 ? void 0 : state.toUpperCase()) === common.SubscriptionState.EXPIRED) {
4680
- return "Ended on ".concat(common.Misc.formatDate(endDate));
4681
- }
4682
- return "Ends on ".concat(common.Misc.formatDate(endDate));
4683
- };
4684
- var SubscriptionCardHeader = function (_a) {
4685
- var _b, _c, _d, _e, _f;
4686
- var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
4687
- var isMobile = common.useIsMobile();
4688
- // Derived state
4689
- var trialDaysLeft = dayjs(subscription.trialEndDate).diff(dayjs(), "days");
4690
- var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
4691
- return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx("div", __assign({ className: "font-medium text-orange-500", style: { fontSize: "11px" } }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsxRuntime.jsx("span", __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(antd.Tag, __assign({ className: "ant-tag-".concat(common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()]) }, { children: [lodash.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsxRuntime.jsx("div", __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && (jsxRuntime.jsx(SubscriptionCardActions, { planChangeOptions: planChangeOptions, subscription: subscription, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible }))] }))] })));
4692
- };
4693
-
4694
- var SubscriptionCardColumnHeaders = function (_a) {
4695
- var columns = _a.columns;
4696
- return columns.map(function (subscriptionColumn, index) { return (jsxRuntime.jsx("div", __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); });
4697
- };
4698
-
4699
- var BillingPeriodConverter;
4700
- (function (BillingPeriodConverter) {
4701
- BillingPeriodConverter["ONCE"] = "once";
4702
- BillingPeriodConverter["MONTHLY"] = "monthly";
4703
- BillingPeriodConverter["ANNUAL"] = "annually";
4704
- BillingPeriodConverter["SEMI_ANNUAL"] = "semi annually";
4705
- BillingPeriodConverter["QUARTERLY"] = "quarterly";
4706
- })(BillingPeriodConverter || (BillingPeriodConverter = {}));
4707
- var SubscriptionChargeTotal = function (_a) {
4708
- var charge = _a.charge, subscription = _a.subscription;
4709
- var isMobile = common.useIsMobile();
4710
- return (jsxRuntime.jsxs("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: [jsxRuntime.jsx("div", { children: common.Misc.formatCurrency(Number(charge.periodPrice), subscription.currencyId) }), charge.billingPeriod && (jsxRuntime.jsx("div", { children: BillingPeriodConverter[charge.billingPeriod] }))] })));
4711
- };
4712
-
4713
- var SubscriptionChargeUnitPrice = function (_a) {
4714
- var _b, _c;
4715
- var charge = _a.charge, subscription = _a.subscription;
4716
- var _d = React.useState(false), showPriceTiers = _d[0], setShowPriceTiers = _d[1];
4717
- if ((_c = (_b = charge.priceListCharge) === null || _b === void 0 ? void 0 : _b.priceListChargeTiers) === null || _c === void 0 ? void 0 : _c.length) {
4718
- return (jsxRuntime.jsx(antd.Dropdown, __assign({ dropdownRender: function () {
4719
- var _a, _b;
4720
- return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 bg-white p-2" }, { children: jsxRuntime.jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b.map(function (tier, index) {
4721
- var _a, _b, _c, _d, _e;
4722
- var ends = ((_c = (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b[index + 1]) === null || _c === void 0 ? void 0 : _c.starts)
4723
- ? ((_e = (_d = charge.priceListCharge) === null || _d === void 0 ? void 0 : _d.priceListChargeTiers[index + 1]) === null || _e === void 0 ? void 0 : _e.starts) - 1
4724
- : "∞";
4725
- return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " ", ":"] })), jsxRuntime.jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: common.Misc.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
4726
- }) })) })));
4727
- }, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsxRuntime.jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "hide details" : "show details" })) })));
4728
- }
4729
- return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.Misc.formatCurrency(charge.discountedPrice, subscription.currencyId) }));
4730
- };
4731
-
4732
- var FEATURE_USAGE_MUTATION = "\nquery GetFeatureUsage($id: ID!) {\n featureUsageHistogram(subscriptionChargeId: $id) {\n subscriptionCharge { \n id\n name\n amount\n currentPeriodPriceByTiers { \n tier { starts price } \n quantity\n amount\n }\n }\n feature { id name }\n periodRange\n dataInterval\n data {\n periodStart\n periodEnd\n intervals {\n intervalStart\n intervalUsage\n }\n intervalsTotal\n }\n }\n}\n";
4733
- var getFeatureUsage = function (_a) {
4734
- var subscriptionChargeId = _a.subscriptionChargeId; _a.startDate; _a.endDate; _a.dataInterval; var token = _a.token;
4735
- return __awaiter(void 0, void 0, void 0, function () {
4736
- var vars, response;
4737
- var _b;
4738
- return __generator(this, function (_c) {
4739
- switch (_c.label) {
4740
- case 0:
4741
- vars = {
4742
- id: subscriptionChargeId,
4743
- };
4744
- return [4 /*yield*/, common.gqlRequest({
4745
- query: FEATURE_USAGE_MUTATION,
4865
+ query: FEATURE_USAGE_MUTATION,
4746
4866
  token: token,
4747
4867
  vars: vars,
4748
4868
  })];
@@ -4913,6 +5033,191 @@ var FeatureBarChart = function (_a) {
4913
5033
  var StyledBarChart = styled__default["default"](recharts.BarChart)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n .recharts-surface {\n overflow: visible;\n }\n"], ["\n .recharts-surface {\n overflow: visible;\n }\n"])));
4914
5034
  var templateObject_1;
4915
5035
 
5036
+ var MUTATION = "\nmutation quoteSubscriptionReinstate($ids: [ID!]!) {\n quoteSubscriptionReinstate(ids: $ids) {\n quote {\n id\n uuid\n accountId\n dealId\n name\n amount\n taxAmount\n discount\n netPaymentDays\n acceptedByName\n acceptedByTitle\n state\n billingDay\n evergreen\n requiresApproval\n isPendingApprovalRequest\n poNumber\n kind\n currencyId\n ownerId\n contactId\n quoteChanges {\n id\n priceListId\n charges {\n id\n pricingModel\n chargeType\n billingPeriod\n price\n priceDecimals\n tieredAveragePrice\n quantity\n quantityMin\n quantityMax\n discount\n amount\n prorationRate\n name\n invoiceLineText\n createdAt\n updatedAt\n startDate\n endDate\n billingPeriodAmounts { id amount prorationRate }\n currencyId\n couponId\n feature { id name code isUnit unitName }\n priceTiers { starts price }\n }\n }\n expiresAt\n createdAt\n updatedAt\n startDate\n endDate\n invoiceUntil\n applicationDate\n applied\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n notes\n message\n amountsByPeriod {\n id\n name\n amount\n }\n subtotal\n credits\n discountValue\n }\n }\n}\n";
5037
+ var getGuoteSubscriptionReinstate = function (_a) {
5038
+ var ids = _a.ids, token = _a.token, subdomain = _a.subdomain;
5039
+ return __awaiter(void 0, void 0, void 0, function () {
5040
+ var vars, response, _b, errors, quote;
5041
+ return __generator(this, function (_c) {
5042
+ switch (_c.label) {
5043
+ case 0:
5044
+ vars = { ids: ids };
5045
+ return [4 /*yield*/, common.gqlRequest({
5046
+ query: MUTATION,
5047
+ token: token,
5048
+ vars: vars,
5049
+ subdomain: subdomain,
5050
+ })];
5051
+ case 1:
5052
+ response = _c.sent();
5053
+ _b = response === null || response === void 0 ? void 0 : response.quoteSubscriptionReinstate, errors = _b.errors, quote = _b.quote;
5054
+ if (errors)
5055
+ throw errors;
5056
+ return [2 /*return*/, quote];
5057
+ }
5058
+ });
5059
+ });
5060
+ };
5061
+
5062
+ var useCancelSubscription = function () {
5063
+ var graphQLRequest = useGraphQLRequest();
5064
+ return function (subscriptionIds, token) { return __awaiter(void 0, void 0, void 0, function () {
5065
+ var data;
5066
+ var _a;
5067
+ return __generator(this, function (_b) {
5068
+ switch (_b.label) {
5069
+ case 0: return [4 /*yield*/, graphQLRequest("\n mutation SubscriptionCancel($subscriptionIds: [ID!]!) {\n subscriptionCancel(ids: $subscriptionIds) {\n subscriptions {\n accountId\n state\n }\n }\n }", token, { subscriptionIds: subscriptionIds })];
5070
+ case 1:
5071
+ data = _b.sent();
5072
+ return [2 /*return*/, (_a = data === null || data === void 0 ? void 0 : data.subscriptions) === null || _a === void 0 ? void 0 : _a.nodes];
5073
+ }
5074
+ });
5075
+ }); };
5076
+ };
5077
+
5078
+ var SubscriptionCardActions = function (_a) {
5079
+ var _b, _c;
5080
+ var planChangeOptions = _a.planChangeOptions, subscription = _a.subscription, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible;
5081
+ // Context
5082
+ var _d = React.useContext(BunnyContext), token = _d.token, subdomain = _d.subdomain;
5083
+ var _e = React.useContext(SubscriptionsContext), onChangePlanClick = _e.onChangePlanClick, onClickUpgrade = _e.onClickUpgrade, isTempViewOnly = _e.isTempViewOnly;
5084
+ // Hooks
5085
+ var showSuccessNotification = common.NotificationUtils.useSuccessNotification();
5086
+ var cancelSubscription = useCancelSubscription();
5087
+ var queryClient = reactQuery.useQueryClient();
5088
+ // const navigate = usePortalNavigate();
5089
+ // const handleUpgradingSubscriptionChange =
5090
+ // useHandleUpgradingSubscriptionChange();
5091
+ // Derived state
5092
+ var canShowCancelButton = subscription.plan.selfServiceCancel;
5093
+ var productPlans = (_b = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _b === void 0 ? void 0 : _b.filter(function (plan) { var _a; return ((_a = plan.priceLists) === null || _a === void 0 ? void 0 : _a.length) > 0 && plan.productId === subscription.product.id; });
5094
+ var canShowChangePlanButton = ((productPlans === null || productPlans === void 0 ? void 0 : productPlans.length) || 0) > 0;
5095
+ // Mutations
5096
+ var subscriptionCancel = reactQuery.useMutation({
5097
+ mutationFn: function () { return cancelSubscription([subscription.id], token); },
5098
+ onSuccess: function () {
5099
+ queryClient.invalidateQueries({
5100
+ queryKey: common.QueryKeyFactory.default.createTableKey("subscriptions"),
5101
+ });
5102
+ showSuccessNotification("Subscription canceled");
5103
+ },
5104
+ });
5105
+ reactQuery.useMutation({
5106
+ mutationFn: function () {
5107
+ return getGuoteSubscriptionReinstate({
5108
+ ids: [subscription.id],
5109
+ token: token,
5110
+ subdomain: subdomain,
5111
+ });
5112
+ },
5113
+ onSuccess: function (quote) {
5114
+ setEditingQuoteData({ id: quote.id, isTrial: false });
5115
+ setPayModalVisible(true);
5116
+ },
5117
+ });
5118
+ // Handlers
5119
+ var handleChangePlanClick = function () {
5120
+ // handleUpgradingSubscriptionChange({
5121
+ // subscription,
5122
+ // });
5123
+ console.log("handleChangePlanClick handleUpgradingSubscriptionChange not implemented");
5124
+ // navigate("plan-manager", {
5125
+ // subscriptionUpgradeId: subscription.id,
5126
+ // });
5127
+ onChangePlanClick();
5128
+ };
5129
+ return (canShowChangePlanButton || canShowCancelButton) &&
5130
+ canShowSubscriptionActions(subscription) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!isTempViewOnly && canShowCancelButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ icon: null, onConfirm: function () { return subscriptionCancel.mutate(); }, title: "Cancel subscription" }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "p-0", type: "link" }, { children: "Cancel subscription" })) }))), !isTempViewOnly && canShowChangePlanButton && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return handleChangePlanClick(); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === common.SubscriptionState.TRIAL ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isTempViewOnly && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () {
5131
+ // handleUpgradingSubscriptionChange({
5132
+ // subscription,
5133
+ // });
5134
+ console.log("onClickUpgrade handleUpgradingSubscriptionChange not implemented");
5135
+ // navigate("plan-manager", {
5136
+ // subscriptionUpgradeId: subscription.id,
5137
+ // });
5138
+ onClickUpgrade();
5139
+ }, type: "primary" }, { children: "Upgrade" }))) })) : null;
5140
+ };
5141
+
5142
+ var Text$2 = antd.Typography.Text;
5143
+ var getSubscriptionStatusText = function (subscription) {
5144
+ var cancellationDate = subscription.cancellationDate, state = subscription.state, evergreen = subscription.evergreen, endDate = subscription.endDate;
5145
+ if (cancellationDate &&
5146
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.CANCELED &&
5147
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.EXPIRED) {
5148
+ return (jsxRuntime.jsxs(antd.Tag, __assign({ color: "red" }, { children: ["Canceled - ends on ", common.Misc.formatDate(cancellationDate)] })));
5149
+ }
5150
+ if (evergreen) {
5151
+ return "Renews on ".concat(common.Misc.formatDate(endDate));
5152
+ }
5153
+ if ((state === null || state === void 0 ? void 0 : state.toUpperCase()) === common.SubscriptionState.CANCELED ||
5154
+ (state === null || state === void 0 ? void 0 : state.toUpperCase()) === common.SubscriptionState.EXPIRED) {
5155
+ return "Ended on ".concat(common.Misc.formatDate(endDate));
5156
+ }
5157
+ return "Ends on ".concat(common.Misc.formatDate(endDate));
5158
+ };
5159
+ var SubscriptionCardHeader = function (_a) {
5160
+ var _b, _c, _d, _e, _f;
5161
+ var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
5162
+ var darkMode = React.useContext(BunnyContext).darkMode;
5163
+ var isMobile = common.useIsMobile();
5164
+ // Derived state
5165
+ var trialDaysLeft = dayjs(subscription.trialEndDate).diff(dayjs(), "days");
5166
+ var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
5167
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between", style: {
5168
+ backgroundColor: darkMode ? "var(--row-background-dark)" : "",
5169
+ } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx("div", __assign({ className: "font-medium text-orange-500", style: { fontSize: "11px" } }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "flex grow items-center gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && (jsxRuntime.jsx(Text$2, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(antd.Tag, __assign({ className: "ant-tag-".concat(common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()]) }, { children: [lodash.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsxRuntime.jsx(Text$2, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && (jsxRuntime.jsx(SubscriptionCardActions, { planChangeOptions: planChangeOptions, subscription: subscription, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible }))] }))] })));
5170
+ };
5171
+
5172
+ var BillingPeriodConverter;
5173
+ (function (BillingPeriodConverter) {
5174
+ BillingPeriodConverter["ONCE"] = "once";
5175
+ BillingPeriodConverter["MONTHLY"] = "monthly";
5176
+ BillingPeriodConverter["ANNUAL"] = "annually";
5177
+ BillingPeriodConverter["SEMI_ANNUAL"] = "semi annually";
5178
+ BillingPeriodConverter["QUARTERLY"] = "quarterly";
5179
+ })(BillingPeriodConverter || (BillingPeriodConverter = {}));
5180
+ var SubscriptionChargeTotal = function (_a) {
5181
+ var charge = _a.charge, subscription = _a.subscription;
5182
+ var isMobile = common.useIsMobile();
5183
+ return (jsxRuntime.jsxs("div", __assign({ className: "flex gap-1 ".concat(isMobile ? "flex-col" : "") }, { children: [jsxRuntime.jsx("div", { children: common.Misc.formatCurrency(Number(charge.periodPrice), subscription.currencyId) }), charge.billingPeriod && (jsxRuntime.jsx("div", { children: BillingPeriodConverter[charge.billingPeriod] }))] })));
5184
+ };
5185
+
5186
+ var SubscriptionChargeUnitPrice = function (_a) {
5187
+ var _b, _c;
5188
+ var charge = _a.charge, subscription = _a.subscription;
5189
+ var darkMode = React.useContext(BunnyContext).darkMode;
5190
+ var _d = React.useState(false), showPriceTiers = _d[0], setShowPriceTiers = _d[1];
5191
+ if ((_c = (_b = charge.priceListCharge) === null || _b === void 0 ? void 0 : _b.priceListChargeTiers) === null || _c === void 0 ? void 0 : _c.length) {
5192
+ return (jsxRuntime.jsx(antd.Dropdown, __assign({ dropdownRender: function () {
5193
+ var _a, _b;
5194
+ return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col rounded border border-solid border-slate-200 p-2", style: {
5195
+ backgroundColor: darkMode
5196
+ ? "var(--row-background-dark)"
5197
+ : "var(--row-background)",
5198
+ } }, { children: jsxRuntime.jsx("div", __assign({ className: "grid grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b.map(function (tier, index) {
5199
+ var _a, _b, _c, _d, _e;
5200
+ var ends = ((_c = (_b = (_a = charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.priceListChargeTiers) === null || _b === void 0 ? void 0 : _b[index + 1]) === null || _c === void 0 ? void 0 : _c.starts)
5201
+ ? ((_e = (_d = charge.priceListCharge) === null || _d === void 0 ? void 0 : _d.priceListChargeTiers[index + 1]) === null || _e === void 0 ? void 0 : _e.starts) - 1
5202
+ : "∞";
5203
+ return (jsxRuntime.jsxs("div", __assign({ className: "contents" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " ", ":"] })), jsxRuntime.jsx("div", __assign({ className: "whitespace-nowrap text-right" }, { children: common.Misc.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
5204
+ }) })) })));
5205
+ }, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsxRuntime.jsx("div", __assign({ className: "cursor-pointer underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "hide details" : "show details" })) })));
5206
+ }
5207
+ return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.Misc.formatCurrency(charge.discountedPrice, subscription.currencyId) }));
5208
+ };
5209
+
5210
+ var SubscriptionCardColumnHeaders = function (_a) {
5211
+ var columns = _a.columns;
5212
+ return columns.map(function (subscriptionColumn, index) { return (jsxRuntime.jsx("div", __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); });
5213
+ };
5214
+
5215
+ var Text$1 = antd.Typography.Text;
5216
+ var SubscriptionsListCell = function (_a) {
5217
+ var children = _a.children, className = _a.className, gridColumn = _a.gridColumn, right = _a.right, style = _a.style;
5218
+ return (jsxRuntime.jsx(Text$1, __assign({ className: "flex items-center text-sm whitespace-nowrap ".concat(className), style: __assign({ gridColumn: gridColumn, textAlign: right ? "right" : "left", justifyContent: right ? "flex-end" : "flex-start" }, style) }, { children: children })));
5219
+ };
5220
+
4916
5221
  var createCardColumns = function () { return [
4917
5222
  {
4918
5223
  title: "CHARGE",
@@ -4991,9 +5296,10 @@ var SubscriptionCardDesktopRow = function (_a) {
4991
5296
  : charge.quantity })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge, subscription: subscription }) })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsxRuntime.jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) }))] })));
4992
5297
  };
4993
5298
 
5299
+ var Text = antd.Typography.Text;
4994
5300
  var SubscriptionCardCellMobile = function (_a) {
4995
5301
  var children = _a.children, className = _a.className, style = _a.style;
4996
- return (jsxRuntime.jsx("div", __assign({ className: className, style: style }, { children: children })));
5302
+ return (jsxRuntime.jsx(Text, __assign({ className: className, style: style }, { children: children })));
4997
5303
  };
4998
5304
 
4999
5305
  var CHARGE_COLUMNS = [
@@ -5016,8 +5322,12 @@ var CHARGE_COLUMNS = [
5016
5322
  var SubscriptionCard = function (_a) {
5017
5323
  var _b;
5018
5324
  var planChangeOptions = _a.planChangeOptions, setEditingQuoteData = _a.setEditingQuoteData, setPayModalVisible = _a.setPayModalVisible, subscription = _a.subscription;
5325
+ var darkMode = React.useContext(BunnyContext).darkMode;
5019
5326
  // Derived state
5020
5327
  var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL;
5328
+ var backgroundColor = darkMode
5329
+ ? "var(--row-background-dark)"
5330
+ : "var(--row-background)";
5021
5331
  return (jsxRuntime.jsx(Card, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col p-4" }, { children: [jsxRuntime.jsx(SubscriptionCardHeader, { planChangeOptions: planChangeOptions, setEditingQuoteData: setEditingQuoteData, setPayModalVisible: setPayModalVisible, subscription: subscription }), jsxRuntime.jsx(antd.Divider, { className: "my-4", style: {
5022
5332
  gridColumn: "1 / -1",
5023
5333
  width: "calc(100% + 32px)",
@@ -5026,6 +5336,7 @@ var SubscriptionCard = function (_a) {
5026
5336
  columnGap: "0.5rem",
5027
5337
  gridTemplateColumns: "1fr auto auto auto",
5028
5338
  rowGap: "0.75rem",
5339
+ backgroundColor: backgroundColor,
5029
5340
  } }, { children: [CHARGE_COLUMNS.map(function (subscriptionColumn, index) { return (jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: "text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: "11px" } }, { children: subscriptionColumn.title }), index)); }), subscription.charges.map(function (charge, chargeIndex) {
5030
5341
  if ((isTrial && !charge.trial) || (!isTrial && charge.trial))
5031
5342
  return null;
@@ -5173,6 +5484,7 @@ exports.Checkout = Checkout;
5173
5484
  exports.Invoice = Invoice;
5174
5485
  exports.PaymentMethod = PaymentMethod;
5175
5486
  exports.Quote = Quote;
5487
+ exports.Signup = Signup;
5176
5488
  exports.Subscriptions = Subscriptions;
5177
5489
  exports.Transactions = Transactions;
5178
5490
  exports.getQuoteAmountDue = getQuoteAmountDue;