@bunnyapp/components 1.0.62-beta.0 → 1.0.62-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +209 -142
- package/dist/cjs/src/components/Subscriptions/TieredDisplayDropdown.d.ts +8 -0
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +3 -3
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +1 -1
- package/dist/cjs/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +7 -4
- package/dist/cjs/src/utils/stringUtils.d.ts +1 -0
- package/dist/esm/index.js +211 -144
- package/dist/esm/src/components/Subscriptions/TieredDisplayDropdown.d.ts +8 -0
- package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionChargeTotal.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/SubscriptionChargeUnitPrice.d.ts +3 -3
- package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardDesktop/SubscriptionCardDesktop.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionCardMobile/SubscriptionCardMobile.d.ts +1 -1
- package/dist/esm/src/components/Subscriptions/subscriptionsList/subscriptionUtils.d.ts +7 -4
- package/dist/esm/src/utils/stringUtils.d.ts +1 -0
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -171,7 +171,7 @@ var BrandContext = react.createContext({
|
|
|
171
171
|
});
|
|
172
172
|
|
|
173
173
|
// This will be replaced at build time by rollup-plugin-replace
|
|
174
|
-
var PACKAGE_VERSION = '1.0.62-beta.
|
|
174
|
+
var PACKAGE_VERSION = '1.0.62-beta.1';
|
|
175
175
|
var createRequestHeaders = function (token) {
|
|
176
176
|
var _a;
|
|
177
177
|
var bearerToken = token ? "Bearer ".concat(token) : null;
|
|
@@ -408,7 +408,7 @@ function useToken() {
|
|
|
408
408
|
return overrideToken || tokenFromContext;
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
-
var MarkupContainer = defaultStyled.div(templateObject_1$
|
|
411
|
+
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"])));
|
|
412
412
|
var InvoiceQuoteView = function (_a) {
|
|
413
413
|
var children = _a.children, formattedInvoice = _a.formattedInvoice, html = _a.html, backButtonName = _a.backButtonName, onBackButtonClick = _a.onBackButtonClick, onDownloadError = _a.onDownloadError;
|
|
414
414
|
var downloadFile = useDownloadFile(formattedInvoice === null || formattedInvoice === void 0 ? void 0 : formattedInvoice.id, onDownloadError);
|
|
@@ -426,7 +426,7 @@ var InvoiceQuoteView = function (_a) {
|
|
|
426
426
|
minWidth: '750px',
|
|
427
427
|
} }, { children: [jsxRuntime.jsx(interweave.Markup, { content: html }), children] })))] })));
|
|
428
428
|
};
|
|
429
|
-
var templateObject_1$
|
|
429
|
+
var templateObject_1$c;
|
|
430
430
|
|
|
431
431
|
var fetchPDF = function (apiHost, documentUuid, documentType, token) { return __awaiter(void 0, void 0, void 0, function () {
|
|
432
432
|
var response;
|
|
@@ -18361,7 +18361,7 @@ var Visa = function (_a) {
|
|
|
18361
18361
|
return (jsxRuntime.jsxs("svg", __assign({ className: className, width: "70", height: "48", viewBox: "0 0 70 48", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("rect", { x: "0.5", y: "0.5", width: "69", height: "47", rx: "5.5", fill: "white", stroke: "#D9D9D9" }), jsxRuntime.jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M21.2505 32.5165H17.0099L13.8299 20.3847C13.679 19.8267 13.3585 19.3333 12.8871 19.1008C11.7106 18.5165 10.4142 18.0514 9 17.8169V17.3498H15.8313C16.7742 17.3498 17.4813 18.0514 17.5991 18.8663L19.2491 27.6173L23.4877 17.3498H27.6104L21.2505 32.5165ZM29.9675 32.5165H25.9626L29.2604 17.3498H33.2653L29.9675 32.5165ZM38.4467 21.5514C38.5646 20.7346 39.2717 20.2675 40.0967 20.2675C41.3931 20.1502 42.8052 20.3848 43.9838 20.9671L44.6909 17.7016C43.5123 17.2345 42.216 17 41.0395 17C37.1524 17 34.3239 19.1008 34.3239 22.0165C34.3239 24.2346 36.3274 25.3992 37.7417 26.1008C39.2717 26.8004 39.861 27.2675 39.7431 27.9671C39.7431 29.0165 38.5646 29.4836 37.3881 29.4836C35.9739 29.4836 34.5596 29.1338 33.2653 28.5494L32.5582 31.8169C33.9724 32.3992 35.5025 32.6338 36.9167 32.6338C41.2752 32.749 43.9838 30.6502 43.9838 27.5C43.9838 23.5329 38.4467 23.3004 38.4467 21.5514ZM58 32.5165L54.82 17.3498H51.4044C50.6972 17.3498 49.9901 17.8169 49.7544 18.5165L43.8659 32.5165H47.9887L48.8116 30.3004H53.8772L54.3486 32.5165H58ZM51.9936 21.4342L53.1701 27.1502H49.8723L51.9936 21.4342Z", fill: "#172B85" })] })));
|
|
18362
18362
|
};
|
|
18363
18363
|
|
|
18364
|
-
var Text$
|
|
18364
|
+
var Text$q = antd.Typography.Text;
|
|
18365
18365
|
var MiniCreditCard = function (_a) {
|
|
18366
18366
|
var className = _a.className, buttons = _a.buttons, _b = _a.hideDropdownMenu, hideDropdownMenu = _b === void 0 ? false : _b, _c = _a.hideDefaultTag, hideDefaultTag = _c === void 0 ? false : _c, onClickRemove = _a.onClickRemove, paymentMethodData = _a.paymentMethodData, onClickSetDefault = _a.onClickSetDefault, id = _a.id;
|
|
18367
18367
|
var darkMode = react.useContext(BunnyContext).darkMode;
|
|
@@ -18372,7 +18372,7 @@ var MiniCreditCard = function (_a) {
|
|
|
18372
18372
|
return darkMode ? 'var(--row-background-alternate)' : 'bg-slate-50';
|
|
18373
18373
|
}, [darkMode]);
|
|
18374
18374
|
var isDefault = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.isDefault;
|
|
18375
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ".concat(backgroundColor, " bunny-").concat(borderColor, " bunny-rounded-md bunny-border ").concat(className), id: id }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Issuer, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Identifier, { paymentMethodData: paymentMethodData }), !hideDefaultTag && (jsxRuntime.jsx("div", { children: isDefault ? (jsxRuntime.jsx(antd.Tag, __assign({ bordered: false, color: "blue" }, { children: "Default" }))) : null }))] })) })), buttons ? (buttons) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideDropdownMenu && (jsxRuntime.jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: "credit-card-dropdown-".concat(paymentMethodData.id) })) }))] })) : (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center" }, { children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$
|
|
18375
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-row bunny-justify-between bunny-items-center bunny-p-1 bunny-px-3 bunny-border-solid ".concat(backgroundColor, " bunny-").concat(borderColor, " bunny-rounded-md bunny-border ").concat(className), id: id }, { children: paymentMethodData ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-4" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2 bunny-space-between bunny-w-full" }, { children: [jsxRuntime.jsx(CardImage, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Issuer, { paymentMethodData: paymentMethodData }), jsxRuntime.jsx(Identifier, { paymentMethodData: paymentMethodData }), !hideDefaultTag && (jsxRuntime.jsx("div", { children: isDefault ? (jsxRuntime.jsx(antd.Tag, __assign({ bordered: false, color: "blue" }, { children: "Default" }))) : null }))] })) })), buttons ? (buttons) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hideDropdownMenu && (jsxRuntime.jsx(DropdownMenu, { setDefault: onClickSetDefault, remove: onClickRemove, isDefault: isDefault !== null && isDefault !== void 0 ? isDefault : false, id: "credit-card-dropdown-".concat(paymentMethodData.id) })) }))] })) : (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-items-center justify-between w-full" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-row bunny-gap-2 bunny-items-center" }, { children: [jsxRuntime.jsx(icons.CreditCardOutlined, {}), jsxRuntime.jsx(Text$q, __assign({ className: "bunny-text-slate-400", style: { fontSize: '12px' } }, { children: "No payment methods" }))] })), jsxRuntime.jsx(antd.Button, { disabled: true, type: "link" }), buttons] }))) })));
|
|
18376
18376
|
};
|
|
18377
18377
|
var Identifier = function (_a) {
|
|
18378
18378
|
var _b, _c, _d;
|
|
@@ -18381,9 +18381,9 @@ var Identifier = function (_a) {
|
|
|
18381
18381
|
return null;
|
|
18382
18382
|
}
|
|
18383
18383
|
if (((_c = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _c === void 0 ? void 0 : _c.type) === 'cashapp') {
|
|
18384
|
-
return jsxRuntime.jsx(Text$
|
|
18384
|
+
return jsxRuntime.jsx(Text$q, { children: "Cashapp" });
|
|
18385
18385
|
}
|
|
18386
|
-
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$
|
|
18386
|
+
return (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(Text$q, __assign({ className: "relative -top-0.5" }, { children: "****" })), jsxRuntime.jsx(Text$q, { children: (_d = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _d === void 0 ? void 0 : _d.identifier })] }));
|
|
18387
18387
|
};
|
|
18388
18388
|
var Issuer = function (_a) {
|
|
18389
18389
|
var _b;
|
|
@@ -18392,7 +18392,7 @@ var Issuer = function (_a) {
|
|
|
18392
18392
|
var issuer = (_b = paymentMethodData === null || paymentMethodData === void 0 ? void 0 : paymentMethodData.metadata) === null || _b === void 0 ? void 0 : _b.issuer;
|
|
18393
18393
|
if (issuer.length == 0 || list.includes(issuer.toLowerCase()))
|
|
18394
18394
|
return null;
|
|
18395
|
-
return jsxRuntime.jsx(Text$
|
|
18395
|
+
return jsxRuntime.jsx(Text$q, { children: lodashExports.capitalize(issuer) });
|
|
18396
18396
|
};
|
|
18397
18397
|
var DropdownMenu = function (_a) {
|
|
18398
18398
|
var setDefault = _a.setDefault, remove = _a.remove, isDefault = _a.isDefault, id = _a.id;
|
|
@@ -18683,7 +18683,7 @@ function useSave$1(_a) {
|
|
|
18683
18683
|
return { save: save, isSaving: isSaving };
|
|
18684
18684
|
}
|
|
18685
18685
|
|
|
18686
|
-
var Text$
|
|
18686
|
+
var Text$p = antd.Typography.Text;
|
|
18687
18687
|
var TEST_CARD = '4242424242424242';
|
|
18688
18688
|
var DemoPayForm = function (_a) {
|
|
18689
18689
|
var onFail = _a.onFail, onSavePaymentMethod = _a.onSavePaymentMethod, plugin = _a.plugin;
|
|
@@ -18745,16 +18745,16 @@ var DemoPayForm = function (_a) {
|
|
|
18745
18745
|
var onCardCvcChange = function (cvc) {
|
|
18746
18746
|
setCardDetails(__assign(__assign({}, cardDetails), { cvc: cvc }));
|
|
18747
18747
|
};
|
|
18748
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx(Text$
|
|
18748
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [jsxRuntime.jsxs(StyledInputs, __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2", darkMode: darkMode !== null && darkMode !== void 0 ? darkMode : false }, { children: [jsxRuntime.jsx(DemoPayCardNumber, { onChange: onCardNumberChange, value: cardDetails.number }), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-2" }, { children: [jsxRuntime.jsx(DemoPayExpiry, { onChange: onCardExpiryChange, value: cardDetails.expiry }), jsxRuntime.jsx(DemoPayCardCvc, { onChange: onCardCvcChange, value: cardDetails.cvc })] }))] })), jsxRuntime.jsx(Text$p, { children: "DemoPay is for testing only." }), jsxRuntime.jsx(SavePaymentMethodFooter, { isSaving: isSaving, onSave: onSave })] })));
|
|
18749
18749
|
};
|
|
18750
|
-
var StyledInputs = defaultStyled.div(templateObject_1$
|
|
18750
|
+
var StyledInputs = defaultStyled.div(templateObject_1$b || (templateObject_1$b = __makeTemplateObject(["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"], ["\n .ant-input {\n background-color: ", " !important;\n }\n .ant-input:not(:focus) {\n border-color: ", " !important;\n }\n"])), function (_a) {
|
|
18751
18751
|
var darkMode = _a.darkMode;
|
|
18752
18752
|
return darkMode ? 'var(--row-background-dark)' : 'white';
|
|
18753
18753
|
}, function (_a) {
|
|
18754
18754
|
var darkMode = _a.darkMode;
|
|
18755
18755
|
return darkMode ? common.GRAY_500 : common.GRAY_200;
|
|
18756
18756
|
});
|
|
18757
|
-
var templateObject_1$
|
|
18757
|
+
var templateObject_1$b;
|
|
18758
18758
|
|
|
18759
18759
|
function useSave(_a) {
|
|
18760
18760
|
var _this = this;
|
|
@@ -18897,7 +18897,7 @@ var CardIcon = function (_a) {
|
|
|
18897
18897
|
return (jsxRuntime.jsxs("svg", __assign({ className: className, width: "18", height: "18", viewBox: "0 0 18 18", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, { children: [jsxRuntime.jsx("path", { d: "M15 3.75H3C2.17157 3.75 1.5 4.42157 1.5 5.25V12.75C1.5 13.5784 2.17157 14.25 3 14.25H15C15.8284 14.25 16.5 13.5784 16.5 12.75V5.25C16.5 4.42157 15.8284 3.75 15 3.75Z", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), jsxRuntime.jsx("path", { d: "M1.5 7.5H16.5", stroke: common.SLATE_400, strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] })));
|
|
18898
18898
|
};
|
|
18899
18899
|
|
|
18900
|
-
var Text$
|
|
18900
|
+
var Text$o = antd.Typography.Text;
|
|
18901
18901
|
var PaymentMethodSelector = function (_a) {
|
|
18902
18902
|
var paymentMethodAllowedPlugins = _a.paymentMethodAllowedPlugins, onSelect = _a.onSelect, value = _a.value;
|
|
18903
18903
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: paymentMethodAllowedPlugins === null || paymentMethodAllowedPlugins === void 0 ? void 0 : paymentMethodAllowedPlugins.map(function (plugin, index) { return (jsxRuntime.jsx(PaymentOption, { name: plugin.name, onClick: onSelect, paymentPlugin: plugin, selected: (value === null || value === void 0 ? void 0 : value.id) === plugin.id }, index)); }) })));
|
|
@@ -18910,9 +18910,9 @@ var PaymentOption = function (_a) {
|
|
|
18910
18910
|
var isCard = name === null || name === void 0 ? void 0 : name.toLowerCase().includes('card');
|
|
18911
18911
|
return (jsxRuntime.jsxs(PaymentOptionContainer, __assign({ "$brandColor": brandColor, "$selected": selected, className: "bunny-flex bunny-justify-between bunny-items-center bunny-cursor-pointer bunny-py-2 bunny-rounded bunny-border-solid ".concat(darkMode
|
|
18912
18912
|
? "var(--row-background-dark) border-gray-500"
|
|
18913
|
-
: 'bunny-bg-slate-50 bunny-border-slate-200', " bunny-border"), onClick: function () { return onClick(paymentPlugin); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsxRuntime.jsx(Text$
|
|
18913
|
+
: 'bunny-bg-slate-50 bunny-border-slate-200', " bunny-border"), onClick: function () { return onClick(paymentPlugin); } }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-gap-2 bunny-items-center bunny-pl-4" }, { children: [jsxRuntime.jsx(antd.Checkbox, { checked: selected, className: darkMode ? 'border-gray-400' : '' }), jsxRuntime.jsx(Text$o, { children: name })] })), isAch ? (jsxRuntime.jsx(icons.BankOutlined, { className: "bunny-pr-4" })) : isCard ? (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" })) : (jsxRuntime.jsx(CardIcon, { className: "bunny-pr-4" }))] })));
|
|
18914
18914
|
};
|
|
18915
|
-
var PaymentOptionContainer = defaultStyled.div(templateObject_1$
|
|
18915
|
+
var PaymentOptionContainer = defaultStyled.div(templateObject_1$a || (templateObject_1$a = __makeTemplateObject(["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"], ["\n transition: border 0.3s ease;\n\n ", "\n\n &:hover {\n border-color: ", ";\n }\n"])), function (_a) {
|
|
18916
18916
|
var $brandColor = _a.$brandColor, $selected = _a.$selected;
|
|
18917
18917
|
return $selected &&
|
|
18918
18918
|
"\n border-color: ".concat($brandColor, ";\n ");
|
|
@@ -18920,7 +18920,7 @@ var PaymentOptionContainer = defaultStyled.div(templateObject_1$9 || (templateOb
|
|
|
18920
18920
|
var $brandColor = _a.$brandColor;
|
|
18921
18921
|
return $brandColor;
|
|
18922
18922
|
});
|
|
18923
|
-
var templateObject_1$
|
|
18923
|
+
var templateObject_1$a;
|
|
18924
18924
|
|
|
18925
18925
|
function useRemovePaymentMethod(paymentPlugins, apiHost, token, accountId, onRemovePaymentMethod, onError) {
|
|
18926
18926
|
var _this = this;
|
|
@@ -19473,11 +19473,11 @@ var PandadocPollingModal = function (_a) {
|
|
|
19473
19473
|
return (jsxRuntime.jsxs(antd.Modal, __assign({ title: "Uploading quote to Pandadoc", open: isVisible, closable: false, footer: null }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-py-4 bunny-text-center" }, { children: ["This may take a few seconds", ".".repeat(numberOfPolls)] })), jsxRuntime.jsx("div", __assign({ className: "bunny-text-center" }, { children: infoMessage }))] })));
|
|
19474
19474
|
};
|
|
19475
19475
|
|
|
19476
|
-
var ModalOverrideBrandStylings = defaultStyled(antd.Modal)(templateObject_1$
|
|
19476
|
+
var ModalOverrideBrandStylings = defaultStyled(antd.Modal)(templateObject_1$9 || (templateObject_1$9 = __makeTemplateObject(["\n .ant-modal-content {\n border-radius: 0.75rem;\n overflow: hidden;\n padding: 0 !important;\n }\n\n .ant-modal-header {\n border-bottom: none;\n padding: 1.5rem 1.5rem 0;\n margin: 0 !important;\n }\n .ant-modal-body {\n padding: 1rem 1.5rem 1.5rem;\n }\n .ant-modal-footer {\n border-top: none;\n padding: 0 1.5rem 1.5rem;\n margin: 0 !important;\n }\n"], ["\n .ant-modal-content {\n border-radius: 0.75rem;\n overflow: hidden;\n padding: 0 !important;\n }\n\n .ant-modal-header {\n border-bottom: none;\n padding: 1.5rem 1.5rem 0;\n margin: 0 !important;\n }\n .ant-modal-body {\n padding: 1rem 1.5rem 1.5rem;\n }\n .ant-modal-footer {\n border-top: none;\n padding: 0 1.5rem 1.5rem;\n margin: 0 !important;\n }\n"])));
|
|
19477
19477
|
var StyledModal$1 = function (props) {
|
|
19478
19478
|
return jsxRuntime.jsx(ModalOverrideBrandStylings, __assign({ closable: false }, props));
|
|
19479
19479
|
};
|
|
19480
|
-
var templateObject_1$
|
|
19480
|
+
var templateObject_1$9;
|
|
19481
19481
|
|
|
19482
19482
|
var useFocusFirstInput = function (_a) {
|
|
19483
19483
|
var firstInputRef = _a.firstInputRef, isVisible = _a.isVisible;
|
|
@@ -19546,8 +19546,8 @@ var PaymentHoldModal = function (_a) {
|
|
|
19546
19546
|
} }) }))] })));
|
|
19547
19547
|
};
|
|
19548
19548
|
|
|
19549
|
-
var Text$
|
|
19550
|
-
defaultStyled.div(templateObject_1$
|
|
19549
|
+
var Text$n = antd.Typography.Text;
|
|
19550
|
+
defaultStyled.div(templateObject_1$8 || (templateObject_1$8 = __makeTemplateObject(["\n span {\n width: 100%;\n }\n"], ["\n span {\n width: 100%;\n }\n"])));
|
|
19551
19551
|
function Quote(_a) {
|
|
19552
19552
|
var id = _a.id, invoiceQuoteViewComponent = _a.invoiceQuoteViewComponent, onInvoiceDownloadError = _a.onInvoiceDownloadError, onPaymentSuccess = _a.onPaymentSuccess, _b = _a.shadow, shadow = _b === void 0 ? 'shadow-md' : _b, className = _a.className, _c = _a.hideDownloadButton, hideDownloadButton = _c === void 0 ? false : _c, onQuoteLoaded = _a.onQuoteLoaded;
|
|
19553
19553
|
return (jsxRuntime.jsx(InvoiceQuoteContext.Provider, __assign({ value: {
|
|
@@ -19652,7 +19652,7 @@ function QuoteButtons(_a) {
|
|
|
19652
19652
|
var isExpired = useIsExpired(formattedQuote === null || formattedQuote === void 0 ? void 0 : formattedQuote.expiresAt);
|
|
19653
19653
|
return (jsxRuntime.jsxs("div", __assign({ className: "flex flex-row justify-end items-center gap-4", id: "acceptance", style: {
|
|
19654
19654
|
color: entityBranding.secondaryColor,
|
|
19655
|
-
} }, { children: [isAccepted && formattedQuote.acceptedAt ? (jsxRuntime.jsx(Text$
|
|
19655
|
+
} }, { 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 ? 'Quote is expired' : 'Accept quote' }))) : null }))] })))] })));
|
|
19656
19656
|
}
|
|
19657
19657
|
function PaymentHoldDisplay(_a) {
|
|
19658
19658
|
var _b, _c, _d, _e;
|
|
@@ -19664,7 +19664,7 @@ function PaymentHoldDisplay(_a) {
|
|
|
19664
19664
|
var expirationDate = paymentHold.expiresAt ? common.formatDate(paymentHold.expiresAt) : 'N/A';
|
|
19665
19665
|
return (jsxRuntime.jsx(antd.Tooltip, __assign({ title: "".concat(formattedAmount, " will be charged to ").concat(paymentMethod, " once the quote is accepted. Hold will be released on ").concat(expirationDate, " if not accepted.") }, { children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(CustomizedTag, __assign({ color: 'orange', className: "rounded-md", style: { padding: 6 } }, { children: ["Hold of ", formattedAmount, " on ****", paymentMethod] })) }) })));
|
|
19666
19666
|
}
|
|
19667
|
-
var templateObject_1$
|
|
19667
|
+
var templateObject_1$8;
|
|
19668
19668
|
|
|
19669
19669
|
var QUOTES_QUERY = function (filter) { return "\n query quotes {\n quotes ".concat(filter ? "(".concat(filter, ")") : '', " {\n pageInfo {\n startCursor\n endCursor\n hasNextPage\n hasPreviousPage\n }\n nodes {\n id\n name\n account {\n name\n id\n }\n applicationDate\n state\n createdAt\n expiresAt\n currencyId\n amount\n number\n }\n }\n }"); };
|
|
19670
19670
|
var getQuotes = function (_a) {
|
|
@@ -19751,10 +19751,10 @@ var getColor = function (state) {
|
|
|
19751
19751
|
}
|
|
19752
19752
|
};
|
|
19753
19753
|
|
|
19754
|
-
var Text$
|
|
19754
|
+
var Text$m = antd.Typography.Text;
|
|
19755
19755
|
var TransactionDate = function (_a) {
|
|
19756
19756
|
var date = _a.date;
|
|
19757
|
-
return jsxRuntime.jsx(Text$
|
|
19757
|
+
return jsxRuntime.jsx(Text$m, __assign({ className: "bunny-text-sm" }, { children: common.formatDate(date) }));
|
|
19758
19758
|
};
|
|
19759
19759
|
|
|
19760
19760
|
var ArrowDownToLine = function (_a) {
|
|
@@ -19784,20 +19784,20 @@ var TransactionGridCell = defaultStyled.div.withConfig({
|
|
|
19784
19784
|
shouldForwardProp: function (prop) {
|
|
19785
19785
|
return !["gridColumn", "padding", "right"].includes(prop);
|
|
19786
19786
|
},
|
|
19787
|
-
})(templateObject_1$
|
|
19787
|
+
})(templateObject_1$7 || (templateObject_1$7 = __makeTemplateObject(["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"], ["\n ", "\n\n display: flex;\n align-items: center;\n justify-content: ", ";\n\n text-align: ", ";\n white-space: nowrap;\n font-size: 14px;\n color: ", ";\n\n background-color: inherit;\n\n padding: 1rem;\n min-width: 48px;\n"])), function (props) { return props.gridColumn && "grid-column: ".concat(props.gridColumn, ";"); }, function (props) {
|
|
19788
19788
|
return props.right ? "flex-end" : "flex-start";
|
|
19789
19789
|
}, function (props) {
|
|
19790
19790
|
return props.right ? "right" : "left";
|
|
19791
19791
|
}, common.SLATE_600);
|
|
19792
|
-
var templateObject_1$
|
|
19792
|
+
var templateObject_1$7;
|
|
19793
19793
|
|
|
19794
|
-
var Text$
|
|
19794
|
+
var Text$l = antd.Typography.Text;
|
|
19795
19795
|
var TransactionsEmptyState = function () {
|
|
19796
19796
|
var noTransactionsMessage = react.useContext(TransactionsListContext).noTransactionsMessage;
|
|
19797
|
-
return (jsxRuntime.jsx(Text$
|
|
19797
|
+
return (jsxRuntime.jsx(Text$l, __assign({ className: "bunny-flex bunny-justify-center bunny-p-4 bunny-text-base" }, { children: noTransactionsMessage || "There are no transactions" })));
|
|
19798
19798
|
};
|
|
19799
19799
|
|
|
19800
|
-
var Text$
|
|
19800
|
+
var Text$k = antd.Typography.Text;
|
|
19801
19801
|
var isInvoice = function (transaction) {
|
|
19802
19802
|
return transaction.kind === "INVOICE";
|
|
19803
19803
|
};
|
|
@@ -19809,7 +19809,7 @@ var TransactionRowTitle = function (_a) {
|
|
|
19809
19809
|
if (!isInvoice(transaction) && !isQuote(transaction)) {
|
|
19810
19810
|
return jsxRuntime.jsx(jsxRuntime.Fragment, {});
|
|
19811
19811
|
}
|
|
19812
|
-
return (jsxRuntime.jsx(Text$
|
|
19812
|
+
return (jsxRuntime.jsx(Text$k, __assign({ className: "bunny-text-slate-400", style: { fontSize: "11px" } }, { children: transaction.transactionable.number })));
|
|
19813
19813
|
};
|
|
19814
19814
|
|
|
19815
19815
|
function transactionDateToDisplay(transaction, transactionDateType) {
|
|
@@ -19828,7 +19828,7 @@ function transactionDateToDisplay(transaction, transactionDateType) {
|
|
|
19828
19828
|
}
|
|
19829
19829
|
}
|
|
19830
19830
|
|
|
19831
|
-
var Text$
|
|
19831
|
+
var Text$j = antd.Typography.Text;
|
|
19832
19832
|
var TransactionsListDesktop = function (_a) {
|
|
19833
19833
|
var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
|
|
19834
19834
|
var _b = react.useContext(TransactionsListContext), columns = _b.columns, transactionDateType = _b.transactionDateType;
|
|
@@ -19857,11 +19857,11 @@ var TransactionsListDesktop = function (_a) {
|
|
|
19857
19857
|
!showState &&
|
|
19858
19858
|
!showAmount &&
|
|
19859
19859
|
!showDownload &&
|
|
19860
|
-
!showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$
|
|
19860
|
+
!showAccountName && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(Text$j, { children: "No columns selected" }) })), showDate && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) }) }))), showTitle && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsxs(TransactionGridCell, __assign({ right: false, className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(Text$j, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })) })), showAccountName && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: false }, { children: jsxRuntime.jsx(Text$j, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }) }))), !showDate && !showTitle && !showAccountName && (jsxRuntime.jsx(TransactionGridCell, { right: false })), showDownload && (jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })), showState ? (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(StateTag, { state: transaction.state }) }))) : null, showAmount && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(Text$j, { children: common.formatCurrency(((_b = transaction === null || transaction === void 0 ? void 0 : transaction.transactionable) === null || _b === void 0 ? void 0 : _b.amount) || transaction.amount, transaction.currencyId) }) })))] }), index));
|
|
19861
19861
|
}) }));
|
|
19862
19862
|
};
|
|
19863
19863
|
|
|
19864
|
-
var Text$
|
|
19864
|
+
var Text$i = antd.Typography.Text;
|
|
19865
19865
|
var TransactionsListMobile = function (_a) {
|
|
19866
19866
|
var transactions = _a.transactions, onTransactionClick = _a.onTransactionClick;
|
|
19867
19867
|
var _b = react.useContext(TransactionsListContext), columns = _b.columns, transactionDateType = _b.transactionDateType;
|
|
@@ -19884,12 +19884,12 @@ var TransactionsListMobile = function (_a) {
|
|
|
19884
19884
|
backgroundColor: index % 2 === 0
|
|
19885
19885
|
? "var(--row-background".concat(darkMode ? "-dark" : "", ")")
|
|
19886
19886
|
: "var(--row-background-alternate".concat(darkMode ? "-dark" : "", ")"),
|
|
19887
|
-
} }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [(showTitle || showState) && (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$
|
|
19887
|
+
} }, { children: [jsxRuntime.jsx(TransactionGridCell, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [(showTitle || showState) && (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [showTitle && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Text$i, { children: lodashExports.capitalize(transaction.kind.toLowerCase()) }), jsxRuntime.jsx(TransactionRowTitle, { transaction: transaction })] })), showState && jsxRuntime.jsx(StateTag, { state: transaction.state })] }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [showAccountName && jsxRuntime.jsx(Text$i, { children: (_a = transaction.account) === null || _a === void 0 ? void 0 : _a.name }), showAccountName && showDate && jsxRuntime.jsx(Text$i, { children: "\u00B7" }), showDate && (jsxRuntime.jsx(TransactionDate, { date: transactionDateToDisplay(transaction, transactionDateType) })), showDate && showAmount && jsxRuntime.jsx(Text$i, { children: "\u00B7" }), showAmount && (jsxRuntime.jsx(Text$i, { children: common.formatCurrency(transaction.transactionable.amount ||
|
|
19888
19888
|
transaction.amount, transaction.currencyId) }))] }))] })) }), showDownload && (jsxRuntime.jsx(TransactionGridCell, __assign({ right: true }, { children: jsxRuntime.jsx(TransactionDownload, { transaction: transaction, token: token, apiHost: apiHost }) })))] }), index));
|
|
19889
19889
|
}) }));
|
|
19890
19890
|
};
|
|
19891
19891
|
|
|
19892
|
-
var Text$
|
|
19892
|
+
var Text$h = antd.Typography.Text;
|
|
19893
19893
|
var DISPLAY_WIDTH = 1200;
|
|
19894
19894
|
function Transactions(_a) {
|
|
19895
19895
|
var transactionComponent = _a.transactionComponent, _b = _a.showSearchBar, showSearchBar = _b === void 0 ? true : _b, _c = _a.showTitle, showTitle = _c === void 0 ? true : _c, _d = _a.title, title = _d === void 0 ? "Past transactions" : _d, _e = _a.columns, columns = _e === void 0 ? ["date", "title", "state", "amount", "download"] : _e, className = _a.className, _f = _a.shadow, shadow = _f === void 0 ? "shadow-md" : _f, searchBarClassName = _a.searchBarClassName, _g = _a.useModal, useModal = _g === void 0 ? false : _g, onTransactionClick = _a.onTransactionClick, _h = _a.suppressTransactionDisplay, suppressTransactionDisplay = _h === void 0 ? false : _h, _j = _a.kindsToShow, kindsToShow = _j === void 0 ? [
|
|
@@ -20002,7 +20002,7 @@ function TransactionsDisplay(_a) {
|
|
|
20002
20002
|
onTransactionDisplayClose === null || onTransactionDisplayClose === void 0 ? void 0 : onTransactionDisplayClose(selectedTransaction);
|
|
20003
20003
|
setDrawerOpen(false);
|
|
20004
20004
|
}
|
|
20005
|
-
return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-full bunny-shadow-padding-xb bunny-gap-2 ".concat(isMobile ? "bunny-overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? "bunny-flex-col bunny-gap-1" : "bunny-flex-row bunny-items-center", " bunny-justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$
|
|
20005
|
+
return (jsxRuntime.jsxs("div", __assign({ style: style }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-w-full bunny-shadow-padding-xb bunny-gap-2 ".concat(isMobile ? "bunny-overflow-hidden" : "", " ").concat(className) }, { children: [showTitle || showSearchBar ? (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex ".concat(isMobile ? "bunny-flex-col bunny-gap-1" : "bunny-flex-row bunny-items-center", " bunny-justify-between") }, { children: [showTitle ? (jsxRuntime.jsx(Text$h, __assign({ className: "bunny-shrink-0 bunny-font-medium", style: { color: darkMode ? undefined : secondaryColor } }, { children: title }))) : (jsxRuntime.jsx("div", {}) // Empty div so justify-between works
|
|
20006
20006
|
), showSearchBar && (jsxRuntime.jsx("div", __assign({ className: "".concat(isMobile ? "bunny-w-full" : "") }, { children: jsxRuntime.jsx(antd.Input, { className: searchBarClassName
|
|
20007
20007
|
? searchBarClassName
|
|
20008
20008
|
: "border border-slate-200", onChange: function (e) {
|
|
@@ -20270,7 +20270,7 @@ var BunnyFooterIcon = function (_a) {
|
|
|
20270
20270
|
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" }) })) })] })));
|
|
20271
20271
|
};
|
|
20272
20272
|
|
|
20273
|
-
var Text$
|
|
20273
|
+
var Text$g = antd.Typography.Text;
|
|
20274
20274
|
var Footer = function (_a) {
|
|
20275
20275
|
var className = _a.className;
|
|
20276
20276
|
var _b = useCurrentUserData(), privacyUrl = _b.privacyUrl, termsUrl = _b.termsUrl;
|
|
@@ -20280,11 +20280,11 @@ var Footer = function (_a) {
|
|
|
20280
20280
|
var BunnyMarketingLink = function () {
|
|
20281
20281
|
var _a = react.useState(false), isHovered = _a[0], setIsHovered = _a[1];
|
|
20282
20282
|
var isMobile = common.useIsMobile();
|
|
20283
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-end bunny-justify-end ".concat(isMobile ? '' : 'grow') }, { children: jsxRuntime.jsx(StyledBunnyLink, __assign({ className: "bunny-flex bunny-items-end bunny-justify-end bunny-text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: [jsxRuntime.jsx(Text$
|
|
20283
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-end bunny-justify-end ".concat(isMobile ? '' : 'grow') }, { children: jsxRuntime.jsx(StyledBunnyLink, __assign({ className: "bunny-flex bunny-items-end bunny-justify-end bunny-text-slate-400", href: "https://bunny.com/", rel: "noopener noreferrer", target: "_blank" }, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center", onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } }, { children: [jsxRuntime.jsx(Text$g, __assign({ className: "bunny-text-xs bunny-text-slate-400" }, { children: "Powered by\u00A0" })), jsxRuntime.jsx("div", __assign({ style: { paddingTop: '5px' } }, { children: jsxRuntime.jsx(BunnyFooterIcon, { color: isHovered ? common.PRIMARY_COLOR : common.SLATE_400 }) }))] })) })) })));
|
|
20284
20284
|
};
|
|
20285
|
-
var StyedLink = styled__default["default"].a(templateObject_1$
|
|
20285
|
+
var StyedLink = styled__default["default"].a(templateObject_1$6 || (templateObject_1$6 = __makeTemplateObject(["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n text-decoration: none;\n font-size: 14px;\n"], ["\n color: ", ";\n transition: color 0.3s;\n &:hover {\n color: ", ";\n }\n text-decoration: none;\n font-size: 14px;\n"])), common.SLATE_400, common.SLATE_500);
|
|
20286
20286
|
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);
|
|
20287
|
-
var templateObject_1$
|
|
20287
|
+
var templateObject_1$6, templateObject_2$1;
|
|
20288
20288
|
|
|
20289
20289
|
var Title$1 = antd.Typography.Title;
|
|
20290
20290
|
function PaymentForms(_a) {
|
|
@@ -20305,18 +20305,18 @@ function InitialSignupForm(_a) {
|
|
|
20305
20305
|
] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Email" }) })), jsxRuntime.jsx(antd.Form.Item, __assign({ name: "accountName", rules: [{ required: true, message: 'Company name is required' }] }, { children: jsxRuntime.jsx(antd.Input, { placeholder: "Company name" }) })), 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" })) })] })) })));
|
|
20306
20306
|
}
|
|
20307
20307
|
|
|
20308
|
-
var Title = antd.Typography.Title, Text$
|
|
20308
|
+
var Title = antd.Typography.Title, Text$f = antd.Typography.Text;
|
|
20309
20309
|
function PaymentSuccessDisplay(_a) {
|
|
20310
20310
|
var amountPaid = _a.amountPaid, className = _a.className, companyName = _a.companyName, returnUrl = _a.returnUrl, style = _a.style, currencyId = _a.currencyId;
|
|
20311
|
-
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$
|
|
20311
|
+
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$f, __assign({ className: "bunny-text-slate-500 bunny-cursor-pointer bunny-underline", onClick: function () { return (window.location.href = returnUrl); } }, { children: ["Back to ", companyName] })))] })));
|
|
20312
20312
|
}
|
|
20313
20313
|
|
|
20314
|
-
var Text$
|
|
20314
|
+
var Text$e = antd.Typography.Text;
|
|
20315
20315
|
function PriceListDisplay(_a) {
|
|
20316
20316
|
var priceListData = _a.priceListData;
|
|
20317
20317
|
if (!priceListData)
|
|
20318
20318
|
return null;
|
|
20319
|
-
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$
|
|
20319
|
+
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$e, __assign({ className: "bunny-text-slate-500 bunny-font-bold bunny-text-lg" }, { children: [priceListData.product.name, " ", priceListData.name] })), jsxRuntime.jsxs(Text$e, __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$e, __assign({ style: { fontSize: '16px' }, className: "bunny-text-slate-500" }, { children: [priceListData.trialLengthDays, " day trial"] })), jsxRuntime.jsx(Text$e, __assign({ className: "bunny-text-slate-500", style: { fontSize: '12px' } }, { children: "You will not be charged until the last day of the trial." }))] }))) : null] })));
|
|
20320
20320
|
}
|
|
20321
20321
|
|
|
20322
20322
|
var showErrorNotification = common.useErrorNotification();
|
|
@@ -20484,14 +20484,14 @@ function Signup(_a) {
|
|
|
20484
20484
|
boxShadow: '-5px 0 20px 0 rgba(0, 0, 0, 0.05)',
|
|
20485
20485
|
} }, { 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: isLoadingQuote ? undefined : quote, handlePaymentSuccess: handlePaymentSuccess, handlePaymentFail: handlePaymentFail, handleSubmit: handleSubmit, proceedingToPayment: proceedingToPayment, accountId: accountId, overrideToken: portalSessionToken, customCheckoutFunction: accountSignupFunction }) }))) }))] })));
|
|
20486
20486
|
}
|
|
20487
|
-
var Text$
|
|
20487
|
+
var Text$d = antd.Typography.Text;
|
|
20488
20488
|
var CheckoutSummaryDivider = function () {
|
|
20489
20489
|
return (jsxRuntime.jsx("div", __assign({ className: "bunny-my-2" }, { children: jsxRuntime.jsx(antd.Divider, { className: "m-0" }) })));
|
|
20490
20490
|
};
|
|
20491
20491
|
var showSuccessNotification = common.useSuccessNotification();
|
|
20492
20492
|
function CheckoutSummary(_a) {
|
|
20493
20493
|
var quote = _a.quote, className = _a.className; _a.onAddCoupon; var priceListData = _a.priceListData; _a.isAddingCoupon;
|
|
20494
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "".concat(className, " bunny-space-y-4") }, { children: [jsxRuntime.jsxs(Text$
|
|
20494
|
+
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) {
|
|
20495
20495
|
return quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.map(function (charge) {
|
|
20496
20496
|
var multiplier = charge.kind === 'COUPON' ? -1 : 1;
|
|
20497
20497
|
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));
|
|
@@ -21310,7 +21310,7 @@ var BillingPeriodSelector = function (_a) {
|
|
|
21310
21310
|
};
|
|
21311
21311
|
var ProductRadioStyled = styled__default["default"].div.withConfig({
|
|
21312
21312
|
shouldForwardProp: function (prop) { return !["brandColor"].includes(prop); },
|
|
21313
|
-
})(templateObject_1$
|
|
21313
|
+
})(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked) {\n border-color: ", " !important;\n color: ", " !important;\n }\n"], ["\n .ant-radio-button-wrapper:not(.ant-radio-button-wrapper-checked) {\n border-color: ", " !important;\n color: ", " !important;\n }\n"])), function (props) {
|
|
21314
21314
|
return props.brandColor ? props.brandColor : "black";
|
|
21315
21315
|
}, function (props) {
|
|
21316
21316
|
return props.brandColor ? props.brandColor : "black";
|
|
@@ -21319,7 +21319,7 @@ var StyledRadioGroup = styled__default["default"].div(templateObject_2 || (templ
|
|
|
21319
21319
|
var $isMobile = _a.$isMobile;
|
|
21320
21320
|
return $isMobile ? "100%" : "min-content";
|
|
21321
21321
|
});
|
|
21322
|
-
var templateObject_1$
|
|
21322
|
+
var templateObject_1$5, templateObject_2;
|
|
21323
21323
|
|
|
21324
21324
|
var PriceListCardTitle = function (_a) {
|
|
21325
21325
|
var priceList = _a.priceList, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, trialRemainingDays = _a.trialRemainingDays;
|
|
@@ -21338,22 +21338,22 @@ var PriceListCardPrice = function (_a) {
|
|
|
21338
21338
|
: "Free" })));
|
|
21339
21339
|
};
|
|
21340
21340
|
|
|
21341
|
-
var Text$
|
|
21341
|
+
var Text$c = antd.Typography.Text;
|
|
21342
21342
|
var PriceListCardDescription = function (_a) {
|
|
21343
21343
|
var description = _a.description;
|
|
21344
21344
|
if (!description)
|
|
21345
21345
|
return null;
|
|
21346
|
-
return jsxRuntime.jsx(Text$
|
|
21346
|
+
return jsxRuntime.jsx(Text$c, __assign({ className: "bunny-text-center" }, { children: description }));
|
|
21347
21347
|
};
|
|
21348
21348
|
|
|
21349
|
-
var Text$
|
|
21349
|
+
var Text$b = antd.Typography.Text;
|
|
21350
21350
|
var PriceListCardPriceDescription = function (_a) {
|
|
21351
21351
|
var feature = _a.feature, priceList = _a.priceList;
|
|
21352
21352
|
var isMobile = common.useIsMobile();
|
|
21353
21353
|
var doesPlanHaveFlatFeeCharges = priceList.charges.some(function (charge) { return charge.pricingModel === common.PricingModel.FLAT && charge.basePrice > 0; });
|
|
21354
21354
|
if (priceList.periodMonths <= 0 || priceList.plan.pricingStyle !== common.PricingStyle.PRICED)
|
|
21355
21355
|
return null;
|
|
21356
|
-
return (jsxRuntime.jsx(Text$
|
|
21356
|
+
return (jsxRuntime.jsx(Text$b, __assign({ className: "bunny-text-center bunny-text-gray-900", style: {
|
|
21357
21357
|
fontSize: isMobile ? "13px" : "12px",
|
|
21358
21358
|
} }, { children: priceList.plan.pricingDescription
|
|
21359
21359
|
? priceList.plan.pricingDescription
|
|
@@ -21387,8 +21387,8 @@ var PriceListCardButton = function (_a) {
|
|
|
21387
21387
|
maxWidth: '240px',
|
|
21388
21388
|
}, type: isSelected ? 'primary' : 'default' }, { children: createButtonText() })) })) })));
|
|
21389
21389
|
};
|
|
21390
|
-
var StyledCardButton = styled__default["default"].div(templateObject_1$
|
|
21391
|
-
var templateObject_1$
|
|
21390
|
+
var StyledCardButton = styled__default["default"].div(templateObject_1$4 || (templateObject_1$4 = __makeTemplateObject(["\n .ant-btn-primary {\n border-color: transparent !important;\n }\n .ant-btn-primary:disabled {\n background: ", ";\n color: ", ";\n }\n"], ["\n .ant-btn-primary {\n border-color: transparent !important;\n }\n .ant-btn-primary:disabled {\n background: ", ";\n color: ", ";\n }\n"])), common.SLATE_200, common.SLATE_600);
|
|
21391
|
+
var templateObject_1$4;
|
|
21392
21392
|
|
|
21393
21393
|
var PriceListCardMobile = function (_a) {
|
|
21394
21394
|
var description = _a.description, disableOnClick = _a.disableOnClick, feature = _a.feature, isPriceListCurrentSubscription = _a.isPriceListCurrentSubscription, isSelected = _a.isSelected, onClick = _a.onClick, priceList = _a.priceList, subscriptionPlan = _a.subscriptionPlan, trialRemainingDays = _a.trialRemainingDays;
|
|
@@ -21459,13 +21459,13 @@ var PriceListCard = function (_a) {
|
|
|
21459
21459
|
return isMobile ? (jsxRuntime.jsx(PriceListCardMobile, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan })) : (jsxRuntime.jsx(PriceListCardDesktop, { description: description, disableOnClick: disableOnClick, feature: feature, isPriceListCurrentSubscription: isPriceListCurrentSubscription, isSelected: isSelected, onClick: onClick, priceList: priceList, trialRemainingDays: trialRemainingDays, subscriptionPlan: subscriptionPlan }));
|
|
21460
21460
|
};
|
|
21461
21461
|
|
|
21462
|
-
var Text$
|
|
21462
|
+
var Text$a = antd.Typography.Text;
|
|
21463
21463
|
var PriceListCardFeature = function (_a) {
|
|
21464
21464
|
var index = _a.index, planFeature = _a.planFeature;
|
|
21465
21465
|
var brandColor = react.useContext(BrandContext).brandColor;
|
|
21466
21466
|
if (planFeature.feature.kind === "GROUP")
|
|
21467
|
-
return jsxRuntime.jsx(Text$
|
|
21468
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), jsxRuntime.jsx(Text$
|
|
21467
|
+
return jsxRuntime.jsx(Text$a, __assign({ className: "bunny-font-medium bunny-base-text" }, { children: planFeature.name }));
|
|
21468
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2" }, { children: [jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }), jsxRuntime.jsx(Text$a, __assign({ className: "bunny-text-gray-600" }, { children: planFeature.feature.name }))] }), index));
|
|
21469
21469
|
};
|
|
21470
21470
|
|
|
21471
21471
|
var getAvailablePlansAndPriceLists = function (_a) {
|
|
@@ -21572,7 +21572,7 @@ var FeatureGridCell = function (_a) {
|
|
|
21572
21572
|
: {})) }, { children: children })));
|
|
21573
21573
|
};
|
|
21574
21574
|
|
|
21575
|
-
var Text$
|
|
21575
|
+
var Text$9 = antd.Typography.Text;
|
|
21576
21576
|
var PlanFeatures = function (_a) {
|
|
21577
21577
|
var _b;
|
|
21578
21578
|
var availablePlansArray = _a.availablePlansArray, selectedProduct = _a.selectedProduct, plansToDisplay = _a.plansToDisplay;
|
|
@@ -21611,14 +21611,14 @@ var PlanFeatures = function (_a) {
|
|
|
21611
21611
|
return (jsxRuntime.jsx(FeatureGridCell, { rowIndex: rowIndex, noBorder: !Boolean(doesHavePrevPlan) }, columnIndex));
|
|
21612
21612
|
if (isFeatureGroup)
|
|
21613
21613
|
return jsxRuntime.jsx(FeatureGridCell, { isFeatureGroup: true, rowIndex: rowIndex }, columnIndex);
|
|
21614
|
-
return (jsxRuntime.jsx(FeatureGridCell, __assign({ rowIndex: rowIndex }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-text-center" }, { children: planFeature ? ((planFeature === null || planFeature === void 0 ? void 0 : planFeature.value) ? (planFeature.value) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }))) : (jsxRuntime.jsx(Text$
|
|
21614
|
+
return (jsxRuntime.jsx(FeatureGridCell, __assign({ rowIndex: rowIndex }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-text-center" }, { children: planFeature ? ((planFeature === null || planFeature === void 0 ? void 0 : planFeature.value) ? (planFeature.value) : (jsxRuntime.jsx(CheckIcon, { backgroundColor: brandColor, size: "15px" }))) : (jsxRuntime.jsx(Text$9, __assign({ className: "bunny-text-gray" }, { children: "-" }))) })) }), columnIndex));
|
|
21615
21615
|
})] }), rowIndex));
|
|
21616
21616
|
}) }));
|
|
21617
21617
|
};
|
|
21618
21618
|
var FeatureTitle = function (_a) {
|
|
21619
21619
|
var _b;
|
|
21620
21620
|
var isFeatureGroup = _a.isFeatureGroup, feature = _a.feature;
|
|
21621
|
-
return (jsxRuntime.jsx(Text$
|
|
21621
|
+
return (jsxRuntime.jsx(Text$9, __assign({ className: " ".concat(isFeatureGroup ? 'bunny-text-slate-500 bunny-font-medium bunny-pt-4' : ''), style: __assign({}, (isFeatureGroup ? { fontSize: '11px' } : {})) }, { children: isFeatureGroup ? (_b = feature === null || feature === void 0 ? void 0 : feature.name) === null || _b === void 0 ? void 0 : _b.toUpperCase() : feature === null || feature === void 0 ? void 0 : feature.name })));
|
|
21622
21622
|
};
|
|
21623
21623
|
|
|
21624
21624
|
var PriceListGridDesktop = function (_a) {
|
|
@@ -21834,12 +21834,12 @@ var PlanPicker = function () {
|
|
|
21834
21834
|
return (jsxRuntime.jsx(PriceListSelector, { arePlanChangeOptionsLoading: arePlanChangeOptionsLoading, areSubscriptionsLoading: areSubscriptionsLoading, onChangePriceList: onChangePriceList, priceListChangeOptions: priceListChangeOptions, selectedPriceList: quotePreviewData === null || quotePreviewData === void 0 ? void 0 : quotePreviewData.priceList, subscriptions: subscriptions }));
|
|
21835
21835
|
};
|
|
21836
21836
|
|
|
21837
|
-
var Text$
|
|
21837
|
+
var Text$8 = antd.Typography.Text;
|
|
21838
21838
|
var PreviewModeAdvisary = function (_a) {
|
|
21839
21839
|
var isInPreviewMode = _a.isInPreviewMode;
|
|
21840
21840
|
if (!isInPreviewMode)
|
|
21841
21841
|
return null;
|
|
21842
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full bunny-rounded" }, { children: jsxRuntime.jsx(Text$
|
|
21842
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-justify-center bunny-w-full bunny-rounded" }, { children: jsxRuntime.jsx(Text$8, { children: "You are in preview mode. Products, plans and price lists are shown regardless of visibility settings." }) })));
|
|
21843
21843
|
};
|
|
21844
21844
|
|
|
21845
21845
|
var PlanManager = function (_a) {
|
|
@@ -21999,7 +21999,7 @@ var getFeatureUsage = function (_a) {
|
|
|
21999
21999
|
});
|
|
22000
22000
|
};
|
|
22001
22001
|
|
|
22002
|
-
var StyledModal = defaultStyled(antd.Modal)(templateObject_1$
|
|
22002
|
+
var StyledModal = defaultStyled(antd.Modal)(templateObject_1$3 || (templateObject_1$3 = __makeTemplateObject(["\n z-index: 2000;\n\n .ant-modal-content {\n overflow: hidden;\n padding: 0 !important;\n }\n .ant-modal-body {\n height: min-content;\n max-height: ", ";\n overflow: auto;\n display: flex;\n flex-direction: column;\n padding: 0;\n }\n .ant-modal-footer {\n padding: 0 1.5rem 1.5rem;\n }\n"], ["\n z-index: 2000;\n\n .ant-modal-content {\n overflow: hidden;\n padding: 0 !important;\n }\n .ant-modal-body {\n height: min-content;\n max-height: ", ";\n overflow: auto;\n display: flex;\n flex-direction: column;\n padding: 0;\n }\n .ant-modal-footer {\n padding: 0 1.5rem 1.5rem;\n }\n"])), common.MODAL_MAX_HEIGHT);
|
|
22003
22003
|
var HeaderModalWrapper = function (props) {
|
|
22004
22004
|
var children = props.children, description = props.description, title = props.title;
|
|
22005
22005
|
var modalProps = react.useMemo(function () {
|
|
@@ -22011,7 +22011,7 @@ var HeaderModalWrapper = function (props) {
|
|
|
22011
22011
|
width: "75%",
|
|
22012
22012
|
} }, { children: description })))] }))), children] })));
|
|
22013
22013
|
};
|
|
22014
|
-
var templateObject_1$
|
|
22014
|
+
var templateObject_1$3;
|
|
22015
22015
|
|
|
22016
22016
|
var isPlural = pkg__default["default"].isPlural;
|
|
22017
22017
|
var getDateFormat = function (dataInterval) {
|
|
@@ -22089,8 +22089,8 @@ var FeatureBarChart = function (_a) {
|
|
|
22089
22089
|
position: { y: -62 },
|
|
22090
22090
|
}))), jsxRuntime.jsx(recharts.Bar, { dataKey: featureName, fill: brandColor, activeBar: jsxRuntime.jsx(recharts.Rectangle, { fill: brandColor }) })] })));
|
|
22091
22091
|
};
|
|
22092
|
-
var StyledBarChart = defaultStyled(recharts.BarChart)(templateObject_1$
|
|
22093
|
-
var templateObject_1$
|
|
22092
|
+
var StyledBarChart = defaultStyled(recharts.BarChart)(templateObject_1$2 || (templateObject_1$2 = __makeTemplateObject(["\n .recharts-surface {\n overflow: visible;\n }\n"], ["\n .recharts-surface {\n overflow: visible;\n }\n"])));
|
|
22093
|
+
var templateObject_1$2;
|
|
22094
22094
|
|
|
22095
22095
|
var canShowQuantitiesInput = function (charge, subscription) {
|
|
22096
22096
|
// Check if the subscription is active, pending, or in trial,
|
|
@@ -22100,7 +22100,7 @@ var canShowQuantitiesInput = function (charge, subscription) {
|
|
|
22100
22100
|
var isActiveSubscription = ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === common.SubscriptionState.ACTIVE;
|
|
22101
22101
|
var isPendingSubscription = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.PENDING;
|
|
22102
22102
|
var isTrialSubscription = ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
22103
|
-
var isFlatPricing = charge.pricingModel ===
|
|
22103
|
+
var isFlatPricing = charge.pricingModel === 'FLAT';
|
|
22104
22104
|
var shouldProcessCharge = (isActiveSubscription || isPendingSubscription || isTrialSubscription) &&
|
|
22105
22105
|
!isFlatPricing &&
|
|
22106
22106
|
charge.selfServiceQuantity &&
|
|
@@ -22109,9 +22109,7 @@ var canShowQuantitiesInput = function (charge, subscription) {
|
|
|
22109
22109
|
return shouldProcessCharge;
|
|
22110
22110
|
};
|
|
22111
22111
|
var createQuoteParams = function (quote, subscriptionQuantity, editedSubscription) {
|
|
22112
|
-
var quoteChange = quote.quoteChanges.find(function (quoteChange) {
|
|
22113
|
-
return quoteChange.priceList.id === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription.priceList.id);
|
|
22114
|
-
});
|
|
22112
|
+
var quoteChange = quote.quoteChanges.find(function (quoteChange) { return quoteChange.priceList.id === (editedSubscription === null || editedSubscription === void 0 ? void 0 : editedSubscription.subscription.priceList.id); });
|
|
22115
22113
|
var quoteChangeCharge = quoteChange === null || quoteChange === void 0 ? void 0 : quoteChange.charges.find(function (charge) { return charge.priceListCharge.id === editedSubscription.chargeId; });
|
|
22116
22114
|
var charges = [
|
|
22117
22115
|
{
|
|
@@ -22139,6 +22137,49 @@ var canShowSubscriptionActions = function (subscription) {
|
|
|
22139
22137
|
return ((_a = subscription.state) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === common.SubscriptionState.ACTIVE ||
|
|
22140
22138
|
((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.PENDING;
|
|
22141
22139
|
};
|
|
22140
|
+
// Helper function to check if charge is a discount
|
|
22141
|
+
var isDiscount = function (kind) {
|
|
22142
|
+
return kind === common.QuoteChangeKind.DISCOUNT || kind === common.QuoteChangeKind.FREE_PERIOD_DISCOUNT;
|
|
22143
|
+
};
|
|
22144
|
+
var hasPriceTiers = function (charge) {
|
|
22145
|
+
var _a;
|
|
22146
|
+
return Boolean((_a = charge === null || charge === void 0 ? void 0 : charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length);
|
|
22147
|
+
};
|
|
22148
|
+
var getApplicablePriceTier = function (charge, currencyId) {
|
|
22149
|
+
var _a;
|
|
22150
|
+
if (!((_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.length))
|
|
22151
|
+
return '';
|
|
22152
|
+
var selectedTier;
|
|
22153
|
+
// For TIERED pricing model: always show the first tier
|
|
22154
|
+
if (charge.pricingModel === common.PricingModel.TIERED) {
|
|
22155
|
+
selectedTier = charge.priceTiers[0];
|
|
22156
|
+
}
|
|
22157
|
+
// For VOLUME and BANDS pricing models: find the tier that contains the current quantity
|
|
22158
|
+
else if (charge.pricingModel === common.PricingModel.VOLUME ||
|
|
22159
|
+
charge.pricingModel === common.PricingModel.BANDS) {
|
|
22160
|
+
// Find the appropriate tier based on quantity
|
|
22161
|
+
selectedTier = charge.priceTiers.find(function (tier, index) {
|
|
22162
|
+
var nextTier = charge.priceTiers[index + 1];
|
|
22163
|
+
var tierStart = tier.starts;
|
|
22164
|
+
var tierEnd = nextTier ? nextTier.starts - 1 : Infinity;
|
|
22165
|
+
return charge.quantity >= tierStart && charge.quantity <= tierEnd;
|
|
22166
|
+
});
|
|
22167
|
+
// Fallback to first tier if no tier found (shouldn't happen with proper data)
|
|
22168
|
+
selectedTier = selectedTier || charge.priceTiers[0];
|
|
22169
|
+
}
|
|
22170
|
+
// Default fallback for any other pricing models
|
|
22171
|
+
else {
|
|
22172
|
+
selectedTier = charge.priceTiers[0];
|
|
22173
|
+
}
|
|
22174
|
+
if (!selectedTier)
|
|
22175
|
+
return '';
|
|
22176
|
+
// Calculate the tier range for display
|
|
22177
|
+
var tierIndex = charge.priceTiers.indexOf(selectedTier);
|
|
22178
|
+
var starts = selectedTier.starts;
|
|
22179
|
+
var nextTier = charge.priceTiers[tierIndex + 1];
|
|
22180
|
+
var ends = nextTier ? nextTier.starts - 1 : '∞';
|
|
22181
|
+
return "".concat(starts, "-").concat(ends, ": ").concat(common.formatCurrency(selectedTier.price, currencyId));
|
|
22182
|
+
};
|
|
22142
22183
|
|
|
22143
22184
|
var SubscriptionCardActions = function (_a) {
|
|
22144
22185
|
var _b, _c;
|
|
@@ -22151,7 +22192,7 @@ var SubscriptionCardActions = function (_a) {
|
|
|
22151
22192
|
canShowSubscriptionActions(subscription) ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [canShowCancelButton && (jsxRuntime.jsx(antd.Popconfirm, __assign({ icon: null, onConfirm: function () { return onCancelSubscriptionClick === null || onCancelSubscriptionClick === void 0 ? void 0 : onCancelSubscriptionClick(subscription); }, title: "Cancel subscription" }, { children: jsxRuntime.jsx(antd.Button, __assign({ className: "bunny-p-0", type: "link" }, { children: "Cancel subscription" })) }))), canShowChangePlanButton && (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return onChangePlanClick(subscription); }, type: "primary" }, { children: "Change plan" })))] })) : ((_c = subscription.state) === null || _c === void 0 ? void 0 : _c.toUpperCase()) === common.SubscriptionState.TRIAL ? (jsxRuntime.jsx(antd.Button, __assign({ onClick: function () { return onChangePlanClick(subscription); }, type: "primary" }, { children: "Upgrade" }))) : null;
|
|
22152
22193
|
};
|
|
22153
22194
|
|
|
22154
|
-
var Text$
|
|
22195
|
+
var Text$7 = antd.Typography.Text;
|
|
22155
22196
|
var getSubscriptionStatusText = function (subscription) {
|
|
22156
22197
|
var cancellationDate = subscription.cancellationDate, state = subscription.state, evergreen = subscription.evergreen, endDate = subscription.endDate;
|
|
22157
22198
|
if (cancellationDate &&
|
|
@@ -22180,7 +22221,7 @@ var SubscriptionCardHeader = function (_a) {
|
|
|
22180
22221
|
var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === common.SubscriptionState.TRIAL;
|
|
22181
22222
|
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-justify-between", style: {
|
|
22182
22223
|
backgroundColor: darkMode ? "var(--row-background-dark)" : "",
|
|
22183
|
-
} }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx(Text$
|
|
22224
|
+
} }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-gap-2" }, { children: [((_c = subscription === null || subscription === void 0 ? void 0 : subscription.product) === null || _c === void 0 ? void 0 : _c.name) && (jsxRuntime.jsx(Text$7, __assign({ style: __assign({ fontSize: "11px", fontWeight: 500, color: brandColor }, subscriptionProductNameStyle) }, { children: (_d = subscription.product.name) === null || _d === void 0 ? void 0 : _d.toUpperCase() }))), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-grow bunny-items-center bunny-gap-2" }, { children: [((_e = subscription === null || subscription === void 0 ? void 0 : subscription.plan) === null || _e === void 0 ? void 0 : _e.name) && jsxRuntime.jsx(Text$7, __assign({ className: "bunny-text-lg" }, { children: subscription.plan.name })), jsxRuntime.jsxs(CustomizedTag, __assign({ color: common.TAG_COLORS[(_f = subscription.state) === null || _f === void 0 ? void 0 : _f.toUpperCase()] }, { children: [lodashExports.capitalize(subscription.state.toLowerCase()), isTrial ? " (".concat(trialDaysLeft, " days left)") : ""] }))] }))] })), jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-6" }, { children: [jsxRuntime.jsx(Text$7, __assign({ className: "bunny-grow bunny-text-xs" }, { children: getSubscriptionStatusText(subscription) })), !isMobile && priceListChangeOptions && onChangePlanClick && onCancelSubscriptionClick && (jsxRuntime.jsx(SubscriptionCardActions, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscription: subscription }))] }))] })));
|
|
22184
22225
|
};
|
|
22185
22226
|
|
|
22186
22227
|
var BillingPeriodConverter;
|
|
@@ -22198,41 +22239,71 @@ var SubscriptionChargeTotal = function (_a) {
|
|
|
22198
22239
|
var currencyId = subscription.currencyId;
|
|
22199
22240
|
var formattedDiscountedPrice = common.formatCurrency(charge.price, currencyId);
|
|
22200
22241
|
var formattedPeriodPrice = common.formatCurrency(charge.periodPrice, currencyId);
|
|
22201
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-gap-1 ".concat(isMobile ?
|
|
22202
|
-
?
|
|
22203
|
-
: charge.kind === common.
|
|
22242
|
+
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-gap-1 ".concat(isMobile ? 'bunny-flex-col' : '') }, { children: charge.chargeType === common.ChargeType.USAGE || charge.trial
|
|
22243
|
+
? '-'
|
|
22244
|
+
: charge.kind === common.QuoteChangeKind.DISCOUNT
|
|
22204
22245
|
? "-".concat(formattedDiscountedPrice, " ").concat(billingPeriod)
|
|
22205
22246
|
: "".concat(formattedPeriodPrice, " ").concat(billingPeriod) })));
|
|
22206
22247
|
};
|
|
22207
22248
|
|
|
22208
|
-
var
|
|
22249
|
+
var formatNumber = function (num, decimals) {
|
|
22250
|
+
if (decimals === void 0) { decimals = 2; }
|
|
22251
|
+
if (decimals && decimals > 20)
|
|
22252
|
+
decimals = 20;
|
|
22253
|
+
if (num === null || num === undefined || !num.toFixed)
|
|
22254
|
+
return num;
|
|
22255
|
+
if (isNaN(decimals))
|
|
22256
|
+
decimals = 2;
|
|
22257
|
+
return parseFloat(num.toFixed(decimals)).toLocaleString(navigator.language, {
|
|
22258
|
+
minimumFractionDigits: decimals,
|
|
22259
|
+
maximumFractionDigits: decimals,
|
|
22260
|
+
});
|
|
22261
|
+
};
|
|
22262
|
+
|
|
22263
|
+
var StyledTable = styled__default["default"](antd.Table)(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\n .ant-table-cell {\n border-bottom: none !important;\n }\n"], ["\n .ant-table-cell {\n border-bottom: none !important;\n }\n"])));
|
|
22264
|
+
var TieredDisplayDropdown = function (_a) {
|
|
22265
|
+
var _b;
|
|
22266
|
+
var charge = _a.charge, currencyId = _a.currencyId, truncatedText = _a.truncatedText;
|
|
22267
|
+
var onlyHasOneTier = ((_b = charge.priceTiers) === null || _b === void 0 ? void 0 : _b.length) === 1;
|
|
22268
|
+
var dropdownTrigger = (jsxRuntime.jsx("div", __assign({ className: "w-full ".concat(onlyHasOneTier ? '' : 'underline cursor-pointer') }, { children: truncatedText })));
|
|
22269
|
+
if (onlyHasOneTier) {
|
|
22270
|
+
return dropdownTrigger;
|
|
22271
|
+
}
|
|
22272
|
+
return (jsxRuntime.jsx(antd.Dropdown, __assign({ dropdownRender: function () {
|
|
22273
|
+
return (jsxRuntime.jsx("div", __assign({ className: "rounded border border-solid border-slate-200 bg-white overflow-hidden" }, { children: jsxRuntime.jsx(StyledTable, { columns: [
|
|
22274
|
+
{
|
|
22275
|
+
dataIndex: 'starts',
|
|
22276
|
+
title: 'From # of units',
|
|
22277
|
+
align: 'right',
|
|
22278
|
+
render: function (_, record, index) {
|
|
22279
|
+
var _a;
|
|
22280
|
+
record = record;
|
|
22281
|
+
var nextRecord = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1];
|
|
22282
|
+
var starts = record.starts;
|
|
22283
|
+
var ends = (nextRecord === null || nextRecord === void 0 ? void 0 : nextRecord.starts) ? nextRecord.starts - 1 : '∞';
|
|
22284
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [formatNumber(starts, 0), " -", ' ', typeof ends === 'number' ? formatNumber(ends, 0) : '∞'] }));
|
|
22285
|
+
},
|
|
22286
|
+
},
|
|
22287
|
+
{
|
|
22288
|
+
dataIndex: 'price',
|
|
22289
|
+
title: 'Unit price',
|
|
22290
|
+
align: 'right',
|
|
22291
|
+
render: function (value) {
|
|
22292
|
+
return jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.formatCurrency(value, currencyId, charge.priceDecimals) });
|
|
22293
|
+
},
|
|
22294
|
+
},
|
|
22295
|
+
], dataSource: charge.priceTiers, pagination: false, size: "small" }) })));
|
|
22296
|
+
} }, { children: dropdownTrigger })));
|
|
22297
|
+
};
|
|
22298
|
+
var templateObject_1$1;
|
|
22299
|
+
|
|
22209
22300
|
var SubscriptionChargeUnitPrice = function (_a) {
|
|
22210
|
-
var charge = _a.charge,
|
|
22211
|
-
var
|
|
22212
|
-
|
|
22213
|
-
|
|
22214
|
-
var
|
|
22215
|
-
|
|
22216
|
-
return (jsxRuntime.jsx(antd.Dropdown, __assign({ dropdownRender: function () {
|
|
22217
|
-
var _a;
|
|
22218
|
-
return (jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-flex-col bunny-rounded bunny-border bunny-border-solid bunny-border-slate-200 bunny-p-2", style: {
|
|
22219
|
-
backgroundColor: darkMode
|
|
22220
|
-
? "var(--row-background-dark)"
|
|
22221
|
-
: "var(--row-background)",
|
|
22222
|
-
} }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-grid bunny-grid-cols-2", style: { columnGap: "0.5rem" } }, { children: (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a.map(function (tier, index) {
|
|
22223
|
-
var _a, _b, _c;
|
|
22224
|
-
var ends = ((_b = (_a = charge.priceTiers) === null || _a === void 0 ? void 0 : _a[index + 1]) === null || _b === void 0 ? void 0 : _b.starts)
|
|
22225
|
-
? ((_c = charge.priceTiers[index + 1]) === null || _c === void 0 ? void 0 : _c.starts) - 1
|
|
22226
|
-
: "∞";
|
|
22227
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-contents" }, { children: [jsxRuntime.jsxs("div", __assign({ className: "bunny-whitespace-nowrap" }, { children: [tier.starts.toLocaleString(), " - ", ends.toLocaleString(), " :"] })), jsxRuntime.jsx("div", __assign({ className: "bunny-whitespace-nowrap bunny-text-right" }, { children: common.formatCurrency(tier.price, subscription.currencyId, charge.priceDecimals) }))] }), index));
|
|
22228
|
-
}) })) })));
|
|
22229
|
-
}, onOpenChange: setShowPriceTiers, open: showPriceTiers, trigger: ["click"] }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-cursor-pointer bunny-underline", onClick: function () { return setShowPriceTiers(!showPriceTiers); } }, { children: showPriceTiers ? "Hide tiers" : "Show tiers" })) })));
|
|
22230
|
-
else if (charge.chargeType === common.ChargeType.USAGE || charge.trial)
|
|
22231
|
-
return jsxRuntime.jsx(Text$7, { children: "-" });
|
|
22232
|
-
else if (isDiscount)
|
|
22233
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: ["-", common.formatCurrency(charge.discountedPrice, subscription.currencyId)] }));
|
|
22234
|
-
else
|
|
22235
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: common.formatCurrency(charge.discountedPrice, subscription.currencyId) }));
|
|
22301
|
+
var charge = _a.charge, currencyId = _a.currencyId;
|
|
22302
|
+
var price = charge.trial
|
|
22303
|
+
? '-'
|
|
22304
|
+
: common.formatCurrency(charge.discountedPrice, currencyId, charge.priceDecimals);
|
|
22305
|
+
var isChargeDiscount = isDiscount(charge.kind);
|
|
22306
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: hasPriceTiers(charge) ? (jsxRuntime.jsx(TieredDisplayDropdown, { charge: charge, currencyId: currencyId, truncatedText: "".concat(charge.kind === common.QuoteChangeKind.PRICE_UPDATE ? 'new ' : '').concat(getApplicablePriceTier(charge, currencyId)) })) : isChargeDiscount ? ("-".concat(price)) : (price) }));
|
|
22236
22307
|
};
|
|
22237
22308
|
|
|
22238
22309
|
var Text$6 = antd.Typography.Text;
|
|
@@ -22249,26 +22320,26 @@ var SubscriptionsListCell = function (_a) {
|
|
|
22249
22320
|
|
|
22250
22321
|
var CARD_COLUMNS = [
|
|
22251
22322
|
{
|
|
22252
|
-
title:
|
|
22253
|
-
width:
|
|
22323
|
+
title: 'CHARGE',
|
|
22324
|
+
width: 'minmax(min-content, 26%)',
|
|
22254
22325
|
},
|
|
22255
22326
|
{
|
|
22256
|
-
title:
|
|
22257
|
-
width:
|
|
22327
|
+
title: 'PERIOD',
|
|
22328
|
+
width: 'minmax(min-content, 20%)',
|
|
22258
22329
|
},
|
|
22259
22330
|
{
|
|
22260
|
-
className:
|
|
22261
|
-
title:
|
|
22331
|
+
className: 'text-right',
|
|
22332
|
+
title: 'QUANTITY',
|
|
22262
22333
|
width: "minmax(min-content, 18%)",
|
|
22263
22334
|
},
|
|
22264
22335
|
{
|
|
22265
|
-
className:
|
|
22266
|
-
title:
|
|
22336
|
+
className: 'text-right',
|
|
22337
|
+
title: 'UNIT PRICE',
|
|
22267
22338
|
width: "minmax(min-content, 18%)",
|
|
22268
22339
|
},
|
|
22269
22340
|
{
|
|
22270
|
-
className:
|
|
22271
|
-
title:
|
|
22341
|
+
className: 'text-right',
|
|
22342
|
+
title: 'TOTAL',
|
|
22272
22343
|
width: "minmax(min-content, 18%)",
|
|
22273
22344
|
},
|
|
22274
22345
|
];
|
|
@@ -22278,13 +22349,13 @@ var SubscriptionCardDesktop = function (_a) {
|
|
|
22278
22349
|
var shadow = react.useContext(SubscriptionsContext).shadow;
|
|
22279
22350
|
// Derived state
|
|
22280
22351
|
var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL;
|
|
22281
|
-
return (jsxRuntime.jsxs(Card, __assign({ className: "p-4 ".concat(shadow ? "shadow-".concat(shadow) :
|
|
22282
|
-
gridColumn:
|
|
22283
|
-
width:
|
|
22284
|
-
transform:
|
|
22352
|
+
return (jsxRuntime.jsxs(Card, __assign({ className: "p-4 ".concat(shadow ? "shadow-".concat(shadow) : '') }, { children: [jsxRuntime.jsx(SubscriptionCardHeader, { onChangePlanClick: onChangePlanClick, onCancelSubscriptionClick: onCancelSubscriptionClick, priceListChangeOptions: priceListChangeOptions, subscription: subscription }), jsxRuntime.jsx(antd.Divider, { className: "bunny-my-4", style: {
|
|
22353
|
+
gridColumn: '1 / 5',
|
|
22354
|
+
width: 'calc(100% + 32px)',
|
|
22355
|
+
transform: 'translateX(-16px)',
|
|
22285
22356
|
} }), jsxRuntime.jsxs("div", __assign({ className: "bunny-grid bunny-w-full", style: {
|
|
22286
|
-
gridTemplateColumns: CARD_COLUMNS.map(function (column) { return column.width; }).join(
|
|
22287
|
-
rowGap:
|
|
22357
|
+
gridTemplateColumns: CARD_COLUMNS.map(function (column) { return column.width; }).join(' '),
|
|
22358
|
+
rowGap: '0.75rem',
|
|
22288
22359
|
} }, { children: [jsxRuntime.jsx(SubscriptionCardColumnHeaders, { columns: CARD_COLUMNS }), subscription.charges.map(function (charge, chargeIndex) {
|
|
22289
22360
|
if ((isTrial && !charge.trial) || (!isTrial && charge.trial))
|
|
22290
22361
|
return null;
|
|
@@ -22304,7 +22375,7 @@ var SubscriptionCardDesktopRow = function (_a) {
|
|
|
22304
22375
|
var chargePeriod = "".concat(common.formatDate(charge.startDate), " - ").concat(common.formatDate(charge.endDate));
|
|
22305
22376
|
// Queries
|
|
22306
22377
|
var data = reactQuery.useQuery({
|
|
22307
|
-
queryKey: [
|
|
22378
|
+
queryKey: ['getFeatureUsage', charge.id, charge.startDate, charge.endDate],
|
|
22308
22379
|
queryFn: function () {
|
|
22309
22380
|
return getFeatureUsage({
|
|
22310
22381
|
endDate: charge.endDate,
|
|
@@ -22318,18 +22389,18 @@ var SubscriptionCardDesktopRow = function (_a) {
|
|
|
22318
22389
|
}).data;
|
|
22319
22390
|
var isRampFirstRow = isRamp && chargeIndex === 0;
|
|
22320
22391
|
var isTrial = charge.trial;
|
|
22321
|
-
var isDiscount = charge.kind === common.
|
|
22392
|
+
var isDiscount = charge.kind === common.QuoteChangeKind.DISCOUNT;
|
|
22322
22393
|
var dontShowChargeName = (prevCharge === null || prevCharge === void 0 ? void 0 : prevCharge.priceListChargeId) === charge.priceListChargeId &&
|
|
22323
22394
|
!isDiscount &&
|
|
22324
22395
|
(!isTrial || prevCharge.trial) &&
|
|
22325
22396
|
(isTrial || !prevCharge.trial);
|
|
22326
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-contents" }, { children: [(isRampFirstRow || !isRamp) && (jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ?
|
|
22327
|
-
?
|
|
22397
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-contents" }, { children: [(isRampFirstRow || !isRamp) && (jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: isRamp ? '1/-1' : '1' }, { children: jsxRuntime.jsx("div", __assign({ className: "bunny-flex bunny-items-center bunny-gap-2 ".concat(isDiscount ? 'bunny-pl-4' : '') }, { children: jsxRuntime.jsx("div", { children: isRampFirstRow || (!isRamp && !dontShowChargeName) ? charge.name : '' }) })) }))), jsxRuntime.jsx(SubscriptionsListCell, __assign({ gridColumn: 2 }, { children: jsxRuntime.jsx("div", { children: chargePeriod }) })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: charge.kind === common.QuoteChangeKind.DISCOUNT
|
|
22398
|
+
? ''
|
|
22328
22399
|
: charge.chargeType === common.ChargeType.USAGE
|
|
22329
22400
|
? data && jsxRuntime.jsx(FeatureUsageGraph, { charge: charge, featureUsage: data })
|
|
22330
22401
|
: charge.isAmendment
|
|
22331
22402
|
? "+".concat((_b = charge.quantity) === null || _b === void 0 ? void 0 : _b.toLocaleString())
|
|
22332
|
-
: (_c = charge.quantity) === null || _c === void 0 ? void 0 : _c.toLocaleString() })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge,
|
|
22403
|
+
: (_c = charge.quantity) === null || _c === void 0 ? void 0 : _c.toLocaleString() })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge, currencyId: subscription.currencyId }) })), jsxRuntime.jsx(SubscriptionsListCell, __assign({ right: true }, { children: jsxRuntime.jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) }))] })));
|
|
22333
22404
|
};
|
|
22334
22405
|
|
|
22335
22406
|
var Text$4 = antd.Typography.Text;
|
|
@@ -22340,19 +22411,19 @@ var SubscriptionCardCellMobile = function (_a) {
|
|
|
22340
22411
|
|
|
22341
22412
|
var CHARGE_COLUMNS = [
|
|
22342
22413
|
{
|
|
22343
|
-
title:
|
|
22414
|
+
title: 'CHARGE',
|
|
22344
22415
|
},
|
|
22345
22416
|
{
|
|
22346
|
-
className:
|
|
22347
|
-
title:
|
|
22417
|
+
className: 'text-right',
|
|
22418
|
+
title: 'QUANTITY',
|
|
22348
22419
|
},
|
|
22349
22420
|
{
|
|
22350
|
-
className:
|
|
22351
|
-
title:
|
|
22421
|
+
className: 'text-right',
|
|
22422
|
+
title: 'UNIT PRICE',
|
|
22352
22423
|
},
|
|
22353
22424
|
{
|
|
22354
|
-
className:
|
|
22355
|
-
title:
|
|
22425
|
+
className: 'text-right',
|
|
22426
|
+
title: 'TOTAL',
|
|
22356
22427
|
},
|
|
22357
22428
|
];
|
|
22358
22429
|
var SubscriptionCard = function (_a) {
|
|
@@ -22361,26 +22432,22 @@ var SubscriptionCard = function (_a) {
|
|
|
22361
22432
|
var darkMode = react.useContext(BunnyContext).darkMode;
|
|
22362
22433
|
// Derived state
|
|
22363
22434
|
var isTrial = ((_b = subscription.state) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === SubscriptionState$1.TRIAL;
|
|
22364
|
-
var backgroundColor = darkMode
|
|
22365
|
-
? "var(--row-background-dark)"
|
|
22366
|
-
: "var(--row-background)";
|
|
22435
|
+
var backgroundColor = darkMode ? 'var(--row-background-dark)' : 'var(--row-background)';
|
|
22367
22436
|
return (jsxRuntime.jsx(Card, { children: jsxRuntime.jsxs("div", __assign({ className: "bunny-flex bunny-flex-col bunny-p-4" }, { children: [jsxRuntime.jsx(SubscriptionCardHeader, { subscription: subscription }), jsxRuntime.jsx(antd.Divider, { className: "bunny-my-4", style: {
|
|
22368
|
-
gridColumn:
|
|
22369
|
-
width:
|
|
22370
|
-
transform:
|
|
22437
|
+
gridColumn: '1 / -1',
|
|
22438
|
+
width: 'calc(100% + 32px)',
|
|
22439
|
+
transform: 'translateX(-16px)',
|
|
22371
22440
|
} }), jsxRuntime.jsxs("div", __assign({ className: "bunny-grid", style: {
|
|
22372
|
-
columnGap:
|
|
22441
|
+
columnGap: '0.5rem',
|
|
22373
22442
|
gridTemplateColumns: "1fr auto auto auto",
|
|
22374
|
-
rowGap:
|
|
22443
|
+
rowGap: '0.75rem',
|
|
22375
22444
|
backgroundColor: backgroundColor,
|
|
22376
|
-
} }, { children: [CHARGE_COLUMNS.map(function (subscriptionColumn, index) { return (jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: "bunny-text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize:
|
|
22445
|
+
} }, { children: [CHARGE_COLUMNS.map(function (subscriptionColumn, index) { return (jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: "bunny-text-slate-400 ".concat(subscriptionColumn.className), style: { fontSize: '11px' } }, { children: subscriptionColumn.title }), index)); }), subscription.charges.map(function (charge, chargeIndex) {
|
|
22377
22446
|
if ((isTrial && !charge.trial) || (!isTrial && charge.trial))
|
|
22378
22447
|
return null;
|
|
22379
22448
|
var isRamp = charge.isRamp;
|
|
22380
22449
|
var chargePeriod = "".concat(common.formatDate(charge.startDate), " - ").concat(common.formatDate(charge.endDate));
|
|
22381
|
-
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-contents" }, { children: [((isRamp && chargeIndex === 0) || !isRamp) && (jsxRuntime.jsxs(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[0].className, style: { gridColumn: isRamp ?
|
|
22382
|
-
? ""
|
|
22383
|
-
: charge.quantity })), jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[2].className }, { children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge, subscription: subscription }) })), jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[3].className }, { children: jsxRuntime.jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) }))] }), chargeIndex));
|
|
22450
|
+
return (jsxRuntime.jsxs("div", __assign({ className: "bunny-contents" }, { children: [((isRamp && chargeIndex === 0) || !isRamp) && (jsxRuntime.jsxs(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[0].className, style: { gridColumn: isRamp ? '1/-1' : '1' } }, { children: [jsxRuntime.jsx("span", { children: charge.name }), !isRamp ? " - ".concat(chargePeriod) : ''] }))), isRamp && (jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[0].className }, { children: "- ".concat(chargePeriod) }))), jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[1].className }, { children: charge.kind === common.QuoteChangeKind.DISCOUNT ? '' : charge.quantity })), jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[2].className }, { children: jsxRuntime.jsx(SubscriptionChargeUnitPrice, { charge: charge, currencyId: subscription.currencyId }) })), jsxRuntime.jsx(SubscriptionCardCellMobile, __assign({ className: CHARGE_COLUMNS[3].className }, { children: jsxRuntime.jsx(SubscriptionChargeTotal, { charge: charge, subscription: subscription }) }))] }), chargeIndex));
|
|
22384
22451
|
})] }))] })) }));
|
|
22385
22452
|
};
|
|
22386
22453
|
|