@getodk/xforms-engine 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/TextRange.d.ts +0 -9
- package/dist/index.js +265 -146
- package/dist/index.js.map +1 -1
- package/dist/instance/RankControl.d.ts +3 -2
- package/dist/instance/SelectControl.d.ts +3 -2
- package/dist/parse/body/control/ItemsetDefinition.d.ts +1 -1
- package/dist/parse/expression/BindComputationExpression.d.ts +1 -1
- package/dist/parse/expression/ItemsetNodesetExpression.d.ts +1 -2
- package/dist/parse/expression/TextChunkExpression.d.ts +9 -7
- package/dist/parse/expression/abstract/DependentExpression.d.ts +1 -15
- package/dist/parse/model/ModelDefinition.d.ts +6 -1
- package/dist/parse/model/generateItextChunks.d.ts +5 -0
- package/dist/parse/xpath/semantic-analysis.d.ts +1 -0
- package/dist/solid.js +249 -116
- package/dist/solid.js.map +1 -1
- package/package.json +16 -16
- package/src/client/TextRange.ts +0 -9
- package/src/instance/RankControl.ts +8 -2
- package/src/instance/SelectControl.ts +8 -2
- package/src/lib/reactivity/text/createTextRange.ts +30 -30
- package/src/parse/body/control/ItemsetDefinition.ts +2 -2
- package/src/parse/expression/BindComputationExpression.ts +2 -7
- package/src/parse/expression/ItemsetNodesetExpression.ts +2 -3
- package/src/parse/expression/ItemsetValueExpression.ts +1 -1
- package/src/parse/expression/RepeatCountControlExpression.ts +4 -4
- package/src/parse/expression/TextChunkExpression.ts +25 -35
- package/src/parse/expression/abstract/DependentExpression.ts +2 -38
- package/src/parse/model/ModelDefinition.ts +13 -0
- package/src/parse/model/generateItextChunks.ts +61 -0
- package/src/parse/text/ItemsetLabelDefinition.ts +4 -4
- package/src/parse/text/MessageDefinition.ts +4 -4
- package/src/parse/text/abstract/TextElementDefinition.ts +6 -7
- package/src/parse/xpath/semantic-analysis.ts +37 -8
package/dist/solid.js
CHANGED
|
@@ -353,7 +353,11 @@ function getAugmentedNamespace(n) {
|
|
|
353
353
|
var f = n.default;
|
|
354
354
|
if (typeof f == "function") {
|
|
355
355
|
var a = function a () {
|
|
356
|
-
|
|
356
|
+
var isInstance = false;
|
|
357
|
+
try {
|
|
358
|
+
isInstance = this instanceof a;
|
|
359
|
+
} catch {}
|
|
360
|
+
if (isInstance) {
|
|
357
361
|
return Reflect.construct(f, arguments, this.constructor);
|
|
358
362
|
}
|
|
359
363
|
return f.apply(this, arguments);
|
|
@@ -4173,7 +4177,7 @@ function epochMilliToIso$1(e, n = 0, t = 0) {
|
|
|
4173
4177
|
return zipProps$1(Tr$1, [r.getUTCFullYear(), r.getUTCMonth() + 1, r.getUTCDate() + o, r.getUTCHours(), r.getUTCMinutes(), r.getUTCSeconds(), r.getUTCMilliseconds(), n, t]);
|
|
4174
4178
|
}
|
|
4175
4179
|
function hashIntlFormatParts$1(e, n) {
|
|
4176
|
-
if (n < -
|
|
4180
|
+
if (n < -Pr$1) {
|
|
4177
4181
|
throw new RangeError(Io$1);
|
|
4178
4182
|
}
|
|
4179
4183
|
const t = e.formatToParts(n),
|
|
@@ -4857,7 +4861,7 @@ function getSingleInstantFor$1(e, n, t = 0, o = e.I(n)) {
|
|
|
4857
4861
|
}
|
|
4858
4862
|
const r = isoToEpochNano$1(n),
|
|
4859
4863
|
i = ((e, n) => {
|
|
4860
|
-
const t = e.R(moveBigNano$1(n, -
|
|
4864
|
+
const t = e.R(moveBigNano$1(n, -Uo$1));
|
|
4861
4865
|
return (e => {
|
|
4862
4866
|
if (e > Uo$1) {
|
|
4863
4867
|
throw new RangeError(go$1);
|
|
@@ -4873,7 +4877,7 @@ function getStartOfDayInstantFor$1(e, n) {
|
|
|
4873
4877
|
if (t.length) {
|
|
4874
4878
|
return t[0];
|
|
4875
4879
|
}
|
|
4876
|
-
const o = moveBigNano$1(isoToEpochNano$1(n), -
|
|
4880
|
+
const o = moveBigNano$1(isoToEpochNano$1(n), -Uo$1);
|
|
4877
4881
|
return e.O(o, 1);
|
|
4878
4882
|
}
|
|
4879
4883
|
function Ye$1(e, n, t) {
|
|
@@ -5095,7 +5099,7 @@ function computeDurationSign$1(e, n = p$1) {
|
|
|
5095
5099
|
}
|
|
5096
5100
|
function checkDurationUnits$1(e) {
|
|
5097
5101
|
for (const n of dr$1) {
|
|
5098
|
-
clampEntity$1(n, e[n], -
|
|
5102
|
+
clampEntity$1(n, e[n], -di$1, di$1, 1);
|
|
5099
5103
|
}
|
|
5100
5104
|
return checkDurationTimeUnit$1(bigNanoToNumber$1(durationFieldsToBigNano$1(e), Ro$1)), e;
|
|
5101
5105
|
}
|
|
@@ -5754,7 +5758,7 @@ function createIntlYearDataCache$1(e) {
|
|
|
5754
5758
|
r += 400 * ko$1;
|
|
5755
5759
|
} while ((o = e(r)).year <= t);
|
|
5756
5760
|
do {
|
|
5757
|
-
if (r += (1 - o.day) * ko$1, o.year === t && (a.push(r), s.push(o.o)), r -= ko$1, ++i > 100 || r < -
|
|
5761
|
+
if (r += (1 - o.day) * ko$1, o.year === t && (a.push(r), s.push(o.o)), r -= ko$1, ++i > 100 || r < -Pr$1) {
|
|
5758
5762
|
throw new RangeError(fo$1);
|
|
5759
5763
|
}
|
|
5760
5764
|
} while ((o = e(r)).year >= t);
|
|
@@ -6547,7 +6551,7 @@ const expectedInteger$1 = (e, n) => `Non-integer ${e}: ${n}`,
|
|
|
6547
6551
|
vr$1 = 1e8,
|
|
6548
6552
|
Pr$1 = vr$1 * ko$1,
|
|
6549
6553
|
Er$1 = [vr$1, 0],
|
|
6550
|
-
Sr$1 = [-
|
|
6554
|
+
Sr$1 = [-vr$1, 0],
|
|
6551
6555
|
Fr$1 = 275760,
|
|
6552
6556
|
wr$1 = -271821,
|
|
6553
6557
|
en$1 = Intl.DateTimeFormat,
|
|
@@ -10934,7 +10938,9 @@ const dateTimeFromString = (timeZone, value) => {
|
|
|
10934
10938
|
}
|
|
10935
10939
|
return Xn$1.PlainDateTime.from(value).toZonedDateTime(timeZone);
|
|
10936
10940
|
};
|
|
10937
|
-
const toNanoseconds = (milliseconds) =>
|
|
10941
|
+
const toNanoseconds = (milliseconds) => {
|
|
10942
|
+
return BigInt(Math.round(milliseconds)) * MILLISECOND_NANOSECONDS;
|
|
10943
|
+
};
|
|
10938
10944
|
const dateTimeFromNumber = (timeZone, milliseconds) => {
|
|
10939
10945
|
if (Number.isNaN(milliseconds)) {
|
|
10940
10946
|
return null;
|
|
@@ -11227,7 +11233,45 @@ const nodeSet = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
|
11227
11233
|
itext
|
|
11228
11234
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
11229
11235
|
|
|
11230
|
-
const
|
|
11236
|
+
const choiceName = new StringFunction(
|
|
11237
|
+
"choice-name",
|
|
11238
|
+
[
|
|
11239
|
+
{ arityType: "required", typeHint: "string" },
|
|
11240
|
+
{ arityType: "required", typeHint: "string" }
|
|
11241
|
+
],
|
|
11242
|
+
(context, [nodeExpression, valueExpression]) => {
|
|
11243
|
+
const node = nodeExpression.evaluate(context).toString();
|
|
11244
|
+
const value = valueExpression.evaluate(context).toString();
|
|
11245
|
+
const [contextNode] = context.contextNodes;
|
|
11246
|
+
const { domProvider } = context;
|
|
11247
|
+
let nodes;
|
|
11248
|
+
if (contextNode && domProvider.isElement(contextNode)) {
|
|
11249
|
+
nodes = context.evaluator.evaluateNodes(value, { contextNode });
|
|
11250
|
+
} else {
|
|
11251
|
+
nodes = context.evaluator.evaluateNodes(value);
|
|
11252
|
+
}
|
|
11253
|
+
const firstNode = nodes?.[0];
|
|
11254
|
+
if (!firstNode) {
|
|
11255
|
+
return "";
|
|
11256
|
+
}
|
|
11257
|
+
if (!("getChoiceName" in firstNode)) {
|
|
11258
|
+
throw new Error(
|
|
11259
|
+
`Evaluating 'jr:choice-name' on element '${value}' which has no possible choices.`
|
|
11260
|
+
);
|
|
11261
|
+
}
|
|
11262
|
+
return firstNode.getChoiceName(node) ?? "";
|
|
11263
|
+
}
|
|
11264
|
+
);
|
|
11265
|
+
|
|
11266
|
+
const select$1 = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
11267
|
+
__proto__: null,
|
|
11268
|
+
choiceName
|
|
11269
|
+
}, Symbol.toStringTag, { value: 'Module' }));
|
|
11270
|
+
|
|
11271
|
+
const jr$2 = new FunctionLibrary(JAVAROSA_NAMESPACE_URI, [
|
|
11272
|
+
...Object.values(nodeSet),
|
|
11273
|
+
...Object.values(select$1)
|
|
11274
|
+
]);
|
|
11231
11275
|
|
|
11232
11276
|
const booleanFromString = new BooleanFunction(
|
|
11233
11277
|
"boolean-from-string",
|
|
@@ -18658,6 +18702,10 @@ const hex = /*#__PURE__*/_mergeNamespaces({
|
|
|
18658
18702
|
default: encHex
|
|
18659
18703
|
}, [encHexExports]);
|
|
18660
18704
|
|
|
18705
|
+
const base64Decode$1 = (base64Input) => {
|
|
18706
|
+
return new TextDecoder().decode(Uint8Array.from(atob(base64Input), (m) => m.charCodeAt(0)));
|
|
18707
|
+
};
|
|
18708
|
+
|
|
18661
18709
|
const toStrings = (context, expressions) => {
|
|
18662
18710
|
return expressions.flatMap((arg) => {
|
|
18663
18711
|
const result = arg.evaluate(context);
|
|
@@ -18669,6 +18717,17 @@ const toStrings = (context, expressions) => {
|
|
|
18669
18717
|
});
|
|
18670
18718
|
};
|
|
18671
18719
|
|
|
18720
|
+
const base64Decode = new StringFunction(
|
|
18721
|
+
"base64-decode",
|
|
18722
|
+
[{ arityType: "required", typeHint: "string" }],
|
|
18723
|
+
(context, [base64Expression]) => {
|
|
18724
|
+
try {
|
|
18725
|
+
return base64Decode$1(base64Expression.evaluate(context).toString());
|
|
18726
|
+
} catch {
|
|
18727
|
+
return "";
|
|
18728
|
+
}
|
|
18729
|
+
}
|
|
18730
|
+
);
|
|
18672
18731
|
const coalesce = new StringFunction(
|
|
18673
18732
|
"coalesce",
|
|
18674
18733
|
[
|
|
@@ -18758,6 +18817,23 @@ const join = new StringFunction(
|
|
|
18758
18817
|
return strings.join(glue);
|
|
18759
18818
|
}
|
|
18760
18819
|
);
|
|
18820
|
+
const pulldata = new StringFunction(
|
|
18821
|
+
"pulldata",
|
|
18822
|
+
[
|
|
18823
|
+
{ arityType: "required", typeHint: "string" },
|
|
18824
|
+
{ arityType: "required", typeHint: "string" },
|
|
18825
|
+
{ arityType: "required", typeHint: "string" },
|
|
18826
|
+
{ arityType: "required", typeHint: "string" }
|
|
18827
|
+
],
|
|
18828
|
+
(context, [instanceExpression, desiredElementExpression, queryElementExpression, queryExpression]) => {
|
|
18829
|
+
const instanceId = instanceExpression.evaluate(context).toString();
|
|
18830
|
+
const desiredElement = desiredElementExpression.evaluate(context).toString();
|
|
18831
|
+
const queryElement = queryElementExpression.evaluate(context).toString();
|
|
18832
|
+
const query = queryExpression.evaluate(context).toString();
|
|
18833
|
+
const expr = `instance('${instanceId}')/root/item[${queryElement}='${query}']/${desiredElement}`;
|
|
18834
|
+
return context.evaluator.evaluateString(expr);
|
|
18835
|
+
}
|
|
18836
|
+
);
|
|
18761
18837
|
const regex = new BooleanFunction(
|
|
18762
18838
|
"regex",
|
|
18763
18839
|
[
|
|
@@ -18836,11 +18912,13 @@ const uuid = new StringFunction(
|
|
|
18836
18912
|
|
|
18837
18913
|
const string = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty({
|
|
18838
18914
|
__proto__: null,
|
|
18915
|
+
base64Decode,
|
|
18839
18916
|
coalesce,
|
|
18840
18917
|
concat,
|
|
18841
18918
|
digest,
|
|
18842
18919
|
endsWith,
|
|
18843
18920
|
join,
|
|
18921
|
+
pulldata,
|
|
18844
18922
|
regex,
|
|
18845
18923
|
substr,
|
|
18846
18924
|
uuid
|
|
@@ -19554,18 +19632,32 @@ const isTranslationFunctionCall = (syntaxNode) => {
|
|
|
19554
19632
|
ANY_ARGUMENT_TYPE
|
|
19555
19633
|
]);
|
|
19556
19634
|
};
|
|
19557
|
-
const
|
|
19635
|
+
const findFunctionPrincipalExpressionNode = (expression) => {
|
|
19558
19636
|
let result;
|
|
19559
19637
|
try {
|
|
19560
19638
|
result = expressionParser.parse(expression);
|
|
19561
19639
|
} catch {
|
|
19562
|
-
return
|
|
19640
|
+
return null;
|
|
19563
19641
|
}
|
|
19564
19642
|
const functionCallNode = findTypedPrincipalExpressionNode(["function_call"], result.rootNode);
|
|
19565
19643
|
if (functionCallNode == null) {
|
|
19566
|
-
return
|
|
19644
|
+
return null;
|
|
19567
19645
|
}
|
|
19568
|
-
return
|
|
19646
|
+
return functionCallNode;
|
|
19647
|
+
};
|
|
19648
|
+
const getTranslationExpression = (expression) => {
|
|
19649
|
+
const functionCallNode = findFunctionPrincipalExpressionNode(expression);
|
|
19650
|
+
if (!functionCallNode) {
|
|
19651
|
+
return null;
|
|
19652
|
+
}
|
|
19653
|
+
if (!isTranslationFunctionCall(functionCallNode)) {
|
|
19654
|
+
return null;
|
|
19655
|
+
}
|
|
19656
|
+
const arg = functionCallNode.children.find((child) => child.type === "argument");
|
|
19657
|
+
if (!arg) {
|
|
19658
|
+
return null;
|
|
19659
|
+
}
|
|
19660
|
+
return arg.text;
|
|
19569
19661
|
};
|
|
19570
19662
|
const isCurrentFunctionCall = (syntaxNode) => {
|
|
19571
19663
|
return isCallToLocalNamedFunction(syntaxNode, "current") && hasCallSignature(syntaxNode, []);
|
|
@@ -19685,7 +19777,7 @@ const evaluatorMethodsByResultType = {
|
|
|
19685
19777
|
string: "evaluateString"
|
|
19686
19778
|
};
|
|
19687
19779
|
class DependentExpression {
|
|
19688
|
-
constructor(
|
|
19780
|
+
constructor(resultType, expression) {
|
|
19689
19781
|
this.resultType = resultType;
|
|
19690
19782
|
this.expression = expression;
|
|
19691
19783
|
if (resultType === "boolean" && isConstantTruthyExpression(expression)) {
|
|
@@ -19699,16 +19791,6 @@ class DependentExpression {
|
|
|
19699
19791
|
this.constantExpression = null;
|
|
19700
19792
|
}
|
|
19701
19793
|
this.evaluatorMethod = evaluatorMethodsByResultType[resultType];
|
|
19702
|
-
const {
|
|
19703
|
-
semanticDependencies = {
|
|
19704
|
-
translations: false
|
|
19705
|
-
}
|
|
19706
|
-
} = options;
|
|
19707
|
-
const isTranslated = semanticDependencies.translations && isTranslationExpression(expression);
|
|
19708
|
-
if (isTranslated) {
|
|
19709
|
-
this.isTranslated = true;
|
|
19710
|
-
context.isTranslated = true;
|
|
19711
|
-
}
|
|
19712
19794
|
}
|
|
19713
19795
|
isTranslated = false;
|
|
19714
19796
|
evaluatorMethod;
|
|
@@ -19732,33 +19814,32 @@ class TextChunkExpression extends DependentExpression {
|
|
|
19732
19814
|
source;
|
|
19733
19815
|
// Set for the literal source, blank otherwise
|
|
19734
19816
|
stringValue;
|
|
19735
|
-
|
|
19736
|
-
|
|
19737
|
-
|
|
19738
|
-
|
|
19739
|
-
},
|
|
19740
|
-
ignoreContextReference: true
|
|
19741
|
-
});
|
|
19817
|
+
resourceType;
|
|
19818
|
+
constructor(resultType, expression, source, literalValue = "", options = {}) {
|
|
19819
|
+
super(resultType, expression);
|
|
19820
|
+
this.resourceType = options.type ?? null;
|
|
19742
19821
|
this.source = source;
|
|
19743
19822
|
this.stringValue = literalValue;
|
|
19744
19823
|
}
|
|
19745
|
-
static fromLiteral(
|
|
19746
|
-
return new TextChunkExpression(
|
|
19824
|
+
static fromLiteral(stringValue) {
|
|
19825
|
+
return new TextChunkExpression("string", "null", "literal", stringValue);
|
|
19747
19826
|
}
|
|
19748
|
-
static fromReference(
|
|
19749
|
-
return new TextChunkExpression(
|
|
19827
|
+
static fromReference(ref) {
|
|
19828
|
+
return new TextChunkExpression("string", ref, "reference");
|
|
19750
19829
|
}
|
|
19751
|
-
static fromOutput(
|
|
19830
|
+
static fromOutput(element) {
|
|
19752
19831
|
if (!isOutputElement(element)) {
|
|
19753
19832
|
return null;
|
|
19754
19833
|
}
|
|
19755
|
-
return new TextChunkExpression(
|
|
19834
|
+
return new TextChunkExpression("string", element.getAttribute("value"), "output");
|
|
19756
19835
|
}
|
|
19757
|
-
static
|
|
19758
|
-
|
|
19759
|
-
|
|
19760
|
-
|
|
19761
|
-
|
|
19836
|
+
static fromResource(url, type) {
|
|
19837
|
+
return new TextChunkExpression("string", "null", "literal", url, { type });
|
|
19838
|
+
}
|
|
19839
|
+
static fromTranslation(maybeExpression) {
|
|
19840
|
+
const translationExpression = getTranslationExpression(maybeExpression);
|
|
19841
|
+
if (translationExpression) {
|
|
19842
|
+
return new TextChunkExpression("nodes", translationExpression, "translation");
|
|
19762
19843
|
}
|
|
19763
19844
|
return null;
|
|
19764
19845
|
}
|
|
@@ -20005,24 +20086,23 @@ class TextElementDefinition extends TextRangeDefinition {
|
|
|
20005
20086
|
chunks;
|
|
20006
20087
|
constructor(form, owner, sourceNode) {
|
|
20007
20088
|
super(form, owner, sourceNode);
|
|
20008
|
-
const context = this;
|
|
20009
20089
|
const refExpression = parseNodesetReference(owner, sourceNode, "ref");
|
|
20010
20090
|
if (refExpression == null) {
|
|
20011
20091
|
this.chunks = Array.from(sourceNode.childNodes).flatMap((childNode) => {
|
|
20012
20092
|
if (isElementNode(childNode)) {
|
|
20013
|
-
return TextChunkExpression.fromOutput(
|
|
20093
|
+
return TextChunkExpression.fromOutput(childNode) ?? [];
|
|
20014
20094
|
}
|
|
20015
20095
|
if (isTextNode(childNode)) {
|
|
20016
|
-
return TextChunkExpression.fromLiteral(
|
|
20096
|
+
return TextChunkExpression.fromLiteral(childNode.data);
|
|
20017
20097
|
}
|
|
20018
20098
|
return [];
|
|
20019
20099
|
});
|
|
20020
20100
|
} else {
|
|
20021
|
-
const
|
|
20022
|
-
if (
|
|
20023
|
-
this.chunks = [
|
|
20101
|
+
const translationChunk = TextChunkExpression.fromTranslation(refExpression);
|
|
20102
|
+
if (translationChunk) {
|
|
20103
|
+
this.chunks = [translationChunk];
|
|
20024
20104
|
} else {
|
|
20025
|
-
this.chunks = [TextChunkExpression.fromReference(
|
|
20105
|
+
this.chunks = [TextChunkExpression.fromReference(refExpression)];
|
|
20026
20106
|
}
|
|
20027
20107
|
}
|
|
20028
20108
|
}
|
|
@@ -20247,14 +20327,14 @@ class RangeControlDefinition extends ControlDefinition {
|
|
|
20247
20327
|
}
|
|
20248
20328
|
|
|
20249
20329
|
class ItemsetNodesetExpression extends DependentExpression {
|
|
20250
|
-
constructor(
|
|
20251
|
-
super(
|
|
20330
|
+
constructor(nodesetExpression) {
|
|
20331
|
+
super("nodes", nodesetExpression);
|
|
20252
20332
|
}
|
|
20253
20333
|
}
|
|
20254
20334
|
|
|
20255
20335
|
class ItemsetValueExpression extends DependentExpression {
|
|
20256
20336
|
constructor(itemset, expression) {
|
|
20257
|
-
super(
|
|
20337
|
+
super("string", expression);
|
|
20258
20338
|
this.itemset = itemset;
|
|
20259
20339
|
}
|
|
20260
20340
|
}
|
|
@@ -20275,11 +20355,11 @@ class ItemsetLabelDefinition extends TextRangeDefinition {
|
|
|
20275
20355
|
if (refExpression == null) {
|
|
20276
20356
|
throw new Error("<itemset><label> missing ref attribute");
|
|
20277
20357
|
}
|
|
20278
|
-
const
|
|
20279
|
-
if (
|
|
20280
|
-
this.chunks = [
|
|
20358
|
+
const translationChunk = TextChunkExpression.fromTranslation(refExpression);
|
|
20359
|
+
if (translationChunk) {
|
|
20360
|
+
this.chunks = [translationChunk];
|
|
20281
20361
|
} else {
|
|
20282
|
-
this.chunks = [TextChunkExpression.fromReference(
|
|
20362
|
+
this.chunks = [TextChunkExpression.fromReference(refExpression)];
|
|
20283
20363
|
}
|
|
20284
20364
|
}
|
|
20285
20365
|
}
|
|
@@ -20289,7 +20369,7 @@ class ItemsetDefinition extends BodyElementDefinition {
|
|
|
20289
20369
|
super(form, parent, element);
|
|
20290
20370
|
this.parent = parent;
|
|
20291
20371
|
const nodesetExpression = parseNodesetReference(parent, element, "nodeset");
|
|
20292
|
-
this.nodes = new ItemsetNodesetExpression(
|
|
20372
|
+
this.nodes = new ItemsetNodesetExpression(nodesetExpression);
|
|
20293
20373
|
this.reference = nodesetExpression;
|
|
20294
20374
|
const valueElement = getValueElement(element);
|
|
20295
20375
|
if (valueElement == null) {
|
|
@@ -21108,6 +21188,64 @@ const parseStaticDocumentFromDOMSubtree = (subtreeRootElement, options = {}) =>
|
|
|
21108
21188
|
});
|
|
21109
21189
|
};
|
|
21110
21190
|
|
|
21191
|
+
const JR_RESOURCE_URL_PROTOCOL = "jr:";
|
|
21192
|
+
const ALL_RESOURCE_TYPES = ["image", "audio", "video"];
|
|
21193
|
+
const isResourceType = (string) => {
|
|
21194
|
+
return ALL_RESOURCE_TYPES.includes(string);
|
|
21195
|
+
};
|
|
21196
|
+
class JRResourceURL extends URL {
|
|
21197
|
+
static create(category, fileName) {
|
|
21198
|
+
return new this(`jr://${category}/${fileName}`);
|
|
21199
|
+
}
|
|
21200
|
+
static from(url) {
|
|
21201
|
+
return new this(url);
|
|
21202
|
+
}
|
|
21203
|
+
static isJRResourceReference(reference) {
|
|
21204
|
+
return reference?.startsWith(JR_RESOURCE_URL_PROTOCOL) ?? false;
|
|
21205
|
+
}
|
|
21206
|
+
constructor(url) {
|
|
21207
|
+
super(url);
|
|
21208
|
+
}
|
|
21209
|
+
}
|
|
21210
|
+
|
|
21211
|
+
const generateChunk = (node) => {
|
|
21212
|
+
if (isElementNode(node)) {
|
|
21213
|
+
return TextChunkExpression.fromOutput(node);
|
|
21214
|
+
}
|
|
21215
|
+
if (isTextNode(node)) {
|
|
21216
|
+
const formAttribute = node.parentElement.getAttribute("form");
|
|
21217
|
+
if (isResourceType(formAttribute)) {
|
|
21218
|
+
return TextChunkExpression.fromResource(node.data, formAttribute);
|
|
21219
|
+
}
|
|
21220
|
+
return TextChunkExpression.fromLiteral(node.data);
|
|
21221
|
+
}
|
|
21222
|
+
return null;
|
|
21223
|
+
};
|
|
21224
|
+
const generateChunksForValues = (valueElement) => {
|
|
21225
|
+
return Array.from(valueElement.childNodes).map((node) => generateChunk(node)).filter((chunk) => chunk !== null);
|
|
21226
|
+
};
|
|
21227
|
+
const generateChunksForTranslation = (textElement) => {
|
|
21228
|
+
return Array.from(textElement.childNodes).flatMap(
|
|
21229
|
+
(valueElement) => generateChunksForValues(valueElement)
|
|
21230
|
+
);
|
|
21231
|
+
};
|
|
21232
|
+
const generateChunksForLanguage = (translationElement) => {
|
|
21233
|
+
return new Map(
|
|
21234
|
+
Array.from(translationElement.children).map((textElement) => {
|
|
21235
|
+
const itextId = textElement.getAttribute("id");
|
|
21236
|
+
return [itextId, generateChunksForTranslation(textElement)];
|
|
21237
|
+
})
|
|
21238
|
+
);
|
|
21239
|
+
};
|
|
21240
|
+
const generateItextChunks = (translationElements) => {
|
|
21241
|
+
return new Map(
|
|
21242
|
+
translationElements.map((translationElement) => {
|
|
21243
|
+
const lang = translationElement.getAttribute("lang");
|
|
21244
|
+
return [lang, generateChunksForLanguage(translationElement)];
|
|
21245
|
+
})
|
|
21246
|
+
);
|
|
21247
|
+
};
|
|
21248
|
+
|
|
21111
21249
|
const assertItextTranslationsDefinitionEntry = ([
|
|
21112
21250
|
key,
|
|
21113
21251
|
root
|
|
@@ -21154,8 +21292,7 @@ const bindComputationResultTypes = {
|
|
|
21154
21292
|
saveIncomplete: "boolean"
|
|
21155
21293
|
};
|
|
21156
21294
|
class BindComputationExpression extends DependentExpression {
|
|
21157
|
-
constructor(
|
|
21158
|
-
const ignoreContextReference = computation === "constraint";
|
|
21295
|
+
constructor(computation, expression) {
|
|
21159
21296
|
let isDefaultExpression;
|
|
21160
21297
|
let resolvedExpression;
|
|
21161
21298
|
if (expression == null) {
|
|
@@ -21168,9 +21305,7 @@ class BindComputationExpression extends DependentExpression {
|
|
|
21168
21305
|
isDefaultExpression = false;
|
|
21169
21306
|
resolvedExpression = expression;
|
|
21170
21307
|
}
|
|
21171
|
-
super(
|
|
21172
|
-
ignoreContextReference
|
|
21173
|
-
});
|
|
21308
|
+
super(bindComputationResultTypes[computation], resolvedExpression);
|
|
21174
21309
|
this.computation = computation;
|
|
21175
21310
|
this.isDefaultExpression = isDefaultExpression;
|
|
21176
21311
|
}
|
|
@@ -21179,7 +21314,7 @@ class BindComputationExpression extends DependentExpression {
|
|
|
21179
21314
|
if (expression == null) {
|
|
21180
21315
|
return null;
|
|
21181
21316
|
}
|
|
21182
|
-
return new this(
|
|
21317
|
+
return new this(computation, expression);
|
|
21183
21318
|
}
|
|
21184
21319
|
isDefaultExpression;
|
|
21185
21320
|
}
|
|
@@ -21188,11 +21323,11 @@ class MessageDefinition extends TextRangeDefinition {
|
|
|
21188
21323
|
constructor(bind, role, message) {
|
|
21189
21324
|
super(bind.form, bind, null);
|
|
21190
21325
|
this.role = role;
|
|
21191
|
-
const
|
|
21192
|
-
if (
|
|
21193
|
-
this.chunks = [
|
|
21326
|
+
const translationChunk = TextChunkExpression.fromTranslation(message);
|
|
21327
|
+
if (translationChunk) {
|
|
21328
|
+
this.chunks = [translationChunk];
|
|
21194
21329
|
} else {
|
|
21195
|
-
this.chunks = [TextChunkExpression.fromLiteral(
|
|
21330
|
+
this.chunks = [TextChunkExpression.fromLiteral(message)];
|
|
21196
21331
|
}
|
|
21197
21332
|
}
|
|
21198
21333
|
static from(bind, type) {
|
|
@@ -22290,7 +22425,7 @@ function epochMilliToIso(e, n = 0, t = 0) {
|
|
|
22290
22425
|
}
|
|
22291
22426
|
|
|
22292
22427
|
function hashIntlFormatParts(e, n) {
|
|
22293
|
-
if (n < -
|
|
22428
|
+
if (n < -Pr) {
|
|
22294
22429
|
throw new RangeError(Io);
|
|
22295
22430
|
}
|
|
22296
22431
|
const t = e.formatToParts(n), o = {};
|
|
@@ -22990,7 +23125,7 @@ function getSingleInstantFor(e, n, t = 0, o = e.I(n)) {
|
|
|
22990
23125
|
return o[3 === t ? 1 : 0];
|
|
22991
23126
|
}
|
|
22992
23127
|
const r = isoToEpochNano(n), i = ((e, n) => {
|
|
22993
|
-
const t = e.R(moveBigNano(n, -
|
|
23128
|
+
const t = e.R(moveBigNano(n, -Uo));
|
|
22994
23129
|
return (e => {
|
|
22995
23130
|
if (e > Uo) {
|
|
22996
23131
|
throw new RangeError(go);
|
|
@@ -23006,7 +23141,7 @@ function getStartOfDayInstantFor(e, n) {
|
|
|
23006
23141
|
if (t.length) {
|
|
23007
23142
|
return t[0];
|
|
23008
23143
|
}
|
|
23009
|
-
const o = moveBigNano(isoToEpochNano(n), -
|
|
23144
|
+
const o = moveBigNano(isoToEpochNano(n), -Uo);
|
|
23010
23145
|
return e.O(o, 1);
|
|
23011
23146
|
}
|
|
23012
23147
|
|
|
@@ -23237,7 +23372,7 @@ function computeDurationSign(e, n = p) {
|
|
|
23237
23372
|
|
|
23238
23373
|
function checkDurationUnits(e) {
|
|
23239
23374
|
for (const n of dr) {
|
|
23240
|
-
clampEntity(n, e[n], -
|
|
23375
|
+
clampEntity(n, e[n], -di, di, 1);
|
|
23241
23376
|
}
|
|
23242
23377
|
return checkDurationTimeUnit(bigNanoToNumber(durationFieldsToBigNano(e), Ro)), e;
|
|
23243
23378
|
}
|
|
@@ -23931,7 +24066,7 @@ function createIntlYearDataCache(e) {
|
|
|
23931
24066
|
r += 400 * ko;
|
|
23932
24067
|
} while ((o = e(r)).year <= t);
|
|
23933
24068
|
do {
|
|
23934
|
-
if (r += (1 - o.day) * ko, o.year === t && (a.push(r), s.push(o.o)), r -= ko, ++i > 100 || r < -
|
|
24069
|
+
if (r += (1 - o.day) * ko, o.year === t && (a.push(r), s.push(o.o)), r -= ko, ++i > 100 || r < -Pr) {
|
|
23935
24070
|
throw new RangeError(fo);
|
|
23936
24071
|
}
|
|
23937
24072
|
} while ((o = e(r)).year >= t);
|
|
@@ -24612,7 +24747,7 @@ const expectedInteger = (e, n) => `Non-integer ${e}: ${n}`, expectedPositive = (
|
|
|
24612
24747
|
chinese: 13,
|
|
24613
24748
|
dangi: 13,
|
|
24614
24749
|
hebrew: -6
|
|
24615
|
-
}, m = /*@__PURE__*/ Pt(requireType, "string"), D = /*@__PURE__*/ Pt(requireType, "boolean"), cr = /*@__PURE__*/ Pt(requireType, "number"), p = /*@__PURE__*/ Bo.map((e => e + "s")), ur = /*@__PURE__*/ sortStrings(p), fr = /*@__PURE__*/ p.slice(0, 6), lr = /*@__PURE__*/ p.slice(6), dr = /*@__PURE__*/ lr.slice(1), mr = /*@__PURE__*/ Fo(p), pr = /*@__PURE__*/ wo(p, 0), hr = /*@__PURE__*/ wo(fr, 0), gr = /*@__PURE__*/ Pt(zeroOutProps, p), w = [ "isoNanosecond", "isoMicrosecond", "isoMillisecond", "isoSecond", "isoMinute", "isoHour" ], Dr = [ "isoDay", "isoMonth", "isoYear" ], Tr = /*@__PURE__*/ w.concat(Dr), Ir = /*@__PURE__*/ sortStrings(Dr), Mr = /*@__PURE__*/ sortStrings(w), Nr = /*@__PURE__*/ sortStrings(Tr), Nt = /*@__PURE__*/ wo(Mr, 0), yr = /*@__PURE__*/ Pt(zeroOutProps, Tr), vr = 1e8, Pr = vr * ko, Er = [ vr, 0 ], Sr = [ -
|
|
24750
|
+
}, m = /*@__PURE__*/ Pt(requireType, "string"), D = /*@__PURE__*/ Pt(requireType, "boolean"), cr = /*@__PURE__*/ Pt(requireType, "number"), p = /*@__PURE__*/ Bo.map((e => e + "s")), ur = /*@__PURE__*/ sortStrings(p), fr = /*@__PURE__*/ p.slice(0, 6), lr = /*@__PURE__*/ p.slice(6), dr = /*@__PURE__*/ lr.slice(1), mr = /*@__PURE__*/ Fo(p), pr = /*@__PURE__*/ wo(p, 0), hr = /*@__PURE__*/ wo(fr, 0), gr = /*@__PURE__*/ Pt(zeroOutProps, p), w = [ "isoNanosecond", "isoMicrosecond", "isoMillisecond", "isoSecond", "isoMinute", "isoHour" ], Dr = [ "isoDay", "isoMonth", "isoYear" ], Tr = /*@__PURE__*/ w.concat(Dr), Ir = /*@__PURE__*/ sortStrings(Dr), Mr = /*@__PURE__*/ sortStrings(w), Nr = /*@__PURE__*/ sortStrings(Tr), Nt = /*@__PURE__*/ wo(Mr, 0), yr = /*@__PURE__*/ Pt(zeroOutProps, Tr), vr = 1e8, Pr = vr * ko, Er = [ vr, 0 ], Sr = [ -vr, 0 ], Fr = 275760, wr = -271821, en = Intl.DateTimeFormat, br = "en-GB", Or = 1970, Br = 1972, kr = 12, Cr = /*@__PURE__*/ isoArgsToEpochMilli(1868, 9, 8), Yr = /*@__PURE__*/ on(computeJapaneseEraParts, WeakMap), Rr = "smallestUnit", Zr = "unit", zr = "roundingIncrement", Ur = "fractionalSecondDigits", Ar = "relativeTo", qr = "direction", Wr = {
|
|
24616
24751
|
constrain: 0,
|
|
24617
24752
|
reject: 1
|
|
24618
24753
|
}, jr = /*@__PURE__*/ Object.keys(Wr), Lr = {
|
|
@@ -26060,16 +26195,16 @@ class RepeatCountControlExpression extends DependentExpression {
|
|
|
26060
26195
|
static from(bodyElement, initialCount) {
|
|
26061
26196
|
const { countExpression, noAddRemoveExpression } = bodyElement;
|
|
26062
26197
|
if (countExpression != null) {
|
|
26063
|
-
return new this(
|
|
26198
|
+
return new this(countExpression);
|
|
26064
26199
|
}
|
|
26065
26200
|
if (noAddRemoveExpression != null && isConstantTruthyExpression(noAddRemoveExpression)) {
|
|
26066
26201
|
const fixedCountExpression = String(Math.max(initialCount, 1));
|
|
26067
|
-
return new this(
|
|
26202
|
+
return new this(fixedCountExpression);
|
|
26068
26203
|
}
|
|
26069
26204
|
return null;
|
|
26070
26205
|
}
|
|
26071
|
-
constructor(
|
|
26072
|
-
super(
|
|
26206
|
+
constructor(expression) {
|
|
26207
|
+
super("number", expression);
|
|
26073
26208
|
}
|
|
26074
26209
|
}
|
|
26075
26210
|
|
|
@@ -26336,12 +26471,14 @@ class ModelDefinition {
|
|
|
26336
26471
|
this.root = new RootDefinition(form, this, submission, form.body.classes);
|
|
26337
26472
|
this.nodes = nodeDefinitionMap(this.root);
|
|
26338
26473
|
this.itextTranslations = ItextTranslationsDefinition.from(form.xformDOM);
|
|
26474
|
+
this.itextChunks = generateItextChunks(form.xformDOM.itextTranslationElements);
|
|
26339
26475
|
}
|
|
26340
26476
|
binds;
|
|
26341
26477
|
root;
|
|
26342
26478
|
nodes;
|
|
26343
26479
|
instance;
|
|
26344
26480
|
itextTranslations;
|
|
26481
|
+
itextChunks;
|
|
26345
26482
|
getNodeDefinition(nodeset) {
|
|
26346
26483
|
const definition = this.nodes.get(nodeset);
|
|
26347
26484
|
if (definition == null) {
|
|
@@ -26360,6 +26497,10 @@ class ModelDefinition {
|
|
|
26360
26497
|
const { form, ...rest } = this;
|
|
26361
26498
|
return rest;
|
|
26362
26499
|
}
|
|
26500
|
+
getTranslationChunks(itextId, activeLanguage) {
|
|
26501
|
+
const languageMap = this.itextChunks.get(activeLanguage.language);
|
|
26502
|
+
return languageMap?.get(itextId) ?? [];
|
|
26503
|
+
}
|
|
26363
26504
|
}
|
|
26364
26505
|
|
|
26365
26506
|
class XFormDefinition {
|
|
@@ -26385,22 +26526,6 @@ class XFormDefinition {
|
|
|
26385
26526
|
model;
|
|
26386
26527
|
}
|
|
26387
26528
|
|
|
26388
|
-
const JR_RESOURCE_URL_PROTOCOL = "jr:";
|
|
26389
|
-
class JRResourceURL extends URL {
|
|
26390
|
-
static create(category, fileName) {
|
|
26391
|
-
return new this(`jr://${category}/${fileName}`);
|
|
26392
|
-
}
|
|
26393
|
-
static from(url) {
|
|
26394
|
-
return new this(url);
|
|
26395
|
-
}
|
|
26396
|
-
static isJRResourceReference(reference) {
|
|
26397
|
-
return reference?.startsWith(JR_RESOURCE_URL_PROTOCOL) ?? false;
|
|
26398
|
-
}
|
|
26399
|
-
constructor(url) {
|
|
26400
|
-
super(url);
|
|
26401
|
-
}
|
|
26402
|
-
}
|
|
26403
|
-
|
|
26404
26529
|
const assertSecondaryInstanceDefinition = ({ root }) => {
|
|
26405
26530
|
const id = root.getAttributeValue("id");
|
|
26406
26531
|
if (id == null) {
|
|
@@ -26448,7 +26573,7 @@ var papaparse_min$1 = {exports: {}};
|
|
|
26448
26573
|
|
|
26449
26574
|
/* @license
|
|
26450
26575
|
Papa Parse
|
|
26451
|
-
v5.5.
|
|
26576
|
+
v5.5.3
|
|
26452
26577
|
https://github.com/mholt/PapaParse
|
|
26453
26578
|
License: MIT
|
|
26454
26579
|
*/
|
|
@@ -26460,7 +26585,7 @@ function requirePapaparse_min () {
|
|
|
26460
26585
|
if (hasRequiredPapaparse_min) return papaparse_min$1.exports;
|
|
26461
26586
|
hasRequiredPapaparse_min = 1;
|
|
26462
26587
|
(function (module, exports) {
|
|
26463
|
-
((e,t)=>{module.exports=t();})(papaparse_min,function r(){var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{};var d,s=!n.document&&!!n.postMessage,a=n.IS_PAPA_WORKER||false,o={},h=0,v={};function u(e){this._handle=null,this._finished=false,this._completed=false,this._halted=false,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=true,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=w(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null);this._handle=new i(t),(this._handle.streamer=this)._config=t;}.call(this,e),this.parseChunk=function(t,e){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<i){let e=this._config.newline;e||(r=this._config.quoteChar||'"',e=this._handle.guessLineEndings(t,r)),t=[...t.split(e).slice(i)].join(e);}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&void 0!==(r=this._config.beforeFirstChunk(t))&&(t=r),this.isFirstChunk=false,this._halted=false;var i=this._partialLine+t,r=(this._partialLine="",this._handle.parse(i,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){t=r.meta.cursor,i=(this._finished||(this._partialLine=i.substring(t-this._baseIndex),this._baseIndex=t),r&&r.data&&(this._rowCount+=r.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview);if(a)n.postMessage({results:r,workerId:v.WORKER_ID,finished:i});else if(U(this._config.chunk)&&!e){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=true);this._completeResults=r=void 0;}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!i||!U(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=true),i||r&&r.meta.paused||this._nextChunk(),r}this._halted=true;},this._sendError=function(e){U(this._config.error)?this._config.error(e):a&&this._config.error&&n.postMessage({workerId:v.WORKER_ID,error:e,finished:false});};}function f(e){var r;(e=e||{}).chunkSize||(e.chunkSize=v.RemoteChunkSize),u.call(this,e),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded();}:function(){this._readChunk();},this.stream=function(e){this._input=e,this._nextChunk();},this._readChunk=function(){if(this._finished)this._chunkLoaded();else {if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),s||(r.onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var e,t=this._config.downloadRequestHeaders;for(e in t)r.setRequestHeader(e,t[e]);}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+i));try{r.send(this._config.downloadRequestBody);}catch(e){this._chunkError(e.message);}s&&0===r.status&&this._chunkError();}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>null!==(e=e.getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)));},this._chunkError=function(e){e=r.statusText||e;this._sendError(new Error(e));};}function l(e){(e=e||{}).chunkSize||(e.chunkSize=v.LocalChunkSize),u.call(this,e);var i,r,n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((i=new FileReader).onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)):i=new FileReaderSync,this._nextChunk();},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk();},this._readChunk=function(){var e=this._input,t=(this._config.chunkSize&&(t=Math.min(this._start+this._config.chunkSize,this._input.size),e=r.call(e,this._start,t)),i.readAsText(e,this._config.encoding));n||this._chunkLoaded({target:{result:t}});},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result);},this._chunkError=function(){this._sendError(i.error);};}function c(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){var e,t;if(!this._finished)return e=this._config.chunkSize,i=e?(t=i.substring(0,e),i.substring(e)):(t=i,""),this._finished=!i,this.parseChunk(t)};}function p(e){u.call(this,e=e||{});var t=[],i=true,r=false;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause();},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume();},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError);},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=true);},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=true;},this._streamData=y(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()));}catch(e){this._streamError(e);}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e);},this),this._streamEnd=y(function(){this._streamCleanUp(),r=true,this._streamData("");},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError);},this);}function i(m){var n,s,a,t,o=Math.pow(2,53),h=-o,u=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,d=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,i=this,r=0,f=0,l=false,e=false,c=[],p={data:[],errors:[],meta:{}};function y(e){return "greedy"===m.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(p&&a&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+v.DefaultDelimiter+"'"),a=false),m.skipEmptyLines&&(p.data=p.data.filter(function(e){return !y(e)})),_()){if(p)if(Array.isArray(p.data[0])){for(var e=0;_()&&e<p.data.length;e++)p.data[e].forEach(t);p.data.splice(0,1);}else p.data.forEach(t);function t(e,t){U(m.transformHeader)&&(e=m.transformHeader(e,t)),c.push(e);}}function i(e,t){for(var i=m.header?{}:[],r=0;r<e.length;r++){var n=r,s=e[r],s=((e,t)=>(e=>(m.dynamicTypingFunction&&void 0===m.dynamicTyping[e]&&(m.dynamicTyping[e]=m.dynamicTypingFunction(e)),true===(m.dynamicTyping[e]||m.dynamicTyping)))(e)?"true"===t||"TRUE"===t||"false"!==t&&"FALSE"!==t&&((e=>{if(u.test(e)){e=parseFloat(e);if(h<e&&e<o)return 1}})(t)?parseFloat(t):d.test(t)?new Date(t):""===t?null:t):t)(n=m.header?r>=c.length?"__parsed_extra":c[r]:n,s=m.transform?m.transform(s,n):s);"__parsed_extra"===n?(i[n]=i[n]||[],i[n].push(s)):i[n]=s;}return m.header&&(r>c.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+c.length+" fields but parsed "+r,f+t):r<c.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+c.length+" fields but parsed "+r,f+t)),i}var r;p&&(m.header||m.dynamicTyping||m.transform)&&(r=1,!p.data.length||Array.isArray(p.data[0])?(p.data=p.data.map(i),r=p.data.length):p.data=i(p.data,0),m.header&&p.meta&&(p.meta.fields=c),f+=r);}function _(){return m.header&&0===c.length}function k(e,t,i,r){e={type:e,code:t,message:i};void 0!==r&&(e.row=r),p.errors.push(e);}U(m.step)&&(t=m.step,m.step=function(e){p=e,_()?g():(g(),0!==p.data.length&&(r+=e.data.length,m.preview&&r>m.preview?s.abort():(p.data=p.data[0],t(p,i))));}),this.parse=function(e,t,i){var r=m.quoteChar||'"',r=(m.newline||(m.newline=this.guessLineEndings(e,r)),a=false,m.delimiter?U(m.delimiter)&&(m.delimiter=m.delimiter(e),p.meta.delimiter=m.delimiter):((r=((e,t,i,r,n)=>{var s,a,o,h;n=n||[",","\t","|",";",v.RECORD_SEP,v.UNIT_SEP];for(var u=0;u<n.length;u++){for(var d,f=n[u],l=0,c=0,p=0,g=(o=void 0,new E({comments:r,delimiter:f,newline:t,preview:10}).parse(e)),_=0;_<g.data.length;_++)i&&y(g.data[_])?p++:(d=g.data[_].length,c+=d,void 0===o?o=d:0<d&&(l+=Math.abs(d-o),o=d));0<g.data.length&&(c/=g.data.length-p),(void 0===a||l<=a)&&(void 0===h||h<c)&&1.99<c&&(a=l,s=f,h=c);}return {successful:!!(m.delimiter=s),bestDelimiter:s}})(e,m.newline,m.skipEmptyLines,m.comments,m.delimitersToGuess)).successful?m.delimiter=r.bestDelimiter:(a=true,m.delimiter=v.DefaultDelimiter),p.meta.delimiter=m.delimiter),w(m));return m.preview&&m.header&&r.preview++,n=e,s=new E(r),p=s.parse(n,t,i),g(),l?{meta:{paused:true}}:p||{meta:{paused:false}}},this.paused=function(){return l},this.pause=function(){l=true,s.abort(),n=U(m.chunk)?"":n.substring(s.getCharIndex());},this.resume=function(){i.streamer._halted?(l=false,i.streamer.parseChunk(n,true)):setTimeout(i.resume,3);},this.aborted=function(){return e},this.abort=function(){e=true,s.abort(),p.meta.aborted=true,U(m.complete)&&m.complete(p),n="";},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=new RegExp(P(t)+"([^]*?)"+P(t),"gm"),i=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<i[0].length;if(1===i.length||e)return "\n";for(var r=0,n=0;n<i.length;n++)"\n"===i[n][0]&&r++;return r>=i.length/2?"\r\n":"\r"};}function P(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(C){var S=(C=C||{}).delimiter,O=C.newline,x=C.comments,I=C.step,A=C.preview,T=C.fastMode,D=null,L=false,F=null==C.quoteChar?'"':C.quoteChar,j=F;if(void 0!==C.escapeChar&&(j=C.escapeChar),("string"!=typeof S||-1<v.BAD_DELIMITERS.indexOf(S))&&(S=","),x===S)throw new Error("Comment character same as delimiter");true===x?x="#":("string"!=typeof x||-1<v.BAD_DELIMITERS.indexOf(x))&&(x=false),"\n"!==O&&"\r"!==O&&"\r\n"!==O&&(O="\n");var z=0,M=false;this.parse=function(i,t,r){if("string"!=typeof i)throw new Error("Input must be a string");var n=i.length,e=S.length,s=O.length,a=x.length,o=U(I),h=[],u=[],d=[],f=z=0;if(!i)return b();if(T||false!==T&&-1===i.indexOf(F)){for(var l=i.split(O),c=0;c<l.length;c++){if(d=l[c],z+=d.length,c!==l.length-1)z+=O.length;else if(r)return b();if(!x||d.substring(0,a)!==x){if(o){if(h=[],k(d.split(S)),R(),M)return b()}else k(d.split(S));if(A&&A<=c)return h=h.slice(0,A),b(true)}}return b()}for(var p=i.indexOf(S,z),g=i.indexOf(O,z),_=new RegExp(P(j)+P(F),"g"),m=i.indexOf(F,z);;)if(i[z]===F)for(m=z,z++;;){if(-1===(m=i.indexOf(F,m+1)))return r||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:z}),E();if(m===n-1)return E(i.substring(z,m).replace(_,F));if(F===j&&i[m+1]===j)m++;else if(F===j||0===m||i[m-1]!==j){ -1!==p&&p<m+1&&(p=i.indexOf(S,m+1));var y=v(-1===(g=-1!==g&&g<m+1?i.indexOf(O,m+1):g)?p:Math.min(p,g));if(i.substr(m+1+y,e)===S){d.push(i.substring(z,m).replace(_,F)),i[z=m+1+y+e]!==F&&(m=i.indexOf(F,z)),p=i.indexOf(S,z),g=i.indexOf(O,z);break}y=v(g);if(i.substring(m+1+y,m+1+y+s)===O){if(d.push(i.substring(z,m).replace(_,F)),w(m+1+y+s),p=i.indexOf(S,z),m=i.indexOf(F,z),o&&(R(),M))return b();if(A&&h.length>=A)return b(true);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:z}),m++;}}else if(x&&0===d.length&&i.substring(z,z+a)===x){if(-1===g)return b();z=g+s,g=i.indexOf(O,z),p=i.indexOf(S,z);}else if(-1!==p&&(p<g||-1===g))d.push(i.substring(z,p)),z=p+e,p=i.indexOf(S,z);else {if(-1===g)break;if(d.push(i.substring(z,g)),w(g+s),o&&(R(),M))return b();if(A&&h.length>=A)return b(true)}return E();function k(e){h.push(e),f=z;}function v(e){var t=0;return t=-1!==e&&(e=i.substring(m+1,e))&&""===e.trim()?e.length:t}function E(e){return r||(void 0===e&&(e=i.substring(z)),d.push(e),z=n,k(d),o&&R()),b()}function w(e){z=e,k(d),d=[],g=i.indexOf(O,z);}function b(e){if(C.header&&!t&&h.length&&!L){var s=h[0],a={},o=new Set(s);let n=false;for(let r=0;r<s.length;r++){let i=s[r];if(a[i=U(C.transformHeader)?C.transformHeader(i,r):i]){let e,t=a[i];for(;e=i+"_"+t,t++,o.has(e););o.add(e),s[r]=e,a[i]++,n=true,(D=null===D?{}:D)[e]=i;}else a[i]=1,s[r]=i;o.add(i);}n&&console.warn("Duplicate headers found and renamed."),L=true;}return {data:h,errors:u,meta:{delimiter:S,linebreak:O,aborted:M,truncated:!!e,cursor:f+(t||0),renamedHeaders:D}}}function R(){I(b()),h=[],u=[];}},this.abort=function(){M=true;},this.getCharIndex=function(){return z};}function g(e){var t=e.data,i=o[t.workerId],r=false;if(t.error)i.userError(t.error,t.file);else if(t.results&&t.results.data){var n={abort:function(){r=true,_(t.workerId,{data:[],errors:[],meta:{aborted:true}});},pause:m,resume:m};if(U(i.userStep)){for(var s=0;s<t.results.data.length&&(i.userStep({data:t.results.data[s],errors:t.results.errors,meta:t.results.meta},n),!r);s++);delete t.results;}else U(i.userChunk)&&(i.userChunk(t.results,n,t.file),delete t.results);}t.finished&&!r&&_(t.workerId,t.results);}function _(e,t){var i=o[e];U(i.userComplete)&&i.userComplete(t),i.terminate(),delete o[e];}function m(){throw new Error("Not implemented.")}function w(e){if("object"!=typeof e||null===e)return e;var t,i=Array.isArray(e)?[]:{};for(t in e)i[t]=w(e[t]);return i}function y(e,t){return function(){e.apply(t,arguments);}}function U(e){return "function"==typeof e}return v.parse=function(e,t){var i=(t=t||{}).dynamicTyping||false;U(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!U(t.transform)&&t.transform,!t.worker||!v.WORKERS_SUPPORTED)return i=null,v.NODE_STREAM_INPUT,"string"==typeof e?(e=(e=>65279!==e.charCodeAt(0)?e:e.slice(1))(e),i=new(t.download?f:c)(t)):true===e.readable&&U(e.read)&&U(e.on)?i=new p(t):(n.File&&e instanceof File||e instanceof Object)&&(i=new l(t)),i.stream(e);(i=(()=>{var e;return !!v.WORKERS_SUPPORTED&&(e=(()=>{var e=n.URL||n.webkitURL||null,t=r.toString();return v.BLOB_URL||(v.BLOB_URL=e.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",t,")();"],{type:"text/javascript"})))})(),(e=new n.Worker(e)).onmessage=g,e.id=h++,o[e.id]=e)})()).userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=U(t.step),t.chunk=U(t.chunk),t.complete=U(t.complete),t.error=U(t.error),delete t.worker,i.postMessage({input:e,config:t,workerId:i.id});},v.unparse=function(e,t){var n=false,_=true,m=",",y="\r\n",s='"',a=s+s,i=false,r=null,o=false,h=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||v.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter),"boolean"!=typeof t.quotes&&"function"!=typeof t.quotes&&!Array.isArray(t.quotes)||(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines),"string"==typeof t.newline&&(y=t.newline),"string"==typeof t.quoteChar&&(s=t.quoteChar),"boolean"==typeof t.header&&(_=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");r=t.columns;} void 0!==t.escapeChar&&(a=t.escapeChar+s),t.escapeFormulae instanceof RegExp?o=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(o=/^[=+\-@\t\r].*$/);}})(),new RegExp(P(s),"g"));"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,i);if("object"==typeof e[0])return u(r||Object.keys(e[0]),e,i)}else if("object"==typeof e)return "string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||r),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],i);throw new Error("Unable to serialize unrecognized input");function u(e,t,i){var r="",n=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(n&&_){for(var a=0;a<e.length;a++)0<a&&(r+=m),r+=k(e[a],a);0<t.length&&(r+=y);}for(var o=0;o<t.length;o++){var h=(n?e:t[o]).length,u=false,d=n?0===Object.keys(t[o]).length:0===t[o].length;if(i&&!n&&(u="greedy"===i?""===t[o].join("").trim():1===t[o].length&&0===t[o][0].length),"greedy"===i&&n){for(var f=[],l=0;l<h;l++){var c=s?e[l]:l;f.push(t[o][c]);}u=""===f.join("").trim();}if(!u){for(var p=0;p<h;p++){0<p&&!d&&(r+=m);var g=n&&s?e[p]:p;r+=k(t[o][g],p);}o<t.length-1&&(!i||0<h&&!d)&&(r+=y);}}return r}function k(e,t){var i,r;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(r=false,o&&"string"==typeof e&&o.test(e)&&(e="'"+e,r=true),i=e.toString().replace(h,a),(r=r||true===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var i=0;i<t.length;i++)if(-1<e.indexOf(t[i]))return true;return false})(i,v.BAD_DELIMITERS)||-1<i.indexOf(m)||" "===i.charAt(0)||" "===i.charAt(i.length-1))?s+i+s:i)}},v.RECORD_SEP=String.fromCharCode(30),v.UNIT_SEP=String.fromCharCode(31),v.BYTE_ORDER_MARK="\ufeff",v.BAD_DELIMITERS=["\r","\n",'"',v.BYTE_ORDER_MARK],v.WORKERS_SUPPORTED=!s&&!!n.Worker,v.NODE_STREAM_INPUT=1,v.LocalChunkSize=10485760,v.RemoteChunkSize=5242880,v.DefaultDelimiter=",",v.Parser=E,v.ParserHandle=i,v.NetworkStreamer=f,v.FileStreamer=l,v.StringStreamer=c,v.ReadableStreamStreamer=p,n.jQuery&&((d=n.jQuery).fn.parse=function(o){var i=o.config||{},h=[];return this.each(function(e){if(!("INPUT"===d(this).prop("tagName").toUpperCase()&&"file"===d(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return true;for(var t=0;t<this.files.length;t++)h.push({file:this.files[t],inputElem:this,instanceConfig:d.extend({},i)});}),e(),this;function e(){if(0===h.length)U(o.complete)&&o.complete();else {var e,t,i,r,n=h[0];if(U(o.before)){var s=o.before(n.file,n.inputElem);if("object"==typeof s){if("abort"===s.action)return e="AbortError",t=n.file,i=n.inputElem,r=s.reason,void(U(o.error)&&o.error({name:e},t,i,r));if("skip"===s.action)return void u();"object"==typeof s.config&&(n.instanceConfig=d.extend(n.instanceConfig,s.config));}else if("skip"===s)return void u()}var a=n.instanceConfig.complete;n.instanceConfig.complete=function(e){U(a)&&a(e,n.file,n.inputElem),u();},v.parse(n.file,n.instanceConfig);}}function u(){h.splice(0,1),e();}}),a&&(n.onmessage=function(e){e=e.data;void 0===v.WORKER_ID&&e&&(v.WORKER_ID=e.workerId);"string"==typeof e.input?n.postMessage({workerId:v.WORKER_ID,results:v.parse(e.input,e.config),finished:true}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=v.parse(e.input,e.config))&&n.postMessage({workerId:v.WORKER_ID,results:e,finished:true});}),(f.prototype=Object.create(u.prototype)).constructor=f,(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(c.prototype)).constructor=c,(p.prototype=Object.create(u.prototype)).constructor=p,v});
|
|
26588
|
+
((e,t)=>{module.exports=t();})(papaparse_min,function r(){var n="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n?n:{};var d,s=!n.document&&!!n.postMessage,a=n.IS_PAPA_WORKER||false,o={},h=0,v={};function u(e){this._handle=null,this._finished=false,this._completed=false,this._halted=false,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=true,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=b(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null);this._handle=new i(t),(this._handle.streamer=this)._config=t;}.call(this,e),this.parseChunk=function(t,e){var i=parseInt(this._config.skipFirstNLines)||0;if(this.isFirstChunk&&0<i){let e=this._config.newline;e||(r=this._config.quoteChar||'"',e=this._handle.guessLineEndings(t,r)),t=[...t.split(e).slice(i)].join(e);}this.isFirstChunk&&U(this._config.beforeFirstChunk)&&void 0!==(r=this._config.beforeFirstChunk(t))&&(t=r),this.isFirstChunk=false,this._halted=false;var i=this._partialLine+t,r=(this._partialLine="",this._handle.parse(i,this._baseIndex,!this._finished));if(!this._handle.paused()&&!this._handle.aborted()){t=r.meta.cursor,i=(this._finished||(this._partialLine=i.substring(t-this._baseIndex),this._baseIndex=t),r&&r.data&&(this._rowCount+=r.data.length),this._finished||this._config.preview&&this._rowCount>=this._config.preview);if(a)n.postMessage({results:r,workerId:v.WORKER_ID,finished:i});else if(U(this._config.chunk)&&!e){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=true);this._completeResults=r=void 0;}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!i||!U(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=true),i||r&&r.meta.paused||this._nextChunk(),r}this._halted=true;},this._sendError=function(e){U(this._config.error)?this._config.error(e):a&&this._config.error&&n.postMessage({workerId:v.WORKER_ID,error:e,finished:false});};}function f(e){var r;(e=e||{}).chunkSize||(e.chunkSize=v.RemoteChunkSize),u.call(this,e),this._nextChunk=s?function(){this._readChunk(),this._chunkLoaded();}:function(){this._readChunk();},this.stream=function(e){this._input=e,this._nextChunk();},this._readChunk=function(){if(this._finished)this._chunkLoaded();else {if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),s||(r.onload=y(this._chunkLoaded,this),r.onerror=y(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!s),this._config.downloadRequestHeaders){var e,t=this._config.downloadRequestHeaders;for(e in t)r.setRequestHeader(e,t[e]);}var i;this._config.chunkSize&&(i=this._start+this._config.chunkSize-1,r.setRequestHeader("Range","bytes="+this._start+"-"+i));try{r.send(this._config.downloadRequestBody);}catch(e){this._chunkError(e.message);}s&&0===r.status&&this._chunkError();}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize||r.responseText.length,this._finished=!this._config.chunkSize||this._start>=(e=>null!==(e=e.getResponseHeader("Content-Range"))?parseInt(e.substring(e.lastIndexOf("/")+1)):-1)(r),this.parseChunk(r.responseText)));},this._chunkError=function(e){e=r.statusText||e;this._sendError(new Error(e));};}function l(e){(e=e||{}).chunkSize||(e.chunkSize=v.LocalChunkSize),u.call(this,e);var i,r,n="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,r=e.slice||e.webkitSlice||e.mozSlice,n?((i=new FileReader).onload=y(this._chunkLoaded,this),i.onerror=y(this._chunkError,this)):i=new FileReaderSync,this._nextChunk();},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk();},this._readChunk=function(){var e=this._input,t=(this._config.chunkSize&&(t=Math.min(this._start+this._config.chunkSize,this._input.size),e=r.call(e,this._start,t)),i.readAsText(e,this._config.encoding));n||this._chunkLoaded({target:{result:t}});},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result);},this._chunkError=function(){this._sendError(i.error);};}function c(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){var e,t;if(!this._finished)return e=this._config.chunkSize,i=e?(t=i.substring(0,e),i.substring(e)):(t=i,""),this._finished=!i,this.parseChunk(t)};}function p(e){u.call(this,e=e||{});var t=[],i=true,r=false;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause();},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume();},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError);},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=true);},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=true;},this._streamData=y(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()));}catch(e){this._streamError(e);}},this),this._streamError=y(function(e){this._streamCleanUp(),this._sendError(e);},this),this._streamEnd=y(function(){this._streamCleanUp(),r=true,this._streamData("");},this),this._streamCleanUp=y(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError);},this);}function i(m){var n,s,a,t,o=Math.pow(2,53),h=-o,u=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,d=/^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/,i=this,r=0,f=0,l=false,e=false,c=[],p={data:[],errors:[],meta:{}};function y(e){return "greedy"===m.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(p&&a&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+v.DefaultDelimiter+"'"),a=false),m.skipEmptyLines&&(p.data=p.data.filter(function(e){return !y(e)})),_()){if(p)if(Array.isArray(p.data[0])){for(var e=0;_()&&e<p.data.length;e++)p.data[e].forEach(t);p.data.splice(0,1);}else p.data.forEach(t);function t(e,t){U(m.transformHeader)&&(e=m.transformHeader(e,t)),c.push(e);}}function i(e,t){for(var i=m.header?{}:[],r=0;r<e.length;r++){var n=r,s=e[r],s=((e,t)=>(e=>(m.dynamicTypingFunction&&void 0===m.dynamicTyping[e]&&(m.dynamicTyping[e]=m.dynamicTypingFunction(e)),true===(m.dynamicTyping[e]||m.dynamicTyping)))(e)?"true"===t||"TRUE"===t||"false"!==t&&"FALSE"!==t&&((e=>{if(u.test(e)){e=parseFloat(e);if(h<e&&e<o)return 1}})(t)?parseFloat(t):d.test(t)?new Date(t):""===t?null:t):t)(n=m.header?r>=c.length?"__parsed_extra":c[r]:n,s=m.transform?m.transform(s,n):s);"__parsed_extra"===n?(i[n]=i[n]||[],i[n].push(s)):i[n]=s;}return m.header&&(r>c.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+c.length+" fields but parsed "+r,f+t):r<c.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+c.length+" fields but parsed "+r,f+t)),i}var r;p&&(m.header||m.dynamicTyping||m.transform)&&(r=1,!p.data.length||Array.isArray(p.data[0])?(p.data=p.data.map(i),r=p.data.length):p.data=i(p.data,0),m.header&&p.meta&&(p.meta.fields=c),f+=r);}function _(){return m.header&&0===c.length}function k(e,t,i,r){e={type:e,code:t,message:i};void 0!==r&&(e.row=r),p.errors.push(e);}U(m.step)&&(t=m.step,m.step=function(e){p=e,_()?g():(g(),0!==p.data.length&&(r+=e.data.length,m.preview&&r>m.preview?s.abort():(p.data=p.data[0],t(p,i))));}),this.parse=function(e,t,i){var r=m.quoteChar||'"',r=(m.newline||(m.newline=this.guessLineEndings(e,r)),a=false,m.delimiter?U(m.delimiter)&&(m.delimiter=m.delimiter(e),p.meta.delimiter=m.delimiter):((r=((e,t,i,r,n)=>{var s,a,o,h;n=n||[",","\t","|",";",v.RECORD_SEP,v.UNIT_SEP];for(var u=0;u<n.length;u++){for(var d,f=n[u],l=0,c=0,p=0,g=(o=void 0,new E({comments:r,delimiter:f,newline:t,preview:10}).parse(e)),_=0;_<g.data.length;_++)i&&y(g.data[_])?p++:(d=g.data[_].length,c+=d,void 0===o?o=d:0<d&&(l+=Math.abs(d-o),o=d));0<g.data.length&&(c/=g.data.length-p),(void 0===a||l<=a)&&(void 0===h||h<c)&&1.99<c&&(a=l,s=f,h=c);}return {successful:!!(m.delimiter=s),bestDelimiter:s}})(e,m.newline,m.skipEmptyLines,m.comments,m.delimitersToGuess)).successful?m.delimiter=r.bestDelimiter:(a=true,m.delimiter=v.DefaultDelimiter),p.meta.delimiter=m.delimiter),b(m));return m.preview&&m.header&&r.preview++,n=e,s=new E(r),p=s.parse(n,t,i),g(),l?{meta:{paused:true}}:p||{meta:{paused:false}}},this.paused=function(){return l},this.pause=function(){l=true,s.abort(),n=U(m.chunk)?"":n.substring(s.getCharIndex());},this.resume=function(){i.streamer._halted?(l=false,i.streamer.parseChunk(n,true)):setTimeout(i.resume,3);},this.aborted=function(){return e},this.abort=function(){e=true,s.abort(),p.meta.aborted=true,U(m.complete)&&m.complete(p),n="";},this.guessLineEndings=function(e,t){e=e.substring(0,1048576);var t=new RegExp(P(t)+"([^]*?)"+P(t),"gm"),i=(e=e.replace(t,"")).split("\r"),t=e.split("\n"),e=1<t.length&&t[0].length<i[0].length;if(1===i.length||e)return "\n";for(var r=0,n=0;n<i.length;n++)"\n"===i[n][0]&&r++;return r>=i.length/2?"\r\n":"\r"};}function P(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(C){var S=(C=C||{}).delimiter,O=C.newline,x=C.comments,I=C.step,A=C.preview,T=C.fastMode,D=null,L=false,F=null==C.quoteChar?'"':C.quoteChar,j=F;if(void 0!==C.escapeChar&&(j=C.escapeChar),("string"!=typeof S||-1<v.BAD_DELIMITERS.indexOf(S))&&(S=","),x===S)throw new Error("Comment character same as delimiter");true===x?x="#":("string"!=typeof x||-1<v.BAD_DELIMITERS.indexOf(x))&&(x=false),"\n"!==O&&"\r"!==O&&"\r\n"!==O&&(O="\n");var z=0,M=false;this.parse=function(i,t,r){if("string"!=typeof i)throw new Error("Input must be a string");var n=i.length,e=S.length,s=O.length,a=x.length,o=U(I),h=[],u=[],d=[],f=z=0;if(!i)return w();if(T||false!==T&&-1===i.indexOf(F)){for(var l=i.split(O),c=0;c<l.length;c++){if(d=l[c],z+=d.length,c!==l.length-1)z+=O.length;else if(r)return w();if(!x||d.substring(0,a)!==x){if(o){if(h=[],k(d.split(S)),R(),M)return w()}else k(d.split(S));if(A&&A<=c)return h=h.slice(0,A),w(true)}}return w()}for(var p=i.indexOf(S,z),g=i.indexOf(O,z),_=new RegExp(P(j)+P(F),"g"),m=i.indexOf(F,z);;)if(i[z]===F)for(m=z,z++;;){if(-1===(m=i.indexOf(F,m+1)))return r||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:z}),E();if(m===n-1)return E(i.substring(z,m).replace(_,F));if(F===j&&i[m+1]===j)m++;else if(F===j||0===m||i[m-1]!==j){ -1!==p&&p<m+1&&(p=i.indexOf(S,m+1));var y=v(-1===(g=-1!==g&&g<m+1?i.indexOf(O,m+1):g)?p:Math.min(p,g));if(i.substr(m+1+y,e)===S){d.push(i.substring(z,m).replace(_,F)),i[z=m+1+y+e]!==F&&(m=i.indexOf(F,z)),p=i.indexOf(S,z),g=i.indexOf(O,z);break}y=v(g);if(i.substring(m+1+y,m+1+y+s)===O){if(d.push(i.substring(z,m).replace(_,F)),b(m+1+y+s),p=i.indexOf(S,z),m=i.indexOf(F,z),o&&(R(),M))return w();if(A&&h.length>=A)return w(true);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:z}),m++;}}else if(x&&0===d.length&&i.substring(z,z+a)===x){if(-1===g)return w();z=g+s,g=i.indexOf(O,z),p=i.indexOf(S,z);}else if(-1!==p&&(p<g||-1===g))d.push(i.substring(z,p)),z=p+e,p=i.indexOf(S,z);else {if(-1===g)break;if(d.push(i.substring(z,g)),b(g+s),o&&(R(),M))return w();if(A&&h.length>=A)return w(true)}return E();function k(e){h.push(e),f=z;}function v(e){var t=0;return t=-1!==e&&(e=i.substring(m+1,e))&&""===e.trim()?e.length:t}function E(e){return r||(void 0===e&&(e=i.substring(z)),d.push(e),z=n,k(d),o&&R()),w()}function b(e){z=e,k(d),d=[],g=i.indexOf(O,z);}function w(e){if(C.header&&!t&&h.length&&!L){var s=h[0],a=Object.create(null),o=new Set(s);let n=false;for(let r=0;r<s.length;r++){let i=s[r];if(a[i=U(C.transformHeader)?C.transformHeader(i,r):i]){let e,t=a[i];for(;e=i+"_"+t,t++,o.has(e););o.add(e),s[r]=e,a[i]++,n=true,(D=null===D?{}:D)[e]=i;}else a[i]=1,s[r]=i;o.add(i);}n&&console.warn("Duplicate headers found and renamed."),L=true;}return {data:h,errors:u,meta:{delimiter:S,linebreak:O,aborted:M,truncated:!!e,cursor:f+(t||0),renamedHeaders:D}}}function R(){I(w()),h=[],u=[];}},this.abort=function(){M=true;},this.getCharIndex=function(){return z};}function g(e){var t=e.data,i=o[t.workerId],r=false;if(t.error)i.userError(t.error,t.file);else if(t.results&&t.results.data){var n={abort:function(){r=true,_(t.workerId,{data:[],errors:[],meta:{aborted:true}});},pause:m,resume:m};if(U(i.userStep)){for(var s=0;s<t.results.data.length&&(i.userStep({data:t.results.data[s],errors:t.results.errors,meta:t.results.meta},n),!r);s++);delete t.results;}else U(i.userChunk)&&(i.userChunk(t.results,n,t.file),delete t.results);}t.finished&&!r&&_(t.workerId,t.results);}function _(e,t){var i=o[e];U(i.userComplete)&&i.userComplete(t),i.terminate(),delete o[e];}function m(){throw new Error("Not implemented.")}function b(e){if("object"!=typeof e||null===e)return e;var t,i=Array.isArray(e)?[]:{};for(t in e)i[t]=b(e[t]);return i}function y(e,t){return function(){e.apply(t,arguments);}}function U(e){return "function"==typeof e}return v.parse=function(e,t){var i=(t=t||{}).dynamicTyping||false;U(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!U(t.transform)&&t.transform,!t.worker||!v.WORKERS_SUPPORTED)return i=null,v.NODE_STREAM_INPUT,"string"==typeof e?(e=(e=>65279!==e.charCodeAt(0)?e:e.slice(1))(e),i=new(t.download?f:c)(t)):true===e.readable&&U(e.read)&&U(e.on)?i=new p(t):(n.File&&e instanceof File||e instanceof Object)&&(i=new l(t)),i.stream(e);(i=(()=>{var e;return !!v.WORKERS_SUPPORTED&&(e=(()=>{var e=n.URL||n.webkitURL||null,t=r.toString();return v.BLOB_URL||(v.BLOB_URL=e.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ","(",t,")();"],{type:"text/javascript"})))})(),(e=new n.Worker(e)).onmessage=g,e.id=h++,o[e.id]=e)})()).userStep=t.step,i.userChunk=t.chunk,i.userComplete=t.complete,i.userError=t.error,t.step=U(t.step),t.chunk=U(t.chunk),t.complete=U(t.complete),t.error=U(t.error),delete t.worker,i.postMessage({input:e,config:t,workerId:i.id});},v.unparse=function(e,t){var n=false,_=true,m=",",y="\r\n",s='"',a=s+s,i=false,r=null,o=false,h=((()=>{if("object"==typeof t){if("string"!=typeof t.delimiter||v.BAD_DELIMITERS.filter(function(e){return -1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter),"boolean"!=typeof t.quotes&&"function"!=typeof t.quotes&&!Array.isArray(t.quotes)||(n=t.quotes),"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines),"string"==typeof t.newline&&(y=t.newline),"string"==typeof t.quoteChar&&(s=t.quoteChar),"boolean"==typeof t.header&&(_=t.header),Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");r=t.columns;} void 0!==t.escapeChar&&(a=t.escapeChar+s),t.escapeFormulae instanceof RegExp?o=t.escapeFormulae:"boolean"==typeof t.escapeFormulae&&t.escapeFormulae&&(o=/^[=+\-@\t\r].*$/);}})(),new RegExp(P(s),"g"));"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,i);if("object"==typeof e[0])return u(r||Object.keys(e[0]),e,i)}else if("object"==typeof e)return "string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields||r),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],i);throw new Error("Unable to serialize unrecognized input");function u(e,t,i){var r="",n=("string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t)),Array.isArray(e)&&0<e.length),s=!Array.isArray(t[0]);if(n&&_){for(var a=0;a<e.length;a++)0<a&&(r+=m),r+=k(e[a],a);0<t.length&&(r+=y);}for(var o=0;o<t.length;o++){var h=(n?e:t[o]).length,u=false,d=n?0===Object.keys(t[o]).length:0===t[o].length;if(i&&!n&&(u="greedy"===i?""===t[o].join("").trim():1===t[o].length&&0===t[o][0].length),"greedy"===i&&n){for(var f=[],l=0;l<h;l++){var c=s?e[l]:l;f.push(t[o][c]);}u=""===f.join("").trim();}if(!u){for(var p=0;p<h;p++){0<p&&!d&&(r+=m);var g=n&&s?e[p]:p;r+=k(t[o][g],p);}o<t.length-1&&(!i||0<h&&!d)&&(r+=y);}}return r}function k(e,t){var i,r;return null==e?"":e.constructor===Date?JSON.stringify(e).slice(1,25):(r=false,o&&"string"==typeof e&&o.test(e)&&(e="'"+e,r=true),i=e.toString().replace(h,a),(r=r||true===n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||((e,t)=>{for(var i=0;i<t.length;i++)if(-1<e.indexOf(t[i]))return true;return false})(i,v.BAD_DELIMITERS)||-1<i.indexOf(m)||" "===i.charAt(0)||" "===i.charAt(i.length-1))?s+i+s:i)}},v.RECORD_SEP=String.fromCharCode(30),v.UNIT_SEP=String.fromCharCode(31),v.BYTE_ORDER_MARK="\ufeff",v.BAD_DELIMITERS=["\r","\n",'"',v.BYTE_ORDER_MARK],v.WORKERS_SUPPORTED=!s&&!!n.Worker,v.NODE_STREAM_INPUT=1,v.LocalChunkSize=10485760,v.RemoteChunkSize=5242880,v.DefaultDelimiter=",",v.Parser=E,v.ParserHandle=i,v.NetworkStreamer=f,v.FileStreamer=l,v.StringStreamer=c,v.ReadableStreamStreamer=p,n.jQuery&&((d=n.jQuery).fn.parse=function(o){var i=o.config||{},h=[];return this.each(function(e){if(!("INPUT"===d(this).prop("tagName").toUpperCase()&&"file"===d(this).attr("type").toLowerCase()&&n.FileReader)||!this.files||0===this.files.length)return true;for(var t=0;t<this.files.length;t++)h.push({file:this.files[t],inputElem:this,instanceConfig:d.extend({},i)});}),e(),this;function e(){if(0===h.length)U(o.complete)&&o.complete();else {var e,t,i,r,n=h[0];if(U(o.before)){var s=o.before(n.file,n.inputElem);if("object"==typeof s){if("abort"===s.action)return e="AbortError",t=n.file,i=n.inputElem,r=s.reason,void(U(o.error)&&o.error({name:e},t,i,r));if("skip"===s.action)return void u();"object"==typeof s.config&&(n.instanceConfig=d.extend(n.instanceConfig,s.config));}else if("skip"===s)return void u()}var a=n.instanceConfig.complete;n.instanceConfig.complete=function(e){U(a)&&a(e,n.file,n.inputElem),u();},v.parse(n.file,n.instanceConfig);}}function u(){h.splice(0,1),e();}}),a&&(n.onmessage=function(e){e=e.data;void 0===v.WORKER_ID&&e&&(v.WORKER_ID=e.workerId);"string"==typeof e.input?n.postMessage({workerId:v.WORKER_ID,results:v.parse(e.input,e.config),finished:true}):(n.File&&e.input instanceof File||e.input instanceof Object)&&(e=v.parse(e.input,e.config))&&n.postMessage({workerId:v.WORKER_ID,results:e,finished:true});}),(f.prototype=Object.create(u.prototype)).constructor=f,(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(c.prototype)).constructor=c,(p.prototype=Object.create(u.prototype)).constructor=p,v});
|
|
26464
26589
|
} (papaparse_min$1));
|
|
26465
26590
|
return papaparse_min$1.exports;
|
|
26466
26591
|
}
|
|
@@ -29105,42 +29230,42 @@ class TextRange {
|
|
|
29105
29230
|
}
|
|
29106
29231
|
}
|
|
29107
29232
|
|
|
29108
|
-
const createTextChunks = (context,
|
|
29233
|
+
const createTextChunks = (context, definition) => {
|
|
29109
29234
|
return createMemo(() => {
|
|
29110
29235
|
const chunks = [];
|
|
29111
29236
|
const mediaSources = {};
|
|
29237
|
+
let chunkExpressions;
|
|
29238
|
+
if (definition.chunks[0]?.source === "translation") {
|
|
29239
|
+
const itextId = context.evaluator.evaluateString(definition.chunks[0].toString(), {
|
|
29240
|
+
contextNode: context.contextNode
|
|
29241
|
+
});
|
|
29242
|
+
chunkExpressions = definition.form.model.getTranslationChunks(
|
|
29243
|
+
itextId,
|
|
29244
|
+
context.getActiveLanguage()
|
|
29245
|
+
);
|
|
29246
|
+
} else {
|
|
29247
|
+
chunkExpressions = definition.chunks;
|
|
29248
|
+
}
|
|
29112
29249
|
chunkExpressions.forEach((chunkExpression) => {
|
|
29250
|
+
if (chunkExpression.resourceType) {
|
|
29251
|
+
mediaSources[chunkExpression.resourceType] = JRResourceURL.from(
|
|
29252
|
+
chunkExpression.stringValue
|
|
29253
|
+
);
|
|
29254
|
+
return;
|
|
29255
|
+
}
|
|
29113
29256
|
if (chunkExpression.source === "literal") {
|
|
29114
29257
|
chunks.push(new TextChunk(context, chunkExpression.source, chunkExpression.stringValue));
|
|
29115
29258
|
return;
|
|
29116
29259
|
}
|
|
29117
29260
|
const computed = createComputedExpression(context, chunkExpression)();
|
|
29118
|
-
|
|
29119
|
-
chunks.push(new TextChunk(context, chunkExpression.source, computed));
|
|
29120
|
-
return;
|
|
29121
|
-
} else {
|
|
29122
|
-
computed.forEach((itextForm) => {
|
|
29123
|
-
if (isEngineXPathElement(itextForm) && itextForm instanceof StaticElement) {
|
|
29124
|
-
const formAttribute = itextForm.getAttributeValue("form");
|
|
29125
|
-
if (!formAttribute) {
|
|
29126
|
-
const defaultFormValue = itextForm.getXPathValue();
|
|
29127
|
-
chunks.push(new TextChunk(context, chunkExpression.source, defaultFormValue));
|
|
29128
|
-
} else if (["image", "video", "audio"].includes(formAttribute)) {
|
|
29129
|
-
const formValue = itextForm.getXPathValue();
|
|
29130
|
-
if (JRResourceURL.isJRResourceReference(formValue)) {
|
|
29131
|
-
mediaSources[formAttribute] = JRResourceURL.from(formValue);
|
|
29132
|
-
}
|
|
29133
|
-
}
|
|
29134
|
-
}
|
|
29135
|
-
});
|
|
29136
|
-
}
|
|
29261
|
+
chunks.push(new TextChunk(context, chunkExpression.source, computed));
|
|
29137
29262
|
});
|
|
29138
29263
|
return { chunks, mediaSources };
|
|
29139
29264
|
});
|
|
29140
29265
|
};
|
|
29141
29266
|
const createTextRange = (context, role, definition) => {
|
|
29142
29267
|
return context.scope.runTask(() => {
|
|
29143
|
-
const textChunks = createTextChunks(context, definition
|
|
29268
|
+
const textChunks = createTextChunks(context, definition);
|
|
29144
29269
|
return createMemo(() => {
|
|
29145
29270
|
const chunks = textChunks();
|
|
29146
29271
|
return new TextRange("form", role, chunks.chunks, chunks.mediaSources);
|
|
@@ -30019,6 +30144,10 @@ class RankControl extends ValueNode {
|
|
|
30019
30144
|
this.setValueState(valuesInOrder);
|
|
30020
30145
|
return this.root;
|
|
30021
30146
|
}
|
|
30147
|
+
getChoiceName(value) {
|
|
30148
|
+
const option = this.mapOptionsByValue().get(value);
|
|
30149
|
+
return option?.label?.asString ?? null;
|
|
30150
|
+
}
|
|
30022
30151
|
}
|
|
30023
30152
|
|
|
30024
30153
|
const insertAtIndex = (currentValues, insertionIndex, newValues) => {
|
|
@@ -30583,6 +30712,10 @@ class SelectControl extends ValueNode {
|
|
|
30583
30712
|
this.setValueState(effectiveValues);
|
|
30584
30713
|
return this.root;
|
|
30585
30714
|
}
|
|
30715
|
+
getChoiceName(value) {
|
|
30716
|
+
const option = this.mapOptionsByValue().get(value);
|
|
30717
|
+
return option?.label?.asString ?? null;
|
|
30718
|
+
}
|
|
30586
30719
|
}
|
|
30587
30720
|
|
|
30588
30721
|
class Subtree extends DescendantNode {
|