gt-sanity 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +138 -0
- package/README.md +100 -0
- package/dist/index.d.mts +241 -0
- package/dist/index.d.ts +241 -0
- package/dist/index.js +2119 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2099 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +92 -0
- package/sanity.json +8 -0
- package/src/adapter/core.ts +44 -0
- package/src/adapter/createTask.ts +41 -0
- package/src/adapter/getLocales.ts +13 -0
- package/src/adapter/getTranslation.ts +20 -0
- package/src/adapter/getTranslationTask.ts +31 -0
- package/src/adapter/index.ts +13 -0
- package/src/components/LanguageStatus.tsx +65 -0
- package/src/components/NewTask.tsx +249 -0
- package/src/components/ProgressBar.tsx +38 -0
- package/src/components/TaskView.tsx +255 -0
- package/src/components/TranslationContext.tsx +19 -0
- package/src/components/TranslationView.tsx +82 -0
- package/src/components/TranslationsTab.tsx +177 -0
- package/src/configuration/README.md +8 -0
- package/src/configuration/baseDocumentLevelConfig/documentLevelPatch.ts +108 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/createI18nDocAndPatchMetadata.ts +47 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/createTranslationMetadata.ts +43 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/getOrCreateTranslationMetadata.ts +77 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/getTranslationMetadata.ts +15 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/index.ts +5 -0
- package/src/configuration/baseDocumentLevelConfig/helpers/patchI18nDoc.ts +25 -0
- package/src/configuration/baseDocumentLevelConfig/index.ts +129 -0
- package/src/configuration/baseDocumentLevelConfig/legacyDocumentLevelPatch.ts +69 -0
- package/src/configuration/baseFieldLevelConfig.ts +118 -0
- package/src/configuration/index.ts +18 -0
- package/src/configuration/utils/checkSerializationVersion.ts +13 -0
- package/src/configuration/utils/findDocumentAtRevision.ts +22 -0
- package/src/configuration/utils/findLatestDraft.ts +16 -0
- package/src/configuration/utils/index.ts +3 -0
- package/src/hooks/useClient.ts +5 -0
- package/src/hooks/useSecrets.ts +33 -0
- package/src/index.ts +120 -0
- package/src/types.ts +124 -0
- package/v2-incompatible.js +11 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2099 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import o, { useDebugValue, createElement, useRef, useContext, useState, useEffect, useCallback, useMemo } from "react";
|
|
3
|
+
import { useClient as useClient$1, useSchema, definePlugin } from "sanity";
|
|
4
|
+
import { randomKey } from "@sanity/util/content";
|
|
5
|
+
import { useToast, Stack, Text, Flex, Button, Grid, Select, Switch, Box, Card, Label, ThemeProvider, Spinner, Layer, ToastProvider } from "@sanity/ui";
|
|
6
|
+
import { CheckmarkCircleIcon, DownloadIcon, ArrowTopRightIcon } from "@sanity/icons";
|
|
7
|
+
import { BaseDocumentMerger, BaseDocumentDeserializer, customBlockDeserializers, BaseDocumentSerializer, defaultStopTypes, customSerializers } from "sanity-naive-html-serializer";
|
|
8
|
+
import { BaseDocumentDeserializer as BaseDocumentDeserializer2, BaseDocumentMerger as BaseDocumentMerger2, BaseDocumentSerializer as BaseDocumentSerializer2, customSerializers as customSerializers2, defaultStopTypes as defaultStopTypes2 } from "sanity-naive-html-serializer";
|
|
9
|
+
import { GT } from "generaltranslation";
|
|
10
|
+
import { libraryDefaultLocale } from "generaltranslation/internal";
|
|
11
|
+
const TranslationContext = o.createContext(
|
|
12
|
+
null
|
|
13
|
+
);
|
|
14
|
+
var __assign = function() {
|
|
15
|
+
return __assign = Object.assign || function(t) {
|
|
16
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17
|
+
s = arguments[i];
|
|
18
|
+
for (var p in s) Object.prototype.hasOwnProperty.call(s, p) && (t[p] = s[p]);
|
|
19
|
+
}
|
|
20
|
+
return t;
|
|
21
|
+
}, __assign.apply(this, arguments);
|
|
22
|
+
};
|
|
23
|
+
function __spreadArray(to, from2, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from2.length, ar; i < l; i++)
|
|
25
|
+
(ar || !(i in from2)) && (ar || (ar = Array.prototype.slice.call(from2, 0, i)), ar[i] = from2[i]);
|
|
26
|
+
return to.concat(ar || Array.prototype.slice.call(from2));
|
|
27
|
+
}
|
|
28
|
+
function memoize(fn) {
|
|
29
|
+
var cache = /* @__PURE__ */ Object.create(null);
|
|
30
|
+
return function(arg) {
|
|
31
|
+
return cache[arg] === void 0 && (cache[arg] = fn(arg)), cache[arg];
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/, isPropValid = /* @__PURE__ */ memoize(
|
|
35
|
+
function(prop) {
|
|
36
|
+
return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110 && prop.charCodeAt(2) < 91;
|
|
37
|
+
}
|
|
38
|
+
/* Z+1 */
|
|
39
|
+
), MS = "-ms-", MOZ = "-moz-", WEBKIT = "-webkit-", COMMENT = "comm", RULESET = "rule", DECLARATION = "decl", IMPORT = "@import", KEYFRAMES = "@keyframes", LAYER = "@layer", abs = Math.abs, from = String.fromCharCode, assign = Object.assign;
|
|
40
|
+
function hash(value, length2) {
|
|
41
|
+
return charat(value, 0) ^ 45 ? (((length2 << 2 ^ charat(value, 0)) << 2 ^ charat(value, 1)) << 2 ^ charat(value, 2)) << 2 ^ charat(value, 3) : 0;
|
|
42
|
+
}
|
|
43
|
+
function trim(value) {
|
|
44
|
+
return value.trim();
|
|
45
|
+
}
|
|
46
|
+
function match(value, pattern) {
|
|
47
|
+
return (value = pattern.exec(value)) ? value[0] : value;
|
|
48
|
+
}
|
|
49
|
+
function replace(value, pattern, replacement) {
|
|
50
|
+
return value.replace(pattern, replacement);
|
|
51
|
+
}
|
|
52
|
+
function indexof(value, search, position2) {
|
|
53
|
+
return value.indexOf(search, position2);
|
|
54
|
+
}
|
|
55
|
+
function charat(value, index) {
|
|
56
|
+
return value.charCodeAt(index) | 0;
|
|
57
|
+
}
|
|
58
|
+
function substr(value, begin, end) {
|
|
59
|
+
return value.slice(begin, end);
|
|
60
|
+
}
|
|
61
|
+
function strlen(value) {
|
|
62
|
+
return value.length;
|
|
63
|
+
}
|
|
64
|
+
function sizeof(value) {
|
|
65
|
+
return value.length;
|
|
66
|
+
}
|
|
67
|
+
function append(value, array) {
|
|
68
|
+
return array.push(value), value;
|
|
69
|
+
}
|
|
70
|
+
function combine(array, callback) {
|
|
71
|
+
return array.map(callback).join("");
|
|
72
|
+
}
|
|
73
|
+
function filter(array, pattern) {
|
|
74
|
+
return array.filter(function(value) {
|
|
75
|
+
return !match(value, pattern);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
var line = 1, column = 1, length = 0, position = 0, character = 0, characters = "";
|
|
79
|
+
function node(value, root, parent, type, props, children, length2, siblings) {
|
|
80
|
+
return { value, root, parent, type, props, children, line, column, length: length2, return: "", siblings };
|
|
81
|
+
}
|
|
82
|
+
function copy(root, props) {
|
|
83
|
+
return assign(node("", null, null, "", null, null, 0, root.siblings), root, { length: -root.length }, props);
|
|
84
|
+
}
|
|
85
|
+
function lift(root) {
|
|
86
|
+
for (; root.root; )
|
|
87
|
+
root = copy(root.root, { children: [root] });
|
|
88
|
+
append(root, root.siblings);
|
|
89
|
+
}
|
|
90
|
+
function char() {
|
|
91
|
+
return character;
|
|
92
|
+
}
|
|
93
|
+
function prev() {
|
|
94
|
+
return character = position > 0 ? charat(characters, --position) : 0, column--, character === 10 && (column = 1, line--), character;
|
|
95
|
+
}
|
|
96
|
+
function next() {
|
|
97
|
+
return character = position < length ? charat(characters, position++) : 0, column++, character === 10 && (column = 1, line++), character;
|
|
98
|
+
}
|
|
99
|
+
function peek() {
|
|
100
|
+
return charat(characters, position);
|
|
101
|
+
}
|
|
102
|
+
function caret() {
|
|
103
|
+
return position;
|
|
104
|
+
}
|
|
105
|
+
function slice(begin, end) {
|
|
106
|
+
return substr(characters, begin, end);
|
|
107
|
+
}
|
|
108
|
+
function token(type) {
|
|
109
|
+
switch (type) {
|
|
110
|
+
// \0 \t \n \r \s whitespace token
|
|
111
|
+
case 0:
|
|
112
|
+
case 9:
|
|
113
|
+
case 10:
|
|
114
|
+
case 13:
|
|
115
|
+
case 32:
|
|
116
|
+
return 5;
|
|
117
|
+
// ! + , / > @ ~ isolate token
|
|
118
|
+
case 33:
|
|
119
|
+
case 43:
|
|
120
|
+
case 44:
|
|
121
|
+
case 47:
|
|
122
|
+
case 62:
|
|
123
|
+
case 64:
|
|
124
|
+
case 126:
|
|
125
|
+
// ; { } breakpoint token
|
|
126
|
+
case 59:
|
|
127
|
+
case 123:
|
|
128
|
+
case 125:
|
|
129
|
+
return 4;
|
|
130
|
+
// : accompanied token
|
|
131
|
+
case 58:
|
|
132
|
+
return 3;
|
|
133
|
+
// " ' ( [ opening delimit token
|
|
134
|
+
case 34:
|
|
135
|
+
case 39:
|
|
136
|
+
case 40:
|
|
137
|
+
case 91:
|
|
138
|
+
return 2;
|
|
139
|
+
// ) ] closing delimit token
|
|
140
|
+
case 41:
|
|
141
|
+
case 93:
|
|
142
|
+
return 1;
|
|
143
|
+
}
|
|
144
|
+
return 0;
|
|
145
|
+
}
|
|
146
|
+
function alloc(value) {
|
|
147
|
+
return line = column = 1, length = strlen(characters = value), position = 0, [];
|
|
148
|
+
}
|
|
149
|
+
function dealloc(value) {
|
|
150
|
+
return characters = "", value;
|
|
151
|
+
}
|
|
152
|
+
function delimit(type) {
|
|
153
|
+
return trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)));
|
|
154
|
+
}
|
|
155
|
+
function whitespace(type) {
|
|
156
|
+
for (; (character = peek()) && character < 33; )
|
|
157
|
+
next();
|
|
158
|
+
return token(type) > 2 || token(character) > 3 ? "" : " ";
|
|
159
|
+
}
|
|
160
|
+
function escaping(index, count) {
|
|
161
|
+
for (; --count && next() && !(character < 48 || character > 102 || character > 57 && character < 65 || character > 70 && character < 97); )
|
|
162
|
+
;
|
|
163
|
+
return slice(index, caret() + (count < 6 && peek() == 32 && next() == 32));
|
|
164
|
+
}
|
|
165
|
+
function delimiter(type) {
|
|
166
|
+
for (; next(); )
|
|
167
|
+
switch (character) {
|
|
168
|
+
// ] ) " '
|
|
169
|
+
case type:
|
|
170
|
+
return position;
|
|
171
|
+
// " '
|
|
172
|
+
case 34:
|
|
173
|
+
case 39:
|
|
174
|
+
type !== 34 && type !== 39 && delimiter(character);
|
|
175
|
+
break;
|
|
176
|
+
// (
|
|
177
|
+
case 40:
|
|
178
|
+
type === 41 && delimiter(type);
|
|
179
|
+
break;
|
|
180
|
+
// \
|
|
181
|
+
case 92:
|
|
182
|
+
next();
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
return position;
|
|
186
|
+
}
|
|
187
|
+
function commenter(type, index) {
|
|
188
|
+
for (; next() && type + character !== 57; )
|
|
189
|
+
if (type + character === 84 && peek() === 47)
|
|
190
|
+
break;
|
|
191
|
+
return "/*" + slice(index, position - 1) + "*" + from(type === 47 ? type : next());
|
|
192
|
+
}
|
|
193
|
+
function identifier(index) {
|
|
194
|
+
for (; !token(peek()); )
|
|
195
|
+
next();
|
|
196
|
+
return slice(index, position);
|
|
197
|
+
}
|
|
198
|
+
function compile(value) {
|
|
199
|
+
return dealloc(parse("", null, null, null, [""], value = alloc(value), 0, [0], value));
|
|
200
|
+
}
|
|
201
|
+
function parse(value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {
|
|
202
|
+
for (var index = 0, offset = 0, length2 = pseudo, atrule = 0, property = 0, previous = 0, variable = 1, scanning = 1, ampersand = 1, character2 = 0, type = "", props = rules, children = rulesets, reference = rule, characters2 = type; scanning; )
|
|
203
|
+
switch (previous = character2, character2 = next()) {
|
|
204
|
+
// (
|
|
205
|
+
case 40:
|
|
206
|
+
if (previous != 108 && charat(characters2, length2 - 1) == 58) {
|
|
207
|
+
indexof(characters2 += replace(delimit(character2), "&", "&\f"), "&\f", abs(index ? points[index - 1] : 0)) != -1 && (ampersand = -1);
|
|
208
|
+
break;
|
|
209
|
+
}
|
|
210
|
+
// " ' [
|
|
211
|
+
case 34:
|
|
212
|
+
case 39:
|
|
213
|
+
case 91:
|
|
214
|
+
characters2 += delimit(character2);
|
|
215
|
+
break;
|
|
216
|
+
// \t \n \r \s
|
|
217
|
+
case 9:
|
|
218
|
+
case 10:
|
|
219
|
+
case 13:
|
|
220
|
+
case 32:
|
|
221
|
+
characters2 += whitespace(previous);
|
|
222
|
+
break;
|
|
223
|
+
// \
|
|
224
|
+
case 92:
|
|
225
|
+
characters2 += escaping(caret() - 1, 7);
|
|
226
|
+
continue;
|
|
227
|
+
// /
|
|
228
|
+
case 47:
|
|
229
|
+
switch (peek()) {
|
|
230
|
+
case 42:
|
|
231
|
+
case 47:
|
|
232
|
+
append(comment(commenter(next(), caret()), root, parent, declarations), declarations);
|
|
233
|
+
break;
|
|
234
|
+
default:
|
|
235
|
+
characters2 += "/";
|
|
236
|
+
}
|
|
237
|
+
break;
|
|
238
|
+
// {
|
|
239
|
+
case 123 * variable:
|
|
240
|
+
points[index++] = strlen(characters2) * ampersand;
|
|
241
|
+
// } ; \0
|
|
242
|
+
case 125 * variable:
|
|
243
|
+
case 59:
|
|
244
|
+
case 0:
|
|
245
|
+
switch (character2) {
|
|
246
|
+
// \0 }
|
|
247
|
+
case 0:
|
|
248
|
+
case 125:
|
|
249
|
+
scanning = 0;
|
|
250
|
+
// ;
|
|
251
|
+
case 59 + offset:
|
|
252
|
+
ampersand == -1 && (characters2 = replace(characters2, /\f/g, "")), property > 0 && strlen(characters2) - length2 && append(property > 32 ? declaration(characters2 + ";", rule, parent, length2 - 1, declarations) : declaration(replace(characters2, " ", "") + ";", rule, parent, length2 - 2, declarations), declarations);
|
|
253
|
+
break;
|
|
254
|
+
// @ ;
|
|
255
|
+
case 59:
|
|
256
|
+
characters2 += ";";
|
|
257
|
+
// { rule/at-rule
|
|
258
|
+
default:
|
|
259
|
+
if (append(reference = ruleset(characters2, root, parent, index, offset, rules, points, type, props = [], children = [], length2, rulesets), rulesets), character2 === 123)
|
|
260
|
+
if (offset === 0)
|
|
261
|
+
parse(characters2, root, reference, reference, props, rulesets, length2, points, children);
|
|
262
|
+
else
|
|
263
|
+
switch (atrule === 99 && charat(characters2, 3) === 110 ? 100 : atrule) {
|
|
264
|
+
// d l m s
|
|
265
|
+
case 100:
|
|
266
|
+
case 108:
|
|
267
|
+
case 109:
|
|
268
|
+
case 115:
|
|
269
|
+
parse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length2, children), children), rules, children, length2, points, rule ? props : children);
|
|
270
|
+
break;
|
|
271
|
+
default:
|
|
272
|
+
parse(characters2, reference, reference, reference, [""], children, 0, points, children);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
index = offset = property = 0, variable = ampersand = 1, type = characters2 = "", length2 = pseudo;
|
|
276
|
+
break;
|
|
277
|
+
// :
|
|
278
|
+
case 58:
|
|
279
|
+
length2 = 1 + strlen(characters2), property = previous;
|
|
280
|
+
default:
|
|
281
|
+
if (variable < 1) {
|
|
282
|
+
if (character2 == 123)
|
|
283
|
+
--variable;
|
|
284
|
+
else if (character2 == 125 && variable++ == 0 && prev() == 125)
|
|
285
|
+
continue;
|
|
286
|
+
}
|
|
287
|
+
switch (characters2 += from(character2), character2 * variable) {
|
|
288
|
+
// &
|
|
289
|
+
case 38:
|
|
290
|
+
ampersand = offset > 0 ? 1 : (characters2 += "\f", -1);
|
|
291
|
+
break;
|
|
292
|
+
// ,
|
|
293
|
+
case 44:
|
|
294
|
+
points[index++] = (strlen(characters2) - 1) * ampersand, ampersand = 1;
|
|
295
|
+
break;
|
|
296
|
+
// @
|
|
297
|
+
case 64:
|
|
298
|
+
peek() === 45 && (characters2 += delimit(next())), atrule = peek(), offset = length2 = strlen(type = characters2 += identifier(caret())), character2++;
|
|
299
|
+
break;
|
|
300
|
+
// -
|
|
301
|
+
case 45:
|
|
302
|
+
previous === 45 && strlen(characters2) == 2 && (variable = 0);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return rulesets;
|
|
306
|
+
}
|
|
307
|
+
function ruleset(value, root, parent, index, offset, rules, points, type, props, children, length2, siblings) {
|
|
308
|
+
for (var post = offset - 1, rule = offset === 0 ? rules : [""], size = sizeof(rule), i = 0, j2 = 0, k2 = 0; i < index; ++i)
|
|
309
|
+
for (var x2 = 0, y2 = substr(value, post + 1, post = abs(j2 = points[i])), z2 = value; x2 < size; ++x2)
|
|
310
|
+
(z2 = trim(j2 > 0 ? rule[x2] + " " + y2 : replace(y2, /&\f/g, rule[x2]))) && (props[k2++] = z2);
|
|
311
|
+
return node(value, root, parent, offset === 0 ? RULESET : type, props, children, length2, siblings);
|
|
312
|
+
}
|
|
313
|
+
function comment(value, root, parent, siblings) {
|
|
314
|
+
return node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0, siblings);
|
|
315
|
+
}
|
|
316
|
+
function declaration(value, root, parent, length2, siblings) {
|
|
317
|
+
return node(value, root, parent, DECLARATION, substr(value, 0, length2), substr(value, length2 + 1, -1), length2, siblings);
|
|
318
|
+
}
|
|
319
|
+
function prefix(value, length2, children) {
|
|
320
|
+
switch (hash(value, length2)) {
|
|
321
|
+
// color-adjust
|
|
322
|
+
case 5103:
|
|
323
|
+
return WEBKIT + "print-" + value + value;
|
|
324
|
+
// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)
|
|
325
|
+
case 5737:
|
|
326
|
+
case 4201:
|
|
327
|
+
case 3177:
|
|
328
|
+
case 3433:
|
|
329
|
+
case 1641:
|
|
330
|
+
case 4457:
|
|
331
|
+
case 2921:
|
|
332
|
+
// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break
|
|
333
|
+
case 5572:
|
|
334
|
+
case 6356:
|
|
335
|
+
case 5844:
|
|
336
|
+
case 3191:
|
|
337
|
+
case 6645:
|
|
338
|
+
case 3005:
|
|
339
|
+
// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,
|
|
340
|
+
case 6391:
|
|
341
|
+
case 5879:
|
|
342
|
+
case 5623:
|
|
343
|
+
case 6135:
|
|
344
|
+
case 4599:
|
|
345
|
+
case 4855:
|
|
346
|
+
// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)
|
|
347
|
+
case 4215:
|
|
348
|
+
case 6389:
|
|
349
|
+
case 5109:
|
|
350
|
+
case 5365:
|
|
351
|
+
case 5621:
|
|
352
|
+
case 3829:
|
|
353
|
+
return WEBKIT + value + value;
|
|
354
|
+
// tab-size
|
|
355
|
+
case 4789:
|
|
356
|
+
return MOZ + value + value;
|
|
357
|
+
// appearance, user-select, transform, hyphens, text-size-adjust
|
|
358
|
+
case 5349:
|
|
359
|
+
case 4246:
|
|
360
|
+
case 4810:
|
|
361
|
+
case 6968:
|
|
362
|
+
case 2756:
|
|
363
|
+
return WEBKIT + value + MOZ + value + MS + value + value;
|
|
364
|
+
// writing-mode
|
|
365
|
+
case 5936:
|
|
366
|
+
switch (charat(value, length2 + 11)) {
|
|
367
|
+
// vertical-l(r)
|
|
368
|
+
case 114:
|
|
369
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb") + value;
|
|
370
|
+
// vertical-r(l)
|
|
371
|
+
case 108:
|
|
372
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "tb-rl") + value;
|
|
373
|
+
// horizontal(-)tb
|
|
374
|
+
case 45:
|
|
375
|
+
return WEBKIT + value + MS + replace(value, /[svh]\w+-[tblr]{2}/, "lr") + value;
|
|
376
|
+
}
|
|
377
|
+
// flex, flex-direction, scroll-snap-type, writing-mode
|
|
378
|
+
case 6828:
|
|
379
|
+
case 4268:
|
|
380
|
+
case 2903:
|
|
381
|
+
return WEBKIT + value + MS + value + value;
|
|
382
|
+
// order
|
|
383
|
+
case 6165:
|
|
384
|
+
return WEBKIT + value + MS + "flex-" + value + value;
|
|
385
|
+
// align-items
|
|
386
|
+
case 5187:
|
|
387
|
+
return WEBKIT + value + replace(value, /(\w+).+(:[^]+)/, WEBKIT + "box-$1$2" + MS + "flex-$1$2") + value;
|
|
388
|
+
// align-self
|
|
389
|
+
case 5443:
|
|
390
|
+
return WEBKIT + value + MS + "flex-item-" + replace(value, /flex-|-self/g, "") + (match(value, /flex-|baseline/) ? "" : MS + "grid-row-" + replace(value, /flex-|-self/g, "")) + value;
|
|
391
|
+
// align-content
|
|
392
|
+
case 4675:
|
|
393
|
+
return WEBKIT + value + MS + "flex-line-pack" + replace(value, /align-content|flex-|-self/g, "") + value;
|
|
394
|
+
// flex-shrink
|
|
395
|
+
case 5548:
|
|
396
|
+
return WEBKIT + value + MS + replace(value, "shrink", "negative") + value;
|
|
397
|
+
// flex-basis
|
|
398
|
+
case 5292:
|
|
399
|
+
return WEBKIT + value + MS + replace(value, "basis", "preferred-size") + value;
|
|
400
|
+
// flex-grow
|
|
401
|
+
case 6060:
|
|
402
|
+
return WEBKIT + "box-" + replace(value, "-grow", "") + WEBKIT + value + MS + replace(value, "grow", "positive") + value;
|
|
403
|
+
// transition
|
|
404
|
+
case 4554:
|
|
405
|
+
return WEBKIT + replace(value, /([^-])(transform)/g, "$1" + WEBKIT + "$2") + value;
|
|
406
|
+
// cursor
|
|
407
|
+
case 6187:
|
|
408
|
+
return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + "$1"), /(image-set)/, WEBKIT + "$1"), value, "") + value;
|
|
409
|
+
// background, background-image
|
|
410
|
+
case 5495:
|
|
411
|
+
case 3959:
|
|
412
|
+
return replace(value, /(image-set\([^]*)/, WEBKIT + "$1$`$1");
|
|
413
|
+
// justify-content
|
|
414
|
+
case 4968:
|
|
415
|
+
return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + "box-pack:$3" + MS + "flex-pack:$3"), /s.+-b[^;]+/, "justify") + WEBKIT + value + value;
|
|
416
|
+
// justify-self
|
|
417
|
+
case 4200:
|
|
418
|
+
if (!match(value, /flex-|baseline/)) return MS + "grid-column-align" + substr(value, length2) + value;
|
|
419
|
+
break;
|
|
420
|
+
// grid-template-(columns|rows)
|
|
421
|
+
case 2592:
|
|
422
|
+
case 3360:
|
|
423
|
+
return MS + replace(value, "template-", "") + value;
|
|
424
|
+
// grid-(row|column)-start
|
|
425
|
+
case 4384:
|
|
426
|
+
case 3616:
|
|
427
|
+
return children && children.some(function(element, index) {
|
|
428
|
+
return length2 = index, match(element.props, /grid-\w+-end/);
|
|
429
|
+
}) ? ~indexof(value + (children = children[length2].value), "span", 0) ? value : MS + replace(value, "-start", "") + value + MS + "grid-row-span:" + (~indexof(children, "span", 0) ? match(children, /\d+/) : +match(children, /\d+/) - +match(value, /\d+/)) + ";" : MS + replace(value, "-start", "") + value;
|
|
430
|
+
// grid-(row|column)-end
|
|
431
|
+
case 4896:
|
|
432
|
+
case 4128:
|
|
433
|
+
return children && children.some(function(element) {
|
|
434
|
+
return match(element.props, /grid-\w+-start/);
|
|
435
|
+
}) ? value : MS + replace(replace(value, "-end", "-span"), "span ", "") + value;
|
|
436
|
+
// (margin|padding)-inline-(start|end)
|
|
437
|
+
case 4095:
|
|
438
|
+
case 3583:
|
|
439
|
+
case 4068:
|
|
440
|
+
case 2532:
|
|
441
|
+
return replace(value, /(.+)-inline(.+)/, WEBKIT + "$1$2") + value;
|
|
442
|
+
// (min|max)?(width|height|inline-size|block-size)
|
|
443
|
+
case 8116:
|
|
444
|
+
case 7059:
|
|
445
|
+
case 5753:
|
|
446
|
+
case 5535:
|
|
447
|
+
case 5445:
|
|
448
|
+
case 5701:
|
|
449
|
+
case 4933:
|
|
450
|
+
case 4677:
|
|
451
|
+
case 5533:
|
|
452
|
+
case 5789:
|
|
453
|
+
case 5021:
|
|
454
|
+
case 4765:
|
|
455
|
+
if (strlen(value) - 1 - length2 > 6)
|
|
456
|
+
switch (charat(value, length2 + 1)) {
|
|
457
|
+
// (m)ax-content, (m)in-content
|
|
458
|
+
case 109:
|
|
459
|
+
if (charat(value, length2 + 4) !== 45)
|
|
460
|
+
break;
|
|
461
|
+
// (f)ill-available, (f)it-content
|
|
462
|
+
case 102:
|
|
463
|
+
return replace(value, /(.+:)(.+)-([^]+)/, "$1" + WEBKIT + "$2-$3$1" + MOZ + (charat(value, length2 + 3) == 108 ? "$3" : "$2-$3")) + value;
|
|
464
|
+
// (s)tretch
|
|
465
|
+
case 115:
|
|
466
|
+
return ~indexof(value, "stretch", 0) ? prefix(replace(value, "stretch", "fill-available"), length2, children) + value : value;
|
|
467
|
+
}
|
|
468
|
+
break;
|
|
469
|
+
// grid-(column|row)
|
|
470
|
+
case 5152:
|
|
471
|
+
case 5920:
|
|
472
|
+
return replace(value, /(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/, function(_2, a, b, c, d, e, f2) {
|
|
473
|
+
return MS + a + ":" + b + f2 + (c ? MS + a + "-span:" + (d ? e : +e - +b) + f2 : "") + value;
|
|
474
|
+
});
|
|
475
|
+
// position: sticky
|
|
476
|
+
case 4949:
|
|
477
|
+
if (charat(value, length2 + 6) === 121)
|
|
478
|
+
return replace(value, ":", ":" + WEBKIT) + value;
|
|
479
|
+
break;
|
|
480
|
+
// display: (flex|inline-flex|grid|inline-grid)
|
|
481
|
+
case 6444:
|
|
482
|
+
switch (charat(value, charat(value, 14) === 45 ? 18 : 11)) {
|
|
483
|
+
// (inline-)?fle(x)
|
|
484
|
+
case 120:
|
|
485
|
+
return replace(value, /(.+:)([^;\s!]+)(;|(\s+)?!.+)?/, "$1" + WEBKIT + (charat(value, 14) === 45 ? "inline-" : "") + "box$3$1" + WEBKIT + "$2$3$1" + MS + "$2box$3") + value;
|
|
486
|
+
// (inline-)?gri(d)
|
|
487
|
+
case 100:
|
|
488
|
+
return replace(value, ":", ":" + MS) + value;
|
|
489
|
+
}
|
|
490
|
+
break;
|
|
491
|
+
// scroll-margin, scroll-margin-(top|right|bottom|left)
|
|
492
|
+
case 5719:
|
|
493
|
+
case 2647:
|
|
494
|
+
case 2135:
|
|
495
|
+
case 3927:
|
|
496
|
+
case 2391:
|
|
497
|
+
return replace(value, "scroll-", "scroll-snap-") + value;
|
|
498
|
+
}
|
|
499
|
+
return value;
|
|
500
|
+
}
|
|
501
|
+
function serialize(children, callback) {
|
|
502
|
+
for (var output = "", i = 0; i < children.length; i++)
|
|
503
|
+
output += callback(children[i], i, children, callback) || "";
|
|
504
|
+
return output;
|
|
505
|
+
}
|
|
506
|
+
function stringify(element, index, children, callback) {
|
|
507
|
+
switch (element.type) {
|
|
508
|
+
case LAYER:
|
|
509
|
+
if (element.children.length) break;
|
|
510
|
+
case IMPORT:
|
|
511
|
+
case DECLARATION:
|
|
512
|
+
return element.return = element.return || element.value;
|
|
513
|
+
case COMMENT:
|
|
514
|
+
return "";
|
|
515
|
+
case KEYFRAMES:
|
|
516
|
+
return element.return = element.value + "{" + serialize(element.children, callback) + "}";
|
|
517
|
+
case RULESET:
|
|
518
|
+
if (!strlen(element.value = element.props.join(","))) return "";
|
|
519
|
+
}
|
|
520
|
+
return strlen(children = serialize(element.children, callback)) ? element.return = element.value + "{" + children + "}" : "";
|
|
521
|
+
}
|
|
522
|
+
function middleware(collection) {
|
|
523
|
+
var length2 = sizeof(collection);
|
|
524
|
+
return function(element, index, children, callback) {
|
|
525
|
+
for (var output = "", i = 0; i < length2; i++)
|
|
526
|
+
output += collection[i](element, index, children, callback) || "";
|
|
527
|
+
return output;
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
function rulesheet(callback) {
|
|
531
|
+
return function(element) {
|
|
532
|
+
element.root || (element = element.return) && callback(element);
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
function prefixer(element, index, children, callback) {
|
|
536
|
+
if (element.length > -1 && !element.return)
|
|
537
|
+
switch (element.type) {
|
|
538
|
+
case DECLARATION:
|
|
539
|
+
element.return = prefix(element.value, element.length, children);
|
|
540
|
+
return;
|
|
541
|
+
case KEYFRAMES:
|
|
542
|
+
return serialize([copy(element, { value: replace(element.value, "@", "@" + WEBKIT) })], callback);
|
|
543
|
+
case RULESET:
|
|
544
|
+
if (element.length)
|
|
545
|
+
return combine(children = element.props, function(value) {
|
|
546
|
+
switch (match(value, callback = /(::plac\w+|:read-\w+)/)) {
|
|
547
|
+
// :read-(only|write)
|
|
548
|
+
case ":read-only":
|
|
549
|
+
case ":read-write":
|
|
550
|
+
lift(copy(element, { props: [replace(value, /:(read-\w+)/, ":" + MOZ + "$1")] })), lift(copy(element, { props: [value] })), assign(element, { props: filter(children, callback) });
|
|
551
|
+
break;
|
|
552
|
+
// :placeholder
|
|
553
|
+
case "::placeholder":
|
|
554
|
+
lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + WEBKIT + "input-$1")] })), lift(copy(element, { props: [replace(value, /:(plac\w+)/, ":" + MOZ + "$1")] })), lift(copy(element, { props: [replace(value, /:(plac\w+)/, MS + "input-$1")] })), lift(copy(element, { props: [value] })), assign(element, { props: filter(children, callback) });
|
|
555
|
+
break;
|
|
556
|
+
}
|
|
557
|
+
return "";
|
|
558
|
+
});
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
var unitlessKeys = {
|
|
562
|
+
animationIterationCount: 1,
|
|
563
|
+
aspectRatio: 1,
|
|
564
|
+
borderImageOutset: 1,
|
|
565
|
+
borderImageSlice: 1,
|
|
566
|
+
borderImageWidth: 1,
|
|
567
|
+
boxFlex: 1,
|
|
568
|
+
boxFlexGroup: 1,
|
|
569
|
+
boxOrdinalGroup: 1,
|
|
570
|
+
columnCount: 1,
|
|
571
|
+
columns: 1,
|
|
572
|
+
flex: 1,
|
|
573
|
+
flexGrow: 1,
|
|
574
|
+
flexPositive: 1,
|
|
575
|
+
flexShrink: 1,
|
|
576
|
+
flexNegative: 1,
|
|
577
|
+
flexOrder: 1,
|
|
578
|
+
gridRow: 1,
|
|
579
|
+
gridRowEnd: 1,
|
|
580
|
+
gridRowSpan: 1,
|
|
581
|
+
gridRowStart: 1,
|
|
582
|
+
gridColumn: 1,
|
|
583
|
+
gridColumnEnd: 1,
|
|
584
|
+
gridColumnSpan: 1,
|
|
585
|
+
gridColumnStart: 1,
|
|
586
|
+
msGridRow: 1,
|
|
587
|
+
msGridRowSpan: 1,
|
|
588
|
+
msGridColumn: 1,
|
|
589
|
+
msGridColumnSpan: 1,
|
|
590
|
+
fontWeight: 1,
|
|
591
|
+
lineHeight: 1,
|
|
592
|
+
opacity: 1,
|
|
593
|
+
order: 1,
|
|
594
|
+
orphans: 1,
|
|
595
|
+
tabSize: 1,
|
|
596
|
+
widows: 1,
|
|
597
|
+
zIndex: 1,
|
|
598
|
+
zoom: 1,
|
|
599
|
+
WebkitLineClamp: 1,
|
|
600
|
+
// SVG-related properties
|
|
601
|
+
fillOpacity: 1,
|
|
602
|
+
floodOpacity: 1,
|
|
603
|
+
stopOpacity: 1,
|
|
604
|
+
strokeDasharray: 1,
|
|
605
|
+
strokeDashoffset: 1,
|
|
606
|
+
strokeMiterlimit: 1,
|
|
607
|
+
strokeOpacity: 1,
|
|
608
|
+
strokeWidth: 1
|
|
609
|
+
}, f = typeof process < "u" && process.env !== void 0 && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || "data-styled", m = "active", y = "data-styled-version", v = "6.1.19", g = `/*!sc*/
|
|
610
|
+
`, S = typeof window < "u" && typeof document < "u", w = !!(typeof SC_DISABLE_SPEEDY == "boolean" ? SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== void 0 && process.env.REACT_APP_SC_DISABLE_SPEEDY !== "" ? process.env.REACT_APP_SC_DISABLE_SPEEDY !== "false" && process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process < "u" && process.env !== void 0 && process.env.SC_DISABLE_SPEEDY !== void 0 && process.env.SC_DISABLE_SPEEDY !== "" ? process.env.SC_DISABLE_SPEEDY !== "false" && process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== "production"), E = /invalid hook call/i, N = /* @__PURE__ */ new Set(), P = function(t, n) {
|
|
611
|
+
if (process.env.NODE_ENV !== "production") {
|
|
612
|
+
var o2 = n ? ' with the id of "'.concat(n, '"') : "", s = "The component ".concat(t).concat(o2, ` has been created dynamically.
|
|
613
|
+
`) + `You may see this warning because you've called styled inside another component.
|
|
614
|
+
To resolve this only create new StyledComponents outside of any render method and function component.
|
|
615
|
+
See https://styled-components.com/docs/basics#define-styled-components-outside-of-the-render-method for more info.
|
|
616
|
+
`, i = console.error;
|
|
617
|
+
try {
|
|
618
|
+
var a = !0;
|
|
619
|
+
console.error = function(t2) {
|
|
620
|
+
for (var n2 = [], o3 = 1; o3 < arguments.length; o3++) n2[o3 - 1] = arguments[o3];
|
|
621
|
+
E.test(t2) ? (a = !1, N.delete(s)) : i.apply(void 0, __spreadArray([t2], n2, !1));
|
|
622
|
+
}, useRef(), a && !N.has(s) && (console.warn(s), N.add(s));
|
|
623
|
+
} catch (e) {
|
|
624
|
+
E.test(e.message) && N.delete(s);
|
|
625
|
+
} finally {
|
|
626
|
+
console.error = i;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
}, _ = Object.freeze([]), C = Object.freeze({});
|
|
630
|
+
function I(e, t, n) {
|
|
631
|
+
return n === void 0 && (n = C), e.theme !== n.theme && e.theme || t || n.theme;
|
|
632
|
+
}
|
|
633
|
+
var A = /* @__PURE__ */ new Set(["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "keygen", "label", "legend", "li", "link", "main", "map", "mark", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "script", "section", "select", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "u", "ul", "use", "var", "video", "wbr", "circle", "clipPath", "defs", "ellipse", "foreignObject", "g", "image", "line", "linearGradient", "marker", "mask", "path", "pattern", "polygon", "polyline", "radialGradient", "rect", "stop", "svg", "text", "tspan"]), O = /[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g, D = /(^-|-$)/g;
|
|
634
|
+
function R(e) {
|
|
635
|
+
return e.replace(O, "-").replace(D, "");
|
|
636
|
+
}
|
|
637
|
+
var T = /(a)(d)/gi, k = 52, j = function(e) {
|
|
638
|
+
return String.fromCharCode(e + (e > 25 ? 39 : 97));
|
|
639
|
+
};
|
|
640
|
+
function x(e) {
|
|
641
|
+
var t, n = "";
|
|
642
|
+
for (t = Math.abs(e); t > k; t = t / k | 0) n = j(t % k) + n;
|
|
643
|
+
return (j(t % k) + n).replace(T, "$1-$2");
|
|
644
|
+
}
|
|
645
|
+
var V, F = 5381, z = function(e, t) {
|
|
646
|
+
for (var n = t.length; n; ) e = 33 * e ^ t.charCodeAt(--n);
|
|
647
|
+
return e;
|
|
648
|
+
}, M = function(e) {
|
|
649
|
+
return z(F, e);
|
|
650
|
+
};
|
|
651
|
+
function $(e) {
|
|
652
|
+
return x(M(e) >>> 0);
|
|
653
|
+
}
|
|
654
|
+
function B(e) {
|
|
655
|
+
return process.env.NODE_ENV !== "production" && typeof e == "string" && e || e.displayName || e.name || "Component";
|
|
656
|
+
}
|
|
657
|
+
function G(e) {
|
|
658
|
+
return typeof e == "string" && (process.env.NODE_ENV === "production" || e.charAt(0) === e.charAt(0).toLowerCase());
|
|
659
|
+
}
|
|
660
|
+
var L = typeof Symbol == "function" && Symbol.for, Y = L ? Symbol.for("react.memo") : 60115, q = L ? Symbol.for("react.forward_ref") : 60112, W = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, H = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, U = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, J = ((V = {})[q] = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, V[Y] = U, V);
|
|
661
|
+
function X(e) {
|
|
662
|
+
return ("type" in (t = e) && t.type.$$typeof) === Y ? U : "$$typeof" in e ? J[e.$$typeof] : W;
|
|
663
|
+
var t;
|
|
664
|
+
}
|
|
665
|
+
var Z = Object.defineProperty, K = Object.getOwnPropertyNames, Q = Object.getOwnPropertySymbols, ee = Object.getOwnPropertyDescriptor, te = Object.getPrototypeOf, ne = Object.prototype;
|
|
666
|
+
function oe(e, t, n) {
|
|
667
|
+
if (typeof t != "string") {
|
|
668
|
+
if (ne) {
|
|
669
|
+
var o2 = te(t);
|
|
670
|
+
o2 && o2 !== ne && oe(e, o2, n);
|
|
671
|
+
}
|
|
672
|
+
var r = K(t);
|
|
673
|
+
Q && (r = r.concat(Q(t)));
|
|
674
|
+
for (var s = X(e), i = X(t), a = 0; a < r.length; ++a) {
|
|
675
|
+
var c = r[a];
|
|
676
|
+
if (!(c in H || n && n[c] || i && c in i || s && c in s)) {
|
|
677
|
+
var l = ee(t, c);
|
|
678
|
+
try {
|
|
679
|
+
Z(e, c, l);
|
|
680
|
+
} catch {
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
return e;
|
|
686
|
+
}
|
|
687
|
+
function re(e) {
|
|
688
|
+
return typeof e == "function";
|
|
689
|
+
}
|
|
690
|
+
function se(e) {
|
|
691
|
+
return typeof e == "object" && "styledComponentId" in e;
|
|
692
|
+
}
|
|
693
|
+
function ie(e, t) {
|
|
694
|
+
return e && t ? "".concat(e, " ").concat(t) : e || t || "";
|
|
695
|
+
}
|
|
696
|
+
function ae(e, t) {
|
|
697
|
+
if (e.length === 0) return "";
|
|
698
|
+
for (var n = e[0], o2 = 1; o2 < e.length; o2++) n += e[o2];
|
|
699
|
+
return n;
|
|
700
|
+
}
|
|
701
|
+
function ce(e) {
|
|
702
|
+
return e !== null && typeof e == "object" && e.constructor.name === Object.name && !("props" in e && e.$$typeof);
|
|
703
|
+
}
|
|
704
|
+
function le(e, t, n) {
|
|
705
|
+
if (n === void 0 && (n = !1), !n && !ce(e) && !Array.isArray(e)) return t;
|
|
706
|
+
if (Array.isArray(t)) for (var o2 = 0; o2 < t.length; o2++) e[o2] = le(e[o2], t[o2]);
|
|
707
|
+
else if (ce(t)) for (var o2 in t) e[o2] = le(e[o2], t[o2]);
|
|
708
|
+
return e;
|
|
709
|
+
}
|
|
710
|
+
function ue(e, t) {
|
|
711
|
+
Object.defineProperty(e, "toString", { value: t });
|
|
712
|
+
}
|
|
713
|
+
var pe = process.env.NODE_ENV !== "production" ? { 1: `Cannot create styled-component for component: %s.
|
|
714
|
+
|
|
715
|
+
`, 2: `Can't collect styles once you've consumed a \`ServerStyleSheet\`'s styles! \`ServerStyleSheet\` is a one off instance for each server-side render cycle.
|
|
716
|
+
|
|
717
|
+
- Are you trying to reuse it across renders?
|
|
718
|
+
- Are you accidentally calling collectStyles twice?
|
|
719
|
+
|
|
720
|
+
`, 3: `Streaming SSR is only supported in a Node.js environment; Please do not try to call this method in the browser.
|
|
721
|
+
|
|
722
|
+
`, 4: `The \`StyleSheetManager\` expects a valid target or sheet prop!
|
|
723
|
+
|
|
724
|
+
- Does this error occur on the client and is your target falsy?
|
|
725
|
+
- Does this error occur on the server and is the sheet falsy?
|
|
726
|
+
|
|
727
|
+
`, 5: `The clone method cannot be used on the client!
|
|
728
|
+
|
|
729
|
+
- Are you running in a client-like environment on the server?
|
|
730
|
+
- Are you trying to run SSR on the client?
|
|
731
|
+
|
|
732
|
+
`, 6: `Trying to insert a new style tag, but the given Node is unmounted!
|
|
733
|
+
|
|
734
|
+
- Are you using a custom target that isn't mounted?
|
|
735
|
+
- Does your document not have a valid head element?
|
|
736
|
+
- Have you accidentally removed a style tag manually?
|
|
737
|
+
|
|
738
|
+
`, 7: 'ThemeProvider: Please return an object from your "theme" prop function, e.g.\n\n```js\ntheme={() => ({})}\n```\n\n', 8: `ThemeProvider: Please make your "theme" prop an object.
|
|
739
|
+
|
|
740
|
+
`, 9: "Missing document `<head>`\n\n", 10: `Cannot find a StyleSheet instance. Usually this happens if there are multiple copies of styled-components loaded at once. Check out this issue for how to troubleshoot and fix the common cases where this situation can happen: https://github.com/styled-components/styled-components/issues/1941#issuecomment-417862021
|
|
741
|
+
|
|
742
|
+
`, 11: `_This error was replaced with a dev-time warning, it will be deleted for v4 final._ [createGlobalStyle] received children which will not be rendered. Please use the component without passing children elements.
|
|
743
|
+
|
|
744
|
+
`, 12: "It seems you are interpolating a keyframe declaration (%s) into an untagged string. This was supported in styled-components v3, but is not longer supported in v4 as keyframes are now injected on-demand. Please wrap your string in the css\\`\\` helper which ensures the styles are injected correctly. See https://www.styled-components.com/docs/api#css\n\n", 13: `%s is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.
|
|
745
|
+
|
|
746
|
+
`, 14: `ThemeProvider: "theme" prop is required.
|
|
747
|
+
|
|
748
|
+
`, 15: "A stylis plugin has been supplied that is not named. We need a name for each plugin to be able to prevent styling collisions between different stylis configurations within the same app. Before you pass your plugin to `<StyleSheetManager stylisPlugins={[]}>`, please make sure each plugin is uniquely-named, e.g.\n\n```js\nObject.defineProperty(importedPlugin, 'name', { value: 'some-unique-name' });\n```\n\n", 16: `Reached the limit of how many styled components may be created at group %s.
|
|
749
|
+
You may only create up to 1,073,741,824 components. If you're creating components dynamically,
|
|
750
|
+
as for instance in your render method then you may be running into this limitation.
|
|
751
|
+
|
|
752
|
+
`, 17: `CSSStyleSheet could not be found on HTMLStyleElement.
|
|
753
|
+
Has styled-components' style tag been unmounted or altered by another script?
|
|
754
|
+
`, 18: "ThemeProvider: Please make sure your useTheme hook is within a `<ThemeProvider>`" } : {};
|
|
755
|
+
function de() {
|
|
756
|
+
for (var e = [], t = 0; t < arguments.length; t++) e[t] = arguments[t];
|
|
757
|
+
for (var n = e[0], o2 = [], r = 1, s = e.length; r < s; r += 1) o2.push(e[r]);
|
|
758
|
+
return o2.forEach(function(e2) {
|
|
759
|
+
n = n.replace(/%[a-z]/, e2);
|
|
760
|
+
}), n;
|
|
761
|
+
}
|
|
762
|
+
function he(t) {
|
|
763
|
+
for (var n = [], o2 = 1; o2 < arguments.length; o2++) n[o2 - 1] = arguments[o2];
|
|
764
|
+
return process.env.NODE_ENV === "production" ? new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t, " for more information.").concat(n.length > 0 ? " Args: ".concat(n.join(", ")) : "")) : new Error(de.apply(void 0, __spreadArray([pe[t]], n, !1)).trim());
|
|
765
|
+
}
|
|
766
|
+
var fe = (function() {
|
|
767
|
+
function e(e2) {
|
|
768
|
+
this.groupSizes = new Uint32Array(512), this.length = 512, this.tag = e2;
|
|
769
|
+
}
|
|
770
|
+
return e.prototype.indexOfGroup = function(e2) {
|
|
771
|
+
for (var t = 0, n = 0; n < e2; n++) t += this.groupSizes[n];
|
|
772
|
+
return t;
|
|
773
|
+
}, e.prototype.insertRules = function(e2, t) {
|
|
774
|
+
if (e2 >= this.groupSizes.length) {
|
|
775
|
+
for (var n = this.groupSizes, o2 = n.length, r = o2; e2 >= r; ) if ((r <<= 1) < 0) throw he(16, "".concat(e2));
|
|
776
|
+
this.groupSizes = new Uint32Array(r), this.groupSizes.set(n), this.length = r;
|
|
777
|
+
for (var s = o2; s < r; s++) this.groupSizes[s] = 0;
|
|
778
|
+
}
|
|
779
|
+
for (var i = this.indexOfGroup(e2 + 1), a = (s = 0, t.length); s < a; s++) this.tag.insertRule(i, t[s]) && (this.groupSizes[e2]++, i++);
|
|
780
|
+
}, e.prototype.clearGroup = function(e2) {
|
|
781
|
+
if (e2 < this.length) {
|
|
782
|
+
var t = this.groupSizes[e2], n = this.indexOfGroup(e2), o2 = n + t;
|
|
783
|
+
this.groupSizes[e2] = 0;
|
|
784
|
+
for (var r = n; r < o2; r++) this.tag.deleteRule(n);
|
|
785
|
+
}
|
|
786
|
+
}, e.prototype.getGroup = function(e2) {
|
|
787
|
+
var t = "";
|
|
788
|
+
if (e2 >= this.length || this.groupSizes[e2] === 0) return t;
|
|
789
|
+
for (var n = this.groupSizes[e2], o2 = this.indexOfGroup(e2), r = o2 + n, s = o2; s < r; s++) t += "".concat(this.tag.getRule(s)).concat(g);
|
|
790
|
+
return t;
|
|
791
|
+
}, e;
|
|
792
|
+
})(), me = 1 << 30, ye = /* @__PURE__ */ new Map(), ve = /* @__PURE__ */ new Map(), ge = 1, Se = function(e) {
|
|
793
|
+
if (ye.has(e)) return ye.get(e);
|
|
794
|
+
for (; ve.has(ge); ) ge++;
|
|
795
|
+
var t = ge++;
|
|
796
|
+
if (process.env.NODE_ENV !== "production" && ((0 | t) < 0 || t > me)) throw he(16, "".concat(t));
|
|
797
|
+
return ye.set(e, t), ve.set(t, e), t;
|
|
798
|
+
}, we = function(e, t) {
|
|
799
|
+
ge = t + 1, ye.set(e, t), ve.set(t, e);
|
|
800
|
+
}, be = "style[".concat(f, "][").concat(y, '="').concat(v, '"]'), Ee = new RegExp("^".concat(f, '\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')), Ne = function(e, t, n) {
|
|
801
|
+
for (var o2, r = n.split(","), s = 0, i = r.length; s < i; s++) (o2 = r[s]) && e.registerName(t, o2);
|
|
802
|
+
}, Pe = function(e, t) {
|
|
803
|
+
for (var n, o2 = ((n = t.textContent) !== null && n !== void 0 ? n : "").split(g), r = [], s = 0, i = o2.length; s < i; s++) {
|
|
804
|
+
var a = o2[s].trim();
|
|
805
|
+
if (a) {
|
|
806
|
+
var c = a.match(Ee);
|
|
807
|
+
if (c) {
|
|
808
|
+
var l = 0 | parseInt(c[1], 10), u = c[2];
|
|
809
|
+
l !== 0 && (we(u, l), Ne(e, u, c[3]), e.getTag().insertRules(l, r)), r.length = 0;
|
|
810
|
+
} else r.push(a);
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
}, _e = function(e) {
|
|
814
|
+
for (var t = document.querySelectorAll(be), n = 0, o2 = t.length; n < o2; n++) {
|
|
815
|
+
var r = t[n];
|
|
816
|
+
r && r.getAttribute(f) !== m && (Pe(e, r), r.parentNode && r.parentNode.removeChild(r));
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
function Ce() {
|
|
820
|
+
return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : null;
|
|
821
|
+
}
|
|
822
|
+
var Ie = function(e) {
|
|
823
|
+
var t = document.head, n = e || t, o2 = document.createElement("style"), r = (function(e2) {
|
|
824
|
+
var t2 = Array.from(e2.querySelectorAll("style[".concat(f, "]")));
|
|
825
|
+
return t2[t2.length - 1];
|
|
826
|
+
})(n), s = r !== void 0 ? r.nextSibling : null;
|
|
827
|
+
o2.setAttribute(f, m), o2.setAttribute(y, v);
|
|
828
|
+
var i = Ce();
|
|
829
|
+
return i && o2.setAttribute("nonce", i), n.insertBefore(o2, s), o2;
|
|
830
|
+
}, Ae = (function() {
|
|
831
|
+
function e(e2) {
|
|
832
|
+
this.element = Ie(e2), this.element.appendChild(document.createTextNode("")), this.sheet = (function(e3) {
|
|
833
|
+
if (e3.sheet) return e3.sheet;
|
|
834
|
+
for (var t = document.styleSheets, n = 0, o2 = t.length; n < o2; n++) {
|
|
835
|
+
var r = t[n];
|
|
836
|
+
if (r.ownerNode === e3) return r;
|
|
837
|
+
}
|
|
838
|
+
throw he(17);
|
|
839
|
+
})(this.element), this.length = 0;
|
|
840
|
+
}
|
|
841
|
+
return e.prototype.insertRule = function(e2, t) {
|
|
842
|
+
try {
|
|
843
|
+
return this.sheet.insertRule(t, e2), this.length++, !0;
|
|
844
|
+
} catch {
|
|
845
|
+
return !1;
|
|
846
|
+
}
|
|
847
|
+
}, e.prototype.deleteRule = function(e2) {
|
|
848
|
+
this.sheet.deleteRule(e2), this.length--;
|
|
849
|
+
}, e.prototype.getRule = function(e2) {
|
|
850
|
+
var t = this.sheet.cssRules[e2];
|
|
851
|
+
return t && t.cssText ? t.cssText : "";
|
|
852
|
+
}, e;
|
|
853
|
+
})(), Oe = (function() {
|
|
854
|
+
function e(e2) {
|
|
855
|
+
this.element = Ie(e2), this.nodes = this.element.childNodes, this.length = 0;
|
|
856
|
+
}
|
|
857
|
+
return e.prototype.insertRule = function(e2, t) {
|
|
858
|
+
if (e2 <= this.length && e2 >= 0) {
|
|
859
|
+
var n = document.createTextNode(t);
|
|
860
|
+
return this.element.insertBefore(n, this.nodes[e2] || null), this.length++, !0;
|
|
861
|
+
}
|
|
862
|
+
return !1;
|
|
863
|
+
}, e.prototype.deleteRule = function(e2) {
|
|
864
|
+
this.element.removeChild(this.nodes[e2]), this.length--;
|
|
865
|
+
}, e.prototype.getRule = function(e2) {
|
|
866
|
+
return e2 < this.length ? this.nodes[e2].textContent : "";
|
|
867
|
+
}, e;
|
|
868
|
+
})(), De = (function() {
|
|
869
|
+
function e(e2) {
|
|
870
|
+
this.rules = [], this.length = 0;
|
|
871
|
+
}
|
|
872
|
+
return e.prototype.insertRule = function(e2, t) {
|
|
873
|
+
return e2 <= this.length && (this.rules.splice(e2, 0, t), this.length++, !0);
|
|
874
|
+
}, e.prototype.deleteRule = function(e2) {
|
|
875
|
+
this.rules.splice(e2, 1), this.length--;
|
|
876
|
+
}, e.prototype.getRule = function(e2) {
|
|
877
|
+
return e2 < this.length ? this.rules[e2] : "";
|
|
878
|
+
}, e;
|
|
879
|
+
})(), Re = S, Te = { isServer: !S, useCSSOMInjection: !w }, ke = (function() {
|
|
880
|
+
function e(e2, n, o2) {
|
|
881
|
+
e2 === void 0 && (e2 = C), n === void 0 && (n = {});
|
|
882
|
+
var r = this;
|
|
883
|
+
this.options = __assign(__assign({}, Te), e2), this.gs = n, this.names = new Map(o2), this.server = !!e2.isServer, !this.server && S && Re && (Re = !1, _e(this)), ue(this, function() {
|
|
884
|
+
return (function(e3) {
|
|
885
|
+
for (var t = e3.getTag(), n2 = t.length, o3 = "", r2 = function(n3) {
|
|
886
|
+
var r3 = (function(e4) {
|
|
887
|
+
return ve.get(e4);
|
|
888
|
+
})(n3);
|
|
889
|
+
if (r3 === void 0) return "continue";
|
|
890
|
+
var s2 = e3.names.get(r3), i = t.getGroup(n3);
|
|
891
|
+
if (s2 === void 0 || !s2.size || i.length === 0) return "continue";
|
|
892
|
+
var a = "".concat(f, ".g").concat(n3, '[id="').concat(r3, '"]'), c = "";
|
|
893
|
+
s2 !== void 0 && s2.forEach(function(e4) {
|
|
894
|
+
e4.length > 0 && (c += "".concat(e4, ","));
|
|
895
|
+
}), o3 += "".concat(i).concat(a, '{content:"').concat(c, '"}').concat(g);
|
|
896
|
+
}, s = 0; s < n2; s++) r2(s);
|
|
897
|
+
return o3;
|
|
898
|
+
})(r);
|
|
899
|
+
});
|
|
900
|
+
}
|
|
901
|
+
return e.registerId = function(e2) {
|
|
902
|
+
return Se(e2);
|
|
903
|
+
}, e.prototype.rehydrate = function() {
|
|
904
|
+
!this.server && S && _e(this);
|
|
905
|
+
}, e.prototype.reconstructWithOptions = function(n, o2) {
|
|
906
|
+
return o2 === void 0 && (o2 = !0), new e(__assign(__assign({}, this.options), n), this.gs, o2 && this.names || void 0);
|
|
907
|
+
}, e.prototype.allocateGSInstance = function(e2) {
|
|
908
|
+
return this.gs[e2] = (this.gs[e2] || 0) + 1;
|
|
909
|
+
}, e.prototype.getTag = function() {
|
|
910
|
+
return this.tag || (this.tag = (e2 = (function(e3) {
|
|
911
|
+
var t = e3.useCSSOMInjection, n = e3.target;
|
|
912
|
+
return e3.isServer ? new De(n) : t ? new Ae(n) : new Oe(n);
|
|
913
|
+
})(this.options), new fe(e2)));
|
|
914
|
+
var e2;
|
|
915
|
+
}, e.prototype.hasNameForId = function(e2, t) {
|
|
916
|
+
return this.names.has(e2) && this.names.get(e2).has(t);
|
|
917
|
+
}, e.prototype.registerName = function(e2, t) {
|
|
918
|
+
if (Se(e2), this.names.has(e2)) this.names.get(e2).add(t);
|
|
919
|
+
else {
|
|
920
|
+
var n = /* @__PURE__ */ new Set();
|
|
921
|
+
n.add(t), this.names.set(e2, n);
|
|
922
|
+
}
|
|
923
|
+
}, e.prototype.insertRules = function(e2, t, n) {
|
|
924
|
+
this.registerName(e2, t), this.getTag().insertRules(Se(e2), n);
|
|
925
|
+
}, e.prototype.clearNames = function(e2) {
|
|
926
|
+
this.names.has(e2) && this.names.get(e2).clear();
|
|
927
|
+
}, e.prototype.clearRules = function(e2) {
|
|
928
|
+
this.getTag().clearGroup(Se(e2)), this.clearNames(e2);
|
|
929
|
+
}, e.prototype.clearTag = function() {
|
|
930
|
+
this.tag = void 0;
|
|
931
|
+
}, e;
|
|
932
|
+
})(), je = /&/g, xe = /^\s*\/\/.*$/gm;
|
|
933
|
+
function Ve(e, t) {
|
|
934
|
+
return e.map(function(e2) {
|
|
935
|
+
return e2.type === "rule" && (e2.value = "".concat(t, " ").concat(e2.value), e2.value = e2.value.replaceAll(",", ",".concat(t, " ")), e2.props = e2.props.map(function(e3) {
|
|
936
|
+
return "".concat(t, " ").concat(e3);
|
|
937
|
+
})), Array.isArray(e2.children) && e2.type !== "@keyframes" && (e2.children = Ve(e2.children, t)), e2;
|
|
938
|
+
});
|
|
939
|
+
}
|
|
940
|
+
function Fe(e) {
|
|
941
|
+
var t, n, o2, r = C, s = r.options, i = s === void 0 ? C : s, a = r.plugins, c = a === void 0 ? _ : a, l = function(e2, o3, r2) {
|
|
942
|
+
return r2.startsWith(n) && r2.endsWith(n) && r2.replaceAll(n, "").length > 0 ? ".".concat(t) : e2;
|
|
943
|
+
}, u = c.slice();
|
|
944
|
+
u.push(function(e2) {
|
|
945
|
+
e2.type === RULESET && e2.value.includes("&") && (e2.props[0] = e2.props[0].replace(je, n).replace(o2, l));
|
|
946
|
+
}), i.prefix && u.push(prefixer), u.push(stringify);
|
|
947
|
+
var p = function(e2, r2, s2, a2) {
|
|
948
|
+
r2 === void 0 && (r2 = ""), s2 === void 0 && (s2 = ""), a2 === void 0 && (a2 = "&"), t = a2, n = r2, o2 = new RegExp("\\".concat(n, "\\b"), "g");
|
|
949
|
+
var c2 = e2.replace(xe, ""), l2 = compile(s2 || r2 ? "".concat(s2, " ").concat(r2, " { ").concat(c2, " }") : c2);
|
|
950
|
+
i.namespace && (l2 = Ve(l2, i.namespace));
|
|
951
|
+
var p2 = [];
|
|
952
|
+
return serialize(l2, middleware(u.concat(rulesheet(function(e3) {
|
|
953
|
+
return p2.push(e3);
|
|
954
|
+
})))), p2;
|
|
955
|
+
};
|
|
956
|
+
return p.hash = c.length ? c.reduce(function(e2, t2) {
|
|
957
|
+
return t2.name || he(15), z(e2, t2.name);
|
|
958
|
+
}, F).toString() : "", p;
|
|
959
|
+
}
|
|
960
|
+
var ze = new ke(), Me = Fe(), $e = o.createContext({ shouldForwardProp: void 0, styleSheet: ze, stylis: Me });
|
|
961
|
+
o.createContext(void 0);
|
|
962
|
+
function Le() {
|
|
963
|
+
return useContext($e);
|
|
964
|
+
}
|
|
965
|
+
var qe = (function() {
|
|
966
|
+
function e(e2, t) {
|
|
967
|
+
var n = this;
|
|
968
|
+
this.inject = function(e3, t2) {
|
|
969
|
+
t2 === void 0 && (t2 = Me);
|
|
970
|
+
var o2 = n.name + t2.hash;
|
|
971
|
+
e3.hasNameForId(n.id, o2) || e3.insertRules(n.id, o2, t2(n.rules, o2, "@keyframes"));
|
|
972
|
+
}, this.name = e2, this.id = "sc-keyframes-".concat(e2), this.rules = t, ue(this, function() {
|
|
973
|
+
throw he(12, String(n.name));
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
return e.prototype.getName = function(e2) {
|
|
977
|
+
return e2 === void 0 && (e2 = Me), this.name + e2.hash;
|
|
978
|
+
}, e;
|
|
979
|
+
})(), We = function(e) {
|
|
980
|
+
return e >= "A" && e <= "Z";
|
|
981
|
+
};
|
|
982
|
+
function He(e) {
|
|
983
|
+
for (var t = "", n = 0; n < e.length; n++) {
|
|
984
|
+
var o2 = e[n];
|
|
985
|
+
if (n === 1 && o2 === "-" && e[0] === "-") return e;
|
|
986
|
+
We(o2) ? t += "-" + o2.toLowerCase() : t += o2;
|
|
987
|
+
}
|
|
988
|
+
return t.startsWith("ms-") ? "-" + t : t;
|
|
989
|
+
}
|
|
990
|
+
var Ue = function(e) {
|
|
991
|
+
return e == null || e === !1 || e === "";
|
|
992
|
+
}, Je = function(t) {
|
|
993
|
+
var n, o2, r = [];
|
|
994
|
+
for (var s in t) {
|
|
995
|
+
var i = t[s];
|
|
996
|
+
t.hasOwnProperty(s) && !Ue(i) && (Array.isArray(i) && i.isCss || re(i) ? r.push("".concat(He(s), ":"), i, ";") : ce(i) ? r.push.apply(r, __spreadArray(__spreadArray(["".concat(s, " {")], Je(i), !1), ["}"], !1)) : r.push("".concat(He(s), ": ").concat((n = s, (o2 = i) == null || typeof o2 == "boolean" || o2 === "" ? "" : typeof o2 != "number" || o2 === 0 || n in unitlessKeys || n.startsWith("--") ? String(o2).trim() : "".concat(o2, "px")), ";")));
|
|
997
|
+
}
|
|
998
|
+
return r;
|
|
999
|
+
};
|
|
1000
|
+
function Xe(e, t, n, o2) {
|
|
1001
|
+
if (Ue(e)) return [];
|
|
1002
|
+
if (se(e)) return [".".concat(e.styledComponentId)];
|
|
1003
|
+
if (re(e)) {
|
|
1004
|
+
if (!re(s = e) || s.prototype && s.prototype.isReactComponent || !t) return [e];
|
|
1005
|
+
var r = e(t);
|
|
1006
|
+
return process.env.NODE_ENV === "production" || typeof r != "object" || Array.isArray(r) || r instanceof qe || ce(r) || r === null || console.error("".concat(B(e), " is not a styled component and cannot be referred to via component selector. See https://www.styled-components.com/docs/advanced#referring-to-other-components for more details.")), Xe(r, t, n, o2);
|
|
1007
|
+
}
|
|
1008
|
+
var s;
|
|
1009
|
+
return e instanceof qe ? n ? (e.inject(n, o2), [e.getName(o2)]) : [e] : ce(e) ? Je(e) : Array.isArray(e) ? Array.prototype.concat.apply(_, e.map(function(e2) {
|
|
1010
|
+
return Xe(e2, t, n, o2);
|
|
1011
|
+
})) : [e.toString()];
|
|
1012
|
+
}
|
|
1013
|
+
function Ze(e) {
|
|
1014
|
+
for (var t = 0; t < e.length; t += 1) {
|
|
1015
|
+
var n = e[t];
|
|
1016
|
+
if (re(n) && !se(n)) return !1;
|
|
1017
|
+
}
|
|
1018
|
+
return !0;
|
|
1019
|
+
}
|
|
1020
|
+
var Ke = M(v), Qe = (function() {
|
|
1021
|
+
function e(e2, t, n) {
|
|
1022
|
+
this.rules = e2, this.staticRulesId = "", this.isStatic = process.env.NODE_ENV === "production" && (n === void 0 || n.isStatic) && Ze(e2), this.componentId = t, this.baseHash = z(Ke, t), this.baseStyle = n, ke.registerId(t);
|
|
1023
|
+
}
|
|
1024
|
+
return e.prototype.generateAndInjectStyles = function(e2, t, n) {
|
|
1025
|
+
var o2 = this.baseStyle ? this.baseStyle.generateAndInjectStyles(e2, t, n) : "";
|
|
1026
|
+
if (this.isStatic && !n.hash) if (this.staticRulesId && t.hasNameForId(this.componentId, this.staticRulesId)) o2 = ie(o2, this.staticRulesId);
|
|
1027
|
+
else {
|
|
1028
|
+
var r = ae(Xe(this.rules, e2, t, n)), s = x(z(this.baseHash, r) >>> 0);
|
|
1029
|
+
if (!t.hasNameForId(this.componentId, s)) {
|
|
1030
|
+
var i = n(r, ".".concat(s), void 0, this.componentId);
|
|
1031
|
+
t.insertRules(this.componentId, s, i);
|
|
1032
|
+
}
|
|
1033
|
+
o2 = ie(o2, s), this.staticRulesId = s;
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
for (var a = z(this.baseHash, n.hash), c = "", l = 0; l < this.rules.length; l++) {
|
|
1037
|
+
var u = this.rules[l];
|
|
1038
|
+
if (typeof u == "string") c += u, process.env.NODE_ENV !== "production" && (a = z(a, u));
|
|
1039
|
+
else if (u) {
|
|
1040
|
+
var p = ae(Xe(u, e2, t, n));
|
|
1041
|
+
a = z(a, p + l), c += p;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
if (c) {
|
|
1045
|
+
var d = x(a >>> 0);
|
|
1046
|
+
t.hasNameForId(this.componentId, d) || t.insertRules(this.componentId, d, n(c, ".".concat(d), void 0, this.componentId)), o2 = ie(o2, d);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
return o2;
|
|
1050
|
+
}, e;
|
|
1051
|
+
})(), et = o.createContext(void 0), rt = {}, st = /* @__PURE__ */ new Set();
|
|
1052
|
+
function it(e, r, s) {
|
|
1053
|
+
var i = se(e), a = e, c = !G(e), p = r.attrs, d = p === void 0 ? _ : p, h = r.componentId, f2 = h === void 0 ? (function(e2, t) {
|
|
1054
|
+
var n = typeof e2 != "string" ? "sc" : R(e2);
|
|
1055
|
+
rt[n] = (rt[n] || 0) + 1;
|
|
1056
|
+
var o2 = "".concat(n, "-").concat($(v + n + rt[n]));
|
|
1057
|
+
return t ? "".concat(t, "-").concat(o2) : o2;
|
|
1058
|
+
})(r.displayName, r.parentComponentId) : h, m2 = r.displayName, y2 = m2 === void 0 ? (function(e2) {
|
|
1059
|
+
return G(e2) ? "styled.".concat(e2) : "Styled(".concat(B(e2), ")");
|
|
1060
|
+
})(e) : m2, g2 = r.displayName && r.componentId ? "".concat(R(r.displayName), "-").concat(r.componentId) : r.componentId || f2, S2 = i && a.attrs ? a.attrs.concat(d).filter(Boolean) : d, w2 = r.shouldForwardProp;
|
|
1061
|
+
if (i && a.shouldForwardProp) {
|
|
1062
|
+
var b = a.shouldForwardProp;
|
|
1063
|
+
if (r.shouldForwardProp) {
|
|
1064
|
+
var E2 = r.shouldForwardProp;
|
|
1065
|
+
w2 = function(e2, t) {
|
|
1066
|
+
return b(e2, t) && E2(e2, t);
|
|
1067
|
+
};
|
|
1068
|
+
} else w2 = b;
|
|
1069
|
+
}
|
|
1070
|
+
var N2 = new Qe(s, g2, i ? a.componentStyle : void 0);
|
|
1071
|
+
function O2(e2, r2) {
|
|
1072
|
+
return (function(e3, r3, s2) {
|
|
1073
|
+
var i2 = e3.attrs, a2 = e3.componentStyle, c2 = e3.defaultProps, p2 = e3.foldedComponentIds, d2 = e3.styledComponentId, h2 = e3.target, f3 = o.useContext(et), m3 = Le(), y3 = e3.shouldForwardProp || m3.shouldForwardProp;
|
|
1074
|
+
process.env.NODE_ENV !== "production" && useDebugValue(d2);
|
|
1075
|
+
var v2 = I(r3, f3, c2) || C, g3 = (function(e4, n, o2) {
|
|
1076
|
+
for (var r4, s3 = __assign(__assign({}, n), { className: void 0, theme: o2 }), i3 = 0; i3 < e4.length; i3 += 1) {
|
|
1077
|
+
var a3 = re(r4 = e4[i3]) ? r4(s3) : r4;
|
|
1078
|
+
for (var c3 in a3) s3[c3] = c3 === "className" ? ie(s3[c3], a3[c3]) : c3 === "style" ? __assign(__assign({}, s3[c3]), a3[c3]) : a3[c3];
|
|
1079
|
+
}
|
|
1080
|
+
return n.className && (s3.className = ie(s3.className, n.className)), s3;
|
|
1081
|
+
})(i2, r3, v2), S3 = g3.as || h2, w3 = {};
|
|
1082
|
+
for (var b2 in g3) g3[b2] === void 0 || b2[0] === "$" || b2 === "as" || b2 === "theme" && g3.theme === v2 || (b2 === "forwardedAs" ? w3.as = g3.forwardedAs : y3 && !y3(b2, S3) || (w3[b2] = g3[b2], y3 || process.env.NODE_ENV !== "development" || isPropValid(b2) || st.has(b2) || !A.has(S3) || (st.add(b2), console.warn('styled-components: it looks like an unknown prop "'.concat(b2, '" is being sent through to the DOM, which will likely trigger a React console error. If you would like automatic filtering of unknown props, you can opt-into that behavior via `<StyleSheetManager shouldForwardProp={...}>` (connect an API like `@emotion/is-prop-valid`) or consider using transient props (`$` prefix for automatic filtering.)')))));
|
|
1083
|
+
var E3 = (function(e4, t) {
|
|
1084
|
+
var n = Le(), o2 = e4.generateAndInjectStyles(t, n.styleSheet, n.stylis);
|
|
1085
|
+
return process.env.NODE_ENV !== "production" && useDebugValue(o2), o2;
|
|
1086
|
+
})(a2, g3);
|
|
1087
|
+
process.env.NODE_ENV !== "production" && e3.warnTooManyClasses && e3.warnTooManyClasses(E3);
|
|
1088
|
+
var N3 = ie(p2, d2);
|
|
1089
|
+
return E3 && (N3 += " " + E3), g3.className && (N3 += " " + g3.className), w3[G(S3) && !A.has(S3) ? "class" : "className"] = N3, s2 && (w3.ref = s2), createElement(S3, w3);
|
|
1090
|
+
})(D2, e2, r2);
|
|
1091
|
+
}
|
|
1092
|
+
O2.displayName = y2;
|
|
1093
|
+
var D2 = o.forwardRef(O2);
|
|
1094
|
+
return D2.attrs = S2, D2.componentStyle = N2, D2.displayName = y2, D2.shouldForwardProp = w2, D2.foldedComponentIds = i ? ie(a.foldedComponentIds, a.styledComponentId) : "", D2.styledComponentId = g2, D2.target = i ? a.target : e, Object.defineProperty(D2, "defaultProps", { get: function() {
|
|
1095
|
+
return this._foldedDefaultProps;
|
|
1096
|
+
}, set: function(e2) {
|
|
1097
|
+
this._foldedDefaultProps = i ? (function(e3) {
|
|
1098
|
+
for (var t = [], n = 1; n < arguments.length; n++) t[n - 1] = arguments[n];
|
|
1099
|
+
for (var o2 = 0, r2 = t; o2 < r2.length; o2++) le(e3, r2[o2], !0);
|
|
1100
|
+
return e3;
|
|
1101
|
+
})({}, a.defaultProps, e2) : e2;
|
|
1102
|
+
} }), process.env.NODE_ENV !== "production" && (P(y2, g2), D2.warnTooManyClasses = /* @__PURE__ */ (function(e2, t) {
|
|
1103
|
+
var n = {}, o2 = !1;
|
|
1104
|
+
return function(r2) {
|
|
1105
|
+
if (!o2 && (n[r2] = !0, Object.keys(n).length >= 200)) {
|
|
1106
|
+
var s2 = t ? ' with the id of "'.concat(t, '"') : "";
|
|
1107
|
+
console.warn("Over ".concat(200, " classes were generated for component ").concat(e2).concat(s2, `.
|
|
1108
|
+
`) + `Consider using the attrs method, together with a style object for frequently changed styles.
|
|
1109
|
+
Example:
|
|
1110
|
+
const Component = styled.div.attrs(props => ({
|
|
1111
|
+
style: {
|
|
1112
|
+
background: props.background,
|
|
1113
|
+
},
|
|
1114
|
+
}))\`width: 100%;\`
|
|
1115
|
+
|
|
1116
|
+
<Component />`), o2 = !0, n = {};
|
|
1117
|
+
}
|
|
1118
|
+
};
|
|
1119
|
+
})(y2, g2)), ue(D2, function() {
|
|
1120
|
+
return ".".concat(D2.styledComponentId);
|
|
1121
|
+
}), c && oe(D2, e, { attrs: !0, componentStyle: !0, displayName: !0, foldedComponentIds: !0, shouldForwardProp: !0, styledComponentId: !0, target: !0 }), D2;
|
|
1122
|
+
}
|
|
1123
|
+
function at(e, t) {
|
|
1124
|
+
for (var n = [e[0]], o2 = 0, r = t.length; o2 < r; o2 += 1) n.push(t[o2], e[o2 + 1]);
|
|
1125
|
+
return n;
|
|
1126
|
+
}
|
|
1127
|
+
var ct = function(e) {
|
|
1128
|
+
return Object.assign(e, { isCss: !0 });
|
|
1129
|
+
};
|
|
1130
|
+
function lt(t) {
|
|
1131
|
+
for (var n = [], o2 = 1; o2 < arguments.length; o2++) n[o2 - 1] = arguments[o2];
|
|
1132
|
+
if (re(t) || ce(t)) return ct(Xe(at(_, __spreadArray([t], n, !0))));
|
|
1133
|
+
var r = t;
|
|
1134
|
+
return n.length === 0 && r.length === 1 && typeof r[0] == "string" ? Xe(r) : ct(Xe(at(r, n)));
|
|
1135
|
+
}
|
|
1136
|
+
function ut(n, o2, r) {
|
|
1137
|
+
if (r === void 0 && (r = C), !o2) throw he(1, o2);
|
|
1138
|
+
var s = function(t) {
|
|
1139
|
+
for (var s2 = [], i = 1; i < arguments.length; i++) s2[i - 1] = arguments[i];
|
|
1140
|
+
return n(o2, r, lt.apply(void 0, __spreadArray([t], s2, !1)));
|
|
1141
|
+
};
|
|
1142
|
+
return s.attrs = function(e) {
|
|
1143
|
+
return ut(n, o2, __assign(__assign({}, r), { attrs: Array.prototype.concat(r.attrs, e).filter(Boolean) }));
|
|
1144
|
+
}, s.withConfig = function(e) {
|
|
1145
|
+
return ut(n, o2, __assign(__assign({}, r), e));
|
|
1146
|
+
}, s;
|
|
1147
|
+
}
|
|
1148
|
+
var pt = function(e) {
|
|
1149
|
+
return ut(it, e);
|
|
1150
|
+
}, dt = pt;
|
|
1151
|
+
A.forEach(function(e) {
|
|
1152
|
+
dt[e] = pt(e);
|
|
1153
|
+
});
|
|
1154
|
+
process.env.NODE_ENV !== "production" && typeof navigator < "u" && navigator.product === "ReactNative" && console.warn(`It looks like you've imported 'styled-components' on React Native.
|
|
1155
|
+
Perhaps you're looking to import 'styled-components/native'?
|
|
1156
|
+
Read more about this at https://www.styled-components.com/docs/basics#react-native`);
|
|
1157
|
+
var wt = "__sc-".concat(f, "__");
|
|
1158
|
+
process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && typeof window < "u" && (window[wt] || (window[wt] = 0), window[wt] === 1 && console.warn(`It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.
|
|
1159
|
+
|
|
1160
|
+
See https://s-c.sh/2BAXzed for more info.`), window[wt] += 1);
|
|
1161
|
+
const WrapText = dt(Box)`
|
|
1162
|
+
white-space: normal;
|
|
1163
|
+
`, LocaleCheckbox = ({ locale, toggle, checked }) => {
|
|
1164
|
+
const onClick = useCallback(
|
|
1165
|
+
() => toggle(locale.localeId, !checked),
|
|
1166
|
+
[locale, toggle, checked]
|
|
1167
|
+
);
|
|
1168
|
+
return /* @__PURE__ */ jsx(
|
|
1169
|
+
Button,
|
|
1170
|
+
{
|
|
1171
|
+
mode: "ghost",
|
|
1172
|
+
onClick,
|
|
1173
|
+
disabled: locale.enabled === !1,
|
|
1174
|
+
style: { cursor: "pointer" },
|
|
1175
|
+
radius: 2,
|
|
1176
|
+
children: /* @__PURE__ */ jsxs(Flex, { align: "center", gap: 3, children: [
|
|
1177
|
+
/* @__PURE__ */ jsx(
|
|
1178
|
+
Switch,
|
|
1179
|
+
{
|
|
1180
|
+
style: { pointerEvents: "none" },
|
|
1181
|
+
disabled: locale.enabled === !1,
|
|
1182
|
+
onChange: onClick,
|
|
1183
|
+
checked
|
|
1184
|
+
}
|
|
1185
|
+
),
|
|
1186
|
+
/* @__PURE__ */ jsx(WrapText, { children: /* @__PURE__ */ jsx(Text, { size: 1, weight: "semibold", children: locale.description }) })
|
|
1187
|
+
] })
|
|
1188
|
+
}
|
|
1189
|
+
);
|
|
1190
|
+
}, NewTask = ({ locales, refreshTask }) => {
|
|
1191
|
+
const possibleLocales = locales.filter((locale) => locale.enabled !== !1), [selectedLocales, setSelectedLocales] = useState(
|
|
1192
|
+
locales.filter((locale) => locale.enabled !== !1).map((locale) => locale.localeId)
|
|
1193
|
+
);
|
|
1194
|
+
useEffect(() => {
|
|
1195
|
+
setSelectedLocales(
|
|
1196
|
+
locales.filter((locale) => locale.enabled !== !1).map((locale) => locale.localeId)
|
|
1197
|
+
);
|
|
1198
|
+
}, [locales]);
|
|
1199
|
+
const [selectedWorkflowUid, setSelectedWorkflowUid] = useState(), [isBusy, setIsBusy] = useState(!1), context = useContext(TranslationContext), toast = useToast(), toggleLocale = useCallback(
|
|
1200
|
+
(locale, selected) => {
|
|
1201
|
+
selected ? selectedLocales.includes(locale) || setSelectedLocales([...selectedLocales, locale]) : setSelectedLocales(selectedLocales.filter((l) => l !== locale));
|
|
1202
|
+
},
|
|
1203
|
+
[selectedLocales, setSelectedLocales]
|
|
1204
|
+
), createTask2 = useCallback(() => {
|
|
1205
|
+
if (!context) {
|
|
1206
|
+
toast.push({
|
|
1207
|
+
title: "Unable to create task: missing context",
|
|
1208
|
+
status: "error",
|
|
1209
|
+
closable: !0
|
|
1210
|
+
});
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
setIsBusy(!0), context.exportForTranslation(context.documentInfo).then(
|
|
1214
|
+
(serialized) => context.adapter.createTask(
|
|
1215
|
+
context.documentInfo,
|
|
1216
|
+
serialized,
|
|
1217
|
+
selectedLocales,
|
|
1218
|
+
context.secrets,
|
|
1219
|
+
selectedWorkflowUid,
|
|
1220
|
+
context.callbackUrl
|
|
1221
|
+
)
|
|
1222
|
+
).then(() => {
|
|
1223
|
+
toast.push({
|
|
1224
|
+
title: "Job successfully created",
|
|
1225
|
+
status: "success",
|
|
1226
|
+
closable: !0
|
|
1227
|
+
}), setSelectedLocales([]), setSelectedWorkflowUid(""), refreshTask();
|
|
1228
|
+
}).catch((err) => {
|
|
1229
|
+
let errorMsg;
|
|
1230
|
+
err instanceof Error ? errorMsg = err.message : errorMsg = err ? String(err) : null, toast.push({
|
|
1231
|
+
title: "Error creating translation job",
|
|
1232
|
+
description: errorMsg,
|
|
1233
|
+
status: "error",
|
|
1234
|
+
closable: !0
|
|
1235
|
+
});
|
|
1236
|
+
}).finally(() => {
|
|
1237
|
+
setIsBusy(!1);
|
|
1238
|
+
});
|
|
1239
|
+
}, [context, selectedLocales, selectedWorkflowUid, toast, refreshTask]), onClick = useCallback(() => {
|
|
1240
|
+
setSelectedLocales(
|
|
1241
|
+
possibleLocales.length === selectedLocales.length ? (
|
|
1242
|
+
// Disable all
|
|
1243
|
+
[]
|
|
1244
|
+
) : (
|
|
1245
|
+
// Enable all
|
|
1246
|
+
locales.filter((locale) => locale.enabled !== !1).map((locale) => locale.localeId)
|
|
1247
|
+
)
|
|
1248
|
+
);
|
|
1249
|
+
}, [possibleLocales, selectedLocales, setSelectedLocales, locales]), onToggle = useCallback(
|
|
1250
|
+
(locale, checked) => {
|
|
1251
|
+
toggleLocale(locale, checked);
|
|
1252
|
+
},
|
|
1253
|
+
[toggleLocale]
|
|
1254
|
+
), onWorkflowChange = useCallback(
|
|
1255
|
+
(e) => {
|
|
1256
|
+
setSelectedWorkflowUid(e.target.value);
|
|
1257
|
+
},
|
|
1258
|
+
[setSelectedWorkflowUid]
|
|
1259
|
+
);
|
|
1260
|
+
return /* @__PURE__ */ jsxs(Stack, { paddingTop: 4, space: 4, children: [
|
|
1261
|
+
/* @__PURE__ */ jsx(Text, { as: "h2", weight: "semibold", size: 2, children: "Generate New Translations" }),
|
|
1262
|
+
/* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
1263
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", justify: "space-between", children: [
|
|
1264
|
+
/* @__PURE__ */ jsx(Text, { weight: "semibold", size: 1, children: possibleLocales.length === 1 ? "Select locale" : "Select locales" }),
|
|
1265
|
+
/* @__PURE__ */ jsx(
|
|
1266
|
+
Button,
|
|
1267
|
+
{
|
|
1268
|
+
fontSize: 1,
|
|
1269
|
+
padding: 2,
|
|
1270
|
+
text: "Toggle All",
|
|
1271
|
+
onClick
|
|
1272
|
+
}
|
|
1273
|
+
)
|
|
1274
|
+
] }),
|
|
1275
|
+
/* @__PURE__ */ jsx(Grid, { columns: [1, 1, 2, 3], gap: 1, children: (locales || []).map((l) => /* @__PURE__ */ jsx(
|
|
1276
|
+
LocaleCheckbox,
|
|
1277
|
+
{
|
|
1278
|
+
locale: l,
|
|
1279
|
+
toggle: onToggle,
|
|
1280
|
+
checked: selectedLocales.includes(l.localeId)
|
|
1281
|
+
},
|
|
1282
|
+
l.localeId
|
|
1283
|
+
)) })
|
|
1284
|
+
] }),
|
|
1285
|
+
context?.workflowOptions && context.workflowOptions.length > 0 && /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
|
|
1286
|
+
/* @__PURE__ */ jsx(Text, { weight: "semibold", size: 1, as: "label", htmlFor: "workflow-select", children: "Select translation workflow" }),
|
|
1287
|
+
/* @__PURE__ */ jsx(Grid, { columns: [1, 1, 2], children: /* @__PURE__ */ jsxs(Select, { id: "workflowSelect", onChange: onWorkflowChange, children: [
|
|
1288
|
+
/* @__PURE__ */ jsx("option", { children: "Default locale workflows" }),
|
|
1289
|
+
context.workflowOptions.map((w2) => /* @__PURE__ */ jsx(
|
|
1290
|
+
"option",
|
|
1291
|
+
{
|
|
1292
|
+
value: w2.workflowUid,
|
|
1293
|
+
children: w2.workflowName
|
|
1294
|
+
},
|
|
1295
|
+
`workflow-opt-${w2.workflowUid}`
|
|
1296
|
+
))
|
|
1297
|
+
] }) })
|
|
1298
|
+
] }),
|
|
1299
|
+
/* @__PURE__ */ jsx(
|
|
1300
|
+
Button,
|
|
1301
|
+
{
|
|
1302
|
+
onClick: createTask2,
|
|
1303
|
+
disabled: isBusy || !selectedLocales.length,
|
|
1304
|
+
tone: "positive",
|
|
1305
|
+
text: isBusy ? "Queueing translations..." : "Generate Translations"
|
|
1306
|
+
}
|
|
1307
|
+
)
|
|
1308
|
+
] });
|
|
1309
|
+
};
|
|
1310
|
+
function ProgressBar({ progress }) {
|
|
1311
|
+
return typeof progress > "u" ? (console.warn("No progress prop passed to ProgressBar"), null) : /* @__PURE__ */ jsxs(Card, { border: !0, radius: 2, style: { width: "100%", position: "relative" }, children: [
|
|
1312
|
+
/* @__PURE__ */ jsx(
|
|
1313
|
+
Flex,
|
|
1314
|
+
{
|
|
1315
|
+
style: {
|
|
1316
|
+
position: "absolute",
|
|
1317
|
+
left: 0,
|
|
1318
|
+
right: 0,
|
|
1319
|
+
top: 0,
|
|
1320
|
+
bottom: 0,
|
|
1321
|
+
zIndex: 1
|
|
1322
|
+
},
|
|
1323
|
+
align: "center",
|
|
1324
|
+
justify: "center",
|
|
1325
|
+
children: /* @__PURE__ */ jsxs(Label, { size: 1, children: [
|
|
1326
|
+
progress,
|
|
1327
|
+
"%"
|
|
1328
|
+
] })
|
|
1329
|
+
}
|
|
1330
|
+
),
|
|
1331
|
+
/* @__PURE__ */ jsx(
|
|
1332
|
+
Card,
|
|
1333
|
+
{
|
|
1334
|
+
style: {
|
|
1335
|
+
width: "100%",
|
|
1336
|
+
transform: `scaleX(${progress / 100})`,
|
|
1337
|
+
transformOrigin: "left",
|
|
1338
|
+
transition: "transform .2s ease",
|
|
1339
|
+
boxSizing: "border-box"
|
|
1340
|
+
},
|
|
1341
|
+
padding: 2,
|
|
1342
|
+
tone: "positive"
|
|
1343
|
+
}
|
|
1344
|
+
)
|
|
1345
|
+
] });
|
|
1346
|
+
}
|
|
1347
|
+
const LanguageStatus = ({
|
|
1348
|
+
title,
|
|
1349
|
+
progress,
|
|
1350
|
+
importFile,
|
|
1351
|
+
isImported = !1
|
|
1352
|
+
}) => {
|
|
1353
|
+
const [isBusy, setIsBusy] = useState(!1), handleImport = useCallback(async () => {
|
|
1354
|
+
setIsBusy(!0);
|
|
1355
|
+
try {
|
|
1356
|
+
await importFile();
|
|
1357
|
+
} finally {
|
|
1358
|
+
setIsBusy(!1);
|
|
1359
|
+
}
|
|
1360
|
+
}, [importFile, setIsBusy]);
|
|
1361
|
+
return /* @__PURE__ */ jsx(Card, { shadow: 1, children: /* @__PURE__ */ jsxs(Grid, { columns: 5, gap: 3, padding: 3, children: [
|
|
1362
|
+
/* @__PURE__ */ jsx(Flex, { columnStart: 1, columnEnd: 3, align: "center", children: /* @__PURE__ */ jsx(Text, { weight: "bold", size: 1, children: title }) }),
|
|
1363
|
+
typeof progress == "number" ? /* @__PURE__ */ jsx(Flex, { columnStart: 3, columnEnd: 5, align: "center", children: /* @__PURE__ */ jsx(ProgressBar, { progress }) }) : null,
|
|
1364
|
+
/* @__PURE__ */ jsx(Box, { columnStart: 5, columnEnd: 6, children: isImported ? /* @__PURE__ */ jsxs(Flex, { align: "center", justify: "center", style: { color: "green" }, children: [
|
|
1365
|
+
/* @__PURE__ */ jsx(CheckmarkCircleIcon, {}),
|
|
1366
|
+
/* @__PURE__ */ jsx(Text, { size: 1, style: { marginLeft: "4px" }, children: "Imported" })
|
|
1367
|
+
] }) : /* @__PURE__ */ jsx(
|
|
1368
|
+
Button,
|
|
1369
|
+
{
|
|
1370
|
+
style: { width: "100%" },
|
|
1371
|
+
mode: "ghost",
|
|
1372
|
+
onClick: handleImport,
|
|
1373
|
+
text: isBusy ? "Importing..." : "Import",
|
|
1374
|
+
icon: isBusy ? null : DownloadIcon,
|
|
1375
|
+
disabled: isBusy || !progress || progress < 100
|
|
1376
|
+
}
|
|
1377
|
+
) })
|
|
1378
|
+
] }) });
|
|
1379
|
+
}, getLocale = (localeId, locales) => locales.find((l) => l.localeId === localeId), TaskView = ({ task, locales, refreshTask }) => {
|
|
1380
|
+
const context = useContext(TranslationContext), toast = useToast(), [isRefreshing, setIsRefreshing] = useState(!1), [autoRefresh, setAutoRefresh] = useState(!0), [isBusy, setIsBusy] = useState(!1), [autoImport, setAutoImport] = useState(!0), [importedFiles, setImportedFiles] = useState(/* @__PURE__ */ new Set()), importFile = useCallback(
|
|
1381
|
+
async (localeId) => {
|
|
1382
|
+
if (!context) {
|
|
1383
|
+
toast.push({
|
|
1384
|
+
title: "Missing context, unable to import translation. Try refreshing or clicking away from this tab and back.",
|
|
1385
|
+
status: "error",
|
|
1386
|
+
closable: !0
|
|
1387
|
+
});
|
|
1388
|
+
return;
|
|
1389
|
+
}
|
|
1390
|
+
const localeTitle = getLocale(localeId, locales)?.description || localeId;
|
|
1391
|
+
try {
|
|
1392
|
+
const translation = await context.adapter.getTranslation(
|
|
1393
|
+
task.document,
|
|
1394
|
+
localeId,
|
|
1395
|
+
context.secrets
|
|
1396
|
+
), sanityId = context.localeIdAdapter ? await context.localeIdAdapter(localeId) : localeId;
|
|
1397
|
+
await context.importTranslation(sanityId, translation), setImportedFiles((prev2) => /* @__PURE__ */ new Set([...prev2, localeId])), toast.push({
|
|
1398
|
+
title: `Imported ${localeTitle} translation`,
|
|
1399
|
+
status: "success",
|
|
1400
|
+
closable: !0
|
|
1401
|
+
});
|
|
1402
|
+
} catch (err) {
|
|
1403
|
+
let errorMsg;
|
|
1404
|
+
err instanceof Error ? errorMsg = err.message : errorMsg = err ? String(err) : null, toast.push({
|
|
1405
|
+
title: `Error getting ${localeTitle} translation`,
|
|
1406
|
+
description: errorMsg,
|
|
1407
|
+
status: "error",
|
|
1408
|
+
closable: !0
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
},
|
|
1412
|
+
[locales, context, task.document, toast]
|
|
1413
|
+
), checkAndImportCompletedFiles = useCallback(async () => {
|
|
1414
|
+
if (!autoImport || isBusy) return;
|
|
1415
|
+
const completedFiles = task.locales.filter(
|
|
1416
|
+
(locale) => (locale.progress || 0) >= 100 && !importedFiles.has(locale.localeId)
|
|
1417
|
+
);
|
|
1418
|
+
if (completedFiles.length !== 0) {
|
|
1419
|
+
setIsBusy(!0);
|
|
1420
|
+
try {
|
|
1421
|
+
for (const locale of completedFiles)
|
|
1422
|
+
await importFile(locale.localeId);
|
|
1423
|
+
} finally {
|
|
1424
|
+
setIsBusy(!1);
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
}, [autoImport, isBusy, task.locales, importedFiles, importFile]), handleRefreshClick = useCallback(async () => {
|
|
1428
|
+
isRefreshing || (setIsRefreshing(!0), await refreshTask(), await checkAndImportCompletedFiles(), setIsRefreshing(!1));
|
|
1429
|
+
}, [refreshTask, setIsRefreshing, checkAndImportCompletedFiles]), handleImportAll = useCallback(async () => {
|
|
1430
|
+
if (!isBusy) {
|
|
1431
|
+
setIsBusy(!0);
|
|
1432
|
+
try {
|
|
1433
|
+
const filesToImport = task.locales.filter(
|
|
1434
|
+
(locale) => !importedFiles.has(locale.localeId)
|
|
1435
|
+
);
|
|
1436
|
+
for (const locale of filesToImport)
|
|
1437
|
+
await importFile(locale.localeId);
|
|
1438
|
+
} finally {
|
|
1439
|
+
setIsBusy(!1);
|
|
1440
|
+
}
|
|
1441
|
+
}
|
|
1442
|
+
}, [task.locales, importFile, isBusy, importedFiles]);
|
|
1443
|
+
return useEffect(() => {
|
|
1444
|
+
if (!autoRefresh || importedFiles.size === task.locales.length) return;
|
|
1445
|
+
const interval = setInterval(async () => {
|
|
1446
|
+
await handleRefreshClick();
|
|
1447
|
+
}, 5e3);
|
|
1448
|
+
return () => clearInterval(interval);
|
|
1449
|
+
}, [
|
|
1450
|
+
handleRefreshClick,
|
|
1451
|
+
autoRefresh,
|
|
1452
|
+
importedFiles.size,
|
|
1453
|
+
task.locales.length
|
|
1454
|
+
]), useEffect(() => {
|
|
1455
|
+
checkAndImportCompletedFiles();
|
|
1456
|
+
}, [checkAndImportCompletedFiles, task.locales]), useEffect(() => {
|
|
1457
|
+
setImportedFiles((prev2) => {
|
|
1458
|
+
const newSet = /* @__PURE__ */ new Set();
|
|
1459
|
+
for (const localeId of prev2)
|
|
1460
|
+
task.locales.some((locale) => locale.localeId === localeId) && newSet.add(localeId);
|
|
1461
|
+
return newSet;
|
|
1462
|
+
});
|
|
1463
|
+
}, [task.locales]), /* @__PURE__ */ jsxs(Stack, { space: 4, children: [
|
|
1464
|
+
/* @__PURE__ */ jsxs(Flex, { align: "center", justify: "space-between", children: [
|
|
1465
|
+
/* @__PURE__ */ jsx(Text, { as: "h2", weight: "semibold", size: 2, children: "Translation Progress" }),
|
|
1466
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 3, align: "center", children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, align: "center", children: [
|
|
1468
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: "Auto-refresh" }),
|
|
1469
|
+
/* @__PURE__ */ jsx(
|
|
1470
|
+
Switch,
|
|
1471
|
+
{
|
|
1472
|
+
checked: autoRefresh,
|
|
1473
|
+
onChange: () => setAutoRefresh(!autoRefresh)
|
|
1474
|
+
}
|
|
1475
|
+
)
|
|
1476
|
+
] }),
|
|
1477
|
+
task.linkToVendorTask && /* @__PURE__ */ jsx(
|
|
1478
|
+
Button,
|
|
1479
|
+
{
|
|
1480
|
+
as: "a",
|
|
1481
|
+
text: "View Job",
|
|
1482
|
+
iconRight: ArrowTopRightIcon,
|
|
1483
|
+
href: task.linkToVendorTask,
|
|
1484
|
+
target: "_blank",
|
|
1485
|
+
rel: "noreferrer noopener",
|
|
1486
|
+
fontSize: 1,
|
|
1487
|
+
padding: 2,
|
|
1488
|
+
mode: "bleed"
|
|
1489
|
+
}
|
|
1490
|
+
),
|
|
1491
|
+
/* @__PURE__ */ jsx(
|
|
1492
|
+
Button,
|
|
1493
|
+
{
|
|
1494
|
+
fontSize: 1,
|
|
1495
|
+
padding: 2,
|
|
1496
|
+
text: "Refresh Status",
|
|
1497
|
+
onClick: handleRefreshClick,
|
|
1498
|
+
disabled: isRefreshing
|
|
1499
|
+
}
|
|
1500
|
+
)
|
|
1501
|
+
] })
|
|
1502
|
+
] }),
|
|
1503
|
+
/* @__PURE__ */ jsx(Box, { children: task.locales.map((localeTask) => {
|
|
1504
|
+
const reportPercent = localeTask.progress || 0, locale = getLocale(localeTask.localeId, locales);
|
|
1505
|
+
return /* @__PURE__ */ jsx(
|
|
1506
|
+
LanguageStatus,
|
|
1507
|
+
{
|
|
1508
|
+
importFile: async () => {
|
|
1509
|
+
await importFile(localeTask.localeId);
|
|
1510
|
+
},
|
|
1511
|
+
title: locale?.description || localeTask.localeId,
|
|
1512
|
+
progress: reportPercent,
|
|
1513
|
+
isImported: importedFiles.has(localeTask.localeId)
|
|
1514
|
+
},
|
|
1515
|
+
[task.document.documentId, localeTask.localeId].join(".")
|
|
1516
|
+
);
|
|
1517
|
+
}) }),
|
|
1518
|
+
/* @__PURE__ */ jsx(Stack, { space: 3, children: /* @__PURE__ */ jsxs(Flex, { gap: 3, align: "center", justify: "space-between", children: [
|
|
1519
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, align: "center", children: [
|
|
1520
|
+
/* @__PURE__ */ jsx(
|
|
1521
|
+
Button,
|
|
1522
|
+
{
|
|
1523
|
+
mode: "ghost",
|
|
1524
|
+
onClick: handleImportAll,
|
|
1525
|
+
text: isBusy ? "Importing..." : "Import All",
|
|
1526
|
+
icon: isBusy ? null : DownloadIcon,
|
|
1527
|
+
disabled: isBusy || importedFiles.size === task.locales.length
|
|
1528
|
+
}
|
|
1529
|
+
),
|
|
1530
|
+
importedFiles.size === task.locales.length && task.locales.length > 0 && /* @__PURE__ */ jsxs(Flex, { gap: 2, align: "center", style: { color: "green" }, children: [
|
|
1531
|
+
/* @__PURE__ */ jsx(CheckmarkCircleIcon, {}),
|
|
1532
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: "All translations imported" })
|
|
1533
|
+
] }),
|
|
1534
|
+
importedFiles.size > 0 && importedFiles.size < task.locales.length && /* @__PURE__ */ jsxs(Text, { size: 1, style: { color: "#666" }, children: [
|
|
1535
|
+
importedFiles.size,
|
|
1536
|
+
"/",
|
|
1537
|
+
task.locales.length,
|
|
1538
|
+
" imported"
|
|
1539
|
+
] })
|
|
1540
|
+
] }),
|
|
1541
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, align: "center", style: { whiteSpace: "nowrap" }, children: [
|
|
1542
|
+
/* @__PURE__ */ jsx(Text, { size: 1, children: "Auto-import when complete" }),
|
|
1543
|
+
/* @__PURE__ */ jsx(
|
|
1544
|
+
Switch,
|
|
1545
|
+
{
|
|
1546
|
+
checked: autoImport,
|
|
1547
|
+
onChange: () => setAutoImport(!autoImport),
|
|
1548
|
+
disabled: isBusy
|
|
1549
|
+
}
|
|
1550
|
+
)
|
|
1551
|
+
] })
|
|
1552
|
+
] }) })
|
|
1553
|
+
] });
|
|
1554
|
+
}, TranslationView = () => {
|
|
1555
|
+
const [locales, setLocales] = useState([]), [task, setTask] = useState(null), context = useContext(TranslationContext), toast = useToast();
|
|
1556
|
+
useEffect(() => {
|
|
1557
|
+
async function fetchData() {
|
|
1558
|
+
if (!context) {
|
|
1559
|
+
toast.push({
|
|
1560
|
+
title: "Unable to load translation data: missing context",
|
|
1561
|
+
status: "error",
|
|
1562
|
+
closable: !0
|
|
1563
|
+
});
|
|
1564
|
+
return;
|
|
1565
|
+
}
|
|
1566
|
+
const locales2 = await context.adapter.getLocales(context.secrets);
|
|
1567
|
+
setLocales(locales2);
|
|
1568
|
+
try {
|
|
1569
|
+
const task2 = await context?.adapter.getTranslationTask(
|
|
1570
|
+
context.documentInfo,
|
|
1571
|
+
context.secrets
|
|
1572
|
+
);
|
|
1573
|
+
setTask(task2);
|
|
1574
|
+
} catch (err) {
|
|
1575
|
+
let errorMsg;
|
|
1576
|
+
if (err instanceof Error ? errorMsg = err.message : errorMsg = err ? String(err) : null, errorMsg?.toLowerCase().includes("no source file found"))
|
|
1577
|
+
return;
|
|
1578
|
+
toast.push({
|
|
1579
|
+
title: "Error creating translation job",
|
|
1580
|
+
description: errorMsg,
|
|
1581
|
+
status: "error",
|
|
1582
|
+
closable: !0
|
|
1583
|
+
});
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
fetchData();
|
|
1587
|
+
}, [context, toast]);
|
|
1588
|
+
const refreshTask = useCallback(async () => {
|
|
1589
|
+
const task2 = await context?.adapter.getTranslationTask(
|
|
1590
|
+
context.documentInfo,
|
|
1591
|
+
context.secrets
|
|
1592
|
+
);
|
|
1593
|
+
task2 && setTask(task2);
|
|
1594
|
+
}, [context, setTask]);
|
|
1595
|
+
return /* @__PURE__ */ jsxs(Stack, { space: 6, children: [
|
|
1596
|
+
/* @__PURE__ */ jsx(NewTask, { locales, refreshTask }),
|
|
1597
|
+
task && /* @__PURE__ */ jsx(TaskView, { task, locales, refreshTask })
|
|
1598
|
+
] });
|
|
1599
|
+
}, useClient = () => useClient$1({ apiVersion: "2022-12-07" });
|
|
1600
|
+
function useSecrets(id) {
|
|
1601
|
+
const [loading, setLoading] = useState(!0), [secrets, setSecrets] = useState(null), client = useClient();
|
|
1602
|
+
return useEffect(() => {
|
|
1603
|
+
function fetchData() {
|
|
1604
|
+
client.fetch("* [_id == $id][0]", { id }).then((doc) => {
|
|
1605
|
+
const result = {};
|
|
1606
|
+
for (const key in doc)
|
|
1607
|
+
key[0] !== "_" && (result[key] = doc[key]);
|
|
1608
|
+
setSecrets(result), setLoading(!1);
|
|
1609
|
+
});
|
|
1610
|
+
}
|
|
1611
|
+
fetchData();
|
|
1612
|
+
}, [id, client]), { loading, secrets };
|
|
1613
|
+
}
|
|
1614
|
+
const TranslationTab = (props) => {
|
|
1615
|
+
const { displayed } = props.document, client = useClient(), schema = useSchema(), documentId = displayed && displayed._id ? displayed._id.split("drafts.").pop() : "", revisionId = displayed && displayed._rev ? displayed._rev : void 0, { errors, importTranslation, exportForTranslation } = useMemo(() => {
|
|
1616
|
+
const { serializationOptions, languageField, mergeWithTargetLocale } = props.options, ctx = {
|
|
1617
|
+
client,
|
|
1618
|
+
schema
|
|
1619
|
+
}, allErrors = [], importTranslationFunc = props.options.importTranslation;
|
|
1620
|
+
importTranslationFunc || allErrors.push({
|
|
1621
|
+
key: randomKey(12),
|
|
1622
|
+
text: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1623
|
+
"You need to provide an ",
|
|
1624
|
+
/* @__PURE__ */ jsx("code", { children: "importTranslation" }),
|
|
1625
|
+
" function. See documentation."
|
|
1626
|
+
] })
|
|
1627
|
+
});
|
|
1628
|
+
const contextImportTranslation = (localeId, doc) => importTranslationFunc(
|
|
1629
|
+
{ documentId, versionId: revisionId },
|
|
1630
|
+
localeId,
|
|
1631
|
+
doc,
|
|
1632
|
+
ctx,
|
|
1633
|
+
serializationOptions,
|
|
1634
|
+
languageField,
|
|
1635
|
+
mergeWithTargetLocale
|
|
1636
|
+
), exportTranslationFunc = props.options.exportForTranslation;
|
|
1637
|
+
return exportTranslationFunc || allErrors.push({
|
|
1638
|
+
key: randomKey(12),
|
|
1639
|
+
text: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1640
|
+
"You need to provide an ",
|
|
1641
|
+
/* @__PURE__ */ jsx("code", { children: "exportForTranslation" }),
|
|
1642
|
+
" function. See documentation."
|
|
1643
|
+
] })
|
|
1644
|
+
}), {
|
|
1645
|
+
errors: allErrors,
|
|
1646
|
+
importTranslation: contextImportTranslation,
|
|
1647
|
+
exportForTranslation: (docInfo) => exportTranslationFunc(
|
|
1648
|
+
docInfo,
|
|
1649
|
+
ctx,
|
|
1650
|
+
serializationOptions,
|
|
1651
|
+
languageField
|
|
1652
|
+
)
|
|
1653
|
+
};
|
|
1654
|
+
}, [props.options, documentId, revisionId, client, schema]), { loading, secrets } = useSecrets(
|
|
1655
|
+
`${props.options.secretsNamespace || "translationService"}.secrets`
|
|
1656
|
+
), hasErrors = errors.length > 0;
|
|
1657
|
+
return loading || !secrets ? /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Flex, { padding: 5, align: "center", justify: "center", children: /* @__PURE__ */ jsx(Spinner, {}) }) }) : secrets ? /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Layer, { children: /* @__PURE__ */ jsxs(ToastProvider, { paddingY: 7, children: [
|
|
1658
|
+
hasErrors && /* @__PURE__ */ jsx(Stack, { space: 3, children: errors.map((error) => /* @__PURE__ */ jsx(
|
|
1659
|
+
Card,
|
|
1660
|
+
{
|
|
1661
|
+
tone: "caution",
|
|
1662
|
+
padding: [2, 3, 4, 4],
|
|
1663
|
+
shadow: 1,
|
|
1664
|
+
radius: 2,
|
|
1665
|
+
children: /* @__PURE__ */ jsx(Text, { children: error.text })
|
|
1666
|
+
},
|
|
1667
|
+
error.key
|
|
1668
|
+
)) }),
|
|
1669
|
+
!hasErrors && /* @__PURE__ */ jsx(
|
|
1670
|
+
TranslationContext.Provider,
|
|
1671
|
+
{
|
|
1672
|
+
value: {
|
|
1673
|
+
documentInfo: { documentId, versionId: revisionId },
|
|
1674
|
+
secrets,
|
|
1675
|
+
importTranslation,
|
|
1676
|
+
exportForTranslation,
|
|
1677
|
+
adapter: props.options.adapter,
|
|
1678
|
+
workflowOptions: props.options.workflowOptions,
|
|
1679
|
+
localeIdAdapter: props.options.localeIdAdapter,
|
|
1680
|
+
callbackUrl: props.options.callbackUrl,
|
|
1681
|
+
mergeWithTargetLocale: props.options.mergeWithTargetLocale
|
|
1682
|
+
},
|
|
1683
|
+
children: /* @__PURE__ */ jsx(TranslationView, {})
|
|
1684
|
+
}
|
|
1685
|
+
)
|
|
1686
|
+
] }) }) }) }) : /* @__PURE__ */ jsx(ThemeProvider, { children: /* @__PURE__ */ jsx(Box, { padding: 4, children: /* @__PURE__ */ jsx(Card, { tone: "caution", padding: [2, 3, 4, 4], shadow: 1, radius: 2, children: /* @__PURE__ */ jsx(Text, { children: "Can't find secrets for your translation service. Did you load them into this dataset?" }) }) }) });
|
|
1687
|
+
}, findDocumentAtRevision = async (documentId, rev, client) => {
|
|
1688
|
+
const baseUrl = `/data/history/${client.config().dataset}/documents/${documentId}?revision=${rev}`, url = client.getUrl(baseUrl);
|
|
1689
|
+
return await fetch(url, { credentials: "include" }).then((req) => req.json()).then((req) => req.documents && req.documents.length ? req.documents[0] : null);
|
|
1690
|
+
}, findLatestDraft = (documentId, client) => {
|
|
1691
|
+
const query = "*[_id == $id || _id == $draftId]", params = { id: documentId, draftId: `drafts.${documentId}` };
|
|
1692
|
+
return client.fetch(query, params).then(
|
|
1693
|
+
(docs) => docs.find((doc) => doc._id.startsWith("drafts.")) ?? docs[0]
|
|
1694
|
+
);
|
|
1695
|
+
}, createI18nDocAndPatchMetadata = (translatedDoc, localeId, client, translationMetadata, languageField = "language") => {
|
|
1696
|
+
translatedDoc[languageField] = localeId;
|
|
1697
|
+
const existingLocaleKey = translationMetadata.translations.find(
|
|
1698
|
+
(translation) => translation._key === localeId
|
|
1699
|
+
), operation = existingLocaleKey ? "replace" : "after", location = existingLocaleKey ? `translations[_key == "${localeId}"]` : "translations[-1]", { _updatedAt, _createdAt, ...rest } = translatedDoc;
|
|
1700
|
+
client.create({ ...rest, _id: "drafts." }).then((doc) => {
|
|
1701
|
+
const _ref = doc._id.replace("drafts.", "");
|
|
1702
|
+
client.transaction().patch(
|
|
1703
|
+
translationMetadata._id,
|
|
1704
|
+
(p) => p.insert(operation, location, [
|
|
1705
|
+
{
|
|
1706
|
+
_key: localeId,
|
|
1707
|
+
_type: "internationalizedArrayReferenceValue",
|
|
1708
|
+
value: {
|
|
1709
|
+
_type: "reference",
|
|
1710
|
+
_ref,
|
|
1711
|
+
_weak: !0,
|
|
1712
|
+
_strengthenOnPublish: {
|
|
1713
|
+
type: doc._type
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
}
|
|
1717
|
+
])
|
|
1718
|
+
).commit();
|
|
1719
|
+
});
|
|
1720
|
+
}, getOrCreateTranslationMetadata = async (documentId, baseDocument, client, baseLanguage) => {
|
|
1721
|
+
const existingMetadata = await client.fetch(
|
|
1722
|
+
`*[
|
|
1723
|
+
_type == 'translation.metadata' &&
|
|
1724
|
+
translations[_key == $baseLanguage][0].value._ref == $id
|
|
1725
|
+
][0]`,
|
|
1726
|
+
{ baseLanguage, id: documentId.replace("drafts.", "") }
|
|
1727
|
+
);
|
|
1728
|
+
if (existingMetadata)
|
|
1729
|
+
return existingMetadata;
|
|
1730
|
+
const baseLangEntry = {
|
|
1731
|
+
_key: baseLanguage,
|
|
1732
|
+
_type: "internationalizedArrayReferenceValue",
|
|
1733
|
+
value: {
|
|
1734
|
+
_type: "reference",
|
|
1735
|
+
_ref: baseDocument._id.replace("drafts.", "")
|
|
1736
|
+
}
|
|
1737
|
+
};
|
|
1738
|
+
baseDocument._id.startsWith("drafts.") && (baseLangEntry.value = {
|
|
1739
|
+
...baseLangEntry.value,
|
|
1740
|
+
_weak: !0,
|
|
1741
|
+
//this should reflect doc i18n config when this
|
|
1742
|
+
//plugin is able to take that as a config option
|
|
1743
|
+
_strengthenOnPublish: {
|
|
1744
|
+
type: baseDocument._type
|
|
1745
|
+
}
|
|
1746
|
+
});
|
|
1747
|
+
try {
|
|
1748
|
+
return await client.createIfNotExists({
|
|
1749
|
+
_id: `translation.metadata.${documentId.replace("drafts.", "")}`,
|
|
1750
|
+
_type: "translation.metadata",
|
|
1751
|
+
translations: [baseLangEntry]
|
|
1752
|
+
});
|
|
1753
|
+
} catch (error) {
|
|
1754
|
+
const metadata = await client.fetch(
|
|
1755
|
+
`*[
|
|
1756
|
+
_type == 'translation.metadata' &&
|
|
1757
|
+
translations[_key == $baseLanguage][0].value._ref == $id
|
|
1758
|
+
][0]`,
|
|
1759
|
+
{ baseLanguage, id: documentId.replace("drafts.", "") }
|
|
1760
|
+
);
|
|
1761
|
+
if (metadata)
|
|
1762
|
+
return metadata;
|
|
1763
|
+
throw error;
|
|
1764
|
+
}
|
|
1765
|
+
}, patchI18nDoc = (i18nDocId, mergedDocument, translatedFields, client) => {
|
|
1766
|
+
const cleanedMerge = {};
|
|
1767
|
+
Object.entries(mergedDocument).forEach(([key, value]) => {
|
|
1768
|
+
key in translatedFields && //don't overwrite any existing system values on the i18n doc
|
|
1769
|
+
!["_id", "_rev", "_updatedAt", "language"].includes(key) && (cleanedMerge[key] = value);
|
|
1770
|
+
}), client.transaction().patch(i18nDocId, (p) => p.set(cleanedMerge)).commit();
|
|
1771
|
+
}, gt = new GT();
|
|
1772
|
+
function overrideConfig(secrets) {
|
|
1773
|
+
gt.setConfig({
|
|
1774
|
+
...secrets?.project && { projectId: secrets?.project },
|
|
1775
|
+
...secrets?.secret && { apiKey: secrets?.secret }
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
class GTConfig {
|
|
1779
|
+
sourceLocale;
|
|
1780
|
+
locales;
|
|
1781
|
+
static instance;
|
|
1782
|
+
constructor(sourceLocale, locales) {
|
|
1783
|
+
this.sourceLocale = sourceLocale, this.locales = locales;
|
|
1784
|
+
}
|
|
1785
|
+
static getInstance() {
|
|
1786
|
+
return this.instance || (this.instance = new GTConfig(gt.sourceLocale || libraryDefaultLocale, [])), this.instance;
|
|
1787
|
+
}
|
|
1788
|
+
setSourceLocale(sourceLocale) {
|
|
1789
|
+
this.sourceLocale = sourceLocale;
|
|
1790
|
+
}
|
|
1791
|
+
getSourceLocale() {
|
|
1792
|
+
return this.sourceLocale;
|
|
1793
|
+
}
|
|
1794
|
+
setLocales(locales) {
|
|
1795
|
+
this.locales = locales;
|
|
1796
|
+
}
|
|
1797
|
+
getLocales() {
|
|
1798
|
+
return this.locales;
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
const gtConfig = GTConfig.getInstance(), documentLevelPatch = async (docInfo, translatedFields, localeId, client, languageField = "language", mergeWithTargetLocale = !1) => {
|
|
1802
|
+
const baseLanguage = gtConfig.getSourceLocale();
|
|
1803
|
+
let baseDoc = null, i18nDoc = null;
|
|
1804
|
+
docInfo.documentId && docInfo.versionId && (baseDoc = await findDocumentAtRevision(
|
|
1805
|
+
docInfo.documentId,
|
|
1806
|
+
docInfo.versionId,
|
|
1807
|
+
client
|
|
1808
|
+
)), baseDoc || (baseDoc = await findLatestDraft(docInfo.documentId, client));
|
|
1809
|
+
const translationMetadata = await getOrCreateTranslationMetadata(
|
|
1810
|
+
docInfo.documentId,
|
|
1811
|
+
baseDoc,
|
|
1812
|
+
client,
|
|
1813
|
+
baseLanguage
|
|
1814
|
+
), i18nDocId = translationMetadata.translations.find((translation) => translation._key === localeId)?.value?._ref;
|
|
1815
|
+
i18nDocId && (i18nDoc = await findLatestDraft(i18nDocId, client)), mergeWithTargetLocale && i18nDoc ? baseDoc = i18nDoc : docInfo.documentId && docInfo.versionId && (baseDoc = await findDocumentAtRevision(
|
|
1816
|
+
docInfo.documentId,
|
|
1817
|
+
docInfo.versionId,
|
|
1818
|
+
client
|
|
1819
|
+
)), baseDoc || (baseDoc = await findLatestDraft(docInfo.documentId, client));
|
|
1820
|
+
const merged = BaseDocumentMerger.documentLevelMerge(
|
|
1821
|
+
translatedFields,
|
|
1822
|
+
baseDoc
|
|
1823
|
+
);
|
|
1824
|
+
i18nDoc ? patchI18nDoc(docInfo.documentId, merged, translatedFields, client) : createI18nDocAndPatchMetadata(
|
|
1825
|
+
merged,
|
|
1826
|
+
localeId,
|
|
1827
|
+
client,
|
|
1828
|
+
translationMetadata,
|
|
1829
|
+
languageField
|
|
1830
|
+
);
|
|
1831
|
+
}, legacyDocumentLevelPatch = async (docInfo, translatedFields, localeId, client) => {
|
|
1832
|
+
let baseDoc = null;
|
|
1833
|
+
docInfo.documentId && docInfo.versionId && (baseDoc = await findDocumentAtRevision(
|
|
1834
|
+
docInfo.documentId,
|
|
1835
|
+
docInfo.versionId,
|
|
1836
|
+
client
|
|
1837
|
+
)), baseDoc || (baseDoc = await findLatestDraft(docInfo.documentId, client));
|
|
1838
|
+
const merged = BaseDocumentMerger.documentLevelMerge(
|
|
1839
|
+
translatedFields,
|
|
1840
|
+
baseDoc
|
|
1841
|
+
), targetId = `drafts.${docInfo.documentId}__i18n_${localeId}`, i18nDoc = await findLatestDraft(targetId, client);
|
|
1842
|
+
if (i18nDoc) {
|
|
1843
|
+
const cleanedMerge = {};
|
|
1844
|
+
Object.entries(merged).forEach(([key, value]) => {
|
|
1845
|
+
Object.keys(translatedFields).includes(key) && !["_id", "_rev", "_updatedAt"].includes(key) && (cleanedMerge[key] = value);
|
|
1846
|
+
}), await client.transaction().patch(i18nDoc._id, (p) => p.set(cleanedMerge)).commit();
|
|
1847
|
+
} else
|
|
1848
|
+
merged._id = targetId, merged.__i18n_lang = localeId, await client.create(merged);
|
|
1849
|
+
}, baseDocumentLevelConfig = {
|
|
1850
|
+
exportForTranslation: async (...params) => {
|
|
1851
|
+
const [
|
|
1852
|
+
docInfo,
|
|
1853
|
+
context,
|
|
1854
|
+
serializationOptions = {},
|
|
1855
|
+
languageField = "language"
|
|
1856
|
+
] = params, { client, schema } = context, stopTypes = [
|
|
1857
|
+
...serializationOptions.additionalStopTypes ?? [],
|
|
1858
|
+
...defaultStopTypes
|
|
1859
|
+
], serializers = {
|
|
1860
|
+
...customSerializers,
|
|
1861
|
+
types: {
|
|
1862
|
+
...customSerializers.types,
|
|
1863
|
+
...serializationOptions.additionalSerializers ?? {}
|
|
1864
|
+
}
|
|
1865
|
+
}, doc = await findLatestDraft(docInfo.documentId, client);
|
|
1866
|
+
delete doc[languageField];
|
|
1867
|
+
const baseLanguage = gtConfig.getSourceLocale();
|
|
1868
|
+
return {
|
|
1869
|
+
content: BaseDocumentSerializer(schema).serializeDocument(
|
|
1870
|
+
doc,
|
|
1871
|
+
"document",
|
|
1872
|
+
baseLanguage,
|
|
1873
|
+
stopTypes,
|
|
1874
|
+
serializers
|
|
1875
|
+
).content,
|
|
1876
|
+
documentId: docInfo.documentId,
|
|
1877
|
+
versionId: docInfo.versionId
|
|
1878
|
+
};
|
|
1879
|
+
},
|
|
1880
|
+
importTranslation: (...params) => {
|
|
1881
|
+
const [
|
|
1882
|
+
docInfo,
|
|
1883
|
+
localeId,
|
|
1884
|
+
document2,
|
|
1885
|
+
context,
|
|
1886
|
+
serializationOptions = {},
|
|
1887
|
+
languageField = "language",
|
|
1888
|
+
mergeWithTargetLocale = !1
|
|
1889
|
+
] = params, { client } = context, deserializers = {
|
|
1890
|
+
types: {
|
|
1891
|
+
...serializationOptions.additionalDeserializers ?? {}
|
|
1892
|
+
}
|
|
1893
|
+
}, blockDeserializers = [
|
|
1894
|
+
...serializationOptions.additionalBlockDeserializers ?? [],
|
|
1895
|
+
...customBlockDeserializers
|
|
1896
|
+
], deserialized = BaseDocumentDeserializer.deserializeDocument(
|
|
1897
|
+
document2,
|
|
1898
|
+
deserializers,
|
|
1899
|
+
blockDeserializers
|
|
1900
|
+
);
|
|
1901
|
+
return documentLevelPatch(
|
|
1902
|
+
docInfo,
|
|
1903
|
+
// versionId is not used here, since we just use the _rev id in the deserialized HTML itself
|
|
1904
|
+
deserialized,
|
|
1905
|
+
localeId,
|
|
1906
|
+
client,
|
|
1907
|
+
languageField,
|
|
1908
|
+
mergeWithTargetLocale
|
|
1909
|
+
);
|
|
1910
|
+
},
|
|
1911
|
+
secretsNamespace: "translationService"
|
|
1912
|
+
}, legacyDocumentLevelConfig$1 = {
|
|
1913
|
+
...baseDocumentLevelConfig,
|
|
1914
|
+
importTranslation: (...params) => {
|
|
1915
|
+
const [docInfo, localeId, document2, context, serializationOptions = {}] = params, { client } = context, deserializers = {
|
|
1916
|
+
types: {
|
|
1917
|
+
...serializationOptions.additionalDeserializers ?? {}
|
|
1918
|
+
}
|
|
1919
|
+
}, blockDeserializers = [
|
|
1920
|
+
...serializationOptions.additionalBlockDeserializers ?? [],
|
|
1921
|
+
...customBlockDeserializers
|
|
1922
|
+
], deserialized = BaseDocumentDeserializer.deserializeDocument(
|
|
1923
|
+
document2,
|
|
1924
|
+
deserializers,
|
|
1925
|
+
blockDeserializers
|
|
1926
|
+
);
|
|
1927
|
+
return legacyDocumentLevelPatch(
|
|
1928
|
+
docInfo,
|
|
1929
|
+
// versionId is not used here, since we just use the _rev id in the deserialized HTML itself
|
|
1930
|
+
deserialized,
|
|
1931
|
+
localeId,
|
|
1932
|
+
client
|
|
1933
|
+
);
|
|
1934
|
+
}
|
|
1935
|
+
}, fieldLevelPatch = async (docInfo, translatedFields, localeId, client, mergeWithTargetLocale = !1) => {
|
|
1936
|
+
let baseDoc;
|
|
1937
|
+
const baseLanguage = gtConfig.getSourceLocale();
|
|
1938
|
+
docInfo.documentId && docInfo.versionId ? baseDoc = await findDocumentAtRevision(
|
|
1939
|
+
docInfo.documentId,
|
|
1940
|
+
docInfo.versionId,
|
|
1941
|
+
client
|
|
1942
|
+
) : baseDoc = await findLatestDraft(docInfo.documentId, client);
|
|
1943
|
+
const merged = BaseDocumentMerger.fieldLevelMerge(
|
|
1944
|
+
translatedFields,
|
|
1945
|
+
baseDoc,
|
|
1946
|
+
localeId,
|
|
1947
|
+
mergeWithTargetLocale ? baseLanguage : localeId
|
|
1948
|
+
);
|
|
1949
|
+
await client.patch(baseDoc._id).set(merged).commit();
|
|
1950
|
+
}, baseFieldLevelConfig = {
|
|
1951
|
+
exportForTranslation: async (...params) => {
|
|
1952
|
+
const [docInfo, context, serializationOptions = {}] = params, baseLanguage = gtConfig.getSourceLocale(), { client, schema } = context, stopTypes = [
|
|
1953
|
+
...serializationOptions.additionalStopTypes ?? [],
|
|
1954
|
+
...defaultStopTypes
|
|
1955
|
+
], serializers = {
|
|
1956
|
+
...customSerializers,
|
|
1957
|
+
types: {
|
|
1958
|
+
...customSerializers.types,
|
|
1959
|
+
...serializationOptions.additionalSerializers ?? {}
|
|
1960
|
+
}
|
|
1961
|
+
}, doc = await findLatestDraft(docInfo.documentId, client);
|
|
1962
|
+
return {
|
|
1963
|
+
content: BaseDocumentSerializer(schema).serializeDocument(
|
|
1964
|
+
doc,
|
|
1965
|
+
"field",
|
|
1966
|
+
baseLanguage,
|
|
1967
|
+
stopTypes,
|
|
1968
|
+
serializers
|
|
1969
|
+
).content,
|
|
1970
|
+
documentId: docInfo.documentId,
|
|
1971
|
+
versionId: docInfo.versionId
|
|
1972
|
+
};
|
|
1973
|
+
},
|
|
1974
|
+
importTranslation: (...params) => {
|
|
1975
|
+
const [
|
|
1976
|
+
docInfo,
|
|
1977
|
+
localeId,
|
|
1978
|
+
document2,
|
|
1979
|
+
context,
|
|
1980
|
+
serializationOptions = {},
|
|
1981
|
+
,
|
|
1982
|
+
mergeWithTargetLocale
|
|
1983
|
+
] = params, { client } = context, deserializers = {
|
|
1984
|
+
types: {
|
|
1985
|
+
...serializationOptions.additionalDeserializers ?? {}
|
|
1986
|
+
}
|
|
1987
|
+
}, blockDeserializers = [
|
|
1988
|
+
...serializationOptions.additionalBlockDeserializers ?? [],
|
|
1989
|
+
...customBlockDeserializers
|
|
1990
|
+
], deserialized = BaseDocumentDeserializer.deserializeDocument(
|
|
1991
|
+
document2,
|
|
1992
|
+
deserializers,
|
|
1993
|
+
blockDeserializers
|
|
1994
|
+
);
|
|
1995
|
+
return fieldLevelPatch(
|
|
1996
|
+
docInfo,
|
|
1997
|
+
deserialized,
|
|
1998
|
+
localeId,
|
|
1999
|
+
client,
|
|
2000
|
+
mergeWithTargetLocale
|
|
2001
|
+
);
|
|
2002
|
+
},
|
|
2003
|
+
secretsNamespace: "translationService"
|
|
2004
|
+
}, getLocales = async (secrets) => gtConfig.getLocales().map((locale) => ({
|
|
2005
|
+
localeId: locale,
|
|
2006
|
+
description: gt.getLocaleProperties(locale).name,
|
|
2007
|
+
enabled: !0
|
|
2008
|
+
})), getTranslationTask = async (documentInfo, secrets) => {
|
|
2009
|
+
if (!documentInfo.documentId || !secrets)
|
|
2010
|
+
return {
|
|
2011
|
+
document: documentInfo,
|
|
2012
|
+
locales: []
|
|
2013
|
+
};
|
|
2014
|
+
overrideConfig(secrets);
|
|
2015
|
+
const task = await gt.querySourceFile({
|
|
2016
|
+
fileId: documentInfo.documentId,
|
|
2017
|
+
versionId: documentInfo.versionId || void 0
|
|
2018
|
+
});
|
|
2019
|
+
return {
|
|
2020
|
+
document: {
|
|
2021
|
+
documentId: task.sourceFile.fileId,
|
|
2022
|
+
versionId: task.sourceFile.versionId
|
|
2023
|
+
},
|
|
2024
|
+
locales: task.translations.map((translation) => ({
|
|
2025
|
+
localeId: translation.locale,
|
|
2026
|
+
progress: translation.completedAt ? 100 : 0
|
|
2027
|
+
}))
|
|
2028
|
+
};
|
|
2029
|
+
}, getTranslation = async (documentInfo, localeId, secrets) => secrets ? (overrideConfig(secrets), await gt.downloadTranslatedFile({
|
|
2030
|
+
fileId: documentInfo.documentId,
|
|
2031
|
+
versionId: documentInfo.versionId || void 0,
|
|
2032
|
+
locale: localeId
|
|
2033
|
+
})) : "", createTask = async (documentInfo, serializedDocument, localeIds, secrets, workflowUid, callbackUrl) => {
|
|
2034
|
+
const fileName = `sanity-${documentInfo.documentId}`;
|
|
2035
|
+
overrideConfig(secrets);
|
|
2036
|
+
const uploadResult = await gt.uploadSourceFiles(
|
|
2037
|
+
[
|
|
2038
|
+
{
|
|
2039
|
+
source: {
|
|
2040
|
+
content: serializedDocument.content,
|
|
2041
|
+
fileName,
|
|
2042
|
+
fileId: documentInfo.documentId,
|
|
2043
|
+
fileFormat: "HTML",
|
|
2044
|
+
locale: gt.sourceLocale || libraryDefaultLocale,
|
|
2045
|
+
versionId: documentInfo.versionId || void 0
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
],
|
|
2049
|
+
{
|
|
2050
|
+
sourceLocale: gt.sourceLocale || libraryDefaultLocale
|
|
2051
|
+
}
|
|
2052
|
+
);
|
|
2053
|
+
return await gt.enqueueFiles(uploadResult.uploadedFiles, {
|
|
2054
|
+
sourceLocale: gt.sourceLocale || libraryDefaultLocale,
|
|
2055
|
+
targetLocales: localeIds
|
|
2056
|
+
}), await getTranslationTask(documentInfo, secrets);
|
|
2057
|
+
}, GTAdapter = {
|
|
2058
|
+
getLocales,
|
|
2059
|
+
getTranslationTask,
|
|
2060
|
+
createTask,
|
|
2061
|
+
getTranslation
|
|
2062
|
+
}, defaultDocumentLevelConfig = {
|
|
2063
|
+
...baseDocumentLevelConfig,
|
|
2064
|
+
adapter: GTAdapter,
|
|
2065
|
+
secretsNamespace: "generaltranslation"
|
|
2066
|
+
}, legacyDocumentLevelConfig = {
|
|
2067
|
+
...legacyDocumentLevelConfig$1,
|
|
2068
|
+
adapter: GTAdapter,
|
|
2069
|
+
secretsNamespace: "generaltranslation"
|
|
2070
|
+
}, defaultFieldLevelConfig = {
|
|
2071
|
+
...baseFieldLevelConfig,
|
|
2072
|
+
adapter: GTAdapter,
|
|
2073
|
+
secretsNamespace: "generaltranslation"
|
|
2074
|
+
}, gtPlugin = definePlugin(({ sourceLocale, locales, customMapping, apiKey, projectId }) => (gtConfig.setLocales(locales), gtConfig.setSourceLocale(sourceLocale || libraryDefaultLocale), gt.setConfig({
|
|
2075
|
+
sourceLocale,
|
|
2076
|
+
customMapping,
|
|
2077
|
+
apiKey,
|
|
2078
|
+
projectId
|
|
2079
|
+
}), {
|
|
2080
|
+
name: "@generaltranslation/sanity"
|
|
2081
|
+
}));
|
|
2082
|
+
export {
|
|
2083
|
+
BaseDocumentDeserializer2 as BaseDocumentDeserializer,
|
|
2084
|
+
BaseDocumentMerger2 as BaseDocumentMerger,
|
|
2085
|
+
BaseDocumentSerializer2 as BaseDocumentSerializer,
|
|
2086
|
+
GTAdapter,
|
|
2087
|
+
TranslationTab as TranslationsTab,
|
|
2088
|
+
customSerializers2 as customSerializers,
|
|
2089
|
+
defaultDocumentLevelConfig,
|
|
2090
|
+
defaultFieldLevelConfig,
|
|
2091
|
+
defaultStopTypes2 as defaultStopTypes,
|
|
2092
|
+
documentLevelPatch,
|
|
2093
|
+
fieldLevelPatch,
|
|
2094
|
+
findLatestDraft,
|
|
2095
|
+
gtPlugin,
|
|
2096
|
+
legacyDocumentLevelConfig,
|
|
2097
|
+
legacyDocumentLevelPatch
|
|
2098
|
+
};
|
|
2099
|
+
//# sourceMappingURL=index.mjs.map
|