intlayer-editor 7.5.0-canary.0 → 7.5.0
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/client/dist/assets/{CodeBlockShiki-75Nt4Gwt.js → CodeBlockShiki-Cf2gZa5F.js} +4 -4
- package/client/dist/assets/Inter-VariableFont-c8O0ljhh.ttf +0 -0
- package/client/dist/assets/{bundle-web-BBNmn0_H.js → bundle-web-Bm391V69.js} +144 -55
- package/client/dist/assets/{dark-plus-D1BtfNxb.js → dark-plus-DmZ1Dzd4.js} +1 -1
- package/client/dist/assets/{index-Br4JAuU5.js → index-0ibbfhRF.js} +1816 -1120
- package/client/dist/assets/{index-BzVHXaHc.css → index-xMTI_9fM.css} +194 -26
- package/client/dist/assets/{rose-pine-LL9gXmP2.js → rose-pine-B-kZ4Z9q.js} +1 -1
- package/client/dist/assets/{rose-pine-dawn-CH9zdisO.js → rose-pine-dawn-efeVGdSI.js} +1 -1
- package/client/dist/assets/{rose-pine-moon-B1oKSfEJ.js → rose-pine-moon-DmodZNzl.js} +1 -1
- package/client/dist/assets/vue-BQglRdBF.js +50 -0
- package/client/dist/assets/{vue-html-BzXE5pTE.js → vue-html-BS551n9F.js} +1 -1
- package/client/dist/assets/{vue-vine-BT_ihGGO.js → vue-vine-B43RKH9N.js} +1 -1
- package/client/dist/index.html +2 -2
- package/package.json +23 -23
- package/server/dist/controllers/configuration.controller.cjs +3 -3
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.d.ts +1 -1
- package/server/dist/controllers/configuration.controller.mjs +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +6 -6
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.d.ts +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +1 -1
- package/server/dist/index.cjs +9 -9
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs +1 -1
- package/server/dist/routes/config.routes.cjs +3 -3
- package/server/dist/routes/config.routes.cjs.map +1 -1
- package/server/dist/routes/config.routes.d.ts +1 -1
- package/server/dist/routes/config.routes.mjs +1 -1
- package/server/dist/routes/dictionary.routes.cjs +3 -3
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.d.ts +1 -1
- package/server/dist/routes/dictionary.routes.mjs +1 -1
- package/server/dist/types/Routes.d.ts +1 -1
- package/server/dist/utils/checkPortAvailability.cjs +1 -1
- package/server/dist/utils/checkPortAvailability.d.ts +1 -1
- package/server/dist/utils/checkPortAvailability.mjs +1 -1
- package/server/dist/utils/httpStatusCodes.cjs +1 -1
- package/server/dist/utils/httpStatusCodes.d.ts +1 -1
- package/server/dist/utils/httpStatusCodes.mjs +1 -1
- package/server/dist/utils/responseData.cjs +1 -1
- package/server/dist/utils/responseData.d.ts +1 -1
- package/server/dist/utils/responseData.mjs +1 -1
- package/client/dist/assets/Figtree-VariableFont-CuCnmeMh.ttf +0 -0
- package/client/dist/assets/vue-M1-XqLgv.js +0 -50
|
@@ -55,7 +55,7 @@ var hasRequiredReactJsxRuntime_production;
|
|
|
55
55
|
function requireReactJsxRuntime_production() {
|
|
56
56
|
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
57
57
|
hasRequiredReactJsxRuntime_production = 1;
|
|
58
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
58
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
59
59
|
function jsxProd(type, config2, maybeKey) {
|
|
60
60
|
var key2 = null;
|
|
61
61
|
void 0 !== maybeKey && (key2 = "" + maybeKey);
|
|
@@ -95,7 +95,7 @@ var hasRequiredReact_production;
|
|
|
95
95
|
function requireReact_production() {
|
|
96
96
|
if (hasRequiredReact_production) return react_production;
|
|
97
97
|
hasRequiredReact_production = 1;
|
|
98
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE2 = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
98
|
+
var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE2 = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity"), MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
99
99
|
function getIteratorFn(maybeIterable) {
|
|
100
100
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
101
101
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
@@ -512,7 +512,7 @@ function requireReact_production() {
|
|
|
512
512
|
react_production.useTransition = function() {
|
|
513
513
|
return ReactSharedInternals.H.useTransition();
|
|
514
514
|
};
|
|
515
|
-
react_production.version = "19.2.
|
|
515
|
+
react_production.version = "19.2.3";
|
|
516
516
|
return react_production;
|
|
517
517
|
}
|
|
518
518
|
var hasRequiredReact;
|
|
@@ -832,7 +832,7 @@ function requireReactDom_production() {
|
|
|
832
832
|
},
|
|
833
833
|
p: 0,
|
|
834
834
|
findDOMNode: null
|
|
835
|
-
}, REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
835
|
+
}, REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
|
|
836
836
|
function createPortal$1(children, containerInfo, implementation) {
|
|
837
837
|
var key2 = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;
|
|
838
838
|
return {
|
|
@@ -944,7 +944,7 @@ function requireReactDom_production() {
|
|
|
944
944
|
reactDom_production.useFormStatus = function() {
|
|
945
945
|
return ReactSharedInternals.H.useHostTransitionStatus();
|
|
946
946
|
};
|
|
947
|
-
reactDom_production.version = "19.2.
|
|
947
|
+
reactDom_production.version = "19.2.3";
|
|
948
948
|
return reactDom_production;
|
|
949
949
|
}
|
|
950
950
|
var hasRequiredReactDom;
|
|
@@ -1093,16 +1093,16 @@ function requireReactDomClient_production() {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
return null;
|
|
1095
1095
|
}
|
|
1096
|
-
var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE2 = Symbol.for("react.lazy");
|
|
1097
|
-
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
1098
|
-
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
1096
|
+
var assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE2 = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
1097
|
+
var REACT_ACTIVITY_TYPE = /* @__PURE__ */ Symbol.for("react.activity");
|
|
1098
|
+
var REACT_MEMO_CACHE_SENTINEL = /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel");
|
|
1099
1099
|
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
1100
1100
|
function getIteratorFn(maybeIterable) {
|
|
1101
1101
|
if (null === maybeIterable || "object" !== typeof maybeIterable) return null;
|
|
1102
1102
|
maybeIterable = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable["@@iterator"];
|
|
1103
1103
|
return "function" === typeof maybeIterable ? maybeIterable : null;
|
|
1104
1104
|
}
|
|
1105
|
-
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
1105
|
+
var REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for("react.client.reference");
|
|
1106
1106
|
function getComponentNameFromType(type) {
|
|
1107
1107
|
if (null == type) return null;
|
|
1108
1108
|
if ("function" === typeof type)
|
|
@@ -12388,12 +12388,12 @@ function requireReactDomClient_production() {
|
|
|
12388
12388
|
}
|
|
12389
12389
|
};
|
|
12390
12390
|
var isomorphicReactPackageVersion$jscomp$inline_1840 = React2.version;
|
|
12391
|
-
if ("19.2.
|
|
12391
|
+
if ("19.2.3" !== isomorphicReactPackageVersion$jscomp$inline_1840)
|
|
12392
12392
|
throw Error(
|
|
12393
12393
|
formatProdErrorMessage(
|
|
12394
12394
|
527,
|
|
12395
12395
|
isomorphicReactPackageVersion$jscomp$inline_1840,
|
|
12396
|
-
"19.2.
|
|
12396
|
+
"19.2.3"
|
|
12397
12397
|
)
|
|
12398
12398
|
);
|
|
12399
12399
|
ReactDOMSharedInternals.findDOMNode = function(componentOrElement) {
|
|
@@ -12411,10 +12411,10 @@ function requireReactDomClient_production() {
|
|
|
12411
12411
|
};
|
|
12412
12412
|
var internals$jscomp$inline_2347 = {
|
|
12413
12413
|
bundleType: 0,
|
|
12414
|
-
version: "19.2.
|
|
12414
|
+
version: "19.2.3",
|
|
12415
12415
|
rendererPackageName: "react-dom",
|
|
12416
12416
|
currentDispatcherRef: ReactSharedInternals,
|
|
12417
|
-
reconcilerVersion: "19.2.
|
|
12417
|
+
reconcilerVersion: "19.2.3"
|
|
12418
12418
|
};
|
|
12419
12419
|
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
|
12420
12420
|
var hook$jscomp$inline_2348 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
|
@@ -12481,7 +12481,7 @@ function requireReactDomClient_production() {
|
|
|
12481
12481
|
listenToAllSupportedEvents(container);
|
|
12482
12482
|
return new ReactDOMHydrationRoot(initialChildren);
|
|
12483
12483
|
};
|
|
12484
|
-
reactDomClient_production.version = "19.2.
|
|
12484
|
+
reactDomClient_production.version = "19.2.3";
|
|
12485
12485
|
return reactDomClient_production;
|
|
12486
12486
|
}
|
|
12487
12487
|
var hasRequiredClient;
|
|
@@ -12583,12 +12583,14 @@ var __export$1 = (all, symbols) => {
|
|
|
12583
12583
|
return target;
|
|
12584
12584
|
};
|
|
12585
12585
|
var build_exports = /* @__PURE__ */ __export$1({
|
|
12586
|
+
BUILD_MODE: () => BUILD_MODE,
|
|
12586
12587
|
CACHE: () => CACHE,
|
|
12587
12588
|
IMPORT_MODE: () => IMPORT_MODE,
|
|
12588
12589
|
OPTIMIZE: () => OPTIMIZE,
|
|
12589
12590
|
OUTPUT_FORMAT: () => OUTPUT_FORMAT,
|
|
12590
12591
|
TRAVERSE_PATTERN: () => TRAVERSE_PATTERN
|
|
12591
12592
|
});
|
|
12593
|
+
const BUILD_MODE = "auto";
|
|
12592
12594
|
const OPTIMIZE = void 0;
|
|
12593
12595
|
const IMPORT_MODE = "static";
|
|
12594
12596
|
const TRAVERSE_PATTERN = ["**/*.{tsx,ts,js,mjs,cjs,jsx,mjx,cjx,vue,svelte,svte}", "!**/node_modules/**"];
|
|
@@ -12821,6 +12823,8 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12821
12823
|
ICELANDIC_ICELAND: () => ICELANDIC_ICELAND,
|
|
12822
12824
|
INDONESIAN: () => INDONESIAN,
|
|
12823
12825
|
INDONESIAN_INDONESIA: () => INDONESIAN_INDONESIA,
|
|
12826
|
+
IRISH: () => IRISH,
|
|
12827
|
+
IRISH_IRELAND: () => IRISH_IRELAND,
|
|
12824
12828
|
ITALIAN: () => ITALIAN,
|
|
12825
12829
|
ITALIAN_ITALY: () => ITALIAN_ITALY,
|
|
12826
12830
|
ITALIAN_SWITZERLAND: () => ITALIAN_SWITZERLAND,
|
|
@@ -12836,6 +12840,8 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12836
12840
|
KONKANI_INDIA: () => KONKANI_INDIA,
|
|
12837
12841
|
KOREAN: () => KOREAN,
|
|
12838
12842
|
KOREAN_KOREA: () => KOREAN_KOREA,
|
|
12843
|
+
KURDISH: () => KURDISH,
|
|
12844
|
+
KURDISH_TURKEY: () => KURDISH_TURKEY,
|
|
12839
12845
|
KYRGYZ: () => KYRGYZ,
|
|
12840
12846
|
KYRGYZ_KYRGYZSTAN: () => KYRGYZ_KYRGYZSTAN,
|
|
12841
12847
|
LAO: () => LAO,
|
|
@@ -12844,7 +12850,11 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12844
12850
|
LATVIAN_LATVIA: () => LATVIAN_LATVIA,
|
|
12845
12851
|
LITHUANIAN: () => LITHUANIAN,
|
|
12846
12852
|
LITHUANIAN_LITHUANIA: () => LITHUANIAN_LITHUANIA,
|
|
12853
|
+
LOWER_SORBIAN: () => LOWER_SORBIAN,
|
|
12854
|
+
LOWER_SORBIAN_GERMANY: () => LOWER_SORBIAN_GERMANY,
|
|
12847
12855
|
MALAY: () => MALAY,
|
|
12856
|
+
MALAYALAM: () => MALAYALAM,
|
|
12857
|
+
MALAYALAM_INDIA: () => MALAYALAM_INDIA,
|
|
12848
12858
|
MALAY_BRUNEI_DARUSSALAM: () => MALAY_BRUNEI_DARUSSALAM,
|
|
12849
12859
|
MALAY_MALAYSIA: () => MALAY_MALAYSIA,
|
|
12850
12860
|
MALTESE: () => MALTESE,
|
|
@@ -12859,8 +12869,10 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12859
12869
|
NEPALI_NEPAL: () => NEPALI_NEPAL,
|
|
12860
12870
|
NORTHERN_SOTHO: () => NORTHERN_SOTHO,
|
|
12861
12871
|
NORTHERN_SOTHO_SOUTH_AFRICA: () => NORTHERN_SOTHO_SOUTH_AFRICA,
|
|
12872
|
+
NORWEGIAN: () => NORWEGIAN,
|
|
12862
12873
|
NORWEGIAN_BOKMAL: () => NORWEGIAN_BOKMAL,
|
|
12863
12874
|
NORWEGIAN_BOKMAL_NORWAY: () => NORWEGIAN_BOKMAL_NORWAY,
|
|
12875
|
+
NORWEGIAN_NYNORSK: () => NORWEGIAN_NYNORSK,
|
|
12864
12876
|
NORWEGIAN_NYNORSK_NORWAY: () => NORWEGIAN_NYNORSK_NORWAY,
|
|
12865
12877
|
PASHTO: () => PASHTO,
|
|
12866
12878
|
PASHTO_AFGHANISTAN: () => PASHTO_AFGHANISTAN,
|
|
@@ -12882,8 +12894,12 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12882
12894
|
QUECHUA_ECUADOR: () => QUECHUA_ECUADOR,
|
|
12883
12895
|
QUECHUA_PERU: () => QUECHUA_PERU,
|
|
12884
12896
|
ROMANIAN: () => ROMANIAN,
|
|
12897
|
+
ROMANIAN_MOLDOVA: () => ROMANIAN_MOLDOVA,
|
|
12885
12898
|
ROMANIAN_ROMANIA: () => ROMANIAN_ROMANIA,
|
|
12899
|
+
ROMANSH: () => ROMANSH,
|
|
12900
|
+
ROMANSH_SWITZERLAND: () => ROMANSH_SWITZERLAND,
|
|
12886
12901
|
RUSSIAN: () => RUSSIAN,
|
|
12902
|
+
RUSSIAN_MOLDOVA: () => RUSSIAN_MOLDOVA,
|
|
12887
12903
|
RUSSIAN_RUSSIA: () => RUSSIAN_RUSSIA,
|
|
12888
12904
|
SAMI_NORTHERN: () => SAMI_NORTHERN,
|
|
12889
12905
|
SAMI_NORTHERN_FINLAND: () => SAMI_NORTHERN_FINLAND,
|
|
@@ -12891,6 +12907,8 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12891
12907
|
SAMI_NORTHERN_SWEDEN: () => SAMI_NORTHERN_SWEDEN,
|
|
12892
12908
|
SANSKRIT: () => SANSKRIT,
|
|
12893
12909
|
SANSKRIT_INDIA: () => SANSKRIT_INDIA,
|
|
12910
|
+
SCOTTISH_GAELIC: () => SCOTTISH_GAELIC,
|
|
12911
|
+
SCOTTISH_GAELIC_UNITED_KINGDOM: () => SCOTTISH_GAELIC_UNITED_KINGDOM,
|
|
12894
12912
|
SERBIAN_CYRILLIC: () => SERBIAN_CYRILLIC,
|
|
12895
12913
|
SERBIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA: () => SERBIAN_CYRILLIC_BOSNIA_AND_HERZEGOVINA,
|
|
12896
12914
|
SERBIAN_CYRILLIC_SERBIA: () => SERBIAN_CYRILLIC_SERBIA,
|
|
@@ -12949,16 +12967,22 @@ var locales_exports = /* @__PURE__ */ __export({
|
|
|
12949
12967
|
TURKISH_TURKEY: () => TURKISH_TURKEY,
|
|
12950
12968
|
UKRAINIAN: () => UKRAINIAN,
|
|
12951
12969
|
UKRAINIAN_UKRAINE: () => UKRAINIAN_UKRAINE,
|
|
12970
|
+
UPPER_SORBIAN: () => UPPER_SORBIAN,
|
|
12971
|
+
UPPER_SORBIAN_GERMANY: () => UPPER_SORBIAN_GERMANY,
|
|
12952
12972
|
URDU: () => URDU,
|
|
12953
12973
|
URDU_ISLAMIC_REPUBLIC_OF_PAKISTAN: () => URDU_ISLAMIC_REPUBLIC_OF_PAKISTAN,
|
|
12954
12974
|
UZBEK_LATIN: () => UZBEK_LATIN,
|
|
12955
12975
|
UZBEK_LATIN_UZBEKISTAN: () => UZBEK_LATIN_UZBEKISTAN,
|
|
12976
|
+
VENDA: () => VENDA,
|
|
12977
|
+
VENDA_SOUTH_AFRICA: () => VENDA_SOUTH_AFRICA,
|
|
12956
12978
|
VIETNAMESE: () => VIETNAMESE,
|
|
12957
12979
|
VIETNAMESE_VIET_NAM: () => VIETNAMESE_VIET_NAM,
|
|
12958
12980
|
WELSH: () => WELSH,
|
|
12959
12981
|
WELSH_UNITED_KINGDOM: () => WELSH_UNITED_KINGDOM,
|
|
12960
12982
|
XHOSA: () => XHOSA,
|
|
12961
12983
|
XHOSA_SOUTH_AFRICA: () => XHOSA_SOUTH_AFRICA,
|
|
12984
|
+
YIDDISH: () => YIDDISH,
|
|
12985
|
+
YIDDISH_WORLD: () => YIDDISH_WORLD,
|
|
12962
12986
|
YORUBA: () => YORUBA,
|
|
12963
12987
|
YORUBA_NIGERIA: () => YORUBA_NIGERIA,
|
|
12964
12988
|
ZULU: () => ZULU,
|
|
@@ -13061,6 +13085,10 @@ const FRENCH_SWITZERLAND = "fr-CH";
|
|
|
13061
13085
|
const FRENCH_FRANCE = "fr-FR";
|
|
13062
13086
|
const FRENCH_LUXEMBOURG = "fr-LU";
|
|
13063
13087
|
const FRENCH_PRINCIPALITY_OF_MONACO = "fr-MC";
|
|
13088
|
+
const IRISH = "ga";
|
|
13089
|
+
const IRISH_IRELAND = "ga-IE";
|
|
13090
|
+
const SCOTTISH_GAELIC = "gd";
|
|
13091
|
+
const SCOTTISH_GAELIC_UNITED_KINGDOM = "gd-GB";
|
|
13064
13092
|
const GALICIAN = "gl";
|
|
13065
13093
|
const GALICIAN_SPAIN = "gl-ES";
|
|
13066
13094
|
const GUJARATI = "gu";
|
|
@@ -13095,6 +13123,8 @@ const KOREAN = "ko";
|
|
|
13095
13123
|
const KOREAN_KOREA = "ko-KR";
|
|
13096
13124
|
const KONKANI = "kok";
|
|
13097
13125
|
const KONKANI_INDIA = "kok-IN";
|
|
13126
|
+
const KURDISH = "ku";
|
|
13127
|
+
const KURDISH_TURKEY = "ku-TR";
|
|
13098
13128
|
const KYRGYZ = "ky";
|
|
13099
13129
|
const KYRGYZ_KYRGYZSTAN = "ky-KG";
|
|
13100
13130
|
const LITHUANIAN = "lt";
|
|
@@ -13114,11 +13144,15 @@ const MALAY_BRUNEI_DARUSSALAM = "ms-BN";
|
|
|
13114
13144
|
const MALAY_MALAYSIA = "ms-MY";
|
|
13115
13145
|
const MALTESE = "mt";
|
|
13116
13146
|
const MALTESE_MALTA = "mt-MT";
|
|
13147
|
+
const MALAYALAM = "ml";
|
|
13148
|
+
const MALAYALAM_INDIA = "ml-IN";
|
|
13149
|
+
const NORWEGIAN = "no";
|
|
13117
13150
|
const NORWEGIAN_BOKMAL = "nb";
|
|
13118
13151
|
const NORWEGIAN_BOKMAL_NORWAY = "nb-NO";
|
|
13119
13152
|
const DUTCH = "nl";
|
|
13120
13153
|
const DUTCH_BELGIUM = "nl-BE";
|
|
13121
13154
|
const DUTCH_NETHERLANDS = "nl-NL";
|
|
13155
|
+
const NORWEGIAN_NYNORSK = "nn";
|
|
13122
13156
|
const NORWEGIAN_NYNORSK_NORWAY = "nn-NO";
|
|
13123
13157
|
const NORTHERN_SOTHO = "ns";
|
|
13124
13158
|
const NORTHERN_SOTHO_SOUTH_AFRICA = "ns-ZA";
|
|
@@ -13137,14 +13171,22 @@ const QUECHUA_ECUADOR = "qu-EC";
|
|
|
13137
13171
|
const QUECHUA_PERU = "qu-PE";
|
|
13138
13172
|
const ROMANIAN = "ro";
|
|
13139
13173
|
const ROMANIAN_ROMANIA = "ro-RO";
|
|
13174
|
+
const ROMANIAN_MOLDOVA = "ro-MD";
|
|
13175
|
+
const ROMANSH = "rm";
|
|
13176
|
+
const ROMANSH_SWITZERLAND = "rm-CH";
|
|
13140
13177
|
const RUSSIAN = "ru";
|
|
13141
13178
|
const RUSSIAN_RUSSIA = "ru-RU";
|
|
13179
|
+
const RUSSIAN_MOLDOVA = "ru-MD";
|
|
13142
13180
|
const SANSKRIT = "sa";
|
|
13143
13181
|
const SANSKRIT_INDIA = "sa-IN";
|
|
13144
13182
|
const SAMI_NORTHERN = "se";
|
|
13145
13183
|
const SAMI_NORTHERN_FINLAND = "se-FI";
|
|
13146
13184
|
const SAMI_NORTHERN_NORWAY = "se-NO";
|
|
13147
13185
|
const SAMI_NORTHERN_SWEDEN = "se-SE";
|
|
13186
|
+
const UPPER_SORBIAN = "hsb";
|
|
13187
|
+
const UPPER_SORBIAN_GERMANY = "hsb-DE";
|
|
13188
|
+
const LOWER_SORBIAN = "dsb";
|
|
13189
|
+
const LOWER_SORBIAN_GERMANY = "dsb-DE";
|
|
13148
13190
|
const SLOVAK = "sk";
|
|
13149
13191
|
const SLOVAK_SLOVAKIA = "sk-SK";
|
|
13150
13192
|
const SLOVENIAN = "sl";
|
|
@@ -13184,6 +13226,8 @@ const UZBEK_LATIN = "uz";
|
|
|
13184
13226
|
const UZBEK_LATIN_UZBEKISTAN = "uz-UZ";
|
|
13185
13227
|
const VIETNAMESE = "vi";
|
|
13186
13228
|
const VIETNAMESE_VIET_NAM = "vi-VN";
|
|
13229
|
+
const VENDA = "ve";
|
|
13230
|
+
const VENDA_SOUTH_AFRICA = "ve-ZA";
|
|
13187
13231
|
const XHOSA = "xh";
|
|
13188
13232
|
const XHOSA_SOUTH_AFRICA = "xh-ZA";
|
|
13189
13233
|
const CHINESE = "zh";
|
|
@@ -13207,6 +13251,8 @@ const LAO = "lo";
|
|
|
13207
13251
|
const LAO_LAOS = "lo-LA";
|
|
13208
13252
|
const YORUBA = "yo";
|
|
13209
13253
|
const YORUBA_NIGERIA = "yo-NG";
|
|
13254
|
+
const YIDDISH = "yi";
|
|
13255
|
+
const YIDDISH_WORLD = "yi-001";
|
|
13210
13256
|
const AMHARIC = "am";
|
|
13211
13257
|
const AMHARIC_ETHIOPIA = "am-ET";
|
|
13212
13258
|
const NEPALI = "ne";
|
|
@@ -13341,6 +13387,10 @@ const ALL_LOCALES = {
|
|
|
13341
13387
|
FRENCH_FRANCE,
|
|
13342
13388
|
FRENCH_LUXEMBOURG,
|
|
13343
13389
|
FRENCH_PRINCIPALITY_OF_MONACO,
|
|
13390
|
+
IRISH,
|
|
13391
|
+
IRISH_IRELAND,
|
|
13392
|
+
SCOTTISH_GAELIC,
|
|
13393
|
+
SCOTTISH_GAELIC_UNITED_KINGDOM,
|
|
13344
13394
|
GALICIAN,
|
|
13345
13395
|
GALICIAN_SPAIN,
|
|
13346
13396
|
GUJARATI,
|
|
@@ -13375,6 +13425,8 @@ const ALL_LOCALES = {
|
|
|
13375
13425
|
KOREAN_KOREA,
|
|
13376
13426
|
KONKANI,
|
|
13377
13427
|
KONKANI_INDIA,
|
|
13428
|
+
KURDISH,
|
|
13429
|
+
KURDISH_TURKEY,
|
|
13378
13430
|
KYRGYZ,
|
|
13379
13431
|
KYRGYZ_KYRGYZSTAN,
|
|
13380
13432
|
LITHUANIAN,
|
|
@@ -13394,11 +13446,15 @@ const ALL_LOCALES = {
|
|
|
13394
13446
|
MALAY_MALAYSIA,
|
|
13395
13447
|
MALTESE,
|
|
13396
13448
|
MALTESE_MALTA,
|
|
13449
|
+
MALAYALAM,
|
|
13450
|
+
MALAYALAM_INDIA,
|
|
13451
|
+
NORWEGIAN,
|
|
13397
13452
|
NORWEGIAN_BOKMAL,
|
|
13398
13453
|
NORWEGIAN_BOKMAL_NORWAY,
|
|
13399
13454
|
DUTCH,
|
|
13400
13455
|
DUTCH_BELGIUM,
|
|
13401
13456
|
DUTCH_NETHERLANDS,
|
|
13457
|
+
NORWEGIAN_NYNORSK,
|
|
13402
13458
|
NORWEGIAN_NYNORSK_NORWAY,
|
|
13403
13459
|
NORTHERN_SOTHO,
|
|
13404
13460
|
NORTHERN_SOTHO_SOUTH_AFRICA,
|
|
@@ -13417,14 +13473,22 @@ const ALL_LOCALES = {
|
|
|
13417
13473
|
QUECHUA_PERU,
|
|
13418
13474
|
ROMANIAN,
|
|
13419
13475
|
ROMANIAN_ROMANIA,
|
|
13476
|
+
ROMANIAN_MOLDOVA,
|
|
13477
|
+
ROMANSH,
|
|
13478
|
+
ROMANSH_SWITZERLAND,
|
|
13420
13479
|
RUSSIAN,
|
|
13421
13480
|
RUSSIAN_RUSSIA,
|
|
13481
|
+
RUSSIAN_MOLDOVA,
|
|
13422
13482
|
SANSKRIT,
|
|
13423
13483
|
SANSKRIT_INDIA,
|
|
13424
13484
|
SAMI_NORTHERN,
|
|
13425
13485
|
SAMI_NORTHERN_FINLAND,
|
|
13426
13486
|
SAMI_NORTHERN_NORWAY,
|
|
13427
13487
|
SAMI_NORTHERN_SWEDEN,
|
|
13488
|
+
UPPER_SORBIAN,
|
|
13489
|
+
UPPER_SORBIAN_GERMANY,
|
|
13490
|
+
LOWER_SORBIAN,
|
|
13491
|
+
LOWER_SORBIAN_GERMANY,
|
|
13428
13492
|
SLOVAK,
|
|
13429
13493
|
SLOVAK_SLOVAKIA,
|
|
13430
13494
|
SLOVENIAN,
|
|
@@ -13464,6 +13528,8 @@ const ALL_LOCALES = {
|
|
|
13464
13528
|
UZBEK_LATIN_UZBEKISTAN,
|
|
13465
13529
|
VIETNAMESE,
|
|
13466
13530
|
VIETNAMESE_VIET_NAM,
|
|
13531
|
+
VENDA,
|
|
13532
|
+
VENDA_SOUTH_AFRICA,
|
|
13467
13533
|
XHOSA,
|
|
13468
13534
|
XHOSA_SOUTH_AFRICA,
|
|
13469
13535
|
CHINESE,
|
|
@@ -13487,6 +13553,8 @@ const ALL_LOCALES = {
|
|
|
13487
13553
|
LAO_LAOS,
|
|
13488
13554
|
YORUBA,
|
|
13489
13555
|
YORUBA_NIGERIA,
|
|
13556
|
+
YIDDISH,
|
|
13557
|
+
YIDDISH_WORLD,
|
|
13490
13558
|
AMHARIC,
|
|
13491
13559
|
AMHARIC_ETHIOPIA,
|
|
13492
13560
|
NEPALI,
|
|
@@ -14516,28 +14584,25 @@ const cacheKey = (locales, options) => JSON.stringify([locales, options]);
|
|
|
14516
14584
|
const createCachedConstructor = (Ctor) => {
|
|
14517
14585
|
const cache = /* @__PURE__ */ new Map();
|
|
14518
14586
|
function Wrapped(locales, options) {
|
|
14519
|
-
if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function")
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
|
|
14523
|
-
|
|
14524
|
-
|
|
14525
|
-
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
|
|
14530
|
-
|
|
14531
|
-
|
|
14532
|
-
|
|
14533
|
-
|
|
14534
|
-
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14538
|
-
].join("\n"));
|
|
14539
|
-
return locales;
|
|
14540
|
-
}
|
|
14587
|
+
if (Ctor.name === "DisplayNames" && typeof Intl?.DisplayNames !== "function") throw new Error([
|
|
14588
|
+
`// Intl.DisplayNames is not supported; falling back to raw locale (${locales}). `,
|
|
14589
|
+
`// Consider adding a polyfill as https://formatjs.io/docs/polyfills/intl-displaynames/`,
|
|
14590
|
+
``,
|
|
14591
|
+
`import 'intl';`,
|
|
14592
|
+
`import '@formatjs/intl-getcanonicallocales/polyfill';`,
|
|
14593
|
+
`import '@formatjs/intl-locale/polyfill';`,
|
|
14594
|
+
`import '@formatjs/intl-pluralrules/polyfill';`,
|
|
14595
|
+
`import '@formatjs/intl-displaynames/polyfill';`,
|
|
14596
|
+
`import '@formatjs/intl-listformat/polyfill';`,
|
|
14597
|
+
`import '@formatjs/intl-numberformat/polyfill';`,
|
|
14598
|
+
`import '@formatjs/intl-relativetimeformat/polyfill';`,
|
|
14599
|
+
`import '@formatjs/intl-datetimeformat/polyfill';`,
|
|
14600
|
+
``,
|
|
14601
|
+
`// Optionally add locale data`,
|
|
14602
|
+
`import '@formatjs/intl-pluralrules/locale-data/fr';`,
|
|
14603
|
+
`import '@formatjs/intl-numberformat/locale-data/fr';`,
|
|
14604
|
+
`import '@formatjs/intl-datetimeformat/locale-data/fr';`
|
|
14605
|
+
].join("\n"));
|
|
14541
14606
|
const key2 = cacheKey(locales ?? locales_exports.ENGLISH, options);
|
|
14542
14607
|
let instance = cache.get(key2);
|
|
14543
14608
|
if (!instance) {
|
|
@@ -14718,10 +14783,6 @@ const localeStorageOptions = {
|
|
|
14718
14783
|
const getHTMLTextDir = (locale) => {
|
|
14719
14784
|
switch (locale) {
|
|
14720
14785
|
case locales_exports.ARABIC:
|
|
14721
|
-
case locales_exports.FARSI:
|
|
14722
|
-
case locales_exports.URDU:
|
|
14723
|
-
case locales_exports.PASHTO:
|
|
14724
|
-
case locales_exports.SYRIAC:
|
|
14725
14786
|
case locales_exports.ARABIC_UNITED_ARAB_EMIRATES:
|
|
14726
14787
|
case locales_exports.ARABIC_BAHRAIN:
|
|
14727
14788
|
case locales_exports.ARABIC_ALGERIA:
|
|
@@ -14738,10 +14799,27 @@ const getHTMLTextDir = (locale) => {
|
|
|
14738
14799
|
case locales_exports.ARABIC_SYRIA:
|
|
14739
14800
|
case locales_exports.ARABIC_TUNISIA:
|
|
14740
14801
|
case locales_exports.ARABIC_YEMEN:
|
|
14802
|
+
case locales_exports.ARABIC_MAURITANIA:
|
|
14803
|
+
case locales_exports.ARABIC_PALESTINE:
|
|
14804
|
+
case locales_exports.ARABIC_SUDAN:
|
|
14805
|
+
case locales_exports.ARABIC_DJIBOUTI:
|
|
14806
|
+
case locales_exports.ARABIC_SOMALIA:
|
|
14807
|
+
case locales_exports.ARABIC_CHAD:
|
|
14808
|
+
case locales_exports.ARABIC_COMOROS:
|
|
14809
|
+
case locales_exports.HEBREW:
|
|
14810
|
+
case locales_exports.HEBREW_ISRAEL:
|
|
14811
|
+
case locales_exports.FARSI:
|
|
14741
14812
|
case locales_exports.FARSI_IRAN:
|
|
14813
|
+
case locales_exports.URDU:
|
|
14742
14814
|
case locales_exports.URDU_ISLAMIC_REPUBLIC_OF_PAKISTAN:
|
|
14815
|
+
case locales_exports.PASHTO:
|
|
14743
14816
|
case locales_exports.PASHTO_AFGHANISTAN:
|
|
14817
|
+
case locales_exports.SYRIAC:
|
|
14744
14818
|
case locales_exports.SYRIAC_SYRIA:
|
|
14819
|
+
case locales_exports.DIVEHI:
|
|
14820
|
+
case locales_exports.DIVEHI_MALDIVES:
|
|
14821
|
+
case locales_exports.YIDDISH:
|
|
14822
|
+
case locales_exports.YIDDISH_WORLD:
|
|
14745
14823
|
return "rtl";
|
|
14746
14824
|
default:
|
|
14747
14825
|
return "ltr";
|
|
@@ -20878,6 +20956,7 @@ const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
|
20878
20956
|
xl: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
20879
20957
|
"2xl": "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
20880
20958
|
"3xl": "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl",
|
|
20959
|
+
"4xl": "rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]",
|
|
20881
20960
|
full: "rounded-full [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-full"
|
|
20882
20961
|
},
|
|
20883
20962
|
transparency: {
|
|
@@ -20904,7 +20983,7 @@ const containerVariants$1 = cva("flex flex-col text-text backdrop-blur", {
|
|
|
20904
20983
|
},
|
|
20905
20984
|
border: {
|
|
20906
20985
|
none: "",
|
|
20907
|
-
with: "border-[1.
|
|
20986
|
+
with: "border-[1.3px]"
|
|
20908
20987
|
},
|
|
20909
20988
|
borderColor: {
|
|
20910
20989
|
primary: "border-primary",
|
|
@@ -20945,8 +21024,10 @@ let ContainerRoundedSize = /* @__PURE__ */ (function(ContainerRoundedSize$1) {
|
|
|
20945
21024
|
ContainerRoundedSize$1["MD"] = "md";
|
|
20946
21025
|
ContainerRoundedSize$1["LG"] = "lg";
|
|
20947
21026
|
ContainerRoundedSize$1["XL"] = "xl";
|
|
20948
|
-
ContainerRoundedSize$1["
|
|
20949
|
-
ContainerRoundedSize$1["
|
|
21027
|
+
ContainerRoundedSize$1["2xl"] = "2xl";
|
|
21028
|
+
ContainerRoundedSize$1["3xl"] = "3xl";
|
|
21029
|
+
ContainerRoundedSize$1["4xl"] = "4xl";
|
|
21030
|
+
ContainerRoundedSize$1["5xl"] = "5xl";
|
|
20950
21031
|
ContainerRoundedSize$1["FULL"] = "full";
|
|
20951
21032
|
return ContainerRoundedSize$1;
|
|
20952
21033
|
})({});
|
|
@@ -21118,10 +21199,10 @@ const buttonVariants = cva("relative inline-flex cursor-pointer items-center jus
|
|
|
21118
21199
|
[`${ButtonColor.NEUTRAL}`]: "text-neutral ring-neutral-500/20 *:text-text-light",
|
|
21119
21200
|
[`${ButtonColor.CARD}`]: "hover-card-500/20 text-card ring-card-500/20 *:text-text-light",
|
|
21120
21201
|
[`${ButtonColor.LIGHT}`]: "hover-white-500/20 text-white ring-white/20 *:text-text-light",
|
|
21121
|
-
[`${ButtonColor.DARK}`]: "text-neutral-800 ring-
|
|
21122
|
-
[`${ButtonColor.TEXT}`]: "text-text ring-
|
|
21123
|
-
[`${ButtonColor.CURRENT}`]: "hover-current-500/
|
|
21124
|
-
[`${ButtonColor.TEXT_INVERSE}`]: "text-text-opposite ring-
|
|
21202
|
+
[`${ButtonColor.DARK}`]: "text-neutral-800 ring-text-light/50 *:text-text-light",
|
|
21203
|
+
[`${ButtonColor.TEXT}`]: "text-text ring-text/20 *:text-text-opposite",
|
|
21204
|
+
[`${ButtonColor.CURRENT}`]: "hover-current-500/10 text-current ring-current/10 *:text-text-light",
|
|
21205
|
+
[`${ButtonColor.TEXT_INVERSE}`]: "text-text-opposite ring-text-opposite/20 *:text-text",
|
|
21125
21206
|
[`${ButtonColor.ERROR}`]: "hover-error-500/20 text-error ring-error/20 *:text-text-light",
|
|
21126
21207
|
[`${ButtonColor.SUCCESS}`]: "hover-success-500/20 text-success ring-success/20 *:text-text-light",
|
|
21127
21208
|
[`${ButtonColor.CUSTOM}`]: ""
|
|
@@ -21132,20 +21213,24 @@ const buttonVariants = cva("relative inline-flex cursor-pointer items-center jus
|
|
|
21132
21213
|
[`${ContainerRoundedSize.MD}`]: "rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl",
|
|
21133
21214
|
[`${ContainerRoundedSize.LG}`]: "rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl",
|
|
21134
21215
|
[`${ContainerRoundedSize.XL}`]: "rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl",
|
|
21216
|
+
[`${ContainerRoundedSize["2xl"]}`]: "rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]",
|
|
21217
|
+
[`${ContainerRoundedSize["3xl"]}`]: "rounded-[2.5rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[3rem]",
|
|
21218
|
+
[`${ContainerRoundedSize["4xl"]}`]: "rounded-[3rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[4rem]",
|
|
21219
|
+
[`${ContainerRoundedSize["5xl"]}`]: "rounded-[4rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[5rem]",
|
|
21135
21220
|
[`${ContainerRoundedSize.FULL}`]: "rounded-full"
|
|
21136
21221
|
},
|
|
21137
21222
|
variant: {
|
|
21138
21223
|
[`${ButtonVariant.DEFAULT}`]: [
|
|
21139
21224
|
"bg-current",
|
|
21140
21225
|
"hover:bg-current/90",
|
|
21141
|
-
"hover:ring-
|
|
21142
|
-
"aria-selected:ring-
|
|
21226
|
+
"hover:ring-5",
|
|
21227
|
+
"aria-selected:ring-5"
|
|
21143
21228
|
],
|
|
21144
21229
|
[`${ButtonVariant.OUTLINE}`]: [
|
|
21145
|
-
"rounded-2xl border-[1.
|
|
21146
|
-
"hover:bg-current/20",
|
|
21147
|
-
"hover:ring-
|
|
21148
|
-
"aria-selected:ring-
|
|
21230
|
+
"rounded-2xl border-[1.3px] border-current bg-current/0 *:text-current!",
|
|
21231
|
+
"hover:bg-current/20 focus-visible:bg-current/20",
|
|
21232
|
+
"hover:ring-5 focus-visible:ring-5",
|
|
21233
|
+
"aria-selected:ring-5"
|
|
21149
21234
|
],
|
|
21150
21235
|
[`${ButtonVariant.NONE}`]: "border-none bg-current/0 text-inherit hover:bg-current/0",
|
|
21151
21236
|
[`${ButtonVariant.LINK}`]: "h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline",
|
|
@@ -21189,7 +21274,7 @@ const buttonVariants = cva("relative inline-flex cursor-pointer items-center jus
|
|
|
21189
21274
|
isFullWidth: false
|
|
21190
21275
|
}
|
|
21191
21276
|
});
|
|
21192
|
-
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive
|
|
21277
|
+
const Button = ({ variant, size: size2, color: color2, children, Icon: Icon2, IconRight, iconClassName, isLoading = false, isActive, isSelected, isFullWidth, roundedSize, textAlign, disabled, label, className, type = "button", "aria-describedby": ariaDescribedBy, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, "aria-pressed": ariaPressed, ...props }) => {
|
|
21193
21278
|
const isLink = variant === `${ButtonVariant.LINK}` || variant === `${ButtonVariant.INVISIBLE_LINK}`;
|
|
21194
21279
|
const isIconOnly = !children && (Icon2 || IconRight);
|
|
21195
21280
|
const accessibilityProps = {
|
|
@@ -21360,10 +21445,10 @@ const __iconNode$o = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
|
21360
21445
|
const Check = createLucideIcon("check", __iconNode$o);
|
|
21361
21446
|
const __iconNode$n = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
21362
21447
|
const ChevronDown = createLucideIcon("chevron-down", __iconNode$n);
|
|
21363
|
-
const __iconNode$m = [["path", { d: "
|
|
21364
|
-
const
|
|
21365
|
-
const __iconNode$l = [["path", { d: "
|
|
21366
|
-
const
|
|
21448
|
+
const __iconNode$m = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]];
|
|
21449
|
+
const ChevronLeft = createLucideIcon("chevron-left", __iconNode$m);
|
|
21450
|
+
const __iconNode$l = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
21451
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$l);
|
|
21367
21452
|
const __iconNode$k = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
21368
21453
|
const ChevronUp = createLucideIcon("chevron-up", __iconNode$k);
|
|
21369
21454
|
const __iconNode$j = [
|
|
@@ -21607,7 +21692,7 @@ const badgeVariants = cva("inline-flex items-center rounded-md border px-2.5 py-
|
|
|
21607
21692
|
variant: {
|
|
21608
21693
|
[BadgeVariant.DEFAULT]: "rounded-lg text-text-opposite",
|
|
21609
21694
|
[BadgeVariant.NONE]: "border-none bg-opacity-0 text-inherit hover:bg-opacity-0",
|
|
21610
|
-
[BadgeVariant.OUTLINE]: "rounded-lg border-[1.
|
|
21695
|
+
[BadgeVariant.OUTLINE]: "rounded-lg border-[1.3px] bg-opacity-0 hover:bg-opacity-30",
|
|
21611
21696
|
[BadgeVariant.HOVERABLE]: "rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10"
|
|
21612
21697
|
},
|
|
21613
21698
|
size: {
|
|
@@ -21717,8 +21802,8 @@ const linkVariants = cva("gap-3 transition-all duration-300 focus-visible:outlin
|
|
|
21717
21802
|
variant: {
|
|
21718
21803
|
[`${LinkVariant.DEFAULT}`]: "h-auto justify-start border-inherit bg-current/0 px-1 underline-offset-4 hover:bg-current/0 hover:underline",
|
|
21719
21804
|
[`${LinkVariant.INVISIBLE_LINK}`]: "h-auto justify-start border-inherit bg-current/0 px-1 underline-offset-4 hover:bg-current/0",
|
|
21720
|
-
[`${LinkVariant.BUTTON}`]: "relative flex cursor-pointer flex-row items-center justify-center gap-2 rounded-full bg-current text-center font-medium text-text ring-0 *:text-text-opposite hover:bg-current/90 hover:ring-
|
|
21721
|
-
[`${LinkVariant.BUTTON_OUTLINED}`]: "relative flex cursor-pointer flex-row items-center justify-center gap-2 rounded-full border-[1.
|
|
21805
|
+
[`${LinkVariant.BUTTON}`]: "relative flex cursor-pointer flex-row items-center justify-center gap-2 rounded-full bg-current text-center font-medium text-text ring-0 *:text-text-opposite hover:bg-current/90 hover:ring-5 aria-selected:ring-5",
|
|
21806
|
+
[`${LinkVariant.BUTTON_OUTLINED}`]: "relative flex cursor-pointer flex-row items-center justify-center gap-2 rounded-full border-[1.3px] border-current text-center font-medium text-text ring-0 *:text-text hover:bg-current/20 hover:ring-5 aria-selected:ring-5",
|
|
21722
21807
|
[`${LinkVariant.HOVERABLE}`]: "block rounded-lg border-none bg-current/0 hover:bg-current/10 aria-[current]:bg-current/5"
|
|
21723
21808
|
},
|
|
21724
21809
|
roundedSize: {
|
|
@@ -21848,10 +21933,8 @@ const Link = (props) => {
|
|
|
21848
21933
|
const isChildrenString = typeof children === "string";
|
|
21849
21934
|
const rel = isExternalLink ? "noopener noreferrer nofollow" : void 0;
|
|
21850
21935
|
const target = isExternalLink ? "_blank" : "_self";
|
|
21851
|
-
const href = locale && hrefProp && !isExternalLink && !isPageSection ? getLocalizedUrl(hrefProp, locale) : hrefProp;
|
|
21852
|
-
const isButton = variant === "button" || variant === "button-outlined";
|
|
21853
21936
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("a", {
|
|
21854
|
-
href,
|
|
21937
|
+
href: locale && hrefProp && !isExternalLink && !isPageSection ? getLocalizedUrl(hrefProp, locale) : hrefProp,
|
|
21855
21938
|
"aria-label": label,
|
|
21856
21939
|
rel,
|
|
21857
21940
|
target,
|
|
@@ -21862,26 +21945,23 @@ const Link = (props) => {
|
|
|
21862
21945
|
roundedSize,
|
|
21863
21946
|
underlined,
|
|
21864
21947
|
size: size2,
|
|
21865
|
-
className
|
|
21948
|
+
className
|
|
21866
21949
|
})),
|
|
21867
21950
|
...otherProps,
|
|
21868
21951
|
children: [
|
|
21869
|
-
|
|
21870
|
-
className,
|
|
21871
|
-
children
|
|
21872
|
-
}) : children,
|
|
21952
|
+
children,
|
|
21873
21953
|
isExternalLink && isChildrenString && /* @__PURE__ */ jsxRuntimeExports.jsx(ExternalLink, { className: "ml-2 inline-block size-4" }),
|
|
21874
21954
|
isPageSection && /* @__PURE__ */ jsxRuntimeExports.jsx(MoveRight, { className: "ml-2 inline-block size-4" })
|
|
21875
21955
|
]
|
|
21876
21956
|
});
|
|
21877
21957
|
};
|
|
21878
|
-
const key$
|
|
21879
|
-
const content$
|
|
21880
|
-
const localIds$
|
|
21958
|
+
const key$g = "breadcrumb";
|
|
21959
|
+
const content$g = { "nodeType": "translation", "translation": { "en": { "linkLabel": "Go to" }, "en-GB": { "linkLabel": "Go to" }, "fr": { "linkLabel": "Aller à" }, "es": { "linkLabel": "Ir a" }, "de": { "linkLabel": "Gehe zu" }, "ja": { "linkLabel": "に移動" }, "ko": { "linkLabel": "로 이동" }, "zh": { "linkLabel": "转到" }, "it": { "linkLabel": "Vai a" }, "pt": { "linkLabel": "Ir para" }, "hi": { "linkLabel": "कर जाएं" }, "ar": { "linkLabel": "اذهب إلى" }, "ru": { "linkLabel": "Перейти на" } } };
|
|
21960
|
+
const localIds$g = ["breadcrumb::local::../@intlayer/design-system/src/components/Breadcrumb/breadcrumb.content.ts"];
|
|
21881
21961
|
const _duYE5iNjRQYnPZLlbTEY = {
|
|
21882
|
-
key: key$
|
|
21883
|
-
content: content$
|
|
21884
|
-
localIds: localIds$
|
|
21962
|
+
key: key$g,
|
|
21963
|
+
content: content$g,
|
|
21964
|
+
localIds: localIds$g
|
|
21885
21965
|
};
|
|
21886
21966
|
const breadcrumbVariants = cva("flex flex-row flex-wrap items-center text-sm", {
|
|
21887
21967
|
variants: {
|
|
@@ -21926,6 +22006,7 @@ const LinkLink = ({
|
|
|
21926
22006
|
...props,
|
|
21927
22007
|
label: `${linkLabel} ${children}`,
|
|
21928
22008
|
itemID: href,
|
|
22009
|
+
size: "sm",
|
|
21929
22010
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", {
|
|
21930
22011
|
itemProp: "name",
|
|
21931
22012
|
children
|
|
@@ -22308,7 +22389,7 @@ function createSlotClone$1(ownerName) {
|
|
|
22308
22389
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
22309
22390
|
return SlotClone;
|
|
22310
22391
|
}
|
|
22311
|
-
var SLOTTABLE_IDENTIFIER$1 = Symbol("radix.slottable");
|
|
22392
|
+
var SLOTTABLE_IDENTIFIER$1 = /* @__PURE__ */ Symbol("radix.slottable");
|
|
22312
22393
|
function isSlottable$1(child) {
|
|
22313
22394
|
return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER$1;
|
|
22314
22395
|
}
|
|
@@ -22374,7 +22455,7 @@ var Primitive = NODES.reduce((primitive, node) => {
|
|
|
22374
22455
|
const { asChild, ...primitiveProps } = props;
|
|
22375
22456
|
const Comp = asChild ? Slot2 : node;
|
|
22376
22457
|
if (typeof window !== "undefined") {
|
|
22377
|
-
window[Symbol.for("radix-ui")] = true;
|
|
22458
|
+
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
22378
22459
|
}
|
|
22379
22460
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
22380
22461
|
});
|
|
@@ -23504,6 +23585,12 @@ function RemoveScrollSideCar(props) {
|
|
|
23504
23585
|
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
23505
23586
|
return false;
|
|
23506
23587
|
}
|
|
23588
|
+
var selection = window.getSelection();
|
|
23589
|
+
var anchorNode = selection && selection.anchorNode;
|
|
23590
|
+
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
|
|
23591
|
+
if (isTouchingSelection) {
|
|
23592
|
+
return false;
|
|
23593
|
+
}
|
|
23507
23594
|
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
23508
23595
|
if (!canBeScrolledInMainDirection) {
|
|
23509
23596
|
return true;
|
|
@@ -24370,13 +24457,13 @@ const Command = {
|
|
|
24370
24457
|
Empty: CommandEmpty,
|
|
24371
24458
|
Item: CommandItem
|
|
24372
24459
|
};
|
|
24373
|
-
const key$
|
|
24374
|
-
const content$
|
|
24375
|
-
const localIds$
|
|
24460
|
+
const key$f = "copy-button";
|
|
24461
|
+
const content$f = { "nodeType": "translation", "translation": { "en": { "label": "Copy content" }, "en-GB": { "label": "Copy content" }, "fr": { "label": "Copier le contenu" }, "es": { "label": "Copiar contenido" }, "de": { "label": "Inhalt kopieren" }, "ja": { "label": "コンテンツをコピー" }, "ko": { "label": "콘텐츠 복사" }, "zh": { "label": "复制内容" }, "it": { "label": "Copia contenuto" }, "pt": { "label": "Copiar conteúdo" }, "hi": { "label": "सामग्री कॉपी करें" }, "ar": { "label": "نسخ المحتوى" }, "ru": { "label": "Копировать содержимое" } } };
|
|
24462
|
+
const localIds$f = ["copy-button::local::../@intlayer/design-system/src/components/CopyButton/CopyButton.content.ts"];
|
|
24376
24463
|
const _ZBwciJIQ6QXeiWWVK4aI = {
|
|
24377
|
-
key: key$
|
|
24378
|
-
content: content$
|
|
24379
|
-
localIds: localIds$
|
|
24464
|
+
key: key$f,
|
|
24465
|
+
content: content$f,
|
|
24466
|
+
localIds: localIds$f
|
|
24380
24467
|
};
|
|
24381
24468
|
const CopyButton = ({
|
|
24382
24469
|
content: content2,
|
|
@@ -27784,15 +27871,63 @@ function useCreateMotionContext(props) {
|
|
|
27784
27871
|
function variantLabelsAsDependency(prop) {
|
|
27785
27872
|
return Array.isArray(prop) ? prop.join(" ") : prop;
|
|
27786
27873
|
}
|
|
27787
|
-
|
|
27788
|
-
|
|
27789
|
-
|
|
27790
|
-
|
|
27791
|
-
|
|
27792
|
-
|
|
27874
|
+
function pixelsToPercent(pixels, axis) {
|
|
27875
|
+
if (axis.max === axis.min)
|
|
27876
|
+
return 0;
|
|
27877
|
+
return pixels / (axis.max - axis.min) * 100;
|
|
27878
|
+
}
|
|
27879
|
+
const correctBorderRadius = {
|
|
27880
|
+
correct: (latest, node) => {
|
|
27881
|
+
if (!node.target)
|
|
27882
|
+
return latest;
|
|
27883
|
+
if (typeof latest === "string") {
|
|
27884
|
+
if (px.test(latest)) {
|
|
27885
|
+
latest = parseFloat(latest);
|
|
27886
|
+
} else {
|
|
27887
|
+
return latest;
|
|
27888
|
+
}
|
|
27793
27889
|
}
|
|
27890
|
+
const x = pixelsToPercent(latest, node.target.x);
|
|
27891
|
+
const y = pixelsToPercent(latest, node.target.y);
|
|
27892
|
+
return `${x}% ${y}%`;
|
|
27794
27893
|
}
|
|
27795
|
-
}
|
|
27894
|
+
};
|
|
27895
|
+
const correctBoxShadow = {
|
|
27896
|
+
correct: (latest, { treeScale, projectionDelta }) => {
|
|
27897
|
+
const original = latest;
|
|
27898
|
+
const shadow = complex.parse(latest);
|
|
27899
|
+
if (shadow.length > 5)
|
|
27900
|
+
return original;
|
|
27901
|
+
const template = complex.createTransformer(latest);
|
|
27902
|
+
const offset2 = typeof shadow[0] !== "number" ? 1 : 0;
|
|
27903
|
+
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
27904
|
+
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
27905
|
+
shadow[0 + offset2] /= xScale;
|
|
27906
|
+
shadow[1 + offset2] /= yScale;
|
|
27907
|
+
const averageScale = mixNumber$1(xScale, yScale, 0.5);
|
|
27908
|
+
if (typeof shadow[2 + offset2] === "number")
|
|
27909
|
+
shadow[2 + offset2] /= averageScale;
|
|
27910
|
+
if (typeof shadow[3 + offset2] === "number")
|
|
27911
|
+
shadow[3 + offset2] /= averageScale;
|
|
27912
|
+
return template(shadow);
|
|
27913
|
+
}
|
|
27914
|
+
};
|
|
27915
|
+
const scaleCorrectors = {
|
|
27916
|
+
borderRadius: {
|
|
27917
|
+
...correctBorderRadius,
|
|
27918
|
+
applyTo: [
|
|
27919
|
+
"borderTopLeftRadius",
|
|
27920
|
+
"borderTopRightRadius",
|
|
27921
|
+
"borderBottomLeftRadius",
|
|
27922
|
+
"borderBottomRightRadius"
|
|
27923
|
+
]
|
|
27924
|
+
},
|
|
27925
|
+
borderTopLeftRadius: correctBorderRadius,
|
|
27926
|
+
borderTopRightRadius: correctBorderRadius,
|
|
27927
|
+
borderBottomLeftRadius: correctBorderRadius,
|
|
27928
|
+
borderBottomRightRadius: correctBorderRadius,
|
|
27929
|
+
boxShadow: correctBoxShadow
|
|
27930
|
+
};
|
|
27796
27931
|
function isForcedMotionValue(key2, { layout: layout2, layoutId }) {
|
|
27797
27932
|
return transformProps.has(key2) || key2.startsWith("origin") || (layout2 || layoutId !== void 0) && (!!scaleCorrectors[key2] || key2 === "opacity");
|
|
27798
27933
|
}
|
|
@@ -28163,7 +28298,7 @@ const useSVGVisualState = /* @__PURE__ */ makeUseVisualState({
|
|
|
28163
28298
|
scrapeMotionValuesFromProps,
|
|
28164
28299
|
createRenderState: createSvgRenderState
|
|
28165
28300
|
});
|
|
28166
|
-
const motionComponentSymbol = Symbol.for("motionComponentSymbol");
|
|
28301
|
+
const motionComponentSymbol = /* @__PURE__ */ Symbol.for("motionComponentSymbol");
|
|
28167
28302
|
function isRefObject(ref) {
|
|
28168
28303
|
return ref && typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current");
|
|
28169
28304
|
}
|
|
@@ -30278,47 +30413,6 @@ const globalProjectionState = {
|
|
|
30278
30413
|
*/
|
|
30279
30414
|
hasEverUpdated: false
|
|
30280
30415
|
};
|
|
30281
|
-
function pixelsToPercent(pixels, axis) {
|
|
30282
|
-
if (axis.max === axis.min)
|
|
30283
|
-
return 0;
|
|
30284
|
-
return pixels / (axis.max - axis.min) * 100;
|
|
30285
|
-
}
|
|
30286
|
-
const correctBorderRadius = {
|
|
30287
|
-
correct: (latest, node) => {
|
|
30288
|
-
if (!node.target)
|
|
30289
|
-
return latest;
|
|
30290
|
-
if (typeof latest === "string") {
|
|
30291
|
-
if (px.test(latest)) {
|
|
30292
|
-
latest = parseFloat(latest);
|
|
30293
|
-
} else {
|
|
30294
|
-
return latest;
|
|
30295
|
-
}
|
|
30296
|
-
}
|
|
30297
|
-
const x = pixelsToPercent(latest, node.target.x);
|
|
30298
|
-
const y = pixelsToPercent(latest, node.target.y);
|
|
30299
|
-
return `${x}% ${y}%`;
|
|
30300
|
-
}
|
|
30301
|
-
};
|
|
30302
|
-
const correctBoxShadow = {
|
|
30303
|
-
correct: (latest, { treeScale, projectionDelta }) => {
|
|
30304
|
-
const original = latest;
|
|
30305
|
-
const shadow = complex.parse(latest);
|
|
30306
|
-
if (shadow.length > 5)
|
|
30307
|
-
return original;
|
|
30308
|
-
const template = complex.createTransformer(latest);
|
|
30309
|
-
const offset2 = typeof shadow[0] !== "number" ? 1 : 0;
|
|
30310
|
-
const xScale = projectionDelta.x.scale * treeScale.x;
|
|
30311
|
-
const yScale = projectionDelta.y.scale * treeScale.y;
|
|
30312
|
-
shadow[0 + offset2] /= xScale;
|
|
30313
|
-
shadow[1 + offset2] /= yScale;
|
|
30314
|
-
const averageScale = mixNumber$1(xScale, yScale, 0.5);
|
|
30315
|
-
if (typeof shadow[2 + offset2] === "number")
|
|
30316
|
-
shadow[2 + offset2] /= averageScale;
|
|
30317
|
-
if (typeof shadow[3 + offset2] === "number")
|
|
30318
|
-
shadow[3 + offset2] /= averageScale;
|
|
30319
|
-
return template(shadow);
|
|
30320
|
-
}
|
|
30321
|
-
};
|
|
30322
30416
|
let hasTakenAnySnapshot = false;
|
|
30323
30417
|
class MeasureLayoutWithContext extends reactExports.Component {
|
|
30324
30418
|
/**
|
|
@@ -30329,7 +30423,6 @@ class MeasureLayoutWithContext extends reactExports.Component {
|
|
|
30329
30423
|
componentDidMount() {
|
|
30330
30424
|
const { visualElement, layoutGroup, switchLayoutGroup, layoutId } = this.props;
|
|
30331
30425
|
const { projection } = visualElement;
|
|
30332
|
-
addScaleCorrector(defaultScaleCorrectors);
|
|
30333
30426
|
if (projection) {
|
|
30334
30427
|
if (layoutGroup.group)
|
|
30335
30428
|
layoutGroup.group.add(projection);
|
|
@@ -30411,22 +30504,6 @@ function MeasureLayout(props) {
|
|
|
30411
30504
|
const layoutGroup = reactExports.useContext(LayoutGroupContext);
|
|
30412
30505
|
return jsxRuntimeExports.jsx(MeasureLayoutWithContext, { ...props, layoutGroup, switchLayoutGroup: reactExports.useContext(SwitchLayoutGroupContext), isPresent, safeToRemove });
|
|
30413
30506
|
}
|
|
30414
|
-
const defaultScaleCorrectors = {
|
|
30415
|
-
borderRadius: {
|
|
30416
|
-
...correctBorderRadius,
|
|
30417
|
-
applyTo: [
|
|
30418
|
-
"borderTopLeftRadius",
|
|
30419
|
-
"borderTopRightRadius",
|
|
30420
|
-
"borderBottomLeftRadius",
|
|
30421
|
-
"borderBottomRightRadius"
|
|
30422
|
-
]
|
|
30423
|
-
},
|
|
30424
|
-
borderTopLeftRadius: correctBorderRadius,
|
|
30425
|
-
borderTopRightRadius: correctBorderRadius,
|
|
30426
|
-
borderBottomLeftRadius: correctBorderRadius,
|
|
30427
|
-
borderBottomRightRadius: correctBorderRadius,
|
|
30428
|
-
boxShadow: correctBoxShadow
|
|
30429
|
-
};
|
|
30430
30507
|
function animateSingleValue(value, keyframes2, options) {
|
|
30431
30508
|
const motionValue$1 = isMotionValue(value) ? value : motionValue(value);
|
|
30432
30509
|
motionValue$1.start(animateMotionValue("", motionValue$1, keyframes2, options));
|
|
@@ -32686,10 +32763,9 @@ const InputOTPSeparator = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div"
|
|
|
32686
32763
|
...props,
|
|
32687
32764
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Minus, {})
|
|
32688
32765
|
});
|
|
32689
|
-
const InputIndicator = (
|
|
32766
|
+
const InputIndicator = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
32690
32767
|
"data-indicator": true,
|
|
32691
32768
|
className: "absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/20 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none",
|
|
32692
|
-
ref,
|
|
32693
32769
|
...props
|
|
32694
32770
|
});
|
|
32695
32771
|
const SearchInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", {
|
|
@@ -32986,7 +33062,7 @@ var generateWatchOutput = (names, _names, formValues, isGlobal, defaultValue) =>
|
|
|
32986
33062
|
var isPrimitive = (value) => isNullOrUndefined(value) || !isObjectType(value);
|
|
32987
33063
|
function deepEqual$1(object1, object2, _internal_visited = /* @__PURE__ */ new WeakSet()) {
|
|
32988
33064
|
if (isPrimitive(object1) || isPrimitive(object2)) {
|
|
32989
|
-
return object1
|
|
33065
|
+
return Object.is(object1, object2);
|
|
32990
33066
|
}
|
|
32991
33067
|
if (isDateObject(object1) && isDateObject(object2)) {
|
|
32992
33068
|
return object1.getTime() === object2.getTime();
|
|
@@ -33008,7 +33084,7 @@ function deepEqual$1(object1, object2, _internal_visited = /* @__PURE__ */ new W
|
|
|
33008
33084
|
}
|
|
33009
33085
|
if (key2 !== "ref") {
|
|
33010
33086
|
const val2 = object2[key2];
|
|
33011
|
-
if (isDateObject(val1) && isDateObject(val2) || isObject$4(val1) && isObject$4(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual$1(val1, val2, _internal_visited) : val1
|
|
33087
|
+
if (isDateObject(val1) && isDateObject(val2) || isObject$4(val1) && isObject$4(val2) || Array.isArray(val1) && Array.isArray(val2) ? !deepEqual$1(val1, val2, _internal_visited) : !Object.is(val1, val2)) {
|
|
33012
33088
|
return false;
|
|
33013
33089
|
}
|
|
33014
33090
|
}
|
|
@@ -33078,19 +33154,19 @@ function useWatch(props) {
|
|
|
33078
33154
|
}
|
|
33079
33155
|
function useController(props) {
|
|
33080
33156
|
const methods2 = useFormContext();
|
|
33081
|
-
const { name, disabled, control = methods2.control, shouldUnregister, defaultValue } = props;
|
|
33157
|
+
const { name, disabled, control = methods2.control, shouldUnregister, defaultValue, exact = true } = props;
|
|
33082
33158
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
33083
33159
|
const defaultValueMemo = We.useMemo(() => get$2(control._formValues, name, get$2(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
33084
33160
|
const value = useWatch({
|
|
33085
33161
|
control,
|
|
33086
33162
|
name,
|
|
33087
33163
|
defaultValue: defaultValueMemo,
|
|
33088
|
-
exact
|
|
33164
|
+
exact
|
|
33089
33165
|
});
|
|
33090
33166
|
const formState = useFormState({
|
|
33091
33167
|
control,
|
|
33092
33168
|
name,
|
|
33093
|
-
exact
|
|
33169
|
+
exact
|
|
33094
33170
|
});
|
|
33095
33171
|
const _props = We.useRef(props);
|
|
33096
33172
|
const _previousNameRef = We.useRef(void 0);
|
|
@@ -33307,10 +33383,11 @@ function isTraversable(value) {
|
|
|
33307
33383
|
}
|
|
33308
33384
|
function markFieldsDirty(data, fields = {}) {
|
|
33309
33385
|
for (const key2 in data) {
|
|
33310
|
-
|
|
33311
|
-
|
|
33312
|
-
|
|
33313
|
-
|
|
33386
|
+
const value = data[key2];
|
|
33387
|
+
if (isTraversable(value)) {
|
|
33388
|
+
fields[key2] = Array.isArray(value) ? [] : {};
|
|
33389
|
+
markFieldsDirty(value, fields[key2]);
|
|
33390
|
+
} else if (!isUndefined(value)) {
|
|
33314
33391
|
fields[key2] = true;
|
|
33315
33392
|
}
|
|
33316
33393
|
}
|
|
@@ -33321,14 +33398,16 @@ function getDirtyFields(data, formValues, dirtyFieldsFromValues) {
|
|
|
33321
33398
|
dirtyFieldsFromValues = markFieldsDirty(formValues);
|
|
33322
33399
|
}
|
|
33323
33400
|
for (const key2 in data) {
|
|
33324
|
-
|
|
33401
|
+
const value = data[key2];
|
|
33402
|
+
if (isTraversable(value)) {
|
|
33325
33403
|
if (isUndefined(formValues) || isPrimitive(dirtyFieldsFromValues[key2])) {
|
|
33326
|
-
dirtyFieldsFromValues[key2] = markFieldsDirty(
|
|
33404
|
+
dirtyFieldsFromValues[key2] = markFieldsDirty(value, Array.isArray(value) ? [] : {});
|
|
33327
33405
|
} else {
|
|
33328
|
-
getDirtyFields(
|
|
33406
|
+
getDirtyFields(value, isNullOrUndefined(formValues) ? {} : formValues[key2], dirtyFieldsFromValues[key2]);
|
|
33329
33407
|
}
|
|
33330
33408
|
} else {
|
|
33331
|
-
|
|
33409
|
+
const formValue = formValues[key2];
|
|
33410
|
+
dirtyFieldsFromValues[key2] = !deepEqual$1(value, formValue);
|
|
33332
33411
|
}
|
|
33333
33412
|
}
|
|
33334
33413
|
return dirtyFieldsFromValues;
|
|
@@ -33783,7 +33862,7 @@ function createFormControl(props = {}) {
|
|
|
33783
33862
|
if (field) {
|
|
33784
33863
|
const defaultValue = get$2(_formValues, name, isUndefined(value) ? get$2(_defaultValues, name) : value);
|
|
33785
33864
|
isUndefined(defaultValue) || ref && ref.defaultChecked || shouldSkipSetValueAs ? set(_formValues, name, shouldSkipSetValueAs ? defaultValue : getFieldValue(field._f)) : setFieldValue(name, defaultValue);
|
|
33786
|
-
_state.mount && _setValid();
|
|
33865
|
+
_state.mount && !_state.action && _setValid();
|
|
33787
33866
|
}
|
|
33788
33867
|
};
|
|
33789
33868
|
const updateTouchAndDirty = (name, fieldValue, isBlurEvent, shouldDirty, shouldRender) => {
|
|
@@ -34396,6 +34475,10 @@ function createFormControl(props = {}) {
|
|
|
34396
34475
|
};
|
|
34397
34476
|
_state.mount = !_proxyFormState.isValid || !!keepStateOptions.keepIsValid || !!keepStateOptions.keepDirtyValues || !_options.shouldUnregister && !isEmptyObject(values);
|
|
34398
34477
|
_state.watch = !!_options.shouldUnregister;
|
|
34478
|
+
_state.action = false;
|
|
34479
|
+
if (!keepStateOptions.keepErrors) {
|
|
34480
|
+
_formState.errors = {};
|
|
34481
|
+
}
|
|
34399
34482
|
_subjects.state.next({
|
|
34400
34483
|
submitCount: keepStateOptions.keepSubmitCount ? _formState.submitCount : 0,
|
|
34401
34484
|
isDirty: isEmptyResetValues ? false : keepStateOptions.keepDirty ? _formState.isDirty : !!(keepStateOptions.keepDefaultValues && !deepEqual$1(formValues, _defaultValues)),
|
|
@@ -34592,11 +34675,15 @@ function useForm$1(props = {}) {
|
|
|
34592
34675
|
}
|
|
34593
34676
|
}, [control, formState.isDirty]);
|
|
34594
34677
|
We.useEffect(() => {
|
|
34678
|
+
var _a2;
|
|
34595
34679
|
if (props.values && !deepEqual$1(props.values, _values.current)) {
|
|
34596
34680
|
control._reset(props.values, {
|
|
34597
34681
|
keepFieldsRef: true,
|
|
34598
34682
|
...control._options.resetOptions
|
|
34599
34683
|
});
|
|
34684
|
+
if (!((_a2 = control._options.resetOptions) === null || _a2 === void 0 ? void 0 : _a2.keepIsValid)) {
|
|
34685
|
+
control._setValid();
|
|
34686
|
+
}
|
|
34600
34687
|
_values.current = props.values;
|
|
34601
34688
|
updateFormState((state) => ({ ...state }));
|
|
34602
34689
|
} else {
|
|
@@ -34960,7 +35047,7 @@ function addToStart(items, item, max2 = 0) {
|
|
|
34960
35047
|
const newItems = [item, ...items];
|
|
34961
35048
|
return max2 && newItems.length > max2 ? newItems.slice(0, -1) : newItems;
|
|
34962
35049
|
}
|
|
34963
|
-
var skipToken = Symbol();
|
|
35050
|
+
var skipToken = /* @__PURE__ */ Symbol();
|
|
34964
35051
|
function ensureQueryFn(options, fetchOptions) {
|
|
34965
35052
|
if (!options.queryFn && fetchOptions?.initialPromise) {
|
|
34966
35053
|
return () => fetchOptions.initialPromise;
|
|
@@ -35046,20 +35133,20 @@ function pendingThenable() {
|
|
|
35046
35133
|
thenable.status = "pending";
|
|
35047
35134
|
thenable.catch(() => {
|
|
35048
35135
|
});
|
|
35049
|
-
function
|
|
35136
|
+
function finalize2(data) {
|
|
35050
35137
|
Object.assign(thenable, data);
|
|
35051
35138
|
delete thenable.resolve;
|
|
35052
35139
|
delete thenable.reject;
|
|
35053
35140
|
}
|
|
35054
35141
|
thenable.resolve = (value) => {
|
|
35055
|
-
|
|
35142
|
+
finalize2({
|
|
35056
35143
|
status: "fulfilled",
|
|
35057
35144
|
value
|
|
35058
35145
|
});
|
|
35059
35146
|
resolve(value);
|
|
35060
35147
|
};
|
|
35061
35148
|
thenable.reject = (reason) => {
|
|
35062
|
-
|
|
35149
|
+
finalize2({
|
|
35063
35150
|
status: "rejected",
|
|
35064
35151
|
reason
|
|
35065
35152
|
});
|
|
@@ -38205,293 +38292,107 @@ async function startAuthentication(options) {
|
|
|
38205
38292
|
authenticatorAttachment: toAuthenticatorAttachment(credential.authenticatorAttachment)
|
|
38206
38293
|
};
|
|
38207
38294
|
}
|
|
38208
|
-
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
},
|
|
38216
|
-
has(_2, prop) {
|
|
38217
|
-
return prop in _getEnv() || prop in _envShim;
|
|
38218
|
-
},
|
|
38219
|
-
set(_2, prop, value) {
|
|
38220
|
-
const env$1 = _getEnv(true);
|
|
38221
|
-
env$1[prop] = value;
|
|
38222
|
-
return true;
|
|
38223
|
-
},
|
|
38224
|
-
deleteProperty(_2, prop) {
|
|
38225
|
-
if (!prop) return false;
|
|
38226
|
-
const env$1 = _getEnv(true);
|
|
38227
|
-
delete env$1[prop];
|
|
38228
|
-
return true;
|
|
38229
|
-
},
|
|
38230
|
-
ownKeys() {
|
|
38231
|
-
const env$1 = _getEnv(true);
|
|
38232
|
-
return Object.keys(env$1);
|
|
38233
|
-
}
|
|
38234
|
-
});
|
|
38235
|
-
function getEnvVar(key2, fallback) {
|
|
38236
|
-
if (typeof process !== "undefined" && define_process_env_default) return define_process_env_default[key2] ?? fallback;
|
|
38237
|
-
if (typeof Deno !== "undefined") return Deno.env.get(key2) ?? fallback;
|
|
38238
|
-
if (typeof Bun !== "undefined") return Bun.env[key2] ?? fallback;
|
|
38239
|
-
return fallback;
|
|
38240
|
-
}
|
|
38241
|
-
const COLORS_2 = 1;
|
|
38242
|
-
const COLORS_16 = 4;
|
|
38243
|
-
const COLORS_256 = 8;
|
|
38244
|
-
const COLORS_16m = 24;
|
|
38245
|
-
const TERM_ENVS = {
|
|
38246
|
-
eterm: COLORS_16,
|
|
38247
|
-
cons25: COLORS_16,
|
|
38248
|
-
console: COLORS_16,
|
|
38249
|
-
cygwin: COLORS_16,
|
|
38250
|
-
dtterm: COLORS_16,
|
|
38251
|
-
gnome: COLORS_16,
|
|
38252
|
-
hurd: COLORS_16,
|
|
38253
|
-
jfbterm: COLORS_16,
|
|
38254
|
-
konsole: COLORS_16,
|
|
38255
|
-
kterm: COLORS_16,
|
|
38256
|
-
mlterm: COLORS_16,
|
|
38257
|
-
mosh: COLORS_16m,
|
|
38258
|
-
putty: COLORS_16,
|
|
38259
|
-
st: COLORS_16,
|
|
38260
|
-
"rxvt-unicode-24bit": COLORS_16m,
|
|
38261
|
-
terminator: COLORS_16m,
|
|
38262
|
-
"xterm-kitty": COLORS_16m
|
|
38263
|
-
};
|
|
38264
|
-
const CI_ENVS_MAP = new Map(Object.entries({
|
|
38265
|
-
APPVEYOR: COLORS_256,
|
|
38266
|
-
BUILDKITE: COLORS_256,
|
|
38267
|
-
CIRCLECI: COLORS_16m,
|
|
38268
|
-
DRONE: COLORS_256,
|
|
38269
|
-
GITEA_ACTIONS: COLORS_16m,
|
|
38270
|
-
GITHUB_ACTIONS: COLORS_16m,
|
|
38271
|
-
GITLAB_CI: COLORS_256,
|
|
38272
|
-
TRAVIS: COLORS_256
|
|
38273
|
-
}));
|
|
38274
|
-
const TERM_ENVS_REG_EXP = [
|
|
38275
|
-
/ansi/,
|
|
38276
|
-
/color/,
|
|
38277
|
-
/linux/,
|
|
38278
|
-
/direct/,
|
|
38279
|
-
/^con[0-9]*x[0-9]/,
|
|
38280
|
-
/^rxvt/,
|
|
38281
|
-
/^screen/,
|
|
38282
|
-
/^xterm/,
|
|
38283
|
-
/^vt100/,
|
|
38284
|
-
/^vt220/
|
|
38285
|
-
];
|
|
38286
|
-
function getColorDepth() {
|
|
38287
|
-
if (getEnvVar("FORCE_COLOR") !== void 0) switch (getEnvVar("FORCE_COLOR")) {
|
|
38288
|
-
case "":
|
|
38289
|
-
case "1":
|
|
38290
|
-
case "true":
|
|
38291
|
-
return COLORS_16;
|
|
38292
|
-
case "2":
|
|
38293
|
-
return COLORS_256;
|
|
38294
|
-
case "3":
|
|
38295
|
-
return COLORS_16m;
|
|
38296
|
-
default:
|
|
38297
|
-
return COLORS_2;
|
|
38298
|
-
}
|
|
38299
|
-
if (getEnvVar("NODE_DISABLE_COLORS") !== void 0 && getEnvVar("NODE_DISABLE_COLORS") !== "" || getEnvVar("NO_COLOR") !== void 0 && getEnvVar("NO_COLOR") !== "" || getEnvVar("TERM") === "dumb") return COLORS_2;
|
|
38300
|
-
if (getEnvVar("TMUX")) return COLORS_16m;
|
|
38301
|
-
if ("TF_BUILD" in env && "AGENT_NAME" in env) return COLORS_16;
|
|
38302
|
-
if ("CI" in env) {
|
|
38303
|
-
for (const { 0: envName, 1: colors } of CI_ENVS_MAP) if (envName in env) return colors;
|
|
38304
|
-
if (getEnvVar("CI_NAME") === "codeship") return COLORS_256;
|
|
38305
|
-
return COLORS_2;
|
|
38295
|
+
const kBroadcastChannel = /* @__PURE__ */ Symbol.for("better-auth:broadcast-channel");
|
|
38296
|
+
const now$1 = () => Math.floor(Date.now() / 1e3);
|
|
38297
|
+
var WindowBroadcastChannel = class {
|
|
38298
|
+
listeners = /* @__PURE__ */ new Set();
|
|
38299
|
+
name;
|
|
38300
|
+
constructor(name = "better-auth.message") {
|
|
38301
|
+
this.name = name;
|
|
38306
38302
|
}
|
|
38307
|
-
|
|
38308
|
-
|
|
38309
|
-
|
|
38310
|
-
|
|
38311
|
-
|
|
38312
|
-
case "HyperTerm":
|
|
38313
|
-
case "MacTerm":
|
|
38314
|
-
return COLORS_16m;
|
|
38315
|
-
case "Apple_Terminal":
|
|
38316
|
-
return COLORS_256;
|
|
38303
|
+
subscribe(listener) {
|
|
38304
|
+
this.listeners.add(listener);
|
|
38305
|
+
return () => {
|
|
38306
|
+
this.listeners.delete(listener);
|
|
38307
|
+
};
|
|
38317
38308
|
}
|
|
38318
|
-
|
|
38319
|
-
|
|
38320
|
-
|
|
38321
|
-
|
|
38322
|
-
|
|
38323
|
-
|
|
38324
|
-
|
|
38309
|
+
post(message) {
|
|
38310
|
+
if (typeof window === "undefined") return;
|
|
38311
|
+
try {
|
|
38312
|
+
localStorage.setItem(this.name, JSON.stringify({
|
|
38313
|
+
...message,
|
|
38314
|
+
timestamp: now$1()
|
|
38315
|
+
}));
|
|
38316
|
+
} catch {
|
|
38317
|
+
}
|
|
38325
38318
|
}
|
|
38326
|
-
|
|
38327
|
-
|
|
38328
|
-
}
|
|
38329
|
-
const
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38319
|
+
setup() {
|
|
38320
|
+
if (typeof window === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
38321
|
+
};
|
|
38322
|
+
const handler = (event) => {
|
|
38323
|
+
if (event.key !== this.name) return;
|
|
38324
|
+
const message = JSON.parse(event.newValue ?? "{}");
|
|
38325
|
+
if (message?.event !== "session" || !message?.data) return;
|
|
38326
|
+
this.listeners.forEach((listener) => listener(message));
|
|
38327
|
+
};
|
|
38328
|
+
window.addEventListener("storage", handler);
|
|
38329
|
+
return () => {
|
|
38330
|
+
window.removeEventListener("storage", handler);
|
|
38331
|
+
};
|
|
38339
38332
|
}
|
|
38340
38333
|
};
|
|
38341
|
-
|
|
38342
|
-
|
|
38343
|
-
|
|
38344
|
-
"success",
|
|
38345
|
-
"warn",
|
|
38346
|
-
"error"
|
|
38347
|
-
];
|
|
38348
|
-
function shouldPublishLog(currentLogLevel, logLevel) {
|
|
38349
|
-
return levels.indexOf(logLevel) >= levels.indexOf(currentLogLevel);
|
|
38350
|
-
}
|
|
38351
|
-
const levelColors = {
|
|
38352
|
-
info: TTY_COLORS.fg.blue,
|
|
38353
|
-
success: TTY_COLORS.fg.green,
|
|
38354
|
-
warn: TTY_COLORS.fg.yellow,
|
|
38355
|
-
error: TTY_COLORS.fg.red,
|
|
38356
|
-
debug: TTY_COLORS.fg.magenta
|
|
38357
|
-
};
|
|
38358
|
-
const formatMessage = (level, message, colorsEnabled) => {
|
|
38359
|
-
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
38360
|
-
if (colorsEnabled) return `${TTY_COLORS.dim}${timestamp}${TTY_COLORS.reset} ${levelColors[level]}${level.toUpperCase()}${TTY_COLORS.reset} ${TTY_COLORS.bright}[Better Auth]:${TTY_COLORS.reset} ${message}`;
|
|
38361
|
-
return `${timestamp} ${level.toUpperCase()} [Better Auth]: ${message}`;
|
|
38362
|
-
};
|
|
38363
|
-
const createLogger = (options) => {
|
|
38364
|
-
const logLevel = "error";
|
|
38365
|
-
const colorsEnabled = getColorDepth() !== 1;
|
|
38366
|
-
const LogFunc = (level, message, args = []) => {
|
|
38367
|
-
if (!shouldPublishLog(logLevel, level)) return;
|
|
38368
|
-
const formattedMessage = formatMessage(level, message, colorsEnabled);
|
|
38369
|
-
{
|
|
38370
|
-
if (level === "error") console.error(formattedMessage, ...args);
|
|
38371
|
-
else if (level === "warn") console.warn(formattedMessage, ...args);
|
|
38372
|
-
else console.log(formattedMessage, ...args);
|
|
38373
|
-
return;
|
|
38374
|
-
}
|
|
38375
|
-
};
|
|
38376
|
-
return {
|
|
38377
|
-
...Object.fromEntries(levels.map((level) => [level, (...[message, ...args]) => LogFunc(level, message, args)])),
|
|
38378
|
-
get level() {
|
|
38379
|
-
return logLevel;
|
|
38380
|
-
}
|
|
38381
|
-
};
|
|
38382
|
-
};
|
|
38383
|
-
createLogger();
|
|
38384
|
-
function capitalizeFirstLetter(str) {
|
|
38385
|
-
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
38334
|
+
function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
38335
|
+
if (!globalThis[kBroadcastChannel]) globalThis[kBroadcastChannel] = new WindowBroadcastChannel(name);
|
|
38336
|
+
return globalThis[kBroadcastChannel];
|
|
38386
38337
|
}
|
|
38387
|
-
|
|
38388
|
-
|
|
38389
|
-
|
|
38390
|
-
|
|
38391
|
-
this.
|
|
38392
|
-
|
|
38393
|
-
|
|
38394
|
-
|
|
38395
|
-
};
|
|
38396
|
-
function checkHasPath(url) {
|
|
38397
|
-
try {
|
|
38398
|
-
return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
|
|
38399
|
-
} catch (error) {
|
|
38400
|
-
throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`);
|
|
38338
|
+
const kFocusManager = /* @__PURE__ */ Symbol.for("better-auth:focus-manager");
|
|
38339
|
+
var WindowFocusManager = class {
|
|
38340
|
+
listeners = /* @__PURE__ */ new Set();
|
|
38341
|
+
subscribe(listener) {
|
|
38342
|
+
this.listeners.add(listener);
|
|
38343
|
+
return () => {
|
|
38344
|
+
this.listeners.delete(listener);
|
|
38345
|
+
};
|
|
38401
38346
|
}
|
|
38402
|
-
|
|
38403
|
-
|
|
38404
|
-
try {
|
|
38405
|
-
const parsedUrl = new URL(url);
|
|
38406
|
-
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") throw new BetterAuthError(`Invalid base URL: ${url}. URL must include 'http://' or 'https://'`);
|
|
38407
|
-
} catch (error) {
|
|
38408
|
-
if (error instanceof BetterAuthError) throw error;
|
|
38409
|
-
throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`, String(error));
|
|
38347
|
+
setFocused(focused) {
|
|
38348
|
+
this.listeners.forEach((listener) => listener(focused));
|
|
38410
38349
|
}
|
|
38411
|
-
|
|
38412
|
-
|
|
38413
|
-
|
|
38414
|
-
|
|
38415
|
-
|
|
38416
|
-
|
|
38417
|
-
|
|
38418
|
-
|
|
38419
|
-
|
|
38420
|
-
|
|
38421
|
-
if (url) return withPath(url, path);
|
|
38422
|
-
{
|
|
38423
|
-
const fromEnv = env.BETTER_AUTH_URL || env.NEXT_PUBLIC_BETTER_AUTH_URL || env.PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_AUTH_URL || (env.BASE_URL !== "/" ? env.BASE_URL : void 0);
|
|
38424
|
-
if (fromEnv) return withPath(fromEnv, path);
|
|
38350
|
+
setup() {
|
|
38351
|
+
if (typeof window === "undefined" || typeof document === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
38352
|
+
};
|
|
38353
|
+
const visibilityHandler = () => {
|
|
38354
|
+
if (document.visibilityState === "visible") this.setFocused(true);
|
|
38355
|
+
};
|
|
38356
|
+
document.addEventListener("visibilitychange", visibilityHandler, false);
|
|
38357
|
+
return () => {
|
|
38358
|
+
document.removeEventListener("visibilitychange", visibilityHandler, false);
|
|
38359
|
+
};
|
|
38425
38360
|
}
|
|
38426
|
-
if (typeof window !== "undefined" && window.location) return withPath(window.location.origin, path);
|
|
38427
|
-
}
|
|
38428
|
-
const PROTO_POLLUTION_PATTERNS = {
|
|
38429
|
-
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
38430
|
-
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
38431
|
-
protoShort: /"__proto__"\s*:/,
|
|
38432
|
-
constructorShort: /"constructor"\s*:/
|
|
38433
38361
|
};
|
|
38434
|
-
|
|
38435
|
-
|
|
38436
|
-
|
|
38437
|
-
false: false,
|
|
38438
|
-
null: null,
|
|
38439
|
-
undefined: void 0,
|
|
38440
|
-
nan: NaN,
|
|
38441
|
-
infinity: Number.POSITIVE_INFINITY,
|
|
38442
|
-
"-infinity": Number.NEGATIVE_INFINITY
|
|
38443
|
-
};
|
|
38444
|
-
const ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;
|
|
38445
|
-
function isValidDate(date2) {
|
|
38446
|
-
return date2 instanceof Date && !isNaN(date2.getTime());
|
|
38362
|
+
function getGlobalFocusManager() {
|
|
38363
|
+
if (!globalThis[kFocusManager]) globalThis[kFocusManager] = new WindowFocusManager();
|
|
38364
|
+
return globalThis[kFocusManager];
|
|
38447
38365
|
}
|
|
38448
|
-
|
|
38449
|
-
|
|
38450
|
-
|
|
38451
|
-
|
|
38452
|
-
|
|
38453
|
-
|
|
38454
|
-
|
|
38455
|
-
|
|
38366
|
+
const kOnlineManager = /* @__PURE__ */ Symbol.for("better-auth:online-manager");
|
|
38367
|
+
var WindowOnlineManager = class {
|
|
38368
|
+
listeners = /* @__PURE__ */ new Set();
|
|
38369
|
+
isOnline = typeof navigator !== "undefined" ? navigator.onLine : true;
|
|
38370
|
+
subscribe(listener) {
|
|
38371
|
+
this.listeners.add(listener);
|
|
38372
|
+
return () => {
|
|
38373
|
+
this.listeners.delete(listener);
|
|
38374
|
+
};
|
|
38456
38375
|
}
|
|
38457
|
-
|
|
38458
|
-
|
|
38459
|
-
|
|
38460
|
-
const { strict = false, warnings = false, reviver, parseDates = true } = options;
|
|
38461
|
-
if (typeof value !== "string") return value;
|
|
38462
|
-
const trimmed = value.trim();
|
|
38463
|
-
if (trimmed.length > 0 && trimmed[0] === '"' && trimmed.endsWith('"') && !trimmed.slice(1, -1).includes('"')) return trimmed.slice(1, -1);
|
|
38464
|
-
const lowerValue = trimmed.toLowerCase();
|
|
38465
|
-
if (lowerValue.length <= 9 && lowerValue in SPECIAL_VALUES) return SPECIAL_VALUES[lowerValue];
|
|
38466
|
-
if (!JSON_SIGNATURE.test(trimmed)) {
|
|
38467
|
-
if (strict) throw new SyntaxError("[better-json] Invalid JSON");
|
|
38468
|
-
return value;
|
|
38376
|
+
setOnline(online) {
|
|
38377
|
+
this.isOnline = online;
|
|
38378
|
+
this.listeners.forEach((listener) => listener(online));
|
|
38469
38379
|
}
|
|
38470
|
-
|
|
38471
|
-
|
|
38472
|
-
|
|
38473
|
-
|
|
38474
|
-
|
|
38475
|
-
|
|
38476
|
-
|
|
38477
|
-
|
|
38478
|
-
|
|
38479
|
-
|
|
38480
|
-
}
|
|
38481
|
-
if (parseDates && typeof value$1 === "string") {
|
|
38482
|
-
const date2 = parseISODate(value$1);
|
|
38483
|
-
if (date2) return date2;
|
|
38484
|
-
}
|
|
38485
|
-
return reviver ? reviver(key2, value$1) : value$1;
|
|
38380
|
+
setup() {
|
|
38381
|
+
if (typeof window === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
38382
|
+
};
|
|
38383
|
+
const onOnline = () => this.setOnline(true);
|
|
38384
|
+
const onOffline = () => this.setOnline(false);
|
|
38385
|
+
window.addEventListener("online", onOnline, false);
|
|
38386
|
+
window.addEventListener("offline", onOffline, false);
|
|
38387
|
+
return () => {
|
|
38388
|
+
window.removeEventListener("online", onOnline, false);
|
|
38389
|
+
window.removeEventListener("offline", onOffline, false);
|
|
38486
38390
|
};
|
|
38487
|
-
return JSON.parse(trimmed, secureReviver);
|
|
38488
|
-
} catch (error) {
|
|
38489
|
-
if (strict) throw error;
|
|
38490
|
-
return value;
|
|
38491
38391
|
}
|
|
38492
|
-
}
|
|
38493
|
-
function
|
|
38494
|
-
|
|
38392
|
+
};
|
|
38393
|
+
function getGlobalOnlineManager() {
|
|
38394
|
+
if (!globalThis[kOnlineManager]) globalThis[kOnlineManager] = new WindowOnlineManager();
|
|
38395
|
+
return globalThis[kOnlineManager];
|
|
38495
38396
|
}
|
|
38496
38397
|
let listenerQueue = [];
|
|
38497
38398
|
let lqIndex = 0;
|
|
@@ -38619,6 +38520,530 @@ let onMount = ($store, initialize) => {
|
|
|
38619
38520
|
};
|
|
38620
38521
|
});
|
|
38621
38522
|
};
|
|
38523
|
+
const isServer = () => typeof window === "undefined";
|
|
38524
|
+
const useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
38525
|
+
const value = /* @__PURE__ */ atom({
|
|
38526
|
+
data: null,
|
|
38527
|
+
error: null,
|
|
38528
|
+
isPending: true,
|
|
38529
|
+
isRefetching: false,
|
|
38530
|
+
refetch: (queryParams) => fn(queryParams)
|
|
38531
|
+
});
|
|
38532
|
+
const fn = async (queryParams) => {
|
|
38533
|
+
return new Promise((resolve) => {
|
|
38534
|
+
const opts = typeof options === "function" ? options({
|
|
38535
|
+
data: value.get().data,
|
|
38536
|
+
error: value.get().error,
|
|
38537
|
+
isPending: value.get().isPending
|
|
38538
|
+
}) : options;
|
|
38539
|
+
$fetch(path, {
|
|
38540
|
+
...opts,
|
|
38541
|
+
query: {
|
|
38542
|
+
...opts?.query,
|
|
38543
|
+
...queryParams?.query
|
|
38544
|
+
},
|
|
38545
|
+
async onSuccess(context) {
|
|
38546
|
+
value.set({
|
|
38547
|
+
data: context.data,
|
|
38548
|
+
error: null,
|
|
38549
|
+
isPending: false,
|
|
38550
|
+
isRefetching: false,
|
|
38551
|
+
refetch: value.value.refetch
|
|
38552
|
+
});
|
|
38553
|
+
await opts?.onSuccess?.(context);
|
|
38554
|
+
},
|
|
38555
|
+
async onError(context) {
|
|
38556
|
+
const { request } = context;
|
|
38557
|
+
const retryAttempts = typeof request.retry === "number" ? request.retry : request.retry?.attempts;
|
|
38558
|
+
const retryAttempt = request.retryAttempt || 0;
|
|
38559
|
+
if (retryAttempts && retryAttempt < retryAttempts) return;
|
|
38560
|
+
value.set({
|
|
38561
|
+
error: context.error,
|
|
38562
|
+
data: null,
|
|
38563
|
+
isPending: false,
|
|
38564
|
+
isRefetching: false,
|
|
38565
|
+
refetch: value.value.refetch
|
|
38566
|
+
});
|
|
38567
|
+
await opts?.onError?.(context);
|
|
38568
|
+
},
|
|
38569
|
+
async onRequest(context) {
|
|
38570
|
+
const currentValue = value.get();
|
|
38571
|
+
value.set({
|
|
38572
|
+
isPending: currentValue.data === null,
|
|
38573
|
+
data: currentValue.data,
|
|
38574
|
+
error: null,
|
|
38575
|
+
isRefetching: true,
|
|
38576
|
+
refetch: value.value.refetch
|
|
38577
|
+
});
|
|
38578
|
+
await opts?.onRequest?.(context);
|
|
38579
|
+
}
|
|
38580
|
+
}).catch((error) => {
|
|
38581
|
+
value.set({
|
|
38582
|
+
error,
|
|
38583
|
+
data: null,
|
|
38584
|
+
isPending: false,
|
|
38585
|
+
isRefetching: false,
|
|
38586
|
+
refetch: value.value.refetch
|
|
38587
|
+
});
|
|
38588
|
+
}).finally(() => {
|
|
38589
|
+
resolve(void 0);
|
|
38590
|
+
});
|
|
38591
|
+
});
|
|
38592
|
+
};
|
|
38593
|
+
initializedAtom = Array.isArray(initializedAtom) ? initializedAtom : [initializedAtom];
|
|
38594
|
+
let isMounted = false;
|
|
38595
|
+
for (const initAtom of initializedAtom) initAtom.subscribe(async () => {
|
|
38596
|
+
if (isServer()) return;
|
|
38597
|
+
if (isMounted) await fn();
|
|
38598
|
+
else onMount(value, () => {
|
|
38599
|
+
const timeoutId = setTimeout(async () => {
|
|
38600
|
+
if (!isMounted) {
|
|
38601
|
+
await fn();
|
|
38602
|
+
isMounted = true;
|
|
38603
|
+
}
|
|
38604
|
+
}, 0);
|
|
38605
|
+
return () => {
|
|
38606
|
+
value.off();
|
|
38607
|
+
initAtom.off();
|
|
38608
|
+
clearTimeout(timeoutId);
|
|
38609
|
+
};
|
|
38610
|
+
});
|
|
38611
|
+
});
|
|
38612
|
+
return value;
|
|
38613
|
+
};
|
|
38614
|
+
const now = () => Math.floor(Date.now() / 1e3);
|
|
38615
|
+
const FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;
|
|
38616
|
+
function createSessionRefreshManager(opts) {
|
|
38617
|
+
const { sessionAtom, sessionSignal, $fetch, options = {} } = opts;
|
|
38618
|
+
const refetchInterval = options.sessionOptions?.refetchInterval ?? 0;
|
|
38619
|
+
const refetchOnWindowFocus = options.sessionOptions?.refetchOnWindowFocus ?? true;
|
|
38620
|
+
const refetchWhenOffline = options.sessionOptions?.refetchWhenOffline ?? false;
|
|
38621
|
+
const state = {
|
|
38622
|
+
lastSync: 0,
|
|
38623
|
+
lastSessionRequest: 0,
|
|
38624
|
+
cachedSession: void 0
|
|
38625
|
+
};
|
|
38626
|
+
const shouldRefetch = () => {
|
|
38627
|
+
return refetchWhenOffline || getGlobalOnlineManager().isOnline;
|
|
38628
|
+
};
|
|
38629
|
+
const triggerRefetch = (event) => {
|
|
38630
|
+
if (!shouldRefetch()) return;
|
|
38631
|
+
if (event?.event === "storage") {
|
|
38632
|
+
state.lastSync = now();
|
|
38633
|
+
sessionSignal.set(!sessionSignal.get());
|
|
38634
|
+
return;
|
|
38635
|
+
}
|
|
38636
|
+
const currentSession = sessionAtom.get();
|
|
38637
|
+
if (event?.event === "poll") {
|
|
38638
|
+
state.lastSessionRequest = now();
|
|
38639
|
+
$fetch("/get-session").then((res) => {
|
|
38640
|
+
sessionAtom.set({
|
|
38641
|
+
...currentSession,
|
|
38642
|
+
data: res.data,
|
|
38643
|
+
error: res.error || null
|
|
38644
|
+
});
|
|
38645
|
+
state.lastSync = now();
|
|
38646
|
+
sessionSignal.set(!sessionSignal.get());
|
|
38647
|
+
}).catch(() => {
|
|
38648
|
+
});
|
|
38649
|
+
return;
|
|
38650
|
+
}
|
|
38651
|
+
if (event?.event === "visibilitychange") {
|
|
38652
|
+
if (now() - state.lastSessionRequest < FOCUS_REFETCH_RATE_LIMIT_SECONDS && currentSession?.data !== null && currentSession?.data !== void 0) return;
|
|
38653
|
+
}
|
|
38654
|
+
if (currentSession?.data === null || currentSession?.data === void 0 || event?.event === "visibilitychange") {
|
|
38655
|
+
if (event?.event === "visibilitychange") state.lastSessionRequest = now();
|
|
38656
|
+
state.lastSync = now();
|
|
38657
|
+
sessionSignal.set(!sessionSignal.get());
|
|
38658
|
+
}
|
|
38659
|
+
};
|
|
38660
|
+
const broadcastSessionUpdate = (trigger) => {
|
|
38661
|
+
getGlobalBroadcastChannel().post({
|
|
38662
|
+
event: "session",
|
|
38663
|
+
data: { trigger },
|
|
38664
|
+
clientId: Math.random().toString(36).substring(7)
|
|
38665
|
+
});
|
|
38666
|
+
};
|
|
38667
|
+
const setupPolling = () => {
|
|
38668
|
+
if (refetchInterval && refetchInterval > 0) state.pollInterval = setInterval(() => {
|
|
38669
|
+
if (sessionAtom.get()?.data) triggerRefetch({ event: "poll" });
|
|
38670
|
+
}, refetchInterval * 1e3);
|
|
38671
|
+
};
|
|
38672
|
+
const setupBroadcast = () => {
|
|
38673
|
+
state.unsubscribeBroadcast = getGlobalBroadcastChannel().subscribe(() => {
|
|
38674
|
+
triggerRefetch({ event: "storage" });
|
|
38675
|
+
});
|
|
38676
|
+
};
|
|
38677
|
+
const setupFocusRefetch = () => {
|
|
38678
|
+
if (!refetchOnWindowFocus) return;
|
|
38679
|
+
state.unsubscribeFocus = getGlobalFocusManager().subscribe(() => {
|
|
38680
|
+
triggerRefetch({ event: "visibilitychange" });
|
|
38681
|
+
});
|
|
38682
|
+
};
|
|
38683
|
+
const setupOnlineRefetch = () => {
|
|
38684
|
+
state.unsubscribeOnline = getGlobalOnlineManager().subscribe((online) => {
|
|
38685
|
+
if (online) triggerRefetch({ event: "visibilitychange" });
|
|
38686
|
+
});
|
|
38687
|
+
};
|
|
38688
|
+
const init2 = () => {
|
|
38689
|
+
setupPolling();
|
|
38690
|
+
setupBroadcast();
|
|
38691
|
+
setupFocusRefetch();
|
|
38692
|
+
setupOnlineRefetch();
|
|
38693
|
+
getGlobalBroadcastChannel().setup();
|
|
38694
|
+
getGlobalFocusManager().setup();
|
|
38695
|
+
getGlobalOnlineManager().setup();
|
|
38696
|
+
};
|
|
38697
|
+
const cleanup = () => {
|
|
38698
|
+
if (state.pollInterval) {
|
|
38699
|
+
clearInterval(state.pollInterval);
|
|
38700
|
+
state.pollInterval = void 0;
|
|
38701
|
+
}
|
|
38702
|
+
if (state.unsubscribeBroadcast) {
|
|
38703
|
+
state.unsubscribeBroadcast();
|
|
38704
|
+
state.unsubscribeBroadcast = void 0;
|
|
38705
|
+
}
|
|
38706
|
+
if (state.unsubscribeFocus) {
|
|
38707
|
+
state.unsubscribeFocus();
|
|
38708
|
+
state.unsubscribeFocus = void 0;
|
|
38709
|
+
}
|
|
38710
|
+
if (state.unsubscribeOnline) {
|
|
38711
|
+
state.unsubscribeOnline();
|
|
38712
|
+
state.unsubscribeOnline = void 0;
|
|
38713
|
+
}
|
|
38714
|
+
state.lastSync = 0;
|
|
38715
|
+
state.lastSessionRequest = 0;
|
|
38716
|
+
state.cachedSession = void 0;
|
|
38717
|
+
};
|
|
38718
|
+
return {
|
|
38719
|
+
init: init2,
|
|
38720
|
+
cleanup,
|
|
38721
|
+
triggerRefetch,
|
|
38722
|
+
broadcastSessionUpdate
|
|
38723
|
+
};
|
|
38724
|
+
}
|
|
38725
|
+
var define_globalThis_process_env_default = {};
|
|
38726
|
+
var define_process_env_default = {};
|
|
38727
|
+
const _envShim = /* @__PURE__ */ Object.create(null);
|
|
38728
|
+
const _getEnv = (useShim) => define_globalThis_process_env_default || globalThis.Deno?.env.toObject() || globalThis.__env__ || (useShim ? _envShim : globalThis);
|
|
38729
|
+
const env = new Proxy(_envShim, {
|
|
38730
|
+
get(_2, prop) {
|
|
38731
|
+
return _getEnv()[prop] ?? _envShim[prop];
|
|
38732
|
+
},
|
|
38733
|
+
has(_2, prop) {
|
|
38734
|
+
return prop in _getEnv() || prop in _envShim;
|
|
38735
|
+
},
|
|
38736
|
+
set(_2, prop, value) {
|
|
38737
|
+
const env$1 = _getEnv(true);
|
|
38738
|
+
env$1[prop] = value;
|
|
38739
|
+
return true;
|
|
38740
|
+
},
|
|
38741
|
+
deleteProperty(_2, prop) {
|
|
38742
|
+
if (!prop) return false;
|
|
38743
|
+
const env$1 = _getEnv(true);
|
|
38744
|
+
delete env$1[prop];
|
|
38745
|
+
return true;
|
|
38746
|
+
},
|
|
38747
|
+
ownKeys() {
|
|
38748
|
+
const env$1 = _getEnv(true);
|
|
38749
|
+
return Object.keys(env$1);
|
|
38750
|
+
}
|
|
38751
|
+
});
|
|
38752
|
+
function getEnvVar(key2, fallback) {
|
|
38753
|
+
if (typeof process !== "undefined" && define_process_env_default) return define_process_env_default[key2] ?? fallback;
|
|
38754
|
+
if (typeof Deno !== "undefined") return Deno.env.get(key2) ?? fallback;
|
|
38755
|
+
if (typeof Bun !== "undefined") return Bun.env[key2] ?? fallback;
|
|
38756
|
+
return fallback;
|
|
38757
|
+
}
|
|
38758
|
+
const COLORS_2 = 1;
|
|
38759
|
+
const COLORS_16 = 4;
|
|
38760
|
+
const COLORS_256 = 8;
|
|
38761
|
+
const COLORS_16m = 24;
|
|
38762
|
+
const TERM_ENVS = {
|
|
38763
|
+
eterm: COLORS_16,
|
|
38764
|
+
cons25: COLORS_16,
|
|
38765
|
+
console: COLORS_16,
|
|
38766
|
+
cygwin: COLORS_16,
|
|
38767
|
+
dtterm: COLORS_16,
|
|
38768
|
+
gnome: COLORS_16,
|
|
38769
|
+
hurd: COLORS_16,
|
|
38770
|
+
jfbterm: COLORS_16,
|
|
38771
|
+
konsole: COLORS_16,
|
|
38772
|
+
kterm: COLORS_16,
|
|
38773
|
+
mlterm: COLORS_16,
|
|
38774
|
+
mosh: COLORS_16m,
|
|
38775
|
+
putty: COLORS_16,
|
|
38776
|
+
st: COLORS_16,
|
|
38777
|
+
"rxvt-unicode-24bit": COLORS_16m,
|
|
38778
|
+
terminator: COLORS_16m,
|
|
38779
|
+
"xterm-kitty": COLORS_16m
|
|
38780
|
+
};
|
|
38781
|
+
const CI_ENVS_MAP = new Map(Object.entries({
|
|
38782
|
+
APPVEYOR: COLORS_256,
|
|
38783
|
+
BUILDKITE: COLORS_256,
|
|
38784
|
+
CIRCLECI: COLORS_16m,
|
|
38785
|
+
DRONE: COLORS_256,
|
|
38786
|
+
GITEA_ACTIONS: COLORS_16m,
|
|
38787
|
+
GITHUB_ACTIONS: COLORS_16m,
|
|
38788
|
+
GITLAB_CI: COLORS_256,
|
|
38789
|
+
TRAVIS: COLORS_256
|
|
38790
|
+
}));
|
|
38791
|
+
const TERM_ENVS_REG_EXP = [
|
|
38792
|
+
/ansi/,
|
|
38793
|
+
/color/,
|
|
38794
|
+
/linux/,
|
|
38795
|
+
/direct/,
|
|
38796
|
+
/^con[0-9]*x[0-9]/,
|
|
38797
|
+
/^rxvt/,
|
|
38798
|
+
/^screen/,
|
|
38799
|
+
/^xterm/,
|
|
38800
|
+
/^vt100/,
|
|
38801
|
+
/^vt220/
|
|
38802
|
+
];
|
|
38803
|
+
function getColorDepth() {
|
|
38804
|
+
if (getEnvVar("FORCE_COLOR") !== void 0) switch (getEnvVar("FORCE_COLOR")) {
|
|
38805
|
+
case "":
|
|
38806
|
+
case "1":
|
|
38807
|
+
case "true":
|
|
38808
|
+
return COLORS_16;
|
|
38809
|
+
case "2":
|
|
38810
|
+
return COLORS_256;
|
|
38811
|
+
case "3":
|
|
38812
|
+
return COLORS_16m;
|
|
38813
|
+
default:
|
|
38814
|
+
return COLORS_2;
|
|
38815
|
+
}
|
|
38816
|
+
if (getEnvVar("NODE_DISABLE_COLORS") !== void 0 && getEnvVar("NODE_DISABLE_COLORS") !== "" || getEnvVar("NO_COLOR") !== void 0 && getEnvVar("NO_COLOR") !== "" || getEnvVar("TERM") === "dumb") return COLORS_2;
|
|
38817
|
+
if (getEnvVar("TMUX")) return COLORS_16m;
|
|
38818
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) return COLORS_16;
|
|
38819
|
+
if ("CI" in env) {
|
|
38820
|
+
for (const { 0: envName, 1: colors } of CI_ENVS_MAP) if (envName in env) return colors;
|
|
38821
|
+
if (getEnvVar("CI_NAME") === "codeship") return COLORS_256;
|
|
38822
|
+
return COLORS_2;
|
|
38823
|
+
}
|
|
38824
|
+
if ("TEAMCITY_VERSION" in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.exec(getEnvVar("TEAMCITY_VERSION")) !== null ? COLORS_16 : COLORS_2;
|
|
38825
|
+
switch (getEnvVar("TERM_PROGRAM")) {
|
|
38826
|
+
case "iTerm.app":
|
|
38827
|
+
if (!getEnvVar("TERM_PROGRAM_VERSION") || /^[0-2]\./.exec(getEnvVar("TERM_PROGRAM_VERSION")) !== null) return COLORS_256;
|
|
38828
|
+
return COLORS_16m;
|
|
38829
|
+
case "HyperTerm":
|
|
38830
|
+
case "MacTerm":
|
|
38831
|
+
return COLORS_16m;
|
|
38832
|
+
case "Apple_Terminal":
|
|
38833
|
+
return COLORS_256;
|
|
38834
|
+
}
|
|
38835
|
+
if (getEnvVar("COLORTERM") === "truecolor" || getEnvVar("COLORTERM") === "24bit") return COLORS_16m;
|
|
38836
|
+
if (getEnvVar("TERM")) {
|
|
38837
|
+
if (/truecolor/.exec(getEnvVar("TERM")) !== null) return COLORS_16m;
|
|
38838
|
+
if (/^xterm-256/.exec(getEnvVar("TERM")) !== null) return COLORS_256;
|
|
38839
|
+
const termEnv = getEnvVar("TERM").toLowerCase();
|
|
38840
|
+
if (TERM_ENVS[termEnv]) return TERM_ENVS[termEnv];
|
|
38841
|
+
if (TERM_ENVS_REG_EXP.some((term) => term.exec(termEnv) !== null)) return COLORS_16;
|
|
38842
|
+
}
|
|
38843
|
+
if (getEnvVar("COLORTERM")) return COLORS_16;
|
|
38844
|
+
return COLORS_2;
|
|
38845
|
+
}
|
|
38846
|
+
const TTY_COLORS = {
|
|
38847
|
+
reset: "\x1B[0m",
|
|
38848
|
+
bright: "\x1B[1m",
|
|
38849
|
+
dim: "\x1B[2m",
|
|
38850
|
+
fg: {
|
|
38851
|
+
red: "\x1B[31m",
|
|
38852
|
+
green: "\x1B[32m",
|
|
38853
|
+
yellow: "\x1B[33m",
|
|
38854
|
+
blue: "\x1B[34m",
|
|
38855
|
+
magenta: "\x1B[35m"
|
|
38856
|
+
}
|
|
38857
|
+
};
|
|
38858
|
+
const levels = [
|
|
38859
|
+
"debug",
|
|
38860
|
+
"info",
|
|
38861
|
+
"success",
|
|
38862
|
+
"warn",
|
|
38863
|
+
"error"
|
|
38864
|
+
];
|
|
38865
|
+
function shouldPublishLog(currentLogLevel, logLevel) {
|
|
38866
|
+
return levels.indexOf(logLevel) >= levels.indexOf(currentLogLevel);
|
|
38867
|
+
}
|
|
38868
|
+
const levelColors = {
|
|
38869
|
+
info: TTY_COLORS.fg.blue,
|
|
38870
|
+
success: TTY_COLORS.fg.green,
|
|
38871
|
+
warn: TTY_COLORS.fg.yellow,
|
|
38872
|
+
error: TTY_COLORS.fg.red,
|
|
38873
|
+
debug: TTY_COLORS.fg.magenta
|
|
38874
|
+
};
|
|
38875
|
+
const formatMessage = (level, message, colorsEnabled) => {
|
|
38876
|
+
const timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
38877
|
+
if (colorsEnabled) return `${TTY_COLORS.dim}${timestamp}${TTY_COLORS.reset} ${levelColors[level]}${level.toUpperCase()}${TTY_COLORS.reset} ${TTY_COLORS.bright}[Better Auth]:${TTY_COLORS.reset} ${message}`;
|
|
38878
|
+
return `${timestamp} ${level.toUpperCase()} [Better Auth]: ${message}`;
|
|
38879
|
+
};
|
|
38880
|
+
const createLogger = (options) => {
|
|
38881
|
+
const logLevel = "error";
|
|
38882
|
+
const colorsEnabled = getColorDepth() !== 1;
|
|
38883
|
+
const LogFunc = (level, message, args = []) => {
|
|
38884
|
+
if (!shouldPublishLog(logLevel, level)) return;
|
|
38885
|
+
const formattedMessage = formatMessage(level, message, colorsEnabled);
|
|
38886
|
+
{
|
|
38887
|
+
if (level === "error") console.error(formattedMessage, ...args);
|
|
38888
|
+
else if (level === "warn") console.warn(formattedMessage, ...args);
|
|
38889
|
+
else console.log(formattedMessage, ...args);
|
|
38890
|
+
return;
|
|
38891
|
+
}
|
|
38892
|
+
};
|
|
38893
|
+
return {
|
|
38894
|
+
...Object.fromEntries(levels.map((level) => [level, (...[message, ...args]) => LogFunc(level, message, args)])),
|
|
38895
|
+
get level() {
|
|
38896
|
+
return logLevel;
|
|
38897
|
+
}
|
|
38898
|
+
};
|
|
38899
|
+
};
|
|
38900
|
+
createLogger();
|
|
38901
|
+
function capitalizeFirstLetter(str) {
|
|
38902
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
38903
|
+
}
|
|
38904
|
+
var BetterAuthError = class extends Error {
|
|
38905
|
+
constructor(message, cause) {
|
|
38906
|
+
super(message);
|
|
38907
|
+
this.name = "BetterAuthError";
|
|
38908
|
+
this.message = message;
|
|
38909
|
+
this.cause = cause;
|
|
38910
|
+
this.stack = "";
|
|
38911
|
+
}
|
|
38912
|
+
};
|
|
38913
|
+
function checkHasPath(url) {
|
|
38914
|
+
try {
|
|
38915
|
+
return (new URL(url).pathname.replace(/\/+$/, "") || "/") !== "/";
|
|
38916
|
+
} catch {
|
|
38917
|
+
throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`);
|
|
38918
|
+
}
|
|
38919
|
+
}
|
|
38920
|
+
function assertHasProtocol(url) {
|
|
38921
|
+
try {
|
|
38922
|
+
const parsedUrl = new URL(url);
|
|
38923
|
+
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") throw new BetterAuthError(`Invalid base URL: ${url}. URL must include 'http://' or 'https://'`);
|
|
38924
|
+
} catch (error) {
|
|
38925
|
+
if (error instanceof BetterAuthError) throw error;
|
|
38926
|
+
throw new BetterAuthError(`Invalid base URL: ${url}. Please provide a valid base URL.`, String(error));
|
|
38927
|
+
}
|
|
38928
|
+
}
|
|
38929
|
+
function withPath(url, path = "/api/auth") {
|
|
38930
|
+
assertHasProtocol(url);
|
|
38931
|
+
if (checkHasPath(url)) return url;
|
|
38932
|
+
const trimmedUrl = url.replace(/\/+$/, "");
|
|
38933
|
+
if (!path || path === "/") return trimmedUrl;
|
|
38934
|
+
path = path.startsWith("/") ? path : `/${path}`;
|
|
38935
|
+
return `${trimmedUrl}${path}`;
|
|
38936
|
+
}
|
|
38937
|
+
function getBaseURL(url, path, request, loadEnv, trustedProxyHeaders) {
|
|
38938
|
+
if (url) return withPath(url, path);
|
|
38939
|
+
{
|
|
38940
|
+
const fromEnv = env.BETTER_AUTH_URL || env.NEXT_PUBLIC_BETTER_AUTH_URL || env.PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_BETTER_AUTH_URL || env.NUXT_PUBLIC_AUTH_URL || (env.BASE_URL !== "/" ? env.BASE_URL : void 0);
|
|
38941
|
+
if (fromEnv) return withPath(fromEnv, path);
|
|
38942
|
+
}
|
|
38943
|
+
if (typeof window !== "undefined" && window.location) return withPath(window.location.origin, path);
|
|
38944
|
+
}
|
|
38945
|
+
const redirectPlugin = {
|
|
38946
|
+
id: "redirect",
|
|
38947
|
+
name: "Redirect",
|
|
38948
|
+
hooks: { onSuccess(context) {
|
|
38949
|
+
if (context.data?.url && context.data?.redirect) {
|
|
38950
|
+
if (typeof window !== "undefined" && window.location) {
|
|
38951
|
+
if (window.location) try {
|
|
38952
|
+
window.location.href = context.data.url;
|
|
38953
|
+
} catch {
|
|
38954
|
+
}
|
|
38955
|
+
}
|
|
38956
|
+
}
|
|
38957
|
+
} }
|
|
38958
|
+
};
|
|
38959
|
+
const PROTO_POLLUTION_PATTERNS = {
|
|
38960
|
+
proto: /"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,
|
|
38961
|
+
constructor: /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,
|
|
38962
|
+
protoShort: /"__proto__"\s*:/,
|
|
38963
|
+
constructorShort: /"constructor"\s*:/
|
|
38964
|
+
};
|
|
38965
|
+
const JSON_SIGNATURE = /^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;
|
|
38966
|
+
const SPECIAL_VALUES = {
|
|
38967
|
+
true: true,
|
|
38968
|
+
false: false,
|
|
38969
|
+
null: null,
|
|
38970
|
+
undefined: void 0,
|
|
38971
|
+
nan: NaN,
|
|
38972
|
+
infinity: Number.POSITIVE_INFINITY,
|
|
38973
|
+
"-infinity": Number.NEGATIVE_INFINITY
|
|
38974
|
+
};
|
|
38975
|
+
const ISO_DATE_REGEX = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;
|
|
38976
|
+
function isValidDate(date2) {
|
|
38977
|
+
return date2 instanceof Date && !isNaN(date2.getTime());
|
|
38978
|
+
}
|
|
38979
|
+
function parseISODate(value) {
|
|
38980
|
+
const match = ISO_DATE_REGEX.exec(value);
|
|
38981
|
+
if (!match) return null;
|
|
38982
|
+
const [, year, month, day, hour, minute, second, ms, offsetSign, offsetHour, offsetMinute] = match;
|
|
38983
|
+
let date2 = new Date(Date.UTC(parseInt(year, 10), parseInt(month, 10) - 1, parseInt(day, 10), parseInt(hour, 10), parseInt(minute, 10), parseInt(second, 10), ms ? parseInt(ms.padEnd(3, "0"), 10) : 0));
|
|
38984
|
+
if (offsetSign) {
|
|
38985
|
+
const offset2 = (parseInt(offsetHour, 10) * 60 + parseInt(offsetMinute, 10)) * (offsetSign === "+" ? -1 : 1);
|
|
38986
|
+
date2.setUTCMinutes(date2.getUTCMinutes() + offset2);
|
|
38987
|
+
}
|
|
38988
|
+
return isValidDate(date2) ? date2 : null;
|
|
38989
|
+
}
|
|
38990
|
+
function betterJSONParse(value, options = {}) {
|
|
38991
|
+
const { strict = false, warnings = false, reviver, parseDates = true } = options;
|
|
38992
|
+
if (typeof value !== "string") return value;
|
|
38993
|
+
const trimmed = value.trim();
|
|
38994
|
+
if (trimmed.length > 0 && trimmed[0] === '"' && trimmed.endsWith('"') && !trimmed.slice(1, -1).includes('"')) return trimmed.slice(1, -1);
|
|
38995
|
+
const lowerValue = trimmed.toLowerCase();
|
|
38996
|
+
if (lowerValue.length <= 9 && lowerValue in SPECIAL_VALUES) return SPECIAL_VALUES[lowerValue];
|
|
38997
|
+
if (!JSON_SIGNATURE.test(trimmed)) {
|
|
38998
|
+
if (strict) throw new SyntaxError("[better-json] Invalid JSON");
|
|
38999
|
+
return value;
|
|
39000
|
+
}
|
|
39001
|
+
if (Object.entries(PROTO_POLLUTION_PATTERNS).some(([key2, pattern]) => {
|
|
39002
|
+
const matches = pattern.test(trimmed);
|
|
39003
|
+
if (matches && warnings) console.warn(`[better-json] Detected potential prototype pollution attempt using ${key2} pattern`);
|
|
39004
|
+
return matches;
|
|
39005
|
+
}) && strict) throw new Error("[better-json] Potential prototype pollution attempt detected");
|
|
39006
|
+
try {
|
|
39007
|
+
const secureReviver = (key2, value$1) => {
|
|
39008
|
+
if (key2 === "__proto__" || key2 === "constructor" && value$1 && typeof value$1 === "object" && "prototype" in value$1) {
|
|
39009
|
+
if (warnings) console.warn(`[better-json] Dropping "${key2}" key to prevent prototype pollution`);
|
|
39010
|
+
return;
|
|
39011
|
+
}
|
|
39012
|
+
if (parseDates && typeof value$1 === "string") {
|
|
39013
|
+
const date2 = parseISODate(value$1);
|
|
39014
|
+
if (date2) return date2;
|
|
39015
|
+
}
|
|
39016
|
+
return reviver ? reviver(key2, value$1) : value$1;
|
|
39017
|
+
};
|
|
39018
|
+
return JSON.parse(trimmed, secureReviver);
|
|
39019
|
+
} catch (error) {
|
|
39020
|
+
if (strict) throw error;
|
|
39021
|
+
return value;
|
|
39022
|
+
}
|
|
39023
|
+
}
|
|
39024
|
+
function parseJSON(value, options = { strict: true }) {
|
|
39025
|
+
return betterJSONParse(value, options);
|
|
39026
|
+
}
|
|
39027
|
+
function getSessionAtom($fetch, options) {
|
|
39028
|
+
const $signal = /* @__PURE__ */ atom(false);
|
|
39029
|
+
const session = useAuthQuery($signal, "/get-session", $fetch, { method: "GET" });
|
|
39030
|
+
onMount(session, () => {
|
|
39031
|
+
const refreshManager = createSessionRefreshManager({
|
|
39032
|
+
sessionAtom: session,
|
|
39033
|
+
sessionSignal: $signal,
|
|
39034
|
+
$fetch,
|
|
39035
|
+
options
|
|
39036
|
+
});
|
|
39037
|
+
refreshManager.init();
|
|
39038
|
+
return () => {
|
|
39039
|
+
refreshManager.cleanup();
|
|
39040
|
+
};
|
|
39041
|
+
});
|
|
39042
|
+
return {
|
|
39043
|
+
session,
|
|
39044
|
+
$sessionSignal: $signal
|
|
39045
|
+
};
|
|
39046
|
+
}
|
|
38622
39047
|
var __defProp = Object.defineProperty;
|
|
38623
39048
|
var __defProps = Object.defineProperties;
|
|
38624
39049
|
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
@@ -38646,6 +39071,7 @@ var BetterFetchError = class extends Error {
|
|
|
38646
39071
|
this.status = status;
|
|
38647
39072
|
this.statusText = statusText;
|
|
38648
39073
|
this.error = error;
|
|
39074
|
+
Error.captureStackTrace(this, this.constructor);
|
|
38649
39075
|
}
|
|
38650
39076
|
};
|
|
38651
39077
|
var initializePlugins = async (url, options) => {
|
|
@@ -38747,18 +39173,23 @@ var getAuthHeader = async (options) => {
|
|
|
38747
39173
|
}
|
|
38748
39174
|
headers["authorization"] = `Bearer ${token}`;
|
|
38749
39175
|
} else if (options.auth.type === "Basic") {
|
|
38750
|
-
const username =
|
|
38751
|
-
|
|
39176
|
+
const [username, password] = await Promise.all([
|
|
39177
|
+
getValue(options.auth.username),
|
|
39178
|
+
getValue(options.auth.password)
|
|
39179
|
+
]);
|
|
38752
39180
|
if (!username || !password) {
|
|
38753
39181
|
return headers;
|
|
38754
39182
|
}
|
|
38755
39183
|
headers["authorization"] = `Basic ${btoa(`${username}:${password}`)}`;
|
|
38756
39184
|
} else if (options.auth.type === "Custom") {
|
|
38757
|
-
const value =
|
|
39185
|
+
const [prefix, value] = await Promise.all([
|
|
39186
|
+
getValue(options.auth.prefix),
|
|
39187
|
+
getValue(options.auth.value)
|
|
39188
|
+
]);
|
|
38758
39189
|
if (!value) {
|
|
38759
39190
|
return headers;
|
|
38760
39191
|
}
|
|
38761
|
-
headers["authorization"] = `${
|
|
39192
|
+
headers["authorization"] = `${prefix != null ? prefix : ""} ${value}`;
|
|
38762
39193
|
}
|
|
38763
39194
|
}
|
|
38764
39195
|
return headers;
|
|
@@ -38866,6 +39297,12 @@ function getBody(options) {
|
|
|
38866
39297
|
}
|
|
38867
39298
|
return JSON.stringify(options.body);
|
|
38868
39299
|
}
|
|
39300
|
+
if (headers.has("content-type") && headers.get("content-type") === "application/x-www-form-urlencoded") {
|
|
39301
|
+
if (isJSONSerializable(options.body)) {
|
|
39302
|
+
return new URLSearchParams(options.body).toString();
|
|
39303
|
+
}
|
|
39304
|
+
return options.body;
|
|
39305
|
+
}
|
|
38869
39306
|
return options.body;
|
|
38870
39307
|
}
|
|
38871
39308
|
function getMethod$1(url, options) {
|
|
@@ -38904,7 +39341,7 @@ var ValidationError = class _ValidationError extends Error {
|
|
|
38904
39341
|
}
|
|
38905
39342
|
};
|
|
38906
39343
|
async function parseStandardSchema(schema, input) {
|
|
38907
|
-
|
|
39344
|
+
const result = await schema["~standard"].validate(input);
|
|
38908
39345
|
if (result.issues) {
|
|
38909
39346
|
throw new ValidationError(result.issues);
|
|
38910
39347
|
}
|
|
@@ -38966,7 +39403,7 @@ var applySchemaPlugin = (config2) => ({
|
|
|
38966
39403
|
var createFetch = (config2) => {
|
|
38967
39404
|
async function $fetch(url, options) {
|
|
38968
39405
|
const opts = __spreadProps(__spreadValues(__spreadValues({}, config2), options), {
|
|
38969
|
-
plugins: [...(config2 == null ? void 0 : config2.plugins) || [], applySchemaPlugin(config2 || {})]
|
|
39406
|
+
plugins: [...(config2 == null ? void 0 : config2.plugins) || [], applySchemaPlugin(config2 || {}), ...(options == null ? void 0 : options.plugins) || []]
|
|
38970
39407
|
});
|
|
38971
39408
|
if (config2 == null ? void 0 : config2.catchAllError) {
|
|
38972
39409
|
try {
|
|
@@ -38987,536 +39424,208 @@ var createFetch = (config2) => {
|
|
|
38987
39424
|
}
|
|
38988
39425
|
return $fetch;
|
|
38989
39426
|
};
|
|
38990
|
-
function getURL2(url, option) {
|
|
38991
|
-
|
|
38992
|
-
query: {},
|
|
38993
|
-
params: {},
|
|
38994
|
-
baseURL: ""
|
|
38995
|
-
};
|
|
38996
|
-
let basePath = url.startsWith("http") ? url.split("/").slice(0, 3).join("/") : baseURL || "";
|
|
38997
|
-
if (url.startsWith("@")) {
|
|
38998
|
-
const m2 = url.toString().split("@")[1].split("/")[0];
|
|
38999
|
-
if (methods.includes(m2)) {
|
|
39000
|
-
url = url.replace(`@${m2}/`, "/");
|
|
39001
|
-
}
|
|
39002
|
-
}
|
|
39003
|
-
if (!basePath.endsWith("/")) basePath += "/";
|
|
39004
|
-
let [path, urlQuery] = url.replace(basePath, "").split("?");
|
|
39005
|
-
const queryParams = new URLSearchParams(urlQuery);
|
|
39006
|
-
for (const [key2, value] of Object.entries(query || {})) {
|
|
39007
|
-
if (value == null) continue;
|
|
39008
|
-
queryParams.set(key2, String(value));
|
|
39009
|
-
}
|
|
39010
|
-
if (params) {
|
|
39011
|
-
if (Array.isArray(params)) {
|
|
39012
|
-
const paramPaths = path.split("/").filter((p2) => p2.startsWith(":"));
|
|
39013
|
-
for (const [index2, key2] of paramPaths.entries()) {
|
|
39014
|
-
const value = params[index2];
|
|
39015
|
-
path = path.replace(key2, value);
|
|
39016
|
-
}
|
|
39017
|
-
} else {
|
|
39018
|
-
for (const [key2, value] of Object.entries(params)) {
|
|
39019
|
-
path = path.replace(`:${key2}`, String(value));
|
|
39020
|
-
}
|
|
39021
|
-
}
|
|
39022
|
-
}
|
|
39023
|
-
path = path.split("/").map(encodeURIComponent).join("/");
|
|
39024
|
-
if (path.startsWith("/")) path = path.slice(1);
|
|
39025
|
-
let queryParamString = queryParams.toString();
|
|
39026
|
-
queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\+/g, "%20") : "";
|
|
39027
|
-
if (!basePath.startsWith("http")) {
|
|
39028
|
-
return `${basePath}${path}${queryParamString}`;
|
|
39029
|
-
}
|
|
39030
|
-
const _url2 = new URL(`${path}${queryParamString}`, basePath);
|
|
39031
|
-
return _url2;
|
|
39032
|
-
}
|
|
39033
|
-
var betterFetch = async (url, options) => {
|
|
39034
|
-
var _a2, _b, _c, _d, _e2, _f, _g, _h;
|
|
39035
|
-
const {
|
|
39036
|
-
hooks,
|
|
39037
|
-
url: __url,
|
|
39038
|
-
options: opts
|
|
39039
|
-
} = await initializePlugins(url, options);
|
|
39040
|
-
const fetch2 = getFetch(opts);
|
|
39041
|
-
const controller = new AbortController();
|
|
39042
|
-
const signal = (_a2 = opts.signal) != null ? _a2 : controller.signal;
|
|
39043
|
-
const _url2 = getURL2(__url, opts);
|
|
39044
|
-
const body = getBody(opts);
|
|
39045
|
-
const headers = await getHeaders(opts);
|
|
39046
|
-
const method = getMethod$1(__url, opts);
|
|
39047
|
-
let context = __spreadProps(__spreadValues({}, opts), {
|
|
39048
|
-
url: _url2,
|
|
39049
|
-
headers,
|
|
39050
|
-
body,
|
|
39051
|
-
method,
|
|
39052
|
-
signal
|
|
39053
|
-
});
|
|
39054
|
-
for (const onRequest of hooks.onRequest) {
|
|
39055
|
-
if (onRequest) {
|
|
39056
|
-
const res = await onRequest(context);
|
|
39057
|
-
if (res instanceof Object) {
|
|
39058
|
-
context = res;
|
|
39059
|
-
}
|
|
39060
|
-
}
|
|
39061
|
-
}
|
|
39062
|
-
if ("pipeTo" in context && typeof context.pipeTo === "function" || typeof ((_b = options == null ? void 0 : options.body) == null ? void 0 : _b.pipe) === "function") {
|
|
39063
|
-
if (!("duplex" in context)) {
|
|
39064
|
-
context.duplex = "half";
|
|
39065
|
-
}
|
|
39066
|
-
}
|
|
39067
|
-
const { clearTimeout: clearTimeout2 } = getTimeout(opts, controller);
|
|
39068
|
-
let response = await fetch2(context.url, context);
|
|
39069
|
-
clearTimeout2();
|
|
39070
|
-
const responseContext = {
|
|
39071
|
-
response,
|
|
39072
|
-
request: context
|
|
39073
|
-
};
|
|
39074
|
-
for (const onResponse of hooks.onResponse) {
|
|
39075
|
-
if (onResponse) {
|
|
39076
|
-
const r2 = await onResponse(__spreadProps(__spreadValues({}, responseContext), {
|
|
39077
|
-
response: ((_c = options == null ? void 0 : options.hookOptions) == null ? void 0 : _c.cloneResponse) ? response.clone() : response
|
|
39078
|
-
}));
|
|
39079
|
-
if (r2 instanceof Response) {
|
|
39080
|
-
response = r2;
|
|
39081
|
-
} else if (r2 instanceof Object) {
|
|
39082
|
-
response = r2.response;
|
|
39083
|
-
}
|
|
39084
|
-
}
|
|
39085
|
-
}
|
|
39086
|
-
if (response.ok) {
|
|
39087
|
-
const hasBody = context.method !== "HEAD";
|
|
39088
|
-
if (!hasBody) {
|
|
39089
|
-
return {
|
|
39090
|
-
data: "",
|
|
39091
|
-
error: null
|
|
39092
|
-
};
|
|
39093
|
-
}
|
|
39094
|
-
const responseType = detectResponseType(response);
|
|
39095
|
-
const successContext = {
|
|
39096
|
-
data: "",
|
|
39097
|
-
response,
|
|
39098
|
-
request: context
|
|
39099
|
-
};
|
|
39100
|
-
if (responseType === "json" || responseType === "text") {
|
|
39101
|
-
const text = await response.text();
|
|
39102
|
-
const parser2 = (_d = context.jsonParser) != null ? _d : jsonParse;
|
|
39103
|
-
const data = await parser2(text);
|
|
39104
|
-
successContext.data = data;
|
|
39105
|
-
} else {
|
|
39106
|
-
successContext.data = await response[responseType]();
|
|
39107
|
-
}
|
|
39108
|
-
if (context == null ? void 0 : context.output) {
|
|
39109
|
-
if (context.output && !context.disableValidation) {
|
|
39110
|
-
successContext.data = await parseStandardSchema(
|
|
39111
|
-
context.output,
|
|
39112
|
-
successContext.data
|
|
39113
|
-
);
|
|
39114
|
-
}
|
|
39115
|
-
}
|
|
39116
|
-
for (const onSuccess of hooks.onSuccess) {
|
|
39117
|
-
if (onSuccess) {
|
|
39118
|
-
await onSuccess(__spreadProps(__spreadValues({}, successContext), {
|
|
39119
|
-
response: ((_e2 = options == null ? void 0 : options.hookOptions) == null ? void 0 : _e2.cloneResponse) ? response.clone() : response
|
|
39120
|
-
}));
|
|
39121
|
-
}
|
|
39122
|
-
}
|
|
39123
|
-
if (options == null ? void 0 : options.throw) {
|
|
39124
|
-
return successContext.data;
|
|
39125
|
-
}
|
|
39126
|
-
return {
|
|
39127
|
-
data: successContext.data,
|
|
39128
|
-
error: null
|
|
39129
|
-
};
|
|
39130
|
-
}
|
|
39131
|
-
const parser = (_f = options == null ? void 0 : options.jsonParser) != null ? _f : jsonParse;
|
|
39132
|
-
const responseText = await response.text();
|
|
39133
|
-
const isJSONResponse = isJSONParsable(responseText);
|
|
39134
|
-
const errorObject = isJSONResponse ? await parser(responseText) : null;
|
|
39135
|
-
const errorContext = {
|
|
39136
|
-
response,
|
|
39137
|
-
responseText,
|
|
39138
|
-
request: context,
|
|
39139
|
-
error: __spreadProps(__spreadValues({}, errorObject), {
|
|
39140
|
-
status: response.status,
|
|
39141
|
-
statusText: response.statusText
|
|
39142
|
-
})
|
|
39143
|
-
};
|
|
39144
|
-
for (const onError of hooks.onError) {
|
|
39145
|
-
if (onError) {
|
|
39146
|
-
await onError(__spreadProps(__spreadValues({}, errorContext), {
|
|
39147
|
-
response: ((_g = options == null ? void 0 : options.hookOptions) == null ? void 0 : _g.cloneResponse) ? response.clone() : response
|
|
39148
|
-
}));
|
|
39149
|
-
}
|
|
39150
|
-
}
|
|
39151
|
-
if (options == null ? void 0 : options.retry) {
|
|
39152
|
-
const retryStrategy = createRetryStrategy(options.retry);
|
|
39153
|
-
const _retryAttempt = (_h = options.retryAttempt) != null ? _h : 0;
|
|
39154
|
-
if (await retryStrategy.shouldAttemptRetry(_retryAttempt, response)) {
|
|
39155
|
-
for (const onRetry of hooks.onRetry) {
|
|
39156
|
-
if (onRetry) {
|
|
39157
|
-
await onRetry(responseContext);
|
|
39158
|
-
}
|
|
39159
|
-
}
|
|
39160
|
-
const delay2 = retryStrategy.getDelay(_retryAttempt);
|
|
39161
|
-
await new Promise((resolve) => setTimeout(resolve, delay2));
|
|
39162
|
-
return await betterFetch(url, __spreadProps(__spreadValues({}, options), {
|
|
39163
|
-
retryAttempt: _retryAttempt + 1
|
|
39164
|
-
}));
|
|
39165
|
-
}
|
|
39166
|
-
}
|
|
39167
|
-
if (options == null ? void 0 : options.throw) {
|
|
39168
|
-
throw new BetterFetchError(
|
|
39169
|
-
response.status,
|
|
39170
|
-
response.statusText,
|
|
39171
|
-
isJSONResponse ? errorObject : responseText
|
|
39172
|
-
);
|
|
39173
|
-
}
|
|
39174
|
-
return {
|
|
39175
|
-
data: null,
|
|
39176
|
-
error: __spreadProps(__spreadValues({}, errorObject), {
|
|
39177
|
-
status: response.status,
|
|
39178
|
-
statusText: response.statusText
|
|
39179
|
-
})
|
|
39180
|
-
};
|
|
39181
|
-
};
|
|
39182
|
-
const kBroadcastChannel = Symbol.for("better-auth:broadcast-channel");
|
|
39183
|
-
const now$1 = () => Math.floor(Date.now() / 1e3);
|
|
39184
|
-
var WindowBroadcastChannel = class {
|
|
39185
|
-
listeners = /* @__PURE__ */ new Set();
|
|
39186
|
-
name;
|
|
39187
|
-
constructor(name = "better-auth.message") {
|
|
39188
|
-
this.name = name;
|
|
39189
|
-
}
|
|
39190
|
-
subscribe(listener) {
|
|
39191
|
-
this.listeners.add(listener);
|
|
39192
|
-
return () => {
|
|
39193
|
-
this.listeners.delete(listener);
|
|
39194
|
-
};
|
|
39195
|
-
}
|
|
39196
|
-
post(message) {
|
|
39197
|
-
if (typeof window === "undefined") return;
|
|
39198
|
-
try {
|
|
39199
|
-
localStorage.setItem(this.name, JSON.stringify({
|
|
39200
|
-
...message,
|
|
39201
|
-
timestamp: now$1()
|
|
39202
|
-
}));
|
|
39203
|
-
} catch {
|
|
39204
|
-
}
|
|
39205
|
-
}
|
|
39206
|
-
setup() {
|
|
39207
|
-
if (typeof window === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
39208
|
-
};
|
|
39209
|
-
const handler = (event) => {
|
|
39210
|
-
if (event.key !== this.name) return;
|
|
39211
|
-
const message = JSON.parse(event.newValue ?? "{}");
|
|
39212
|
-
if (message?.event !== "session" || !message?.data) return;
|
|
39213
|
-
this.listeners.forEach((listener) => listener(message));
|
|
39214
|
-
};
|
|
39215
|
-
window.addEventListener("storage", handler);
|
|
39216
|
-
return () => {
|
|
39217
|
-
window.removeEventListener("storage", handler);
|
|
39218
|
-
};
|
|
39219
|
-
}
|
|
39220
|
-
};
|
|
39221
|
-
function getGlobalBroadcastChannel(name = "better-auth.message") {
|
|
39222
|
-
if (!globalThis[kBroadcastChannel]) globalThis[kBroadcastChannel] = new WindowBroadcastChannel(name);
|
|
39223
|
-
return globalThis[kBroadcastChannel];
|
|
39224
|
-
}
|
|
39225
|
-
const kFocusManager = Symbol.for("better-auth:focus-manager");
|
|
39226
|
-
var WindowFocusManager = class {
|
|
39227
|
-
listeners = /* @__PURE__ */ new Set();
|
|
39228
|
-
subscribe(listener) {
|
|
39229
|
-
this.listeners.add(listener);
|
|
39230
|
-
return () => {
|
|
39231
|
-
this.listeners.delete(listener);
|
|
39232
|
-
};
|
|
39233
|
-
}
|
|
39234
|
-
setFocused(focused) {
|
|
39235
|
-
this.listeners.forEach((listener) => listener(focused));
|
|
39236
|
-
}
|
|
39237
|
-
setup() {
|
|
39238
|
-
if (typeof window === "undefined" || typeof document === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
39239
|
-
};
|
|
39240
|
-
const visibilityHandler = () => {
|
|
39241
|
-
if (document.visibilityState === "visible") this.setFocused(true);
|
|
39242
|
-
};
|
|
39243
|
-
document.addEventListener("visibilitychange", visibilityHandler, false);
|
|
39244
|
-
return () => {
|
|
39245
|
-
document.removeEventListener("visibilitychange", visibilityHandler, false);
|
|
39246
|
-
};
|
|
39247
|
-
}
|
|
39248
|
-
};
|
|
39249
|
-
function getGlobalFocusManager() {
|
|
39250
|
-
if (!globalThis[kFocusManager]) globalThis[kFocusManager] = new WindowFocusManager();
|
|
39251
|
-
return globalThis[kFocusManager];
|
|
39252
|
-
}
|
|
39253
|
-
const kOnlineManager = Symbol.for("better-auth:online-manager");
|
|
39254
|
-
var WindowOnlineManager = class {
|
|
39255
|
-
listeners = /* @__PURE__ */ new Set();
|
|
39256
|
-
isOnline = typeof navigator !== "undefined" ? navigator.onLine : true;
|
|
39257
|
-
subscribe(listener) {
|
|
39258
|
-
this.listeners.add(listener);
|
|
39259
|
-
return () => {
|
|
39260
|
-
this.listeners.delete(listener);
|
|
39261
|
-
};
|
|
39262
|
-
}
|
|
39263
|
-
setOnline(online) {
|
|
39264
|
-
this.isOnline = online;
|
|
39265
|
-
this.listeners.forEach((listener) => listener(online));
|
|
39266
|
-
}
|
|
39267
|
-
setup() {
|
|
39268
|
-
if (typeof window === "undefined" || typeof window.addEventListener === "undefined") return () => {
|
|
39269
|
-
};
|
|
39270
|
-
const onOnline = () => this.setOnline(true);
|
|
39271
|
-
const onOffline = () => this.setOnline(false);
|
|
39272
|
-
window.addEventListener("online", onOnline, false);
|
|
39273
|
-
window.addEventListener("offline", onOffline, false);
|
|
39274
|
-
return () => {
|
|
39275
|
-
window.removeEventListener("online", onOnline, false);
|
|
39276
|
-
window.removeEventListener("offline", onOffline, false);
|
|
39277
|
-
};
|
|
39278
|
-
}
|
|
39279
|
-
};
|
|
39280
|
-
function getGlobalOnlineManager() {
|
|
39281
|
-
if (!globalThis[kOnlineManager]) globalThis[kOnlineManager] = new WindowOnlineManager();
|
|
39282
|
-
return globalThis[kOnlineManager];
|
|
39283
|
-
}
|
|
39284
|
-
const isServer = () => typeof window === "undefined";
|
|
39285
|
-
const useAuthQuery = (initializedAtom, path, $fetch, options) => {
|
|
39286
|
-
const value = /* @__PURE__ */ atom({
|
|
39287
|
-
data: null,
|
|
39288
|
-
error: null,
|
|
39289
|
-
isPending: true,
|
|
39290
|
-
isRefetching: false,
|
|
39291
|
-
refetch: (queryParams) => fn(queryParams)
|
|
39292
|
-
});
|
|
39293
|
-
const fn = async (queryParams) => {
|
|
39294
|
-
return new Promise((resolve) => {
|
|
39295
|
-
const opts = typeof options === "function" ? options({
|
|
39296
|
-
data: value.get().data,
|
|
39297
|
-
error: value.get().error,
|
|
39298
|
-
isPending: value.get().isPending
|
|
39299
|
-
}) : options;
|
|
39300
|
-
$fetch(path, {
|
|
39301
|
-
...opts,
|
|
39302
|
-
query: {
|
|
39303
|
-
...opts?.query,
|
|
39304
|
-
...queryParams?.query
|
|
39305
|
-
},
|
|
39306
|
-
async onSuccess(context) {
|
|
39307
|
-
value.set({
|
|
39308
|
-
data: context.data,
|
|
39309
|
-
error: null,
|
|
39310
|
-
isPending: false,
|
|
39311
|
-
isRefetching: false,
|
|
39312
|
-
refetch: value.value.refetch
|
|
39313
|
-
});
|
|
39314
|
-
await opts?.onSuccess?.(context);
|
|
39315
|
-
},
|
|
39316
|
-
async onError(context) {
|
|
39317
|
-
const { request } = context;
|
|
39318
|
-
const retryAttempts = typeof request.retry === "number" ? request.retry : request.retry?.attempts;
|
|
39319
|
-
const retryAttempt = request.retryAttempt || 0;
|
|
39320
|
-
if (retryAttempts && retryAttempt < retryAttempts) return;
|
|
39321
|
-
value.set({
|
|
39322
|
-
error: context.error,
|
|
39323
|
-
data: null,
|
|
39324
|
-
isPending: false,
|
|
39325
|
-
isRefetching: false,
|
|
39326
|
-
refetch: value.value.refetch
|
|
39327
|
-
});
|
|
39328
|
-
await opts?.onError?.(context);
|
|
39329
|
-
},
|
|
39330
|
-
async onRequest(context) {
|
|
39331
|
-
const currentValue = value.get();
|
|
39332
|
-
value.set({
|
|
39333
|
-
isPending: currentValue.data === null,
|
|
39334
|
-
data: currentValue.data,
|
|
39335
|
-
error: null,
|
|
39336
|
-
isRefetching: true,
|
|
39337
|
-
refetch: value.value.refetch
|
|
39338
|
-
});
|
|
39339
|
-
await opts?.onRequest?.(context);
|
|
39340
|
-
}
|
|
39341
|
-
}).catch((error) => {
|
|
39342
|
-
value.set({
|
|
39343
|
-
error,
|
|
39344
|
-
data: null,
|
|
39345
|
-
isPending: false,
|
|
39346
|
-
isRefetching: false,
|
|
39347
|
-
refetch: value.value.refetch
|
|
39348
|
-
});
|
|
39349
|
-
}).finally(() => {
|
|
39350
|
-
resolve(void 0);
|
|
39351
|
-
});
|
|
39352
|
-
});
|
|
39353
|
-
};
|
|
39354
|
-
initializedAtom = Array.isArray(initializedAtom) ? initializedAtom : [initializedAtom];
|
|
39355
|
-
let isMounted = false;
|
|
39356
|
-
for (const initAtom of initializedAtom) initAtom.subscribe(async () => {
|
|
39357
|
-
if (isServer()) return;
|
|
39358
|
-
if (isMounted) await fn();
|
|
39359
|
-
else onMount(value, () => {
|
|
39360
|
-
const timeoutId = setTimeout(async () => {
|
|
39361
|
-
if (!isMounted) {
|
|
39362
|
-
await fn();
|
|
39363
|
-
isMounted = true;
|
|
39364
|
-
}
|
|
39365
|
-
}, 0);
|
|
39366
|
-
return () => {
|
|
39367
|
-
value.off();
|
|
39368
|
-
initAtom.off();
|
|
39369
|
-
clearTimeout(timeoutId);
|
|
39370
|
-
};
|
|
39371
|
-
});
|
|
39372
|
-
});
|
|
39373
|
-
return value;
|
|
39374
|
-
};
|
|
39375
|
-
const now = () => Math.floor(Date.now() / 1e3);
|
|
39376
|
-
const FOCUS_REFETCH_RATE_LIMIT_SECONDS = 5;
|
|
39377
|
-
function createSessionRefreshManager(opts) {
|
|
39378
|
-
const { sessionAtom, sessionSignal, $fetch, options = {} } = opts;
|
|
39379
|
-
const refetchInterval = options.sessionOptions?.refetchInterval ?? 0;
|
|
39380
|
-
const refetchOnWindowFocus = options.sessionOptions?.refetchOnWindowFocus ?? true;
|
|
39381
|
-
const refetchWhenOffline = options.sessionOptions?.refetchWhenOffline ?? false;
|
|
39382
|
-
const state = {
|
|
39383
|
-
lastSync: 0,
|
|
39384
|
-
lastSessionRequest: 0,
|
|
39385
|
-
cachedSession: void 0
|
|
39386
|
-
};
|
|
39387
|
-
const shouldRefetch = () => {
|
|
39388
|
-
return refetchWhenOffline || getGlobalOnlineManager().isOnline;
|
|
39427
|
+
function getURL2(url, option) {
|
|
39428
|
+
const { baseURL, params, query } = option || {
|
|
39429
|
+
query: {},
|
|
39430
|
+
params: {},
|
|
39431
|
+
baseURL: ""
|
|
39389
39432
|
};
|
|
39390
|
-
|
|
39391
|
-
|
|
39392
|
-
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
return;
|
|
39433
|
+
let basePath = url.startsWith("http") ? url.split("/").slice(0, 3).join("/") : baseURL || "";
|
|
39434
|
+
if (url.startsWith("@")) {
|
|
39435
|
+
const m2 = url.toString().split("@")[1].split("/")[0];
|
|
39436
|
+
if (methods.includes(m2)) {
|
|
39437
|
+
url = url.replace(`@${m2}/`, "/");
|
|
39396
39438
|
}
|
|
39397
|
-
|
|
39398
|
-
|
|
39399
|
-
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
}
|
|
39410
|
-
|
|
39439
|
+
}
|
|
39440
|
+
if (!basePath.endsWith("/")) basePath += "/";
|
|
39441
|
+
let [path, urlQuery] = url.replace(basePath, "").split("?");
|
|
39442
|
+
const queryParams = new URLSearchParams(urlQuery);
|
|
39443
|
+
for (const [key2, value] of Object.entries(query || {})) {
|
|
39444
|
+
if (value == null) continue;
|
|
39445
|
+
let serializedValue;
|
|
39446
|
+
if (typeof value === "string") {
|
|
39447
|
+
serializedValue = value;
|
|
39448
|
+
} else if (Array.isArray(value)) {
|
|
39449
|
+
for (const val of value) {
|
|
39450
|
+
queryParams.append(key2, val);
|
|
39451
|
+
}
|
|
39452
|
+
continue;
|
|
39453
|
+
} else {
|
|
39454
|
+
serializedValue = JSON.stringify(value);
|
|
39411
39455
|
}
|
|
39412
|
-
|
|
39413
|
-
|
|
39456
|
+
queryParams.set(key2, serializedValue);
|
|
39457
|
+
}
|
|
39458
|
+
if (params) {
|
|
39459
|
+
if (Array.isArray(params)) {
|
|
39460
|
+
const paramPaths = path.split("/").filter((p2) => p2.startsWith(":"));
|
|
39461
|
+
for (const [index2, key2] of paramPaths.entries()) {
|
|
39462
|
+
const value = params[index2];
|
|
39463
|
+
path = path.replace(key2, value);
|
|
39464
|
+
}
|
|
39465
|
+
} else {
|
|
39466
|
+
for (const [key2, value] of Object.entries(params)) {
|
|
39467
|
+
path = path.replace(`:${key2}`, String(value));
|
|
39468
|
+
}
|
|
39414
39469
|
}
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39470
|
+
}
|
|
39471
|
+
path = path.split("/").map(encodeURIComponent).join("/");
|
|
39472
|
+
if (path.startsWith("/")) path = path.slice(1);
|
|
39473
|
+
let queryParamString = queryParams.toString();
|
|
39474
|
+
queryParamString = queryParamString.length > 0 ? `?${queryParamString}`.replace(/\+/g, "%20") : "";
|
|
39475
|
+
if (!basePath.startsWith("http")) {
|
|
39476
|
+
return `${basePath}${path}${queryParamString}`;
|
|
39477
|
+
}
|
|
39478
|
+
const _url2 = new URL(`${path}${queryParamString}`, basePath);
|
|
39479
|
+
return _url2;
|
|
39480
|
+
}
|
|
39481
|
+
var betterFetch = async (url, options) => {
|
|
39482
|
+
var _a2, _b, _c, _d, _e2, _f, _g, _h;
|
|
39483
|
+
const {
|
|
39484
|
+
hooks,
|
|
39485
|
+
url: __url,
|
|
39486
|
+
options: opts
|
|
39487
|
+
} = await initializePlugins(url, options);
|
|
39488
|
+
const fetch2 = getFetch(opts);
|
|
39489
|
+
const controller = new AbortController();
|
|
39490
|
+
const signal = (_a2 = opts.signal) != null ? _a2 : controller.signal;
|
|
39491
|
+
const _url2 = getURL2(__url, opts);
|
|
39492
|
+
const body = getBody(opts);
|
|
39493
|
+
const headers = await getHeaders(opts);
|
|
39494
|
+
const method = getMethod$1(__url, opts);
|
|
39495
|
+
let context = __spreadProps(__spreadValues({}, opts), {
|
|
39496
|
+
url: _url2,
|
|
39497
|
+
headers,
|
|
39498
|
+
body,
|
|
39499
|
+
method,
|
|
39500
|
+
signal
|
|
39501
|
+
});
|
|
39502
|
+
for (const onRequest of hooks.onRequest) {
|
|
39503
|
+
if (onRequest) {
|
|
39504
|
+
const res = await onRequest(context);
|
|
39505
|
+
if (typeof res === "object" && res !== null) {
|
|
39506
|
+
context = res;
|
|
39507
|
+
}
|
|
39419
39508
|
}
|
|
39509
|
+
}
|
|
39510
|
+
if ("pipeTo" in context && typeof context.pipeTo === "function" || typeof ((_b = options == null ? void 0 : options.body) == null ? void 0 : _b.pipe) === "function") {
|
|
39511
|
+
if (!("duplex" in context)) {
|
|
39512
|
+
context.duplex = "half";
|
|
39513
|
+
}
|
|
39514
|
+
}
|
|
39515
|
+
const { clearTimeout: clearTimeout2 } = getTimeout(opts, controller);
|
|
39516
|
+
let response = await fetch2(context.url, context);
|
|
39517
|
+
clearTimeout2();
|
|
39518
|
+
const responseContext = {
|
|
39519
|
+
response,
|
|
39520
|
+
request: context
|
|
39420
39521
|
};
|
|
39421
|
-
const
|
|
39422
|
-
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
|
|
39426
|
-
|
|
39427
|
-
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
}, refetchInterval * 1e3);
|
|
39432
|
-
};
|
|
39433
|
-
const setupBroadcast = () => {
|
|
39434
|
-
state.unsubscribeBroadcast = getGlobalBroadcastChannel().subscribe(() => {
|
|
39435
|
-
triggerRefetch({ event: "storage" });
|
|
39436
|
-
});
|
|
39437
|
-
};
|
|
39438
|
-
const setupFocusRefetch = () => {
|
|
39439
|
-
if (!refetchOnWindowFocus) return;
|
|
39440
|
-
state.unsubscribeFocus = getGlobalFocusManager().subscribe(() => {
|
|
39441
|
-
triggerRefetch({ event: "visibilitychange" });
|
|
39442
|
-
});
|
|
39443
|
-
};
|
|
39444
|
-
const setupOnlineRefetch = () => {
|
|
39445
|
-
state.unsubscribeOnline = getGlobalOnlineManager().subscribe((online) => {
|
|
39446
|
-
if (online) triggerRefetch({ event: "visibilitychange" });
|
|
39447
|
-
});
|
|
39448
|
-
};
|
|
39449
|
-
const init2 = () => {
|
|
39450
|
-
setupPolling();
|
|
39451
|
-
setupBroadcast();
|
|
39452
|
-
setupFocusRefetch();
|
|
39453
|
-
setupOnlineRefetch();
|
|
39454
|
-
getGlobalBroadcastChannel().setup();
|
|
39455
|
-
getGlobalFocusManager().setup();
|
|
39456
|
-
getGlobalOnlineManager().setup();
|
|
39457
|
-
};
|
|
39458
|
-
const cleanup = () => {
|
|
39459
|
-
if (state.pollInterval) {
|
|
39460
|
-
clearInterval(state.pollInterval);
|
|
39461
|
-
state.pollInterval = void 0;
|
|
39522
|
+
for (const onResponse of hooks.onResponse) {
|
|
39523
|
+
if (onResponse) {
|
|
39524
|
+
const r2 = await onResponse(__spreadProps(__spreadValues({}, responseContext), {
|
|
39525
|
+
response: ((_c = options == null ? void 0 : options.hookOptions) == null ? void 0 : _c.cloneResponse) ? response.clone() : response
|
|
39526
|
+
}));
|
|
39527
|
+
if (r2 instanceof Response) {
|
|
39528
|
+
response = r2;
|
|
39529
|
+
} else if (typeof r2 === "object" && r2 !== null) {
|
|
39530
|
+
response = r2.response;
|
|
39531
|
+
}
|
|
39462
39532
|
}
|
|
39463
|
-
|
|
39464
|
-
|
|
39465
|
-
|
|
39533
|
+
}
|
|
39534
|
+
if (response.ok) {
|
|
39535
|
+
const hasBody = context.method !== "HEAD";
|
|
39536
|
+
if (!hasBody) {
|
|
39537
|
+
return {
|
|
39538
|
+
data: "",
|
|
39539
|
+
error: null
|
|
39540
|
+
};
|
|
39466
39541
|
}
|
|
39467
|
-
|
|
39468
|
-
|
|
39469
|
-
|
|
39542
|
+
const responseType = detectResponseType(response);
|
|
39543
|
+
const successContext = {
|
|
39544
|
+
data: null,
|
|
39545
|
+
response,
|
|
39546
|
+
request: context
|
|
39547
|
+
};
|
|
39548
|
+
if (responseType === "json" || responseType === "text") {
|
|
39549
|
+
const text = await response.text();
|
|
39550
|
+
const parser2 = (_d = context.jsonParser) != null ? _d : jsonParse;
|
|
39551
|
+
successContext.data = await parser2(text);
|
|
39552
|
+
} else {
|
|
39553
|
+
successContext.data = await response[responseType]();
|
|
39470
39554
|
}
|
|
39471
|
-
if (
|
|
39472
|
-
|
|
39473
|
-
|
|
39555
|
+
if (context == null ? void 0 : context.output) {
|
|
39556
|
+
if (context.output && !context.disableValidation) {
|
|
39557
|
+
successContext.data = await parseStandardSchema(
|
|
39558
|
+
context.output,
|
|
39559
|
+
successContext.data
|
|
39560
|
+
);
|
|
39561
|
+
}
|
|
39474
39562
|
}
|
|
39475
|
-
|
|
39476
|
-
|
|
39477
|
-
|
|
39478
|
-
|
|
39479
|
-
|
|
39480
|
-
|
|
39481
|
-
|
|
39482
|
-
|
|
39483
|
-
|
|
39563
|
+
for (const onSuccess of hooks.onSuccess) {
|
|
39564
|
+
if (onSuccess) {
|
|
39565
|
+
await onSuccess(__spreadProps(__spreadValues({}, successContext), {
|
|
39566
|
+
response: ((_e2 = options == null ? void 0 : options.hookOptions) == null ? void 0 : _e2.cloneResponse) ? response.clone() : response
|
|
39567
|
+
}));
|
|
39568
|
+
}
|
|
39569
|
+
}
|
|
39570
|
+
if (options == null ? void 0 : options.throw) {
|
|
39571
|
+
return successContext.data;
|
|
39572
|
+
}
|
|
39573
|
+
return {
|
|
39574
|
+
data: successContext.data,
|
|
39575
|
+
error: null
|
|
39576
|
+
};
|
|
39577
|
+
}
|
|
39578
|
+
const parser = (_f = options == null ? void 0 : options.jsonParser) != null ? _f : jsonParse;
|
|
39579
|
+
const responseText = await response.text();
|
|
39580
|
+
const isJSONResponse = isJSONParsable(responseText);
|
|
39581
|
+
const errorObject = isJSONResponse ? await parser(responseText) : null;
|
|
39582
|
+
const errorContext = {
|
|
39583
|
+
response,
|
|
39584
|
+
responseText,
|
|
39585
|
+
request: context,
|
|
39586
|
+
error: __spreadProps(__spreadValues({}, errorObject), {
|
|
39587
|
+
status: response.status,
|
|
39588
|
+
statusText: response.statusText
|
|
39589
|
+
})
|
|
39484
39590
|
};
|
|
39485
|
-
|
|
39486
|
-
|
|
39487
|
-
|
|
39488
|
-
|
|
39489
|
-
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
|
|
39493
|
-
|
|
39494
|
-
|
|
39591
|
+
for (const onError of hooks.onError) {
|
|
39592
|
+
if (onError) {
|
|
39593
|
+
await onError(__spreadProps(__spreadValues({}, errorContext), {
|
|
39594
|
+
response: ((_g = options == null ? void 0 : options.hookOptions) == null ? void 0 : _g.cloneResponse) ? response.clone() : response
|
|
39595
|
+
}));
|
|
39596
|
+
}
|
|
39597
|
+
}
|
|
39598
|
+
if (options == null ? void 0 : options.retry) {
|
|
39599
|
+
const retryStrategy = createRetryStrategy(options.retry);
|
|
39600
|
+
const _retryAttempt = (_h = options.retryAttempt) != null ? _h : 0;
|
|
39601
|
+
if (await retryStrategy.shouldAttemptRetry(_retryAttempt, response)) {
|
|
39602
|
+
for (const onRetry of hooks.onRetry) {
|
|
39603
|
+
if (onRetry) {
|
|
39604
|
+
await onRetry(responseContext);
|
|
39495
39605
|
}
|
|
39496
39606
|
}
|
|
39607
|
+
const delay2 = retryStrategy.getDelay(_retryAttempt);
|
|
39608
|
+
await new Promise((resolve) => setTimeout(resolve, delay2));
|
|
39609
|
+
return await betterFetch(url, __spreadProps(__spreadValues({}, options), {
|
|
39610
|
+
retryAttempt: _retryAttempt + 1
|
|
39611
|
+
}));
|
|
39497
39612
|
}
|
|
39498
|
-
}
|
|
39499
|
-
|
|
39500
|
-
|
|
39501
|
-
|
|
39502
|
-
|
|
39503
|
-
|
|
39504
|
-
|
|
39505
|
-
|
|
39506
|
-
sessionSignal: $signal,
|
|
39507
|
-
$fetch,
|
|
39508
|
-
options
|
|
39509
|
-
});
|
|
39510
|
-
refreshManager.init();
|
|
39511
|
-
return () => {
|
|
39512
|
-
refreshManager.cleanup();
|
|
39513
|
-
};
|
|
39514
|
-
});
|
|
39613
|
+
}
|
|
39614
|
+
if (options == null ? void 0 : options.throw) {
|
|
39615
|
+
throw new BetterFetchError(
|
|
39616
|
+
response.status,
|
|
39617
|
+
response.statusText,
|
|
39618
|
+
isJSONResponse ? errorObject : responseText
|
|
39619
|
+
);
|
|
39620
|
+
}
|
|
39515
39621
|
return {
|
|
39516
|
-
|
|
39517
|
-
|
|
39622
|
+
data: null,
|
|
39623
|
+
error: __spreadProps(__spreadValues({}, errorObject), {
|
|
39624
|
+
status: response.status,
|
|
39625
|
+
statusText: response.statusText
|
|
39626
|
+
})
|
|
39518
39627
|
};
|
|
39519
|
-
}
|
|
39628
|
+
};
|
|
39520
39629
|
const getClientConfig = (options, loadEnv) => {
|
|
39521
39630
|
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
39522
39631
|
const baseURL = getBaseURL(options?.baseURL, options?.basePath) ?? "/api/auth";
|
|
@@ -39531,7 +39640,7 @@ const getClientConfig = (options, loadEnv) => {
|
|
|
39531
39640
|
onResponse: options?.fetchOptions?.onResponse
|
|
39532
39641
|
}
|
|
39533
39642
|
};
|
|
39534
|
-
const { onSuccess, onError, onRequest, onResponse, ...restOfFetchOptions } = options?.fetchOptions || {};
|
|
39643
|
+
const { onSuccess: _onSuccess, onError: _onError, onRequest: _onRequest, onResponse: _onResponse, ...restOfFetchOptions } = options?.fetchOptions || {};
|
|
39535
39644
|
const $fetch = createFetch({
|
|
39536
39645
|
baseURL,
|
|
39537
39646
|
...isCredentialsSupported ? { credentials: "include" } : {},
|
|
@@ -39600,7 +39709,7 @@ function isAtom(value) {
|
|
|
39600
39709
|
}
|
|
39601
39710
|
function getMethod(path, knownPathMethods, args) {
|
|
39602
39711
|
const method = knownPathMethods[path];
|
|
39603
|
-
const { fetchOptions, query, ...body } = args || {};
|
|
39712
|
+
const { fetchOptions, query: _query, ...body } = args || {};
|
|
39604
39713
|
if (method) return method;
|
|
39605
39714
|
if (fetchOptions?.method) return fetchOptions.method;
|
|
39606
39715
|
if (body && Object.keys(body).length > 0) return "POST";
|
|
@@ -39694,7 +39803,7 @@ const getPasskeyActions = ($fetch, { $listPasskeys, $store }) => {
|
|
|
39694
39803
|
$listPasskeys.set(Math.random());
|
|
39695
39804
|
$store.notify("$sessionSignal");
|
|
39696
39805
|
return verified;
|
|
39697
|
-
} catch
|
|
39806
|
+
} catch {
|
|
39698
39807
|
return {
|
|
39699
39808
|
data: null,
|
|
39700
39809
|
error: {
|
|
@@ -39811,6 +39920,18 @@ const passkeyClient = () => {
|
|
|
39811
39920
|
}]
|
|
39812
39921
|
};
|
|
39813
39922
|
};
|
|
39923
|
+
const ssoClient = (options) => {
|
|
39924
|
+
return {
|
|
39925
|
+
id: "sso-client",
|
|
39926
|
+
$InferServerPlugin: {}
|
|
39927
|
+
};
|
|
39928
|
+
};
|
|
39929
|
+
const magicLinkClient = () => {
|
|
39930
|
+
return {
|
|
39931
|
+
id: "magic-link",
|
|
39932
|
+
$InferServerPlugin: {}
|
|
39933
|
+
};
|
|
39934
|
+
};
|
|
39814
39935
|
const twoFactorClient = (options) => {
|
|
39815
39936
|
return {
|
|
39816
39937
|
id: "two-factor",
|
|
@@ -39836,12 +39957,6 @@ const twoFactorClient = (options) => {
|
|
|
39836
39957
|
}]
|
|
39837
39958
|
};
|
|
39838
39959
|
};
|
|
39839
|
-
const magicLinkClient = () => {
|
|
39840
|
-
return {
|
|
39841
|
-
id: "magic-link",
|
|
39842
|
-
$InferServerPlugin: {}
|
|
39843
|
-
};
|
|
39844
|
-
};
|
|
39845
39960
|
const getAuthClient = (backendURL) => createAuthClient({
|
|
39846
39961
|
baseURL: backendURL,
|
|
39847
39962
|
withCredentials: true,
|
|
@@ -39852,7 +39967,8 @@ const getAuthClient = (backendURL) => createAuthClient({
|
|
|
39852
39967
|
window.location.href = twoFaUrl;
|
|
39853
39968
|
} }),
|
|
39854
39969
|
passkeyClient(),
|
|
39855
|
-
magicLinkClient()
|
|
39970
|
+
magicLinkClient(),
|
|
39971
|
+
ssoClient()
|
|
39856
39972
|
]
|
|
39857
39973
|
});
|
|
39858
39974
|
const getAuthAPI = (intlayerConfig) => {
|
|
@@ -39887,7 +40003,7 @@ const getAuthAPI = (intlayerConfig) => {
|
|
|
39887
40003
|
return client2.getSession(...args);
|
|
39888
40004
|
};
|
|
39889
40005
|
const forgetPassword = async (...args) => {
|
|
39890
|
-
return client2.
|
|
40006
|
+
return client2.requestPasswordReset(...args);
|
|
39891
40007
|
};
|
|
39892
40008
|
const sendVerificationEmail = async (...args) => {
|
|
39893
40009
|
return client2.sendVerificationEmail(...args);
|
|
@@ -39958,6 +40074,9 @@ const getAuthAPI = (intlayerConfig) => {
|
|
|
39958
40074
|
const signInMagicLink = async (...args) => {
|
|
39959
40075
|
return client2.signIn.magicLink(...args);
|
|
39960
40076
|
};
|
|
40077
|
+
const signInSSO = async (...args) => {
|
|
40078
|
+
return client2.sso.signIn(...args);
|
|
40079
|
+
};
|
|
39961
40080
|
return {
|
|
39962
40081
|
getAuthClient: () => client2,
|
|
39963
40082
|
signInEmail,
|
|
@@ -39992,7 +40111,8 @@ const getAuthAPI = (intlayerConfig) => {
|
|
|
39992
40111
|
signInPasskey,
|
|
39993
40112
|
deletePasskey,
|
|
39994
40113
|
listPasskeys,
|
|
39995
|
-
signInMagicLink
|
|
40114
|
+
signInMagicLink,
|
|
40115
|
+
signInSSO
|
|
39996
40116
|
};
|
|
39997
40117
|
};
|
|
39998
40118
|
function useSession(sessionProp, intlayerConfiguration) {
|
|
@@ -44056,42 +44176,57 @@ const useItemSelector = (optionsRefs, { selector: selector2 = selectorDefault, i
|
|
|
44056
44176
|
}) => {
|
|
44057
44177
|
const [choiceIndicatorPosition, setChoiceIndicatorPosition] = reactExports.useState(null);
|
|
44058
44178
|
const [hoveredItem, setHoveredItem] = reactExports.useState(null);
|
|
44179
|
+
const hideTimeoutRef = reactExports.useRef(null);
|
|
44180
|
+
const lastPositionRef = reactExports.useRef(null);
|
|
44059
44181
|
const itemsLength = optionsRefs.current.length;
|
|
44060
44182
|
const calculatePosition = () => {
|
|
44061
44183
|
let targetElement = null;
|
|
44062
|
-
if (hoveredItem)
|
|
44063
|
-
|
|
44184
|
+
if (hoveredItem) {
|
|
44185
|
+
targetElement = hoveredItem;
|
|
44186
|
+
if (hideTimeoutRef.current) {
|
|
44187
|
+
clearTimeout(hideTimeoutRef.current);
|
|
44188
|
+
hideTimeoutRef.current = null;
|
|
44189
|
+
}
|
|
44190
|
+
} else targetElement = optionsRefs.current.find(selector2) ?? null;
|
|
44064
44191
|
if (!targetElement) {
|
|
44065
|
-
if (orientation === "vertical") setChoiceIndicatorPosition((prev) =>
|
|
44066
|
-
|
|
44067
|
-
|
|
44068
|
-
|
|
44069
|
-
|
|
44070
|
-
|
|
44071
|
-
|
|
44072
|
-
|
|
44073
|
-
|
|
44074
|
-
|
|
44075
|
-
|
|
44076
|
-
|
|
44192
|
+
if (orientation === "vertical") setChoiceIndicatorPosition((prev) => {
|
|
44193
|
+
const verticalPrev = prev;
|
|
44194
|
+
const newPosition = {
|
|
44195
|
+
top: verticalPrev?.top ?? 0,
|
|
44196
|
+
height: verticalPrev?.height ?? 0,
|
|
44197
|
+
opacity: 0
|
|
44198
|
+
};
|
|
44199
|
+
lastPositionRef.current = newPosition;
|
|
44200
|
+
return newPosition;
|
|
44201
|
+
});
|
|
44202
|
+
else setChoiceIndicatorPosition((prev) => {
|
|
44203
|
+
const horizontalPrev = prev;
|
|
44204
|
+
const newPosition = {
|
|
44205
|
+
left: horizontalPrev?.left ?? 0,
|
|
44206
|
+
width: horizontalPrev?.width ?? 0,
|
|
44207
|
+
opacity: 0
|
|
44208
|
+
};
|
|
44209
|
+
lastPositionRef.current = newPosition;
|
|
44210
|
+
return newPosition;
|
|
44211
|
+
});
|
|
44077
44212
|
return;
|
|
44078
44213
|
}
|
|
44079
44214
|
if (orientation === "vertical") {
|
|
44080
|
-
const
|
|
44081
|
-
|
|
44082
|
-
|
|
44083
|
-
top,
|
|
44084
|
-
height,
|
|
44215
|
+
const newPosition = {
|
|
44216
|
+
top: targetElement.offsetTop,
|
|
44217
|
+
height: targetElement.offsetHeight,
|
|
44085
44218
|
opacity: 1
|
|
44086
|
-
}
|
|
44219
|
+
};
|
|
44220
|
+
setChoiceIndicatorPosition(newPosition);
|
|
44221
|
+
lastPositionRef.current = newPosition;
|
|
44087
44222
|
} else {
|
|
44088
|
-
const
|
|
44089
|
-
|
|
44090
|
-
|
|
44091
|
-
left,
|
|
44092
|
-
width,
|
|
44223
|
+
const newPosition = {
|
|
44224
|
+
left: targetElement.offsetLeft,
|
|
44225
|
+
width: targetElement.offsetWidth,
|
|
44093
44226
|
opacity: 1
|
|
44094
|
-
}
|
|
44227
|
+
};
|
|
44228
|
+
setChoiceIndicatorPosition(newPosition);
|
|
44229
|
+
lastPositionRef.current = newPosition;
|
|
44095
44230
|
}
|
|
44096
44231
|
};
|
|
44097
44232
|
reactExports.useEffect(() => {
|
|
@@ -44127,16 +44262,24 @@ const useItemSelector = (optionsRefs, { selector: selector2 = selectorDefault, i
|
|
|
44127
44262
|
if (selectedItem) observeSize(selectedItem);
|
|
44128
44263
|
if (hoveredItem) observeSize(hoveredItem);
|
|
44129
44264
|
const handleMouseEnter = (event) => {
|
|
44265
|
+
if (hideTimeoutRef.current) {
|
|
44266
|
+
clearTimeout(hideTimeoutRef.current);
|
|
44267
|
+
hideTimeoutRef.current = null;
|
|
44268
|
+
}
|
|
44130
44269
|
setHoveredItem(event.currentTarget);
|
|
44131
44270
|
};
|
|
44132
44271
|
const handleMouseLeave = () => {
|
|
44133
|
-
|
|
44272
|
+
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
44273
|
+
hideTimeoutRef.current = setTimeout(() => {
|
|
44274
|
+
setHoveredItem(null);
|
|
44275
|
+
}, 150);
|
|
44134
44276
|
};
|
|
44135
44277
|
if (isHoverable) optionsRefs.current.forEach((option) => {
|
|
44136
44278
|
option?.addEventListener("mouseenter", handleMouseEnter, { passive: true });
|
|
44137
44279
|
option?.addEventListener("mouseleave", handleMouseLeave, { passive: true });
|
|
44138
44280
|
});
|
|
44139
44281
|
return () => {
|
|
44282
|
+
if (hideTimeoutRef.current) clearTimeout(hideTimeoutRef.current);
|
|
44140
44283
|
window.removeEventListener("resize", calculatePosition);
|
|
44141
44284
|
window.removeEventListener("DOMContentLoaded", calculatePosition);
|
|
44142
44285
|
mutationObservers.forEach((observer) => {
|
|
@@ -44180,7 +44323,7 @@ let SwitchSelectorColor = /* @__PURE__ */ (function(SwitchSelectorColor$1) {
|
|
|
44180
44323
|
SwitchSelectorColor$1["TEXT"] = "text";
|
|
44181
44324
|
return SwitchSelectorColor$1;
|
|
44182
44325
|
})({});
|
|
44183
|
-
const switchSelectorVariant = cva("flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.
|
|
44326
|
+
const switchSelectorVariant = cva("flex w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-[1.5px]", {
|
|
44184
44327
|
variants: { color: {
|
|
44185
44328
|
[`${SwitchSelectorColor.PRIMARY}`]: "border-primary text-primary",
|
|
44186
44329
|
[`${SwitchSelectorColor.SECONDARY}`]: "border-secondary text-secondary",
|
|
@@ -44206,7 +44349,7 @@ const choiceVariant = cva("z-1 w-full flex-1 cursor-pointer font-medium text-sm
|
|
|
44206
44349
|
} },
|
|
44207
44350
|
defaultVariants: { size: `${SwitchSelectorSize.MD}` }
|
|
44208
44351
|
});
|
|
44209
|
-
const indicatorVariant$1 = cva("absolute top-0 z-
|
|
44352
|
+
const indicatorVariant$1 = cva("absolute top-0 z-0 h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none", { variants: { color: {
|
|
44210
44353
|
[`${SwitchSelectorColor.PRIMARY}`]: "bg-primary data-[indicator=true]:text-text",
|
|
44211
44354
|
[`${SwitchSelectorColor.SECONDARY}`]: "bg-secondary data-[indicator=true]:text-text",
|
|
44212
44355
|
[`${SwitchSelectorColor.DESTRUCTIVE}`]: "bg-destructive data-[indicator=true]:text-text",
|
|
@@ -44391,7 +44534,7 @@ function cleanRegex(source) {
|
|
|
44391
44534
|
const end = source.endsWith("$") ? source.length - 1 : source.length;
|
|
44392
44535
|
return source.slice(start, end);
|
|
44393
44536
|
}
|
|
44394
|
-
const EVALUATING = Symbol("evaluating");
|
|
44537
|
+
const EVALUATING = /* @__PURE__ */ Symbol("evaluating");
|
|
44395
44538
|
function defineLazy(object2, key2, getter) {
|
|
44396
44539
|
let value = void 0;
|
|
44397
44540
|
Object.defineProperty(object2, key2, {
|
|
@@ -45168,8 +45311,8 @@ class Doc {
|
|
|
45168
45311
|
}
|
|
45169
45312
|
const version = {
|
|
45170
45313
|
major: 4,
|
|
45171
|
-
minor:
|
|
45172
|
-
patch:
|
|
45314
|
+
minor: 2,
|
|
45315
|
+
patch: 1
|
|
45173
45316
|
};
|
|
45174
45317
|
const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
45175
45318
|
var _a2;
|
|
@@ -46679,6 +46822,510 @@ function _check(fn, params) {
|
|
|
46679
46822
|
ch._zod.check = fn;
|
|
46680
46823
|
return ch;
|
|
46681
46824
|
}
|
|
46825
|
+
function initializeContext(params) {
|
|
46826
|
+
let target = params?.target ?? "draft-2020-12";
|
|
46827
|
+
if (target === "draft-4")
|
|
46828
|
+
target = "draft-04";
|
|
46829
|
+
if (target === "draft-7")
|
|
46830
|
+
target = "draft-07";
|
|
46831
|
+
return {
|
|
46832
|
+
processors: params.processors ?? {},
|
|
46833
|
+
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
46834
|
+
target,
|
|
46835
|
+
unrepresentable: params?.unrepresentable ?? "throw",
|
|
46836
|
+
override: params?.override ?? (() => {
|
|
46837
|
+
}),
|
|
46838
|
+
io: params?.io ?? "output",
|
|
46839
|
+
counter: 0,
|
|
46840
|
+
seen: /* @__PURE__ */ new Map(),
|
|
46841
|
+
cycles: params?.cycles ?? "ref",
|
|
46842
|
+
reused: params?.reused ?? "inline",
|
|
46843
|
+
external: params?.external ?? void 0
|
|
46844
|
+
};
|
|
46845
|
+
}
|
|
46846
|
+
function process$1(schema, ctx, _params = { path: [], schemaPath: [] }) {
|
|
46847
|
+
var _a2;
|
|
46848
|
+
const def = schema._zod.def;
|
|
46849
|
+
const seen2 = ctx.seen.get(schema);
|
|
46850
|
+
if (seen2) {
|
|
46851
|
+
seen2.count++;
|
|
46852
|
+
const isCycle = _params.schemaPath.includes(schema);
|
|
46853
|
+
if (isCycle) {
|
|
46854
|
+
seen2.cycle = _params.path;
|
|
46855
|
+
}
|
|
46856
|
+
return seen2.schema;
|
|
46857
|
+
}
|
|
46858
|
+
const result = { schema: {}, count: 1, cycle: void 0, path: _params.path };
|
|
46859
|
+
ctx.seen.set(schema, result);
|
|
46860
|
+
const overrideSchema = schema._zod.toJSONSchema?.();
|
|
46861
|
+
if (overrideSchema) {
|
|
46862
|
+
result.schema = overrideSchema;
|
|
46863
|
+
} else {
|
|
46864
|
+
const params = {
|
|
46865
|
+
..._params,
|
|
46866
|
+
schemaPath: [..._params.schemaPath, schema],
|
|
46867
|
+
path: _params.path
|
|
46868
|
+
};
|
|
46869
|
+
const parent = schema._zod.parent;
|
|
46870
|
+
if (parent) {
|
|
46871
|
+
result.ref = parent;
|
|
46872
|
+
process$1(parent, ctx, params);
|
|
46873
|
+
ctx.seen.get(parent).isParent = true;
|
|
46874
|
+
} else if (schema._zod.processJSONSchema) {
|
|
46875
|
+
schema._zod.processJSONSchema(ctx, result.schema, params);
|
|
46876
|
+
} else {
|
|
46877
|
+
const _json = result.schema;
|
|
46878
|
+
const processor = ctx.processors[def.type];
|
|
46879
|
+
if (!processor) {
|
|
46880
|
+
throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
|
|
46881
|
+
}
|
|
46882
|
+
processor(schema, ctx, _json, params);
|
|
46883
|
+
}
|
|
46884
|
+
}
|
|
46885
|
+
const meta = ctx.metadataRegistry.get(schema);
|
|
46886
|
+
if (meta)
|
|
46887
|
+
Object.assign(result.schema, meta);
|
|
46888
|
+
if (ctx.io === "input" && isTransforming(schema)) {
|
|
46889
|
+
delete result.schema.examples;
|
|
46890
|
+
delete result.schema.default;
|
|
46891
|
+
}
|
|
46892
|
+
if (ctx.io === "input" && result.schema._prefault)
|
|
46893
|
+
(_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
|
|
46894
|
+
delete result.schema._prefault;
|
|
46895
|
+
const _result = ctx.seen.get(schema);
|
|
46896
|
+
return _result.schema;
|
|
46897
|
+
}
|
|
46898
|
+
function extractDefs(ctx, schema) {
|
|
46899
|
+
const root = ctx.seen.get(schema);
|
|
46900
|
+
if (!root)
|
|
46901
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
46902
|
+
const makeURI = (entry) => {
|
|
46903
|
+
const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
|
|
46904
|
+
if (ctx.external) {
|
|
46905
|
+
const externalId = ctx.external.registry.get(entry[0])?.id;
|
|
46906
|
+
const uriGenerator = ctx.external.uri ?? ((id3) => id3);
|
|
46907
|
+
if (externalId) {
|
|
46908
|
+
return { ref: uriGenerator(externalId) };
|
|
46909
|
+
}
|
|
46910
|
+
const id2 = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
|
|
46911
|
+
entry[1].defId = id2;
|
|
46912
|
+
return { defId: id2, ref: `${uriGenerator("__shared")}#/${defsSegment}/${id2}` };
|
|
46913
|
+
}
|
|
46914
|
+
if (entry[1] === root) {
|
|
46915
|
+
return { ref: "#" };
|
|
46916
|
+
}
|
|
46917
|
+
const uriPrefix = `#`;
|
|
46918
|
+
const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
|
|
46919
|
+
const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
|
|
46920
|
+
return { defId, ref: defUriPrefix + defId };
|
|
46921
|
+
};
|
|
46922
|
+
const extractToDef = (entry) => {
|
|
46923
|
+
if (entry[1].schema.$ref) {
|
|
46924
|
+
return;
|
|
46925
|
+
}
|
|
46926
|
+
const seen2 = entry[1];
|
|
46927
|
+
const { ref, defId } = makeURI(entry);
|
|
46928
|
+
seen2.def = { ...seen2.schema };
|
|
46929
|
+
if (defId)
|
|
46930
|
+
seen2.defId = defId;
|
|
46931
|
+
const schema2 = seen2.schema;
|
|
46932
|
+
for (const key2 in schema2) {
|
|
46933
|
+
delete schema2[key2];
|
|
46934
|
+
}
|
|
46935
|
+
schema2.$ref = ref;
|
|
46936
|
+
};
|
|
46937
|
+
if (ctx.cycles === "throw") {
|
|
46938
|
+
for (const entry of ctx.seen.entries()) {
|
|
46939
|
+
const seen2 = entry[1];
|
|
46940
|
+
if (seen2.cycle) {
|
|
46941
|
+
throw new Error(`Cycle detected: #/${seen2.cycle?.join("/")}/<root>
|
|
46942
|
+
|
|
46943
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
|
|
46944
|
+
}
|
|
46945
|
+
}
|
|
46946
|
+
}
|
|
46947
|
+
for (const entry of ctx.seen.entries()) {
|
|
46948
|
+
const seen2 = entry[1];
|
|
46949
|
+
if (schema === entry[0]) {
|
|
46950
|
+
extractToDef(entry);
|
|
46951
|
+
continue;
|
|
46952
|
+
}
|
|
46953
|
+
if (ctx.external) {
|
|
46954
|
+
const ext = ctx.external.registry.get(entry[0])?.id;
|
|
46955
|
+
if (schema !== entry[0] && ext) {
|
|
46956
|
+
extractToDef(entry);
|
|
46957
|
+
continue;
|
|
46958
|
+
}
|
|
46959
|
+
}
|
|
46960
|
+
const id2 = ctx.metadataRegistry.get(entry[0])?.id;
|
|
46961
|
+
if (id2) {
|
|
46962
|
+
extractToDef(entry);
|
|
46963
|
+
continue;
|
|
46964
|
+
}
|
|
46965
|
+
if (seen2.cycle) {
|
|
46966
|
+
extractToDef(entry);
|
|
46967
|
+
continue;
|
|
46968
|
+
}
|
|
46969
|
+
if (seen2.count > 1) {
|
|
46970
|
+
if (ctx.reused === "ref") {
|
|
46971
|
+
extractToDef(entry);
|
|
46972
|
+
continue;
|
|
46973
|
+
}
|
|
46974
|
+
}
|
|
46975
|
+
}
|
|
46976
|
+
}
|
|
46977
|
+
function finalize(ctx, schema) {
|
|
46978
|
+
const root = ctx.seen.get(schema);
|
|
46979
|
+
if (!root)
|
|
46980
|
+
throw new Error("Unprocessed schema. This is a bug in Zod.");
|
|
46981
|
+
const flattenRef = (zodSchema) => {
|
|
46982
|
+
const seen2 = ctx.seen.get(zodSchema);
|
|
46983
|
+
const schema2 = seen2.def ?? seen2.schema;
|
|
46984
|
+
const _cached = { ...schema2 };
|
|
46985
|
+
if (seen2.ref === null) {
|
|
46986
|
+
return;
|
|
46987
|
+
}
|
|
46988
|
+
const ref = seen2.ref;
|
|
46989
|
+
seen2.ref = null;
|
|
46990
|
+
if (ref) {
|
|
46991
|
+
flattenRef(ref);
|
|
46992
|
+
const refSchema = ctx.seen.get(ref).schema;
|
|
46993
|
+
if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
|
|
46994
|
+
schema2.allOf = schema2.allOf ?? [];
|
|
46995
|
+
schema2.allOf.push(refSchema);
|
|
46996
|
+
} else {
|
|
46997
|
+
Object.assign(schema2, refSchema);
|
|
46998
|
+
Object.assign(schema2, _cached);
|
|
46999
|
+
}
|
|
47000
|
+
}
|
|
47001
|
+
if (!seen2.isParent)
|
|
47002
|
+
ctx.override({
|
|
47003
|
+
zodSchema,
|
|
47004
|
+
jsonSchema: schema2,
|
|
47005
|
+
path: seen2.path ?? []
|
|
47006
|
+
});
|
|
47007
|
+
};
|
|
47008
|
+
for (const entry of [...ctx.seen.entries()].reverse()) {
|
|
47009
|
+
flattenRef(entry[0]);
|
|
47010
|
+
}
|
|
47011
|
+
const result = {};
|
|
47012
|
+
if (ctx.target === "draft-2020-12") {
|
|
47013
|
+
result.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
47014
|
+
} else if (ctx.target === "draft-07") {
|
|
47015
|
+
result.$schema = "http://json-schema.org/draft-07/schema#";
|
|
47016
|
+
} else if (ctx.target === "draft-04") {
|
|
47017
|
+
result.$schema = "http://json-schema.org/draft-04/schema#";
|
|
47018
|
+
} else if (ctx.target === "openapi-3.0") ;
|
|
47019
|
+
else ;
|
|
47020
|
+
if (ctx.external?.uri) {
|
|
47021
|
+
const id2 = ctx.external.registry.get(schema)?.id;
|
|
47022
|
+
if (!id2)
|
|
47023
|
+
throw new Error("Schema is missing an `id` property");
|
|
47024
|
+
result.$id = ctx.external.uri(id2);
|
|
47025
|
+
}
|
|
47026
|
+
Object.assign(result, root.def ?? root.schema);
|
|
47027
|
+
const defs = ctx.external?.defs ?? {};
|
|
47028
|
+
for (const entry of ctx.seen.entries()) {
|
|
47029
|
+
const seen2 = entry[1];
|
|
47030
|
+
if (seen2.def && seen2.defId) {
|
|
47031
|
+
defs[seen2.defId] = seen2.def;
|
|
47032
|
+
}
|
|
47033
|
+
}
|
|
47034
|
+
if (ctx.external) ;
|
|
47035
|
+
else {
|
|
47036
|
+
if (Object.keys(defs).length > 0) {
|
|
47037
|
+
if (ctx.target === "draft-2020-12") {
|
|
47038
|
+
result.$defs = defs;
|
|
47039
|
+
} else {
|
|
47040
|
+
result.definitions = defs;
|
|
47041
|
+
}
|
|
47042
|
+
}
|
|
47043
|
+
}
|
|
47044
|
+
try {
|
|
47045
|
+
const finalized = JSON.parse(JSON.stringify(result));
|
|
47046
|
+
Object.defineProperty(finalized, "~standard", {
|
|
47047
|
+
value: {
|
|
47048
|
+
...schema["~standard"],
|
|
47049
|
+
jsonSchema: {
|
|
47050
|
+
input: createStandardJSONSchemaMethod(schema, "input"),
|
|
47051
|
+
output: createStandardJSONSchemaMethod(schema, "output")
|
|
47052
|
+
}
|
|
47053
|
+
},
|
|
47054
|
+
enumerable: false,
|
|
47055
|
+
writable: false
|
|
47056
|
+
});
|
|
47057
|
+
return finalized;
|
|
47058
|
+
} catch (_err) {
|
|
47059
|
+
throw new Error("Error converting schema to JSON.");
|
|
47060
|
+
}
|
|
47061
|
+
}
|
|
47062
|
+
function isTransforming(_schema, _ctx) {
|
|
47063
|
+
const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
|
|
47064
|
+
if (ctx.seen.has(_schema))
|
|
47065
|
+
return false;
|
|
47066
|
+
ctx.seen.add(_schema);
|
|
47067
|
+
const def = _schema._zod.def;
|
|
47068
|
+
if (def.type === "transform")
|
|
47069
|
+
return true;
|
|
47070
|
+
if (def.type === "array")
|
|
47071
|
+
return isTransforming(def.element, ctx);
|
|
47072
|
+
if (def.type === "set")
|
|
47073
|
+
return isTransforming(def.valueType, ctx);
|
|
47074
|
+
if (def.type === "lazy")
|
|
47075
|
+
return isTransforming(def.getter(), ctx);
|
|
47076
|
+
if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") {
|
|
47077
|
+
return isTransforming(def.innerType, ctx);
|
|
47078
|
+
}
|
|
47079
|
+
if (def.type === "intersection") {
|
|
47080
|
+
return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
|
|
47081
|
+
}
|
|
47082
|
+
if (def.type === "record" || def.type === "map") {
|
|
47083
|
+
return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
|
|
47084
|
+
}
|
|
47085
|
+
if (def.type === "pipe") {
|
|
47086
|
+
return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
|
|
47087
|
+
}
|
|
47088
|
+
if (def.type === "object") {
|
|
47089
|
+
for (const key2 in def.shape) {
|
|
47090
|
+
if (isTransforming(def.shape[key2], ctx))
|
|
47091
|
+
return true;
|
|
47092
|
+
}
|
|
47093
|
+
return false;
|
|
47094
|
+
}
|
|
47095
|
+
if (def.type === "union") {
|
|
47096
|
+
for (const option of def.options) {
|
|
47097
|
+
if (isTransforming(option, ctx))
|
|
47098
|
+
return true;
|
|
47099
|
+
}
|
|
47100
|
+
return false;
|
|
47101
|
+
}
|
|
47102
|
+
if (def.type === "tuple") {
|
|
47103
|
+
for (const item of def.items) {
|
|
47104
|
+
if (isTransforming(item, ctx))
|
|
47105
|
+
return true;
|
|
47106
|
+
}
|
|
47107
|
+
if (def.rest && isTransforming(def.rest, ctx))
|
|
47108
|
+
return true;
|
|
47109
|
+
return false;
|
|
47110
|
+
}
|
|
47111
|
+
return false;
|
|
47112
|
+
}
|
|
47113
|
+
const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
47114
|
+
const ctx = initializeContext({ ...params, processors });
|
|
47115
|
+
process$1(schema, ctx);
|
|
47116
|
+
extractDefs(ctx, schema);
|
|
47117
|
+
return finalize(ctx, schema);
|
|
47118
|
+
};
|
|
47119
|
+
const createStandardJSONSchemaMethod = (schema, io) => (params) => {
|
|
47120
|
+
const { libraryOptions, target } = params ?? {};
|
|
47121
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors: {} });
|
|
47122
|
+
process$1(schema, ctx);
|
|
47123
|
+
extractDefs(ctx, schema);
|
|
47124
|
+
return finalize(ctx, schema);
|
|
47125
|
+
};
|
|
47126
|
+
const formatMap = {
|
|
47127
|
+
guid: "uuid",
|
|
47128
|
+
url: "uri",
|
|
47129
|
+
datetime: "date-time",
|
|
47130
|
+
json_string: "json-string",
|
|
47131
|
+
regex: ""
|
|
47132
|
+
// do not set
|
|
47133
|
+
};
|
|
47134
|
+
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
47135
|
+
const json = _json;
|
|
47136
|
+
json.type = "string";
|
|
47137
|
+
const { minimum, maximum, format: format2, patterns, contentEncoding } = schema._zod.bag;
|
|
47138
|
+
if (typeof minimum === "number")
|
|
47139
|
+
json.minLength = minimum;
|
|
47140
|
+
if (typeof maximum === "number")
|
|
47141
|
+
json.maxLength = maximum;
|
|
47142
|
+
if (format2) {
|
|
47143
|
+
json.format = formatMap[format2] ?? format2;
|
|
47144
|
+
if (json.format === "")
|
|
47145
|
+
delete json.format;
|
|
47146
|
+
}
|
|
47147
|
+
if (contentEncoding)
|
|
47148
|
+
json.contentEncoding = contentEncoding;
|
|
47149
|
+
if (patterns && patterns.size > 0) {
|
|
47150
|
+
const regexes = [...patterns];
|
|
47151
|
+
if (regexes.length === 1)
|
|
47152
|
+
json.pattern = regexes[0].source;
|
|
47153
|
+
else if (regexes.length > 1) {
|
|
47154
|
+
json.allOf = [
|
|
47155
|
+
...regexes.map((regex) => ({
|
|
47156
|
+
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
47157
|
+
pattern: regex.source
|
|
47158
|
+
}))
|
|
47159
|
+
];
|
|
47160
|
+
}
|
|
47161
|
+
}
|
|
47162
|
+
};
|
|
47163
|
+
const neverProcessor = (_schema, _ctx, json, _params) => {
|
|
47164
|
+
json.not = {};
|
|
47165
|
+
};
|
|
47166
|
+
const unknownProcessor = (_schema, _ctx, _json, _params) => {
|
|
47167
|
+
};
|
|
47168
|
+
const enumProcessor = (schema, _ctx, json, _params) => {
|
|
47169
|
+
const def = schema._zod.def;
|
|
47170
|
+
const values = getEnumValues(def.entries);
|
|
47171
|
+
if (values.every((v2) => typeof v2 === "number"))
|
|
47172
|
+
json.type = "number";
|
|
47173
|
+
if (values.every((v2) => typeof v2 === "string"))
|
|
47174
|
+
json.type = "string";
|
|
47175
|
+
json.enum = values;
|
|
47176
|
+
};
|
|
47177
|
+
const customProcessor = (_schema, ctx, _json, _params) => {
|
|
47178
|
+
if (ctx.unrepresentable === "throw") {
|
|
47179
|
+
throw new Error("Custom types cannot be represented in JSON Schema");
|
|
47180
|
+
}
|
|
47181
|
+
};
|
|
47182
|
+
const transformProcessor = (_schema, ctx, _json, _params) => {
|
|
47183
|
+
if (ctx.unrepresentable === "throw") {
|
|
47184
|
+
throw new Error("Transforms cannot be represented in JSON Schema");
|
|
47185
|
+
}
|
|
47186
|
+
};
|
|
47187
|
+
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
47188
|
+
const json = _json;
|
|
47189
|
+
const def = schema._zod.def;
|
|
47190
|
+
const { minimum, maximum } = schema._zod.bag;
|
|
47191
|
+
if (typeof minimum === "number")
|
|
47192
|
+
json.minItems = minimum;
|
|
47193
|
+
if (typeof maximum === "number")
|
|
47194
|
+
json.maxItems = maximum;
|
|
47195
|
+
json.type = "array";
|
|
47196
|
+
json.items = process$1(def.element, ctx, { ...params, path: [...params.path, "items"] });
|
|
47197
|
+
};
|
|
47198
|
+
const objectProcessor = (schema, ctx, _json, params) => {
|
|
47199
|
+
const json = _json;
|
|
47200
|
+
const def = schema._zod.def;
|
|
47201
|
+
json.type = "object";
|
|
47202
|
+
json.properties = {};
|
|
47203
|
+
const shape = def.shape;
|
|
47204
|
+
for (const key2 in shape) {
|
|
47205
|
+
json.properties[key2] = process$1(shape[key2], ctx, {
|
|
47206
|
+
...params,
|
|
47207
|
+
path: [...params.path, "properties", key2]
|
|
47208
|
+
});
|
|
47209
|
+
}
|
|
47210
|
+
const allKeys = new Set(Object.keys(shape));
|
|
47211
|
+
const requiredKeys = new Set([...allKeys].filter((key2) => {
|
|
47212
|
+
const v2 = def.shape[key2]._zod;
|
|
47213
|
+
if (ctx.io === "input") {
|
|
47214
|
+
return v2.optin === void 0;
|
|
47215
|
+
} else {
|
|
47216
|
+
return v2.optout === void 0;
|
|
47217
|
+
}
|
|
47218
|
+
}));
|
|
47219
|
+
if (requiredKeys.size > 0) {
|
|
47220
|
+
json.required = Array.from(requiredKeys);
|
|
47221
|
+
}
|
|
47222
|
+
if (def.catchall?._zod.def.type === "never") {
|
|
47223
|
+
json.additionalProperties = false;
|
|
47224
|
+
} else if (!def.catchall) {
|
|
47225
|
+
if (ctx.io === "output")
|
|
47226
|
+
json.additionalProperties = false;
|
|
47227
|
+
} else if (def.catchall) {
|
|
47228
|
+
json.additionalProperties = process$1(def.catchall, ctx, {
|
|
47229
|
+
...params,
|
|
47230
|
+
path: [...params.path, "additionalProperties"]
|
|
47231
|
+
});
|
|
47232
|
+
}
|
|
47233
|
+
};
|
|
47234
|
+
const unionProcessor = (schema, ctx, json, params) => {
|
|
47235
|
+
const def = schema._zod.def;
|
|
47236
|
+
const isExclusive = def.inclusive === false;
|
|
47237
|
+
const options = def.options.map((x, i2) => process$1(x, ctx, {
|
|
47238
|
+
...params,
|
|
47239
|
+
path: [...params.path, isExclusive ? "oneOf" : "anyOf", i2]
|
|
47240
|
+
}));
|
|
47241
|
+
if (isExclusive) {
|
|
47242
|
+
json.oneOf = options;
|
|
47243
|
+
} else {
|
|
47244
|
+
json.anyOf = options;
|
|
47245
|
+
}
|
|
47246
|
+
};
|
|
47247
|
+
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
47248
|
+
const def = schema._zod.def;
|
|
47249
|
+
const a2 = process$1(def.left, ctx, {
|
|
47250
|
+
...params,
|
|
47251
|
+
path: [...params.path, "allOf", 0]
|
|
47252
|
+
});
|
|
47253
|
+
const b = process$1(def.right, ctx, {
|
|
47254
|
+
...params,
|
|
47255
|
+
path: [...params.path, "allOf", 1]
|
|
47256
|
+
});
|
|
47257
|
+
const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
|
|
47258
|
+
const allOf = [
|
|
47259
|
+
...isSimpleIntersection(a2) ? a2.allOf : [a2],
|
|
47260
|
+
...isSimpleIntersection(b) ? b.allOf : [b]
|
|
47261
|
+
];
|
|
47262
|
+
json.allOf = allOf;
|
|
47263
|
+
};
|
|
47264
|
+
const nullableProcessor = (schema, ctx, json, params) => {
|
|
47265
|
+
const def = schema._zod.def;
|
|
47266
|
+
const inner = process$1(def.innerType, ctx, params);
|
|
47267
|
+
const seen2 = ctx.seen.get(schema);
|
|
47268
|
+
if (ctx.target === "openapi-3.0") {
|
|
47269
|
+
seen2.ref = def.innerType;
|
|
47270
|
+
json.nullable = true;
|
|
47271
|
+
} else {
|
|
47272
|
+
json.anyOf = [inner, { type: "null" }];
|
|
47273
|
+
}
|
|
47274
|
+
};
|
|
47275
|
+
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
47276
|
+
const def = schema._zod.def;
|
|
47277
|
+
process$1(def.innerType, ctx, params);
|
|
47278
|
+
const seen2 = ctx.seen.get(schema);
|
|
47279
|
+
seen2.ref = def.innerType;
|
|
47280
|
+
};
|
|
47281
|
+
const defaultProcessor = (schema, ctx, json, params) => {
|
|
47282
|
+
const def = schema._zod.def;
|
|
47283
|
+
process$1(def.innerType, ctx, params);
|
|
47284
|
+
const seen2 = ctx.seen.get(schema);
|
|
47285
|
+
seen2.ref = def.innerType;
|
|
47286
|
+
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
47287
|
+
};
|
|
47288
|
+
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
47289
|
+
const def = schema._zod.def;
|
|
47290
|
+
process$1(def.innerType, ctx, params);
|
|
47291
|
+
const seen2 = ctx.seen.get(schema);
|
|
47292
|
+
seen2.ref = def.innerType;
|
|
47293
|
+
if (ctx.io === "input")
|
|
47294
|
+
json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
47295
|
+
};
|
|
47296
|
+
const catchProcessor = (schema, ctx, json, params) => {
|
|
47297
|
+
const def = schema._zod.def;
|
|
47298
|
+
process$1(def.innerType, ctx, params);
|
|
47299
|
+
const seen2 = ctx.seen.get(schema);
|
|
47300
|
+
seen2.ref = def.innerType;
|
|
47301
|
+
let catchValue;
|
|
47302
|
+
try {
|
|
47303
|
+
catchValue = def.catchValue(void 0);
|
|
47304
|
+
} catch {
|
|
47305
|
+
throw new Error("Dynamic catch values are not supported in JSON Schema");
|
|
47306
|
+
}
|
|
47307
|
+
json.default = catchValue;
|
|
47308
|
+
};
|
|
47309
|
+
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
47310
|
+
const def = schema._zod.def;
|
|
47311
|
+
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
47312
|
+
process$1(innerType, ctx, params);
|
|
47313
|
+
const seen2 = ctx.seen.get(schema);
|
|
47314
|
+
seen2.ref = innerType;
|
|
47315
|
+
};
|
|
47316
|
+
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
47317
|
+
const def = schema._zod.def;
|
|
47318
|
+
process$1(def.innerType, ctx, params);
|
|
47319
|
+
const seen2 = ctx.seen.get(schema);
|
|
47320
|
+
seen2.ref = def.innerType;
|
|
47321
|
+
json.readOnly = true;
|
|
47322
|
+
};
|
|
47323
|
+
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
47324
|
+
const def = schema._zod.def;
|
|
47325
|
+
process$1(def.innerType, ctx, params);
|
|
47326
|
+
const seen2 = ctx.seen.get(schema);
|
|
47327
|
+
seen2.ref = def.innerType;
|
|
47328
|
+
};
|
|
46682
47329
|
function t(r2, e) {
|
|
46683
47330
|
try {
|
|
46684
47331
|
var o2 = r2();
|
|
@@ -46918,7 +47565,6 @@ const selector = (option) => option?.getAttribute("aria-active") === "true";
|
|
|
46918
47565
|
const OTPFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, slots = 6, maxLength = 6, ...props }) => {
|
|
46919
47566
|
const { error } = useFormField();
|
|
46920
47567
|
const optionsRefs = reactExports.useRef([]);
|
|
46921
|
-
const indicatorRef = reactExports.useRef(null);
|
|
46922
47568
|
const { choiceIndicatorPosition, calculatePosition } = useItemSelector(optionsRefs, {
|
|
46923
47569
|
selector,
|
|
46924
47570
|
isHoverable: true
|
|
@@ -46983,10 +47629,7 @@ const OTPFieldContent = ({ field, name, label, description, isRequired, info, sh
|
|
|
46983
47629
|
}
|
|
46984
47630
|
})
|
|
46985
47631
|
] }),
|
|
46986
|
-
choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx(InputIndicator, {
|
|
46987
|
-
style: choiceIndicatorPosition,
|
|
46988
|
-
ref: indicatorRef
|
|
46989
|
-
})
|
|
47632
|
+
choiceIndicatorPosition && /* @__PURE__ */ jsxRuntimeExports.jsx(InputIndicator, { style: choiceIndicatorPosition })
|
|
46990
47633
|
] })
|
|
46991
47634
|
})
|
|
46992
47635
|
});
|
|
@@ -47033,17 +47676,17 @@ const AutoSizedTextAreaElement = (props) => /* @__PURE__ */ jsxRuntimeExports.js
|
|
|
47033
47676
|
"data-testid": props.name,
|
|
47034
47677
|
...props
|
|
47035
47678
|
});
|
|
47036
|
-
const CheckboxComponent = ({ inputLabel, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, {
|
|
47679
|
+
const CheckboxComponent = ({ inputLabel, value, onChange, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Checkbox, {
|
|
47037
47680
|
...props,
|
|
47038
|
-
label: inputLabel
|
|
47681
|
+
label: inputLabel,
|
|
47682
|
+
checked: Boolean(value),
|
|
47683
|
+
onChange
|
|
47039
47684
|
});
|
|
47040
47685
|
const CheckboxElement = ({ autoComplete, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(FormElement, {
|
|
47041
47686
|
Element: CheckboxComponent,
|
|
47042
47687
|
id: props.name,
|
|
47043
47688
|
"data-testid": props.name,
|
|
47044
47689
|
autoComplete,
|
|
47045
|
-
minLength: 6,
|
|
47046
|
-
maxLength: 255,
|
|
47047
47690
|
...props
|
|
47048
47691
|
});
|
|
47049
47692
|
const MultiSelectFieldContent = ({ field, name, label, description, isRequired, info, showErrorMessage, children, ...props }) => {
|
|
@@ -47153,7 +47796,7 @@ const SwitchSelectorElement = ({ name, description, label, isRequired, info, sho
|
|
|
47153
47796
|
})
|
|
47154
47797
|
});
|
|
47155
47798
|
};
|
|
47156
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
47799
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
47157
47800
|
var use = React[" use ".trim().toString()];
|
|
47158
47801
|
function isPromiseLike(value) {
|
|
47159
47802
|
return typeof value === "object" && value !== null && "then" in value;
|
|
@@ -47209,7 +47852,7 @@ function createSlotClone(ownerName) {
|
|
|
47209
47852
|
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
47210
47853
|
return SlotClone;
|
|
47211
47854
|
}
|
|
47212
|
-
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
47855
|
+
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
47213
47856
|
function isSlottable(child) {
|
|
47214
47857
|
return reactExports.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
47215
47858
|
}
|
|
@@ -47300,13 +47943,13 @@ Form.EditableFieldTextArea = EditableFieldTextAreaElement;
|
|
|
47300
47943
|
Form.SwitchSelector = SwitchSelectorElement;
|
|
47301
47944
|
Form.OTP = OTPElement;
|
|
47302
47945
|
Form.SearchInput = SearchInputElement;
|
|
47303
|
-
const key$
|
|
47304
|
-
const content$
|
|
47305
|
-
const localIds$
|
|
47946
|
+
const key$e = "save-dictionary-details";
|
|
47947
|
+
const content$e = { "nodeType": "translation", "translation": { "en": { "deleteButton": { "text": "Delete dictionary", "label": "Click to delete dictionary" }, "resetButton": { "text": "Reset all changes", "label": "Click to reset all the changes" }, "saveButton": { "text": "Save changes", "label": "Click to save changes" }, "publishButton": { "text": "Publish dictionary", "label": "Click to publish dictionary" }, "downloadButton": { "text": "Download", "label": "Click to download" }, "confirmation": { "title": "Confirmation", "message": "This will overwrite the existing dictionary. Are you sure you want to continue?", "confirmButton": { "text": "Confirm", "label": "Click to confirm" }, "cancelButton": { "text": "Cancel", "label": "Click to cancel" } } }, "en-GB": { "deleteButton": { "text": "Delete dictionary", "label": "Click to delete dictionary" }, "resetButton": { "text": "Reset all changes", "label": "Click to reset all the changes" }, "saveButton": { "text": "Save changes", "label": "Click to save changes" }, "publishButton": { "text": "Publish dictionary", "label": "Click to publish dictionary" }, "downloadButton": { "text": "Download", "label": "Click to download" }, "confirmation": { "title": "Confirmation", "message": "This will overwrite the existing dictionary. Are you sure you want to continue?", "confirmButton": { "text": "Confirm", "label": "Click to confirm" }, "cancelButton": { "text": "Cancel", "label": "Click to cancel" } } }, "fr": { "deleteButton": { "text": "Supprimer le dictionnaire", "label": "Cliquez pour supprimer le dictionnaire" }, "resetButton": { "text": "Réinitialiser toutes les modifications", "label": "Cliquez pour réinitialiser toutes les modifications" }, "saveButton": { "text": "Enregistrer les modifications", "label": "Cliquez pour enregistrer les modifications" }, "publishButton": { "text": "Publier dictionnaire", "label": "Cliquez pour publier dictionnaire" }, "downloadButton": { "text": "Télécharger", "label": "Cliquez pour télécharger" }, "confirmation": { "title": "Confirmation", "message": "Cela remplacera le dictionnaire existant. Êtes-vous sûr de vouloir continuer?", "confirmButton": { "text": "Confirmer", "label": "Cliquez pour confirmer" }, "cancelButton": { "text": "Annuler", "label": "Cliquez pour annuler" } } }, "es": { "deleteButton": { "text": "Eliminar diccionario", "label": "Haga clic para eliminar el diccionario" }, "resetButton": { "text": "Restablecer todas las modificaciones", "label": "Haga clic para restablecer todas las modificaciones" }, "saveButton": { "text": "Guardar cambios", "label": "Haga clic para guardar cambios" }, "publishButton": { "text": "Publicar diccionario", "label": "Haga clic para publicar diccionario" }, "downloadButton": { "text": "Descargar", "label": "Haga clic para descargar" }, "confirmation": { "title": "Confirmation", "message": "Esto sobrescribirá el diccionario existente. ¿Estás seguro de que quieres continuar?", "confirmButton": { "text": "Confirmar", "label": "Haga clic para confirmar" }, "cancelButton": { "text": "Cancelar", "label": "Haga clic para cancelar" } } }, "de": { "deleteButton": { "text": "Wörterbuch löschen", "label": "Klicken Sie, um das Wörterbuch zu löschen" }, "resetButton": { "text": "Alle Änderungen zurücksetzen", "label": "Klicken Sie, um alle Änderungen zurückzusetzen" }, "saveButton": { "text": "Änderungen speichern", "label": "Klicken Sie, um Änderungen zu speichern" }, "publishButton": { "text": "Wörterbuch veröffentlichen", "label": "Klicken Sie, um das Wörterbuch zu veröffentlichen" }, "downloadButton": { "text": "Herunterladen", "label": "Klicken Sie, um herunterzuladen" }, "confirmation": { "title": "Confirmation", "message": "Dies wird das existierende Wörterbuch überschreiben. Sind Sie sicher, dass Sie fortfahren möchten?", "confirmButton": { "text": "Bestätigen", "label": "Klicken Sie, um zu bestätigen" }, "cancelButton": { "text": "Abbrechen", "label": "Klicken Sie, um abzubrechen" } } }, "ja": { "deleteButton": { "text": "辞書を削除", "label": "辞書を削除するにはクリックしてください" }, "resetButton": { "text": "すべての変更をリセット", "label": "すべての変更をリセットするにはクリックしてください" }, "saveButton": { "text": "変更を保存", "label": "変更を保存するにはクリックしてください" }, "publishButton": { "text": "辞書を公開", "label": "辞書を公開するにはクリックしてください" }, "downloadButton": { "text": "ダウンロード", "label": "ダウンロードするにはクリックしてください" }, "confirmation": { "title": "確認", "message": "既存の辞書を上書きします。続行しますか?", "confirmButton": { "text": "確認", "label": "確認するにはクリックしてください" }, "cancelButton": { "text": "キャンセル", "label": "キャンセルするにはクリックしてください" } } }, "ko": { "deleteButton": { "text": "사전 삭제", "label": "사전을 삭제하려면 클릭하세요" }, "resetButton": { "text": "모든 변경 사항 초기화", "label": "모든 변경 사항을 초기화하려면 클릭하세요" }, "saveButton": { "text": "변경 사항 저장", "label": "변경 사항을 저장하려면 클릭하세요" }, "publishButton": { "text": "사전을 게시합니다", "label": "사전을 게시하려면 클릭하세요" }, "downloadButton": { "text": "다운로드", "label": "다운로드를 클릭하세요" }, "confirmation": { "title": "확인", "message": "이는 기존 사전을 덮어 쓸 것입니다. 계속하시겠습니까?", "confirmButton": { "text": "확인", "label": "확인을 클릭하세요" }, "cancelButton": { "text": "취소", "label": "취소를 클릭하세요" } } }, "zh": { "deleteButton": { "text": "删除字典", "label": "单击以删除字典" }, "resetButton": { "text": "重置所有更改", "label": "单击以重置所有更改" }, "saveButton": { "text": "保存更改", "label": "单击保存更改" }, "publishButton": { "text": "发布字典", "label": "单击以发布字典" }, "downloadButton": { "text": "下载", "label": "单击下载" }, "confirmation": { "title": "确认", "message": "这将覆盖现有的字典。你确定要继续吗?", "confirmButton": { "text": "确认", "label": "单击确认" }, "cancelButton": { "text": "取消", "label": "单击取消" } } }, "it": { "deleteButton": { "text": "Elimina dizionario", "label": "Fai clic per eliminare il dizionario" }, "resetButton": { "text": "Reimposta tutte le modifiche", "label": "Fai clic per ripristinare tutte le modifiche" }, "saveButton": { "text": "Salva le modifiche", "label": "Fai clic per salvare le modifiche" }, "publishButton": { "text": "Pubblica dizionario", "label": "Fai clic per pubblicare il dizionario" }, "downloadButton": { "text": "Scarica", "label": "Fai clic per scaricare" }, "confirmation": { "title": "Conferma", "message": "Questo sovrascriverà il dizionario esistente. Sei sicuro di voler continuare?", "confirmButton": { "text": "Conferma", "label": "Fai clic per confermare" }, "cancelButton": { "text": "Annulla", "label": "Fai clic per annullare" } } }, "pt": { "deleteButton": { "text": "Excluir dicionário", "label": "Clique para excluir o dicionário" }, "resetButton": { "text": "Redefinir todas as alterações", "label": "Clique para redefinir todas as alterações" }, "saveButton": { "text": "Salvar alterações", "label": "Clique para salvar alterações" }, "publishButton": { "text": "Publicar dicionário", "label": "Clique para publicar dicionário" }, "downloadButton": { "text": "Baixar", "label": "Clique para baixar" }, "confirmation": { "title": "Confirmação", "message": "Isso sobrescreverá o dicionário existente. Você tem certeza de que deseja continuar?", "confirmButton": { "text": "Confirmar", "label": "Clique para confirmar" }, "cancelButton": { "text": "Cancelar", "label": "Clique para cancelar" } } }, "hi": { "deleteButton": { "text": "शब्दकोश हटाएं", "label": "शब्दकोश हटाने के लिए क्लिक करें" }, "resetButton": { "text": "सभी परिवर्तनों को रीसेट करें", "label": "सभी परिवर्तनों को रीसेट करने के लिए क्लिक करें" }, "saveButton": { "text": "परिवर्तनों को सहेजें", "label": "परिवर्तनों को सहेजने के लिए क्लिक करें" }, "publishButton": { "text": "शब्दकोश प्रकाशित करें", "label": "शब्दकोश प्रकाशित करने के लिए क्लिक करें" }, "downloadButton": { "text": "डाउनलोड", "label": "डाउनलोड करने के लिए क्लिक करें" }, "confirmation": { "title": "पुष्टि करें", "message": "यह मौजूदा शब्दकोश को ओवरराइट करने जारी है। आप क्या आप जारी रखना चाहते हैं?", "confirmButton": { "text": "पुष्टि करें", "label": "पुष्टि करने के लिए क्लिक करें" }, "cancelButton": { "text": "रद्द करें", "label": "रद्द करने के लिए क्लिक करें" } } }, "ar": { "deleteButton": { "text": "حذف القاموس", "label": "انقر لحذف القاموس" }, "resetButton": { "text": "إعادة تعيين جميع التغييرات", "label": "انقر لإعادة تعيين جميع التغييرات" }, "saveButton": { "text": "احفظ التغييرات", "label": "انقر لحفظ التغييرات" }, "publishButton": { "text": "نشر القاموس", "label": "انقر لنشر القاموس" }, "downloadButton": { "text": "تنزيل", "label": "انقر لتنزيل" }, "confirmation": { "title": "تأكيد", "message": "سيتم الكتابة على القاموس الحالي. هل أنت متأكد من أنك تريد المتابعة؟", "confirmButton": { "text": "تأكيد", "label": "انقر لتأكيد" }, "cancelButton": { "text": "إلغاء", "label": "انقر لإلغاء" } } }, "ru": { "deleteButton": { "text": "Удалить словарь", "label": "Нажмите, чтобы удалить словарь" }, "resetButton": { "text": "Сбросить все изменения", "label": "Нажмите, чтобы сбросить все изменения" }, "saveButton": { "text": "Сохранить изменения", "label": "Нажмите, чтобы сохранить изменения" }, "publishButton": { "text": "Опубликовать словарь", "label": "Нажмите, чтобы опубликовать словарь" }, "downloadButton": { "text": "Скачать", "label": "Нажмите, чтобы скачать" }, "confirmation": { "title": "Подтверждение", "message": "Это перезапишет существующий словарь. Вы уверены, что хотите продолжить?", "confirmButton": { "text": "Подтвердить", "label": "Нажмите, чтобы подтвердить" }, "cancelButton": { "text": "Отмена", "label": "Нажмите, чтобы отменить" } } } } };
|
|
47948
|
+
const localIds$e = ["save-dictionary-details::local::../@intlayer/design-system/src/components/DictionaryFieldEditor/SaveForm/saveForm.content.tsx"];
|
|
47306
47949
|
const _T0SfS5x6SHrzZMCwRUVc = {
|
|
47307
|
-
key: key$
|
|
47308
|
-
content: content$
|
|
47309
|
-
localIds: localIds$
|
|
47950
|
+
key: key$e,
|
|
47951
|
+
content: content$e,
|
|
47952
|
+
localIds: localIds$e
|
|
47310
47953
|
};
|
|
47311
47954
|
const SaveForm = ({
|
|
47312
47955
|
dictionary,
|
|
@@ -47865,6 +48508,13 @@ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
|
47865
48508
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
47866
48509
|
const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
47867
48510
|
$ZodType.init(inst, def);
|
|
48511
|
+
Object.assign(inst["~standard"], {
|
|
48512
|
+
jsonSchema: {
|
|
48513
|
+
input: createStandardJSONSchemaMethod(inst, "input"),
|
|
48514
|
+
output: createStandardJSONSchemaMethod(inst, "output")
|
|
48515
|
+
}
|
|
48516
|
+
});
|
|
48517
|
+
inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
|
|
47868
48518
|
inst.def = def;
|
|
47869
48519
|
inst.type = def.type;
|
|
47870
48520
|
Object.defineProperty(inst, "_def", { value: def });
|
|
@@ -47937,6 +48587,7 @@ const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
47937
48587
|
const _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
|
|
47938
48588
|
$ZodString.init(inst, def);
|
|
47939
48589
|
ZodType.init(inst, def);
|
|
48590
|
+
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json);
|
|
47940
48591
|
const bag = inst._zod.bag;
|
|
47941
48592
|
inst.format = bag.format ?? null;
|
|
47942
48593
|
inst.minLength = bag.minimum ?? null;
|
|
@@ -48074,6 +48725,7 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
|
|
|
48074
48725
|
const ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
|
|
48075
48726
|
$ZodUnknown.init(inst, def);
|
|
48076
48727
|
ZodType.init(inst, def);
|
|
48728
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor();
|
|
48077
48729
|
});
|
|
48078
48730
|
function unknown() {
|
|
48079
48731
|
return _unknown(ZodUnknown);
|
|
@@ -48081,6 +48733,7 @@ function unknown() {
|
|
|
48081
48733
|
const ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
|
|
48082
48734
|
$ZodNever.init(inst, def);
|
|
48083
48735
|
ZodType.init(inst, def);
|
|
48736
|
+
inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json);
|
|
48084
48737
|
});
|
|
48085
48738
|
function never(params) {
|
|
48086
48739
|
return _never(ZodNever, params);
|
|
@@ -48088,6 +48741,7 @@ function never(params) {
|
|
|
48088
48741
|
const ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
|
|
48089
48742
|
$ZodArray.init(inst, def);
|
|
48090
48743
|
ZodType.init(inst, def);
|
|
48744
|
+
inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
|
|
48091
48745
|
inst.element = def.element;
|
|
48092
48746
|
inst.min = (minLength, params) => inst.check(_minLength(minLength, params));
|
|
48093
48747
|
inst.nonempty = (params) => inst.check(_minLength(1, params));
|
|
@@ -48101,6 +48755,7 @@ function array(element, params) {
|
|
|
48101
48755
|
const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
48102
48756
|
$ZodObjectJIT.init(inst, def);
|
|
48103
48757
|
ZodType.init(inst, def);
|
|
48758
|
+
inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
|
|
48104
48759
|
defineLazy(inst, "shape", () => {
|
|
48105
48760
|
return def.shape;
|
|
48106
48761
|
});
|
|
@@ -48133,6 +48788,7 @@ function object(shape, params) {
|
|
|
48133
48788
|
const ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
48134
48789
|
$ZodUnion.init(inst, def);
|
|
48135
48790
|
ZodType.init(inst, def);
|
|
48791
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
48136
48792
|
inst.options = def.options;
|
|
48137
48793
|
});
|
|
48138
48794
|
function union(options, params) {
|
|
@@ -48145,6 +48801,7 @@ function union(options, params) {
|
|
|
48145
48801
|
const ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
48146
48802
|
$ZodIntersection.init(inst, def);
|
|
48147
48803
|
ZodType.init(inst, def);
|
|
48804
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
48148
48805
|
});
|
|
48149
48806
|
function intersection(left, right) {
|
|
48150
48807
|
return new ZodIntersection({
|
|
@@ -48156,6 +48813,7 @@ function intersection(left, right) {
|
|
|
48156
48813
|
const ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
|
|
48157
48814
|
$ZodEnum.init(inst, def);
|
|
48158
48815
|
ZodType.init(inst, def);
|
|
48816
|
+
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json);
|
|
48159
48817
|
inst.enum = def.entries;
|
|
48160
48818
|
inst.options = Object.values(def.entries);
|
|
48161
48819
|
const keys = new Set(Object.keys(def.entries));
|
|
@@ -48201,6 +48859,7 @@ function _enum(values, params) {
|
|
|
48201
48859
|
const ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
|
|
48202
48860
|
$ZodTransform.init(inst, def);
|
|
48203
48861
|
ZodType.init(inst, def);
|
|
48862
|
+
inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx);
|
|
48204
48863
|
inst._zod.parse = (payload, _ctx) => {
|
|
48205
48864
|
if (_ctx.direction === "backward") {
|
|
48206
48865
|
throw new $ZodEncodeError(inst.constructor.name);
|
|
@@ -48238,6 +48897,7 @@ function transform(fn) {
|
|
|
48238
48897
|
const ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
|
|
48239
48898
|
$ZodOptional.init(inst, def);
|
|
48240
48899
|
ZodType.init(inst, def);
|
|
48900
|
+
inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
|
|
48241
48901
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48242
48902
|
});
|
|
48243
48903
|
function optional(innerType) {
|
|
@@ -48249,6 +48909,7 @@ function optional(innerType) {
|
|
|
48249
48909
|
const ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
|
|
48250
48910
|
$ZodNullable.init(inst, def);
|
|
48251
48911
|
ZodType.init(inst, def);
|
|
48912
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
|
|
48252
48913
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48253
48914
|
});
|
|
48254
48915
|
function nullable(innerType) {
|
|
@@ -48260,6 +48921,7 @@ function nullable(innerType) {
|
|
|
48260
48921
|
const ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
|
|
48261
48922
|
$ZodDefault.init(inst, def);
|
|
48262
48923
|
ZodType.init(inst, def);
|
|
48924
|
+
inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
|
|
48263
48925
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48264
48926
|
inst.removeDefault = inst.unwrap;
|
|
48265
48927
|
});
|
|
@@ -48275,6 +48937,7 @@ function _default(innerType, defaultValue) {
|
|
|
48275
48937
|
const ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
|
|
48276
48938
|
$ZodPrefault.init(inst, def);
|
|
48277
48939
|
ZodType.init(inst, def);
|
|
48940
|
+
inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
|
|
48278
48941
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48279
48942
|
});
|
|
48280
48943
|
function prefault(innerType, defaultValue) {
|
|
@@ -48289,6 +48952,7 @@ function prefault(innerType, defaultValue) {
|
|
|
48289
48952
|
const ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
|
|
48290
48953
|
$ZodNonOptional.init(inst, def);
|
|
48291
48954
|
ZodType.init(inst, def);
|
|
48955
|
+
inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
|
|
48292
48956
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48293
48957
|
});
|
|
48294
48958
|
function nonoptional(innerType, params) {
|
|
@@ -48301,6 +48965,7 @@ function nonoptional(innerType, params) {
|
|
|
48301
48965
|
const ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
|
|
48302
48966
|
$ZodCatch.init(inst, def);
|
|
48303
48967
|
ZodType.init(inst, def);
|
|
48968
|
+
inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
|
|
48304
48969
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48305
48970
|
inst.removeCatch = inst.unwrap;
|
|
48306
48971
|
});
|
|
@@ -48314,6 +48979,7 @@ function _catch(innerType, catchValue) {
|
|
|
48314
48979
|
const ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
|
|
48315
48980
|
$ZodPipe.init(inst, def);
|
|
48316
48981
|
ZodType.init(inst, def);
|
|
48982
|
+
inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
|
|
48317
48983
|
inst.in = def.in;
|
|
48318
48984
|
inst.out = def.out;
|
|
48319
48985
|
});
|
|
@@ -48328,6 +48994,7 @@ function pipe(in_, out) {
|
|
|
48328
48994
|
const ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
|
|
48329
48995
|
$ZodReadonly.init(inst, def);
|
|
48330
48996
|
ZodType.init(inst, def);
|
|
48997
|
+
inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
|
|
48331
48998
|
inst.unwrap = () => inst._zod.def.innerType;
|
|
48332
48999
|
});
|
|
48333
49000
|
function readonly(innerType) {
|
|
@@ -48339,6 +49006,7 @@ function readonly(innerType) {
|
|
|
48339
49006
|
const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
|
|
48340
49007
|
$ZodCustom.init(inst, def);
|
|
48341
49008
|
ZodType.init(inst, def);
|
|
49009
|
+
inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx);
|
|
48342
49010
|
});
|
|
48343
49011
|
function refine(fn, _params = {}) {
|
|
48344
49012
|
return _refine(ZodCustom, fn, _params);
|
|
@@ -48354,7 +49022,11 @@ const DropDown = ({ children, className, identifier, ...props }) => /* @__PURE__
|
|
|
48354
49022
|
children
|
|
48355
49023
|
});
|
|
48356
49024
|
const Trigger = ({ children, identifier, className, label, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
48357
|
-
className: cn$2(
|
|
49025
|
+
className: cn$2([
|
|
49026
|
+
"w-full cursor-pointer",
|
|
49027
|
+
"group-focus-within/dropdown:bg-current/20 group-focus-within/dropdown:ring-4",
|
|
49028
|
+
className
|
|
49029
|
+
]),
|
|
48358
49030
|
label: label ?? `Open panel ${identifier}`,
|
|
48359
49031
|
"aria-haspopup": "true",
|
|
48360
49032
|
"aria-controls": `dropdown-panel-${identifier}`,
|
|
@@ -48372,7 +49044,7 @@ let DropDownAlign = /* @__PURE__ */ (function(DropDownAlign$1) {
|
|
|
48372
49044
|
return DropDownAlign$1;
|
|
48373
49045
|
})({});
|
|
48374
49046
|
const Panel = ({ children, isHidden: isHidden2 = void 0, isOverable = false, isFocusable = false, align = DropDownAlign.START, identifier, className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
48375
|
-
className: cn$2("absolute top-[calc(100%+0.5rem)] z-
|
|
49047
|
+
className: cn$2("absolute top-[calc(100%+0.5rem)] z-100 min-w-full", align === DropDownAlign.START && "left-0", align === DropDownAlign.END && "right-0", className),
|
|
48376
49048
|
"aria-hidden": isHidden2,
|
|
48377
49049
|
role: "region",
|
|
48378
49050
|
"aria-labelledby": `dropdown-trigger-${identifier}`,
|
|
@@ -48449,13 +49121,13 @@ const LocaleSwitcherContentProvider = ({ availableLocales, defaultSelectedLocale
|
|
|
48449
49121
|
children
|
|
48450
49122
|
});
|
|
48451
49123
|
};
|
|
48452
|
-
const key$
|
|
48453
|
-
const content$
|
|
48454
|
-
const localIds$
|
|
49124
|
+
const key$d = "locale-switcher-content";
|
|
49125
|
+
const content$d = { "nodeType": "translation", "translation": { "en": { "localeSwitcherLabel": "Language switcher", "languageListLabel": "Language list", "switchTo": "Switch to", "searchInput": { "text": "Search Locale", "placeholder": "Search a locale", "ariaLabel": "Language search" }, "seeAllLocalesSwitch": { "true": "See all locales", "false": "See only selected locales" } }, "en-GB": { "localeSwitcherLabel": "Language switcher", "languageListLabel": "Language list", "switchTo": "Switch to", "searchInput": { "text": "Search Locale", "placeholder": "Search a locale", "ariaLabel": "Language search" }, "seeAllLocalesSwitch": { "true": "See all locales", "false": "See only selected locales" } }, "fr": { "localeSwitcherLabel": "Changer de langue", "languageListLabel": "Liste des langues", "switchTo": "Passer à", "searchInput": { "text": "Rechercher la locale", "placeholder": "Rechercher une locale", "ariaLabel": "Recherche de langue" }, "seeAllLocalesSwitch": { "true": "Voir toutes les langues", "false": "Voir seulement les langues sélectionnées" } }, "es": { "localeSwitcherLabel": "Cambiar idioma", "languageListLabel": "Lista de idiomas", "switchTo": "Cambiar a", "searchInput": { "text": "Buscar idioma", "placeholder": "Buscar un idioma", "ariaLabel": "Búsqueda de idioma" }, "seeAllLocalesSwitch": { "true": "Ver todos los idiomas", "false": "Ver solo los idiomas seleccionados" } }, "de": { "localeSwitcherLabel": "Sprachwechsler", "languageListLabel": "Sprachliste", "switchTo": "Wechseln Sie zu", "searchInput": { "text": "Sprache durchsuchen", "placeholder": "Sprache suchen", "ariaLabel": "Sprachsuche" }, "seeAllLocalesSwitch": { "true": "Alle Sprachen anzeigen", "false": "Nur ausgewählte Sprachen anzeigen" } }, "ja": { "localeSwitcherLabel": "言語スイッチャー", "languageListLabel": "言語リスト", "switchTo": "に切り替える", "searchInput": { "text": "ロケールを検索", "placeholder": "ロケールを検索", "ariaLabel": "言語検索" }, "seeAllLocalesSwitch": { "true": "すべての言語を表示", "false": "選択された言語のみを表示" } }, "ko": { "localeSwitcherLabel": "언어 스위치", "languageListLabel": "언어 목록", "switchTo": "전환", "searchInput": { "text": "언어 검색", "placeholder": "언어 검색", "ariaLabel": "언어 검색" }, "seeAllLocalesSwitch": { "true": "모든 언어 보기", "false": "선택한 언어만 보기" } }, "zh": { "localeSwitcherLabel": "语言切换器", "languageListLabel": "语言列表", "switchTo": "切换到", "searchInput": { "text": "搜索语言", "placeholder": "搜索语言", "ariaLabel": "语言搜索" }, "seeAllLocalesSwitch": { "true": "查看所有语言", "false": "仅查看选定的语言" } }, "it": { "localeSwitcherLabel": "Cambia lingua", "languageListLabel": "Elenco lingue", "switchTo": "Passa a", "searchInput": { "text": "Cerca lingua", "placeholder": "Cerca una lingua", "ariaLabel": "Ricerca lingua" }, "seeAllLocalesSwitch": { "true": "Vedi tutte le lingue", "false": "Vedi solo le lingue selezionate" } }, "pt": { "localeSwitcherLabel": "Mudar idioma", "languageListLabel": "Lista de idiomas", "switchTo": "Mudar para", "searchInput": { "text": "Pesquisar idioma", "placeholder": "Pesquisar um idioma", "ariaLabel": "Pesquisa de idioma" }, "seeAllLocalesSwitch": { "true": "Ver todos os idiomas", "false": "Ver apenas os idiomas selecionados" } }, "hi": { "localeSwitcherLabel": "भाषा स्विचर", "languageListLabel": "भाषा सूची", "switchTo": "स्विच करें", "searchInput": { "text": "भाषा खोजें", "placeholder": "भाषा खोजें", "ariaLabel": "भाषा खोजें" }, "seeAllLocalesSwitch": { "true": "सभी भाषाओं को देखें", "false": "केवल चुने गए भाषाओं को देखें" } }, "ar": { "localeSwitcherLabel": "مبدل اللغة", "languageListLabel": "قائمة اللغات", "switchTo": "التبديل إلى", "searchInput": { "text": "بحث اللغة", "placeholder": "بحث اللغة", "ariaLabel": "بحث اللغة" }, "seeAllLocalesSwitch": { "true": "عرض جميع اللغات", "false": "عرض اللغات المحددة فقط" } }, "ru": { "localeSwitcherLabel": "Переключатель языка", "languageListLabel": "Список языков", "switchTo": "Переключиться на", "searchInput": { "text": "Поиск языка", "placeholder": "Поиск языка", "ariaLabel": "Поиск языка" }, "seeAllLocalesSwitch": { "true": "Показать все языки", "false": "Показать только выбранные языки" } } } };
|
|
49126
|
+
const localIds$d = ["locale-switcher-content::local::../@intlayer/design-system/src/components/LocaleSwitcherContentDropDown/localeSwitcher.content.ts"];
|
|
48455
49127
|
const _zmGqpnLlhuhC3amqT2id = {
|
|
48456
|
-
key: key$
|
|
48457
|
-
content: content$
|
|
48458
|
-
localIds: localIds$
|
|
49128
|
+
key: key$d,
|
|
49129
|
+
content: content$d,
|
|
49130
|
+
localIds: localIds$d
|
|
48459
49131
|
};
|
|
48460
49132
|
function isArray(value) {
|
|
48461
49133
|
return !Array.isArray ? getTag$1(value) === "[object Array]" : Array.isArray(value);
|
|
@@ -49948,13 +50620,13 @@ const LocaleSwitcherContent = ({
|
|
|
49948
50620
|
})
|
|
49949
50621
|
});
|
|
49950
50622
|
};
|
|
49951
|
-
const key$
|
|
49952
|
-
const content$
|
|
49953
|
-
const localIds$
|
|
50623
|
+
const key$c = "expand-collapse";
|
|
50624
|
+
const content$c = { "nodeType": "translation", "translation": { "en": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Show all", "false": "Show less" } } }, "en-GB": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Show all", "false": "Show less" } } }, "fr": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Afficher tout", "false": "Afficher moins" } } }, "es": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Mostrar todo", "false": "Mostrar menos" } } }, "de": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Mehr anzeigen", "false": "Weniger anzeigen" } } }, "ja": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "すべて表示", "false": "表示を減らす" } } }, "ko": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "모두 보기", "false": "간략히 보기" } } }, "zh": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "显示全部", "false": "显示较少" } } }, "it": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Mostra tutto", "false": "Mostra meno" } } }, "pt": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Mostrar tudo", "false": "Mostrar menos" } } }, "hi": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "सभी दिखाएँ", "false": "कम दिखाएँ" } } }, "ar": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "عرض الكل", "false": "عرض أقل" } } }, "ru": { "expandCollapseContent": { "nodeType": "condition", "condition": { "true": "Показать все", "false": "Показать меньше" } } } } };
|
|
50625
|
+
const localIds$c = ["expand-collapse::local::../@intlayer/design-system/src/components/ExpandCollapse/expandCollapse.content.ts"];
|
|
49954
50626
|
const _45YmjbWLtB85OKkfb0rA = {
|
|
49955
|
-
key: key$
|
|
49956
|
-
content: content$
|
|
49957
|
-
localIds: localIds$
|
|
50627
|
+
key: key$c,
|
|
50628
|
+
content: content$c,
|
|
50629
|
+
localIds: localIds$c
|
|
49958
50630
|
};
|
|
49959
50631
|
const DEFAULT_MIN_HEIGHT = 700;
|
|
49960
50632
|
const ExpandCollapse = ({
|
|
@@ -50005,7 +50677,7 @@ const CodeDefault = ({ children }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div
|
|
|
50005
50677
|
}, `line-${index2}-${line.slice(0, 10)}`)) })
|
|
50006
50678
|
})
|
|
50007
50679
|
});
|
|
50008
|
-
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-
|
|
50680
|
+
const CodeBlockShiki = reactExports.lazy(() => __vitePreload(() => import("./CodeBlockShiki-Cf2gZa5F.js"), true ? [] : void 0).then((mod) => ({ default: mod.CodeBlockShiki })));
|
|
50009
50681
|
const CodeBlock = ({ className, onChange, isEditable, children, lang, isDarkMode, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
50010
50682
|
className: cn$2("flex w-full min-w-0 max-w-full overflow-x-auto", className),
|
|
50011
50683
|
...props,
|
|
@@ -50035,23 +50707,21 @@ const PopoverStatic = ({ children, className, identifier, ...props }) => /* @__P
|
|
|
50035
50707
|
...props,
|
|
50036
50708
|
children
|
|
50037
50709
|
});
|
|
50038
|
-
const Detail =
|
|
50039
|
-
ref,
|
|
50710
|
+
const Detail$1 = ({ children, isHidden: isHidden2 = void 0, isOverable = true, isFocusable = false, xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, identifier, className, displayArrow = true, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Container, {
|
|
50040
50711
|
transparency: "sm",
|
|
50041
50712
|
role: "group",
|
|
50042
50713
|
"aria-hidden": isHidden2,
|
|
50043
50714
|
"aria-labelledby": `unrollable-panel-button-${identifier}`,
|
|
50044
50715
|
id: `unrollable-panel-${identifier}`,
|
|
50045
|
-
className: cn$2("absolute z-
|
|
50716
|
+
className: cn$2("absolute z-50 min-w-full rounded-md ring-1 ring-neutral", xAlign === "start" && "left-0", xAlign === "end" && "right-0", yAlign === "bellow" && "top-[calc(100%+1rem)]", yAlign === "above" && "bottom-[calc(100%+1rem)]", displayArrow && 'before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]', displayArrow && xAlign === "start" && "before:left-2", displayArrow && xAlign === "end" && "before:right-2", displayArrow && yAlign === "bellow" && "before:-top-[10px] before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent", displayArrow && yAlign === "above" && "before:-bottom-[10px] before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent", "overflow-x-visible opacity-0 transition-all duration-400 ease-in-out", isHidden2 !== false ? "invisible" : "visible opacity-100 delay-800", isOverable && "group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800", isFocusable && "group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800", className),
|
|
50046
50717
|
...props,
|
|
50047
50718
|
children
|
|
50048
|
-
})
|
|
50049
|
-
Detail
|
|
50050
|
-
PopoverStatic.Detail = Detail;
|
|
50719
|
+
});
|
|
50720
|
+
PopoverStatic.Detail = Detail$1;
|
|
50051
50721
|
const PopoverComponent = (props) => {
|
|
50052
50722
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverStatic, { ...props });
|
|
50053
50723
|
};
|
|
50054
|
-
const Detail
|
|
50724
|
+
const Detail = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW, ...props }) => {
|
|
50055
50725
|
const popoverRef = reactExports.useRef(null);
|
|
50056
50726
|
const [computedXAlign, setComputedXAlign] = reactExports.useState(xAlign);
|
|
50057
50727
|
const [computedYAlign, setComputedYAlign] = reactExports.useState(yAlign);
|
|
@@ -50128,7 +50798,7 @@ const Detail$1 = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW,
|
|
|
50128
50798
|
xAlign,
|
|
50129
50799
|
yAlign
|
|
50130
50800
|
]);
|
|
50131
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(Detail, {
|
|
50801
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Detail$1, {
|
|
50132
50802
|
...props,
|
|
50133
50803
|
xAlign: computedXAlign,
|
|
50134
50804
|
yAlign: computedYAlign,
|
|
@@ -50140,7 +50810,7 @@ const Detail$1 = ({ xAlign = PopoverXAlign.START, yAlign = PopoverYAlign.BELOW,
|
|
|
50140
50810
|
});
|
|
50141
50811
|
};
|
|
50142
50812
|
const Popover = PopoverComponent;
|
|
50143
|
-
Popover.Detail = Detail
|
|
50813
|
+
Popover.Detail = Detail;
|
|
50144
50814
|
const CodeContext = reactExports.createContext({
|
|
50145
50815
|
packageManager: "npm",
|
|
50146
50816
|
setPackageManager: () => {
|
|
@@ -50180,8 +50850,23 @@ const CodeConditionalRender = ({ children, ...props }) => {
|
|
|
50180
50850
|
if ((isPackageManagerUndefined || isPackageManagerSelected) && (isCodeFormatUndefined || isCodeFormatSelected) && (isContentDeclarationFormatUndefined || isContentDeclarationFormatSelected)) return children;
|
|
50181
50851
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
50182
50852
|
};
|
|
50853
|
+
const key$b = "code-selectors";
|
|
50854
|
+
const content$b = { "nodeType": "translation", "translation": { "en": { "packageManager": { "label": "Select package manager" }, "codeFormat": { "label": "Select code format" }, "contentDeclarationFormat": { "label": "Select dictionary format" } }, "en-GB": { "packageManager": { "label": "Select package manager" }, "codeFormat": { "label": "Select code format" }, "contentDeclarationFormat": { "label": "Select dictionary format" } }, "fr": { "packageManager": { "label": "Sélectionner le gestionnaire de paquets" }, "codeFormat": { "label": "Sélectionner le format de code" }, "contentDeclarationFormat": { "label": "Sélectionner le format de dictionnaire" } }, "es": { "packageManager": { "label": "Seleccionar gestor de paquetes" }, "codeFormat": { "label": "Seleccionar formato de código" }, "contentDeclarationFormat": { "label": "Seleccionar formato de diccionario" } }, "de": { "packageManager": { "label": "Paketmanager auswählen" }, "codeFormat": { "label": "Code-Format auswählen" }, "contentDeclarationFormat": { "label": "Wörterbuchformat auswählen" } }, "ja": { "packageManager": { "label": "パッケージマネージャーを選択" }, "codeFormat": { "label": "コード形式を選択" }, "contentDeclarationFormat": { "label": "辞書形式を選択" } }, "ko": { "packageManager": { "label": "패키지 관리자 선택" }, "codeFormat": { "label": "코드 형식 선택" }, "contentDeclarationFormat": { "label": "사전 형식 선택" } }, "zh": { "packageManager": { "label": "选择包管理器" }, "codeFormat": { "label": "选择代码格式" }, "contentDeclarationFormat": { "label": "选择字典格式" } }, "it": { "packageManager": { "label": "Seleziona il gestore dei pacchetti" }, "codeFormat": { "label": "Seleziona il formato del codice" }, "contentDeclarationFormat": { "label": "Seleziona il formato del dizionario" } }, "pt": { "packageManager": { "label": "Selecionar gerenciador de pacotes" }, "codeFormat": { "label": "Selecionar formato de código" }, "contentDeclarationFormat": { "label": "Selecionar formato de dicionário" } }, "hi": { "packageManager": { "label": "पैकेज प्रबंधक चुनें" }, "codeFormat": { "label": "कोड प्रारूप चुनें" }, "contentDeclarationFormat": { "label": "शब्दकोश प्रारूप चुनें" } }, "ar": { "packageManager": { "label": "اختر مدير الحزم" }, "codeFormat": { "label": "اختر تنسيق الكود" }, "contentDeclarationFormat": { "label": "اختر تنسيق القاموس" } }, "ru": { "packageManager": { "label": "Выбрать менеджер пакетов" }, "codeFormat": { "label": "Выбрать формат кода" }, "contentDeclarationFormat": { "label": "Выбрать формат словаря" } } } };
|
|
50855
|
+
const localIds$b = ["code-selectors::local::../@intlayer/design-system/src/components/IDE/selectors.content.ts"];
|
|
50856
|
+
const _VaxfTMdlIxLlHVFaeieC = {
|
|
50857
|
+
key: key$b,
|
|
50858
|
+
content: content$b,
|
|
50859
|
+
localIds: localIds$b
|
|
50860
|
+
};
|
|
50183
50861
|
const CodeFormatSelector = () => {
|
|
50184
|
-
const {
|
|
50862
|
+
const {
|
|
50863
|
+
codeFormat,
|
|
50864
|
+
setCodeFormat,
|
|
50865
|
+
setContentDeclarationFormat
|
|
50866
|
+
} = useCodeContext();
|
|
50867
|
+
const {
|
|
50868
|
+
codeFormat: codeFormatContent
|
|
50869
|
+
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
50185
50870
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
50186
50871
|
value: codeFormat,
|
|
50187
50872
|
onValueChange: (value) => {
|
|
@@ -50190,49 +50875,56 @@ const CodeFormatSelector = () => {
|
|
|
50190
50875
|
},
|
|
50191
50876
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
50192
50877
|
className: "py-1",
|
|
50193
|
-
|
|
50194
|
-
|
|
50195
|
-
|
|
50878
|
+
"aria-label": codeFormatContent.label,
|
|
50879
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
50880
|
+
placeholder: "Code Format"
|
|
50881
|
+
})
|
|
50882
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
50883
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50196
50884
|
value: "typescript",
|
|
50197
50885
|
children: "TypeScript"
|
|
50198
|
-
}),
|
|
50199
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50886
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50200
50887
|
value: "esm",
|
|
50201
50888
|
children: "ESM"
|
|
50202
|
-
}),
|
|
50203
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50889
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50204
50890
|
value: "commonjs",
|
|
50205
50891
|
children: "CommonJS"
|
|
50206
|
-
})
|
|
50207
|
-
|
|
50892
|
+
})]
|
|
50893
|
+
})]
|
|
50208
50894
|
});
|
|
50209
50895
|
};
|
|
50210
50896
|
const ContentDeclarationFormatSelector = () => {
|
|
50211
|
-
const {
|
|
50897
|
+
const {
|
|
50898
|
+
contentDeclarationFormat,
|
|
50899
|
+
setContentDeclarationFormat
|
|
50900
|
+
} = useCodeContext();
|
|
50901
|
+
const {
|
|
50902
|
+
contentDeclarationFormat: contentDeclarationFormatContent
|
|
50903
|
+
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
50212
50904
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
50213
50905
|
value: contentDeclarationFormat,
|
|
50214
50906
|
onValueChange: setContentDeclarationFormat,
|
|
50215
50907
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
50216
50908
|
className: "py-1",
|
|
50217
|
-
|
|
50218
|
-
|
|
50219
|
-
|
|
50909
|
+
"aria-label": contentDeclarationFormatContent.label,
|
|
50910
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
50911
|
+
placeholder: "Dictionary Format"
|
|
50912
|
+
})
|
|
50913
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
50914
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50220
50915
|
value: "typescript",
|
|
50221
50916
|
children: "TypeScript"
|
|
50222
|
-
}),
|
|
50223
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50917
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50224
50918
|
value: "commonjs",
|
|
50225
50919
|
children: "CommonJS"
|
|
50226
|
-
}),
|
|
50227
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50920
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50228
50921
|
value: "esm",
|
|
50229
50922
|
children: "ESM"
|
|
50230
|
-
}),
|
|
50231
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50923
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50232
50924
|
value: "json",
|
|
50233
50925
|
children: "JSON"
|
|
50234
|
-
})
|
|
50235
|
-
|
|
50926
|
+
})]
|
|
50927
|
+
})]
|
|
50236
50928
|
});
|
|
50237
50929
|
};
|
|
50238
50930
|
const key$a = "code";
|
|
@@ -50268,31 +50960,37 @@ const CopyCode = ({
|
|
|
50268
50960
|
});
|
|
50269
50961
|
};
|
|
50270
50962
|
const PackageManagerSelector = () => {
|
|
50271
|
-
const {
|
|
50963
|
+
const {
|
|
50964
|
+
packageManager,
|
|
50965
|
+
setPackageManager
|
|
50966
|
+
} = useCodeContext();
|
|
50967
|
+
const {
|
|
50968
|
+
packageManager: packageManagerContent
|
|
50969
|
+
} = useDictionary(_VaxfTMdlIxLlHVFaeieC);
|
|
50272
50970
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(Select, {
|
|
50273
50971
|
value: packageManager,
|
|
50274
50972
|
onValueChange: setPackageManager,
|
|
50275
50973
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Trigger, {
|
|
50276
50974
|
className: "py-1",
|
|
50277
|
-
|
|
50278
|
-
|
|
50279
|
-
|
|
50975
|
+
"aria-label": packageManagerContent.label,
|
|
50976
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Value, {
|
|
50977
|
+
placeholder: "Package Manager"
|
|
50978
|
+
})
|
|
50979
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsxs(Select.Content, {
|
|
50980
|
+
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50280
50981
|
value: "npm",
|
|
50281
50982
|
children: "npm"
|
|
50282
|
-
}),
|
|
50283
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50983
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50284
50984
|
value: "pnpm",
|
|
50285
50985
|
children: "pnpm"
|
|
50286
|
-
}),
|
|
50287
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50986
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50288
50987
|
value: "yarn",
|
|
50289
50988
|
children: "yarn"
|
|
50290
|
-
}),
|
|
50291
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50989
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Select.Item, {
|
|
50292
50990
|
value: "bun",
|
|
50293
50991
|
children: "bun"
|
|
50294
|
-
})
|
|
50295
|
-
|
|
50992
|
+
})]
|
|
50993
|
+
})]
|
|
50296
50994
|
});
|
|
50297
50995
|
};
|
|
50298
50996
|
const MIN_HEIGHT = 700;
|
|
@@ -52217,7 +52915,7 @@ const renameKey = (obj, oldKey, newKey) => {
|
|
|
52217
52915
|
} else newObj[key2] = obj[key2];
|
|
52218
52916
|
return newObj;
|
|
52219
52917
|
};
|
|
52220
|
-
const ContentEditorInput = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
52918
|
+
const ContentEditorInput$1 = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
52221
52919
|
const [newValue, setNewValue] = reactExports.useState(children);
|
|
52222
52920
|
const [resetIncrementor, setResetIncrementor] = reactExports.useState(0);
|
|
52223
52921
|
const isEdited = newValue !== children;
|
|
@@ -52307,7 +53005,7 @@ const useUser = () => {
|
|
|
52307
53005
|
logout: logoutHandle
|
|
52308
53006
|
};
|
|
52309
53007
|
};
|
|
52310
|
-
const ContentEditorTextArea = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
53008
|
+
const ContentEditorTextArea$1 = ({ children, onContentChange, disabled, validate, additionalButtons, ...props }) => {
|
|
52311
53009
|
const { isAuthenticated } = useUser();
|
|
52312
53010
|
const [newValue, setNewValue] = reactExports.useState(children);
|
|
52313
53011
|
const [resetIncrementor, setResetIncrementor] = reactExports.useState(0);
|
|
@@ -52454,7 +53152,7 @@ const EnumKeyInput = ({ value, onChange }) => {
|
|
|
52454
53152
|
})]
|
|
52455
53153
|
});
|
|
52456
53154
|
};
|
|
52457
|
-
const ContentEditorTextArea
|
|
53155
|
+
const ContentEditorTextArea = ({
|
|
52458
53156
|
keyPath,
|
|
52459
53157
|
dictionary,
|
|
52460
53158
|
...props
|
|
@@ -52468,7 +53166,7 @@ const ContentEditorTextArea$1 = ({
|
|
|
52468
53166
|
mutate: auditContentDeclarationField,
|
|
52469
53167
|
isPending: isAuditing
|
|
52470
53168
|
} = useAuditContentDeclarationField();
|
|
52471
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorTextArea, {
|
|
53169
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorTextArea$1, {
|
|
52472
53170
|
variant: InputVariant.DEFAULT,
|
|
52473
53171
|
onContentChange: (newValue) => addEditedContent(dictionary.localId, newValue, keyPath),
|
|
52474
53172
|
additionalButtons: /* @__PURE__ */ jsxRuntimeExports.jsx(Button, {
|
|
@@ -52508,7 +53206,7 @@ const ContentEditorTextArea$1 = ({
|
|
|
52508
53206
|
...props
|
|
52509
53207
|
});
|
|
52510
53208
|
};
|
|
52511
|
-
const ContentEditorInput
|
|
53209
|
+
const ContentEditorInput = ({
|
|
52512
53210
|
keyPath,
|
|
52513
53211
|
dictionary,
|
|
52514
53212
|
...props
|
|
@@ -52516,7 +53214,7 @@ const ContentEditorInput$1 = ({
|
|
|
52516
53214
|
const {
|
|
52517
53215
|
addEditedContent
|
|
52518
53216
|
} = useEditedContent();
|
|
52519
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
53217
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput$1, {
|
|
52520
53218
|
variant: InputVariant.DEFAULT,
|
|
52521
53219
|
onContentChange: (newValue) => addEditedContent(dictionary.localId, newValue, keyPath),
|
|
52522
53220
|
...props
|
|
@@ -52959,7 +53657,7 @@ const NestedTextEditor = ({
|
|
|
52959
53657
|
className: "flex w-full flex-col gap-4 p-2",
|
|
52960
53658
|
children: [/* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, {
|
|
52961
53659
|
children: "Dictionary key"
|
|
52962
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
53660
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput$1, {
|
|
52963
53661
|
"aria-label": "Edit field",
|
|
52964
53662
|
type: "text",
|
|
52965
53663
|
variant: InputVariant.DEFAULT,
|
|
@@ -52973,7 +53671,7 @@ const NestedTextEditor = ({
|
|
|
52973
53671
|
children: content2.dictionaryKey ?? ""
|
|
52974
53672
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(Label$1, {
|
|
52975
53673
|
children: "Path (optional)"
|
|
52976
|
-
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
53674
|
+
}), /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput$1, {
|
|
52977
53675
|
"aria-label": "Edit field",
|
|
52978
53676
|
type: "text",
|
|
52979
53677
|
variant: InputVariant.DEFAULT,
|
|
@@ -53069,7 +53767,7 @@ const TextEditor = ({
|
|
|
53069
53767
|
});
|
|
53070
53768
|
if (nodeType === NodeType.Number) return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
53071
53769
|
className: "w-full p-2",
|
|
53072
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput
|
|
53770
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorInput, {
|
|
53073
53771
|
dictionary,
|
|
53074
53772
|
keyPath,
|
|
53075
53773
|
type: "number",
|
|
@@ -53079,7 +53777,7 @@ const TextEditor = ({
|
|
|
53079
53777
|
});
|
|
53080
53778
|
if (nodeType === NodeType.Text) return /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
53081
53779
|
className: "w-full p-2",
|
|
53082
|
-
children: typeof renderSection === "function" ? renderSection(section) : /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorTextArea
|
|
53780
|
+
children: typeof renderSection === "function" ? renderSection(section) : /* @__PURE__ */ jsxRuntimeExports.jsx(ContentEditorTextArea, {
|
|
53083
53781
|
variant: InputVariant.DEFAULT,
|
|
53084
53782
|
"aria-label": "Edit field",
|
|
53085
53783
|
keyPath,
|
|
@@ -54676,9 +55374,7 @@ const DictionaryFieldEditor = ({
|
|
|
54676
55374
|
}), /* @__PURE__ */ jsxRuntimeExports.jsx(SwitchSelector, {
|
|
54677
55375
|
defaultValue: editorView,
|
|
54678
55376
|
onChange: (value) => setEditorView(value),
|
|
54679
|
-
color:
|
|
54680
|
-
size: SwitchSelectorSize.SM,
|
|
54681
|
-
className: "m-auto w-full max-w-xl",
|
|
55377
|
+
color: "text",
|
|
54682
55378
|
choices: [{
|
|
54683
55379
|
content: "Details",
|
|
54684
55380
|
value: EditorViewType.DetailsEditor
|
|
@@ -54716,17 +55412,6 @@ const DictionaryFieldEditor = ({
|
|
|
54716
55412
|
})
|
|
54717
55413
|
});
|
|
54718
55414
|
};
|
|
54719
|
-
const MaxWidthSmoother = ({ children, isHidden: isHidden2, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
54720
|
-
className: cn$2("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden2 ? "" : "grid-cols-[1fr]", className),
|
|
54721
|
-
"aria-hidden": isHidden2,
|
|
54722
|
-
...props,
|
|
54723
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
54724
|
-
style: { minWidth: `${minWidth}px` },
|
|
54725
|
-
tabIndex: isHidden2 !== false ? void 0 : -1,
|
|
54726
|
-
className: cn$2(align === "right" && "ml-auto"),
|
|
54727
|
-
children
|
|
54728
|
-
})
|
|
54729
|
-
});
|
|
54730
55415
|
const getBreakpointFromSize = (breakpoint) => {
|
|
54731
55416
|
switch (breakpoint) {
|
|
54732
55417
|
case "xs":
|
|
@@ -54790,6 +55475,17 @@ const useDevice = (breakpoint = "md") => {
|
|
|
54790
55475
|
}, [breakpoint]);
|
|
54791
55476
|
return result;
|
|
54792
55477
|
};
|
|
55478
|
+
const MaxWidthSmoother = ({ children, isHidden: isHidden2, minWidth = 0, align = "left", className, ...props }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
55479
|
+
className: cn$2("relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out", isHidden2 ? "" : "grid-cols-[1fr]", className),
|
|
55480
|
+
"aria-hidden": isHidden2,
|
|
55481
|
+
inert: isHidden2 ? true : void 0,
|
|
55482
|
+
...props,
|
|
55483
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", {
|
|
55484
|
+
style: { minWidth: `${minWidth}px` },
|
|
55485
|
+
className: cn$2(align === "right" && "ml-auto"),
|
|
55486
|
+
children
|
|
55487
|
+
})
|
|
55488
|
+
});
|
|
54793
55489
|
const useRightDrawerStore = create$1((set2, get2) => ({
|
|
54794
55490
|
drawers: {},
|
|
54795
55491
|
open: (key2) => set2((state) => ({ drawers: {
|
|
@@ -55011,14 +55707,14 @@ const containerVariants = cva("w-fit backdrop-blur", {
|
|
|
55011
55707
|
},
|
|
55012
55708
|
size: {
|
|
55013
55709
|
[`${TagSize.XS}`]: "border-[1.2px] px-2 py-0.5 text-xs",
|
|
55014
|
-
[`${TagSize.SM}`]: "border-[1.
|
|
55710
|
+
[`${TagSize.SM}`]: "border-[1.3px] px-2 py-0.5 text-sm",
|
|
55015
55711
|
[`${TagSize.MD}`]: "border-2 px-2 py-1 text-base",
|
|
55016
55712
|
[`${TagSize.LG}`]: "border-2 px-3 py-2 text-lg",
|
|
55017
55713
|
[`${TagSize.XL}`]: "border-2 px-3 py-2 text-xl"
|
|
55018
55714
|
},
|
|
55019
55715
|
border: {
|
|
55020
55716
|
[`${TagBorder.NONE}`]: "border-none",
|
|
55021
|
-
[`${TagBorder.WITH}`]: "border-[1.
|
|
55717
|
+
[`${TagBorder.WITH}`]: "border-[1.3px] border-text"
|
|
55022
55718
|
},
|
|
55023
55719
|
background: {
|
|
55024
55720
|
[`${TagBackground.NONE}`]: "bg-none",
|
|
@@ -55935,7 +56631,7 @@ const AppProvider = (t0) => {
|
|
|
55935
56631
|
children
|
|
55936
56632
|
} = t0;
|
|
55937
56633
|
let t1;
|
|
55938
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56634
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
55939
56635
|
t1 = /* @__PURE__ */ jsxRuntimeExports.jsx(Toaster, {});
|
|
55940
56636
|
$2[0] = t1;
|
|
55941
56637
|
} else {
|
|
@@ -56187,14 +56883,14 @@ const DictionaryEditionDrawerContent = (t0) => {
|
|
|
56187
56883
|
return t32;
|
|
56188
56884
|
}
|
|
56189
56885
|
let t3;
|
|
56190
|
-
if ($2[10] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56886
|
+
if ($2[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56191
56887
|
t3 = () => setEditionModalOpen(false);
|
|
56192
56888
|
$2[10] = t3;
|
|
56193
56889
|
} else {
|
|
56194
56890
|
t3 = $2[10];
|
|
56195
56891
|
}
|
|
56196
56892
|
let t4;
|
|
56197
|
-
if ($2[11] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56893
|
+
if ($2[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56198
56894
|
t4 = ["local", "remote"];
|
|
56199
56895
|
$2[11] = t4;
|
|
56200
56896
|
} else {
|
|
@@ -56212,7 +56908,7 @@ const DictionaryEditionDrawerContent = (t0) => {
|
|
|
56212
56908
|
t5 = $2[13];
|
|
56213
56909
|
}
|
|
56214
56910
|
let t6;
|
|
56215
|
-
if ($2[14] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56911
|
+
if ($2[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56216
56912
|
t6 = () => {
|
|
56217
56913
|
setEditionModalOpen(false);
|
|
56218
56914
|
};
|
|
@@ -56272,7 +56968,7 @@ const DictionaryEditionDrawerContent = (t0) => {
|
|
|
56272
56968
|
t10 = $2[25];
|
|
56273
56969
|
}
|
|
56274
56970
|
let t11;
|
|
56275
|
-
if ($2[26] === Symbol.for("react.memo_cache_sentinel")) {
|
|
56971
|
+
if ($2[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56276
56972
|
t11 = () => setEditionModalOpen(true);
|
|
56277
56973
|
$2[26] = t11;
|
|
56278
56974
|
} else {
|
|
@@ -56358,7 +57054,7 @@ const DictionaryEditionDrawerContent = (t0) => {
|
|
|
56358
57054
|
t17 = $2[41];
|
|
56359
57055
|
}
|
|
56360
57056
|
let t18;
|
|
56361
|
-
if ($2[42] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57057
|
+
if ($2[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56362
57058
|
t18 = ["local", "remote"];
|
|
56363
57059
|
$2[42] = t18;
|
|
56364
57060
|
} else {
|
|
@@ -56491,7 +57187,7 @@ const DictionaryEditionDrawerController = (t0) => {
|
|
|
56491
57187
|
const dictionaryKey = focusedContent?.dictionaryKey;
|
|
56492
57188
|
if (!dictionaryKey) {
|
|
56493
57189
|
let t12;
|
|
56494
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57190
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56495
57191
|
t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
|
|
56496
57192
|
$2[0] = t12;
|
|
56497
57193
|
} else {
|
|
@@ -56799,7 +57495,7 @@ const EditorLayout = (t0) => {
|
|
|
56799
57495
|
t2 = $2[3];
|
|
56800
57496
|
}
|
|
56801
57497
|
let t3;
|
|
56802
|
-
if ($2[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57498
|
+
if ($2[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56803
57499
|
t3 = /* @__PURE__ */ jsxRuntimeExports.jsx(DictionaryListDrawer, {});
|
|
56804
57500
|
$2[4] = t3;
|
|
56805
57501
|
} else {
|
|
@@ -56827,7 +57523,7 @@ const useIntlayerConfig = () => {
|
|
|
56827
57523
|
const [intlayerConfig, setIntlayerConfig] = reactExports.useState();
|
|
56828
57524
|
let t0;
|
|
56829
57525
|
let t1;
|
|
56830
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57526
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56831
57527
|
t0 = () => {
|
|
56832
57528
|
fetch("/api/config").then(_temp).then((data) => setIntlayerConfig(data.data));
|
|
56833
57529
|
};
|
|
@@ -56855,7 +57551,7 @@ const EditorProvider = (t0) => {
|
|
|
56855
57551
|
const editorURL = intlayerConfig?.editor.editorURL ?? "*";
|
|
56856
57552
|
if (!intlayerConfig) {
|
|
56857
57553
|
let t12;
|
|
56858
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57554
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56859
57555
|
t12 = /* @__PURE__ */ jsxRuntimeExports.jsx(Loader, {});
|
|
56860
57556
|
$2[0] = t12;
|
|
56861
57557
|
} else {
|
|
@@ -56957,7 +57653,7 @@ const useEditedContentPersistence = () => {
|
|
|
56957
57653
|
t3 = $2[7];
|
|
56958
57654
|
}
|
|
56959
57655
|
let t4;
|
|
56960
|
-
if ($2[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57656
|
+
if ($2[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
56961
57657
|
t4 = [];
|
|
56962
57658
|
$2[8] = t4;
|
|
56963
57659
|
} else {
|
|
@@ -57048,7 +57744,7 @@ const IframeController = (t0) => {
|
|
|
57048
57744
|
useIframeClickMerger();
|
|
57049
57745
|
const [loading, setLoading] = reactExports.useState(true);
|
|
57050
57746
|
let t1;
|
|
57051
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57747
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
57052
57748
|
t1 = {
|
|
57053
57749
|
receive: true,
|
|
57054
57750
|
emit: false
|
|
@@ -57078,7 +57774,7 @@ const IframeController = (t0) => {
|
|
|
57078
57774
|
reactExports.useEffect(t2, t3);
|
|
57079
57775
|
if (!editor2.applicationURL) {
|
|
57080
57776
|
let t42;
|
|
57081
|
-
if ($2[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57777
|
+
if ($2[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
57082
57778
|
t42 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex size-full items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Container, { className: "flex max-w-xl flex-col gap-4 p-6", children: /* @__PURE__ */ jsxRuntimeExports.jsx(NoApplicationURLView, {}) }) });
|
|
57083
57779
|
$2[4] = t42;
|
|
57084
57780
|
} else {
|
|
@@ -57157,7 +57853,7 @@ const AppContent = () => {
|
|
|
57157
57853
|
const App = () => {
|
|
57158
57854
|
const $2 = compilerRuntimeExports.c(1);
|
|
57159
57855
|
let t0;
|
|
57160
|
-
if ($2[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
57856
|
+
if ($2[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
|
|
57161
57857
|
t0 = /* @__PURE__ */ jsxRuntimeExports.jsx(AppRouter, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppContent, {}) }) });
|
|
57162
57858
|
$2[0] = t0;
|
|
57163
57859
|
} else {
|