@embedreach/components 0.1.22 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index.js +419 -203
- package/dist/index.umd.js +114 -114
- package/package.json +1 -1
package/dist/chunks/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx,
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import React__default, { createContext as createContext$1, Component,
|
|
3
|
+
import React__default, { createContext as createContext$1, Component, useContext as useContext$1, useCallback, useState, useRef, useEffect, useMemo, createElement as createElement$1, useReducer, forwardRef, useId as useId$2, useInsertionEffect, Children, isValidElement, useLayoutEffect, Fragment as Fragment$1, cloneElement } from "react";
|
|
4
4
|
import * as ReactDOM from "react-dom";
|
|
5
5
|
import ReactDOM__default, { flushSync } from "react-dom";
|
|
6
6
|
var Subscribable = class {
|
|
@@ -4486,7 +4486,7 @@ var isPlainObject = (payload) => {
|
|
|
4486
4486
|
};
|
|
4487
4487
|
var isEmptyObject = (payload) => isPlainObject(payload) && Object.keys(payload).length === 0;
|
|
4488
4488
|
var isArray = (payload) => Array.isArray(payload);
|
|
4489
|
-
var isString$
|
|
4489
|
+
var isString$2 = (payload) => typeof payload === "string";
|
|
4490
4490
|
var isNumber$1 = (payload) => typeof payload === "number" && !isNaN(payload);
|
|
4491
4491
|
var isBoolean = (payload) => typeof payload === "boolean";
|
|
4492
4492
|
var isRegExp = (payload) => payload instanceof RegExp;
|
|
@@ -4496,7 +4496,7 @@ var isSymbol$1 = (payload) => getType(payload) === "Symbol";
|
|
|
4496
4496
|
var isDate$3 = (payload) => payload instanceof Date && !isNaN(payload.valueOf());
|
|
4497
4497
|
var isError = (payload) => payload instanceof Error;
|
|
4498
4498
|
var isNaNValue = (payload) => typeof payload === "number" && isNaN(payload);
|
|
4499
|
-
var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber$1(payload) || isString$
|
|
4499
|
+
var isPrimitive = (payload) => isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber$1(payload) || isString$2(payload) || isSymbol$1(payload);
|
|
4500
4500
|
var isBigint = (payload) => typeof payload === "bigint";
|
|
4501
4501
|
var isInfinite = (payload) => payload === Infinity || payload === -Infinity;
|
|
4502
4502
|
var isTypedArray = (payload) => ArrayBuffer.isView(payload) && !(payload instanceof DataView);
|
|
@@ -7763,6 +7763,241 @@ let D$2 = class D extends Component {
|
|
|
7763
7763
|
return React__default.createElement(a4.Provider, { value: { flags: e4, flagKeyMap: r2, ldClient: n2, error: o2 } }, this.props.children);
|
|
7764
7764
|
}
|
|
7765
7765
|
};
|
|
7766
|
+
const warn = (...args) => {
|
|
7767
|
+
if (console?.warn) {
|
|
7768
|
+
if (isString$1(args[0])) args[0] = `react-i18next:: ${args[0]}`;
|
|
7769
|
+
console.warn(...args);
|
|
7770
|
+
}
|
|
7771
|
+
};
|
|
7772
|
+
const alreadyWarned$1 = {};
|
|
7773
|
+
const warnOnce$1 = (...args) => {
|
|
7774
|
+
if (isString$1(args[0]) && alreadyWarned$1[args[0]]) return;
|
|
7775
|
+
if (isString$1(args[0])) alreadyWarned$1[args[0]] = /* @__PURE__ */ new Date();
|
|
7776
|
+
warn(...args);
|
|
7777
|
+
};
|
|
7778
|
+
const loadedClb = (i18n, cb) => () => {
|
|
7779
|
+
if (i18n.isInitialized) {
|
|
7780
|
+
cb();
|
|
7781
|
+
} else {
|
|
7782
|
+
const initialized = () => {
|
|
7783
|
+
setTimeout(() => {
|
|
7784
|
+
i18n.off("initialized", initialized);
|
|
7785
|
+
}, 0);
|
|
7786
|
+
cb();
|
|
7787
|
+
};
|
|
7788
|
+
i18n.on("initialized", initialized);
|
|
7789
|
+
}
|
|
7790
|
+
};
|
|
7791
|
+
const loadNamespaces = (i18n, ns, cb) => {
|
|
7792
|
+
i18n.loadNamespaces(ns, loadedClb(i18n, cb));
|
|
7793
|
+
};
|
|
7794
|
+
const loadLanguages = (i18n, lng, ns, cb) => {
|
|
7795
|
+
if (isString$1(ns)) ns = [ns];
|
|
7796
|
+
if (i18n.options.preload && i18n.options.preload.indexOf(lng) > -1) return loadNamespaces(i18n, ns, cb);
|
|
7797
|
+
ns.forEach((n2) => {
|
|
7798
|
+
if (i18n.options.ns.indexOf(n2) < 0) i18n.options.ns.push(n2);
|
|
7799
|
+
});
|
|
7800
|
+
i18n.loadLanguages(lng, loadedClb(i18n, cb));
|
|
7801
|
+
};
|
|
7802
|
+
const hasLoadedNamespace = (ns, i18n, options = {}) => {
|
|
7803
|
+
if (!i18n.languages || !i18n.languages.length) {
|
|
7804
|
+
warnOnce$1("i18n.languages were undefined or empty", i18n.languages);
|
|
7805
|
+
return true;
|
|
7806
|
+
}
|
|
7807
|
+
return i18n.hasLoadedNamespace(ns, {
|
|
7808
|
+
lng: options.lng,
|
|
7809
|
+
precheck: (i18nInstance2, loadNotPending) => {
|
|
7810
|
+
if (options.bindI18n?.indexOf("languageChanging") > -1 && i18nInstance2.services.backendConnector.backend && i18nInstance2.isLanguageChangingTo && !loadNotPending(i18nInstance2.isLanguageChangingTo, ns)) return false;
|
|
7811
|
+
}
|
|
7812
|
+
});
|
|
7813
|
+
};
|
|
7814
|
+
const isString$1 = (obj) => typeof obj === "string";
|
|
7815
|
+
const isObject = (obj) => typeof obj === "object" && obj !== null;
|
|
7816
|
+
const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
|
|
7817
|
+
const htmlEntities = {
|
|
7818
|
+
"&": "&",
|
|
7819
|
+
"&": "&",
|
|
7820
|
+
"<": "<",
|
|
7821
|
+
"<": "<",
|
|
7822
|
+
">": ">",
|
|
7823
|
+
">": ">",
|
|
7824
|
+
"'": "'",
|
|
7825
|
+
"'": "'",
|
|
7826
|
+
""": '"',
|
|
7827
|
+
""": '"',
|
|
7828
|
+
" ": " ",
|
|
7829
|
+
" ": " ",
|
|
7830
|
+
"©": "©",
|
|
7831
|
+
"©": "©",
|
|
7832
|
+
"®": "®",
|
|
7833
|
+
"®": "®",
|
|
7834
|
+
"…": "…",
|
|
7835
|
+
"…": "…",
|
|
7836
|
+
"/": "/",
|
|
7837
|
+
"/": "/"
|
|
7838
|
+
};
|
|
7839
|
+
const unescapeHtmlEntity = (m4) => htmlEntities[m4];
|
|
7840
|
+
const unescape$1 = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
7841
|
+
let defaultOptions$2 = {
|
|
7842
|
+
bindI18n: "languageChanged",
|
|
7843
|
+
bindI18nStore: "",
|
|
7844
|
+
transEmptyNodeValue: "",
|
|
7845
|
+
transSupportBasicHtmlNodes: true,
|
|
7846
|
+
transWrapTextNodes: "",
|
|
7847
|
+
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
7848
|
+
useSuspense: true,
|
|
7849
|
+
unescape: unescape$1
|
|
7850
|
+
};
|
|
7851
|
+
const setDefaults = (options = {}) => {
|
|
7852
|
+
defaultOptions$2 = {
|
|
7853
|
+
...defaultOptions$2,
|
|
7854
|
+
...options
|
|
7855
|
+
};
|
|
7856
|
+
};
|
|
7857
|
+
const getDefaults$1 = () => defaultOptions$2;
|
|
7858
|
+
let i18nInstance;
|
|
7859
|
+
const setI18n = (instance2) => {
|
|
7860
|
+
i18nInstance = instance2;
|
|
7861
|
+
};
|
|
7862
|
+
const getI18n = () => i18nInstance;
|
|
7863
|
+
const initReactI18next = {
|
|
7864
|
+
type: "3rdParty",
|
|
7865
|
+
init(instance2) {
|
|
7866
|
+
setDefaults(instance2.options.react);
|
|
7867
|
+
setI18n(instance2);
|
|
7868
|
+
}
|
|
7869
|
+
};
|
|
7870
|
+
const I18nContext = createContext$1();
|
|
7871
|
+
class ReportNamespaces {
|
|
7872
|
+
constructor() {
|
|
7873
|
+
this.usedNamespaces = {};
|
|
7874
|
+
}
|
|
7875
|
+
addUsedNamespaces(namespaces) {
|
|
7876
|
+
namespaces.forEach((ns) => {
|
|
7877
|
+
if (!this.usedNamespaces[ns]) this.usedNamespaces[ns] = true;
|
|
7878
|
+
});
|
|
7879
|
+
}
|
|
7880
|
+
getUsedNamespaces() {
|
|
7881
|
+
return Object.keys(this.usedNamespaces);
|
|
7882
|
+
}
|
|
7883
|
+
}
|
|
7884
|
+
const usePrevious$1 = (value, ignore) => {
|
|
7885
|
+
const ref = useRef();
|
|
7886
|
+
useEffect(() => {
|
|
7887
|
+
ref.current = value;
|
|
7888
|
+
}, [value, ignore]);
|
|
7889
|
+
return ref.current;
|
|
7890
|
+
};
|
|
7891
|
+
const alwaysNewT = (i18n, language, namespace, keyPrefix) => i18n.getFixedT(language, namespace, keyPrefix);
|
|
7892
|
+
const useMemoizedT = (i18n, language, namespace, keyPrefix) => useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
|
|
7893
|
+
const useTranslation = (ns, props = {}) => {
|
|
7894
|
+
const {
|
|
7895
|
+
i18n: i18nFromProps
|
|
7896
|
+
} = props;
|
|
7897
|
+
const {
|
|
7898
|
+
i18n: i18nFromContext,
|
|
7899
|
+
defaultNS: defaultNSFromContext
|
|
7900
|
+
} = useContext$1(I18nContext) || {};
|
|
7901
|
+
const i18n = i18nFromProps || i18nFromContext || getI18n();
|
|
7902
|
+
if (i18n && !i18n.reportNamespaces) i18n.reportNamespaces = new ReportNamespaces();
|
|
7903
|
+
if (!i18n) {
|
|
7904
|
+
warnOnce$1("You will need to pass in an i18next instance by using initReactI18next");
|
|
7905
|
+
const notReadyT = (k3, optsOrDefaultValue) => {
|
|
7906
|
+
if (isString$1(optsOrDefaultValue)) return optsOrDefaultValue;
|
|
7907
|
+
if (isObject(optsOrDefaultValue) && isString$1(optsOrDefaultValue.defaultValue)) return optsOrDefaultValue.defaultValue;
|
|
7908
|
+
return Array.isArray(k3) ? k3[k3.length - 1] : k3;
|
|
7909
|
+
};
|
|
7910
|
+
const retNotReady = [notReadyT, {}, false];
|
|
7911
|
+
retNotReady.t = notReadyT;
|
|
7912
|
+
retNotReady.i18n = {};
|
|
7913
|
+
retNotReady.ready = false;
|
|
7914
|
+
return retNotReady;
|
|
7915
|
+
}
|
|
7916
|
+
if (i18n.options.react?.wait) warnOnce$1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");
|
|
7917
|
+
const i18nOptions = {
|
|
7918
|
+
...getDefaults$1(),
|
|
7919
|
+
...i18n.options.react,
|
|
7920
|
+
...props
|
|
7921
|
+
};
|
|
7922
|
+
const {
|
|
7923
|
+
useSuspense,
|
|
7924
|
+
keyPrefix
|
|
7925
|
+
} = i18nOptions;
|
|
7926
|
+
let namespaces = defaultNSFromContext || i18n.options?.defaultNS;
|
|
7927
|
+
namespaces = isString$1(namespaces) ? [namespaces] : namespaces || ["translation"];
|
|
7928
|
+
i18n.reportNamespaces.addUsedNamespaces?.(namespaces);
|
|
7929
|
+
const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions));
|
|
7930
|
+
const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
7931
|
+
const getT = () => memoGetT;
|
|
7932
|
+
const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
|
|
7933
|
+
const [t3, setT] = useState(getT);
|
|
7934
|
+
let joinedNS = namespaces.join();
|
|
7935
|
+
if (props.lng) joinedNS = `${props.lng}${joinedNS}`;
|
|
7936
|
+
const previousJoinedNS = usePrevious$1(joinedNS);
|
|
7937
|
+
const isMounted = useRef(true);
|
|
7938
|
+
useEffect(() => {
|
|
7939
|
+
const {
|
|
7940
|
+
bindI18n,
|
|
7941
|
+
bindI18nStore
|
|
7942
|
+
} = i18nOptions;
|
|
7943
|
+
isMounted.current = true;
|
|
7944
|
+
if (!ready && !useSuspense) {
|
|
7945
|
+
if (props.lng) {
|
|
7946
|
+
loadLanguages(i18n, props.lng, namespaces, () => {
|
|
7947
|
+
if (isMounted.current) setT(getNewT);
|
|
7948
|
+
});
|
|
7949
|
+
} else {
|
|
7950
|
+
loadNamespaces(i18n, namespaces, () => {
|
|
7951
|
+
if (isMounted.current) setT(getNewT);
|
|
7952
|
+
});
|
|
7953
|
+
}
|
|
7954
|
+
}
|
|
7955
|
+
if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
|
|
7956
|
+
setT(getNewT);
|
|
7957
|
+
}
|
|
7958
|
+
const boundReset = () => {
|
|
7959
|
+
if (isMounted.current) setT(getNewT);
|
|
7960
|
+
};
|
|
7961
|
+
if (bindI18n) i18n?.on(bindI18n, boundReset);
|
|
7962
|
+
if (bindI18nStore) i18n?.store.on(bindI18nStore, boundReset);
|
|
7963
|
+
return () => {
|
|
7964
|
+
isMounted.current = false;
|
|
7965
|
+
if (i18n) bindI18n?.split(" ").forEach((e4) => i18n.off(e4, boundReset));
|
|
7966
|
+
if (bindI18nStore && i18n) bindI18nStore.split(" ").forEach((e4) => i18n.store.off(e4, boundReset));
|
|
7967
|
+
};
|
|
7968
|
+
}, [i18n, joinedNS]);
|
|
7969
|
+
useEffect(() => {
|
|
7970
|
+
if (isMounted.current && ready) {
|
|
7971
|
+
setT(getT);
|
|
7972
|
+
}
|
|
7973
|
+
}, [i18n, keyPrefix, ready]);
|
|
7974
|
+
const ret = [t3, i18n, ready];
|
|
7975
|
+
ret.t = t3;
|
|
7976
|
+
ret.i18n = i18n;
|
|
7977
|
+
ret.ready = ready;
|
|
7978
|
+
if (ready) return ret;
|
|
7979
|
+
if (!ready && !useSuspense) return ret;
|
|
7980
|
+
throw new Promise((resolve) => {
|
|
7981
|
+
if (props.lng) {
|
|
7982
|
+
loadLanguages(i18n, props.lng, namespaces, () => resolve());
|
|
7983
|
+
} else {
|
|
7984
|
+
loadNamespaces(i18n, namespaces, () => resolve());
|
|
7985
|
+
}
|
|
7986
|
+
});
|
|
7987
|
+
};
|
|
7988
|
+
function I18nextProvider({
|
|
7989
|
+
i18n,
|
|
7990
|
+
defaultNS,
|
|
7991
|
+
children: children2
|
|
7992
|
+
}) {
|
|
7993
|
+
const value = useMemo(() => ({
|
|
7994
|
+
i18n,
|
|
7995
|
+
defaultNS
|
|
7996
|
+
}), [i18n, defaultNS]);
|
|
7997
|
+
return createElement$1(I18nContext.Provider, {
|
|
7998
|
+
value
|
|
7999
|
+
}, children2);
|
|
8000
|
+
}
|
|
7766
8001
|
let EventEmitter$1 = class EventEmitter {
|
|
7767
8002
|
handlers = /* @__PURE__ */ new Map();
|
|
7768
8003
|
/**
|
|
@@ -7873,7 +8108,7 @@ const createQueryClient = () => new QueryClient({
|
|
|
7873
8108
|
}
|
|
7874
8109
|
});
|
|
7875
8110
|
const createDataContext = (reducer2, actions, defaultValue, listeners2) => {
|
|
7876
|
-
const
|
|
8111
|
+
const Context2 = React__default.createContext({
|
|
7877
8112
|
state: defaultValue
|
|
7878
8113
|
});
|
|
7879
8114
|
const Provider2 = ({ children: children2 }) => {
|
|
@@ -7905,9 +8140,9 @@ const createDataContext = (reducer2, actions, defaultValue, listeners2) => {
|
|
|
7905
8140
|
() => ({ state, ...boundActions }),
|
|
7906
8141
|
[state, boundActions]
|
|
7907
8142
|
);
|
|
7908
|
-
return /* @__PURE__ */ jsx(
|
|
8143
|
+
return /* @__PURE__ */ jsx(Context2.Provider, { value: contextValue, children: children2 });
|
|
7909
8144
|
};
|
|
7910
|
-
return { Context, Provider: Provider2 };
|
|
8145
|
+
return { Context: Context2, Provider: Provider2 };
|
|
7911
8146
|
};
|
|
7912
8147
|
const authReducer = (state, action) => {
|
|
7913
8148
|
switch (action.type) {
|
|
@@ -8120,6 +8355,13 @@ const applyThemeStyles = (styles2) => {
|
|
|
8120
8355
|
styleElement.textContent = cssText;
|
|
8121
8356
|
document.head.appendChild(styleElement);
|
|
8122
8357
|
};
|
|
8358
|
+
const mergeThemeStyles = (themeConfig, overrides) => {
|
|
8359
|
+
return {
|
|
8360
|
+
...DEFAULT_THEME_STYLES,
|
|
8361
|
+
...themeConfig?.styles || {},
|
|
8362
|
+
...{}
|
|
8363
|
+
};
|
|
8364
|
+
};
|
|
8123
8365
|
const themeReducer = (state, action) => {
|
|
8124
8366
|
switch (action.type) {
|
|
8125
8367
|
case "set_theme":
|
|
@@ -8150,7 +8392,7 @@ const themeReducer = (state, action) => {
|
|
|
8150
8392
|
const setTheme = (dispatch2) => (theme2) => dispatch2({ type: "set_theme", payload: theme2 });
|
|
8151
8393
|
const setLoading = (dispatch2) => (loading2) => dispatch2({ type: "set_loading", payload: loading2 });
|
|
8152
8394
|
const setError = (dispatch2) => (error2) => dispatch2({ type: "set_error", payload: error2 });
|
|
8153
|
-
const { Provider: Provider$2 } = createDataContext(
|
|
8395
|
+
const { Context, Provider: Provider$2 } = createDataContext(
|
|
8154
8396
|
themeReducer,
|
|
8155
8397
|
{
|
|
8156
8398
|
setTheme,
|
|
@@ -8163,67 +8405,28 @@ const { Provider: Provider$2 } = createDataContext(
|
|
|
8163
8405
|
error: null
|
|
8164
8406
|
}
|
|
8165
8407
|
);
|
|
8166
|
-
const
|
|
8167
|
-
const
|
|
8168
|
-
|
|
8169
|
-
|
|
8170
|
-
|
|
8171
|
-
|
|
8172
|
-
|
|
8173
|
-
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
"/": "/",
|
|
8187
|
-
"/": "/"
|
|
8188
|
-
};
|
|
8189
|
-
const unescapeHtmlEntity = (m4) => htmlEntities[m4];
|
|
8190
|
-
const unescape$1 = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
|
|
8191
|
-
let defaultOptions$2 = {
|
|
8192
|
-
bindI18n: "languageChanged",
|
|
8193
|
-
bindI18nStore: "",
|
|
8194
|
-
transEmptyNodeValue: "",
|
|
8195
|
-
transSupportBasicHtmlNodes: true,
|
|
8196
|
-
transWrapTextNodes: "",
|
|
8197
|
-
transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
|
|
8198
|
-
useSuspense: true,
|
|
8199
|
-
unescape: unescape$1
|
|
8200
|
-
};
|
|
8201
|
-
const setDefaults = (options = {}) => {
|
|
8202
|
-
defaultOptions$2 = {
|
|
8203
|
-
...defaultOptions$2,
|
|
8204
|
-
...options
|
|
8408
|
+
const useThemeContext = () => {
|
|
8409
|
+
const context = useContext$1(Context);
|
|
8410
|
+
if (context === void 0) {
|
|
8411
|
+
throw new Error("useThemeContext must be used within a ThemeProvider");
|
|
8412
|
+
}
|
|
8413
|
+
const applyTheme = (themeConfig) => {
|
|
8414
|
+
if (!themeConfig) return;
|
|
8415
|
+
const mergedStyles = mergeThemeStyles(themeConfig);
|
|
8416
|
+
const finalTheme = {
|
|
8417
|
+
styles: mergedStyles
|
|
8418
|
+
};
|
|
8419
|
+
context.setTheme(finalTheme);
|
|
8420
|
+
};
|
|
8421
|
+
return {
|
|
8422
|
+
...context.state,
|
|
8423
|
+
setTheme: context.setTheme,
|
|
8424
|
+
setLoading: context.setLoading,
|
|
8425
|
+
setError: context.setError,
|
|
8426
|
+
// Add the helper function
|
|
8427
|
+
applyTheme
|
|
8205
8428
|
};
|
|
8206
8429
|
};
|
|
8207
|
-
const initReactI18next = {
|
|
8208
|
-
type: "3rdParty",
|
|
8209
|
-
init(instance2) {
|
|
8210
|
-
setDefaults(instance2.options.react);
|
|
8211
|
-
}
|
|
8212
|
-
};
|
|
8213
|
-
const I18nContext = createContext$1();
|
|
8214
|
-
function I18nextProvider({
|
|
8215
|
-
i18n,
|
|
8216
|
-
defaultNS,
|
|
8217
|
-
children: children2
|
|
8218
|
-
}) {
|
|
8219
|
-
const value = useMemo(() => ({
|
|
8220
|
-
i18n,
|
|
8221
|
-
defaultNS
|
|
8222
|
-
}), [i18n, defaultNS]);
|
|
8223
|
-
return createElement$1(I18nContext.Provider, {
|
|
8224
|
-
value
|
|
8225
|
-
}, children2);
|
|
8226
|
-
}
|
|
8227
8430
|
const isString = (obj) => typeof obj === "string";
|
|
8228
8431
|
const defer = () => {
|
|
8229
8432
|
let res;
|
|
@@ -11696,6 +11899,127 @@ const I18nProvider = ({
|
|
|
11696
11899
|
}, [initialLanguage]);
|
|
11697
11900
|
return /* @__PURE__ */ jsx(I18nextProvider, { i18n: instance, children: children2 });
|
|
11698
11901
|
};
|
|
11902
|
+
const H3 = ({ children: children2 }) => {
|
|
11903
|
+
return /* @__PURE__ */ jsx("h3", { className: "scroll-m-20 text-2xl font-semibold tracking-tight", children: children2 });
|
|
11904
|
+
};
|
|
11905
|
+
const SpinLoader = ({
|
|
11906
|
+
size: size2 = 35,
|
|
11907
|
+
color: color2 = "black",
|
|
11908
|
+
speed = 0.9,
|
|
11909
|
+
strokeWidth = 3.5,
|
|
11910
|
+
text,
|
|
11911
|
+
textSpeed = 2e3,
|
|
11912
|
+
// Default 2 seconds per text
|
|
11913
|
+
textColor = "black"
|
|
11914
|
+
}) => {
|
|
11915
|
+
const [currentTextIndex, setCurrentTextIndex] = useState(0);
|
|
11916
|
+
const textArray = Array.isArray(text) ? text : text ? [text] : [];
|
|
11917
|
+
useEffect(() => {
|
|
11918
|
+
if (textArray.length <= 1) return;
|
|
11919
|
+
if (currentTextIndex >= textArray.length - 1) return;
|
|
11920
|
+
const interval = setInterval(() => {
|
|
11921
|
+
setCurrentTextIndex(
|
|
11922
|
+
(current) => current < textArray.length - 1 ? current + 1 : current
|
|
11923
|
+
);
|
|
11924
|
+
}, textSpeed);
|
|
11925
|
+
return () => clearInterval(interval);
|
|
11926
|
+
}, [textArray.length, textSpeed, currentTextIndex]);
|
|
11927
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center items-center h-full", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4", children: [
|
|
11928
|
+
/* @__PURE__ */ jsxs(
|
|
11929
|
+
"div",
|
|
11930
|
+
{
|
|
11931
|
+
className: "loader-container",
|
|
11932
|
+
style: {
|
|
11933
|
+
"--uib-size": `${size2}px`,
|
|
11934
|
+
"--uib-color": color2,
|
|
11935
|
+
"--uib-speed": `${speed}s`,
|
|
11936
|
+
"--uib-stroke": `${strokeWidth}px`
|
|
11937
|
+
},
|
|
11938
|
+
children: [
|
|
11939
|
+
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
11940
|
+
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
11941
|
+
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
11942
|
+
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
11943
|
+
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
11944
|
+
/* @__PURE__ */ jsx("div", { className: "line" })
|
|
11945
|
+
]
|
|
11946
|
+
}
|
|
11947
|
+
),
|
|
11948
|
+
textArray.length > 0 && /* @__PURE__ */ jsx(
|
|
11949
|
+
"div",
|
|
11950
|
+
{
|
|
11951
|
+
className: `text-center text-sm text-muted-foreground animate-fade-in ${textColor ? `text-${textColor}` : ""}`,
|
|
11952
|
+
children: /* @__PURE__ */ jsx(H3, { children: textArray[currentTextIndex] })
|
|
11953
|
+
},
|
|
11954
|
+
currentTextIndex
|
|
11955
|
+
),
|
|
11956
|
+
/* @__PURE__ */ jsx("style", { children: `
|
|
11957
|
+
.loader-container {
|
|
11958
|
+
position: relative;
|
|
11959
|
+
display: flex;
|
|
11960
|
+
align-items: center;
|
|
11961
|
+
justify-content: center;
|
|
11962
|
+
height: var(--uib-size);
|
|
11963
|
+
width: var(--uib-size);
|
|
11964
|
+
}
|
|
11965
|
+
.line {
|
|
11966
|
+
position: absolute;
|
|
11967
|
+
top: calc(50% - var(--uib-stroke) / 2);
|
|
11968
|
+
left: 0;
|
|
11969
|
+
height: var(--uib-stroke);
|
|
11970
|
+
width: 100%;
|
|
11971
|
+
border-radius: calc(var(--uib-stroke) / 2);
|
|
11972
|
+
background-color: var(--uib-color);
|
|
11973
|
+
animation: rotate var(--uib-speed) ease-in-out infinite;
|
|
11974
|
+
transition: background-color 0.3s ease;
|
|
11975
|
+
}
|
|
11976
|
+
.line:nth-child(1) {
|
|
11977
|
+
animation-delay: calc(var(--uib-speed) * -0.375);
|
|
11978
|
+
}
|
|
11979
|
+
.line:nth-child(2) {
|
|
11980
|
+
animation-delay: calc(var(--uib-speed) * -0.375);
|
|
11981
|
+
opacity: 0.8;
|
|
11982
|
+
}
|
|
11983
|
+
.line:nth-child(3) {
|
|
11984
|
+
animation-delay: calc(var(--uib-speed) * -0.3);
|
|
11985
|
+
opacity: 0.6;
|
|
11986
|
+
}
|
|
11987
|
+
.line:nth-child(4) {
|
|
11988
|
+
animation-delay: calc(var(--uib-speed) * -0.225);
|
|
11989
|
+
opacity: 0.4;
|
|
11990
|
+
}
|
|
11991
|
+
.line:nth-child(5) {
|
|
11992
|
+
animation-delay: calc(var(--uib-speed) * -0.15);
|
|
11993
|
+
opacity: 0.2;
|
|
11994
|
+
}
|
|
11995
|
+
.line:nth-child(6) {
|
|
11996
|
+
animation-delay: calc(var(--uib-speed) * -0.075);
|
|
11997
|
+
opacity: 0.1;
|
|
11998
|
+
}
|
|
11999
|
+
@keyframes rotate {
|
|
12000
|
+
0% {
|
|
12001
|
+
transform: rotate(0deg);
|
|
12002
|
+
}
|
|
12003
|
+
100% {
|
|
12004
|
+
transform: rotate(180deg);
|
|
12005
|
+
}
|
|
12006
|
+
}
|
|
12007
|
+
.animate-fade-in {
|
|
12008
|
+
animation: fadeIn 0.5s ease-in-out;
|
|
12009
|
+
}
|
|
12010
|
+
@keyframes fadeIn {
|
|
12011
|
+
from {
|
|
12012
|
+
opacity: 0;
|
|
12013
|
+
transform: translateY(5px);
|
|
12014
|
+
}
|
|
12015
|
+
to {
|
|
12016
|
+
opacity: 1;
|
|
12017
|
+
transform: translateY(0);
|
|
12018
|
+
}
|
|
12019
|
+
}
|
|
12020
|
+
` })
|
|
12021
|
+
] }) });
|
|
12022
|
+
};
|
|
11699
12023
|
const TOAST_LIMIT = 1;
|
|
11700
12024
|
const TOAST_REMOVE_DELAY = 1e6;
|
|
11701
12025
|
let count$2 = 0;
|
|
@@ -11855,15 +12179,15 @@ function useComposedRefs(...refs) {
|
|
|
11855
12179
|
return React.useCallback(composeRefs(...refs), refs);
|
|
11856
12180
|
}
|
|
11857
12181
|
function createContext2(rootComponentName, defaultContext) {
|
|
11858
|
-
const
|
|
12182
|
+
const Context2 = React.createContext(defaultContext);
|
|
11859
12183
|
const Provider2 = (props) => {
|
|
11860
12184
|
const { children: children2, ...context } = props;
|
|
11861
12185
|
const value = React.useMemo(() => context, Object.values(context));
|
|
11862
|
-
return /* @__PURE__ */ jsx(
|
|
12186
|
+
return /* @__PURE__ */ jsx(Context2.Provider, { value, children: children2 });
|
|
11863
12187
|
};
|
|
11864
12188
|
Provider2.displayName = rootComponentName + "Provider";
|
|
11865
12189
|
function useContext2(consumerName) {
|
|
11866
|
-
const context = React.useContext(
|
|
12190
|
+
const context = React.useContext(Context2);
|
|
11867
12191
|
if (context) return context;
|
|
11868
12192
|
if (defaultContext !== void 0) return defaultContext;
|
|
11869
12193
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -11878,14 +12202,14 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
11878
12202
|
defaultContexts = [...defaultContexts, defaultContext];
|
|
11879
12203
|
const Provider2 = (props) => {
|
|
11880
12204
|
const { scope, children: children2, ...context } = props;
|
|
11881
|
-
const
|
|
12205
|
+
const Context2 = scope?.[scopeName]?.[index2] || BaseContext;
|
|
11882
12206
|
const value = React.useMemo(() => context, Object.values(context));
|
|
11883
|
-
return /* @__PURE__ */ jsx(
|
|
12207
|
+
return /* @__PURE__ */ jsx(Context2.Provider, { value, children: children2 });
|
|
11884
12208
|
};
|
|
11885
12209
|
Provider2.displayName = rootComponentName + "Provider";
|
|
11886
12210
|
function useContext2(consumerName, scope) {
|
|
11887
|
-
const
|
|
11888
|
-
const context = React.useContext(
|
|
12211
|
+
const Context2 = scope?.[scopeName]?.[index2] || BaseContext;
|
|
12212
|
+
const context = React.useContext(Context2);
|
|
11889
12213
|
if (context) return context;
|
|
11890
12214
|
if (defaultContext !== void 0) return defaultContext;
|
|
11891
12215
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -16211,14 +16535,27 @@ const ReachProvider = ({
|
|
|
16211
16535
|
authToken: authToken2,
|
|
16212
16536
|
tenantExternalId,
|
|
16213
16537
|
language,
|
|
16214
|
-
children: children2
|
|
16538
|
+
children: children2,
|
|
16539
|
+
theme: theme2
|
|
16215
16540
|
}) => {
|
|
16541
|
+
const { t: t3 } = useTranslation();
|
|
16216
16542
|
const [queryClient] = React__default.useState(() => {
|
|
16217
16543
|
if (authToken2) {
|
|
16218
16544
|
setAuthToken(authToken2);
|
|
16219
16545
|
}
|
|
16220
16546
|
return createQueryClient();
|
|
16221
16547
|
});
|
|
16548
|
+
const { loading: themeLoading, applyTheme } = useThemeContext();
|
|
16549
|
+
const themeApplied = useRef(false);
|
|
16550
|
+
useEffect(() => {
|
|
16551
|
+
if (!themeApplied.current && theme2) {
|
|
16552
|
+
applyTheme(theme2);
|
|
16553
|
+
themeApplied.current = true;
|
|
16554
|
+
}
|
|
16555
|
+
}, [applyTheme, theme2]);
|
|
16556
|
+
if (themeLoading && theme2) {
|
|
16557
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center items-center h-screen", children: /* @__PURE__ */ jsx(SpinLoader, { text: [t3("loading")] }) });
|
|
16558
|
+
}
|
|
16222
16559
|
return /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
|
|
16223
16560
|
/* @__PURE__ */ jsx(
|
|
16224
16561
|
D$2,
|
|
@@ -23612,127 +23949,6 @@ const BlurDiv = ({ children: children2, className: className2, key }) => {
|
|
|
23612
23949
|
key
|
|
23613
23950
|
);
|
|
23614
23951
|
};
|
|
23615
|
-
const H3 = ({ children: children2 }) => {
|
|
23616
|
-
return /* @__PURE__ */ jsx("h3", { className: "scroll-m-20 text-2xl font-semibold tracking-tight", children: children2 });
|
|
23617
|
-
};
|
|
23618
|
-
const SpinLoader = ({
|
|
23619
|
-
size: size2 = 35,
|
|
23620
|
-
color: color2 = "black",
|
|
23621
|
-
speed = 0.9,
|
|
23622
|
-
strokeWidth = 3.5,
|
|
23623
|
-
text,
|
|
23624
|
-
textSpeed = 2e3,
|
|
23625
|
-
// Default 2 seconds per text
|
|
23626
|
-
textColor = "black"
|
|
23627
|
-
}) => {
|
|
23628
|
-
const [currentTextIndex, setCurrentTextIndex] = useState(0);
|
|
23629
|
-
const textArray = Array.isArray(text) ? text : text ? [text] : [];
|
|
23630
|
-
useEffect(() => {
|
|
23631
|
-
if (textArray.length <= 1) return;
|
|
23632
|
-
if (currentTextIndex >= textArray.length - 1) return;
|
|
23633
|
-
const interval = setInterval(() => {
|
|
23634
|
-
setCurrentTextIndex(
|
|
23635
|
-
(current) => current < textArray.length - 1 ? current + 1 : current
|
|
23636
|
-
);
|
|
23637
|
-
}, textSpeed);
|
|
23638
|
-
return () => clearInterval(interval);
|
|
23639
|
-
}, [textArray.length, textSpeed, currentTextIndex]);
|
|
23640
|
-
return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-center items-center h-full", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-4", children: [
|
|
23641
|
-
/* @__PURE__ */ jsxs(
|
|
23642
|
-
"div",
|
|
23643
|
-
{
|
|
23644
|
-
className: "loader-container",
|
|
23645
|
-
style: {
|
|
23646
|
-
"--uib-size": `${size2}px`,
|
|
23647
|
-
"--uib-color": color2,
|
|
23648
|
-
"--uib-speed": `${speed}s`,
|
|
23649
|
-
"--uib-stroke": `${strokeWidth}px`
|
|
23650
|
-
},
|
|
23651
|
-
children: [
|
|
23652
|
-
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
23653
|
-
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
23654
|
-
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
23655
|
-
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
23656
|
-
/* @__PURE__ */ jsx("div", { className: "line" }),
|
|
23657
|
-
/* @__PURE__ */ jsx("div", { className: "line" })
|
|
23658
|
-
]
|
|
23659
|
-
}
|
|
23660
|
-
),
|
|
23661
|
-
textArray.length > 0 && /* @__PURE__ */ jsx(
|
|
23662
|
-
"div",
|
|
23663
|
-
{
|
|
23664
|
-
className: `text-center text-sm text-muted-foreground animate-fade-in ${textColor ? `text-${textColor}` : ""}`,
|
|
23665
|
-
children: /* @__PURE__ */ jsx(H3, { children: textArray[currentTextIndex] })
|
|
23666
|
-
},
|
|
23667
|
-
currentTextIndex
|
|
23668
|
-
),
|
|
23669
|
-
/* @__PURE__ */ jsx("style", { children: `
|
|
23670
|
-
.loader-container {
|
|
23671
|
-
position: relative;
|
|
23672
|
-
display: flex;
|
|
23673
|
-
align-items: center;
|
|
23674
|
-
justify-content: center;
|
|
23675
|
-
height: var(--uib-size);
|
|
23676
|
-
width: var(--uib-size);
|
|
23677
|
-
}
|
|
23678
|
-
.line {
|
|
23679
|
-
position: absolute;
|
|
23680
|
-
top: calc(50% - var(--uib-stroke) / 2);
|
|
23681
|
-
left: 0;
|
|
23682
|
-
height: var(--uib-stroke);
|
|
23683
|
-
width: 100%;
|
|
23684
|
-
border-radius: calc(var(--uib-stroke) / 2);
|
|
23685
|
-
background-color: var(--uib-color);
|
|
23686
|
-
animation: rotate var(--uib-speed) ease-in-out infinite;
|
|
23687
|
-
transition: background-color 0.3s ease;
|
|
23688
|
-
}
|
|
23689
|
-
.line:nth-child(1) {
|
|
23690
|
-
animation-delay: calc(var(--uib-speed) * -0.375);
|
|
23691
|
-
}
|
|
23692
|
-
.line:nth-child(2) {
|
|
23693
|
-
animation-delay: calc(var(--uib-speed) * -0.375);
|
|
23694
|
-
opacity: 0.8;
|
|
23695
|
-
}
|
|
23696
|
-
.line:nth-child(3) {
|
|
23697
|
-
animation-delay: calc(var(--uib-speed) * -0.3);
|
|
23698
|
-
opacity: 0.6;
|
|
23699
|
-
}
|
|
23700
|
-
.line:nth-child(4) {
|
|
23701
|
-
animation-delay: calc(var(--uib-speed) * -0.225);
|
|
23702
|
-
opacity: 0.4;
|
|
23703
|
-
}
|
|
23704
|
-
.line:nth-child(5) {
|
|
23705
|
-
animation-delay: calc(var(--uib-speed) * -0.15);
|
|
23706
|
-
opacity: 0.2;
|
|
23707
|
-
}
|
|
23708
|
-
.line:nth-child(6) {
|
|
23709
|
-
animation-delay: calc(var(--uib-speed) * -0.075);
|
|
23710
|
-
opacity: 0.1;
|
|
23711
|
-
}
|
|
23712
|
-
@keyframes rotate {
|
|
23713
|
-
0% {
|
|
23714
|
-
transform: rotate(0deg);
|
|
23715
|
-
}
|
|
23716
|
-
100% {
|
|
23717
|
-
transform: rotate(180deg);
|
|
23718
|
-
}
|
|
23719
|
-
}
|
|
23720
|
-
.animate-fade-in {
|
|
23721
|
-
animation: fadeIn 0.5s ease-in-out;
|
|
23722
|
-
}
|
|
23723
|
-
@keyframes fadeIn {
|
|
23724
|
-
from {
|
|
23725
|
-
opacity: 0;
|
|
23726
|
-
transform: translateY(5px);
|
|
23727
|
-
}
|
|
23728
|
-
to {
|
|
23729
|
-
opacity: 1;
|
|
23730
|
-
transform: translateY(0);
|
|
23731
|
-
}
|
|
23732
|
-
}
|
|
23733
|
-
` })
|
|
23734
|
-
] }) });
|
|
23735
|
-
};
|
|
23736
23952
|
const BUSINESS_SEGMENT_PATH = "/segments";
|
|
23737
23953
|
const BUSINESS_AUTOMATION_PATH = "/automations";
|
|
23738
23954
|
const CHANNEL_SENDER_PATH = "/channel/senders";
|
|
@@ -33451,19 +33667,19 @@ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {
|
|
|
33451
33667
|
return useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);
|
|
33452
33668
|
}
|
|
33453
33669
|
function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
|
|
33454
|
-
const
|
|
33670
|
+
const Context2 = /* @__PURE__ */ createContext$1(defaultContext);
|
|
33455
33671
|
function Provider2(props) {
|
|
33456
33672
|
const { children: children2, ...context } = props;
|
|
33457
33673
|
const value = useMemo(
|
|
33458
33674
|
() => context,
|
|
33459
33675
|
Object.values(context)
|
|
33460
33676
|
);
|
|
33461
|
-
return /* @__PURE__ */ createElement$1(
|
|
33677
|
+
return /* @__PURE__ */ createElement$1(Context2.Provider, {
|
|
33462
33678
|
value
|
|
33463
33679
|
}, children2);
|
|
33464
33680
|
}
|
|
33465
33681
|
function useContext2(consumerName) {
|
|
33466
|
-
const context = useContext$1(
|
|
33682
|
+
const context = useContext$1(Context2);
|
|
33467
33683
|
if (context) return context;
|
|
33468
33684
|
if (defaultContext !== void 0) return defaultContext;
|
|
33469
33685
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
@@ -33485,18 +33701,18 @@ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeD
|
|
|
33485
33701
|
];
|
|
33486
33702
|
function Provider2(props) {
|
|
33487
33703
|
const { scope, children: children2, ...context } = props;
|
|
33488
|
-
const
|
|
33704
|
+
const Context2 = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
|
|
33489
33705
|
const value = useMemo(
|
|
33490
33706
|
() => context,
|
|
33491
33707
|
Object.values(context)
|
|
33492
33708
|
);
|
|
33493
|
-
return /* @__PURE__ */ createElement$1(
|
|
33709
|
+
return /* @__PURE__ */ createElement$1(Context2.Provider, {
|
|
33494
33710
|
value
|
|
33495
33711
|
}, children2);
|
|
33496
33712
|
}
|
|
33497
33713
|
function useContext2(consumerName, scope) {
|
|
33498
|
-
const
|
|
33499
|
-
const context = useContext$1(
|
|
33714
|
+
const Context2 = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index2]) || BaseContext;
|
|
33715
|
+
const context = useContext$1(Context2);
|
|
33500
33716
|
if (context) return context;
|
|
33501
33717
|
if (defaultContext !== void 0) return defaultContext;
|
|
33502
33718
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|