@schematichq/schematic-components 0.7.1 → 0.7.4
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/schematic-components.cjs.js +911 -730
- package/dist/schematic-components.d.ts +316 -71
- package/dist/schematic-components.esm.js +823 -642
- package/package.json +3 -3
|
@@ -30,28 +30,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
mod
|
|
31
31
|
));
|
|
32
32
|
|
|
33
|
-
// node_modules/void-elements/index.js
|
|
34
|
-
var require_void_elements = __commonJS({
|
|
35
|
-
"node_modules/void-elements/index.js"(exports, module) {
|
|
36
|
-
module.exports = {
|
|
37
|
-
"area": true,
|
|
38
|
-
"base": true,
|
|
39
|
-
"br": true,
|
|
40
|
-
"col": true,
|
|
41
|
-
"embed": true,
|
|
42
|
-
"hr": true,
|
|
43
|
-
"img": true,
|
|
44
|
-
"input": true,
|
|
45
|
-
"link": true,
|
|
46
|
-
"meta": true,
|
|
47
|
-
"param": true,
|
|
48
|
-
"source": true,
|
|
49
|
-
"track": true,
|
|
50
|
-
"wbr": true
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
33
|
// node_modules/shallowequal/index.js
|
|
56
34
|
var require_shallowequal = __commonJS({
|
|
57
35
|
"node_modules/shallowequal/index.js"(exports, module) {
|
|
@@ -1664,6 +1642,28 @@ var require_merge = __commonJS({
|
|
|
1664
1642
|
}
|
|
1665
1643
|
});
|
|
1666
1644
|
|
|
1645
|
+
// node_modules/void-elements/index.js
|
|
1646
|
+
var require_void_elements = __commonJS({
|
|
1647
|
+
"node_modules/void-elements/index.js"(exports, module) {
|
|
1648
|
+
module.exports = {
|
|
1649
|
+
"area": true,
|
|
1650
|
+
"base": true,
|
|
1651
|
+
"br": true,
|
|
1652
|
+
"col": true,
|
|
1653
|
+
"embed": true,
|
|
1654
|
+
"hr": true,
|
|
1655
|
+
"img": true,
|
|
1656
|
+
"input": true,
|
|
1657
|
+
"link": true,
|
|
1658
|
+
"meta": true,
|
|
1659
|
+
"param": true,
|
|
1660
|
+
"source": true,
|
|
1661
|
+
"track": true,
|
|
1662
|
+
"wbr": true
|
|
1663
|
+
};
|
|
1664
|
+
}
|
|
1665
|
+
});
|
|
1666
|
+
|
|
1667
1667
|
// node_modules/pluralize/pluralize.js
|
|
1668
1668
|
var require_pluralize = __commonJS({
|
|
1669
1669
|
"node_modules/pluralize/pluralize.js"(exports, module) {
|
|
@@ -2252,323 +2252,54 @@ var require_debounce = __commonJS({
|
|
|
2252
2252
|
}
|
|
2253
2253
|
});
|
|
2254
2254
|
|
|
2255
|
-
// src/components/elements/
|
|
2256
|
-
import { forwardRef as forwardRef7
|
|
2257
|
-
|
|
2258
|
-
// node_modules/react-i18next/dist/es/Trans.js
|
|
2259
|
-
import { useContext } from "react";
|
|
2260
|
-
|
|
2261
|
-
// node_modules/react-i18next/dist/es/TransWithoutContext.js
|
|
2262
|
-
import { Fragment, isValidElement, cloneElement, createElement, Children } from "react";
|
|
2255
|
+
// src/components/elements/button/Button.tsx
|
|
2256
|
+
import { forwardRef as forwardRef7 } from "react";
|
|
2263
2257
|
|
|
2264
|
-
//
|
|
2265
|
-
|
|
2258
|
+
// src/components/layout/card/Card.tsx
|
|
2259
|
+
import { forwardRef as forwardRef3 } from "react";
|
|
2266
2260
|
|
|
2267
|
-
// node_modules/
|
|
2268
|
-
var
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
if (i18n?.services?.logger?.forward) {
|
|
2274
|
-
return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
|
|
2275
|
-
}
|
|
2276
|
-
if (isString(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
2277
|
-
if (i18n?.services?.logger?.warn) {
|
|
2278
|
-
i18n.services.logger.warn(...args);
|
|
2279
|
-
} else if (console?.warn) {
|
|
2280
|
-
console.warn(...args);
|
|
2281
|
-
}
|
|
2282
|
-
};
|
|
2283
|
-
var alreadyWarned = {};
|
|
2284
|
-
var warnOnce = (i18n, code, msg, rest) => {
|
|
2285
|
-
if (isString(msg) && alreadyWarned[msg]) return;
|
|
2286
|
-
if (isString(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
|
|
2287
|
-
warn(i18n, code, msg, rest);
|
|
2288
|
-
};
|
|
2289
|
-
var loadedClb = (i18n, cb) => () => {
|
|
2290
|
-
if (i18n.isInitialized) {
|
|
2291
|
-
cb();
|
|
2292
|
-
} else {
|
|
2293
|
-
const initialized = () => {
|
|
2294
|
-
setTimeout(() => {
|
|
2295
|
-
i18n.off("initialized", initialized);
|
|
2296
|
-
}, 0);
|
|
2297
|
-
cb();
|
|
2298
|
-
};
|
|
2299
|
-
i18n.on("initialized", initialized);
|
|
2300
|
-
}
|
|
2301
|
-
};
|
|
2302
|
-
var loadNamespaces = (i18n, ns, cb) => {
|
|
2303
|
-
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
2304
|
-
};
|
|
2305
|
-
var loadLanguages = (i18n, lng, ns, cb) => {
|
|
2306
|
-
if (isString(ns)) ns = [ns];
|
|
2307
|
-
if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
|
|
2308
|
-
ns.forEach((n) => {
|
|
2309
|
-
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
2310
|
-
});
|
|
2311
|
-
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
2312
|
-
};
|
|
2313
|
-
var hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
2314
|
-
if (!i18n.languages || !i18n.languages.length) {
|
|
2315
|
-
warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
2316
|
-
languages: i18n.languages
|
|
2317
|
-
});
|
|
2318
|
-
return true;
|
|
2319
|
-
}
|
|
2320
|
-
return i18n.hasLoadedNamespace(ns, {
|
|
2321
|
-
lng: options.lng,
|
|
2322
|
-
precheck: (i18nInstance2, loadNotPending) => {
|
|
2323
|
-
if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
|
|
2261
|
+
// node_modules/styled-components/node_modules/tslib/tslib.es6.mjs
|
|
2262
|
+
var __assign = function() {
|
|
2263
|
+
__assign = Object.assign || function __assign2(t2) {
|
|
2264
|
+
for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
|
|
2265
|
+
s2 = arguments[i2];
|
|
2266
|
+
for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2];
|
|
2324
2267
|
}
|
|
2325
|
-
|
|
2326
|
-
};
|
|
2327
|
-
var isString = (obj) => typeof obj === "string";
|
|
2328
|
-
var isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
2329
|
-
|
|
2330
|
-
// node_modules/react-i18next/dist/es/unescape.js
|
|
2331
|
-
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
2332
|
-
var htmlEntities = {
|
|
2333
|
-
"&": "&",
|
|
2334
|
-
"&": "&",
|
|
2335
|
-
"<": "<",
|
|
2336
|
-
"<": "<",
|
|
2337
|
-
">": ">",
|
|
2338
|
-
">": ">",
|
|
2339
|
-
"'": "'",
|
|
2340
|
-
"'": "'",
|
|
2341
|
-
""": '"',
|
|
2342
|
-
""": '"',
|
|
2343
|
-
" ": " ",
|
|
2344
|
-
" ": " ",
|
|
2345
|
-
"©": "\xA9",
|
|
2346
|
-
"©": "\xA9",
|
|
2347
|
-
"®": "\xAE",
|
|
2348
|
-
"®": "\xAE",
|
|
2349
|
-
"…": "\u2026",
|
|
2350
|
-
"…": "\u2026",
|
|
2351
|
-
"/": "/",
|
|
2352
|
-
"/": "/"
|
|
2353
|
-
};
|
|
2354
|
-
var unescapeHtmlEntity = (m2) => htmlEntities[m2];
|
|
2355
|
-
var unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
2356
|
-
|
|
2357
|
-
// node_modules/react-i18next/dist/es/defaults.js
|
|
2358
|
-
var defaultOptions = {
|
|
2359
|
-
bindI18n: "languageChanged",
|
|
2360
|
-
bindI18nStore: "",
|
|
2361
|
-
transEmptyNodeValue: "",
|
|
2362
|
-
transSupportBasicHtmlNodes: true,
|
|
2363
|
-
transWrapTextNodes: "",
|
|
2364
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
2365
|
-
useSuspense: true,
|
|
2366
|
-
unescape
|
|
2367
|
-
};
|
|
2368
|
-
var setDefaults = (options = {}) => {
|
|
2369
|
-
defaultOptions = {
|
|
2370
|
-
...defaultOptions,
|
|
2371
|
-
...options
|
|
2268
|
+
return t2;
|
|
2372
2269
|
};
|
|
2270
|
+
return __assign.apply(this, arguments);
|
|
2373
2271
|
};
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2272
|
+
function __spreadArray(to, from2, pack) {
|
|
2273
|
+
if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar; i2 < l2; i2++) {
|
|
2274
|
+
if (ar || !(i2 in from2)) {
|
|
2275
|
+
if (!ar) ar = Array.prototype.slice.call(from2, 0, i2);
|
|
2276
|
+
ar[i2] = from2[i2];
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
return to.concat(ar || Array.prototype.slice.call(from2));
|
|
2280
|
+
}
|
|
2382
2281
|
|
|
2383
|
-
// node_modules/
|
|
2384
|
-
|
|
2282
|
+
// node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
2283
|
+
function memoize(fn) {
|
|
2284
|
+
var cache = /* @__PURE__ */ Object.create(null);
|
|
2285
|
+
return function(arg) {
|
|
2286
|
+
if (cache[arg] === void 0) cache[arg] = fn(arg);
|
|
2287
|
+
return cache[arg];
|
|
2288
|
+
};
|
|
2289
|
+
}
|
|
2385
2290
|
|
|
2386
|
-
// node_modules/
|
|
2387
|
-
var
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
setI18n(instance2);
|
|
2291
|
+
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
2292
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
2293
|
+
var isPropValid = /* @__PURE__ */ memoize(
|
|
2294
|
+
function(prop) {
|
|
2295
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
2392
2296
|
}
|
|
2393
|
-
|
|
2297
|
+
/* Z+1 */
|
|
2298
|
+
);
|
|
2394
2299
|
|
|
2395
|
-
// node_modules/
|
|
2396
|
-
var
|
|
2397
|
-
|
|
2398
|
-
constructor() {
|
|
2399
|
-
this.usedNamespaces = {};
|
|
2400
|
-
}
|
|
2401
|
-
addUsedNamespaces(namespaces) {
|
|
2402
|
-
namespaces.forEach((ns) => {
|
|
2403
|
-
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
2404
|
-
});
|
|
2405
|
-
}
|
|
2406
|
-
getUsedNamespaces() {
|
|
2407
|
-
return Object.keys(this.usedNamespaces);
|
|
2408
|
-
}
|
|
2409
|
-
};
|
|
2410
|
-
|
|
2411
|
-
// node_modules/react-i18next/dist/es/useTranslation.js
|
|
2412
|
-
import { useState, useEffect, useContext as useContext2, useRef, useCallback } from "react";
|
|
2413
|
-
var usePrevious = (value, ignore) => {
|
|
2414
|
-
const ref = useRef();
|
|
2415
|
-
useEffect(() => {
|
|
2416
|
-
ref.current = ignore ? ref.current : value;
|
|
2417
|
-
}, [value, ignore]);
|
|
2418
|
-
return ref.current;
|
|
2419
|
-
};
|
|
2420
|
-
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
2421
|
-
var useMemoizedT = (i18n, language, namespace, keyPrefix) => useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
2422
|
-
var useTranslation = (ns, props = {}) => {
|
|
2423
|
-
const {
|
|
2424
|
-
i18n: i18nFromProps
|
|
2425
|
-
} = props;
|
|
2426
|
-
const {
|
|
2427
|
-
i18n: i18nFromContext,
|
|
2428
|
-
defaultNS: defaultNSFromContext
|
|
2429
|
-
} = useContext2(I18nContext) || {};
|
|
2430
|
-
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
2431
|
-
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
2432
|
-
if (!i18n) {
|
|
2433
|
-
warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
2434
|
-
const notReadyT = (k2, optsOrDefaultValue) => {
|
|
2435
|
-
if (isString(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
2436
|
-
if (isObject(optsOrDefaultValue) && isString(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
2437
|
-
return Array.isArray(k2) ? k2[k2.length - 1] : k2;
|
|
2438
|
-
};
|
|
2439
|
-
const retNotReady = [notReadyT, {}, false];
|
|
2440
|
-
retNotReady.t = notReadyT;
|
|
2441
|
-
retNotReady.i18n = {};
|
|
2442
|
-
retNotReady.ready = false;
|
|
2443
|
-
return retNotReady;
|
|
2444
|
-
}
|
|
2445
|
-
if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
2446
|
-
const i18nOptions = {
|
|
2447
|
-
...getDefaults(),
|
|
2448
|
-
...i18n.options.react,
|
|
2449
|
-
...props
|
|
2450
|
-
};
|
|
2451
|
-
const {
|
|
2452
|
-
useSuspense,
|
|
2453
|
-
keyPrefix
|
|
2454
|
-
} = i18nOptions;
|
|
2455
|
-
let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
|
|
2456
|
-
namespaces = isString(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
2457
|
-
i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
|
|
2458
|
-
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace(n, i18n, i18nOptions));
|
|
2459
|
-
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
2460
|
-
const getT = () => memoGetT;
|
|
2461
|
-
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
2462
|
-
const [t2, setT] = useState(getT);
|
|
2463
|
-
let joinedNS = namespaces.join();
|
|
2464
|
-
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
2465
|
-
const previousJoinedNS = usePrevious(joinedNS);
|
|
2466
|
-
const isMounted = useRef(true);
|
|
2467
|
-
useEffect(() => {
|
|
2468
|
-
const {
|
|
2469
|
-
bindI18n,
|
|
2470
|
-
bindI18nStore
|
|
2471
|
-
} = i18nOptions;
|
|
2472
|
-
isMounted.current = true;
|
|
2473
|
-
if (!ready && !useSuspense) {
|
|
2474
|
-
if (props.lng) {
|
|
2475
|
-
loadLanguages(i18n, props.lng, namespaces, () => {
|
|
2476
|
-
if (isMounted.current) setT(getNewT);
|
|
2477
|
-
});
|
|
2478
|
-
} else {
|
|
2479
|
-
loadNamespaces(i18n, namespaces, () => {
|
|
2480
|
-
if (isMounted.current) setT(getNewT);
|
|
2481
|
-
});
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
2485
|
-
setT(getNewT);
|
|
2486
|
-
}
|
|
2487
|
-
const boundReset = () => {
|
|
2488
|
-
if (isMounted.current) setT(getNewT);
|
|
2489
|
-
};
|
|
2490
|
-
if (bindI18n) i18n?.on(bindI18n, boundReset);
|
|
2491
|
-
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
|
|
2492
|
-
return () => {
|
|
2493
|
-
isMounted.current = false;
|
|
2494
|
-
if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
|
|
2495
|
-
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
|
|
2496
|
-
};
|
|
2497
|
-
}, [i18n, joinedNS]);
|
|
2498
|
-
useEffect(() => {
|
|
2499
|
-
if (isMounted.current && ready) {
|
|
2500
|
-
setT(getT);
|
|
2501
|
-
}
|
|
2502
|
-
}, [i18n, keyPrefix, ready]);
|
|
2503
|
-
const ret = [t2, i18n, ready];
|
|
2504
|
-
ret.t = t2;
|
|
2505
|
-
ret.i18n = i18n;
|
|
2506
|
-
ret.ready = ready;
|
|
2507
|
-
if (ready) return ret;
|
|
2508
|
-
if (!ready && !useSuspense) return ret;
|
|
2509
|
-
throw new Promise((resolve) => {
|
|
2510
|
-
if (props.lng) {
|
|
2511
|
-
loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
2512
|
-
} else {
|
|
2513
|
-
loadNamespaces(i18n, namespaces, () => resolve());
|
|
2514
|
-
}
|
|
2515
|
-
});
|
|
2516
|
-
};
|
|
2517
|
-
|
|
2518
|
-
// node_modules/react-i18next/dist/es/withTranslation.js
|
|
2519
|
-
import { createElement as createElement2, forwardRef as forwardRefReact } from "react";
|
|
2520
|
-
|
|
2521
|
-
// node_modules/react-i18next/dist/es/I18nextProvider.js
|
|
2522
|
-
import { createElement as createElement3, useMemo } from "react";
|
|
2523
|
-
|
|
2524
|
-
// node_modules/react-i18next/dist/es/withSSR.js
|
|
2525
|
-
import { createElement as createElement4 } from "react";
|
|
2526
|
-
|
|
2527
|
-
// node_modules/react-i18next/dist/es/useSSR.js
|
|
2528
|
-
import { useContext as useContext3 } from "react";
|
|
2529
|
-
|
|
2530
|
-
// node_modules/styled-components/node_modules/tslib/tslib.es6.mjs
|
|
2531
|
-
var __assign = function() {
|
|
2532
|
-
__assign = Object.assign || function __assign2(t2) {
|
|
2533
|
-
for (var s2, i2 = 1, n = arguments.length; i2 < n; i2++) {
|
|
2534
|
-
s2 = arguments[i2];
|
|
2535
|
-
for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2];
|
|
2536
|
-
}
|
|
2537
|
-
return t2;
|
|
2538
|
-
};
|
|
2539
|
-
return __assign.apply(this, arguments);
|
|
2540
|
-
};
|
|
2541
|
-
function __spreadArray(to, from2, pack) {
|
|
2542
|
-
if (pack || arguments.length === 2) for (var i2 = 0, l2 = from2.length, ar; i2 < l2; i2++) {
|
|
2543
|
-
if (ar || !(i2 in from2)) {
|
|
2544
|
-
if (!ar) ar = Array.prototype.slice.call(from2, 0, i2);
|
|
2545
|
-
ar[i2] = from2[i2];
|
|
2546
|
-
}
|
|
2547
|
-
}
|
|
2548
|
-
return to.concat(ar || Array.prototype.slice.call(from2));
|
|
2549
|
-
}
|
|
2550
|
-
|
|
2551
|
-
// node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
|
|
2552
|
-
function memoize(fn) {
|
|
2553
|
-
var cache = /* @__PURE__ */ Object.create(null);
|
|
2554
|
-
return function(arg) {
|
|
2555
|
-
if (cache[arg] === void 0) cache[arg] = fn(arg);
|
|
2556
|
-
return cache[arg];
|
|
2557
|
-
};
|
|
2558
|
-
}
|
|
2559
|
-
|
|
2560
|
-
// node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
|
|
2561
|
-
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/;
|
|
2562
|
-
var isPropValid = /* @__PURE__ */ memoize(
|
|
2563
|
-
function(prop) {
|
|
2564
|
-
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
2565
|
-
}
|
|
2566
|
-
/* Z+1 */
|
|
2567
|
-
);
|
|
2568
|
-
|
|
2569
|
-
// node_modules/styled-components/dist/styled-components.browser.esm.js
|
|
2570
|
-
var import_shallowequal = __toESM(require_shallowequal());
|
|
2571
|
-
import o, { useRef as r, useState as s, useMemo as i, useEffect as a, useContext as c, useDebugValue as l, createElement as u } from "react";
|
|
2300
|
+
// node_modules/styled-components/dist/styled-components.browser.esm.js
|
|
2301
|
+
var import_shallowequal = __toESM(require_shallowequal());
|
|
2302
|
+
import o, { useRef as r, useState as s, useMemo as i, useEffect as a, useContext as c, useDebugValue as l, createElement as u } from "react";
|
|
2572
2303
|
|
|
2573
2304
|
// node_modules/stylis/src/Enum.js
|
|
2574
2305
|
var MS = "-ms-";
|
|
@@ -3233,7 +2964,7 @@ var unitlessKeys = {
|
|
|
3233
2964
|
var f = "undefined" != typeof process && void 0 !== process.env && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled";
|
|
3234
2965
|
var m = "active";
|
|
3235
2966
|
var y = "data-styled-version";
|
|
3236
|
-
var v = "6.1.
|
|
2967
|
+
var v = "6.1.17";
|
|
3237
2968
|
var g = "/*!sc*/\n";
|
|
3238
2969
|
var S = "undefined" != typeof window && "HTMLElement" in window;
|
|
3239
2970
|
var w = Boolean("boolean" == typeof SC_DISABLE_SPEEDY ? SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.REACT_APP_SC_DISABLE_SPEEDY && "" !== process.env.REACT_APP_SC_DISABLE_SPEEDY ? "false" !== process.env.REACT_APP_SC_DISABLE_SPEEDY && process.env.REACT_APP_SC_DISABLE_SPEEDY : "undefined" != typeof process && void 0 !== process.env && void 0 !== process.env.SC_DISABLE_SPEEDY && "" !== process.env.SC_DISABLE_SPEEDY ? "false" !== process.env.SC_DISABLE_SPEEDY && process.env.SC_DISABLE_SPEEDY : true);
|
|
@@ -3242,7 +2973,7 @@ var E = /invalid hook call/i;
|
|
|
3242
2973
|
var N = /* @__PURE__ */ new Set();
|
|
3243
2974
|
var P = function(t2, n) {
|
|
3244
2975
|
if (true) {
|
|
3245
|
-
var o2 = n ? ' with the id of "'.concat(n, '"') : "", s2 = "The component ".concat(t2).concat(o2, " has been created dynamically.\n") + "You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.", i2 = console.error;
|
|
2976
|
+
var o2 = n ? ' with the id of "'.concat(n, '"') : "", s2 = "The component ".concat(t2).concat(o2, " has been created dynamically.\n") + "You may see this warning because you've called styled inside another component.\nTo resolve this only create new StyledComponents outside of any render method and function component.\nSee https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.\n", i2 = console.error;
|
|
3246
2977
|
try {
|
|
3247
2978
|
var a2 = true;
|
|
3248
2979
|
console.error = function(t3) {
|
|
@@ -3899,10 +3630,10 @@ var DEFAULT_CURRENCY = "USD";
|
|
|
3899
3630
|
var MAXIMUM_SIGNIFICANT_DIGITS = 6;
|
|
3900
3631
|
|
|
3901
3632
|
// src/hooks/useAvailablePlans.ts
|
|
3902
|
-
import { useCallback
|
|
3633
|
+
import { useCallback, useMemo } from "react";
|
|
3903
3634
|
function useAvailablePlans(activePeriod) {
|
|
3904
3635
|
const { data, mode } = useEmbed();
|
|
3905
|
-
const getAvailablePeriods =
|
|
3636
|
+
const getAvailablePeriods = useCallback(() => {
|
|
3906
3637
|
const periods = [];
|
|
3907
3638
|
if (data.activePlans.some((plan) => plan.monthlyPrice) || data.activeAddOns.some((addOn) => addOn.monthlyPrice)) {
|
|
3908
3639
|
periods.push("month");
|
|
@@ -3912,7 +3643,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
3912
3643
|
}
|
|
3913
3644
|
return periods;
|
|
3914
3645
|
}, [data.activePlans, data.activeAddOns]);
|
|
3915
|
-
const getActivePlans =
|
|
3646
|
+
const getActivePlans = useCallback(
|
|
3916
3647
|
(plans) => {
|
|
3917
3648
|
const customPlanExist = plans.some((plan) => plan.custom);
|
|
3918
3649
|
const plansWithSelected = mode === "edit" ? plans.slice() : plans.filter(
|
|
@@ -3933,7 +3664,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
3933
3664
|
},
|
|
3934
3665
|
[activePeriod, mode]
|
|
3935
3666
|
);
|
|
3936
|
-
return
|
|
3667
|
+
return useMemo(() => {
|
|
3937
3668
|
return {
|
|
3938
3669
|
plans: getActivePlans(data.activePlans),
|
|
3939
3670
|
addOns: getActivePlans(data.activeAddOns),
|
|
@@ -3951,7 +3682,7 @@ function useAvailablePlans(activePeriod) {
|
|
|
3951
3682
|
import { useContext as useContext4 } from "react";
|
|
3952
3683
|
|
|
3953
3684
|
// node_modules/i18next/dist/esm/i18next.js
|
|
3954
|
-
var
|
|
3685
|
+
var isString = (obj) => typeof obj === "string";
|
|
3955
3686
|
var defer = () => {
|
|
3956
3687
|
let res;
|
|
3957
3688
|
let rej;
|
|
@@ -3974,9 +3705,9 @@ var copy2 = (a2, s2, t2) => {
|
|
|
3974
3705
|
};
|
|
3975
3706
|
var lastOfPathSeparatorRegExp = /###/g;
|
|
3976
3707
|
var cleanKey = (key) => key && key.indexOf("###") > -1 ? key.replace(lastOfPathSeparatorRegExp, ".") : key;
|
|
3977
|
-
var canNotTraverseDeeper = (object) => !object ||
|
|
3708
|
+
var canNotTraverseDeeper = (object) => !object || isString(object);
|
|
3978
3709
|
var getLastOfPath = (object, path, Empty) => {
|
|
3979
|
-
const stack = !
|
|
3710
|
+
const stack = !isString(path) ? path : path.split(".");
|
|
3980
3711
|
let stackIndex = 0;
|
|
3981
3712
|
while (stackIndex < stack.length - 1) {
|
|
3982
3713
|
if (canNotTraverseDeeper(object)) return {};
|
|
@@ -4045,7 +3776,7 @@ var deepExtend = (target, source, overwrite) => {
|
|
|
4045
3776
|
for (const prop in source) {
|
|
4046
3777
|
if (prop !== "__proto__" && prop !== "constructor") {
|
|
4047
3778
|
if (prop in target) {
|
|
4048
|
-
if (
|
|
3779
|
+
if (isString(target[prop]) || target[prop] instanceof String || isString(source[prop]) || source[prop] instanceof String) {
|
|
4049
3780
|
if (overwrite) target[prop] = source[prop];
|
|
4050
3781
|
} else {
|
|
4051
3782
|
deepExtend(target[prop], source[prop], overwrite);
|
|
@@ -4067,7 +3798,7 @@ var _entityMap = {
|
|
|
4067
3798
|
"/": "/"
|
|
4068
3799
|
};
|
|
4069
3800
|
var escape = (data) => {
|
|
4070
|
-
if (
|
|
3801
|
+
if (isString(data)) {
|
|
4071
3802
|
return data.replace(/[&<>"'\/]/g, (s2) => _entityMap[s2]);
|
|
4072
3803
|
}
|
|
4073
3804
|
return data;
|
|
@@ -4196,7 +3927,7 @@ var Logger = class _Logger {
|
|
|
4196
3927
|
}
|
|
4197
3928
|
forward(args, lvl, prefix2, debugOnly) {
|
|
4198
3929
|
if (debugOnly && !this.debug) return null;
|
|
4199
|
-
if (
|
|
3930
|
+
if (isString(args[0])) args[0] = `${prefix2}${this.prefix} ${args[0]}`;
|
|
4200
3931
|
return this.logger[lvl](args);
|
|
4201
3932
|
}
|
|
4202
3933
|
create(moduleName) {
|
|
@@ -4297,7 +4028,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4297
4028
|
if (key) {
|
|
4298
4029
|
if (Array.isArray(key)) {
|
|
4299
4030
|
path.push(...key);
|
|
4300
|
-
} else if (
|
|
4031
|
+
} else if (isString(key) && keySeparator) {
|
|
4301
4032
|
path.push(...key.split(keySeparator));
|
|
4302
4033
|
} else {
|
|
4303
4034
|
path.push(key);
|
|
@@ -4310,7 +4041,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4310
4041
|
ns = path[1];
|
|
4311
4042
|
key = path.slice(2).join(".");
|
|
4312
4043
|
}
|
|
4313
|
-
if (result || !ignoreJSONStructure || !
|
|
4044
|
+
if (result || !ignoreJSONStructure || !isString(key)) return result;
|
|
4314
4045
|
return deepFind(this.data?.[lng]?.[ns], key, keySeparator);
|
|
4315
4046
|
}
|
|
4316
4047
|
addResource(lng, ns, key, value) {
|
|
@@ -4334,7 +4065,7 @@ var ResourceStore = class extends EventEmitter {
|
|
|
4334
4065
|
silent: false
|
|
4335
4066
|
};
|
|
4336
4067
|
for (const m2 in resources) {
|
|
4337
|
-
if (
|
|
4068
|
+
if (isString(resources[m2]) || Array.isArray(resources[m2])) this.addResource(lng, ns, m2, resources[m2], {
|
|
4338
4069
|
silent: true
|
|
4339
4070
|
});
|
|
4340
4071
|
}
|
|
@@ -4405,7 +4136,7 @@ var postProcessor = {
|
|
|
4405
4136
|
}
|
|
4406
4137
|
};
|
|
4407
4138
|
var checkedLoadedFor = {};
|
|
4408
|
-
var shouldHandleAsObject = (res) => !
|
|
4139
|
+
var shouldHandleAsObject = (res) => !isString(res) && typeof res !== "boolean" && typeof res !== "number";
|
|
4409
4140
|
var Translator = class _Translator extends EventEmitter {
|
|
4410
4141
|
constructor(services) {
|
|
4411
4142
|
let options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
|
|
@@ -4442,7 +4173,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4442
4173
|
if (m2 && m2.length > 0) {
|
|
4443
4174
|
return {
|
|
4444
4175
|
key,
|
|
4445
|
-
namespaces:
|
|
4176
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
4446
4177
|
};
|
|
4447
4178
|
}
|
|
4448
4179
|
const parts = key.split(nsSeparator);
|
|
@@ -4451,7 +4182,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4451
4182
|
}
|
|
4452
4183
|
return {
|
|
4453
4184
|
key,
|
|
4454
|
-
namespaces:
|
|
4185
|
+
namespaces: isString(namespaces) ? [namespaces] : namespaces
|
|
4455
4186
|
};
|
|
4456
4187
|
}
|
|
4457
4188
|
translate(keys, options, lastKey) {
|
|
@@ -4507,7 +4238,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4507
4238
|
const noObject = ["[object Number]", "[object Function]", "[object RegExp]"];
|
|
4508
4239
|
const joinArrays = options.joinArrays !== void 0 ? options.joinArrays : this.options.joinArrays;
|
|
4509
4240
|
const handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
|
4510
|
-
const needsPluralHandling = options.count !== void 0 && !
|
|
4241
|
+
const needsPluralHandling = options.count !== void 0 && !isString(options.count);
|
|
4511
4242
|
const hasDefaultValue = _Translator.hasDefaultValue(options);
|
|
4512
4243
|
const defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : "";
|
|
4513
4244
|
const defaultValueSuffixOrdinalFallback = options.ordinal && needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, {
|
|
@@ -4521,7 +4252,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4521
4252
|
}
|
|
4522
4253
|
const handleAsObject = shouldHandleAsObject(resForObjHndl);
|
|
4523
4254
|
const resType = Object.prototype.toString.apply(resForObjHndl);
|
|
4524
|
-
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(
|
|
4255
|
+
if (handleAsObjectInI18nFormat && resForObjHndl && handleAsObject && noObject.indexOf(resType) < 0 && !(isString(joinArrays) && Array.isArray(resForObjHndl))) {
|
|
4525
4256
|
if (!options.returnObjects && !this.options.returnObjects) {
|
|
4526
4257
|
if (!this.options.returnedObjectHandler) {
|
|
4527
4258
|
this.logger.warn("accessing an object - but returnObjects options is not enabled!");
|
|
@@ -4567,7 +4298,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4567
4298
|
}
|
|
4568
4299
|
res = copy3;
|
|
4569
4300
|
}
|
|
4570
|
-
} else if (handleAsObjectInI18nFormat &&
|
|
4301
|
+
} else if (handleAsObjectInI18nFormat && isString(joinArrays) && Array.isArray(res)) {
|
|
4571
4302
|
res = res.join(joinArrays);
|
|
4572
4303
|
if (res) res = this.extendTranslation(res, keys, options, lastKey);
|
|
4573
4304
|
} else {
|
|
@@ -4661,13 +4392,13 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4661
4392
|
}
|
|
4662
4393
|
}
|
|
4663
4394
|
});
|
|
4664
|
-
const skipOnVariables =
|
|
4395
|
+
const skipOnVariables = isString(res) && (options?.interpolation?.skipOnVariables !== void 0 ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
|
4665
4396
|
let nestBef;
|
|
4666
4397
|
if (skipOnVariables) {
|
|
4667
4398
|
const nb = res.match(this.interpolator.nestingRegexp);
|
|
4668
4399
|
nestBef = nb && nb.length;
|
|
4669
4400
|
}
|
|
4670
|
-
let data = options.replace && !
|
|
4401
|
+
let data = options.replace && !isString(options.replace) ? options.replace : options;
|
|
4671
4402
|
if (this.options.interpolation.defaultVariables) data = {
|
|
4672
4403
|
...this.options.interpolation.defaultVariables,
|
|
4673
4404
|
...data
|
|
@@ -4692,7 +4423,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4692
4423
|
if (options.interpolation) this.interpolator.reset();
|
|
4693
4424
|
}
|
|
4694
4425
|
const postProcess = options.postProcess || this.options.postProcess;
|
|
4695
|
-
const postProcessorNames =
|
|
4426
|
+
const postProcessorNames = isString(postProcess) ? [postProcess] : postProcess;
|
|
4696
4427
|
if (res != null && postProcessorNames?.length && options.applyPostProcessor !== false) {
|
|
4697
4428
|
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? {
|
|
4698
4429
|
i18nResolved: {
|
|
@@ -4711,7 +4442,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4711
4442
|
let exactUsedKey;
|
|
4712
4443
|
let usedLng;
|
|
4713
4444
|
let usedNS;
|
|
4714
|
-
if (
|
|
4445
|
+
if (isString(keys)) keys = [keys];
|
|
4715
4446
|
keys.forEach((k2) => {
|
|
4716
4447
|
if (this.isValidLookup(found)) return;
|
|
4717
4448
|
const extracted = this.extractFromKey(k2, options);
|
|
@@ -4719,9 +4450,9 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4719
4450
|
usedKey = key;
|
|
4720
4451
|
let namespaces = extracted.namespaces;
|
|
4721
4452
|
if (this.options.fallbackNS) namespaces = namespaces.concat(this.options.fallbackNS);
|
|
4722
|
-
const needsPluralHandling = options.count !== void 0 && !
|
|
4453
|
+
const needsPluralHandling = options.count !== void 0 && !isString(options.count);
|
|
4723
4454
|
const needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0;
|
|
4724
|
-
const needsContextHandling = options.context !== void 0 && (
|
|
4455
|
+
const needsContextHandling = options.context !== void 0 && (isString(options.context) || typeof options.context === "number") && options.context !== "";
|
|
4725
4456
|
const codes = options.lngs ? options.lngs : this.languageUtils.toResolveHierarchy(options.lng || this.language, options.fallbackLng);
|
|
4726
4457
|
namespaces.forEach((ns) => {
|
|
4727
4458
|
if (this.isValidLookup(found)) return;
|
|
@@ -4793,7 +4524,7 @@ var Translator = class _Translator extends EventEmitter {
|
|
|
4793
4524
|
getUsedParamsDetails() {
|
|
4794
4525
|
let options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
4795
4526
|
const optionsKeys = ["defaultValue", "ordinal", "context", "replace", "lng", "lngs", "fallbackLng", "ns", "keySeparator", "nsSeparator", "returnObjects", "returnDetails", "joinArrays", "postProcess", "interpolation"];
|
|
4796
|
-
const useOptionsReplaceForData = options.replace && !
|
|
4527
|
+
const useOptionsReplaceForData = options.replace && !isString(options.replace);
|
|
4797
4528
|
let data = useOptionsReplaceForData ? options.replace : options;
|
|
4798
4529
|
if (useOptionsReplaceForData && typeof options.count !== "undefined") {
|
|
4799
4530
|
data.count = options.count;
|
|
@@ -4846,7 +4577,7 @@ var LanguageUtil = class {
|
|
|
4846
4577
|
return this.formatLanguageCode(p2[0]);
|
|
4847
4578
|
}
|
|
4848
4579
|
formatLanguageCode(code) {
|
|
4849
|
-
if (
|
|
4580
|
+
if (isString(code) && code.indexOf("-") > -1) {
|
|
4850
4581
|
let formattedCode;
|
|
4851
4582
|
try {
|
|
4852
4583
|
formattedCode = Intl.getCanonicalLocales(code)[0];
|
|
@@ -4896,7 +4627,7 @@ var LanguageUtil = class {
|
|
|
4896
4627
|
getFallbackCodes(fallbacks, code) {
|
|
4897
4628
|
if (!fallbacks) return [];
|
|
4898
4629
|
if (typeof fallbacks === "function") fallbacks = fallbacks(code);
|
|
4899
|
-
if (
|
|
4630
|
+
if (isString(fallbacks)) fallbacks = [fallbacks];
|
|
4900
4631
|
if (Array.isArray(fallbacks)) return fallbacks;
|
|
4901
4632
|
if (!code) return fallbacks.default || [];
|
|
4902
4633
|
let found = fallbacks[code];
|
|
@@ -4917,11 +4648,11 @@ var LanguageUtil = class {
|
|
|
4917
4648
|
this.logger.warn(`rejecting language code not found in supportedLngs: ${c2}`);
|
|
4918
4649
|
}
|
|
4919
4650
|
};
|
|
4920
|
-
if (
|
|
4651
|
+
if (isString(code) && (code.indexOf("-") > -1 || code.indexOf("_") > -1)) {
|
|
4921
4652
|
if (this.options.load !== "languageOnly") addCode(this.formatLanguageCode(code));
|
|
4922
4653
|
if (this.options.load !== "languageOnly" && this.options.load !== "currentOnly") addCode(this.getScriptPartFromCode(code));
|
|
4923
4654
|
if (this.options.load !== "currentOnly") addCode(this.getLanguagePartFromCode(code));
|
|
4924
|
-
} else if (
|
|
4655
|
+
} else if (isString(code)) {
|
|
4925
4656
|
addCode(this.formatLanguageCode(code));
|
|
4926
4657
|
}
|
|
4927
4658
|
fallbackCodes.forEach((fc) => {
|
|
@@ -5017,7 +4748,7 @@ var deepFindWithDefaults = function(data, defaultData, key) {
|
|
|
5017
4748
|
let keySeparator = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ".";
|
|
5018
4749
|
let ignoreJSONStructure = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
|
|
5019
4750
|
let path = getPathWithDefaults(data, defaultData, key);
|
|
5020
|
-
if (!path && ignoreJSONStructure &&
|
|
4751
|
+
if (!path && ignoreJSONStructure && isString(key)) {
|
|
5021
4752
|
path = deepFind(data, key, keySeparator);
|
|
5022
4753
|
if (path === void 0) path = deepFind(defaultData, key, keySeparator);
|
|
5023
4754
|
}
|
|
@@ -5127,7 +4858,7 @@ var Interpolator = class {
|
|
|
5127
4858
|
if (value === void 0) {
|
|
5128
4859
|
if (typeof missingInterpolationHandler === "function") {
|
|
5129
4860
|
const temp = missingInterpolationHandler(str, match2, options);
|
|
5130
|
-
value =
|
|
4861
|
+
value = isString(temp) ? temp : "";
|
|
5131
4862
|
} else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
|
|
5132
4863
|
value = "";
|
|
5133
4864
|
} else if (skipOnVariables) {
|
|
@@ -5137,7 +4868,7 @@ var Interpolator = class {
|
|
|
5137
4868
|
this.logger.warn(`missed to pass in variable ${matchedVar} for interpolating ${str}`);
|
|
5138
4869
|
value = "";
|
|
5139
4870
|
}
|
|
5140
|
-
} else if (!
|
|
4871
|
+
} else if (!isString(value) && !this.useRawValueToEscape) {
|
|
5141
4872
|
value = makeString(value);
|
|
5142
4873
|
}
|
|
5143
4874
|
const safeValue = todo.safeValue(value);
|
|
@@ -5191,7 +4922,7 @@ var Interpolator = class {
|
|
|
5191
4922
|
clonedOptions = {
|
|
5192
4923
|
...options
|
|
5193
4924
|
};
|
|
5194
|
-
clonedOptions = clonedOptions.replace && !
|
|
4925
|
+
clonedOptions = clonedOptions.replace && !isString(clonedOptions.replace) ? clonedOptions.replace : clonedOptions;
|
|
5195
4926
|
clonedOptions.applyPostProcessor = false;
|
|
5196
4927
|
delete clonedOptions.defaultValue;
|
|
5197
4928
|
let doReduce = false;
|
|
@@ -5202,8 +4933,8 @@ var Interpolator = class {
|
|
|
5202
4933
|
doReduce = true;
|
|
5203
4934
|
}
|
|
5204
4935
|
value = fc(handleHasOptions.call(this, match2[1].trim(), clonedOptions), clonedOptions);
|
|
5205
|
-
if (value && match2[0] === str && !
|
|
5206
|
-
if (!
|
|
4936
|
+
if (value && match2[0] === str && !isString(value)) return value;
|
|
4937
|
+
if (!isString(value)) value = makeString(value);
|
|
5207
4938
|
if (!value) {
|
|
5208
4939
|
this.logger.warn(`missed to resolve ${match2[1]} for nesting ${str}`);
|
|
5209
4940
|
value = "";
|
|
@@ -5513,8 +5244,8 @@ var Connector = class extends EventEmitter {
|
|
|
5513
5244
|
this.logger.warn("No backend was added via i18next.use. Will not load resources.");
|
|
5514
5245
|
return callback && callback();
|
|
5515
5246
|
}
|
|
5516
|
-
if (
|
|
5517
|
-
if (
|
|
5247
|
+
if (isString(languages)) languages = this.languageUtils.toResolveHierarchy(languages);
|
|
5248
|
+
if (isString(namespaces)) namespaces = [namespaces];
|
|
5518
5249
|
const toLoad = this.queueLoad(languages, namespaces, options, callback);
|
|
5519
5250
|
if (!toLoad.toLoad.length) {
|
|
5520
5251
|
if (!toLoad.pending.length) callback();
|
|
@@ -5618,8 +5349,8 @@ var get = () => ({
|
|
|
5618
5349
|
overloadTranslationOptionHandler: (args) => {
|
|
5619
5350
|
let ret = {};
|
|
5620
5351
|
if (typeof args[1] === "object") ret = args[1];
|
|
5621
|
-
if (
|
|
5622
|
-
if (
|
|
5352
|
+
if (isString(args[1])) ret.defaultValue = args[1];
|
|
5353
|
+
if (isString(args[2])) ret.tDescription = args[2];
|
|
5623
5354
|
if (typeof args[2] === "object" || typeof args[3] === "object") {
|
|
5624
5355
|
const options = args[3] || args[2];
|
|
5625
5356
|
Object.keys(options).forEach((key) => {
|
|
@@ -5643,9 +5374,9 @@ var get = () => ({
|
|
|
5643
5374
|
}
|
|
5644
5375
|
});
|
|
5645
5376
|
var transformOptions = (options) => {
|
|
5646
|
-
if (
|
|
5647
|
-
if (
|
|
5648
|
-
if (
|
|
5377
|
+
if (isString(options.ns)) options.ns = [options.ns];
|
|
5378
|
+
if (isString(options.fallbackLng)) options.fallbackLng = [options.fallbackLng];
|
|
5379
|
+
if (isString(options.fallbackNS)) options.fallbackNS = [options.fallbackNS];
|
|
5649
5380
|
if (options.supportedLngs?.indexOf?.("cimode") < 0) {
|
|
5650
5381
|
options.supportedLngs = options.supportedLngs.concat(["cimode"]);
|
|
5651
5382
|
}
|
|
@@ -5694,7 +5425,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5694
5425
|
options = {};
|
|
5695
5426
|
}
|
|
5696
5427
|
if (options.defaultNS == null && options.ns) {
|
|
5697
|
-
if (
|
|
5428
|
+
if (isString(options.ns)) {
|
|
5698
5429
|
options.defaultNS = options.ns;
|
|
5699
5430
|
} else if (options.ns.indexOf("translation") < 0) {
|
|
5700
5431
|
options.defaultNS = options.ns[0];
|
|
@@ -5824,7 +5555,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5824
5555
|
loadResources(language) {
|
|
5825
5556
|
let callback = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
|
|
5826
5557
|
let usedCallback = callback;
|
|
5827
|
-
const usedLng =
|
|
5558
|
+
const usedLng = isString(language) ? language : this.language;
|
|
5828
5559
|
if (typeof language === "function") usedCallback = language;
|
|
5829
5560
|
if (!this.options.resources || this.options.partialBundledLanguages) {
|
|
5830
5561
|
if (usedLng?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return usedCallback();
|
|
@@ -5940,7 +5671,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5940
5671
|
};
|
|
5941
5672
|
const setLng = (lngs) => {
|
|
5942
5673
|
if (!lng && !lngs && this.services.languageDetector) lngs = [];
|
|
5943
|
-
const l2 =
|
|
5674
|
+
const l2 = isString(lngs) ? lngs : this.services.languageUtils.getBestMatchFromCodes(lngs);
|
|
5944
5675
|
if (l2) {
|
|
5945
5676
|
if (!this.language) {
|
|
5946
5677
|
setLngProps(l2);
|
|
@@ -5992,7 +5723,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
5992
5723
|
}
|
|
5993
5724
|
return _this3.t(resultKey, options);
|
|
5994
5725
|
};
|
|
5995
|
-
if (
|
|
5726
|
+
if (isString(lng)) {
|
|
5996
5727
|
fixedT.lng = lng;
|
|
5997
5728
|
} else {
|
|
5998
5729
|
fixedT.lngs = lng;
|
|
@@ -6049,7 +5780,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
6049
5780
|
if (callback) callback();
|
|
6050
5781
|
return Promise.resolve();
|
|
6051
5782
|
}
|
|
6052
|
-
if (
|
|
5783
|
+
if (isString(ns)) ns = [ns];
|
|
6053
5784
|
ns.forEach((n) => {
|
|
6054
5785
|
if (this.options.ns.indexOf(n) < 0) this.options.ns.push(n);
|
|
6055
5786
|
});
|
|
@@ -6061,7 +5792,7 @@ var I18n = class _I18n extends EventEmitter {
|
|
|
6061
5792
|
}
|
|
6062
5793
|
loadLanguages(lngs, callback) {
|
|
6063
5794
|
const deferred = defer();
|
|
6064
|
-
if (
|
|
5795
|
+
if (isString(lngs)) lngs = [lngs];
|
|
6065
5796
|
const preloaded = this.options.preload || [];
|
|
6066
5797
|
const newLngs = lngs.filter((lng) => preloaded.indexOf(lng) < 0 && this.services.languageUtils.isSupportedCode(lng));
|
|
6067
5798
|
if (!newLngs.length) {
|
|
@@ -6165,9 +5896,9 @@ var getFixedT = instance.getFixedT;
|
|
|
6165
5896
|
var t = instance.t;
|
|
6166
5897
|
var exists = instance.exists;
|
|
6167
5898
|
var setDefaultNamespace = instance.setDefaultNamespace;
|
|
6168
|
-
var
|
|
6169
|
-
var
|
|
6170
|
-
var
|
|
5899
|
+
var hasLoadedNamespace = instance.hasLoadedNamespace;
|
|
5900
|
+
var loadNamespaces = instance.loadNamespaces;
|
|
5901
|
+
var loadLanguages = instance.loadLanguages;
|
|
6171
5902
|
|
|
6172
5903
|
// src/context/embed.tsx
|
|
6173
5904
|
var import_merge = __toESM(require_merge());
|
|
@@ -10312,42 +10043,314 @@ Inflate$1.prototype.onEnd = function(status) {
|
|
|
10312
10043
|
if (this.options.to === "string") {
|
|
10313
10044
|
this.result = this.chunks.join("");
|
|
10314
10045
|
} else {
|
|
10315
|
-
this.result = common.flattenChunks(this.chunks);
|
|
10046
|
+
this.result = common.flattenChunks(this.chunks);
|
|
10047
|
+
}
|
|
10048
|
+
}
|
|
10049
|
+
this.chunks = [];
|
|
10050
|
+
this.err = status;
|
|
10051
|
+
this.msg = this.strm.msg;
|
|
10052
|
+
};
|
|
10053
|
+
function inflate$1(input, options) {
|
|
10054
|
+
const inflator = new Inflate$1(options);
|
|
10055
|
+
inflator.push(input);
|
|
10056
|
+
if (inflator.err) throw inflator.msg || messages[inflator.err];
|
|
10057
|
+
return inflator.result;
|
|
10058
|
+
}
|
|
10059
|
+
function inflateRaw$1(input, options) {
|
|
10060
|
+
options = options || {};
|
|
10061
|
+
options.raw = true;
|
|
10062
|
+
return inflate$1(input, options);
|
|
10063
|
+
}
|
|
10064
|
+
var Inflate_1$1 = Inflate$1;
|
|
10065
|
+
var inflate_2 = inflate$1;
|
|
10066
|
+
var inflateRaw_1$1 = inflateRaw$1;
|
|
10067
|
+
var ungzip$1 = inflate$1;
|
|
10068
|
+
var constants = constants$2;
|
|
10069
|
+
var inflate_1$1 = {
|
|
10070
|
+
Inflate: Inflate_1$1,
|
|
10071
|
+
inflate: inflate_2,
|
|
10072
|
+
inflateRaw: inflateRaw_1$1,
|
|
10073
|
+
ungzip: ungzip$1,
|
|
10074
|
+
constants
|
|
10075
|
+
};
|
|
10076
|
+
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
10077
|
+
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
10078
|
+
var inflate_1 = inflate;
|
|
10079
|
+
|
|
10080
|
+
// src/context/embed.tsx
|
|
10081
|
+
import { createContext as createContext2, useCallback as useCallback3, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
10082
|
+
|
|
10083
|
+
// node_modules/react-i18next/dist/es/Trans.js
|
|
10084
|
+
import { useContext } from "react";
|
|
10085
|
+
|
|
10086
|
+
// node_modules/react-i18next/dist/es/TransWithoutContext.js
|
|
10087
|
+
import { Fragment, isValidElement, cloneElement, createElement, Children } from "react";
|
|
10088
|
+
|
|
10089
|
+
// node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
|
|
10090
|
+
var import_void_elements = __toESM(require_void_elements());
|
|
10091
|
+
|
|
10092
|
+
// node_modules/react-i18next/dist/es/utils.js
|
|
10093
|
+
var warn = (i18n, code, msg, rest) => {
|
|
10094
|
+
const args = [msg, {
|
|
10095
|
+
code,
|
|
10096
|
+
...rest || {}
|
|
10097
|
+
}];
|
|
10098
|
+
if (i18n?.services?.logger?.forward) {
|
|
10099
|
+
return i18n.services.logger.forward(args, "warn", "react-i18next::", true);
|
|
10100
|
+
}
|
|
10101
|
+
if (isString2(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
10102
|
+
if (i18n?.services?.logger?.warn) {
|
|
10103
|
+
i18n.services.logger.warn(...args);
|
|
10104
|
+
} else if (console?.warn) {
|
|
10105
|
+
console.warn(...args);
|
|
10106
|
+
}
|
|
10107
|
+
};
|
|
10108
|
+
var alreadyWarned = {};
|
|
10109
|
+
var warnOnce = (i18n, code, msg, rest) => {
|
|
10110
|
+
if (isString2(msg) && alreadyWarned[msg]) return;
|
|
10111
|
+
if (isString2(msg)) alreadyWarned[msg] = /* @__PURE__ */ new Date();
|
|
10112
|
+
warn(i18n, code, msg, rest);
|
|
10113
|
+
};
|
|
10114
|
+
var loadedClb = (i18n, cb) => () => {
|
|
10115
|
+
if (i18n.isInitialized) {
|
|
10116
|
+
cb();
|
|
10117
|
+
} else {
|
|
10118
|
+
const initialized = () => {
|
|
10119
|
+
setTimeout(() => {
|
|
10120
|
+
i18n.off("initialized", initialized);
|
|
10121
|
+
}, 0);
|
|
10122
|
+
cb();
|
|
10123
|
+
};
|
|
10124
|
+
i18n.on("initialized", initialized);
|
|
10125
|
+
}
|
|
10126
|
+
};
|
|
10127
|
+
var loadNamespaces2 = (i18n, ns, cb) => {
|
|
10128
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
10129
|
+
};
|
|
10130
|
+
var loadLanguages2 = (i18n, lng, ns, cb) => {
|
|
10131
|
+
if (isString2(ns)) ns = [ns];
|
|
10132
|
+
if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces2(i18n, ns, cb);
|
|
10133
|
+
ns.forEach((n) => {
|
|
10134
|
+
if (i18n.options.ns.indexOf(n) < 0) i18n.options.ns.push(n);
|
|
10135
|
+
});
|
|
10136
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
10137
|
+
};
|
|
10138
|
+
var hasLoadedNamespace2 = (ns, i18n, options = {}) => {
|
|
10139
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
10140
|
+
warnOnce(i18n, "NO_LANGUAGES", "i18n.languages were undefined or empty", {
|
|
10141
|
+
languages: i18n.languages
|
|
10142
|
+
});
|
|
10143
|
+
return true;
|
|
10144
|
+
}
|
|
10145
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
10146
|
+
lng: options.lng,
|
|
10147
|
+
precheck: (i18nInstance2, loadNotPending) => {
|
|
10148
|
+
if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
|
|
10149
|
+
}
|
|
10150
|
+
});
|
|
10151
|
+
};
|
|
10152
|
+
var isString2 = (obj) => typeof obj === "string";
|
|
10153
|
+
var isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
10154
|
+
|
|
10155
|
+
// node_modules/react-i18next/dist/es/unescape.js
|
|
10156
|
+
var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
10157
|
+
var htmlEntities = {
|
|
10158
|
+
"&": "&",
|
|
10159
|
+
"&": "&",
|
|
10160
|
+
"<": "<",
|
|
10161
|
+
"<": "<",
|
|
10162
|
+
">": ">",
|
|
10163
|
+
">": ">",
|
|
10164
|
+
"'": "'",
|
|
10165
|
+
"'": "'",
|
|
10166
|
+
""": '"',
|
|
10167
|
+
""": '"',
|
|
10168
|
+
" ": " ",
|
|
10169
|
+
" ": " ",
|
|
10170
|
+
"©": "\xA9",
|
|
10171
|
+
"©": "\xA9",
|
|
10172
|
+
"®": "\xAE",
|
|
10173
|
+
"®": "\xAE",
|
|
10174
|
+
"…": "\u2026",
|
|
10175
|
+
"…": "\u2026",
|
|
10176
|
+
"/": "/",
|
|
10177
|
+
"/": "/"
|
|
10178
|
+
};
|
|
10179
|
+
var unescapeHtmlEntity = (m2) => htmlEntities[m2];
|
|
10180
|
+
var unescape = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
10181
|
+
|
|
10182
|
+
// node_modules/react-i18next/dist/es/defaults.js
|
|
10183
|
+
var defaultOptions = {
|
|
10184
|
+
bindI18n: "languageChanged",
|
|
10185
|
+
bindI18nStore: "",
|
|
10186
|
+
transEmptyNodeValue: "",
|
|
10187
|
+
transSupportBasicHtmlNodes: true,
|
|
10188
|
+
transWrapTextNodes: "",
|
|
10189
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
10190
|
+
useSuspense: true,
|
|
10191
|
+
unescape
|
|
10192
|
+
};
|
|
10193
|
+
var setDefaults = (options = {}) => {
|
|
10194
|
+
defaultOptions = {
|
|
10195
|
+
...defaultOptions,
|
|
10196
|
+
...options
|
|
10197
|
+
};
|
|
10198
|
+
};
|
|
10199
|
+
var getDefaults = () => defaultOptions;
|
|
10200
|
+
|
|
10201
|
+
// node_modules/react-i18next/dist/es/i18nInstance.js
|
|
10202
|
+
var i18nInstance;
|
|
10203
|
+
var setI18n = (instance2) => {
|
|
10204
|
+
i18nInstance = instance2;
|
|
10205
|
+
};
|
|
10206
|
+
var getI18n = () => i18nInstance;
|
|
10207
|
+
|
|
10208
|
+
// node_modules/react-i18next/dist/es/context.js
|
|
10209
|
+
import { createContext } from "react";
|
|
10210
|
+
|
|
10211
|
+
// node_modules/react-i18next/dist/es/initReactI18next.js
|
|
10212
|
+
var initReactI18next = {
|
|
10213
|
+
type: "3rdParty",
|
|
10214
|
+
init(instance2) {
|
|
10215
|
+
setDefaults(instance2.options.react);
|
|
10216
|
+
setI18n(instance2);
|
|
10217
|
+
}
|
|
10218
|
+
};
|
|
10219
|
+
|
|
10220
|
+
// node_modules/react-i18next/dist/es/context.js
|
|
10221
|
+
var I18nContext = createContext();
|
|
10222
|
+
var ReportNamespaces = class {
|
|
10223
|
+
constructor() {
|
|
10224
|
+
this.usedNamespaces = {};
|
|
10225
|
+
}
|
|
10226
|
+
addUsedNamespaces(namespaces) {
|
|
10227
|
+
namespaces.forEach((ns) => {
|
|
10228
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
10229
|
+
});
|
|
10230
|
+
}
|
|
10231
|
+
getUsedNamespaces() {
|
|
10232
|
+
return Object.keys(this.usedNamespaces);
|
|
10233
|
+
}
|
|
10234
|
+
};
|
|
10235
|
+
|
|
10236
|
+
// node_modules/react-i18next/dist/es/useTranslation.js
|
|
10237
|
+
import { useState, useEffect, useContext as useContext2, useRef, useCallback as useCallback2 } from "react";
|
|
10238
|
+
var usePrevious = (value, ignore) => {
|
|
10239
|
+
const ref = useRef();
|
|
10240
|
+
useEffect(() => {
|
|
10241
|
+
ref.current = ignore ? ref.current : value;
|
|
10242
|
+
}, [value, ignore]);
|
|
10243
|
+
return ref.current;
|
|
10244
|
+
};
|
|
10245
|
+
var alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
10246
|
+
var useMemoizedT = (i18n, language, namespace, keyPrefix) => useCallback2(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
10247
|
+
var useTranslation = (ns, props = {}) => {
|
|
10248
|
+
const {
|
|
10249
|
+
i18n: i18nFromProps
|
|
10250
|
+
} = props;
|
|
10251
|
+
const {
|
|
10252
|
+
i18n: i18nFromContext,
|
|
10253
|
+
defaultNS: defaultNSFromContext
|
|
10254
|
+
} = useContext2(I18nContext) || {};
|
|
10255
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
10256
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
10257
|
+
if (!i18n) {
|
|
10258
|
+
warnOnce(i18n, "NO_I18NEXT_INSTANCE", "useTranslation: You will need to pass in an i18next instance by using initReactI18next");
|
|
10259
|
+
const notReadyT = (k2, optsOrDefaultValue) => {
|
|
10260
|
+
if (isString2(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
10261
|
+
if (isObject(optsOrDefaultValue) && isString2(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
10262
|
+
return Array.isArray(k2) ? k2[k2.length - 1] : k2;
|
|
10263
|
+
};
|
|
10264
|
+
const retNotReady = [notReadyT, {}, false];
|
|
10265
|
+
retNotReady.t = notReadyT;
|
|
10266
|
+
retNotReady.i18n = {};
|
|
10267
|
+
retNotReady.ready = false;
|
|
10268
|
+
return retNotReady;
|
|
10269
|
+
}
|
|
10270
|
+
if (i18n.options.react?.wait) warnOnce(i18n, "DEPRECATED_OPTION", "useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
10271
|
+
const i18nOptions = {
|
|
10272
|
+
...getDefaults(),
|
|
10273
|
+
...i18n.options.react,
|
|
10274
|
+
...props
|
|
10275
|
+
};
|
|
10276
|
+
const {
|
|
10277
|
+
useSuspense,
|
|
10278
|
+
keyPrefix
|
|
10279
|
+
} = i18nOptions;
|
|
10280
|
+
let namespaces = ns || defaultNSFromContext || i18n.options?.defaultNS;
|
|
10281
|
+
namespaces = isString2(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
10282
|
+
i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
|
|
10283
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n) => hasLoadedNamespace2(n, i18n, i18nOptions));
|
|
10284
|
+
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
10285
|
+
const getT = () => memoGetT;
|
|
10286
|
+
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
10287
|
+
const [t2, setT] = useState(getT);
|
|
10288
|
+
let joinedNS = namespaces.join();
|
|
10289
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
10290
|
+
const previousJoinedNS = usePrevious(joinedNS);
|
|
10291
|
+
const isMounted = useRef(true);
|
|
10292
|
+
useEffect(() => {
|
|
10293
|
+
const {
|
|
10294
|
+
bindI18n,
|
|
10295
|
+
bindI18nStore
|
|
10296
|
+
} = i18nOptions;
|
|
10297
|
+
isMounted.current = true;
|
|
10298
|
+
if (!ready && !useSuspense) {
|
|
10299
|
+
if (props.lng) {
|
|
10300
|
+
loadLanguages2(i18n, props.lng, namespaces, () => {
|
|
10301
|
+
if (isMounted.current) setT(getNewT);
|
|
10302
|
+
});
|
|
10303
|
+
} else {
|
|
10304
|
+
loadNamespaces2(i18n, namespaces, () => {
|
|
10305
|
+
if (isMounted.current) setT(getNewT);
|
|
10306
|
+
});
|
|
10307
|
+
}
|
|
10308
|
+
}
|
|
10309
|
+
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
10310
|
+
setT(getNewT);
|
|
10311
|
+
}
|
|
10312
|
+
const boundReset = () => {
|
|
10313
|
+
if (isMounted.current) setT(getNewT);
|
|
10314
|
+
};
|
|
10315
|
+
if (bindI18n) i18n?.on(bindI18n, boundReset);
|
|
10316
|
+
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
|
|
10317
|
+
return () => {
|
|
10318
|
+
isMounted.current = false;
|
|
10319
|
+
if (i18n) bindI18n?.split(" ").forEach((e2) => i18n.off(e2, boundReset));
|
|
10320
|
+
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
|
|
10321
|
+
};
|
|
10322
|
+
}, [i18n, joinedNS]);
|
|
10323
|
+
useEffect(() => {
|
|
10324
|
+
if (isMounted.current && ready) {
|
|
10325
|
+
setT(getT);
|
|
10326
|
+
}
|
|
10327
|
+
}, [i18n, keyPrefix, ready]);
|
|
10328
|
+
const ret = [t2, i18n, ready];
|
|
10329
|
+
ret.t = t2;
|
|
10330
|
+
ret.i18n = i18n;
|
|
10331
|
+
ret.ready = ready;
|
|
10332
|
+
if (ready) return ret;
|
|
10333
|
+
if (!ready && !useSuspense) return ret;
|
|
10334
|
+
throw new Promise((resolve) => {
|
|
10335
|
+
if (props.lng) {
|
|
10336
|
+
loadLanguages2(i18n, props.lng, namespaces, () => resolve());
|
|
10337
|
+
} else {
|
|
10338
|
+
loadNamespaces2(i18n, namespaces, () => resolve());
|
|
10316
10339
|
}
|
|
10317
|
-
}
|
|
10318
|
-
this.chunks = [];
|
|
10319
|
-
this.err = status;
|
|
10320
|
-
this.msg = this.strm.msg;
|
|
10321
|
-
};
|
|
10322
|
-
function inflate$1(input, options) {
|
|
10323
|
-
const inflator = new Inflate$1(options);
|
|
10324
|
-
inflator.push(input);
|
|
10325
|
-
if (inflator.err) throw inflator.msg || messages[inflator.err];
|
|
10326
|
-
return inflator.result;
|
|
10327
|
-
}
|
|
10328
|
-
function inflateRaw$1(input, options) {
|
|
10329
|
-
options = options || {};
|
|
10330
|
-
options.raw = true;
|
|
10331
|
-
return inflate$1(input, options);
|
|
10332
|
-
}
|
|
10333
|
-
var Inflate_1$1 = Inflate$1;
|
|
10334
|
-
var inflate_2 = inflate$1;
|
|
10335
|
-
var inflateRaw_1$1 = inflateRaw$1;
|
|
10336
|
-
var ungzip$1 = inflate$1;
|
|
10337
|
-
var constants = constants$2;
|
|
10338
|
-
var inflate_1$1 = {
|
|
10339
|
-
Inflate: Inflate_1$1,
|
|
10340
|
-
inflate: inflate_2,
|
|
10341
|
-
inflateRaw: inflateRaw_1$1,
|
|
10342
|
-
ungzip: ungzip$1,
|
|
10343
|
-
constants
|
|
10340
|
+
});
|
|
10344
10341
|
};
|
|
10345
|
-
var { Deflate, deflate, deflateRaw, gzip } = deflate_1$1;
|
|
10346
|
-
var { Inflate, inflate, inflateRaw, ungzip } = inflate_1$1;
|
|
10347
|
-
var inflate_1 = inflate;
|
|
10348
10342
|
|
|
10349
|
-
//
|
|
10350
|
-
import {
|
|
10343
|
+
// node_modules/react-i18next/dist/es/withTranslation.js
|
|
10344
|
+
import { createElement as createElement2, forwardRef as forwardRefReact } from "react";
|
|
10345
|
+
|
|
10346
|
+
// node_modules/react-i18next/dist/es/I18nextProvider.js
|
|
10347
|
+
import { createElement as createElement3, useMemo as useMemo2 } from "react";
|
|
10348
|
+
|
|
10349
|
+
// node_modules/react-i18next/dist/es/withSSR.js
|
|
10350
|
+
import { createElement as createElement4 } from "react";
|
|
10351
|
+
|
|
10352
|
+
// node_modules/react-i18next/dist/es/useSSR.js
|
|
10353
|
+
import { useContext as useContext3 } from "react";
|
|
10351
10354
|
|
|
10352
10355
|
// node_modules/uuid/dist/esm-browser/stringify.js
|
|
10353
10356
|
var byteToHex = [];
|
|
@@ -10672,7 +10675,24 @@ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10672
10675
|
id: json["id"],
|
|
10673
10676
|
interval: json["interval"],
|
|
10674
10677
|
price: json["price"],
|
|
10675
|
-
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"]
|
|
10678
|
+
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10679
|
+
scheme: json["scheme"]
|
|
10680
|
+
};
|
|
10681
|
+
}
|
|
10682
|
+
|
|
10683
|
+
// src/api/models/BillingProductPriceTierResponseData.ts
|
|
10684
|
+
function BillingProductPriceTierResponseDataFromJSON(json) {
|
|
10685
|
+
return BillingProductPriceTierResponseDataFromJSONTyped(json, false);
|
|
10686
|
+
}
|
|
10687
|
+
function BillingProductPriceTierResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
10688
|
+
if (json == null) {
|
|
10689
|
+
return json;
|
|
10690
|
+
}
|
|
10691
|
+
return {
|
|
10692
|
+
flatAmount: json["flat_amount"] == null ? void 0 : json["flat_amount"],
|
|
10693
|
+
perUnitPrice: json["per_unit_price"] == null ? void 0 : json["per_unit_price"],
|
|
10694
|
+
perUnitPriceDecimal: json["per_unit_price_decimal"] == null ? void 0 : json["per_unit_price_decimal"],
|
|
10695
|
+
upTo: json["up_to"] == null ? void 0 : json["up_to"]
|
|
10676
10696
|
};
|
|
10677
10697
|
}
|
|
10678
10698
|
|
|
@@ -10685,6 +10705,7 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10685
10705
|
return json;
|
|
10686
10706
|
}
|
|
10687
10707
|
return {
|
|
10708
|
+
billingScheme: json["billing_scheme"],
|
|
10688
10709
|
createdAt: new Date(json["created_at"]),
|
|
10689
10710
|
currency: json["currency"],
|
|
10690
10711
|
id: json["id"],
|
|
@@ -10695,6 +10716,9 @@ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
10695
10716
|
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10696
10717
|
priceExternalId: json["price_external_id"],
|
|
10697
10718
|
priceId: json["price_id"],
|
|
10719
|
+
priceTier: json["price_tier"].map(
|
|
10720
|
+
BillingProductPriceTierResponseDataFromJSON
|
|
10721
|
+
),
|
|
10698
10722
|
productExternalId: json["product_external_id"],
|
|
10699
10723
|
productId: json["product_id"],
|
|
10700
10724
|
productName: json["product_name"],
|
|
@@ -10739,6 +10763,7 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10739
10763
|
return json;
|
|
10740
10764
|
}
|
|
10741
10765
|
return {
|
|
10766
|
+
billingScheme: json["billing_scheme"],
|
|
10742
10767
|
createdAt: new Date(json["created_at"]),
|
|
10743
10768
|
currency: json["currency"],
|
|
10744
10769
|
environmentId: json["environment_id"],
|
|
@@ -10751,6 +10776,9 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10751
10776
|
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10752
10777
|
priceExternalId: json["price_external_id"],
|
|
10753
10778
|
priceId: json["price_id"],
|
|
10779
|
+
priceTier: json["price_tier"].map(
|
|
10780
|
+
BillingProductPriceTierResponseDataFromJSON
|
|
10781
|
+
),
|
|
10754
10782
|
quantity: json["quantity"],
|
|
10755
10783
|
subscriptionId: json["subscription_id"],
|
|
10756
10784
|
updatedAt: new Date(json["updated_at"]),
|
|
@@ -10758,6 +10786,29 @@ function BillingProductForSubscriptionResponseDataFromJSONTyped(json, ignoreDisc
|
|
|
10758
10786
|
};
|
|
10759
10787
|
}
|
|
10760
10788
|
|
|
10789
|
+
// src/api/models/BillingProductResponseData.ts
|
|
10790
|
+
function BillingProductResponseDataFromJSON(json) {
|
|
10791
|
+
return BillingProductResponseDataFromJSONTyped(json, false);
|
|
10792
|
+
}
|
|
10793
|
+
function BillingProductResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
10794
|
+
if (json == null) {
|
|
10795
|
+
return json;
|
|
10796
|
+
}
|
|
10797
|
+
return {
|
|
10798
|
+
accountId: json["account_id"],
|
|
10799
|
+
createdAt: new Date(json["created_at"]),
|
|
10800
|
+
currency: json["currency"],
|
|
10801
|
+
environmentId: json["environment_id"],
|
|
10802
|
+
externalId: json["external_id"],
|
|
10803
|
+
name: json["name"],
|
|
10804
|
+
price: json["price"],
|
|
10805
|
+
priceDecimal: json["price_decimal"] == null ? void 0 : json["price_decimal"],
|
|
10806
|
+
productId: json["product_id"],
|
|
10807
|
+
quantity: json["quantity"],
|
|
10808
|
+
updatedAt: new Date(json["updated_at"])
|
|
10809
|
+
};
|
|
10810
|
+
}
|
|
10811
|
+
|
|
10761
10812
|
// src/api/models/BillingSubscriptionDiscountView.ts
|
|
10762
10813
|
function BillingSubscriptionDiscountViewFromJSON(json) {
|
|
10763
10814
|
return BillingSubscriptionDiscountViewFromJSONTyped(json, false);
|
|
@@ -11428,6 +11479,7 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11428
11479
|
ruleIdUsageExceeded: json["rule_id_usage_exceeded"] == null ? void 0 : json["rule_id_usage_exceeded"],
|
|
11429
11480
|
softLimit: json["soft_limit"] == null ? void 0 : json["soft_limit"],
|
|
11430
11481
|
updatedAt: new Date(json["updated_at"]),
|
|
11482
|
+
usageBasedProduct: json["usage_based_product"] == null ? void 0 : BillingProductResponseDataFromJSON(json["usage_based_product"]),
|
|
11431
11483
|
valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
|
|
11432
11484
|
valueNumeric: json["value_numeric"] == null ? void 0 : json["value_numeric"],
|
|
11433
11485
|
valueTrait: json["value_trait"] == null ? void 0 : EntityTraitDefinitionResponseDataFromJSON(json["value_trait"]),
|
|
@@ -11776,6 +11828,26 @@ function ListInvoicesResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11776
11828
|
};
|
|
11777
11829
|
}
|
|
11778
11830
|
|
|
11831
|
+
// src/api/models/PreviewSubscriptionFinanceResponseData.ts
|
|
11832
|
+
function PreviewSubscriptionFinanceResponseDataFromJSON(json) {
|
|
11833
|
+
return PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, false);
|
|
11834
|
+
}
|
|
11835
|
+
function PreviewSubscriptionFinanceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
11836
|
+
if (json == null) {
|
|
11837
|
+
return json;
|
|
11838
|
+
}
|
|
11839
|
+
return {
|
|
11840
|
+
amountOff: json["amount_off"],
|
|
11841
|
+
dueNow: json["due_now"],
|
|
11842
|
+
newCharges: json["new_charges"],
|
|
11843
|
+
percentOff: json["percent_off"],
|
|
11844
|
+
periodStart: new Date(json["period_start"]),
|
|
11845
|
+
promoCodeApplied: json["promo_code_applied"],
|
|
11846
|
+
proration: json["proration"],
|
|
11847
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
11848
|
+
};
|
|
11849
|
+
}
|
|
11850
|
+
|
|
11779
11851
|
// src/api/models/PreviewSubscriptionChangeResponseData.ts
|
|
11780
11852
|
function PreviewSubscriptionChangeResponseDataFromJSON(json) {
|
|
11781
11853
|
return PreviewSubscriptionChangeResponseDataFromJSONTyped(json, false);
|
|
@@ -11787,12 +11859,16 @@ function PreviewSubscriptionChangeResponseDataFromJSONTyped(json, ignoreDiscrimi
|
|
|
11787
11859
|
return {
|
|
11788
11860
|
amountOff: json["amount_off"],
|
|
11789
11861
|
dueNow: json["due_now"],
|
|
11862
|
+
finance: json["finance"] == null ? void 0 : PreviewSubscriptionFinanceResponseDataFromJSON(json["finance"]),
|
|
11790
11863
|
newCharges: json["new_charges"],
|
|
11791
11864
|
percentOff: json["percent_off"],
|
|
11792
11865
|
periodStart: new Date(json["period_start"]),
|
|
11793
11866
|
promoCodeApplied: json["promo_code_applied"],
|
|
11794
11867
|
proration: json["proration"],
|
|
11795
|
-
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"])
|
|
11868
|
+
trialEnd: json["trial_end"] == null ? void 0 : new Date(json["trial_end"]),
|
|
11869
|
+
usageViolations: json["usage_violations"].map(
|
|
11870
|
+
FeatureUsageResponseDataFromJSON
|
|
11871
|
+
)
|
|
11796
11872
|
};
|
|
11797
11873
|
}
|
|
11798
11874
|
|
|
@@ -13061,7 +13137,7 @@ var EmbedProvider = ({
|
|
|
13061
13137
|
useEffect2(() => {
|
|
13062
13138
|
if (accessToken) {
|
|
13063
13139
|
const { headers = {} } = apiConfig ?? {};
|
|
13064
|
-
headers["X-Schematic-Components-Version"] = "0.7.
|
|
13140
|
+
headers["X-Schematic-Components-Version"] = "0.7.4";
|
|
13065
13141
|
headers["X-Schematic-Session-ID"] = sessionIdRef.current;
|
|
13066
13142
|
const config = new Configuration({
|
|
13067
13143
|
...apiConfig,
|
|
@@ -13400,9 +13476,6 @@ function useWrapChildren(elements) {
|
|
|
13400
13476
|
return shouldWrap.some((wrap) => wrap);
|
|
13401
13477
|
}
|
|
13402
13478
|
|
|
13403
|
-
// src/components/layout/card/Card.tsx
|
|
13404
|
-
import { forwardRef as forwardRef3 } from "react";
|
|
13405
|
-
|
|
13406
13479
|
// src/components/ui/box/styles.ts
|
|
13407
13480
|
var Box = dt.div((props) => {
|
|
13408
13481
|
function reducer(acc, [key, value]) {
|
|
@@ -13617,6 +13690,8 @@ var EmbedButton = dt(Button2)`
|
|
|
13617
13690
|
font-family: "Public Sans", sans-serif;
|
|
13618
13691
|
font-weight: 500;
|
|
13619
13692
|
text-align: center;
|
|
13693
|
+
display: flex;
|
|
13694
|
+
align-items: center;
|
|
13620
13695
|
|
|
13621
13696
|
${({ disabled, $color = "primary", theme }) => {
|
|
13622
13697
|
const { l: l2 } = hexToHSL(theme[$color]);
|
|
@@ -13764,6 +13839,24 @@ var EmbedButton = dt(Button2)`
|
|
|
13764
13839
|
`;
|
|
13765
13840
|
}
|
|
13766
13841
|
}}
|
|
13842
|
+
|
|
13843
|
+
${({ $selfAlignment = "center" }) => {
|
|
13844
|
+
switch ($selfAlignment) {
|
|
13845
|
+
case "start":
|
|
13846
|
+
return lt`
|
|
13847
|
+
align-self: start;
|
|
13848
|
+
`;
|
|
13849
|
+
case "end":
|
|
13850
|
+
return lt`
|
|
13851
|
+
align-self: end;
|
|
13852
|
+
`;
|
|
13853
|
+
case "center":
|
|
13854
|
+
default:
|
|
13855
|
+
return lt`
|
|
13856
|
+
align-self: center;
|
|
13857
|
+
`;
|
|
13858
|
+
}
|
|
13859
|
+
}}
|
|
13767
13860
|
|
|
13768
13861
|
${({ $fullWidth = true }) => {
|
|
13769
13862
|
if ($fullWidth) {
|
|
@@ -14227,14 +14320,6 @@ var ModalHeader = ({
|
|
|
14227
14320
|
);
|
|
14228
14321
|
};
|
|
14229
14322
|
|
|
14230
|
-
// src/components/ui/progress-bar/styles.ts
|
|
14231
|
-
var Container3 = dt.div`
|
|
14232
|
-
position: relative;
|
|
14233
|
-
display: flex;
|
|
14234
|
-
align-items: center;
|
|
14235
|
-
gap: 1rem;
|
|
14236
|
-
`;
|
|
14237
|
-
|
|
14238
14323
|
// src/components/ui/progress-bar/ProgressBar.tsx
|
|
14239
14324
|
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
14240
14325
|
var progressColorMap = [
|
|
@@ -14251,7 +14336,6 @@ var ProgressBar = ({
|
|
|
14251
14336
|
total = 0,
|
|
14252
14337
|
color = "gray",
|
|
14253
14338
|
bgColor = "#F2F4F7",
|
|
14254
|
-
barWidth = "100%",
|
|
14255
14339
|
...props
|
|
14256
14340
|
}) => {
|
|
14257
14341
|
const theme = nt();
|
|
@@ -14262,18 +14346,18 @@ var ProgressBar = ({
|
|
|
14262
14346
|
orange: "#DB6769",
|
|
14263
14347
|
red: "#EF4444"
|
|
14264
14348
|
};
|
|
14265
|
-
return /* @__PURE__ */ jsxs4(
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14349
|
+
return /* @__PURE__ */ jsxs4(
|
|
14350
|
+
Flex,
|
|
14351
|
+
{
|
|
14352
|
+
$position: "relative",
|
|
14353
|
+
$alignItems: "center",
|
|
14354
|
+
$gap: "1rem",
|
|
14355
|
+
$width: "100%",
|
|
14356
|
+
...props,
|
|
14357
|
+
children: [
|
|
14358
|
+
/* @__PURE__ */ jsx7(
|
|
14359
|
+
Box,
|
|
14275
14360
|
{
|
|
14276
|
-
$position: "relative",
|
|
14277
14361
|
$overflow: "hidden",
|
|
14278
14362
|
$width: "100%",
|
|
14279
14363
|
$height: `${8 / TEXT_BASE_SIZE}rem`,
|
|
@@ -14284,29 +14368,28 @@ var ProgressBar = ({
|
|
|
14284
14368
|
{
|
|
14285
14369
|
$width: `${Math.min(progress, 100)}%`,
|
|
14286
14370
|
$height: "100%",
|
|
14287
|
-
$backgroundColor: barColorMap[color]
|
|
14288
|
-
$borderRadius: "9999px"
|
|
14371
|
+
$backgroundColor: barColorMap[color]
|
|
14289
14372
|
}
|
|
14290
14373
|
)
|
|
14291
14374
|
}
|
|
14375
|
+
),
|
|
14376
|
+
total && /* @__PURE__ */ jsxs4(
|
|
14377
|
+
Text,
|
|
14378
|
+
{
|
|
14379
|
+
$font: theme.typography.text.fontFamily,
|
|
14380
|
+
$size: 14,
|
|
14381
|
+
$weight: 500,
|
|
14382
|
+
$color: theme.typography.text.color,
|
|
14383
|
+
children: [
|
|
14384
|
+
value,
|
|
14385
|
+
"/",
|
|
14386
|
+
total
|
|
14387
|
+
]
|
|
14388
|
+
}
|
|
14292
14389
|
)
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
Text,
|
|
14297
|
-
{
|
|
14298
|
-
$font: theme.typography.text.fontFamily,
|
|
14299
|
-
$size: 14,
|
|
14300
|
-
$weight: 500,
|
|
14301
|
-
$color: theme.typography.text.color,
|
|
14302
|
-
children: [
|
|
14303
|
-
value,
|
|
14304
|
-
"/",
|
|
14305
|
-
total
|
|
14306
|
-
]
|
|
14307
|
-
}
|
|
14308
|
-
)
|
|
14309
|
-
] });
|
|
14390
|
+
]
|
|
14391
|
+
}
|
|
14392
|
+
);
|
|
14310
14393
|
};
|
|
14311
14394
|
|
|
14312
14395
|
// src/components/ui/text/styles.ts
|
|
@@ -14355,7 +14438,9 @@ import { useCallback as useCallback6, useLayoutEffect as useLayoutEffect3, useRe
|
|
|
14355
14438
|
import { createPortal } from "react-dom";
|
|
14356
14439
|
|
|
14357
14440
|
// src/components/ui/tooltip/styles.ts
|
|
14358
|
-
var Trigger = dt.div
|
|
14441
|
+
var Trigger = dt.div`
|
|
14442
|
+
width: 100%;
|
|
14443
|
+
`;
|
|
14359
14444
|
var coords = (position2) => {
|
|
14360
14445
|
let x2 = 0;
|
|
14361
14446
|
let y2 = 0;
|
|
@@ -14511,13 +14596,15 @@ var Tooltip = ({
|
|
|
14511
14596
|
}
|
|
14512
14597
|
}, [position2]);
|
|
14513
14598
|
useLayoutEffect3(() => {
|
|
14514
|
-
updateCoords();
|
|
14515
14599
|
const handleResize = (0, import_debounce.default)(updateCoords, DEBOUNCE_TIMEOUT);
|
|
14516
14600
|
window.addEventListener("resize", handleResize);
|
|
14517
14601
|
return () => {
|
|
14518
14602
|
window.removeEventListener("resize", handleResize);
|
|
14519
14603
|
};
|
|
14520
14604
|
}, [updateCoords]);
|
|
14605
|
+
useLayoutEffect3(() => {
|
|
14606
|
+
updateCoords();
|
|
14607
|
+
}, [updateCoords, show]);
|
|
14521
14608
|
return /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
14522
14609
|
/* @__PURE__ */ jsx8(
|
|
14523
14610
|
Trigger,
|
|
@@ -16242,7 +16329,7 @@ var AddOns = ({ addOns, toggle, isLoading, period }) => {
|
|
|
16242
16329
|
};
|
|
16243
16330
|
|
|
16244
16331
|
// node_modules/@stripe/stripe-js/dist/index.mjs
|
|
16245
|
-
var RELEASE_TRAIN = "
|
|
16332
|
+
var RELEASE_TRAIN = "basil";
|
|
16246
16333
|
var runtimeVersionToUrlVersion = function runtimeVersionToUrlVersion2(version) {
|
|
16247
16334
|
return version === 3 ? "v3" : version;
|
|
16248
16335
|
};
|
|
@@ -16282,7 +16369,7 @@ var registerWrapper = function registerWrapper2(stripe, startTime) {
|
|
|
16282
16369
|
}
|
|
16283
16370
|
stripe._registerWrapper({
|
|
16284
16371
|
name: "stripe-js",
|
|
16285
|
-
version: "
|
|
16372
|
+
version: "7.0.0",
|
|
16286
16373
|
startTime
|
|
16287
16374
|
});
|
|
16288
16375
|
};
|
|
@@ -16357,7 +16444,7 @@ var initStripe = function initStripe2(maybeStripe, args, startTime) {
|
|
|
16357
16444
|
var version = runtimeVersionToUrlVersion(maybeStripe.version);
|
|
16358
16445
|
var expectedVersion = RELEASE_TRAIN;
|
|
16359
16446
|
if (isTestKey && version !== expectedVersion) {
|
|
16360
|
-
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("
|
|
16447
|
+
console.warn("Stripe.js@".concat(version, " was loaded on the page, but @stripe/stripe-js@").concat("7.0.0", " expected Stripe.js@").concat(expectedVersion, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
|
|
16361
16448
|
}
|
|
16362
16449
|
var stripe = maybeStripe.apply(void 0, args);
|
|
16363
16450
|
registerWrapper(stripe, startTime);
|
|
@@ -17359,7 +17446,7 @@ var CheckoutDialog = ({ top = 0 }) => {
|
|
|
17359
17446
|
promoCode: updates.promoCode || promoCode
|
|
17360
17447
|
}
|
|
17361
17448
|
});
|
|
17362
|
-
setCharges(data2);
|
|
17449
|
+
setCharges(data2.finance);
|
|
17363
17450
|
} catch (error2) {
|
|
17364
17451
|
if (error2 instanceof ResponseError && error2.response.status === 401) {
|
|
17365
17452
|
const data2 = await error2.response.json();
|
|
@@ -18288,9 +18375,72 @@ var Viewport = forwardRef6(
|
|
|
18288
18375
|
);
|
|
18289
18376
|
Viewport.displayName = "Viewport";
|
|
18290
18377
|
|
|
18378
|
+
// src/components/elements/button/Button.tsx
|
|
18379
|
+
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
18380
|
+
var resolveDesignProps = (props) => {
|
|
18381
|
+
return {
|
|
18382
|
+
button: {
|
|
18383
|
+
link: props.button?.link ?? "",
|
|
18384
|
+
openInNewTab: props.button?.openInNewTab ?? true,
|
|
18385
|
+
text: props.button?.text ?? "Button",
|
|
18386
|
+
style: props.button?.style ?? "primary",
|
|
18387
|
+
size: props.button?.size ?? "md",
|
|
18388
|
+
fullWidth: props.button?.fullWidth ?? true,
|
|
18389
|
+
alignment: props.button?.alignment ?? "center",
|
|
18390
|
+
selfAlignment: props.button?.selfAlignment ?? "center"
|
|
18391
|
+
}
|
|
18392
|
+
};
|
|
18393
|
+
};
|
|
18394
|
+
var ButtonElement = forwardRef7(({ children, className, ...rest }, ref) => {
|
|
18395
|
+
const props = resolveDesignProps(rest);
|
|
18396
|
+
const buttonStyles = {
|
|
18397
|
+
primary: {
|
|
18398
|
+
color: "primary",
|
|
18399
|
+
variant: "filled"
|
|
18400
|
+
},
|
|
18401
|
+
secondary: {
|
|
18402
|
+
color: "primary",
|
|
18403
|
+
variant: "outline"
|
|
18404
|
+
},
|
|
18405
|
+
tertiary: {
|
|
18406
|
+
color: "primary",
|
|
18407
|
+
variant: "text"
|
|
18408
|
+
}
|
|
18409
|
+
};
|
|
18410
|
+
return /* @__PURE__ */ jsx27(
|
|
18411
|
+
Element,
|
|
18412
|
+
{
|
|
18413
|
+
as: Flex,
|
|
18414
|
+
ref,
|
|
18415
|
+
className,
|
|
18416
|
+
$flexDirection: "column",
|
|
18417
|
+
$gap: "2rem",
|
|
18418
|
+
children: /* @__PURE__ */ jsx27(
|
|
18419
|
+
EmbedButton,
|
|
18420
|
+
{
|
|
18421
|
+
as: "a",
|
|
18422
|
+
href: props.button.link,
|
|
18423
|
+
target: props.button.openInNewTab ? "_blank" : "_self",
|
|
18424
|
+
$size: props.button.size,
|
|
18425
|
+
$color: buttonStyles[props.button.style].color,
|
|
18426
|
+
$variant: buttonStyles[props.button.style].variant,
|
|
18427
|
+
$alignment: props.button.alignment,
|
|
18428
|
+
$selfAlignment: props.button.selfAlignment,
|
|
18429
|
+
$fullWidth: props.button.fullWidth,
|
|
18430
|
+
children: props.button.text
|
|
18431
|
+
}
|
|
18432
|
+
)
|
|
18433
|
+
}
|
|
18434
|
+
);
|
|
18435
|
+
});
|
|
18436
|
+
ButtonElement.displayName = "Button";
|
|
18437
|
+
|
|
18438
|
+
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
18439
|
+
import { forwardRef as forwardRef8, useMemo as useMemo9, useRef as useRef7, useState as useState12 } from "react";
|
|
18440
|
+
|
|
18291
18441
|
// src/components/elements/included-features/Details.tsx
|
|
18292
18442
|
import { useMemo as useMemo8 } from "react";
|
|
18293
|
-
import { jsx as
|
|
18443
|
+
import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
18294
18444
|
var Details = ({
|
|
18295
18445
|
shouldWrapChildren,
|
|
18296
18446
|
featureUsage,
|
|
@@ -18389,7 +18539,7 @@ var Details = ({
|
|
|
18389
18539
|
$flexGrow: "1",
|
|
18390
18540
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
18391
18541
|
children: [
|
|
18392
|
-
props.entitlement.isVisible && /* @__PURE__ */
|
|
18542
|
+
props.entitlement.isVisible && /* @__PURE__ */ jsx28(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx28(
|
|
18393
18543
|
Text,
|
|
18394
18544
|
{
|
|
18395
18545
|
$font: theme.typography[props.entitlement.fontStyle].fontFamily,
|
|
@@ -18400,7 +18550,7 @@ var Details = ({
|
|
|
18400
18550
|
children: text
|
|
18401
18551
|
}
|
|
18402
18552
|
) }),
|
|
18403
|
-
props.usage.isVisible && usageText && /* @__PURE__ */
|
|
18553
|
+
props.usage.isVisible && usageText && /* @__PURE__ */ jsx28(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx28(
|
|
18404
18554
|
Text,
|
|
18405
18555
|
{
|
|
18406
18556
|
$font: theme.typography[props.usage.fontStyle].fontFamily,
|
|
@@ -18417,8 +18567,8 @@ var Details = ({
|
|
|
18417
18567
|
};
|
|
18418
18568
|
|
|
18419
18569
|
// src/components/elements/included-features/IncludedFeatures.tsx
|
|
18420
|
-
import { jsx as
|
|
18421
|
-
function
|
|
18570
|
+
import { jsx as jsx29, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
18571
|
+
function resolveDesignProps2(props) {
|
|
18422
18572
|
return {
|
|
18423
18573
|
header: {
|
|
18424
18574
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -18446,8 +18596,8 @@ function resolveDesignProps(props) {
|
|
|
18446
18596
|
visibleFeatures: props.visibleFeatures
|
|
18447
18597
|
};
|
|
18448
18598
|
}
|
|
18449
|
-
var IncludedFeatures =
|
|
18450
|
-
const props =
|
|
18599
|
+
var IncludedFeatures = forwardRef8(({ className, ...rest }, ref) => {
|
|
18600
|
+
const props = resolveDesignProps2(rest);
|
|
18451
18601
|
const { t: t2 } = useTranslation();
|
|
18452
18602
|
const theme = nt();
|
|
18453
18603
|
const { data } = useEmbed();
|
|
@@ -18491,7 +18641,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18491
18641
|
$flexDirection: "column",
|
|
18492
18642
|
$gap: "1rem",
|
|
18493
18643
|
children: [
|
|
18494
|
-
props.header.isVisible && /* @__PURE__ */
|
|
18644
|
+
props.header.isVisible && /* @__PURE__ */ jsx29(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx29(
|
|
18495
18645
|
Text,
|
|
18496
18646
|
{
|
|
18497
18647
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -18525,7 +18675,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18525
18675
|
$flexBasis: "min-content",
|
|
18526
18676
|
$gap: "1rem",
|
|
18527
18677
|
children: [
|
|
18528
|
-
props.icons.isVisible && feature?.icon && /* @__PURE__ */
|
|
18678
|
+
props.icons.isVisible && feature?.icon && /* @__PURE__ */ jsx29(
|
|
18529
18679
|
IconRound,
|
|
18530
18680
|
{
|
|
18531
18681
|
name: feature.icon,
|
|
@@ -18536,7 +18686,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18536
18686
|
]
|
|
18537
18687
|
}
|
|
18538
18688
|
),
|
|
18539
|
-
feature?.name && /* @__PURE__ */
|
|
18689
|
+
feature?.name && /* @__PURE__ */ jsx29(
|
|
18540
18690
|
Text,
|
|
18541
18691
|
{
|
|
18542
18692
|
$font: theme.typography[props.icons.fontStyle].fontFamily,
|
|
@@ -18566,7 +18716,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18566
18716
|
]
|
|
18567
18717
|
}
|
|
18568
18718
|
),
|
|
18569
|
-
shouldShowDetails && /* @__PURE__ */
|
|
18719
|
+
shouldShowDetails && /* @__PURE__ */ jsx29(
|
|
18570
18720
|
Details,
|
|
18571
18721
|
{
|
|
18572
18722
|
featureUsage: usage,
|
|
@@ -18580,7 +18730,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18580
18730
|
);
|
|
18581
18731
|
}),
|
|
18582
18732
|
shouldShowExpand && /* @__PURE__ */ jsxs22(Flex, { $alignItems: "center", $justifyContent: "start", $marginTop: "1rem", children: [
|
|
18583
|
-
/* @__PURE__ */
|
|
18733
|
+
/* @__PURE__ */ jsx29(
|
|
18584
18734
|
Icon2,
|
|
18585
18735
|
{
|
|
18586
18736
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -18592,7 +18742,7 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18592
18742
|
}
|
|
18593
18743
|
}
|
|
18594
18744
|
),
|
|
18595
|
-
/* @__PURE__ */
|
|
18745
|
+
/* @__PURE__ */ jsx29(
|
|
18596
18746
|
Text,
|
|
18597
18747
|
{
|
|
18598
18748
|
onClick: handleToggleShowAll,
|
|
@@ -18613,9 +18763,9 @@ var IncludedFeatures = forwardRef7(({ className, ...rest }, ref) => {
|
|
|
18613
18763
|
IncludedFeatures.displayName = "IncludedFeatures";
|
|
18614
18764
|
|
|
18615
18765
|
// src/components/elements/invoices/Invoices.tsx
|
|
18616
|
-
import { forwardRef as
|
|
18617
|
-
import { jsx as
|
|
18618
|
-
function
|
|
18766
|
+
import { forwardRef as forwardRef9, useEffect as useEffect6, useState as useState13 } from "react";
|
|
18767
|
+
import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
18768
|
+
function resolveDesignProps3(props) {
|
|
18619
18769
|
return {
|
|
18620
18770
|
header: {
|
|
18621
18771
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -18648,7 +18798,7 @@ function formatInvoices(invoices = []) {
|
|
|
18648
18798
|
}
|
|
18649
18799
|
var InvoiceDate = ({ date, fontStyle, url }) => {
|
|
18650
18800
|
const theme = nt();
|
|
18651
|
-
const dateText = /* @__PURE__ */
|
|
18801
|
+
const dateText = /* @__PURE__ */ jsx30(
|
|
18652
18802
|
Text,
|
|
18653
18803
|
{
|
|
18654
18804
|
...url && { onClick: () => {
|
|
@@ -18661,12 +18811,12 @@ var InvoiceDate = ({ date, fontStyle, url }) => {
|
|
|
18661
18811
|
}
|
|
18662
18812
|
);
|
|
18663
18813
|
if (url) {
|
|
18664
|
-
return /* @__PURE__ */
|
|
18814
|
+
return /* @__PURE__ */ jsx30("a", { href: url, target: "_blank", rel: "noreferrer", children: dateText });
|
|
18665
18815
|
}
|
|
18666
18816
|
return dateText;
|
|
18667
18817
|
};
|
|
18668
|
-
var Invoices =
|
|
18669
|
-
const props =
|
|
18818
|
+
var Invoices = forwardRef9(({ className, data, ...rest }, ref) => {
|
|
18819
|
+
const props = resolveDesignProps3(rest);
|
|
18670
18820
|
const { t: t2 } = useTranslation();
|
|
18671
18821
|
const theme = nt();
|
|
18672
18822
|
const { api } = useEmbed();
|
|
@@ -18685,8 +18835,8 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
18685
18835
|
if (invoices.length === 0) {
|
|
18686
18836
|
return null;
|
|
18687
18837
|
}
|
|
18688
|
-
return /* @__PURE__ */
|
|
18689
|
-
props.header.isVisible && /* @__PURE__ */
|
|
18838
|
+
return /* @__PURE__ */ jsx30(Element, { ref, className, children: /* @__PURE__ */ jsxs23(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
18839
|
+
props.header.isVisible && /* @__PURE__ */ jsx30(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsx30(
|
|
18690
18840
|
Text,
|
|
18691
18841
|
{
|
|
18692
18842
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -18696,9 +18846,9 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
18696
18846
|
children: t2("Invoices")
|
|
18697
18847
|
}
|
|
18698
18848
|
) }),
|
|
18699
|
-
/* @__PURE__ */
|
|
18849
|
+
/* @__PURE__ */ jsx30(Flex, { $flexDirection: "column", $gap: "0.5rem", children: invoices.slice(0, listSize).map(({ date, amount, url }, index) => {
|
|
18700
18850
|
return /* @__PURE__ */ jsxs23(Flex, { $justifyContent: "space-between", children: [
|
|
18701
|
-
props.date.isVisible && date && /* @__PURE__ */
|
|
18851
|
+
props.date.isVisible && date && /* @__PURE__ */ jsx30(
|
|
18702
18852
|
InvoiceDate,
|
|
18703
18853
|
{
|
|
18704
18854
|
date,
|
|
@@ -18706,7 +18856,7 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
18706
18856
|
url
|
|
18707
18857
|
}
|
|
18708
18858
|
),
|
|
18709
|
-
props.amount.isVisible && /* @__PURE__ */
|
|
18859
|
+
props.amount.isVisible && /* @__PURE__ */ jsx30(
|
|
18710
18860
|
Text,
|
|
18711
18861
|
{
|
|
18712
18862
|
$font: theme.typography[props.amount.fontStyle].fontFamily,
|
|
@@ -18719,14 +18869,14 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
18719
18869
|
] }, index);
|
|
18720
18870
|
}) }),
|
|
18721
18871
|
props.collapse.isVisible && invoices.length > props.limit.number && /* @__PURE__ */ jsxs23(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
18722
|
-
/* @__PURE__ */
|
|
18872
|
+
/* @__PURE__ */ jsx30(
|
|
18723
18873
|
Icon2,
|
|
18724
18874
|
{
|
|
18725
18875
|
name: `chevron-${listSize === props.limit.number ? "down" : "up"}`,
|
|
18726
18876
|
style: { color: "#D0D0D0" }
|
|
18727
18877
|
}
|
|
18728
18878
|
),
|
|
18729
|
-
/* @__PURE__ */
|
|
18879
|
+
/* @__PURE__ */ jsx30(
|
|
18730
18880
|
Text,
|
|
18731
18881
|
{
|
|
18732
18882
|
onClick: toggleListSize,
|
|
@@ -18743,10 +18893,10 @@ var Invoices = forwardRef8(({ className, data, ...rest }, ref) => {
|
|
|
18743
18893
|
Invoices.displayName = "Invoices";
|
|
18744
18894
|
|
|
18745
18895
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
18746
|
-
import { forwardRef as
|
|
18896
|
+
import { forwardRef as forwardRef10, useMemo as useMemo10, useRef as useRef8 } from "react";
|
|
18747
18897
|
|
|
18748
18898
|
// src/components/elements/metered-features/styles.ts
|
|
18749
|
-
var
|
|
18899
|
+
var Container3 = dt.div`
|
|
18750
18900
|
display: flex;
|
|
18751
18901
|
flex-direction: column;
|
|
18752
18902
|
gap: 1rem;
|
|
@@ -18786,8 +18936,8 @@ var Container4 = dt.div`
|
|
|
18786
18936
|
`;
|
|
18787
18937
|
|
|
18788
18938
|
// src/components/elements/metered-features/MeteredFeatures.tsx
|
|
18789
|
-
import { Fragment as Fragment10, jsx as
|
|
18790
|
-
function
|
|
18939
|
+
import { Fragment as Fragment10, jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
18940
|
+
function resolveDesignProps4(props) {
|
|
18791
18941
|
return {
|
|
18792
18942
|
isVisible: props.isVisible ?? true,
|
|
18793
18943
|
header: {
|
|
@@ -18812,8 +18962,8 @@ function resolveDesignProps3(props) {
|
|
|
18812
18962
|
visibleFeatures: props.visibleFeatures
|
|
18813
18963
|
};
|
|
18814
18964
|
}
|
|
18815
|
-
var MeteredFeatures =
|
|
18816
|
-
const props =
|
|
18965
|
+
var MeteredFeatures = forwardRef10(({ className, ...rest }, ref) => {
|
|
18966
|
+
const props = resolveDesignProps4(rest);
|
|
18817
18967
|
const elements = useRef8([]);
|
|
18818
18968
|
const shouldWrapChildren = useWrapChildren(elements.current);
|
|
18819
18969
|
const { t: t2 } = useTranslation();
|
|
@@ -18842,7 +18992,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18842
18992
|
if (!shouldShowFeatures) {
|
|
18843
18993
|
return null;
|
|
18844
18994
|
}
|
|
18845
|
-
return /* @__PURE__ */
|
|
18995
|
+
return /* @__PURE__ */ jsx31(Container3, { ref, className, children: featureUsage.map(
|
|
18846
18996
|
({
|
|
18847
18997
|
feature,
|
|
18848
18998
|
priceBehavior,
|
|
@@ -18858,7 +19008,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18858
19008
|
const { price, currency } = getBillingPrice(
|
|
18859
19009
|
planPeriod === "year" ? yearlyUsageBasedPrice : monthlyUsageBasedPrice
|
|
18860
19010
|
) || {};
|
|
18861
|
-
const progressBar = props.isVisible && typeof usage === "number" && limit > 0 && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */
|
|
19011
|
+
const progressBar = props.isVisible && typeof usage === "number" && limit > 0 && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ jsx31(
|
|
18862
19012
|
ProgressBar,
|
|
18863
19013
|
{
|
|
18864
19014
|
progress: (isOverage ? softLimit / usage : usage / limit) * 100,
|
|
@@ -18867,8 +19017,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18867
19017
|
color: isOverage ? "blue" : progressColorMap[Math.floor(
|
|
18868
19018
|
Math.min(usage, limit) / limit * (progressColorMap.length - 1)
|
|
18869
19019
|
)],
|
|
18870
|
-
...isOverage && { bgColor: "#EF4444" }
|
|
18871
|
-
$flexGrow: 1
|
|
19020
|
+
...isOverage && { bgColor: "#EF4444" }
|
|
18872
19021
|
}
|
|
18873
19022
|
);
|
|
18874
19023
|
return /* @__PURE__ */ jsxs24(Flex, { $flexDirection: "column-reverse", children: [
|
|
@@ -18884,7 +19033,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18884
19033
|
$borderBottomRightRadius: `${theme.card.borderRadius / TEXT_BASE_SIZE}rem`
|
|
18885
19034
|
},
|
|
18886
19035
|
children: [
|
|
18887
|
-
/* @__PURE__ */
|
|
19036
|
+
/* @__PURE__ */ jsx31(
|
|
18888
19037
|
Text,
|
|
18889
19038
|
{
|
|
18890
19039
|
$font: theme.typography.text.fontFamily,
|
|
@@ -18932,7 +19081,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18932
19081
|
}
|
|
18933
19082
|
),
|
|
18934
19083
|
/* @__PURE__ */ jsxs24(Element, { as: Flex, $gap: "1.5rem", children: [
|
|
18935
|
-
props.icon.isVisible && feature?.icon && /* @__PURE__ */
|
|
19084
|
+
props.icon.isVisible && feature?.icon && /* @__PURE__ */ jsx31(
|
|
18936
19085
|
IconRound,
|
|
18937
19086
|
{
|
|
18938
19087
|
name: feature.icon,
|
|
@@ -18956,7 +19105,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18956
19105
|
$gap: "1rem",
|
|
18957
19106
|
children: [
|
|
18958
19107
|
feature?.name && /* @__PURE__ */ jsxs24(Flex, { $flexDirection: "column", $gap: "0.5rem", $flexGrow: 1, children: [
|
|
18959
|
-
/* @__PURE__ */
|
|
19108
|
+
/* @__PURE__ */ jsx31(
|
|
18960
19109
|
Text,
|
|
18961
19110
|
{
|
|
18962
19111
|
as: Box,
|
|
@@ -18972,7 +19121,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18972
19121
|
] }) : feature.name
|
|
18973
19122
|
}
|
|
18974
19123
|
),
|
|
18975
|
-
props.description.isVisible && /* @__PURE__ */
|
|
19124
|
+
props.description.isVisible && /* @__PURE__ */ jsx31(
|
|
18976
19125
|
Text,
|
|
18977
19126
|
{
|
|
18978
19127
|
as: Box,
|
|
@@ -18991,7 +19140,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
18991
19140
|
$flexGrow: 1,
|
|
18992
19141
|
$textAlign: shouldWrapChildren ? "left" : "right",
|
|
18993
19142
|
children: [
|
|
18994
|
-
props.usage.isVisible && /* @__PURE__ */
|
|
19143
|
+
props.usage.isVisible && /* @__PURE__ */ jsx31(
|
|
18995
19144
|
Text,
|
|
18996
19145
|
{
|
|
18997
19146
|
as: Box,
|
|
@@ -19015,7 +19164,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
19015
19164
|
] })
|
|
19016
19165
|
}
|
|
19017
19166
|
),
|
|
19018
|
-
props.allocation.isVisible && priceBehavior !== "overage" && /* @__PURE__ */
|
|
19167
|
+
props.allocation.isVisible && priceBehavior !== "overage" && /* @__PURE__ */ jsx31(Box, { $whiteSpace: "nowrap", children: /* @__PURE__ */ jsx31(
|
|
19019
19168
|
Text,
|
|
19020
19169
|
{
|
|
19021
19170
|
$font: theme.typography[props.allocation.fontStyle].fontFamily,
|
|
@@ -19041,11 +19190,11 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
19041
19190
|
}
|
|
19042
19191
|
),
|
|
19043
19192
|
props.isVisible && typeof usage === "number" && priceBehavior !== "pay_as_you_go" && /* @__PURE__ */ jsxs24(Flex, { $gap: "2rem", children: [
|
|
19044
|
-
typeof allocation === "number" ? /* @__PURE__ */
|
|
19193
|
+
typeof allocation === "number" ? /* @__PURE__ */ jsx31(
|
|
19045
19194
|
Tooltip,
|
|
19046
19195
|
{
|
|
19047
19196
|
trigger: progressBar,
|
|
19048
|
-
content: /* @__PURE__ */
|
|
19197
|
+
content: /* @__PURE__ */ jsx31(
|
|
19049
19198
|
Text,
|
|
19050
19199
|
{
|
|
19051
19200
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19062,7 +19211,7 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
19062
19211
|
$flexGrow: 1
|
|
19063
19212
|
}
|
|
19064
19213
|
) : progressBar,
|
|
19065
|
-
priceBehavior === "pay_in_advance" && /* @__PURE__ */
|
|
19214
|
+
priceBehavior === "pay_in_advance" && /* @__PURE__ */ jsx31(
|
|
19066
19215
|
EmbedButton,
|
|
19067
19216
|
{
|
|
19068
19217
|
onClick: () => {
|
|
@@ -19086,11 +19235,11 @@ var MeteredFeatures = forwardRef9(({ className, ...rest }, ref) => {
|
|
|
19086
19235
|
MeteredFeatures.displayName = "MeteredFeatures";
|
|
19087
19236
|
|
|
19088
19237
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
19089
|
-
import { forwardRef as
|
|
19238
|
+
import { forwardRef as forwardRef11, useMemo as useMemo12 } from "react";
|
|
19090
19239
|
|
|
19091
19240
|
// src/components/elements/payment-method/PaymentMethodElement.tsx
|
|
19092
19241
|
import { useMemo as useMemo11 } from "react";
|
|
19093
|
-
import { jsx as
|
|
19242
|
+
import { jsx as jsx32, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
19094
19243
|
var PaymentElement2 = ({
|
|
19095
19244
|
iconName,
|
|
19096
19245
|
iconTitle,
|
|
@@ -19099,17 +19248,17 @@ var PaymentElement2 = ({
|
|
|
19099
19248
|
paymentLast4
|
|
19100
19249
|
}) => {
|
|
19101
19250
|
const theme = nt();
|
|
19102
|
-
return /* @__PURE__ */
|
|
19103
|
-
iconName && /* @__PURE__ */
|
|
19251
|
+
return /* @__PURE__ */ jsx32(Text, { $font: theme.typography.text.fontFamily, $size: 16, children: /* @__PURE__ */ jsxs25(Flex, { $flexDirection: "row", $alignItems: "center", $gap: "0.5rem", children: [
|
|
19252
|
+
iconName && /* @__PURE__ */ jsx32(Box, { children: /* @__PURE__ */ jsx32(Icon2, { name: iconName, title: iconTitle, style: iconStyles }) }),
|
|
19104
19253
|
/* @__PURE__ */ jsxs25(Flex, { $alignItems: "center", children: [
|
|
19105
|
-
/* @__PURE__ */
|
|
19106
|
-
paymentLast4 && /* @__PURE__ */
|
|
19254
|
+
/* @__PURE__ */ jsx32(Box, { $lineHeight: "1", $marginRight: "4px", children: t(label) }),
|
|
19255
|
+
paymentLast4 && /* @__PURE__ */ jsx32(Box, { $display: "inline-block", $fontWeight: "bold", children: paymentLast4 })
|
|
19107
19256
|
] })
|
|
19108
19257
|
] }) });
|
|
19109
19258
|
};
|
|
19110
19259
|
var EmptyPaymentElement = () => {
|
|
19111
19260
|
const theme = nt();
|
|
19112
|
-
return /* @__PURE__ */
|
|
19261
|
+
return /* @__PURE__ */ jsx32(Text, { $font: theme.typography.text.fontFamily, $size: 16, children: /* @__PURE__ */ jsx32(Flex, { $flexDirection: "row", $alignItems: "center", children: /* @__PURE__ */ jsx32(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx32(Box, { $lineHeight: "1", $marginRight: "4px", children: t("No payment method selected") }) }) }) });
|
|
19113
19262
|
};
|
|
19114
19263
|
var getPaymentMethodData = ({
|
|
19115
19264
|
accountLast4,
|
|
@@ -19200,7 +19349,7 @@ var PaymentMethodElement = ({
|
|
|
19200
19349
|
}
|
|
19201
19350
|
return /* @__PURE__ */ jsxs25(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
|
|
19202
19351
|
props.header.isVisible && /* @__PURE__ */ jsxs25(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
19203
|
-
/* @__PURE__ */
|
|
19352
|
+
/* @__PURE__ */ jsx32(
|
|
19204
19353
|
Text,
|
|
19205
19354
|
{
|
|
19206
19355
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -19210,7 +19359,7 @@ var PaymentMethodElement = ({
|
|
|
19210
19359
|
children: t2("Payment Method")
|
|
19211
19360
|
}
|
|
19212
19361
|
),
|
|
19213
|
-
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */
|
|
19362
|
+
props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ jsx32(
|
|
19214
19363
|
Text,
|
|
19215
19364
|
{
|
|
19216
19365
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19230,15 +19379,15 @@ var PaymentMethodElement = ({
|
|
|
19230
19379
|
$padding: `${sizeFactor / 2.2}rem ${sizeFactor}rem`,
|
|
19231
19380
|
$borderRadius: "9999px",
|
|
19232
19381
|
children: [
|
|
19233
|
-
paymentMethod && /* @__PURE__ */
|
|
19382
|
+
paymentMethod && /* @__PURE__ */ jsx32(
|
|
19234
19383
|
PaymentElement2,
|
|
19235
19384
|
{
|
|
19236
19385
|
...getPaymentMethodData(paymentMethod),
|
|
19237
19386
|
...getIconStyles({ size, theme })
|
|
19238
19387
|
}
|
|
19239
19388
|
),
|
|
19240
|
-
!paymentMethod && /* @__PURE__ */
|
|
19241
|
-
props.functions.allowEdit && onEdit && /* @__PURE__ */
|
|
19389
|
+
!paymentMethod && /* @__PURE__ */ jsx32(EmptyPaymentElement, {}),
|
|
19390
|
+
props.functions.allowEdit && onEdit && /* @__PURE__ */ jsx32(
|
|
19242
19391
|
Text,
|
|
19243
19392
|
{
|
|
19244
19393
|
onClick: onEdit,
|
|
@@ -19292,8 +19441,8 @@ var PaymentListElement = ({
|
|
|
19292
19441
|
$font: theme.typography.text.fontFamily,
|
|
19293
19442
|
$color: theme.typography.text.color,
|
|
19294
19443
|
children: [
|
|
19295
|
-
/* @__PURE__ */
|
|
19296
|
-
/* @__PURE__ */
|
|
19444
|
+
/* @__PURE__ */ jsx32(Box, { $paddingLeft: "0.5rem", $paddingRight: "0.5rem", children: iconName && /* @__PURE__ */ jsx32(Icon2, { name: iconName, title: iconTitle, style: iconStyles }) }),
|
|
19445
|
+
/* @__PURE__ */ jsx32(Box, { $flexGrow: "1", children: /* @__PURE__ */ jsxs25(
|
|
19297
19446
|
Text,
|
|
19298
19447
|
{
|
|
19299
19448
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19307,12 +19456,12 @@ var PaymentListElement = ({
|
|
|
19307
19456
|
]
|
|
19308
19457
|
}
|
|
19309
19458
|
) }),
|
|
19310
|
-
/* @__PURE__ */
|
|
19459
|
+
/* @__PURE__ */ jsx32(
|
|
19311
19460
|
Box,
|
|
19312
19461
|
{
|
|
19313
19462
|
$flexGrow: "1",
|
|
19314
19463
|
$color: isLightBackground ? "hsla(0, 0%, 0%, 0.375)" : "hsla(0, 0%, 100%, 0.375)",
|
|
19315
|
-
children: /* @__PURE__ */
|
|
19464
|
+
children: /* @__PURE__ */ jsx32(
|
|
19316
19465
|
Text,
|
|
19317
19466
|
{
|
|
19318
19467
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19324,7 +19473,7 @@ var PaymentListElement = ({
|
|
|
19324
19473
|
)
|
|
19325
19474
|
}
|
|
19326
19475
|
),
|
|
19327
|
-
/* @__PURE__ */
|
|
19476
|
+
/* @__PURE__ */ jsx32(Box, { children: /* @__PURE__ */ jsx32(
|
|
19328
19477
|
Text,
|
|
19329
19478
|
{
|
|
19330
19479
|
onClick: () => {
|
|
@@ -19337,7 +19486,7 @@ var PaymentListElement = ({
|
|
|
19337
19486
|
children: t("Set default")
|
|
19338
19487
|
}
|
|
19339
19488
|
) }),
|
|
19340
|
-
/* @__PURE__ */
|
|
19489
|
+
/* @__PURE__ */ jsx32(
|
|
19341
19490
|
Box,
|
|
19342
19491
|
{
|
|
19343
19492
|
$cursor: "pointer",
|
|
@@ -19345,7 +19494,7 @@ var PaymentListElement = ({
|
|
|
19345
19494
|
onClick: () => {
|
|
19346
19495
|
handleDelete(paymentMethod.id);
|
|
19347
19496
|
},
|
|
19348
|
-
children: /* @__PURE__ */
|
|
19497
|
+
children: /* @__PURE__ */ jsx32(
|
|
19349
19498
|
Icon2,
|
|
19350
19499
|
{
|
|
19351
19500
|
name: "close",
|
|
@@ -19363,8 +19512,8 @@ var PaymentListElement = ({
|
|
|
19363
19512
|
};
|
|
19364
19513
|
|
|
19365
19514
|
// src/components/elements/payment-method/PaymentMethod.tsx
|
|
19366
|
-
import { jsx as
|
|
19367
|
-
var
|
|
19515
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
19516
|
+
var resolveDesignProps5 = (props) => {
|
|
19368
19517
|
return {
|
|
19369
19518
|
header: {
|
|
19370
19519
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -19376,8 +19525,8 @@ var resolveDesignProps4 = (props) => {
|
|
|
19376
19525
|
}
|
|
19377
19526
|
};
|
|
19378
19527
|
};
|
|
19379
|
-
var PaymentMethod =
|
|
19380
|
-
const props =
|
|
19528
|
+
var PaymentMethod = forwardRef11(({ children, className, portal, allowEdit = true, ...rest }, ref) => {
|
|
19529
|
+
const props = resolveDesignProps5(rest);
|
|
19381
19530
|
const { data, setLayout } = useEmbed();
|
|
19382
19531
|
const paymentMethod = useMemo12(() => {
|
|
19383
19532
|
return data.subscription?.paymentMethod;
|
|
@@ -19395,7 +19544,7 @@ var PaymentMethod = forwardRef10(({ children, className, portal, allowEdit = tru
|
|
|
19395
19544
|
}
|
|
19396
19545
|
return expiration;
|
|
19397
19546
|
}, [paymentMethod?.cardExpYear, paymentMethod?.cardExpMonth]);
|
|
19398
|
-
return /* @__PURE__ */
|
|
19547
|
+
return /* @__PURE__ */ jsx33(Element, { ref, className, children: /* @__PURE__ */ jsx33(
|
|
19399
19548
|
PaymentMethodElement,
|
|
19400
19549
|
{
|
|
19401
19550
|
paymentMethod,
|
|
@@ -19410,8 +19559,8 @@ PaymentMethod.displayName = "PaymentMethod";
|
|
|
19410
19559
|
// src/components/elements/payment-method/PaymentMethodDetails.tsx
|
|
19411
19560
|
import { Elements } from "@stripe/react-stripe-js";
|
|
19412
19561
|
import { useCallback as useCallback10, useEffect as useEffect7, useMemo as useMemo13, useState as useState14 } from "react";
|
|
19413
|
-
import { jsx as
|
|
19414
|
-
var
|
|
19562
|
+
import { jsx as jsx34, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
19563
|
+
var resolveDesignProps6 = () => {
|
|
19415
19564
|
return {
|
|
19416
19565
|
header: {
|
|
19417
19566
|
isVisible: true,
|
|
@@ -19426,7 +19575,7 @@ var resolveDesignProps5 = () => {
|
|
|
19426
19575
|
var PaymentMethodDetails = ({
|
|
19427
19576
|
setPaymentMethodId
|
|
19428
19577
|
}) => {
|
|
19429
|
-
const props =
|
|
19578
|
+
const props = resolveDesignProps6();
|
|
19430
19579
|
const { t: t2 } = useTranslation();
|
|
19431
19580
|
const theme = nt();
|
|
19432
19581
|
const { api, data, setData } = useEmbed();
|
|
@@ -19544,7 +19693,7 @@ var PaymentMethodDetails = ({
|
|
|
19544
19693
|
[api, data, setData, t2]
|
|
19545
19694
|
);
|
|
19546
19695
|
return /* @__PURE__ */ jsxs26(Flex, { $position: "relative", children: [
|
|
19547
|
-
isLoading && /* @__PURE__ */
|
|
19696
|
+
isLoading && /* @__PURE__ */ jsx34(
|
|
19548
19697
|
Flex,
|
|
19549
19698
|
{
|
|
19550
19699
|
$position: "absolute",
|
|
@@ -19556,7 +19705,7 @@ var PaymentMethodDetails = ({
|
|
|
19556
19705
|
$zIndex: 1,
|
|
19557
19706
|
$backgroundColor: "black",
|
|
19558
19707
|
$opacity: 0.5,
|
|
19559
|
-
children: /* @__PURE__ */
|
|
19708
|
+
children: /* @__PURE__ */ jsx34(Loader, { $color: theme.primary, $size: "2xl" })
|
|
19560
19709
|
}
|
|
19561
19710
|
),
|
|
19562
19711
|
/* @__PURE__ */ jsxs26(
|
|
@@ -19569,7 +19718,7 @@ var PaymentMethodDetails = ({
|
|
|
19569
19718
|
$backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
|
|
19570
19719
|
$overflow: "auto",
|
|
19571
19720
|
children: [
|
|
19572
|
-
showPaymentForm ? /* @__PURE__ */
|
|
19721
|
+
showPaymentForm ? /* @__PURE__ */ jsx34(
|
|
19573
19722
|
Elements,
|
|
19574
19723
|
{
|
|
19575
19724
|
stripe,
|
|
@@ -19598,7 +19747,7 @@ var PaymentMethodDetails = ({
|
|
|
19598
19747
|
},
|
|
19599
19748
|
clientSecret: setupIntent?.setupIntentClientSecret
|
|
19600
19749
|
},
|
|
19601
|
-
children: /* @__PURE__ */
|
|
19750
|
+
children: /* @__PURE__ */ jsx34(
|
|
19602
19751
|
PaymentForm,
|
|
19603
19752
|
{
|
|
19604
19753
|
onConfirm: async (paymentMethodId) => {
|
|
@@ -19610,7 +19759,7 @@ var PaymentMethodDetails = ({
|
|
|
19610
19759
|
)
|
|
19611
19760
|
}
|
|
19612
19761
|
) : /* @__PURE__ */ jsxs26(Flex, { $flexDirection: "column", $gap: "2rem", children: [
|
|
19613
|
-
/* @__PURE__ */
|
|
19762
|
+
/* @__PURE__ */ jsx34(
|
|
19614
19763
|
PaymentMethodElement,
|
|
19615
19764
|
{
|
|
19616
19765
|
size: "lg",
|
|
@@ -19619,7 +19768,7 @@ var PaymentMethodDetails = ({
|
|
|
19619
19768
|
...props
|
|
19620
19769
|
}
|
|
19621
19770
|
),
|
|
19622
|
-
(data.company?.paymentMethods || []).length > 0 && /* @__PURE__ */
|
|
19771
|
+
(data.company?.paymentMethods || []).length > 0 && /* @__PURE__ */ jsx34(Box, { children: /* @__PURE__ */ jsxs26(
|
|
19623
19772
|
Text,
|
|
19624
19773
|
{
|
|
19625
19774
|
onClick: dropDownDifferentPaymentMethods,
|
|
@@ -19629,7 +19778,7 @@ var PaymentMethodDetails = ({
|
|
|
19629
19778
|
$color: theme.typography.link.color,
|
|
19630
19779
|
children: [
|
|
19631
19780
|
t2("Choose different payment method"),
|
|
19632
|
-
/* @__PURE__ */
|
|
19781
|
+
/* @__PURE__ */ jsx34(
|
|
19633
19782
|
Icon2,
|
|
19634
19783
|
{
|
|
19635
19784
|
name: "chevron-down",
|
|
@@ -19645,9 +19794,9 @@ var PaymentMethodDetails = ({
|
|
|
19645
19794
|
]
|
|
19646
19795
|
}
|
|
19647
19796
|
) }),
|
|
19648
|
-
showDifferentPaymentMethods && /* @__PURE__ */
|
|
19797
|
+
showDifferentPaymentMethods && /* @__PURE__ */ jsx34(Flex, { $flexDirection: "column", $overflowY: "hidden", $height: "10rem", children: /* @__PURE__ */ jsx34(Flex, { $flexDirection: "column", $overflowY: "scroll", children: (data.company?.paymentMethods.filter(
|
|
19649
19798
|
(pm) => pm.id !== paymentMethod?.id
|
|
19650
|
-
) || []).map((paymentMethod2) => /* @__PURE__ */
|
|
19799
|
+
) || []).map((paymentMethod2) => /* @__PURE__ */ jsx34(
|
|
19651
19800
|
PaymentListElement,
|
|
19652
19801
|
{
|
|
19653
19802
|
paymentMethod: paymentMethod2,
|
|
@@ -19656,9 +19805,9 @@ var PaymentMethodDetails = ({
|
|
|
19656
19805
|
},
|
|
19657
19806
|
paymentMethod2.id
|
|
19658
19807
|
)) }) }),
|
|
19659
|
-
(!paymentMethod || showDifferentPaymentMethods) && /* @__PURE__ */
|
|
19808
|
+
(!paymentMethod || showDifferentPaymentMethods) && /* @__PURE__ */ jsx34(EmbedButton, { onClick: createSetupIntent, size: "lg", children: t2("Add new payment method") })
|
|
19660
19809
|
] }),
|
|
19661
|
-
!isLoading && error && /* @__PURE__ */
|
|
19810
|
+
!isLoading && error && /* @__PURE__ */ jsx34(Box, { children: /* @__PURE__ */ jsx34(
|
|
19662
19811
|
Text,
|
|
19663
19812
|
{
|
|
19664
19813
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19675,9 +19824,9 @@ var PaymentMethodDetails = ({
|
|
|
19675
19824
|
};
|
|
19676
19825
|
|
|
19677
19826
|
// src/components/elements/plan-manager/PlanManager.tsx
|
|
19678
|
-
import { forwardRef as
|
|
19679
|
-
import { Fragment as Fragment11, jsx as
|
|
19680
|
-
var
|
|
19827
|
+
import { forwardRef as forwardRef12, useMemo as useMemo14 } from "react";
|
|
19828
|
+
import { Fragment as Fragment11, jsx as jsx35, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
19829
|
+
var resolveDesignProps7 = (props) => {
|
|
19681
19830
|
return {
|
|
19682
19831
|
header: {
|
|
19683
19832
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -19705,8 +19854,8 @@ var resolveDesignProps6 = (props) => {
|
|
|
19705
19854
|
}
|
|
19706
19855
|
};
|
|
19707
19856
|
};
|
|
19708
|
-
var PlanManager =
|
|
19709
|
-
const props =
|
|
19857
|
+
var PlanManager = forwardRef12(({ children, className, portal, ...rest }, ref) => {
|
|
19858
|
+
const props = resolveDesignProps7(rest);
|
|
19710
19859
|
const theme = nt();
|
|
19711
19860
|
const { t: t2 } = useTranslation();
|
|
19712
19861
|
const { data, setLayout, setSelected } = useEmbed();
|
|
@@ -19755,7 +19904,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19755
19904
|
$textAlign: "center",
|
|
19756
19905
|
$backgroundColor: isLightBackground ? darken(theme.card.background, 0.04) : lighten(theme.card.background, 0.04),
|
|
19757
19906
|
children: [
|
|
19758
|
-
/* @__PURE__ */
|
|
19907
|
+
/* @__PURE__ */ jsx35(
|
|
19759
19908
|
Text,
|
|
19760
19909
|
{
|
|
19761
19910
|
as: "h3",
|
|
@@ -19766,7 +19915,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19766
19915
|
children: t2("Trial ends in", { days: trialEndDays.toString() })
|
|
19767
19916
|
}
|
|
19768
19917
|
),
|
|
19769
|
-
/* @__PURE__ */
|
|
19918
|
+
/* @__PURE__ */ jsx35(
|
|
19770
19919
|
Text,
|
|
19771
19920
|
{
|
|
19772
19921
|
as: "p",
|
|
@@ -19793,7 +19942,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19793
19942
|
$textAlign: "center",
|
|
19794
19943
|
$backgroundColor: isLightBackground ? darken(theme.card.background, 0.04) : lighten(theme.card.background, 0.04),
|
|
19795
19944
|
children: [
|
|
19796
|
-
/* @__PURE__ */
|
|
19945
|
+
/* @__PURE__ */ jsx35(
|
|
19797
19946
|
Text,
|
|
19798
19947
|
{
|
|
19799
19948
|
as: "h3",
|
|
@@ -19804,7 +19953,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19804
19953
|
children: t2("Subscription canceled")
|
|
19805
19954
|
}
|
|
19806
19955
|
),
|
|
19807
|
-
billingSubscription?.cancelAt && /* @__PURE__ */
|
|
19956
|
+
billingSubscription?.cancelAt && /* @__PURE__ */ jsx35(
|
|
19808
19957
|
Text,
|
|
19809
19958
|
{
|
|
19810
19959
|
as: "p",
|
|
@@ -19843,7 +19992,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19843
19992
|
$gap: "1rem",
|
|
19844
19993
|
children: [
|
|
19845
19994
|
/* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
19846
|
-
/* @__PURE__ */
|
|
19995
|
+
/* @__PURE__ */ jsx35(
|
|
19847
19996
|
Text,
|
|
19848
19997
|
{
|
|
19849
19998
|
as: Box,
|
|
@@ -19855,7 +20004,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19855
20004
|
children: currentPlan.name
|
|
19856
20005
|
}
|
|
19857
20006
|
),
|
|
19858
|
-
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */
|
|
20007
|
+
props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ jsx35(
|
|
19859
20008
|
Text,
|
|
19860
20009
|
{
|
|
19861
20010
|
as: Box,
|
|
@@ -19868,7 +20017,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19868
20017
|
)
|
|
19869
20018
|
] }),
|
|
19870
20019
|
props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ jsxs27(Box, { children: [
|
|
19871
|
-
/* @__PURE__ */
|
|
20020
|
+
/* @__PURE__ */ jsx35(
|
|
19872
20021
|
Text,
|
|
19873
20022
|
{
|
|
19874
20023
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -19881,7 +20030,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19881
20030
|
)
|
|
19882
20031
|
}
|
|
19883
20032
|
),
|
|
19884
|
-
!isUsageBasedPlan && /* @__PURE__ */
|
|
20033
|
+
!isUsageBasedPlan && /* @__PURE__ */ jsx35(
|
|
19885
20034
|
Text,
|
|
19886
20035
|
{
|
|
19887
20036
|
$font: theme.typography[props.header.price.fontStyle].fontFamily,
|
|
@@ -19899,7 +20048,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19899
20048
|
}
|
|
19900
20049
|
),
|
|
19901
20050
|
props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
19902
|
-
props.addOns.showLabel && /* @__PURE__ */
|
|
20051
|
+
props.addOns.showLabel && /* @__PURE__ */ jsx35(
|
|
19903
20052
|
Text,
|
|
19904
20053
|
{
|
|
19905
20054
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19918,7 +20067,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19918
20067
|
$flexWrap: "wrap",
|
|
19919
20068
|
$gap: "1rem",
|
|
19920
20069
|
children: [
|
|
19921
|
-
/* @__PURE__ */
|
|
20070
|
+
/* @__PURE__ */ jsx35(
|
|
19922
20071
|
Text,
|
|
19923
20072
|
{
|
|
19924
20073
|
$font: theme.typography[props.addOns.fontStyle].fontFamily,
|
|
@@ -19950,7 +20099,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19950
20099
|
))
|
|
19951
20100
|
] }),
|
|
19952
20101
|
usageBasedEntitlements.length > 0 && /* @__PURE__ */ jsxs27(Flex, { $flexDirection: "column", $gap: "1rem", children: [
|
|
19953
|
-
/* @__PURE__ */
|
|
20102
|
+
/* @__PURE__ */ jsx35(
|
|
19954
20103
|
Text,
|
|
19955
20104
|
{
|
|
19956
20105
|
$font: theme.typography.text.fontFamily,
|
|
@@ -19997,7 +20146,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
19997
20146
|
}
|
|
19998
20147
|
),
|
|
19999
20148
|
/* @__PURE__ */ jsxs27(Flex, { $alignItems: "center", $gap: "1rem", children: [
|
|
20000
|
-
entitlement.priceBehavior === "overage" && currentPlan?.planPeriod ? /* @__PURE__ */
|
|
20149
|
+
entitlement.priceBehavior === "overage" && currentPlan?.planPeriod ? /* @__PURE__ */ jsx35(
|
|
20001
20150
|
Text,
|
|
20002
20151
|
{
|
|
20003
20152
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20076,7 +20225,7 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
20076
20225
|
[]
|
|
20077
20226
|
)
|
|
20078
20227
|
] }),
|
|
20079
|
-
canCheckout && props.callToAction.isVisible && /* @__PURE__ */
|
|
20228
|
+
canCheckout && props.callToAction.isVisible && /* @__PURE__ */ jsx35(
|
|
20080
20229
|
EmbedButton,
|
|
20081
20230
|
{
|
|
20082
20231
|
type: "button",
|
|
@@ -20101,9 +20250,9 @@ var PlanManager = forwardRef11(({ children, className, portal, ...rest }, ref) =
|
|
|
20101
20250
|
PlanManager.displayName = "PlanManager";
|
|
20102
20251
|
|
|
20103
20252
|
// src/components/elements/pricing-table/PricingTable.tsx
|
|
20104
|
-
import { forwardRef as
|
|
20105
|
-
import { Fragment as Fragment12, jsx as
|
|
20106
|
-
var
|
|
20253
|
+
import { forwardRef as forwardRef13, useState as useState15 } from "react";
|
|
20254
|
+
import { Fragment as Fragment12, jsx as jsx36, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
20255
|
+
var resolveDesignProps8 = (props) => {
|
|
20107
20256
|
return {
|
|
20108
20257
|
showPeriodToggle: props.showPeriodToggle ?? true,
|
|
20109
20258
|
showDiscount: props.showDiscount ?? true,
|
|
@@ -20142,8 +20291,8 @@ var resolveDesignProps7 = (props) => {
|
|
|
20142
20291
|
}
|
|
20143
20292
|
};
|
|
20144
20293
|
};
|
|
20145
|
-
var PricingTable =
|
|
20146
|
-
const props =
|
|
20294
|
+
var PricingTable = forwardRef13(({ children, className, ...rest }, ref) => {
|
|
20295
|
+
const props = resolveDesignProps8(rest);
|
|
20147
20296
|
const { t: t2 } = useTranslation();
|
|
20148
20297
|
const theme = nt();
|
|
20149
20298
|
const { data, setLayout, setSelected } = useEmbed();
|
|
@@ -20205,7 +20354,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20205
20354
|
}
|
|
20206
20355
|
},
|
|
20207
20356
|
children: [
|
|
20208
|
-
/* @__PURE__ */
|
|
20357
|
+
/* @__PURE__ */ jsx36(
|
|
20209
20358
|
Text,
|
|
20210
20359
|
{
|
|
20211
20360
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -20215,7 +20364,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20215
20364
|
children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && t2("Plans")
|
|
20216
20365
|
}
|
|
20217
20366
|
),
|
|
20218
|
-
props.showPeriodToggle && /* @__PURE__ */
|
|
20367
|
+
props.showPeriodToggle && /* @__PURE__ */ jsx36(
|
|
20219
20368
|
PeriodToggle,
|
|
20220
20369
|
{
|
|
20221
20370
|
options: periods,
|
|
@@ -20226,7 +20375,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20226
20375
|
]
|
|
20227
20376
|
}
|
|
20228
20377
|
),
|
|
20229
|
-
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */
|
|
20378
|
+
props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ jsx36(
|
|
20230
20379
|
Box,
|
|
20231
20380
|
{
|
|
20232
20381
|
$display: "grid",
|
|
@@ -20268,7 +20417,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20268
20417
|
$borderStyle: "solid",
|
|
20269
20418
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
|
|
20270
20419
|
children: [
|
|
20271
|
-
/* @__PURE__ */
|
|
20420
|
+
/* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(
|
|
20272
20421
|
Text,
|
|
20273
20422
|
{
|
|
20274
20423
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20278,7 +20427,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20278
20427
|
children: plan.name
|
|
20279
20428
|
}
|
|
20280
20429
|
) }),
|
|
20281
|
-
props.plans.description.isVisible && /* @__PURE__ */
|
|
20430
|
+
props.plans.description.isVisible && /* @__PURE__ */ jsx36(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx36(
|
|
20282
20431
|
Text,
|
|
20283
20432
|
{
|
|
20284
20433
|
$font: theme.typography[props.plans.description.fontStyle].fontFamily,
|
|
@@ -20289,7 +20438,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20289
20438
|
}
|
|
20290
20439
|
) }),
|
|
20291
20440
|
/* @__PURE__ */ jsxs28(Box, { children: [
|
|
20292
|
-
/* @__PURE__ */
|
|
20441
|
+
/* @__PURE__ */ jsx36(
|
|
20293
20442
|
Text,
|
|
20294
20443
|
{
|
|
20295
20444
|
$font: headerPriceFontStyle.fontFamily,
|
|
@@ -20313,7 +20462,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20313
20462
|
}
|
|
20314
20463
|
)
|
|
20315
20464
|
] }),
|
|
20316
|
-
isActivePlan && /* @__PURE__ */
|
|
20465
|
+
isActivePlan && /* @__PURE__ */ jsx36(
|
|
20317
20466
|
Flex,
|
|
20318
20467
|
{
|
|
20319
20468
|
$position: "absolute",
|
|
@@ -20322,7 +20471,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20322
20471
|
$backgroundColor: theme.primary,
|
|
20323
20472
|
$borderRadius: "9999px",
|
|
20324
20473
|
$padding: "0.125rem 0.85rem",
|
|
20325
|
-
children: /* @__PURE__ */
|
|
20474
|
+
children: /* @__PURE__ */ jsx36(
|
|
20326
20475
|
Text,
|
|
20327
20476
|
{
|
|
20328
20477
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20347,7 +20496,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20347
20496
|
$padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
|
|
20348
20497
|
children: [
|
|
20349
20498
|
props.plans.showEntitlements && /* @__PURE__ */ jsxs28(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: 1, children: [
|
|
20350
|
-
props.plans.showInclusionText && planIndex > 0 && /* @__PURE__ */
|
|
20499
|
+
props.plans.showInclusionText && planIndex > 0 && /* @__PURE__ */ jsx36(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ jsx36(
|
|
20351
20500
|
Text,
|
|
20352
20501
|
{
|
|
20353
20502
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20373,7 +20522,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20373
20522
|
}
|
|
20374
20523
|
acc.push(
|
|
20375
20524
|
/* @__PURE__ */ jsxs28(Flex, { $gap: "1rem", children: [
|
|
20376
|
-
props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */
|
|
20525
|
+
props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx36(
|
|
20377
20526
|
IconRound,
|
|
20378
20527
|
{
|
|
20379
20528
|
name: entitlement.feature.icon,
|
|
@@ -20391,7 +20540,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20391
20540
|
$justifyContent: "center",
|
|
20392
20541
|
$gap: "0.5rem",
|
|
20393
20542
|
children: [
|
|
20394
|
-
/* @__PURE__ */
|
|
20543
|
+
/* @__PURE__ */ jsx36(
|
|
20395
20544
|
Text,
|
|
20396
20545
|
{
|
|
20397
20546
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20500,7 +20649,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20500
20649
|
$justifyContent: "start",
|
|
20501
20650
|
$marginTop: "1rem",
|
|
20502
20651
|
children: [
|
|
20503
|
-
/* @__PURE__ */
|
|
20652
|
+
/* @__PURE__ */ jsx36(
|
|
20504
20653
|
Icon2,
|
|
20505
20654
|
{
|
|
20506
20655
|
name: isExpanded ? "chevron-up" : "chevron-down",
|
|
@@ -20512,7 +20661,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20512
20661
|
}
|
|
20513
20662
|
}
|
|
20514
20663
|
),
|
|
20515
|
-
/* @__PURE__ */
|
|
20664
|
+
/* @__PURE__ */ jsx36(
|
|
20516
20665
|
Text,
|
|
20517
20666
|
{
|
|
20518
20667
|
onClick: () => handleToggleShowAll(plan.id),
|
|
@@ -20537,7 +20686,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20537
20686
|
$gap: "0.25rem",
|
|
20538
20687
|
$padding: "0.625rem 0",
|
|
20539
20688
|
children: [
|
|
20540
|
-
/* @__PURE__ */
|
|
20689
|
+
/* @__PURE__ */ jsx36(
|
|
20541
20690
|
Icon2,
|
|
20542
20691
|
{
|
|
20543
20692
|
name: "check-rounded",
|
|
@@ -20548,7 +20697,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20548
20697
|
}
|
|
20549
20698
|
}
|
|
20550
20699
|
),
|
|
20551
|
-
/* @__PURE__ */
|
|
20700
|
+
/* @__PURE__ */ jsx36(
|
|
20552
20701
|
Text,
|
|
20553
20702
|
{
|
|
20554
20703
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20561,7 +20710,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20561
20710
|
)
|
|
20562
20711
|
]
|
|
20563
20712
|
}
|
|
20564
|
-
) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */
|
|
20713
|
+
) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */ jsx36(
|
|
20565
20714
|
EmbedButton,
|
|
20566
20715
|
{
|
|
20567
20716
|
type: "button",
|
|
@@ -20585,14 +20734,14 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20585
20734
|
$color: props.downgrade.buttonStyle,
|
|
20586
20735
|
$variant: "outline"
|
|
20587
20736
|
},
|
|
20588
|
-
children: plan.custom ? /* @__PURE__ */
|
|
20737
|
+
children: plan.custom ? /* @__PURE__ */ jsx36(
|
|
20589
20738
|
ButtonLink,
|
|
20590
20739
|
{
|
|
20591
20740
|
href: plan.customPlanConfig?.ctaWebSite ?? "#",
|
|
20592
20741
|
target: "_blank",
|
|
20593
20742
|
children: plan.customPlanConfig?.ctaText ?? t2("Talk to support")
|
|
20594
20743
|
}
|
|
20595
|
-
) : !plan.valid ? /* @__PURE__ */
|
|
20744
|
+
) : !plan.valid ? /* @__PURE__ */ jsx36(
|
|
20596
20745
|
Tooltip,
|
|
20597
20746
|
{
|
|
20598
20747
|
trigger: t2("Over usage limit"),
|
|
@@ -20614,14 +20763,14 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20614
20763
|
}
|
|
20615
20764
|
)
|
|
20616
20765
|
] }),
|
|
20617
|
-
/* @__PURE__ */
|
|
20618
|
-
props.header.isVisible && /* @__PURE__ */
|
|
20766
|
+
/* @__PURE__ */ jsx36(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ jsxs28(Fragment12, { children: [
|
|
20767
|
+
props.header.isVisible && /* @__PURE__ */ jsx36(
|
|
20619
20768
|
Flex,
|
|
20620
20769
|
{
|
|
20621
20770
|
$justifyContent: "space-between",
|
|
20622
20771
|
$alignItems: "center",
|
|
20623
20772
|
$marginBottom: "1rem",
|
|
20624
|
-
children: /* @__PURE__ */
|
|
20773
|
+
children: /* @__PURE__ */ jsx36(
|
|
20625
20774
|
Text,
|
|
20626
20775
|
{
|
|
20627
20776
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -20633,7 +20782,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20633
20782
|
)
|
|
20634
20783
|
}
|
|
20635
20784
|
),
|
|
20636
|
-
/* @__PURE__ */
|
|
20785
|
+
/* @__PURE__ */ jsx36(
|
|
20637
20786
|
Box,
|
|
20638
20787
|
{
|
|
20639
20788
|
$display: "grid",
|
|
@@ -20659,7 +20808,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20659
20808
|
...theme.card.hasShadow && { $boxShadow: cardBoxShadow },
|
|
20660
20809
|
children: [
|
|
20661
20810
|
/* @__PURE__ */ jsxs28(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
|
|
20662
|
-
/* @__PURE__ */
|
|
20811
|
+
/* @__PURE__ */ jsx36(Box, { children: /* @__PURE__ */ jsx36(
|
|
20663
20812
|
Text,
|
|
20664
20813
|
{
|
|
20665
20814
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20669,7 +20818,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20669
20818
|
children: addOn.name
|
|
20670
20819
|
}
|
|
20671
20820
|
) }),
|
|
20672
|
-
props.addOns.showDescription && /* @__PURE__ */
|
|
20821
|
+
props.addOns.showDescription && /* @__PURE__ */ jsx36(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ jsx36(
|
|
20673
20822
|
Text,
|
|
20674
20823
|
{
|
|
20675
20824
|
$font: theme.typography[props.plans.description.fontStyle].fontFamily,
|
|
@@ -20680,7 +20829,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20680
20829
|
}
|
|
20681
20830
|
) }),
|
|
20682
20831
|
/* @__PURE__ */ jsxs28(Box, { children: [
|
|
20683
|
-
/* @__PURE__ */
|
|
20832
|
+
/* @__PURE__ */ jsx36(
|
|
20684
20833
|
Text,
|
|
20685
20834
|
{
|
|
20686
20835
|
$font: theme.typography[props.plans.name.fontStyle].fontFamily,
|
|
@@ -20704,7 +20853,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20704
20853
|
}
|
|
20705
20854
|
)
|
|
20706
20855
|
] }),
|
|
20707
|
-
isActiveAddOn && /* @__PURE__ */
|
|
20856
|
+
isActiveAddOn && /* @__PURE__ */ jsx36(
|
|
20708
20857
|
Flex,
|
|
20709
20858
|
{
|
|
20710
20859
|
$position: "absolute",
|
|
@@ -20713,7 +20862,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20713
20862
|
$backgroundColor: theme.primary,
|
|
20714
20863
|
$borderRadius: "9999px",
|
|
20715
20864
|
$padding: "0.125rem 0.85rem",
|
|
20716
|
-
children: /* @__PURE__ */
|
|
20865
|
+
children: /* @__PURE__ */ jsx36(
|
|
20717
20866
|
Text,
|
|
20718
20867
|
{
|
|
20719
20868
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20734,7 +20883,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20734
20883
|
$gap: `${cardPadding}rem`,
|
|
20735
20884
|
$flexGrow: 1,
|
|
20736
20885
|
children: [
|
|
20737
|
-
props.addOns.showEntitlements && /* @__PURE__ */
|
|
20886
|
+
props.addOns.showEntitlements && /* @__PURE__ */ jsx36(
|
|
20738
20887
|
Flex,
|
|
20739
20888
|
{
|
|
20740
20889
|
$flexDirection: "column",
|
|
@@ -20743,7 +20892,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20743
20892
|
$flexGrow: 1,
|
|
20744
20893
|
children: addOn.entitlements.map(
|
|
20745
20894
|
(entitlement, entitlementIndex) => {
|
|
20746
|
-
return /* @__PURE__ */
|
|
20895
|
+
return /* @__PURE__ */ jsx36(
|
|
20747
20896
|
Flex,
|
|
20748
20897
|
{
|
|
20749
20898
|
$flexWrap: "wrap",
|
|
@@ -20751,7 +20900,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20751
20900
|
$alignItems: "center",
|
|
20752
20901
|
$gap: "1rem",
|
|
20753
20902
|
children: /* @__PURE__ */ jsxs28(Flex, { $gap: "1rem", children: [
|
|
20754
|
-
props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */
|
|
20903
|
+
props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ jsx36(
|
|
20755
20904
|
IconRound,
|
|
20756
20905
|
{
|
|
20757
20906
|
name: entitlement.feature.icon,
|
|
@@ -20762,7 +20911,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20762
20911
|
]
|
|
20763
20912
|
}
|
|
20764
20913
|
),
|
|
20765
|
-
entitlement.feature?.name && /* @__PURE__ */
|
|
20914
|
+
entitlement.feature?.name && /* @__PURE__ */ jsx36(Flex, { $alignItems: "center", children: /* @__PURE__ */ jsx36(
|
|
20766
20915
|
Text,
|
|
20767
20916
|
{
|
|
20768
20917
|
$font: theme.typography.text.fontFamily,
|
|
@@ -20806,7 +20955,7 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20806
20955
|
)
|
|
20807
20956
|
}
|
|
20808
20957
|
),
|
|
20809
|
-
props.upgrade.isVisible && /* @__PURE__ */
|
|
20958
|
+
props.upgrade.isVisible && /* @__PURE__ */ jsx36(
|
|
20810
20959
|
EmbedButton,
|
|
20811
20960
|
{
|
|
20812
20961
|
type: "button",
|
|
@@ -20842,10 +20991,39 @@ var PricingTable = forwardRef12(({ children, className, ...rest }, ref) => {
|
|
|
20842
20991
|
});
|
|
20843
20992
|
PricingTable.displayName = "PricingTable";
|
|
20844
20993
|
|
|
20994
|
+
// src/components/elements/text/Text.tsx
|
|
20995
|
+
import { forwardRef as forwardRef14 } from "react";
|
|
20996
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
20997
|
+
var resolveDesignProps9 = (props) => {
|
|
20998
|
+
return {
|
|
20999
|
+
text: {
|
|
21000
|
+
fontStyle: props.text?.fontStyle ?? "text",
|
|
21001
|
+
alignment: props.text?.alignment ?? "left",
|
|
21002
|
+
textContent: props.text?.textContent ?? "Text"
|
|
21003
|
+
}
|
|
21004
|
+
};
|
|
21005
|
+
};
|
|
21006
|
+
var TextElement = forwardRef14(({ children, className, ...rest }, ref) => {
|
|
21007
|
+
const props = resolveDesignProps9(rest);
|
|
21008
|
+
const theme = nt();
|
|
21009
|
+
return /* @__PURE__ */ jsx37(Element, { as: Flex, ref, className, children: /* @__PURE__ */ jsx37(
|
|
21010
|
+
Text,
|
|
21011
|
+
{
|
|
21012
|
+
$font: theme.typography[props.text.fontStyle].fontFamily,
|
|
21013
|
+
$size: theme.typography[props.text.fontStyle].fontSize,
|
|
21014
|
+
$weight: theme.typography[props.text.fontStyle].fontWeight,
|
|
21015
|
+
$color: theme.typography[props.text.fontStyle].color,
|
|
21016
|
+
$align: props.text.alignment,
|
|
21017
|
+
children: props.text.textContent
|
|
21018
|
+
}
|
|
21019
|
+
) });
|
|
21020
|
+
});
|
|
21021
|
+
TextElement.displayName = "Text";
|
|
21022
|
+
|
|
20845
21023
|
// src/components/elements/unsubscribe-button/UnsubscribeButton.tsx
|
|
20846
|
-
import { forwardRef as
|
|
20847
|
-
import { jsx as
|
|
20848
|
-
var
|
|
21024
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
21025
|
+
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
21026
|
+
var resolveDesignProps10 = (props) => {
|
|
20849
21027
|
return {
|
|
20850
21028
|
button: {
|
|
20851
21029
|
text: props.button?.text ?? "Unsubscribe",
|
|
@@ -20856,8 +21034,8 @@ var resolveDesignProps8 = (props) => {
|
|
|
20856
21034
|
}
|
|
20857
21035
|
};
|
|
20858
21036
|
};
|
|
20859
|
-
var UnsubscribeButton =
|
|
20860
|
-
const props =
|
|
21037
|
+
var UnsubscribeButton = forwardRef15(({ children, className, ...rest }, ref) => {
|
|
21038
|
+
const props = resolveDesignProps10(rest);
|
|
20861
21039
|
const { t: t2 } = useTranslation();
|
|
20862
21040
|
const { data, setLayout } = useEmbed();
|
|
20863
21041
|
const disabled = !data.subscription || data.subscription.status === "cancelled" || data.subscription.cancelAtPeriodEnd;
|
|
@@ -20875,7 +21053,7 @@ var UnsubscribeButton = forwardRef13(({ children, className, ...rest }, ref) =>
|
|
|
20875
21053
|
variant: "text"
|
|
20876
21054
|
}
|
|
20877
21055
|
};
|
|
20878
|
-
return /* @__PURE__ */
|
|
21056
|
+
return /* @__PURE__ */ jsx38(
|
|
20879
21057
|
Element,
|
|
20880
21058
|
{
|
|
20881
21059
|
as: Flex,
|
|
@@ -20883,7 +21061,7 @@ var UnsubscribeButton = forwardRef13(({ children, className, ...rest }, ref) =>
|
|
|
20883
21061
|
className,
|
|
20884
21062
|
$flexDirection: "column",
|
|
20885
21063
|
$gap: "2rem",
|
|
20886
|
-
children: /* @__PURE__ */
|
|
21064
|
+
children: /* @__PURE__ */ jsx38(
|
|
20887
21065
|
EmbedButton,
|
|
20888
21066
|
{
|
|
20889
21067
|
$size: props.button.size,
|
|
@@ -20904,9 +21082,9 @@ var UnsubscribeButton = forwardRef13(({ children, className, ...rest }, ref) =>
|
|
|
20904
21082
|
UnsubscribeButton.displayName = "UnsubscribeButton";
|
|
20905
21083
|
|
|
20906
21084
|
// src/components/elements/upcoming-bill/UpcomingBill.tsx
|
|
20907
|
-
import { forwardRef as
|
|
20908
|
-
import { jsx as
|
|
20909
|
-
function
|
|
21085
|
+
import { forwardRef as forwardRef16, useMemo as useMemo15 } from "react";
|
|
21086
|
+
import { jsx as jsx39, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
21087
|
+
function resolveDesignProps11(props) {
|
|
20910
21088
|
return {
|
|
20911
21089
|
header: {
|
|
20912
21090
|
isVisible: props.header?.isVisible ?? true,
|
|
@@ -20924,8 +21102,8 @@ function resolveDesignProps9(props) {
|
|
|
20924
21102
|
}
|
|
20925
21103
|
};
|
|
20926
21104
|
}
|
|
20927
|
-
var UpcomingBill =
|
|
20928
|
-
const props =
|
|
21105
|
+
var UpcomingBill = forwardRef16(({ className, ...rest }, ref) => {
|
|
21106
|
+
const props = resolveDesignProps11(rest);
|
|
20929
21107
|
const { t: t2 } = useTranslation();
|
|
20930
21108
|
const theme = nt();
|
|
20931
21109
|
const { data } = useEmbed();
|
|
@@ -20966,7 +21144,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
20966
21144
|
$flexDirection: "column",
|
|
20967
21145
|
$gap: "1rem",
|
|
20968
21146
|
children: [
|
|
20969
|
-
props.header.isVisible && /* @__PURE__ */
|
|
21147
|
+
props.header.isVisible && /* @__PURE__ */ jsx39(Flex, { $justifyContent: "space-between", $alignItems: "center", children: /* @__PURE__ */ jsxs29(
|
|
20970
21148
|
Text,
|
|
20971
21149
|
{
|
|
20972
21150
|
$font: theme.typography[props.header.fontStyle].fontFamily,
|
|
@@ -20981,7 +21159,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
20981
21159
|
}
|
|
20982
21160
|
) }),
|
|
20983
21161
|
/* @__PURE__ */ jsxs29(Flex, { $justifyContent: "space-between", $alignItems: "start", $gap: "1rem", children: [
|
|
20984
|
-
props.price.isVisible && /* @__PURE__ */
|
|
21162
|
+
props.price.isVisible && /* @__PURE__ */ jsx39(Flex, { $alignItems: "end", $flexGrow: "1", children: /* @__PURE__ */ jsx39(
|
|
20985
21163
|
Text,
|
|
20986
21164
|
{
|
|
20987
21165
|
$font: theme.typography[props.price.fontStyle].fontFamily,
|
|
@@ -20995,7 +21173,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
20995
21173
|
)
|
|
20996
21174
|
}
|
|
20997
21175
|
) }),
|
|
20998
|
-
/* @__PURE__ */
|
|
21176
|
+
/* @__PURE__ */ jsx39(Box, { $lineHeight: 1.15, $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ jsx39(
|
|
20999
21177
|
Text,
|
|
21000
21178
|
{
|
|
21001
21179
|
$font: theme.typography[props.contractEndDate.fontStyle].fontFamily,
|
|
@@ -21008,7 +21186,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
21008
21186
|
) })
|
|
21009
21187
|
] }),
|
|
21010
21188
|
discounts.length > 0 && /* @__PURE__ */ jsxs29(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
|
|
21011
|
-
/* @__PURE__ */
|
|
21189
|
+
/* @__PURE__ */ jsx39(Box, { children: /* @__PURE__ */ jsx39(
|
|
21012
21190
|
Text,
|
|
21013
21191
|
{
|
|
21014
21192
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21018,8 +21196,8 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
21018
21196
|
children: t2("Discount")
|
|
21019
21197
|
}
|
|
21020
21198
|
) }),
|
|
21021
|
-
/* @__PURE__ */
|
|
21022
|
-
/* @__PURE__ */
|
|
21199
|
+
/* @__PURE__ */ jsx39(Box, { children: discounts.map((discount) => /* @__PURE__ */ jsxs29(Flex, { $alignItems: "center", $gap: "0.5rem", children: [
|
|
21200
|
+
/* @__PURE__ */ jsx39(
|
|
21023
21201
|
Flex,
|
|
21024
21202
|
{
|
|
21025
21203
|
$alignItems: "center",
|
|
@@ -21028,7 +21206,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
21028
21206
|
$borderStyle: "solid",
|
|
21029
21207
|
$borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)",
|
|
21030
21208
|
$borderRadius: "0.3125rem",
|
|
21031
|
-
children: /* @__PURE__ */
|
|
21209
|
+
children: /* @__PURE__ */ jsx39(
|
|
21032
21210
|
Text,
|
|
21033
21211
|
{
|
|
21034
21212
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21040,7 +21218,7 @@ var UpcomingBill = forwardRef14(({ className, ...rest }, ref) => {
|
|
|
21040
21218
|
)
|
|
21041
21219
|
}
|
|
21042
21220
|
),
|
|
21043
|
-
/* @__PURE__ */
|
|
21221
|
+
/* @__PURE__ */ jsx39(Box, { children: /* @__PURE__ */ jsx39(
|
|
21044
21222
|
Text,
|
|
21045
21223
|
{
|
|
21046
21224
|
$font: theme.typography.text.fontFamily,
|
|
@@ -21075,7 +21253,8 @@ var components = {
|
|
|
21075
21253
|
PaymentMethod,
|
|
21076
21254
|
Invoices,
|
|
21077
21255
|
PricingTable,
|
|
21078
|
-
UnsubscribeButton
|
|
21256
|
+
UnsubscribeButton,
|
|
21257
|
+
ButtonElement
|
|
21079
21258
|
};
|
|
21080
21259
|
function createRenderer(options) {
|
|
21081
21260
|
const { useFallback = false } = options || {};
|
|
@@ -21108,10 +21287,10 @@ function createRenderer(options) {
|
|
|
21108
21287
|
}
|
|
21109
21288
|
|
|
21110
21289
|
// src/components/embed/ComponentTree.tsx
|
|
21111
|
-
import { Fragment as Fragment13, jsx as
|
|
21290
|
+
import { Fragment as Fragment13, jsx as jsx40, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
21112
21291
|
var Loading = () => {
|
|
21113
21292
|
const theme = nt();
|
|
21114
|
-
return /* @__PURE__ */
|
|
21293
|
+
return /* @__PURE__ */ jsx40(
|
|
21115
21294
|
Flex,
|
|
21116
21295
|
{
|
|
21117
21296
|
$width: "100%",
|
|
@@ -21119,7 +21298,7 @@ var Loading = () => {
|
|
|
21119
21298
|
$alignItems: "center",
|
|
21120
21299
|
$justifyContent: "center",
|
|
21121
21300
|
$padding: `${theme.card.padding / TEXT_BASE_SIZE}rem`,
|
|
21122
|
-
children: /* @__PURE__ */
|
|
21301
|
+
children: /* @__PURE__ */ jsx40(Loader, { $color: "#194BFB", $size: "2xl" })
|
|
21123
21302
|
}
|
|
21124
21303
|
);
|
|
21125
21304
|
};
|
|
@@ -21136,7 +21315,7 @@ var Error2 = ({ message }) => {
|
|
|
21136
21315
|
$alignItems: "center",
|
|
21137
21316
|
$justifyContent: "center",
|
|
21138
21317
|
children: [
|
|
21139
|
-
/* @__PURE__ */
|
|
21318
|
+
/* @__PURE__ */ jsx40(
|
|
21140
21319
|
Box,
|
|
21141
21320
|
{
|
|
21142
21321
|
$marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
|
|
@@ -21147,7 +21326,7 @@ var Error2 = ({ message }) => {
|
|
|
21147
21326
|
children: "Error"
|
|
21148
21327
|
}
|
|
21149
21328
|
),
|
|
21150
|
-
/* @__PURE__ */
|
|
21329
|
+
/* @__PURE__ */ jsx40(
|
|
21151
21330
|
Box,
|
|
21152
21331
|
{
|
|
21153
21332
|
$marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
|
|
@@ -21164,23 +21343,23 @@ var Error2 = ({ message }) => {
|
|
|
21164
21343
|
};
|
|
21165
21344
|
var ComponentTree = () => {
|
|
21166
21345
|
const { error, nodes, isPending } = useEmbed();
|
|
21167
|
-
const [children, setChildren] = useState16(/* @__PURE__ */
|
|
21346
|
+
const [children, setChildren] = useState16(/* @__PURE__ */ jsx40(Loading, {}));
|
|
21168
21347
|
useEffect8(() => {
|
|
21169
21348
|
const renderer = createRenderer();
|
|
21170
21349
|
setChildren(nodes.map(renderer));
|
|
21171
21350
|
}, [nodes]);
|
|
21172
21351
|
if (error) {
|
|
21173
21352
|
console.error(error);
|
|
21174
|
-
return /* @__PURE__ */
|
|
21353
|
+
return /* @__PURE__ */ jsx40(Error2, { message: error.message });
|
|
21175
21354
|
}
|
|
21176
21355
|
if (isPending) {
|
|
21177
|
-
return /* @__PURE__ */
|
|
21356
|
+
return /* @__PURE__ */ jsx40(Loading, {});
|
|
21178
21357
|
}
|
|
21179
|
-
return /* @__PURE__ */
|
|
21358
|
+
return /* @__PURE__ */ jsx40(Fragment13, { children });
|
|
21180
21359
|
};
|
|
21181
21360
|
|
|
21182
21361
|
// src/components/embed/Embed.tsx
|
|
21183
|
-
import { jsx as
|
|
21362
|
+
import { jsx as jsx41 } from "react/jsx-runtime";
|
|
21184
21363
|
var SchematicEmbed = ({
|
|
21185
21364
|
id,
|
|
21186
21365
|
accessToken,
|
|
@@ -21188,25 +21367,26 @@ var SchematicEmbed = ({
|
|
|
21188
21367
|
debug
|
|
21189
21368
|
}) => {
|
|
21190
21369
|
if (accessToken?.length === 0) {
|
|
21191
|
-
return /* @__PURE__ */
|
|
21370
|
+
return /* @__PURE__ */ jsx41("div", { children: "Please provide an access token." });
|
|
21192
21371
|
}
|
|
21193
21372
|
if (!accessToken?.startsWith("token_")) {
|
|
21194
|
-
return /* @__PURE__ */
|
|
21373
|
+
return /* @__PURE__ */ jsx41("div", { children: 'Invalid access token; your temporary access token will start with "token_".' });
|
|
21195
21374
|
}
|
|
21196
|
-
return /* @__PURE__ */
|
|
21375
|
+
return /* @__PURE__ */ jsx41(
|
|
21197
21376
|
EmbedProvider,
|
|
21198
21377
|
{
|
|
21199
21378
|
id,
|
|
21200
21379
|
accessToken,
|
|
21201
21380
|
apiConfig,
|
|
21202
21381
|
debug,
|
|
21203
|
-
children: /* @__PURE__ */
|
|
21382
|
+
children: /* @__PURE__ */ jsx41(ComponentTree, {})
|
|
21204
21383
|
}
|
|
21205
21384
|
);
|
|
21206
21385
|
};
|
|
21207
21386
|
export {
|
|
21208
21387
|
Box,
|
|
21209
21388
|
Button2 as Button,
|
|
21389
|
+
ButtonElement,
|
|
21210
21390
|
Card,
|
|
21211
21391
|
Column,
|
|
21212
21392
|
Container2 as Container,
|
|
@@ -21235,6 +21415,7 @@ export {
|
|
|
21235
21415
|
SchematicEmbed,
|
|
21236
21416
|
StyledCard,
|
|
21237
21417
|
Text,
|
|
21418
|
+
TextElement,
|
|
21238
21419
|
TextPropNames,
|
|
21239
21420
|
Tooltip,
|
|
21240
21421
|
UnsubscribeButton,
|