@pie-element/categorize 13.2.0-beta.0 → 13.2.0-next.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/configure.js +2 -0
  2. package/controller.js +1 -0
  3. package/dist/author/defaults.d.ts +222 -0
  4. package/dist/author/defaults.js +168 -0
  5. package/dist/author/design/builder.d.ts +10 -0
  6. package/dist/author/design/builder.js +24 -0
  7. package/dist/author/design/buttons.d.ts +28 -0
  8. package/dist/author/design/buttons.js +36 -0
  9. package/dist/author/design/categories/RowLabel.d.ts +23 -0
  10. package/dist/author/design/categories/RowLabel.js +47 -0
  11. package/dist/author/design/categories/alternateResponses.d.ts +31 -0
  12. package/dist/author/design/categories/alternateResponses.js +62 -0
  13. package/dist/author/design/categories/category.d.ts +44 -0
  14. package/dist/author/design/categories/category.js +98 -0
  15. package/dist/author/design/categories/choice-preview.d.ts +25 -0
  16. package/dist/author/design/categories/choice-preview.js +60 -0
  17. package/dist/author/design/categories/droppable-placeholder.d.ts +11 -0
  18. package/dist/author/design/categories/droppable-placeholder.js +71 -0
  19. package/dist/author/design/categories/index.d.ts +41 -0
  20. package/dist/author/design/categories/index.js +146 -0
  21. package/dist/author/design/choices/choice.d.ts +11 -0
  22. package/dist/author/design/choices/choice.js +129 -0
  23. package/dist/author/design/choices/config.d.ts +21 -0
  24. package/dist/author/design/choices/config.js +33 -0
  25. package/dist/author/design/choices/index.d.ts +41 -0
  26. package/dist/author/design/choices/index.js +110 -0
  27. package/dist/author/design/header.d.ts +24 -0
  28. package/dist/author/design/header.js +49 -0
  29. package/dist/author/design/index.d.ts +52 -0
  30. package/dist/author/design/index.js +427 -0
  31. package/dist/author/design/input-header.d.ts +39 -0
  32. package/dist/author/design/input-header.js +69 -0
  33. package/dist/author/design/utils.d.ts +9 -0
  34. package/dist/author/design/utils.js +7 -0
  35. package/dist/author/index.d.ts +50 -0
  36. package/dist/author/index.js +87 -0
  37. package/dist/author/main.d.ts +23 -0
  38. package/dist/author/main.js +30 -0
  39. package/dist/author/utils.d.ts +16 -0
  40. package/dist/author/utils.js +17 -0
  41. package/dist/browser/alert-dialog-BL9K_lnF.js +11511 -0
  42. package/dist/browser/alert-dialog-BL9K_lnF.js.map +1 -0
  43. package/dist/browser/author/index.js +43156 -0
  44. package/dist/browser/author/index.js.map +1 -0
  45. package/dist/browser/categorize.css +2 -0
  46. package/dist/browser/controller/index.js +372 -0
  47. package/dist/browser/controller/index.js.map +1 -0
  48. package/dist/browser/delivery/index.js +1205 -0
  49. package/dist/browser/delivery/index.js.map +1 -0
  50. package/dist/browser/dist-C11U2GIc.js +1871 -0
  51. package/dist/browser/dist-C11U2GIc.js.map +1 -0
  52. package/dist/browser/rolldown-runtime-CWhphoD1.js +32 -0
  53. package/dist/controller/defaults.d.ts +33 -0
  54. package/dist/controller/defaults.js +27 -0
  55. package/dist/controller/index.d.ts +62 -0
  56. package/dist/controller/index.js +168 -0
  57. package/dist/controller/utils.d.ts +20 -0
  58. package/dist/controller/utils.js +35 -0
  59. package/dist/delivery/categorize/__tests__/categories.test.d.ts +1 -0
  60. package/dist/delivery/categorize/__tests__/category.test.d.ts +1 -0
  61. package/dist/delivery/categorize/__tests__/choice.test.d.ts +1 -0
  62. package/dist/delivery/categorize/__tests__/choices.test.d.ts +1 -0
  63. package/dist/delivery/categorize/__tests__/droppable-placeholder.test.d.ts +1 -0
  64. package/dist/delivery/categorize/__tests__/grid-content.test.d.ts +1 -0
  65. package/dist/delivery/categorize/__tests__/index.test.d.ts +1 -0
  66. package/dist/delivery/categorize/__tests__/keyboard-coordinates.test.d.ts +1 -0
  67. package/dist/delivery/categorize/categories.d.ts +37 -0
  68. package/dist/delivery/categorize/categories.js +72 -0
  69. package/dist/delivery/categorize/category.d.ts +31 -0
  70. package/dist/delivery/categorize/category.js +55 -0
  71. package/dist/delivery/categorize/choice.d.ts +28 -0
  72. package/dist/delivery/categorize/choice.js +114 -0
  73. package/dist/delivery/categorize/choices.d.ts +42 -0
  74. package/dist/delivery/categorize/choices.js +58 -0
  75. package/dist/delivery/categorize/droppable-placeholder.d.ts +36 -0
  76. package/dist/delivery/categorize/droppable-placeholder.js +77 -0
  77. package/dist/delivery/categorize/grid-content.d.ts +25 -0
  78. package/dist/delivery/categorize/grid-content.js +39 -0
  79. package/dist/delivery/categorize/index.d.ts +70 -0
  80. package/dist/delivery/categorize/index.js +317 -0
  81. package/dist/delivery/categorize/keyboard-coordinates.d.ts +22 -0
  82. package/dist/delivery/categorize/keyboard-coordinates.js +49 -0
  83. package/dist/delivery/index.d.ts +27 -0
  84. package/dist/delivery/index.js +152 -0
  85. package/dist/index.d.ts +1 -0
  86. package/dist/index.iife.d.ts +8 -0
  87. package/dist/index.iife.js +152 -0
  88. package/dist/index.js +2 -0
  89. package/dist/runtime-support.d.ts +12 -0
  90. package/dist/runtime-support.js +12 -0
  91. package/package.json +97 -22
  92. package/CHANGELOG.json +0 -1637
  93. package/CHANGELOG.md +0 -2551
  94. package/LICENSE.md +0 -5
  95. package/README.md +0 -5
  96. package/configure/CHANGELOG.json +0 -1202
  97. package/configure/CHANGELOG.md +0 -2130
  98. package/configure/lib/__tests__/main.test.js +0 -100
  99. package/configure/lib/__tests__/utils.js +0 -39
  100. package/configure/lib/defaults.js +0 -220
  101. package/configure/lib/defaults.js.map +0 -1
  102. package/configure/lib/design/__tests__/builder.test.js +0 -34
  103. package/configure/lib/design/__tests__/buttons.test.js +0 -36
  104. package/configure/lib/design/__tests__/header.test.js +0 -37
  105. package/configure/lib/design/__tests__/index.test.js +0 -269
  106. package/configure/lib/design/__tests__/input-header.test.js +0 -41
  107. package/configure/lib/design/builder.js +0 -55
  108. package/configure/lib/design/builder.js.map +0 -1
  109. package/configure/lib/design/buttons.js +0 -59
  110. package/configure/lib/design/buttons.js.map +0 -1
  111. package/configure/lib/design/categories/RowLabel.js +0 -66
  112. package/configure/lib/design/categories/RowLabel.js.map +0 -1
  113. package/configure/lib/design/categories/__tests__/alternateResponses.test.js +0 -93
  114. package/configure/lib/design/categories/__tests__/category.test.js +0 -65
  115. package/configure/lib/design/categories/__tests__/choice-preview.test.js +0 -52
  116. package/configure/lib/design/categories/__tests__/droppable-placeholder.test.js +0 -63
  117. package/configure/lib/design/categories/__tests__/index.test.js +0 -91
  118. package/configure/lib/design/categories/alternateResponses.js +0 -116
  119. package/configure/lib/design/categories/alternateResponses.js.map +0 -1
  120. package/configure/lib/design/categories/category.js +0 -153
  121. package/configure/lib/design/categories/category.js.map +0 -1
  122. package/configure/lib/design/categories/choice-preview.js +0 -79
  123. package/configure/lib/design/categories/choice-preview.js.map +0 -1
  124. package/configure/lib/design/categories/droppable-placeholder.js +0 -93
  125. package/configure/lib/design/categories/droppable-placeholder.js.map +0 -1
  126. package/configure/lib/design/categories/index.js +0 -256
  127. package/configure/lib/design/categories/index.js.map +0 -1
  128. package/configure/lib/design/choices/__tests__/choice.test.js +0 -62
  129. package/configure/lib/design/choices/__tests__/config.test.js +0 -66
  130. package/configure/lib/design/choices/__tests__/index.test.js +0 -70
  131. package/configure/lib/design/choices/choice.js +0 -187
  132. package/configure/lib/design/choices/choice.js.map +0 -1
  133. package/configure/lib/design/choices/config.js +0 -58
  134. package/configure/lib/design/choices/config.js.map +0 -1
  135. package/configure/lib/design/choices/index.js +0 -197
  136. package/configure/lib/design/choices/index.js.map +0 -1
  137. package/configure/lib/design/header.js +0 -71
  138. package/configure/lib/design/header.js.map +0 -1
  139. package/configure/lib/design/index.js +0 -741
  140. package/configure/lib/design/index.js.map +0 -1
  141. package/configure/lib/design/input-header.js +0 -105
  142. package/configure/lib/design/input-header.js.map +0 -1
  143. package/configure/lib/design/utils.js +0 -12
  144. package/configure/lib/design/utils.js.map +0 -1
  145. package/configure/lib/index.js +0 -148
  146. package/configure/lib/index.js.map +0 -1
  147. package/configure/lib/main.js +0 -44
  148. package/configure/lib/main.js.map +0 -1
  149. package/configure/lib/utils.js +0 -43
  150. package/configure/lib/utils.js.map +0 -1
  151. package/configure/package.json +0 -32
  152. package/controller/CHANGELOG.json +0 -452
  153. package/controller/CHANGELOG.md +0 -1384
  154. package/controller/lib/__tests__/index.test.js +0 -526
  155. package/controller/lib/defaults.js +0 -31
  156. package/controller/lib/defaults.js.map +0 -1
  157. package/controller/lib/index.js +0 -506
  158. package/controller/lib/index.js.map +0 -1
  159. package/controller/lib/utils.js +0 -69
  160. package/controller/lib/utils.js.map +0 -1
  161. package/controller/package.json +0 -18
  162. package/docs/config-schema.json +0 -2897
  163. package/docs/config-schema.json.md +0 -2138
  164. package/docs/demo/.pie/.configure/package.json +0 -10
  165. package/docs/demo/.pie/.configure/yarn.lock +0 -2122
  166. package/docs/demo/.pie/.controllers/package.json +0 -10
  167. package/docs/demo/.pie/.controllers/yarn.lock +0 -110
  168. package/docs/demo/.pie/info.entry.js +0 -89
  169. package/docs/demo/.pie/info.webpack.config.js +0 -119
  170. package/docs/demo/.pie/package.json +0 -10
  171. package/docs/demo/.pie/yarn.lock +0 -2137
  172. package/docs/demo/config.js +0 -8
  173. package/docs/demo/generate.js +0 -357
  174. package/docs/demo/index.html +0 -1
  175. package/docs/demo/pie.manifest.json +0 -11
  176. package/docs/demo/session.js +0 -12
  177. package/docs/pie-schema.json +0 -1784
  178. package/docs/pie-schema.json.md +0 -1046
  179. package/lib/__tests__/index.test.js +0 -197
  180. package/lib/categorize/__tests__/categories.test.js +0 -138
  181. package/lib/categorize/__tests__/category.test.js +0 -137
  182. package/lib/categorize/__tests__/choice.test.js +0 -88
  183. package/lib/categorize/__tests__/choices.test.js +0 -118
  184. package/lib/categorize/__tests__/droppable-placeholder.test.js +0 -96
  185. package/lib/categorize/__tests__/grid-content.test.js +0 -48
  186. package/lib/categorize/__tests__/index.test.js +0 -250
  187. package/lib/categorize/categories.js +0 -135
  188. package/lib/categorize/categories.js.map +0 -1
  189. package/lib/categorize/category.js +0 -67
  190. package/lib/categorize/category.js.map +0 -1
  191. package/lib/categorize/choice.js +0 -140
  192. package/lib/categorize/choice.js.map +0 -1
  193. package/lib/categorize/choices.js +0 -99
  194. package/lib/categorize/choices.js.map +0 -1
  195. package/lib/categorize/droppable-placeholder.js +0 -84
  196. package/lib/categorize/droppable-placeholder.js.map +0 -1
  197. package/lib/categorize/grid-content.js +0 -55
  198. package/lib/categorize/grid-content.js.map +0 -1
  199. package/lib/categorize/index.js +0 -450
  200. package/lib/categorize/index.js.map +0 -1
  201. package/lib/index.js +0 -316
  202. package/lib/index.js.map +0 -1
@@ -0,0 +1,1871 @@
1
+ import { i as e, t } from "./rolldown-runtime-CWhphoD1.js";
2
+ //#region ../../../node_modules/.bun/ms@2.1.3/node_modules/ms/index.js
3
+ var n = /* @__PURE__ */ t(((e, t) => {
4
+ var n = 1e3, r = n * 60, i = r * 60, a = i * 24, o = a * 7, s = a * 365.25;
5
+ t.exports = function(e, t) {
6
+ t ||= {};
7
+ var n = typeof e;
8
+ if (n === "string" && e.length > 0) return c(e);
9
+ if (n === "number" && isFinite(e)) return t.long ? u(e) : l(e);
10
+ throw Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e));
11
+ };
12
+ function c(e) {
13
+ if (e = String(e), !(e.length > 100)) {
14
+ var t = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);
15
+ if (t) {
16
+ var c = parseFloat(t[1]);
17
+ switch ((t[2] || "ms").toLowerCase()) {
18
+ case "years":
19
+ case "year":
20
+ case "yrs":
21
+ case "yr":
22
+ case "y": return c * s;
23
+ case "weeks":
24
+ case "week":
25
+ case "w": return c * o;
26
+ case "days":
27
+ case "day":
28
+ case "d": return c * a;
29
+ case "hours":
30
+ case "hour":
31
+ case "hrs":
32
+ case "hr":
33
+ case "h": return c * i;
34
+ case "minutes":
35
+ case "minute":
36
+ case "mins":
37
+ case "min":
38
+ case "m": return c * r;
39
+ case "seconds":
40
+ case "second":
41
+ case "secs":
42
+ case "sec":
43
+ case "s": return c * n;
44
+ case "milliseconds":
45
+ case "millisecond":
46
+ case "msecs":
47
+ case "msec":
48
+ case "ms": return c;
49
+ default: return;
50
+ }
51
+ }
52
+ }
53
+ }
54
+ function l(e) {
55
+ var t = Math.abs(e);
56
+ return t >= a ? Math.round(e / a) + "d" : t >= i ? Math.round(e / i) + "h" : t >= r ? Math.round(e / r) + "m" : t >= n ? Math.round(e / n) + "s" : e + "ms";
57
+ }
58
+ function u(e) {
59
+ var t = Math.abs(e);
60
+ return t >= a ? d(e, t, a, "day") : t >= i ? d(e, t, i, "hour") : t >= r ? d(e, t, r, "minute") : t >= n ? d(e, t, n, "second") : e + " ms";
61
+ }
62
+ function d(e, t, n, r) {
63
+ var i = t >= n * 1.5;
64
+ return Math.round(e / n) + " " + r + (i ? "s" : "");
65
+ }
66
+ })), r = /* @__PURE__ */ t(((e, t) => {
67
+ function r(e) {
68
+ r.debug = r, r.default = r, r.coerce = l, r.disable = s, r.enable = a, r.enabled = c, r.humanize = n(), r.destroy = u, Object.keys(e).forEach((t) => {
69
+ r[t] = e[t];
70
+ }), r.names = [], r.skips = [], r.formatters = {};
71
+ function t(e) {
72
+ let t = 0;
73
+ for (let n = 0; n < e.length; n++) t = (t << 5) - t + e.charCodeAt(n), t |= 0;
74
+ return r.colors[Math.abs(t) % r.colors.length];
75
+ }
76
+ r.selectColor = t;
77
+ function r(e) {
78
+ let t, n = null, a, o;
79
+ function s(...e) {
80
+ if (!s.enabled) return;
81
+ let n = s, i = Number(/* @__PURE__ */ new Date());
82
+ n.diff = i - (t || i), n.prev = t, n.curr = i, t = i, e[0] = r.coerce(e[0]), typeof e[0] != "string" && e.unshift("%O");
83
+ let a = 0;
84
+ e[0] = e[0].replace(/%([a-zA-Z%])/g, (t, i) => {
85
+ if (t === "%%") return "%";
86
+ a++;
87
+ let o = r.formatters[i];
88
+ if (typeof o == "function") {
89
+ let r = e[a];
90
+ t = o.call(n, r), e.splice(a, 1), a--;
91
+ }
92
+ return t;
93
+ }), r.formatArgs.call(n, e), (n.log || r.log).apply(n, e);
94
+ }
95
+ return s.namespace = e, s.useColors = r.useColors(), s.color = r.selectColor(e), s.extend = i, s.destroy = r.destroy, Object.defineProperty(s, "enabled", {
96
+ enumerable: !0,
97
+ configurable: !1,
98
+ get: () => n === null ? (a !== r.namespaces && (a = r.namespaces, o = r.enabled(e)), o) : n,
99
+ set: (e) => {
100
+ n = e;
101
+ }
102
+ }), typeof r.init == "function" && r.init(s), s;
103
+ }
104
+ function i(e, t) {
105
+ let n = r(this.namespace + (t === void 0 ? ":" : t) + e);
106
+ return n.log = this.log, n;
107
+ }
108
+ function a(e) {
109
+ r.save(e), r.namespaces = e, r.names = [], r.skips = [];
110
+ let t = (typeof e == "string" ? e : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
111
+ for (let e of t) e[0] === "-" ? r.skips.push(e.slice(1)) : r.names.push(e);
112
+ }
113
+ function o(e, t) {
114
+ let n = 0, r = 0, i = -1, a = 0;
115
+ for (; n < e.length;) if (r < t.length && (t[r] === e[n] || t[r] === "*")) t[r] === "*" ? (i = r, a = n, r++) : (n++, r++);
116
+ else if (i !== -1) r = i + 1, a++, n = a;
117
+ else return !1;
118
+ for (; r < t.length && t[r] === "*";) r++;
119
+ return r === t.length;
120
+ }
121
+ function s() {
122
+ let e = [...r.names, ...r.skips.map((e) => "-" + e)].join(",");
123
+ return r.enable(""), e;
124
+ }
125
+ function c(e) {
126
+ for (let t of r.skips) if (o(e, t)) return !1;
127
+ for (let t of r.names) if (o(e, t)) return !0;
128
+ return !1;
129
+ }
130
+ function l(e) {
131
+ return e instanceof Error ? e.stack || e.message : e;
132
+ }
133
+ function u() {
134
+ console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
135
+ }
136
+ return r.enable(r.load()), r;
137
+ }
138
+ t.exports = r;
139
+ })), i = /* @__PURE__ */ t(((e, t) => {
140
+ e.formatArgs = i, e.save = a, e.load = o, e.useColors = n, e.storage = s(), e.destroy = (() => {
141
+ let e = !1;
142
+ return () => {
143
+ e || (e = !0, console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."));
144
+ };
145
+ })(), e.colors = /* @__PURE__ */ "#0000CC.#0000FF.#0033CC.#0033FF.#0066CC.#0066FF.#0099CC.#0099FF.#00CC00.#00CC33.#00CC66.#00CC99.#00CCCC.#00CCFF.#3300CC.#3300FF.#3333CC.#3333FF.#3366CC.#3366FF.#3399CC.#3399FF.#33CC00.#33CC33.#33CC66.#33CC99.#33CCCC.#33CCFF.#6600CC.#6600FF.#6633CC.#6633FF.#66CC00.#66CC33.#9900CC.#9900FF.#9933CC.#9933FF.#99CC00.#99CC33.#CC0000.#CC0033.#CC0066.#CC0099.#CC00CC.#CC00FF.#CC3300.#CC3333.#CC3366.#CC3399.#CC33CC.#CC33FF.#CC6600.#CC6633.#CC9900.#CC9933.#CCCC00.#CCCC33.#FF0000.#FF0033.#FF0066.#FF0099.#FF00CC.#FF00FF.#FF3300.#FF3333.#FF3366.#FF3399.#FF33CC.#FF33FF.#FF6600.#FF6633.#FF9900.#FF9933.#FFCC00.#FFCC33".split(".");
146
+ function n() {
147
+ if (typeof window < "u" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) return !0;
148
+ if (typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
149
+ let e;
150
+ return typeof document < "u" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || typeof window < "u" && window.console && (window.console.firebug || window.console.exception && window.console.table) || typeof navigator < "u" && navigator.userAgent && (e = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(e[1], 10) >= 31 || typeof navigator < "u" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
151
+ }
152
+ function i(e) {
153
+ if (e[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + e[0] + (this.useColors ? "%c " : " ") + "+" + t.exports.humanize(this.diff), !this.useColors) return;
154
+ let n = "color: " + this.color;
155
+ e.splice(1, 0, n, "color: inherit");
156
+ let r = 0, i = 0;
157
+ e[0].replace(/%[a-zA-Z%]/g, (e) => {
158
+ e !== "%%" && (r++, e === "%c" && (i = r));
159
+ }), e.splice(i, 0, n);
160
+ }
161
+ e.log = console.debug || console.log || (() => {});
162
+ function a(t) {
163
+ try {
164
+ t ? e.storage.setItem("debug", t) : e.storage.removeItem("debug");
165
+ } catch {}
166
+ }
167
+ function o() {
168
+ let t;
169
+ try {
170
+ t = e.storage.getItem("debug") || e.storage.getItem("DEBUG");
171
+ } catch {}
172
+ return !t && typeof process < "u" && "env" in process && (t = process.env.DEBUG), t;
173
+ }
174
+ function s() {
175
+ try {
176
+ return localStorage;
177
+ } catch {}
178
+ }
179
+ t.exports = r()(e);
180
+ var { formatters: c } = t.exports;
181
+ c.j = function(e) {
182
+ try {
183
+ return JSON.stringify(e);
184
+ } catch (e) {
185
+ return "[UnexpectedJSONParseError]: " + e.message;
186
+ }
187
+ };
188
+ })), a = {
189
+ translation: {
190
+ categorize: {
191
+ limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
192
+ maxChoicesPerCategoryRestriction: "To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."
193
+ },
194
+ ebsr: { part: "Part {{index}}" },
195
+ numberLine: {
196
+ addElementLimit_one: "You can only add {{count}} element",
197
+ addElementLimit_other: "You can only add {{count}} elements",
198
+ clearAll: "Clear all"
199
+ },
200
+ imageClozeAssociation: {
201
+ reachedLimit_one: "You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",
202
+ reachedLimit_other: "Full"
203
+ },
204
+ drawingResponse: {
205
+ fillColor: "Fill color",
206
+ outlineColor: "Outline color",
207
+ noFill: "No fill",
208
+ lightblue: "Light blue",
209
+ lightyellow: "Light yellow",
210
+ red: "Red",
211
+ orange: "Orange",
212
+ yellow: "Yellow",
213
+ violet: "Violet",
214
+ blue: "Blue",
215
+ green: "Green",
216
+ white: "White",
217
+ black: "Black",
218
+ onDoubleClick: "Double click to edit this text. Press Enter to submit."
219
+ },
220
+ charting: {
221
+ addCategory: "Add category",
222
+ actions: "Actions",
223
+ add: "Add",
224
+ delete: "Delete",
225
+ newLabel: "New label",
226
+ reachedLimit_other: "There can't be more than {{count}} categories.",
227
+ keyLegend: {
228
+ incorrectAnswer: "Student incorrect answer",
229
+ correctAnswer: "Student correct answer",
230
+ correctKeyAnswer: "Answer key correct"
231
+ }
232
+ },
233
+ graphing: {
234
+ point: "Point",
235
+ circle: "Circle",
236
+ line: "Line",
237
+ parabola: "Parabola",
238
+ absolute: "Absolute Value",
239
+ exponential: "Exponential",
240
+ polygon: "Polygon",
241
+ ray: "Ray",
242
+ segment: "Segment",
243
+ sine: "Sine",
244
+ vector: "Vector",
245
+ label: "Label",
246
+ redo: "Redo",
247
+ reset: "Reset"
248
+ },
249
+ mathInline: { primaryCorrectWithAlternates: "Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct." },
250
+ multipleChoice: {
251
+ minSelections: "Select at least {{minSelections}}.",
252
+ maxSelections_one: "Only {{maxSelections}} answer is allowed.",
253
+ maxSelections_other: "Only {{maxSelections}} answers are allowed.",
254
+ minmaxSelections_equal: "Select {{minSelections}}.",
255
+ minmaxSelections_range: "Select between {{minSelections}} and {{maxSelections}}."
256
+ },
257
+ selectText: {
258
+ correctAnswerSelected: "Correct",
259
+ correctAnswerNotSelected: "Correct Answer Not Selected",
260
+ incorrectSelection: "Incorrect Selection",
261
+ key: "Key"
262
+ }
263
+ },
264
+ common: {
265
+ undo: "Undo",
266
+ clearAll: "Clear all",
267
+ correct: "Correct",
268
+ incorrect: "Incorrect",
269
+ showCorrectAnswer: "Show correct answer",
270
+ hideCorrectAnswer: "Hide correct answer",
271
+ commonCorrectAnswerWithAlternates: "Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",
272
+ warning: "Warning",
273
+ showNote: "Show Note",
274
+ hideNote: "Hide Note",
275
+ cancel: "Cancel"
276
+ }
277
+ }, o = {
278
+ translation: {
279
+ categorize: {
280
+ limitMaxChoicesPerCategory: "Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
281
+ maxChoicesPerCategoryRestriction: "Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"
282
+ },
283
+ ebsr: { part: "Parte {{index}}" },
284
+ numberLine: {
285
+ addElementLimit_one: "Solo puedes agregar {{count}} elemento",
286
+ addElementLimit_other: "Solo puedes agregar {{count}} elementos",
287
+ clearAll: "Borrar todo"
288
+ },
289
+ imageClozeAssociation: {
290
+ reachedLimit_one: "Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",
291
+ reachedLimit_other: "Lleno"
292
+ },
293
+ drawingResponse: {
294
+ fillColor: "Color de relleno",
295
+ outlineColor: "Color del contorno",
296
+ noFill: "Sin relleno",
297
+ lightblue: "Azul claro",
298
+ lightyellow: "Amarillo claro",
299
+ red: "Rojo",
300
+ orange: "Naranja",
301
+ yellow: "Amarillo",
302
+ violet: "Violeta",
303
+ blue: "Azul",
304
+ green: "Verde",
305
+ white: "Blanco",
306
+ black: "Negro",
307
+ onDoubleClick: "Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"
308
+ },
309
+ charting: {
310
+ addCategory: "Añadir categoría",
311
+ actions: "Acciones",
312
+ add: "Añadir",
313
+ delete: "Eliminar",
314
+ newLabel: "Nueva etiqueta",
315
+ reachedLimit_other: "No puede haber más de {{count}} categorías.",
316
+ keyLegend: {
317
+ incorrectAnswer: "Respuesta incorrecta del estudiante",
318
+ correctAnswer: "Respuesta correcta del estudiante",
319
+ correctKeyAnswer: "Clave de respuesta correcta"
320
+ }
321
+ },
322
+ graphing: {
323
+ point: "Punto",
324
+ circle: "Circulo",
325
+ line: "Línea",
326
+ parabola: "Parábola",
327
+ absolute: "Valor absoluto",
328
+ exponential: "Exponencial",
329
+ polygon: "Polígono",
330
+ ray: "Semirrecta",
331
+ segment: "Segmento ",
332
+ sine: "Seno",
333
+ vector: "Vector",
334
+ label: "Etiqueta",
335
+ redo: "Rehacer",
336
+ reset: "Reiniciar"
337
+ },
338
+ mathInline: { primaryCorrectWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas." },
339
+ multipleChoice: {
340
+ minSelections: "Seleccione al menos {{minSelections}}.",
341
+ maxSelections_one: "Sólo se permite {{maxSelections}} respuesta.",
342
+ maxSelections_other: "Sólo se permiten {{maxSelections}} respuestas.",
343
+ minmaxSelections_equal: "Seleccione {{minSelections}}.",
344
+ minmaxSelections_range: "Seleccione entre {{minSelections}} y {{maxSelections}}."
345
+ },
346
+ selectText: {
347
+ correctAnswerSelected: "Respuesta Correcta",
348
+ correctAnswerNotSelected: "Respuesta Correcta No Seleccionada",
349
+ incorrectSelection: "Selección Incorrecta",
350
+ key: "Clave"
351
+ }
352
+ },
353
+ common: {
354
+ undo: "Deshacer",
355
+ clearAll: "Borrar todo",
356
+ correct: "Correct",
357
+ incorrect: "Incorrect",
358
+ showCorrectAnswer: "Mostrar respuesta correcta",
359
+ hideCorrectAnswer: "Ocultar respuesta correcta",
360
+ commonCorrectAnswerWithAlternates: "Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",
361
+ warning: "Advertencia",
362
+ showNote: "Mostrar Nota",
363
+ hideNote: "Ocultar Nota",
364
+ cancel: "Cancelar"
365
+ }
366
+ }, s = (e) => typeof e == "string", c = () => {
367
+ let e, t, n = new Promise((n, r) => {
368
+ e = n, t = r;
369
+ });
370
+ return n.resolve = e, n.reject = t, n;
371
+ }, l = (e) => e == null ? "" : "" + e, u = (e, t, n) => {
372
+ e.forEach((e) => {
373
+ t[e] && (n[e] = t[e]);
374
+ });
375
+ }, d = /###/g, f = (e) => e && e.indexOf("###") > -1 ? e.replace(d, ".") : e, p = (e) => !e || s(e), m = (e, t, n) => {
376
+ let r = s(t) ? t.split(".") : t, i = 0;
377
+ for (; i < r.length - 1;) {
378
+ if (p(e)) return {};
379
+ let t = f(r[i]);
380
+ !e[t] && n && (e[t] = new n()), e = Object.prototype.hasOwnProperty.call(e, t) ? e[t] : {}, ++i;
381
+ }
382
+ return p(e) ? {} : {
383
+ obj: e,
384
+ k: f(r[i])
385
+ };
386
+ }, h = (e, t, n) => {
387
+ let { obj: r, k: i } = m(e, t, Object);
388
+ if (r !== void 0 || t.length === 1) {
389
+ r[i] = n;
390
+ return;
391
+ }
392
+ let a = t[t.length - 1], o = t.slice(0, t.length - 1), s = m(e, o, Object);
393
+ for (; s.obj === void 0 && o.length;) a = `${o[o.length - 1]}.${a}`, o = o.slice(0, o.length - 1), s = m(e, o, Object), s?.obj && s.obj[`${s.k}.${a}`] !== void 0 && (s.obj = void 0);
394
+ s.obj[`${s.k}.${a}`] = n;
395
+ }, g = (e, t, n, r) => {
396
+ let { obj: i, k: a } = m(e, t, Object);
397
+ i[a] = i[a] || [], i[a].push(n);
398
+ }, _ = (e, t) => {
399
+ let { obj: n, k: r } = m(e, t);
400
+ if (n && Object.prototype.hasOwnProperty.call(n, r)) return n[r];
401
+ }, v = (e, t, n) => {
402
+ let r = _(e, n);
403
+ return r === void 0 ? _(t, n) : r;
404
+ }, y = (e, t, n) => {
405
+ for (let r in t) r !== "__proto__" && r !== "constructor" && (r in e ? s(e[r]) || e[r] instanceof String || s(t[r]) || t[r] instanceof String ? n && (e[r] = t[r]) : y(e[r], t[r], n) : e[r] = t[r]);
406
+ return e;
407
+ }, b = (e) => e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), x = {
408
+ "&": "&amp;",
409
+ "<": "&lt;",
410
+ ">": "&gt;",
411
+ "\"": "&quot;",
412
+ "'": "&#39;",
413
+ "/": "&#x2F;"
414
+ }, S = (e) => s(e) ? e.replace(/[&<>"'\/]/g, (e) => x[e]) : e, C = class {
415
+ constructor(e) {
416
+ this.capacity = e, this.regExpMap = /* @__PURE__ */ new Map(), this.regExpQueue = [];
417
+ }
418
+ getRegExp(e) {
419
+ let t = this.regExpMap.get(e);
420
+ if (t !== void 0) return t;
421
+ let n = new RegExp(e);
422
+ return this.regExpQueue.length === this.capacity && this.regExpMap.delete(this.regExpQueue.shift()), this.regExpMap.set(e, n), this.regExpQueue.push(e), n;
423
+ }
424
+ }, w = [
425
+ " ",
426
+ ",",
427
+ "?",
428
+ "!",
429
+ ";"
430
+ ], T = new C(20), E = (e, t, n) => {
431
+ t ||= "", n ||= "";
432
+ let r = w.filter((e) => t.indexOf(e) < 0 && n.indexOf(e) < 0);
433
+ if (r.length === 0) return !0;
434
+ let i = T.getRegExp(`(${r.map((e) => e === "?" ? "\\?" : e).join("|")})`), a = !i.test(e);
435
+ if (!a) {
436
+ let t = e.indexOf(n);
437
+ t > 0 && !i.test(e.substring(0, t)) && (a = !0);
438
+ }
439
+ return a;
440
+ }, D = (e, t, n = ".") => {
441
+ if (!e) return;
442
+ if (e[t]) return Object.prototype.hasOwnProperty.call(e, t) ? e[t] : void 0;
443
+ let r = t.split(n), i = e;
444
+ for (let e = 0; e < r.length;) {
445
+ if (!i || typeof i != "object") return;
446
+ let t, a = "";
447
+ for (let o = e; o < r.length; ++o) if (o !== e && (a += n), a += r[o], t = i[a], t !== void 0) {
448
+ if ([
449
+ "string",
450
+ "number",
451
+ "boolean"
452
+ ].indexOf(typeof t) > -1 && o < r.length - 1) continue;
453
+ e += o - e + 1;
454
+ break;
455
+ }
456
+ i = t;
457
+ }
458
+ return i;
459
+ }, O = (e) => e?.replace(/_/g, "-"), ee = {
460
+ type: "logger",
461
+ log(e) {
462
+ this.output("log", e);
463
+ },
464
+ warn(e) {
465
+ this.output("warn", e);
466
+ },
467
+ error(e) {
468
+ this.output("error", e);
469
+ },
470
+ output(e, t) {
471
+ console?.[e]?.apply?.(console, t);
472
+ }
473
+ }, k = new class e {
474
+ constructor(e, t = {}) {
475
+ this.init(e, t);
476
+ }
477
+ init(e, t = {}) {
478
+ this.prefix = t.prefix || "i18next:", this.logger = e || ee, this.options = t, this.debug = t.debug;
479
+ }
480
+ log(...e) {
481
+ return this.forward(e, "log", "", !0);
482
+ }
483
+ warn(...e) {
484
+ return this.forward(e, "warn", "", !0);
485
+ }
486
+ error(...e) {
487
+ return this.forward(e, "error", "");
488
+ }
489
+ deprecate(...e) {
490
+ return this.forward(e, "warn", "WARNING DEPRECATED: ", !0);
491
+ }
492
+ forward(e, t, n, r) {
493
+ return r && !this.debug ? null : (s(e[0]) && (e[0] = `${n}${this.prefix} ${e[0]}`), this.logger[t](e));
494
+ }
495
+ create(t) {
496
+ return new e(this.logger, {
497
+ prefix: `${this.prefix}:${t}:`,
498
+ ...this.options
499
+ });
500
+ }
501
+ clone(t) {
502
+ return t ||= this.options, t.prefix = t.prefix || this.prefix, new e(this.logger, t);
503
+ }
504
+ }(), A = class {
505
+ constructor() {
506
+ this.observers = {};
507
+ }
508
+ on(e, t) {
509
+ return e.split(" ").forEach((e) => {
510
+ this.observers[e] || (this.observers[e] = /* @__PURE__ */ new Map());
511
+ let n = this.observers[e].get(t) || 0;
512
+ this.observers[e].set(t, n + 1);
513
+ }), this;
514
+ }
515
+ off(e, t) {
516
+ if (this.observers[e]) {
517
+ if (!t) {
518
+ delete this.observers[e];
519
+ return;
520
+ }
521
+ this.observers[e].delete(t);
522
+ }
523
+ }
524
+ emit(e, ...t) {
525
+ this.observers[e] && Array.from(this.observers[e].entries()).forEach(([e, n]) => {
526
+ for (let r = 0; r < n; r++) e(...t);
527
+ }), this.observers["*"] && Array.from(this.observers["*"].entries()).forEach(([n, r]) => {
528
+ for (let i = 0; i < r; i++) n.apply(n, [e, ...t]);
529
+ });
530
+ }
531
+ }, j = class extends A {
532
+ constructor(e, t = {
533
+ ns: ["translation"],
534
+ defaultNS: "translation"
535
+ }) {
536
+ super(), this.data = e || {}, this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.options.ignoreJSONStructure === void 0 && (this.options.ignoreJSONStructure = !0);
537
+ }
538
+ addNamespaces(e) {
539
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
540
+ }
541
+ removeNamespaces(e) {
542
+ let t = this.options.ns.indexOf(e);
543
+ t > -1 && this.options.ns.splice(t, 1);
544
+ }
545
+ getResource(e, t, n, r = {}) {
546
+ let i = r.keySeparator === void 0 ? this.options.keySeparator : r.keySeparator, a = r.ignoreJSONStructure === void 0 ? this.options.ignoreJSONStructure : r.ignoreJSONStructure, o;
547
+ e.indexOf(".") > -1 ? o = e.split(".") : (o = [e, t], n && (Array.isArray(n) ? o.push(...n) : s(n) && i ? o.push(...n.split(i)) : o.push(n)));
548
+ let c = _(this.data, o);
549
+ return !c && !t && !n && e.indexOf(".") > -1 && (e = o[0], t = o[1], n = o.slice(2).join(".")), c || !a || !s(n) ? c : D(this.data?.[e]?.[t], n, i);
550
+ }
551
+ addResource(e, t, n, r, i = { silent: !1 }) {
552
+ let a = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, o = [e, t];
553
+ n && (o = o.concat(a ? n.split(a) : n)), e.indexOf(".") > -1 && (o = e.split("."), r = t, t = o[1]), this.addNamespaces(t), h(this.data, o, r), i.silent || this.emit("added", e, t, n, r);
554
+ }
555
+ addResources(e, t, n, r = { silent: !1 }) {
556
+ for (let r in n) (s(n[r]) || Array.isArray(n[r])) && this.addResource(e, t, r, n[r], { silent: !0 });
557
+ r.silent || this.emit("added", e, t, n);
558
+ }
559
+ addResourceBundle(e, t, n, r, i, a = {
560
+ silent: !1,
561
+ skipCopy: !1
562
+ }) {
563
+ let o = [e, t];
564
+ e.indexOf(".") > -1 && (o = e.split("."), r = n, n = t, t = o[1]), this.addNamespaces(t);
565
+ let s = _(this.data, o) || {};
566
+ a.skipCopy || (n = JSON.parse(JSON.stringify(n))), r ? y(s, n, i) : s = {
567
+ ...s,
568
+ ...n
569
+ }, h(this.data, o, s), a.silent || this.emit("added", e, t, n);
570
+ }
571
+ removeResourceBundle(e, t) {
572
+ this.hasResourceBundle(e, t) && delete this.data[e][t], this.removeNamespaces(t), this.emit("removed", e, t);
573
+ }
574
+ hasResourceBundle(e, t) {
575
+ return this.getResource(e, t) !== void 0;
576
+ }
577
+ getResourceBundle(e, t) {
578
+ return t ||= this.options.defaultNS, this.getResource(e, t);
579
+ }
580
+ getDataByLanguage(e) {
581
+ return this.data[e];
582
+ }
583
+ hasLanguageSomeTranslations(e) {
584
+ let t = this.getDataByLanguage(e);
585
+ return !!(t && Object.keys(t) || []).find((e) => t[e] && Object.keys(t[e]).length > 0);
586
+ }
587
+ toJSON() {
588
+ return this.data;
589
+ }
590
+ }, M = {
591
+ processors: {},
592
+ addPostProcessor(e) {
593
+ this.processors[e.name] = e;
594
+ },
595
+ handle(e, t, n, r, i) {
596
+ return e.forEach((e) => {
597
+ t = this.processors[e]?.process(t, n, r, i) ?? t;
598
+ }), t;
599
+ }
600
+ }, N = Symbol("i18next/PATH_KEY");
601
+ function te() {
602
+ let e = [], t = Object.create(null), n;
603
+ return t.get = (r, i) => (n?.revoke?.(), i === N ? e : (e.push(i), n = Proxy.revocable(r, t), n.proxy)), Proxy.revocable(Object.create(null), t).proxy;
604
+ }
605
+ function P(e, t) {
606
+ let { [N]: n } = e(te()), r = t?.keySeparator ?? ".", i = t?.nsSeparator ?? ":";
607
+ if (n.length > 1 && i) {
608
+ let e = t?.ns, a = Array.isArray(e) ? e : null;
609
+ if (a && a.length > 1 && a.slice(1).includes(n[0])) return `${n[0]}${i}${n.slice(1).join(r)}`;
610
+ }
611
+ return n.join(r);
612
+ }
613
+ var F = {}, I = (e) => !s(e) && typeof e != "boolean" && typeof e != "number", L = class e extends A {
614
+ constructor(e, t = {}) {
615
+ super(), u([
616
+ "resourceStore",
617
+ "languageUtils",
618
+ "pluralResolver",
619
+ "interpolator",
620
+ "backendConnector",
621
+ "i18nFormat",
622
+ "utils"
623
+ ], e, this), this.options = t, this.options.keySeparator === void 0 && (this.options.keySeparator = "."), this.logger = k.create("translator");
624
+ }
625
+ changeLanguage(e) {
626
+ e && (this.language = e);
627
+ }
628
+ exists(e, t = { interpolation: {} }) {
629
+ let n = { ...t };
630
+ if (e == null) return !1;
631
+ let r = this.resolve(e, n);
632
+ if (r?.res === void 0) return !1;
633
+ let i = I(r.res);
634
+ return !(n.returnObjects === !1 && i);
635
+ }
636
+ extractFromKey(e, t) {
637
+ let n = t.nsSeparator === void 0 ? this.options.nsSeparator : t.nsSeparator;
638
+ n === void 0 && (n = ":");
639
+ let r = t.keySeparator === void 0 ? this.options.keySeparator : t.keySeparator, i = t.ns || this.options.defaultNS || [], a = n && e.indexOf(n) > -1, o = !this.options.userDefinedKeySeparator && !t.keySeparator && !this.options.userDefinedNsSeparator && !t.nsSeparator && !E(e, n, r);
640
+ if (a && !o) {
641
+ let t = e.match(this.interpolator.nestingRegexp);
642
+ if (t && t.length > 0) return {
643
+ key: e,
644
+ namespaces: s(i) ? [i] : i
645
+ };
646
+ let a = e.split(n);
647
+ (n !== r || n === r && this.options.ns.indexOf(a[0]) > -1) && (i = a.shift()), e = a.join(r);
648
+ }
649
+ return {
650
+ key: e,
651
+ namespaces: s(i) ? [i] : i
652
+ };
653
+ }
654
+ translate(t, n, r) {
655
+ let i = typeof n == "object" ? { ...n } : n;
656
+ if (typeof i != "object" && this.options.overloadTranslationOptionHandler && (i = this.options.overloadTranslationOptionHandler(arguments)), typeof i == "object" && (i = { ...i }), i ||= {}, t == null) return "";
657
+ typeof t == "function" && (t = P(t, {
658
+ ...this.options,
659
+ ...i
660
+ })), Array.isArray(t) || (t = [String(t)]), t = t.map((e) => typeof e == "function" ? P(e, {
661
+ ...this.options,
662
+ ...i
663
+ }) : String(e));
664
+ let a = i.returnDetails === void 0 ? this.options.returnDetails : i.returnDetails, o = i.keySeparator === void 0 ? this.options.keySeparator : i.keySeparator, { key: c, namespaces: l } = this.extractFromKey(t[t.length - 1], i), u = l[l.length - 1], d = i.nsSeparator === void 0 ? this.options.nsSeparator : i.nsSeparator;
665
+ d === void 0 && (d = ":");
666
+ let f = i.lng || this.language, p = i.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
667
+ if (f?.toLowerCase() === "cimode") return p ? a ? {
668
+ res: `${u}${d}${c}`,
669
+ usedKey: c,
670
+ exactUsedKey: c,
671
+ usedLng: f,
672
+ usedNS: u,
673
+ usedParams: this.getUsedParamsDetails(i)
674
+ } : `${u}${d}${c}` : a ? {
675
+ res: c,
676
+ usedKey: c,
677
+ exactUsedKey: c,
678
+ usedLng: f,
679
+ usedNS: u,
680
+ usedParams: this.getUsedParamsDetails(i)
681
+ } : c;
682
+ let m = this.resolve(t, i), h = m?.res, g = m?.usedKey || c, _ = m?.exactUsedKey || c, v = [
683
+ "[object Number]",
684
+ "[object Function]",
685
+ "[object RegExp]"
686
+ ], y = i.joinArrays === void 0 ? this.options.joinArrays : i.joinArrays, b = !this.i18nFormat || this.i18nFormat.handleAsObject, x = i.count !== void 0 && !s(i.count), S = e.hasDefaultValue(i), C = x ? this.pluralResolver.getSuffix(f, i.count, i) : "", w = i.ordinal && x ? this.pluralResolver.getSuffix(f, i.count, { ordinal: !1 }) : "", T = x && !i.ordinal && i.count === 0, E = T && i[`defaultValue${this.options.pluralSeparator}zero`] || i[`defaultValue${C}`] || i[`defaultValue${w}`] || i.defaultValue, D = h;
687
+ b && !h && S && (D = E);
688
+ let O = I(D), ee = Object.prototype.toString.apply(D);
689
+ if (b && D && O && v.indexOf(ee) < 0 && !(s(y) && Array.isArray(D))) {
690
+ if (!i.returnObjects && !this.options.returnObjects) {
691
+ this.options.returnedObjectHandler || this.logger.warn("accessing an object - but returnObjects options is not enabled!");
692
+ let e = this.options.returnedObjectHandler ? this.options.returnedObjectHandler(g, D, {
693
+ ...i,
694
+ ns: l
695
+ }) : `key '${c} (${this.language})' returned an object instead of string.`;
696
+ return a ? (m.res = e, m.usedParams = this.getUsedParamsDetails(i), m) : e;
697
+ }
698
+ if (o) {
699
+ let e = Array.isArray(D), t = e ? [] : {}, n = e ? _ : g;
700
+ for (let e in D) if (Object.prototype.hasOwnProperty.call(D, e)) {
701
+ let r = `${n}${o}${e}`;
702
+ S && !h ? t[e] = this.translate(r, {
703
+ ...i,
704
+ defaultValue: I(E) ? E[e] : void 0,
705
+ joinArrays: !1,
706
+ ns: l
707
+ }) : t[e] = this.translate(r, {
708
+ ...i,
709
+ joinArrays: !1,
710
+ ns: l
711
+ }), t[e] === r && (t[e] = D[e]);
712
+ }
713
+ h = t;
714
+ }
715
+ } else if (b && s(y) && Array.isArray(h)) h = h.join(y), h &&= this.extendTranslation(h, t, i, r);
716
+ else {
717
+ let e = !1, n = !1;
718
+ !this.isValidLookup(h) && S && (e = !0, h = E), this.isValidLookup(h) || (n = !0, h = c);
719
+ let a = (i.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey) && n ? void 0 : h, s = S && E !== h && this.options.updateMissing;
720
+ if (n || e || s) {
721
+ if (this.logger.log(s ? "updateKey" : "missingKey", f, u, c, s ? E : h), o) {
722
+ let e = this.resolve(c, {
723
+ ...i,
724
+ keySeparator: !1
725
+ });
726
+ e && e.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
727
+ }
728
+ let e = [], t = this.languageUtils.getFallbackCodes(this.options.fallbackLng, i.lng || this.language);
729
+ if (this.options.saveMissingTo === "fallback" && t && t[0]) for (let n = 0; n < t.length; n++) e.push(t[n]);
730
+ else this.options.saveMissingTo === "all" ? e = this.languageUtils.toResolveHierarchy(i.lng || this.language) : e.push(i.lng || this.language);
731
+ let n = (e, t, n) => {
732
+ let r = S && n !== h ? n : a;
733
+ this.options.missingKeyHandler ? this.options.missingKeyHandler(e, u, t, r, s, i) : this.backendConnector?.saveMissing && this.backendConnector.saveMissing(e, u, t, r, s, i), this.emit("missingKey", e, u, t, h);
734
+ };
735
+ this.options.saveMissing && (this.options.saveMissingPlurals && x ? e.forEach((e) => {
736
+ let t = this.pluralResolver.getSuffixes(e, i);
737
+ T && i[`defaultValue${this.options.pluralSeparator}zero`] && t.indexOf(`${this.options.pluralSeparator}zero`) < 0 && t.push(`${this.options.pluralSeparator}zero`), t.forEach((t) => {
738
+ n([e], c + t, i[`defaultValue${t}`] || E);
739
+ });
740
+ }) : n(e, c, E));
741
+ }
742
+ h = this.extendTranslation(h, t, i, m, r), n && h === c && this.options.appendNamespaceToMissingKey && (h = `${u}${d}${c}`), (n || e) && this.options.parseMissingKeyHandler && (h = this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey ? `${u}${d}${c}` : c, e ? h : void 0, i));
743
+ }
744
+ return a ? (m.res = h, m.usedParams = this.getUsedParamsDetails(i), m) : h;
745
+ }
746
+ extendTranslation(e, t, n, r, i) {
747
+ if (this.i18nFormat?.parse) e = this.i18nFormat.parse(e, {
748
+ ...this.options.interpolation.defaultVariables,
749
+ ...n
750
+ }, n.lng || this.language || r.usedLng, r.usedNS, r.usedKey, { resolved: r });
751
+ else if (!n.skipInterpolation) {
752
+ n.interpolation && this.interpolator.init({
753
+ ...n,
754
+ interpolation: {
755
+ ...this.options.interpolation,
756
+ ...n.interpolation
757
+ }
758
+ });
759
+ let a = s(e) && (n?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : n.interpolation.skipOnVariables), o;
760
+ if (a) {
761
+ let t = e.match(this.interpolator.nestingRegexp);
762
+ o = t && t.length;
763
+ }
764
+ let c = n.replace && !s(n.replace) ? n.replace : n;
765
+ if (this.options.interpolation.defaultVariables && (c = {
766
+ ...this.options.interpolation.defaultVariables,
767
+ ...c
768
+ }), e = this.interpolator.interpolate(e, c, n.lng || this.language || r.usedLng, n), a) {
769
+ let t = e.match(this.interpolator.nestingRegexp), r = t && t.length;
770
+ o < r && (n.nest = !1);
771
+ }
772
+ !n.lng && r && r.res && (n.lng = this.language || r.usedLng), n.nest !== !1 && (e = this.interpolator.nest(e, (...e) => i?.[0] === e[0] && !n.context ? (this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`), null) : this.translate(...e, t), n)), n.interpolation && this.interpolator.reset();
773
+ }
774
+ let a = n.postProcess || this.options.postProcess, o = s(a) ? [a] : a;
775
+ return e != null && o?.length && n.applyPostProcessor !== !1 && (e = M.handle(o, e, t, this.options && this.options.postProcessPassResolved ? {
776
+ i18nResolved: {
777
+ ...r,
778
+ usedParams: this.getUsedParamsDetails(n)
779
+ },
780
+ ...n
781
+ } : n, this)), e;
782
+ }
783
+ resolve(e, t = {}) {
784
+ let n, r, i, a, o;
785
+ return s(e) && (e = [e]), Array.isArray(e) && (e = e.map((e) => typeof e == "function" ? P(e, {
786
+ ...this.options,
787
+ ...t
788
+ }) : e)), e.forEach((e) => {
789
+ if (this.isValidLookup(n)) return;
790
+ let c = this.extractFromKey(e, t), l = c.key;
791
+ r = l;
792
+ let u = c.namespaces;
793
+ this.options.fallbackNS && (u = u.concat(this.options.fallbackNS));
794
+ let d = t.count !== void 0 && !s(t.count), f = d && !t.ordinal && t.count === 0, p = t.context !== void 0 && (s(t.context) || typeof t.context == "number") && t.context !== "", m = t.lngs ? t.lngs : this.languageUtils.toResolveHierarchy(t.lng || this.language, t.fallbackLng);
795
+ u.forEach((e) => {
796
+ this.isValidLookup(n) || (o = e, !F[`${m[0]}-${e}`] && this.utils?.hasLoadedNamespace && !this.utils?.hasLoadedNamespace(o) && (F[`${m[0]}-${e}`] = !0, this.logger.warn(`key "${r}" for languages "${m.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")), m.forEach((r) => {
797
+ if (this.isValidLookup(n)) return;
798
+ a = r;
799
+ let o = [l];
800
+ if (this.i18nFormat?.addLookupKeys) this.i18nFormat.addLookupKeys(o, l, r, e, t);
801
+ else {
802
+ let e;
803
+ d && (e = this.pluralResolver.getSuffix(r, t.count, t));
804
+ let n = `${this.options.pluralSeparator}zero`, i = `${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;
805
+ if (d && (t.ordinal && e.indexOf(i) === 0 && o.push(l + e.replace(i, this.options.pluralSeparator)), o.push(l + e), f && o.push(l + n)), p) {
806
+ let r = `${l}${this.options.contextSeparator || "_"}${t.context}`;
807
+ o.push(r), d && (t.ordinal && e.indexOf(i) === 0 && o.push(r + e.replace(i, this.options.pluralSeparator)), o.push(r + e), f && o.push(r + n));
808
+ }
809
+ }
810
+ let s;
811
+ for (; s = o.pop();) this.isValidLookup(n) || (i = s, n = this.getResource(r, e, s, t));
812
+ }));
813
+ });
814
+ }), {
815
+ res: n,
816
+ usedKey: r,
817
+ exactUsedKey: i,
818
+ usedLng: a,
819
+ usedNS: o
820
+ };
821
+ }
822
+ isValidLookup(e) {
823
+ return e !== void 0 && !(!this.options.returnNull && e === null) && !(!this.options.returnEmptyString && e === "");
824
+ }
825
+ getResource(e, t, n, r = {}) {
826
+ return this.i18nFormat?.getResource ? this.i18nFormat.getResource(e, t, n, r) : this.resourceStore.getResource(e, t, n, r);
827
+ }
828
+ getUsedParamsDetails(e = {}) {
829
+ let t = [
830
+ "defaultValue",
831
+ "ordinal",
832
+ "context",
833
+ "replace",
834
+ "lng",
835
+ "lngs",
836
+ "fallbackLng",
837
+ "ns",
838
+ "keySeparator",
839
+ "nsSeparator",
840
+ "returnObjects",
841
+ "returnDetails",
842
+ "joinArrays",
843
+ "postProcess",
844
+ "interpolation"
845
+ ], n = e.replace && !s(e.replace), r = n ? e.replace : e;
846
+ if (n && e.count !== void 0 && (r.count = e.count), this.options.interpolation.defaultVariables && (r = {
847
+ ...this.options.interpolation.defaultVariables,
848
+ ...r
849
+ }), !n) {
850
+ r = { ...r };
851
+ for (let e of t) delete r[e];
852
+ }
853
+ return r;
854
+ }
855
+ static hasDefaultValue(e) {
856
+ for (let t in e) if (Object.prototype.hasOwnProperty.call(e, t) && t.substring(0, 12) === "defaultValue" && e[t] !== void 0) return !0;
857
+ return !1;
858
+ }
859
+ }, R = class {
860
+ constructor(e) {
861
+ this.options = e, this.supportedLngs = this.options.supportedLngs || !1, this.logger = k.create("languageUtils");
862
+ }
863
+ getScriptPartFromCode(e) {
864
+ if (e = O(e), !e || e.indexOf("-") < 0) return null;
865
+ let t = e.split("-");
866
+ return t.length === 2 || (t.pop(), t[t.length - 1].toLowerCase() === "x") ? null : this.formatLanguageCode(t.join("-"));
867
+ }
868
+ getLanguagePartFromCode(e) {
869
+ if (e = O(e), !e || e.indexOf("-") < 0) return e;
870
+ let t = e.split("-");
871
+ return this.formatLanguageCode(t[0]);
872
+ }
873
+ formatLanguageCode(e) {
874
+ if (s(e) && e.indexOf("-") > -1) {
875
+ let t;
876
+ try {
877
+ t = Intl.getCanonicalLocales(e)[0];
878
+ } catch {}
879
+ return t && this.options.lowerCaseLng && (t = t.toLowerCase()), t || (this.options.lowerCaseLng ? e.toLowerCase() : e);
880
+ }
881
+ return this.options.cleanCode || this.options.lowerCaseLng ? e.toLowerCase() : e;
882
+ }
883
+ isSupportedCode(e) {
884
+ return (this.options.load === "languageOnly" || this.options.nonExplicitSupportedLngs) && (e = this.getLanguagePartFromCode(e)), !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(e) > -1;
885
+ }
886
+ getBestMatchFromCodes(e) {
887
+ if (!e) return null;
888
+ let t;
889
+ return e.forEach((e) => {
890
+ if (t) return;
891
+ let n = this.formatLanguageCode(e);
892
+ (!this.options.supportedLngs || this.isSupportedCode(n)) && (t = n);
893
+ }), !t && this.options.supportedLngs && e.forEach((e) => {
894
+ if (t) return;
895
+ let n = this.getScriptPartFromCode(e);
896
+ if (this.isSupportedCode(n)) return t = n;
897
+ let r = this.getLanguagePartFromCode(e);
898
+ if (this.isSupportedCode(r)) return t = r;
899
+ t = this.options.supportedLngs.find((e) => {
900
+ if (e === r || !(e.indexOf("-") < 0 && r.indexOf("-") < 0) && (e.indexOf("-") > 0 && r.indexOf("-") < 0 && e.substring(0, e.indexOf("-")) === r || e.indexOf(r) === 0 && r.length > 1)) return e;
901
+ });
902
+ }), t ||= this.getFallbackCodes(this.options.fallbackLng)[0], t;
903
+ }
904
+ getFallbackCodes(e, t) {
905
+ if (!e) return [];
906
+ if (typeof e == "function" && (e = e(t)), s(e) && (e = [e]), Array.isArray(e)) return e;
907
+ if (!t) return e.default || [];
908
+ let n = e[t];
909
+ return n ||= e[this.getScriptPartFromCode(t)], n ||= e[this.formatLanguageCode(t)], n ||= e[this.getLanguagePartFromCode(t)], n ||= e.default, n || [];
910
+ }
911
+ toResolveHierarchy(e, t) {
912
+ let n = this.getFallbackCodes((t === !1 ? [] : t) || this.options.fallbackLng || [], e), r = [], i = (e) => {
913
+ e && (this.isSupportedCode(e) ? r.push(e) : this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`));
914
+ };
915
+ return s(e) && (e.indexOf("-") > -1 || e.indexOf("_") > -1) ? (this.options.load !== "languageOnly" && i(this.formatLanguageCode(e)), this.options.load !== "languageOnly" && this.options.load !== "currentOnly" && i(this.getScriptPartFromCode(e)), this.options.load !== "currentOnly" && i(this.getLanguagePartFromCode(e))) : s(e) && i(this.formatLanguageCode(e)), n.forEach((e) => {
916
+ r.indexOf(e) < 0 && i(this.formatLanguageCode(e));
917
+ }), r;
918
+ }
919
+ }, z = {
920
+ zero: 0,
921
+ one: 1,
922
+ two: 2,
923
+ few: 3,
924
+ many: 4,
925
+ other: 5
926
+ }, B = {
927
+ select: (e) => e === 1 ? "one" : "other",
928
+ resolvedOptions: () => ({ pluralCategories: ["one", "other"] })
929
+ }, ne = class {
930
+ constructor(e, t = {}) {
931
+ this.languageUtils = e, this.options = t, this.logger = k.create("pluralResolver"), this.pluralRulesCache = {};
932
+ }
933
+ clearCache() {
934
+ this.pluralRulesCache = {};
935
+ }
936
+ getRule(e, t = {}) {
937
+ let n = O(e === "dev" ? "en" : e), r = t.ordinal ? "ordinal" : "cardinal", i = JSON.stringify({
938
+ cleanedCode: n,
939
+ type: r
940
+ });
941
+ if (i in this.pluralRulesCache) return this.pluralRulesCache[i];
942
+ let a;
943
+ try {
944
+ a = new Intl.PluralRules(n, { type: r });
945
+ } catch {
946
+ if (typeof Intl > "u") return this.logger.error("No Intl support, please use an Intl polyfill!"), B;
947
+ if (!e.match(/-|_/)) return B;
948
+ let n = this.languageUtils.getLanguagePartFromCode(e);
949
+ a = this.getRule(n, t);
950
+ }
951
+ return this.pluralRulesCache[i] = a, a;
952
+ }
953
+ needsPlural(e, t = {}) {
954
+ let n = this.getRule(e, t);
955
+ return n ||= this.getRule("dev", t), n?.resolvedOptions().pluralCategories.length > 1;
956
+ }
957
+ getPluralFormsOfKey(e, t, n = {}) {
958
+ return this.getSuffixes(e, n).map((e) => `${t}${e}`);
959
+ }
960
+ getSuffixes(e, t = {}) {
961
+ let n = this.getRule(e, t);
962
+ return n ||= this.getRule("dev", t), n ? n.resolvedOptions().pluralCategories.sort((e, t) => z[e] - z[t]).map((e) => `${this.options.prepend}${t.ordinal ? `ordinal${this.options.prepend}` : ""}${e}`) : [];
963
+ }
964
+ getSuffix(e, t, n = {}) {
965
+ let r = this.getRule(e, n);
966
+ return r ? `${this.options.prepend}${n.ordinal ? `ordinal${this.options.prepend}` : ""}${r.select(t)}` : (this.logger.warn(`no plural rule found for: ${e}`), this.getSuffix("dev", t, n));
967
+ }
968
+ }, V = (e, t, n, r = ".", i = !0) => {
969
+ let a = v(e, t, n);
970
+ return !a && i && s(n) && (a = D(e, n, r), a === void 0 && (a = D(t, n, r))), a;
971
+ }, H = (e) => e.replace(/\$/g, "$$$$"), U = class {
972
+ constructor(e = {}) {
973
+ this.logger = k.create("interpolator"), this.options = e, this.format = e?.interpolation?.format || ((e) => e), this.init(e);
974
+ }
975
+ init(e = {}) {
976
+ e.interpolation ||= { escapeValue: !0 };
977
+ let { escape: t, escapeValue: n, useRawValueToEscape: r, prefix: i, prefixEscaped: a, suffix: o, suffixEscaped: s, formatSeparator: c, unescapeSuffix: l, unescapePrefix: u, nestingPrefix: d, nestingPrefixEscaped: f, nestingSuffix: p, nestingSuffixEscaped: m, nestingOptionsSeparator: h, maxReplaces: g, alwaysFormat: _ } = e.interpolation;
978
+ this.escape = t === void 0 ? S : t, this.escapeValue = n === void 0 || n, this.useRawValueToEscape = r !== void 0 && r, this.prefix = i ? b(i) : a || "{{", this.suffix = o ? b(o) : s || "}}", this.formatSeparator = c || ",", this.unescapePrefix = l ? "" : u || "-", this.unescapeSuffix = this.unescapePrefix ? "" : l || "", this.nestingPrefix = d ? b(d) : f || b("$t("), this.nestingSuffix = p ? b(p) : m || b(")"), this.nestingOptionsSeparator = h || ",", this.maxReplaces = g || 1e3, this.alwaysFormat = _ !== void 0 && _, this.resetRegExp();
979
+ }
980
+ reset() {
981
+ this.options && this.init(this.options);
982
+ }
983
+ resetRegExp() {
984
+ let e = (e, t) => e?.source === t ? (e.lastIndex = 0, e) : new RegExp(t, "g");
985
+ this.regexp = e(this.regexp, `${this.prefix}(.+?)${this.suffix}`), this.regexpUnescape = e(this.regexpUnescape, `${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`), this.nestingRegexp = e(this.nestingRegexp, `${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`);
986
+ }
987
+ interpolate(e, t, n, r) {
988
+ let i, a, o, c = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {}, u = (e) => {
989
+ if (e.indexOf(this.formatSeparator) < 0) {
990
+ let i = V(t, c, e, this.options.keySeparator, this.options.ignoreJSONStructure);
991
+ return this.alwaysFormat ? this.format(i, void 0, n, {
992
+ ...r,
993
+ ...t,
994
+ interpolationkey: e
995
+ }) : i;
996
+ }
997
+ let i = e.split(this.formatSeparator), a = i.shift().trim(), o = i.join(this.formatSeparator).trim();
998
+ return this.format(V(t, c, a, this.options.keySeparator, this.options.ignoreJSONStructure), o, n, {
999
+ ...r,
1000
+ ...t,
1001
+ interpolationkey: a
1002
+ });
1003
+ };
1004
+ this.resetRegExp();
1005
+ let d = r?.missingInterpolationHandler || this.options.missingInterpolationHandler, f = r?.interpolation?.skipOnVariables === void 0 ? this.options.interpolation.skipOnVariables : r.interpolation.skipOnVariables;
1006
+ return [{
1007
+ regex: this.regexpUnescape,
1008
+ safeValue: (e) => H(e)
1009
+ }, {
1010
+ regex: this.regexp,
1011
+ safeValue: (e) => this.escapeValue ? H(this.escape(e)) : H(e)
1012
+ }].forEach((t) => {
1013
+ for (o = 0; i = t.regex.exec(e);) {
1014
+ let n = i[1].trim();
1015
+ if (a = u(n), a === void 0) if (typeof d == "function") {
1016
+ let t = d(e, i, r);
1017
+ a = s(t) ? t : "";
1018
+ } else if (r && Object.prototype.hasOwnProperty.call(r, n)) a = "";
1019
+ else if (f) {
1020
+ a = i[0];
1021
+ continue;
1022
+ } else this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`), a = "";
1023
+ else !s(a) && !this.useRawValueToEscape && (a = l(a));
1024
+ let c = t.safeValue(a);
1025
+ if (e = e.replace(i[0], c), f ? (t.regex.lastIndex += a.length, t.regex.lastIndex -= i[0].length) : t.regex.lastIndex = 0, o++, o >= this.maxReplaces) break;
1026
+ }
1027
+ }), e;
1028
+ }
1029
+ nest(e, t, n = {}) {
1030
+ let r, i, a, o = (e, t) => {
1031
+ let n = this.nestingOptionsSeparator;
1032
+ if (e.indexOf(n) < 0) return e;
1033
+ let r = e.split(RegExp(`${b(n)}[ ]*{`)), i = `{${r[1]}`;
1034
+ e = r[0], i = this.interpolate(i, a);
1035
+ let o = i.match(/'/g), s = i.match(/"/g);
1036
+ ((o?.length ?? 0) % 2 == 0 && !s || (s?.length ?? 0) % 2 != 0) && (i = i.replace(/'/g, "\""));
1037
+ try {
1038
+ a = JSON.parse(i), t && (a = {
1039
+ ...t,
1040
+ ...a
1041
+ });
1042
+ } catch (t) {
1043
+ return this.logger.warn(`failed parsing options string in nesting for key ${e}`, t), `${e}${n}${i}`;
1044
+ }
1045
+ return a.defaultValue && a.defaultValue.indexOf(this.prefix) > -1 && delete a.defaultValue, e;
1046
+ };
1047
+ for (; r = this.nestingRegexp.exec(e);) {
1048
+ let c = [];
1049
+ a = { ...n }, a = a.replace && !s(a.replace) ? a.replace : a, a.applyPostProcessor = !1, delete a.defaultValue;
1050
+ let u = /{.*}/.test(r[1]) ? r[1].lastIndexOf("}") + 1 : r[1].indexOf(this.formatSeparator);
1051
+ if (u !== -1 && (c = r[1].slice(u).split(this.formatSeparator).map((e) => e.trim()).filter(Boolean), r[1] = r[1].slice(0, u)), i = t(o.call(this, r[1].trim(), a), a), i && r[0] === e && !s(i)) return i;
1052
+ s(i) || (i = l(i)), i ||= (this.logger.warn(`missed to resolve ${r[1]} for nesting ${e}`), ""), c.length && (i = c.reduce((e, t) => this.format(e, t, n.lng, {
1053
+ ...n,
1054
+ interpolationkey: r[1].trim()
1055
+ }), i.trim())), e = e.replace(r[0], i), this.regexp.lastIndex = 0;
1056
+ }
1057
+ return e;
1058
+ }
1059
+ }, re = (e) => {
1060
+ let t = e.toLowerCase().trim(), n = {};
1061
+ if (e.indexOf("(") > -1) {
1062
+ let r = e.split("(");
1063
+ t = r[0].toLowerCase().trim();
1064
+ let i = r[1].substring(0, r[1].length - 1);
1065
+ t === "currency" && i.indexOf(":") < 0 ? n.currency ||= i.trim() : t === "relativetime" && i.indexOf(":") < 0 ? n.range ||= i.trim() : i.split(";").forEach((e) => {
1066
+ if (e) {
1067
+ let [t, ...r] = e.split(":"), i = r.join(":").trim().replace(/^'+|'+$/g, ""), a = t.trim();
1068
+ n[a] || (n[a] = i), i === "false" && (n[a] = !1), i === "true" && (n[a] = !0), isNaN(i) || (n[a] = parseInt(i, 10));
1069
+ }
1070
+ });
1071
+ }
1072
+ return {
1073
+ formatName: t,
1074
+ formatOptions: n
1075
+ };
1076
+ }, W = (e) => {
1077
+ let t = {};
1078
+ return (n, r, i) => {
1079
+ let a = i;
1080
+ i && i.interpolationkey && i.formatParams && i.formatParams[i.interpolationkey] && i[i.interpolationkey] && (a = {
1081
+ ...a,
1082
+ [i.interpolationkey]: void 0
1083
+ });
1084
+ let o = r + JSON.stringify(a), s = t[o];
1085
+ return s || (s = e(O(r), i), t[o] = s), s(n);
1086
+ };
1087
+ }, ie = (e) => (t, n, r) => e(O(n), r)(t), ae = class {
1088
+ constructor(e = {}) {
1089
+ this.logger = k.create("formatter"), this.options = e, this.init(e);
1090
+ }
1091
+ init(e, t = { interpolation: {} }) {
1092
+ this.formatSeparator = t.interpolation.formatSeparator || ",";
1093
+ let n = t.cacheInBuiltFormats ? W : ie;
1094
+ this.formats = {
1095
+ number: n((e, t) => {
1096
+ let n = new Intl.NumberFormat(e, { ...t });
1097
+ return (e) => n.format(e);
1098
+ }),
1099
+ currency: n((e, t) => {
1100
+ let n = new Intl.NumberFormat(e, {
1101
+ ...t,
1102
+ style: "currency"
1103
+ });
1104
+ return (e) => n.format(e);
1105
+ }),
1106
+ datetime: n((e, t) => {
1107
+ let n = new Intl.DateTimeFormat(e, { ...t });
1108
+ return (e) => n.format(e);
1109
+ }),
1110
+ relativetime: n((e, t) => {
1111
+ let n = new Intl.RelativeTimeFormat(e, { ...t });
1112
+ return (e) => n.format(e, t.range || "day");
1113
+ }),
1114
+ list: n((e, t) => {
1115
+ let n = new Intl.ListFormat(e, { ...t });
1116
+ return (e) => n.format(e);
1117
+ })
1118
+ };
1119
+ }
1120
+ add(e, t) {
1121
+ this.formats[e.toLowerCase().trim()] = t;
1122
+ }
1123
+ addCached(e, t) {
1124
+ this.formats[e.toLowerCase().trim()] = W(t);
1125
+ }
1126
+ format(e, t, n, r = {}) {
1127
+ let i = t.split(this.formatSeparator);
1128
+ if (i.length > 1 && i[0].indexOf("(") > 1 && i[0].indexOf(")") < 0 && i.find((e) => e.indexOf(")") > -1)) {
1129
+ let e = i.findIndex((e) => e.indexOf(")") > -1);
1130
+ i[0] = [i[0], ...i.splice(1, e)].join(this.formatSeparator);
1131
+ }
1132
+ return i.reduce((e, t) => {
1133
+ let { formatName: i, formatOptions: a } = re(t);
1134
+ if (this.formats[i]) {
1135
+ let t = e;
1136
+ try {
1137
+ let o = r?.formatParams?.[r.interpolationkey] || {}, s = o.locale || o.lng || r.locale || r.lng || n;
1138
+ t = this.formats[i](e, s, {
1139
+ ...a,
1140
+ ...r,
1141
+ ...o
1142
+ });
1143
+ } catch (e) {
1144
+ this.logger.warn(e);
1145
+ }
1146
+ return t;
1147
+ } else this.logger.warn(`there was no format function for ${i}`);
1148
+ return e;
1149
+ }, e);
1150
+ }
1151
+ }, oe = (e, t) => {
1152
+ e.pending[t] !== void 0 && (delete e.pending[t], e.pendingCount--);
1153
+ }, se = class extends A {
1154
+ constructor(e, t, n, r = {}) {
1155
+ super(), this.backend = e, this.store = t, this.services = n, this.languageUtils = n.languageUtils, this.options = r, this.logger = k.create("backendConnector"), this.waitingReads = [], this.maxParallelReads = r.maxParallelReads || 10, this.readingCalls = 0, this.maxRetries = r.maxRetries >= 0 ? r.maxRetries : 5, this.retryTimeout = r.retryTimeout >= 1 ? r.retryTimeout : 350, this.state = {}, this.queue = [], this.backend?.init?.(n, r.backend, r);
1156
+ }
1157
+ queueLoad(e, t, n, r) {
1158
+ let i = {}, a = {}, o = {}, s = {};
1159
+ return e.forEach((e) => {
1160
+ let r = !0;
1161
+ t.forEach((t) => {
1162
+ let o = `${e}|${t}`;
1163
+ !n.reload && this.store.hasResourceBundle(e, t) ? this.state[o] = 2 : this.state[o] < 0 || (this.state[o] === 1 ? a[o] === void 0 && (a[o] = !0) : (this.state[o] = 1, r = !1, a[o] === void 0 && (a[o] = !0), i[o] === void 0 && (i[o] = !0), s[t] === void 0 && (s[t] = !0)));
1164
+ }), r || (o[e] = !0);
1165
+ }), (Object.keys(i).length || Object.keys(a).length) && this.queue.push({
1166
+ pending: a,
1167
+ pendingCount: Object.keys(a).length,
1168
+ loaded: {},
1169
+ errors: [],
1170
+ callback: r
1171
+ }), {
1172
+ toLoad: Object.keys(i),
1173
+ pending: Object.keys(a),
1174
+ toLoadLanguages: Object.keys(o),
1175
+ toLoadNamespaces: Object.keys(s)
1176
+ };
1177
+ }
1178
+ loaded(e, t, n) {
1179
+ let r = e.split("|"), i = r[0], a = r[1];
1180
+ t && this.emit("failedLoading", i, a, t), !t && n && this.store.addResourceBundle(i, a, n, void 0, void 0, { skipCopy: !0 }), this.state[e] = t ? -1 : 2, t && n && (this.state[e] = 0);
1181
+ let o = {};
1182
+ this.queue.forEach((n) => {
1183
+ g(n.loaded, [i], a), oe(n, e), t && n.errors.push(t), n.pendingCount === 0 && !n.done && (Object.keys(n.loaded).forEach((e) => {
1184
+ o[e] || (o[e] = {});
1185
+ let t = n.loaded[e];
1186
+ t.length && t.forEach((t) => {
1187
+ o[e][t] === void 0 && (o[e][t] = !0);
1188
+ });
1189
+ }), n.done = !0, n.errors.length ? n.callback(n.errors) : n.callback());
1190
+ }), this.emit("loaded", o), this.queue = this.queue.filter((e) => !e.done);
1191
+ }
1192
+ read(e, t, n, r = 0, i = this.retryTimeout, a) {
1193
+ if (!e.length) return a(null, {});
1194
+ if (this.readingCalls >= this.maxParallelReads) {
1195
+ this.waitingReads.push({
1196
+ lng: e,
1197
+ ns: t,
1198
+ fcName: n,
1199
+ tried: r,
1200
+ wait: i,
1201
+ callback: a
1202
+ });
1203
+ return;
1204
+ }
1205
+ this.readingCalls++;
1206
+ let o = (o, s) => {
1207
+ if (this.readingCalls--, this.waitingReads.length > 0) {
1208
+ let e = this.waitingReads.shift();
1209
+ this.read(e.lng, e.ns, e.fcName, e.tried, e.wait, e.callback);
1210
+ }
1211
+ if (o && s && r < this.maxRetries) {
1212
+ setTimeout(() => {
1213
+ this.read.call(this, e, t, n, r + 1, i * 2, a);
1214
+ }, i);
1215
+ return;
1216
+ }
1217
+ a(o, s);
1218
+ }, s = this.backend[n].bind(this.backend);
1219
+ if (s.length === 2) {
1220
+ try {
1221
+ let n = s(e, t);
1222
+ n && typeof n.then == "function" ? n.then((e) => o(null, e)).catch(o) : o(null, n);
1223
+ } catch (e) {
1224
+ o(e);
1225
+ }
1226
+ return;
1227
+ }
1228
+ return s(e, t, o);
1229
+ }
1230
+ prepareLoading(e, t, n = {}, r) {
1231
+ if (!this.backend) return this.logger.warn("No backend was added via i18next.use. Will not load resources."), r && r();
1232
+ s(e) && (e = this.languageUtils.toResolveHierarchy(e)), s(t) && (t = [t]);
1233
+ let i = this.queueLoad(e, t, n, r);
1234
+ if (!i.toLoad.length) return i.pending.length || r(), null;
1235
+ i.toLoad.forEach((e) => {
1236
+ this.loadOne(e);
1237
+ });
1238
+ }
1239
+ load(e, t, n) {
1240
+ this.prepareLoading(e, t, {}, n);
1241
+ }
1242
+ reload(e, t, n) {
1243
+ this.prepareLoading(e, t, { reload: !0 }, n);
1244
+ }
1245
+ loadOne(e, t = "") {
1246
+ let n = e.split("|"), r = n[0], i = n[1];
1247
+ this.read(r, i, "read", void 0, void 0, (n, a) => {
1248
+ n && this.logger.warn(`${t}loading namespace ${i} for language ${r} failed`, n), !n && a && this.logger.log(`${t}loaded namespace ${i} for language ${r}`, a), this.loaded(e, n, a);
1249
+ });
1250
+ }
1251
+ saveMissing(e, t, n, r, i, a = {}, o = () => {}) {
1252
+ if (this.services?.utils?.hasLoadedNamespace && !this.services?.utils?.hasLoadedNamespace(t)) {
1253
+ this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`, "This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");
1254
+ return;
1255
+ }
1256
+ if (!(n == null || n === "")) {
1257
+ if (this.backend?.create) {
1258
+ let s = {
1259
+ ...a,
1260
+ isUpdate: i
1261
+ }, c = this.backend.create.bind(this.backend);
1262
+ if (c.length < 6) try {
1263
+ let i;
1264
+ i = c.length === 5 ? c(e, t, n, r, s) : c(e, t, n, r), i && typeof i.then == "function" ? i.then((e) => o(null, e)).catch(o) : o(null, i);
1265
+ } catch (e) {
1266
+ o(e);
1267
+ }
1268
+ else c(e, t, n, r, o, s);
1269
+ }
1270
+ !e || !e[0] || this.store.addResource(e[0], t, n, r);
1271
+ }
1272
+ }
1273
+ }, G = () => ({
1274
+ debug: !1,
1275
+ initAsync: !0,
1276
+ ns: ["translation"],
1277
+ defaultNS: ["translation"],
1278
+ fallbackLng: ["dev"],
1279
+ fallbackNS: !1,
1280
+ supportedLngs: !1,
1281
+ nonExplicitSupportedLngs: !1,
1282
+ load: "all",
1283
+ preload: !1,
1284
+ simplifyPluralSuffix: !0,
1285
+ keySeparator: ".",
1286
+ nsSeparator: ":",
1287
+ pluralSeparator: "_",
1288
+ contextSeparator: "_",
1289
+ partialBundledLanguages: !1,
1290
+ saveMissing: !1,
1291
+ updateMissing: !1,
1292
+ saveMissingTo: "fallback",
1293
+ saveMissingPlurals: !0,
1294
+ missingKeyHandler: !1,
1295
+ missingInterpolationHandler: !1,
1296
+ postProcess: !1,
1297
+ postProcessPassResolved: !1,
1298
+ returnNull: !1,
1299
+ returnEmptyString: !0,
1300
+ returnObjects: !1,
1301
+ joinArrays: !1,
1302
+ returnedObjectHandler: !1,
1303
+ parseMissingKeyHandler: !1,
1304
+ appendNamespaceToMissingKey: !1,
1305
+ appendNamespaceToCIMode: !1,
1306
+ overloadTranslationOptionHandler: (e) => {
1307
+ let t = {};
1308
+ if (typeof e[1] == "object" && (t = e[1]), s(e[1]) && (t.defaultValue = e[1]), s(e[2]) && (t.tDescription = e[2]), typeof e[2] == "object" || typeof e[3] == "object") {
1309
+ let n = e[3] || e[2];
1310
+ Object.keys(n).forEach((e) => {
1311
+ t[e] = n[e];
1312
+ });
1313
+ }
1314
+ return t;
1315
+ },
1316
+ interpolation: {
1317
+ escapeValue: !0,
1318
+ format: (e) => e,
1319
+ prefix: "{{",
1320
+ suffix: "}}",
1321
+ formatSeparator: ",",
1322
+ unescapePrefix: "-",
1323
+ nestingPrefix: "$t(",
1324
+ nestingSuffix: ")",
1325
+ nestingOptionsSeparator: ",",
1326
+ maxReplaces: 1e3,
1327
+ skipOnVariables: !0
1328
+ },
1329
+ cacheInBuiltFormats: !0
1330
+ }), K = (e) => (s(e.ns) && (e.ns = [e.ns]), s(e.fallbackLng) && (e.fallbackLng = [e.fallbackLng]), s(e.fallbackNS) && (e.fallbackNS = [e.fallbackNS]), e.supportedLngs?.indexOf?.("cimode") < 0 && (e.supportedLngs = e.supportedLngs.concat(["cimode"])), typeof e.initImmediate == "boolean" && (e.initAsync = e.initImmediate), e), q = () => {}, ce = (e) => {
1331
+ Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((t) => {
1332
+ typeof e[t] == "function" && (e[t] = e[t].bind(e));
1333
+ });
1334
+ }, J = "__i18next_supportNoticeShown", le = () => !!(typeof globalThis < "u" && globalThis[J] || typeof process < "u" && process.env && process.env.I18NEXT_NO_SUPPORT_NOTICE || typeof process < "u" && process.env), ue = () => {
1335
+ typeof globalThis < "u" && (globalThis[J] = !0);
1336
+ }, de = (e) => !!(e?.modules?.backend?.name?.indexOf("Locize") > 0 || e?.modules?.backend?.constructor?.name?.indexOf("Locize") > 0 || e?.options?.backend?.backends && e.options.backend.backends.some((e) => e?.name?.indexOf("Locize") > 0 || e?.constructor?.name?.indexOf("Locize") > 0) || e?.options?.backend?.projectId || e?.options?.backend?.backendOptions && e.options.backend.backendOptions.some((e) => e?.projectId)), Y = class e extends A {
1337
+ constructor(e = {}, t) {
1338
+ if (super(), this.options = K(e), this.services = {}, this.logger = k, this.modules = { external: [] }, ce(this), t && !this.isInitialized && !e.isClone) {
1339
+ if (!this.options.initAsync) return this.init(e, t), this;
1340
+ setTimeout(() => {
1341
+ this.init(e, t);
1342
+ }, 0);
1343
+ }
1344
+ }
1345
+ init(e = {}, t) {
1346
+ this.isInitializing = !0, typeof e == "function" && (t = e, e = {}), e.defaultNS == null && e.ns && (s(e.ns) ? e.defaultNS = e.ns : e.ns.indexOf("translation") < 0 && (e.defaultNS = e.ns[0]));
1347
+ let n = G();
1348
+ this.options = {
1349
+ ...n,
1350
+ ...this.options,
1351
+ ...K(e)
1352
+ }, this.options.interpolation = {
1353
+ ...n.interpolation,
1354
+ ...this.options.interpolation
1355
+ }, e.keySeparator !== void 0 && (this.options.userDefinedKeySeparator = e.keySeparator), e.nsSeparator !== void 0 && (this.options.userDefinedNsSeparator = e.nsSeparator), typeof this.options.overloadTranslationOptionHandler != "function" && (this.options.overloadTranslationOptionHandler = n.overloadTranslationOptionHandler), this.options.showSupportNotice !== !1 && !de(this) && !le() && (typeof console < "u" && console.info !== void 0 && console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"), ue());
1356
+ let r = (e) => e ? typeof e == "function" ? new e() : e : null;
1357
+ if (!this.options.isClone) {
1358
+ this.modules.logger ? k.init(r(this.modules.logger), this.options) : k.init(null, this.options);
1359
+ let e;
1360
+ e = this.modules.formatter ? this.modules.formatter : ae;
1361
+ let t = new R(this.options);
1362
+ this.store = new j(this.options.resources, this.options);
1363
+ let i = this.services;
1364
+ i.logger = k, i.resourceStore = this.store, i.languageUtils = t, i.pluralResolver = new ne(t, {
1365
+ prepend: this.options.pluralSeparator,
1366
+ simplifyPluralSuffix: this.options.simplifyPluralSuffix
1367
+ }), this.options.interpolation.format && this.options.interpolation.format !== n.interpolation.format && this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"), e && (!this.options.interpolation.format || this.options.interpolation.format === n.interpolation.format) && (i.formatter = r(e), i.formatter.init && i.formatter.init(i, this.options), this.options.interpolation.format = i.formatter.format.bind(i.formatter)), i.interpolator = new U(this.options), i.utils = { hasLoadedNamespace: this.hasLoadedNamespace.bind(this) }, i.backendConnector = new se(r(this.modules.backend), i.resourceStore, i, this.options), i.backendConnector.on("*", (e, ...t) => {
1368
+ this.emit(e, ...t);
1369
+ }), this.modules.languageDetector && (i.languageDetector = r(this.modules.languageDetector), i.languageDetector.init && i.languageDetector.init(i, this.options.detection, this.options)), this.modules.i18nFormat && (i.i18nFormat = r(this.modules.i18nFormat), i.i18nFormat.init && i.i18nFormat.init(this)), this.translator = new L(this.services, this.options), this.translator.on("*", (e, ...t) => {
1370
+ this.emit(e, ...t);
1371
+ }), this.modules.external.forEach((e) => {
1372
+ e.init && e.init(this);
1373
+ });
1374
+ }
1375
+ if (this.format = this.options.interpolation.format, t ||= q, this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
1376
+ let e = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
1377
+ e.length > 0 && e[0] !== "dev" && (this.options.lng = e[0]);
1378
+ }
1379
+ !this.services.languageDetector && !this.options.lng && this.logger.warn("init: no languageDetector is used and no lng is defined"), [
1380
+ "getResource",
1381
+ "hasResourceBundle",
1382
+ "getResourceBundle",
1383
+ "getDataByLanguage"
1384
+ ].forEach((e) => {
1385
+ this[e] = (...t) => this.store[e](...t);
1386
+ }), [
1387
+ "addResource",
1388
+ "addResources",
1389
+ "addResourceBundle",
1390
+ "removeResourceBundle"
1391
+ ].forEach((e) => {
1392
+ this[e] = (...t) => (this.store[e](...t), this);
1393
+ });
1394
+ let i = c(), a = () => {
1395
+ let e = (e, n) => {
1396
+ this.isInitializing = !1, this.isInitialized && !this.initializedStoreOnce && this.logger.warn("init: i18next is already initialized. You should call init just once!"), this.isInitialized = !0, this.options.isClone || this.logger.log("initialized", this.options), this.emit("initialized", this.options), i.resolve(n), t(e, n);
1397
+ };
1398
+ if (this.languages && !this.isInitialized) return e(null, this.t.bind(this));
1399
+ this.changeLanguage(this.options.lng, e);
1400
+ };
1401
+ return this.options.resources || !this.options.initAsync ? a() : setTimeout(a, 0), i;
1402
+ }
1403
+ loadResources(e, t = q) {
1404
+ let n = t, r = s(e) ? e : this.language;
1405
+ if (typeof e == "function" && (n = e), !this.options.resources || this.options.partialBundledLanguages) {
1406
+ if (r?.toLowerCase() === "cimode" && (!this.options.preload || this.options.preload.length === 0)) return n();
1407
+ let e = [], t = (t) => {
1408
+ t && t !== "cimode" && this.services.languageUtils.toResolveHierarchy(t).forEach((t) => {
1409
+ t !== "cimode" && e.indexOf(t) < 0 && e.push(t);
1410
+ });
1411
+ };
1412
+ r ? t(r) : this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e) => t(e)), this.options.preload?.forEach?.((e) => t(e)), this.services.backendConnector.load(e, this.options.ns, (e) => {
1413
+ !e && !this.resolvedLanguage && this.language && this.setResolvedLanguage(this.language), n(e);
1414
+ });
1415
+ } else n(null);
1416
+ }
1417
+ reloadResources(e, t, n) {
1418
+ let r = c();
1419
+ return typeof e == "function" && (n = e, e = void 0), typeof t == "function" && (n = t, t = void 0), e ||= this.languages, t ||= this.options.ns, n ||= q, this.services.backendConnector.reload(e, t, (e) => {
1420
+ r.resolve(), n(e);
1421
+ }), r;
1422
+ }
1423
+ use(e) {
1424
+ if (!e) throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");
1425
+ if (!e.type) throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");
1426
+ return e.type === "backend" && (this.modules.backend = e), (e.type === "logger" || e.log && e.warn && e.error) && (this.modules.logger = e), e.type === "languageDetector" && (this.modules.languageDetector = e), e.type === "i18nFormat" && (this.modules.i18nFormat = e), e.type === "postProcessor" && M.addPostProcessor(e), e.type === "formatter" && (this.modules.formatter = e), e.type === "3rdParty" && this.modules.external.push(e), this;
1427
+ }
1428
+ setResolvedLanguage(e) {
1429
+ if (!(!e || !this.languages) && !(["cimode", "dev"].indexOf(e) > -1)) {
1430
+ for (let e = 0; e < this.languages.length; e++) {
1431
+ let t = this.languages[e];
1432
+ if (!(["cimode", "dev"].indexOf(t) > -1) && this.store.hasLanguageSomeTranslations(t)) {
1433
+ this.resolvedLanguage = t;
1434
+ break;
1435
+ }
1436
+ }
1437
+ !this.resolvedLanguage && this.languages.indexOf(e) < 0 && this.store.hasLanguageSomeTranslations(e) && (this.resolvedLanguage = e, this.languages.unshift(e));
1438
+ }
1439
+ }
1440
+ changeLanguage(e, t) {
1441
+ this.isLanguageChangingTo = e;
1442
+ let n = c();
1443
+ this.emit("languageChanging", e);
1444
+ let r = (e) => {
1445
+ this.language = e, this.languages = this.services.languageUtils.toResolveHierarchy(e), this.resolvedLanguage = void 0, this.setResolvedLanguage(e);
1446
+ }, i = (i, a) => {
1447
+ a ? this.isLanguageChangingTo === e && (r(a), this.translator.changeLanguage(a), this.isLanguageChangingTo = void 0, this.emit("languageChanged", a), this.logger.log("languageChanged", a)) : this.isLanguageChangingTo = void 0, n.resolve((...e) => this.t(...e)), t && t(i, (...e) => this.t(...e));
1448
+ }, a = (t) => {
1449
+ !e && !t && this.services.languageDetector && (t = []);
1450
+ let n = s(t) ? t : t && t[0], a = this.store.hasLanguageSomeTranslations(n) ? n : this.services.languageUtils.getBestMatchFromCodes(s(t) ? [t] : t);
1451
+ a && (this.language || r(a), this.translator.language || this.translator.changeLanguage(a), this.services.languageDetector?.cacheUserLanguage?.(a)), this.loadResources(a, (e) => {
1452
+ i(e, a);
1453
+ });
1454
+ };
1455
+ return !e && this.services.languageDetector && !this.services.languageDetector.async ? a(this.services.languageDetector.detect()) : !e && this.services.languageDetector && this.services.languageDetector.async ? this.services.languageDetector.detect.length === 0 ? this.services.languageDetector.detect().then(a) : this.services.languageDetector.detect(a) : a(e), n;
1456
+ }
1457
+ getFixedT(e, t, n) {
1458
+ let r = (e, t, ...i) => {
1459
+ let a;
1460
+ a = typeof t == "object" ? { ...t } : this.options.overloadTranslationOptionHandler([e, t].concat(i)), a.lng = a.lng || r.lng, a.lngs = a.lngs || r.lngs, a.ns = a.ns || r.ns, a.keyPrefix !== "" && (a.keyPrefix = a.keyPrefix || n || r.keyPrefix);
1461
+ let o = {
1462
+ ...this.options,
1463
+ ...a
1464
+ };
1465
+ typeof a.keyPrefix == "function" && (a.keyPrefix = P(a.keyPrefix, o));
1466
+ let s = this.options.keySeparator || ".", c;
1467
+ return a.keyPrefix && Array.isArray(e) ? c = e.map((e) => (typeof e == "function" && (e = P(e, o)), `${a.keyPrefix}${s}${e}`)) : (typeof e == "function" && (e = P(e, o)), c = a.keyPrefix ? `${a.keyPrefix}${s}${e}` : e), this.t(c, a);
1468
+ };
1469
+ return s(e) ? r.lng = e : r.lngs = e, r.ns = t, r.keyPrefix = n, r;
1470
+ }
1471
+ t(...e) {
1472
+ return this.translator?.translate(...e);
1473
+ }
1474
+ exists(...e) {
1475
+ return this.translator?.exists(...e);
1476
+ }
1477
+ setDefaultNamespace(e) {
1478
+ this.options.defaultNS = e;
1479
+ }
1480
+ hasLoadedNamespace(e, t = {}) {
1481
+ if (!this.isInitialized) return this.logger.warn("hasLoadedNamespace: i18next was not initialized", this.languages), !1;
1482
+ if (!this.languages || !this.languages.length) return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty", this.languages), !1;
1483
+ let n = t.lng || this.resolvedLanguage || this.languages[0], r = this.options ? this.options.fallbackLng : !1, i = this.languages[this.languages.length - 1];
1484
+ if (n.toLowerCase() === "cimode") return !0;
1485
+ let a = (e, t) => {
1486
+ let n = this.services.backendConnector.state[`${e}|${t}`];
1487
+ return n === -1 || n === 0 || n === 2;
1488
+ };
1489
+ if (t.precheck) {
1490
+ let e = t.precheck(this, a);
1491
+ if (e !== void 0) return e;
1492
+ }
1493
+ return !!(this.hasResourceBundle(n, e) || !this.services.backendConnector.backend || this.options.resources && !this.options.partialBundledLanguages || a(n, e) && (!r || a(i, e)));
1494
+ }
1495
+ loadNamespaces(e, t) {
1496
+ let n = c();
1497
+ return this.options.ns ? (s(e) && (e = [e]), e.forEach((e) => {
1498
+ this.options.ns.indexOf(e) < 0 && this.options.ns.push(e);
1499
+ }), this.loadResources((e) => {
1500
+ n.resolve(), t && t(e);
1501
+ }), n) : (t && t(), Promise.resolve());
1502
+ }
1503
+ loadLanguages(e, t) {
1504
+ let n = c();
1505
+ s(e) && (e = [e]);
1506
+ let r = this.options.preload || [], i = e.filter((e) => r.indexOf(e) < 0 && this.services.languageUtils.isSupportedCode(e));
1507
+ return i.length ? (this.options.preload = r.concat(i), this.loadResources((e) => {
1508
+ n.resolve(), t && t(e);
1509
+ }), n) : (t && t(), Promise.resolve());
1510
+ }
1511
+ dir(e) {
1512
+ if (e ||= this.resolvedLanguage || (this.languages?.length > 0 ? this.languages[0] : this.language), !e) return "rtl";
1513
+ try {
1514
+ let t = new Intl.Locale(e);
1515
+ if (t && t.getTextInfo) {
1516
+ let e = t.getTextInfo();
1517
+ if (e && e.direction) return e.direction;
1518
+ }
1519
+ } catch {}
1520
+ let t = /* @__PURE__ */ "ar.shu.sqr.ssh.xaa.yhd.yud.aao.abh.abv.acm.acq.acw.acx.acy.adf.ads.aeb.aec.afb.ajp.apc.apd.arb.arq.ars.ary.arz.auz.avl.ayh.ayl.ayn.ayp.bbz.pga.he.iw.ps.pbt.pbu.pst.prp.prd.ug.ur.ydd.yds.yih.ji.yi.hbo.men.xmn.fa.jpr.peo.pes.prs.dv.sam.ckb".split("."), n = this.services?.languageUtils || new R(G());
1521
+ return e.toLowerCase().indexOf("-latn") > 1 ? "ltr" : t.indexOf(n.getLanguagePartFromCode(e)) > -1 || e.toLowerCase().indexOf("-arab") > 1 ? "rtl" : "ltr";
1522
+ }
1523
+ static createInstance(t = {}, n) {
1524
+ let r = new e(t, n);
1525
+ return r.createInstance = e.createInstance, r;
1526
+ }
1527
+ cloneInstance(t = {}, n = q) {
1528
+ let r = t.forkResourceStore;
1529
+ r && delete t.forkResourceStore;
1530
+ let i = {
1531
+ ...this.options,
1532
+ ...t,
1533
+ isClone: !0
1534
+ }, a = new e(i);
1535
+ if ((t.debug !== void 0 || t.prefix !== void 0) && (a.logger = a.logger.clone(t)), [
1536
+ "store",
1537
+ "services",
1538
+ "language"
1539
+ ].forEach((e) => {
1540
+ a[e] = this[e];
1541
+ }), a.services = { ...this.services }, a.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, r && (a.store = new j(Object.keys(this.store.data).reduce((e, t) => (e[t] = { ...this.store.data[t] }, e[t] = Object.keys(e[t]).reduce((n, r) => (n[r] = { ...e[t][r] }, n), e[t]), e), {}), i), a.services.resourceStore = a.store), t.interpolation) {
1542
+ let e = {
1543
+ ...G().interpolation,
1544
+ ...this.options.interpolation,
1545
+ ...t.interpolation
1546
+ }, n = {
1547
+ ...i,
1548
+ interpolation: e
1549
+ };
1550
+ a.services.interpolator = new U(n);
1551
+ }
1552
+ return a.translator = new L(a.services, i), a.translator.on("*", (e, ...t) => {
1553
+ a.emit(e, ...t);
1554
+ }), a.init(i, n), a.translator.options = i, a.translator.backendConnector.services.utils = { hasLoadedNamespace: a.hasLoadedNamespace.bind(a) }, a;
1555
+ }
1556
+ toJSON() {
1557
+ return {
1558
+ options: this.options,
1559
+ store: this.store,
1560
+ language: this.language,
1561
+ languages: this.languages,
1562
+ resolvedLanguage: this.resolvedLanguage
1563
+ };
1564
+ }
1565
+ }.createInstance();
1566
+ //#endregion
1567
+ //#region ../../lib-react/translator/dist/index.js
1568
+ Y.createInstance, Y.dir, Y.init, Y.loadResources, Y.reloadResources, Y.use, Y.changeLanguage, Y.getFixedT, Y.t, Y.exists, Y.setDefaultNamespace, Y.hasLoadedNamespace, Y.loadNamespaces, Y.loadLanguages, Y.init({
1569
+ fallbackLng: "en",
1570
+ lng: "en",
1571
+ debug: !0,
1572
+ resources: {
1573
+ en: a,
1574
+ es: o
1575
+ }
1576
+ });
1577
+ var fe = {
1578
+ translator: {
1579
+ ...Y,
1580
+ t: (e, t) => {
1581
+ let { lng: n } = t;
1582
+ switch (n) {
1583
+ case "en_US":
1584
+ case "en-US":
1585
+ t.lng = "en";
1586
+ break;
1587
+ case "es_ES":
1588
+ case "es-ES":
1589
+ case "es_MX":
1590
+ case "es-MX":
1591
+ t.lng = "es";
1592
+ break;
1593
+ default: break;
1594
+ }
1595
+ return Y.t(e, {
1596
+ lng: n,
1597
+ ...t
1598
+ });
1599
+ }
1600
+ },
1601
+ languageOptions: [{
1602
+ value: "en_US",
1603
+ label: "English (US)"
1604
+ }, {
1605
+ value: "es_ES",
1606
+ label: "Spanish"
1607
+ }]
1608
+ }, pe = /* @__PURE__ */ e(i(), 1), me = Object.prototype;
1609
+ function X(e) {
1610
+ return typeof e == "object" && !!e;
1611
+ }
1612
+ function he(e) {
1613
+ return Array.isArray(e) ? e : typeof e == "number" ? [e] : e.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
1614
+ }
1615
+ function ge(e) {
1616
+ return (t) => Ce(t, e);
1617
+ }
1618
+ function _e(e) {
1619
+ return (t) => X(t) ? Object.entries(e).every(([e, n]) => Ee(t[e], n)) : !1;
1620
+ }
1621
+ function ve(e) {
1622
+ return typeof e == "function" ? e : typeof e == "string" ? ge(e) : X(e) ? _e(e) : ((e) => e);
1623
+ }
1624
+ function ye(e) {
1625
+ return Array.isArray(e) ? e.slice() : X(e) ? { ...e } : e;
1626
+ }
1627
+ function Z(e) {
1628
+ if (!X(e)) return e;
1629
+ if (e instanceof Date) return new Date(e.getTime());
1630
+ if (Array.isArray(e)) return e.map((e) => Z(e));
1631
+ let t = {};
1632
+ for (let [n, r] of Object.entries(e)) t[n] = Z(r);
1633
+ return t;
1634
+ }
1635
+ function be(e) {
1636
+ return (e ?? []).filter(Boolean);
1637
+ }
1638
+ function xe(e, t = 0, n = {}) {
1639
+ let r, i, a, o, s, c = n.leading === !0, l = n.trailing !== !1, u = () => {
1640
+ if (!a) return s;
1641
+ let t = a, n = o;
1642
+ return a = void 0, o = void 0, s = e.apply(n, t), s;
1643
+ }, d = () => {
1644
+ r && clearTimeout(r), i && clearTimeout(i), r = void 0, i = void 0, a = void 0, o = void 0;
1645
+ }, f = function(...e) {
1646
+ let d = c && !r;
1647
+ return a = e, o = this, d && u(), r && clearTimeout(r), r = setTimeout(() => {
1648
+ r = void 0, i &&= (clearTimeout(i), void 0), l ? u() : (a = void 0, o = void 0);
1649
+ }, t), n.maxWait !== void 0 && !i && (i = setTimeout(() => {
1650
+ r && clearTimeout(r), r = void 0, i = void 0, l || !c ? u() : (a = void 0, o = void 0);
1651
+ }, n.maxWait)), s;
1652
+ };
1653
+ return f.cancel = d, f.flush = () => (r &&= (clearTimeout(r), void 0), i &&= (clearTimeout(i), void 0), u()), f;
1654
+ }
1655
+ function Se(e) {
1656
+ let t = [];
1657
+ for (let n of e ?? []) Array.isArray(n) ? t.push(...n) : t.push(n);
1658
+ return t;
1659
+ }
1660
+ function Ce(e, t, n) {
1661
+ if (!Array.isArray(t) && e != null && Object.prototype.hasOwnProperty.call(Object(e), t)) {
1662
+ let r = e[t];
1663
+ return r === void 0 ? n : r;
1664
+ }
1665
+ let r = e;
1666
+ for (let e of he(t)) {
1667
+ if (r == null) return n;
1668
+ r = r[e];
1669
+ }
1670
+ return r === void 0 ? n : r;
1671
+ }
1672
+ function we(e, t) {
1673
+ return typeof e == "string" ? e.includes(String(t)) : Array.isArray(e) ? e.includes(t) : Object.values(e ?? {}).includes(t);
1674
+ }
1675
+ function Te(e) {
1676
+ return e == null ? !0 : typeof e == "string" || Array.isArray(e) ? e.length === 0 : e instanceof Map || e instanceof Set ? e.size === 0 : !X(e) || Object.keys(e).length === 0;
1677
+ }
1678
+ function Q(e, t, n) {
1679
+ let r = n?.(e, t);
1680
+ if (r !== void 0) return !!r;
1681
+ if (Object.is(e, t)) return !0;
1682
+ if (!X(e) || !X(t)) return !1;
1683
+ if (e instanceof Date || t instanceof Date) return e instanceof Date && t instanceof Date && e.getTime() === t.getTime();
1684
+ if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, r) => Q(e, t[r], n));
1685
+ let i = Object.keys(e), a = Object.keys(t);
1686
+ return i.length === a.length && i.every((r) => me.hasOwnProperty.call(t, r) && Q(e[r], t[r], n));
1687
+ }
1688
+ function Ee(e, t) {
1689
+ return Q(e, t);
1690
+ }
1691
+ function De(e) {
1692
+ return Number.isFinite(e);
1693
+ }
1694
+ function Oe(e, ...t) {
1695
+ for (let n of t) if (n) for (let [t, r] of Object.entries(n)) X(r) && !Array.isArray(r) && X(e[t]) ? Oe(e[t], r) : e[t] = Z(r);
1696
+ return e;
1697
+ }
1698
+ function ke(e, t) {
1699
+ let n = { ...e ?? {} };
1700
+ for (let e of Array.isArray(t) ? t : [t]) delete n[e];
1701
+ return n;
1702
+ }
1703
+ function Ae(e, t) {
1704
+ let n = ve(t), r = [];
1705
+ for (let t = e.length - 1; t >= 0; t--) n(e[t], t, e) && r.unshift(...e.splice(t, 1));
1706
+ return r;
1707
+ }
1708
+ function je(e, t, n) {
1709
+ let r = he(t), i = e;
1710
+ return r.forEach((e, t) => {
1711
+ if (t === r.length - 1) {
1712
+ i[e] = n;
1713
+ return;
1714
+ }
1715
+ let a = r[t + 1];
1716
+ i[e] ??= typeof a == "number" || /^\d+$/.test(String(a)) ? [] : {}, i = i[e];
1717
+ }), e;
1718
+ }
1719
+ function Me(e, t) {
1720
+ let n = t ?? ((e) => e);
1721
+ return Array.from({ length: Math.max(0, e) }, (e, t) => n(t));
1722
+ }
1723
+ function Ne(...e) {
1724
+ let t = Math.max(0, ...e.map((e) => e.length));
1725
+ return Array.from({ length: t }, (t, n) => e.map((e) => e[n]));
1726
+ }
1727
+ //#endregion
1728
+ //#region ../../lib-react/categorize/dist/index.js
1729
+ var $ = (0, pe.default)("@pie-lib:categorize"), Pe = (e, t, n) => (t ||= [], t.reduce((t, r) => {
1730
+ let i = Fe(e, r, n - t.count);
1731
+ return t.out.push(i.array), t.count += i.count || 0, t;
1732
+ }, {
1733
+ out: [],
1734
+ count: 0
1735
+ }).out), Fe = (e, t, n) => {
1736
+ if (t ||= [], n === 0) {
1737
+ let n = t.filter((t) => t !== e);
1738
+ return {
1739
+ array: n,
1740
+ count: t.length - n.length
1741
+ };
1742
+ } else {
1743
+ let r = t.reduce((t, r) => (r === e ? t.count < n && (t.count += 1, t.out.push(r)) : t.out.push(r), t), {
1744
+ out: [],
1745
+ count: 0
1746
+ });
1747
+ return {
1748
+ array: r.out,
1749
+ count: r.count
1750
+ };
1751
+ }
1752
+ }, Ie = (e, t) => (t ||= [], t.reduce((e, t) => {
1753
+ if ($("choice: ----> ", t.id, "categoryCount: ", t.categoryCount), t.categoryCount === void 0 || t.categoryCount === 0) return e;
1754
+ {
1755
+ let n = e.map((e) => e.choices);
1756
+ return Pe(t.id, n, t.categoryCount).map((t, n) => ({
1757
+ category: e[n].category,
1758
+ alternateResponses: e[n].alternateResponses,
1759
+ choices: t
1760
+ }));
1761
+ }
1762
+ }, e)), Le = (e, t) => (t ||= [], t.reduce((e, t) => {
1763
+ if ($("choice: ----> ", t.id, "categoryCount: ", t.categoryCount), t.categoryCount === void 0 || t.categoryCount === 0) return e;
1764
+ {
1765
+ let n = {};
1766
+ e.forEach((e) => (e.alternateResponses || []).forEach((e, t) => {
1767
+ t in n || (n[t] = []), n[t].push(e);
1768
+ }));
1769
+ let r = [];
1770
+ return Object.keys(n).forEach((e) => {
1771
+ let i = Pe(t.id, n[e], t.categoryCount);
1772
+ n[e] = i, n[e].forEach((e, t) => {
1773
+ r[t] || (r[t] = []), r[t].push(e);
1774
+ });
1775
+ }), e.map((e, t) => ({
1776
+ category: e.category,
1777
+ alternateResponses: r[t] || e.alternateResponses,
1778
+ choices: e.choices
1779
+ }));
1780
+ }
1781
+ }, e)), Re = (e, t) => {
1782
+ let n = t.reduce((t, n) => t + ze(e, n.choices), 0);
1783
+ return $("[countInAnswer] choiceId:", e, t), n;
1784
+ }, ze = (e, t) => (t || []).filter((t) => t === e).length, Be = (e, t) => !e || !e.id || !Array.isArray(t) ? 0 : t.reduce((t, n) => t + (n.choices || []).filter((t) => t && t.id === e.id).length, 0), Ve = (e, t) => t.filter((t) => t.category !== e), He = (e, t, n) => t.map((t) => {
1785
+ if (!n || t.category === n) {
1786
+ let n = ye(t.choices);
1787
+ return Ae(n, (t) => t === e), {
1788
+ ...t,
1789
+ choices: n
1790
+ };
1791
+ } else return t;
1792
+ }), Ue = (e, t, n) => n.map((n) => n.category === t ? (n.choices = n.choices.reduce((t, n) => (n.id === e.id ? t.findIndex((t) => t.id === e.id) === -1 && t.push(n) : t.push(n), t), []), n) : (n.choices = (n.choices || []).filter((t) => t !== e.id), n)), We = (e, t, n, r) => ($("[removeChoiceFromCategory] choiceIndex:", n), r.map((r) => {
1793
+ if (r.category === t) {
1794
+ let t = ye(r.choices), i = t.findIndex((t, r) => t === e && r >= n);
1795
+ return i !== -1 && t.splice(i, 1), {
1796
+ ...r,
1797
+ choices: t
1798
+ };
1799
+ } else return r;
1800
+ })), Ge = (e, t, n, r, i) => (i || []).map((e) => {
1801
+ if (e?.category === t) {
1802
+ let t = (e?.alternateResponses || []).map((e, t) => (t === r && (e || []).splice(n, 1), e));
1803
+ return {
1804
+ ...e,
1805
+ alternateResponses: t
1806
+ };
1807
+ }
1808
+ return e;
1809
+ }), Ke = (e, t, n, r, i) => ($("[moveChoiceToCategory] choice: ", e, "from: ", t, "to: ", n, "answers: ", i), t === n ? i : (t && (i = We(e, t, r, i)), i.findIndex((e) => e.category === n) === -1 ? (i.push({
1810
+ category: n,
1811
+ choices: [e]
1812
+ }), i) : i.map((t) => t.category === n ? (t.choices = t.choices || [], t.choices.push(e), t) : t))), qe = (e, t, n, r, i, a, o) => ($("[moveChoiceToAlternate] choice: ", e, "from: ", t, "to: ", n, "answers: ", i, "chocieIndex: ", r), t === n ? i : i.map((r) => (r.category === n && (o !== 0 && r.alternateResponses && (r.alternateResponses[a] = (r.alternateResponses[a] || []).filter((t) => t !== e)), r.alternateResponses || (r.alternateResponses = [], r.alternateResponses[a] = []), r.alternateResponses[a].push(e)), r.category === t && o !== 0 && r.alternateResponses && r.alternateResponses[a] && (r.alternateResponses[a] = r.alternateResponses[a].filter((t) => t !== e)), r))), Je = (e, t) => e.categoryCount > 0 ? Be(e, t) < e.categoryCount : !0, Ye = (e, t) => t.reduce((e, t) => {
1813
+ let n = e.copyOfPossibleResponse.findIndex((e) => t && e === t.id);
1814
+ return n >= 0 ? (e.builtChoices.push({
1815
+ ...t,
1816
+ correct: !0
1817
+ }), e.copyOfPossibleResponse = [...e.copyOfPossibleResponse.slice(0, n), ...e.copyOfPossibleResponse.slice(n + 1)]) : (e.builtChoices.push({
1818
+ ...t,
1819
+ correct: !1
1820
+ }), e.allChoicesAreCorrect = !1), e;
1821
+ }, {
1822
+ builtChoices: [],
1823
+ copyOfPossibleResponse: [...e],
1824
+ allChoicesAreCorrect: !0
1825
+ }), Xe = (e, t) => t.reduce((t, n) => {
1826
+ let r = e[n.id] || [], i = n.choices || [], { builtChoices: a, allChoicesAreCorrect: o } = Ye(r, i), s = i.length === r.length;
1827
+ return t.builtCategories.push({
1828
+ ...n,
1829
+ correct: o && s,
1830
+ choices: a
1831
+ }), t.correct = t.correct && o && s, t;
1832
+ }, {
1833
+ builtCategories: [],
1834
+ correct: !0
1835
+ }), Ze = (e) => e ? e.reduce((e, t) => (e[0] ? e[0][t.category] = t.choices : e.push({ [t.category]: t.choices }), t.alternateResponses && t.alternateResponses.forEach((n, r) => {
1836
+ e[r + 1] ? e[r + 1][t.category] = n : e.push({ [t.category]: n });
1837
+ }), e), []) : [], Qe = (e, t, n) => (e ||= [], n ||= [], t ||= [], e.map((e) => {
1838
+ let { choices: r = [] } = n.find((t) => t.category === e.id) || {};
1839
+ return {
1840
+ ...e,
1841
+ choices: r.map((e) => t.find((t) => t.id === e))
1842
+ };
1843
+ })), $e = (e, t, n, r) => {
1844
+ e ||= [], t ||= [], n ||= [];
1845
+ let i = Ze(r) || [], a = Qe(e, t, n), o, s;
1846
+ if (i.length) {
1847
+ let e = i.reduce((e, t) => {
1848
+ let { builtCategories: n, correct: r } = Xe(t, a);
1849
+ return e.bestResponse === null || !e.entirelyCorrect && r ? {
1850
+ bestResponse: t,
1851
+ builtCategories: n,
1852
+ entirelyCorrect: r
1853
+ } : e;
1854
+ }, {
1855
+ bestResponse: null,
1856
+ builtCategories: [],
1857
+ entirelyCorrect: !1
1858
+ });
1859
+ a = e.builtCategories, o = e.bestResponse, s = e.entirelyCorrect;
1860
+ }
1861
+ return {
1862
+ choices: t.map((e) => Je(e, a) ? e : { empty: !0 }),
1863
+ categories: a,
1864
+ correct: s,
1865
+ bestResponse: o
1866
+ };
1867
+ };
1868
+ //#endregion
1869
+ export { be as C, i as D, fe as E, Ne as S, Se as T, we as _, He as a, Z as b, Le as c, Ge as d, Ee as f, Te as g, De as h, Re as i, We as l, je as m, Ue as n, Ie as o, Oe as p, Ke as r, Ve as s, $e as t, qe as u, ke as v, Ce as w, Me as x, xe as y };
1870
+
1871
+ //# sourceMappingURL=dist-C11U2GIc.js.map