@bunnyapp/components 1.0.66 → 1.0.68-beta.10
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 +452 -297
- package/dist/cjs/src/components/Checkout/Checkout.d.ts +1 -3
- package/dist/cjs/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/cjs/src/components/PaymentForm/PaymentForm.d.ts +2 -1
- package/dist/cjs/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
- package/dist/cjs/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
- package/dist/cjs/src/components/Signup/CheckoutSummary.d.ts +11 -0
- package/dist/cjs/src/components/Signup/PaymentForms.d.ts +6 -0
- package/dist/cjs/src/components/Signup/Signup.d.ts +1 -3
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanManager.d.ts +0 -4
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/SubscriptionsContext.d.ts +2 -1
- package/dist/cjs/src/contexts/PaymentContext.d.ts +1 -1
- package/dist/cjs/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/cjs/src/graphql/mutations/quoteAccountSignup.d.ts +3 -2
- package/dist/cjs/src/graphql/mutations/quoteChangeAddCoupon.d.ts +8 -0
- package/dist/cjs/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +8 -0
- package/dist/cjs/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/cjs/src/hooks/usePaymentPlugins.d.ts +24 -3
- package/dist/esm/index.js +455 -281
- package/dist/esm/src/components/Checkout/Checkout.d.ts +1 -3
- package/dist/esm/src/components/Checkout/checkoutUtils.d.ts +1 -1
- package/dist/esm/src/components/PaymentForm/PaymentForm.d.ts +2 -1
- package/dist/esm/src/components/PaymentForm/Stripe/StripeForm.d.ts +1 -1
- package/dist/esm/src/components/Quote/AcceptQuoteModal.d.ts +1 -1
- package/dist/esm/src/components/Signup/CheckoutSummary.d.ts +11 -0
- package/dist/esm/src/components/Signup/PaymentForms.d.ts +6 -0
- package/dist/esm/src/components/Signup/Signup.d.ts +1 -3
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanManager.d.ts +0 -4
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/CheckoutBarSummarySection.d.ts +2 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/checkoutBar/PlanPickerCheckoutBar.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/planPickerMobile/PriceListCardMobile.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/PlanManager/PlanPicker/priceListCard/PriceListCardDescription.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/SubscriptionsContext.d.ts +2 -1
- package/dist/esm/src/contexts/PaymentContext.d.ts +1 -1
- package/dist/esm/src/graphql/mutations/accountSignup.d.ts +1 -2
- package/dist/esm/src/graphql/mutations/quoteAccountSignup.d.ts +3 -2
- package/dist/esm/src/graphql/mutations/quoteChangeAddCoupon.d.ts +8 -0
- package/dist/esm/src/graphql/mutations/quoteChangeRemoveCoupon.d.ts +8 -0
- package/dist/esm/src/hooks/quotes/useSendAcceptQuote.d.ts +1 -2
- package/dist/esm/src/hooks/usePaymentPlugins.d.ts +24 -3
- package/dist/index.d.ts +3 -4
- package/package.json +4 -5
- package/dist/cjs/src/graphql/mutations/quoteAddCoupon.d.ts +0 -8
- package/dist/esm/src/graphql/mutations/quoteAddCoupon.d.ts +0 -8
package/dist/cjs/index.js
CHANGED
|
@@ -13,9 +13,9 @@ var reactQuery = require('@tanstack/react-query');
|
|
|
13
13
|
var theme = require('antd/lib/theme/index.js');
|
|
14
14
|
var recoil = require('recoil');
|
|
15
15
|
var request = require('graphql-request');
|
|
16
|
+
var react$1 = require('@pdf-viewer/react');
|
|
16
17
|
var reactStripeJs = require('@stripe/react-stripe-js');
|
|
17
18
|
var index_js = require('@stripe/stripe-js/pure/index.js');
|
|
18
|
-
var parse = require('html-react-parser');
|
|
19
19
|
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
20
20
|
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
21
21
|
var recharts = require('recharts');
|
|
@@ -24,28 +24,9 @@ var pkg = require('pluralize');
|
|
|
24
24
|
|
|
25
25
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
26
|
|
|
27
|
-
function _interopNamespace(e) {
|
|
28
|
-
if (e && e.__esModule) return e;
|
|
29
|
-
var n = Object.create(null);
|
|
30
|
-
if (e) {
|
|
31
|
-
Object.keys(e).forEach(function (k) {
|
|
32
|
-
if (k !== 'default') {
|
|
33
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
34
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function () { return e[k]; }
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
n["default"] = e;
|
|
42
|
-
return Object.freeze(n);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
27
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
46
28
|
var theme__default = /*#__PURE__*/_interopDefaultLegacy(theme);
|
|
47
29
|
var request__default = /*#__PURE__*/_interopDefaultLegacy(request);
|
|
48
|
-
var parse__default = /*#__PURE__*/_interopDefaultLegacy(parse);
|
|
49
30
|
var pkg__default = /*#__PURE__*/_interopDefaultLegacy(pkg);
|
|
50
31
|
|
|
51
32
|
function styleInject(css, ref) {
|
|
@@ -75,7 +56,7 @@ function styleInject(css, ref) {
|
|
|
75
56
|
}
|
|
76
57
|
}
|
|
77
58
|
|
|
78
|
-
var css_248z = ":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.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\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.bunny-shadow,\n.bunny-shadow-md {\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.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-5 {\n height: 1.25rem;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-2 {\n grid-template-columns: repeat(2, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-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.bunny-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.bunny-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.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-visible {\n overflow: visible;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-2 {\n padding: 0.5rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-0 {\n padding-left: 0px;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-6 {\n padding-top: 1.5rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-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.bunny-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.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\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.-top-0\\.5 {\n top: -0.125rem;\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-0 {\n margin-top: 0px;\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.mr-4 {\n margin-right: 1rem;\n}\n.mb-0 {\n margin-bottom: 0px;\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-12 {\n width: 3rem;\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.whitespace-pre-wrap {\n white-space: pre-wrap;\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.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-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-red-400 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 113 113 / 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-500 {\n --tw-text-opacity: 1;\n color: rgb(107 114 128 / 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.duration-300 {\n transition-duration: 300ms;\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}\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";
|
|
59
|
+
var css_248z = ":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.bunny-component-wrapper {\n box-sizing: border-box;\n}\n.bunny-component-wrapper * {\n box-sizing: border-box;\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.bunny-shadow,\n.bunny-shadow-md {\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.bunny-fixed {\n position: fixed;\n}\n.bunny-absolute {\n position: absolute;\n}\n.bunny-relative {\n position: relative;\n}\n.bunny-sticky {\n position: sticky;\n}\n.bunny-bottom-0 {\n bottom: 0px;\n}\n.bunny-bottom-4 {\n bottom: 1rem;\n}\n.bunny-left-0 {\n left: 0px;\n}\n.bunny-right-0 {\n right: 0px;\n}\n.bunny-top-0 {\n top: 0px;\n}\n.bunny-col-span-1 {\n grid-column: span 1 / span 1;\n}\n.bunny-col-span-full {\n grid-column: 1 / -1;\n}\n.bunny-m-0 {\n margin: 0px;\n}\n.bunny-mx-0 {\n margin-left: 0px;\n margin-right: 0px;\n}\n.bunny-mx-4 {\n margin-left: 1rem;\n margin-right: 1rem;\n}\n.bunny-my-2 {\n margin-top: 0.5rem;\n margin-bottom: 0.5rem;\n}\n.bunny-my-24 {\n margin-top: 6rem;\n margin-bottom: 6rem;\n}\n.bunny-my-4 {\n margin-top: 1rem;\n margin-bottom: 1rem;\n}\n.bunny-mb-2 {\n margin-bottom: 0.5rem;\n}\n.bunny-mb-4 {\n margin-bottom: 1rem;\n}\n.bunny-mb-8 {\n margin-bottom: 2rem;\n}\n.bunny-mt-2 {\n margin-top: 0.5rem;\n}\n.bunny-mt-24 {\n margin-top: 6rem;\n}\n.bunny-mt-4 {\n margin-top: 1rem;\n}\n.bunny-flex {\n display: flex;\n}\n.bunny-grid {\n display: grid;\n}\n.bunny-contents {\n display: contents;\n}\n.bunny-h-1\\/2 {\n height: 50%;\n}\n.bunny-h-5 {\n height: 1.25rem;\n}\n.bunny-h-8 {\n height: 2rem;\n}\n.bunny-h-full {\n height: 100%;\n}\n.bunny-h-screen {\n height: 100vh;\n}\n.bunny-min-h-0 {\n min-height: 0px;\n}\n.bunny-w-1\\/2 {\n width: 50%;\n}\n.bunny-w-3\\/5 {\n width: 60%;\n}\n.bunny-w-full {\n width: 100%;\n}\n.bunny-w-screen {\n width: 100vw;\n}\n.bunny-flex-1 {\n flex: 1 1 0%;\n}\n.bunny-shrink {\n flex-shrink: 1;\n}\n.bunny-shrink-0 {\n flex-shrink: 0;\n}\n.bunny-grow {\n flex-grow: 1;\n}\n.bunny-cursor-pointer {\n cursor: pointer;\n}\n.bunny-grid-cols-3 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n}\n.bunny-flex-row {\n flex-direction: row;\n}\n.bunny-flex-col {\n flex-direction: column;\n}\n.bunny-items-start {\n align-items: flex-start;\n}\n.bunny-items-end {\n align-items: flex-end;\n}\n.bunny-items-center {\n align-items: center;\n}\n.bunny-justify-end {\n justify-content: flex-end;\n}\n.bunny-justify-center {\n justify-content: center;\n}\n.bunny-justify-between {\n justify-content: space-between;\n}\n.bunny-gap-0 {\n gap: 0px;\n}\n.bunny-gap-1 {\n gap: 0.25rem;\n}\n.bunny-gap-2 {\n gap: 0.5rem;\n}\n.bunny-gap-3 {\n gap: 0.75rem;\n}\n.bunny-gap-4 {\n gap: 1rem;\n}\n.bunny-gap-6 {\n gap: 1.5rem;\n}\n.bunny-gap-8 {\n gap: 2rem;\n}\n.bunny-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.bunny-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.bunny-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.bunny-overflow-auto {\n overflow: auto;\n}\n.bunny-overflow-hidden {\n overflow: hidden;\n}\n.bunny-overflow-visible {\n overflow: visible;\n}\n.bunny-whitespace-nowrap {\n white-space: nowrap;\n}\n.bunny-rounded {\n border-radius: 0.25rem;\n}\n.bunny-rounded-full {\n border-radius: 9999px;\n}\n.bunny-rounded-lg {\n border-radius: 0.5rem;\n}\n.bunny-rounded-md {\n border-radius: 0.375rem;\n}\n.bunny-border {\n border-width: 1px;\n}\n.bunny-border-2 {\n border-width: 2px;\n}\n.bunny-border-solid {\n border-style: solid;\n}\n.bunny-border-none {\n border-style: none;\n}\n.bunny-border-slate-200 {\n --tw-border-opacity: 1;\n border-color: rgb(226 232 240 / var(--tw-border-opacity, 1));\n}\n.bunny-bg-slate-50 {\n --tw-bg-opacity: 1;\n background-color: rgb(248 250 252 / var(--tw-bg-opacity, 1));\n}\n.bunny-bg-white {\n --tw-bg-opacity: 1;\n background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));\n}\n.bunny-p-0 {\n padding: 0px;\n}\n.bunny-p-1 {\n padding: 0.25rem;\n}\n.bunny-p-2 {\n padding: 0.5rem;\n}\n.bunny-p-4 {\n padding: 1rem;\n}\n.bunny-px-3 {\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n}\n.bunny-px-4 {\n padding-left: 1rem;\n padding-right: 1rem;\n}\n.bunny-px-6 {\n padding-left: 1.5rem;\n padding-right: 1.5rem;\n}\n.bunny-py-2 {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n.bunny-py-4 {\n padding-top: 1rem;\n padding-bottom: 1rem;\n}\n.bunny-py-6 {\n padding-top: 1.5rem;\n padding-bottom: 1.5rem;\n}\n.bunny-pb-2 {\n padding-bottom: 0.5rem;\n}\n.bunny-pb-4 {\n padding-bottom: 1rem;\n}\n.bunny-pb-6 {\n padding-bottom: 1.5rem;\n}\n.bunny-pb-8 {\n padding-bottom: 2rem;\n}\n.bunny-pl-0 {\n padding-left: 0px;\n}\n.bunny-pl-4 {\n padding-left: 1rem;\n}\n.bunny-pr-4 {\n padding-right: 1rem;\n}\n.bunny-pt-12 {\n padding-top: 3rem;\n}\n.bunny-pt-2 {\n padding-top: 0.5rem;\n}\n.bunny-pt-4 {\n padding-top: 1rem;\n}\n.bunny-pt-5 {\n padding-top: 1.25rem;\n}\n.bunny-pt-6 {\n padding-top: 1.5rem;\n}\n.bunny-pt-\\[25vh\\] {\n padding-top: 25vh;\n}\n.bunny-text-left {\n text-align: left;\n}\n.bunny-text-center {\n text-align: center;\n}\n.bunny-text-right {\n text-align: right;\n}\n.bunny-text-2xl {\n font-size: 1.5rem;\n line-height: 2rem;\n}\n.bunny-text-base {\n font-size: 1rem;\n line-height: 1.5rem;\n}\n.bunny-text-lg {\n font-size: 1.125rem;\n line-height: 1.75rem;\n}\n.bunny-text-sm {\n font-size: 0.875rem;\n line-height: 1.25rem;\n}\n.bunny-text-xl {\n font-size: 1.25rem;\n line-height: 1.75rem;\n}\n.bunny-text-xs {\n font-size: 0.75rem;\n line-height: 1rem;\n}\n.bunny-font-bold {\n font-weight: 700;\n}\n.bunny-font-medium {\n font-weight: 500;\n}\n.bunny-font-normal {\n font-weight: 400;\n}\n.bunny-text-gray-600 {\n --tw-text-opacity: 1;\n color: rgb(75 85 99 / var(--tw-text-opacity, 1));\n}\n.bunny-text-gray-900 {\n --tw-text-opacity: 1;\n color: rgb(17 24 39 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-500 {\n --tw-text-opacity: 1;\n color: rgb(249 115 22 / var(--tw-text-opacity, 1));\n}\n.bunny-text-orange-600 {\n --tw-text-opacity: 1;\n color: rgb(234 88 12 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-400 {\n --tw-text-opacity: 1;\n color: rgb(148 163 184 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-500 {\n --tw-text-opacity: 1;\n color: rgb(100 116 139 / var(--tw-text-opacity, 1));\n}\n.bunny-text-slate-600 {\n --tw-text-opacity: 1;\n color: rgb(71 85 105 / var(--tw-text-opacity, 1));\n}\n.bunny-underline {\n text-decoration-line: underline;\n}\n.bunny-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.bunny-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.bunny-transition-\\[margin\\] {\n transition-property: margin;\n transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n transition-duration: 150ms;\n}\n.bunny-duration-300 {\n transition-duration: 300ms;\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.-top-0\\.5 {\n top: -0.125rem;\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-12 {\n width: 3rem;\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.hover\\:bg-gray-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-100:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(241 245 249 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-slate-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(226 232 240 / var(--tw-bg-opacity, 1));\n}\n.hover\\:bg-gray-200:hover {\n --tw-bg-opacity: 1;\n background-color: rgb(229 231 235 / 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.hover\\:bunny-text-orange-400:hover {\n --tw-text-opacity: 1;\n color: rgb(251 146 60 / var(--tw-text-opacity, 1));\n}\n.bunny-invoice-container {\n padding: 0;\n box-sizing: border-box !important;\n line-height: 1.15;\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";
|
|
79
60
|
styleInject(css_248z);
|
|
80
61
|
|
|
81
62
|
/******************************************************************************
|
|
@@ -173,7 +154,7 @@ var BrandContext = react.createContext({
|
|
|
173
154
|
});
|
|
174
155
|
|
|
175
156
|
// This will be replaced at build time by rollup-plugin-replace
|
|
176
|
-
var PACKAGE_VERSION = '1.0.
|
|
157
|
+
var PACKAGE_VERSION = '1.0.68-beta.10';
|
|
177
158
|
var createRequestHeaders = function (token) {
|
|
178
159
|
var headers = common.createClientDevHeaders(token);
|
|
179
160
|
// Add the components version header
|
|
@@ -217,7 +198,7 @@ var gqlRequest = function (_a) {
|
|
|
217
198
|
});
|
|
218
199
|
};
|
|
219
200
|
|
|
220
|
-
var MUTATION$
|
|
201
|
+
var MUTATION$b = "\n query entityBranding {\n entityBranding {\n accentColor\n brandColor\n topNavImageUrl\n }\n }\n";
|
|
221
202
|
var getBranding = function (_a) {
|
|
222
203
|
var token = _a.token, apiHost = _a.apiHost;
|
|
223
204
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -225,7 +206,7 @@ var getBranding = function (_a) {
|
|
|
225
206
|
return __generator(this, function (_b) {
|
|
226
207
|
switch (_b.label) {
|
|
227
208
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
228
|
-
query: MUTATION$
|
|
209
|
+
query: MUTATION$b,
|
|
229
210
|
token: token,
|
|
230
211
|
apiHost: apiHost,
|
|
231
212
|
})];
|
|
@@ -407,6 +388,20 @@ function useToken() {
|
|
|
407
388
|
return overrideToken || tokenFromContext;
|
|
408
389
|
}
|
|
409
390
|
|
|
391
|
+
var LISENSE_KEY = 'eyJkYXRhIjoiZXlKMElqb2liM0puWVc1cGVtRjBhVzl1SWl3aVlYWjFJam94TnpneU5ETXhPVGs1TENKa2JTSTZJbUoxYm01NUxtTnZiU0lzSW00aU9pSmhOV1F5TWpKaFpXTTNOelF5TkdFNUlpd2laWGh3SWpveE56WTJORFEzT1RrNUxDSmtiWFFpT2lKM2FXeGtZMkZ5WkNKOSIsInNpZ25hdHVyZSI6ImdJWW5BYWp0WW1aSHV1b1RrTkZCZnRGYjEzUTJOZXZwQXlKRmszdy9STDNUa08rRXZYWlV0MDZxenBrZWdOK1A4TXlkbFY1aityemQvM1VpYlB5SW1VSzAweHZSVk5hS29EOXB0cVpkbjR5SWRRdE1pU1NjZ0J1K1RkM0NXM2FONVNrdlNJVDEyTGpBMnVVYll2RmJ6RFpMci9hODkwa05sT0NQZURoVjMyd0w3R0NrTnV2Z1MyZlk5Mis0L25FdUdvZXBZR0RPN0Ryb3NaOGVlbnJ6b1BsQ044T204eFlMNXJxdUkvS2xLVTVYaGN0allrdzBTR0FlL0pDR1dTN1dLTDAvYmFvbS9GS1ltNU91VmlzcmlDVlc2UXgvbzBnTGE4bUtXLytMb3pNaHdFemdtU2I2S0xERzZpTEVPL0czQ2pYN2p2dTU1NEc4OUx2aW1BaE5BQT09In0=';
|
|
392
|
+
// Custom zoom layout component that uses useZoomContext
|
|
393
|
+
var CustomZoomLayout = function () {
|
|
394
|
+
// Consume from the controller provider
|
|
395
|
+
var _a = react$1.useZoomContext(), currentZoom = _a.currentZoom, setZoomLevel = _a.setZoomLevel;
|
|
396
|
+
var mountTimeRef = react.useRef(Date.now());
|
|
397
|
+
// Set default zoom to 100% once the document is loaded
|
|
398
|
+
react.useEffect(function () {
|
|
399
|
+
if (currentZoom < 1 && Date.now() - mountTimeRef.current < 3000) {
|
|
400
|
+
setZoomLevel(100);
|
|
401
|
+
}
|
|
402
|
+
}, [currentZoom, setZoomLevel]);
|
|
403
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
404
|
+
};
|
|
410
405
|
var DocumentTemplatePreview = function (_a) {
|
|
411
406
|
var targetUrl = _a.targetUrl;
|
|
412
407
|
var _b = react.useState(null), pdfUrl = _b[0], setPdfUrl = _b[1];
|
|
@@ -454,7 +449,13 @@ var DocumentTemplatePreview = function (_a) {
|
|
|
454
449
|
if (!pdfUrl) {
|
|
455
450
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
456
451
|
}
|
|
457
|
-
return (jsxRuntime.jsx("div", __assign({ className: "
|
|
452
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-rounded bunny-w-full bunny-overflow-hidden bunny-grow bunny-min-h-0" }, { children: jsxRuntime.jsx(react$1.RPConfig, __assign({ licenseKey: LISENSE_KEY }, { children: jsxRuntime.jsxs(react$1.RPProvider, __assign({ src: pdfUrl }, { children: [jsxRuntime.jsx(CustomZoomLayout, {}), jsxRuntime.jsx(react$1.RPDefaultLayout, __assign({ style: {
|
|
453
|
+
width: '100%',
|
|
454
|
+
height: '100%',
|
|
455
|
+
}, slots: {
|
|
456
|
+
openFileTool: false,
|
|
457
|
+
downloadTool: false,
|
|
458
|
+
} }, { children: jsxRuntime.jsx(react$1.RPPages, {}) }))] })) })) })));
|
|
458
459
|
};
|
|
459
460
|
|
|
460
461
|
var MarkupContainer = defaultStyled.div(templateObject_1$c || (templateObject_1$c = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
|
|
@@ -471,7 +472,7 @@ var InvoiceQuoteView = function (_a) {
|
|
|
471
472
|
color: secondaryColor,
|
|
472
473
|
}, type: "link" }, { children: backButtonName || 'Back' }))) : null }), !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () {
|
|
473
474
|
return downloadFile(apiHost + '/api/pdf/invoice/' + formattedInvoice.id, token);
|
|
474
|
-
} }, { children: "Download" }))) : null] }))) : null, isMobile ? (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-grow bunny-w-full bunny-shadow-padding-xb bunny-overflow-auto" }, { children: [targetUrl ? (jsxRuntime.jsx(DocumentTemplatePreview, { targetUrl: targetUrl })) : (jsxRuntime.jsx(interweave.Markup, { content: html })), children] }))) : (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-p-4 bunny-w-full bunny-bg-white ".concat(shadow ? shadow : 'bunny-shadow-md', " bunny-rounded-md"), style: {
|
|
475
|
+
} }, { children: "Download" }))) : null] }))) : null, isMobile ? (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-grow bunny-w-full bunny-shadow-padding-xb bunny-overflow-auto" }, { children: [targetUrl ? (jsxRuntime.jsx(DocumentTemplatePreview, { targetUrl: targetUrl })) : (jsxRuntime.jsx(interweave.Markup, { content: html })), children] }))) : (jsxRuntime.jsxs(MarkupContainer, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-p-4 bunny-w-full bunny-bg-white bunny-grow ".concat(shadow ? shadow : 'bunny-shadow-md', " bunny-rounded-md"), style: {
|
|
475
476
|
minWidth: '750px',
|
|
476
477
|
} }, { children: [targetUrl ? (jsxRuntime.jsx(DocumentTemplatePreview, { targetUrl: targetUrl })) : (jsxRuntime.jsx(interweave.Markup, { content: html })), children] })))] })));
|
|
477
478
|
};
|
|
@@ -523,6 +524,41 @@ function LegacyDocument(_a) {
|
|
|
523
524
|
}, title: "Invoice PDF", width: "100%" }));
|
|
524
525
|
}
|
|
525
526
|
|
|
527
|
+
var MUTATION$a = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
528
|
+
var checkout = function (_a) {
|
|
529
|
+
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
530
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
531
|
+
var mutationVars, response, errors;
|
|
532
|
+
return __generator(this, function (_b) {
|
|
533
|
+
switch (_b.label) {
|
|
534
|
+
case 0:
|
|
535
|
+
mutationVars = {
|
|
536
|
+
quoteId: quoteId,
|
|
537
|
+
invoiceId: invoiceId,
|
|
538
|
+
paymentMethodId: paymentMethodId,
|
|
539
|
+
};
|
|
540
|
+
if (paymentMethodData) {
|
|
541
|
+
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
542
|
+
}
|
|
543
|
+
return [4 /*yield*/, gqlRequest({
|
|
544
|
+
query: MUTATION$a,
|
|
545
|
+
token: token,
|
|
546
|
+
vars: mutationVars,
|
|
547
|
+
apiHost: apiHost,
|
|
548
|
+
})];
|
|
549
|
+
case 1:
|
|
550
|
+
response = _b.sent();
|
|
551
|
+
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
552
|
+
if (errors)
|
|
553
|
+
throw errors;
|
|
554
|
+
return [2 /*return*/, {
|
|
555
|
+
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
556
|
+
}];
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
});
|
|
560
|
+
};
|
|
561
|
+
|
|
526
562
|
var paymentMethodsQuery = function (filter) { return "query paymentMethods {\n paymentMethods ".concat(filter ? "(".concat(filter, ")") : '', " {\n nodes {\n id\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 type\n }\n isDefault\n }\n }\n}"); };
|
|
527
563
|
var getPaymentMethods = function (_a) {
|
|
528
564
|
var apiHost = _a.apiHost, token = _a.token, accountId = _a.accountId;
|
|
@@ -562,11 +598,15 @@ var usePaymentMethod = function (_a) {
|
|
|
562
598
|
};
|
|
563
599
|
|
|
564
600
|
var filterPaymentPlugins = function (plugins) {
|
|
601
|
+
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) { var _a, _b; return ((_a = plugin.type) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === 'payment' && ((_b = plugin.status) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === 'valid'; });
|
|
602
|
+
};
|
|
603
|
+
var filterPaymentPluginsByEntity = function (plugins, selectedEntityId) {
|
|
565
604
|
return plugins === null || plugins === void 0 ? void 0 : plugins.filter(function (plugin) {
|
|
566
|
-
var _a, _b
|
|
567
|
-
return
|
|
568
|
-
|
|
569
|
-
((
|
|
605
|
+
var _a, _b;
|
|
606
|
+
return selectedEntityId === undefined ||
|
|
607
|
+
selectedEntityId === null ||
|
|
608
|
+
((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(selectedEntityId)) ||
|
|
609
|
+
((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0;
|
|
570
610
|
});
|
|
571
611
|
};
|
|
572
612
|
var MUTATION$9 = "{\n paymentPlugins {\n enabled\n entities\n guid\n hidden\n id\n name\n status\n type\n webhookEnabled\n components\n }\n}";
|
|
@@ -595,19 +635,18 @@ var getPaymentPlugins = function (_a) {
|
|
|
595
635
|
});
|
|
596
636
|
};
|
|
597
637
|
var usePaymentPlugins = function (_a) {
|
|
598
|
-
var apiHost = _a.apiHost, token = _a.token;
|
|
638
|
+
var apiHost = _a.apiHost, token = _a.token, selectedEntityId = _a.selectedEntityId;
|
|
599
639
|
var _b = reactQuery.useQuery({
|
|
600
640
|
queryKey: ['paymentPlugins', token],
|
|
601
641
|
queryFn: function () { return getPaymentPlugins({ apiHost: apiHost, token: token }); },
|
|
602
642
|
staleTime: 5 * 60 * 1000, // Consider data fresh for 5 minutes
|
|
603
643
|
}), paymentPlugins = _b.data, isFetched = _b.isFetched;
|
|
604
644
|
var filteredPaymentPlugins = filterPaymentPlugins(paymentPlugins);
|
|
605
|
-
var
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
});
|
|
645
|
+
var filteredPaymentPluginsByEntity = selectedEntityId
|
|
646
|
+
? filterPaymentPluginsByEntity(filteredPaymentPlugins, selectedEntityId)
|
|
647
|
+
: filteredPaymentPlugins;
|
|
609
648
|
return {
|
|
610
|
-
paymentPlugins:
|
|
649
|
+
paymentPlugins: filteredPaymentPluginsByEntity,
|
|
611
650
|
isFetched: isFetched,
|
|
612
651
|
};
|
|
613
652
|
};
|
|
@@ -616,41 +655,6 @@ var getQuoteAmountDue = function (quote) {
|
|
|
616
655
|
return quote.amountDue || quote.amount;
|
|
617
656
|
};
|
|
618
657
|
|
|
619
|
-
var MUTATION$8 = "\n mutation checkout(\n $invoiceId: ID,\n $quoteId: ID,\n $paymentMethodId: ID,\n $paymentMethodData: CheckoutPaymentMethodAttributes\n ) {\n checkout(\n invoiceId: $invoiceId,\n quoteId: $quoteId,\n paymentMethodId: $paymentMethodId,\n paymentMethodData: $paymentMethodData\n ) {\n invoice {\n id\n state\n amount\n amountDue\n }\n payment {\n id\n state\n amount\n }\n paymentApplication {\n id\n invoiceId\n paymentId\n }\n transaction {\n id\n amount\n }\n }\n }\n";
|
|
620
|
-
var checkout = function (_a) {
|
|
621
|
-
var quoteId = _a.quoteId, invoiceId = _a.invoiceId, paymentMethodId = _a.paymentMethodId, paymentMethodData = _a.paymentMethodData, token = _a.token, apiHost = _a.apiHost;
|
|
622
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
623
|
-
var mutationVars, response, errors;
|
|
624
|
-
return __generator(this, function (_b) {
|
|
625
|
-
switch (_b.label) {
|
|
626
|
-
case 0:
|
|
627
|
-
mutationVars = {
|
|
628
|
-
quoteId: quoteId,
|
|
629
|
-
invoiceId: invoiceId,
|
|
630
|
-
paymentMethodId: paymentMethodId,
|
|
631
|
-
};
|
|
632
|
-
if (paymentMethodData) {
|
|
633
|
-
mutationVars.paymentMethodData = __assign(__assign({}, paymentMethodData), { metadata: paymentMethodData.metadata });
|
|
634
|
-
}
|
|
635
|
-
return [4 /*yield*/, gqlRequest({
|
|
636
|
-
query: MUTATION$8,
|
|
637
|
-
token: token,
|
|
638
|
-
vars: mutationVars,
|
|
639
|
-
apiHost: apiHost,
|
|
640
|
-
})];
|
|
641
|
-
case 1:
|
|
642
|
-
response = _b.sent();
|
|
643
|
-
errors = (response === null || response === void 0 ? void 0 : response.checkout).errors;
|
|
644
|
-
if (errors)
|
|
645
|
-
throw errors;
|
|
646
|
-
return [2 /*return*/, {
|
|
647
|
-
savePaymentMethod: paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.savePaymentMethod,
|
|
648
|
-
}];
|
|
649
|
-
}
|
|
650
|
-
});
|
|
651
|
-
});
|
|
652
|
-
};
|
|
653
|
-
|
|
654
658
|
function usePay$1(_a) {
|
|
655
659
|
var _this = this;
|
|
656
660
|
var onPaymentSuccess = _a.onPaymentSuccess, onPaymentError = _a.onPaymentError, quote = _a.quote, invoice = _a.invoice, storedPaymentMethod = _a.storedPaymentMethod, plugin = _a.plugin;
|
|
@@ -18751,7 +18755,7 @@ var DemoPayForm = function (_a) {
|
|
|
18751
18755
|
cvc: '',
|
|
18752
18756
|
}), cardDetails = _d[0], setCardDetails = _d[1];
|
|
18753
18757
|
var onSave = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
18754
|
-
var error_1;
|
|
18758
|
+
var error_1, errorResponse;
|
|
18755
18759
|
return __generator(this, function (_a) {
|
|
18756
18760
|
switch (_a.label) {
|
|
18757
18761
|
case 0:
|
|
@@ -18767,7 +18771,12 @@ var DemoPayForm = function (_a) {
|
|
|
18767
18771
|
return [3 /*break*/, 3];
|
|
18768
18772
|
case 2:
|
|
18769
18773
|
error_1 = _a.sent();
|
|
18770
|
-
|
|
18774
|
+
errorResponse = {
|
|
18775
|
+
response: {
|
|
18776
|
+
message: error_1.message,
|
|
18777
|
+
},
|
|
18778
|
+
};
|
|
18779
|
+
onFail(errorResponse);
|
|
18771
18780
|
return [3 /*break*/, 3];
|
|
18772
18781
|
case 3: return [2 /*return*/];
|
|
18773
18782
|
}
|
|
@@ -18917,7 +18926,9 @@ var PaymentMethodForm = function (_a) {
|
|
|
18917
18926
|
}
|
|
18918
18927
|
});
|
|
18919
18928
|
}); };
|
|
18920
|
-
return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsx(reactStripeJs.PaymentElement, { options: {
|
|
18929
|
+
return (jsxRuntime.jsxs("form", { children: [jsxRuntime.jsx(reactStripeJs.PaymentElement, { options: {
|
|
18930
|
+
layout: { type: 'accordion' },
|
|
18931
|
+
} }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSubmit })] }));
|
|
18921
18932
|
};
|
|
18922
18933
|
|
|
18923
18934
|
// This is just a wrapper to fetch the stripe object and pass it to the form
|
|
@@ -19078,7 +19089,7 @@ function useSetDefaultPaymentMethod(paymentPlugins, apiHost, token, accountId, o
|
|
|
19078
19089
|
var showErrorNotification$1 = common.useErrorNotification();
|
|
19079
19090
|
var PaymentForm = function (_a) {
|
|
19080
19091
|
var _b;
|
|
19081
|
-
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19092
|
+
var invoice = _a.invoice, onFail = _a.onFail, onPaymentSuccess = _a.onPaymentSuccess, onPaymentHoldSuccess = _a.onPaymentHoldSuccess, quote = _a.quote, accountId = _a.accountId, onSavePaymentMethod = _a.onSavePaymentMethod, onRemovePaymentMethod = _a.onRemovePaymentMethod, onSetDefaultPaymentMethod = _a.onSetDefaultPaymentMethod, entityId = _a.entityId, overrideToken = _a.overrideToken, customCheckoutFunction = _a.customCheckoutFunction, currencyIdFromProps = _a.currencyId, paymentHoldOptions = _a.paymentHoldOptions;
|
|
19082
19093
|
// Local state
|
|
19083
19094
|
var _c = react.useState(false), showPaymentMethodForm = _c[0], setShowPaymentMethodForm = _c[1];
|
|
19084
19095
|
// Simple hooks
|
|
@@ -19092,8 +19103,9 @@ var PaymentForm = function (_a) {
|
|
|
19092
19103
|
apiHost: apiHost,
|
|
19093
19104
|
}), storedPaymentMethods = _d.paymentMethods, defaultPaymentMethod = _d.defaultPaymentMethod, isPaymentMethodLoading = _d.isLoading;
|
|
19094
19105
|
// Complex hooks
|
|
19095
|
-
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, token: token }).paymentPlugins;
|
|
19106
|
+
var paymentPlugins = usePaymentPlugins({ apiHost: apiHost, selectedEntityId: entityId, token: token }).paymentPlugins;
|
|
19096
19107
|
var selectedPaymentMethodPlugin = react.useMemo(function () {
|
|
19108
|
+
// TODO: consolate PluginData and PaymentPlugin into one type. Needs to be done on API side.
|
|
19097
19109
|
return paymentPlugins === null || paymentPlugins === void 0 ? void 0 : paymentPlugins.find(function (plugin) { var _a, _b, _c; return ((_a = plugin.id) === null || _a === void 0 ? void 0 : _a.toString()) === ((_c = (_b = defaultPaymentMethod === null || defaultPaymentMethod === void 0 ? void 0 : defaultPaymentMethod.plugin) === null || _b === void 0 ? void 0 : _b.id) === null || _c === void 0 ? void 0 : _c.toString()); });
|
|
19098
19110
|
}, [paymentPlugins, defaultPaymentMethod]);
|
|
19099
19111
|
// Derived state
|
|
@@ -19102,6 +19114,7 @@ var PaymentForm = function (_a) {
|
|
|
19102
19114
|
var currencyId = (_b = ((quote === null || quote === void 0 ? void 0 : quote.currencyId) ||
|
|
19103
19115
|
(invoice === null || invoice === void 0 ? void 0 : invoice.currencyId) ||
|
|
19104
19116
|
currencyIdFromProps)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
|
19117
|
+
var paymentRequired = quote ? getQuoteAmountDue(quote) > 0 : true;
|
|
19105
19118
|
// Custom hooks
|
|
19106
19119
|
var _e = useSetDefaultPaymentMethod(paymentPlugins || [], apiHost, token, accountId, function (message) {
|
|
19107
19120
|
showErrorNotification$1(message, 'Error setting default payment method');
|
|
@@ -19118,9 +19131,29 @@ var PaymentForm = function (_a) {
|
|
|
19118
19131
|
var _f = usePaymentMethodSelectorPlugin({
|
|
19119
19132
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19120
19133
|
defaultPaymentMethodPlugin: defaultPaymentMethodPlugin,
|
|
19121
|
-
paymentMethodAllowedPlugins: paymentPlugins,
|
|
19134
|
+
paymentMethodAllowedPlugins: paymentPlugins || [],
|
|
19122
19135
|
}), selectorPaymentMethodPlugin = _f.selectorPaymentMethodPlugin, setSelectorPaymentMethodPlugin = _f.setSelectorPaymentMethodPlugin;
|
|
19123
19136
|
var selectedPaymentPluginIsManualPayment = (selectorPaymentMethodPlugin === null || selectorPaymentMethodPlugin === void 0 ? void 0 : selectorPaymentMethodPlugin.name) === 'Manual Payment';
|
|
19137
|
+
// Mutations
|
|
19138
|
+
var _g = reactQuery.useMutation({
|
|
19139
|
+
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
19140
|
+
return __generator(this, function (_a) {
|
|
19141
|
+
switch (_a.label) {
|
|
19142
|
+
case 0:
|
|
19143
|
+
if (!quote)
|
|
19144
|
+
throw new Error('Quote is required');
|
|
19145
|
+
if (paymentRequired)
|
|
19146
|
+
throw new Error('Payment is required');
|
|
19147
|
+
return [4 /*yield*/, checkout({ quoteId: quote.id, token: token, apiHost: apiHost })];
|
|
19148
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
19149
|
+
}
|
|
19150
|
+
});
|
|
19151
|
+
}); },
|
|
19152
|
+
onSuccess: function () {
|
|
19153
|
+
handlePaymentSuccess();
|
|
19154
|
+
},
|
|
19155
|
+
onError: onFail,
|
|
19156
|
+
}), checkoutNoPayment = _g.mutate, isCheckingOutNoPayment = _g.isPending;
|
|
19124
19157
|
var onClickRemove = useRemovePaymentMethod(paymentPlugins || [], apiHost, token, accountId, onRemovePaymentMethod, function (message) {
|
|
19125
19158
|
showErrorNotification$1(message, 'Error removing payment method');
|
|
19126
19159
|
});
|
|
@@ -19157,14 +19190,14 @@ var PaymentForm = function (_a) {
|
|
|
19157
19190
|
storedPaymentMethods: storedPaymentMethods,
|
|
19158
19191
|
defaultPaymentMethod: defaultPaymentMethod,
|
|
19159
19192
|
customCheckoutFunction: customCheckoutFunction,
|
|
19160
|
-
} }, { children: jsxRuntime.jsx(StripeWrapper, __assign({ plugin: selectorPaymentMethodPlugin, token: token, apiHost: apiHost, currencyId: currencyId, accountId: accountId }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4" }, { children: [storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.map(function (paymentMethod) { return (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { return onClickRemove(paymentMethod); }, onClickSetDefault: function () { return handleSetDefault(paymentMethod); }, paymentMethodData: paymentMethod, id: "payment-method-".concat(paymentMethod.id) }, paymentMethod.id)); }), (storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) === 0 && (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { }, onClickSetDefault: function () { } }))] })), jsxRuntime.jsx(antd.Collapse, { bordered: false, activeKey: showPaymentMethodForm ? '1' : undefined, ghost: true, collapsible: "disabled",
|
|
19161
|
-
|
|
19162
|
-
|
|
19163
|
-
|
|
19164
|
-
|
|
19165
|
-
|
|
19166
|
-
|
|
19167
|
-
|
|
19193
|
+
} }, { children: jsxRuntime.jsx(StripeWrapper, __assign({ plugin: selectorPaymentMethodPlugin, token: token, apiHost: apiHost, currencyId: currencyId, accountId: accountId }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-0 bunny-w-full" }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-px-4" }, { children: [storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.map(function (paymentMethod) { return (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { return onClickRemove(paymentMethod); }, onClickSetDefault: function () { return handleSetDefault(paymentMethod); }, paymentMethodData: paymentMethod, id: "payment-method-".concat(paymentMethod.id) }, paymentMethod.id)); }), (storedPaymentMethods === null || storedPaymentMethods === void 0 ? void 0 : storedPaymentMethods.length) === 0 && (jsxRuntime.jsx(MiniCreditCard, { onClickRemove: function () { }, onClickSetDefault: function () { } }))] })), jsxRuntime.jsx(antd.Collapse, { bordered: false, activeKey: showPaymentMethodForm ? '1' : undefined, ghost: true, collapsible: "disabled", destroyInactivePanel: true, items: [
|
|
19194
|
+
{
|
|
19195
|
+
key: '1',
|
|
19196
|
+
showArrow: false,
|
|
19197
|
+
label: !showPaymentMethodForm ? (jsxRuntime.jsx("div", __assign({ className: "bunny-pt-2" }, { children: jsxRuntime.jsx(antd.Button, __assign({ onClick: handleClickAddPaymentMethod, type: "default", className: "bunny-w-full", id: "addPaymentMethod" }, { children: "Add payment method" })) }))) : null,
|
|
19198
|
+
children: (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 bunny-mt-2" }, { children: [jsxRuntime.jsx(PaymentMethodSelector, { onSelect: setSelectorPaymentMethodPlugin, paymentMethodAllowedPlugins: paymentPlugins || [], value: selectorPaymentMethodPlugin }), selectorPaymentMethodPlugin && (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: jsxRuntime.jsx(PaymentMethodDetails, { onFail: onFail, onSavePaymentMethod: handleSavePaymentMethod, plugin: selectorPaymentMethodPlugin }) })))] }))),
|
|
19199
|
+
},
|
|
19200
|
+
] }), paying && !selectedPaymentPluginIsManualPayment ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: defaultPaymentMethod ? (jsxRuntime.jsx("div", __assign({ className: "bunny-px-4" }, { children: jsxRuntime.jsx(CheckoutFooter, { quote: quote, invoice: invoice, onPaymentSuccess: handlePaymentSuccess, plugin: selectedPaymentMethodPlugin, onPaymentHoldSuccess: onPaymentHoldSuccess, paymentHoldOptions: paymentHoldOptions }) }))) : null })) : null] })) : (jsxRuntime.jsx(antd.Button, __assign({ style: { margin: '0 16px' }, loading: isCheckingOutNoPayment, onClick: function () { return checkoutNoPayment(); }, type: "primary" }, { children: isCheckingOutNoPayment ? 'Processing...' : 'Complete Order' }))) }) })) })) })));
|
|
19168
19201
|
};
|
|
19169
19202
|
function StripeWrapper(_a) {
|
|
19170
19203
|
var children = _a.children, plugin = _a.plugin, token = _a.token, apiHost = _a.apiHost, currencyId = _a.currencyId, accountId = _a.accountId;
|
|
@@ -19172,6 +19205,15 @@ function StripeWrapper(_a) {
|
|
|
19172
19205
|
return (jsxRuntime.jsx(reactStripeJs.Elements, __assign({ options: options, stripe: stripe }, { children: children })));
|
|
19173
19206
|
}
|
|
19174
19207
|
|
|
19208
|
+
var useCurrentUserData = function () {
|
|
19209
|
+
var queryClient = reactQuery.useQueryClient();
|
|
19210
|
+
var token = useToken();
|
|
19211
|
+
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
19212
|
+
if (!currentUser)
|
|
19213
|
+
return {};
|
|
19214
|
+
return currentUser;
|
|
19215
|
+
};
|
|
19216
|
+
|
|
19175
19217
|
function Invoice(_a) {
|
|
19176
19218
|
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;
|
|
19177
19219
|
return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
@@ -19191,9 +19233,10 @@ function ActualInvoice() {
|
|
|
19191
19233
|
// Context
|
|
19192
19234
|
var queryClient = reactQuery.useQueryClient();
|
|
19193
19235
|
var _a = react.useContext(InvoiceQuoteContext), id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onPaymentSuccess = _a.onPaymentSuccess, className = _a.className;
|
|
19194
|
-
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired;
|
|
19236
|
+
var _b = react.useContext(BunnyContext), apiHost = _b.apiHost, onTokenExpired = _b.onTokenExpired;
|
|
19195
19237
|
var _c = react.useContext(InvoiceQuoteContext), hideDownloadButton = _c.hideDownloadButton, onInvoiceLoaded = _c.onInvoiceLoaded;
|
|
19196
19238
|
var token = useToken();
|
|
19239
|
+
var entityId = useCurrentUserData().entityId;
|
|
19197
19240
|
// Hooks
|
|
19198
19241
|
var showSuccessNotification = common.useSuccessNotification();
|
|
19199
19242
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
@@ -19229,10 +19272,10 @@ function ActualInvoice() {
|
|
|
19229
19272
|
}, [formattedInvoice]);
|
|
19230
19273
|
if (!formattedInvoice)
|
|
19231
19274
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
19232
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsxRuntime.jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsxRuntime.jsx(PaymentForm, { onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19275
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-invoice-container" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-6 bunny-overflow-hidden ".concat(isMobile ? 'bunny-flex-col bunny-w-full' : '', " ").concat(className) }, { children: [formattedInvoice.isLegacy ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full" }, { children: jsxRuntime.jsx(LegacyDocument, { documentUuid: formattedInvoice.uuid, documentType: "invoice" }) }))) : (invoiceQuoteViewComponent || (jsxRuntime.jsx(InvoiceQuoteView, { html: formattedInvoice.html, formattedInvoice: formattedInvoice, backButtonName: backButtonName, onBackButtonClick: onBackButtonClick }))), isInvoicePayable && (jsxRuntime.jsx("div", __assign({ className: "bunny-w-full ".concat(hideDownloadButton || formattedInvoice.isLegacy ? '' : 'pt-12') }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onPaymentSuccess: onSuccess, onFail: onFail, invoice: formattedInvoice }) })))] })) })));
|
|
19233
19276
|
}
|
|
19234
19277
|
|
|
19235
|
-
var MUTATION$
|
|
19278
|
+
var MUTATION$8 = function (id) { return "\n query formattedQuote ($id: ID) {\n formattedQuote (id: $id) {\n quote {\n documentTemplateId\n documents { id filename size date url }\n firstInvoice {\n id\n state\n }\n payableId\n id\n payToAccept\n currentPaymentHold {\n createdAt\n expiresAt\n id\n updatedAt\n paymentMethod {\n accountId\n createdAt\n expirationDate\n failureCode\n id\n isDefault\n lastSuccess\n paymentType\n pluginId\n state\n updatedAt\n metadata {\n description\n expiration\n icon\n identifier\n issuer\n kind\n }\n }\n }\n }\n payableId\n acceptedAt\n acceptedByName\n amount\n amountDue\n amountsByPeriod {\n id\n name\n amount\n }\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 }"; };
|
|
19236
19279
|
var getFormattedQuote = function (_a) {
|
|
19237
19280
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
19238
19281
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -19240,7 +19283,7 @@ var getFormattedQuote = function (_a) {
|
|
|
19240
19283
|
return __generator(this, function (_b) {
|
|
19241
19284
|
switch (_b.label) {
|
|
19242
19285
|
case 0: return [4 /*yield*/, gqlRequest({
|
|
19243
|
-
query: MUTATION$
|
|
19286
|
+
query: MUTATION$8(),
|
|
19244
19287
|
token: token,
|
|
19245
19288
|
apiHost: apiHost,
|
|
19246
19289
|
vars: { id: id },
|
|
@@ -19278,9 +19321,9 @@ var usePlugins = function (_a) {
|
|
|
19278
19321
|
return response;
|
|
19279
19322
|
};
|
|
19280
19323
|
var getPlugins = function (_a) {
|
|
19281
|
-
var
|
|
19324
|
+
var token = _a.token, apiHost = _a.apiHost;
|
|
19282
19325
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
19283
|
-
var response, plugins,
|
|
19326
|
+
var response, plugins, error;
|
|
19284
19327
|
return __generator(this, function (_b) {
|
|
19285
19328
|
switch (_b.label) {
|
|
19286
19329
|
case 0: return [4 /*yield*/, common.request({
|
|
@@ -19294,12 +19337,7 @@ var getPlugins = function (_a) {
|
|
|
19294
19337
|
return [4 /*yield*/, response.json()];
|
|
19295
19338
|
case 2:
|
|
19296
19339
|
plugins = _b.sent();
|
|
19297
|
-
|
|
19298
|
-
var _a, _b;
|
|
19299
|
-
var result = ((_a = plugin.entities) === null || _a === void 0 ? void 0 : _a.includes(Number(entityId))) || ((_b = plugin.entities) === null || _b === void 0 ? void 0 : _b.length) === 0 || !entityId;
|
|
19300
|
-
return result;
|
|
19301
|
-
});
|
|
19302
|
-
return [2 /*return*/, filteredPlugins];
|
|
19340
|
+
return [2 /*return*/, plugins];
|
|
19303
19341
|
case 3: return [4 /*yield*/, response.json()];
|
|
19304
19342
|
case 4:
|
|
19305
19343
|
error = _b.sent();
|
|
@@ -19350,72 +19388,46 @@ var quoteAccept = function (_a) {
|
|
|
19350
19388
|
};
|
|
19351
19389
|
// export default quoteAccept;
|
|
19352
19390
|
var useSendAcceptQuote = function (_a) {
|
|
19353
|
-
|
|
19391
|
+
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
19354
19392
|
// Hooks
|
|
19355
19393
|
var graphQLMutation = common.useGraphQLmutation(function () {
|
|
19356
|
-
console.log(
|
|
19357
|
-
}, apiHost ||
|
|
19358
|
-
console.log(
|
|
19394
|
+
console.log('navigate in useGraphQLmutation in useSendAcceptQuote is not yet implemented');
|
|
19395
|
+
}, apiHost || '', function () {
|
|
19396
|
+
console.log('onError in useGraphQLmutation in useSendAcceptQuote is not yet implemented');
|
|
19359
19397
|
});
|
|
19360
19398
|
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19361
19399
|
var queryClient = reactQuery.useQueryClient();
|
|
19400
|
+
var showInfoNotification = common.useInfoNotification();
|
|
19362
19401
|
// Local state
|
|
19363
19402
|
var _b = react.useState(false), acceptBoxVisible = _b[0], setAcceptBoxVisible = _b[1];
|
|
19364
19403
|
var _c = react.useState(false), isAccepting = _c[0], setIsAccepting = _c[1];
|
|
19365
19404
|
// Pandadoc polling modal state
|
|
19366
19405
|
var _d = react.useState(false), pandadocPollingModalVisible = _d[0], setPandadocPollingModalVisible = _d[1];
|
|
19367
19406
|
var redirectForSigning = function () {
|
|
19368
|
-
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n errors\n }\n }";
|
|
19407
|
+
var mutation = "mutation quoteSigningUrlCreate($quoteId: ID) {\n quoteSigningUrlCreate(quoteId: $quoteId) {\n redirectUri\n pluginClientId\n pluginShortName\n message\n errors\n }\n }";
|
|
19369
19408
|
var variables = {
|
|
19370
19409
|
quoteId: quoteId,
|
|
19371
19410
|
};
|
|
19372
19411
|
graphQLMutation(mutation, variables, function (rsp) {
|
|
19373
19412
|
if (rsp.errors)
|
|
19374
|
-
console.log(
|
|
19413
|
+
console.log('rsp.errors', rsp.errors);
|
|
19375
19414
|
else {
|
|
19376
|
-
|
|
19377
|
-
|
|
19415
|
+
var _a = rsp.data.quoteSigningUrlCreate, redirectUri = _a.redirectUri, message = _a.message, pluginShortName = _a.pluginShortName;
|
|
19416
|
+
if (redirectUri) {
|
|
19417
|
+
// If redirectUri exists, redirect the browser
|
|
19418
|
+
window.location.href = redirectUri;
|
|
19378
19419
|
}
|
|
19379
|
-
else if (
|
|
19420
|
+
else if (pluginShortName === 'pandadoc') {
|
|
19380
19421
|
setPandadocPollingModalVisible(true);
|
|
19381
19422
|
}
|
|
19382
|
-
else {
|
|
19383
|
-
|
|
19423
|
+
else if (message) {
|
|
19424
|
+
// If redirectUri is nil but message exists, display the message as notification
|
|
19425
|
+
showInfoNotification(message, 'Signing Information');
|
|
19426
|
+
setIsAccepting(false);
|
|
19384
19427
|
}
|
|
19385
19428
|
}
|
|
19386
19429
|
}, token);
|
|
19387
19430
|
};
|
|
19388
|
-
var openDropboxSignModal = function (clientId, url) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19389
|
-
var HelloSign, client;
|
|
19390
|
-
return __generator(this, function (_a) {
|
|
19391
|
-
switch (_a.label) {
|
|
19392
|
-
case 0:
|
|
19393
|
-
if (typeof window === "undefined") {
|
|
19394
|
-
return [2 /*return*/];
|
|
19395
|
-
}
|
|
19396
|
-
return [4 /*yield*/, Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('hellosign-embedded')); })];
|
|
19397
|
-
case 1:
|
|
19398
|
-
HelloSign = (_a.sent()).default;
|
|
19399
|
-
client = new HelloSign({
|
|
19400
|
-
clientId: clientId,
|
|
19401
|
-
});
|
|
19402
|
-
client.on("sign", function (data) {
|
|
19403
|
-
queryClient.refetchQueries({
|
|
19404
|
-
queryKey: common.QueryKeyFactory.default.createQuoteKey({
|
|
19405
|
-
id: quoteId,
|
|
19406
|
-
token: token,
|
|
19407
|
-
}),
|
|
19408
|
-
});
|
|
19409
|
-
});
|
|
19410
|
-
// Open the DropboxSign modal
|
|
19411
|
-
client.open(url, {
|
|
19412
|
-
clientId: clientId,
|
|
19413
|
-
skipDomainVerification: false, // Set true for development testing
|
|
19414
|
-
});
|
|
19415
|
-
return [2 /*return*/];
|
|
19416
|
-
}
|
|
19417
|
-
});
|
|
19418
|
-
}); };
|
|
19419
19431
|
var _e = reactQuery.useMutation({
|
|
19420
19432
|
mutationFn: function (changedFormItems) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19421
19433
|
return __generator(this, function (_a) {
|
|
@@ -19541,6 +19553,9 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19541
19553
|
var acceptBoxVisible = _a.acceptBoxVisible, formattedQuote = _a.formattedQuote, sendAccept = _a.sendAccept, setAcceptBoxVisible = _a.setAcceptBoxVisible, setIsAccepting = _a.setIsAccepting, isSendAcceptPending = _a.isSendAcceptPending;
|
|
19542
19554
|
// Refs
|
|
19543
19555
|
var firstInputRef = react.useRef(null);
|
|
19556
|
+
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
19557
|
+
var token = useToken();
|
|
19558
|
+
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19544
19559
|
// Hooks
|
|
19545
19560
|
var form = antd.Form.useForm()[0];
|
|
19546
19561
|
useFocusFirstInput({ firstInputRef: firstInputRef, isVisible: acceptBoxVisible });
|
|
@@ -19549,7 +19564,7 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19549
19564
|
var createRules = function (required, title) {
|
|
19550
19565
|
return required ? [{ required: true, message: "".concat(title, " is required") }] : [];
|
|
19551
19566
|
};
|
|
19552
|
-
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ?
|
|
19567
|
+
return (jsxRuntime.jsx(StyledModal$1, __assign({ centered: true, okText: isSendAcceptPending ? 'Accepting...' : 'Accept', okButtonProps: {
|
|
19553
19568
|
loading: isSendAcceptPending,
|
|
19554
19569
|
disabled: isSendAcceptPending,
|
|
19555
19570
|
}, onCancel: function () {
|
|
@@ -19562,7 +19577,7 @@ var AcceptQuoteModal = function (_a) {
|
|
|
19562
19577
|
sendAccept(changedFields);
|
|
19563
19578
|
})
|
|
19564
19579
|
.catch(function () { });
|
|
19565
|
-
}, open: acceptBoxVisible, title:
|
|
19580
|
+
}, open: acceptBoxVisible, title: (signingPlugins === null || signingPlugins === void 0 ? void 0 : signingPlugins.length) ? 'Start signing' : 'Accept quote', width: 400 }, { children: jsxRuntime.jsxs(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", form: form, layout: "vertical" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your name", name: "name", rules: createRules(true, 'Your name') }, { children: jsxRuntime.jsx(antd.Input, { autoFocus: true, ref: firstInputRef }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Your job title", name: "title", rules: createRules(true, 'Your job title') }, { children: jsxRuntime.jsx(antd.Input, {}) })), jsxRuntime.jsx(antd.Form.Item, __assign({ label: "Purchase order number", name: "poNumber", rules: createRules(poNumberRequired, 'Purchase order number') }, { children: jsxRuntime.jsx(antd.Input, {}) })), taxNumberRequired && (jsxRuntime.jsx(antd.Form.Item, __assign({ name: "taxNumber", label: taxNumberLabel, rules: createRules(taxNumberRequired, taxNumberLabel) }, { children: jsxRuntime.jsx(antd.Input, {}) })))] })) })));
|
|
19566
19581
|
};
|
|
19567
19582
|
|
|
19568
19583
|
var Title$2 = antd.Typography.Title;
|
|
@@ -19571,9 +19586,10 @@ var PaymentHoldModal = function (_a) {
|
|
|
19571
19586
|
var visible = _a.visible, setVisible = _a.setVisible, quote = _a.quote;
|
|
19572
19587
|
var queryClient = reactQuery.useQueryClient();
|
|
19573
19588
|
var token = useToken();
|
|
19589
|
+
var entityId = useCurrentUserData().entityId;
|
|
19574
19590
|
return (jsxRuntime.jsxs(StyledModal$1, __assign({ centered: true, onCancel: function () {
|
|
19575
19591
|
setVisible(false);
|
|
19576
|
-
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, { quote: {
|
|
19592
|
+
}, footer: null, open: visible, width: 600 }, { children: [jsxRuntime.jsx(Title$2, __assign({ className: "mt-4 pb-4 mx-4", level: 5 }, { children: "Pay to accept" })), jsxRuntime.jsx("div", __assign({ className: "mb-4" }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, quote: {
|
|
19577
19593
|
amount: quote.amount,
|
|
19578
19594
|
currencyId: quote.currency,
|
|
19579
19595
|
id: quote.quote.id,
|
|
@@ -19629,11 +19645,11 @@ function ActualQuote() {
|
|
|
19629
19645
|
var _this = this;
|
|
19630
19646
|
var _a, _b, _c, _d;
|
|
19631
19647
|
// Context
|
|
19632
|
-
var
|
|
19648
|
+
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
19633
19649
|
var token = useToken();
|
|
19634
|
-
var
|
|
19650
|
+
var _e = react.useContext(InvoiceQuoteContext), className = _e.className, id = _e.id, hideDownloadButton = _e.hideDownloadButton, onQuoteLoaded = _e.onQuoteLoaded;
|
|
19635
19651
|
// Queries
|
|
19636
|
-
var
|
|
19652
|
+
var _f = reactQuery.useQuery({
|
|
19637
19653
|
queryKey: common.QueryKeyFactory.default.createQuoteKey({ id: id, token: token }),
|
|
19638
19654
|
queryFn: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
19639
19655
|
var error_1;
|
|
@@ -19652,15 +19668,14 @@ function ActualQuote() {
|
|
|
19652
19668
|
});
|
|
19653
19669
|
}); },
|
|
19654
19670
|
placeholderData: reactQuery.keepPreviousData,
|
|
19655
|
-
}), data =
|
|
19671
|
+
}), data = _f.data, isLoading = _f.isLoading;
|
|
19656
19672
|
var formattedQuote = data;
|
|
19657
19673
|
// Hooks
|
|
19658
|
-
var
|
|
19674
|
+
var _g = useSendAcceptQuote({
|
|
19659
19675
|
token: token,
|
|
19660
|
-
onTokenExpired: onTokenExpired,
|
|
19661
19676
|
apiHost: apiHost,
|
|
19662
19677
|
quoteId: id,
|
|
19663
|
-
}), acceptBoxVisible =
|
|
19678
|
+
}), acceptBoxVisible = _g.acceptBoxVisible, isAccepting = _g.isAccepting, sendAccept = _g.sendAccept, setAcceptBoxVisible = _g.setAcceptBoxVisible, setIsAccepting = _g.setIsAccepting, startAcceptance = _g.startAcceptance, pandadocPollingModalVisible = _g.pandadocPollingModalVisible, setPandadocPollingModalVisible = _g.setPandadocPollingModalVisible, isSendAcceptPending = _g.isSendAcceptPending;
|
|
19664
19679
|
useSigningComplete({ data: formattedQuote, token: token });
|
|
19665
19680
|
var isMobile = common.useIsMobile();
|
|
19666
19681
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -19670,7 +19685,7 @@ function ActualQuote() {
|
|
|
19670
19685
|
}
|
|
19671
19686
|
}, [formattedQuote]);
|
|
19672
19687
|
// Payment hold stuff here
|
|
19673
|
-
var
|
|
19688
|
+
var _h = useQuotePaymentHold(formattedQuote), paymentHoldModalVisible = _h.paymentHoldModalVisible, setPaymentHoldModalVisible = _h.setPaymentHoldModalVisible, shouldDoPaymentHold = _h.shouldDoPaymentHold, paymentHoldCompleted = _h.paymentHoldCompleted, paymentHold = _h.paymentHold;
|
|
19674
19689
|
var handleClickAccept = function () {
|
|
19675
19690
|
if (shouldDoPaymentHold && !paymentHoldCompleted) {
|
|
19676
19691
|
setPaymentHoldModalVisible(true);
|
|
@@ -19688,7 +19703,7 @@ function ActualQuote() {
|
|
|
19688
19703
|
if ((firstInvoice === null || firstInvoice === void 0 ? void 0 : firstInvoice.state) === 'PAID' && paymentHoldCompleted) {
|
|
19689
19704
|
return jsxRuntime.jsx(Invoice, { id: firstInvoice.id });
|
|
19690
19705
|
}
|
|
19691
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 ".concat(isMobile ? 'bunny-w-full bunny-overflow-hidden' : '', " ").concat(className) }, { children: [jsxRuntime.jsx(QuoteButtons, { isAccepted: isAccepted, formattedQuote: formattedQuote, isMobile: isMobile, hideDownloadButton: hideDownloadButton, id: id, isAccepting: isAccepting, handleClickAccept: handleClickAccept, setPaymentHoldModalVisible: setPaymentHoldModalVisible, shouldDoPaymentHold: shouldDoPaymentHold, paymentHoldCompleted: paymentHoldCompleted, paymentHold: paymentHold }), jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, targetUrl: ((_b = formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.quote) === null || _b === void 0 ? void 0 : _b.documentTemplateId)
|
|
19706
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-4 bunny-grow ".concat(isMobile ? 'bunny-w-full bunny-overflow-hidden' : '', " ").concat(className) }, { children: [jsxRuntime.jsx(QuoteButtons, { isAccepted: isAccepted, formattedQuote: formattedQuote, isMobile: isMobile, hideDownloadButton: hideDownloadButton, id: id, isAccepting: isAccepting, handleClickAccept: handleClickAccept, setPaymentHoldModalVisible: setPaymentHoldModalVisible, shouldDoPaymentHold: shouldDoPaymentHold, paymentHoldCompleted: paymentHoldCompleted, paymentHold: paymentHold }), jsxRuntime.jsx(InvoiceQuoteView, __assign({ html: formattedQuote.html, targetUrl: ((_b = formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.quote) === null || _b === void 0 ? void 0 : _b.documentTemplateId)
|
|
19692
19707
|
? "".concat(apiHost, "/api/pdf/quote/").concat(formattedQuote.quote.id)
|
|
19693
19708
|
: undefined }, { children: ((_d = (_c = formattedQuote.quote) === null || _c === void 0 ? void 0 : _c.documents) === null || _d === void 0 ? void 0 : _d.length) > 0 ? (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-end" }, { children: formattedQuote.quote.documents.map(function (doc, index) {
|
|
19694
19709
|
return (jsxRuntime.jsx(antd.Button, __assign({ download: doc.filename, href: doc.url, type: "link" }, { children: doc.filename }), index));
|
|
@@ -19702,9 +19717,14 @@ function QuoteButtons(_a) {
|
|
|
19702
19717
|
var entityBranding = react.useContext(BrandContext);
|
|
19703
19718
|
var downloadFile = useDownloadFile(id);
|
|
19704
19719
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
19720
|
+
var signingPlugins = useSigningPlugins({ apiHost: apiHost, token: token });
|
|
19705
19721
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
19706
19722
|
color: entityBranding.secondaryColor,
|
|
19707
|
-
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$n, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2' }, { children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () { return downloadFile(apiHost + '/api/pdf/quote', token); } }, { children: "Download" }))) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired, onClick: function () { return setPaymentHoldModalVisible(true); }, type: "primary" }, { children: "Pay to accept" }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary" }, { children: isExpired
|
|
19723
|
+
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$n, { children: "Quote was accepted by ".concat(formattedQuote.acceptedByName, " on ").concat(common.formatDate(formattedQuote.acceptedAt)) })) : null, (!isMobile || !isAccepted) && (jsxRuntime.jsxs("div", __assign({ className: isMobile ? 'flex w-full justify-end gap-2' : 'flex items-center justify-end gap-2' }, { children: [paymentHold ? (jsxRuntime.jsx(PaymentHoldDisplay, { paymentHold: paymentHold, currency: formattedQuote.currency, amount: formattedQuote.amount })) : null, !isMobile && !hideDownloadButton ? (jsxRuntime.jsx(antd.Button, __assign({ icon: jsxRuntime.jsx(icons.DownloadOutlined, {}), onClick: function () { return downloadFile(apiHost + '/api/pdf/quote', token); } }, { children: "Download" }))) : null, shouldDoPaymentHold && !paymentHoldCompleted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired, onClick: function () { return setPaymentHoldModalVisible(true); }, type: "primary" }, { children: "Pay to accept" }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !isAccepted ? (jsxRuntime.jsx(antd.Button, __assign({ disabled: isExpired || isAccepting, onClick: handleClickAccept, type: "primary" }, { children: isExpired
|
|
19724
|
+
? 'Quote is expired'
|
|
19725
|
+
: (signingPlugins === null || signingPlugins === void 0 ? void 0 : signingPlugins.length)
|
|
19726
|
+
? 'Start signing'
|
|
19727
|
+
: 'Accept quote' }))) : null }))] })))] })));
|
|
19708
19728
|
}
|
|
19709
19729
|
function PaymentHoldDisplay(_a) {
|
|
19710
19730
|
var _b, _c, _d, _e;
|
|
@@ -20169,9 +20189,9 @@ function QuotesWrapper() {
|
|
|
20169
20189
|
return (jsxRuntime.jsx(TransactionsDisplay, { transactions: quotesAsTransactions, onSearchValueChanged: setSearch, search: search }));
|
|
20170
20190
|
}
|
|
20171
20191
|
|
|
20172
|
-
var MUTATION$
|
|
20192
|
+
var MUTATION$7 = 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 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}"; };
|
|
20173
20193
|
var accountSignup = function (_a) {
|
|
20174
|
-
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
|
|
20194
|
+
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;
|
|
20175
20195
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20176
20196
|
var vars, response, errors;
|
|
20177
20197
|
var _b;
|
|
@@ -20185,10 +20205,9 @@ var accountSignup = function (_a) {
|
|
|
20185
20205
|
pluginId: pluginId,
|
|
20186
20206
|
paymentMethodId: paymentMethodId,
|
|
20187
20207
|
priceListCode: priceListCode,
|
|
20188
|
-
entityId: entityId,
|
|
20189
20208
|
};
|
|
20190
20209
|
return [4 /*yield*/, gqlRequest({
|
|
20191
|
-
query: MUTATION$
|
|
20210
|
+
query: MUTATION$7(),
|
|
20192
20211
|
token: token,
|
|
20193
20212
|
vars: vars,
|
|
20194
20213
|
apiHost: apiHost,
|
|
@@ -20204,9 +20223,9 @@ var accountSignup = function (_a) {
|
|
|
20204
20223
|
});
|
|
20205
20224
|
};
|
|
20206
20225
|
|
|
20207
|
-
var MUTATION$
|
|
20226
|
+
var MUTATION$6 = function () { return "\nmutation QuoteAccountSignup (\n $accountName: String!,\n $billingContact: ContactAttributes!,\n $priceListCode: String!,\n $billingDetails: BillingDetailsAttributes\n) {\n quoteAccountSignup(\n priceListCode: $priceListCode,\n accountName: $accountName,\n billingContact: $billingContact,\n billingDetails: $billingDetails\n ) {\n account {\n id\n }\n quote {\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}"; };
|
|
20208
20227
|
var quoteAccountSignup = function (_a) {
|
|
20209
|
-
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact,
|
|
20228
|
+
var token = _a.token, apiHost = _a.apiHost, priceListCode = _a.priceListCode, accountName = _a.accountName, billingContact = _a.billingContact, billingDetails = _a.billingDetails;
|
|
20210
20229
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20211
20230
|
var vars, response, errors;
|
|
20212
20231
|
var _b;
|
|
@@ -20217,10 +20236,10 @@ var quoteAccountSignup = function (_a) {
|
|
|
20217
20236
|
priceListCode: priceListCode,
|
|
20218
20237
|
accountName: accountName,
|
|
20219
20238
|
billingContact: billingContact,
|
|
20220
|
-
|
|
20239
|
+
billingDetails: billingDetails,
|
|
20221
20240
|
};
|
|
20222
20241
|
return [4 /*yield*/, gqlRequest({
|
|
20223
|
-
query: MUTATION$
|
|
20242
|
+
query: MUTATION$6(),
|
|
20224
20243
|
token: token,
|
|
20225
20244
|
vars: vars,
|
|
20226
20245
|
apiHost: apiHost,
|
|
@@ -20236,18 +20255,18 @@ var quoteAccountSignup = function (_a) {
|
|
|
20236
20255
|
});
|
|
20237
20256
|
};
|
|
20238
20257
|
|
|
20239
|
-
var MUTATION$
|
|
20240
|
-
var
|
|
20241
|
-
var
|
|
20258
|
+
var MUTATION$5 = "mutation quoteChangeAddCoupon($couponCode: String!, $quoteChangeId: ID!) {\n quoteChangeAddCoupon(couponCode: $couponCode, quoteChangeId: $quoteChangeId) {\n quoteChange {\n id\n charges {\n id\n amount\n couponId\n }\n }\n }\n}";
|
|
20259
|
+
var quoteChangeAddCoupon = function (_a) {
|
|
20260
|
+
var quoteChangeId = _a.quoteChangeId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20242
20261
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
20243
20262
|
var vars, response, errors;
|
|
20244
20263
|
var _b;
|
|
20245
20264
|
return __generator(this, function (_c) {
|
|
20246
20265
|
switch (_c.label) {
|
|
20247
20266
|
case 0:
|
|
20248
|
-
vars = {
|
|
20249
|
-
return [4 /*yield*/, gqlRequest({
|
|
20250
|
-
query: MUTATION$
|
|
20267
|
+
vars = { couponCode: couponCode, quoteChangeId: quoteChangeId };
|
|
20268
|
+
return [4 /*yield*/, common.gqlRequest({
|
|
20269
|
+
query: MUTATION$5,
|
|
20251
20270
|
token: token,
|
|
20252
20271
|
vars: vars,
|
|
20253
20272
|
apiHost: apiHost,
|
|
@@ -20263,6 +20282,60 @@ var quoteAddCoupon = function (_a) {
|
|
|
20263
20282
|
});
|
|
20264
20283
|
};
|
|
20265
20284
|
|
|
20285
|
+
var MUTATION$4 = "mutation quoteChangeRemoveCoupon($quoteChangeId: ID!, $couponCode: String!) {\n quoteChangeRemoveCoupon(quoteChangeId: $quoteChangeId, couponCode: $couponCode) {\n errors\n }\n}\n";
|
|
20286
|
+
var quoteChangeRemoveCoupon = function (_a) {
|
|
20287
|
+
var quoteChangeId = _a.quoteChangeId, couponCode = _a.couponCode, token = _a.token, apiHost = _a.apiHost;
|
|
20288
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20289
|
+
var vars, response, errors;
|
|
20290
|
+
var _b;
|
|
20291
|
+
return __generator(this, function (_c) {
|
|
20292
|
+
switch (_c.label) {
|
|
20293
|
+
case 0:
|
|
20294
|
+
vars = { couponCode: couponCode, quoteChangeId: quoteChangeId };
|
|
20295
|
+
return [4 /*yield*/, common.gqlRequest({
|
|
20296
|
+
query: MUTATION$4,
|
|
20297
|
+
token: token,
|
|
20298
|
+
vars: vars,
|
|
20299
|
+
apiHost: apiHost,
|
|
20300
|
+
})];
|
|
20301
|
+
case 1:
|
|
20302
|
+
response = _c.sent();
|
|
20303
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteChangeRemoveCoupon) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20304
|
+
if (errors)
|
|
20305
|
+
throw errors;
|
|
20306
|
+
return [2 /*return*/, response.quote];
|
|
20307
|
+
}
|
|
20308
|
+
});
|
|
20309
|
+
});
|
|
20310
|
+
};
|
|
20311
|
+
|
|
20312
|
+
var QUOTE_RECALCULATE_TAXES = "\n mutation QuoteRecalculateTaxes($id: ID!) {\n quoteRecalculateTaxes(id: $id) {\n quote {\n accountId\n amount\n amountDue\n smallUnitAmountDue\n currencyId\n formattedQuote {\n html\n }\n id\n payableId\n periodAmount\n subtotal\n taxAmount\n amountsByPeriod {\n amount\n startDate\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n subtotal\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n currencyId\n feature {\n unitName\n }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n coupon {\n couponCode\n }\n quantity\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n }\n }\n errors\n }\n }\n";
|
|
20313
|
+
var quoteRecalculateTaxes = function (_a) {
|
|
20314
|
+
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
20315
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
20316
|
+
var vars, response, errors;
|
|
20317
|
+
var _b, _c;
|
|
20318
|
+
return __generator(this, function (_d) {
|
|
20319
|
+
switch (_d.label) {
|
|
20320
|
+
case 0:
|
|
20321
|
+
vars = { id: quoteId };
|
|
20322
|
+
return [4 /*yield*/, common.gqlRequest({
|
|
20323
|
+
query: QUOTE_RECALCULATE_TAXES,
|
|
20324
|
+
token: token,
|
|
20325
|
+
vars: vars,
|
|
20326
|
+
apiHost: apiHost,
|
|
20327
|
+
})];
|
|
20328
|
+
case 1:
|
|
20329
|
+
response = _d.sent();
|
|
20330
|
+
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20331
|
+
if (errors)
|
|
20332
|
+
throw errors;
|
|
20333
|
+
return [2 /*return*/, (_c = response.quoteRecalculateTaxes) === null || _c === void 0 ? void 0 : _c.quote];
|
|
20334
|
+
}
|
|
20335
|
+
});
|
|
20336
|
+
});
|
|
20337
|
+
};
|
|
20338
|
+
|
|
20266
20339
|
var MUTATION$3 = function () { return "\nquery PriceList($code: String!) {\n priceList (code: $code) {\n basePrice\n code\n createdAt\n currencyId\n id\n isVisible\n name\n periodMonths\n planId\n priceDescription\n productId\n product {\n name\n }\n sku\n trialAllowed\n trialLengthDays\n updatedAt\n }\n}"; };
|
|
20267
20340
|
var getPriceList = function (_a) {
|
|
20268
20341
|
var token = _a.token, code = _a.code, apiHost = _a.apiHost;
|
|
@@ -20284,7 +20357,7 @@ var getPriceList = function (_a) {
|
|
|
20284
20357
|
});
|
|
20285
20358
|
};
|
|
20286
20359
|
|
|
20287
|
-
var QUOTE_QUERY = function (id) { return "\n query quote {\n quote ".concat(id ? "(id: ".concat(id, ")") : '', " {\n accountId\n amount\n amountDue\n smallUnitAmountDue\n currencyId\n formattedQuote {\n html\n }\n id\n payableId\n periodAmount\n subtotal\n taxAmount\n amountsByPeriod {\n amount\n startDate\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n currencyId\n feature {\n unitName\n }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n
|
|
20360
|
+
var QUOTE_QUERY = function (id) { return "\n query quote {\n quote ".concat(id ? "(id: ".concat(id, ")") : '', " {\n accountId\n amount\n amountDue\n smallUnitAmountDue\n currencyId\n formattedQuote {\n html\n }\n id\n payableId\n periodAmount\n subtotal\n taxAmount\n amountsByPeriod {\n amount\n startDate\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n subtotal\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n currencyId\n feature {\n unitName\n }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n coupon {\n couponCode\n }\n quantity\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n\n }\n }\n }"); };
|
|
20288
20361
|
var getQuote = function (_a) {
|
|
20289
20362
|
var id = _a.id, token = _a.token, apiHost = _a.apiHost;
|
|
20290
20363
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -20305,15 +20378,6 @@ var getQuote = function (_a) {
|
|
|
20305
20378
|
});
|
|
20306
20379
|
};
|
|
20307
20380
|
|
|
20308
|
-
var useCurrentUserData = function () {
|
|
20309
|
-
var queryClient = reactQuery.useQueryClient();
|
|
20310
|
-
var token = useToken();
|
|
20311
|
-
var currentUser = queryClient.getQueryData(common.QueryKeyFactory.default.currentUserKey(token));
|
|
20312
|
-
if (!currentUser)
|
|
20313
|
-
return {};
|
|
20314
|
-
return currentUser;
|
|
20315
|
-
};
|
|
20316
|
-
|
|
20317
20381
|
var BunnyFooterIcon = function (_a) {
|
|
20318
20382
|
var color = _a.color;
|
|
20319
20383
|
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" }) })) })] })));
|
|
@@ -20324,7 +20388,7 @@ var Footer = function (_a) {
|
|
|
20324
20388
|
var className = _a.className;
|
|
20325
20389
|
var _b = useCurrentUserData(), privacyUrl = _b.privacyUrl, termsUrl = _b.termsUrl;
|
|
20326
20390
|
var isMobile = common.useIsMobile();
|
|
20327
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-between bunny-shrink-0 ".concat(isMobile ? 'bunny-flex-col bunny-gap-2
|
|
20391
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-between bunny-shrink-0 ".concat(isMobile ? 'bunny-flex-col bunny-gap-2' : '', " ").concat(className) }, { children: [(termsUrl || privacyUrl) && (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-3" }, { children: [termsUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "bunny-text-xs bunny-text-slate-400", href: termsUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Terms" }))), privacyUrl && (jsxRuntime.jsx(StyedLink, __assign({ className: "bunny-text-xs bunny-text-slate-400", href: privacyUrl, rel: "noopener noreferrer", target: "_blank", type: "text" }, { children: "Privacy" })))] }))), jsxRuntime.jsx(BunnyMarketingLink, {})] })));
|
|
20328
20392
|
};
|
|
20329
20393
|
var BunnyMarketingLink = function () {
|
|
20330
20394
|
var _a = react.useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
@@ -20335,42 +20399,89 @@ var StyedLink = styled__default["default"].a(templateObject_1$6 || (templateObje
|
|
|
20335
20399
|
var StyledBunnyLink = styled__default["default"](StyedLink)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n &:hover {\n color: ", " !important;\n }\n"], ["\n &:hover {\n color: ", " !important;\n }\n"])), common.PRIMARY_COLOR);
|
|
20336
20400
|
var templateObject_1$6, templateObject_2$1;
|
|
20337
20401
|
|
|
20402
|
+
function CouponEditor(_a) {
|
|
20403
|
+
var className = _a.className, onAddCoupon = _a.onAddCoupon, isAddingCoupon = _a.isAddingCoupon;
|
|
20404
|
+
// Local state
|
|
20405
|
+
var _b = react.useState(''), couponCode = _b[0], setCouponCode = _b[1];
|
|
20406
|
+
function handleAddCoupon() {
|
|
20407
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
20408
|
+
return __generator(this, function (_a) {
|
|
20409
|
+
onAddCoupon(couponCode);
|
|
20410
|
+
setCouponCode('');
|
|
20411
|
+
return [2 /*return*/];
|
|
20412
|
+
});
|
|
20413
|
+
});
|
|
20414
|
+
}
|
|
20415
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2 ".concat(className) }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-2" }, { children: [jsxRuntime.jsx(antd.Input, { value: couponCode, onChange: function (e) { return setCouponCode(e.target.value); }, placeholder: "Coupon code", disabled: isAddingCoupon }), jsxRuntime.jsx(antd.Button, __assign({ loading: isAddingCoupon, type: "primary", onClick: handleAddCoupon }, { children: "Apply" }))] })) })));
|
|
20416
|
+
}
|
|
20417
|
+
|
|
20418
|
+
var Text$f = antd.Typography.Text;
|
|
20419
|
+
function CheckoutSummary(_a) {
|
|
20420
|
+
var quote = _a.quote, className = _a.className, onAddCoupon = _a.onAddCoupon, onRemoveCoupon = _a.onRemoveCoupon, isRemovingCoupon = _a.isRemovingCoupon, priceListData = _a.priceListData, isAddingCoupon = _a.isAddingCoupon;
|
|
20421
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className, " bunny-space-y-4") }, { children: [jsxRuntime.jsxs(Text$f, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-text-lg bunny-font-medium bunny-mb-4" }, { children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] })), jsxRuntime.jsx("div", __assign({ className: "bunny-space-y-4" }, { children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(function (quoteChange) {
|
|
20422
|
+
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20423
|
+
var _a;
|
|
20424
|
+
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20425
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-grid bunny-grid-cols-3 bunny-gap-4 bunny-items-center" }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1" }, { children: charge.name })), jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1 bunny-text-center" }, { children: ((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode) ? (jsxRuntime.jsx("div", __assign({ onClick: function () {
|
|
20426
|
+
var _a, _b;
|
|
20427
|
+
if (isRemovingCoupon) {
|
|
20428
|
+
return;
|
|
20429
|
+
}
|
|
20430
|
+
if (!((_a = charge.coupon) === null || _a === void 0 ? void 0 : _a.couponCode)) {
|
|
20431
|
+
throw new Error('Coupon code not found');
|
|
20432
|
+
}
|
|
20433
|
+
onRemoveCoupon((_b = charge.coupon) === null || _b === void 0 ? void 0 : _b.couponCode);
|
|
20434
|
+
}, className: "bunny-text-orange-500 hover:bunny-text-orange-400 bunny-cursor-pointer" }, { children: "Remove" }))) : (jsxRuntime.jsx("div", { children: charge.quantity })) })), jsxRuntime.jsx("div", __assign({ className: "bunny-col-span-1 bunny-text-right" }, { children: common.formatCurrency(multiplier * (charge.subtotal || 0), charge.currencyId) }))] }), charge.id));
|
|
20435
|
+
});
|
|
20436
|
+
}) })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-space-y-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.subtotal, quote.currencyId) })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] }))] })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] }))] }), jsxRuntime.jsx(CouponEditor, { className: "bunny-w-full", quote: quote, onAddCoupon: onAddCoupon, isAddingCoupon: isAddingCoupon })] })));
|
|
20437
|
+
}
|
|
20438
|
+
var CheckoutSummaryDivider = function () {
|
|
20439
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20440
|
+
};
|
|
20441
|
+
|
|
20338
20442
|
var Title$1 = antd.Typography.Title;
|
|
20339
20443
|
function PaymentForms(_a) {
|
|
20340
20444
|
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;
|
|
20341
|
-
|
|
20445
|
+
var entityId = useCurrentUserData().entityId;
|
|
20446
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: quote ? (jsxRuntime.jsx(jsxRuntime.Fragment, { children: overrideToken ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Payment" })), jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: handlePaymentFail, onPaymentSuccess: handlePaymentSuccess, accountId: accountId, quote: quote, overrideToken: overrideToken, customCheckoutFunction: customCheckoutFunction })] })) : null })) : (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Title$1, __assign({ className: "bunny-px-4 bunny-m-0", level: 2 }, { children: "Signup" })), jsxRuntime.jsx(InitialSignupForm, { className: "bunny-px-4", onSubmit: handleSubmit, submitting: proceedingToPayment })] })) }));
|
|
20342
20447
|
}
|
|
20343
20448
|
function InitialSignupForm(_a) {
|
|
20344
20449
|
var className = _a.className, onSubmit = _a.onSubmit, submitting = _a.submitting;
|
|
20345
20450
|
var form = antd.Form.useForm()[0];
|
|
20451
|
+
var isMobile = common.useIsMobile();
|
|
20346
20452
|
function handleSubmit() {
|
|
20347
20453
|
form.validateFields({ validateOnly: false }).then(function () {
|
|
20348
20454
|
onSubmit(form.getFieldsValue());
|
|
20349
20455
|
});
|
|
20350
20456
|
}
|
|
20351
|
-
return (jsxRuntime.jsx(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-h-full bunny-w-full ".concat(className), form: form, layout: "vertical", autoComplete: "off" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-2" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ name: "firstName", rules: [{ required: true, message: 'First name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "First name" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "lastName", rules: [{ required: true, message: 'Last name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "email", rules: [
|
|
20352
|
-
|
|
20353
|
-
|
|
20354
|
-
|
|
20457
|
+
return (jsxRuntime.jsx(antd.Form, __assign({ className: "bunny-flex bunny-flex-col bunny-h-full bunny-w-full ".concat(className), form: form, layout: "vertical", autoComplete: "off" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-4" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ name: "firstName", rules: [{ required: true, message: 'First name is required' }], className: "bunny-flex-1" }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "First name" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "lastName", rules: [{ required: true, message: 'Last name is required' }], className: "bunny-flex-1" }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Last name" }) }))] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-4" }, { children: [jsxRuntime.jsx(antd.Form.Item, __assign({ name: "email", rules: [
|
|
20458
|
+
{ required: true, message: 'Email is required' },
|
|
20459
|
+
{ type: 'email', message: 'Please enter a valid email' },
|
|
20460
|
+
], className: "bunny-flex-1" }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "accountName", rules: [{ required: true, message: 'Company name is required' }], className: "bunny-flex-1" }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) }))] })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex ".concat(isMobile ? 'bunny-flex-row bunny-pb-2' : 'bunny-flex-row', " bunny-gap-4") }, { children: jsxRuntime.jsx("div", __assign({ className: "flex-1 w-1/2" }, { children: jsxRuntime.jsx(antd.Form.Item, __assign({ name: "billingCountry", rules: [{ required: true, message: 'Country is required' }] }, { children: jsxRuntime.jsx(antd.Select, { className: "bunny-w-full", options: common.Lists.COUNTRY_LIST, placeholder: "Select a country", popupMatchSelectWidth: false, showSearch: true, filterOption: function (input, option) {
|
|
20461
|
+
var _a, _b;
|
|
20462
|
+
return ((_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '').toLowerCase().includes(input.toLowerCase()) ||
|
|
20463
|
+
((_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : '').toLowerCase().includes(input.toLowerCase());
|
|
20464
|
+
} }) })) })) })), jsxRuntime.jsx(antd.Form.Item, { children: jsxRuntime.jsx(antd.Button, __assign({ type: "primary", onClick: handleSubmit, loading: submitting, className: "bunny-w-full" }, { children: "Proceed to payment" })) })] })) })));
|
|
20355
20465
|
}
|
|
20356
20466
|
|
|
20357
|
-
var Title = antd.Typography.Title, Text$
|
|
20467
|
+
var Title = antd.Typography.Title, Text$e = antd.Typography.Text;
|
|
20358
20468
|
function PaymentSuccessDisplay(_a) {
|
|
20359
20469
|
var amountPaid = _a.amountPaid, className = _a.className, companyName = _a.companyName, returnUrl = _a.returnUrl, style = _a.style, currencyId = _a.currencyId;
|
|
20360
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "bunny-mt-2 bunny-m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$
|
|
20470
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-justify-center bunny-h-full ".concat(className), style: style }, { children: [jsxRuntime.jsx(icons.CheckCircleFilled, { style: { fontSize: "48px", color: "rgb(52 211 153)" } }), jsxRuntime.jsxs(Title, __assign({ level: 3, className: "bunny-mt-2 bunny-m-0" }, { children: ["Payment of ", common.formatCurrency(amountPaid, currencyId), " successful"] })), returnUrl && (jsxRuntime.jsxs(Text$e, __assign({ className: "bunny-text-slate-500 bunny-cursor-pointer bunny-underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
|
|
20361
20471
|
}
|
|
20362
20472
|
|
|
20363
|
-
var Text$
|
|
20473
|
+
var Text$d = antd.Typography.Text;
|
|
20364
20474
|
function PriceListDisplay(_a) {
|
|
20365
20475
|
var priceListData = _a.priceListData;
|
|
20366
20476
|
if (!priceListData)
|
|
20367
20477
|
return null;
|
|
20368
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-8" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(Text$
|
|
20478
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-space-y-8" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(Text$d, __assign({ className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg" }, { children: [priceListData.product.name, " ", priceListData.name] })), jsxRuntime.jsxs(Text$d, __assign({ className: "bunny-font-bold bunny-text-xl" }, { children: [common.formatCurrency(priceListData.basePrice, priceListData.currencyId), " / month"] }))] })), priceListData.trialAllowed ? (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col" }, { children: [jsxRuntime.jsxs(Text$d, __assign({ style: { fontSize: '16px' }, className: "bunny-text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$d, __assign({ className: "bunny-text-slate-500", style: { fontSize: '12px' } }, { children: "You will not be charged until the last day of the trial." }))] }))) : null] })));
|
|
20369
20479
|
}
|
|
20370
20480
|
|
|
20371
20481
|
var showErrorNotification = common.useErrorNotification();
|
|
20482
|
+
var showSuccessNotification = common.useSuccessNotification();
|
|
20372
20483
|
function Signup(_a) {
|
|
20373
|
-
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, couponCode = _a.couponCode, className = _a.className, _b = _a.shadow, shadow = _b === void 0 ? 'shadow-md' : _b, style = _a.style
|
|
20484
|
+
var companyName = _a.companyName, priceListCode = _a.priceListCode, returnUrl = _a.returnUrl, couponCode = _a.couponCode, className = _a.className, _b = _a.shadow, shadow = _b === void 0 ? 'shadow-md' : _b, style = _a.style;
|
|
20374
20485
|
// Hooks
|
|
20375
20486
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20376
20487
|
var tokenFromContexts = useToken();
|
|
@@ -20380,8 +20491,7 @@ function Signup(_a) {
|
|
|
20380
20491
|
var _d = react.useState(undefined), accountId = _d[0], setAccountId = _d[1];
|
|
20381
20492
|
var _e = react.useState(undefined), portalSessionToken = _e[0], setPortalSessionToken = _e[1];
|
|
20382
20493
|
var token = portalSessionToken || tokenFromContexts;
|
|
20383
|
-
var _f = react.useState(false),
|
|
20384
|
-
var _g = react.useState(false), purchaseSucceeded = _g[0], setPurchaseSucceeded = _g[1];
|
|
20494
|
+
var _f = react.useState(false), purchaseSucceeded = _f[0], setPurchaseSucceeded = _f[1];
|
|
20385
20495
|
var defaultCouponAppliedRef = react.useRef(undefined);
|
|
20386
20496
|
var defaultPaymentMethod = usePaymentMethod({
|
|
20387
20497
|
accountId: accountId,
|
|
@@ -20389,6 +20499,71 @@ function Signup(_a) {
|
|
|
20389
20499
|
apiHost: apiHost,
|
|
20390
20500
|
}).defaultPaymentMethod;
|
|
20391
20501
|
var queryClient = reactQuery.useQueryClient();
|
|
20502
|
+
var recalculateTaxes = reactQuery.useMutation({
|
|
20503
|
+
mutationFn: function () {
|
|
20504
|
+
if (!(quote === null || quote === void 0 ? void 0 : quote.id)) {
|
|
20505
|
+
throw new Error('Quote ID is required');
|
|
20506
|
+
}
|
|
20507
|
+
return quoteRecalculateTaxes({ token: token, apiHost: apiHost, quoteId: quote.id });
|
|
20508
|
+
},
|
|
20509
|
+
onError: function (error) {
|
|
20510
|
+
if (!error[0].message.includes('Ensure that you have a taxation plugin')) {
|
|
20511
|
+
showErrorNotification(error.message);
|
|
20512
|
+
}
|
|
20513
|
+
},
|
|
20514
|
+
onSuccess: function (quote) {
|
|
20515
|
+
queryClient.setQueryData(['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id], quote);
|
|
20516
|
+
queryClient.invalidateQueries({
|
|
20517
|
+
queryKey: ['quote', initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id],
|
|
20518
|
+
});
|
|
20519
|
+
},
|
|
20520
|
+
}).mutate;
|
|
20521
|
+
var _g = reactQuery.useMutation({
|
|
20522
|
+
mutationFn: function (formData) {
|
|
20523
|
+
return quoteAccountSignup({
|
|
20524
|
+
token: token,
|
|
20525
|
+
apiHost: apiHost,
|
|
20526
|
+
priceListCode: priceListCode,
|
|
20527
|
+
accountName: formData.accountName,
|
|
20528
|
+
billingContact: {
|
|
20529
|
+
firstName: formData.firstName,
|
|
20530
|
+
lastName: formData.lastName,
|
|
20531
|
+
email: formData.email,
|
|
20532
|
+
},
|
|
20533
|
+
billingDetails: {
|
|
20534
|
+
billingCountry: formData.billingCountry,
|
|
20535
|
+
// TODO: add these billing details back for Avalara and AFC taxation plugins.
|
|
20536
|
+
// billingState: formData.billingState,
|
|
20537
|
+
// billingCity: formData.billingCity,
|
|
20538
|
+
// billingZip: formData.billingZip,
|
|
20539
|
+
// billingStreet: formData.billingStreet,
|
|
20540
|
+
// taxNumber: formData.taxNumber,
|
|
20541
|
+
},
|
|
20542
|
+
});
|
|
20543
|
+
},
|
|
20544
|
+
onSuccess: function (data) {
|
|
20545
|
+
setAccountId(data.account.id);
|
|
20546
|
+
setPortalSessionToken(data.portalSessionToken);
|
|
20547
|
+
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20548
|
+
// to instead use paymentMethods from portalSessionToken.
|
|
20549
|
+
queryClient.invalidateQueries({
|
|
20550
|
+
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20551
|
+
accountId: accountId,
|
|
20552
|
+
token: token,
|
|
20553
|
+
}),
|
|
20554
|
+
});
|
|
20555
|
+
setInitialQuote(data.quote);
|
|
20556
|
+
},
|
|
20557
|
+
onError: function (error) {
|
|
20558
|
+
var errorMessage = error.response.errors[0].message;
|
|
20559
|
+
if (errorMessage.includes("Address couldn't be validated")) {
|
|
20560
|
+
showErrorNotification('Please enter a valid billing address');
|
|
20561
|
+
}
|
|
20562
|
+
else {
|
|
20563
|
+
showErrorNotification(errorMessage);
|
|
20564
|
+
}
|
|
20565
|
+
},
|
|
20566
|
+
}), quoteAccountSignupMutate = _g.mutate, isSigningUp = _g.isPending;
|
|
20392
20567
|
// Queries
|
|
20393
20568
|
var _h = reactQuery.useQuery({
|
|
20394
20569
|
queryKey: ['priceList', priceListCode],
|
|
@@ -20407,30 +20582,63 @@ function Signup(_a) {
|
|
|
20407
20582
|
var quote = data || initialQuote;
|
|
20408
20583
|
var _k = reactQuery.useMutation({
|
|
20409
20584
|
mutationFn: function (couponCode) {
|
|
20585
|
+
var _a;
|
|
20410
20586
|
if (!quote) {
|
|
20411
20587
|
throw new Error('Quote is required');
|
|
20412
20588
|
}
|
|
20413
20589
|
if (!token) {
|
|
20414
20590
|
throw new Error('Token is required');
|
|
20415
20591
|
}
|
|
20416
|
-
|
|
20417
|
-
|
|
20592
|
+
if (!((_a = quote.quoteChanges[0]) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
20593
|
+
throw new Error('Quote change ID is required');
|
|
20594
|
+
}
|
|
20595
|
+
return quoteChangeAddCoupon({
|
|
20596
|
+
quoteChangeId: quote.quoteChanges[0].id,
|
|
20418
20597
|
couponCode: couponCode,
|
|
20419
20598
|
apiHost: apiHost,
|
|
20420
20599
|
token: token,
|
|
20421
20600
|
});
|
|
20422
20601
|
},
|
|
20423
20602
|
onSuccess: function () {
|
|
20424
|
-
queryClient.
|
|
20603
|
+
queryClient.invalidateQueries({
|
|
20425
20604
|
queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
|
|
20426
20605
|
});
|
|
20427
20606
|
showSuccessNotification('Coupon applied');
|
|
20607
|
+
recalculateTaxes();
|
|
20428
20608
|
},
|
|
20429
20609
|
onError: function (error) {
|
|
20430
20610
|
var _a, _b;
|
|
20431
20611
|
showErrorNotification((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error adding coupon');
|
|
20432
20612
|
},
|
|
20433
20613
|
}), addCoupon = _k.mutate, isAddingCoupon = _k.isPending;
|
|
20614
|
+
var _l = reactQuery.useMutation({
|
|
20615
|
+
mutationFn: function (couponCode) {
|
|
20616
|
+
var _a;
|
|
20617
|
+
if (!quote) {
|
|
20618
|
+
throw new Error('Quote is required');
|
|
20619
|
+
}
|
|
20620
|
+
if (!((_a = quote.quoteChanges[0]) === null || _a === void 0 ? void 0 : _a.id)) {
|
|
20621
|
+
throw new Error('Quote change ID is required');
|
|
20622
|
+
}
|
|
20623
|
+
return quoteChangeRemoveCoupon({
|
|
20624
|
+
quoteChangeId: quote.quoteChanges[0].id,
|
|
20625
|
+
couponCode: couponCode,
|
|
20626
|
+
apiHost: apiHost,
|
|
20627
|
+
token: token,
|
|
20628
|
+
});
|
|
20629
|
+
},
|
|
20630
|
+
onSuccess: function () {
|
|
20631
|
+
showSuccessNotification('Coupon removed');
|
|
20632
|
+
recalculateTaxes();
|
|
20633
|
+
queryClient.invalidateQueries({
|
|
20634
|
+
queryKey: ['quote', quote === null || quote === void 0 ? void 0 : quote.id],
|
|
20635
|
+
});
|
|
20636
|
+
},
|
|
20637
|
+
onError: function (error) {
|
|
20638
|
+
var _a, _b;
|
|
20639
|
+
showErrorNotification((_b = (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.errors[0]) === null || _b === void 0 ? void 0 : _b.message, 'Error removing coupon');
|
|
20640
|
+
},
|
|
20641
|
+
}), removeCoupon = _l.mutate, isRemovingCoupon = _l.isPending;
|
|
20434
20642
|
// Handle default coupon application
|
|
20435
20643
|
react.useEffect(function () {
|
|
20436
20644
|
if (couponCode && (quote === null || quote === void 0 ? void 0 : quote.id) && defaultCouponAppliedRef.current !== couponCode) {
|
|
@@ -20440,46 +20648,9 @@ function Signup(_a) {
|
|
|
20440
20648
|
}, [couponCode, quote === null || quote === void 0 ? void 0 : quote.id]);
|
|
20441
20649
|
function handleSubmit(formData) {
|
|
20442
20650
|
return __awaiter(this, void 0, void 0, function () {
|
|
20443
|
-
var data_1, error_1;
|
|
20444
20651
|
return __generator(this, function (_a) {
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
_a.trys.push([0, 2, , 3]);
|
|
20448
|
-
setProceedingToPayment(true);
|
|
20449
|
-
return [4 /*yield*/, quoteAccountSignup({
|
|
20450
|
-
token: token,
|
|
20451
|
-
apiHost: apiHost,
|
|
20452
|
-
priceListCode: priceListCode,
|
|
20453
|
-
accountName: formData.accountName,
|
|
20454
|
-
billingContact: {
|
|
20455
|
-
firstName: formData.firstName,
|
|
20456
|
-
lastName: formData.lastName,
|
|
20457
|
-
email: formData.email,
|
|
20458
|
-
},
|
|
20459
|
-
entityId: entityId,
|
|
20460
|
-
})];
|
|
20461
|
-
case 1:
|
|
20462
|
-
data_1 = _a.sent();
|
|
20463
|
-
setAccountId(data_1.account.id);
|
|
20464
|
-
setPortalSessionToken(data_1.portalSessionToken);
|
|
20465
|
-
// We must invalidate the accountPaymentMethodKey query in order to clear payment methods from the provided api token,
|
|
20466
|
-
// to instead use paymentMethods from portalSessionToken.
|
|
20467
|
-
queryClient.invalidateQueries({
|
|
20468
|
-
queryKey: common.QueryKeyFactory.default.accountPaymentMethodKey({
|
|
20469
|
-
accountId: accountId,
|
|
20470
|
-
token: token,
|
|
20471
|
-
}),
|
|
20472
|
-
});
|
|
20473
|
-
setProceedingToPayment(false);
|
|
20474
|
-
setInitialQuote(data_1.quote);
|
|
20475
|
-
return [3 /*break*/, 3];
|
|
20476
|
-
case 2:
|
|
20477
|
-
error_1 = _a.sent();
|
|
20478
|
-
setProceedingToPayment(false);
|
|
20479
|
-
showErrorNotification(error_1.response.message);
|
|
20480
|
-
return [3 /*break*/, 3];
|
|
20481
|
-
case 3: return [2 /*return*/];
|
|
20482
|
-
}
|
|
20652
|
+
quoteAccountSignupMutate(formData);
|
|
20653
|
+
return [2 /*return*/];
|
|
20483
20654
|
});
|
|
20484
20655
|
});
|
|
20485
20656
|
}
|
|
@@ -20516,7 +20687,6 @@ function Signup(_a) {
|
|
|
20516
20687
|
pluginId: plugin === null || plugin === void 0 ? void 0 : plugin.id.toString(),
|
|
20517
20688
|
priceListCode: priceListCode,
|
|
20518
20689
|
accountId: accountId,
|
|
20519
|
-
entityId: entityId,
|
|
20520
20690
|
})];
|
|
20521
20691
|
case 1: return [2 /*return*/, _a.sent()];
|
|
20522
20692
|
}
|
|
@@ -20524,28 +20694,20 @@ function Signup(_a) {
|
|
|
20524
20694
|
});
|
|
20525
20695
|
}
|
|
20526
20696
|
function handlePaymentFail(error) {
|
|
20527
|
-
|
|
20697
|
+
var _a;
|
|
20698
|
+
showErrorNotification((_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.message);
|
|
20528
20699
|
}
|
|
20700
|
+
react.useEffect(function () {
|
|
20701
|
+
if (initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id) {
|
|
20702
|
+
recalculateTaxes();
|
|
20703
|
+
}
|
|
20704
|
+
}, [initialQuote === null || initialQuote === void 0 ? void 0 : initialQuote.id]);
|
|
20529
20705
|
if (purchaseSucceeded) {
|
|
20530
20706
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: (quote === null || quote === void 0 ? void 0 : quote.currencyId) !== undefined ? (jsxRuntime.jsx("div", __assign({ className: "bunny-w-screen bunny-flex bunny-items-start bunny-pt-[25vh]" }, { children: jsxRuntime.jsx(PaymentSuccessDisplay, { amountPaid: (quote === null || quote === void 0 ? void 0 : quote.amountDue) || 0, className: "bunny-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" })) }));
|
|
20531
20707
|
}
|
|
20532
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? 'bunny-flex-col' : 'bunny-flex-row', " bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ").concat(shadow, " ").concat(className), style: style }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full', " bunny-justify-center") }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24" }, { children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-h-full" }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true })) : (jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData })) }))), jsxRuntime.jsx(Footer, {})] })) })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full', " bunny-items-center"), style: {
|
|
20708
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? 'bunny-flex-col' : 'bunny-flex-row', " bunny-h-screen bunny-w-screen bunny-absolute bunny-top-0 bunny-left-0 ").concat(shadow, " ").concat(className), style: style }, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2' : 'bunny-w-1/2 bunny-h-full', " bunny-justify-center") }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-start bunny-justify-between bunny-w-3/5 bunny-h-full bunny-gap-4 bunny-my-24" }, { children: [jsxRuntime.jsx("div", { children: topNavImageUrl.length > 0 && (jsxRuntime.jsx(antd.Image, { width: 24, src: topNavImageUrl, alt: "Logo", preview: false })) }), data ? (jsxRuntime.jsx(CheckoutSummary, { quote: data, className: "bunny-h-full bunny-w-full", onAddCoupon: addCoupon, onRemoveCoupon: removeCoupon, isRemovingCoupon: isRemovingCoupon, priceListData: priceListData, isAddingCoupon: isAddingCoupon })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-h-full" }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true })) : (jsxRuntime.jsx(PriceListDisplay, { priceListData: priceListData })) }))), jsxRuntime.jsx(Footer, {})] })) })), jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col ".concat(isMobile ? 'bunny-w-full bunny-h-1/2 bunny-overflow-auto' : 'bunny-w-1/2 bunny-h-full', " bunny-items-center"), style: {
|
|
20533
20709
|
boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
|
|
20534
|
-
} }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" }, { children: jsxRuntime.jsx(PaymentForms, { quote:
|
|
20535
|
-
}
|
|
20536
|
-
var Text$d = antd.Typography.Text;
|
|
20537
|
-
var CheckoutSummaryDivider = function () {
|
|
20538
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20539
|
-
};
|
|
20540
|
-
var showSuccessNotification = common.useSuccessNotification();
|
|
20541
|
-
function CheckoutSummary(_a) {
|
|
20542
|
-
var quote = _a.quote, className = _a.className; _a.onAddCoupon; var priceListData = _a.priceListData; _a.isAddingCoupon;
|
|
20543
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className, " bunny-space-y-4") }, { children: [jsxRuntime.jsxs(Text$d, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-text-lg bunny-font-medium bunny-mb-4" }, { children: ["Checkout summary - ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.product.name, " ", priceListData === null || priceListData === void 0 ? void 0 : priceListData.name] })), jsxRuntime.jsx("div", __assign({ className: "bunny-space-y-4" }, { children: quote === null || quote === void 0 ? void 0 : quote.quoteChanges.map(function (quoteChange) {
|
|
20544
|
-
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20545
|
-
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20546
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: charge.name }), jsxRuntime.jsx("div", { children: charge.quantity }), jsxRuntime.jsx("div", { children: common.formatCurrency(multiplier * charge.amount, charge.currencyId) })] }), charge.id));
|
|
20547
|
-
});
|
|
20548
|
-
}) })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-space-y-4" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Subtotal" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue, quote.currencyId) })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Taxes" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.taxAmount, quote.currencyId) })] }))] })), jsxRuntime.jsx(CheckoutSummaryDivider, {}), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-justify-between" }, { children: [jsxRuntime.jsx("div", { children: "Total" }), jsxRuntime.jsx("div", { children: common.formatCurrency(quote.amountDue + quote.taxAmount, quote.currencyId) })] }))] }), false ] })));
|
|
20710
|
+
} }, { children: isLoadingPriceList ? (jsxRuntime.jsx(antd.Skeleton, { active: true, className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" })) : (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-3/5 bunny-mt-24" }, { children: jsxRuntime.jsx(PaymentForms, { quote: quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: isSigningUp || isLoadingQuote, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction }) }))) }))] })));
|
|
20549
20711
|
}
|
|
20550
20712
|
|
|
20551
20713
|
var useQuoteSubscriptionUpgrade = function () {
|
|
@@ -20634,35 +20796,6 @@ var pageWrapperClassName = function (isMobile) {
|
|
|
20634
20796
|
return "flex flex-col grow pt-4 ".concat(isMobile ? "pb-4 overflow-hidden" : "pb-8", " ").concat("content-container");
|
|
20635
20797
|
};
|
|
20636
20798
|
|
|
20637
|
-
var QUOTE_FIELDS = "quote {\n formattedQuote {\n html\n }\n acceptedByName\n acceptedByTitle\n accountId\n amount\n amountDue\n applicationDate\n applied\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 invoiceUntil\n isPendingApprovalRequest\n kind\n message\n name\n netPaymentDays\n notes\n ownerId\n periodAmount\n poNumber\n requiresApproval\n startDate\n state\n subtotal\n taxAmount\n updatedAt\n uuid\n amountsByPeriod {\n amount\n id\n name\n }\n endDateOptions {\n endDate\n label\n }\n invoiceUntilOptions {\n endDate\n label\n }\n quoteChanges {\n currencyId\n id\n kind\n charges {\n amountsByPeriod {\n amount\n startDate\n }\n amount\n billingPeriod\n billingPeriodAmounts { id amount prorationRate }\n chargeType\n couponId\n createdAt\n currencyId\n discount\n endDate\n feature { id name code isUnit unitName }\n id\n name\n priceListCharge {\n id\n }\n priceList {\n id\n }\n couponId\n price\n priceDecimals\n priceTiers { starts price }\n pricingModel\n prorationRate\n quantity\n quantityMax\n quantityMin\n startDate\n tieredAveragePrice\n updatedAt\n kind\n }\n priceList {\n id\n plan {\n name\n }\n product {\n name\n }\n }\n }\n}";
|
|
20638
|
-
|
|
20639
|
-
var QUOTE_RECALCULATE_TAXES = "\n mutation QuoteRecalculateTaxes($id: ID!) {\n quoteRecalculateTaxes(id: $id) {\n ".concat(QUOTE_FIELDS, "\n errors\n }\n }\n");
|
|
20640
|
-
var quoteRecalculateTaxes = function (_a) {
|
|
20641
|
-
var quoteId = _a.quoteId, apiHost = _a.apiHost, token = _a.token;
|
|
20642
|
-
return __awaiter(void 0, void 0, void 0, function () {
|
|
20643
|
-
var vars, response, errors;
|
|
20644
|
-
var _b, _c;
|
|
20645
|
-
return __generator(this, function (_d) {
|
|
20646
|
-
switch (_d.label) {
|
|
20647
|
-
case 0:
|
|
20648
|
-
vars = { id: quoteId };
|
|
20649
|
-
return [4 /*yield*/, gqlRequest({
|
|
20650
|
-
query: QUOTE_RECALCULATE_TAXES,
|
|
20651
|
-
token: token,
|
|
20652
|
-
vars: vars,
|
|
20653
|
-
apiHost: apiHost,
|
|
20654
|
-
})];
|
|
20655
|
-
case 1:
|
|
20656
|
-
response = _d.sent();
|
|
20657
|
-
errors = (_b = response === null || response === void 0 ? void 0 : response.quoteRecalculateTaxes) === null || _b === void 0 ? void 0 : _b.errors;
|
|
20658
|
-
if (errors)
|
|
20659
|
-
throw errors;
|
|
20660
|
-
return [2 /*return*/, (_c = response.quoteRecalculateTaxes) === null || _c === void 0 ? void 0 : _c.quote];
|
|
20661
|
-
}
|
|
20662
|
-
});
|
|
20663
|
-
});
|
|
20664
|
-
};
|
|
20665
|
-
|
|
20666
20799
|
var MUTATION$2 = "{\n currentUser {\n taxationRequiredAccountFields\n }\n}";
|
|
20667
20800
|
var getTaxationRequiredAccountFields = function (_a) {
|
|
20668
20801
|
var apiHost = _a.apiHost, token = _a.token;
|
|
@@ -20774,6 +20907,7 @@ var QuoteCheckout = function (_a) {
|
|
|
20774
20907
|
var isMobile = common.useIsMobile();
|
|
20775
20908
|
var _b = react.useState(false), isSaving = _b[0], setIsSaving = _b[1];
|
|
20776
20909
|
var paymentRequired = getQuoteAmountDue(quote) > 0;
|
|
20910
|
+
var entityId = useCurrentUserData().entityId;
|
|
20777
20911
|
var checkoutMutation = reactQuery.useMutation({
|
|
20778
20912
|
mutationFn: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
20779
20913
|
return __generator(this, function (_a) {
|
|
@@ -20803,7 +20937,7 @@ var QuoteCheckout = function (_a) {
|
|
|
20803
20937
|
}
|
|
20804
20938
|
if (taxationRequiredAccountFields)
|
|
20805
20939
|
return (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsx(TaxationForm, { account: account, quote: quote }) })));
|
|
20806
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-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: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20940
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: paymentRequired ? (jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: onFail, onPaymentSuccess: onSuccess, quote: quote })) : (jsxRuntime.jsx(PaymentFormWrapper, __assign({ setMaxHeight: false }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-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: "bunny-text-xs bunny-text-slate-500" }, { children: "No payment is required" }))] })) }))) }));
|
|
20807
20941
|
};
|
|
20808
20942
|
var PaymentFormWrapper = function (_a) {
|
|
20809
20943
|
var children = _a.children, setMaxHeight = _a.setMaxHeight, className = _a.className;
|
|
@@ -20820,9 +20954,10 @@ var PaymentFormWrapper = function (_a) {
|
|
|
20820
20954
|
var queryKeyFactory = common.QueryKeyFactory.default;
|
|
20821
20955
|
var Checkout = function (_a) {
|
|
20822
20956
|
var _b, _c;
|
|
20823
|
-
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList
|
|
20957
|
+
var onCancel = _a.onCancel, onSuccess = _a.onSuccess, onFail = _a.onFail, invoice = _a.invoice, open = _a.open, quote = _a.quote, selectedPriceList = _a.selectedPriceList;
|
|
20824
20958
|
var apiHost = react.useContext(BunnyContext).apiHost;
|
|
20825
20959
|
var isMobile = common.useIsMobile();
|
|
20960
|
+
var token = useToken();
|
|
20826
20961
|
var hasTaxPlugin = useHasTaxPlugin({
|
|
20827
20962
|
apiHost: apiHost,
|
|
20828
20963
|
token: token,
|
|
@@ -21270,11 +21405,11 @@ var PlanPickerCheckoutBar = function (_a) {
|
|
|
21270
21405
|
return (jsxRuntime.jsx(CheckoutBarInput, { disabled: !chargeQuantity, charge: charge, quantity: chargeQuantity !== null && chargeQuantity !== void 0 ? chargeQuantity : 0, selectedPriceList: selectedPriceList, onQuantityChanged: function (quantity) {
|
|
21271
21406
|
onChangeQuantity(charge.id, quantity);
|
|
21272
21407
|
} }, index));
|
|
21273
|
-
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsxRuntime.jsx(Checkout, {
|
|
21408
|
+
}) })), jsxRuntime.jsx(CheckoutBarSummarySection, { onClickCheckout: function () { return setPayModalVisible(true); }, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, upgradingSubscription: upgradingSubscription, quotePreviewData: quotePreviewData }), jsxRuntime.jsx(Checkout, { onCancel: function () { return setPayModalVisible(false); }, onFail: onCheckoutFail, onSuccess: handleCheckoutSuccess, open: payModalVisible, quote: quote, selectedPriceList: selectedPriceList, storedPaymentMethod: defaultPaymentMethod, token: token })] })));
|
|
21274
21409
|
};
|
|
21275
21410
|
|
|
21276
21411
|
// WARNING: There is a preview button on APP that will need to be changed if this query is changed
|
|
21277
|
-
var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n basePrice\n currencyId\n id\n monthlyBasePrice\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
|
|
21412
|
+
var PRICE_LIST_CHANGE_OPTIONS_QUERY = "\n query priceListChangeOptions($subscriptionId: ID, $productId: ID) {\n priceListChangeOptions(subscriptionId: $subscriptionId, productId: $productId) {\n products {\n everythingInPlus\n id\n name\n plansToDisplay\n features(sort: \"position asc\") {\n description\n id\n isVisible\n kind\n name\n position\n }\n }\n priceLists {\n showPriceAsMonthly\n basePrice\n currencyId\n id\n monthlyBasePrice\n periodMonths\n plan {\n code\n contactUsLabel\n contactUsUrl\n description\n id\n name\n position\n pricingDescription\n pricingStyle\n planFeatures {\n featureId\n value\n feature {\n name\n }\n }\n }\n product {\n id\n }\n charges {\n basePrice\n billingPeriod\n chargeType\n id\n name\n priceDecimals\n pricingModel\n quantityMax\n quantityMin\n selfServiceQuantity\n feature {\n name\n unitName\n }\n }\n }\n }\n }";
|
|
21278
21413
|
var getPriceListChangeOptions = function (_a) {
|
|
21279
21414
|
var apiHost = _a.apiHost, isInPreviewMode = _a.isInPreviewMode, productId = _a.productId, token = _a.token, upgradingSubscription = _a.upgradingSubscription;
|
|
21280
21415
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -21378,10 +21513,30 @@ var PriceListCardTitle = function (_a) {
|
|
|
21378
21513
|
: " " }))), jsxRuntime.jsx("div", __assign({ className: "bunny-font-medium bunny-text-center ".concat(isMobile ? "bunny-text-slate-500" : "bunny-text-orange-600"), style: { fontSize: "20px" } }, { children: priceList.plan.name }))] })));
|
|
21379
21514
|
};
|
|
21380
21515
|
|
|
21516
|
+
var getPrice = function (priceList) {
|
|
21517
|
+
if (priceList.showPriceAsMonthly) {
|
|
21518
|
+
return priceList.monthlyBasePrice;
|
|
21519
|
+
}
|
|
21520
|
+
return priceList.basePrice;
|
|
21521
|
+
};
|
|
21522
|
+
var calculatePriceDecimals = function (priceList) {
|
|
21523
|
+
if (priceList.plan.pricingStyle === common.PricingStyle.PRICED) {
|
|
21524
|
+
var decimalPart = getPrice(priceList).toString().split('.')[1];
|
|
21525
|
+
if (!decimalPart)
|
|
21526
|
+
return 0;
|
|
21527
|
+
// If decimal part consists only of zeros, return 0
|
|
21528
|
+
if (parseInt(decimalPart) === 0) {
|
|
21529
|
+
return 0;
|
|
21530
|
+
}
|
|
21531
|
+
return undefined;
|
|
21532
|
+
}
|
|
21533
|
+
return 0;
|
|
21534
|
+
};
|
|
21381
21535
|
var PriceListCardPrice = function (_a) {
|
|
21382
21536
|
var priceList = _a.priceList;
|
|
21537
|
+
var priceDecimals = calculatePriceDecimals(priceList);
|
|
21383
21538
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-font-medium bunny-text-center bunny-text-gray-900", style: { fontSize: '32px' } }, { children: !priceList.plan.pricingStyle || priceList.plan.pricingStyle === common.PricingStyle.PRICED
|
|
21384
|
-
? common.formatCurrency(priceList
|
|
21539
|
+
? common.formatCurrency(getPrice(priceList), priceList.currencyId, priceDecimals)
|
|
21385
21540
|
: priceList.plan.pricingStyle === common.PricingStyle.CONTACT_US
|
|
21386
21541
|
? ''
|
|
21387
21542
|
: 'Free' })));
|
|
@@ -21390,10 +21545,7 @@ var PriceListCardPrice = function (_a) {
|
|
|
21390
21545
|
var Text$c = antd.Typography.Text;
|
|
21391
21546
|
var PriceListCardDescription = function (_a) {
|
|
21392
21547
|
var description = _a.description;
|
|
21393
|
-
|
|
21394
|
-
if (!description)
|
|
21395
|
-
return null;
|
|
21396
|
-
return jsxRuntime.jsx(Text$c, __assign({ className: "bunny-text-center" }, { children: htmlParsedDescription }));
|
|
21548
|
+
return (jsxRuntime.jsx(Text$c, __assign({ className: "bunny-text-center" }, { children: jsxRuntime.jsx(interweave.Markup, { content: description }) })));
|
|
21397
21549
|
};
|
|
21398
21550
|
|
|
21399
21551
|
var BillingPeriodConverter;
|
|
@@ -21420,7 +21572,9 @@ var PriceListCardPriceDescription = function (_a) {
|
|
|
21420
21572
|
fontSize: isMobile ? '13px' : '12px',
|
|
21421
21573
|
} }, { children: priceList.plan.pricingDescription && !isEmptyHtml(priceList.plan.pricingDescription) ? (jsxRuntime.jsx(interweave.Markup, { content: priceList.plan.pricingDescription })) : ("per ".concat((feature === null || feature === void 0 ? void 0 : feature.unitName) && !doesPlanHaveFlatFeeCharges
|
|
21422
21574
|
? "".concat(feature.unitName.toLowerCase(), " / ")
|
|
21423
|
-
: ''
|
|
21575
|
+
: '').concat(priceList.showPriceAsMonthly
|
|
21576
|
+
? 'month'
|
|
21577
|
+
: common.PERIOD_LABELS[periodMonthsConverter(priceList.periodMonths)])) })), priceList.periodMonths > 1 && (jsxRuntime.jsxs(Text$b, __assign({ className: "bunny-text-center bunny-text-gray-900", style: { fontSize: isMobile ? '12px' : '11px' } }, { children: ["billed ", BillingPeriodConverter$1[periodMonthsConverter(priceList.periodMonths)]] })))] }));
|
|
21424
21578
|
};
|
|
21425
21579
|
|
|
21426
21580
|
var CheckIcon = function (_a) {
|
|
@@ -21458,11 +21612,11 @@ var PriceListCardMobile = function (_a) {
|
|
|
21458
21612
|
if (!disableOnClick)
|
|
21459
21613
|
onClick(priceList);
|
|
21460
21614
|
}, style: {
|
|
21461
|
-
minWidth:
|
|
21615
|
+
minWidth: '220px',
|
|
21462
21616
|
borderColor: isSelected ? brandColor : common.SLATE_200,
|
|
21463
21617
|
} }, { children: [isSelected && (jsxRuntime.jsx("div", __assign({ className: "bunny-absolute", style: {
|
|
21464
|
-
top:
|
|
21465
|
-
right:
|
|
21618
|
+
top: '10px',
|
|
21619
|
+
right: '10px',
|
|
21466
21620
|
} }, { children: jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "20px" }) }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-grow bunny-gap-2" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(PriceListCardTitle, { isPriceListCurrentSubscription: isPriceListCurrentSubscription, priceList: priceList, trialRemainingDays: trialRemainingDays }), jsxRuntime.jsx(PriceListCardDescription, { description: description })] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(PriceListCardPrice, { priceList: priceList }), jsxRuntime.jsx(PriceListCardPriceDescription, { feature: feature, priceList: priceList })] })), jsxRuntime.jsx(PriceListCardButton, { disableOnClick: disableOnClick, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, priceList: priceList, subscriptionPlan: subscriptionPlan })] }))] })));
|
|
21467
21621
|
};
|
|
21468
21622
|
|
|
@@ -21918,7 +22072,7 @@ var PlanManager = function (_a) {
|
|
|
21918
22072
|
var queryClient = reactQuery.useQueryClient();
|
|
21919
22073
|
var showSuccessNotification = common.useSuccessNotification();
|
|
21920
22074
|
var showInfoNotification = common.useInfoNotification();
|
|
21921
|
-
|
|
22075
|
+
common.useIsMobile();
|
|
21922
22076
|
var defaultPaymentMethod = usePaymentMethod({
|
|
21923
22077
|
token: token,
|
|
21924
22078
|
apiHost: apiHost,
|
|
@@ -21970,8 +22124,8 @@ var PlanManager = function (_a) {
|
|
|
21970
22124
|
}, []);
|
|
21971
22125
|
function handleSetEditingQuoteData(quoteId, isTrial) {
|
|
21972
22126
|
setEditingQuoteData({
|
|
21973
|
-
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id),
|
|
21974
|
-
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial),
|
|
22127
|
+
id: quoteId || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.id) || '',
|
|
22128
|
+
isTrial: isTrial || (editingQuoteData === null || editingQuoteData === void 0 ? void 0 : editingQuoteData.isTrial) || false,
|
|
21975
22129
|
});
|
|
21976
22130
|
}
|
|
21977
22131
|
// Handlers
|
|
@@ -22002,7 +22156,7 @@ var PlanManager = function (_a) {
|
|
|
22002
22156
|
return showInfoNotification('You are in preview mode');
|
|
22003
22157
|
setQuotePreviewData(undefined);
|
|
22004
22158
|
onChangePlanCancel();
|
|
22005
|
-
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token,
|
|
22159
|
+
}, title: "Change plan" }), jsxRuntime.jsx(PlanPicker, {}), jsxRuntime.jsx(Checkout, { onCancel: onCancel, onSuccess: onSuccess, onFail: onFail, open: payModalVisible, quote: quote, token: token, storedPaymentMethod: defaultPaymentMethod, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList }), jsxRuntime.jsx("div", { ref: stickyRef }), jsxRuntime.jsx("div", __assign({ className: "bunny-sticky bunny-bottom-4 bunny-transition-[margin] bunny-duration-300 ".concat(isSticky ? 'bunny-mx-4' : 'bunny-mx-0') }, { children: jsxRuntime.jsx(PlanPickerCheckoutBarWrapper, { editingQuote: editingQuoteData, setEditingQuoteData: handleSetEditingQuoteData, handlePortalErrors: handlePortalErrors, onCheckoutSuccess: function () { return onChangePlanCancel(); } }) }))] })));
|
|
22006
22160
|
};
|
|
22007
22161
|
|
|
22008
22162
|
var useCancelSubscription = function () {
|
|
@@ -23026,7 +23180,7 @@ var Subscriptions = function (_a) {
|
|
|
23026
23180
|
setIsChangingPlan(false);
|
|
23027
23181
|
}, handlePortalErrors: handlePortalErrors }));
|
|
23028
23182
|
}
|
|
23029
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsxRuntime.jsx(PageTitle, { title: 'Subscriptions' }) : null, jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideExpiredToggle && (jsxRuntime.jsxs(Text$1, __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: { minWidth: '120px' } }, { children: [hideExpired ? 'Active subscriptions' : 'All subscriptions', isMobile && expiredSwitchVisible && (jsxRuntime.jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpiredState }))] }))) }) }, { children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: !hideExpiredToggle && expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, 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: "bunny-pt-4 bunny-pb-2" }, { children: jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), 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,
|
|
23183
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className) }, { children: [!hideTitle ? jsxRuntime.jsx(PageTitle, { title: 'Subscriptions' }) : null, jsxRuntime.jsx(PageHeaderWithActions, __assign({ title: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideExpiredToggle && (jsxRuntime.jsxs(Text$1, __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: { minWidth: '120px' } }, { children: [hideExpired ? 'Active subscriptions' : 'All subscriptions', isMobile && expiredSwitchVisible && (jsxRuntime.jsx(HideExpiredToggle, { hideExpired: hideExpired, setHideExpired: setHideExpiredState }))] }))) }) }, { children: !isMobile && (jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: !hideExpiredToggle && expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, 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: "bunny-pt-4 bunny-pb-2" }, { children: jsxRuntime.jsx(SubscriptionsNavigation, { expiredSwitchVisible: expiredSwitchVisible, hideExpired: hideExpired, setHideExpired: setHideExpiredState, setQuantityDrawerOpen: setQuantityDrawerOpen, subscriptions: subscriptions }) }))), 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, storedPaymentMethod: defaultPaymentMethod })] })));
|
|
23030
23184
|
};
|
|
23031
23185
|
var PageHeaderWithActions = function (_a) {
|
|
23032
23186
|
var children = _a.children, title = _a.title;
|
|
@@ -23281,7 +23435,8 @@ var PaymentFormSection = function (_a) {
|
|
|
23281
23435
|
var onTokenExpired = react.useContext(BunnyContext).onTokenExpired;
|
|
23282
23436
|
var handleAllErrorFormats = common.useAllErrorFormats(onTokenExpired);
|
|
23283
23437
|
var showSuccessNotification = common.useSuccessNotification();
|
|
23284
|
-
|
|
23438
|
+
var entityId = useCurrentUserData().entityId;
|
|
23439
|
+
return (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile || hideBillingDetailsForm ? 'bunny-w-full' : 'bunny-w-1/2 bunny-pt-4', " bunny-flex bunny-justify-center") }, { children: jsxRuntime.jsx(PaymentForm, { entityId: entityId, onFail: function (error) {
|
|
23285
23440
|
handleAllErrorFormats(error);
|
|
23286
23441
|
}, onSavePaymentMethod: function () {
|
|
23287
23442
|
showSuccessNotification('Your payment method has been saved');
|