@bunnyapp/components 1.0.46 → 1.0.48
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.
- package/dist/cjs/index.js +280 -223
- package/dist/cjs/src/components/BillingDetails/BillingDetails.d.ts +1 -2
- package/dist/cjs/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -2
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +1 -2
- package/dist/cjs/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/cjs/src/components/CustomizedAntdComponents/Tag.d.ts +36 -0
- package/dist/cjs/src/components/Invoice/Invoice.d.ts +1 -1
- package/dist/cjs/src/components/Invoice/Invoice.stories.d.ts +0 -1
- package/dist/cjs/src/components/Invoice/InvoiceQuoteContext.d.ts +0 -1
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -2
- package/dist/cjs/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
- package/dist/cjs/src/components/Quote/Quote.d.ts +1 -1
- package/dist/cjs/src/components/Quote/Quote.stories.d.ts +0 -10
- package/dist/cjs/src/components/Quotes/Quotes.d.ts +1 -2
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/cjs/src/components/Signup/Signup.d.ts +1 -3
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/cjs/src/components/Subscriptions/Subscriptions.d.ts +1 -2
- package/dist/cjs/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -0
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -1
- package/dist/cjs/src/components/Transactions/Transactions.d.ts +1 -3
- package/dist/cjs/src/components/Transactions/Transactions.stories.d.ts +0 -1
- package/dist/cjs/src/components/Transactions/TransactionsListContext.d.ts +0 -1
- package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/quoteChargeCreate.d.ts +13 -0
- package/dist/cjs/src/graphql/queries/getSubscriptions.d.ts +1 -2
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/cjs/src/hooks/useHasTaxPlugin.d.ts +1 -2
- package/dist/cjs/src/hooks/usePaymentMethod.d.ts +1 -2
- package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +1 -2
- package/dist/cjs/src/hooks/usePlugins.d.ts +1 -2
- package/dist/cjs/src/hooks/useSigningPlugins.d.ts +1 -2
- package/dist/esm/index.js +281 -224
- package/dist/esm/src/components/BillingDetails/BillingDetails.d.ts +1 -2
- package/dist/esm/src/components/BillingDetails/BillingDetailsForm.d.ts +1 -2
- package/dist/esm/src/components/Checkout/Checkout.d.ts +1 -2
- package/dist/esm/src/components/Checkout/QuoteCheckout.d.ts +1 -2
- package/dist/esm/src/components/CustomizedAntdComponents/Tag.d.ts +36 -0
- package/dist/esm/src/components/Invoice/Invoice.d.ts +1 -1
- package/dist/esm/src/components/Invoice/Invoice.stories.d.ts +0 -1
- package/dist/esm/src/components/Invoice/InvoiceQuoteContext.d.ts +0 -1
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/PaymentMethod/PaymentMethod.d.ts +1 -2
- package/dist/esm/src/components/PaymentForm/useRemovePaymentMethod.d.ts +1 -1
- package/dist/esm/src/components/Quote/Quote.d.ts +1 -1
- package/dist/esm/src/components/Quote/Quote.stories.d.ts +0 -10
- package/dist/esm/src/components/Quotes/Quotes.d.ts +1 -2
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +1 -2
- package/dist/esm/src/components/Signup/Signup.d.ts +1 -3
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +1 -2
- package/dist/esm/src/components/Subscriptions/Subscriptions.d.ts +1 -2
- package/dist/esm/src/components/Subscriptions/Subscriptions.stories.d.ts +2 -0
- package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +0 -1
- package/dist/esm/src/components/Transactions/Transactions.d.ts +1 -3
- package/dist/esm/src/components/Transactions/Transactions.stories.d.ts +0 -1
- package/dist/esm/src/components/Transactions/TransactionsListContext.d.ts +0 -1
- package/dist/esm/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/quoteChargeCreate.d.ts +13 -0
- package/dist/esm/src/graphql/queries/getSubscriptions.d.ts +1 -2
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/esm/src/hooks/useHasTaxPlugin.d.ts +1 -2
- package/dist/esm/src/hooks/usePaymentMethod.d.ts +1 -2
- package/dist/esm/src/hooks/usePaymentPlugins.d.ts +1 -2
- package/dist/esm/src/hooks/usePlugins.d.ts +1 -2
- package/dist/esm/src/hooks/useSigningPlugins.d.ts +1 -2
- package/dist/index.d.ts +9 -19
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -73,7 +73,7 @@ function styleInject(css, ref) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
var css_248z = ".ant-divider-horizontal {\n margin: 0;\n}\n.ant-divider-horizontal {\n margin: 0;\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-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\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-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: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.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n.\\!container {\n width: 100% !important;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n .\\!container {\n max-width: 768px !important;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n .\\!container {\n max-width: 1024px !important;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n .\\!container {\n max-width: 1280px !important;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n .\\!container {\n max-width: 1536px !important;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.bottom-16 {\n bottom: 4rem;\n}\n.bottom-8 {\n bottom: 2rem;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.top-32 {\n top: 8rem;\n}\n.top-16 {\n top: 4rem;\n}\n.z-50 {\n z-index: 50;\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-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\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.mx-8 {\n margin-left: 2rem;\n margin-right: 2rem;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.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-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 100%;\n}\n.h-10 {\n height: 2.5rem;\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-full {\n width: 100%;\n}\n.w-10 {\n width: 2.5rem;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\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.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\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;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.border-gray-300 {\n --tw-border-opacity: 1;\n border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.bg-blue-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-16 {\n padding: 4rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.p-48 {\n padding: 12rem;\n}\n.p-44 {\n padding: 11rem;\n}\n.px-12 {\n padding-left: 3rem;\n padding-right: 3rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\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-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.px-16 {\n padding-left: 4rem;\n padding-right: 4rem;\n}\n.px-32 {\n padding-left: 8rem;\n padding-right: 8rem;\n}\n.px-48 {\n padding-left: 12rem;\n padding-right: 12rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\n}\n.px-0 {\n padding-left: 0px;\n padding-right: 0px;\n}\n.px-10 {\n padding-left: 2.5rem;\n padding-right: 2.5rem;\n}\n.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\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.pl-1 {\n padding-left: 0.25rem;\n}\n.pb-32 {\n padding-bottom: 8rem;\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.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.ease-in-out {\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n}\n.font-light {\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.font-medium {\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.font-bold {\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.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box !important;\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";
|
|
76
|
+
var css_248z = ".ant-divider-horizontal {\n margin: 0;\n}\n.ant-divider-horizontal {\n margin: 0;\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-link:disabled {\n color: #717d94 !important;\n}\n.ant-btn-link:disabled:hover {\n background-color: transparent !important;\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-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: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 --bunny-blue-500: #3b82f6;\n --bunny-blue-200: #bfdbfe;\n --bunny-green-600: #059669;\n --bunny-green-200: #a7f3d0;\n --bunny-red-500: #ef4444;\n --bunny-red-200: #fecaca;\n --bunny-orange-500: #f97316;\n --bunny-orange-200: #fed7aa;\n --bunny-yellow-500: #f59e0b;\n --bunny-yellow-200: #fde68a;\n --bunny-purple-500: #8b5cf6;\n --bunny-purple-200: #ddd6fe;\n --bunny-black: #000000;\n}\n* {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\n}\n.hidden {\n display: none;\n}\n.bunny-show-on-hover {\n opacity: 0;\n}\n.bunny-show-on-hover-container:hover .bunny-show-on-hover {\n opacity: 1;\n}\n.has-tooltip:hover .tooltip {\n visibility: visible;\n z-index: 100;\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.bunny-icon-path {\n transition: fill 0.3s;\n}\n.bunny-shadow-padding-x {\n padding-right: 1rem;\n padding-left: 1rem;\n}\n.bunny-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 .bunny-shadow-padding-x {\n padding-right: 2rem;\n padding-left: 2rem;\n }\n .bunny-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.rotate-45,\n.transform {\n --tw-translate-x: 0;\n --tw-translate-y: 0;\n --tw-rotate: 0;\n --tw-skew-x: 0;\n --tw-skew-y: 0;\n --tw-scale-x: 1;\n --tw-scale-y: 1;\n}\n.shadow,\n.shadow-lg,\n.shadow-md,\n.shadow-none,\n.shadow-sm,\n.shadow-xl {\n --tw-ring-offset-shadow: 0 0 #0000;\n --tw-ring-shadow: 0 0 #0000;\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n}\n.container {\n width: 100%;\n}\n@media (min-width: 768px) {\n .container {\n max-width: 768px;\n }\n}\n@media (min-width: 1024px) {\n .container {\n max-width: 1024px;\n }\n}\n@media (min-width: 1280px) {\n .container {\n max-width: 1280px;\n }\n}\n@media (min-width: 1536px) {\n .container {\n max-width: 1536px;\n }\n}\n.visible {\n visibility: visible;\n}\n.fixed {\n position: fixed;\n}\n.absolute {\n position: absolute;\n}\n.relative {\n position: relative;\n}\n.sticky {\n position: sticky;\n}\n.bottom-0 {\n bottom: 0px;\n}\n.bottom-4 {\n bottom: 1rem;\n}\n.left-0 {\n left: 0px;\n}\n.right-0 {\n right: 0px;\n}\n.top-0 {\n top: 0px;\n}\n.z-50 {\n z-index: 50;\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-full {\n grid-column: 1 / -1;\n}\n.m-0 {\n margin: 0px;\n}\n.mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.my-12 {\n margin-top: 3rem;\n margin-bottom: 3rem;\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.mb-2 {\n margin-bottom: 0.5rem;\n}\n.mb-4 {\n margin-bottom: 1rem;\n}\n.mb-8 {\n margin-bottom: 2rem;\n}\n.ml-2 {\n margin-left: 0.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-6 {\n margin-top: 1.5rem;\n}\n.mt-8 {\n margin-top: 2rem;\n}\n.block {\n display: block;\n}\n.flex {\n display: flex;\n}\n.table {\n display: table;\n}\n.grid {\n display: grid;\n}\n.contents {\n display: contents;\n}\n.hidden {\n display: none;\n}\n.h-4 {\n height: 1rem;\n}\n.h-5 {\n height: 1.25rem;\n}\n.h-8 {\n height: 2rem;\n}\n.h-full {\n height: 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-full {\n width: 100%;\n}\n.max-w-32 {\n max-width: 8rem;\n}\n.flex-1 {\n flex: 1 1 0%;\n}\n.shrink {\n flex-shrink: 1;\n}\n.shrink-0 {\n flex-shrink: 0;\n}\n.flex-grow {\n flex-grow: 1;\n}\n.grow {\n flex-grow: 1;\n}\n.border-collapse {\n border-collapse: collapse;\n}\n.rotate-45 {\n --tw-rotate: 45deg;\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.transform {\n transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));\n}\n.cursor-pointer {\n cursor: pointer;\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.flex-row {\n flex-direction: row;\n}\n.flex-col {\n flex-direction: column;\n}\n.items-end {\n align-items: flex-end;\n}\n.items-center {\n align-items: center;\n}\n.justify-start {\n justify-content: flex-start;\n}\n.justify-end {\n justify-content: flex-end;\n}\n.justify-center {\n justify-content: center;\n}\n.justify-between {\n justify-content: space-between;\n}\n.gap-0 {\n gap: 0px;\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;\n}\n.gap-6 {\n gap: 1.5rem;\n}\n.gap-8 {\n gap: 2rem;\n}\n.space-y-2 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));\n}\n.space-y-4 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(1rem * var(--tw-space-y-reverse));\n}\n.space-y-8 > :not([hidden]) ~ :not([hidden]) {\n --tw-space-y-reverse: 0;\n margin-top: calc(2rem * calc(1 - var(--tw-space-y-reverse)));\n margin-bottom: calc(2rem * var(--tw-space-y-reverse));\n}\n.overflow-auto {\n overflow: auto;\n}\n.overflow-hidden {\n overflow: hidden;\n}\n.overflow-visible {\n overflow: visible;\n}\n.whitespace-nowrap {\n white-space: nowrap;\n}\n.text-nowrap {\n text-wrap: nowrap;\n}\n.rounded {\n border-radius: 0.25rem;\n}\n.rounded-full {\n border-radius: 9999px;\n}\n.rounded-lg {\n border-radius: 0.5rem;\n}\n.rounded-md {\n border-radius: 0.375rem;\n}\n.rounded-sm {\n border-radius: 0.125rem;\n}\n.border {\n border-width: 1px;\n}\n.border-2 {\n border-width: 2px;\n}\n.border-b {\n border-bottom-width: 1px;\n}\n.border-t {\n border-top-width: 1px;\n}\n.border-solid {\n border-style: solid;\n}\n.border-none {\n border-style: none;\n}\n.border-gray-400 {\n --tw-border-opacity: 1;\n border-color: rgb(156 163 175 / var(--tw-border-opacity, 1));\n}\n.border-gray-500 {\n --tw-border-opacity: 1;\n border-color: rgb(107 114 128 / var(--tw-border-opacity, 1));\n}\n.border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.border-slate-300 {\n --tw-border-opacity: 1;\n border-color: rgb(203 213 225 / var(--tw-border-opacity, 1));\n}\n.border-slate-700 {\n --tw-border-opacity: 1;\n border-color: rgb(51 65 85 / var(--tw-border-opacity, 1));\n}\n.bg-black {\n --tw-bg-opacity: 1;\n background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));\n}\n.bg-emerald-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(167 243 208 / var(--tw-bg-opacity, 1));\n}\n.bg-green-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(187 247 208 / var(--tw-bg-opacity, 1));\n}\n.bg-orange-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 215 170 / var(--tw-bg-opacity, 1));\n}\n.bg-red-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 202 202 / var(--tw-bg-opacity, 1));\n}\n.bg-red-500 {\n --tw-bg-opacity: 1;\n background-color: rgb(239 68 68 / var(--tw-bg-opacity, 1));\n}\n.bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bg-transparent {\n background-color: transparent;\n}\n.bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bg-yellow-200 {\n --tw-bg-opacity: 1;\n background-color: rgb(254 240 138 / var(--tw-bg-opacity, 1));\n}\n.p-0 {\n padding: 0px;\n}\n.p-1 {\n padding: 0.25rem;\n}\n.p-2 {\n padding: 0.5rem;\n}\n.p-4 {\n padding: 1rem;\n}\n.p-8 {\n padding: 2rem;\n}\n.px-2 {\n padding-left: 0.5rem;\n padding-right: 0.5rem;\n}\n.px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.px-8 {\n padding-left: 2rem;\n padding-right: 2rem;\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-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.pb-2 {\n padding-bottom: 0.5rem;\n}\n.pb-4 {\n padding-bottom: 1rem;\n}\n.pb-6 {\n padding-bottom: 1.5rem;\n}\n.pb-8 {\n padding-bottom: 2rem;\n}\n.pl-0 {\n padding-left: 0px;\n}\n.pl-2 {\n padding-left: 0.5rem;\n}\n.pl-4 {\n padding-left: 1rem;\n}\n.pt-1 {\n padding-top: 0.25rem;\n}\n.pt-12 {\n padding-top: 3rem;\n}\n.pt-2 {\n padding-top: 0.5rem;\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.text-left {\n text-align: left;\n}\n.text-center {\n text-align: center;\n}\n.text-right {\n text-align: right;\n}\n.align-middle {\n vertical-align: middle;\n}\n.text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.font-bold {\n font-weight: 700;\n}\n.font-medium {\n font-weight: 500;\n}\n.font-normal {\n font-weight: 400;\n}\n.capitalize {\n text-transform: capitalize;\n}\n.text-emerald-600 {\n --tw-text-opacity: 1;\n color: rgb(5 150 105 / var(--tw-text-opacity, 1));\n}\n.text-emerald-700 {\n --tw-text-opacity: 1;\n color: rgb(4 120 87 / var(--tw-text-opacity, 1));\n}\n.text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.text-green-600 {\n --tw-text-opacity: 1;\n color: rgb(22 163 74 / var(--tw-text-opacity, 1));\n}\n.text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.text-red-500 {\n --tw-text-opacity: 1;\n color: rgb(239 68 68 / var(--tw-text-opacity, 1));\n}\n.text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.text-white {\n --tw-text-opacity: 1;\n color: rgb(255 255 255 / var(--tw-text-opacity, 1));\n}\n.text-yellow-500 {\n --tw-text-opacity: 1;\n color: rgb(234 179 8 / var(--tw-text-opacity, 1));\n}\n.underline {\n text-decoration-line: underline;\n}\n.shadow {\n --tw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-lg {\n --tw-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-md {\n --tw-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-none {\n --tw-shadow: 0 0 #0000;\n --tw-shadow-colored: 0 0 #0000;\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-sm {\n --tw-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.shadow-xl {\n --tw-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);\n --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);\n box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);\n}\n.transition {\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;\n transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-backdrop-filter;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.transition-all {\n transition-property: all;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.duration-200 {\n transition-duration: 200ms;\n}\n.duration-300 {\n transition-duration: 300ms;\n}\n.font-light {\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.font-medium {\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.font-bold {\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.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n@media (min-width: 768px) {\n .sm\\:flex {\n display: flex;\n }\n .sm\\:hidden {\n display: none;\n }\n}\n.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\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";
|
|
77
77
|
styleInject(css_248z);
|
|
78
78
|
|
|
79
79
|
/******************************************************************************
|
|
@@ -266,6 +266,7 @@ function ContextualWrapper(_a) {
|
|
|
266
266
|
colorLinkHover: entityBranding.brandColor,
|
|
267
267
|
fontFamily: common.MARK_PRO,
|
|
268
268
|
colorBorder: common.INPUT_BORDER_COLOR,
|
|
269
|
+
lineHeight: 1,
|
|
269
270
|
}, components: {
|
|
270
271
|
Button: {
|
|
271
272
|
defaultShadow: "none",
|
|
@@ -388,11 +389,11 @@ var InvoiceQuoteView = function (_a) {
|
|
|
388
389
|
var _b = react.useContext(InvoiceQuoteContext), shadow = _b.shadow, hideDownloadButton = _b.hideDownloadButton;
|
|
389
390
|
var isMobile = common.useIsMobile();
|
|
390
391
|
var buttonsVisible = formattedInvoice && (!hideDownloadButton || onBackButtonClick);
|
|
391
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [buttonsVisible ? (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: {
|
|
392
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full grow ".concat(isMobile ? "overflow-hidden" : "") }, { children: [buttonsVisible ? (jsxRuntime.jsxs("div", __assign({ className: "flex justify-between items-center pb-4 ".concat(isMobile ? "bunny-shadow-padding-x" : ""), id: "acceptance" }, { children: [jsxRuntime.jsx("div", { children: onBackButtonClick ? (jsxRuntime.jsx(antd.Button, __assign({ className: "text-xs pl-0", onClick: onBackButtonClick, style: {
|
|
392
393
|
color: secondaryColor,
|
|
393
394
|
}, type: "link" }, { children: backButtonName || "Back" }))) : null }), !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () {
|
|
394
395
|
return downloadFile(apiHost + "/api/pdf/invoice/" + formattedInvoice.id, token);
|
|
395
|
-
} }, { children: "Download" }))) : null] }))) : 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-4 w-full bg-white ".concat(shadow ? shadow : "shadow-md", " rounded-md"), style: {
|
|
396
|
+
} }, { children: "Download" }))) : null] }))) : null, isMobile ? (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 grow w-full bunny-shadow-padding-xb overflow-auto" }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] }))) : (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "flex flex-col gap-4 p-4 w-full bg-white ".concat(shadow ? shadow : "shadow-md", " rounded-md"), style: {
|
|
396
397
|
minWidth: "750px",
|
|
397
398
|
} }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] })))] })));
|
|
398
399
|
};
|
|
@@ -451,9 +452,12 @@ function InvoicePDF(_a) {
|
|
|
451
452
|
|
|
452
453
|
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}";
|
|
453
454
|
var usePaymentMethod = function (_a) {
|
|
454
|
-
var accountId = _a.accountId,
|
|
455
|
+
var accountId = _a.accountId, graphQLClient = _a.graphQLClient, token = _a.token;
|
|
455
456
|
var _b = reactQuery.useQuery({
|
|
456
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
457
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
458
|
+
token: token,
|
|
459
|
+
accountId: accountId,
|
|
460
|
+
}),
|
|
457
461
|
queryFn: function () {
|
|
458
462
|
return graphQLClient
|
|
459
463
|
.request(paymentMethodsQuery, {
|
|
@@ -472,7 +476,7 @@ var usePaymentMethod = function (_a) {
|
|
|
472
476
|
};
|
|
473
477
|
|
|
474
478
|
var usePlugins = function (_a) {
|
|
475
|
-
var
|
|
479
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
476
480
|
var response = reactQuery.useQuery({
|
|
477
481
|
queryKey: common.QueryKeyFactory.default.pluginsKey(token),
|
|
478
482
|
queryFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -480,7 +484,6 @@ var usePlugins = function (_a) {
|
|
|
480
484
|
return __generator(this, function (_a) {
|
|
481
485
|
switch (_a.label) {
|
|
482
486
|
case 0: return [4 /*yield*/, common.getPlugins({
|
|
483
|
-
entityId: entityId,
|
|
484
487
|
token: token,
|
|
485
488
|
apiHost: apiHost,
|
|
486
489
|
})];
|
|
@@ -490,7 +493,6 @@ var usePlugins = function (_a) {
|
|
|
490
493
|
}
|
|
491
494
|
});
|
|
492
495
|
}); },
|
|
493
|
-
enabled: Boolean(entityId),
|
|
494
496
|
});
|
|
495
497
|
return response;
|
|
496
498
|
};
|
|
@@ -504,9 +506,8 @@ var filterPaymentPlugins = function (plugins) {
|
|
|
504
506
|
});
|
|
505
507
|
};
|
|
506
508
|
var usePaymentPlugins = function (_a) {
|
|
507
|
-
var
|
|
509
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
508
510
|
var _b = usePlugins({
|
|
509
|
-
entityId: entityId,
|
|
510
511
|
apiHost: apiHost,
|
|
511
512
|
token: token,
|
|
512
513
|
}), plugins = _b.data, isFetched = _b.isFetched;
|
|
@@ -753,6 +754,34 @@ var Card = function (_a) {
|
|
|
753
754
|
: "var(--row-background)" }) }, { children: children })));
|
|
754
755
|
};
|
|
755
756
|
|
|
757
|
+
var tagStyleMap = {
|
|
758
|
+
blue: { color: "var(--bunny-blue-500)", background: "var(--bunny-blue-200)" },
|
|
759
|
+
green: {
|
|
760
|
+
color: "var(--bunny-green-600)",
|
|
761
|
+
background: "var(--bunny-green-200)",
|
|
762
|
+
},
|
|
763
|
+
red: { color: "var(--bunny-red-500)", background: "var(--bunny-red-200)" },
|
|
764
|
+
orange: {
|
|
765
|
+
color: "var(--bunny-orange-500)",
|
|
766
|
+
background: "var(--bunny-orange-200)",
|
|
767
|
+
},
|
|
768
|
+
yellow: {
|
|
769
|
+
color: "var(--bunny-yellow-500)",
|
|
770
|
+
background: "var(--bunny-yellow-200)",
|
|
771
|
+
},
|
|
772
|
+
purple: {
|
|
773
|
+
color: "var(--bunny-purple-500)",
|
|
774
|
+
background: "var(--bunny-purple-200)",
|
|
775
|
+
},
|
|
776
|
+
black: { color: "white", background: "var(--bunny-black)" },
|
|
777
|
+
};
|
|
778
|
+
// This component provides custom styling for antd Tag components without using antd overwrites.
|
|
779
|
+
// Please use this component instead of the antd Tag component directly to maintain consistent styling.
|
|
780
|
+
var CustomizedTag = function (_a) {
|
|
781
|
+
var children = _a.children, color = _a.color, className = _a.className;
|
|
782
|
+
return (jsxRuntime.jsx(antd.Tag, __assign({ color: color, style: color ? tagStyleMap[color] : undefined, className: "m-0 font-medium rounded-full border-none whitespace-nowrap ".concat(className) }, { children: children })));
|
|
783
|
+
};
|
|
784
|
+
|
|
756
785
|
var LargeCardIcon = function () {
|
|
757
786
|
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" }) })));
|
|
758
787
|
};
|
|
@@ -768,7 +797,7 @@ var CreditCard = function (_a) {
|
|
|
768
797
|
var onClickRemove = _a.onClickRemove, onClickUpdate = _a.onClickUpdate, paymentMethodData = _a.paymentMethodData, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d;
|
|
769
798
|
var isMobile = common.useIsMobile();
|
|
770
799
|
var Wrapper = cardEnabled ? Card : "div";
|
|
771
|
-
return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " 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: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsxRuntime.jsx(
|
|
800
|
+
return (jsxRuntime.jsxs(Wrapper, __assign({ className: "".concat(cardEnabled ? shadow : "", " 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: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier })] })), jsxRuntime.jsx(CustomizedTag, __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: expirationDate(paymentMethodData) }), isMobile && (jsxRuntime.jsx(CardActions, { onClickRemove: onClickRemove, onClickUpdate: onClickUpdate }))] }))] }))] })));
|
|
772
801
|
};
|
|
773
802
|
var MiniCreditCard = function (_a) {
|
|
774
803
|
var _b;
|
|
@@ -780,7 +809,7 @@ var MiniCreditCard = function (_a) {
|
|
|
780
809
|
var backgroundColor = react.useMemo(function () {
|
|
781
810
|
return darkMode ? "var(--row-background-alternate)" : "bg-slate-50";
|
|
782
811
|
}, [darkMode]);
|
|
783
|
-
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4 space-between w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier }), jsxRuntime.jsx(
|
|
812
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-row justify-between items-center p-1 px-3 border-solid ".concat(backgroundColor, " ").concat(borderColor, " rounded-md border") }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex flex-row gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-4 space-between w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Text$p, { children: (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.identifier }), jsxRuntime.jsx(CustomizedTag, __assign({ color: isExpired(paymentMethodData) ? "red" : "green" }, { children: isExpired(paymentMethodData) ? "Expired" : "Valid" }))] })) })), !hideRemoveButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ title: "Remove card?", onConfirm: onClickRemove }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "font-normal p-0", type: "link" }, { children: "Remove" })) })))] })) : (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row gap-2 items-center" }, { children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$p, __assign({ className: "text-slate-400", style: { fontSize: "11px" } }, { children: "No payment method selected" })), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" })] }))) })));
|
|
784
813
|
};
|
|
785
814
|
var CardImage = function (_a) {
|
|
786
815
|
var _b, _c;
|
|
@@ -1308,7 +1337,7 @@ var PaymentOptionContainer = defaultStyled.div(templateObject_1$9 || (templateOb
|
|
|
1308
1337
|
});
|
|
1309
1338
|
var templateObject_1$9;
|
|
1310
1339
|
|
|
1311
|
-
function useRemovePaymentMethod(paymentPlugins, apiHost,
|
|
1340
|
+
function useRemovePaymentMethod(paymentPlugins, apiHost, token, accountId) {
|
|
1312
1341
|
var _this = this;
|
|
1313
1342
|
var queryClient = reactQuery.useQueryClient();
|
|
1314
1343
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -1332,7 +1361,10 @@ function useRemovePaymentMethod(paymentPlugins, apiHost, entityId, token, accoun
|
|
|
1332
1361
|
})
|
|
1333
1362
|
.then(function () {
|
|
1334
1363
|
showSuccessNotification("Payment method was removed", "Success");
|
|
1335
|
-
queryClient.setQueryData(common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1364
|
+
queryClient.setQueryData(common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1365
|
+
token: token,
|
|
1366
|
+
accountId: accountId,
|
|
1367
|
+
}), null);
|
|
1336
1368
|
})
|
|
1337
1369
|
.catch(function (error) {
|
|
1338
1370
|
showErrorNotification(error.message, "Error removing payment method");
|
|
@@ -1350,35 +1382,38 @@ function useRemovePaymentMethod(paymentPlugins, apiHost, entityId, token, accoun
|
|
|
1350
1382
|
var Panel = antd.Collapse.Panel;
|
|
1351
1383
|
var PaymentForm = function (_a) {
|
|
1352
1384
|
var _b;
|
|
1353
|
-
var
|
|
1385
|
+
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, overrideToken = _a.overrideToken, graphQLClient = _a.graphQLClient, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, customPaymentForms = _a.customPaymentForms, _c = _a.useAllPaymentPlugins, useAllPaymentPlugins = _c === void 0 ? false : _c;
|
|
1354
1386
|
// Local state
|
|
1355
1387
|
var _d = react.useState(), selectedPaymentMethod = _d[0], setSelectedPaymentMethod = _d[1];
|
|
1356
1388
|
var _e = react.useState(false), showPaymentMethodForm = _e[0], setShowPaymentMethodForm = _e[1];
|
|
1357
1389
|
var paying = !!(quote || invoice);
|
|
1358
|
-
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
1390
|
+
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
1391
|
+
(invoice === null || invoice === void 0 ? void 0 : invoice.currencyId) ||
|
|
1392
|
+
currencyIdFromProps)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
1359
1393
|
// Hooks
|
|
1360
1394
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
1361
1395
|
var tokenFromContexts = useToken();
|
|
1362
1396
|
var token = overrideToken || tokenFromContexts;
|
|
1363
1397
|
var _f = usePaymentMethod({
|
|
1364
1398
|
accountId: accountId,
|
|
1365
|
-
entityId: entityId,
|
|
1366
1399
|
graphQLClient: graphQLClient,
|
|
1367
1400
|
token: token,
|
|
1368
1401
|
}), storedPaymentMethod = _f.data, isPaymentMethodLoading = _f.isLoading;
|
|
1369
1402
|
var isPaymentMethodFetched = storedPaymentMethod !== undefined;
|
|
1370
|
-
var _g = usePaymentPlugins({
|
|
1403
|
+
var _g = usePaymentPlugins({ apiHost: apiHost, token: token }), allPaymentMethodAllowedPlugins = _g.paymentMethodAllowedPlugins, allPaymentPlugins = _g.paymentPlugins, arePluginsFetched = _g.isFetched;
|
|
1371
1404
|
var paymentMethodAllowedPlugins = react.useMemo(function () {
|
|
1372
1405
|
if (useAllPaymentPlugins) {
|
|
1373
1406
|
return allPaymentPlugins;
|
|
1374
1407
|
}
|
|
1375
1408
|
return allPaymentMethodAllowedPlugins;
|
|
1376
1409
|
}, [allPaymentMethodAllowedPlugins, allPaymentPlugins, useAllPaymentPlugins]);
|
|
1377
|
-
var onClickRemove = useRemovePaymentMethod(paymentMethodAllowedPlugins || [], apiHost,
|
|
1410
|
+
var onClickRemove = useRemovePaymentMethod(paymentMethodAllowedPlugins || [], apiHost, token, accountId);
|
|
1378
1411
|
var queryClient = reactQuery.useQueryClient();
|
|
1379
1412
|
// Set default plugin
|
|
1380
1413
|
react.useEffect(function () {
|
|
1381
|
-
if (!arePluginsFetched ||
|
|
1414
|
+
if (!arePluginsFetched ||
|
|
1415
|
+
!isPaymentMethodFetched ||
|
|
1416
|
+
selectedPaymentMethod) {
|
|
1382
1417
|
return;
|
|
1383
1418
|
}
|
|
1384
1419
|
var pluginPaymentMethod = paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.find(function (plugin) { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = storedPaymentMethod === null || storedPaymentMethod === void 0 ? void 0 : storedPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
|
|
@@ -1407,7 +1442,10 @@ var PaymentForm = function (_a) {
|
|
|
1407
1442
|
};
|
|
1408
1443
|
var handleSavePaymentMethod = function () {
|
|
1409
1444
|
queryClient.invalidateQueries({
|
|
1410
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1445
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
1446
|
+
accountId: accountId,
|
|
1447
|
+
token: token,
|
|
1448
|
+
}),
|
|
1411
1449
|
});
|
|
1412
1450
|
onSavePaymentMethod === null || onSavePaymentMethod === void 0 ? void 0 : onSavePaymentMethod();
|
|
1413
1451
|
setShowPaymentMethodForm(false);
|
|
@@ -1434,7 +1472,7 @@ function StripeWrapper(_a) {
|
|
|
1434
1472
|
}
|
|
1435
1473
|
|
|
1436
1474
|
function Invoice(_a) {
|
|
1437
|
-
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess,
|
|
1475
|
+
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? "shadow-md" : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onInvoiceLoaded = _a.onInvoiceLoaded;
|
|
1438
1476
|
return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
1439
1477
|
id: id,
|
|
1440
1478
|
invoiceQuoteViewComponent: invoiceQuoteViewComponent,
|
|
@@ -1442,7 +1480,6 @@ function Invoice(_a) {
|
|
|
1442
1480
|
onBackButtonClick: onBackButtonClick,
|
|
1443
1481
|
onInvoiceDownloadError: onInvoiceDownloadError,
|
|
1444
1482
|
onPaymentSuccess: onPaymentSuccess,
|
|
1445
|
-
entityId: entityId,
|
|
1446
1483
|
shadow: shadow,
|
|
1447
1484
|
className: className,
|
|
1448
1485
|
hideDownloadButton: hideDownloadButton,
|
|
@@ -1452,7 +1489,7 @@ function Invoice(_a) {
|
|
|
1452
1489
|
function ActualInvoice() {
|
|
1453
1490
|
// Context
|
|
1454
1491
|
var queryClient = reactQuery.useQueryClient();
|
|
1455
|
-
var _a = react.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick,
|
|
1492
|
+
var _a = react.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onPaymentSuccess = _a.onPaymentSuccess, className = _a.className;
|
|
1456
1493
|
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired, graphQLClient = _b.graphQLClient;
|
|
1457
1494
|
var _c = react.useContext(InvoiceQuoteContext), hideDownloadButton = _c.hideDownloadButton, onInvoiceLoaded = _c.onInvoiceLoaded;
|
|
1458
1495
|
var token = useToken();
|
|
@@ -1473,7 +1510,10 @@ function ActualInvoice() {
|
|
|
1473
1510
|
queryKey: common.QueryKeyFactory.default.transactionsKey({ token: token }),
|
|
1474
1511
|
});
|
|
1475
1512
|
queryClient.invalidateQueries({
|
|
1476
|
-
queryKey: common.QueryKeyFactory.default.createFormattedInvoiceKey({
|
|
1513
|
+
queryKey: common.QueryKeyFactory.default.createFormattedInvoiceKey({
|
|
1514
|
+
id: id,
|
|
1515
|
+
token: token,
|
|
1516
|
+
}),
|
|
1477
1517
|
});
|
|
1478
1518
|
showSuccessNotification("Your invoice has been paid", "Payment successful");
|
|
1479
1519
|
onPaymentSuccess === null || onPaymentSuccess === void 0 ? void 0 : onPaymentSuccess();
|
|
@@ -1488,7 +1528,9 @@ function ActualInvoice() {
|
|
|
1488
1528
|
}, [formattedInvoice]);
|
|
1489
1529
|
if (!formattedInvoice)
|
|
1490
1530
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
1491
|
-
return (jsxRuntime.jsx(
|
|
1531
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex gap-6 ".concat(isMobile
|
|
1532
|
+
? "flex-col w-full overflow-hidden"
|
|
1533
|
+
: "bunny-shadow-padding-xb", " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "flex justify-center w-full" }, { children: jsxRuntime.jsx(InvoicePDF, { invoiceUuid: formattedInvoice.uuid, apiHost: apiHost, token: token }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? "" : "pt-12") }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice, graphQLClient: graphQLClient }) })))] })) })));
|
|
1492
1534
|
}
|
|
1493
1535
|
|
|
1494
1536
|
var MUTATION$7 = function (id) { 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 }"; };
|
|
@@ -1516,16 +1558,20 @@ var getFormattedQuote = function (_a) {
|
|
|
1516
1558
|
};
|
|
1517
1559
|
|
|
1518
1560
|
var filterSigningPlugins = function (plugins) {
|
|
1519
|
-
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
1561
|
+
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
1562
|
+
var _a, _b;
|
|
1563
|
+
return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === "signing" &&
|
|
1564
|
+
((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === "valid";
|
|
1565
|
+
});
|
|
1520
1566
|
};
|
|
1521
1567
|
var useSigningPlugins = function (_a) {
|
|
1522
|
-
var
|
|
1523
|
-
var plugins = usePlugins({
|
|
1568
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
1569
|
+
var plugins = usePlugins({ apiHost: apiHost, token: token });
|
|
1524
1570
|
return filterSigningPlugins(plugins.data);
|
|
1525
1571
|
};
|
|
1526
1572
|
|
|
1527
1573
|
var useSendAcceptQuote = function (_a) {
|
|
1528
|
-
var
|
|
1574
|
+
var onTokenExpired = _a.onTokenExpired, quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
1529
1575
|
// Hooks
|
|
1530
1576
|
var graphQLMutation = common.useGraphQLmutation(function () {
|
|
1531
1577
|
console.log("navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
@@ -1533,7 +1579,7 @@ var useSendAcceptQuote = function (_a) {
|
|
|
1533
1579
|
console.log("onError in useGraphQLmutation in useSendAcceptQuote is not yet implemented");
|
|
1534
1580
|
});
|
|
1535
1581
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
1536
|
-
var signingPlugins = useSigningPlugins({
|
|
1582
|
+
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
1537
1583
|
var queryClient = reactQuery.useQueryClient();
|
|
1538
1584
|
// Local state
|
|
1539
1585
|
var _b = react.useState(false), acceptBoxVisible = _b[0], setAcceptBoxVisible = _b[1];
|
|
@@ -1748,30 +1794,28 @@ var AcceptQuoteModal = function (_a) {
|
|
|
1748
1794
|
var Text$m = antd.Typography.Text;
|
|
1749
1795
|
defaultStyled.div(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
|
|
1750
1796
|
function Quote(_a) {
|
|
1751
|
-
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess,
|
|
1797
|
+
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? "shadow-md" : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onQuoteLoaded = _a.onQuoteLoaded;
|
|
1752
1798
|
return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
1753
1799
|
id: id,
|
|
1754
1800
|
invoiceQuoteViewComponent: invoiceQuoteViewComponent,
|
|
1755
1801
|
onInvoiceDownloadError: onInvoiceDownloadError,
|
|
1756
1802
|
onPaymentSuccess: onPaymentSuccess,
|
|
1757
|
-
entityId: entityId,
|
|
1758
1803
|
shadow: shadow,
|
|
1759
1804
|
className: className,
|
|
1760
1805
|
hideDownloadButton: hideDownloadButton,
|
|
1761
1806
|
onQuoteLoaded: onQuoteLoaded,
|
|
1762
|
-
} }, { children: jsxRuntime.jsx(ActualQuote, {
|
|
1807
|
+
} }, { children: jsxRuntime.jsx(ActualQuote, {}) })));
|
|
1763
1808
|
}
|
|
1764
|
-
function ActualQuote(
|
|
1809
|
+
function ActualQuote() {
|
|
1765
1810
|
var _this = this;
|
|
1766
|
-
var
|
|
1767
|
-
var entityId = _a.entityId;
|
|
1811
|
+
var _a, _b;
|
|
1768
1812
|
// Context
|
|
1769
|
-
var
|
|
1813
|
+
var _c = react.useContext(BunnyContext), apiHost = _c.apiHost, onTokenExpired = _c.onTokenExpired;
|
|
1770
1814
|
var token = useToken();
|
|
1771
1815
|
var entityBranding = react.useContext(BrandContext);
|
|
1772
|
-
var
|
|
1816
|
+
var _d = react.useContext(InvoiceQuoteContext), className = _d.className, id = _d.id, hideDownloadButton = _d.hideDownloadButton, onQuoteLoaded = _d.onQuoteLoaded;
|
|
1773
1817
|
// Queries
|
|
1774
|
-
var
|
|
1818
|
+
var _e = reactQuery.useQuery({
|
|
1775
1819
|
queryKey: common.QueryKeyFactory.default.createQuoteKey({ id: id, token: token }),
|
|
1776
1820
|
queryFn: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1777
1821
|
var error_1;
|
|
@@ -1790,18 +1834,17 @@ function ActualQuote(_a) {
|
|
|
1790
1834
|
});
|
|
1791
1835
|
}); },
|
|
1792
1836
|
placeholderData: reactQuery.keepPreviousData,
|
|
1793
|
-
}), data =
|
|
1837
|
+
}), data = _e.data, isLoading = _e.isLoading;
|
|
1794
1838
|
var formattedQuote = data;
|
|
1795
1839
|
// Hooks
|
|
1796
1840
|
var downloadFile = useDownloadFile(id);
|
|
1797
1841
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
1798
|
-
var
|
|
1799
|
-
entityId: entityId,
|
|
1842
|
+
var _f = useSendAcceptQuote({
|
|
1800
1843
|
token: token,
|
|
1801
1844
|
onTokenExpired: onTokenExpired,
|
|
1802
1845
|
apiHost: apiHost,
|
|
1803
1846
|
quoteId: id,
|
|
1804
|
-
}), acceptBoxVisible =
|
|
1847
|
+
}), acceptBoxVisible = _f.acceptBoxVisible, isAccepting = _f.isAccepting, sendAccept = _f.sendAccept, setAcceptBoxVisible = _f.setAcceptBoxVisible, setIsAccepting = _f.setIsAccepting, startAcceptance = _f.startAcceptance, pandadocPollingModalVisible = _f.pandadocPollingModalVisible, setPandadocPollingModalVisible = _f.setPandadocPollingModalVisible;
|
|
1805
1848
|
useSigningComplete({ data: formattedQuote, token: token });
|
|
1806
1849
|
var isMobile = common.useIsMobile();
|
|
1807
1850
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -1815,67 +1858,18 @@ function ActualQuote(_a) {
|
|
|
1815
1858
|
}
|
|
1816
1859
|
// Derived state
|
|
1817
1860
|
var isAccepted = formattedQuote.state === "ACCEPTED";
|
|
1818
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4 ".concat(isMobile ? "w-full overflow-hidden" : "shadow-padding-xb", " ").concat(className) }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
1861
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-4 ".concat(isMobile ? "w-full overflow-hidden" : "bunny-shadow-padding-xb", " ").concat(className) }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
1819
1862
|
color: entityBranding.secondaryColor,
|
|
1820
1863
|
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$m, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile
|
|
1821
1864
|
? "flex w-full justify-end gap-2"
|
|
1822
1865
|
: "flex items-center justify-end gap-2" }, { children: [!isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () {
|
|
1823
1866
|
return downloadFile(apiHost + "/api/pdf/quote", token);
|
|
1824
|
-
} }, { children: "Download" }))) : null, !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] })))] })), jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html }, { children: ((
|
|
1867
|
+
} }, { children: "Download" }))) : null, !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: function () { return startAcceptance(); }, type: "primary" }, { children: isExpired ? "Quote is expired" : "Accept quote" }))) : null] })))] })), jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html }, { 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) {
|
|
1825
1868
|
return (jsxRuntime.jsx(antd.Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
|
|
1826
1869
|
}) }))) : null }))] })), jsxRuntime.jsx(AcceptQuoteModal, { acceptBoxVisible: acceptBoxVisible, formattedQuote: formattedQuote, setAcceptBoxVisible: setAcceptBoxVisible, setIsAccepting: setIsAccepting, sendAccept: sendAccept }), jsxRuntime.jsx(PandadocPollingModal, { isVisible: pandadocPollingModalVisible, setVisible: setPandadocPollingModalVisible, id: id })] }));
|
|
1827
1870
|
}
|
|
1828
1871
|
var templateObject_1$7;
|
|
1829
1872
|
|
|
1830
|
-
var QUOTES_QUERY = function (filter) { return "\n query quotes {\n quotes ".concat(filter ? "(".concat(filter, ")") : "", " {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n nodes {\n id\n name\n account {\n name\n id\n }\n applicationDate\n state\n createdAt\n expiresAt\n currencyId\n amount\n number\n }\n }\n }"); };
|
|
1831
|
-
var getQuotes = function (_a) {
|
|
1832
|
-
var token = _a.token, apiHost = _a.apiHost, filter = _a.filter;
|
|
1833
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
1834
|
-
var response;
|
|
1835
|
-
return __generator(this, function (_b) {
|
|
1836
|
-
switch (_b.label) {
|
|
1837
|
-
case 0: return [4 /*yield*/, common.gqlRequest({
|
|
1838
|
-
query: QUOTES_QUERY(filter),
|
|
1839
|
-
token: token,
|
|
1840
|
-
vars: {},
|
|
1841
|
-
apiHost: apiHost,
|
|
1842
|
-
})];
|
|
1843
|
-
case 1:
|
|
1844
|
-
response = _b.sent();
|
|
1845
|
-
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quotes];
|
|
1846
|
-
}
|
|
1847
|
-
});
|
|
1848
|
-
});
|
|
1849
|
-
};
|
|
1850
|
-
|
|
1851
|
-
var transactionMutation = function (filter) { return "\nquery transactions {\n transactions ".concat(filter ? "(".concat(filter, ")") : "", " {\n nodes {\n amount\n createdAt\n currencyId\n description\n id\n kind\n state\n transactionableId\n transactionable {\n ...on Payment { amount }\n ...on Invoice { amount number dueAt issuedAt isLegacy }\n ...on CreditNote { amount number issuedAt }\n }\n account {\n name\n id\n }\n }\n }\n}"); };
|
|
1852
|
-
var getTransactions = function (filter, apiHost, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1853
|
-
var response, _a, data, errors;
|
|
1854
|
-
return __generator(this, function (_b) {
|
|
1855
|
-
switch (_b.label) {
|
|
1856
|
-
case 0: return [4 /*yield*/, fetch(apiHost + "/graphql", {
|
|
1857
|
-
method: "POST",
|
|
1858
|
-
headers: {
|
|
1859
|
-
"Content-type": "application/json; charset=utf-8",
|
|
1860
|
-
Authorization: "Bearer ".concat(token),
|
|
1861
|
-
},
|
|
1862
|
-
body: JSON.stringify({
|
|
1863
|
-
query: transactionMutation(filter),
|
|
1864
|
-
}),
|
|
1865
|
-
})];
|
|
1866
|
-
case 1:
|
|
1867
|
-
response = _b.sent();
|
|
1868
|
-
return [4 /*yield*/, response.json()];
|
|
1869
|
-
case 2:
|
|
1870
|
-
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
1871
|
-
if (errors) {
|
|
1872
|
-
throw new Error(errors[0].message);
|
|
1873
|
-
}
|
|
1874
|
-
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.transactions.nodes];
|
|
1875
|
-
}
|
|
1876
|
-
});
|
|
1877
|
-
}); };
|
|
1878
|
-
|
|
1879
1873
|
var lodash$1 = {exports: {}};
|
|
1880
1874
|
|
|
1881
1875
|
/**
|
|
@@ -19087,6 +19081,55 @@ function requireLodash () {
|
|
|
19087
19081
|
|
|
19088
19082
|
var lodashExports = requireLodash();
|
|
19089
19083
|
|
|
19084
|
+
var QUOTES_QUERY = function (filter) { return "\n query quotes {\n quotes ".concat(filter ? "(".concat(filter, ")") : "", " {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n nodes {\n id\n name\n account {\n name\n id\n }\n applicationDate\n state\n createdAt\n expiresAt\n currencyId\n amount\n number\n }\n }\n }"); };
|
|
19085
|
+
var getQuotes = function (_a) {
|
|
19086
|
+
var token = _a.token, apiHost = _a.apiHost, filter = _a.filter;
|
|
19087
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
19088
|
+
var response;
|
|
19089
|
+
return __generator(this, function (_b) {
|
|
19090
|
+
switch (_b.label) {
|
|
19091
|
+
case 0: return [4 /*yield*/, common.gqlRequest({
|
|
19092
|
+
query: QUOTES_QUERY(filter),
|
|
19093
|
+
token: token,
|
|
19094
|
+
vars: {},
|
|
19095
|
+
apiHost: apiHost,
|
|
19096
|
+
})];
|
|
19097
|
+
case 1:
|
|
19098
|
+
response = _b.sent();
|
|
19099
|
+
return [2 /*return*/, response === null || response === void 0 ? void 0 : response.quotes];
|
|
19100
|
+
}
|
|
19101
|
+
});
|
|
19102
|
+
});
|
|
19103
|
+
};
|
|
19104
|
+
|
|
19105
|
+
var transactionMutation = function (filter) { return "\nquery transactions {\n transactions ".concat(filter ? "(".concat(filter, ")") : "", " {\n nodes {\n amount\n createdAt\n currencyId\n description\n id\n kind\n state\n transactionableId\n transactionable {\n ...on Payment { amount }\n ...on Invoice { amount number dueAt issuedAt isLegacy }\n ...on CreditNote { amount number issuedAt }\n }\n account {\n name\n id\n }\n }\n }\n}"); };
|
|
19106
|
+
var getTransactions = function (filter, apiHost, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19107
|
+
var response, _a, data, errors;
|
|
19108
|
+
return __generator(this, function (_b) {
|
|
19109
|
+
switch (_b.label) {
|
|
19110
|
+
case 0: return [4 /*yield*/, fetch(apiHost + "/graphql", {
|
|
19111
|
+
method: "POST",
|
|
19112
|
+
headers: {
|
|
19113
|
+
"Content-type": "application/json; charset=utf-8",
|
|
19114
|
+
Authorization: "Bearer ".concat(token),
|
|
19115
|
+
},
|
|
19116
|
+
body: JSON.stringify({
|
|
19117
|
+
query: transactionMutation(filter),
|
|
19118
|
+
}),
|
|
19119
|
+
})];
|
|
19120
|
+
case 1:
|
|
19121
|
+
response = _b.sent();
|
|
19122
|
+
return [4 /*yield*/, response.json()];
|
|
19123
|
+
case 2:
|
|
19124
|
+
_a = _b.sent(), data = _a.data, errors = _a.errors;
|
|
19125
|
+
if (errors) {
|
|
19126
|
+
throw new Error(errors[0].message);
|
|
19127
|
+
}
|
|
19128
|
+
return [2 /*return*/, data === null || data === void 0 ? void 0 : data.transactions.nodes];
|
|
19129
|
+
}
|
|
19130
|
+
});
|
|
19131
|
+
}); };
|
|
19132
|
+
|
|
19090
19133
|
var TransactionsListContext = react.createContext({});
|
|
19091
19134
|
|
|
19092
19135
|
var StateTag = function (_a) {
|
|
@@ -19095,7 +19138,7 @@ var StateTag = function (_a) {
|
|
|
19095
19138
|
if (transactionStateRenderer) {
|
|
19096
19139
|
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: transactionStateRenderer(state) });
|
|
19097
19140
|
}
|
|
19098
|
-
return jsxRuntime.jsx(
|
|
19141
|
+
return (jsxRuntime.jsx(CustomizedTag, __assign({ color: getColor(state) }, { children: lodashExports.capitalize(lodashExports.startCase(state)) })));
|
|
19099
19142
|
};
|
|
19100
19143
|
var getColor = function (state) {
|
|
19101
19144
|
switch (state) {
|
|
@@ -19149,7 +19192,7 @@ var TransactionDownload = function (_a) {
|
|
|
19149
19192
|
return (jsxRuntime.jsx("div", __assign({ onClick: function (e) {
|
|
19150
19193
|
e.stopPropagation();
|
|
19151
19194
|
downloadFile(downloadLink, token);
|
|
19152
|
-
} }, { children: jsxRuntime.jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "show-on-hover"), color: darkMode ? common.WHITE : common.SLATE_600 }) })));
|
|
19195
|
+
} }, { children: jsxRuntime.jsx(ArrowDownToLine, { className: "".concat(isMobile ? "" : "bunny-show-on-hover"), color: darkMode ? common.WHITE : common.SLATE_600 }) })));
|
|
19153
19196
|
};
|
|
19154
19197
|
|
|
19155
19198
|
var TransactionGridCell = defaultStyled.div.withConfig({
|
|
@@ -19217,7 +19260,7 @@ var TransactionsListDesktop = function (_a) {
|
|
|
19217
19260
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: transactions === null || transactions === void 0 ? void 0 : transactions.map(function (transaction, index) {
|
|
19218
19261
|
var _a, _b;
|
|
19219
19262
|
var isClickable = onTransactionClick !== undefined;
|
|
19220
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
|
|
19263
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " bunny-show-on-hover-container"), onClick: function () {
|
|
19221
19264
|
onTransactionClick === null || onTransactionClick === void 0 ? void 0 : onTransactionClick(transaction);
|
|
19222
19265
|
}, style: {
|
|
19223
19266
|
backgroundColor: index % 2 === 0
|
|
@@ -19249,7 +19292,7 @@ var TransactionsListMobile = function (_a) {
|
|
|
19249
19292
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: transactions === null || transactions === void 0 ? void 0 : transactions.map(function (transaction, index) {
|
|
19250
19293
|
var _a;
|
|
19251
19294
|
var isClickable = transaction.kind === "INVOICE";
|
|
19252
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " show-on-hover-container"), onClick: function () {
|
|
19295
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "contents ".concat(isClickable && "cursor-pointer", " bunny-show-on-hover-container"), onClick: function () {
|
|
19253
19296
|
onTransactionClick(transaction);
|
|
19254
19297
|
}, style: {
|
|
19255
19298
|
backgroundColor: index % 2 === 0
|
|
@@ -19268,7 +19311,7 @@ function Transactions(_a) {
|
|
|
19268
19311
|
common.TransactionKind.PAYMENT,
|
|
19269
19312
|
common.TransactionKind.REFUND,
|
|
19270
19313
|
common.TransactionKind.WRITE_OFF,
|
|
19271
|
-
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage,
|
|
19314
|
+
] : _j, style = _a.style, filter = _a.filter, noTransactionsMessage = _a.noTransactionsMessage, filterTransactions = _a.filterTransactions, _k = _a.sortTransactions, sortTransactions = _k === void 0 ? function (a, b) {
|
|
19272
19315
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
19273
19316
|
} : _k, _l = _a.transactionDateType, transactionDateType = _l === void 0 ? "createdAt" : _l;
|
|
19274
19317
|
var contextValues = {
|
|
@@ -19287,7 +19330,6 @@ function Transactions(_a) {
|
|
|
19287
19330
|
style: style,
|
|
19288
19331
|
filter: filter,
|
|
19289
19332
|
noTransactionsMessage: noTransactionsMessage,
|
|
19290
|
-
entityId: entityId,
|
|
19291
19333
|
filterTransactions: filterTransactions,
|
|
19292
19334
|
sortTransactions: sortTransactions,
|
|
19293
19335
|
transactionDateType: transactionDateType,
|
|
@@ -19309,7 +19351,7 @@ function Transactions(_a) {
|
|
|
19309
19351
|
function TransactionsDisplay(_a) {
|
|
19310
19352
|
var _b, _c;
|
|
19311
19353
|
var transactions = _a.transactions, onSearchValueChanged = _a.onSearchValueChanged, search = _a.search;
|
|
19312
|
-
var _d = react.useContext(TransactionsListContext), showSearchBar = _d.showSearchBar, showTitle = _d.showTitle, title = _d.title, transactionComponent = _d.transactionComponent, useModal = _d.useModal, suppressTransactionDisplay = _d.suppressTransactionDisplay, className = _d.className, shadow = _d.shadow, searchBarClassName = _d.searchBarClassName, style = _d.style, onTransactionClick = _d.onTransactionClick,
|
|
19354
|
+
var _d = react.useContext(TransactionsListContext), showSearchBar = _d.showSearchBar, showTitle = _d.showTitle, title = _d.title, transactionComponent = _d.transactionComponent, useModal = _d.useModal, suppressTransactionDisplay = _d.suppressTransactionDisplay, className = _d.className, shadow = _d.shadow, searchBarClassName = _d.searchBarClassName, style = _d.style, onTransactionClick = _d.onTransactionClick, onTransactionDisplayClose = _d.onTransactionDisplayClose, kindsToShow = _d.kindsToShow, filterTransactions = _d.filterTransactions, sortTransactions = _d.sortTransactions; _d.transactionDateType;
|
|
19313
19355
|
var columns = react.useContext(TransactionsListContext).columns;
|
|
19314
19356
|
var darkMode = react.useContext(BunnyContext).darkMode;
|
|
19315
19357
|
var secondaryColor = react.useContext(BrandContext).secondaryColor;
|
|
@@ -19374,7 +19416,7 @@ function TransactionsDisplay(_a) {
|
|
|
19374
19416
|
onTransactionDisplayClose === null || onTransactionDisplayClose === void 0 ? void 0 : onTransactionDisplayClose(selectedTransaction);
|
|
19375
19417
|
setDrawerOpen(false);
|
|
19376
19418
|
}
|
|
19377
|
-
return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$h, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
|
|
19419
|
+
return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "flex flex-col w-full bunny-shadow-padding-xb gap-2 ".concat(isMobile ? "overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-1" : "flex-row items-center", " justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$h, __assign({ className: "shrink-0 font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
|
|
19378
19420
|
), showSearchBar && (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "") }, { children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName
|
|
19379
19421
|
? searchBarClassName
|
|
19380
19422
|
: "border border-slate-200", onChange: function (e) {
|
|
@@ -19387,11 +19429,11 @@ function TransactionsDisplay(_a) {
|
|
|
19387
19429
|
}, value: search }) })))] }))) : null, jsxRuntime.jsx("div", __assign({ className: "grid w-full rounded-md overflow-auto ".concat(shadow), style: {
|
|
19388
19430
|
gridTemplateColumns: gridTemplateColumns(),
|
|
19389
19431
|
backgroundColor: "var(--row-background".concat(darkMode ? "-dark" : "", ")"),
|
|
19390
|
-
} }, { children: isMobile ? (jsxRuntime.jsx(TransactionsListMobile, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) : (jsxRuntime.jsx(TransactionsListDesktop, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) }))] })), useModal ? (jsxRuntime.jsx(antd.Modal, __assign({ title: drawerTitle(), open: drawerOpen, onOk: handleDisplayClose, onCancel: handleDisplayClose, width: DISPLAY_WIDTH, footer: null }, { children: jsxRuntime.jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || ""
|
|
19432
|
+
} }, { children: isMobile ? (jsxRuntime.jsx(TransactionsListMobile, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) : (jsxRuntime.jsx(TransactionsListDesktop, { transactions: updatedTransactions, onTransactionClick: handleTransactionClick })) }))] })), useModal ? (jsxRuntime.jsx(antd.Modal, __assign({ title: drawerTitle(), open: drawerOpen, onOk: handleDisplayClose, onCancel: handleDisplayClose, width: DISPLAY_WIDTH, footer: null }, { children: jsxRuntime.jsx(Invoice, { id: (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.transactionableId) || "" }) }))) : (jsxRuntime.jsx(antd.Drawer, __assign({ title: drawerTitle(), onClose: handleDisplayClose, open: drawerOpen, width: DISPLAY_WIDTH }, { children: transactionComponent ? (transactionComponent) : (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind) === "INVOICE" ? (jsxRuntime.jsx(Invoice, { id: selectedTransaction.transactionableId })) : (jsxRuntime.jsxs(antd.Card, __assign({ className: "shadow-md" }, { children: [jsxRuntime.jsx(antd.Typography.Title, __assign({ level: 2, className: "mb-4" }, { children: "Transaction Details" })), jsxRuntime.jsxs(antd.Typography.Paragraph, { children: [jsxRuntime.jsx("strong", { children: "Amount:" }), " ", jsxRuntime.jsx(antd.Typography.Text, { children: common.formatCurrency((selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.amount) || 0, (selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.currencyId) || "USD") })] }), jsxRuntime.jsxs(antd.Typography.Paragraph, { children: [jsxRuntime.jsx("strong", { children: "Description:" }), " ", jsxRuntime.jsx(antd.Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.description })] }), jsxRuntime.jsxs(antd.Typography.Paragraph, { children: [jsxRuntime.jsx("strong", { children: "Kind:" }), " ", jsxRuntime.jsx(antd.Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.kind })] }), jsxRuntime.jsxs(antd.Typography.Paragraph, { children: [jsxRuntime.jsx("strong", { children: "State:" }), " ", jsxRuntime.jsx(antd.Typography.Text, { children: selectedTransaction === null || selectedTransaction === void 0 ? void 0 : selectedTransaction.state })] })] }))) })))] })));
|
|
19391
19433
|
}
|
|
19392
19434
|
|
|
19393
19435
|
function Quotes(_a) {
|
|
19394
|
-
var className = _a.className, _b = _a.columns, columns = _b === void 0 ? ["date", "title", "amount", "download", "state"] : _b,
|
|
19436
|
+
var className = _a.className, _b = _a.columns, columns = _b === void 0 ? ["date", "title", "amount", "download", "state"] : _b, filter = _a.filter, filterQuotes = _a.filterQuotes, _c = _a.sort, sort = _c === void 0 ? function (a, b) {
|
|
19395
19437
|
return new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime();
|
|
19396
19438
|
} : _c, _d = _a.noQuotesMessage, noQuotesMessage = _d === void 0 ? "There are no quotes" : _d, onQuoteClick = _a.onQuoteClick, quoteComponent = _a.quoteComponent, searchBarClassName = _a.searchBarClassName, _e = _a.shadow, shadow = _e === void 0 ? "shadow-md" : _e, _f = _a.showSearchBar, showSearchBar = _f === void 0 ? true : _f, _g = _a.showTitle, showTitle = _g === void 0 ? true : _g, _h = _a.title, title = _h === void 0 ? "Past quotes" : _h, style = _a.style, _j = _a.suppressQuoteDisplay, suppressQuoteDisplay = _j === void 0 ? false : _j, _k = _a.useModal, useModal = _k === void 0 ? false : _k;
|
|
19397
19439
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
@@ -19419,7 +19461,6 @@ function Quotes(_a) {
|
|
|
19419
19461
|
filterTransactions: filterQuotes,
|
|
19420
19462
|
sortTransactions: sort,
|
|
19421
19463
|
downloadTransactionLink: function (id) { return "".concat(apiHost, "/api/pdf/quote/").concat(id); },
|
|
19422
|
-
entityId: entityId,
|
|
19423
19464
|
transactionDateType: "createdAt", // Required for the transactions list, but doesn't affect quotes
|
|
19424
19465
|
};
|
|
19425
19466
|
function quoteStateRenderer(state) {
|
|
@@ -19440,7 +19481,7 @@ function Quotes(_a) {
|
|
|
19440
19481
|
return "blue";
|
|
19441
19482
|
}
|
|
19442
19483
|
};
|
|
19443
|
-
return jsxRuntime.jsx(
|
|
19484
|
+
return (jsxRuntime.jsx(CustomizedTag, __assign({ color: getColor(state) }, { children: lodashExports.capitalize(lodashExports.startCase(state)) })));
|
|
19444
19485
|
}
|
|
19445
19486
|
function handleQuoteClick(quote) {
|
|
19446
19487
|
onQuoteClick === null || onQuoteClick === void 0 ? void 0 : onQuoteClick(quote);
|
|
@@ -19448,7 +19489,7 @@ function Quotes(_a) {
|
|
|
19448
19489
|
setComponent(quoteComponent);
|
|
19449
19490
|
}
|
|
19450
19491
|
else {
|
|
19451
|
-
setComponent(jsxRuntime.jsx(Quote, {
|
|
19492
|
+
setComponent(jsxRuntime.jsx(Quote, { id: quote === null || quote === void 0 ? void 0 : quote.transactionableId }));
|
|
19452
19493
|
}
|
|
19453
19494
|
}
|
|
19454
19495
|
return (jsxRuntime.jsx(TransactionsListContext.Provider, __assign({ value: contextValues }, { children: jsxRuntime.jsx(QuotesWrapper, {}) })));
|
|
@@ -19528,7 +19569,7 @@ var DrawerHeader = function (_a) {
|
|
|
19528
19569
|
|
|
19529
19570
|
var PaymentMethod = function (_a) {
|
|
19530
19571
|
var _b;
|
|
19531
|
-
var
|
|
19572
|
+
var className = _a.className, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, _d = _a.cardEnabled, cardEnabled = _d === void 0 ? true : _d,
|
|
19532
19573
|
/** Whether to use a modal instead of a drawer for the payment method form */
|
|
19533
19574
|
_e = _a.useModal,
|
|
19534
19575
|
/** Whether to use a modal instead of a drawer for the payment method form */
|
|
@@ -19537,21 +19578,21 @@ var PaymentMethod = function (_a) {
|
|
|
19537
19578
|
var token = useToken();
|
|
19538
19579
|
// Hooks
|
|
19539
19580
|
var queryClient = reactQuery.useQueryClient();
|
|
19540
|
-
var paymentPlugins = usePaymentPlugins({
|
|
19581
|
+
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, token: token }).paymentPlugins;
|
|
19541
19582
|
var showSuccessNotification = common.useSuccessNotification();
|
|
19542
19583
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
19543
|
-
var data = usePaymentMethod({
|
|
19544
|
-
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost,
|
|
19584
|
+
var data = usePaymentMethod({ graphQLClient: graphQLClient, token: token }).data;
|
|
19585
|
+
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token);
|
|
19545
19586
|
// Queries
|
|
19546
19587
|
var billingDetails = reactQuery.useQuery({
|
|
19547
|
-
queryKey: common.QueryKeyFactory.default.billingDetailsKey({
|
|
19588
|
+
queryKey: common.QueryKeyFactory.default.billingDetailsKey({ token: token }),
|
|
19548
19589
|
queryFn: function () { return getBillingDetails({ token: token, apiHost: apiHost }); },
|
|
19549
19590
|
}).data;
|
|
19550
19591
|
// Local state
|
|
19551
19592
|
var _g = react.useState(false), showModal = _g[0], setShowModal = _g[1];
|
|
19552
19593
|
var onSuccess = function () {
|
|
19553
19594
|
queryClient.invalidateQueries({
|
|
19554
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
19595
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({ token: token }),
|
|
19555
19596
|
});
|
|
19556
19597
|
setShowModal(false);
|
|
19557
19598
|
showSuccessNotification("Your payment method has been saved");
|
|
@@ -19567,7 +19608,7 @@ var PaymentMethod = function (_a) {
|
|
|
19567
19608
|
return [2 /*return*/];
|
|
19568
19609
|
}
|
|
19569
19610
|
});
|
|
19570
|
-
}); }, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data, shadow: shadow, cardEnabled: cardEnabled })) : (jsxRuntime.jsx(EmptyCard, { onClick: function () { return setShowModal(true); }, shadow: shadow, cardEnabled: cardEnabled })), jsxRuntime.jsx(PaymentMethodDisplay, __assign({ useModal: useModal, setShowModal: setShowModal, showModal: showModal }, { children: jsxRuntime.jsx(PaymentForm, {
|
|
19611
|
+
}); }, onClickUpdate: function () { return setShowModal(true); }, paymentMethodData: data, shadow: shadow, cardEnabled: cardEnabled })) : (jsxRuntime.jsx(EmptyCard, { onClick: function () { return setShowModal(true); }, shadow: shadow, cardEnabled: cardEnabled })), jsxRuntime.jsx(PaymentMethodDisplay, __assign({ useModal: useModal, setShowModal: setShowModal, showModal: showModal }, { children: jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
19571
19612
|
handleAllErrorFormats(error);
|
|
19572
19613
|
}, onPaymentSuccess: function () {
|
|
19573
19614
|
onSuccess();
|
|
@@ -19589,9 +19630,9 @@ var PaymentMethodDisplay = function (_a) {
|
|
|
19589
19630
|
}, title: jsxRuntime.jsx(DrawerHeader, { onClose: function () { return setShowModal(false); }, title: "New payment method", closeButtonClassName: "ant-drawer-close" }) }, { children: children })));
|
|
19590
19631
|
};
|
|
19591
19632
|
|
|
19592
|
-
var MUTATION$6 = function () { return "\nmutation AccountSignup (\n $
|
|
19633
|
+
var MUTATION$6 = function () { return "\nmutation AccountSignup (\n $pluginId: String!,\n $paymentMethodId: String,\n $priceListCode: String!,\n $accountId: ID!,\n $quoteId: ID!\n) {\n accountSignup(\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}"; };
|
|
19593
19634
|
var accountSignup = function (_a) {
|
|
19594
|
-
var token = _a.token, apiHost = _a.apiHost,
|
|
19635
|
+
var token = _a.token, apiHost = _a.apiHost, accountId = _a.accountId, quoteId = _a.quoteId, paymentToken = _a.paymentToken, paymentMethodId = _a.paymentMethodId, pluginId = _a.pluginId, priceListCode = _a.priceListCode;
|
|
19595
19636
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19596
19637
|
var vars, response, errors;
|
|
19597
19638
|
var _b;
|
|
@@ -19599,7 +19640,6 @@ var accountSignup = function (_a) {
|
|
|
19599
19640
|
switch (_c.label) {
|
|
19600
19641
|
case 0:
|
|
19601
19642
|
vars = {
|
|
19602
|
-
entityId: entityId,
|
|
19603
19643
|
accountId: accountId,
|
|
19604
19644
|
quoteId: quoteId,
|
|
19605
19645
|
paymentToken: paymentToken,
|
|
@@ -19624,9 +19664,9 @@ var accountSignup = function (_a) {
|
|
|
19624
19664
|
});
|
|
19625
19665
|
};
|
|
19626
19666
|
|
|
19627
|
-
var MUTATION$5 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $
|
|
19667
|
+
var MUTATION$5 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $priceListCode: String!\n) {\n quoteAccountSignup(\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact\n ) {\n account {\n id\n }\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 tenant {\n code\n }\n portalSessionToken\n errors\n }\n}"; };
|
|
19628
19668
|
var quoteAccountSignup = function (_a) {
|
|
19629
|
-
var token = _a.token, apiHost = _a.apiHost,
|
|
19669
|
+
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact;
|
|
19630
19670
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19631
19671
|
var vars, response, errors;
|
|
19632
19672
|
var _b;
|
|
@@ -19634,7 +19674,6 @@ var quoteAccountSignup = function (_a) {
|
|
|
19634
19674
|
switch (_c.label) {
|
|
19635
19675
|
case 0:
|
|
19636
19676
|
vars = {
|
|
19637
|
-
entityId: entityId,
|
|
19638
19677
|
priceListCode: priceListCode,
|
|
19639
19678
|
accountName: accountName,
|
|
19640
19679
|
billingContact: billingContact,
|
|
@@ -19678,9 +19717,9 @@ var getPriceList = function (_a) {
|
|
|
19678
19717
|
};
|
|
19679
19718
|
|
|
19680
19719
|
function PaymentForms(_a) {
|
|
19681
|
-
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment,
|
|
19720
|
+
var quote = _a.quote, handlePaymentSuccess = _a.handlePaymentSuccess, handlePaymentFail = _a.handlePaymentFail, handleSubmit = _a.handleSubmit, proceedingToPayment = _a.proceedingToPayment, accountId = _a.accountId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction;
|
|
19682
19721
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
19683
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsx(PaymentForm, {
|
|
19722
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsx(PaymentForm, { onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, graphQLClient: createGraphQLClient(apiHost, overrideToken), customCheckoutFunction: customCheckoutFunction })) : null })) : (jsxRuntime.jsx(InitialSignupForm, { onSubmit: handleSubmit, submitting: proceedingToPayment })) }));
|
|
19684
19723
|
}
|
|
19685
19724
|
function InitialSignupForm(_a) {
|
|
19686
19725
|
var onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
@@ -19714,7 +19753,7 @@ function PriceListDisplay(_a) {
|
|
|
19714
19753
|
|
|
19715
19754
|
var showErrorNotification = common.useErrorNotification();
|
|
19716
19755
|
function Signup(_a) {
|
|
19717
|
-
var companyName = _a.companyName,
|
|
19756
|
+
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, _b = _a.isCardEnabled, isCardEnabled = _b === void 0 ? true : _b, className = _a.className, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, style = _a.style;
|
|
19718
19757
|
// Hooks
|
|
19719
19758
|
var _d = react.useContext(BunnyContext), apiHost = _d.apiHost, graphQLClient = _d.graphQLClient;
|
|
19720
19759
|
var tokenFromContexts = useToken();
|
|
@@ -19729,7 +19768,6 @@ function Signup(_a) {
|
|
|
19729
19768
|
var _k = react.useState(undefined), paymentMethodGraphQLClient = _k[0], setPaymentMethodGraphQLClient = _k[1];
|
|
19730
19769
|
var paymentMethod = usePaymentMethod({
|
|
19731
19770
|
accountId: accountId,
|
|
19732
|
-
entityId: entityId,
|
|
19733
19771
|
graphQLClient: paymentMethodGraphQLClient || graphQLClient,
|
|
19734
19772
|
token: token,
|
|
19735
19773
|
}).data;
|
|
@@ -19750,7 +19788,6 @@ function Signup(_a) {
|
|
|
19750
19788
|
return [4 /*yield*/, quoteAccountSignup({
|
|
19751
19789
|
token: token,
|
|
19752
19790
|
apiHost: apiHost,
|
|
19753
|
-
entityId: entityId,
|
|
19754
19791
|
priceListCode: priceListCode,
|
|
19755
19792
|
accountName: formData.accountName,
|
|
19756
19793
|
billingContact: {
|
|
@@ -19768,7 +19805,6 @@ function Signup(_a) {
|
|
|
19768
19805
|
// to instead use paymentMethods from portalSessionToken.
|
|
19769
19806
|
queryClient.invalidateQueries({
|
|
19770
19807
|
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
19771
|
-
entityId: entityId,
|
|
19772
19808
|
token: token,
|
|
19773
19809
|
}),
|
|
19774
19810
|
});
|
|
@@ -19813,7 +19849,6 @@ function Signup(_a) {
|
|
|
19813
19849
|
return [4 /*yield*/, accountSignup({
|
|
19814
19850
|
token: portalSessionToken,
|
|
19815
19851
|
apiHost: apiHost,
|
|
19816
|
-
entityId: entityId,
|
|
19817
19852
|
quoteId: quote === null || quote === void 0 ? void 0 : quote.id,
|
|
19818
19853
|
paymentMethodId: paymentMethod === null || paymentMethod === void 0 ? void 0 : paymentMethod.id,
|
|
19819
19854
|
pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
|
|
@@ -19834,7 +19869,7 @@ function Signup(_a) {
|
|
|
19834
19869
|
};
|
|
19835
19870
|
return (jsxRuntime.jsx(WrapperComponent, __assign({ className: "p-4 flex flex-col ".concat(shadow, " ").concat(className), style: style }, { children: purchaseSucceeded ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "w-full", companyName: companyName, returnUrl: returnUrl, currencyId: quote === null || quote === void 0 ? void 0 : quote.currencyId })) : (jsxRuntime.jsx("div", { children: "No currency ID found from Quote" })) })) : (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 ".concat(isMobile ? "items-center" : "w-1/2 items-center") }, { children: jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData, topNavImageUrl: topNavImageUrl }) })), jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "h-full" : "my-4") }, { children: jsxRuntime.jsx(antd.Divider, { className: "h-full", type: isMobile ? undefined : "vertical" }) })), jsxRuntime.jsx("div", __assign({ className: "flex ".concat(isMobile
|
|
19836
19871
|
? "items-center justify-center my-12"
|
|
19837
|
-
: "w-1/2 items-center justify-center my-12") }, { children: jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "w-1/2") }, { children: jsxRuntime.jsx(PaymentForms, {
|
|
19872
|
+
: "w-1/2 items-center justify-center my-12") }, { children: jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "w-full" : "w-1/2") }, { children: jsxRuntime.jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction }) })) }))] }))) })));
|
|
19838
19873
|
}
|
|
19839
19874
|
|
|
19840
19875
|
var createRequestHeaders = function (token) {
|
|
@@ -19872,7 +19907,7 @@ var useCreateSubscriptionQuote = function () {
|
|
|
19872
19907
|
var data;
|
|
19873
19908
|
return __generator(this, function (_a) {
|
|
19874
19909
|
switch (_a.label) {
|
|
19875
|
-
case 0: return [4 /*yield*/, graphQLRequest("\n mutation quoteSubscriptionUpdate(\n $subscriptionIds: [ID!]!,\n ) {\n quoteSubscriptionUpdate(\n subscriptionIds: $subscriptionIds,\n ) {\n quote {\n id\n quoteChanges {\n id\n priceList {\n id\n }\n charges {\n
|
|
19910
|
+
case 0: return [4 /*yield*/, graphQLRequest("\n mutation quoteSubscriptionUpdate(\n $subscriptionIds: [ID!]!,\n ) {\n quoteSubscriptionUpdate(\n subscriptionIds: $subscriptionIds,\n ) {\n quote {\n id\n quoteChanges {\n id\n priceList {\n id\n }\n subscription {\n charges {\n startDate\n endDate\n id\n priceListCharge {\n id\n }\n }\n }\n }\n }\n }\n }\n ", token, apiHost, {
|
|
19876
19911
|
subscriptionIds: subscriptionIds,
|
|
19877
19912
|
})];
|
|
19878
19913
|
case 1:
|
|
@@ -19934,7 +19969,7 @@ var getQuote = function (_a) {
|
|
|
19934
19969
|
|
|
19935
19970
|
var SUBSCRIPTIONS_QUERY = "\nquery subscriptions {\n subscriptions {\n nodes {\n cancellationDate\n currencyId\n endDate\n evergreen\n id\n period\n plan { id name selfServiceBuy selfServiceCancel selfServiceRenew }\n priceList { id periodMonths }\n product { id name showProductNameOnLineItem }\n startDate\n state\n trialEndDate\n trialPeriod\n trialStartDate\n charges {\n priceListCharge {\n priceListChargeTiers {\n price\n starts\n }\n }\n amount\n billingPeriod\n chargeType\n discount\n discountedPrice\n endDate\n expired\n feature { name }\n id\n isAmendment\n isRamp\n kind\n name\n periodPrice\n price\n priceDecimals\n priceListChargeId\n priceTiers { starts price }\n pricingModel\n quantity\n selfServiceQuantity\n startDate\n trial\n }\n }\n }\n }";
|
|
19936
19971
|
var getSubscriptions = function (_a) {
|
|
19937
|
-
var apiHost = _a.apiHost,
|
|
19972
|
+
var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, token = _a.token;
|
|
19938
19973
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19939
19974
|
var response, combinedSubscriptions;
|
|
19940
19975
|
var _b, _c;
|
|
@@ -19944,7 +19979,6 @@ var getSubscriptions = function (_a) {
|
|
|
19944
19979
|
isInPreviewMode: isInPreviewMode,
|
|
19945
19980
|
query: SUBSCRIPTIONS_QUERY,
|
|
19946
19981
|
token: token,
|
|
19947
|
-
vars: { entityId: entityId },
|
|
19948
19982
|
apiHost: apiHost,
|
|
19949
19983
|
})];
|
|
19950
19984
|
case 1:
|
|
@@ -20039,9 +20073,8 @@ var getTaxationRequiredAccountFields = function (_a) {
|
|
|
20039
20073
|
};
|
|
20040
20074
|
|
|
20041
20075
|
var useHasTaxPlugin = function (_a) {
|
|
20042
|
-
var
|
|
20076
|
+
var apiHost = _a.apiHost, token = _a.token;
|
|
20043
20077
|
var plugins = usePlugins({
|
|
20044
|
-
entityId: entityId,
|
|
20045
20078
|
apiHost: apiHost,
|
|
20046
20079
|
token: token,
|
|
20047
20080
|
}).data;
|
|
@@ -20121,7 +20154,7 @@ var FormBillingState = function (_a) {
|
|
|
20121
20154
|
};
|
|
20122
20155
|
|
|
20123
20156
|
var QuoteCheckout = function (_a) {
|
|
20124
|
-
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields
|
|
20157
|
+
var account = _a.account, onSuccess = _a.onSuccess, onFail = _a.onFail, quote = _a.quote, taxationRequiredAccountFields = _a.taxationRequiredAccountFields;
|
|
20125
20158
|
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
20126
20159
|
var token = useToken();
|
|
20127
20160
|
var isMobile = common.useIsMobile();
|
|
@@ -20156,12 +20189,12 @@ var QuoteCheckout = function (_a) {
|
|
|
20156
20189
|
}
|
|
20157
20190
|
if (taxationRequiredAccountFields)
|
|
20158
20191
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20159
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, {
|
|
20192
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote, graphQLClient: graphQLClient })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex flex-col gap-2 ".concat(isMobile ? "bunny-shadow-padding-x" : "") }, { children: [jsxRuntime.jsx(antd.Button, __assign({ onClick: handleCheckoutNoPayment, type: "primary" }, { children: isSaving ? "Processing..." : "Complete order" })), jsxRuntime.jsx("div", __assign({ className: "text-xs text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20160
20193
|
};
|
|
20161
20194
|
var PaymentFormWrapper = function (_a) {
|
|
20162
20195
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
20163
20196
|
var isMobile = common.useIsMobile();
|
|
20164
|
-
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-6 shrink-0 ".concat(isMobile ? "w-full shadow-padding-xb" : "", " ").concat(className), style: __assign({}, (isMobile
|
|
20197
|
+
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-6 shrink-0 ".concat(isMobile ? "w-full bunny-shadow-padding-xb" : "", " ").concat(className), style: __assign({}, (isMobile
|
|
20165
20198
|
? setMaxHeight
|
|
20166
20199
|
? { maxHeight: "60vh" }
|
|
20167
20200
|
: {}
|
|
@@ -20173,11 +20206,10 @@ var PaymentFormWrapper = function (_a) {
|
|
|
20173
20206
|
var queryKeyFactory = common.QueryKeyFactory.default;
|
|
20174
20207
|
var Checkout = function (_a) {
|
|
20175
20208
|
var _b, _c;
|
|
20176
|
-
var
|
|
20209
|
+
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList, token = _a.token, _d = _a.quantity, quantity = _d === void 0 ? 0 : _d;
|
|
20177
20210
|
var _e = react.useContext(BunnyContext), apiHost = _e.apiHost, graphQLClient = _e.graphQLClient;
|
|
20178
20211
|
var isMobile = common.useIsMobile();
|
|
20179
20212
|
var hasTaxPlugin = useHasTaxPlugin({
|
|
20180
|
-
entityId: entityId,
|
|
20181
20213
|
apiHost: apiHost,
|
|
20182
20214
|
token: token,
|
|
20183
20215
|
});
|
|
@@ -20246,9 +20278,9 @@ var Checkout = function (_a) {
|
|
|
20246
20278
|
return null;
|
|
20247
20279
|
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col fixed top-0 left-0 right-0 bottom-0 bg-slate-50 overflow-auto", style: {
|
|
20248
20280
|
zIndex: 1001,
|
|
20249
|
-
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsxRuntime.jsx(icons.CloseOutlined, { className: "text-base shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsxRuntime.jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "w-full pt-12" }, { children: jsxRuntime.jsx(PaymentForm, {
|
|
20281
|
+
} }, { children: jsxRuntime.jsxs("div", __assign({ className: pageWrapperClassName(isMobile) }, { children: [jsxRuntime.jsx("div", __assign({ className: "flex justify-end w-full" }, { children: jsxRuntime.jsx(icons.CloseOutlined, { className: "text-base bunny-shadow-padding-xb", onClick: onCancel }) })), jsxRuntime.jsxs("div", __assign({ className: "flex justify-end gap-6 pt-4 ".concat(isMobile ? "flex-col" : "bunny-shadow-padding-xb") }, { children: [((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_b = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _b === void 0 ? void 0 : _b.html)) && (jsxRuntime.jsx(InvoiceQuoteView, { html: invoice ? invoice.html : quote ? quote.formattedQuote.html : "" })), !isMobile && ((invoice === null || invoice === void 0 ? void 0 : invoice.html) || ((_c = quote === null || quote === void 0 ? void 0 : quote.formattedQuote) === null || _c === void 0 ? void 0 : _c.html)) && (jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" })), invoice ? (jsxRuntime.jsx("div", __assign({ className: "w-full pt-12" }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: invoice, graphQLClient: graphQLClient }) }))) : quote ? (jsxRuntime.jsx(QuoteCheckout, { account: account, onFail: function (error) {
|
|
20250
20282
|
onFail(error);
|
|
20251
|
-
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, {
|
|
20283
|
+
}, onSuccess: onSuccess, quote: quote, taxationRequiredAccountFields: taxationRequiredAccountFields, token: token })) : (jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
20252
20284
|
onFail(error);
|
|
20253
20285
|
}, onPaymentSuccess: onSuccess, graphQLClient: graphQLClient }))] }))] })) })));
|
|
20254
20286
|
};
|
|
@@ -20264,7 +20296,7 @@ var useCurrentUserData = function () {
|
|
|
20264
20296
|
|
|
20265
20297
|
var BunnyFooterIcon = function (_a) {
|
|
20266
20298
|
var color = _a.color;
|
|
20267
|
-
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" }) })) })] })));
|
|
20299
|
+
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: "bunny-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: "bunny-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: "bunny-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: "bunny-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: "bunny-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: "bunny-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" }) })) })] })));
|
|
20268
20300
|
};
|
|
20269
20301
|
|
|
20270
20302
|
var SubscriptionsContext = react.createContext({});
|
|
@@ -20512,13 +20544,12 @@ var CheckoutPrice = function (_a) {
|
|
|
20512
20544
|
|
|
20513
20545
|
var CheckoutBarSummarySection = function (_a) {
|
|
20514
20546
|
var _b, _c;
|
|
20515
|
-
var open = _a.open, quantityLocal = _a.quantityLocal, quote = _a.quote, selectedPriceList = _a.selectedPriceList, onClickCheckout = _a.onClickCheckout,
|
|
20547
|
+
var open = _a.open, quantityLocal = _a.quantityLocal, quote = _a.quote, selectedPriceList = _a.selectedPriceList, onClickCheckout = _a.onClickCheckout, upgradingSubscription = _a.upgradingSubscription, quotePreviewData = _a.quotePreviewData;
|
|
20516
20548
|
// Context
|
|
20517
20549
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20518
20550
|
// Hooks
|
|
20519
20551
|
var token = useToken();
|
|
20520
20552
|
var paymentMethodAllowedPlugins = usePaymentPlugins({
|
|
20521
|
-
entityId: entityId,
|
|
20522
20553
|
apiHost: apiHost,
|
|
20523
20554
|
token: token,
|
|
20524
20555
|
}).paymentMethodAllowedPlugins;
|
|
@@ -20563,7 +20594,7 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20563
20594
|
var selectedPriceList = _a.selectedPriceList, handlePortalErrors = _a.handlePortalErrors, onCheckoutSuccess = _a.onCheckoutSuccess;
|
|
20564
20595
|
// Context
|
|
20565
20596
|
var token = useToken();
|
|
20566
|
-
var _c = react.useContext(SubscriptionsContext),
|
|
20597
|
+
var _c = react.useContext(SubscriptionsContext), quotePreviewData = _c.quotePreviewData, upgradingSubscription = _c.upgradingSubscription, shadow = _c.shadow;
|
|
20567
20598
|
var _d = react.useContext(BunnyContext), apiHost = _d.apiHost, graphQLClient = _d.graphQLClient;
|
|
20568
20599
|
// Local state
|
|
20569
20600
|
var _e = react.useState(0), quantityLocal = _e[0], setQuantity = _e[1];
|
|
@@ -20638,7 +20669,6 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20638
20669
|
var handleCheckoutSuccess = function () {
|
|
20639
20670
|
queryClient.invalidateQueries({
|
|
20640
20671
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
20641
|
-
filterString: "entityId=".concat(entityId),
|
|
20642
20672
|
pluralType: "subscriptions",
|
|
20643
20673
|
token: token,
|
|
20644
20674
|
}),
|
|
@@ -20681,7 +20711,7 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
20681
20711
|
}, [queryClient, selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.id, quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.quantity, token]);
|
|
20682
20712
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col gap-4" : "flex-row", " my-2 p-4 justify-between bg-white rounded-md ").concat(shadow ? "shadow-".concat(shadow) : "") }, { children: [jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "flex flex-col" : "flex", " gap-4") }, { children: selectedPriceList === null || selectedPriceList === void 0 ? void 0 : selectedPriceList.charges.map(function (charge, index) {
|
|
20683
20713
|
return (jsxRuntime.jsx(CheckoutBarInput, { charge: charge, quantity: quantityLocal || 0, selectedPriceList: selectedPriceList, setQuantity: setQuantity }, index));
|
|
20684
|
-
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quantityLocal: quantityLocal, quote: quote, selectedPriceList: selectedPriceList,
|
|
20714
|
+
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quantityLocal: quantityLocal, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsxRuntime.jsx(Checkout, { isMobile: isMobile, onCancel: function () { return setPayModalVisible(false); }, onFail: onCheckoutFail, onSuccess: handleCheckoutSuccess, open: payModalVisible, quantity: quantityLocal, quote: quote, selectedPriceList: selectedPriceList, storedPaymentMethod: storedPaymentMethod, token: token })] })));
|
|
20685
20715
|
};
|
|
20686
20716
|
|
|
20687
20717
|
// WARNING: There is a preview button on APP that will need to be changed if this query is changed
|
|
@@ -21117,13 +21147,13 @@ var PriceListGridMobile = function (_a) {
|
|
|
21117
21147
|
var prevPriceListIndex = availablePriceLists.findIndex(function (priceList) { return priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id); });
|
|
21118
21148
|
var prevPlanId = (_b = availablePriceLists[prevPriceListIndex - 1]) === null || _b === void 0 ? void 0 : _b.plan.id;
|
|
21119
21149
|
var prevPlan = (_c = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _c === void 0 ? void 0 : _c.find(function (plan) { return plan.id === prevPlanId; });
|
|
21120
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex gap-4 overflow-auto shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
|
|
21150
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "flex gap-4 overflow-auto bunny-shadow-padding-xb", style: { flexShrink: 0 } }, { children: availablePriceLists.map(function (priceList, index) {
|
|
21121
21151
|
var _a;
|
|
21122
21152
|
var plan = (_a = planChangeOptions === null || planChangeOptions === void 0 ? void 0 : planChangeOptions.plans) === null || _a === void 0 ? void 0 : _a.find(function (plan) { return plan.id === priceList.plan.id; });
|
|
21123
21153
|
return (jsxRuntime.jsx(PriceListCard, { isSelected: priceList.plan.id === (selectedPlan === null || selectedPlan === void 0 ? void 0 : selectedPlan.id), onClick: onChangePriceList, plan: plan, priceList: priceList, subscriptions: subscriptions, trialRemainingDays: trialRemainingDays }, index));
|
|
21124
|
-
}) })), jsxRuntime.jsx(Text$8, __assign({ className: "text-slate-500 pt-5 pb-4 shadow-padding-x" }, { children: everythingInPlus && prevPlan
|
|
21154
|
+
}) })), jsxRuntime.jsx(Text$8, __assign({ className: "text-slate-500 pt-5 pb-4 bunny-shadow-padding-x" }, { children: everythingInPlus && prevPlan
|
|
21125
21155
|
? everythingInPlusString({ plan: prevPlan })
|
|
21126
|
-
: "Features" })), jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto shadow-padding-x" }, { children: (_d = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _d === void 0 ? void 0 : _d.map(function (feature, index) { return (jsxRuntime.jsx(PriceListCardFeature, { feature: feature, index: index }, index)); }) }))] }));
|
|
21156
|
+
: "Features" })), jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-4 overflow-auto bunny-shadow-padding-x" }, { children: (_d = selectedProduct === null || selectedProduct === void 0 ? void 0 : selectedProduct.features) === null || _d === void 0 ? void 0 : _d.map(function (feature, index) { return (jsxRuntime.jsx(PriceListCardFeature, { feature: feature, index: index }, index)); }) }))] }));
|
|
21127
21157
|
};
|
|
21128
21158
|
|
|
21129
21159
|
var PriceListGrid = function (_a) {
|
|
@@ -21288,21 +21318,17 @@ var PlanPicker = function () {
|
|
|
21288
21318
|
// Context
|
|
21289
21319
|
var token = useToken();
|
|
21290
21320
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
21291
|
-
var _b = react.useContext(SubscriptionsContext),
|
|
21321
|
+
var _b = react.useContext(SubscriptionsContext), isInPreviewMode = _b.isInPreviewMode, productId = _b.productId, quotePreviewData = _b.quotePreviewData, setQuotePreviewData = _b.setQuotePreviewData, upgradingSubscription = _b.upgradingSubscription;
|
|
21292
21322
|
// Hooks
|
|
21293
21323
|
var queryClient = reactQuery.useQueryClient();
|
|
21294
21324
|
var showInfoNotification = common.useInfoNotification();
|
|
21295
21325
|
// Queries
|
|
21296
21326
|
var _c = reactQuery.useQuery({
|
|
21297
21327
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
21298
|
-
filterString: "entityId=".concat(entityId),
|
|
21299
21328
|
pluralType: "subscriptions",
|
|
21300
21329
|
token: token,
|
|
21301
21330
|
}),
|
|
21302
|
-
queryFn: function () {
|
|
21303
|
-
return getSubscriptions({ entityId: entityId, isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost });
|
|
21304
|
-
},
|
|
21305
|
-
enabled: Boolean(entityId),
|
|
21331
|
+
queryFn: function () { return getSubscriptions({ isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost }); },
|
|
21306
21332
|
}), subscriptions = _c.data, areSubscriptionsLoading = _c.isLoading;
|
|
21307
21333
|
var _d = reactQuery.useQuery({
|
|
21308
21334
|
queryKey: common.QueryKeyFactory.default.planChangeOptionsKey({
|
|
@@ -21371,7 +21397,7 @@ var PlanManager = function (_a) {
|
|
|
21371
21397
|
// Context
|
|
21372
21398
|
var token = useToken();
|
|
21373
21399
|
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
21374
|
-
var _c = react.useContext(SubscriptionsContext),
|
|
21400
|
+
var _c = react.useContext(SubscriptionsContext), isInPreviewMode = _c.isInPreviewMode, upgradingSubscription = _c.upgradingSubscription, setUpgradingSubscription = _c.setUpgradingSubscription, subscriptionUpgradeId = _c.subscriptionUpgradeId, setQuotePreviewData = _c.setQuotePreviewData, quotePreviewData = _c.quotePreviewData, className = _c.className;
|
|
21375
21401
|
// Local state
|
|
21376
21402
|
var _d = react.useState(), editingQuoteData = _d[0], setEditingQuoteData = _d[1];
|
|
21377
21403
|
var _e = react.useState(false), payModalVisible = _e[0], setPayModalVisible = _e[1];
|
|
@@ -21389,14 +21415,11 @@ var PlanManager = function (_a) {
|
|
|
21389
21415
|
// Queries
|
|
21390
21416
|
var _g = reactQuery.useQuery({
|
|
21391
21417
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
21392
|
-
filterString: "entityId=".concat(entityId),
|
|
21393
21418
|
pluralType: "subscriptions",
|
|
21394
21419
|
token: token,
|
|
21395
21420
|
}),
|
|
21396
|
-
queryFn: function () {
|
|
21397
|
-
|
|
21398
|
-
},
|
|
21399
|
-
enabled: Boolean(entityId),
|
|
21421
|
+
queryFn: function () { return getSubscriptions({ isInPreviewMode: isInPreviewMode, token: token, apiHost: apiHost }); },
|
|
21422
|
+
enabled: false,
|
|
21400
21423
|
}), subscriptions = _g.data, subscriptionsAreLoading = _g.isLoading;
|
|
21401
21424
|
var quote = reactQuery.useQuery({
|
|
21402
21425
|
queryKey: common.QueryKeyFactory.default.createObjectKey({
|
|
@@ -21451,7 +21474,6 @@ var PlanManager = function (_a) {
|
|
|
21451
21474
|
});
|
|
21452
21475
|
queryClient.invalidateQueries({
|
|
21453
21476
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
21454
|
-
filterString: "entityId=".concat(entityId),
|
|
21455
21477
|
pluralType: "subscriptions",
|
|
21456
21478
|
token: token,
|
|
21457
21479
|
}),
|
|
@@ -21467,12 +21489,12 @@ var PlanManager = function (_a) {
|
|
|
21467
21489
|
};
|
|
21468
21490
|
if (subscriptionsAreLoading && !isInPreviewMode)
|
|
21469
21491
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
21470
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className
|
|
21492
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [jsxRuntime.jsx(PreviewModeAdvisary, { isInPreviewMode: isInPreviewMode }), jsxRuntime.jsx(PageTitle, { onGoBack: function () {
|
|
21471
21493
|
if (isInPreviewMode)
|
|
21472
21494
|
return showInfoNotification("You are in preview mode");
|
|
21473
21495
|
setQuotePreviewData(undefined);
|
|
21474
21496
|
onChangePlanCancel();
|
|
21475
|
-
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, {
|
|
21497
|
+
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: storedPaymentMethod, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList, quantity: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.quantity }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", __assign({ className: "sticky bottom-4 transition-[margin] duration-300 ".concat(isSticky ? "mx-4" : "mx-0") }, { children: jsxRuntime.jsx(PlanPickerCheckoutBarWrapper, { handlePortalErrors: handlePortalErrors, onCheckoutSuccess: function () { return onChangePlanCancel(); } }) })), jsxRuntime.jsx(Footer, {})] })));
|
|
21476
21498
|
};
|
|
21477
21499
|
|
|
21478
21500
|
var useCancelSubscription = function () {
|
|
@@ -21688,7 +21710,7 @@ var getSubscriptionStatusText = function (subscription) {
|
|
|
21688
21710
|
if (cancellationDate &&
|
|
21689
21711
|
(state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.CANCELED &&
|
|
21690
21712
|
(state === null || state === void 0 ? void 0 : state.toUpperCase()) !== common.SubscriptionState.EXPIRED) {
|
|
21691
|
-
return (jsxRuntime.jsxs(
|
|
21713
|
+
return (jsxRuntime.jsxs(CustomizedTag, __assign({ color: "red" }, { children: ["Canceled - ends on ", common.formatDate(cancellationDate)] })));
|
|
21692
21714
|
}
|
|
21693
21715
|
if (evergreen) {
|
|
21694
21716
|
return "Renews on ".concat(common.formatDate(endDate));
|
|
@@ -21711,7 +21733,7 @@ var SubscriptionCardHeader = function (_a) {
|
|
|
21711
21733
|
var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
21712
21734
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex items-center justify-between", style: {
|
|
21713
21735
|
backgroundColor: darkMode ? "var(--row-background-dark)" : "",
|
|
21714
|
-
} }, { 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(Text$6, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { 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$6, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(
|
|
21736
|
+
} }, { 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(Text$6, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { 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$6, __assign({ className: "text-lg" }, { children: subscription.plan.name }))), jsxRuntime.jsxs(CustomizedTag, __assign({ color: common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex items-center gap-6" }, { children: [jsxRuntime.jsx(Text$6, __assign({ className: "grow text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile &&
|
|
21715
21737
|
planChangeOptions &&
|
|
21716
21738
|
onChangePlanClick &&
|
|
21717
21739
|
onCancelSubscriptionClick && (jsxRuntime.jsx(SubscriptionCardActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscription: subscription }))] }))] })));
|
|
@@ -21951,6 +21973,25 @@ var SubscriptionsListContainer = function (_a) {
|
|
|
21951
21973
|
return (jsxRuntime.jsx("div", __assign({ className: "flex flex-col gap-".concat(gap, " shrink overflow-auto") }, { children: (subscriptions === null || subscriptions === void 0 ? void 0 : subscriptions.length) > 0 ? (jsxRuntime.jsx(SubscriptionsList, { hideExpired: hideExpired, onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, planChangeOptions: planChangeOptions, subscriptions: subscriptions })) : (noSubscriptionsComponent || (jsxRuntime.jsx("div", __assign({ className: "flex flex-col items-center w-full" }, { children: jsxRuntime.jsx(ErrorView, { message: "You have no subscriptions with ".concat(companyName, " yet") }) })))) })));
|
|
21952
21974
|
};
|
|
21953
21975
|
|
|
21976
|
+
var QUOTE_CHARGE_CREATE = "\nmutation QuoteChargeCreate ($quoteChangeId: ID!, $startDate: ISO8601Date!, $endDate: ISO8601Date, $priceListChargeId: ID, $subscriptionChargeId: ID, $price: Float, $quantity: Int) {\n quoteChargeCreate(\n endDate: $endDate\n price: $price\n priceListChargeId: $priceListChargeId\n quantity: $quantity\n quoteChangeId: $quoteChangeId\n startDate: $startDate\n subscriptionChargeId: $subscriptionChargeId\n ) {\n quoteCharge {\n quoteChange {\n id\n quoteId\n }\n }\n }\n}\n\n";
|
|
21977
|
+
var quoteChargeCreate = function (_a) {
|
|
21978
|
+
var endDate = _a.endDate, price = _a.price, priceListChargeId = _a.priceListChargeId, quantity = _a.quantity, quoteChangeId = _a.quoteChangeId, startDate = _a.startDate, subscriptionChargeId = _a.subscriptionChargeId, token = _a.token, apiHost = _a.apiHost;
|
|
21979
|
+
return common.gqlRequest({
|
|
21980
|
+
query: QUOTE_CHARGE_CREATE,
|
|
21981
|
+
vars: {
|
|
21982
|
+
endDate: endDate,
|
|
21983
|
+
price: price,
|
|
21984
|
+
priceListChargeId: priceListChargeId,
|
|
21985
|
+
quantity: quantity,
|
|
21986
|
+
quoteChangeId: quoteChangeId,
|
|
21987
|
+
startDate: startDate,
|
|
21988
|
+
subscriptionChargeId: subscriptionChargeId,
|
|
21989
|
+
},
|
|
21990
|
+
apiHost: apiHost,
|
|
21991
|
+
token: token,
|
|
21992
|
+
});
|
|
21993
|
+
};
|
|
21994
|
+
|
|
21954
21995
|
var QuantityInput = function (_a) {
|
|
21955
21996
|
var charge = _a.charge, chargeIndex = _a.chargeIndex, editingQuote = _a.editingQuote, setEditingQuoteData = _a.setEditingQuoteData, subscription = _a.subscription, subscriptionIndex = _a.subscriptionIndex, subscriptions = _a.subscriptions;
|
|
21956
21997
|
// Context
|
|
@@ -21971,22 +22012,46 @@ var QuantityInput = function (_a) {
|
|
|
21971
22012
|
(updatingChargeQuantityId && updatingChargeQuantityId !== charge.id) ||
|
|
21972
22013
|
// If the subscription is not self-service, we disable the quantity input
|
|
21973
22014
|
!charge.selfServiceQuantity;
|
|
21974
|
-
var value = (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) === undefined
|
|
21975
|
-
? ""
|
|
21976
|
-
: editedSubscription.quantity;
|
|
22015
|
+
var value = (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) === undefined ? "" : editedSubscription.quantity;
|
|
21977
22016
|
// Mutations
|
|
22017
|
+
var createCharge = reactQuery.useMutation({
|
|
22018
|
+
mutationFn: quoteChargeCreate,
|
|
22019
|
+
onSuccess: function (response) {
|
|
22020
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
22021
|
+
if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
|
|
22022
|
+
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
22023
|
+
setEditingQuoteData({
|
|
22024
|
+
id: (_e = (_d = (_c = response.quoteChargeCreate) === null || _c === void 0 ? void 0 : _c.quoteCharge) === null || _d === void 0 ? void 0 : _d.quoteChange) === null || _e === void 0 ? void 0 : _e.quoteId,
|
|
22025
|
+
isTrial: isTrial,
|
|
22026
|
+
});
|
|
22027
|
+
}
|
|
22028
|
+
queryClient.invalidateQueries({
|
|
22029
|
+
queryKey: common.QueryKeyFactory.default.createObjectKey({
|
|
22030
|
+
id: (_h = (_g = (_f = response.quoteChargeCreate) === null || _f === void 0 ? void 0 : _f.quoteCharge) === null || _g === void 0 ? void 0 : _g.quoteChange) === null || _h === void 0 ? void 0 : _h.quoteId,
|
|
22031
|
+
objectName: "editingQuote",
|
|
22032
|
+
token: token,
|
|
22033
|
+
}),
|
|
22034
|
+
});
|
|
22035
|
+
},
|
|
22036
|
+
}).mutate;
|
|
21978
22037
|
var createQuote = reactQuery.useMutation({
|
|
21979
22038
|
mutationFn: function (subscriptionIds) {
|
|
21980
22039
|
return createSubscriptionQuote(subscriptionIds, token, apiHost);
|
|
21981
22040
|
},
|
|
21982
22041
|
onSuccess: function (subscriptionUpdateData) {
|
|
21983
|
-
var _a;
|
|
22042
|
+
var _a, _b;
|
|
21984
22043
|
var quote = (_a = subscriptionUpdateData === null || subscriptionUpdateData === void 0 ? void 0 : subscriptionUpdateData.quoteSubscriptionUpdate) === null || _a === void 0 ? void 0 : _a.quote;
|
|
21985
|
-
var
|
|
21986
|
-
|
|
21987
|
-
|
|
21988
|
-
|
|
21989
|
-
|
|
22044
|
+
var quoteChange = quote.quoteChanges.find(function (quoteChange) { return quoteChange.priceList.id === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription.priceList.id); });
|
|
22045
|
+
var subscriptionCharge = (_b = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.subscription) === null || _b === void 0 ? void 0 : _b.charges.find(function (charge) { var _a; return ((_a = charge === null || charge === void 0 ? void 0 : charge.priceListCharge) === null || _a === void 0 ? void 0 : _a.id) === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.chargeId); });
|
|
22046
|
+
if (subscriptionCharge && quoteChange && editedSubscription) {
|
|
22047
|
+
createCharge({
|
|
22048
|
+
apiHost: apiHost,
|
|
22049
|
+
endDate: subscriptionCharge.endDate,
|
|
22050
|
+
quantity: editedSubscription.quantity,
|
|
22051
|
+
quoteChangeId: quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.id,
|
|
22052
|
+
startDate: subscriptionCharge.startDate,
|
|
22053
|
+
subscriptionChargeId: subscriptionCharge.id,
|
|
22054
|
+
token: token,
|
|
21990
22055
|
});
|
|
21991
22056
|
}
|
|
21992
22057
|
},
|
|
@@ -21999,8 +22064,7 @@ var QuantityInput = function (_a) {
|
|
|
21999
22064
|
onSuccess: function (response) {
|
|
22000
22065
|
var _a, _b, _c, _d, _e, _f;
|
|
22001
22066
|
if (!(editingQuote === null || editingQuote === void 0 ? void 0 : editingQuote.id)) {
|
|
22002
|
-
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) ===
|
|
22003
|
-
common.SubscriptionState.TRIAL;
|
|
22067
|
+
var isTrial = ((_b = (_a = editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription) === null || _a === void 0 ? void 0 : _a.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
22004
22068
|
setEditingQuoteData({
|
|
22005
22069
|
id: (_d = (_c = response.quoteChangeUpdate) === null || _c === void 0 ? void 0 : _c.quoteChange) === null || _d === void 0 ? void 0 : _d.quoteId,
|
|
22006
22070
|
isTrial: isTrial,
|
|
@@ -22017,8 +22081,7 @@ var QuantityInput = function (_a) {
|
|
|
22017
22081
|
});
|
|
22018
22082
|
// Handlers
|
|
22019
22083
|
var isQuantityLowerThanOriginal = function (quantity) {
|
|
22020
|
-
return (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) !== undefined &&
|
|
22021
|
-
editedSubscription.quantity <= quantity;
|
|
22084
|
+
return (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.quantity) !== undefined && editedSubscription.quantity <= quantity;
|
|
22022
22085
|
};
|
|
22023
22086
|
var onChangeQuantity = function (chargeIndex, value, priceListChargeId, subscription, subscriptionIndex) {
|
|
22024
22087
|
var quantity = isNaN(parseInt(value)) ? 0 : parseInt(value);
|
|
@@ -22221,7 +22284,7 @@ var SubscriptionsNavigation = function (_a) {
|
|
|
22221
22284
|
|
|
22222
22285
|
var Text = antd.Typography.Text;
|
|
22223
22286
|
var SubscriptionsWrapper = function (_a) {
|
|
22224
|
-
var handlePortalErrors = _a.handlePortalErrors,
|
|
22287
|
+
var handlePortalErrors = _a.handlePortalErrors, companyName = _a.companyName, _b = _a.isInPreviewMode, isInPreviewMode = _b === void 0 ? false : _b, productId = _a.productId, className = _a.className, _c = _a.styles, userStyles = _c === void 0 ? {} : _c, noSubscriptionsComponent = _a.noSubscriptionsComponent, _d = _a.hideTitle, hideTitle = _d === void 0 ? false : _d;
|
|
22225
22288
|
var defaultStyles = {
|
|
22226
22289
|
gap: 4,
|
|
22227
22290
|
shadow: "sm",
|
|
@@ -22241,7 +22304,6 @@ var SubscriptionsWrapper = function (_a) {
|
|
|
22241
22304
|
className: className,
|
|
22242
22305
|
subscriptionProductNameStyle: styles.subscriptionProductNameStyle,
|
|
22243
22306
|
productId: productId,
|
|
22244
|
-
entityId: entityId,
|
|
22245
22307
|
isInPreviewMode: isInPreviewMode,
|
|
22246
22308
|
upgradingSubscription: upgradingSubscription,
|
|
22247
22309
|
setUpgradingSubscription: setUpgradingSubscription,
|
|
@@ -22258,7 +22320,7 @@ var Subscriptions = function (_a) {
|
|
|
22258
22320
|
// Context
|
|
22259
22321
|
var token = useToken();
|
|
22260
22322
|
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, graphQLClient = _b.graphQLClient;
|
|
22261
|
-
var _c = react.useContext(SubscriptionsContext),
|
|
22323
|
+
var _c = react.useContext(SubscriptionsContext), setUpgradingSubscription = _c.setUpgradingSubscription, updatingChargeQuantityId = _c.updatingChargeQuantityId, setUpdatingChargeQuantityId = _c.setUpdatingChargeQuantityId, setSubscriptionUpgradeId = _c.setSubscriptionUpgradeId, className = _c.className, isInPreviewMode = _c.isInPreviewMode;
|
|
22262
22324
|
// Local state
|
|
22263
22325
|
var _d = react.useState(), editingQuoteData = _d[0], setEditingQuoteData = _d[1];
|
|
22264
22326
|
var _e = react.useState(false), payModalVisible = _e[0], setPayModalVisible = _e[1];
|
|
@@ -22284,20 +22346,16 @@ var Subscriptions = function (_a) {
|
|
|
22284
22346
|
token: token,
|
|
22285
22347
|
}),
|
|
22286
22348
|
queryFn: function () {
|
|
22287
|
-
return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id)
|
|
22288
|
-
? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost })
|
|
22289
|
-
: undefined;
|
|
22349
|
+
return (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) ? getQuote({ token: token, id: editingQuoteData.id, apiHost: apiHost }) : undefined;
|
|
22290
22350
|
},
|
|
22291
22351
|
enabled: Boolean(editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
|
|
22292
22352
|
}).data;
|
|
22293
22353
|
var _k = reactQuery.useQuery({
|
|
22294
22354
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
22295
|
-
filterString: "entityId=".concat(entityId),
|
|
22296
22355
|
pluralType: "subscriptions",
|
|
22297
22356
|
token: token,
|
|
22298
22357
|
}),
|
|
22299
|
-
queryFn: function () { return getSubscriptions({
|
|
22300
|
-
enabled: Boolean(entityId),
|
|
22358
|
+
queryFn: function () { return getSubscriptions({ token: token, apiHost: apiHost }); },
|
|
22301
22359
|
}), subscriptions = _k.data, subscriptionsAreLoading = _k.isLoading;
|
|
22302
22360
|
// Mutations
|
|
22303
22361
|
var subscriptionCancel = reactQuery.useMutation({
|
|
@@ -22307,7 +22365,6 @@ var Subscriptions = function (_a) {
|
|
|
22307
22365
|
onSuccess: function () {
|
|
22308
22366
|
queryClient.invalidateQueries({
|
|
22309
22367
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
22310
|
-
filterString: "entityId=".concat(entityId),
|
|
22311
22368
|
pluralType: "subscriptions",
|
|
22312
22369
|
token: token,
|
|
22313
22370
|
}),
|
|
@@ -22325,7 +22382,6 @@ var Subscriptions = function (_a) {
|
|
|
22325
22382
|
setSubscriptionUpgradeId(null);
|
|
22326
22383
|
setUpgradingSubscription(undefined);
|
|
22327
22384
|
}
|
|
22328
|
-
console.log("setIsChangingPlan true");
|
|
22329
22385
|
setIsChangingPlan(true);
|
|
22330
22386
|
};
|
|
22331
22387
|
var onCancelSubscriptionClick = function (subscription) {
|
|
@@ -22339,7 +22395,6 @@ var Subscriptions = function (_a) {
|
|
|
22339
22395
|
});
|
|
22340
22396
|
queryClient.invalidateQueries({
|
|
22341
22397
|
queryKey: common.QueryKeyFactory.default.createTableKey({
|
|
22342
|
-
filterString: "entityId=".concat(entityId),
|
|
22343
22398
|
pluralType: "subscriptions",
|
|
22344
22399
|
token: token,
|
|
22345
22400
|
}),
|
|
@@ -22382,16 +22437,12 @@ var Subscriptions = function (_a) {
|
|
|
22382
22437
|
if (hasExpiredOrCanceledSubscriptions && subscriptions.length > 0)
|
|
22383
22438
|
setExpiredSwitchVisible(true);
|
|
22384
22439
|
}, [hasExpiredOrCanceledSubscriptions, subscriptions]);
|
|
22385
|
-
react.useEffect(function () {
|
|
22386
|
-
console.log("isChangingPlan", isChangingPlan);
|
|
22387
|
-
}, [isChangingPlan]);
|
|
22388
22440
|
if (isChangingPlan || isInPreviewMode) {
|
|
22389
22441
|
return (jsxRuntime.jsx(PlanManager, { onChangePlanCancel: function () {
|
|
22390
|
-
console.log("setIsChangingPlan false");
|
|
22391
22442
|
setIsChangingPlan(false);
|
|
22392
22443
|
}, handlePortalErrors: handlePortalErrors }));
|
|
22393
22444
|
}
|
|
22394
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className
|
|
22445
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsxRuntime.jsx(PageTitle, { title: "Subscriptions" }) : null, jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: jsxRuntime.jsxs(Text, __assign({ className: "flex items-center justify-between", style: { minWidth: "137px" } }, { children: [hideExpired ? "Active subscriptions" : "All subscriptions", isMobile && (jsxRuntime.jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpired, visible: expiredSwitchVisible }))] })) }, { children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpired, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions })) })), jsxRuntime.jsx(SubscriptionsListContainer, { companyName: companyName, hideExpired: hideExpired, onCancelSubscriptionClick: onCancelSubscriptionClick, onChangePlanClick: onChangePlanClick, subscriptions: subscriptions, subscriptionsAreLoading: subscriptionsAreLoading, noSubscriptionsComponent: noSubscriptionsComponent }), isMobile && (jsxRuntime.jsx("div", __assign({ className: "pt-4 pb-2" }, { children: jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpired, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), jsxRuntime.jsx(Footer, {}), jsxRuntime.jsx(QuantityChangeDrawerDesktop, { editingQuote: quote, editingQuoteData: editingQuoteData, onClose: onClose, open: quantityDrawerOpen, openCheckout: function () { return setPayModalVisible(true); }, setEditingQuoteData: setEditingQuoteData, subscriptions: subscriptions }), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, isMobile: isMobile, storedPaymentMethod: storedPaymentMethod })] })));
|
|
22395
22446
|
};
|
|
22396
22447
|
var PageHeaderWithActions = function (_a) {
|
|
22397
22448
|
var children = _a.children, title = _a.title;
|
|
@@ -22433,7 +22484,7 @@ var billingDetailsUpdate = function (_a) {
|
|
|
22433
22484
|
|
|
22434
22485
|
function BillingDetailsSection(_a) {
|
|
22435
22486
|
var _this = this;
|
|
22436
|
-
var
|
|
22487
|
+
var hidePaymentMethodForm = _a.hidePaymentMethodForm, countryListFilter = _a.countryListFilter;
|
|
22437
22488
|
// State
|
|
22438
22489
|
var _b = react.useState(false), isFormEdited = _b[0], setIsFormEdited = _b[1];
|
|
22439
22490
|
var _c = react.useState(false), formIsValid = _c[0], setFormIsValid = _c[1];
|
|
@@ -22449,7 +22500,7 @@ function BillingDetailsSection(_a) {
|
|
|
22449
22500
|
var showSuccessNotification = common.useSuccessNotification();
|
|
22450
22501
|
// Queries
|
|
22451
22502
|
var _d = reactQuery.useQuery({
|
|
22452
|
-
queryKey: common.QueryKeyFactory.default.billingDetailsKey({
|
|
22503
|
+
queryKey: common.QueryKeyFactory.default.billingDetailsKey({ token: token }),
|
|
22453
22504
|
queryFn: function () { return getBillingDetails({ token: token, apiHost: apiHost }); },
|
|
22454
22505
|
}), billingDetails = _d.data, isLoadingBillingDetails = _d.isLoading;
|
|
22455
22506
|
var _e = reactQuery.useMutation({
|
|
@@ -22473,7 +22524,7 @@ function BillingDetailsSection(_a) {
|
|
|
22473
22524
|
})];
|
|
22474
22525
|
case 1:
|
|
22475
22526
|
updatedBillingDetails = _a.sent();
|
|
22476
|
-
queryClient.setQueryData(common.QueryKeyFactory.default.billingDetailsKey({
|
|
22527
|
+
queryClient.setQueryData(common.QueryKeyFactory.default.billingDetailsKey({ token: token }), function (old) {
|
|
22477
22528
|
return __assign(__assign({}, old), updatedBillingDetails.billingDetails);
|
|
22478
22529
|
});
|
|
22479
22530
|
return [2 /*return*/, updatedBillingDetails];
|
|
@@ -22484,7 +22535,6 @@ function BillingDetailsSection(_a) {
|
|
|
22484
22535
|
showSuccessNotification("Your account details have been saved");
|
|
22485
22536
|
queryClient.invalidateQueries({
|
|
22486
22537
|
queryKey: common.QueryKeyFactory.default.taxationRequiredAccountFieldsKey({
|
|
22487
|
-
entityId: entityId,
|
|
22488
22538
|
token: token,
|
|
22489
22539
|
}),
|
|
22490
22540
|
});
|
|
@@ -22533,6 +22583,11 @@ function BillingDetailsSection(_a) {
|
|
|
22533
22583
|
};
|
|
22534
22584
|
setIsFormEdited(isFormEdited());
|
|
22535
22585
|
}, [form, values, billingDetails]);
|
|
22586
|
+
// Validate form fields when isFormEdited changes
|
|
22587
|
+
react.useEffect(function () {
|
|
22588
|
+
var validateOnly = isFormEdited ? false : true;
|
|
22589
|
+
form.validateFields({ validateOnly: validateOnly });
|
|
22590
|
+
}, [isFormEdited]);
|
|
22536
22591
|
var saveBillingDetails = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
22537
22592
|
var _this = this;
|
|
22538
22593
|
return __generator(this, function (_a) {
|
|
@@ -22571,32 +22626,34 @@ function BillingDetailsSection(_a) {
|
|
|
22571
22626
|
? common.Lists.COUNTRY_LIST.filter(countryListFilter)
|
|
22572
22627
|
: common.Lists.COUNTRY_LIST;
|
|
22573
22628
|
}, [countryListFilter]);
|
|
22574
|
-
return (jsxRuntime.
|
|
22575
|
-
|
|
22576
|
-
|
|
22577
|
-
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22581
|
-
|
|
22582
|
-
|
|
22583
|
-
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : "")
|
|
22629
|
+
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hidePaymentMethodForm ? "w-full" : "w-1/2") }, { children: jsxRuntime.jsxs("div", __assign({ className: "px-4" }, { children: [jsxRuntime.jsx(antd.Skeleton, __assign({ loading: isLoadingBillingDetails }, { children: jsxRuntime.jsxs(antd.Form, __assign({ className: "flex flex-col gap-2", form: form, layout: "vertical", disabled: isUpdatingBillingDetails, autoComplete: "off" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Account name", name: "name", rules: [{ required: true, message: "Account name is required" }] }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Street address", name: "billingStreet", rules: [
|
|
22630
|
+
{ required: true, message: "Street address is required" },
|
|
22631
|
+
] }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsxs("div", __assign({ className: "flex gap-4" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "City", name: "billingCity", rules: [{ required: true, message: "City is required" }], className: "flex-1" }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Zipcode", name: "billingZip", rules: [{ required: true, message: "Zipcode is required" }], className: "flex-1" }, { children: jsxRuntime.jsx(antd.Input, {}) }))] })), jsxRuntime.jsxs("div", __assign({ className: "flex ".concat(isMobile ? "flex-col pb-2" : "flex-row", " gap-4") }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "State", name: "billingState", className: "flex-1", rules: [
|
|
22632
|
+
{
|
|
22633
|
+
required: false,
|
|
22634
|
+
},
|
|
22635
|
+
] }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Country", name: "billingCountry", className: "flex-1", rules: [{ required: true, message: "Country is required" }] }, { children: jsxRuntime.jsx(antd.Select, { options: filteredCountryList, placeholder: "Select a country", showSearch: true, filterOption: function (input, option) {
|
|
22636
|
+
var _a, _b;
|
|
22637
|
+
return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : "")
|
|
22584
22638
|
.toLowerCase()
|
|
22585
|
-
.includes(input.toLowerCase())
|
|
22586
|
-
|
|
22587
|
-
|
|
22588
|
-
|
|
22589
|
-
|
|
22590
|
-
|
|
22591
|
-
|
|
22592
|
-
|
|
22639
|
+
.includes(input.toLowerCase()) ||
|
|
22640
|
+
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : "")
|
|
22641
|
+
.toLowerCase()
|
|
22642
|
+
.includes(input.toLowerCase());
|
|
22643
|
+
} }) }))] })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Email", name: "billingContactEmail", rules: [
|
|
22644
|
+
{
|
|
22645
|
+
required: true,
|
|
22646
|
+
message: "Email is required",
|
|
22647
|
+
type: "email",
|
|
22648
|
+
},
|
|
22649
|
+
] }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Tax ID", name: "taxNumber", tooltip: "Tax ID will be printed on quotes and invoices below the account's address", rules: [{ required: false }] }, { children: jsxRuntime.jsx(antd.Input, {}) }))] })) })), jsxRuntime.jsx(antd.Button, __assign({ disabled: !isFormEdited || isUpdatingBillingDetails || !formIsValid, className: "w-full mt-4", type: "primary", onClick: saveBillingDetails }, { children: "Save" }))] })) })));
|
|
22593
22650
|
}
|
|
22594
22651
|
|
|
22595
22652
|
var BillingDetails = function (_a) {
|
|
22596
|
-
var
|
|
22653
|
+
var _b = _a.isCardEnabled, isCardEnabled = _b === void 0 ? true : _b, _c = _a.shadow, shadow = _c === void 0 ? "shadow-md" : _c, className = _a.className, _d = _a.hidePaymentMethodForm, hidePaymentMethodForm = _d === void 0 ? false : _d, _e = _a.hideBillingDetailsForm, hideBillingDetailsForm = _e === void 0 ? false : _e, countryListFilter = _a.countryListFilter;
|
|
22597
22654
|
// Hooks
|
|
22598
22655
|
var isMobile = common.useIsMobile();
|
|
22599
|
-
return (jsxRuntime.jsx(WrapperComponent, __assign({ isCardEnabled: isCardEnabled, shadow: shadow, className: className }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex p-2 my-2 ".concat(isMobile ? "flex-col space-y-4" : "flex-row", " gap-4") }, { children: [!hideBillingDetailsForm ? (jsxRuntime.jsx(BillingDetailsSection, { hidePaymentMethodForm: hidePaymentMethodForm, countryListFilter: countryListFilter
|
|
22656
|
+
return (jsxRuntime.jsx(WrapperComponent, __assign({ isCardEnabled: isCardEnabled, shadow: shadow, className: className }, { children: jsxRuntime.jsxs("div", __assign({ className: "flex p-2 my-2 ".concat(isMobile ? "flex-col space-y-4" : "flex-row", " gap-4") }, { children: [!hideBillingDetailsForm ? (jsxRuntime.jsx(BillingDetailsSection, { hidePaymentMethodForm: hidePaymentMethodForm, countryListFilter: countryListFilter })) : null, !hideBillingDetailsForm && !hidePaymentMethodForm ? (jsxRuntime.jsx(ResponsiveDivider, {})) : null, !hidePaymentMethodForm ? (jsxRuntime.jsx(PaymentFormSection, { hideBillingDetailsForm: hideBillingDetailsForm })) : null] })) })));
|
|
22600
22657
|
};
|
|
22601
22658
|
var WrapperComponent = function (_a) {
|
|
22602
22659
|
var children = _a.children, isCardEnabled = _a.isCardEnabled, shadow = _a.shadow, className = _a.className;
|
|
@@ -22607,12 +22664,12 @@ var ResponsiveDivider = function () {
|
|
|
22607
22664
|
return isMobile ? (jsxRuntime.jsx("div", __assign({ className: "mx-4" }, { children: jsxRuntime.jsx(antd.Divider, {}) }))) : (jsxRuntime.jsx("div", { children: jsxRuntime.jsx(antd.Divider, { className: "h-full", type: "vertical" }) }));
|
|
22608
22665
|
};
|
|
22609
22666
|
var PaymentFormSection = function (_a) {
|
|
22610
|
-
var
|
|
22667
|
+
var hideBillingDetailsForm = _a.hideBillingDetailsForm;
|
|
22611
22668
|
var isMobile = common.useIsMobile();
|
|
22612
22669
|
var _b = react.useContext(BunnyContext), onTokenExpired = _b.onTokenExpired, graphQLClient = _b.graphQLClient;
|
|
22613
22670
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
22614
22671
|
var showSuccessNotification = common.useSuccessNotification();
|
|
22615
|
-
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? "w-full" : "w-1/2 pt-4", " flex justify-center") }, { children: jsxRuntime.jsx(PaymentForm, {
|
|
22672
|
+
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? "w-full" : "w-1/2 pt-4", " flex justify-center") }, { children: jsxRuntime.jsx(PaymentForm, { onFail: function (error) {
|
|
22616
22673
|
handleAllErrorFormats(error);
|
|
22617
22674
|
}, onSavePaymentMethod: function () {
|
|
22618
22675
|
showSuccessNotification("Your payment method has been saved");
|