import {
require_arrayIncludesWith
} from "./chunk-WJHEGEPQ.js";
import {
AttributeIcon,
COMPONENT_ICONS,
DataManagerContext,
FormModalNavigationContext,
getTrad,
useDataManager,
useFormModalNavigation
} from "./chunk-6EDW4YHC.js";
import {
require_sortBy
} from "./chunk-FSHORG2W.js";
import "./chunk-T2YF43GM.js";
import {
require_groupBy
} from "./chunk-MUOUY6GG.js";
import "./chunk-NE3KAGU6.js";
import {
AutoReloadOverlayBlockerProvider,
MAX_COMPONENT_DEPTH,
PERMISSIONS,
actions,
actions2,
createComponentUid,
createUid,
getRelationType,
initialState,
initialState2,
makeUnique,
nameToSlug,
require_slugify,
retrieveComponentsFromSchema,
useAutoReloadOverlayBlocker
} from "./chunk-7HX4OIS5.js";
import "./chunk-6LY4MOO2.js";
import {
pluginId
} from "./chunk-SQLDXQZE.js";
import "./chunk-QF6GPHA4.js";
import "./chunk-JRLAXHTE.js";
import "./chunk-E4IFZ6ZT.js";
import {
require_pluralize
} from "./chunk-XNACAI67.js";
import "./chunk-QLEKUQKW.js";
import "./chunk-4J3VOWQV.js";
import {
useGuidedTour
} from "./chunk-PFI4R5WA.js";
import "./chunk-B3BGMYGX.js";
import "./chunk-W6ICJ5TB.js";
import "./chunk-IHYIPMY2.js";
import "./chunk-UWHSN2C7.js";
import "./chunk-ERK7O2GM.js";
import {
useFetchClient
} from "./chunk-FCIM6RNO.js";
import "./chunk-J33IXKN4.js";
import {
ConfirmDialog
} from "./chunk-NP53ZCXD.js";
import {
formatISO
} from "./chunk-ED4XR3VQ.js";
import "./chunk-MBK4V2X7.js";
import {
require_omit
} from "./chunk-5ESYXDTN.js";
import "./chunk-K65KIEAL.js";
import "./chunk-B7ZLODDO.js";
import "./chunk-PW7XKCYO.js";
import {
require_set
} from "./chunk-RMBEU7DO.js";
import "./chunk-RI2W2UZ6.js";
import "./chunk-IY256CNP.js";
import {
errorsTrads
} from "./chunk-IFOFBKTA.js";
import {
create3 as create,
create4 as create2,
create5 as create3,
create6 as create4,
create7 as create5,
create8 as create6,
require_camelCase,
require_has,
require_upperFirst
} from "./chunk-XLSIZGJF.js";
import "./chunk-EGNP2T5O.js";
import {
useAppInfo,
useTracking
} from "./chunk-GSN7U3BK.js";
import "./chunk-T3B5F2LV.js";
import {
require_castSlice,
require_hasUnicode,
require_stringToArray
} from "./chunk-YXDCVYVT.js";
import "./chunk-QIJGNK42.js";
import "./chunk-7PUJSL55.js";
import "./chunk-C2ZJTFO7.js";
import "./chunk-C75BZXCZ.js";
import "./chunk-APGTER6B.js";
import "./chunk-ZM6TT53G.js";
import "./chunk-6AXVGFVQ.js";
import "./chunk-BFLP6DBI.js";
import "./chunk-CMLQV3Z2.js";
import "./chunk-MMOBCIZG.js";
import "./chunk-IGCTEXRF.js";
import {
Layouts
} from "./chunk-TIVRAWTC.js";
import "./chunk-PQINNV4N.js";
import {
require_isEqual
} from "./chunk-VYSYYPOB.js";
import {
ForwardRef$J as ForwardRef$J2,
Page
} from "./chunk-5CAWUBTQ.js";
import {
useAuth,
useStrapiApp
} from "./chunk-W2TBR6J3.js";
import "./chunk-QEGMJR7H.js";
import {
require_arrayIncludes,
require_baseConvert,
require_baseProperty,
require_get,
require_lib,
require_noop,
require_toInteger,
require_toNumber
} from "./chunk-LCL5TIBZ.js";
import {
createSelector,
shallowEqual,
useDispatch,
useSelector
} from "./chunk-WOQNBAGN.js";
import "./chunk-BHLYCXQ7.js";
import "./chunk-76QM3EFM.js";
import {
require_Set,
require_SetCache,
require_baseGetTag,
require_baseKeys,
require_baseToString,
require_baseUnary,
require_cacheHas,
require_getTag,
require_isArray,
require_isArrayLike,
require_isObject,
require_isObjectLike,
require_nodeUtil,
require_setToArray,
require_toString
} from "./chunk-CE4VABH2.js";
import "./chunk-5VODLFKF.js";
import {
useNotification
} from "./chunk-N55RVBRV.js";
import {
Box,
Breadcrumbs,
Button,
CheckboxImpl,
Combobox,
Crumb,
DatePicker$1,
DateTimePicker,
Dialog,
Divider,
Field,
Flex,
Grid,
IconButton,
JSONInput,
KeyboardNavigable,
Link as Link2,
LinkButton,
Menu,
Modal,
MultiSelectNested,
NumberInput,
Option,
Searchbar,
SingleSelect,
SingleSelectOption,
SubNav,
SubNavHeader,
SubNavLink,
SubNavLinkSection,
SubNavSection,
SubNavSections,
Tabs,
TextButton,
TextInput,
Textarea,
TimePicker$1,
Toggle,
TooltipImpl,
Typography,
VisuallyHidden,
inputFocusStyle,
useCollator,
useFilter,
useIntl
} from "./chunk-7XB6XSWQ.js";
import "./chunk-5ZC4PE57.js";
import {
Link,
NavLink,
Navigate,
Route,
Routes,
useLocation,
useMatch,
useNavigate
} from "./chunk-TUXTO2Z5.js";
import "./chunk-FOD4ENRR.js";
import {
ForwardRef$1J,
ForwardRef$1L,
ForwardRef$1N,
ForwardRef$1h,
ForwardRef$27,
ForwardRef$29,
ForwardRef$2b,
ForwardRef$3B,
ForwardRef$3D,
ForwardRef$5j,
ForwardRef$J,
ForwardRef$X,
ForwardRef$j
} from "./chunk-WRD5KPDH.js";
import {
require_jsx_runtime
} from "./chunk-NIAJZ5MX.js";
import {
dt
} from "./chunk-ACIMPXWY.js";
import {
require_react
} from "./chunk-MADUDGYZ.js";
import {
__commonJS,
__toESM
} from "./chunk-PLDDJCW6.js";
// node_modules/lodash/isString.js
var require_isString = __commonJS({
"node_modules/lodash/isString.js"(exports, module) {
var baseGetTag = require_baseGetTag();
var isArray = require_isArray();
var isObjectLike = require_isObjectLike();
var stringTag = "[object String]";
function isString(value) {
return typeof value == "string" || !isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag;
}
module.exports = isString;
}
});
// node_modules/lodash/_asciiSize.js
var require_asciiSize = __commonJS({
"node_modules/lodash/_asciiSize.js"(exports, module) {
var baseProperty = require_baseProperty();
var asciiSize = baseProperty("length");
module.exports = asciiSize;
}
});
// node_modules/lodash/_unicodeSize.js
var require_unicodeSize = __commonJS({
"node_modules/lodash/_unicodeSize.js"(exports, module) {
var rsAstralRange = "\\ud800-\\udfff";
var rsComboMarksRange = "\\u0300-\\u036f";
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
var rsVarRange = "\\ufe0e\\ufe0f";
var rsAstral = "[" + rsAstralRange + "]";
var rsCombo = "[" + rsComboRange + "]";
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
var rsNonAstral = "[^" + rsAstralRange + "]";
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
var rsZWJ = "\\u200d";
var reOptMod = rsModifier + "?";
var rsOptVar = "[" + rsVarRange + "]?";
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")";
var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g");
function unicodeSize(string) {
var result = reUnicode.lastIndex = 0;
while (reUnicode.test(string)) {
++result;
}
return result;
}
module.exports = unicodeSize;
}
});
// node_modules/lodash/_stringSize.js
var require_stringSize = __commonJS({
"node_modules/lodash/_stringSize.js"(exports, module) {
var asciiSize = require_asciiSize();
var hasUnicode = require_hasUnicode();
var unicodeSize = require_unicodeSize();
function stringSize(string) {
return hasUnicode(string) ? unicodeSize(string) : asciiSize(string);
}
module.exports = stringSize;
}
});
// node_modules/lodash/size.js
var require_size = __commonJS({
"node_modules/lodash/size.js"(exports, module) {
var baseKeys = require_baseKeys();
var getTag = require_getTag();
var isArrayLike = require_isArrayLike();
var isString = require_isString();
var stringSize = require_stringSize();
var mapTag = "[object Map]";
var setTag = "[object Set]";
function size2(collection) {
if (collection == null) {
return 0;
}
if (isArrayLike(collection)) {
return isString(collection) ? stringSize(collection) : collection.length;
}
var tag = getTag(collection);
if (tag == mapTag || tag == setTag) {
return collection.size;
}
return baseKeys(collection).length;
}
module.exports = size2;
}
});
// node_modules/lodash/toLower.js
var require_toLower = __commonJS({
"node_modules/lodash/toLower.js"(exports, module) {
var toString = require_toString();
function toLower2(value) {
return toString(value).toLowerCase();
}
module.exports = toLower2;
}
});
// node_modules/lodash/_baseIsRegExp.js
var require_baseIsRegExp = __commonJS({
"node_modules/lodash/_baseIsRegExp.js"(exports, module) {
var baseGetTag = require_baseGetTag();
var isObjectLike = require_isObjectLike();
var regexpTag = "[object RegExp]";
function baseIsRegExp(value) {
return isObjectLike(value) && baseGetTag(value) == regexpTag;
}
module.exports = baseIsRegExp;
}
});
// node_modules/lodash/isRegExp.js
var require_isRegExp = __commonJS({
"node_modules/lodash/isRegExp.js"(exports, module) {
var baseIsRegExp = require_baseIsRegExp();
var baseUnary = require_baseUnary();
var nodeUtil = require_nodeUtil();
var nodeIsRegExp = nodeUtil && nodeUtil.isRegExp;
var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
module.exports = isRegExp;
}
});
// node_modules/lodash/truncate.js
var require_truncate = __commonJS({
"node_modules/lodash/truncate.js"(exports, module) {
var baseToString = require_baseToString();
var castSlice = require_castSlice();
var hasUnicode = require_hasUnicode();
var isObject = require_isObject();
var isRegExp = require_isRegExp();
var stringSize = require_stringSize();
var stringToArray = require_stringToArray();
var toInteger = require_toInteger();
var toString = require_toString();
var DEFAULT_TRUNC_LENGTH = 30;
var DEFAULT_TRUNC_OMISSION = "...";
var reFlags = /\w*$/;
function truncate2(string, options2) {
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
if (isObject(options2)) {
var separator = "separator" in options2 ? options2.separator : separator;
length = "length" in options2 ? toInteger(options2.length) : length;
omission = "omission" in options2 ? baseToString(options2.omission) : omission;
}
string = toString(string);
var strLength = string.length;
if (hasUnicode(string)) {
var strSymbols = stringToArray(string);
strLength = strSymbols.length;
}
if (length >= strLength) {
return string;
}
var end = length - stringSize(omission);
if (end < 1) {
return omission;
}
var result = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end);
if (separator === void 0) {
return result + omission;
}
if (strSymbols) {
end += result.length - end;
}
if (isRegExp(separator)) {
if (string.slice(end).search(separator)) {
var match, substring = result;
if (!separator.global) {
separator = RegExp(separator.source, toString(reFlags.exec(separator)) + "g");
}
separator.lastIndex = 0;
while (match = separator.exec(substring)) {
var newEnd = match.index;
}
result = result.slice(0, newEnd === void 0 ? end : newEnd);
}
} else if (string.indexOf(baseToString(separator), end) != end) {
var index = result.lastIndexOf(separator);
if (index > -1) {
result = result.slice(0, index);
}
}
return result + omission;
}
module.exports = truncate2;
}
});
// node_modules/lodash/_createSet.js
var require_createSet = __commonJS({
"node_modules/lodash/_createSet.js"(exports, module) {
var Set2 = require_Set();
var noop = require_noop();
var setToArray = require_setToArray();
var INFINITY = 1 / 0;
var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values) {
return new Set2(values);
};
module.exports = createSet;
}
});
// node_modules/lodash/_baseUniq.js
var require_baseUniq = __commonJS({
"node_modules/lodash/_baseUniq.js"(exports, module) {
var SetCache = require_SetCache();
var arrayIncludes = require_arrayIncludes();
var arrayIncludesWith = require_arrayIncludesWith();
var cacheHas = require_cacheHas();
var createSet = require_createSet();
var setToArray = require_setToArray();
var LARGE_ARRAY_SIZE = 200;
function baseUniq(array, iteratee, comparator) {
var index = -1, includes = arrayIncludes, length = array.length, isCommon = true, result = [], seen = result;
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
} else if (length >= LARGE_ARRAY_SIZE) {
var set3 = iteratee ? null : createSet(array);
if (set3) {
return setToArray(set3);
}
isCommon = false;
includes = cacheHas;
seen = new SetCache();
} else {
seen = iteratee ? [] : result;
}
outer:
while (++index < length) {
var value = array[index], computed = iteratee ? iteratee(value) : value;
value = comparator || value !== 0 ? value : 0;
if (isCommon && computed === computed) {
var seenIndex = seen.length;
while (seenIndex--) {
if (seen[seenIndex] === computed) {
continue outer;
}
}
if (iteratee) {
seen.push(computed);
}
result.push(value);
} else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
result.push(value);
}
}
return result;
}
module.exports = baseUniq;
}
});
// node_modules/lodash/uniq.js
var require_uniq = __commonJS({
"node_modules/lodash/uniq.js"(exports, module) {
var baseUniq = require_baseUniq();
function uniq2(array) {
return array && array.length ? baseUniq(array) : [];
}
module.exports = uniq2;
}
});
// node_modules/lodash/lodash.min.js
var require_lodash_min = __commonJS({
"node_modules/lodash/lodash.min.js"(exports, module) {
(function() {
function n(n2, t2, r2) {
switch (r2.length) {
case 0:
return n2.call(t2);
case 1:
return n2.call(t2, r2[0]);
case 2:
return n2.call(t2, r2[0], r2[1]);
case 3:
return n2.call(t2, r2[0], r2[1], r2[2]);
}
return n2.apply(t2, r2);
}
function t(n2, t2, r2, e2) {
for (var u2 = -1, i2 = null == n2 ? 0 : n2.length; ++u2 < i2; ) {
var o2 = n2[u2];
t2(e2, o2, r2(o2), n2);
}
return e2;
}
function r(n2, t2) {
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2 && t2(n2[r2], r2, n2) !== false; ) ;
return n2;
}
function e(n2, t2) {
for (var r2 = null == n2 ? 0 : n2.length; r2-- && t2(n2[r2], r2, n2) !== false; ) ;
return n2;
}
function u(n2, t2) {
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2; ) if (!t2(n2[r2], r2, n2)) return false;
return true;
}
function i(n2, t2) {
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
var o2 = n2[r2];
t2(o2, r2, n2) && (i2[u2++] = o2);
}
return i2;
}
function o(n2, t2) {
return !!(null == n2 ? 0 : n2.length) && y(n2, t2, 0) > -1;
}
function f(n2, t2, r2) {
for (var e2 = -1, u2 = null == n2 ? 0 : n2.length; ++e2 < u2; ) if (r2(t2, n2[e2])) return true;
return false;
}
function c(n2, t2) {
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length, u2 = Array(e2); ++r2 < e2; ) u2[r2] = t2(n2[r2], r2, n2);
return u2;
}
function a(n2, t2) {
for (var r2 = -1, e2 = t2.length, u2 = n2.length; ++r2 < e2; ) n2[u2 + r2] = t2[r2];
return n2;
}
function l(n2, t2, r2, e2) {
var u2 = -1, i2 = null == n2 ? 0 : n2.length;
for (e2 && i2 && (r2 = n2[++u2]); ++u2 < i2; ) r2 = t2(r2, n2[u2], u2, n2);
return r2;
}
function s(n2, t2, r2, e2) {
var u2 = null == n2 ? 0 : n2.length;
for (e2 && u2 && (r2 = n2[--u2]); u2--; ) r2 = t2(r2, n2[u2], u2, n2);
return r2;
}
function h(n2, t2) {
for (var r2 = -1, e2 = null == n2 ? 0 : n2.length; ++r2 < e2; ) if (t2(n2[r2], r2, n2)) return true;
return false;
}
function p(n2) {
return n2.split("");
}
function _(n2) {
return n2.match($t) || [];
}
function v(n2, t2, r2) {
var e2;
return r2(n2, function(n3, r3, u2) {
if (t2(n3, r3, u2)) return e2 = r3, false;
}), e2;
}
function g(n2, t2, r2, e2) {
for (var u2 = n2.length, i2 = r2 + (e2 ? 1 : -1); e2 ? i2-- : ++i2 < u2; ) if (t2(n2[i2], i2, n2)) return i2;
return -1;
}
function y(n2, t2, r2) {
return t2 === t2 ? Z(n2, t2, r2) : g(n2, b, r2);
}
function d(n2, t2, r2, e2) {
for (var u2 = r2 - 1, i2 = n2.length; ++u2 < i2; ) if (e2(n2[u2], t2)) return u2;
return -1;
}
function b(n2) {
return n2 !== n2;
}
function w(n2, t2) {
var r2 = null == n2 ? 0 : n2.length;
return r2 ? k(n2, t2) / r2 : Cn;
}
function m(n2) {
return function(t2) {
return null == t2 ? X : t2[n2];
};
}
function x(n2) {
return function(t2) {
return null == n2 ? X : n2[t2];
};
}
function j(n2, t2, r2, e2, u2) {
return u2(n2, function(n3, u3, i2) {
r2 = e2 ? (e2 = false, n3) : t2(r2, n3, u3, i2);
}), r2;
}
function A(n2, t2) {
var r2 = n2.length;
for (n2.sort(t2); r2--; ) n2[r2] = n2[r2].value;
return n2;
}
function k(n2, t2) {
for (var r2, e2 = -1, u2 = n2.length; ++e2 < u2; ) {
var i2 = t2(n2[e2]);
i2 !== X && (r2 = r2 === X ? i2 : r2 + i2);
}
return r2;
}
function O(n2, t2) {
for (var r2 = -1, e2 = Array(n2); ++r2 < n2; ) e2[r2] = t2(r2);
return e2;
}
function I(n2, t2) {
return c(t2, function(t3) {
return [t3, n2[t3]];
});
}
function R(n2) {
return n2 ? n2.slice(0, H(n2) + 1).replace(Lt, "") : n2;
}
function z(n2) {
return function(t2) {
return n2(t2);
};
}
function E(n2, t2) {
return c(t2, function(t3) {
return n2[t3];
});
}
function S(n2, t2) {
return n2.has(t2);
}
function W(n2, t2) {
for (var r2 = -1, e2 = n2.length; ++r2 < e2 && y(t2, n2[r2], 0) > -1; ) ;
return r2;
}
function L(n2, t2) {
for (var r2 = n2.length; r2-- && y(t2, n2[r2], 0) > -1; ) ;
return r2;
}
function C(n2, t2) {
for (var r2 = n2.length, e2 = 0; r2--; ) n2[r2] === t2 && ++e2;
return e2;
}
function U(n2) {
return "\\" + Yr[n2];
}
function B(n2, t2) {
return null == n2 ? X : n2[t2];
}
function T(n2) {
return Nr.test(n2);
}
function $(n2) {
return Pr.test(n2);
}
function D(n2) {
for (var t2, r2 = []; !(t2 = n2.next()).done; ) r2.push(t2.value);
return r2;
}
function M(n2) {
var t2 = -1, r2 = Array(n2.size);
return n2.forEach(function(n3, e2) {
r2[++t2] = [e2, n3];
}), r2;
}
function F(n2, t2) {
return function(r2) {
return n2(t2(r2));
};
}
function N(n2, t2) {
for (var r2 = -1, e2 = n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
var o2 = n2[r2];
o2 !== t2 && o2 !== cn || (n2[r2] = cn, i2[u2++] = r2);
}
return i2;
}
function P(n2) {
var t2 = -1, r2 = Array(n2.size);
return n2.forEach(function(n3) {
r2[++t2] = n3;
}), r2;
}
function q(n2) {
var t2 = -1, r2 = Array(n2.size);
return n2.forEach(function(n3) {
r2[++t2] = [n3, n3];
}), r2;
}
function Z(n2, t2, r2) {
for (var e2 = r2 - 1, u2 = n2.length; ++e2 < u2; ) if (n2[e2] === t2) return e2;
return -1;
}
function K(n2, t2, r2) {
for (var e2 = r2 + 1; e2--; ) if (n2[e2] === t2) return e2;
return e2;
}
function V(n2) {
return T(n2) ? J(n2) : _e(n2);
}
function G(n2) {
return T(n2) ? Y(n2) : p(n2);
}
function H(n2) {
for (var t2 = n2.length; t2-- && Ct.test(n2.charAt(t2)); ) ;
return t2;
}
function J(n2) {
for (var t2 = Mr.lastIndex = 0; Mr.test(n2); ) ++t2;
return t2;
}
function Y(n2) {
return n2.match(Mr) || [];
}
function Q(n2) {
return n2.match(Fr) || [];
}
var X, nn = "4.17.21", tn = 200, rn = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", en = "Expected a function", un = "Invalid `variable` option passed into `_.template`", on = "__lodash_hash_undefined__", fn = 500, cn = "__lodash_placeholder__", an = 1, ln = 2, sn = 4, hn = 1, pn = 2, _n = 1, vn = 2, gn = 4, yn = 8, dn = 16, bn = 32, wn = 64, mn = 128, xn = 256, jn = 512, An = 30, kn = "...", On = 800, In = 16, Rn = 1, zn = 2, En = 3, Sn = 1 / 0, Wn = 9007199254740991, Ln = 17976931348623157e292, Cn = NaN, Un = 4294967295, Bn = Un - 1, Tn = Un >>> 1, $n = [["ary", mn], ["bind", _n], ["bindKey", vn], ["curry", yn], ["curryRight", dn], ["flip", jn], ["partial", bn], ["partialRight", wn], ["rearg", xn]], Dn = "[object Arguments]", Mn = "[object Array]", Fn = "[object AsyncFunction]", Nn = "[object Boolean]", Pn = "[object Date]", qn = "[object DOMException]", Zn = "[object Error]", Kn = "[object Function]", Vn = "[object GeneratorFunction]", Gn = "[object Map]", Hn = "[object Number]", Jn = "[object Null]", Yn = "[object Object]", Qn = "[object Promise]", Xn = "[object Proxy]", nt = "[object RegExp]", tt = "[object Set]", rt = "[object String]", et = "[object Symbol]", ut = "[object Undefined]", it = "[object WeakMap]", ot = "[object WeakSet]", ft = "[object ArrayBuffer]", ct = "[object DataView]", at = "[object Float32Array]", lt = "[object Float64Array]", st = "[object Int8Array]", ht = "[object Int16Array]", pt = "[object Int32Array]", _t = "[object Uint8Array]", vt = "[object Uint8ClampedArray]", gt = "[object Uint16Array]", yt = "[object Uint32Array]", dt2 = /\b__p \+= '';/g, bt = /\b(__p \+=) '' \+/g, wt = /(__e\(.*?\)|\b__t\)) \+\n'';/g, mt = /&(?:amp|lt|gt|quot|#39);/g, xt = /[&<>"']/g, jt = RegExp(mt.source), At = RegExp(xt.source), kt = /<%-([\s\S]+?)%>/g, Ot = /<%([\s\S]+?)%>/g, It = /<%=([\s\S]+?)%>/g, Rt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, zt = /^\w*$/, Et = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, St = /[\\^$.*+?()[\]{}|]/g, Wt = RegExp(St.source), Lt = /^\s+/, Ct = /\s/, Ut = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Bt = /\{\n\/\* \[wrapped with (.+)\] \*/, Tt = /,? & /, $t = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Dt = /[()=,{}\[\]\/\s]/, Mt = /\\(\\)?/g, Ft = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Nt = /\w*$/, Pt = /^[-+]0x[0-9a-f]+$/i, qt = /^0b[01]+$/i, Zt = /^\[object .+?Constructor\]$/, Kt = /^0o[0-7]+$/i, Vt = /^(?:0|[1-9]\d*)$/, Gt = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Ht = /($^)/, Jt = /['\n\r\u2028\u2029\\]/g, Yt = "\\ud800-\\udfff", Qt = "\\u0300-\\u036f", Xt = "\\ufe20-\\ufe2f", nr = "\\u20d0-\\u20ff", tr = Qt + Xt + nr, rr = "\\u2700-\\u27bf", er = "a-z\\xdf-\\xf6\\xf8-\\xff", ur = "\\xac\\xb1\\xd7\\xf7", ir = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", or = "\\u2000-\\u206f", fr = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", cr = "A-Z\\xc0-\\xd6\\xd8-\\xde", ar = "\\ufe0e\\ufe0f", lr = ur + ir + or + fr, sr = "['’]", hr = "[" + Yt + "]", pr = "[" + lr + "]", _r = "[" + tr + "]", vr = "\\d+", gr = "[" + rr + "]", yr = "[" + er + "]", dr = "[^" + Yt + lr + vr + rr + er + cr + "]", br = "\\ud83c[\\udffb-\\udfff]", wr = "(?:" + _r + "|" + br + ")", mr = "[^" + Yt + "]", xr = "(?:\\ud83c[\\udde6-\\uddff]){2}", jr = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ar = "[" + cr + "]", kr = "\\u200d", Or = "(?:" + yr + "|" + dr + ")", Ir = "(?:" + Ar + "|" + dr + ")", Rr = "(?:" + sr + "(?:d|ll|m|re|s|t|ve))?", zr = "(?:" + sr + "(?:D|LL|M|RE|S|T|VE))?", Er = wr + "?", Sr = "[" + ar + "]?", Wr = "(?:" + kr + "(?:" + [mr, xr, jr].join("|") + ")" + Sr + Er + ")*", Lr = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", Cr = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Ur = Sr + Er + Wr, Br = "(?:" + [gr, xr, jr].join("|") + ")" + Ur, Tr = "(?:" + [mr + _r + "?", _r, xr, jr, hr].join("|") + ")", $r = RegExp(sr, "g"), Dr = RegExp(_r, "g"), Mr = RegExp(br + "(?=" + br + ")|" + Tr + Ur, "g"), Fr = RegExp([Ar + "?" + yr + "+" + Rr + "(?=" + [pr, Ar, "$"].join("|") + ")", Ir + "+" + zr + "(?=" + [pr, Ar + Or, "$"].join("|") + ")", Ar + "?" + Or + "+" + Rr, Ar + "+" + zr, Cr, Lr, vr, Br].join("|"), "g"), Nr = RegExp("[" + kr + Yt + tr + ar + "]"), Pr = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, qr = ["Array", "Buffer", "DataView", "Date", "Error", "Float32Array", "Float64Array", "Function", "Int8Array", "Int16Array", "Int32Array", "Map", "Math", "Object", "Promise", "RegExp", "Set", "String", "Symbol", "TypeError", "Uint8Array", "Uint8ClampedArray", "Uint16Array", "Uint32Array", "WeakMap", "_", "clearTimeout", "isFinite", "parseInt", "setTimeout"], Zr = -1, Kr = {};
Kr[at] = Kr[lt] = Kr[st] = Kr[ht] = Kr[pt] = Kr[_t] = Kr[vt] = Kr[gt] = Kr[yt] = true, Kr[Dn] = Kr[Mn] = Kr[ft] = Kr[Nn] = Kr[ct] = Kr[Pn] = Kr[Zn] = Kr[Kn] = Kr[Gn] = Kr[Hn] = Kr[Yn] = Kr[nt] = Kr[tt] = Kr[rt] = Kr[it] = false;
var Vr = {};
Vr[Dn] = Vr[Mn] = Vr[ft] = Vr[ct] = Vr[Nn] = Vr[Pn] = Vr[at] = Vr[lt] = Vr[st] = Vr[ht] = Vr[pt] = Vr[Gn] = Vr[Hn] = Vr[Yn] = Vr[nt] = Vr[tt] = Vr[rt] = Vr[et] = Vr[_t] = Vr[vt] = Vr[gt] = Vr[yt] = true, Vr[Zn] = Vr[Kn] = Vr[it] = false;
var Gr = {
"À": "A",
"Á": "A",
"Â": "A",
"Ã": "A",
"Ä": "A",
"Å": "A",
"à": "a",
"á": "a",
"â": "a",
"ã": "a",
"ä": "a",
"å": "a",
"Ç": "C",
"ç": "c",
"Ð": "D",
"ð": "d",
"È": "E",
"É": "E",
"Ê": "E",
"Ë": "E",
"è": "e",
"é": "e",
"ê": "e",
"ë": "e",
"Ì": "I",
"Í": "I",
"Î": "I",
"Ï": "I",
"ì": "i",
"í": "i",
"î": "i",
"ï": "i",
"Ñ": "N",
"ñ": "n",
"Ò": "O",
"Ó": "O",
"Ô": "O",
"Õ": "O",
"Ö": "O",
"Ø": "O",
"ò": "o",
"ó": "o",
"ô": "o",
"õ": "o",
"ö": "o",
"ø": "o",
"Ù": "U",
"Ú": "U",
"Û": "U",
"Ü": "U",
"ù": "u",
"ú": "u",
"û": "u",
"ü": "u",
"Ý": "Y",
"ý": "y",
"ÿ": "y",
"Æ": "Ae",
"æ": "ae",
"Þ": "Th",
"þ": "th",
"ß": "ss",
"Ā": "A",
"Ă": "A",
"Ą": "A",
"ā": "a",
"ă": "a",
"ą": "a",
"Ć": "C",
"Ĉ": "C",
"Ċ": "C",
"Č": "C",
"ć": "c",
"ĉ": "c",
"ċ": "c",
"č": "c",
"Ď": "D",
"Đ": "D",
"ď": "d",
"đ": "d",
"Ē": "E",
"Ĕ": "E",
"Ė": "E",
"Ę": "E",
"Ě": "E",
"ē": "e",
"ĕ": "e",
"ė": "e",
"ę": "e",
"ě": "e",
"Ĝ": "G",
"Ğ": "G",
"Ġ": "G",
"Ģ": "G",
"ĝ": "g",
"ğ": "g",
"ġ": "g",
"ģ": "g",
"Ĥ": "H",
"Ħ": "H",
"ĥ": "h",
"ħ": "h",
"Ĩ": "I",
"Ī": "I",
"Ĭ": "I",
"Į": "I",
"İ": "I",
"ĩ": "i",
"ī": "i",
"ĭ": "i",
"į": "i",
"ı": "i",
"Ĵ": "J",
"ĵ": "j",
"Ķ": "K",
"ķ": "k",
"ĸ": "k",
"Ĺ": "L",
"Ļ": "L",
"Ľ": "L",
"Ŀ": "L",
"Ł": "L",
"ĺ": "l",
"ļ": "l",
"ľ": "l",
"ŀ": "l",
"ł": "l",
"Ń": "N",
"Ņ": "N",
"Ň": "N",
"Ŋ": "N",
"ń": "n",
"ņ": "n",
"ň": "n",
"ŋ": "n",
"Ō": "O",
"Ŏ": "O",
"Ő": "O",
"ō": "o",
"ŏ": "o",
"ő": "o",
"Ŕ": "R",
"Ŗ": "R",
"Ř": "R",
"ŕ": "r",
"ŗ": "r",
"ř": "r",
"Ś": "S",
"Ŝ": "S",
"Ş": "S",
"Š": "S",
"ś": "s",
"ŝ": "s",
"ş": "s",
"š": "s",
"Ţ": "T",
"Ť": "T",
"Ŧ": "T",
"ţ": "t",
"ť": "t",
"ŧ": "t",
"Ũ": "U",
"Ū": "U",
"Ŭ": "U",
"Ů": "U",
"Ű": "U",
"Ų": "U",
"ũ": "u",
"ū": "u",
"ŭ": "u",
"ů": "u",
"ű": "u",
"ų": "u",
"Ŵ": "W",
"ŵ": "w",
"Ŷ": "Y",
"ŷ": "y",
"Ÿ": "Y",
"Ź": "Z",
"Ż": "Z",
"Ž": "Z",
"ź": "z",
"ż": "z",
"ž": "z",
"IJ": "IJ",
"ij": "ij",
"Œ": "Oe",
"œ": "oe",
"ʼn": "'n",
"ſ": "s"
}, Hr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Jr = { "&": "&", "<": "<", ">": ">", """: '"', "'": "'" }, Yr = { "\\": "\\", "'": "'", "\n": "n", "\r": "r", "\u2028": "u2028", "\u2029": "u2029" }, Qr = parseFloat, Xr = parseInt, ne = "object" == typeof global && global && global.Object === Object && global, te = "object" == typeof self && self && self.Object === Object && self, re = ne || te || Function("return this")(), ee = "object" == typeof exports && exports && !exports.nodeType && exports, ue = ee && "object" == typeof module && module && !module.nodeType && module, ie = ue && ue.exports === ee, oe = ie && ne.process, fe = function() {
try {
var n2 = ue && ue.require && ue.require("util").types;
return n2 ? n2 : oe && oe.binding && oe.binding("util");
} catch (n3) {
}
}(), ce = fe && fe.isArrayBuffer, ae = fe && fe.isDate, le = fe && fe.isMap, se = fe && fe.isRegExp, he = fe && fe.isSet, pe = fe && fe.isTypedArray, _e = m("length"), ve = x(Gr), ge = x(Hr), ye = x(Jr), de = function p2(x2) {
function Z2(n2) {
if (cc(n2) && !bh(n2) && !(n2 instanceof Ct2)) {
if (n2 instanceof Y2) return n2;
if (bl.call(n2, "__wrapped__")) return eo(n2);
}
return new Y2(n2);
}
function J2() {
}
function Y2(n2, t2) {
this.__wrapped__ = n2, this.__actions__ = [], this.__chain__ = !!t2, this.__index__ = 0, this.__values__ = X;
}
function Ct2(n2) {
this.__wrapped__ = n2, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = false, this.__iteratees__ = [], this.__takeCount__ = Un, this.__views__ = [];
}
function $t2() {
var n2 = new Ct2(this.__wrapped__);
return n2.__actions__ = Tu(this.__actions__), n2.__dir__ = this.__dir__, n2.__filtered__ = this.__filtered__, n2.__iteratees__ = Tu(this.__iteratees__), n2.__takeCount__ = this.__takeCount__, n2.__views__ = Tu(this.__views__), n2;
}
function Yt2() {
if (this.__filtered__) {
var n2 = new Ct2(this);
n2.__dir__ = -1, n2.__filtered__ = true;
} else n2 = this.clone(), n2.__dir__ *= -1;
return n2;
}
function Qt2() {
var n2 = this.__wrapped__.value(), t2 = this.__dir__, r2 = bh(n2), e2 = t2 < 0, u2 = r2 ? n2.length : 0, i2 = Oi(0, u2, this.__views__), o2 = i2.start, f2 = i2.end, c2 = f2 - o2, a2 = e2 ? f2 : o2 - 1, l2 = this.__iteratees__, s2 = l2.length, h2 = 0, p3 = Hl(c2, this.__takeCount__);
if (!r2 || !e2 && u2 == c2 && p3 == c2) return wu(n2, this.__actions__);
var _2 = [];
n: for (; c2-- && h2 < p3; ) {
a2 += t2;
for (var v2 = -1, g2 = n2[a2]; ++v2 < s2; ) {
var y2 = l2[v2], d2 = y2.iteratee, b2 = y2.type, w2 = d2(g2);
if (b2 == zn) g2 = w2;
else if (!w2) {
if (b2 == Rn) continue n;
break n;
}
}
_2[h2++] = g2;
}
return _2;
}
function Xt2(n2) {
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
for (this.clear(); ++t2 < r2; ) {
var e2 = n2[t2];
this.set(e2[0], e2[1]);
}
}
function nr2() {
this.__data__ = is ? is(null) : {}, this.size = 0;
}
function tr2(n2) {
var t2 = this.has(n2) && delete this.__data__[n2];
return this.size -= t2 ? 1 : 0, t2;
}
function rr2(n2) {
var t2 = this.__data__;
if (is) {
var r2 = t2[n2];
return r2 === on ? X : r2;
}
return bl.call(t2, n2) ? t2[n2] : X;
}
function er2(n2) {
var t2 = this.__data__;
return is ? t2[n2] !== X : bl.call(t2, n2);
}
function ur2(n2, t2) {
var r2 = this.__data__;
return this.size += this.has(n2) ? 0 : 1, r2[n2] = is && t2 === X ? on : t2, this;
}
function ir2(n2) {
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
for (this.clear(); ++t2 < r2; ) {
var e2 = n2[t2];
this.set(e2[0], e2[1]);
}
}
function or2() {
this.__data__ = [], this.size = 0;
}
function fr2(n2) {
var t2 = this.__data__, r2 = Wr2(t2, n2);
return !(r2 < 0) && (r2 == t2.length - 1 ? t2.pop() : Ll.call(t2, r2, 1), --this.size, true);
}
function cr2(n2) {
var t2 = this.__data__, r2 = Wr2(t2, n2);
return r2 < 0 ? X : t2[r2][1];
}
function ar2(n2) {
return Wr2(this.__data__, n2) > -1;
}
function lr2(n2, t2) {
var r2 = this.__data__, e2 = Wr2(r2, n2);
return e2 < 0 ? (++this.size, r2.push([n2, t2])) : r2[e2][1] = t2, this;
}
function sr2(n2) {
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
for (this.clear(); ++t2 < r2; ) {
var e2 = n2[t2];
this.set(e2[0], e2[1]);
}
}
function hr2() {
this.size = 0, this.__data__ = { hash: new Xt2(), map: new (ts || ir2)(), string: new Xt2() };
}
function pr2(n2) {
var t2 = xi(this, n2).delete(n2);
return this.size -= t2 ? 1 : 0, t2;
}
function _r2(n2) {
return xi(this, n2).get(n2);
}
function vr2(n2) {
return xi(this, n2).has(n2);
}
function gr2(n2, t2) {
var r2 = xi(this, n2), e2 = r2.size;
return r2.set(n2, t2), this.size += r2.size == e2 ? 0 : 1, this;
}
function yr2(n2) {
var t2 = -1, r2 = null == n2 ? 0 : n2.length;
for (this.__data__ = new sr2(); ++t2 < r2; ) this.add(n2[t2]);
}
function dr2(n2) {
return this.__data__.set(n2, on), this;
}
function br2(n2) {
return this.__data__.has(n2);
}
function wr2(n2) {
this.size = (this.__data__ = new ir2(n2)).size;
}
function mr2() {
this.__data__ = new ir2(), this.size = 0;
}
function xr2(n2) {
var t2 = this.__data__, r2 = t2.delete(n2);
return this.size = t2.size, r2;
}
function jr2(n2) {
return this.__data__.get(n2);
}
function Ar2(n2) {
return this.__data__.has(n2);
}
function kr2(n2, t2) {
var r2 = this.__data__;
if (r2 instanceof ir2) {
var e2 = r2.__data__;
if (!ts || e2.length < tn - 1) return e2.push([n2, t2]), this.size = ++r2.size, this;
r2 = this.__data__ = new sr2(e2);
}
return r2.set(n2, t2), this.size = r2.size, this;
}
function Or2(n2, t2) {
var r2 = bh(n2), e2 = !r2 && dh(n2), u2 = !r2 && !e2 && mh(n2), i2 = !r2 && !e2 && !u2 && Oh(n2), o2 = r2 || e2 || u2 || i2, f2 = o2 ? O(n2.length, hl) : [], c2 = f2.length;
for (var a2 in n2) !t2 && !bl.call(n2, a2) || o2 && ("length" == a2 || u2 && ("offset" == a2 || "parent" == a2) || i2 && ("buffer" == a2 || "byteLength" == a2 || "byteOffset" == a2) || Ci(a2, c2)) || f2.push(a2);
return f2;
}
function Ir2(n2) {
var t2 = n2.length;
return t2 ? n2[tu(0, t2 - 1)] : X;
}
function Rr2(n2, t2) {
return Xi(Tu(n2), Mr2(t2, 0, n2.length));
}
function zr2(n2) {
return Xi(Tu(n2));
}
function Er2(n2, t2, r2) {
(r2 === X || Gf(n2[t2], r2)) && (r2 !== X || t2 in n2) || Br2(n2, t2, r2);
}
function Sr2(n2, t2, r2) {
var e2 = n2[t2];
bl.call(n2, t2) && Gf(e2, r2) && (r2 !== X || t2 in n2) || Br2(n2, t2, r2);
}
function Wr2(n2, t2) {
for (var r2 = n2.length; r2--; ) if (Gf(n2[r2][0], t2)) return r2;
return -1;
}
function Lr2(n2, t2, r2, e2) {
return ys(n2, function(n3, u2, i2) {
t2(e2, n3, r2(n3), i2);
}), e2;
}
function Cr2(n2, t2) {
return n2 && $u(t2, Pc(t2), n2);
}
function Ur2(n2, t2) {
return n2 && $u(t2, qc(t2), n2);
}
function Br2(n2, t2, r2) {
"__proto__" == t2 && Tl ? Tl(n2, t2, { configurable: true, enumerable: true, value: r2, writable: true }) : n2[t2] = r2;
}
function Tr2(n2, t2) {
for (var r2 = -1, e2 = t2.length, u2 = il(e2), i2 = null == n2; ++r2 < e2; ) u2[r2] = i2 ? X : Mc(n2, t2[r2]);
return u2;
}
function Mr2(n2, t2, r2) {
return n2 === n2 && (r2 !== X && (n2 = n2 <= r2 ? n2 : r2), t2 !== X && (n2 = n2 >= t2 ? n2 : t2)), n2;
}
function Fr2(n2, t2, e2, u2, i2, o2) {
var f2, c2 = t2 & an, a2 = t2 & ln, l2 = t2 & sn;
if (e2 && (f2 = i2 ? e2(n2, u2, i2, o2) : e2(n2)), f2 !== X) return f2;
if (!fc(n2)) return n2;
var s2 = bh(n2);
if (s2) {
if (f2 = zi(n2), !c2) return Tu(n2, f2);
} else {
var h2 = zs(n2), p3 = h2 == Kn || h2 == Vn;
if (mh(n2)) return Iu(n2, c2);
if (h2 == Yn || h2 == Dn || p3 && !i2) {
if (f2 = a2 || p3 ? {} : Ei(n2), !c2) return a2 ? Mu(n2, Ur2(f2, n2)) : Du(n2, Cr2(f2, n2));
} else {
if (!Vr[h2]) return i2 ? n2 : {};
f2 = Si(n2, h2, c2);
}
}
o2 || (o2 = new wr2());
var _2 = o2.get(n2);
if (_2) return _2;
o2.set(n2, f2), kh(n2) ? n2.forEach(function(r2) {
f2.add(Fr2(r2, t2, e2, r2, n2, o2));
}) : jh(n2) && n2.forEach(function(r2, u3) {
f2.set(u3, Fr2(r2, t2, e2, u3, n2, o2));
});
var v2 = l2 ? a2 ? di : yi : a2 ? qc : Pc, g2 = s2 ? X : v2(n2);
return r(g2 || n2, function(r2, u3) {
g2 && (u3 = r2, r2 = n2[u3]), Sr2(f2, u3, Fr2(r2, t2, e2, u3, n2, o2));
}), f2;
}
function Nr2(n2) {
var t2 = Pc(n2);
return function(r2) {
return Pr2(r2, n2, t2);
};
}
function Pr2(n2, t2, r2) {
var e2 = r2.length;
if (null == n2) return !e2;
for (n2 = ll(n2); e2--; ) {
var u2 = r2[e2], i2 = t2[u2], o2 = n2[u2];
if (o2 === X && !(u2 in n2) || !i2(o2)) return false;
}
return true;
}
function Gr2(n2, t2, r2) {
if ("function" != typeof n2) throw new pl(en);
return Ws(function() {
n2.apply(X, r2);
}, t2);
}
function Hr2(n2, t2, r2, e2) {
var u2 = -1, i2 = o, a2 = true, l2 = n2.length, s2 = [], h2 = t2.length;
if (!l2) return s2;
r2 && (t2 = c(t2, z(r2))), e2 ? (i2 = f, a2 = false) : t2.length >= tn && (i2 = S, a2 = false, t2 = new yr2(t2));
n: for (; ++u2 < l2; ) {
var p3 = n2[u2], _2 = null == r2 ? p3 : r2(p3);
if (p3 = e2 || 0 !== p3 ? p3 : 0, a2 && _2 === _2) {
for (var v2 = h2; v2--; ) if (t2[v2] === _2) continue n;
s2.push(p3);
} else i2(t2, _2, e2) || s2.push(p3);
}
return s2;
}
function Jr2(n2, t2) {
var r2 = true;
return ys(n2, function(n3, e2, u2) {
return r2 = !!t2(n3, e2, u2);
}), r2;
}
function Yr2(n2, t2, r2) {
for (var e2 = -1, u2 = n2.length; ++e2 < u2; ) {
var i2 = n2[e2], o2 = t2(i2);
if (null != o2 && (f2 === X ? o2 === o2 && !bc(o2) : r2(o2, f2))) var f2 = o2, c2 = i2;
}
return c2;
}
function ne2(n2, t2, r2, e2) {
var u2 = n2.length;
for (r2 = kc(r2), r2 < 0 && (r2 = -r2 > u2 ? 0 : u2 + r2), e2 = e2 === X || e2 > u2 ? u2 : kc(e2), e2 < 0 && (e2 += u2), e2 = r2 > e2 ? 0 : Oc(e2); r2 < e2; ) n2[r2++] = t2;
return n2;
}
function te2(n2, t2) {
var r2 = [];
return ys(n2, function(n3, e2, u2) {
t2(n3, e2, u2) && r2.push(n3);
}), r2;
}
function ee2(n2, t2, r2, e2, u2) {
var i2 = -1, o2 = n2.length;
for (r2 || (r2 = Li), u2 || (u2 = []); ++i2 < o2; ) {
var f2 = n2[i2];
t2 > 0 && r2(f2) ? t2 > 1 ? ee2(f2, t2 - 1, r2, e2, u2) : a(u2, f2) : e2 || (u2[u2.length] = f2);
}
return u2;
}
function ue2(n2, t2) {
return n2 && bs(n2, t2, Pc);
}
function oe2(n2, t2) {
return n2 && ws(n2, t2, Pc);
}
function fe2(n2, t2) {
return i(t2, function(t3) {
return uc(n2[t3]);
});
}
function _e2(n2, t2) {
t2 = ku(t2, n2);
for (var r2 = 0, e2 = t2.length; null != n2 && r2 < e2; ) n2 = n2[no(t2[r2++])];
return r2 && r2 == e2 ? n2 : X;
}
function de2(n2, t2, r2) {
var e2 = t2(n2);
return bh(n2) ? e2 : a(e2, r2(n2));
}
function we(n2) {
return null == n2 ? n2 === X ? ut : Jn : Bl && Bl in ll(n2) ? ki(n2) : Ki(n2);
}
function me(n2, t2) {
return n2 > t2;
}
function xe(n2, t2) {
return null != n2 && bl.call(n2, t2);
}
function je(n2, t2) {
return null != n2 && t2 in ll(n2);
}
function Ae(n2, t2, r2) {
return n2 >= Hl(t2, r2) && n2 < Gl(t2, r2);
}
function ke(n2, t2, r2) {
for (var e2 = r2 ? f : o, u2 = n2[0].length, i2 = n2.length, a2 = i2, l2 = il(i2), s2 = 1 / 0, h2 = []; a2--; ) {
var p3 = n2[a2];
a2 && t2 && (p3 = c(p3, z(t2))), s2 = Hl(p3.length, s2), l2[a2] = !r2 && (t2 || u2 >= 120 && p3.length >= 120) ? new yr2(a2 && p3) : X;
}
p3 = n2[0];
var _2 = -1, v2 = l2[0];
n: for (; ++_2 < u2 && h2.length < s2; ) {
var g2 = p3[_2], y2 = t2 ? t2(g2) : g2;
if (g2 = r2 || 0 !== g2 ? g2 : 0, !(v2 ? S(v2, y2) : e2(h2, y2, r2))) {
for (a2 = i2; --a2; ) {
var d2 = l2[a2];
if (!(d2 ? S(d2, y2) : e2(n2[a2], y2, r2))) continue n;
}
v2 && v2.push(y2), h2.push(g2);
}
}
return h2;
}
function Oe(n2, t2, r2, e2) {
return ue2(n2, function(n3, u2, i2) {
t2(e2, r2(n3), u2, i2);
}), e2;
}
function Ie(t2, r2, e2) {
r2 = ku(r2, t2), t2 = Gi(t2, r2);
var u2 = null == t2 ? t2 : t2[no(jo(r2))];
return null == u2 ? X : n(u2, t2, e2);
}
function Re(n2) {
return cc(n2) && we(n2) == Dn;
}
function ze(n2) {
return cc(n2) && we(n2) == ft;
}
function Ee(n2) {
return cc(n2) && we(n2) == Pn;
}
function Se(n2, t2, r2, e2, u2) {
return n2 === t2 || (null == n2 || null == t2 || !cc(n2) && !cc(t2) ? n2 !== n2 && t2 !== t2 : We(n2, t2, r2, e2, Se, u2));
}
function We(n2, t2, r2, e2, u2, i2) {
var o2 = bh(n2), f2 = bh(t2), c2 = o2 ? Mn : zs(n2), a2 = f2 ? Mn : zs(t2);
c2 = c2 == Dn ? Yn : c2, a2 = a2 == Dn ? Yn : a2;
var l2 = c2 == Yn, s2 = a2 == Yn, h2 = c2 == a2;
if (h2 && mh(n2)) {
if (!mh(t2)) return false;
o2 = true, l2 = false;
}
if (h2 && !l2) return i2 || (i2 = new wr2()), o2 || Oh(n2) ? pi(n2, t2, r2, e2, u2, i2) : _i(n2, t2, c2, r2, e2, u2, i2);
if (!(r2 & hn)) {
var p3 = l2 && bl.call(n2, "__wrapped__"), _2 = s2 && bl.call(t2, "__wrapped__");
if (p3 || _2) {
var v2 = p3 ? n2.value() : n2, g2 = _2 ? t2.value() : t2;
return i2 || (i2 = new wr2()), u2(v2, g2, r2, e2, i2);
}
}
return !!h2 && (i2 || (i2 = new wr2()), vi(n2, t2, r2, e2, u2, i2));
}
function Le(n2) {
return cc(n2) && zs(n2) == Gn;
}
function Ce(n2, t2, r2, e2) {
var u2 = r2.length, i2 = u2, o2 = !e2;
if (null == n2) return !i2;
for (n2 = ll(n2); u2--; ) {
var f2 = r2[u2];
if (o2 && f2[2] ? f2[1] !== n2[f2[0]] : !(f2[0] in n2)) return false;
}
for (; ++u2 < i2; ) {
f2 = r2[u2];
var c2 = f2[0], a2 = n2[c2], l2 = f2[1];
if (o2 && f2[2]) {
if (a2 === X && !(c2 in n2)) return false;
} else {
var s2 = new wr2();
if (e2) var h2 = e2(a2, l2, c2, n2, t2, s2);
if (!(h2 === X ? Se(l2, a2, hn | pn, e2, s2) : h2)) return false;
}
}
return true;
}
function Ue(n2) {
return !(!fc(n2) || Di(n2)) && (uc(n2) ? kl : Zt).test(to(n2));
}
function Be(n2) {
return cc(n2) && we(n2) == nt;
}
function Te(n2) {
return cc(n2) && zs(n2) == tt;
}
function $e(n2) {
return cc(n2) && oc(n2.length) && !!Kr[we(n2)];
}
function De(n2) {
return "function" == typeof n2 ? n2 : null == n2 ? La : "object" == typeof n2 ? bh(n2) ? Ze(n2[0], n2[1]) : qe(n2) : Fa(n2);
}
function Me(n2) {
if (!Mi(n2)) return Vl(n2);
var t2 = [];
for (var r2 in ll(n2)) bl.call(n2, r2) && "constructor" != r2 && t2.push(r2);
return t2;
}
function Fe(n2) {
if (!fc(n2)) return Zi(n2);
var t2 = Mi(n2), r2 = [];
for (var e2 in n2) ("constructor" != e2 || !t2 && bl.call(n2, e2)) && r2.push(e2);
return r2;
}
function Ne(n2, t2) {
return n2 < t2;
}
function Pe(n2, t2) {
var r2 = -1, e2 = Hf(n2) ? il(n2.length) : [];
return ys(n2, function(n3, u2, i2) {
e2[++r2] = t2(n3, u2, i2);
}), e2;
}
function qe(n2) {
var t2 = ji(n2);
return 1 == t2.length && t2[0][2] ? Ni(t2[0][0], t2[0][1]) : function(r2) {
return r2 === n2 || Ce(r2, n2, t2);
};
}
function Ze(n2, t2) {
return Bi(n2) && Fi(t2) ? Ni(no(n2), t2) : function(r2) {
var e2 = Mc(r2, n2);
return e2 === X && e2 === t2 ? Nc(r2, n2) : Se(t2, e2, hn | pn);
};
}
function Ke(n2, t2, r2, e2, u2) {
n2 !== t2 && bs(t2, function(i2, o2) {
if (u2 || (u2 = new wr2()), fc(i2)) Ve(n2, t2, o2, r2, Ke, e2, u2);
else {
var f2 = e2 ? e2(Ji(n2, o2), i2, o2 + "", n2, t2, u2) : X;
f2 === X && (f2 = i2), Er2(n2, o2, f2);
}
}, qc);
}
function Ve(n2, t2, r2, e2, u2, i2, o2) {
var f2 = Ji(n2, r2), c2 = Ji(t2, r2), a2 = o2.get(c2);
if (a2) return Er2(n2, r2, a2), X;
var l2 = i2 ? i2(f2, c2, r2 + "", n2, t2, o2) : X, s2 = l2 === X;
if (s2) {
var h2 = bh(c2), p3 = !h2 && mh(c2), _2 = !h2 && !p3 && Oh(c2);
l2 = c2, h2 || p3 || _2 ? bh(f2) ? l2 = f2 : Jf(f2) ? l2 = Tu(f2) : p3 ? (s2 = false, l2 = Iu(c2, true)) : _2 ? (s2 = false, l2 = Wu(c2, true)) : l2 = [] : gc(c2) || dh(c2) ? (l2 = f2, dh(f2) ? l2 = Rc(f2) : fc(f2) && !uc(f2) || (l2 = Ei(c2))) : s2 = false;
}
s2 && (o2.set(c2, l2), u2(l2, c2, e2, i2, o2), o2.delete(c2)), Er2(n2, r2, l2);
}
function Ge(n2, t2) {
var r2 = n2.length;
if (r2) return t2 += t2 < 0 ? r2 : 0, Ci(t2, r2) ? n2[t2] : X;
}
function He(n2, t2, r2) {
t2 = t2.length ? c(t2, function(n3) {
return bh(n3) ? function(t3) {
return _e2(t3, 1 === n3.length ? n3[0] : n3);
} : n3;
}) : [La];
var e2 = -1;
return t2 = c(t2, z(mi())), A(Pe(n2, function(n3, r3, u2) {
return { criteria: c(t2, function(t3) {
return t3(n3);
}), index: ++e2, value: n3 };
}), function(n3, t3) {
return Cu(n3, t3, r2);
});
}
function Je(n2, t2) {
return Ye(n2, t2, function(t3, r2) {
return Nc(n2, r2);
});
}
function Ye(n2, t2, r2) {
for (var e2 = -1, u2 = t2.length, i2 = {}; ++e2 < u2; ) {
var o2 = t2[e2], f2 = _e2(n2, o2);
r2(f2, o2) && fu(i2, ku(o2, n2), f2);
}
return i2;
}
function Qe(n2) {
return function(t2) {
return _e2(t2, n2);
};
}
function Xe(n2, t2, r2, e2) {
var u2 = e2 ? d : y, i2 = -1, o2 = t2.length, f2 = n2;
for (n2 === t2 && (t2 = Tu(t2)), r2 && (f2 = c(n2, z(r2))); ++i2 < o2; ) for (var a2 = 0, l2 = t2[i2], s2 = r2 ? r2(l2) : l2; (a2 = u2(f2, s2, a2, e2)) > -1; ) f2 !== n2 && Ll.call(f2, a2, 1), Ll.call(n2, a2, 1);
return n2;
}
function nu(n2, t2) {
for (var r2 = n2 ? t2.length : 0, e2 = r2 - 1; r2--; ) {
var u2 = t2[r2];
if (r2 == e2 || u2 !== i2) {
var i2 = u2;
Ci(u2) ? Ll.call(n2, u2, 1) : yu(n2, u2);
}
}
return n2;
}
function tu(n2, t2) {
return n2 + Nl(Ql() * (t2 - n2 + 1));
}
function ru(n2, t2, r2, e2) {
for (var u2 = -1, i2 = Gl(Fl((t2 - n2) / (r2 || 1)), 0), o2 = il(i2); i2--; ) o2[e2 ? i2 : ++u2] = n2, n2 += r2;
return o2;
}
function eu(n2, t2) {
var r2 = "";
if (!n2 || t2 < 1 || t2 > Wn) return r2;
do
t2 % 2 && (r2 += n2), t2 = Nl(t2 / 2), t2 && (n2 += n2);
while (t2);
return r2;
}
function uu(n2, t2) {
return Ls(Vi(n2, t2, La), n2 + "");
}
function iu(n2) {
return Ir2(ra(n2));
}
function ou(n2, t2) {
var r2 = ra(n2);
return Xi(r2, Mr2(t2, 0, r2.length));
}
function fu(n2, t2, r2, e2) {
if (!fc(n2)) return n2;
t2 = ku(t2, n2);
for (var u2 = -1, i2 = t2.length, o2 = i2 - 1, f2 = n2; null != f2 && ++u2 < i2; ) {
var c2 = no(t2[u2]), a2 = r2;
if ("__proto__" === c2 || "constructor" === c2 || "prototype" === c2) return n2;
if (u2 != o2) {
var l2 = f2[c2];
a2 = e2 ? e2(l2, c2, f2) : X, a2 === X && (a2 = fc(l2) ? l2 : Ci(t2[u2 + 1]) ? [] : {});
}
Sr2(f2, c2, a2), f2 = f2[c2];
}
return n2;
}
function cu(n2) {
return Xi(ra(n2));
}
function au(n2, t2, r2) {
var e2 = -1, u2 = n2.length;
t2 < 0 && (t2 = -t2 > u2 ? 0 : u2 + t2), r2 = r2 > u2 ? u2 : r2, r2 < 0 && (r2 += u2), u2 = t2 > r2 ? 0 : r2 - t2 >>> 0, t2 >>>= 0;
for (var i2 = il(u2); ++e2 < u2; ) i2[e2] = n2[e2 + t2];
return i2;
}
function lu(n2, t2) {
var r2;
return ys(n2, function(n3, e2, u2) {
return r2 = t2(n3, e2, u2), !r2;
}), !!r2;
}
function su(n2, t2, r2) {
var e2 = 0, u2 = null == n2 ? e2 : n2.length;
if ("number" == typeof t2 && t2 === t2 && u2 <= Tn) {
for (; e2 < u2; ) {
var i2 = e2 + u2 >>> 1, o2 = n2[i2];
null !== o2 && !bc(o2) && (r2 ? o2 <= t2 : o2 < t2) ? e2 = i2 + 1 : u2 = i2;
}
return u2;
}
return hu(n2, t2, La, r2);
}
function hu(n2, t2, r2, e2) {
var u2 = 0, i2 = null == n2 ? 0 : n2.length;
if (0 === i2) return 0;
t2 = r2(t2);
for (var o2 = t2 !== t2, f2 = null === t2, c2 = bc(t2), a2 = t2 === X; u2 < i2; ) {
var l2 = Nl((u2 + i2) / 2), s2 = r2(n2[l2]), h2 = s2 !== X, p3 = null === s2, _2 = s2 === s2, v2 = bc(s2);
if (o2) var g2 = e2 || _2;
else g2 = a2 ? _2 && (e2 || h2) : f2 ? _2 && h2 && (e2 || !p3) : c2 ? _2 && h2 && !p3 && (e2 || !v2) : !p3 && !v2 && (e2 ? s2 <= t2 : s2 < t2);
g2 ? u2 = l2 + 1 : i2 = l2;
}
return Hl(i2, Bn);
}
function pu(n2, t2) {
for (var r2 = -1, e2 = n2.length, u2 = 0, i2 = []; ++r2 < e2; ) {
var o2 = n2[r2], f2 = t2 ? t2(o2) : o2;
if (!r2 || !Gf(f2, c2)) {
var c2 = f2;
i2[u2++] = 0 === o2 ? 0 : o2;
}
}
return i2;
}
function _u(n2) {
return "number" == typeof n2 ? n2 : bc(n2) ? Cn : +n2;
}
function vu(n2) {
if ("string" == typeof n2) return n2;
if (bh(n2)) return c(n2, vu) + "";
if (bc(n2)) return vs ? vs.call(n2) : "";
var t2 = n2 + "";
return "0" == t2 && 1 / n2 == -Sn ? "-0" : t2;
}
function gu(n2, t2, r2) {
var e2 = -1, u2 = o, i2 = n2.length, c2 = true, a2 = [], l2 = a2;
if (r2) c2 = false, u2 = f;
else if (i2 >= tn) {
var s2 = t2 ? null : ks(n2);
if (s2) return P(s2);
c2 = false, u2 = S, l2 = new yr2();
} else l2 = t2 ? [] : a2;
n: for (; ++e2 < i2; ) {
var h2 = n2[e2], p3 = t2 ? t2(h2) : h2;
if (h2 = r2 || 0 !== h2 ? h2 : 0, c2 && p3 === p3) {
for (var _2 = l2.length; _2--; ) if (l2[_2] === p3) continue n;
t2 && l2.push(p3), a2.push(h2);
} else u2(l2, p3, r2) || (l2 !== a2 && l2.push(p3), a2.push(h2));
}
return a2;
}
function yu(n2, t2) {
return t2 = ku(t2, n2), n2 = Gi(n2, t2), null == n2 || delete n2[no(jo(t2))];
}
function du(n2, t2, r2, e2) {
return fu(n2, t2, r2(_e2(n2, t2)), e2);
}
function bu(n2, t2, r2, e2) {
for (var u2 = n2.length, i2 = e2 ? u2 : -1; (e2 ? i2-- : ++i2 < u2) && t2(n2[i2], i2, n2); ) ;
return r2 ? au(n2, e2 ? 0 : i2, e2 ? i2 + 1 : u2) : au(n2, e2 ? i2 + 1 : 0, e2 ? u2 : i2);
}
function wu(n2, t2) {
var r2 = n2;
return r2 instanceof Ct2 && (r2 = r2.value()), l(t2, function(n3, t3) {
return t3.func.apply(t3.thisArg, a([n3], t3.args));
}, r2);
}
function mu(n2, t2, r2) {
var e2 = n2.length;
if (e2 < 2) return e2 ? gu(n2[0]) : [];
for (var u2 = -1, i2 = il(e2); ++u2 < e2; ) for (var o2 = n2[u2], f2 = -1; ++f2 < e2; ) f2 != u2 && (i2[u2] = Hr2(i2[u2] || o2, n2[f2], t2, r2));
return gu(ee2(i2, 1), t2, r2);
}
function xu(n2, t2, r2) {
for (var e2 = -1, u2 = n2.length, i2 = t2.length, o2 = {}; ++e2 < u2; ) {
r2(o2, n2[e2], e2 < i2 ? t2[e2] : X);
}
return o2;
}
function ju(n2) {
return Jf(n2) ? n2 : [];
}
function Au(n2) {
return "function" == typeof n2 ? n2 : La;
}
function ku(n2, t2) {
return bh(n2) ? n2 : Bi(n2, t2) ? [n2] : Cs(Ec(n2));
}
function Ou(n2, t2, r2) {
var e2 = n2.length;
return r2 = r2 === X ? e2 : r2, !t2 && r2 >= e2 ? n2 : au(n2, t2, r2);
}
function Iu(n2, t2) {
if (t2) return n2.slice();
var r2 = n2.length, e2 = zl ? zl(r2) : new n2.constructor(r2);
return n2.copy(e2), e2;
}
function Ru(n2) {
var t2 = new n2.constructor(n2.byteLength);
return new Rl(t2).set(new Rl(n2)), t2;
}
function zu(n2, t2) {
return new n2.constructor(t2 ? Ru(n2.buffer) : n2.buffer, n2.byteOffset, n2.byteLength);
}
function Eu(n2) {
var t2 = new n2.constructor(n2.source, Nt.exec(n2));
return t2.lastIndex = n2.lastIndex, t2;
}
function Su(n2) {
return _s ? ll(_s.call(n2)) : {};
}
function Wu(n2, t2) {
return new n2.constructor(t2 ? Ru(n2.buffer) : n2.buffer, n2.byteOffset, n2.length);
}
function Lu(n2, t2) {
if (n2 !== t2) {
var r2 = n2 !== X, e2 = null === n2, u2 = n2 === n2, i2 = bc(n2), o2 = t2 !== X, f2 = null === t2, c2 = t2 === t2, a2 = bc(t2);
if (!f2 && !a2 && !i2 && n2 > t2 || i2 && o2 && c2 && !f2 && !a2 || e2 && o2 && c2 || !r2 && c2 || !u2) return 1;
if (!e2 && !i2 && !a2 && n2 < t2 || a2 && r2 && u2 && !e2 && !i2 || f2 && r2 && u2 || !o2 && u2 || !c2) return -1;
}
return 0;
}
function Cu(n2, t2, r2) {
for (var e2 = -1, u2 = n2.criteria, i2 = t2.criteria, o2 = u2.length, f2 = r2.length; ++e2 < o2; ) {
var c2 = Lu(u2[e2], i2[e2]);
if (c2) {
if (e2 >= f2) return c2;
return c2 * ("desc" == r2[e2] ? -1 : 1);
}
}
return n2.index - t2.index;
}
function Uu(n2, t2, r2, e2) {
for (var u2 = -1, i2 = n2.length, o2 = r2.length, f2 = -1, c2 = t2.length, a2 = Gl(i2 - o2, 0), l2 = il(c2 + a2), s2 = !e2; ++f2 < c2; ) l2[f2] = t2[f2];
for (; ++u2 < o2; ) (s2 || u2 < i2) && (l2[r2[u2]] = n2[u2]);
for (; a2--; ) l2[f2++] = n2[u2++];
return l2;
}
function Bu(n2, t2, r2, e2) {
for (var u2 = -1, i2 = n2.length, o2 = -1, f2 = r2.length, c2 = -1, a2 = t2.length, l2 = Gl(i2 - f2, 0), s2 = il(l2 + a2), h2 = !e2; ++u2 < l2; ) s2[u2] = n2[u2];
for (var p3 = u2; ++c2 < a2; ) s2[p3 + c2] = t2[c2];
for (; ++o2 < f2; ) (h2 || u2 < i2) && (s2[p3 + r2[o2]] = n2[u2++]);
return s2;
}
function Tu(n2, t2) {
var r2 = -1, e2 = n2.length;
for (t2 || (t2 = il(e2)); ++r2 < e2; ) t2[r2] = n2[r2];
return t2;
}
function $u(n2, t2, r2, e2) {
var u2 = !r2;
r2 || (r2 = {});
for (var i2 = -1, o2 = t2.length; ++i2 < o2; ) {
var f2 = t2[i2], c2 = e2 ? e2(r2[f2], n2[f2], f2, r2, n2) : X;
c2 === X && (c2 = n2[f2]), u2 ? Br2(r2, f2, c2) : Sr2(r2, f2, c2);
}
return r2;
}
function Du(n2, t2) {
return $u(n2, Is(n2), t2);
}
function Mu(n2, t2) {
return $u(n2, Rs(n2), t2);
}
function Fu(n2, r2) {
return function(e2, u2) {
var i2 = bh(e2) ? t : Lr2, o2 = r2 ? r2() : {};
return i2(e2, n2, mi(u2, 2), o2);
};
}
function Nu(n2) {
return uu(function(t2, r2) {
var e2 = -1, u2 = r2.length, i2 = u2 > 1 ? r2[u2 - 1] : X, o2 = u2 > 2 ? r2[2] : X;
for (i2 = n2.length > 3 && "function" == typeof i2 ? (u2--, i2) : X, o2 && Ui(r2[0], r2[1], o2) && (i2 = u2 < 3 ? X : i2, u2 = 1), t2 = ll(t2); ++e2 < u2; ) {
var f2 = r2[e2];
f2 && n2(t2, f2, e2, i2);
}
return t2;
});
}
function Pu(n2, t2) {
return function(r2, e2) {
if (null == r2) return r2;
if (!Hf(r2)) return n2(r2, e2);
for (var u2 = r2.length, i2 = t2 ? u2 : -1, o2 = ll(r2); (t2 ? i2-- : ++i2 < u2) && e2(o2[i2], i2, o2) !== false; ) ;
return r2;
};
}
function qu(n2) {
return function(t2, r2, e2) {
for (var u2 = -1, i2 = ll(t2), o2 = e2(t2), f2 = o2.length; f2--; ) {
var c2 = o2[n2 ? f2 : ++u2];
if (r2(i2[c2], c2, i2) === false) break;
}
return t2;
};
}
function Zu(n2, t2, r2) {
function e2() {
return (this && this !== re && this instanceof e2 ? i2 : n2).apply(u2 ? r2 : this, arguments);
}
var u2 = t2 & _n, i2 = Gu(n2);
return e2;
}
function Ku(n2) {
return function(t2) {
t2 = Ec(t2);
var r2 = T(t2) ? G(t2) : X, e2 = r2 ? r2[0] : t2.charAt(0), u2 = r2 ? Ou(r2, 1).join("") : t2.slice(1);
return e2[n2]() + u2;
};
}
function Vu(n2) {
return function(t2) {
return l(Ra(ca(t2).replace($r, "")), n2, "");
};
}
function Gu(n2) {
return function() {
var t2 = arguments;
switch (t2.length) {
case 0:
return new n2();
case 1:
return new n2(t2[0]);
case 2:
return new n2(t2[0], t2[1]);
case 3:
return new n2(t2[0], t2[1], t2[2]);
case 4:
return new n2(t2[0], t2[1], t2[2], t2[3]);
case 5:
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4]);
case 6:
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5]);
case 7:
return new n2(t2[0], t2[1], t2[2], t2[3], t2[4], t2[5], t2[6]);
}
var r2 = gs(n2.prototype), e2 = n2.apply(r2, t2);
return fc(e2) ? e2 : r2;
};
}
function Hu(t2, r2, e2) {
function u2() {
for (var o2 = arguments.length, f2 = il(o2), c2 = o2, a2 = wi(u2); c2--; ) f2[c2] = arguments[c2];
var l2 = o2 < 3 && f2[0] !== a2 && f2[o2 - 1] !== a2 ? [] : N(f2, a2);
return o2 -= l2.length, o2 < e2 ? oi(t2, r2, Qu, u2.placeholder, X, f2, l2, X, X, e2 - o2) : n(this && this !== re && this instanceof u2 ? i2 : t2, this, f2);
}
var i2 = Gu(t2);
return u2;
}
function Ju(n2) {
return function(t2, r2, e2) {
var u2 = ll(t2);
if (!Hf(t2)) {
var i2 = mi(r2, 3);
t2 = Pc(t2), r2 = function(n3) {
return i2(u2[n3], n3, u2);
};
}
var o2 = n2(t2, r2, e2);
return o2 > -1 ? u2[i2 ? t2[o2] : o2] : X;
};
}
function Yu(n2) {
return gi(function(t2) {
var r2 = t2.length, e2 = r2, u2 = Y2.prototype.thru;
for (n2 && t2.reverse(); e2--; ) {
var i2 = t2[e2];
if ("function" != typeof i2) throw new pl(en);
if (u2 && !o2 && "wrapper" == bi(i2)) var o2 = new Y2([], true);
}
for (e2 = o2 ? e2 : r2; ++e2 < r2; ) {
i2 = t2[e2];
var f2 = bi(i2), c2 = "wrapper" == f2 ? Os(i2) : X;
o2 = c2 && $i(c2[0]) && c2[1] == (mn | yn | bn | xn) && !c2[4].length && 1 == c2[9] ? o2[bi(c2[0])].apply(o2, c2[3]) : 1 == i2.length && $i(i2) ? o2[f2]() : o2.thru(i2);
}
return function() {
var n3 = arguments, e3 = n3[0];
if (o2 && 1 == n3.length && bh(e3)) return o2.plant(e3).value();
for (var u3 = 0, i3 = r2 ? t2[u3].apply(this, n3) : e3; ++u3 < r2; ) i3 = t2[u3].call(this, i3);
return i3;
};
});
}
function Qu(n2, t2, r2, e2, u2, i2, o2, f2, c2, a2) {
function l2() {
for (var y2 = arguments.length, d2 = il(y2), b2 = y2; b2--; ) d2[b2] = arguments[b2];
if (_2) var w2 = wi(l2), m2 = C(d2, w2);
if (e2 && (d2 = Uu(d2, e2, u2, _2)), i2 && (d2 = Bu(d2, i2, o2, _2)), y2 -= m2, _2 && y2 < a2) {
return oi(n2, t2, Qu, l2.placeholder, r2, d2, N(d2, w2), f2, c2, a2 - y2);
}
var x3 = h2 ? r2 : this, j2 = p3 ? x3[n2] : n2;
return y2 = d2.length, f2 ? d2 = Hi(d2, f2) : v2 && y2 > 1 && d2.reverse(), s2 && c2 < y2 && (d2.length = c2), this && this !== re && this instanceof l2 && (j2 = g2 || Gu(j2)), j2.apply(x3, d2);
}
var s2 = t2 & mn, h2 = t2 & _n, p3 = t2 & vn, _2 = t2 & (yn | dn), v2 = t2 & jn, g2 = p3 ? X : Gu(n2);
return l2;
}
function Xu(n2, t2) {
return function(r2, e2) {
return Oe(r2, n2, t2(e2), {});
};
}
function ni(n2, t2) {
return function(r2, e2) {
var u2;
if (r2 === X && e2 === X) return t2;
if (r2 !== X && (u2 = r2), e2 !== X) {
if (u2 === X) return e2;
"string" == typeof r2 || "string" == typeof e2 ? (r2 = vu(r2), e2 = vu(e2)) : (r2 = _u(r2), e2 = _u(e2)), u2 = n2(r2, e2);
}
return u2;
};
}
function ti(t2) {
return gi(function(r2) {
return r2 = c(r2, z(mi())), uu(function(e2) {
var u2 = this;
return t2(r2, function(t3) {
return n(t3, u2, e2);
});
});
});
}
function ri(n2, t2) {
t2 = t2 === X ? " " : vu(t2);
var r2 = t2.length;
if (r2 < 2) return r2 ? eu(t2, n2) : t2;
var e2 = eu(t2, Fl(n2 / V(t2)));
return T(t2) ? Ou(G(e2), 0, n2).join("") : e2.slice(0, n2);
}
function ei(t2, r2, e2, u2) {
function i2() {
for (var r3 = -1, c2 = arguments.length, a2 = -1, l2 = u2.length, s2 = il(l2 + c2), h2 = this && this !== re && this instanceof i2 ? f2 : t2; ++a2 < l2; ) s2[a2] = u2[a2];
for (; c2--; ) s2[a2++] = arguments[++r3];
return n(h2, o2 ? e2 : this, s2);
}
var o2 = r2 & _n, f2 = Gu(t2);
return i2;
}
function ui(n2) {
return function(t2, r2, e2) {
return e2 && "number" != typeof e2 && Ui(t2, r2, e2) && (r2 = e2 = X), t2 = Ac(t2), r2 === X ? (r2 = t2, t2 = 0) : r2 = Ac(r2), e2 = e2 === X ? t2 < r2 ? 1 : -1 : Ac(e2), ru(t2, r2, e2, n2);
};
}
function ii(n2) {
return function(t2, r2) {
return "string" == typeof t2 && "string" == typeof r2 || (t2 = Ic(t2), r2 = Ic(r2)), n2(t2, r2);
};
}
function oi(n2, t2, r2, e2, u2, i2, o2, f2, c2, a2) {
var l2 = t2 & yn, s2 = l2 ? o2 : X, h2 = l2 ? X : o2, p3 = l2 ? i2 : X, _2 = l2 ? X : i2;
t2 |= l2 ? bn : wn, t2 &= ~(l2 ? wn : bn), t2 & gn || (t2 &= ~(_n | vn));
var v2 = [n2, t2, u2, p3, s2, _2, h2, f2, c2, a2], g2 = r2.apply(X, v2);
return $i(n2) && Ss(g2, v2), g2.placeholder = e2, Yi(g2, n2, t2);
}
function fi(n2) {
var t2 = al[n2];
return function(n3, r2) {
if (n3 = Ic(n3), r2 = null == r2 ? 0 : Hl(kc(r2), 292), r2 && Zl(n3)) {
var e2 = (Ec(n3) + "e").split("e");
return e2 = (Ec(t2(e2[0] + "e" + (+e2[1] + r2))) + "e").split("e"), +(e2[0] + "e" + (+e2[1] - r2));
}
return t2(n3);
};
}
function ci(n2) {
return function(t2) {
var r2 = zs(t2);
return r2 == Gn ? M(t2) : r2 == tt ? q(t2) : I(t2, n2(t2));
};
}
function ai(n2, t2, r2, e2, u2, i2, o2, f2) {
var c2 = t2 & vn;
if (!c2 && "function" != typeof n2) throw new pl(en);
var a2 = e2 ? e2.length : 0;
if (a2 || (t2 &= ~(bn | wn), e2 = u2 = X), o2 = o2 === X ? o2 : Gl(kc(o2), 0), f2 = f2 === X ? f2 : kc(f2), a2 -= u2 ? u2.length : 0, t2 & wn) {
var l2 = e2, s2 = u2;
e2 = u2 = X;
}
var h2 = c2 ? X : Os(n2), p3 = [n2, t2, r2, e2, u2, l2, s2, i2, o2, f2];
if (h2 && qi(p3, h2), n2 = p3[0], t2 = p3[1], r2 = p3[2], e2 = p3[3], u2 = p3[4], f2 = p3[9] = p3[9] === X ? c2 ? 0 : n2.length : Gl(p3[9] - a2, 0), !f2 && t2 & (yn | dn) && (t2 &= ~(yn | dn)), t2 && t2 != _n) _2 = t2 == yn || t2 == dn ? Hu(n2, t2, f2) : t2 != bn && t2 != (_n | bn) || u2.length ? Qu.apply(X, p3) : ei(n2, t2, r2, e2);
else var _2 = Zu(n2, t2, r2);
return Yi((h2 ? ms : Ss)(_2, p3), n2, t2);
}
function li(n2, t2, r2, e2) {
return n2 === X || Gf(n2, gl[r2]) && !bl.call(e2, r2) ? t2 : n2;
}
function si(n2, t2, r2, e2, u2, i2) {
return fc(n2) && fc(t2) && (i2.set(t2, n2), Ke(n2, t2, X, si, i2), i2.delete(t2)), n2;
}
function hi(n2) {
return gc(n2) ? X : n2;
}
function pi(n2, t2, r2, e2, u2, i2) {
var o2 = r2 & hn, f2 = n2.length, c2 = t2.length;
if (f2 != c2 && !(o2 && c2 > f2)) return false;
var a2 = i2.get(n2), l2 = i2.get(t2);
if (a2 && l2) return a2 == t2 && l2 == n2;
var s2 = -1, p3 = true, _2 = r2 & pn ? new yr2() : X;
for (i2.set(n2, t2), i2.set(t2, n2); ++s2 < f2; ) {
var v2 = n2[s2], g2 = t2[s2];
if (e2) var y2 = o2 ? e2(g2, v2, s2, t2, n2, i2) : e2(v2, g2, s2, n2, t2, i2);
if (y2 !== X) {
if (y2) continue;
p3 = false;
break;
}
if (_2) {
if (!h(t2, function(n3, t3) {
if (!S(_2, t3) && (v2 === n3 || u2(v2, n3, r2, e2, i2))) return _2.push(t3);
})) {
p3 = false;
break;
}
} else if (v2 !== g2 && !u2(v2, g2, r2, e2, i2)) {
p3 = false;
break;
}
}
return i2.delete(n2), i2.delete(t2), p3;
}
function _i(n2, t2, r2, e2, u2, i2, o2) {
switch (r2) {
case ct:
if (n2.byteLength != t2.byteLength || n2.byteOffset != t2.byteOffset) return false;
n2 = n2.buffer, t2 = t2.buffer;
case ft:
return !(n2.byteLength != t2.byteLength || !i2(new Rl(n2), new Rl(t2)));
case Nn:
case Pn:
case Hn:
return Gf(+n2, +t2);
case Zn:
return n2.name == t2.name && n2.message == t2.message;
case nt:
case rt:
return n2 == t2 + "";
case Gn:
var f2 = M;
case tt:
var c2 = e2 & hn;
if (f2 || (f2 = P), n2.size != t2.size && !c2) return false;
var a2 = o2.get(n2);
if (a2) return a2 == t2;
e2 |= pn, o2.set(n2, t2);
var l2 = pi(f2(n2), f2(t2), e2, u2, i2, o2);
return o2.delete(n2), l2;
case et:
if (_s) return _s.call(n2) == _s.call(t2);
}
return false;
}
function vi(n2, t2, r2, e2, u2, i2) {
var o2 = r2 & hn, f2 = yi(n2), c2 = f2.length;
if (c2 != yi(t2).length && !o2) return false;
for (var a2 = c2; a2--; ) {
var l2 = f2[a2];
if (!(o2 ? l2 in t2 : bl.call(t2, l2))) return false;
}
var s2 = i2.get(n2), h2 = i2.get(t2);
if (s2 && h2) return s2 == t2 && h2 == n2;
var p3 = true;
i2.set(n2, t2), i2.set(t2, n2);
for (var _2 = o2; ++a2 < c2; ) {
l2 = f2[a2];
var v2 = n2[l2], g2 = t2[l2];
if (e2) var y2 = o2 ? e2(g2, v2, l2, t2, n2, i2) : e2(v2, g2, l2, n2, t2, i2);
if (!(y2 === X ? v2 === g2 || u2(v2, g2, r2, e2, i2) : y2)) {
p3 = false;
break;
}
_2 || (_2 = "constructor" == l2);
}
if (p3 && !_2) {
var d2 = n2.constructor, b2 = t2.constructor;
d2 != b2 && "constructor" in n2 && "constructor" in t2 && !("function" == typeof d2 && d2 instanceof d2 && "function" == typeof b2 && b2 instanceof b2) && (p3 = false);
}
return i2.delete(n2), i2.delete(t2), p3;
}
function gi(n2) {
return Ls(Vi(n2, X, _o), n2 + "");
}
function yi(n2) {
return de2(n2, Pc, Is);
}
function di(n2) {
return de2(n2, qc, Rs);
}
function bi(n2) {
for (var t2 = n2.name + "", r2 = fs[t2], e2 = bl.call(fs, t2) ? r2.length : 0; e2--; ) {
var u2 = r2[e2], i2 = u2.func;
if (null == i2 || i2 == n2) return u2.name;
}
return t2;
}
function wi(n2) {
return (bl.call(Z2, "placeholder") ? Z2 : n2).placeholder;
}
function mi() {
var n2 = Z2.iteratee || Ca;
return n2 = n2 === Ca ? De : n2, arguments.length ? n2(arguments[0], arguments[1]) : n2;
}
function xi(n2, t2) {
var r2 = n2.__data__;
return Ti(t2) ? r2["string" == typeof t2 ? "string" : "hash"] : r2.map;
}
function ji(n2) {
for (var t2 = Pc(n2), r2 = t2.length; r2--; ) {
var e2 = t2[r2], u2 = n2[e2];
t2[r2] = [e2, u2, Fi(u2)];
}
return t2;
}
function Ai(n2, t2) {
var r2 = B(n2, t2);
return Ue(r2) ? r2 : X;
}
function ki(n2) {
var t2 = bl.call(n2, Bl), r2 = n2[Bl];
try {
n2[Bl] = X;
var e2 = true;
} catch (n3) {
}
var u2 = xl.call(n2);
return e2 && (t2 ? n2[Bl] = r2 : delete n2[Bl]), u2;
}
function Oi(n2, t2, r2) {
for (var e2 = -1, u2 = r2.length; ++e2 < u2; ) {
var i2 = r2[e2], o2 = i2.size;
switch (i2.type) {
case "drop":
n2 += o2;
break;
case "dropRight":
t2 -= o2;
break;
case "take":
t2 = Hl(t2, n2 + o2);
break;
case "takeRight":
n2 = Gl(n2, t2 - o2);
}
}
return { start: n2, end: t2 };
}
function Ii(n2) {
var t2 = n2.match(Bt);
return t2 ? t2[1].split(Tt) : [];
}
function Ri(n2, t2, r2) {
t2 = ku(t2, n2);
for (var e2 = -1, u2 = t2.length, i2 = false; ++e2 < u2; ) {
var o2 = no(t2[e2]);
if (!(i2 = null != n2 && r2(n2, o2))) break;
n2 = n2[o2];
}
return i2 || ++e2 != u2 ? i2 : (u2 = null == n2 ? 0 : n2.length, !!u2 && oc(u2) && Ci(o2, u2) && (bh(n2) || dh(n2)));
}
function zi(n2) {
var t2 = n2.length, r2 = new n2.constructor(t2);
return t2 && "string" == typeof n2[0] && bl.call(n2, "index") && (r2.index = n2.index, r2.input = n2.input), r2;
}
function Ei(n2) {
return "function" != typeof n2.constructor || Mi(n2) ? {} : gs(El(n2));
}
function Si(n2, t2, r2) {
var e2 = n2.constructor;
switch (t2) {
case ft:
return Ru(n2);
case Nn:
case Pn:
return new e2(+n2);
case ct:
return zu(n2, r2);
case at:
case lt:
case st:
case ht:
case pt:
case _t:
case vt:
case gt:
case yt:
return Wu(n2, r2);
case Gn:
return new e2();
case Hn:
case rt:
return new e2(n2);
case nt:
return Eu(n2);
case tt:
return new e2();
case et:
return Su(n2);
}
}
function Wi(n2, t2) {
var r2 = t2.length;
if (!r2) return n2;
var e2 = r2 - 1;
return t2[e2] = (r2 > 1 ? "& " : "") + t2[e2], t2 = t2.join(r2 > 2 ? ", " : " "), n2.replace(Ut, "{\n/* [wrapped with " + t2 + "] */\n");
}
function Li(n2) {
return bh(n2) || dh(n2) || !!(Cl && n2 && n2[Cl]);
}
function Ci(n2, t2) {
var r2 = typeof n2;
return t2 = null == t2 ? Wn : t2, !!t2 && ("number" == r2 || "symbol" != r2 && Vt.test(n2)) && n2 > -1 && n2 % 1 == 0 && n2 < t2;
}
function Ui(n2, t2, r2) {
if (!fc(r2)) return false;
var e2 = typeof t2;
return !!("number" == e2 ? Hf(r2) && Ci(t2, r2.length) : "string" == e2 && t2 in r2) && Gf(r2[t2], n2);
}
function Bi(n2, t2) {
if (bh(n2)) return false;
var r2 = typeof n2;
return !("number" != r2 && "symbol" != r2 && "boolean" != r2 && null != n2 && !bc(n2)) || (zt.test(n2) || !Rt.test(n2) || null != t2 && n2 in ll(t2));
}
function Ti(n2) {
var t2 = typeof n2;
return "string" == t2 || "number" == t2 || "symbol" == t2 || "boolean" == t2 ? "__proto__" !== n2 : null === n2;
}
function $i(n2) {
var t2 = bi(n2), r2 = Z2[t2];
if ("function" != typeof r2 || !(t2 in Ct2.prototype)) return false;
if (n2 === r2) return true;
var e2 = Os(r2);
return !!e2 && n2 === e2[0];
}
function Di(n2) {
return !!ml && ml in n2;
}
function Mi(n2) {
var t2 = n2 && n2.constructor;
return n2 === ("function" == typeof t2 && t2.prototype || gl);
}
function Fi(n2) {
return n2 === n2 && !fc(n2);
}
function Ni(n2, t2) {
return function(r2) {
return null != r2 && (r2[n2] === t2 && (t2 !== X || n2 in ll(r2)));
};
}
function Pi(n2) {
var t2 = Cf(n2, function(n3) {
return r2.size === fn && r2.clear(), n3;
}), r2 = t2.cache;
return t2;
}
function qi(n2, t2) {
var r2 = n2[1], e2 = t2[1], u2 = r2 | e2, i2 = u2 < (_n | vn | mn), o2 = e2 == mn && r2 == yn || e2 == mn && r2 == xn && n2[7].length <= t2[8] || e2 == (mn | xn) && t2[7].length <= t2[8] && r2 == yn;
if (!i2 && !o2) return n2;
e2 & _n && (n2[2] = t2[2], u2 |= r2 & _n ? 0 : gn);
var f2 = t2[3];
if (f2) {
var c2 = n2[3];
n2[3] = c2 ? Uu(c2, f2, t2[4]) : f2, n2[4] = c2 ? N(n2[3], cn) : t2[4];
}
return f2 = t2[5], f2 && (c2 = n2[5], n2[5] = c2 ? Bu(c2, f2, t2[6]) : f2, n2[6] = c2 ? N(n2[5], cn) : t2[6]), f2 = t2[7], f2 && (n2[7] = f2), e2 & mn && (n2[8] = null == n2[8] ? t2[8] : Hl(n2[8], t2[8])), null == n2[9] && (n2[9] = t2[9]), n2[0] = t2[0], n2[1] = u2, n2;
}
function Zi(n2) {
var t2 = [];
if (null != n2) for (var r2 in ll(n2)) t2.push(r2);
return t2;
}
function Ki(n2) {
return xl.call(n2);
}
function Vi(t2, r2, e2) {
return r2 = Gl(r2 === X ? t2.length - 1 : r2, 0), function() {
for (var u2 = arguments, i2 = -1, o2 = Gl(u2.length - r2, 0), f2 = il(o2); ++i2 < o2; ) f2[i2] = u2[r2 + i2];
i2 = -1;
for (var c2 = il(r2 + 1); ++i2 < r2; ) c2[i2] = u2[i2];
return c2[r2] = e2(f2), n(t2, this, c2);
};
}
function Gi(n2, t2) {
return t2.length < 2 ? n2 : _e2(n2, au(t2, 0, -1));
}
function Hi(n2, t2) {
for (var r2 = n2.length, e2 = Hl(t2.length, r2), u2 = Tu(n2); e2--; ) {
var i2 = t2[e2];
n2[e2] = Ci(i2, r2) ? u2[i2] : X;
}
return n2;
}
function Ji(n2, t2) {
if (("constructor" !== t2 || "function" != typeof n2[t2]) && "__proto__" != t2) return n2[t2];
}
function Yi(n2, t2, r2) {
var e2 = t2 + "";
return Ls(n2, Wi(e2, ro(Ii(e2), r2)));
}
function Qi(n2) {
var t2 = 0, r2 = 0;
return function() {
var e2 = Jl(), u2 = In - (e2 - r2);
if (r2 = e2, u2 > 0) {
if (++t2 >= On) return arguments[0];
} else t2 = 0;
return n2.apply(X, arguments);
};
}
function Xi(n2, t2) {
var r2 = -1, e2 = n2.length, u2 = e2 - 1;
for (t2 = t2 === X ? e2 : t2; ++r2 < t2; ) {
var i2 = tu(r2, u2), o2 = n2[i2];
n2[i2] = n2[r2], n2[r2] = o2;
}
return n2.length = t2, n2;
}
function no(n2) {
if ("string" == typeof n2 || bc(n2)) return n2;
var t2 = n2 + "";
return "0" == t2 && 1 / n2 == -Sn ? "-0" : t2;
}
function to(n2) {
if (null != n2) {
try {
return dl.call(n2);
} catch (n3) {
}
try {
return n2 + "";
} catch (n3) {
}
}
return "";
}
function ro(n2, t2) {
return r($n, function(r2) {
var e2 = "_." + r2[0];
t2 & r2[1] && !o(n2, e2) && n2.push(e2);
}), n2.sort();
}
function eo(n2) {
if (n2 instanceof Ct2) return n2.clone();
var t2 = new Y2(n2.__wrapped__, n2.__chain__);
return t2.__actions__ = Tu(n2.__actions__), t2.__index__ = n2.__index__, t2.__values__ = n2.__values__, t2;
}
function uo(n2, t2, r2) {
t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : Gl(kc(t2), 0);
var e2 = null == n2 ? 0 : n2.length;
if (!e2 || t2 < 1) return [];
for (var u2 = 0, i2 = 0, o2 = il(Fl(e2 / t2)); u2 < e2; ) o2[i2++] = au(n2, u2, u2 += t2);
return o2;
}
function io(n2) {
for (var t2 = -1, r2 = null == n2 ? 0 : n2.length, e2 = 0, u2 = []; ++t2 < r2; ) {
var i2 = n2[t2];
i2 && (u2[e2++] = i2);
}
return u2;
}
function oo() {
var n2 = arguments.length;
if (!n2) return [];
for (var t2 = il(n2 - 1), r2 = arguments[0], e2 = n2; e2--; ) t2[e2 - 1] = arguments[e2];
return a(bh(r2) ? Tu(r2) : [r2], ee2(t2, 1));
}
function fo(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), au(n2, t2 < 0 ? 0 : t2, e2)) : [];
}
function co(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), t2 = e2 - t2, au(n2, 0, t2 < 0 ? 0 : t2)) : [];
}
function ao(n2, t2) {
return n2 && n2.length ? bu(n2, mi(t2, 3), true, true) : [];
}
function lo(n2, t2) {
return n2 && n2.length ? bu(n2, mi(t2, 3), true) : [];
}
function so(n2, t2, r2, e2) {
var u2 = null == n2 ? 0 : n2.length;
return u2 ? (r2 && "number" != typeof r2 && Ui(n2, t2, r2) && (r2 = 0, e2 = u2), ne2(n2, t2, r2, e2)) : [];
}
function ho(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
if (!e2) return -1;
var u2 = null == r2 ? 0 : kc(r2);
return u2 < 0 && (u2 = Gl(e2 + u2, 0)), g(n2, mi(t2, 3), u2);
}
function po(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
if (!e2) return -1;
var u2 = e2 - 1;
return r2 !== X && (u2 = kc(r2), u2 = r2 < 0 ? Gl(e2 + u2, 0) : Hl(u2, e2 - 1)), g(n2, mi(t2, 3), u2, true);
}
function _o(n2) {
return (null == n2 ? 0 : n2.length) ? ee2(n2, 1) : [];
}
function vo(n2) {
return (null == n2 ? 0 : n2.length) ? ee2(n2, Sn) : [];
}
function go(n2, t2) {
return (null == n2 ? 0 : n2.length) ? (t2 = t2 === X ? 1 : kc(t2), ee2(n2, t2)) : [];
}
function yo(n2) {
for (var t2 = -1, r2 = null == n2 ? 0 : n2.length, e2 = {}; ++t2 < r2; ) {
var u2 = n2[t2];
e2[u2[0]] = u2[1];
}
return e2;
}
function bo(n2) {
return n2 && n2.length ? n2[0] : X;
}
function wo(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
if (!e2) return -1;
var u2 = null == r2 ? 0 : kc(r2);
return u2 < 0 && (u2 = Gl(e2 + u2, 0)), y(n2, t2, u2);
}
function mo(n2) {
return (null == n2 ? 0 : n2.length) ? au(n2, 0, -1) : [];
}
function xo(n2, t2) {
return null == n2 ? "" : Kl.call(n2, t2);
}
function jo(n2) {
var t2 = null == n2 ? 0 : n2.length;
return t2 ? n2[t2 - 1] : X;
}
function Ao(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
if (!e2) return -1;
var u2 = e2;
return r2 !== X && (u2 = kc(r2), u2 = u2 < 0 ? Gl(e2 + u2, 0) : Hl(u2, e2 - 1)), t2 === t2 ? K(n2, t2, u2) : g(n2, b, u2, true);
}
function ko(n2, t2) {
return n2 && n2.length ? Ge(n2, kc(t2)) : X;
}
function Oo(n2, t2) {
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2) : n2;
}
function Io(n2, t2, r2) {
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2, mi(r2, 2)) : n2;
}
function Ro(n2, t2, r2) {
return n2 && n2.length && t2 && t2.length ? Xe(n2, t2, X, r2) : n2;
}
function zo(n2, t2) {
var r2 = [];
if (!n2 || !n2.length) return r2;
var e2 = -1, u2 = [], i2 = n2.length;
for (t2 = mi(t2, 3); ++e2 < i2; ) {
var o2 = n2[e2];
t2(o2, e2, n2) && (r2.push(o2), u2.push(e2));
}
return nu(n2, u2), r2;
}
function Eo(n2) {
return null == n2 ? n2 : Xl.call(n2);
}
function So(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
return e2 ? (r2 && "number" != typeof r2 && Ui(n2, t2, r2) ? (t2 = 0, r2 = e2) : (t2 = null == t2 ? 0 : kc(t2), r2 = r2 === X ? e2 : kc(r2)), au(n2, t2, r2)) : [];
}
function Wo(n2, t2) {
return su(n2, t2);
}
function Lo(n2, t2, r2) {
return hu(n2, t2, mi(r2, 2));
}
function Co(n2, t2) {
var r2 = null == n2 ? 0 : n2.length;
if (r2) {
var e2 = su(n2, t2);
if (e2 < r2 && Gf(n2[e2], t2)) return e2;
}
return -1;
}
function Uo(n2, t2) {
return su(n2, t2, true);
}
function Bo(n2, t2, r2) {
return hu(n2, t2, mi(r2, 2), true);
}
function To(n2, t2) {
if (null == n2 ? 0 : n2.length) {
var r2 = su(n2, t2, true) - 1;
if (Gf(n2[r2], t2)) return r2;
}
return -1;
}
function $o(n2) {
return n2 && n2.length ? pu(n2) : [];
}
function Do(n2, t2) {
return n2 && n2.length ? pu(n2, mi(t2, 2)) : [];
}
function Mo(n2) {
var t2 = null == n2 ? 0 : n2.length;
return t2 ? au(n2, 1, t2) : [];
}
function Fo(n2, t2, r2) {
return n2 && n2.length ? (t2 = r2 || t2 === X ? 1 : kc(t2), au(n2, 0, t2 < 0 ? 0 : t2)) : [];
}
function No(n2, t2, r2) {
var e2 = null == n2 ? 0 : n2.length;
return e2 ? (t2 = r2 || t2 === X ? 1 : kc(t2), t2 = e2 - t2, au(n2, t2 < 0 ? 0 : t2, e2)) : [];
}
function Po(n2, t2) {
return n2 && n2.length ? bu(n2, mi(t2, 3), false, true) : [];
}
function qo(n2, t2) {
return n2 && n2.length ? bu(n2, mi(t2, 3)) : [];
}
function Zo(n2) {
return n2 && n2.length ? gu(n2) : [];
}
function Ko(n2, t2) {
return n2 && n2.length ? gu(n2, mi(t2, 2)) : [];
}
function Vo(n2, t2) {
return t2 = "function" == typeof t2 ? t2 : X, n2 && n2.length ? gu(n2, X, t2) : [];
}
function Go(n2) {
if (!n2 || !n2.length) return [];
var t2 = 0;
return n2 = i(n2, function(n3) {
if (Jf(n3)) return t2 = Gl(n3.length, t2), true;
}), O(t2, function(t3) {
return c(n2, m(t3));
});
}
function Ho(t2, r2) {
if (!t2 || !t2.length) return [];
var e2 = Go(t2);
return null == r2 ? e2 : c(e2, function(t3) {
return n(r2, X, t3);
});
}
function Jo(n2, t2) {
return xu(n2 || [], t2 || [], Sr2);
}
function Yo(n2, t2) {
return xu(n2 || [], t2 || [], fu);
}
function Qo(n2) {
var t2 = Z2(n2);
return t2.__chain__ = true, t2;
}
function Xo(n2, t2) {
return t2(n2), n2;
}
function nf(n2, t2) {
return t2(n2);
}
function tf() {
return Qo(this);
}
function rf() {
return new Y2(this.value(), this.__chain__);
}
function ef() {
this.__values__ === X && (this.__values__ = jc(this.value()));
var n2 = this.__index__ >= this.__values__.length;
return { done: n2, value: n2 ? X : this.__values__[this.__index__++] };
}
function uf() {
return this;
}
function of(n2) {
for (var t2, r2 = this; r2 instanceof J2; ) {
var e2 = eo(r2);
e2.__index__ = 0, e2.__values__ = X, t2 ? u2.__wrapped__ = e2 : t2 = e2;
var u2 = e2;
r2 = r2.__wrapped__;
}
return u2.__wrapped__ = n2, t2;
}
function ff() {
var n2 = this.__wrapped__;
if (n2 instanceof Ct2) {
var t2 = n2;
return this.__actions__.length && (t2 = new Ct2(this)), t2 = t2.reverse(), t2.__actions__.push({ func: nf, args: [Eo], thisArg: X }), new Y2(t2, this.__chain__);
}
return this.thru(Eo);
}
function cf() {
return wu(this.__wrapped__, this.__actions__);
}
function af(n2, t2, r2) {
var e2 = bh(n2) ? u : Jr2;
return r2 && Ui(n2, t2, r2) && (t2 = X), e2(n2, mi(t2, 3));
}
function lf(n2, t2) {
return (bh(n2) ? i : te2)(n2, mi(t2, 3));
}
function sf(n2, t2) {
return ee2(yf(n2, t2), 1);
}
function hf(n2, t2) {
return ee2(yf(n2, t2), Sn);
}
function pf(n2, t2, r2) {
return r2 = r2 === X ? 1 : kc(r2), ee2(yf(n2, t2), r2);
}
function _f(n2, t2) {
return (bh(n2) ? r : ys)(n2, mi(t2, 3));
}
function vf(n2, t2) {
return (bh(n2) ? e : ds)(n2, mi(t2, 3));
}
function gf(n2, t2, r2, e2) {
n2 = Hf(n2) ? n2 : ra(n2), r2 = r2 && !e2 ? kc(r2) : 0;
var u2 = n2.length;
return r2 < 0 && (r2 = Gl(u2 + r2, 0)), dc(n2) ? r2 <= u2 && n2.indexOf(t2, r2) > -1 : !!u2 && y(n2, t2, r2) > -1;
}
function yf(n2, t2) {
return (bh(n2) ? c : Pe)(n2, mi(t2, 3));
}
function df(n2, t2, r2, e2) {
return null == n2 ? [] : (bh(t2) || (t2 = null == t2 ? [] : [t2]), r2 = e2 ? X : r2, bh(r2) || (r2 = null == r2 ? [] : [r2]), He(n2, t2, r2));
}
function bf(n2, t2, r2) {
var e2 = bh(n2) ? l : j, u2 = arguments.length < 3;
return e2(n2, mi(t2, 4), r2, u2, ys);
}
function wf(n2, t2, r2) {
var e2 = bh(n2) ? s : j, u2 = arguments.length < 3;
return e2(n2, mi(t2, 4), r2, u2, ds);
}
function mf(n2, t2) {
return (bh(n2) ? i : te2)(n2, Uf(mi(t2, 3)));
}
function xf(n2) {
return (bh(n2) ? Ir2 : iu)(n2);
}
function jf(n2, t2, r2) {
return t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : kc(t2), (bh(n2) ? Rr2 : ou)(n2, t2);
}
function Af(n2) {
return (bh(n2) ? zr2 : cu)(n2);
}
function kf(n2) {
if (null == n2) return 0;
if (Hf(n2)) return dc(n2) ? V(n2) : n2.length;
var t2 = zs(n2);
return t2 == Gn || t2 == tt ? n2.size : Me(n2).length;
}
function Of(n2, t2, r2) {
var e2 = bh(n2) ? h : lu;
return r2 && Ui(n2, t2, r2) && (t2 = X), e2(n2, mi(t2, 3));
}
function If(n2, t2) {
if ("function" != typeof t2) throw new pl(en);
return n2 = kc(n2), function() {
if (--n2 < 1) return t2.apply(this, arguments);
};
}
function Rf(n2, t2, r2) {
return t2 = r2 ? X : t2, t2 = n2 && null == t2 ? n2.length : t2, ai(n2, mn, X, X, X, X, t2);
}
function zf(n2, t2) {
var r2;
if ("function" != typeof t2) throw new pl(en);
return n2 = kc(n2), function() {
return --n2 > 0 && (r2 = t2.apply(this, arguments)), n2 <= 1 && (t2 = X), r2;
};
}
function Ef(n2, t2, r2) {
t2 = r2 ? X : t2;
var e2 = ai(n2, yn, X, X, X, X, X, t2);
return e2.placeholder = Ef.placeholder, e2;
}
function Sf(n2, t2, r2) {
t2 = r2 ? X : t2;
var e2 = ai(n2, dn, X, X, X, X, X, t2);
return e2.placeholder = Sf.placeholder, e2;
}
function Wf(n2, t2, r2) {
function e2(t3) {
var r3 = h2, e3 = p3;
return h2 = p3 = X, d2 = t3, v2 = n2.apply(e3, r3);
}
function u2(n3) {
return d2 = n3, g2 = Ws(f2, t2), b2 ? e2(n3) : v2;
}
function i2(n3) {
var r3 = n3 - y2, e3 = n3 - d2, u3 = t2 - r3;
return w2 ? Hl(u3, _2 - e3) : u3;
}
function o2(n3) {
var r3 = n3 - y2, e3 = n3 - d2;
return y2 === X || r3 >= t2 || r3 < 0 || w2 && e3 >= _2;
}
function f2() {
var n3 = fh();
return o2(n3) ? c2(n3) : (g2 = Ws(f2, i2(n3)), X);
}
function c2(n3) {
return g2 = X, m2 && h2 ? e2(n3) : (h2 = p3 = X, v2);
}
function a2() {
g2 !== X && As(g2), d2 = 0, h2 = y2 = p3 = g2 = X;
}
function l2() {
return g2 === X ? v2 : c2(fh());
}
function s2() {
var n3 = fh(), r3 = o2(n3);
if (h2 = arguments, p3 = this, y2 = n3, r3) {
if (g2 === X) return u2(y2);
if (w2) return As(g2), g2 = Ws(f2, t2), e2(y2);
}
return g2 === X && (g2 = Ws(f2, t2)), v2;
}
var h2, p3, _2, v2, g2, y2, d2 = 0, b2 = false, w2 = false, m2 = true;
if ("function" != typeof n2) throw new pl(en);
return t2 = Ic(t2) || 0, fc(r2) && (b2 = !!r2.leading, w2 = "maxWait" in r2, _2 = w2 ? Gl(Ic(r2.maxWait) || 0, t2) : _2, m2 = "trailing" in r2 ? !!r2.trailing : m2), s2.cancel = a2, s2.flush = l2, s2;
}
function Lf(n2) {
return ai(n2, jn);
}
function Cf(n2, t2) {
if ("function" != typeof n2 || null != t2 && "function" != typeof t2) throw new pl(en);
var r2 = function() {
var e2 = arguments, u2 = t2 ? t2.apply(this, e2) : e2[0], i2 = r2.cache;
if (i2.has(u2)) return i2.get(u2);
var o2 = n2.apply(this, e2);
return r2.cache = i2.set(u2, o2) || i2, o2;
};
return r2.cache = new (Cf.Cache || sr2)(), r2;
}
function Uf(n2) {
if ("function" != typeof n2) throw new pl(en);
return function() {
var t2 = arguments;
switch (t2.length) {
case 0:
return !n2.call(this);
case 1:
return !n2.call(this, t2[0]);
case 2:
return !n2.call(this, t2[0], t2[1]);
case 3:
return !n2.call(this, t2[0], t2[1], t2[2]);
}
return !n2.apply(this, t2);
};
}
function Bf(n2) {
return zf(2, n2);
}
function Tf(n2, t2) {
if ("function" != typeof n2) throw new pl(en);
return t2 = t2 === X ? t2 : kc(t2), uu(n2, t2);
}
function $f(t2, r2) {
if ("function" != typeof t2) throw new pl(en);
return r2 = null == r2 ? 0 : Gl(kc(r2), 0), uu(function(e2) {
var u2 = e2[r2], i2 = Ou(e2, 0, r2);
return u2 && a(i2, u2), n(t2, this, i2);
});
}
function Df(n2, t2, r2) {
var e2 = true, u2 = true;
if ("function" != typeof n2) throw new pl(en);
return fc(r2) && (e2 = "leading" in r2 ? !!r2.leading : e2, u2 = "trailing" in r2 ? !!r2.trailing : u2), Wf(n2, t2, { leading: e2, maxWait: t2, trailing: u2 });
}
function Mf(n2) {
return Rf(n2, 1);
}
function Ff(n2, t2) {
return ph(Au(t2), n2);
}
function Nf() {
if (!arguments.length) return [];
var n2 = arguments[0];
return bh(n2) ? n2 : [n2];
}
function Pf(n2) {
return Fr2(n2, sn);
}
function qf(n2, t2) {
return t2 = "function" == typeof t2 ? t2 : X, Fr2(n2, sn, t2);
}
function Zf(n2) {
return Fr2(n2, an | sn);
}
function Kf(n2, t2) {
return t2 = "function" == typeof t2 ? t2 : X, Fr2(n2, an | sn, t2);
}
function Vf(n2, t2) {
return null == t2 || Pr2(n2, t2, Pc(t2));
}
function Gf(n2, t2) {
return n2 === t2 || n2 !== n2 && t2 !== t2;
}
function Hf(n2) {
return null != n2 && oc(n2.length) && !uc(n2);
}
function Jf(n2) {
return cc(n2) && Hf(n2);
}
function Yf(n2) {
return n2 === true || n2 === false || cc(n2) && we(n2) == Nn;
}
function Qf(n2) {
return cc(n2) && 1 === n2.nodeType && !gc(n2);
}
function Xf(n2) {
if (null == n2) return true;
if (Hf(n2) && (bh(n2) || "string" == typeof n2 || "function" == typeof n2.splice || mh(n2) || Oh(n2) || dh(n2))) return !n2.length;
var t2 = zs(n2);
if (t2 == Gn || t2 == tt) return !n2.size;
if (Mi(n2)) return !Me(n2).length;
for (var r2 in n2) if (bl.call(n2, r2)) return false;
return true;
}
function nc(n2, t2) {
return Se(n2, t2);
}
function tc(n2, t2, r2) {
r2 = "function" == typeof r2 ? r2 : X;
var e2 = r2 ? r2(n2, t2) : X;
return e2 === X ? Se(n2, t2, X, r2) : !!e2;
}
function rc(n2) {
if (!cc(n2)) return false;
var t2 = we(n2);
return t2 == Zn || t2 == qn || "string" == typeof n2.message && "string" == typeof n2.name && !gc(n2);
}
function ec(n2) {
return "number" == typeof n2 && Zl(n2);
}
function uc(n2) {
if (!fc(n2)) return false;
var t2 = we(n2);
return t2 == Kn || t2 == Vn || t2 == Fn || t2 == Xn;
}
function ic(n2) {
return "number" == typeof n2 && n2 == kc(n2);
}
function oc(n2) {
return "number" == typeof n2 && n2 > -1 && n2 % 1 == 0 && n2 <= Wn;
}
function fc(n2) {
var t2 = typeof n2;
return null != n2 && ("object" == t2 || "function" == t2);
}
function cc(n2) {
return null != n2 && "object" == typeof n2;
}
function ac(n2, t2) {
return n2 === t2 || Ce(n2, t2, ji(t2));
}
function lc(n2, t2, r2) {
return r2 = "function" == typeof r2 ? r2 : X, Ce(n2, t2, ji(t2), r2);
}
function sc(n2) {
return vc(n2) && n2 != +n2;
}
function hc(n2) {
if (Es(n2)) throw new fl(rn);
return Ue(n2);
}
function pc(n2) {
return null === n2;
}
function _c(n2) {
return null == n2;
}
function vc(n2) {
return "number" == typeof n2 || cc(n2) && we(n2) == Hn;
}
function gc(n2) {
if (!cc(n2) || we(n2) != Yn) return false;
var t2 = El(n2);
if (null === t2) return true;
var r2 = bl.call(t2, "constructor") && t2.constructor;
return "function" == typeof r2 && r2 instanceof r2 && dl.call(r2) == jl;
}
function yc(n2) {
return ic(n2) && n2 >= -Wn && n2 <= Wn;
}
function dc(n2) {
return "string" == typeof n2 || !bh(n2) && cc(n2) && we(n2) == rt;
}
function bc(n2) {
return "symbol" == typeof n2 || cc(n2) && we(n2) == et;
}
function wc(n2) {
return n2 === X;
}
function mc(n2) {
return cc(n2) && zs(n2) == it;
}
function xc(n2) {
return cc(n2) && we(n2) == ot;
}
function jc(n2) {
if (!n2) return [];
if (Hf(n2)) return dc(n2) ? G(n2) : Tu(n2);
if (Ul && n2[Ul]) return D(n2[Ul]());
var t2 = zs(n2);
return (t2 == Gn ? M : t2 == tt ? P : ra)(n2);
}
function Ac(n2) {
if (!n2) return 0 === n2 ? n2 : 0;
if (n2 = Ic(n2), n2 === Sn || n2 === -Sn) {
return (n2 < 0 ? -1 : 1) * Ln;
}
return n2 === n2 ? n2 : 0;
}
function kc(n2) {
var t2 = Ac(n2), r2 = t2 % 1;
return t2 === t2 ? r2 ? t2 - r2 : t2 : 0;
}
function Oc(n2) {
return n2 ? Mr2(kc(n2), 0, Un) : 0;
}
function Ic(n2) {
if ("number" == typeof n2) return n2;
if (bc(n2)) return Cn;
if (fc(n2)) {
var t2 = "function" == typeof n2.valueOf ? n2.valueOf() : n2;
n2 = fc(t2) ? t2 + "" : t2;
}
if ("string" != typeof n2) return 0 === n2 ? n2 : +n2;
n2 = R(n2);
var r2 = qt.test(n2);
return r2 || Kt.test(n2) ? Xr(n2.slice(2), r2 ? 2 : 8) : Pt.test(n2) ? Cn : +n2;
}
function Rc(n2) {
return $u(n2, qc(n2));
}
function zc(n2) {
return n2 ? Mr2(kc(n2), -Wn, Wn) : 0 === n2 ? n2 : 0;
}
function Ec(n2) {
return null == n2 ? "" : vu(n2);
}
function Sc(n2, t2) {
var r2 = gs(n2);
return null == t2 ? r2 : Cr2(r2, t2);
}
function Wc(n2, t2) {
return v(n2, mi(t2, 3), ue2);
}
function Lc(n2, t2) {
return v(n2, mi(t2, 3), oe2);
}
function Cc(n2, t2) {
return null == n2 ? n2 : bs(n2, mi(t2, 3), qc);
}
function Uc(n2, t2) {
return null == n2 ? n2 : ws(n2, mi(t2, 3), qc);
}
function Bc(n2, t2) {
return n2 && ue2(n2, mi(t2, 3));
}
function Tc(n2, t2) {
return n2 && oe2(n2, mi(t2, 3));
}
function $c(n2) {
return null == n2 ? [] : fe2(n2, Pc(n2));
}
function Dc(n2) {
return null == n2 ? [] : fe2(n2, qc(n2));
}
function Mc(n2, t2, r2) {
var e2 = null == n2 ? X : _e2(n2, t2);
return e2 === X ? r2 : e2;
}
function Fc(n2, t2) {
return null != n2 && Ri(n2, t2, xe);
}
function Nc(n2, t2) {
return null != n2 && Ri(n2, t2, je);
}
function Pc(n2) {
return Hf(n2) ? Or2(n2) : Me(n2);
}
function qc(n2) {
return Hf(n2) ? Or2(n2, true) : Fe(n2);
}
function Zc(n2, t2) {
var r2 = {};
return t2 = mi(t2, 3), ue2(n2, function(n3, e2, u2) {
Br2(r2, t2(n3, e2, u2), n3);
}), r2;
}
function Kc(n2, t2) {
var r2 = {};
return t2 = mi(t2, 3), ue2(n2, function(n3, e2, u2) {
Br2(r2, e2, t2(n3, e2, u2));
}), r2;
}
function Vc(n2, t2) {
return Gc(n2, Uf(mi(t2)));
}
function Gc(n2, t2) {
if (null == n2) return {};
var r2 = c(di(n2), function(n3) {
return [n3];
});
return t2 = mi(t2), Ye(n2, r2, function(n3, r3) {
return t2(n3, r3[0]);
});
}
function Hc(n2, t2, r2) {
t2 = ku(t2, n2);
var e2 = -1, u2 = t2.length;
for (u2 || (u2 = 1, n2 = X); ++e2 < u2; ) {
var i2 = null == n2 ? X : n2[no(t2[e2])];
i2 === X && (e2 = u2, i2 = r2), n2 = uc(i2) ? i2.call(n2) : i2;
}
return n2;
}
function Jc(n2, t2, r2) {
return null == n2 ? n2 : fu(n2, t2, r2);
}
function Yc(n2, t2, r2, e2) {
return e2 = "function" == typeof e2 ? e2 : X, null == n2 ? n2 : fu(n2, t2, r2, e2);
}
function Qc(n2, t2, e2) {
var u2 = bh(n2), i2 = u2 || mh(n2) || Oh(n2);
if (t2 = mi(t2, 4), null == e2) {
var o2 = n2 && n2.constructor;
e2 = i2 ? u2 ? new o2() : [] : fc(n2) && uc(o2) ? gs(El(n2)) : {};
}
return (i2 ? r : ue2)(n2, function(n3, r2, u3) {
return t2(e2, n3, r2, u3);
}), e2;
}
function Xc(n2, t2) {
return null == n2 || yu(n2, t2);
}
function na(n2, t2, r2) {
return null == n2 ? n2 : du(n2, t2, Au(r2));
}
function ta(n2, t2, r2, e2) {
return e2 = "function" == typeof e2 ? e2 : X, null == n2 ? n2 : du(n2, t2, Au(r2), e2);
}
function ra(n2) {
return null == n2 ? [] : E(n2, Pc(n2));
}
function ea(n2) {
return null == n2 ? [] : E(n2, qc(n2));
}
function ua(n2, t2, r2) {
return r2 === X && (r2 = t2, t2 = X), r2 !== X && (r2 = Ic(r2), r2 = r2 === r2 ? r2 : 0), t2 !== X && (t2 = Ic(t2), t2 = t2 === t2 ? t2 : 0), Mr2(Ic(n2), t2, r2);
}
function ia(n2, t2, r2) {
return t2 = Ac(t2), r2 === X ? (r2 = t2, t2 = 0) : r2 = Ac(r2), n2 = Ic(n2), Ae(n2, t2, r2);
}
function oa(n2, t2, r2) {
if (r2 && "boolean" != typeof r2 && Ui(n2, t2, r2) && (t2 = r2 = X), r2 === X && ("boolean" == typeof t2 ? (r2 = t2, t2 = X) : "boolean" == typeof n2 && (r2 = n2, n2 = X)), n2 === X && t2 === X ? (n2 = 0, t2 = 1) : (n2 = Ac(n2), t2 === X ? (t2 = n2, n2 = 0) : t2 = Ac(t2)), n2 > t2) {
var e2 = n2;
n2 = t2, t2 = e2;
}
if (r2 || n2 % 1 || t2 % 1) {
var u2 = Ql();
return Hl(n2 + u2 * (t2 - n2 + Qr("1e-" + ((u2 + "").length - 1))), t2);
}
return tu(n2, t2);
}
function fa(n2) {
return Qh(Ec(n2).toLowerCase());
}
function ca(n2) {
return n2 = Ec(n2), n2 && n2.replace(Gt, ve).replace(Dr, "");
}
function aa(n2, t2, r2) {
n2 = Ec(n2), t2 = vu(t2);
var e2 = n2.length;
r2 = r2 === X ? e2 : Mr2(kc(r2), 0, e2);
var u2 = r2;
return r2 -= t2.length, r2 >= 0 && n2.slice(r2, u2) == t2;
}
function la(n2) {
return n2 = Ec(n2), n2 && At.test(n2) ? n2.replace(xt, ge) : n2;
}
function sa(n2) {
return n2 = Ec(n2), n2 && Wt.test(n2) ? n2.replace(St, "\\$&") : n2;
}
function ha(n2, t2, r2) {
n2 = Ec(n2), t2 = kc(t2);
var e2 = t2 ? V(n2) : 0;
if (!t2 || e2 >= t2) return n2;
var u2 = (t2 - e2) / 2;
return ri(Nl(u2), r2) + n2 + ri(Fl(u2), r2);
}
function pa(n2, t2, r2) {
n2 = Ec(n2), t2 = kc(t2);
var e2 = t2 ? V(n2) : 0;
return t2 && e2 < t2 ? n2 + ri(t2 - e2, r2) : n2;
}
function _a(n2, t2, r2) {
n2 = Ec(n2), t2 = kc(t2);
var e2 = t2 ? V(n2) : 0;
return t2 && e2 < t2 ? ri(t2 - e2, r2) + n2 : n2;
}
function va(n2, t2, r2) {
return r2 || null == t2 ? t2 = 0 : t2 && (t2 = +t2), Yl(Ec(n2).replace(Lt, ""), t2 || 0);
}
function ga(n2, t2, r2) {
return t2 = (r2 ? Ui(n2, t2, r2) : t2 === X) ? 1 : kc(t2), eu(Ec(n2), t2);
}
function ya() {
var n2 = arguments, t2 = Ec(n2[0]);
return n2.length < 3 ? t2 : t2.replace(n2[1], n2[2]);
}
function da(n2, t2, r2) {
return r2 && "number" != typeof r2 && Ui(n2, t2, r2) && (t2 = r2 = X), (r2 = r2 === X ? Un : r2 >>> 0) ? (n2 = Ec(n2), n2 && ("string" == typeof t2 || null != t2 && !Ah(t2)) && (t2 = vu(t2), !t2 && T(n2)) ? Ou(G(n2), 0, r2) : n2.split(t2, r2)) : [];
}
function ba(n2, t2, r2) {
return n2 = Ec(n2), r2 = null == r2 ? 0 : Mr2(kc(r2), 0, n2.length), t2 = vu(t2), n2.slice(r2, r2 + t2.length) == t2;
}
function wa(n2, t2, r2) {
var e2 = Z2.templateSettings;
r2 && Ui(n2, t2, r2) && (t2 = X), n2 = Ec(n2), t2 = Sh({}, t2, e2, li);
var u2, i2, o2 = Sh({}, t2.imports, e2.imports, li), f2 = Pc(o2), c2 = E(o2, f2), a2 = 0, l2 = t2.interpolate || Ht, s2 = "__p += '", h2 = sl((t2.escape || Ht).source + "|" + l2.source + "|" + (l2 === It ? Ft : Ht).source + "|" + (t2.evaluate || Ht).source + "|$", "g"), p3 = "//# sourceURL=" + (bl.call(t2, "sourceURL") ? (t2.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Zr + "]") + "\n";
n2.replace(h2, function(t3, r3, e3, o3, f3, c3) {
return e3 || (e3 = o3), s2 += n2.slice(a2, c3).replace(Jt, U), r3 && (u2 = true, s2 += "' +\n__e(" + r3 + ") +\n'"), f3 && (i2 = true, s2 += "';\n" + f3 + ";\n__p += '"), e3 && (s2 += "' +\n((__t = (" + e3 + ")) == null ? '' : __t) +\n'"), a2 = c3 + t3.length, t3;
}), s2 += "';\n";
var _2 = bl.call(t2, "variable") && t2.variable;
if (_2) {
if (Dt.test(_2)) throw new fl(un);
} else s2 = "with (obj) {\n" + s2 + "\n}\n";
s2 = (i2 ? s2.replace(dt2, "") : s2).replace(bt, "$1").replace(wt, "$1;"), s2 = "function(" + (_2 || "obj") + ") {\n" + (_2 ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (u2 ? ", __e = _.escape" : "") + (i2 ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + s2 + "return __p\n}";
var v2 = Xh(function() {
return cl(f2, p3 + "return " + s2).apply(X, c2);
});
if (v2.source = s2, rc(v2)) throw v2;
return v2;
}
function ma(n2) {
return Ec(n2).toLowerCase();
}
function xa(n2) {
return Ec(n2).toUpperCase();
}
function ja(n2, t2, r2) {
if (n2 = Ec(n2), n2 && (r2 || t2 === X)) return R(n2);
if (!n2 || !(t2 = vu(t2))) return n2;
var e2 = G(n2), u2 = G(t2);
return Ou(e2, W(e2, u2), L(e2, u2) + 1).join("");
}
function Aa(n2, t2, r2) {
if (n2 = Ec(n2), n2 && (r2 || t2 === X)) return n2.slice(0, H(n2) + 1);
if (!n2 || !(t2 = vu(t2))) return n2;
var e2 = G(n2);
return Ou(e2, 0, L(e2, G(t2)) + 1).join("");
}
function ka(n2, t2, r2) {
if (n2 = Ec(n2), n2 && (r2 || t2 === X)) return n2.replace(Lt, "");
if (!n2 || !(t2 = vu(t2))) return n2;
var e2 = G(n2);
return Ou(e2, W(e2, G(t2))).join("");
}
function Oa(n2, t2) {
var r2 = An, e2 = kn;
if (fc(t2)) {
var u2 = "separator" in t2 ? t2.separator : u2;
r2 = "length" in t2 ? kc(t2.length) : r2, e2 = "omission" in t2 ? vu(t2.omission) : e2;
}
n2 = Ec(n2);
var i2 = n2.length;
if (T(n2)) {
var o2 = G(n2);
i2 = o2.length;
}
if (r2 >= i2) return n2;
var f2 = r2 - V(e2);
if (f2 < 1) return e2;
var c2 = o2 ? Ou(o2, 0, f2).join("") : n2.slice(0, f2);
if (u2 === X) return c2 + e2;
if (o2 && (f2 += c2.length - f2), Ah(u2)) {
if (n2.slice(f2).search(u2)) {
var a2, l2 = c2;
for (u2.global || (u2 = sl(u2.source, Ec(Nt.exec(u2)) + "g")), u2.lastIndex = 0; a2 = u2.exec(l2); ) var s2 = a2.index;
c2 = c2.slice(0, s2 === X ? f2 : s2);
}
} else if (n2.indexOf(vu(u2), f2) != f2) {
var h2 = c2.lastIndexOf(u2);
h2 > -1 && (c2 = c2.slice(0, h2));
}
return c2 + e2;
}
function Ia(n2) {
return n2 = Ec(n2), n2 && jt.test(n2) ? n2.replace(mt, ye) : n2;
}
function Ra(n2, t2, r2) {
return n2 = Ec(n2), t2 = r2 ? X : t2, t2 === X ? $(n2) ? Q(n2) : _(n2) : n2.match(t2) || [];
}
function za(t2) {
var r2 = null == t2 ? 0 : t2.length, e2 = mi();
return t2 = r2 ? c(t2, function(n2) {
if ("function" != typeof n2[1]) throw new pl(en);
return [e2(n2[0]), n2[1]];
}) : [], uu(function(e3) {
for (var u2 = -1; ++u2 < r2; ) {
var i2 = t2[u2];
if (n(i2[0], this, e3)) return n(i2[1], this, e3);
}
});
}
function Ea(n2) {
return Nr2(Fr2(n2, an));
}
function Sa(n2) {
return function() {
return n2;
};
}
function Wa(n2, t2) {
return null == n2 || n2 !== n2 ? t2 : n2;
}
function La(n2) {
return n2;
}
function Ca(n2) {
return De("function" == typeof n2 ? n2 : Fr2(n2, an));
}
function Ua(n2) {
return qe(Fr2(n2, an));
}
function Ba(n2, t2) {
return Ze(n2, Fr2(t2, an));
}
function Ta(n2, t2, e2) {
var u2 = Pc(t2), i2 = fe2(t2, u2);
null != e2 || fc(t2) && (i2.length || !u2.length) || (e2 = t2, t2 = n2, n2 = this, i2 = fe2(t2, Pc(t2)));
var o2 = !(fc(e2) && "chain" in e2 && !e2.chain), f2 = uc(n2);
return r(i2, function(r2) {
var e3 = t2[r2];
n2[r2] = e3, f2 && (n2.prototype[r2] = function() {
var t3 = this.__chain__;
if (o2 || t3) {
var r3 = n2(this.__wrapped__);
return (r3.__actions__ = Tu(this.__actions__)).push({ func: e3, args: arguments, thisArg: n2 }), r3.__chain__ = t3, r3;
}
return e3.apply(n2, a([this.value()], arguments));
});
}), n2;
}
function $a() {
return re._ === this && (re._ = Al), this;
}
function Da() {
}
function Ma(n2) {
return n2 = kc(n2), uu(function(t2) {
return Ge(t2, n2);
});
}
function Fa(n2) {
return Bi(n2) ? m(no(n2)) : Qe(n2);
}
function Na(n2) {
return function(t2) {
return null == n2 ? X : _e2(n2, t2);
};
}
function Pa() {
return [];
}
function qa() {
return false;
}
function Za() {
return {};
}
function Ka() {
return "";
}
function Va() {
return true;
}
function Ga(n2, t2) {
if (n2 = kc(n2), n2 < 1 || n2 > Wn) return [];
var r2 = Un, e2 = Hl(n2, Un);
t2 = mi(t2), n2 -= Un;
for (var u2 = O(e2, t2); ++r2 < n2; ) t2(r2);
return u2;
}
function Ha(n2) {
return bh(n2) ? c(n2, no) : bc(n2) ? [n2] : Tu(Cs(Ec(n2)));
}
function Ja(n2) {
var t2 = ++wl;
return Ec(n2) + t2;
}
function Ya(n2) {
return n2 && n2.length ? Yr2(n2, La, me) : X;
}
function Qa(n2, t2) {
return n2 && n2.length ? Yr2(n2, mi(t2, 2), me) : X;
}
function Xa(n2) {
return w(n2, La);
}
function nl(n2, t2) {
return w(n2, mi(t2, 2));
}
function tl(n2) {
return n2 && n2.length ? Yr2(n2, La, Ne) : X;
}
function rl(n2, t2) {
return n2 && n2.length ? Yr2(n2, mi(t2, 2), Ne) : X;
}
function el(n2) {
return n2 && n2.length ? k(n2, La) : 0;
}
function ul(n2, t2) {
return n2 && n2.length ? k(n2, mi(t2, 2)) : 0;
}
x2 = null == x2 ? re : be.defaults(re.Object(), x2, be.pick(re, qr));
var il = x2.Array, ol = x2.Date, fl = x2.Error, cl = x2.Function, al = x2.Math, ll = x2.Object, sl = x2.RegExp, hl = x2.String, pl = x2.TypeError, _l = il.prototype, vl = cl.prototype, gl = ll.prototype, yl = x2["__core-js_shared__"], dl = vl.toString, bl = gl.hasOwnProperty, wl = 0, ml = function() {
var n2 = /[^.]+$/.exec(yl && yl.keys && yl.keys.IE_PROTO || "");
return n2 ? "Symbol(src)_1." + n2 : "";
}(), xl = gl.toString, jl = dl.call(ll), Al = re._, kl = sl("^" + dl.call(bl).replace(St, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), Ol = ie ? x2.Buffer : X, Il = x2.Symbol, Rl = x2.Uint8Array, zl = Ol ? Ol.allocUnsafe : X, El = F(ll.getPrototypeOf, ll), Sl = ll.create, Wl = gl.propertyIsEnumerable, Ll = _l.splice, Cl = Il ? Il.isConcatSpreadable : X, Ul = Il ? Il.iterator : X, Bl = Il ? Il.toStringTag : X, Tl = function() {
try {
var n2 = Ai(ll, "defineProperty");
return n2({}, "", {}), n2;
} catch (n3) {
}
}(), $l = x2.clearTimeout !== re.clearTimeout && x2.clearTimeout, Dl = ol && ol.now !== re.Date.now && ol.now, Ml = x2.setTimeout !== re.setTimeout && x2.setTimeout, Fl = al.ceil, Nl = al.floor, Pl = ll.getOwnPropertySymbols, ql = Ol ? Ol.isBuffer : X, Zl = x2.isFinite, Kl = _l.join, Vl = F(ll.keys, ll), Gl = al.max, Hl = al.min, Jl = ol.now, Yl = x2.parseInt, Ql = al.random, Xl = _l.reverse, ns = Ai(x2, "DataView"), ts = Ai(x2, "Map"), rs = Ai(x2, "Promise"), es = Ai(x2, "Set"), us = Ai(x2, "WeakMap"), is = Ai(ll, "create"), os = us && new us(), fs = {}, cs = to(ns), as = to(ts), ls = to(rs), ss = to(es), hs = to(us), ps = Il ? Il.prototype : X, _s = ps ? ps.valueOf : X, vs = ps ? ps.toString : X, gs = /* @__PURE__ */ function() {
function n2() {
}
return function(t2) {
if (!fc(t2)) return {};
if (Sl) return Sl(t2);
n2.prototype = t2;
var r2 = new n2();
return n2.prototype = X, r2;
};
}();
Z2.templateSettings = { escape: kt, evaluate: Ot, interpolate: It, variable: "", imports: { _: Z2 } }, Z2.prototype = J2.prototype, Z2.prototype.constructor = Z2, Y2.prototype = gs(J2.prototype), Y2.prototype.constructor = Y2, Ct2.prototype = gs(J2.prototype), Ct2.prototype.constructor = Ct2, Xt2.prototype.clear = nr2, Xt2.prototype.delete = tr2, Xt2.prototype.get = rr2, Xt2.prototype.has = er2, Xt2.prototype.set = ur2, ir2.prototype.clear = or2, ir2.prototype.delete = fr2, ir2.prototype.get = cr2, ir2.prototype.has = ar2, ir2.prototype.set = lr2, sr2.prototype.clear = hr2, sr2.prototype.delete = pr2, sr2.prototype.get = _r2, sr2.prototype.has = vr2, sr2.prototype.set = gr2, yr2.prototype.add = yr2.prototype.push = dr2, yr2.prototype.has = br2, wr2.prototype.clear = mr2, wr2.prototype.delete = xr2, wr2.prototype.get = jr2, wr2.prototype.has = Ar2, wr2.prototype.set = kr2;
var ys = Pu(ue2), ds = Pu(oe2, true), bs = qu(), ws = qu(true), ms = os ? function(n2, t2) {
return os.set(n2, t2), n2;
} : La, xs = Tl ? function(n2, t2) {
return Tl(n2, "toString", {
configurable: true,
enumerable: false,
value: Sa(t2),
writable: true
});
} : La, js = uu, As = $l || function(n2) {
return re.clearTimeout(n2);
}, ks = es && 1 / P(new es([, -0]))[1] == Sn ? function(n2) {
return new es(n2);
} : Da, Os = os ? function(n2) {
return os.get(n2);
} : Da, Is = Pl ? function(n2) {
return null == n2 ? [] : (n2 = ll(n2), i(Pl(n2), function(t2) {
return Wl.call(n2, t2);
}));
} : Pa, Rs = Pl ? function(n2) {
for (var t2 = []; n2; ) a(t2, Is(n2)), n2 = El(n2);
return t2;
} : Pa, zs = we;
(ns && zs(new ns(new ArrayBuffer(1))) != ct || ts && zs(new ts()) != Gn || rs && zs(rs.resolve()) != Qn || es && zs(new es()) != tt || us && zs(new us()) != it) && (zs = function(n2) {
var t2 = we(n2), r2 = t2 == Yn ? n2.constructor : X, e2 = r2 ? to(r2) : "";
if (e2) switch (e2) {
case cs:
return ct;
case as:
return Gn;
case ls:
return Qn;
case ss:
return tt;
case hs:
return it;
}
return t2;
});
var Es = yl ? uc : qa, Ss = Qi(ms), Ws = Ml || function(n2, t2) {
return re.setTimeout(n2, t2);
}, Ls = Qi(xs), Cs = Pi(function(n2) {
var t2 = [];
return 46 === n2.charCodeAt(0) && t2.push(""), n2.replace(Et, function(n3, r2, e2, u2) {
t2.push(e2 ? u2.replace(Mt, "$1") : r2 || n3);
}), t2;
}), Us = uu(function(n2, t2) {
return Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true)) : [];
}), Bs = uu(function(n2, t2) {
var r2 = jo(t2);
return Jf(r2) && (r2 = X), Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true), mi(r2, 2)) : [];
}), Ts = uu(function(n2, t2) {
var r2 = jo(t2);
return Jf(r2) && (r2 = X), Jf(n2) ? Hr2(n2, ee2(t2, 1, Jf, true), X, r2) : [];
}), $s = uu(function(n2) {
var t2 = c(n2, ju);
return t2.length && t2[0] === n2[0] ? ke(t2) : [];
}), Ds = uu(function(n2) {
var t2 = jo(n2), r2 = c(n2, ju);
return t2 === jo(r2) ? t2 = X : r2.pop(), r2.length && r2[0] === n2[0] ? ke(r2, mi(t2, 2)) : [];
}), Ms = uu(function(n2) {
var t2 = jo(n2), r2 = c(n2, ju);
return t2 = "function" == typeof t2 ? t2 : X, t2 && r2.pop(), r2.length && r2[0] === n2[0] ? ke(r2, X, t2) : [];
}), Fs = uu(Oo), Ns = gi(function(n2, t2) {
var r2 = null == n2 ? 0 : n2.length, e2 = Tr2(n2, t2);
return nu(n2, c(t2, function(n3) {
return Ci(n3, r2) ? +n3 : n3;
}).sort(Lu)), e2;
}), Ps = uu(function(n2) {
return gu(ee2(n2, 1, Jf, true));
}), qs2 = uu(function(n2) {
var t2 = jo(n2);
return Jf(t2) && (t2 = X), gu(ee2(n2, 1, Jf, true), mi(t2, 2));
}), Zs = uu(function(n2) {
var t2 = jo(n2);
return t2 = "function" == typeof t2 ? t2 : X, gu(ee2(n2, 1, Jf, true), X, t2);
}), Ks = uu(function(n2, t2) {
return Jf(n2) ? Hr2(n2, t2) : [];
}), Vs = uu(function(n2) {
return mu(i(n2, Jf));
}), Gs = uu(function(n2) {
var t2 = jo(n2);
return Jf(t2) && (t2 = X), mu(i(n2, Jf), mi(t2, 2));
}), Hs = uu(function(n2) {
var t2 = jo(n2);
return t2 = "function" == typeof t2 ? t2 : X, mu(i(n2, Jf), X, t2);
}), Js = uu(Go), Ys = uu(function(n2) {
var t2 = n2.length, r2 = t2 > 1 ? n2[t2 - 1] : X;
return r2 = "function" == typeof r2 ? (n2.pop(), r2) : X, Ho(n2, r2);
}), Qs = gi(function(n2) {
var t2 = n2.length, r2 = t2 ? n2[0] : 0, e2 = this.__wrapped__, u2 = function(t3) {
return Tr2(t3, n2);
};
return !(t2 > 1 || this.__actions__.length) && e2 instanceof Ct2 && Ci(r2) ? (e2 = e2.slice(r2, +r2 + (t2 ? 1 : 0)), e2.__actions__.push({ func: nf, args: [u2], thisArg: X }), new Y2(e2, this.__chain__).thru(function(n3) {
return t2 && !n3.length && n3.push(X), n3;
})) : this.thru(u2);
}), Xs = Fu(function(n2, t2, r2) {
bl.call(n2, r2) ? ++n2[r2] : Br2(n2, r2, 1);
}), nh = Ju(ho), th = Ju(po), rh = Fu(function(n2, t2, r2) {
bl.call(n2, r2) ? n2[r2].push(t2) : Br2(n2, r2, [t2]);
}), eh = uu(function(t2, r2, e2) {
var u2 = -1, i2 = "function" == typeof r2, o2 = Hf(t2) ? il(t2.length) : [];
return ys(t2, function(t3) {
o2[++u2] = i2 ? n(r2, t3, e2) : Ie(t3, r2, e2);
}), o2;
}), uh = Fu(function(n2, t2, r2) {
Br2(n2, r2, t2);
}), ih = Fu(function(n2, t2, r2) {
n2[r2 ? 0 : 1].push(t2);
}, function() {
return [[], []];
}), oh = uu(function(n2, t2) {
if (null == n2) return [];
var r2 = t2.length;
return r2 > 1 && Ui(n2, t2[0], t2[1]) ? t2 = [] : r2 > 2 && Ui(t2[0], t2[1], t2[2]) && (t2 = [t2[0]]), He(n2, ee2(t2, 1), []);
}), fh = Dl || function() {
return re.Date.now();
}, ch = uu(function(n2, t2, r2) {
var e2 = _n;
if (r2.length) {
var u2 = N(r2, wi(ch));
e2 |= bn;
}
return ai(n2, e2, t2, r2, u2);
}), ah = uu(function(n2, t2, r2) {
var e2 = _n | vn;
if (r2.length) {
var u2 = N(r2, wi(ah));
e2 |= bn;
}
return ai(t2, e2, n2, r2, u2);
}), lh = uu(function(n2, t2) {
return Gr2(n2, 1, t2);
}), sh = uu(function(n2, t2, r2) {
return Gr2(n2, Ic(t2) || 0, r2);
});
Cf.Cache = sr2;
var hh = js(function(t2, r2) {
r2 = 1 == r2.length && bh(r2[0]) ? c(r2[0], z(mi())) : c(ee2(r2, 1), z(mi()));
var e2 = r2.length;
return uu(function(u2) {
for (var i2 = -1, o2 = Hl(u2.length, e2); ++i2 < o2; ) u2[i2] = r2[i2].call(this, u2[i2]);
return n(t2, this, u2);
});
}), ph = uu(function(n2, t2) {
return ai(n2, bn, X, t2, N(t2, wi(ph)));
}), _h = uu(function(n2, t2) {
return ai(n2, wn, X, t2, N(t2, wi(_h)));
}), vh = gi(function(n2, t2) {
return ai(n2, xn, X, X, X, t2);
}), gh = ii(me), yh = ii(function(n2, t2) {
return n2 >= t2;
}), dh = Re(/* @__PURE__ */ function() {
return arguments;
}()) ? Re : function(n2) {
return cc(n2) && bl.call(n2, "callee") && !Wl.call(n2, "callee");
}, bh = il.isArray, wh = ce ? z(ce) : ze, mh = ql || qa, xh = ae ? z(ae) : Ee, jh = le ? z(le) : Le, Ah = se ? z(se) : Be, kh = he ? z(he) : Te, Oh = pe ? z(pe) : $e, Ih = ii(Ne), Rh = ii(function(n2, t2) {
return n2 <= t2;
}), zh = Nu(function(n2, t2) {
if (Mi(t2) || Hf(t2)) return $u(t2, Pc(t2), n2), X;
for (var r2 in t2) bl.call(t2, r2) && Sr2(n2, r2, t2[r2]);
}), Eh = Nu(function(n2, t2) {
$u(t2, qc(t2), n2);
}), Sh = Nu(function(n2, t2, r2, e2) {
$u(t2, qc(t2), n2, e2);
}), Wh = Nu(function(n2, t2, r2, e2) {
$u(t2, Pc(t2), n2, e2);
}), Lh = gi(Tr2), Ch = uu(function(n2, t2) {
n2 = ll(n2);
var r2 = -1, e2 = t2.length, u2 = e2 > 2 ? t2[2] : X;
for (u2 && Ui(t2[0], t2[1], u2) && (e2 = 1); ++r2 < e2; ) for (var i2 = t2[r2], o2 = qc(i2), f2 = -1, c2 = o2.length; ++f2 < c2; ) {
var a2 = o2[f2], l2 = n2[a2];
(l2 === X || Gf(l2, gl[a2]) && !bl.call(n2, a2)) && (n2[a2] = i2[a2]);
}
return n2;
}), Uh = uu(function(t2) {
return t2.push(X, si), n(Mh, X, t2);
}), Bh = Xu(function(n2, t2, r2) {
null != t2 && "function" != typeof t2.toString && (t2 = xl.call(t2)), n2[t2] = r2;
}, Sa(La)), Th = Xu(function(n2, t2, r2) {
null != t2 && "function" != typeof t2.toString && (t2 = xl.call(t2)), bl.call(n2, t2) ? n2[t2].push(r2) : n2[t2] = [r2];
}, mi), $h = uu(Ie), Dh = Nu(function(n2, t2, r2) {
Ke(n2, t2, r2);
}), Mh = Nu(function(n2, t2, r2, e2) {
Ke(n2, t2, r2, e2);
}), Fh = gi(function(n2, t2) {
var r2 = {};
if (null == n2) return r2;
var e2 = false;
t2 = c(t2, function(t3) {
return t3 = ku(t3, n2), e2 || (e2 = t3.length > 1), t3;
}), $u(n2, di(n2), r2), e2 && (r2 = Fr2(r2, an | ln | sn, hi));
for (var u2 = t2.length; u2--; ) yu(r2, t2[u2]);
return r2;
}), Nh = gi(function(n2, t2) {
return null == n2 ? {} : Je(n2, t2);
}), Ph = ci(Pc), qh = ci(qc), Zh = Vu(function(n2, t2, r2) {
return t2 = t2.toLowerCase(), n2 + (r2 ? fa(t2) : t2);
}), Kh = Vu(function(n2, t2, r2) {
return n2 + (r2 ? "-" : "") + t2.toLowerCase();
}), Vh = Vu(function(n2, t2, r2) {
return n2 + (r2 ? " " : "") + t2.toLowerCase();
}), Gh = Ku("toLowerCase"), Hh = Vu(function(n2, t2, r2) {
return n2 + (r2 ? "_" : "") + t2.toLowerCase();
}), Jh = Vu(function(n2, t2, r2) {
return n2 + (r2 ? " " : "") + Qh(t2);
}), Yh = Vu(function(n2, t2, r2) {
return n2 + (r2 ? " " : "") + t2.toUpperCase();
}), Qh = Ku("toUpperCase"), Xh = uu(function(t2, r2) {
try {
return n(t2, X, r2);
} catch (n2) {
return rc(n2) ? n2 : new fl(n2);
}
}), np = gi(function(n2, t2) {
return r(t2, function(t3) {
t3 = no(t3), Br2(n2, t3, ch(n2[t3], n2));
}), n2;
}), tp = Yu(), rp = Yu(true), ep = uu(function(n2, t2) {
return function(r2) {
return Ie(r2, n2, t2);
};
}), up = uu(function(n2, t2) {
return function(r2) {
return Ie(n2, r2, t2);
};
}), ip = ti(c), op = ti(u), fp = ti(h), cp = ui(), ap = ui(true), lp = ni(function(n2, t2) {
return n2 + t2;
}, 0), sp = fi("ceil"), hp = ni(function(n2, t2) {
return n2 / t2;
}, 1), pp = fi("floor"), _p = ni(function(n2, t2) {
return n2 * t2;
}, 1), vp = fi("round"), gp = ni(function(n2, t2) {
return n2 - t2;
}, 0);
return Z2.after = If, Z2.ary = Rf, Z2.assign = zh, Z2.assignIn = Eh, Z2.assignInWith = Sh, Z2.assignWith = Wh, Z2.at = Lh, Z2.before = zf, Z2.bind = ch, Z2.bindAll = np, Z2.bindKey = ah, Z2.castArray = Nf, Z2.chain = Qo, Z2.chunk = uo, Z2.compact = io, Z2.concat = oo, Z2.cond = za, Z2.conforms = Ea, Z2.constant = Sa, Z2.countBy = Xs, Z2.create = Sc, Z2.curry = Ef, Z2.curryRight = Sf, Z2.debounce = Wf, Z2.defaults = Ch, Z2.defaultsDeep = Uh, Z2.defer = lh, Z2.delay = sh, Z2.difference = Us, Z2.differenceBy = Bs, Z2.differenceWith = Ts, Z2.drop = fo, Z2.dropRight = co, Z2.dropRightWhile = ao, Z2.dropWhile = lo, Z2.fill = so, Z2.filter = lf, Z2.flatMap = sf, Z2.flatMapDeep = hf, Z2.flatMapDepth = pf, Z2.flatten = _o, Z2.flattenDeep = vo, Z2.flattenDepth = go, Z2.flip = Lf, Z2.flow = tp, Z2.flowRight = rp, Z2.fromPairs = yo, Z2.functions = $c, Z2.functionsIn = Dc, Z2.groupBy = rh, Z2.initial = mo, Z2.intersection = $s, Z2.intersectionBy = Ds, Z2.intersectionWith = Ms, Z2.invert = Bh, Z2.invertBy = Th, Z2.invokeMap = eh, Z2.iteratee = Ca, Z2.keyBy = uh, Z2.keys = Pc, Z2.keysIn = qc, Z2.map = yf, Z2.mapKeys = Zc, Z2.mapValues = Kc, Z2.matches = Ua, Z2.matchesProperty = Ba, Z2.memoize = Cf, Z2.merge = Dh, Z2.mergeWith = Mh, Z2.method = ep, Z2.methodOf = up, Z2.mixin = Ta, Z2.negate = Uf, Z2.nthArg = Ma, Z2.omit = Fh, Z2.omitBy = Vc, Z2.once = Bf, Z2.orderBy = df, Z2.over = ip, Z2.overArgs = hh, Z2.overEvery = op, Z2.overSome = fp, Z2.partial = ph, Z2.partialRight = _h, Z2.partition = ih, Z2.pick = Nh, Z2.pickBy = Gc, Z2.property = Fa, Z2.propertyOf = Na, Z2.pull = Fs, Z2.pullAll = Oo, Z2.pullAllBy = Io, Z2.pullAllWith = Ro, Z2.pullAt = Ns, Z2.range = cp, Z2.rangeRight = ap, Z2.rearg = vh, Z2.reject = mf, Z2.remove = zo, Z2.rest = Tf, Z2.reverse = Eo, Z2.sampleSize = jf, Z2.set = Jc, Z2.setWith = Yc, Z2.shuffle = Af, Z2.slice = So, Z2.sortBy = oh, Z2.sortedUniq = $o, Z2.sortedUniqBy = Do, Z2.split = da, Z2.spread = $f, Z2.tail = Mo, Z2.take = Fo, Z2.takeRight = No, Z2.takeRightWhile = Po, Z2.takeWhile = qo, Z2.tap = Xo, Z2.throttle = Df, Z2.thru = nf, Z2.toArray = jc, Z2.toPairs = Ph, Z2.toPairsIn = qh, Z2.toPath = Ha, Z2.toPlainObject = Rc, Z2.transform = Qc, Z2.unary = Mf, Z2.union = Ps, Z2.unionBy = qs2, Z2.unionWith = Zs, Z2.uniq = Zo, Z2.uniqBy = Ko, Z2.uniqWith = Vo, Z2.unset = Xc, Z2.unzip = Go, Z2.unzipWith = Ho, Z2.update = na, Z2.updateWith = ta, Z2.values = ra, Z2.valuesIn = ea, Z2.without = Ks, Z2.words = Ra, Z2.wrap = Ff, Z2.xor = Vs, Z2.xorBy = Gs, Z2.xorWith = Hs, Z2.zip = Js, Z2.zipObject = Jo, Z2.zipObjectDeep = Yo, Z2.zipWith = Ys, Z2.entries = Ph, Z2.entriesIn = qh, Z2.extend = Eh, Z2.extendWith = Sh, Ta(Z2, Z2), Z2.add = lp, Z2.attempt = Xh, Z2.camelCase = Zh, Z2.capitalize = fa, Z2.ceil = sp, Z2.clamp = ua, Z2.clone = Pf, Z2.cloneDeep = Zf, Z2.cloneDeepWith = Kf, Z2.cloneWith = qf, Z2.conformsTo = Vf, Z2.deburr = ca, Z2.defaultTo = Wa, Z2.divide = hp, Z2.endsWith = aa, Z2.eq = Gf, Z2.escape = la, Z2.escapeRegExp = sa, Z2.every = af, Z2.find = nh, Z2.findIndex = ho, Z2.findKey = Wc, Z2.findLast = th, Z2.findLastIndex = po, Z2.findLastKey = Lc, Z2.floor = pp, Z2.forEach = _f, Z2.forEachRight = vf, Z2.forIn = Cc, Z2.forInRight = Uc, Z2.forOwn = Bc, Z2.forOwnRight = Tc, Z2.get = Mc, Z2.gt = gh, Z2.gte = yh, Z2.has = Fc, Z2.hasIn = Nc, Z2.head = bo, Z2.identity = La, Z2.includes = gf, Z2.indexOf = wo, Z2.inRange = ia, Z2.invoke = $h, Z2.isArguments = dh, Z2.isArray = bh, Z2.isArrayBuffer = wh, Z2.isArrayLike = Hf, Z2.isArrayLikeObject = Jf, Z2.isBoolean = Yf, Z2.isBuffer = mh, Z2.isDate = xh, Z2.isElement = Qf, Z2.isEmpty = Xf, Z2.isEqual = nc, Z2.isEqualWith = tc, Z2.isError = rc, Z2.isFinite = ec, Z2.isFunction = uc, Z2.isInteger = ic, Z2.isLength = oc, Z2.isMap = jh, Z2.isMatch = ac, Z2.isMatchWith = lc, Z2.isNaN = sc, Z2.isNative = hc, Z2.isNil = _c, Z2.isNull = pc, Z2.isNumber = vc, Z2.isObject = fc, Z2.isObjectLike = cc, Z2.isPlainObject = gc, Z2.isRegExp = Ah, Z2.isSafeInteger = yc, Z2.isSet = kh, Z2.isString = dc, Z2.isSymbol = bc, Z2.isTypedArray = Oh, Z2.isUndefined = wc, Z2.isWeakMap = mc, Z2.isWeakSet = xc, Z2.join = xo, Z2.kebabCase = Kh, Z2.last = jo, Z2.lastIndexOf = Ao, Z2.lowerCase = Vh, Z2.lowerFirst = Gh, Z2.lt = Ih, Z2.lte = Rh, Z2.max = Ya, Z2.maxBy = Qa, Z2.mean = Xa, Z2.meanBy = nl, Z2.min = tl, Z2.minBy = rl, Z2.stubArray = Pa, Z2.stubFalse = qa, Z2.stubObject = Za, Z2.stubString = Ka, Z2.stubTrue = Va, Z2.multiply = _p, Z2.nth = ko, Z2.noConflict = $a, Z2.noop = Da, Z2.now = fh, Z2.pad = ha, Z2.padEnd = pa, Z2.padStart = _a, Z2.parseInt = va, Z2.random = oa, Z2.reduce = bf, Z2.reduceRight = wf, Z2.repeat = ga, Z2.replace = ya, Z2.result = Hc, Z2.round = vp, Z2.runInContext = p2, Z2.sample = xf, Z2.size = kf, Z2.snakeCase = Hh, Z2.some = Of, Z2.sortedIndex = Wo, Z2.sortedIndexBy = Lo, Z2.sortedIndexOf = Co, Z2.sortedLastIndex = Uo, Z2.sortedLastIndexBy = Bo, Z2.sortedLastIndexOf = To, Z2.startCase = Jh, Z2.startsWith = ba, Z2.subtract = gp, Z2.sum = el, Z2.sumBy = ul, Z2.template = wa, Z2.times = Ga, Z2.toFinite = Ac, Z2.toInteger = kc, Z2.toLength = Oc, Z2.toLower = ma, Z2.toNumber = Ic, Z2.toSafeInteger = zc, Z2.toString = Ec, Z2.toUpper = xa, Z2.trim = ja, Z2.trimEnd = Aa, Z2.trimStart = ka, Z2.truncate = Oa, Z2.unescape = Ia, Z2.uniqueId = Ja, Z2.upperCase = Yh, Z2.upperFirst = Qh, Z2.each = _f, Z2.eachRight = vf, Z2.first = bo, Ta(Z2, function() {
var n2 = {};
return ue2(Z2, function(t2, r2) {
bl.call(Z2.prototype, r2) || (n2[r2] = t2);
}), n2;
}(), { chain: false }), Z2.VERSION = nn, r(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(n2) {
Z2[n2].placeholder = Z2;
}), r(["drop", "take"], function(n2, t2) {
Ct2.prototype[n2] = function(r2) {
r2 = r2 === X ? 1 : Gl(kc(r2), 0);
var e2 = this.__filtered__ && !t2 ? new Ct2(this) : this.clone();
return e2.__filtered__ ? e2.__takeCount__ = Hl(r2, e2.__takeCount__) : e2.__views__.push({ size: Hl(r2, Un), type: n2 + (e2.__dir__ < 0 ? "Right" : "") }), e2;
}, Ct2.prototype[n2 + "Right"] = function(t3) {
return this.reverse()[n2](t3).reverse();
};
}), r(["filter", "map", "takeWhile"], function(n2, t2) {
var r2 = t2 + 1, e2 = r2 == Rn || r2 == En;
Ct2.prototype[n2] = function(n3) {
var t3 = this.clone();
return t3.__iteratees__.push({ iteratee: mi(n3, 3), type: r2 }), t3.__filtered__ = t3.__filtered__ || e2, t3;
};
}), r(["head", "last"], function(n2, t2) {
var r2 = "take" + (t2 ? "Right" : "");
Ct2.prototype[n2] = function() {
return this[r2](1).value()[0];
};
}), r(["initial", "tail"], function(n2, t2) {
var r2 = "drop" + (t2 ? "" : "Right");
Ct2.prototype[n2] = function() {
return this.__filtered__ ? new Ct2(this) : this[r2](1);
};
}), Ct2.prototype.compact = function() {
return this.filter(La);
}, Ct2.prototype.find = function(n2) {
return this.filter(n2).head();
}, Ct2.prototype.findLast = function(n2) {
return this.reverse().find(n2);
}, Ct2.prototype.invokeMap = uu(function(n2, t2) {
return "function" == typeof n2 ? new Ct2(this) : this.map(function(r2) {
return Ie(r2, n2, t2);
});
}), Ct2.prototype.reject = function(n2) {
return this.filter(Uf(mi(n2)));
}, Ct2.prototype.slice = function(n2, t2) {
n2 = kc(n2);
var r2 = this;
return r2.__filtered__ && (n2 > 0 || t2 < 0) ? new Ct2(r2) : (n2 < 0 ? r2 = r2.takeRight(-n2) : n2 && (r2 = r2.drop(n2)), t2 !== X && (t2 = kc(t2), r2 = t2 < 0 ? r2.dropRight(-t2) : r2.take(t2 - n2)), r2);
}, Ct2.prototype.takeRightWhile = function(n2) {
return this.reverse().takeWhile(n2).reverse();
}, Ct2.prototype.toArray = function() {
return this.take(Un);
}, ue2(Ct2.prototype, function(n2, t2) {
var r2 = /^(?:filter|find|map|reject)|While$/.test(t2), e2 = /^(?:head|last)$/.test(t2), u2 = Z2[e2 ? "take" + ("last" == t2 ? "Right" : "") : t2], i2 = e2 || /^find/.test(t2);
u2 && (Z2.prototype[t2] = function() {
var t3 = this.__wrapped__, o2 = e2 ? [1] : arguments, f2 = t3 instanceof Ct2, c2 = o2[0], l2 = f2 || bh(t3), s2 = function(n3) {
var t4 = u2.apply(Z2, a([n3], o2));
return e2 && h2 ? t4[0] : t4;
};
l2 && r2 && "function" == typeof c2 && 1 != c2.length && (f2 = l2 = false);
var h2 = this.__chain__, p3 = !!this.__actions__.length, _2 = i2 && !h2, v2 = f2 && !p3;
if (!i2 && l2) {
t3 = v2 ? t3 : new Ct2(this);
var g2 = n2.apply(t3, o2);
return g2.__actions__.push({ func: nf, args: [s2], thisArg: X }), new Y2(g2, h2);
}
return _2 && v2 ? n2.apply(this, o2) : (g2 = this.thru(s2), _2 ? e2 ? g2.value()[0] : g2.value() : g2);
});
}), r(["pop", "push", "shift", "sort", "splice", "unshift"], function(n2) {
var t2 = _l[n2], r2 = /^(?:push|sort|unshift)$/.test(n2) ? "tap" : "thru", e2 = /^(?:pop|shift)$/.test(n2);
Z2.prototype[n2] = function() {
var n3 = arguments;
if (e2 && !this.__chain__) {
var u2 = this.value();
return t2.apply(bh(u2) ? u2 : [], n3);
}
return this[r2](function(r3) {
return t2.apply(bh(r3) ? r3 : [], n3);
});
};
}), ue2(Ct2.prototype, function(n2, t2) {
var r2 = Z2[t2];
if (r2) {
var e2 = r2.name + "";
bl.call(fs, e2) || (fs[e2] = []), fs[e2].push({ name: t2, func: r2 });
}
}), fs[Qu(X, vn).name] = [{ name: "wrapper", func: X }], Ct2.prototype.clone = $t2, Ct2.prototype.reverse = Yt2, Ct2.prototype.value = Qt2, Z2.prototype.at = Qs, Z2.prototype.chain = tf, Z2.prototype.commit = rf, Z2.prototype.next = ef, Z2.prototype.plant = of, Z2.prototype.reverse = ff, Z2.prototype.toJSON = Z2.prototype.valueOf = Z2.prototype.value = cf, Z2.prototype.first = Z2.prototype.head, Ul && (Z2.prototype[Ul] = uf), Z2;
}, be = de();
"function" == typeof define && "object" == typeof define.amd && define.amd ? (re._ = be, define(function() {
return be;
})) : ue ? ((ue.exports = be)._ = be, ee._ = be) : re._ = be;
}).call(exports);
}
});
// node_modules/lodash/fp.js
var require_fp = __commonJS({
"node_modules/lodash/fp.js"(exports, module) {
var _ = require_lodash_min().runInContext();
module.exports = require_baseConvert()(_, _);
}
});
// node_modules/@strapi/content-type-builder/dist/admin/pages/App/index.mjs
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
var import_react11 = __toESM(require_react(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
var import_react2 = __toESM(require_react(), 1);
var import_upperFirst = __toESM(require_upperFirst(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/ContentTypeBuilderNav/useContentTypeBuilderMenu.mjs
var import_react = __toESM(require_react(), 1);
var import_isEqual = __toESM(require_isEqual(), 1);
var useContentTypeBuilderMenu = () => {
const { components, componentsGroupedByCategory, contentTypes, isInDevelopmentMode, sortedContentTypesList, modifiedData, initialData } = useDataManager();
const { toggleNotification } = useNotification();
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const [searchValue, setSearchValue] = (0, import_react.useState)("");
const { onOpenModalCreateSchema, onOpenModalEditCategory } = useFormModalNavigation();
const { locale } = useIntl();
const { startsWith } = useFilter(locale, {
sensitivity: "base"
});
const formatter = useCollator(locale, {
sensitivity: "base"
});
const canOpenModalCreateCTorComponent = !Object.keys(contentTypes).some((ct) => contentTypes[ct].isTemporary === true) && !Object.keys(components).some((component) => components[component].isTemporary === true) && (0, import_isEqual.default)(modifiedData, initialData);
const handleClickOpenModalCreateCollectionType = () => {
if (canOpenModalCreateCTorComponent) {
trackUsage(`willCreateContentType`);
const nextState = {
modalType: "contentType",
kind: "collectionType",
actionType: "create",
forTarget: "contentType"
};
onOpenModalCreateSchema(nextState);
} else {
toggleNotificationCannotCreateSchema();
}
};
const handleClickOpenModalCreateSingleType = () => {
if (canOpenModalCreateCTorComponent) {
trackUsage(`willCreateSingleType`);
const nextState = {
modalType: "contentType",
kind: "singleType",
actionType: "create",
forTarget: "contentType"
};
onOpenModalCreateSchema(nextState);
} else {
toggleNotificationCannotCreateSchema();
}
};
const handleClickOpenModalCreateComponent = () => {
if (canOpenModalCreateCTorComponent) {
trackUsage("willCreateComponent");
const nextState = {
modalType: "component",
kind: null,
actionType: "create",
forTarget: "component"
};
onOpenModalCreateSchema(nextState);
} else {
toggleNotificationCannotCreateSchema();
}
};
const toggleNotificationCannotCreateSchema = () => {
toggleNotification({
type: "info",
message: formatMessage({
id: getTrad("notification.info.creating.notSaved"),
defaultMessage: "Please save your work before creating a new collection type or component"
})
});
};
const componentsData = Object.entries(componentsGroupedByCategory).map(([category, components2]) => ({
name: category,
title: category,
isEditable: isInDevelopmentMode,
// TODO: re-add functionality to edit category name
onClickEdit(e, data2) {
e.stopPropagation();
if (canOpenModalCreateCTorComponent) {
onOpenModalEditCategory(data2.name);
} else {
toggleNotificationCannotCreateSchema();
}
},
links: components2.map((component) => ({
name: component.uid,
to: `/plugins/${pluginId}/component-categories/${category}/${component.uid}`,
title: component.schema.displayName
})).sort((a, b) => formatter.compare(a.title, b.title))
})).sort((a, b) => formatter.compare(a.title, b.title));
const displayedContentTypes = sortedContentTypesList.filter((obj) => obj.visible);
const data = [
{
name: "models",
title: {
id: `${getTrad("menu.section.models.name")}`,
defaultMessage: "Collection Types"
},
customLink: isInDevelopmentMode && {
id: `${getTrad("button.model.create")}`,
defaultMessage: "Create new collection type",
onClick: handleClickOpenModalCreateCollectionType
},
links: displayedContentTypes.filter((contentType) => contentType.kind === "collectionType")
},
{
name: "singleTypes",
title: {
id: `${getTrad("menu.section.single-types.name")}`,
defaultMessage: "Single Types"
},
customLink: isInDevelopmentMode && {
id: `${getTrad("button.single-types.create")}`,
defaultMessage: "Create new single type",
onClick: handleClickOpenModalCreateSingleType
},
links: displayedContentTypes.filter((singleType) => singleType.kind === "singleType")
},
{
name: "components",
title: {
id: `${getTrad("menu.section.components.name")}`,
defaultMessage: "Components"
},
customLink: isInDevelopmentMode && {
id: `${getTrad("button.component.create")}`,
defaultMessage: "Create a new component",
onClick: handleClickOpenModalCreateComponent
},
links: componentsData
}
].map((section) => {
const hasChild = section.links.some((l) => Array.isArray(l.links));
if (hasChild) {
let filteredLinksCount = 0;
return {
...section,
links: section.links.map((link) => {
const filteredLinks2 = link.links.filter((link2) => startsWith(link2.title, searchValue));
if (filteredLinks2.length === 0) {
return null;
}
filteredLinksCount += filteredLinks2.length;
return {
...link,
links: filteredLinks2.sort((a, b) => formatter.compare(a.title, b.title))
};
}).filter(Boolean),
linksCount: filteredLinksCount
};
}
const filteredLinks = section.links.filter((link) => startsWith(link.title, searchValue)).sort((a, b) => formatter.compare(a.title, b.title));
return {
...section,
links: filteredLinks,
linksCount: filteredLinks.length
};
});
return {
menu: data,
search: {
value: searchValue,
onChange: setSearchValue,
clear: () => setSearchValue("")
}
};
};
// node_modules/@strapi/content-type-builder/dist/admin/components/ContentTypeBuilderNav/ContentTypeBuilderNav.mjs
var SubNavLinkCustom = dt(SubNavLink)`
div {
width: inherit;
span:nth-child(2) {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: inherit;
}
}
`;
var ContentTypeBuilderNav = () => {
const { menu, search } = useContentTypeBuilderMenu();
const { formatMessage } = useIntl();
const pluginName = formatMessage({
id: getTrad("plugin.name"),
defaultMessage: "Content-Type Builder"
});
return (0, import_jsx_runtime.jsxs)(SubNav, {
"aria-label": pluginName,
children: [
(0, import_jsx_runtime.jsx)(SubNavHeader, {
searchable: true,
value: search.value,
onClear: () => search.clear(),
onChange: (e) => search.onChange(e.target.value),
label: pluginName,
searchLabel: formatMessage({
id: "global.search",
defaultMessage: "Search"
})
}),
(0, import_jsx_runtime.jsx)(SubNavSections, {
children: menu.map((section) => (0, import_jsx_runtime.jsxs)(import_react2.Fragment, {
children: [
(0, import_jsx_runtime.jsx)(SubNavSection, {
label: formatMessage({
id: section.title.id,
defaultMessage: section.title.defaultMessage
}),
collapsable: true,
badgeLabel: section.linksCount.toString(),
children: section.links.map((link) => {
if (link.links) {
return (0, import_jsx_runtime.jsx)(SubNavLinkSection, {
label: (0, import_upperFirst.default)(link.title),
children: link.links.map((subLink) => (0, import_jsx_runtime.jsx)(SubNavLink, {
tag: NavLink,
to: subLink.to,
active: subLink.active,
isSubSectionChild: true,
children: (0, import_upperFirst.default)(formatMessage({
id: subLink.name,
defaultMessage: subLink.title
}))
}, subLink.name))
}, link.name);
}
return (0, import_jsx_runtime.jsx)(SubNavLinkCustom, {
tag: NavLink,
to: link.to,
active: link.active,
width: "100%",
children: (0, import_upperFirst.default)(formatMessage({
id: link.name,
defaultMessage: link.title
}))
}, link.name);
})
}),
section.customLink && (0, import_jsx_runtime.jsx)(Box, {
paddingLeft: 7,
children: (0, import_jsx_runtime.jsx)(TextButton, {
onClick: section.customLink.onClick,
startIcon: (0, import_jsx_runtime.jsx)(ForwardRef$1h, {
width: "0.8rem",
height: "0.8rem"
}),
marginTop: 2,
cursor: "pointer",
children: formatMessage({
id: section.customLink.id,
defaultMessage: section.customLink.defaultMessage
})
})
})
]
}, section.name))
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/DataManagerProvider.mjs
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var import_react10 = __toESM(require_react(), 1);
var import_get9 = __toESM(require_get(), 1);
var import_groupBy = __toESM(require_groupBy(), 1);
var import_set2 = __toESM(require_set(), 1);
var import_size = __toESM(require_size(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/FormModal.mjs
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var React2 = __toESM(require_react(), 1);
var import_get4 = __toESM(require_get(), 1);
var import_has = __toESM(require_has(), 1);
var import_isEqual3 = __toESM(require_isEqual(), 1);
var import_set = __toESM(require_set(), 1);
var import_toLower = __toESM(require_toLower(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/utils/isAllowedContentTypesForRelations.mjs
var isAllowedContentTypesForRelations = (contentType) => {
return contentType.kind === "collectionType" && (contentType.restrictRelationsTo === null || Array.isArray(contentType.restrictRelationsTo) && contentType.restrictRelationsTo.length > 0);
};
// node_modules/@strapi/content-type-builder/dist/admin/utils/findAttribute.mjs
var findAttribute = (attributes, attributeToFind) => {
return attributes.find(({ name }) => name === attributeToFind);
};
// node_modules/@strapi/content-type-builder/dist/admin/utils/getYupInnerErrors.mjs
var extractValuesFromYupError = (errorType, errorParams) => {
if (!errorType || !errorParams) {
return {};
}
return {
[errorType]: errorParams[errorType]
};
};
var getYupInnerErrors = (error) => ((error == null ? void 0 : error.inner) || []).reduce((acc, currentError) => {
if (currentError.path) {
acc[currentError.path.split("[").join(".").split("]").join("")] = {
id: currentError.message,
defaultMessage: currentError.message,
values: extractValuesFromYupError(currentError == null ? void 0 : currentError.type, currentError == null ? void 0 : currentError.params)
};
}
return acc;
}, {});
// node_modules/@strapi/content-type-builder/dist/admin/components/AllowedTypesSelect.mjs
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var import_upperFirst2 = __toESM(require_upperFirst(), 1);
var options = [
{
label: "All",
children: [
{
label: "images (JPEG, PNG, GIF, SVG, TIFF, ICO, DVU)",
value: "images"
},
{
label: "videos (MPEG, MP4, Quicktime, WMV, AVI, FLV)",
value: "videos"
},
{
label: "audios (MP3, WAV, OGG)",
value: "audios"
},
{
label: "files (CSV, ZIP, PDF, Excel, JSON, ...)",
value: "files"
}
]
}
];
var AllowedTypesSelect = ({ intlLabel, name, onChange, value = null }) => {
const { formatMessage } = useIntl();
const displayedValue = value === null || (value == null ? void 0 : value.length) === 0 ? formatMessage({
id: "global.none",
defaultMessage: "None"
}) : [
...value
].sort().map((v) => (0, import_upperFirst2.default)(v)).join(", ");
const label = intlLabel.id ? formatMessage({
id: intlLabel.id,
defaultMessage: intlLabel.defaultMessage
}) : name;
return (0, import_jsx_runtime2.jsxs)(Field.Root, {
name,
children: [
(0, import_jsx_runtime2.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime2.jsx)(MultiSelectNested, {
customizeContent: () => displayedValue,
onChange: (values) => {
if (values.length > 0) {
onChange({
target: {
name,
value: values,
type: "allowed-types-select"
}
});
} else {
onChange({
target: {
name,
value: null,
type: "allowed-types-select"
}
});
}
},
options,
value: value || []
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeOptions.mjs
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeList.mjs
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeOption.mjs
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/OptionBoxWrapper.mjs
var OptionBoxWrapper = dt(Box)`
width: 100%;
height: 100%;
border: 1px solid ${({ theme }) => theme.colors.neutral200};
text-align: left;
&:hover {
cursor: pointer;
background: ${({ theme }) => theme.colors.primary100};
border: 1px solid ${({ theme }) => theme.colors.primary200};
}
`;
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeOption.mjs
var newAttributes = [];
var NewBadge = () => (0, import_jsx_runtime3.jsx)(Flex, {
grow: 1,
justifyContent: "flex-end",
children: (0, import_jsx_runtime3.jsxs)(Flex, {
gap: 1,
hasRadius: true,
background: "alternative100",
padding: `0.2rem 0.4rem`,
children: [
(0, import_jsx_runtime3.jsx)(ForwardRef$J, {
width: `1rem`,
height: `1rem`,
fill: "alternative600"
}),
(0, import_jsx_runtime3.jsx)(Typography, {
textColor: "alternative600",
variant: "sigma",
children: "New"
})
]
})
});
var AttributeOption = ({ type = "text" }) => {
const { formatMessage } = useIntl();
const { onClickSelectField } = useFormModalNavigation();
const handleClick = () => {
const step = type === "component" ? "1" : null;
onClickSelectField({
attributeType: type,
step
});
};
return (0, import_jsx_runtime3.jsx)(OptionBoxWrapper, {
padding: 4,
tag: "button",
hasRadius: true,
type: "button",
onClick: handleClick,
children: (0, import_jsx_runtime3.jsxs)(Flex, {
children: [
(0, import_jsx_runtime3.jsx)(AttributeIcon, {
type
}),
(0, import_jsx_runtime3.jsxs)(Box, {
paddingLeft: 4,
width: "100%",
children: [
(0, import_jsx_runtime3.jsxs)(Flex, {
justifyContent: "space-between",
children: [
(0, import_jsx_runtime3.jsx)(Typography, {
fontWeight: "bold",
textColor: "neutral800",
children: formatMessage({
id: getTrad(`attribute.${type}`),
defaultMessage: type
})
}),
newAttributes.includes(type) && (0, import_jsx_runtime3.jsx)(NewBadge, {})
]
}),
(0, import_jsx_runtime3.jsx)(Flex, {
children: (0, import_jsx_runtime3.jsx)(Typography, {
variant: "pi",
textColor: "neutral600",
children: formatMessage({
id: getTrad(`attribute.${type}.description`),
defaultMessage: "A type for modeling data"
})
})
})
]
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeList.mjs
var AttributeList = ({ attributes }) => (0, import_jsx_runtime4.jsx)(KeyboardNavigable, {
tagName: "button",
children: (0, import_jsx_runtime4.jsx)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 8,
children: attributes.map((attributeRow, index) => {
return (
// eslint-disable-next-line react/no-array-index-key
(0, import_jsx_runtime4.jsx)(Grid.Root, {
gap: 3,
children: attributeRow.map((attribute) => (0, import_jsx_runtime4.jsx)(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: (0, import_jsx_runtime4.jsx)(AttributeOption, {
type: attribute
})
}, attribute))
}, index)
);
})
})
});
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/CustomFieldsList.mjs
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/CustomFieldOption.mjs
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var import_react3 = __toESM(require_react(), 1);
var CustomFieldOption = ({ customFieldUid, customField }) => {
const { type, intlLabel, intlDescription } = customField;
const { formatMessage } = useIntl();
const { onClickSelectCustomField } = useFormModalNavigation();
const handleClick = () => {
onClickSelectCustomField({
attributeType: type,
customFieldUid
});
};
return (0, import_jsx_runtime5.jsx)(OptionBoxWrapper, {
padding: 4,
tag: "button",
hasRadius: true,
type: "button",
onClick: handleClick,
children: (0, import_jsx_runtime5.jsxs)(Flex, {
children: [
(0, import_jsx_runtime5.jsx)(AttributeIcon, {
type,
customField: customFieldUid
}),
(0, import_jsx_runtime5.jsxs)(Box, {
paddingLeft: 4,
children: [
(0, import_jsx_runtime5.jsx)(Flex, {
children: (0, import_jsx_runtime5.jsx)(Typography, {
fontWeight: "bold",
textColor: "neutral800",
children: formatMessage(intlLabel)
})
}),
(0, import_jsx_runtime5.jsx)(Flex, {
children: (0, import_jsx_runtime5.jsx)(Typography, {
variant: "pi",
textColor: "neutral600",
children: formatMessage(intlDescription)
})
})
]
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/EmptyAttributes.mjs
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
var qs = __toESM(require_lib(), 1);
var EmptyCard = dt(Box)`
background: ${({ theme }) => `linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${theme.colors.neutral150} 100%)`};
opacity: 0.33;
`;
var EmptyCardGrid = () => {
return (0, import_jsx_runtime6.jsx)(Flex, {
wrap: "wrap",
gap: 4,
children: [
...Array(4)
].map((_, idx) => {
return (0, import_jsx_runtime6.jsx)(EmptyCard, {
height: "138px",
width: "375px",
hasRadius: true
}, `empty-card-${idx}`);
})
});
};
var EmptyAttributes = () => {
const { formatMessage } = useIntl();
return (0, import_jsx_runtime6.jsxs)(Box, {
position: "relative",
children: [
(0, import_jsx_runtime6.jsx)(EmptyCardGrid, {}),
(0, import_jsx_runtime6.jsx)(Box, {
position: "absolute",
top: 6,
width: "100%",
children: (0, import_jsx_runtime6.jsxs)(Flex, {
alignItems: "center",
justifyContent: "center",
direction: "column",
children: [
(0, import_jsx_runtime6.jsx)(ForwardRef$J2, {
width: "160px",
height: "88px"
}),
(0, import_jsx_runtime6.jsx)(Box, {
paddingTop: 6,
paddingBottom: 4,
children: (0, import_jsx_runtime6.jsxs)(Box, {
textAlign: "center",
children: [
(0, import_jsx_runtime6.jsx)(Typography, {
variant: "delta",
tag: "p",
textColor: "neutral600",
children: formatMessage({
id: getTrad("modalForm.empty.heading"),
defaultMessage: "Nothing in here yet."
})
}),
(0, import_jsx_runtime6.jsx)(Box, {
paddingTop: 4,
children: (0, import_jsx_runtime6.jsx)(Typography, {
variant: "delta",
tag: "p",
textColor: "neutral600",
children: formatMessage({
id: getTrad("modalForm.empty.sub-heading"),
defaultMessage: "Find what you are looking for through a wide range of extensions."
})
})
})
]
})
}),
(0, import_jsx_runtime6.jsx)(LinkButton, {
tag: Link,
to: `/marketplace?${qs.stringify({
categories: [
"Custom fields"
]
})}`,
variant: "secondary",
startIcon: (0, import_jsx_runtime6.jsx)(ForwardRef$1h, {}),
children: formatMessage({
id: getTrad("modalForm.empty.button"),
defaultMessage: "Add custom fields"
})
})
]
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/CustomFieldsList.mjs
var CustomFieldsList = () => {
const { formatMessage } = useIntl();
const getAllCustomFields = useStrapiApp("CustomFieldsList", (state) => state.customFields.getAll);
const registeredCustomFields = Object.entries(getAllCustomFields());
if (!registeredCustomFields.length) {
return (0, import_jsx_runtime7.jsx)(EmptyAttributes, {});
}
const sortedCustomFields = registeredCustomFields.sort((a, b) => a[1].name > b[1].name ? 1 : -1);
return (0, import_jsx_runtime7.jsx)(KeyboardNavigable, {
tagName: "button",
children: (0, import_jsx_runtime7.jsxs)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 3,
children: [
(0, import_jsx_runtime7.jsx)(Grid.Root, {
gap: 3,
children: sortedCustomFields.map(([uid, customField]) => (0, import_jsx_runtime7.jsx)(Grid.Item, {
col: 6,
direction: "column",
alignItems: "stretch",
children: (0, import_jsx_runtime7.jsx)(CustomFieldOption, {
customFieldUid: uid,
customField
}, uid)
}, uid))
}),
(0, import_jsx_runtime7.jsx)(Link2, {
href: "https://docs.strapi.io/developer-docs/latest/development/custom-fields.html",
isExternal: true,
children: formatMessage({
id: getTrad("modalForm.tabs.custom.howToLink"),
defaultMessage: "How to add custom fields"
})
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/AttributeOptions/AttributeOptions.mjs
var AttributeOptions = ({ attributes, forTarget, kind }) => {
const { formatMessage } = useIntl();
const defaultTabId = getTrad("modalForm.tabs.default");
const customTabId = getTrad("modalForm.tabs.custom");
const titleIdSuffix = forTarget.includes("component") ? "component" : kind;
const titleId = getTrad(`modalForm.sub-header.chooseAttribute.${titleIdSuffix}`);
return (0, import_jsx_runtime8.jsx)(Modal.Body, {
children: (0, import_jsx_runtime8.jsxs)(Tabs.Root, {
variant: "simple",
defaultValue: "default",
children: [
(0, import_jsx_runtime8.jsxs)(Flex, {
justifyContent: "space-between",
children: [
(0, import_jsx_runtime8.jsx)(Typography, {
variant: "beta",
tag: "h2",
children: formatMessage({
id: titleId,
defaultMessage: "Select a field"
})
}),
(0, import_jsx_runtime8.jsxs)(Tabs.List, {
children: [
(0, import_jsx_runtime8.jsx)(Tabs.Trigger, {
value: "default",
children: formatMessage({
id: defaultTabId,
defaultMessage: "Default"
})
}),
(0, import_jsx_runtime8.jsx)(Tabs.Trigger, {
value: "custom",
children: formatMessage({
id: customTabId,
defaultMessage: "Custom"
})
})
]
})
]
}),
(0, import_jsx_runtime8.jsx)(Divider, {
marginBottom: 6
}),
(0, import_jsx_runtime8.jsx)(Tabs.Content, {
value: "default",
children: (0, import_jsx_runtime8.jsx)(AttributeList, {
attributes
})
}),
(0, import_jsx_runtime8.jsx)(Tabs.Content, {
value: "custom",
children: (0, import_jsx_runtime8.jsx)(CustomFieldsList, {})
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/BooleanDefaultValueSelect.mjs
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
var BooleanDefaultValueSelect = ({ intlLabel, name, options: options2, onChange, value = null }) => {
const { formatMessage } = useIntl();
const label = intlLabel.id ? formatMessage({
id: intlLabel.id,
defaultMessage: intlLabel.defaultMessage
}, {
...intlLabel.values
}) : name;
const handleChange = (value2) => {
let nextValue = "";
if (value2 === "true") {
nextValue = true;
}
if (value2 === "false") {
nextValue = false;
}
onChange({
target: {
name,
value: nextValue,
type: "select-default-boolean"
}
});
};
return (0, import_jsx_runtime9.jsxs)(Field.Root, {
name,
children: [
(0, import_jsx_runtime9.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime9.jsx)(SingleSelect, {
onChange: handleChange,
value: (value === null ? "" : value).toString(),
children: options2.map(({ metadatas: { intlLabel: intlLabel2, disabled, hidden }, key, value: value2 }) => {
return (0, import_jsx_runtime9.jsx)(SingleSelectOption, {
value: value2,
disabled,
hidden,
children: intlLabel2.defaultMessage
}, key);
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/BooleanRadioGroup.mjs
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
var import_react4 = __toESM(require_react(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/CustomRadioGroup/Styles.mjs
var Wrapper = dt(Flex)`
position: relative;
align-items: stretch;
label {
border-radius: 4px;
max-width: 50%;
cursor: pointer;
user-select: none;
flex: 1;
border-radius: 4px;
border: 1px solid ${({ theme }) => theme.colors.neutral200};
${inputFocusStyle()}
}
input {
position: absolute;
opacity: 0;
}
.option {
height: 100%;
border-radius: 4px;
will-change: transform, opacity;
background: ${({ theme }) => theme.colors.neutral0};
.checkmark {
position: relative;
display: block;
will-change: transform;
background: ${({ theme }) => theme.colors.neutral0};
width: ${({ theme }) => theme.spaces[5]};
height: ${({ theme }) => theme.spaces[5]};
border: solid 1px ${({ theme }) => theme.colors.neutral300};
border-radius: 50%;
&:before,
&:after {
content: '';
display: block;
border-radius: 50%;
width: ${({ theme }) => theme.spaces[3]};
height: ${({ theme }) => theme.spaces[3]};
position: absolute;
top: 3px;
left: 3px;
}
&:after {
transform: scale(0);
transition: inherit;
will-change: transform;
}
}
}
.container input:checked ~ div {
background: ${({ theme }) => theme.colors.primary100};
color: ${({ theme }) => theme.colors.primary600};
.checkmark {
border: solid 1px ${({ theme }) => theme.colors.primary600};
&::after {
background: ${({ theme }) => theme.colors.primary600};
transform: scale(1);
}
}
}
`;
// node_modules/@strapi/content-type-builder/dist/admin/components/CustomRadioGroup/CustomRadioGroup.mjs
var CustomRadioGroup = ({ intlLabel, name, onChange, radios = [], value }) => {
const { formatMessage } = useIntl();
return (0, import_jsx_runtime10.jsxs)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 2,
children: [
(0, import_jsx_runtime10.jsx)(Typography, {
variant: "pi",
fontWeight: "bold",
textColor: "neutral800",
htmlFor: name,
tag: "label",
children: formatMessage(intlLabel)
}),
(0, import_jsx_runtime10.jsx)(Wrapper, {
gap: 4,
alignItems: "stretch",
children: radios.map((radio) => {
return (0, import_jsx_runtime10.jsxs)("label", {
htmlFor: radio.value.toString(),
className: "container",
children: [
(0, import_jsx_runtime10.jsx)("input", {
id: radio.value.toString(),
name,
className: "option-input",
checked: radio.value === value,
value: radio.value,
onChange,
type: "radio"
}, radio.value),
(0, import_jsx_runtime10.jsx)(Box, {
className: "option",
padding: 4,
children: (0, import_jsx_runtime10.jsxs)(Flex, {
children: [
(0, import_jsx_runtime10.jsx)(Box, {
paddingRight: 4,
children: (0, import_jsx_runtime10.jsx)("span", {
className: "checkmark"
})
}),
(0, import_jsx_runtime10.jsxs)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 2,
children: [
(0, import_jsx_runtime10.jsx)(Typography, {
fontWeight: "bold",
children: formatMessage(radio.title)
}),
(0, import_jsx_runtime10.jsx)(Typography, {
variant: "pi",
textColor: "neutral600",
children: formatMessage(radio.description)
})
]
})
]
})
})
]
}, radio.value);
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/BooleanRadioGroup.mjs
var BooleanRadioGroup = ({ onChange, name, intlLabel, ...rest }) => {
const handleChange = (e) => {
const checked = e.target.value !== "false";
onChange({
target: {
name,
value: checked,
type: "boolean-radio-group"
}
});
};
return (0, import_jsx_runtime11.jsx)(CustomRadioGroup, {
...rest,
name,
onChange: handleChange,
intlLabel
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/CheckboxWithNumberField.mjs
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
var CheckboxWithNumberField = ({ error, intlLabel, modifiedData, name, onChange, value = null }) => {
const { formatMessage } = useIntl();
const label = intlLabel.id ? formatMessage({
id: intlLabel.id,
defaultMessage: intlLabel.defaultMessage
}, {
...intlLabel.values
}) : name;
const type = modifiedData.type === "biginteger" ? "text" : "number";
const disabled = !modifiedData.type;
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
return (0, import_jsx_runtime12.jsxs)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 2,
children: [
(0, import_jsx_runtime12.jsx)(CheckboxImpl, {
id: name,
name,
onCheckedChange: (value2) => {
const initValue = type === "text" ? "0" : 0;
const nextValue = value2 ? initValue : null;
onChange({
target: {
name,
value: nextValue
}
});
},
checked: value !== null,
children: label
}),
value !== null && (0, import_jsx_runtime12.jsx)(Box, {
paddingLeft: 6,
style: {
maxWidth: "200px"
},
children: type === "text" ? (0, import_jsx_runtime12.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime12.jsx)(TextInput, {
"aria-label": label,
disabled,
onChange,
value: value === null ? "" : value
}),
(0, import_jsx_runtime12.jsx)(Field.Error, {})
]
}) : (0, import_jsx_runtime12.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime12.jsx)(NumberInput, {
"aria-label": label,
disabled,
onValueChange: (value2) => {
onChange({
target: {
name,
value: value2 ?? 0,
type
}
});
},
value: value || 0
}),
(0, import_jsx_runtime12.jsx)(Field.Error, {})
]
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/ContentTypeRadioGroup.mjs
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var ContentTypeRadioGroup = ({ onChange, ...rest }) => {
const { formatMessage } = useIntl();
const { toggleNotification } = useNotification();
const handleChange = (e) => {
toggleNotification({
type: "info",
message: formatMessage({
id: getTrad("contentType.kind.change.warning"),
defaultMessage: "You just changed the kind of a content type: API will be reset (routes, controllers, and services will be overwritten)."
})
});
onChange(e);
};
return (0, import_jsx_runtime13.jsx)(CustomRadioGroup, {
...rest,
onChange: handleChange
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DraftAndPublishToggle.mjs
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var import_react5 = __toESM(require_react(), 1);
var DraftAndPublishToggle = ({ description, disabled = false, intlLabel, isCreating, name, onChange, value = false }) => {
const { formatMessage } = useIntl();
const [showWarning, setShowWarning] = (0, import_react5.useState)(false);
const label = intlLabel.id ? formatMessage({
id: intlLabel.id,
defaultMessage: intlLabel.defaultMessage
}, {
...intlLabel.values
}) : name;
const hint = description ? formatMessage({
id: description.id,
defaultMessage: description.defaultMessage
}, {
...description.values
}) : "";
const handleConfirm = () => {
onChange({
target: {
name,
value: false
}
});
setShowWarning(false);
};
const handleChange = (checked) => {
if (!checked && !isCreating) {
setShowWarning(true);
return;
}
onChange({
target: {
name,
value: !!checked
}
});
};
return (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, {
children: [
(0, import_jsx_runtime14.jsxs)(Field.Root, {
hint,
name,
children: [
(0, import_jsx_runtime14.jsx)(CheckboxImpl, {
checked: value,
disabled,
onCheckedChange: handleChange,
children: label
}),
(0, import_jsx_runtime14.jsx)(Field.Hint, {})
]
}),
(0, import_jsx_runtime14.jsx)(Dialog.Root, {
open: showWarning,
onOpenChange: (isOpen) => setShowWarning(isOpen),
children: (0, import_jsx_runtime14.jsx)(ConfirmDialog, {
endAction: (0, import_jsx_runtime14.jsx)(Button, {
onClick: handleConfirm,
variant: "danger",
width: "100%",
justifyContent: "center",
children: formatMessage({
id: getTrad("popUpWarning.draft-publish.button.confirm"),
defaultMessage: "Yes, disable"
})
}),
children: formatMessage({
id: getTrad("popUpWarning.draft-publish.message"),
defaultMessage: "If you disable the draft & publish, your drafts will be deleted."
})
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalEndActions.mjs
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var FormModalEndActions = ({ categoryName, deleteCategory, deleteComponent, deleteContentType, isAttributeModal, isCustomFieldModal, isComponentAttribute, isComponentToDzModal, isContentTypeModal, isCreatingComponent, isCreatingComponentAttribute, isCreatingComponentInDz, isCreatingComponentWhileAddingAField, isCreatingContentType, isCreatingDz, isComponentModal, isDzAttribute, isEditingAttribute, isEditingCategory, isInFirstComponentStep, onSubmitAddComponentAttribute, onSubmitAddComponentToDz, onSubmitCreateContentType, onSubmitCreateComponent, onSubmitCreateDz, onSubmitEditAttribute, onSubmitEditCategory, onSubmitEditComponent, onSubmitEditContentType, onSubmitEditCustomFieldAttribute, onSubmitEditDz, onClickFinish }) => {
const { formatMessage } = useIntl();
if (isComponentToDzModal) {
if (isCreatingComponentInDz) {
return (0, import_jsx_runtime15.jsx)(Button, {
variant: "secondary",
type: "submit",
onClick: (e) => {
e.preventDefault();
onSubmitAddComponentToDz(e, true);
},
startIcon: (0, import_jsx_runtime15.jsx)(ForwardRef$1h, {}),
children: formatMessage({
id: getTrad("form.button.add-first-field-to-created-component"),
defaultMessage: "Add first field to the component"
})
});
}
return (0, import_jsx_runtime15.jsx)(Button, {
variant: "default",
type: "submit",
onClick: (e) => {
e.preventDefault();
onSubmitAddComponentToDz(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
});
}
if (isAttributeModal && isDzAttribute && !isCreatingDz) {
return (0, import_jsx_runtime15.jsx)(Button, {
variant: "default",
type: "submit",
onClick: (e) => {
e.preventDefault();
onClickFinish();
onSubmitEditDz(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
});
}
if (isAttributeModal && isDzAttribute && isCreatingDz) {
return (0, import_jsx_runtime15.jsx)(import_jsx_runtime15.Fragment, {
children: (0, import_jsx_runtime15.jsx)(Button, {
variant: "secondary",
type: "submit",
onClick: (e) => {
e.preventDefault();
onSubmitCreateDz(e, true);
},
startIcon: (0, import_jsx_runtime15.jsx)(ForwardRef$1h, {}),
children: formatMessage({
id: getTrad("form.button.add-components-to-dynamiczone"),
defaultMessage: "Add components to the zone"
})
})
});
}
if (isAttributeModal && isComponentAttribute) {
if (isInFirstComponentStep) {
return (0, import_jsx_runtime15.jsx)(Button, {
variant: "secondary",
type: "submit",
onClick: (e) => {
e.preventDefault();
onSubmitAddComponentAttribute(e, true);
},
children: isCreatingComponentAttribute ? formatMessage({
id: getTrad("form.button.configure-component"),
defaultMessage: "Configure the component"
}) : formatMessage({
id: getTrad("form.button.select-component"),
defaultMessage: "Configure the component"
})
});
}
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
(0, import_jsx_runtime15.jsx)(Button, {
variant: "secondary",
type: "submit",
onClick: (e) => {
e.preventDefault();
onSubmitAddComponentAttribute(e, true);
},
startIcon: (0, import_jsx_runtime15.jsx)(ForwardRef$1h, {}),
children: isCreatingComponentWhileAddingAField ? formatMessage({
id: getTrad("form.button.add-first-field-to-created-component"),
defaultMessage: "Add first field to the component"
}) : formatMessage({
id: getTrad("form.button.add-field"),
defaultMessage: "Add another field"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
variant: "default",
type: "button",
onClick: (e) => {
e.preventDefault();
onClickFinish();
onSubmitAddComponentAttribute(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
})
]
});
}
if (isAttributeModal && !isComponentAttribute && !isDzAttribute) {
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
(0, import_jsx_runtime15.jsx)(Button, {
type: isEditingAttribute ? "button" : "submit",
variant: "secondary",
onClick: (e) => {
e.preventDefault();
onSubmitEditAttribute(e, true);
},
startIcon: (0, import_jsx_runtime15.jsx)(ForwardRef$1h, {}),
children: formatMessage({
id: getTrad("form.button.add-field"),
defaultMessage: "Add another field"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
type: isEditingAttribute ? "submit" : "button",
variant: "default",
onClick: (e) => {
e.preventDefault();
onClickFinish();
onSubmitEditAttribute(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
})
]
});
}
if (isContentTypeModal) {
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
!isCreatingContentType && (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, {
children: [
(0, import_jsx_runtime15.jsx)(Button, {
type: "button",
variant: "danger",
onClick: (e) => {
e.preventDefault();
deleteContentType();
},
children: formatMessage({
id: "global.delete",
defaultMessage: "Delete"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
type: "submit",
variant: "default",
onClick: (e) => {
e.preventDefault();
onSubmitEditContentType(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
})
]
}),
isCreatingContentType && (0, import_jsx_runtime15.jsx)(Button, {
type: "submit",
variant: "secondary",
onClick: (e) => {
e.preventDefault();
onSubmitCreateContentType(e, true);
},
children: formatMessage({
id: "global.continue",
defaultMessage: "Continue"
})
})
]
});
}
if (isComponentModal) {
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
!isCreatingComponent && (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, {
children: [
(0, import_jsx_runtime15.jsx)(Button, {
type: "button",
variant: "danger",
onClick: (e) => {
e.preventDefault();
deleteComponent();
},
children: formatMessage({
id: "global.delete",
defaultMessage: "Delete"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
type: "submit",
variant: "default",
onClick: (e) => {
e.preventDefault();
onSubmitEditComponent(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
})
]
}),
isCreatingComponent && (0, import_jsx_runtime15.jsx)(Button, {
type: "submit",
variant: "secondary",
onClick: (e) => {
e.preventDefault();
onSubmitCreateComponent(e, true);
},
children: formatMessage({
id: "global.continue",
defaultMessage: "Continue"
})
})
]
});
}
if (isEditingCategory) {
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
(0, import_jsx_runtime15.jsx)(Button, {
type: "button",
variant: "danger",
onClick: (e) => {
e.preventDefault();
if (categoryName) {
deleteCategory(categoryName);
}
},
children: formatMessage({
id: "global.delete",
defaultMessage: "Delete"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
type: "submit",
variant: "default",
onClick: (e) => {
e.preventDefault();
onSubmitEditCategory(e);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "finish"
})
})
]
});
}
if (isCustomFieldModal) {
return (0, import_jsx_runtime15.jsxs)(Flex, {
gap: 2,
children: [
(0, import_jsx_runtime15.jsx)(Button, {
type: isEditingAttribute ? "button" : "submit",
variant: "secondary",
onClick: (e) => {
e.preventDefault();
onSubmitEditCustomFieldAttribute(e, true);
},
startIcon: (0, import_jsx_runtime15.jsx)(ForwardRef$1h, {}),
children: formatMessage({
id: getTrad("form.button.add-field"),
defaultMessage: "Add another field"
})
}),
(0, import_jsx_runtime15.jsx)(Button, {
type: isEditingAttribute ? "submit" : "button",
variant: "default",
onClick: (e) => {
e.preventDefault();
onClickFinish();
onSubmitEditCustomFieldAttribute(e, false);
},
children: formatMessage({
id: "global.finish",
defaultMessage: "Finish"
})
})
]
});
}
return null;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalHeader.mjs
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
var import_upperFirst3 = __toESM(require_upperFirst(), 1);
var FormModalHeader = ({ actionType = null, attributeName, attributeType, categoryName, contentTypeKind, dynamicZoneTarget, forTarget, modalType = null, targetUid, customFieldUid = null, showBackLink = false }) => {
var _a;
const { formatMessage } = useIntl();
const { modifiedData } = useDataManager();
const { onOpenModalAddField } = useFormModalNavigation();
let icon = "component";
let headers = [];
const schema = ((_a = modifiedData == null ? void 0 : modifiedData[forTarget]) == null ? void 0 : _a[targetUid]) || (modifiedData == null ? void 0 : modifiedData[forTarget]) || null;
const displayName = schema == null ? void 0 : schema.schema.displayName;
if (modalType === "contentType") {
icon = contentTypeKind;
}
if ([
"component",
"editCategory"
].includes(modalType || "")) {
icon = "component";
}
const isCreatingMainSchema = [
"component",
"contentType"
].includes(modalType || "");
if (isCreatingMainSchema) {
let headerId = getTrad(`modalForm.component.header-${actionType}`);
if (modalType === "contentType") {
headerId = getTrad(`modalForm.${contentTypeKind}.header-create`);
}
if (actionType === "edit") {
headerId = getTrad(`modalForm.header-edit`);
}
return (0, import_jsx_runtime16.jsx)(Modal.Header, {
children: (0, import_jsx_runtime16.jsxs)(Flex, {
children: [
(0, import_jsx_runtime16.jsx)(Box, {
children: (0, import_jsx_runtime16.jsx)(AttributeIcon, {
type: icon
})
}),
(0, import_jsx_runtime16.jsx)(Box, {
paddingLeft: 3,
children: (0, import_jsx_runtime16.jsx)(Modal.Title, {
children: formatMessage({
id: headerId
}, {
name: displayName
})
})
})
]
})
});
}
headers = [
{
label: displayName,
info: {
category: (schema == null ? void 0 : schema.category) || null,
name: schema == null ? void 0 : schema.schema.displayName
}
}
];
if (modalType === "chooseAttribute") {
icon = [
"component",
"components"
].includes(forTarget) ? "component" : schema.schema.kind;
}
if (modalType === "addComponentToDynamicZone") {
icon = "dynamiczone";
headers.push({
label: dynamicZoneTarget
});
}
if (modalType === "attribute" || modalType === "customField") {
icon = attributeType;
headers.push({
label: attributeName
});
}
if (modalType === "editCategory") {
const label = formatMessage({
id: getTrad("modalForm.header.categories"),
defaultMessage: "Categories"
});
headers = [
{
label
},
{
label: categoryName
}
];
}
return (0, import_jsx_runtime16.jsx)(Modal.Header, {
children: (0, import_jsx_runtime16.jsxs)(Flex, {
gap: 3,
children: [
showBackLink && // This is a workaround and should use the LinkButton with a variant that currently doesn't exist
(0, import_jsx_runtime16.jsx)(Link2, {
"aria-label": formatMessage({
id: getTrad("modalForm.header.back"),
defaultMessage: "Back"
}),
startIcon: (0, import_jsx_runtime16.jsx)(ForwardRef$5j, {}),
onClick: () => onOpenModalAddField({
forTarget,
targetUid
}),
href: "#back",
isExternal: false
}),
(0, import_jsx_runtime16.jsx)(AttributeIcon, {
type: icon,
customField: customFieldUid
}),
(0, import_jsx_runtime16.jsx)(Breadcrumbs, {
label: headers.map(({ label }) => label).join(","),
children: headers.map(({ label, info }, index, arr) => {
label = (0, import_upperFirst3.default)(label);
if (!label) {
return null;
}
const key = `${label}.${index}`;
if (info == null ? void 0 : info.category) {
label = `${label} (${(0, import_upperFirst3.default)(info.category)} - ${(0, import_upperFirst3.default)(info.name)})`;
}
return (0, import_jsx_runtime16.jsx)(Crumb, {
isCurrent: index === arr.length - 1,
children: label
}, key);
})
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalSubHeader.mjs
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var import_upperFirst4 = __toESM(require_upperFirst(), 1);
var getModalTitleSubHeader = ({ modalType, forTarget, kind, actionType, step }) => {
switch (modalType) {
case "chooseAttribute":
return getTrad(`modalForm.sub-header.chooseAttribute.${(forTarget == null ? void 0 : forTarget.includes("component")) ? "component" : kind || "collectionType"}`);
case "attribute": {
return getTrad(`modalForm.sub-header.attribute.${actionType}${step !== "null" && step !== null && actionType !== "edit" ? ".step" : ""}`);
}
case "customField": {
return getTrad(`modalForm.sub-header.attribute.${actionType}`);
}
case "addComponentToDynamicZone":
return getTrad("modalForm.sub-header.addComponentToDynamicZone");
default:
return getTrad("configurations");
}
};
var FormModalSubHeader = ({ actionType, modalType, forTarget, kind, step, attributeType, attributeName, customField }) => {
const { formatMessage } = useIntl();
const intlLabel = modalType === "customField" ? customField == null ? void 0 : customField.intlLabel : {
id: getTrad(`attribute.${attributeType}`)
};
return (0, import_jsx_runtime17.jsxs)(Flex, {
direction: "column",
alignItems: "flex-start",
paddingBottom: 1,
gap: 1,
children: [
(0, import_jsx_runtime17.jsx)(Typography, {
tag: "h2",
variant: "beta",
children: formatMessage({
id: getModalTitleSubHeader({
actionType,
forTarget,
kind,
step,
modalType
}),
defaultMessage: "Add new field"
}, {
type: intlLabel ? (0, import_upperFirst4.default)(formatMessage(intlLabel)) : "",
name: (0, import_upperFirst4.default)(attributeName),
step
})
}),
(0, import_jsx_runtime17.jsx)(Typography, {
variant: "pi",
textColor: "neutral600",
children: formatMessage({
id: getTrad(`attribute.${attributeType}.description`),
defaultMessage: "A type for modeling data"
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/IconPicker/IconPicker.mjs
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
var import_react6 = __toESM(require_react(), 1);
var IconPickerWrapper = dt(Flex)`
label {
${inputFocusStyle()}
border-radius: ${({ theme }) => theme.borderRadius};
border: 1px solid ${({ theme }) => theme.colors.neutral100};
}
`;
var IconPick = ({ iconKey, name, onChange, isSelected, ariaLabel }) => {
const Icon = COMPONENT_ICONS[iconKey];
return (0, import_jsx_runtime18.jsx)(Field.Root, {
name,
required: false,
children: (0, import_jsx_runtime18.jsxs)(Field.Label, {
children: [
(0, import_jsx_runtime18.jsxs)(VisuallyHidden, {
children: [
ariaLabel,
(0, import_jsx_runtime18.jsx)(Field.Input, {
type: "radio",
checked: isSelected,
onChange,
value: iconKey,
"aria-checked": isSelected
})
]
}),
(0, import_jsx_runtime18.jsx)(TooltipImpl, {
label: iconKey,
children: (0, import_jsx_runtime18.jsx)(Flex, {
padding: 2,
cursor: "pointer",
hasRadius: true,
background: isSelected ? "primary200" : void 0,
children: (0, import_jsx_runtime18.jsx)(Icon, {
width: "2rem",
height: "2rem",
fill: isSelected ? "primary600" : "neutral300"
})
})
})
]
})
});
};
var IconPicker = ({ intlLabel, name, onChange, value = "" }) => {
const { formatMessage } = useIntl();
const [showSearch, setShowSearch] = (0, import_react6.useState)(false);
const [search, setSearch] = (0, import_react6.useState)("");
const allIcons = Object.keys(COMPONENT_ICONS);
const [icons, setIcons] = (0, import_react6.useState)(allIcons);
const searchIconRef = (0, import_react6.useRef)(null);
const searchBarRef = (0, import_react6.useRef)(null);
const toggleSearch = () => {
setShowSearch(!showSearch);
};
const onChangeSearch = ({ target: { value: value2 } }) => {
setSearch(value2);
setIcons(() => allIcons.filter((icon) => icon.toLowerCase().includes(value2.toLowerCase())));
};
const onClearSearch = () => {
toggleSearch();
setSearch("");
setIcons(allIcons);
};
const removeIconSelected = () => {
onChange({
target: {
name,
value: ""
}
});
};
(0, import_react6.useEffect)(() => {
var _a;
if (showSearch) {
(_a = searchBarRef.current) == null ? void 0 : _a.focus();
}
}, [
showSearch
]);
return (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, {
children: [
(0, import_jsx_runtime18.jsxs)(Flex, {
justifyContent: "space-between",
paddingBottom: 2,
children: [
(0, import_jsx_runtime18.jsx)(Typography, {
variant: "pi",
fontWeight: "bold",
textColor: "neutral800",
tag: "label",
children: formatMessage(intlLabel)
}),
(0, import_jsx_runtime18.jsxs)(Flex, {
gap: 1,
children: [
showSearch ? (0, import_jsx_runtime18.jsx)(Searchbar, {
ref: searchBarRef,
name: "searchbar",
placeholder: formatMessage({
id: getTrad("ComponentIconPicker.search.placeholder"),
defaultMessage: "Search for an icon"
}),
onBlur: () => {
if (!search) {
toggleSearch();
}
},
onChange: onChangeSearch,
value: search,
onClear: onClearSearch,
clearLabel: formatMessage({
id: getTrad("IconPicker.search.clear.label"),
defaultMessage: "Clear the icon search"
}),
children: formatMessage({
id: getTrad("IconPicker.search.placeholder.label"),
defaultMessage: "Search for an icon"
})
}) : (0, import_jsx_runtime18.jsx)(IconButton, {
ref: searchIconRef,
onClick: toggleSearch,
withTooltip: false,
label: formatMessage({
id: getTrad("IconPicker.search.button.label"),
defaultMessage: "Search icon button"
}),
variant: "ghost",
children: (0, import_jsx_runtime18.jsx)(ForwardRef$X, {})
}),
value && (0, import_jsx_runtime18.jsx)(TooltipImpl, {
label: formatMessage({
id: getTrad("IconPicker.remove.tooltip"),
defaultMessage: "Remove the selected icon"
}),
children: (0, import_jsx_runtime18.jsx)(IconButton, {
onClick: removeIconSelected,
withTooltip: false,
label: formatMessage({
id: getTrad("IconPicker.remove.button"),
defaultMessage: "Remove the selected icon"
}),
variant: "ghost",
children: (0, import_jsx_runtime18.jsx)(ForwardRef$j, {})
})
})
]
})
]
}),
(0, import_jsx_runtime18.jsx)(IconPickerWrapper, {
position: "relative",
padding: 1,
background: "neutral100",
hasRadius: true,
wrap: "wrap",
gap: 2,
maxHeight: "126px",
overflow: "auto",
textAlign: "center",
children: icons.length > 0 ? icons.map((iconKey) => (0, import_jsx_runtime18.jsx)(IconPick, {
iconKey,
name,
onChange,
isSelected: iconKey === value,
ariaLabel: formatMessage({
id: getTrad("IconPicker.icon.label"),
defaultMessage: "Select {icon} icon"
}, {
icon: iconKey
})
}, iconKey)) : (0, import_jsx_runtime18.jsx)(Box, {
padding: 4,
grow: 2,
children: (0, import_jsx_runtime18.jsx)(Typography, {
variant: "delta",
textColor: "neutral600",
textAlign: "center",
children: formatMessage({
id: getTrad("IconPicker.emptyState.label"),
defaultMessage: "No icon found"
})
})
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/PluralName.mjs
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
var import_react7 = __toESM(require_react(), 1);
var import_pluralize = __toESM(require_pluralize(), 1);
var PluralName = ({ description, error, intlLabel, modifiedData, name, onChange, value }) => {
const { formatMessage } = useIntl();
const onChangeRef = (0, import_react7.useRef)(onChange);
const displayName = (modifiedData == null ? void 0 : modifiedData.displayName) || "";
(0, import_react7.useEffect)(() => {
if (displayName) {
const value2 = nameToSlug(displayName);
try {
const plural = (0, import_pluralize.default)(value2, 2);
onChangeRef.current({
target: {
name,
value: plural
}
});
} catch (err) {
onChangeRef.current({
target: {
name,
value: value2
}
});
}
} else {
onChangeRef.current({
target: {
name,
value: ""
}
});
}
}, [
displayName,
name
]);
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const hint = description ? formatMessage({
id: description.id,
defaultMessage: description.defaultMessage
}, {
...description.values
}) : "";
const label = formatMessage(intlLabel);
return (0, import_jsx_runtime19.jsxs)(Field.Root, {
error: errorMessage,
hint,
name,
children: [
(0, import_jsx_runtime19.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime19.jsx)(TextInput, {
onChange,
value: value || ""
}),
(0, import_jsx_runtime19.jsx)(Field.Error, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/Relation.mjs
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationField/RelationField.mjs
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/GenericInputs.mjs
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var React = __toESM(require_react(), 1);
var import_isEqual2 = __toESM(require_isEqual(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/utils/parseDateValue.mjs
var parseDateValue = (value) => {
if (value instanceof Date && isValidDate(value)) {
return value;
}
if (typeof value === "string" || typeof value === "number") {
const date = new Date(value);
if (isValidDate(date)) {
return date;
}
}
};
var isValidDate = (date) => !isNaN(date.getTime());
// node_modules/@strapi/content-type-builder/dist/admin/utils/timeFormat.mjs
var removeSeconds = (time) => {
const [hours, minutes] = time.split(":");
return `${hours}:${minutes}`;
};
var addSecondsAndMilliseconds = (time) => {
return time.split(":").length === 2 ? `${time}:00.000` : time;
};
var formatTimeForInput = (value) => {
if (!value) return;
return value.split(":").length > 2 ? removeSeconds(value) : value;
};
var formatTimeForOutput = (value) => {
if (!value) return void 0;
return addSecondsAndMilliseconds(value);
};
var handleTimeChange = ({ value }) => {
const formattedInputTime = formatTimeForInput(value);
return formattedInputTime;
};
var handleTimeChangeEvent = (onChange, name, type, time) => {
const formattedOutputTime = formatTimeForOutput(time);
onChange({
target: {
name,
value: formattedOutputTime,
type
}
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/GenericInputs.mjs
var GenericInput = ({ autoComplete, customInputs, description, disabled, intlLabel, labelAction, error, name, onChange, options: options2 = [], placeholder, required, step, type, value: defaultValue, isNullable, attribute, ...rest }) => {
const { formatMessage } = useIntl();
const getFieldHintValue = (attribute2, key) => {
if (!attribute2) return;
if (key === "minLength" && key in attribute2) {
return attribute2[key];
}
if (key === "maxLength" && key in attribute2) {
return attribute2[key];
}
if (key === "max" && key in attribute2) {
return attribute2[key];
}
if (key === "min" && key in attribute2) {
return attribute2[key];
}
};
const { hint } = useFieldHint({
description,
fieldSchema: {
minLength: getFieldHintValue(attribute, "minLength"),
maxLength: getFieldHintValue(attribute, "maxLength"),
max: getFieldHintValue(attribute, "max"),
min: getFieldHintValue(attribute, "min")
},
type: (attribute == null ? void 0 : attribute.type) || type
});
const [showPassword, setShowPassword] = React.useState(false);
const CustomInput = customInputs ? customInputs[type] : null;
const value = defaultValue ?? void 0;
const valueWithEmptyStringFallback = value ?? "";
function getErrorMessage(error2) {
if (!error2) {
return null;
}
if (typeof error2 === "string") {
return formatMessage({
id: error2,
defaultMessage: error2
});
}
const values = {
...error2.values
};
return formatMessage({
id: error2.id,
defaultMessage: (error2 == null ? void 0 : error2.defaultMessage) ?? error2.id
}, values);
}
const errorMessage = getErrorMessage(error) ?? void 0;
if (CustomInput) {
return (0, import_jsx_runtime20.jsx)(CustomInput, {
...rest,
attribute,
description,
hint,
disabled,
intlLabel,
labelAction,
error: errorMessage || "",
name,
onChange,
options: options2,
required,
placeholder,
type,
value
});
}
const label = intlLabel.id ? formatMessage({
id: intlLabel.id,
defaultMessage: intlLabel.defaultMessage
}, {
...intlLabel.values
}) : name;
const formattedPlaceholder = placeholder ? formatMessage({
id: placeholder.id,
defaultMessage: placeholder.defaultMessage
}, {
...placeholder.values
}) : "";
const getComponent = () => {
switch (type) {
case "json": {
return (0, import_jsx_runtime20.jsx)(JSONInput, {
value,
disabled,
onChange: (json) => {
const value2 = attribute && "required" in attribute && !(attribute == null ? void 0 : attribute.required) && !json.length ? null : json;
onChange({
target: {
name,
value: value2
}
}, false);
},
minHeight: "25.2rem",
maxHeight: "50.4rem"
});
}
case "bool": {
return (0, import_jsx_runtime20.jsx)(Toggle, {
checked: defaultValue === null ? null : defaultValue || false,
disabled,
offLabel: formatMessage({
id: "app.components.ToggleCheckbox.off-label",
defaultMessage: "False"
}),
onLabel: formatMessage({
id: "app.components.ToggleCheckbox.on-label",
defaultMessage: "True"
}),
onChange: (e) => {
onChange({
target: {
name,
value: e.target.checked
}
});
}
});
}
case "checkbox": {
return (0, import_jsx_runtime20.jsx)(CheckboxImpl, {
disabled,
onCheckedChange: (value2) => {
onChange({
target: {
name,
value: value2
}
});
},
checked: Boolean(value),
children: label
});
}
case "datetime": {
const dateValue = parseDateValue(value);
return (0, import_jsx_runtime20.jsx)(DateTimePicker, {
clearLabel: formatMessage({
id: "clearLabel",
defaultMessage: "Clear"
}),
disabled,
onChange: (date) => {
const formattedDate = date ? date.toISOString() : null;
onChange({
target: {
name,
value: formattedDate,
type
}
});
},
onClear: () => onChange({
target: {
name,
value: null,
type
}
}),
placeholder: formattedPlaceholder,
value: dateValue
});
}
case "date": {
const dateValue = parseDateValue(value);
return (0, import_jsx_runtime20.jsx)(DatePicker$1, {
clearLabel: formatMessage({
id: "clearLabel",
defaultMessage: "Clear"
}),
disabled,
onChange: (date) => {
onChange({
target: {
name,
value: date ? formatISO(date, {
representation: "date"
}) : null,
type
}
});
},
onClear: () => onChange({
target: {
name,
value: null,
type
}
}),
placeholder: formattedPlaceholder,
value: dateValue
});
}
case "number": {
return (0, import_jsx_runtime20.jsx)(NumberInput, {
disabled,
onValueChange: (value2) => {
onChange({
target: {
name,
value: value2,
type
}
});
},
placeholder: formattedPlaceholder,
step,
value
});
}
case "email": {
return (0, import_jsx_runtime20.jsx)(TextInput, {
autoComplete,
disabled,
onChange: (e) => {
onChange({
target: {
name,
value: e.target.value,
type
}
});
},
placeholder: formattedPlaceholder,
type: "email",
value: valueWithEmptyStringFallback
});
}
case "timestamp":
case "text":
case "string": {
return (0, import_jsx_runtime20.jsx)(TextInput, {
autoComplete,
disabled,
onChange: (e) => {
onChange({
target: {
name,
value: e.target.value,
type
}
});
},
placeholder: formattedPlaceholder,
type: "text",
value: valueWithEmptyStringFallback
});
}
case "password": {
return (0, import_jsx_runtime20.jsx)(TextInput, {
autoComplete,
disabled,
endAction: (0, import_jsx_runtime20.jsx)("button", {
"aria-label": formatMessage({
id: "Auth.form.password.show-password",
defaultMessage: "Show password"
}),
onClick: () => {
setShowPassword((prev) => !prev);
},
style: {
border: "none",
padding: 0,
background: "transparent"
},
type: "button",
children: showPassword ? (0, import_jsx_runtime20.jsx)(ForwardRef$3D, {
fill: "neutral500"
}) : (0, import_jsx_runtime20.jsx)(ForwardRef$3B, {
fill: "neutral500"
})
}),
onChange: (e) => {
onChange({
target: {
name,
value: e.target.value,
type
}
});
},
placeholder: formattedPlaceholder,
type: showPassword ? "text" : "password",
value: valueWithEmptyStringFallback
});
}
case "select": {
return (0, import_jsx_runtime20.jsx)(SingleSelect, {
disabled,
onChange: (value2) => {
onChange({
target: {
name,
value: value2,
type: "select"
}
});
},
placeholder: formattedPlaceholder,
value,
children: options2.map(({ metadatas: { intlLabel: intlLabel2, disabled: disabled2, hidden }, key, value: value2 }) => {
return (0, import_jsx_runtime20.jsx)(SingleSelectOption, {
value: value2,
disabled: disabled2,
hidden,
children: formatMessage(intlLabel2)
}, key);
})
});
}
case "textarea": {
return (0, import_jsx_runtime20.jsx)(Textarea, {
disabled,
onChange: (event) => onChange({
target: {
name,
value: event.target.value,
type
}
}),
placeholder: formattedPlaceholder,
value: valueWithEmptyStringFallback
});
}
case "time": {
const formattedValue = handleTimeChange({
value,
onChange,
name,
type
});
return (0, import_jsx_runtime20.jsx)(TimePicker$1, {
clearLabel: formatMessage({
id: "clearLabel",
defaultMessage: "Clear"
}),
disabled,
onChange: (time) => handleTimeChangeEvent(onChange, name, type, time),
onClear: () => handleTimeChangeEvent(onChange, name, type, void 0),
value: formattedValue
});
}
default: {
return (0, import_jsx_runtime20.jsx)(TextInput, {
disabled: true,
placeholder: "Not supported",
type: "text",
value: ""
});
}
}
};
return (0, import_jsx_runtime20.jsxs)(Field.Root, {
error: errorMessage,
name,
hint,
required,
children: [
type !== "checkbox" ? (0, import_jsx_runtime20.jsx)(Field.Label, {
action: labelAction,
children: label
}) : null,
getComponent(),
(0, import_jsx_runtime20.jsx)(Field.Error, {}),
(0, import_jsx_runtime20.jsx)(Field.Hint, {})
]
});
};
var useFieldHint = ({ description, fieldSchema, type }) => {
const { formatMessage } = useIntl();
const buildDescription = () => (description == null ? void 0 : description.id) ? formatMessage({
id: description.id,
defaultMessage: description.defaultMessage
}, {
...description.values
}) : "";
const buildHint = () => {
const { maximum, minimum } = getMinMax(fieldSchema);
const units = getFieldUnits({
type,
minimum,
maximum
});
const minIsNumber = typeof minimum === "number";
const maxIsNumber = typeof maximum === "number";
const hasMinAndMax = maxIsNumber && minIsNumber;
const hasMinOrMax = maxIsNumber || minIsNumber;
if (!(description == null ? void 0 : description.id) && !hasMinOrMax) {
return "";
}
return formatMessage({
id: "content-manager.form.Input.hint.text",
defaultMessage: "{min, select, undefined {} other {min. {min}}}{divider}{max, select, undefined {} other {max. {max}}}{unit}{br}{description}"
}, {
min: minimum,
max: maximum,
description: buildDescription(),
unit: (units == null ? void 0 : units.message) && hasMinOrMax ? formatMessage(units.message, units.values) : null,
divider: hasMinAndMax ? formatMessage({
id: "content-manager.form.Input.hint.minMaxDivider",
defaultMessage: " / "
}) : null,
br: hasMinOrMax ? (0, import_jsx_runtime20.jsx)("br", {}) : null
});
};
return {
hint: buildHint()
};
};
var getFieldUnits = ({ type, minimum, maximum }) => {
if (type && [
"biginteger",
"integer",
"number"
].includes(type)) {
return {};
}
const maxValue = Math.max(minimum || 0, maximum || 0);
return {
message: {
id: "content-manager.form.Input.hint.character.unit",
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
},
values: {
maxValue
}
};
};
var getMinMax = (fieldSchema) => {
if (!fieldSchema) {
return {
maximum: void 0,
minimum: void 0
};
}
const { minLength, maxLength, max, min } = fieldSchema;
let minimum;
let maximum;
const parsedMin = Number(min);
const parsedMinLength = Number(minLength);
if (!Number.isNaN(parsedMin)) {
minimum = parsedMin;
} else if (!Number.isNaN(parsedMinLength)) {
minimum = parsedMinLength;
}
const parsedMax = Number(max);
const parsedMaxLength = Number(maxLength);
if (!Number.isNaN(parsedMax)) {
maximum = parsedMax;
} else if (!Number.isNaN(parsedMaxLength)) {
maximum = parsedMaxLength;
}
return {
maximum,
minimum
};
};
var MemoizedGenericInput = React.memo(GenericInput, import_isEqual2.default);
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationField/RelationTargetPicker/RelationTargetPicker.mjs
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var RelationTargetPicker = ({ oneThatIsCreatingARelationWithAnother, target }) => {
const { contentTypes, sortedContentTypesList } = useDataManager();
const dispatch = useDispatch();
const allowedContentTypesForRelation = sortedContentTypesList.filter(isAllowedContentTypesForRelations);
const { plugin = null, schema: { displayName } = {
displayName: "error"
} } = (contentTypes == null ? void 0 : contentTypes[target]) ?? {};
const handleSelect = ({ uid, plugin: plugin2, title, restrictRelationsTo }) => () => {
const selectedContentTypeFriendlyName = plugin2 ? `${plugin2}_${title}` : title;
dispatch(actions2.onChangeRelationTarget({
target: {
value: uid,
oneThatIsCreatingARelationWithAnother,
selectedContentTypeFriendlyName,
targetContentTypeAllowedRelations: restrictRelationsTo
}
}));
};
return (0, import_jsx_runtime21.jsxs)(Menu.Root, {
children: [
(0, import_jsx_runtime21.jsx)(MenuTrigger, {
children: `${displayName} ${plugin ? `(from: ${plugin})` : ""}`
}),
(0, import_jsx_runtime21.jsx)(Menu.Content, {
zIndex: "popover",
children: allowedContentTypesForRelation.map(({ uid, title, restrictRelationsTo, plugin: plugin2 }) => (0, import_jsx_runtime21.jsxs)(Menu.Item, {
onSelect: handleSelect({
uid,
plugin: plugin2,
title,
restrictRelationsTo
}),
children: [
title,
" ",
plugin2 && (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, {
children: [
"(from: ",
plugin2,
")"
]
})
]
}, uid))
})
]
});
};
var MenuTrigger = dt(Menu.Trigger)`
max-width: 16.8rem;
span {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
`;
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationField/RelationField.mjs
var RelationFormBox = ({ disabled = false, error, header, isMain = false, name, onChange, oneThatIsCreatingARelationWithAnother = "", target = "", value = "" }) => {
return (0, import_jsx_runtime22.jsxs)(Box, {
background: "neutral100",
hasRadius: true,
borderColor: "neutral200",
children: [
(0, import_jsx_runtime22.jsx)(Flex, {
paddingTop: isMain ? 4 : 1,
paddingBottom: isMain ? 3 : 1,
justifyContent: "center",
children: isMain ? (0, import_jsx_runtime22.jsx)(Typography, {
variant: "pi",
fontWeight: "bold",
textColor: "neutral800",
children: header
}) : (0, import_jsx_runtime22.jsx)(RelationTargetPicker, {
target,
oneThatIsCreatingARelationWithAnother
})
}),
(0, import_jsx_runtime22.jsx)(Divider, {
background: "neutral200"
}),
(0, import_jsx_runtime22.jsx)(Box, {
padding: 4,
children: (0, import_jsx_runtime22.jsx)(MemoizedGenericInput, {
disabled,
error: (error == null ? void 0 : error.id) || null,
intlLabel: {
id: getTrad("form.attribute.item.defineRelation.fieldName"),
defaultMessage: "Field name"
},
name,
onChange,
type: "text",
value
})
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.mjs
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var import_get = __toESM(require_get(), 1);
var import_truncate = __toESM(require_truncate(), 1);
var import_pluralize2 = __toESM(require_pluralize(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationNaturePicker/Components.mjs
var Wrapper2 = dt(Box)`
position: relative;
width: 100%;
&::before {
content: '';
position: absolute;
top: calc(50% - 0px);
height: 2px;
width: 100%;
background-color: ${({ theme }) => theme.colors.primary600};
z-index: 0;
}
`;
var IconWrapper = dt(Box)`
background: ${({ theme, $isSelected }) => theme.colors[$isSelected ? "primary100" : "neutral0"]};
border: 1px solid
${({ theme, $isSelected }) => theme.colors[$isSelected ? "primary700" : "neutral200"]};
border-radius: ${({ theme }) => theme.borderRadius};
z-index: 1;
flex: 0 0 2.4rem;
svg {
width: 2.4rem;
height: 2.4rem;
max-width: unset;
path {
fill: ${({ theme, $isSelected }) => theme.colors[$isSelected ? "primary700" : "neutral500"]};
}
}
cursor: pointer;
&:disabled {
cursor: not-allowed;
}
display: flex;
justify-content: center;
align-items: center;
`;
var InfosWrapper = dt(Flex)`
position: absolute;
bottom: 0;
left: 0;
right: 0;
`;
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/RelationNaturePicker/RelationNaturePicker.mjs
var relations = {
oneWay: ForwardRef$1J,
oneToOne: ForwardRef$1L,
oneToMany: ForwardRef$1N,
manyToOne: ForwardRef$29,
manyToMany: ForwardRef$2b,
manyWay: ForwardRef$27
};
var RelationNaturePicker = ({ naturePickerType, oneThatIsCreatingARelationWithAnother, relationType, target }) => {
const dispatch = useDispatch();
const { formatMessage } = useIntl();
const { contentTypes, modifiedData } = useDataManager();
const ctRelations = [
"oneWay",
"oneToOne",
"oneToMany",
"manyToOne",
"manyToMany",
"manyWay"
];
const componentRelations = [
"oneWay",
"manyWay"
];
const dataType = naturePickerType === "contentType" ? (0, import_get.default)(modifiedData, [
naturePickerType,
"schema",
"kind"
], "") : naturePickerType;
const relationsType = dataType === "collectionType" ? ctRelations : componentRelations;
const areDisplayedNamesInverted = relationType === "manyToOne";
const targetLabel = (0, import_get.default)(contentTypes, [
target,
"schema",
"displayName"
], "unknown");
const leftTarget = areDisplayedNamesInverted ? targetLabel : oneThatIsCreatingARelationWithAnother;
const rightTarget = areDisplayedNamesInverted ? oneThatIsCreatingARelationWithAnother : targetLabel;
const leftDisplayedValue = (0, import_pluralize2.default)(leftTarget, relationType === "manyToMany" ? 2 : 1);
const restrictedRelations = (0, import_get.default)(contentTypes, [
target,
"schema",
"restrictRelationsTo"
], null);
const rightDisplayedValue = (0, import_pluralize2.default)(rightTarget, [
"manyToMany",
"oneToMany",
"manyToOne",
"manyWay"
].includes(relationType) ? 2 : 1);
if (!relationType) {
return null;
}
return (0, import_jsx_runtime23.jsxs)(Flex, {
style: {
flex: 1
},
children: [
(0, import_jsx_runtime23.jsx)(Wrapper2, {
children: (0, import_jsx_runtime23.jsx)(Flex, {
paddingLeft: 9,
paddingRight: 9,
paddingTop: 1,
justifyContent: "center",
children: (0, import_jsx_runtime23.jsx)(KeyboardNavigable, {
tagName: "button",
children: (0, import_jsx_runtime23.jsx)(Flex, {
gap: 3,
children: relationsType.map((relation) => {
const Asset = relations[relation];
const isEnabled = restrictedRelations === null || restrictedRelations.includes(relation);
return (0, import_jsx_runtime23.jsx)(IconWrapper, {
tag: "button",
$isSelected: relationType === relation,
disabled: !isEnabled,
onClick: () => {
if (isEnabled) {
dispatch(actions2.onChangeRelationType({
target: {
oneThatIsCreatingARelationWithAnother,
value: relation
}
}));
}
},
padding: 2,
type: "button",
"aria-label": formatMessage({
id: getTrad(`relation.${relation}`)
}),
"aria-pressed": relationType === relation,
"data-relation-type": relation,
children: (0, import_jsx_runtime23.jsx)(Asset, {
"aria-hidden": "true"
}, relation)
}, relation);
})
})
})
})
}),
(0, import_jsx_runtime23.jsxs)(InfosWrapper, {
justifyContent: "center",
children: [
(0, import_jsx_runtime23.jsxs)(Typography, {
children: [
(0, import_truncate.default)(leftDisplayedValue, {
length: 24
}),
" "
]
}),
(0, import_jsx_runtime23.jsxs)(Typography, {
textColor: "primary600",
children: [
formatMessage({
id: getTrad(`relation.${relationType}`)
}),
" "
]
}),
(0, import_jsx_runtime23.jsx)(Typography, {
children: (0, import_truncate.default)(rightDisplayedValue, {
length: 24
})
})
]
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/Relation/Relation.mjs
var Relation = ({ formErrors, mainBoxHeader, modifiedData, naturePickerType, onChange }) => {
const relationType = getRelationType(modifiedData.relation, modifiedData.targetAttribute);
return (0, import_jsx_runtime24.jsxs)(Flex, {
style: {
position: "relative"
},
children: [
(0, import_jsx_runtime24.jsx)(RelationFormBox, {
isMain: true,
header: mainBoxHeader,
error: (formErrors == null ? void 0 : formErrors.name) || null,
name: "name",
onChange,
value: (modifiedData == null ? void 0 : modifiedData.name) || ""
}),
(0, import_jsx_runtime24.jsx)(RelationNaturePicker, {
naturePickerType,
oneThatIsCreatingARelationWithAnother: mainBoxHeader,
relationType,
target: modifiedData.target
}),
(0, import_jsx_runtime24.jsx)(RelationFormBox, {
disabled: [
"oneWay",
"manyWay"
].includes(relationType),
error: (formErrors == null ? void 0 : formErrors.targetAttribute) || null,
name: "targetAttribute",
onChange,
oneThatIsCreatingARelationWithAnother: mainBoxHeader,
target: modifiedData.target,
value: (modifiedData == null ? void 0 : modifiedData.targetAttribute) || ""
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectCategory.mjs
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
var import_react8 = __toESM(require_react(), 1);
var SelectCategory = ({ error = null, intlLabel, name, onChange, value = void 0, isCreating, dynamicZoneTarget }) => {
const { formatMessage } = useIntl();
const { allComponentsCategories } = useDataManager();
const [categories, setCategories] = (0, import_react8.useState)(allComponentsCategories);
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const label = formatMessage(intlLabel);
const handleChange = (value2) => {
onChange({
target: {
name,
value: value2,
type: "select-category"
}
});
};
const handleCreateOption = (value2) => {
setCategories((prev) => [
...prev,
value2
]);
handleChange(value2);
};
return (0, import_jsx_runtime25.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime25.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime25.jsx)(Combobox, {
// TODO: re-enable category edits, renaming categories of already existing components currently breaks other functionality
// See https://github.com/strapi/strapi/issues/20356
disabled: !isCreating && !dynamicZoneTarget,
onChange: handleChange,
onCreateOption: handleCreateOption,
value,
creatable: true,
children: categories.map((category) => (0, import_jsx_runtime25.jsx)(Option, {
value: category,
children: category
}, category))
}),
(0, import_jsx_runtime25.jsx)(Field.Error, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectComponent.mjs
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/utils/getMaxDepth.mjs
var findComponent = (componentUid, components) => {
return components.find((c) => c.component === componentUid);
};
var getChildrenMaxDepth = (componentUid, components, currentDepth = 0) => {
const component = findComponent(componentUid, components);
if (!component || !component.childComponents || component.childComponents.length === 0) {
return currentDepth;
}
let maxDepth = currentDepth;
component.childComponents.forEach((child) => {
const depth = getChildrenMaxDepth(child.component, components, currentDepth + 1);
if (depth > maxDepth) {
maxDepth = depth;
}
});
return maxDepth;
};
var getComponentDepth = (component, components) => {
const getDepth = (currentComponent, currentLevel) => {
const levels = [];
levels.push(currentLevel);
if (!currentComponent.uidsOfAllParents) {
return levels;
}
for (const parentUid of currentComponent.uidsOfAllParents) {
const parentComponent = findComponent(parentUid, components);
if (parentComponent) {
levels.push(...getDepth(parentComponent, currentLevel + 1));
}
}
return levels;
};
const nestedCompo = findComponent(component, components);
if (!nestedCompo) {
return 0;
}
const compoDepth = Math.max(...getDepth(nestedCompo, 1));
return compoDepth;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectComponent.mjs
var SelectComponent = ({ error = null, intlLabel, isAddingAComponentToAnotherComponent, isCreating, isCreatingComponentWhileAddingAField, componentToCreate, name, onChange, targetUid, forTarget, value }) => {
const { formatMessage } = useIntl();
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const label = formatMessage(intlLabel);
const { componentsGroupedByCategory, componentsThatHaveOtherComponentInTheirAttributes, nestedComponents } = useDataManager();
const isTargetAComponent = [
"component",
"components"
].includes(forTarget);
let options2 = Object.entries(componentsGroupedByCategory).reduce((acc, current) => {
const [categoryName, components] = current;
const compos = components.map((component) => {
return {
uid: component.uid,
label: component.schema.displayName,
categoryName
};
});
return [
...acc,
...compos
];
}, []);
if (isAddingAComponentToAnotherComponent) {
options2 = options2.filter(({ uid }) => {
const maxDepth = getChildrenMaxDepth(uid, componentsThatHaveOtherComponentInTheirAttributes);
const componentDepth = getComponentDepth(targetUid, nestedComponents);
const totalDepth = maxDepth + componentDepth;
return totalDepth <= MAX_COMPONENT_DEPTH;
});
}
if (isTargetAComponent) {
options2 = options2.filter((option) => {
return option.uid !== targetUid;
});
}
if (isCreatingComponentWhileAddingAField) {
options2 = [
{
uid: value,
label: componentToCreate == null ? void 0 : componentToCreate.displayName,
categoryName: componentToCreate == null ? void 0 : componentToCreate.category
}
];
}
return (0, import_jsx_runtime26.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime26.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime26.jsx)(SingleSelect, {
disabled: isCreatingComponentWhileAddingAField || !isCreating,
onChange: (value2) => {
onChange({
target: {
name,
value: value2,
type: "select-category"
}
});
},
value: value || "",
children: options2.map((option) => {
return (0, import_jsx_runtime26.jsx)(SingleSelectOption, {
value: option.uid,
children: `${option.categoryName} - ${option.label}`
}, option.uid);
})
}),
(0, import_jsx_runtime26.jsx)(Field.Error, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectComponents.mjs
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
var SelectComponents = ({ dynamicZoneTarget, intlLabel, name, onChange, value }) => {
const { formatMessage } = useIntl();
const { componentsGroupedByCategory, modifiedData } = useDataManager();
const dzSchema = findAttribute(modifiedData.contentType.schema.attributes, dynamicZoneTarget);
const alreadyUsedComponents = (dzSchema == null ? void 0 : dzSchema.components) || [];
const filteredComponentsGroupedByCategory = Object.keys(componentsGroupedByCategory).reduce((acc, current) => {
const filteredComponents = componentsGroupedByCategory[current].filter(({ uid }) => {
return !alreadyUsedComponents.includes(uid);
});
if (filteredComponents.length > 0) {
acc[current] = filteredComponents;
}
return acc;
}, {});
const options2 = Object.entries(filteredComponentsGroupedByCategory).reduce((acc, current) => {
const [categoryName, components] = current;
const section = {
label: categoryName,
children: components.map(({ uid, schema: { displayName } }) => {
return {
label: displayName,
value: uid
};
})
};
acc.push(section);
return acc;
}, []);
const displayedValue = formatMessage({
id: getTrad("components.SelectComponents.displayed-value"),
defaultMessage: "{number, plural, =0 {# components} one {# component} other {# components}} selected"
}, {
number: (value == null ? void 0 : value.length) ?? 0
});
return (0, import_jsx_runtime27.jsxs)(Field.Root, {
name,
children: [
(0, import_jsx_runtime27.jsx)(Field.Label, {
children: formatMessage(intlLabel)
}),
(0, import_jsx_runtime27.jsx)(MultiSelectNested, {
id: "select1",
customizeContent: () => displayedValue,
onChange: (values) => {
onChange({
target: {
name,
value: values,
type: "select-components"
}
});
},
options: options2,
value: value || []
})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectDateType.mjs
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var SelectDateType = ({ intlLabel, error = void 0, modifiedData, name, onChange, options: options2, value = "" }) => {
const { formatMessage } = useIntl();
const label = formatMessage(intlLabel);
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const handleChange = (nextValue) => {
onChange({
target: {
name,
value: nextValue,
type: "select"
}
});
if (!value) {
return;
}
if (modifiedData.default !== void 0 && modifiedData.default !== null) {
onChange({
target: {
name: "default",
value: null
}
});
}
};
return (0, import_jsx_runtime28.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime28.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime28.jsx)(SingleSelect, {
onChange: handleChange,
value: value || "",
children: options2.map(({ metadatas: { intlLabel: intlLabel2, disabled, hidden }, key, value: value2 }) => {
return (0, import_jsx_runtime28.jsx)(SingleSelectOption, {
value: value2,
disabled,
hidden,
children: formatMessage({
id: intlLabel2.id,
defaultMessage: intlLabel2.defaultMessage
}, intlLabel2.values)
}, key);
})
}),
(0, import_jsx_runtime28.jsx)(Field.Error, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SelectNumber.mjs
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var SelectNumber = ({ intlLabel, error = void 0, modifiedData, name, onChange, options: options2, value = "" }) => {
const { formatMessage } = useIntl();
const label = formatMessage(intlLabel);
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const handleChange = (nextValue) => {
onChange({
target: {
name,
value: nextValue,
type: "select"
}
});
if (!value) {
return;
}
if (nextValue === "biginteger" && value !== "biginteger") {
if (modifiedData.default !== void 0 && modifiedData.default !== null) {
onChange({
target: {
name: "default",
value: null
}
});
}
if (modifiedData.max !== void 0 && modifiedData.max !== null) {
onChange({
target: {
name: "max",
value: null
}
});
}
if (modifiedData.min !== void 0 && modifiedData.min !== null) {
onChange({
target: {
name: "min",
value: null
}
});
}
}
if (typeof nextValue === "string" && [
"decimal",
"float",
"integer"
].includes(nextValue) && value === "biginteger") {
if (modifiedData.default !== void 0 && modifiedData.default !== null) {
onChange({
target: {
name: "default",
value: null
}
});
}
if (modifiedData.max !== void 0 && modifiedData.max !== null) {
onChange({
target: {
name: "max",
value: null
}
});
}
if (modifiedData.min !== void 0 && modifiedData.min !== null) {
onChange({
target: {
name: "min",
value: null
}
});
}
}
};
return (0, import_jsx_runtime29.jsxs)(Field.Root, {
error: errorMessage,
name,
children: [
(0, import_jsx_runtime29.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime29.jsx)(SingleSelect, {
onChange: handleChange,
value: value || "",
children: options2.map(({ metadatas: { intlLabel: intlLabel2, disabled, hidden }, key, value: value2 }) => {
return (0, import_jsx_runtime29.jsx)(SingleSelectOption, {
value: value2,
disabled,
hidden,
children: formatMessage(intlLabel2)
}, key);
})
}),
(0, import_jsx_runtime29.jsx)(Field.Error, {})
]
});
};
SelectNumber.defaultProps = {
error: void 0,
value: ""
};
// node_modules/@strapi/content-type-builder/dist/admin/components/SingularName.mjs
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var import_react9 = __toESM(require_react(), 1);
var SingularName = ({ description = null, error = null, intlLabel, modifiedData, name, onChange, value = null }) => {
const { formatMessage } = useIntl();
const onChangeRef = (0, import_react9.useRef)(onChange);
const displayName = (modifiedData == null ? void 0 : modifiedData.displayName) || "";
(0, import_react9.useEffect)(() => {
if (displayName) {
onChangeRef.current({
target: {
name,
value: nameToSlug(displayName)
}
});
} else {
onChangeRef.current({
target: {
name,
value: ""
}
});
}
}, [
displayName,
name
]);
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const hint = description ? formatMessage({
id: description.id,
defaultMessage: description.defaultMessage
}, {
...description.values
}) : "";
const label = formatMessage(intlLabel);
return (0, import_jsx_runtime30.jsxs)(Field.Root, {
error: errorMessage,
hint,
name,
children: [
(0, import_jsx_runtime30.jsx)(Field.Label, {
children: label
}),
(0, import_jsx_runtime30.jsx)(TextInput, {
onChange,
value: value || ""
}),
(0, import_jsx_runtime30.jsx)(Field.Error, {}),
(0, import_jsx_runtime30.jsx)(Field.Hint, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/TabForm.mjs
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var import_get2 = __toESM(require_get(), 1);
var TabForm = ({ form, formErrors, genericInputProps, modifiedData, onChange }) => {
const { formatMessage } = useIntl();
return (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, {
children: form.map((section, sectionIndex) => {
if (section.items.length === 0) {
return null;
}
return (0, import_jsx_runtime31.jsxs)(Box, {
children: [
section.sectionTitle && (0, import_jsx_runtime31.jsx)(Box, {
paddingBottom: 4,
children: (0, import_jsx_runtime31.jsx)(Typography, {
variant: "delta",
tag: "h3",
children: formatMessage(section.sectionTitle)
})
}),
(0, import_jsx_runtime31.jsx)(Grid.Root, {
gap: 4,
children: section.items.map((input, i) => {
const key = `${sectionIndex}.${i}`;
const value = (0, import_get2.default)(modifiedData, input.name, void 0);
const pluginOptionError = Object.keys(formErrors).find((key2) => key2 === input.name);
const errorId = pluginOptionError ? formErrors[pluginOptionError].id : (0, import_get2.default)(formErrors, [
...input.name.split(".").filter((key2) => key2 !== "componentToCreate"),
"id"
], null);
if (input.type === "pushRight") {
return (0, import_jsx_runtime31.jsx)(Grid.Item, {
col: input.size || 6,
direction: "column",
alignItems: "stretch",
children: (0, import_jsx_runtime31.jsx)("div", {})
}, input.name || key);
}
return (0, import_jsx_runtime31.jsx)(Grid.Item, {
col: input.size || 6,
direction: "column",
alignItems: "stretch",
children: (0, import_jsx_runtime31.jsx)(MemoizedGenericInput, {
...input,
...genericInputProps,
error: errorId,
onChange,
value
})
}, input.name || key);
})
})
]
}, sectionIndex);
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/TextareaEnum.mjs
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var TextareaEnum = ({ description = null, disabled = false, error = "", intlLabel, labelAction, name, onChange, placeholder = null, value = "" }) => {
const { formatMessage } = useIntl();
const errorMessage = error ? formatMessage({
id: error,
defaultMessage: error
}) : "";
const hint = description ? formatMessage({
id: description.id,
defaultMessage: description.defaultMessage
}, {
...description.values
}) : "";
const label = formatMessage(intlLabel);
const formattedPlaceholder = placeholder ? formatMessage({
id: placeholder.id,
defaultMessage: placeholder.defaultMessage
}, {
...placeholder.values
}) : "";
const inputValue = Array.isArray(value) ? value.join("\n") : "";
const handleChange = (e) => {
const arrayValue = e.target.value.split("\n");
onChange({
target: {
name,
value: arrayValue
}
});
};
return (0, import_jsx_runtime32.jsxs)(Field.Root, {
error: errorMessage,
hint,
name,
children: [
(0, import_jsx_runtime32.jsx)(Field.Label, {
action: labelAction,
children: label
}),
(0, import_jsx_runtime32.jsx)(Textarea, {
disabled,
onChange: handleChange,
placeholder: formattedPlaceholder,
value: inputValue
}),
(0, import_jsx_runtime32.jsx)(Field.Error, {}),
(0, import_jsx_runtime32.jsx)(Field.Hint, {})
]
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/nameField.mjs
var nameField = {
name: "name",
type: "text",
intlLabel: {
id: "global.name",
defaultMessage: "Name"
},
description: {
id: getTrad("modalForm.attribute.form.base.name.description"),
defaultMessage: "No space is allowed for the name of the attribute"
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/commonBaseForm.mjs
var commonBaseForm = {
sections: [
{
sectionTitle: null,
items: [
nameField
]
}
]
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/component/componentForm.mjs
var componentForm = {
base(prefix = "") {
const sections = [
{
sectionTitle: null,
items: [
{
name: `${prefix}displayName`,
type: "text",
intlLabel: {
id: getTrad("contentType.displayName.label"),
defaultMessage: "Display Name"
}
},
{
name: `${prefix}category`,
type: "select-category",
intlLabel: {
id: getTrad("modalForm.components.create-component.category.label"),
defaultMessage: "Select a category or enter a name to create a new one"
}
}
]
},
{
sectionTitle: null,
items: [
{
name: `${prefix}icon`,
type: "icon-picker",
size: 12,
intlLabel: {
id: getTrad("modalForm.components.icon.label"),
defaultMessage: "Icon"
}
}
]
}
];
return sections;
},
advanced() {
const sections = [];
return sections;
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/attributeOptions.mjs
var attributeOptions = {
default: {
name: "default",
type: "text",
intlLabel: {
id: getTrad("form.attribute.settings.default"),
defaultMessage: "Default value"
}
},
max: {
name: "max",
type: "checkbox-with-number-field",
intlLabel: {
id: getTrad("form.attribute.item.maximum"),
defaultMessage: "Maximum value"
}
},
maxLength: {
name: "maxLength",
type: "checkbox-with-number-field",
intlLabel: {
id: getTrad("form.attribute.item.maximumLength"),
defaultMessage: "Maximum length"
}
},
min: {
name: "min",
type: "checkbox-with-number-field",
intlLabel: {
id: getTrad("form.attribute.item.minimum"),
defaultMessage: "Minimum value"
}
},
minLength: {
name: "minLength",
type: "checkbox-with-number-field",
intlLabel: {
id: getTrad("form.attribute.item.minimumLength"),
defaultMessage: "Minimum length"
}
},
private: {
name: "private",
type: "checkbox",
intlLabel: {
id: getTrad("form.attribute.item.privateField"),
defaultMessage: "Private field"
},
description: {
id: getTrad("form.attribute.item.privateField.description"),
defaultMessage: "This field will not show up in the API response"
}
},
regex: {
intlLabel: {
id: getTrad("form.attribute.item.text.regex"),
defaultMessage: "RegExp pattern"
},
name: "regex",
type: "text",
description: {
id: getTrad("form.attribute.item.text.regex.description"),
defaultMessage: "The text of the regular expression"
}
},
required: {
name: "required",
type: "checkbox",
intlLabel: {
id: getTrad("form.attribute.item.requiredField"),
defaultMessage: "Required field"
},
description: {
id: getTrad("form.attribute.item.requiredField.description"),
defaultMessage: "You won't be able to create an entry if this field is empty"
}
},
unique: {
name: "unique",
type: "checkbox",
intlLabel: {
id: getTrad("form.attribute.item.uniqueField"),
defaultMessage: "Unique field"
},
description: {
id: getTrad("form.attribute.item.uniqueField.description"),
defaultMessage: "You won't be able to create an entry if there is an existing entry with identical content"
}
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/advancedForm.mjs
var advancedForm = {
blocks() {
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
boolean() {
return {
sections: [
{
sectionTitle: null,
items: [
{
autoFocus: true,
type: "select-default-boolean",
intlLabel: {
id: getTrad("form.attribute.settings.default"),
defaultMessage: "Default value"
},
name: "default",
options: [
{
value: "true",
key: "true",
metadatas: {
intlLabel: {
id: "true",
defaultMessage: "true"
}
}
},
{
value: "",
key: "null",
metadatas: {
intlLabel: {
id: "null",
defaultMessage: "null"
}
}
},
{
value: "false",
key: "false",
metadatas: {
intlLabel: {
id: "false",
defaultMessage: "false"
}
}
}
]
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
component({ repeatable }, step) {
if (step === "1") {
return {
sections: componentForm.advanced()
};
}
if (repeatable) {
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private,
attributeOptions.max,
attributeOptions.min
]
}
]
};
}
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
date({ type }) {
return {
sections: [
{
sectionTitle: null,
items: [
{
...attributeOptions.default,
type: type || "date",
value: null,
withDefaultValue: false,
disabled: !type,
autoFocus: false
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.unique,
attributeOptions.private
]
}
]
};
},
dynamiczone() {
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.max,
attributeOptions.min
]
}
]
};
},
email() {
return {
sections: [
{
sectionTitle: null,
items: [
{
...attributeOptions.default,
type: "email"
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.unique,
attributeOptions.maxLength,
attributeOptions.minLength,
attributeOptions.private
]
}
]
};
},
enumeration(data) {
return {
sections: [
{
sectionTitle: null,
items: [
{
name: "default",
type: "select",
intlLabel: {
id: getTrad("form.attribute.settings.default"),
defaultMessage: "Default value"
},
validations: {},
options: [
{
key: "__null_reset_value__",
value: "",
metadatas: {
intlLabel: {
id: "components.InputSelect.option.placeholder",
defaultMessage: "Choose here"
}
}
},
...(data.enum || []).filter((value, index) => data.enum.indexOf(value) === index && value).map((value) => {
return {
key: value,
value,
metadatas: {
intlLabel: {
id: `${value}.no-override`,
defaultMessage: value
}
}
};
})
]
},
{
intlLabel: {
id: getTrad("form.attribute.item.enumeration.graphql"),
defaultMessage: "Name override for GraphQL"
},
name: "enumName",
type: "text",
validations: {},
description: {
id: getTrad("form.attribute.item.enumeration.graphql.description"),
defaultMessage: "Allows you to override the default generated name for GraphQL"
}
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
json() {
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
media() {
return {
sections: [
{
sectionTitle: null,
items: [
{
intlLabel: {
id: getTrad("form.attribute.media.allowed-types"),
defaultMessage: "Select allowed types of media"
},
name: "allowedTypes",
type: "allowed-types-select",
size: 7,
value: "",
validations: {}
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.private
]
}
]
};
},
number(data) {
const inputStep = data.type === "decimal" || data.type === "float" ? "any" : 1;
return {
sections: [
{
sectionTitle: null,
items: [
{
autoFocus: true,
name: "default",
type: data.type === "biginteger" ? "text" : "number",
step: inputStep,
intlLabel: {
id: getTrad("form.attribute.settings.default"),
defaultMessage: "Default value"
},
validations: {}
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.unique,
attributeOptions.max,
attributeOptions.min,
attributeOptions.private
]
}
]
};
},
password() {
return {
sections: [
{
sectionTitle: null,
items: [
attributeOptions.default
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.maxLength,
attributeOptions.minLength,
attributeOptions.private
]
}
]
};
},
relation() {
return {
sections: [
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.private
]
}
]
};
},
richtext() {
return {
sections: [
{
sectionTitle: null,
items: [
attributeOptions.default
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.maxLength,
attributeOptions.minLength,
attributeOptions.private
]
}
]
};
},
text() {
return {
sections: [
{
sectionTitle: null,
items: [
attributeOptions.default,
attributeOptions.regex
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.unique,
attributeOptions.maxLength,
attributeOptions.minLength,
attributeOptions.private
]
}
]
};
},
uid(data) {
return {
sections: [
{
sectionTitle: null,
items: [
{
...attributeOptions.default,
disabled: Boolean(data.targetField),
type: "text"
}
]
},
{
sectionTitle: {
id: "global.settings",
defaultMessage: "Settings"
},
items: [
attributeOptions.required,
attributeOptions.maxLength,
attributeOptions.minLength,
attributeOptions.private
]
}
]
};
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/component/componentField.mjs
var componentField = {
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "createComponent",
type: "boolean-radio-group",
size: 12,
radios: [
{
title: {
id: getTrad("form.attribute.component.option.create"),
defaultMessage: "Create a new component"
},
description: {
id: getTrad("form.attribute.component.option.create.description"),
defaultMessage: "A component is shared across types and components, it will be available and accessible everywhere."
},
value: true
},
{
title: {
id: getTrad("form.attribute.component.option.reuse-existing"),
defaultMessage: "Use an existing component"
},
description: {
id: getTrad("form.attribute.component.option.reuse-existing.description"),
defaultMessage: "Reuse a component already created to keep your data consistent across content-types."
},
value: false
}
]
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/baseForm.mjs
var baseForm = {
component(data, step) {
if (step === "1") {
const itemsToConcat = data.createComponent === true ? componentForm.base("componentToCreate.") : [];
return {
sections: [
{
sectionTitle: null,
items: [
componentField
]
},
...itemsToConcat
]
};
}
return {
sections: [
{
sectionTitle: null,
items: [
nameField,
{
name: "component",
type: "select-component",
intlLabel: {
id: getTrad("modalForm.attributes.select-component"),
defaultMessage: "Select a component"
},
isMultiple: false
}
]
},
{
sectionTitle: null,
items: [
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "repeatable",
type: "boolean-radio-group",
size: 12,
radios: [
{
title: {
id: getTrad("form.attribute.component.option.repeatable"),
defaultMessage: "Repeatable component"
},
description: {
id: getTrad("form.attribute.component.option.repeatable.description"),
defaultMessage: "Best for multiple instances (array) of ingredients, meta tags, etc.."
},
value: true
},
{
title: {
id: getTrad("form.attribute.component.option.single"),
defaultMessage: "Single component"
},
description: {
id: getTrad("form.attribute.component.option.single.description"),
defaultMessage: "Best for grouping fields like full address, main information, etc..."
},
value: false
}
]
}
]
}
]
};
},
date() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField,
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "type",
type: "select-date",
options: [
{
key: "__null_reset_value__",
value: "",
metadatas: {
intlLabel: {
id: "components.InputSelect.option.placeholder",
defaultMessage: "Choose here"
},
hidden: true
}
},
{
key: "date",
value: "date",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.date.type.date"),
defaultMessage: "date (ex: 01/01/{currentYear})",
values: {
currentYear: (/* @__PURE__ */ new Date()).getFullYear()
}
}
}
},
{
key: "datetime",
value: "datetime",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.date.type.datetime"),
defaultMessage: "datetime (ex: 01/01/{currentYear} 00:00 AM)",
values: {
currentYear: (/* @__PURE__ */ new Date()).getFullYear()
}
}
}
},
{
key: "time",
value: "time",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.date.type.time"),
defaultMessage: "time (ex: 00:00 AM)"
}
}
}
]
}
]
}
]
};
},
enumeration() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField
]
},
{
sectionTitle: null,
items: [
{
name: "enum",
type: "textarea-enum",
size: 6,
intlLabel: {
id: getTrad("form.attribute.item.enumeration.rules"),
defaultMessage: "Values (one line per value)"
},
placeholder: {
id: getTrad("form.attribute.item.enumeration.placeholder"),
defaultMessage: "Ex:\nmorning\nnoon\nevening"
},
validations: {
required: true
}
}
]
}
]
};
},
media() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField
]
},
{
sectionTitle: null,
items: [
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "multiple",
size: 12,
type: "boolean-radio-group",
radios: [
{
title: {
id: getTrad("form.attribute.media.option.multiple"),
defaultMessage: "Multiple media"
},
description: {
id: getTrad("form.attribute.media.option.multiple.description"),
defaultMessage: "Best for sliders, carousels or multiple files download"
},
value: true
},
{
title: {
id: getTrad("form.attribute.media.option.single"),
defaultMessage: "Single media"
},
description: {
id: getTrad("form.attribute.media.option.single.description"),
defaultMessage: "Best for avatar, profile picture or cover"
},
value: false
}
]
}
]
}
]
};
},
number() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField,
{
intlLabel: {
id: getTrad("form.attribute.item.number.type"),
defaultMessage: "Number format"
},
name: "type",
type: "select-number",
options: [
{
key: "__null_reset_value__",
value: "",
metadatas: {
intlLabel: {
id: "components.InputSelect.option.placeholder",
defaultMessage: "Choose here"
},
hidden: true
}
},
{
key: "integer",
value: "integer",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.number.type.integer"),
defaultMessage: "integer (ex: 10)"
}
}
},
{
key: "biginteger",
value: "biginteger",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.number.type.biginteger"),
defaultMessage: "biginteger (ex: 123456789)"
}
}
},
{
key: "decimal",
value: "decimal",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.number.type.decimal"),
defaultMessage: "decimal (ex: 2.22)"
}
}
},
{
key: "float",
value: "float",
metadatas: {
intlLabel: {
id: getTrad("form.attribute.item.number.type.float"),
defaultMessage: "decimal (ex: 3.3333333)"
}
}
}
]
}
]
}
]
};
},
relation() {
return {
sections: [
{
sectionTitle: null,
items: [
{
intlLabel: {
id: "FIXME",
defaultMessage: "FIXME"
},
name: "relation",
size: 12,
type: "relation"
}
]
}
]
};
},
string() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField
]
},
{
sectionTitle: null,
items: [
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "type",
size: 12,
type: "radio-group",
radios: [
{
title: {
id: getTrad("form.attribute.text.option.short-text"),
defaultMessage: "Sort text"
},
description: {
id: getTrad("form.attribute.text.option.short-text.description"),
defaultMessage: "Best for titles, names, links (URL). It also enables exact search on the field."
},
value: "string"
},
{
title: {
id: getTrad("form.attribute.text.option.long-text"),
defaultMessage: "Long text"
},
description: {
id: getTrad("form.attribute.text.option.long-text.description"),
defaultMessage: "Best for descriptions, biography. Exact search is disabled."
},
value: "text"
}
]
}
]
}
]
};
},
text() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField
]
},
{
sectionTitle: null,
items: [
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "type",
size: 12,
type: "radio-group",
radios: [
{
title: {
id: getTrad("form.attribute.text.option.short-text"),
defaultMessage: "Sort text"
},
description: {
id: getTrad("form.attribute.text.option.short-text.description"),
defaultMessage: "Best for titles, names, links (URL). It also enables exact search on the field."
},
value: "string"
},
{
title: {
id: getTrad("form.attribute.text.option.long-text"),
defaultMessage: "Long text"
},
description: {
id: getTrad("form.attribute.text.option.long-text.description"),
defaultMessage: "Best for descriptions, biography. Exact search is disabled."
},
value: "text"
}
]
}
]
}
]
};
},
uid(_data, step, attributes) {
const options2 = attributes.filter(({ type }) => [
"string",
"text"
].includes(type)).map(({ name }) => ({
key: name,
value: name,
metadatas: {
intlLabel: {
id: `${name}.no-override`,
defaultMessage: name
}
}
}));
return {
sections: [
{
sectionTitle: null,
items: [
{
...nameField,
placeholder: {
id: getTrad("modalForm.attribute.form.base.name.placeholder"),
defaultMessage: "e.g. slug, seoUrl, canonicalUrl"
}
},
{
intlLabel: {
id: getTrad("modalForm.attribute.target-field"),
defaultMessage: "Attached field"
},
name: "targetField",
type: "select",
options: [
{
key: "__null_reset_value__",
value: "",
metadatas: {
intlLabel: {
id: "global.none",
defaultMessage: "None"
}
}
},
...options2
]
}
]
}
]
};
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/form.mjs
var attributesForm = {
advanced: advancedForm,
base: baseForm
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/types.mjs
var import_uniq = __toESM(require_uniq(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/utils/toRegressedEnumValue.mjs
var import_slugify = __toESM(require_slugify(), 1);
var toRegressedEnumValue = (value) => {
if (!value) {
return "";
}
return (0, import_slugify.default)(value, {
decamelize: false,
lowercase: false,
separator: "_"
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/validation/common.mjs
var import_fp = __toESM(require_fp(), 1);
var import_toNumber = __toESM(require_toNumber(), 1);
var NAME_REGEX = /^[A-Za-z][_0-9A-Za-z]*$/;
var alreadyUsedAttributeNames = (usedNames) => {
return {
name: "attributeNameAlreadyUsed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp.snakeCase)(value);
return !usedNames.some((existingKey) => {
return (0, import_fp.snakeCase)(existingKey) === snakeCaseKey;
});
}
};
};
var isNameAllowed = (reservedNames) => {
return {
name: "forbiddenAttributeName",
message: getTrad("error.attributeName.reserved-name"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp.snakeCase)(value);
return !reservedNames.some((existingKey) => {
return (0, import_fp.snakeCase)(existingKey) === snakeCaseKey;
});
}
};
};
var validators = {
default: () => create2().nullable(),
max: () => create3().integer().nullable(),
min: () => create3().integer().when("max", (max, schema) => {
if (max) {
return schema.max(max, getTrad("error.validation.minSupMax"));
}
return schema;
}).nullable(),
maxLength: () => create3().integer().positive(getTrad("error.validation.positive")).nullable(),
minLength: () => create3().integer().min(1).when("maxLength", (maxLength, schema) => {
if (maxLength) {
return schema.max(maxLength, getTrad("error.validation.minSupMax"));
}
return schema;
}).nullable(),
name(usedNames, reservedNames) {
return create2().test(alreadyUsedAttributeNames(usedNames)).test(isNameAllowed(reservedNames)).matches(NAME_REGEX, errorsTrads.regex.id).required(errorsTrads.required.id);
},
required: () => create(),
type: () => create2().required(errorsTrads.required.id),
unique: () => create().nullable()
};
var createTextShape = (usedAttributeNames, reservedNames) => {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: validators.default(),
unique: validators.unique(),
required: validators.required(),
maxLength: validators.maxLength(),
minLength: validators.minLength(),
regex: create2().test({
name: "isValidRegExpPattern",
message: getTrad("error.validation.regex"),
test(value) {
try {
return new RegExp(value || "") !== null;
} catch (e) {
return false;
}
}
}).nullable()
};
return shape;
};
var isMinSuperiorThanMax = () => ({
name: "isMinSuperiorThanMax",
message: getTrad("error.validation.minSupMax"),
test(min) {
if (!min) {
return true;
}
const { max } = this.parent;
if (!max) {
return true;
}
if (Number.isNaN((0, import_toNumber.default)(min))) {
return true;
}
return (0, import_toNumber.default)(max) >= (0, import_toNumber.default)(min);
}
});
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/attributes/types.mjs
var attributeTypes = {
date(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type()
};
return create4(shape);
},
datetime(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type()
};
return create4(shape);
},
time(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type()
};
return create4(shape);
},
default(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type()
};
return create4(shape);
},
biginteger(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: create2().nullable().matches(/^-?\d*$/),
unique: validators.unique(),
required: validators.required(),
max: create2().nullable().matches(/^-?\d*$/, errorsTrads.regex.id),
min: create2().nullable().test(isMinSuperiorThanMax()).matches(/^-?\d*$/, errorsTrads.regex.id)
};
return create4(shape);
},
boolean(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
default: create().nullable(),
required: validators.required(),
unique: validators.unique()
};
return create4(shape);
},
component(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
required: validators.required(),
max: validators.max(),
min: validators.min(),
component: create2().required(errorsTrads.required.id)
};
return create4(shape);
},
decimal(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: create3(),
required: validators.required(),
max: create3(),
min: create3().test(isMinSuperiorThanMax())
};
return create4(shape);
},
dynamiczone(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
required: validators.required(),
max: validators.max(),
min: validators.min()
};
return create4(shape);
},
email(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: create2().email().nullable(),
unique: validators.unique(),
required: validators.required(),
maxLength: validators.maxLength(),
minLength: validators.minLength()
};
return create4(shape);
},
enumeration(usedAttributeNames, reservedNames) {
const GRAPHQL_ENUM_REGEX = /^[_A-Za-z][_0-9A-Za-z]*$/;
const shape = {
name: create2().test(alreadyUsedAttributeNames(usedAttributeNames)).test(isNameAllowed(reservedNames)).matches(GRAPHQL_ENUM_REGEX, errorsTrads.regex.id).required(errorsTrads.required.id),
type: validators.type(),
default: validators.default(),
unique: validators.unique(),
required: validators.required(),
enum: create5().of(create2()).min(1, errorsTrads.min.id).test({
name: "areEnumValuesUnique",
message: getTrad("error.validation.enum-duplicate"),
test(values) {
if (!values) {
return false;
}
const duplicates = (0, import_uniq.default)(values.map(toRegressedEnumValue).filter((value, index, values2) => values2.indexOf(value) !== index));
return !duplicates.length;
}
}).test({
name: "doesNotHaveEmptyValues",
message: getTrad("error.validation.enum-empty-string"),
test: (values) => {
if (!values) {
return false;
}
return !values.map(toRegressedEnumValue).some((val) => val === "");
}
}).test({
name: "doesMatchRegex",
message: getTrad("error.validation.enum-regex"),
test: (values) => {
if (!values) {
return false;
}
return values.map(toRegressedEnumValue).every((value) => GRAPHQL_ENUM_REGEX.test(value));
}
}),
enumName: create2().nullable()
};
return create4(shape);
},
float(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
required: validators.required(),
default: create3(),
max: create3(),
min: create3().test(isMinSuperiorThanMax())
};
return create4(shape);
},
integer(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: create3().integer(),
unique: validators.unique(),
required: validators.required(),
max: validators.max(),
min: validators.min()
};
return create4(shape);
},
json(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
required: validators.required(),
unique: validators.unique()
};
return create4(shape);
},
media(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
multiple: create(),
required: validators.required(),
allowedTypes: create5().of(create2().oneOf([
"images",
"videos",
"files",
"audios"
])).min(1).nullable()
};
return create4(shape);
},
password(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: validators.default(),
unique: validators.unique(),
required: validators.required(),
maxLength: validators.maxLength(),
minLength: validators.minLength()
};
return create4(shape);
},
relation(usedAttributeNames, reservedNames, alreadyTakenTargetAttributes, { initialData, modifiedData }) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
target: create2().required(errorsTrads.required.id),
relation: create2().required(),
type: create2().required(),
targetAttribute: create6(() => {
const relationType = getRelationType(modifiedData.relation, modifiedData.targetAttribute);
if (relationType === "oneWay" || relationType === "manyWay") {
return create2().nullable();
}
const schema = create2().test(isNameAllowed(reservedNames));
const initialForbiddenName = [
...alreadyTakenTargetAttributes.map(({ name }) => name),
modifiedData.name
];
const forbiddenTargetAttributeName = initialForbiddenName.filter((val) => val !== initialData.targetAttribute);
return schema.matches(NAME_REGEX, errorsTrads.regex.id).test({
name: "forbiddenTargetAttributeName",
message: getTrad("error.validation.relation.targetAttribute-taken"),
test(value) {
if (!value) {
return false;
}
return !forbiddenTargetAttributeName.includes(value);
}
}).required(errorsTrads.required.id);
})
};
return create4(shape);
},
richtext(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: validators.default(),
unique: validators.unique(),
required: validators.required(),
maxLength: validators.maxLength(),
minLength: validators.minLength()
};
return create4(shape);
},
blocks(usedAttributeNames, reservedNames) {
const shape = {
name: validators.name(usedAttributeNames, reservedNames),
type: validators.type(),
default: validators.default(),
unique: validators.unique(),
required: validators.required(),
maxLength: validators.maxLength(),
minLength: validators.minLength()
};
return create4(shape);
},
string(usedAttributeNames, reservedNames) {
const shape = createTextShape(usedAttributeNames, reservedNames);
return create4(shape);
},
text(usedAttributeNames, reservedNames) {
const shape = createTextShape(usedAttributeNames, reservedNames);
return create4(shape);
},
uid(usedAttributeNames, reservedNames) {
const shape = createTextShape(usedAttributeNames, reservedNames);
return create4(shape);
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/category/regex.mjs
var CATEGORY_NAME_REGEX = /^[A-Za-z][-_0-9A-Za-z]*$/;
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/category/createCategorySchema.mjs
var createCategorySchema = (usedCategoryNames) => {
const shape = {
name: create2().matches(CATEGORY_NAME_REGEX, errorsTrads.regex.id).test({
name: "nameNotAllowed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
return !usedCategoryNames.includes(value == null ? void 0 : value.toLowerCase());
}
}).required(errorsTrads.required.id)
};
return create4(shape);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/category/form.mjs
var categoryForm = {
base: {
sections: [
{
sectionTitle: null,
items: [
{
autoFocus: true,
name: "name",
type: "text",
intlLabel: {
id: "global.name",
defaultMessage: "Name"
},
// validations: {
// required: true,
// },
description: {
id: getTrad("modalForm.editCategory.base.name.description"),
defaultMessage: "No space is allowed for the name of the category"
}
}
]
}
]
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/component/createComponentSchema.mjs
var import_fp2 = __toESM(require_fp(), 1);
var createComponentSchema = (usedComponentNames, reservedNames, category, takenCollectionNames, currentCollectionName) => {
const shape = {
displayName: create2().test({
name: "nameAlreadyUsed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
const name = createComponentUid(value, category);
const snakeCaseKey = (0, import_fp2.snakeCase)(name);
const snakeCaseCollectionName = (0, import_fp2.snakeCase)(currentCollectionName);
return usedComponentNames.every((reserved) => {
return (0, import_fp2.snakeCase)(reserved) !== snakeCaseKey;
}) && takenCollectionNames.every((collectionName) => (0, import_fp2.snakeCase)(collectionName) !== snakeCaseCollectionName);
}
}).test({
name: "nameNotAllowed",
message: getTrad("error.contentTypeName.reserved-name"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp2.snakeCase)(value);
return reservedNames.every((reserved) => {
return (0, import_fp2.snakeCase)(reserved) !== snakeCaseKey;
});
}
}).required(errorsTrads.required.id),
category: create2().matches(CATEGORY_NAME_REGEX, errorsTrads.regex.id).required(errorsTrads.required.id),
icon: create2()
};
return create4(shape);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/contentType/contentTypeForm.mjs
var nameField2 = {
name: "displayName",
type: "text",
intlLabel: {
id: getTrad("contentType.displayName.label"),
defaultMessage: "Display name"
}
};
var contentTypeForm = {
advanced: {
default() {
return {
sections: [
{
items: [
{
intlLabel: {
id: getTrad("contentType.draftAndPublish.label"),
defaultMessage: "Draft & publish"
},
description: {
id: getTrad("contentType.draftAndPublish.description"),
defaultMessage: "Allows writing a draft version of an entry, before it is published"
},
name: "draftAndPublish",
type: "toggle-draft-publish",
validations: {}
}
]
}
]
};
}
},
base: {
create() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField2,
{
description: {
id: getTrad("contentType.apiId-singular.description"),
defaultMessage: "Used to generate the API routes and databases tables/collections"
},
intlLabel: {
id: getTrad("contentType.apiId-singular.label"),
defaultMessage: "API ID (Singular)"
},
name: "singularName",
type: "text-singular"
},
{
type: "pushRight",
size: 6,
intlLabel: {
id: "",
defaultMessage: ""
},
name: "pushRight"
},
{
description: {
id: getTrad("contentType.apiId-plural.description"),
defaultMessage: "Pluralized API ID"
},
intlLabel: {
id: getTrad("contentType.apiId-plural.label"),
defaultMessage: "API ID (Plural)"
},
name: "pluralName",
type: "text-plural"
}
]
}
]
};
},
edit() {
return {
sections: [
{
sectionTitle: null,
items: [
nameField2,
{
disabled: true,
description: {
id: getTrad("contentType.apiId-singular.description"),
defaultMessage: "Used to generate the API routes and databases tables/collections"
},
intlLabel: {
id: getTrad("contentType.apiId-singular.label"),
defaultMessage: "API ID (Singular)"
},
name: "singularName",
type: "text"
},
{
type: "pushRight",
size: 6,
intlLabel: {
id: "",
defaultMessage: ""
},
name: "pushRight"
},
{
disabled: true,
description: {
id: getTrad("contentType.apiId-plural.description"),
defaultMessage: "Pluralized API ID"
},
intlLabel: {
id: getTrad("contentType.apiId-plural.label"),
defaultMessage: "API ID (Plural)"
},
name: "pluralName",
type: "text"
},
{
intlLabel: {
id: "global.type",
defaultMessage: "Type"
},
name: "kind",
type: "content-type-radio-group",
size: 12,
radios: [
{
title: {
id: getTrad("form.button.collection-type.name"),
defaultMessage: "Collection Type"
},
description: {
id: getTrad("form.button.collection-type.description"),
defaultMessage: "Best for multiple instances like articles, products, comments, etc."
},
value: "collectionType"
},
{
title: {
id: getTrad("form.button.single-type.name"),
defaultMessage: "Single Type"
},
description: {
id: getTrad("form.button.single-type.description"),
defaultMessage: "Best for single instance like about us, homepage, etc."
},
value: "singleType"
}
]
}
]
}
]
};
}
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/contentType/createContentTypeSchema.mjs
var import_fp3 = __toESM(require_fp(), 1);
var createContentTypeSchema = ({ usedContentTypeNames = [], reservedModels = [], singularNames = [], pluralNames = [], collectionNames = [] }) => {
const shape = {
displayName: create2().test({
name: "nameAlreadyUsed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
const name = createUid(value);
const snakeCaseKey = (0, import_fp3.snakeCase)(name);
return !usedContentTypeNames.some((value2) => {
return (0, import_fp3.snakeCase)(value2) === snakeCaseKey;
});
}
}).test({
name: "nameNotAllowed",
message: getTrad("error.contentTypeName.reserved-name"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !reservedModels.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).required(errorsTrads.required.id),
pluralName: create2().test({
name: "pluralNameAlreadyUsed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !pluralNames.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).test({
name: "pluralNameAlreadyUsedAsSingular",
message: getTrad("error.contentType.pluralName-equals-singularName"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !singularNames.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).test({
name: "pluralAndSingularAreUnique",
message: getTrad("error.contentType.pluralName-used"),
test(value, context) {
if (!value) {
return false;
}
return (0, import_fp3.snakeCase)(context.parent.singularName) !== (0, import_fp3.snakeCase)(value);
}
}).test({
name: "pluralNameNotAllowed",
message: getTrad("error.contentTypeName.reserved-name"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !reservedModels.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).test({
name: "pluralNameNotAlreadyUsedInCollectionName",
message: getTrad("error.contentType.pluralName-equals-collectionName"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !collectionNames.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).required(errorsTrads.required.id),
singularName: create2().test({
name: "singularNameAlreadyUsed",
message: errorsTrads.unique.id,
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !singularNames.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).test({
name: "singularNameAlreadyUsedAsPlural",
message: getTrad("error.contentType.singularName-equals-pluralName"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !pluralNames.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).test({
name: "pluralAndSingularAreUnique",
message: getTrad("error.contentType.singularName-used"),
test(value, context) {
if (!value) {
return false;
}
return (0, import_fp3.snakeCase)(context.parent.pluralName) !== (0, import_fp3.snakeCase)(value);
}
}).test({
name: "singularNameNotAllowed",
message: getTrad("error.contentTypeName.reserved-name"),
test(value) {
if (!value) {
return false;
}
const snakeCaseKey = (0, import_fp3.snakeCase)(value);
return !reservedModels.some((key) => {
return (0, import_fp3.snakeCase)(key) === snakeCaseKey;
});
}
}).required(errorsTrads.required.id),
draftAndPublish: create(),
kind: create2().oneOf([
"singleType",
"collectionType"
])
};
return create4(shape);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/dynamiczoneForm.mjs
var dynamiczoneForm = {
advanced: {
default() {
return {
sections: componentForm.advanced()
};
}
},
base: {
createComponent() {
return {
sections: [
{
sectionTitle: null,
items: [
componentField
]
},
...componentForm.base("componentToCreate.")
]
};
},
default() {
return {
sections: [
{
sectionTitle: null,
items: [
componentField
]
},
{
sectionTitle: null,
items: [
{
type: "pushRight",
size: 6,
intlLabel: {
id: "",
defaultMessage: ""
},
name: "pushRight"
},
{
name: "components",
type: "select-components",
intlLabel: {
id: getTrad("modalForm.attributes.select-components"),
defaultMessage: "Select the components"
},
isMultiple: true
}
]
}
]
};
}
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/forms/utils/addItemsToFormSection.mjs
var addItemsToFormSection = (formTypeOptions, sections) => {
formTypeOptions.forEach((item) => {
var _a;
if (!("sectionTitle" in item)) {
(_a = sections[0].items) == null ? void 0 : _a.push(item);
return;
}
sections.push(item);
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/forms/utils/createCollectionName.mjs
var import_fp4 = __toESM(require_fp(), 1);
var import_pluralize3 = __toESM(require_pluralize(), 1);
var createComponentCollectionName = (name, category) => {
return `components_${(0, import_fp4.snakeCase)(category)}_${(0, import_pluralize3.default)((0, import_fp4.snakeCase)(name))}`;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/forms/utils/getUsedAttributeNames.mjs
var getUsedAttributeNames = (attributes, schemaData) => {
return attributes.filter(({ name }) => {
return name !== schemaData.initialData.name;
}).map(({ name }) => name);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/forms/forms.mjs
var forms = {
customField: {
schema({ schemaAttributes, attributeType, customFieldValidator, reservedNames, schemaData, ctbFormsAPI }) {
const usedAttributeNames = getUsedAttributeNames(schemaAttributes, schemaData);
let attributeShape;
if (attributeType === "relation") {
attributeShape = attributeTypes[attributeType](usedAttributeNames, reservedNames.attributes, [], {
initialData: {},
modifiedData: {}
});
} else {
attributeShape = attributeTypes[attributeType](usedAttributeNames, reservedNames.attributes);
}
return ctbFormsAPI.makeCustomFieldValidator(attributeShape, customFieldValidator, usedAttributeNames, reservedNames.attributes, schemaData);
},
form: {
base({ customField }) {
var _a;
const sections = [
{
sectionTitle: null,
items: [
nameField
]
}
];
if ((_a = customField.options) == null ? void 0 : _a.base) {
addItemsToFormSection(customField.options.base, sections);
}
return {
sections
};
},
advanced({ customField, data, step, extensions, ...rest }) {
var _a;
const sections = [
{
sectionTitle: null,
items: []
}
];
const injectedInputs = extensions.getAdvancedForm([
"attribute",
customField.type
], {
data,
type: customField.type,
step,
...rest
});
if ((_a = customField.options) == null ? void 0 : _a.advanced) {
addItemsToFormSection(customField.options.advanced, sections);
}
if (injectedInputs) {
const extendedSettings = {
sectionTitle: {
id: getTrad("modalForm.custom-fields.advanced.settings.extended"),
defaultMessage: "Extended settings"
},
items: injectedInputs
};
sections.push(extendedSettings);
}
return {
sections
};
}
}
},
attribute: {
schema(currentSchema, attributeType, reservedNames, alreadyTakenTargetContentTypeAttributes, options2, extensions) {
var _a;
const attributes = ((_a = currentSchema == null ? void 0 : currentSchema.schema) == null ? void 0 : _a.attributes) ?? [];
const usedAttributeNames = getUsedAttributeNames(attributes, options2);
try {
const attributeShape = attributeTypes[attributeType](usedAttributeNames, reservedNames.attributes, alreadyTakenTargetContentTypeAttributes, options2);
return extensions.makeValidator([
"attribute",
attributeType
], attributeShape, usedAttributeNames, reservedNames.attributes, alreadyTakenTargetContentTypeAttributes, options2);
} catch (err) {
console.error("Error yup build schema", err);
return attributeTypes.default(usedAttributeNames, reservedNames.attributes);
}
},
form: {
advanced({ data, type, step, extensions, ...rest }) {
try {
const baseForm2 = attributesForm.advanced[type](data, step).sections;
const itemsToAdd = extensions.getAdvancedForm([
"attribute",
type
], {
data,
type,
step,
...rest
});
const sections = baseForm2.reduce((acc, current) => {
if (current.sectionTitle === null) {
acc.push(current);
} else {
acc.push({
...current,
items: [
...current.items,
...itemsToAdd
]
});
}
return acc;
}, []);
return {
sections
};
} catch (err) {
console.error(err);
return {
sections: []
};
}
},
base({ data, type, step, attributes }) {
try {
return attributesForm.base[type](data, step, attributes);
} catch (err) {
return commonBaseForm;
}
}
}
},
contentType: {
schema(alreadyTakenNames, isEditing, ctUid, reservedNames, extensions, contentTypes) {
const singularNames = Object.values(contentTypes).map((contentType) => {
return contentType.schema.singularName;
});
const pluralNames = Object.values(contentTypes).map((contentType) => {
var _a;
return ((_a = contentType == null ? void 0 : contentType.schema) == null ? void 0 : _a.pluralName) ?? "";
});
const takenNames = isEditing ? alreadyTakenNames.filter((uid) => uid !== ctUid) : alreadyTakenNames;
const takenSingularNames = isEditing ? singularNames.filter((singName) => {
const { schema } = contentTypes[ctUid];
return schema.singularName !== singName;
}) : singularNames;
const takenPluralNames = isEditing ? pluralNames.filter((pluralName) => {
const { schema } = contentTypes[ctUid];
return schema.pluralName !== pluralName;
}) : pluralNames;
const collectionNames = Object.values(contentTypes).map((contentType) => {
var _a;
return ((_a = contentType == null ? void 0 : contentType.schema) == null ? void 0 : _a.collectionName) ?? "";
});
const takenCollectionNames = isEditing ? collectionNames.filter((collectionName) => {
const { schema } = contentTypes[ctUid];
const currentCollectionName = schema.collectionName;
return collectionName !== currentCollectionName;
}) : collectionNames;
const contentTypeShape = createContentTypeSchema({
usedContentTypeNames: takenNames,
reservedModels: reservedNames.models,
singularNames: takenSingularNames,
pluralNames: takenPluralNames,
collectionNames: takenCollectionNames
});
return extensions.makeValidator([
"contentType"
], contentTypeShape, takenNames, reservedNames.models, takenSingularNames, takenPluralNames);
},
form: {
base({ actionType }) {
if (actionType === "create") {
return contentTypeForm.base.create();
}
return contentTypeForm.base.edit();
},
advanced({ extensions }) {
const baseForm2 = contentTypeForm.advanced.default().sections.map((section) => section.items).flat();
const itemsToAdd = extensions.getAdvancedForm([
"contentType"
]);
return {
sections: [
{
items: [
...baseForm2,
...itemsToAdd
]
}
]
};
}
}
},
component: {
schema(alreadyTakenAttributes, componentCategory, reservedNames, isEditing = false, components, componentDisplayName, compoUid = null) {
const takenNames = isEditing ? alreadyTakenAttributes.filter((uid) => uid !== compoUid) : alreadyTakenAttributes;
const collectionNames = Object.values(components).map((component) => {
var _a;
return (_a = component == null ? void 0 : component.schema) == null ? void 0 : _a.collectionName;
});
const currentCollectionName = createComponentCollectionName(componentDisplayName, componentCategory);
const takenCollectionNames = isEditing ? collectionNames.filter((collectionName) => collectionName !== currentCollectionName) : collectionNames;
return createComponentSchema(takenNames, reservedNames.models, componentCategory, takenCollectionNames, currentCollectionName);
},
form: {
advanced() {
return {
sections: componentForm.advanced()
};
},
base() {
return {
sections: componentForm.base()
};
}
}
},
addComponentToDynamicZone: {
form: {
advanced() {
return dynamiczoneForm.advanced.default();
},
base({ data }) {
const isCreatingComponent = (data == null ? void 0 : data.createComponent) ?? false;
if (isCreatingComponent) {
return dynamiczoneForm.base.createComponent();
}
return dynamiczoneForm.base.default();
}
}
},
editCategory: {
schema(allCategories, initialData) {
const allowedCategories = allCategories.filter((cat) => cat !== initialData.name).map((cat) => cat.toLowerCase());
return createCategorySchema(allowedCategories);
},
form: {
advanced: () => ({
sections: []
}),
base() {
return categoryForm.base;
}
}
}
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/selectors.mjs
var formModalDomain = () => (state) => state[`${pluginId}_formModal`] || initialState2;
var makeSelectFormModal = () => createSelector(formModalDomain(), (substate) => {
return substate;
});
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/utils/canEditContentType.mjs
var import_get3 = __toESM(require_get(), 1);
var canEditContentType = (data, modifiedData) => {
const kind = (0, import_get3.default)(data, [
"contentType",
"schema",
"kind"
], "");
if (kind === "singleType" || kind === modifiedData.kind) {
return true;
}
const contentTypeAttributes = (0, import_get3.default)(data, [
"contentType",
"schema",
"attributes"
], []);
const relationAttributes = contentTypeAttributes.filter(({ relation, type, targetAttribute }) => {
const relationType = getRelationType(relation, targetAttribute);
return type === "relation" && ![
"oneWay",
"manyWay"
].includes(relationType || "");
});
return relationAttributes.length === 0;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/utils/getAttributesToDisplay.mjs
var getAttributesToDisplay = (dataTarget = "", targetUid, nestedComponents) => {
const defaultAttributes = [
"text",
"boolean",
"blocks",
"json",
"number",
"email",
"date",
"password",
"media",
"enumeration",
"relation",
"richtext"
];
const isPickingAttributeForAContentType = dataTarget === "contentType";
if (isPickingAttributeForAContentType) {
return [
// Insert UID before the last item (richtext)
[
...defaultAttributes.slice(0, -1),
"uid",
...defaultAttributes.slice(-1)
],
[
"component",
"dynamiczone"
]
];
}
if (dataTarget) {
const componentDepth = getComponentDepth(targetUid, nestedComponents);
const isNestedInAnotherComponent = componentDepth >= MAX_COMPONENT_DEPTH;
const canAddComponentInAnotherComponent = !isPickingAttributeForAContentType && !isNestedInAnotherComponent;
if (canAddComponentInAnotherComponent) {
return [
defaultAttributes,
[
"component"
]
];
}
}
return [
defaultAttributes
];
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/utils/getFormInputNames.mjs
var getFormInputNames = (form) => form.reduce((acc, current) => {
const names = current.items.reduce((acc2, current2) => {
if (current2.name) {
acc2.push(current2.name);
}
return acc2;
}, []);
return [
...acc,
...names
];
}, []);
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModal/FormModal.mjs
var FormComponent = dt.form`
overflow: auto;
`;
var FormModal = () => {
const { onCloseModal, onNavigateToChooseAttributeModal, onNavigateToAddCompoToDZModal, onNavigateToCreateComponentStep2, actionType, attributeName, attributeType, customFieldUid, categoryName, dynamicZoneTarget, forTarget, modalType, isOpen, kind, step, targetUid, showBackLink, activeTab, setActiveTab } = useFormModalNavigation();
const getPlugin = useStrapiApp("FormModal", (state) => state.getPlugin);
const getCustomField = useStrapiApp("FormModal", (state) => state.customFields.get);
const customField = getCustomField(customFieldUid);
const formModalSelector = React2.useMemo(makeSelectFormModal, []);
const dispatch = useDispatch();
const { toggleNotification } = useNotification();
const reducerState = useSelector((state) => formModalSelector(state), shallowEqual);
const navigate = useNavigate();
const { trackUsage } = useTracking();
const { formatMessage } = useIntl();
const ctbPlugin = getPlugin(pluginId);
const ctbFormsAPI = ctbPlugin == null ? void 0 : ctbPlugin.apis.forms;
const inputsFromPlugins = ctbFormsAPI.components.inputs;
const { addAttribute, addCustomFieldAttribute, addCreatedComponentToDynamicZone, allComponentsCategories, changeDynamicZoneComponents, contentTypes, components, createSchema, deleteCategory, deleteData, editCategory, editCustomFieldAttribute, submitData, modifiedData: allDataSchema, nestedComponents, setModifiedData, sortedContentTypesList, updateSchema, reservedNames } = useDataManager();
const { componentToCreate, formErrors, initialData, isCreatingComponentWhileAddingAField, modifiedData } = reducerState;
const pathToSchema = forTarget === "contentType" || forTarget === "component" ? [
forTarget
] : [
forTarget,
targetUid
];
React2.useEffect(() => {
if (isOpen) {
const collectionTypesForRelation = sortedContentTypesList.filter(isAllowedContentTypesForRelations);
if (modalType === "editCategory") {
setModifiedData();
}
if (actionType === "edit" && modalType === "attribute" && forTarget === "contentType") {
trackUsage("willEditFieldOfContentType");
}
const pathToAttributes = [
...pathToSchema,
"schema",
"attributes"
];
const foundDynamicZoneTarget = findAttribute((0, import_get4.default)(allDataSchema, pathToAttributes, []), dynamicZoneTarget) || null;
if (modalType === "editCategory" && actionType === "edit") {
dispatch(actions2.setDataToEdit({
data: {
name: categoryName
}
}));
}
if (modalType === "contentType" && actionType === "create") {
dispatch(actions2.setDataToEdit({
data: {
draftAndPublish: true
}
}));
}
if (modalType === "contentType" && actionType === "edit") {
const { displayName, draftAndPublish, kind: kind2, pluginOptions, pluralName, singularName } = (0, import_get4.default)(allDataSchema, [
...pathToSchema,
"schema"
], {
displayName: null,
pluginOptions: {},
singularName: null,
pluralName: null
});
dispatch(actions2.setDataToEdit({
data: {
displayName,
draftAndPublish,
kind: kind2,
pluginOptions,
pluralName,
singularName
}
}));
}
if (modalType === "component" && actionType === "edit") {
const data = (0, import_get4.default)(allDataSchema, pathToSchema, {});
dispatch(actions2.setDataToEdit({
data: {
displayName: data.schema.displayName,
category: data.category,
icon: data.schema.icon
}
}));
}
if (modalType === "addComponentToDynamicZone" && actionType === "edit") {
const attributeToEdit = {
...foundDynamicZoneTarget,
// We filter the available components
// Because this modal is only used for adding components
components: [],
name: dynamicZoneTarget,
createComponent: false,
componentToCreate: {
type: "component"
}
};
dispatch(actions2.setDynamicZoneDataSchema({
attributeToEdit
}));
}
if (attributeType) {
const attributeToEditNotFormatted = findAttribute((0, import_get4.default)(allDataSchema, pathToAttributes, []), attributeName);
const attributeToEdit = {
...attributeToEditNotFormatted,
name: attributeName
};
if (attributeType === "component" && actionType === "edit") {
if (!attributeToEdit.repeatable) {
(0, import_set.default)(attributeToEdit, "repeatable", false);
}
}
if (modalType === "customField") {
if (actionType === "edit") {
dispatch(actions2.setCustomFieldDataSchema({
isEditing: true,
modifiedDataToSetForEditing: attributeToEdit
}));
} else {
dispatch(actions2.setCustomFieldDataSchema({
customField,
isEditing: false,
modifiedDataToSetForEditing: attributeToEdit
}));
}
} else {
dispatch(actions2.setAttributeDataSchema({
attributeType,
nameToSetForRelation: (0, import_get4.default)(collectionTypesForRelation, [
"0",
"title"
], "error"),
targetUid: (0, import_get4.default)(collectionTypesForRelation, [
"0",
"uid"
], "error"),
isEditing: actionType === "edit",
modifiedDataToSetForEditing: attributeToEdit,
step
}));
}
}
} else {
dispatch(actions2.resetProps());
}
}, [
actionType,
attributeName,
attributeType,
categoryName,
dynamicZoneTarget,
forTarget,
isOpen,
modalType
]);
const isCreatingContentType = modalType === "contentType";
const isCreatingComponent = modalType === "component";
const isCreatingAttribute = modalType === "attribute";
const isCreatingCustomFieldAttribute = modalType === "customField";
const isComponentAttribute = attributeType === "component" && isCreatingAttribute;
const isCreating = actionType === "create";
const isCreatingComponentFromAView = (0, import_get4.default)(modifiedData, "createComponent", false) || isCreatingComponentWhileAddingAField;
const isInFirstComponentStep = step === "1";
const isEditingCategory = modalType === "editCategory";
const isPickingAttribute = modalType === "chooseAttribute";
const uid = createUid(modifiedData.displayName || "");
const attributes = (0, import_get4.default)(allDataSchema, [
...pathToSchema,
"schema",
"attributes"
], null);
const checkFormValidity = async () => {
var _a;
let schema;
const dataToValidate = isCreatingComponentFromAView && step === "1" ? (0, import_get4.default)(modifiedData, "componentToCreate", {}) : modifiedData;
if (isCreatingContentType) {
schema = forms.contentType.schema(
Object.keys(contentTypes),
actionType === "edit",
// currentUID
(0, import_get4.default)(allDataSchema, [
...pathToSchema,
"uid"
], null),
reservedNames,
ctbFormsAPI,
contentTypes
);
} else if (isCreatingComponent) {
schema = forms.component.schema(Object.keys(components), modifiedData.category || "", reservedNames, actionType === "edit", components, modifiedData.displayName || "", (0, import_get4.default)(allDataSchema, [
...pathToSchema,
"uid"
], null));
} else if (isCreatingCustomFieldAttribute) {
schema = forms.customField.schema({
schemaAttributes: (0, import_get4.default)(allDataSchema, [
...pathToSchema,
"schema",
"attributes"
], []),
attributeType: customField.type,
reservedNames,
schemaData: {
modifiedData,
initialData
},
ctbFormsAPI,
customFieldValidator: (_a = customField.options) == null ? void 0 : _a.validator
});
} else if (isComponentAttribute && isCreatingComponentFromAView && isInFirstComponentStep) {
schema = forms.component.schema(Object.keys(components), (0, import_get4.default)(modifiedData, "componentToCreate.category", ""), reservedNames, actionType === "edit", components, modifiedData.componentToCreate.displayName || "");
} else if (isCreatingAttribute && !isInFirstComponentStep) {
const type = attributeType === "relation" ? "relation" : modifiedData.type;
let alreadyTakenTargetContentTypeAttributes = [];
if (type === "relation") {
const targetContentTypeUID = (0, import_get4.default)(modifiedData, [
"target"
], null);
const targetContentTypeAttributes = (0, import_get4.default)(contentTypes, [
targetContentTypeUID,
"schema",
"attributes"
], []);
alreadyTakenTargetContentTypeAttributes = targetContentTypeAttributes.filter(({ name: attrName }) => {
if (actionType !== "edit") {
return true;
}
return attrName !== initialData.targetAttribute;
});
}
schema = forms.attribute.schema((0, import_get4.default)(allDataSchema, pathToSchema, {}), type, reservedNames, alreadyTakenTargetContentTypeAttributes, {
modifiedData,
initialData
}, ctbFormsAPI);
} else if (isEditingCategory) {
schema = forms.editCategory.schema(allComponentsCategories, initialData);
} else {
if (isInFirstComponentStep && isCreatingComponentFromAView) {
schema = forms.component.schema(Object.keys(components), (0, import_get4.default)(modifiedData, "componentToCreate.category", ""), reservedNames, actionType === "edit", components, modifiedData.componentToCreate.displayName || "");
} else {
return;
}
}
await schema.validate(dataToValidate, {
abortEarly: false
});
};
const handleChange = React2.useCallback(({ target: { name, value, type, ...rest } }) => {
const namesThatCanResetToNullValue = [
"enumName",
"max",
"min",
"maxLength",
"minLength",
"regex",
"default"
];
let val;
if (namesThatCanResetToNullValue.includes(name) && value === "") {
val = null;
} else {
val = value;
}
const clonedErrors = Object.assign({}, formErrors);
if (name === "max") {
delete clonedErrors.min;
}
if (name === "maxLength") {
delete clonedErrors.minLength;
}
delete clonedErrors[name];
dispatch(actions2.setErrors({
errors: clonedErrors
}));
dispatch(actions2.onChange({
keys: name.split("."),
value: val
}));
}, [
dispatch,
formErrors
]);
const handleSubmit = async (e, shouldContinue = isCreating) => {
e.preventDefault();
try {
await checkFormValidity();
sendButtonAddMoreFieldEvent(shouldContinue);
const ctTargetUid = forTarget === "components" ? targetUid : uid;
if (isCreatingContentType) {
if (isCreating) {
createSchema({
...modifiedData,
kind
}, modalType, uid);
navigate({
pathname: `/plugins/${pluginId}/content-types/${uid}`
});
onNavigateToChooseAttributeModal({
forTarget,
targetUid: ctTargetUid
});
} else {
if (canEditContentType(allDataSchema, modifiedData)) {
onCloseModal();
await submitData(modifiedData);
} else {
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.contentType.relations.conflict"
})
});
}
return;
}
} else if (modalType === "component") {
if (isCreating) {
const componentUid = createComponentUid(modifiedData.displayName, modifiedData.category);
const { category, ...rest } = modifiedData;
createSchema(rest, "component", componentUid, category);
navigate({
pathname: `/plugins/${pluginId}/component-categories/${category}/${componentUid}`
});
onNavigateToChooseAttributeModal({
forTarget,
targetUid: componentUid
});
} else {
updateSchema(modifiedData, modalType, targetUid);
onCloseModal();
return;
}
} else if (isEditingCategory) {
if ((0, import_toLower.default)(initialData.name) === (0, import_toLower.default)(modifiedData.name)) {
onCloseModal();
return;
}
editCategory(initialData.name, modifiedData);
return;
} else if (isCreatingCustomFieldAttribute) {
const customFieldAttributeUpdate = {
attributeToSet: {
...modifiedData,
customField: customFieldUid
},
forTarget,
targetUid,
initialAttribute: initialData
};
if (actionType === "edit") {
editCustomFieldAttribute(customFieldAttributeUpdate);
} else {
addCustomFieldAttribute(customFieldAttributeUpdate);
}
if (shouldContinue) {
onNavigateToChooseAttributeModal({
forTarget,
targetUid: ctTargetUid
});
} else {
onCloseModal();
}
return;
} else if (isCreatingAttribute && !isCreatingComponentFromAView) {
const isDynamicZoneAttribute = attributeType === "dynamiczone";
if (isDynamicZoneAttribute) {
addAttribute(modifiedData, forTarget, targetUid, actionType === "edit", initialData);
if (isCreating) {
dispatch(actions2.resetPropsAndSetTheFormForAddingACompoToADz());
setActiveTab("basic");
onNavigateToAddCompoToDZModal({
dynamicZoneTarget: modifiedData.name
});
} else {
onCloseModal();
}
return;
}
if (!isComponentAttribute) {
addAttribute(modifiedData, forTarget, targetUid, actionType === "edit", initialData);
if (shouldContinue) {
onNavigateToChooseAttributeModal({
forTarget,
targetUid: ctTargetUid
});
} else {
onCloseModal();
}
return;
}
if (isInFirstComponentStep) {
onNavigateToCreateComponentStep2();
dispatch(actions2.resetPropsAndSetFormForAddingAnExistingCompo({}));
return;
}
addAttribute(
modifiedData,
forTarget,
targetUid,
// This change the dispatched type
// either 'editAttribute' or 'addAttribute' in the DataManagerProvider
actionType === "edit",
// This is for the edit part
initialData,
// Passing true will add the component to the components object
// This way we can add fields to the added component (if it wasn't there already)
true
);
if (shouldContinue) {
onNavigateToChooseAttributeModal({
forTarget,
targetUid
});
} else {
onCloseModal();
}
} else if (isCreatingAttribute && isCreatingComponentFromAView) {
if (isInFirstComponentStep) {
trackUsage("willCreateComponentFromAttributesModal");
dispatch(actions2.resetPropsAndSaveCurrentData({}));
onNavigateToCreateComponentStep2();
return;
}
const { category, type, ...rest } = componentToCreate;
const componentUid = createComponentUid(componentToCreate.displayName, category);
createSchema(
// Component data
rest,
// Type will always be component
// It will dispatch the CREATE_COMPONENT_SCHEMA action
// So the component will be added in the main components object
// This might not be needed if we don't allow navigation between entries while editing
type,
componentUid,
category,
// This will add the created component in the datamanager modifiedData components key
// Like explained above we will be able to modify the created component structure
isCreatingComponentFromAView
);
addAttribute(modifiedData, forTarget, targetUid, false);
dispatch(actions2.resetProps());
if (shouldContinue) {
onNavigateToChooseAttributeModal({
forTarget: "components",
targetUid: componentUid
});
} else {
onCloseModal();
}
return;
} else {
if (isInFirstComponentStep) {
if (isCreatingComponentFromAView) {
const { category, type, ...rest } = modifiedData.componentToCreate;
const componentUid = createComponentUid(modifiedData.componentToCreate.displayName, category);
createSchema(
// Component data
rest,
// Type will always be component
// It will dispatch the CREATE_COMPONENT_SCHEMA action
// So the component will be added in the main components object
// This might not be needed if we don't allow navigation between entries while editing
type,
componentUid,
category,
// This will add the created component in the datamanager modifiedData components key
// Like explained above we will be able to modify the created component structure
isCreatingComponentFromAView
);
addCreatedComponentToDynamicZone(dynamicZoneTarget, [
componentUid
]);
onNavigateToChooseAttributeModal({
forTarget: "components",
targetUid: componentUid
});
} else {
changeDynamicZoneComponents(dynamicZoneTarget, modifiedData.components);
onCloseModal();
}
} else {
console.error("This case is not handled");
}
return;
}
dispatch(actions2.resetProps());
} catch (err) {
const errors = getYupInnerErrors(err);
dispatch(actions2.setErrors({
errors
}));
}
};
const handleConfirmClose = () => {
const confirm = window.confirm(formatMessage({
id: "window.confirm.close-modal.file",
defaultMessage: "Are you sure? Your changes will be lost."
}));
if (confirm) {
onCloseModal();
dispatch(actions2.resetProps());
}
};
const handleClosed = () => {
if (!(0, import_isEqual3.default)(modifiedData, initialData)) {
handleConfirmClose();
} else {
onCloseModal();
dispatch(actions2.resetProps());
}
};
const sendAdvancedTabEvent = (tab) => {
if (tab !== "advanced") {
return;
}
if (isCreatingContentType) {
trackUsage("didSelectContentTypeSettings");
return;
}
if (forTarget === "contentType") {
trackUsage("didSelectContentTypeFieldSettings");
}
};
const sendButtonAddMoreFieldEvent = (shouldContinue) => {
if (modalType === "attribute" && forTarget === "contentType" && attributeType !== "dynamiczone" && shouldContinue) {
trackUsage("willAddMoreFieldToContentType");
}
};
const shouldDisableAdvancedTab = () => {
if (modalType === "editCategory") {
return true;
}
if (modalType === "component") {
return true;
}
if ((0, import_has.default)(modifiedData, "createComponent")) {
return true;
}
return false;
};
const displayedAttributes = getAttributesToDisplay(
forTarget,
targetUid,
// We need the nested components so we know when to remove the component option
nestedComponents
);
if (!modalType) {
return null;
}
const formToDisplay = (0, import_get4.default)(forms, [
modalType,
"form"
], {
advanced: () => ({
sections: []
}),
base: () => ({
sections: []
})
});
const isAddingAComponentToAnotherComponent = forTarget === "components" || forTarget === "component";
const genericInputProps = {
customInputs: {
"allowed-types-select": AllowedTypesSelect,
"boolean-radio-group": BooleanRadioGroup,
"checkbox-with-number-field": CheckboxWithNumberField,
"icon-picker": IconPicker,
"content-type-radio-group": ContentTypeRadioGroup,
"radio-group": CustomRadioGroup,
relation: Relation,
"select-category": SelectCategory,
"select-component": SelectComponent,
"select-components": SelectComponents,
"select-default-boolean": BooleanDefaultValueSelect,
"select-number": SelectNumber,
"select-date": SelectDateType,
"toggle-draft-publish": DraftAndPublishToggle,
"text-plural": PluralName,
"text-singular": SingularName,
"textarea-enum": TextareaEnum,
...inputsFromPlugins
},
componentToCreate,
dynamicZoneTarget,
formErrors,
isAddingAComponentToAnotherComponent,
isCreatingComponentWhileAddingAField,
mainBoxHeader: (0, import_get4.default)(allDataSchema, [
...pathToSchema,
"schema",
"displayName"
], ""),
modifiedData,
naturePickerType: forTarget,
isCreating,
targetUid,
forTarget
};
const advancedForm2 = formToDisplay.advanced({
data: modifiedData,
type: attributeType,
step,
actionType,
attributes,
extensions: ctbFormsAPI,
forTarget,
contentTypeSchema: allDataSchema.contentType || {},
customField
}).sections;
const baseForm2 = formToDisplay.base({
data: modifiedData,
type: attributeType,
step,
actionType,
attributes,
extensions: ctbFormsAPI,
forTarget,
contentTypeSchema: allDataSchema.contentType || {},
customField
}).sections;
const baseFormInputNames = getFormInputNames(baseForm2);
const advancedFormInputNames = getFormInputNames(advancedForm2);
const doesBaseFormHasError = Object.keys(formErrors).some((key) => baseFormInputNames.includes(key));
const doesAdvancedFormHasError = Object.keys(formErrors).some((key) => advancedFormInputNames.includes(key));
const schemaKind = (0, import_get4.default)(contentTypes, [
targetUid,
"schema",
"kind"
]);
const checkIsEditingFieldName = () => actionType === "edit" && attributes.every(({ name }) => name !== (modifiedData == null ? void 0 : modifiedData.name));
const handleClickFinish = () => {
if (checkIsEditingFieldName()) {
trackUsage("didEditFieldNameOnContentType");
}
};
return (0, import_jsx_runtime33.jsx)(Modal.Root, {
open: isOpen,
onOpenChange: handleClosed,
children: (0, import_jsx_runtime33.jsxs)(Modal.Content, {
children: [
(0, import_jsx_runtime33.jsx)(FormModalHeader, {
actionType,
attributeName,
categoryName,
contentTypeKind: kind,
dynamicZoneTarget,
modalType,
forTarget,
targetUid,
attributeType,
customFieldUid,
showBackLink
}),
isPickingAttribute && (0, import_jsx_runtime33.jsx)(AttributeOptions, {
attributes: displayedAttributes,
forTarget,
kind: schemaKind || "collectionType"
}),
!isPickingAttribute && (0, import_jsx_runtime33.jsxs)(FormComponent, {
onSubmit: handleSubmit,
children: [
(0, import_jsx_runtime33.jsx)(Modal.Body, {
children: (0, import_jsx_runtime33.jsxs)(Tabs.Root, {
variant: "simple",
value: activeTab,
onValueChange: (value) => {
setActiveTab(value);
sendAdvancedTabEvent(value);
},
hasError: doesBaseFormHasError ? "basic" : doesAdvancedFormHasError ? "advanced" : void 0,
children: [
(0, import_jsx_runtime33.jsxs)(Flex, {
justifyContent: "space-between",
children: [
(0, import_jsx_runtime33.jsx)(FormModalSubHeader, {
actionType,
forTarget,
kind,
step,
modalType,
attributeType,
attributeName,
customField
}),
(0, import_jsx_runtime33.jsxs)(Tabs.List, {
children: [
(0, import_jsx_runtime33.jsx)(Tabs.Trigger, {
value: "basic",
children: formatMessage({
id: getTrad("popUpForm.navContainer.base"),
defaultMessage: "Basic settings"
})
}),
(0, import_jsx_runtime33.jsx)(Tabs.Trigger, {
value: "advanced",
disabled: shouldDisableAdvancedTab(),
children: formatMessage({
id: getTrad("popUpForm.navContainer.advanced"),
defaultMessage: "Advanced settings"
})
})
]
})
]
}),
(0, import_jsx_runtime33.jsx)(Divider, {
marginBottom: 6
}),
(0, import_jsx_runtime33.jsx)(Tabs.Content, {
value: "basic",
children: (0, import_jsx_runtime33.jsx)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 6,
children: (0, import_jsx_runtime33.jsx)(TabForm, {
form: baseForm2,
formErrors,
genericInputProps,
modifiedData,
onChange: handleChange
})
})
}),
(0, import_jsx_runtime33.jsx)(Tabs.Content, {
value: "advanced",
children: (0, import_jsx_runtime33.jsx)(Flex, {
direction: "column",
alignItems: "stretch",
gap: 6,
children: (0, import_jsx_runtime33.jsx)(TabForm, {
form: advancedForm2,
formErrors,
genericInputProps,
modifiedData,
onChange: handleChange
})
})
})
]
})
}),
(0, import_jsx_runtime33.jsxs)(Modal.Footer, {
children: [
(0, import_jsx_runtime33.jsx)(Button, {
variant: "tertiary",
onClick: handleClosed,
children: formatMessage({
id: "app.components.Button.cancel",
defaultMessage: "Cancel"
})
}),
(0, import_jsx_runtime33.jsx)(FormModalEndActions, {
deleteCategory,
deleteContentType: deleteData,
deleteComponent: deleteData,
categoryName: initialData.name,
isAttributeModal: modalType === "attribute",
isCustomFieldModal: modalType === "customField",
isComponentToDzModal: modalType === "addComponentToDynamicZone",
isComponentAttribute: attributeType === "component",
isComponentModal: modalType === "component",
isContentTypeModal: modalType === "contentType",
isCreatingComponent: actionType === "create",
isCreatingDz: actionType === "create",
isCreatingComponentAttribute: modifiedData.createComponent || false,
isCreatingComponentInDz: modifiedData.createComponent || false,
isCreatingComponentWhileAddingAField,
isCreatingContentType: actionType === "create",
isEditingAttribute: actionType === "edit",
isDzAttribute: attributeType === "dynamiczone",
isEditingCategory: modalType === "editCategory",
isInFirstComponentStep: step === "1",
onSubmitAddComponentAttribute: handleSubmit,
onSubmitAddComponentToDz: handleSubmit,
onSubmitCreateComponent: handleSubmit,
onSubmitCreateContentType: handleSubmit,
onSubmitCreateDz: handleSubmit,
onSubmitEditAttribute: handleSubmit,
onSubmitEditCategory: handleSubmit,
onSubmitEditComponent: handleSubmit,
onSubmitEditContentType: handleSubmit,
onSubmitEditCustomFieldAttribute: handleSubmit,
onSubmitEditDz: handleSubmit,
onClickFinish: handleClickFinish
})
]
})
]
})
]
})
});
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/selectors.mjs
var dataManagerProviderDomain = () => (state) => state[`${pluginId}_dataManagerProvider`] || initialState;
var makeSelectDataManagerProvider = () => createSelector(dataManagerProviderDomain(), (substate) => {
return substate;
});
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/cleanData.mjs
var import_camelCase = __toESM(require_camelCase(), 1);
var import_get5 = __toESM(require_get(), 1);
var import_isEqual4 = __toESM(require_isEqual(), 1);
var import_omit = __toESM(require_omit(), 1);
var import_sortBy = __toESM(require_sortBy(), 1);
var getCreatedAndModifiedComponents = (allComponents, initialComponents) => {
const componentUIDsToReturn = Object.keys(allComponents).filter((compoUid) => {
const currentCompo = (0, import_get5.default)(allComponents, compoUid, {});
const initialCompo = (0, import_get5.default)(initialComponents, compoUid, {});
const hasComponentBeenCreated = (0, import_get5.default)(currentCompo, [
"isTemporary"
], false);
const hasComponentBeenModified = !(0, import_isEqual4.default)(currentCompo, initialCompo);
return hasComponentBeenCreated || hasComponentBeenModified;
});
return makeUnique(componentUIDsToReturn);
};
var formatComponent = (component, mainDataUID) => {
const formattedAttributes = formatAttributes((0, import_get5.default)(component, "schema.attributes", []), mainDataUID);
const compoUID = (0, import_get5.default)(component, "isTemporary", false) ? {
tmpUID: component.uid
} : {
uid: component.uid
};
const formattedComponent = Object.assign(
{},
compoUID,
{
category: component.category
},
// Omit the attributes since we want to format them
(0, import_omit.default)(component.schema, "attributes"),
// Add the formatted attributes
{
attributes: formattedAttributes
}
);
return formattedComponent;
};
var formatMainDataType = (data, isComponent = false) => {
const mainDataUID = (0, import_get5.default)(data, "uid", null);
const formattedAttributes = formatAttributes((0, import_get5.default)(data, "schema.attributes", []), mainDataUID);
const initObj = isComponent ? {
category: (0, import_get5.default)(data, "category", "")
} : {};
const formattedContentType = Object.assign(initObj, (0, import_omit.default)(data.schema, "attributes"), {
attributes: formattedAttributes
});
delete formattedContentType.uid;
delete formattedContentType.isTemporary;
delete formattedContentType.visible;
delete formattedContentType.restrictRelationsTo;
return formattedContentType;
};
var formatAttributes = (attributes, mainDataUID) => {
return attributes.reduce((acc, { name, ...rest }) => {
const currentAttribute = rest;
const hasARelationWithMainDataUID = currentAttribute.target === mainDataUID;
const isRelationType = currentAttribute.type === "relation";
const currentTargetAttribute = (0, import_get5.default)(currentAttribute, "targetAttribute", null);
if (!hasARelationWithMainDataUID) {
if (isRelationType) {
const relationAttr = Object.assign({}, currentAttribute, {
targetAttribute: formatRelationTargetAttribute(currentTargetAttribute)
});
acc[name] = removeNullKeys(relationAttr);
} else {
acc[name] = removeNullKeys(currentAttribute);
}
}
if (hasARelationWithMainDataUID) {
const target = currentAttribute.target;
const formattedRelationAttribute = Object.assign({}, currentAttribute, {
target,
targetAttribute: formatRelationTargetAttribute(currentTargetAttribute)
});
acc[name] = removeNullKeys(formattedRelationAttribute);
}
if (currentAttribute.customField) {
const customFieldAttribute = {
...currentAttribute,
type: "customField"
};
acc[name] = removeNullKeys(customFieldAttribute);
}
return acc;
}, {});
};
var formatRelationTargetAttribute = (targetAttribute) => targetAttribute === "-" ? null : targetAttribute;
var removeNullKeys = (obj) => Object.keys(obj).reduce((acc, current) => {
if (obj[current] !== null && current !== "plugin") {
acc[current] = obj[current];
}
return acc;
}, {});
var getComponentsToPost = (allComponents, initialComponents, mainDataUID) => {
const componentsToFormat = getCreatedAndModifiedComponents(allComponents, initialComponents);
const formattedComponents = componentsToFormat.map((compoUID) => {
const currentCompo = (0, import_get5.default)(allComponents, compoUID, {});
const formattedComponent = formatComponent(currentCompo, mainDataUID);
return formattedComponent;
});
return formattedComponents;
};
var sortContentType = (types) => (0, import_sortBy.default)(Object.keys(types).map((uid) => ({
visible: types[uid].schema.visible,
name: uid,
title: types[uid].schema.displayName,
plugin: types[uid].plugin || null,
uid,
to: `/plugins/${pluginId}/content-types/${uid}`,
kind: types[uid].schema.kind,
restrictRelationsTo: types[uid].schema.restrictRelationsTo
})).filter((obj) => obj !== null), (obj) => (0, import_camelCase.default)(obj.title));
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/createDataObject.mjs
var createDataObject = (arr) => arr.reduce((acc, current) => {
acc[current.uid] = current;
return acc;
}, {});
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/createModifiedDataSchema.mjs
var import_get6 = __toESM(require_get(), 1);
var createModifiedDataSchema = (contentTypeSchema, retrievedComponents, allComponentsSchema, isInContentTypeView) => {
const componentsAssociatedToContentType = retrievedComponents.reduce((acc, current) => {
const componentSchema = (0, import_get6.default)(allComponentsSchema, current, {});
acc[current] = componentSchema;
return acc;
}, {});
const keyName = isInContentTypeView ? "contentType" : "component";
const schema = {
[keyName]: contentTypeSchema,
components: componentsAssociatedToContentType
};
return schema;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/formatSchemas.mjs
var formatSchemas = (schemas) => {
return Object.keys(schemas).reduce((acc, current) => {
const schema = schemas[current].schema;
acc[current] = {
...schemas[current],
schema: {
...schema,
attributes: toAttributesArray(schema.attributes)
}
};
return acc;
}, {});
};
var toAttributesArray = (attributes) => {
return Object.keys(attributes).reduce((acc, current) => {
acc.push({
...attributes[current],
name: current
});
return acc;
}, []);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.mjs
var import_get7 = __toESM(require_get(), 1);
var retrieveComponentsThatHaveComponents = (allComponents) => {
const componentsThatHaveNestedComponents = Object.keys(allComponents).reduce((acc, current) => {
const currentComponent = (0, import_get7.default)(allComponents, [
current
]);
const compoWithChildren = getComponentWithChildComponents(currentComponent);
if (compoWithChildren.childComponents.length > 0) {
acc.push(compoWithChildren);
}
return acc;
}, []);
return componentsThatHaveNestedComponents;
};
var getComponentWithChildComponents = (component) => {
const attributes = (0, import_get7.default)(component, [
"schema",
"attributes"
], []);
return {
component: component.uid,
childComponents: attributes.filter((attribute) => {
const { type } = attribute;
return type === "component";
}).map((attribute) => {
return {
component: attribute.component
};
})
};
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/retrieveNestedComponents.mjs
var retrieveNestedComponents = (appComponents) => {
const nestedComponents = Object.keys(appComponents).reduce((acc, current) => {
var _a, _b;
const componentAttributes = ((_b = (_a = appComponents == null ? void 0 : appComponents[current]) == null ? void 0 : _a.schema) == null ? void 0 : _b.attributes) ?? [];
const currentComponentNestedCompos = getComponentsNestedWithinComponent(componentAttributes, current);
return [
...acc,
...currentComponentNestedCompos
];
}, []);
return mergeComponents(nestedComponents);
};
var getComponentsNestedWithinComponent = (componentAttributes, parentCompoUid) => {
return componentAttributes.reduce((acc, current) => {
const { type, component } = current;
if (type === "component") {
acc.push({
component,
parentCompoUid
});
}
return acc;
}, []);
};
var mergeComponents = (originalComponents) => {
const componentMap = /* @__PURE__ */ new Map();
originalComponents.forEach(({ component, parentCompoUid }) => {
if (!componentMap.has(component)) {
componentMap.set(component, /* @__PURE__ */ new Set());
}
componentMap.get(component).add(parentCompoUid);
});
const transformedComponents = Array.from(componentMap.entries()).map(([component, parentCompoUidSet]) => ({
component,
uidsOfAllParents: Array.from(parentCompoUidSet)
}));
return transformedComponents;
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.mjs
var import_get8 = __toESM(require_get(), 1);
var retrieveSpecificInfoFromComponents = (allComponents, keysToRetrieve) => {
const allData = Object.keys(allComponents).map((compo) => {
return (0, import_get8.default)(allComponents, [
compo,
...keysToRetrieve
], "");
});
return makeUnique(allData);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/serverRestartWatcher.mjs
var SERVER_HAS_NOT_BEEN_KILLED_MESSAGE = "did-not-kill-server";
var SERVER_HAS_BEEN_KILLED_MESSAGE = "server is down";
function serverRestartWatcher(response, didShutDownServer) {
return new Promise((resolve) => {
fetch(`${window.strapi.backendURL}/_health`, {
method: "HEAD",
mode: "no-cors",
headers: {
"Content-Type": "application/json",
"Keep-Alive": "false"
}
}).then((res) => {
if (res.status >= 400) {
throw new Error(SERVER_HAS_BEEN_KILLED_MESSAGE);
}
if (!didShutDownServer) {
throw new Error(SERVER_HAS_NOT_BEEN_KILLED_MESSAGE);
}
resolve(response);
}).catch((err) => {
setTimeout(() => {
return serverRestartWatcher(response, err.message !== SERVER_HAS_NOT_BEEN_KILLED_MESSAGE).then(resolve);
}, 100);
});
});
}
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/utils/validateSchema.mjs
var validateSchema = (schema) => {
const dynamicZoneAttributes = Object.values(schema.attributes).filter((attribute) => attribute.type === "dynamiczone");
return dynamicZoneAttributes.every((attribute) => Array.isArray(attribute.components) && attribute.components.length > 0);
};
// node_modules/@strapi/content-type-builder/dist/admin/components/DataManagerProvider/DataManagerProvider.mjs
var DataManagerProvider = ({ children }) => {
const dispatch = useDispatch();
const { components, contentTypes, isLoading, initialData, modifiedData, reservedNames } = useSelector(makeSelectDataManagerProvider());
const { toggleNotification } = useNotification();
const { lockAppWithAutoreload, unlockAppWithAutoreload } = useAutoReloadOverlayBlocker();
const { setCurrentStep, setStepState } = useGuidedTour("DataManagerProvider", (state) => state);
const getPlugin = useStrapiApp("DataManagerProvider", (state) => state.getPlugin);
const plugin = getPlugin(pluginId);
const autoReload = useAppInfo("DataManagerProvider", (state) => state.autoReload);
const { formatMessage } = useIntl();
const { trackUsage } = useTracking();
const refetchPermissions = useAuth("DataManagerProvider", (state) => state.refetchPermissions);
const { pathname } = useLocation();
const { onCloseModal } = useFormModalNavigation();
const contentTypeMatch = useMatch(`/plugins/${pluginId}/content-types/:uid`);
const componentMatch = useMatch(`/plugins/${pluginId}/component-categories/:categoryUid/:componentUid`);
const fetchClient = useFetchClient();
const { put, post, del } = fetchClient;
const isInDevelopmentMode = autoReload;
const isInContentTypeView = contentTypeMatch !== null;
const firstKeyToMainSchema = isInContentTypeView ? "contentType" : "component";
const currentUid = isInContentTypeView ? (0, import_get9.default)(contentTypeMatch, "params.uid", null) : (0, import_get9.default)(componentMatch, "params.componentUid", null);
const getDataRef = (0, import_react10.useRef)();
const endPoint = isInContentTypeView ? "content-types" : "components";
getDataRef.current = async () => {
try {
const [componentsResponse, contentTypesResponse, reservedNamesResponse] = await Promise.all([
fetchClient.get(`/content-type-builder/components`),
fetchClient.get(`/content-type-builder/content-types`),
fetchClient.get(`/content-type-builder/reserved-names`)
]);
const components2 = createDataObject(componentsResponse.data.data);
const formattedComponents = formatSchemas(components2);
const contentTypes2 = createDataObject(contentTypesResponse.data.data);
const formattedContentTypes = formatSchemas(contentTypes2);
dispatch(actions.init({
components: formattedComponents,
contentTypes: formattedContentTypes,
reservedNames: reservedNamesResponse.data
}));
} catch (err) {
console.error({
err
});
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.error",
defaultMessage: "An error occurred"
})
});
}
};
(0, import_react10.useEffect)(() => {
getDataRef.current();
return () => {
dispatch(actions.reloadPlugin());
};
}, []);
(0, import_react10.useEffect)(() => {
if (!isLoading && currentUid) {
setModifiedData();
}
}, [
isLoading,
pathname,
currentUid
]);
(0, import_react10.useEffect)(() => {
if (!autoReload) {
toggleNotification({
type: "info",
message: formatMessage({
id: getTrad("notification.info.autoreaload-disable")
})
});
}
}, [
autoReload,
toggleNotification,
formatMessage
]);
const addAttribute = (attributeToSet, forTarget, targetUid, isEditing = false, initialAttribute, shouldAddComponentToData = false) => {
if (isEditing) {
const payload = {
attributeToSet,
forTarget,
targetUid,
// NOTE: using ! here to avoid changing the code logic before bigger refactorings
initialAttribute,
shouldAddComponentToData
};
dispatch(actions.editAttribute(payload));
} else {
const payload = {
attributeToSet,
forTarget,
targetUid,
shouldAddComponentToData
};
dispatch(actions.addAttribute(payload));
}
};
const addCustomFieldAttribute = ({ attributeToSet, forTarget, targetUid }) => {
dispatch(actions.addCustomFieldAttribute({
attributeToSet,
forTarget,
targetUid
}));
};
const editCustomFieldAttribute = ({ attributeToSet, forTarget, targetUid, initialAttribute }) => {
dispatch(actions.editCustomFieldAttribute({
attributeToSet,
forTarget,
targetUid,
initialAttribute
}));
};
const addCreatedComponentToDynamicZone = (dynamicZoneTarget, componentsToAdd) => {
dispatch(actions.addCreatedComponentToDynamicZone({
dynamicZoneTarget,
componentsToAdd
}));
};
const createSchema = (data, schemaType, uid, componentCategory, shouldAddComponentToData = false) => {
if (schemaType === "contentType") {
const payload = {
data,
uid
};
dispatch(actions.createSchema(payload));
} else {
const payload = {
data,
uid,
componentCategory,
shouldAddComponentToData
};
dispatch(actions.createComponentSchema(payload));
}
};
const changeDynamicZoneComponents = (dynamicZoneTarget, newComponents) => {
dispatch(actions.changeDynamicZoneComponents({
dynamicZoneTarget,
newComponents
}));
};
const removeAttribute = (mainDataKey, attributeToRemoveName, componentUid = "") => {
if (mainDataKey === "components") {
dispatch(actions.removeFieldFromDisplayedComponent({
attributeToRemoveName,
componentUid
}));
} else {
if (mainDataKey === "contentType") {
trackUsage("willDeleteFieldOfContentType");
}
dispatch(actions.removeField({
mainDataKey,
attributeToRemoveName
}));
}
};
const deleteCategory = async (categoryUid) => {
try {
const requestURL = `/${pluginId}/component-categories/${categoryUid}`;
const userConfirm = window.confirm(formatMessage({
id: getTrad("popUpWarning.bodyMessage.category.delete")
}));
onCloseModal();
if (userConfirm) {
lockAppWithAutoreload == null ? void 0 : lockAppWithAutoreload();
await del(requestURL);
await serverRestartWatcher(true);
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
await updatePermissions();
}
} catch (err) {
console.error({
err
});
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.error",
defaultMessage: "An error occurred"
})
});
} finally {
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
}
};
const deleteData = async () => {
try {
const requestURL = `/${pluginId}/${endPoint}/${currentUid}`;
const isTemporary = (0, import_get9.default)(modifiedData, [
firstKeyToMainSchema,
"isTemporary"
], false);
const userConfirm = window.confirm(formatMessage({
id: getTrad(`popUpWarning.bodyMessage.${isInContentTypeView ? "contentType" : "component"}.delete`)
}));
onCloseModal();
if (userConfirm) {
if (isTemporary) {
dispatch(actions.deleteNotSavedType());
return;
}
lockAppWithAutoreload == null ? void 0 : lockAppWithAutoreload();
await del(requestURL);
await serverRestartWatcher(true);
await (unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload());
await getDataRef.current();
await updatePermissions();
}
} catch (err) {
console.error({
err
});
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.error",
defaultMessage: "An error occurred"
})
});
} finally {
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
}
};
const editCategory = async (categoryUid, body) => {
try {
const requestURL = `/${pluginId}/component-categories/${categoryUid}`;
onCloseModal();
lockAppWithAutoreload == null ? void 0 : lockAppWithAutoreload();
await put(requestURL, body);
await serverRestartWatcher(true);
await (unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload());
await updatePermissions();
} catch (err) {
console.error({
err
});
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.error",
defaultMessage: "An error occurred"
})
});
} finally {
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
}
};
const getAllComponentsThatHaveAComponentInTheirAttributes = () => {
const allCompos = Object.assign({}, components, modifiedData.components);
if (!isInContentTypeView) {
const currentEditedCompo = (0, import_get9.default)(modifiedData, "component", {});
(0, import_set2.default)(allCompos, (0, import_get9.default)(currentEditedCompo, [
"uid"
], ""), currentEditedCompo);
}
const composWithCompos = retrieveComponentsThatHaveComponents(allCompos);
return composWithCompos;
};
const getAllNestedComponents = () => {
const appNestedCompo = retrieveNestedComponents(components);
return appNestedCompo;
};
const removeComponentFromDynamicZone = (dzName, componentToRemoveIndex) => {
dispatch(actions.removeComponentFromDynamicZone({
dzName,
componentToRemoveIndex
}));
};
const setModifiedData = () => {
const currentSchemas = isInContentTypeView ? contentTypes : components;
const schemaToSet = (0, import_get9.default)(currentSchemas, currentUid ?? "", {
schema: {
attributes: []
}
});
const retrievedComponents = retrieveComponentsFromSchema(schemaToSet.schema.attributes, components);
const newSchemaToSet = createModifiedDataSchema(schemaToSet, retrievedComponents, components, isInContentTypeView);
const hasJustCreatedSchema = (0, import_get9.default)(schemaToSet, "isTemporary", false) && (0, import_size.default)((0, import_get9.default)(schemaToSet, "schema.attributes", [])) === 0;
dispatch(actions.setModifiedData({
schemaToSet: newSchemaToSet,
hasJustCreatedSchema
}));
};
const shouldRedirect = (0, import_react10.useMemo)(() => {
const dataSet = isInContentTypeView ? contentTypes : components;
if (currentUid === "create-content-type") {
return false;
}
return !Object.keys(dataSet).includes(currentUid || "") && !isLoading;
}, [
components,
contentTypes,
currentUid,
isInContentTypeView,
isLoading
]);
const redirectEndpoint = (0, import_react10.useMemo)(() => {
const allowedEndpoints = Object.keys(contentTypes).filter((uid) => (0, import_get9.default)(contentTypes, [
uid,
"schema",
"visible"
], true)).sort();
return (0, import_get9.default)(allowedEndpoints, "0", "create-content-type");
}, [
contentTypes
]);
if (shouldRedirect) {
return (0, import_jsx_runtime34.jsx)(Navigate, {
to: `/plugins/${pluginId}/content-types/${redirectEndpoint}`
});
}
const submitData = async (additionalContentTypeData) => {
var _a, _b, _c;
try {
const isCreating = (0, import_get9.default)(modifiedData, [
firstKeyToMainSchema,
"isTemporary"
], false);
const body = {
components: getComponentsToPost(modifiedData.components, components, currentUid)
};
if (isInContentTypeView) {
const PluginForms = (_a = plugin == null ? void 0 : plugin.apis) == null ? void 0 : _a.forms;
const contentType = PluginForms.mutateContentTypeSchema({
...formatMainDataType(modifiedData.contentType),
...additionalContentTypeData
}, initialData.contentType);
const isValidSchema = validateSchema(contentType);
if (!isValidSchema) {
toggleNotification({
type: "danger",
message: formatMessage({
id: getTrad("notification.error.dynamiczone-min.validation"),
defaultMessage: "At least one component is required in a dynamic zone to be able to save a content type"
})
});
return;
}
body.contentType = contentType;
trackUsage("willSaveContentType");
} else {
body.component = formatMainDataType(modifiedData.component, true);
trackUsage("willSaveComponent");
}
lockAppWithAutoreload == null ? void 0 : lockAppWithAutoreload();
const baseURL = `/${pluginId}/${endPoint}`;
const requestURL = isCreating ? baseURL : `${baseURL}/${currentUid}`;
if (isCreating) {
await post(requestURL, body);
} else {
await put(requestURL, body);
}
if (isCreating && (((_b = initialData.contentType) == null ? void 0 : _b.schema.kind) === "collectionType" || ((_c = initialData.contentType) == null ? void 0 : _c.schema.kind) === "singleType")) {
setStepState("contentTypeBuilder.success", true);
trackUsage("didCreateGuidedTourCollectionType");
setCurrentStep(null);
}
if (isInContentTypeView) {
trackUsage("didSaveContentType");
const oldName = (0, import_get9.default)(body, [
"contentType",
"schema",
"name"
], "");
const newName = (0, import_get9.default)(initialData, [
"contentType",
"schema",
"name"
], "");
if (!isCreating && oldName !== newName) {
trackUsage("didEditNameOfContentType");
}
} else {
trackUsage("didSaveComponent");
}
await serverRestartWatcher(true);
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
await getDataRef.current();
await updatePermissions();
} catch (err) {
if (!isInContentTypeView) {
trackUsage("didNotSaveComponent");
}
console.error({
err: err.response
});
toggleNotification({
type: "danger",
message: formatMessage({
id: "notification.error",
defaultMessage: "An error occurred"
})
});
} finally {
unlockAppWithAutoreload == null ? void 0 : unlockAppWithAutoreload();
}
};
const updatePermissions = async () => {
await refetchPermissions();
};
const updateSchema = (data, schemaType, componentUID) => {
dispatch(actions.updateSchema({
data,
schemaType,
uid: componentUID
}));
};
return (0, import_jsx_runtime34.jsxs)(DataManagerContext.Provider, {
value: {
addAttribute,
addCustomFieldAttribute,
addCreatedComponentToDynamicZone,
allComponentsCategories: retrieveSpecificInfoFromComponents(components, [
"category"
]),
changeDynamicZoneComponents,
components,
componentsGroupedByCategory: (0, import_groupBy.default)(components, "category"),
componentsThatHaveOtherComponentInTheirAttributes: getAllComponentsThatHaveAComponentInTheirAttributes(),
contentTypes,
createSchema,
deleteCategory,
deleteData,
editCategory,
editCustomFieldAttribute,
isInDevelopmentMode,
initialData,
isInContentTypeView,
modifiedData,
nestedComponents: getAllNestedComponents(),
removeAttribute,
removeComponentFromDynamicZone,
reservedNames,
setModifiedData,
sortedContentTypesList: sortContentType(contentTypes),
submitData,
updateSchema
},
children: [
children,
isInDevelopmentMode && (0, import_jsx_runtime34.jsx)(FormModal, {})
]
});
};
var DataManagerProvider$1 = (0, import_react10.memo)(DataManagerProvider);
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.mjs
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
var React3 = __toESM(require_react(), 1);
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalNavigationProvider/constants.mjs
var INITIAL_STATE_DATA = {
actionType: null,
attributeName: null,
attributeType: null,
categoryName: null,
dynamicZoneTarget: null,
forTarget: null,
modalType: null,
isOpen: false,
showBackLink: false,
kind: null,
step: null,
targetUid: null,
customFieldUid: null,
activeTab: "basic"
};
// node_modules/@strapi/content-type-builder/dist/admin/components/FormModalNavigationProvider/FormModalNavigationProvider.mjs
var FormModalNavigationProvider = ({ children }) => {
const [state, setFormModalNavigationState] = React3.useState(INITIAL_STATE_DATA);
const { trackUsage } = useTracking();
const onClickSelectCustomField = ({ attributeType, customFieldUid }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
actionType: "create",
modalType: "customField",
attributeType,
customFieldUid,
activeTab: "basic"
};
});
};
const onClickSelectField = ({ attributeType, step }) => {
if (state.forTarget === "contentType") {
trackUsage("didSelectContentTypeFieldType", {
type: attributeType
});
}
setFormModalNavigationState((prevState) => {
return {
...prevState,
actionType: "create",
modalType: "attribute",
step,
attributeType,
showBackLink: true,
activeTab: "basic"
};
});
};
const onOpenModalAddComponentsToDZ = ({ dynamicZoneTarget, targetUid }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
dynamicZoneTarget,
targetUid,
modalType: "addComponentToDynamicZone",
forTarget: "contentType",
step: "1",
actionType: "edit",
isOpen: true
};
});
};
const onOpenModalAddField = ({ forTarget, targetUid }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
actionType: "create",
forTarget,
targetUid,
modalType: "chooseAttribute",
isOpen: true,
showBackLink: false,
activeTab: "basic"
};
});
};
const onOpenModalCreateSchema = (nextState) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
...nextState,
isOpen: true,
activeTab: "basic"
};
});
};
const onOpenModalEditCategory = (categoryName) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
categoryName,
actionType: "edit",
modalType: "editCategory",
isOpen: true,
activeTab: "basic"
};
});
};
const onOpenModalEditCustomField = ({ forTarget, targetUid, attributeName, attributeType, customFieldUid }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
modalType: "customField",
customFieldUid,
actionType: "edit",
forTarget,
targetUid,
attributeName,
attributeType,
isOpen: true,
activeTab: "basic"
};
});
};
const onOpenModalEditField = ({ forTarget, targetUid, attributeName, attributeType, step }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
modalType: "attribute",
actionType: "edit",
forTarget,
targetUid,
attributeName,
attributeType,
step,
isOpen: true
};
});
};
const onOpenModalEditSchema = ({ modalType, forTarget, targetUid, kind }) => {
setFormModalNavigationState((prevState) => {
return {
...prevState,
modalType,
actionType: "edit",
forTarget,
targetUid,
kind,
isOpen: true,
activeTab: "basic"
};
});
};
const onCloseModal = () => {
setFormModalNavigationState(INITIAL_STATE_DATA);
};
const onNavigateToChooseAttributeModal = ({ forTarget, targetUid }) => {
setFormModalNavigationState((prev) => {
return {
...prev,
forTarget,
targetUid,
modalType: "chooseAttribute",
activeTab: "basic"
};
});
};
const onNavigateToCreateComponentStep2 = () => {
setFormModalNavigationState((prev) => {
return {
...prev,
attributeType: "component",
modalType: "attribute",
step: "2",
activeTab: "basic"
};
});
};
const onNavigateToAddCompoToDZModal = ({ dynamicZoneTarget }) => {
setFormModalNavigationState((prev) => {
return {
...prev,
dynamicZoneTarget,
modalType: "addComponentToDynamicZone",
actionType: "create",
step: "1",
attributeType: null,
attributeName: null,
activeTab: "basic"
};
});
};
const setActiveTab = (value) => {
setFormModalNavigationState((prev) => {
return {
...prev,
activeTab: value
};
});
};
return (0, import_jsx_runtime35.jsx)(FormModalNavigationContext.Provider, {
value: {
...state,
onClickSelectField,
onClickSelectCustomField,
onCloseModal,
onNavigateToChooseAttributeModal,
onNavigateToAddCompoToDZModal,
onOpenModalAddComponentsToDZ,
onNavigateToCreateComponentStep2,
onOpenModalAddField,
onOpenModalCreateSchema,
onOpenModalEditCategory,
onOpenModalEditField,
onOpenModalEditCustomField,
onOpenModalEditSchema,
setFormModalNavigationState,
setActiveTab
},
children
});
};
// node_modules/@strapi/content-type-builder/dist/admin/pages/App/index.mjs
var ListView = (0, import_react11.lazy)(() => import("./ListView-M4MMRMSH.js"));
var App = () => {
const { formatMessage } = useIntl();
const title = formatMessage({
id: `${pluginId}.plugin.name`,
defaultMessage: "Content Types Builder"
});
const startSection = useGuidedTour("App", (state) => state.startSection);
const startSectionRef = (0, import_react11.useRef)(startSection);
(0, import_react11.useEffect)(() => {
if (startSectionRef.current) {
startSectionRef.current("contentTypeBuilder");
}
}, []);
return (0, import_jsx_runtime36.jsxs)(Page.Protect, {
permissions: PERMISSIONS.main,
children: [
(0, import_jsx_runtime36.jsx)(Page.Title, {
children: title
}),
(0, import_jsx_runtime36.jsx)(AutoReloadOverlayBlockerProvider, {
children: (0, import_jsx_runtime36.jsx)(FormModalNavigationProvider, {
children: (0, import_jsx_runtime36.jsx)(DataManagerProvider$1, {
children: (0, import_jsx_runtime36.jsx)(Layouts.Root, {
sideNav: (0, import_jsx_runtime36.jsx)(ContentTypeBuilderNav, {}),
children: (0, import_jsx_runtime36.jsx)(import_react11.Suspense, {
fallback: (0, import_jsx_runtime36.jsx)(Page.Loading, {}),
children: (0, import_jsx_runtime36.jsxs)(Routes, {
children: [
(0, import_jsx_runtime36.jsx)(Route, {
path: "content-types/:uid",
element: (0, import_jsx_runtime36.jsx)(ListView, {})
}),
(0, import_jsx_runtime36.jsx)(Route, {
path: `component-categories/:categoryUid/:componentUid`,
element: (0, import_jsx_runtime36.jsx)(ListView, {})
})
]
})
})
})
})
})
})
]
});
};
export {
App as default
};
/*! Bundled license information:
lodash/lodash.min.js:
(**
* @license
* Lodash
* Copyright OpenJS Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*)
*/
//# sourceMappingURL=App-H27Y6V6P.js.map