@pie-element/select-text 12.1.0-next.0 → 12.1.1-next.2
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/CHANGELOG.md +1039 -2576
- package/LICENSE.md +5 -0
- package/configure/CHANGELOG.md +890 -2307
- package/configure/lib/defaultConfiguration.js +177 -0
- package/configure/lib/defaultConfiguration.js.map +1 -0
- package/configure/lib/design.js +406 -0
- package/configure/lib/design.js.map +1 -0
- package/configure/lib/index.js +128 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/utils.js +92 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +4 -4
- package/controller/CHANGELOG.md +636 -1690
- package/controller/lib/defaults.js +25 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +196 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +3 -3
- package/package.json +6 -6
- package/module/configure.js +0 -1
- package/module/controller.js +0 -1121
- package/module/demo.js +0 -301
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -339
- package/module/print.html +0 -18
- package/module/print.js +0 -1
package/module/demo.js
DELETED
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
const tokens = () => [
|
|
8
|
-
{
|
|
9
|
-
text: "If 'tweren't for sight and sound and smell,",
|
|
10
|
-
start: 0,
|
|
11
|
-
end: 43,
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
text: "I'd like the city pretty well,",
|
|
15
|
-
start: 44,
|
|
16
|
-
end: 74,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
text: 'But when it comes to getting rest,',
|
|
20
|
-
start: 75,
|
|
21
|
-
end: 109,
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
text: 'I like the country lots the best.',
|
|
25
|
-
start: 110,
|
|
26
|
-
end: 143,
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
text: 'Sometimes it seems to me I must',
|
|
30
|
-
start: 145,
|
|
31
|
-
end: 176,
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
text: "Just quit the city's din and dust,",
|
|
35
|
-
start: 177,
|
|
36
|
-
end: 211,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
text: 'And get out where the sky is blue,',
|
|
40
|
-
start: 212,
|
|
41
|
-
end: 246,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
text: 'And say, now, how does it seem to you?',
|
|
45
|
-
start: 247,
|
|
46
|
-
end: 285,
|
|
47
|
-
},
|
|
48
|
-
];
|
|
49
|
-
|
|
50
|
-
const mathSampleTokens = [
|
|
51
|
-
{
|
|
52
|
-
start: 583,
|
|
53
|
-
end: 1465,
|
|
54
|
-
text: '<span class="lrn_token"><math xmlns="http://www.w3.org/1998/Math/MathML">\n <mstyle displaystyle="true">\n <mrow>\n <mo>[</mo>\n <mn>6</mn>\n <mi>x</mi>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>+</mo>\n <mn>2</mn>\n <mrow>\n <mo>(</mo>\n <mo>-</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>+</mo>\n <mn>3</mn>\n <mi>x</mi>\n <mo>-</mo>\n <mn>1</mn>\n <mo>)</mo>\n </mrow>\n <mo>]</mo>\n </mrow>\n <mrow>\n <mo>(</mo>\n <msup>\n <mi>x</mi>\n <mn>2</mn>\n </msup>\n <mo>)</mo>\n </mrow>\n </mstyle>\n</math></span>',
|
|
55
|
-
correct: true,
|
|
56
|
-
},
|
|
57
|
-
{ start: 1474, end: 2218 },
|
|
58
|
-
{ start: 2227, end: 2797 },
|
|
59
|
-
{ start: 2806, end: 3112 },
|
|
60
|
-
];
|
|
61
|
-
|
|
62
|
-
const base = (extras) =>
|
|
63
|
-
Object.assign(
|
|
64
|
-
{},
|
|
65
|
-
{
|
|
66
|
-
// highlightChoices: true,
|
|
67
|
-
feedback: {
|
|
68
|
-
correct: {
|
|
69
|
-
type: 'default',
|
|
70
|
-
default: 'Correct',
|
|
71
|
-
},
|
|
72
|
-
incorrect: {
|
|
73
|
-
type: 'default',
|
|
74
|
-
default: 'Incorrect',
|
|
75
|
-
},
|
|
76
|
-
partial: {
|
|
77
|
-
type: 'default',
|
|
78
|
-
default: 'Nearly',
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
partialScoring: false,
|
|
82
|
-
maxSelections: 2,
|
|
83
|
-
mode: 'sentence',
|
|
84
|
-
rationale: 'Rationale goes here.',
|
|
85
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
86
|
-
promptEnabled: true,
|
|
87
|
-
toolbarEditorPosition: 'bottom',
|
|
88
|
-
// text: `<p>Warhol was born in 1928 in Pittsburgh, Pennsylvania. When he was eight years old, he became very sick and had to stay in bed for months. To help him pass the time his mother, who was an artist, taught him how to draw. He took to it like a fish to water. Art became the center of Andy's world. A year later he added picture-taking to his interests when his mother gave him a camera. He also became fascinated with movies.</p><p>Andy studied art in school and learned many ways to make art. He learned how to use different art materials, such as oil paints, metal, clay, and wood. In 1949 he moved to New York City, where he got a job drawing and painting pictures for magazines.</p>`,
|
|
89
|
-
text: `<p>If 'tweren't for sight and sound and smell,<br />
|
|
90
|
-
I'd like the city pretty well,<br />
|
|
91
|
-
But when it comes to getting rest,<br />
|
|
92
|
-
I like the country lots the best.</p>
|
|
93
|
-
|
|
94
|
-
<p>Sometimes it seems to me I must<br />
|
|
95
|
-
Just quit the city's din and dust,<br />
|
|
96
|
-
And get out where the sky is blue,<br />
|
|
97
|
-
And say, now, how does it seem to you?</p>`,
|
|
98
|
-
tokens: tokens(),
|
|
99
|
-
},
|
|
100
|
-
extras,
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
const mathSample = (extras) => {
|
|
104
|
-
return Object.assign(
|
|
105
|
-
{},
|
|
106
|
-
{
|
|
107
|
-
highlightChoices: false,
|
|
108
|
-
feedback: {
|
|
109
|
-
correct: {
|
|
110
|
-
type: 'default',
|
|
111
|
-
default: 'Correct',
|
|
112
|
-
},
|
|
113
|
-
incorrect: {
|
|
114
|
-
type: 'default',
|
|
115
|
-
default: 'Incorrect',
|
|
116
|
-
},
|
|
117
|
-
partial: {
|
|
118
|
-
type: 'default',
|
|
119
|
-
default: 'Nearly',
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
partialScoring: false,
|
|
123
|
-
maxSelections: 2,
|
|
124
|
-
prompt: 'What sentences contain the character 6 in them?',
|
|
125
|
-
text: `<p>If 'tweren't for sight and sound and smell,<br />
|
|
126
|
-
I'd like the city pretty well,<br />
|
|
127
|
-
But when it comes to getting rest,<br />
|
|
128
|
-
I like the country lots the best.</p>
|
|
129
|
-
|
|
130
|
-
<p>Sometimes it seems to me I must<br />
|
|
131
|
-
Just quit the city's din and dust,<br />
|
|
132
|
-
And get out where the sky is blue,<br />
|
|
133
|
-
And say, now, how does it seem to you?</p>`,
|
|
134
|
-
tokens: mathSampleTokens,
|
|
135
|
-
},
|
|
136
|
-
extras,
|
|
137
|
-
);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
generate.mathSample = (id, element) => {
|
|
141
|
-
return Object.assign({}, { id, element }, mathSample({}));
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
generate.htmlSample = (id, element) => {
|
|
145
|
-
return Object.assign(
|
|
146
|
-
{},
|
|
147
|
-
{ id, element },
|
|
148
|
-
{
|
|
149
|
-
highlightChoices: true,
|
|
150
|
-
feedback: {
|
|
151
|
-
correct: {
|
|
152
|
-
type: 'default',
|
|
153
|
-
default: 'Correct',
|
|
154
|
-
},
|
|
155
|
-
incorrect: {
|
|
156
|
-
type: 'default',
|
|
157
|
-
default: 'Incorrect',
|
|
158
|
-
},
|
|
159
|
-
partial: {
|
|
160
|
-
type: 'default',
|
|
161
|
-
default: 'Nearly',
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
partialScoring: false,
|
|
165
|
-
text: '<p style=\'padding: 20px\'>A flicker and then gone. In its wake, only <span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>, as he stared into the smiling faces of the crew and told himself that yes he was meant to be here, that <span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>, the sense of panic already replaced by the pride of his accomplishment, replaced so completely that he would not remember that flicker, would not allow himself to remember, <span class="lrn_token">even after everything else had happened</span>. In his memory of that moment, <span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>. And in his memory he was smiling. Is this not what he was meant to do? Is the answer not as fixed and indisputable as any equation he might have been tasked to solve?</p>\n',
|
|
166
|
-
prompt:
|
|
167
|
-
'<p>Select the <span class="relative-emphasis">one</span> phrase below that suggests that in the future, Keith may interpret this moment differently.</p>',
|
|
168
|
-
maxSelections: 2,
|
|
169
|
-
mode: 'sentence',
|
|
170
|
-
rationale: 'Rationale goes here.',
|
|
171
|
-
tokens: [
|
|
172
|
-
{
|
|
173
|
-
correct: false,
|
|
174
|
-
start: 67,
|
|
175
|
-
end: 215,
|
|
176
|
-
text: '<span class="lrn_token">the after-echo of a distant high-pitched ringing that vibrated through him even as it returned to silence once again</span>',
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
correct: false,
|
|
180
|
-
start: 321,
|
|
181
|
-
end: 410,
|
|
182
|
-
text: '<span class="lrn_token">it had been his destiny to succeed and so he had succeeded</span>',
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
correct: true,
|
|
186
|
-
start: 585,
|
|
187
|
-
end: 655,
|
|
188
|
-
text: '<span class="lrn_token">even after everything else had happened</span>',
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
correct: false,
|
|
192
|
-
start: 687,
|
|
193
|
-
end: 790,
|
|
194
|
-
text: '<span class="lrn_token">he was an astronaut and they were welcoming him aboard the space station</span>',
|
|
195
|
-
},
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
);
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
generate.htmlAscii = (id, element) => ({
|
|
202
|
-
id,
|
|
203
|
-
element,
|
|
204
|
-
highlightChoices: true,
|
|
205
|
-
prompt: 'Select the parts that have references for Lucy',
|
|
206
|
-
text: '<p>“Lucy? Are you using your time wisely to plan your project?” Mr. Wilson asked.</p><p> Lucy looked a little confused at first.</p>',
|
|
207
|
-
tokens: [
|
|
208
|
-
{
|
|
209
|
-
start: 10,
|
|
210
|
-
end: 68,
|
|
211
|
-
text: 'Lucy? Are you using your time wisely to plan your project?',
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
start: 106,
|
|
215
|
-
end: 145,
|
|
216
|
-
text: 'Lucy looked a little confused at first.',
|
|
217
|
-
},
|
|
218
|
-
],
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
generate.model = (id, element) => {
|
|
222
|
-
return Object.assign(
|
|
223
|
-
{},
|
|
224
|
-
{ id, element },
|
|
225
|
-
base({
|
|
226
|
-
// "id": "8a808081701d693801703174fb900421",
|
|
227
|
-
teacherInstructions: '',
|
|
228
|
-
partialScoring: true,
|
|
229
|
-
prompt:
|
|
230
|
-
'<p>Select the sentence from "The Gymnast" that <span class="relative-emphasis">best</span> represents the theme.</p>',
|
|
231
|
-
rationale:
|
|
232
|
-
'<p>The final sentence of the passage best exemplifies the theme of the short story because Natasha's practice and determination finally pays off.</p>',
|
|
233
|
-
tokens: [
|
|
234
|
-
{
|
|
235
|
-
text: 'She thought about what she had to do, struggling to rein in her wild, fearful thoughts.',
|
|
236
|
-
end: 90,
|
|
237
|
-
start: 3,
|
|
238
|
-
correct: false,
|
|
239
|
-
},
|
|
240
|
-
{
|
|
241
|
-
start: 449,
|
|
242
|
-
end: 585,
|
|
243
|
-
text: 'Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.',
|
|
244
|
-
correct: false,
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
end: 627,
|
|
248
|
-
correct: false,
|
|
249
|
-
text: "At last Natasha's moment arrived.",
|
|
250
|
-
start: 594,
|
|
251
|
-
},
|
|
252
|
-
{
|
|
253
|
-
end: 743,
|
|
254
|
-
text: "The faces of past giants of gymnastics swam before her mind's eye, now razor–sharp with fierce determination.",
|
|
255
|
-
correct: false,
|
|
256
|
-
start: 628,
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
text: 'Suddenly, the din of the gymnasium was silent to her.',
|
|
260
|
-
end: 997,
|
|
261
|
-
correct: false,
|
|
262
|
-
start: 944,
|
|
263
|
-
},
|
|
264
|
-
{
|
|
265
|
-
end: 1087,
|
|
266
|
-
start: 998,
|
|
267
|
-
correct: false,
|
|
268
|
-
text: 'Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her.',
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
correct: true,
|
|
272
|
-
start: 1088,
|
|
273
|
-
end: 1225,
|
|
274
|
-
text: 'Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.',
|
|
275
|
-
},
|
|
276
|
-
],
|
|
277
|
-
// "element": "select-text",
|
|
278
|
-
text: "<p>She thought about what she had to do, struggling to rein in her wild, fearful thoughts. Coach Cummings always said that an undisciplined mind never scored a perfect 10. Natasha wanted to please her Coach, yet sometimes his approval wasn't as exciting as his anger. The gymnasts were unanimous about one thing: Coach Cummings's fits of disapproving rage were much more humorous to witness than his infrequent, backslapping moments of high praise. Just for a hair of a moment, Natasha wondered if she really wanted a perfect 10, so weary was she of trying for but never achieving one.</p>\n\n<p>At last Natasha's moment arrived. The faces of past giants of gymnastics swam before her mind's eye, now razor–sharp with fierce determination. \"I am talented. I am not afraid. I will make a perfect 10,\" she spoke aloud to herself, as she approached the mat, dusted her hands with chalk to prevent slippage, and returned to her starting point. Suddenly, the din of the gymnasium was silent to her. Forcing all sound out of her mind, she focused on the gleaming balance beam ahead of her. Taking a deep breath, Natasha made her graceful, yet powerful approach, mounted the beam flawlessly, and...executed her first perfect 10.</p>\n",
|
|
279
|
-
rubricEnabled: false,
|
|
280
|
-
}),
|
|
281
|
-
);
|
|
282
|
-
};
|
|
283
|
-
|
|
284
|
-
const { model } = generate;
|
|
285
|
-
|
|
286
|
-
var config = {
|
|
287
|
-
elements: {
|
|
288
|
-
'select-text': '../..',
|
|
289
|
-
},
|
|
290
|
-
models: [model('1', 'select-text')],
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
294
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
295
|
-
config.models.forEach((m) => {
|
|
296
|
-
const de = document.createElement("demo-el");
|
|
297
|
-
document.body.appendChild(de);
|
|
298
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
299
|
-
de.model = m;
|
|
300
|
-
});
|
|
301
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material as u,_dll_mui__material_styles as o,_dll_pie_lib__render_ui as r,_dll_debug as i,_dll_classnames as s,_dll_mui__icons_material as a,_dll_pie_lib__correct_answer_toggle as c}from"../../../@pie-lib/shared-module@^4.0.1/module/index.js";import{_dll_pie_lib__math_rendering as l}from"../../../@pie-lib/math-rendering-module@^4.0.7/module/index.js";var p,d=e;p=d.createRoot,d.hydrateRoot;var D={};Object.defineProperty(D,"__esModule",{value:!0});class h extends CustomEvent{constructor(e,t,n){super(h.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:n}}),this.component=e,this.complete=t}}h.TYPE="model-set";var g=D.ModelSetEvent=h;class f extends CustomEvent{constructor(e,t){super(f.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}f.TYPE="session-changed";var C=D.SessionChangedEvent=f;const F=t,A=n,{Button:E}=u,{Switch:m}=u,{FormControlLabel:y}=u,{styled:b}=o,{color:v}=r,B=b("div")(()=>({display:"flex",alignItems:"center",justifyContent:"space-between"})),x=b(E)(({theme:e})=>({marginRight:e.spacing(1)})),S=b(m)(()=>({"& .MuiSwitch-thumb":{"&.Mui-checked":{color:`${v.tertiary()} !important`}},"& .MuiSwitch-track":{"&.Mui-checked":{backgroundColor:`${v.tertiaryLight()} !important`}}}));class k extends F.Component{static __initStatic(){this.propTypes={onClear:A.func.isRequired,onWords:A.func.isRequired,onSentences:A.func.isRequired,onParagraphs:A.func.isRequired,setCorrectMode:A.bool.isRequired,onToggleCorrectMode:A.func.isRequired}}static __initStatic2(){this.defaultProps={}}render(){const{onClear:e,onWords:t,onSentences:n,onParagraphs:u,setCorrectMode:o,onToggleCorrectMode:r}=this.props;return F.createElement(B,null,F.createElement("div",null,F.createElement(x,{onClick:t,size:"small",color:"primary",disabled:o},"Words"),F.createElement(x,{onClick:n,size:"small",color:"primary",disabled:o},"Sentences"),F.createElement(x,{onClick:u,size:"small",color:"primary",disabled:o},"Paragraphs"),F.createElement(x,{size:"small",color:"secondary",onClick:e,disabled:o},"Clear")),F.createElement(y,{control:F.createElement(S,{checked:o,onChange:r}),label:"Set correct answers"}))}}k.__initStatic(),k.__initStatic2();var w="object"==typeof global&&global&&global.Object===Object&&global,_="object"==typeof self&&self&&self.Object===Object&&self,O=w||_||Function("return this")(),j=O.Symbol,N=Object.prototype,L=N.hasOwnProperty,P=N.toString,R=j?j.toStringTag:void 0;var T=Object.prototype.toString;var $=j?j.toStringTag:void 0;function M(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":$&&$ in Object(e)?function(e){var t=L.call(e,R),n=e[R];try{e[R]=void 0;var u=!0}catch(e){}var o=P.call(e);return u&&(t?e[R]=n:delete e[R]),o}(e):function(e){return T.call(e)}(e)}function I(e){return null!=e&&"object"==typeof e}var z=Array.isArray;function W(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function V(e){return e}function U(e){if(!W(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var H,q=O["__core-js_shared__"],K=(H=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+H:"";var G=Function.prototype.toString;function Y(e){if(null!=e){try{return G.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var J=/^\[object .+?Constructor\]$/,Q=Function.prototype,X=Object.prototype,Z=Q.toString,ee=X.hasOwnProperty,te=RegExp("^"+Z.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function ne(e){return!(!W(e)||(t=e,K&&K in t))&&(U(e)?te:J).test(Y(e));var t}function ue(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return ne(n)?n:void 0}var oe=ue(O,"WeakMap"),re=Object.create,ie=function(){function e(){}return function(t){if(!W(t))return{};if(re)return re(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),se=ie;var ae=Date.now;var ce,le,pe,de=function(){try{var e=ue(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),De=de,he=De?function(e,t){return De(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:V,ge=(ce=he,le=0,pe=0,function(){var e=ae(),t=16-(e-pe);if(pe=e,t>0){if(++le>=800)return arguments[0]}else le=0;return ce.apply(void 0,arguments)});function fe(e){return e!=e}function Ce(e,t){return!!(null==e?0:e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var u=n-1,o=e.length;++u<o;)if(e[u]===t)return u;return-1}(e,t,n):function(e,t,n,u){for(var o=e.length,r=n+(u?1:-1);u?r--:++r<o;)if(t(e[r],r,e))return r;return-1}(e,fe,n)}(e,t,0)>-1}var Fe=/^(?:0|[1-9]\d*)$/;function Ae(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Fe.test(e))&&e>-1&&e%1==0&&e<t}function Ee(e,t,n){"__proto__"==t&&De?De(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function me(e,t){return e===t||e!=e&&t!=t}var ye=Object.prototype.hasOwnProperty;function be(e,t,n){var u=e[t];ye.call(e,t)&&me(u,n)&&(void 0!==n||t in e)||Ee(e,t,n)}function ve(e,t,n,u){var o=!n;n||(n={});for(var r=-1,i=t.length;++r<i;){var s=t[r],a=u?u(n[s],e[s],s,n,e):void 0;void 0===a&&(a=e[s]),o?Ee(n,s,a):be(n,s,a)}return n}var Be=Math.max;function xe(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function Se(e){return null!=e&&xe(e.length)&&!U(e)}var ke=Object.prototype;function we(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ke)}function _e(e){return I(e)&&"[object Arguments]"==M(e)}var Oe=Object.prototype,je=Oe.hasOwnProperty,Ne=Oe.propertyIsEnumerable,Le=_e(function(){return arguments}())?_e:function(e){return I(e)&&je.call(e,"callee")&&!Ne.call(e,"callee")};var Pe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Re=Pe&&"object"==typeof module&&module&&!module.nodeType&&module,Te=Re&&Re.exports===Pe?O.Buffer:void 0,$e=(Te?Te.isBuffer:void 0)||function(){return!1},Me={};function Ie(e){return function(t){return e(t)}}Me["[object Float32Array]"]=Me["[object Float64Array]"]=Me["[object Int8Array]"]=Me["[object Int16Array]"]=Me["[object Int32Array]"]=Me["[object Uint8Array]"]=Me["[object Uint8ClampedArray]"]=Me["[object Uint16Array]"]=Me["[object Uint32Array]"]=!0,Me["[object Arguments]"]=Me["[object Array]"]=Me["[object ArrayBuffer]"]=Me["[object Boolean]"]=Me["[object DataView]"]=Me["[object Date]"]=Me["[object Error]"]=Me["[object Function]"]=Me["[object Map]"]=Me["[object Number]"]=Me["[object Object]"]=Me["[object RegExp]"]=Me["[object Set]"]=Me["[object String]"]=Me["[object WeakMap]"]=!1;var ze="object"==typeof exports&&exports&&!exports.nodeType&&exports,We=ze&&"object"==typeof module&&module&&!module.nodeType&&module,Ve=We&&We.exports===ze&&w.process,Ue=function(){try{var e=We&&We.require&&We.require("util").types;return e||Ve&&Ve.binding&&Ve.binding("util")}catch(e){}}(),He=Ue&&Ue.isTypedArray,qe=He?Ie(He):function(e){return I(e)&&xe(e.length)&&!!Me[M(e)]},Ke=Object.prototype.hasOwnProperty;function Ge(e,t){var n=z(e),u=!n&&Le(e),o=!n&&!u&&$e(e),r=!n&&!u&&!o&&qe(e),i=n||u||o||r,s=i?function(e,t){for(var n=-1,u=Array(e);++n<e;)u[n]=t(n);return u}(e.length,String):[],a=s.length;for(var c in e)!t&&!Ke.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||r&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||Ae(c,a))||s.push(c);return s}function Ye(e,t){return function(n){return e(t(n))}}var Je=Ye(Object.keys,Object),Qe=Object.prototype.hasOwnProperty;function Xe(e){return Se(e)?Ge(e):function(e){if(!we(e))return Je(e);var t=[];for(var n in Object(e))Qe.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}var Ze=Object.prototype.hasOwnProperty;function et(e){if(!W(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t=we(e),n=[];for(var u in e)("constructor"!=u||!t&&Ze.call(e,u))&&n.push(u);return n}function tt(e){return Se(e)?Ge(e,!0):et(e)}var nt=ue(Object,"create");var ut=Object.prototype.hasOwnProperty;var ot=Object.prototype.hasOwnProperty;function rt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}function it(e,t){for(var n=e.length;n--;)if(me(e[n][0],t))return n;return-1}rt.prototype.clear=function(){this.__data__=nt?nt(null):{},this.size=0},rt.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},rt.prototype.get=function(e){var t=this.__data__;if(nt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return ut.call(t,e)?t[e]:void 0},rt.prototype.has=function(e){var t=this.__data__;return nt?void 0!==t[e]:ot.call(t,e)},rt.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nt&&void 0===t?"__lodash_hash_undefined__":t,this};var st=Array.prototype.splice;function at(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}at.prototype.clear=function(){this.__data__=[],this.size=0},at.prototype.delete=function(e){var t=this.__data__,n=it(t,e);return!(n<0)&&(n==t.length-1?t.pop():st.call(t,n,1),--this.size,!0)},at.prototype.get=function(e){var t=this.__data__,n=it(t,e);return n<0?void 0:t[n][1]},at.prototype.has=function(e){return it(this.__data__,e)>-1},at.prototype.set=function(e,t){var n=this.__data__,u=it(n,e);return u<0?(++this.size,n.push([e,t])):n[u][1]=t,this};var ct=ue(O,"Map");function lt(e,t){var n,u,o=e.__data__;return("string"==(u=typeof(n=t))||"number"==u||"symbol"==u||"boolean"==u?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function pt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var u=e[t];this.set(u[0],u[1])}}function dt(e,t){for(var n=-1,u=t.length,o=e.length;++n<u;)e[o+n]=t[n];return e}pt.prototype.clear=function(){this.size=0,this.__data__={hash:new rt,map:new(ct||at),string:new rt}},pt.prototype.delete=function(e){var t=lt(this,e).delete(e);return this.size-=t?1:0,t},pt.prototype.get=function(e){return lt(this,e).get(e)},pt.prototype.has=function(e){return lt(this,e).has(e)},pt.prototype.set=function(e,t){var n=lt(this,e),u=n.size;return n.set(e,t),this.size+=n.size==u?0:1,this};var Dt=j?j.isConcatSpreadable:void 0;function ht(e){return z(e)||Le(e)||!!(Dt&&e&&e[Dt])}function gt(e,t,n,u,o){var r=-1,i=e.length;for(n||(n=ht),o||(o=[]);++r<i;){var s=e[r];t>0&&n(s)?t>1?gt(s,t-1,n,u,o):dt(o,s):u||(o[o.length]=s)}return o}var ft=Ye(Object.getPrototypeOf,Object);function Ct(e){var t=this.__data__=new at(e);this.size=t.size}Ct.prototype.clear=function(){this.__data__=new at,this.size=0},Ct.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ct.prototype.get=function(e){return this.__data__.get(e)},Ct.prototype.has=function(e){return this.__data__.has(e)},Ct.prototype.set=function(e,t){var n=this.__data__;if(n instanceof at){var u=n.__data__;if(!ct||u.length<199)return u.push([e,t]),this.size=++n.size,this;n=this.__data__=new pt(u)}return n.set(e,t),this.size=n.size,this};var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,At=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,Et=At&&At.exports===Ft?O.Buffer:void 0,mt=Et?Et.allocUnsafe:void 0;function yt(){return[]}var bt=Object.prototype.propertyIsEnumerable,vt=Object.getOwnPropertySymbols,Bt=vt?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,u=null==e?0:e.length,o=0,r=[];++n<u;){var i=e[n];t(i,n,e)&&(r[o++]=i)}return r}(vt(e),function(t){return bt.call(e,t)}))}:yt;var xt=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)dt(t,Bt(e)),e=ft(e);return t}:yt;function St(e,t,n){var u=t(e);return z(e)?u:dt(u,n(e))}function kt(e){return St(e,Xe,Bt)}function wt(e){return St(e,tt,xt)}var _t=ue(O,"DataView"),Ot=ue(O,"Promise"),jt=ue(O,"Set"),Nt="[object Map]",Lt="[object Promise]",Pt="[object Set]",Rt="[object WeakMap]",Tt="[object DataView]",$t=Y(_t),Mt=Y(ct),It=Y(Ot),zt=Y(jt),Wt=Y(oe),Vt=M;(_t&&Vt(new _t(new ArrayBuffer(1)))!=Tt||ct&&Vt(new ct)!=Nt||Ot&&Vt(Ot.resolve())!=Lt||jt&&Vt(new jt)!=Pt||oe&&Vt(new oe)!=Rt)&&(Vt=function(e){var t=M(e),n="[object Object]"==t?e.constructor:void 0,u=n?Y(n):"";if(u)switch(u){case $t:return Tt;case Mt:return Nt;case It:return Lt;case zt:return Pt;case Wt:return Rt}return t});var Ut=Vt,Ht=Object.prototype.hasOwnProperty;var qt=O.Uint8Array;function Kt(e){var t=new e.constructor(e.byteLength);return new qt(t).set(new qt(e)),t}var Gt=/\w*$/;var Yt=j?j.prototype:void 0,Jt=Yt?Yt.valueOf:void 0;function Qt(e,t,n){var u,o,r,i=e.constructor;switch(t){case"[object ArrayBuffer]":return Kt(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return function(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e,t){var n=t?Kt(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,n);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(r=new(o=e).constructor(o.source,Gt.exec(o))).lastIndex=o.lastIndex,r;case"[object Symbol]":return u=e,Jt?Object(Jt.call(u)):{}}}var Xt=Ue&&Ue.isMap,Zt=Xt?Ie(Xt):function(e){return I(e)&&"[object Map]"==Ut(e)};var en=Ue&&Ue.isSet,tn=en?Ie(en):function(e){return I(e)&&"[object Set]"==Ut(e)},nn="[object Arguments]",un="[object Function]",on="[object Object]",rn={};function sn(e,t,n,u,o,r){var i,s=1&t,a=2&t,c=4&t;if(n&&(i=o?n(e,u,o,r):n(e)),void 0!==i)return i;if(!W(e))return e;var l=z(e);if(l){if(i=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Ht.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!s)return function(e,t){var n=-1,u=e.length;for(t||(t=Array(u));++n<u;)t[n]=e[n];return t}(e,i)}else{var p=Ut(e),d=p==un||"[object GeneratorFunction]"==p;if($e(e))return function(e,t){if(t)return e.slice();var n=e.length,u=mt?mt(n):new e.constructor(n);return e.copy(u),u}(e,s);if(p==on||p==nn||d&&!o){if(i=a||d?{}:function(e){return"function"!=typeof e.constructor||we(e)?{}:se(ft(e))}(e),!s)return a?function(e,t){return ve(e,xt(e),t)}(e,function(e,t){return e&&ve(t,tt(t),e)}(i,e)):function(e,t){return ve(e,Bt(e),t)}(e,function(e,t){return e&&ve(t,Xe(t),e)}(i,e))}else{if(!rn[p])return o?e:{};i=Qt(e,p,s)}}r||(r=new Ct);var D=r.get(e);if(D)return D;r.set(e,i),tn(e)?e.forEach(function(u){i.add(sn(u,t,n,u,e,r))}):Zt(e)&&e.forEach(function(u,o){i.set(o,sn(u,t,n,o,e,r))});var h=l?void 0:(c?a?wt:kt:a?tt:Xe)(e);return function(e,t){for(var n=-1,u=null==e?0:e.length;++n<u&&!1!==t(e[n],n,e););}(h||e,function(u,o){h&&(u=e[o=u]),be(i,o,sn(u,t,n,o,e,r))}),i}rn[nn]=rn["[object Array]"]=rn["[object ArrayBuffer]"]=rn["[object DataView]"]=rn["[object Boolean]"]=rn["[object Date]"]=rn["[object Float32Array]"]=rn["[object Float64Array]"]=rn["[object Int8Array]"]=rn["[object Int16Array]"]=rn["[object Int32Array]"]=rn["[object Map]"]=rn["[object Number]"]=rn[on]=rn["[object RegExp]"]=rn["[object Set]"]=rn["[object String]"]=rn["[object Symbol]"]=rn["[object Uint8Array]"]=rn["[object Uint8ClampedArray]"]=rn["[object Uint16Array]"]=rn["[object Uint32Array]"]=!0,rn["[object Error]"]=rn[un]=rn["[object WeakMap]"]=!1;function an(e){return sn(e,4)}function cn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new pt;++t<n;)this.add(e[t])}function ln(e,t){for(var n=-1,u=null==e?0:e.length;++n<u;)if(t(e[n],n,e))return!0;return!1}function pn(e,t){return e.has(t)}cn.prototype.add=cn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},cn.prototype.has=function(e){return this.__data__.has(e)};function dn(e,t,n,u,o,r){var i=1&n,s=e.length,a=t.length;if(s!=a&&!(i&&a>s))return!1;var c=r.get(e),l=r.get(t);if(c&&l)return c==t&&l==e;var p=-1,d=!0,D=2&n?new cn:void 0;for(r.set(e,t),r.set(t,e);++p<s;){var h=e[p],g=t[p];if(u)var f=i?u(g,h,p,t,e,r):u(h,g,p,e,t,r);if(void 0!==f){if(f)continue;d=!1;break}if(D){if(!ln(t,function(e,t){if(!pn(D,t)&&(h===e||o(h,e,n,u,r)))return D.push(t)})){d=!1;break}}else if(h!==g&&!o(h,g,n,u,r)){d=!1;break}}return r.delete(e),r.delete(t),d}function Dn(e){var t=-1,n=Array(e.size);return e.forEach(function(e,u){n[++t]=[u,e]}),n}function hn(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var gn=j?j.prototype:void 0,fn=gn?gn.valueOf:void 0;var Cn=Object.prototype.hasOwnProperty;var Fn="[object Arguments]",An="[object Array]",En="[object Object]",mn=Object.prototype.hasOwnProperty;function yn(e,t,n,u,o,r){var i=z(e),s=z(t),a=i?An:Ut(e),c=s?An:Ut(t),l=(a=a==Fn?En:a)==En,p=(c=c==Fn?En:c)==En,d=a==c;if(d&&$e(e)){if(!$e(t))return!1;i=!0,l=!1}if(d&&!l)return r||(r=new Ct),i||qe(e)?dn(e,t,n,u,o,r):function(e,t,n,u,o,r,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!r(new qt(e),new qt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return me(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Dn;case"[object Set]":var a=1&u;if(s||(s=hn),e.size!=t.size&&!a)return!1;var c=i.get(e);if(c)return c==t;u|=2,i.set(e,t);var l=dn(s(e),s(t),u,o,r,i);return i.delete(e),l;case"[object Symbol]":if(fn)return fn.call(e)==fn.call(t)}return!1}(e,t,a,n,u,o,r);if(!(1&n)){var D=l&&mn.call(e,"__wrapped__"),h=p&&mn.call(t,"__wrapped__");if(D||h){var g=D?e.value():e,f=h?t.value():t;return r||(r=new Ct),o(g,f,n,u,r)}}return!!d&&(r||(r=new Ct),function(e,t,n,u,o,r){var i=1&n,s=kt(e),a=s.length;if(a!=kt(t).length&&!i)return!1;for(var c=a;c--;){var l=s[c];if(!(i?l in t:Cn.call(t,l)))return!1}var p=r.get(e),d=r.get(t);if(p&&d)return p==t&&d==e;var D=!0;r.set(e,t),r.set(t,e);for(var h=i;++c<a;){var g=e[l=s[c]],f=t[l];if(u)var C=i?u(f,g,l,t,e,r):u(g,f,l,e,t,r);if(!(void 0===C?g===f||o(g,f,n,u,r):C)){D=!1;break}h||(h="constructor"==l)}if(D&&!h){var F=e.constructor,A=t.constructor;F==A||!("constructor"in e)||!("constructor"in t)||"function"==typeof F&&F instanceof F&&"function"==typeof A&&A instanceof A||(D=!1)}return r.delete(e),r.delete(t),D}(e,t,n,u,o,r))}function bn(e,t,n,u,o){return e===t||(null==e||null==t||!I(e)&&!I(t)?e!=e&&t!=t:yn(e,t,n,u,bn,o))}function vn(e){return I(e)&&Se(e)}function Bn(e,t,n){for(var u=-1,o=null==e?0:e.length;++u<o;)if(n(t,e[u]))return!0;return!1}function xn(e,t,n,u){var o=-1,r=Ce,i=!0,s=e.length,a=[],c=t.length;if(!s)return a;n&&(t=function(e,t){for(var n=-1,u=null==e?0:e.length,o=Array(u);++n<u;)o[n]=t(e[n],n,e);return o}(t,Ie(n))),u?(r=Bn,i=!1):t.length>=200&&(r=pn,i=!1,t=new cn(t));e:for(;++o<s;){var l=e[o],p=null==n?l:n(l);if(l=u||0!==l?l:0,i&&p==p){for(var d=c;d--;)if(t[d]===p)continue e;a.push(l)}else r(t,p,u)||a.push(l)}return a}var Sn=function(e,t){return ge(function(e,t,n){return t=Be(void 0===t?e.length-1:t,0),function(){for(var u=arguments,o=-1,r=Be(u.length-t,0),i=Array(r);++o<r;)i[o]=u[t+o];o=-1;for(var s=Array(t+1);++o<t;)s[o]=u[o];return s[t]=n(i),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,s)}}(e,t,V),e+"")}(function(e,t){var n=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}(t);return vn(n)&&(n=void 0),vn(e)?xn(e,gt(t,1,vn,!0),void 0,n):[]}),kn=Sn;function wn(e,t){return bn(e,t)}var _n=function e(t,n){var u,o,r,i=n||"";if(!t||!("length"in t)&&!t.type)throw new Error("Expected node, not `"+t+"`");if("string"==typeof t.value)return t.value;if(r="length"in t?t:t.children,1===(o=r.length)&&"value"in r[0])return r[0].value;u=[];for(;o--;)u[o]=e(r[o],i);return u.join(i)};var On=function(e){return function(t){var n=-1,u=t&&t.children;if(!u)throw new Error("Missing children in `parent` for `visitor`");for(;++n in u;)e(u[n],n,t)}};var jn=function(e,t,n){var u,o=-1;if(!e)throw new Error("Iterate requires that |this| not be "+e);if(!Nn.call(e,"length"))throw new Error("Iterate requires that |this| has a `length`");if("function"!=typeof t)throw new Error("`callback` must be a function");for(;++o<e.length;)o in e&&"number"==typeof(u=t.call(n,e[o],o,e))&&(u<0&&(o=0),o=u-1)},Nn={}.hasOwnProperty;var Ln=jn,Pn=function(e){return function(e){return t;function t(t){var n=t&&t.children;if(!n)throw new Error("Missing children in `parent` for `modifier`");return Ln(n,e,t)}}(function(e){return t;function t(t,n){return e(t,n,this)}}(e))};var Rn=_n,Tn=function(e,t){return function(n){var u,o,r,i=[],s=n.children,a=n.type,c=s.length,l=-1,p=c-1,d=0;for(;++l<c;)(l===p||s[l].type===e&&t.test(Rn(s[l])))&&(u=s[d],o=s[l],r={type:a,children:s.slice(d,l+1)},u.position&&o.position&&(r.position={start:u.position.start,end:o.position.end}),i.push(r),d=l+1);return i}};var $n=Tn,Mn=function(e){var t=e.type,n=e.tokenizer,u=e.delimiter,o=u&&$n(e.delimiterType,u);return function(e){var u=this[n](e);return{type:t,children:o?o(u):u}}};var In={affixSymbol:/^([!"').?\u0F3B\u0F3D\u169C\u2019\u201D\u2026\u203A\u203D\u2046\u207E\u208E\u2309\u230B\u232A\u2769\u276B\u276D\u276F\u2771\u2773\u2775\u27C6\u27E7\u27E9\u27EB\u27ED\u27EF\u2984\u2986\u2988\u298A\u298C\u298E\u2990\u2992\u2994\u2996\u2998\u29D9\u29DB\u29FD\u2E03\u2E05\u2E0A\u2E0D\u2E1D\u2E21\u2E23\u2E25\u2E27\u2E29\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u301E\u301F\uFD3E\uFE18\uFE36\uFE38\uFE3A\uFE3C\uFE3E\uFE40\uFE42\uFE44\uFE48\uFE5A\uFE5C\uFE5E\uFF09\uFF3D\uFF5D\uFF60\uFF63\xBB\]}])\1*$/,newLine:/^[ \t]*((\r?\n|\r)[\t ]*)+$/,newLineMulti:/^[ \t]*((\r?\n|\r)[\t ]*){2,}$/,terminalMarker:/^([!.?\u2026\u203D]+)$/,wordSymbolInner:/^([&'\-.:=?@\xAD\xB7\u2010\u2011\u2019\u2027]|_+)$/,numerical:/^(?:[\d\xB2\xB3\xB9\xBC-\xBE\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u09F4-\u09F9\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0B72-\u0B77\u0BE6-\u0BF2\u0C66-\u0C6F\u0C78-\u0C7E\u0CE6-\u0CEF\u0D58-\u0D5E\u0D66-\u0D78\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F33\u1040-\u1049\u1090-\u1099\u1369-\u137C\u16EE-\u16F0\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1946-\u194F\u19D0-\u19DA\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\u2070\u2074-\u2079\u2080-\u2089\u2150-\u2182\u2185-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2CFD\u3007\u3021-\u3029\u3038-\u303A\u3192-\u3195\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\uA620-\uA629\uA6E6-\uA6EF\uA830-\uA835\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19]|\uD800[\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDEE1-\uDEFB\uDF20-\uDF23\uDF41\uDF4A\uDFD1-\uDFD5]|\uD801[\uDCA0-\uDCA9]|\uD802[\uDC58-\uDC5F\uDC79-\uDC7F\uDCA7-\uDCAF\uDCFB-\uDCFF\uDD16-\uDD1B\uDDBC\uDDBD\uDDC0-\uDDCF\uDDD2-\uDDFF\uDE40-\uDE48\uDE7D\uDE7E\uDE9D-\uDE9F\uDEEB-\uDEEF\uDF58-\uDF5F\uDF78-\uDF7F\uDFA9-\uDFAF]|\uD803[\uDCFA-\uDCFF\uDD30-\uDD39\uDE60-\uDE7E\uDF1D-\uDF26\uDF51-\uDF54\uDFC5-\uDFCB]|\uD804[\uDC52-\uDC6F\uDCF0-\uDCF9\uDD36-\uDD3F\uDDD0-\uDDD9\uDDE1-\uDDF4\uDEF0-\uDEF9]|\uD805[\uDC50-\uDC59\uDCD0-\uDCD9\uDE50-\uDE59\uDEC0-\uDEC9\uDF30-\uDF3B]|\uD806[\uDCE0-\uDCF2\uDD50-\uDD59]|\uD807[\uDC50-\uDC6C\uDD50-\uDD59\uDDA0-\uDDA9\uDFC0-\uDFD4]|\uD809[\uDC00-\uDC6E]|\uD81A[\uDE60-\uDE69\uDF50-\uDF59\uDF5B-\uDF61]|\uD81B[\uDE80-\uDE96]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDFCE-\uDFFF]|\uD838[\uDD40-\uDD49\uDEF0-\uDEF9]|\uD83A[\uDCC7-\uDCCF\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9])+$/,digitStart:/^\d/,lowerInitial:/^(?:[a-z\xB5\xDF-\xF6\xF8-\xFF\u0101\u0103\u0105\u0107\u0109\u010B\u010D\u010F\u0111\u0113\u0115\u0117\u0119\u011B\u011D\u011F\u0121\u0123\u0125\u0127\u0129\u012B\u012D\u012F\u0131\u0133\u0135\u0137\u0138\u013A\u013C\u013E\u0140\u0142\u0144\u0146\u0148\u0149\u014B\u014D\u014F\u0151\u0153\u0155\u0157\u0159\u015B\u015D\u015F\u0161\u0163\u0165\u0167\u0169\u016B\u016D\u016F\u0171\u0173\u0175\u0177\u017A\u017C\u017E-\u0180\u0183\u0185\u0188\u018C\u018D\u0192\u0195\u0199-\u019B\u019E\u01A1\u01A3\u01A5\u01A8\u01AA\u01AB\u01AD\u01B0\u01B4\u01B6\u01B9\u01BA\u01BD-\u01BF\u01C6\u01C9\u01CC\u01CE\u01D0\u01D2\u01D4\u01D6\u01D8\u01DA\u01DC\u01DD\u01DF\u01E1\u01E3\u01E5\u01E7\u01E9\u01EB\u01ED\u01EF\u01F0\u01F3\u01F5\u01F9\u01FB\u01FD\u01FF\u0201\u0203\u0205\u0207\u0209\u020B\u020D\u020F\u0211\u0213\u0215\u0217\u0219\u021B\u021D\u021F\u0221\u0223\u0225\u0227\u0229\u022B\u022D\u022F\u0231\u0233-\u0239\u023C\u023F\u0240\u0242\u0247\u0249\u024B\u024D\u024F-\u0293\u0295-\u02AF\u0371\u0373\u0377\u037B-\u037D\u0390\u03AC-\u03CE\u03D0\u03D1\u03D5-\u03D7\u03D9\u03DB\u03DD\u03DF\u03E1\u03E3\u03E5\u03E7\u03E9\u03EB\u03ED\u03EF-\u03F3\u03F5\u03F8\u03FB\u03FC\u0430-\u045F\u0461\u0463\u0465\u0467\u0469\u046B\u046D\u046F\u0471\u0473\u0475\u0477\u0479\u047B\u047D\u047F\u0481\u048B\u048D\u048F\u0491\u0493\u0495\u0497\u0499\u049B\u049D\u049F\u04A1\u04A3\u04A5\u04A7\u04A9\u04AB\u04AD\u04AF\u04B1\u04B3\u04B5\u04B7\u04B9\u04BB\u04BD\u04BF\u04C2\u04C4\u04C6\u04C8\u04CA\u04CC\u04CE\u04CF\u04D1\u04D3\u04D5\u04D7\u04D9\u04DB\u04DD\u04DF\u04E1\u04E3\u04E5\u04E7\u04E9\u04EB\u04ED\u04EF\u04F1\u04F3\u04F5\u04F7\u04F9\u04FB\u04FD\u04FF\u0501\u0503\u0505\u0507\u0509\u050B\u050D\u050F\u0511\u0513\u0515\u0517\u0519\u051B\u051D\u051F\u0521\u0523\u0525\u0527\u0529\u052B\u052D\u052F\u0560-\u0588\u10D0-\u10FA\u10FD-\u10FF\u13F8-\u13FD\u1C80-\u1C88\u1D00-\u1D2B\u1D6B-\u1D77\u1D79-\u1D9A\u1E01\u1E03\u1E05\u1E07\u1E09\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1E1F\u1E21\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E2D\u1E2F\u1E31\u1E33\u1E35\u1E37\u1E39\u1E3B\u1E3D\u1E3F\u1E41\u1E43\u1E45\u1E47\u1E49\u1E4B\u1E4D\u1E4F\u1E51\u1E53\u1E55\u1E57\u1E59\u1E5B\u1E5D\u1E5F\u1E61\u1E63\u1E65\u1E67\u1E69\u1E6B\u1E6D\u1E6F\u1E71\u1E73\u1E75\u1E77\u1E79\u1E7B\u1E7D\u1E7F\u1E81\u1E83\u1E85\u1E87\u1E89\u1E8B\u1E8D\u1E8F\u1E91\u1E93\u1E95-\u1E9D\u1E9F\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1EC9\u1ECB\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u1EF3\u1EF5\u1EF7\u1EF9\u1EFB\u1EFD\u1EFF-\u1F07\u1F10-\u1F15\u1F20-\u1F27\u1F30-\u1F37\u1F40-\u1F45\u1F50-\u1F57\u1F60-\u1F67\u1F70-\u1F7D\u1F80-\u1F87\u1F90-\u1F97\u1FA0-\u1FA7\u1FB0-\u1FB4\u1FB6\u1FB7\u1FBE\u1FC2-\u1FC4\u1FC6\u1FC7\u1FD0-\u1FD3\u1FD6\u1FD7\u1FE0-\u1FE7\u1FF2-\u1FF4\u1FF6\u1FF7\u210A\u210E\u210F\u2113\u212F\u2134\u2139\u213C\u213D\u2146-\u2149\u214E\u2184\u2C30-\u2C5E\u2C61\u2C65\u2C66\u2C68\u2C6A\u2C6C\u2C71\u2C73\u2C74\u2C76-\u2C7B\u2C81\u2C83\u2C85\u2C87\u2C89\u2C8B\u2C8D\u2C8F\u2C91\u2C93\u2C95\u2C97\u2C99\u2C9B\u2C9D\u2C9F\u2CA1\u2CA3\u2CA5\u2CA7\u2CA9\u2CAB\u2CAD\u2CAF\u2CB1\u2CB3\u2CB5\u2CB7\u2CB9\u2CBB\u2CBD\u2CBF\u2CC1\u2CC3\u2CC5\u2CC7\u2CC9\u2CCB\u2CCD\u2CCF\u2CD1\u2CD3\u2CD5\u2CD7\u2CD9\u2CDB\u2CDD\u2CDF\u2CE1\u2CE3\u2CE4\u2CEC\u2CEE\u2CF3\u2D00-\u2D25\u2D27\u2D2D\uA641\uA643\uA645\uA647\uA649\uA64B\uA64D\uA64F\uA651\uA653\uA655\uA657\uA659\uA65B\uA65D\uA65F\uA661\uA663\uA665\uA667\uA669\uA66B\uA66D\uA681\uA683\uA685\uA687\uA689\uA68B\uA68D\uA68F\uA691\uA693\uA695\uA697\uA699\uA69B\uA723\uA725\uA727\uA729\uA72B\uA72D\uA72F-\uA731\uA733\uA735\uA737\uA739\uA73B\uA73D\uA73F\uA741\uA743\uA745\uA747\uA749\uA74B\uA74D\uA74F\uA751\uA753\uA755\uA757\uA759\uA75B\uA75D\uA75F\uA761\uA763\uA765\uA767\uA769\uA76B\uA76D\uA76F\uA771-\uA778\uA77A\uA77C\uA77F\uA781\uA783\uA785\uA787\uA78C\uA78E\uA791\uA793-\uA795\uA797\uA799\uA79B\uA79D\uA79F\uA7A1\uA7A3\uA7A5\uA7A7\uA7A9\uA7AF\uA7B5\uA7B7\uA7B9\uA7BB\uA7BD\uA7BF\uA7C3\uA7C8\uA7CA\uA7F6\uA7FA\uAB30-\uAB5A\uAB60-\uAB68\uAB70-\uABBF\uFB00-\uFB06\uFB13-\uFB17\uFF41-\uFF5A]|\uD801[\uDC28-\uDC4F\uDCD8-\uDCFB]|\uD803[\uDCC0-\uDCF2]|\uD806[\uDCC0-\uDCDF]|\uD81B[\uDE60-\uDE7F]|\uD835[\uDC1A-\uDC33\uDC4E-\uDC54\uDC56-\uDC67\uDC82-\uDC9B\uDCB6-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDCCF\uDCEA-\uDD03\uDD1E-\uDD37\uDD52-\uDD6B\uDD86-\uDD9F\uDDBA-\uDDD3\uDDEE-\uDE07\uDE22-\uDE3B\uDE56-\uDE6F\uDE8A-\uDEA5\uDEC2-\uDEDA\uDEDC-\uDEE1\uDEFC-\uDF14\uDF16-\uDF1B\uDF36-\uDF4E\uDF50-\uDF55\uDF70-\uDF88\uDF8A-\uDF8F\uDFAA-\uDFC2\uDFC4-\uDFC9\uDFCB]|\uD83A[\uDD22-\uDD43])/,surrogates:/[\uD800-\uDFFF]/,punctuation:/[!"'-),-/:;?[-\]_{}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u201F\u2022-\u2027\u2032-\u203A\u203C-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDFFF]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,word:/[\dA-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u052F\u0531-\u0556\u0559\u0560-\u0588\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05EF-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u07FD\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u08D3-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09F4-\u09F9\u09FC\u09FE\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71-\u0B77\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BF2\u0C00-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C78-\u0C7E\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D63\u0D66-\u0D78\u0D7A-\u0D7F\u0D81-\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F33\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u17F0-\u17F9\u180B-\u180D\u1810-\u1819\u1820-\u1878\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1AC0\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CD0-\u1CD2\u1CD4-\u1CFA\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u20D0-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA672\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA827\uA82C\uA830-\uA835\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE38-\uDE3A\uDE3F-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE6\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD27\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEAB\uDEAC\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC00-\uDC46\uDC52-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD44-\uDD47\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDC9-\uDDCC\uDDCE-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3B-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC5E-\uDC61\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF1D-\uDF2B\uDF30-\uDF3B]|\uD806[\uDC00-\uDC3A\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD35\uDD37\uDD38\uDD3B-\uDD43\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD7\uDDDA-\uDDE1\uDDE3\uDDE4\uDE00-\uDE3E\uDE47\uDE50-\uDE99\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD8E\uDD90\uDD91\uDD93-\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF6\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF4F-\uDF87\uDF8F-\uDF9F\uDFE0\uDFE1\uDFE3\uDFE4\uDFF0\uDFF1]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A\uDD00-\uDD2C\uDD30-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCD6\uDD00-\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A]|\uDB40[\uDD00-\uDDEF]/,whiteSpace:/[\t-\r \x85\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/},zn=jn,Wn=function(e){return function(e){return t;function t(t){var n=t&&t.children;if(!n)throw new Error("Missing children in `parent` for `modifier`");zn(n,e,t)}}(function(e){return t;function t(t,n){return e(t,n,this)}}(e))};var Vn=_n,Un=Wn(function(e,t,n){var u,o;if("SymbolNode"!==e.type&&"PunctuationNode"!==e.type||"&"!==Vn(e))return;if(u=n.children,o=u[t+1],0!==t&&"WordNode"===u[t-1].type||!(o&&"WordNode"===o.type))return;u.splice(t,1),o.children.unshift(e),o.position&&e.position&&(o.position.start=e.position.start);return t-1});var Hn=_n,qn=Wn(function(e,t,n){var u,o,r;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"-"===Hn(e)&&(o=(u=n.children)[t-1],(!(r=u[t+1])||"WordNode"!==r.type)&&o&&"WordNode"===o.type))return u.splice(t,1),o.children.push(e),o.position&&e.position&&(o.position.end=e.position.end),t});var Kn=_n,Gn=In,Yn=Wn(function(e,t,n){var u,o,r,i,s,a,c;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&(r=(u=n.children)[t-1])&&"WordNode"===r.type){for(s=t-1,a=[],c=[];u[++s];)if("WordNode"===(o=u[s]).type)a=a.concat(c,o.children),c=[];else{if("SymbolNode"!==o.type&&"PunctuationNode"!==o.type||!Jn.test(Kn(o)))break;c.push(o)}if(0!==a.length)return 0!==c.length&&(s-=c.length),u.splice(t,s-t),r.children=r.children.concat(a),i=a[a.length-1],r.position&&i.position&&(r.position.end=i.position.end),t}}),Jn=Gn.wordSymbolInner;var Qn=_n,Xn=Wn(function(e,t,n){var u,o,r,i,s,a,c,l=n.children;if(u=l[t-1],o=l[t+1],u&&"WordNode"===u.type&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&Qn(e)===Zn&&(r=Qn(u),a=e,s=[e],c=1,o&&"WordNode"===o.type&&(i=Qn(o),a=o,s=s.concat(o.children),c++),r.length<3&&(!i||i.length<3)))return u.children=u.children.concat(s),l.splice(t,c),u.position&&a.position&&(u.position.end=a.position.end),t}),Zn="/";var eu=_n,tu=In,nu=Wn(function(e,t,n){var u,o,r,i,s,a,c,l;if(0!==t&&"."===eu(e)&&(i=(r=(o=(u=n.children)[t-1]).children)&&r.length,"WordNode"===o.type&&1!==i&&i%2!=0)){for(s=i,c=!0;r[--s];)if(a=r[s],l=eu(a),s%2==0){if(l.length>1)return;uu.test(l)||(c=!1)}else if("."!==l){if(s<i-2)break;return}if(!c)return u.splice(t,1),r.push(e),o.position&&e.position&&(o.position.end=e.position.end),t}}),uu=tu.numerical;var ou=Wn(function(e,t,n){var u,o=n.children;if("WordNode"===e.type&&(u=o[t+1])&&"WordNode"===u.type)return o.splice(t+1,1),e.children=e.children.concat(u.children),u.position&&e.position&&(e.position.end=u.position.end),t});var ru=On(function(e,t,n){var u=n.children;if(!e.position)return;0!==t||n.position&&n.position.start||(iu(n),n.position.start=e.position.start);t!==u.length-1||n.position&&n.position.end||(iu(n),n.position.end=e.position.end)});function iu(e){e.position||(e.position={})}var su=Wn(function(e,t,n){var u,o,r=e.children,i=-1;for(;r[++i];)if("WordNode"===r[i].type)return;if(u=n.children[t-1])return u.children=u.children.concat(r),n.children.splice(t,1),u.position&&e.position&&(u.position.end=e.position.end),t;(o=n.children[t+1])&&(o.children=r.concat(o.children),o.position&&e.position&&(o.position.start=e.position.start),n.children.splice(t,1))});var au=_n,cu=In,lu=Wn(function(e,t,n){var u,o,r,i=e.children;if(i&&0!==i.length&&0!==t&&(u=i[0],o=i[1],r=n.children[t-1],("SymbolNode"===u.type||"PunctuationNode"===u.type)&&pu.test(au(u))))return r.children.push(i.shift()),u.position&&r.position&&(r.position.end=u.position.end),o&&o.position&&e.position&&(e.position.start=o.position.start),t-1}),pu=cu.affixSymbol;var du=_n,Du=In,hu=Wn(function(e,t,n){var u,o,r,i,s=e.children;if(s&&0!==s.length&&0!==t)for(u=-1;s[++u];){if("WordNode"===(o=s[u]).type){if(!gu.test(du(o)))return;return(i=(r=n.children)[t-1]).children=i.children.concat(s),r.splice(t,1),i.position&&e.position&&(i.position.end=e.position.end),t}if("SymbolNode"===o.type||"PunctuationNode"===o.type)return}}),gu=Du.lowerInitial;var fu=_n,Cu=In,Fu=Wn(function(e,t,n){var u=e.children,o=n.children,r=o[t-1],i=u[0];if(r&&i&&"WordNode"===i.type&&Au.test(fu(i)))return r.children=r.children.concat(u),o.splice(t,1),r.position&&e.position&&(r.position.end=e.position.end),t}),Au=Cu.digitStart;var Eu=_n,mu=Wn(function(e,t,n){var u,o,r,i=e.children;if(i&&i.length>1&&(u=i[i.length-1])&&"."===Eu(u)&&(o=i[i.length-2])&&"WordNode"===o.type&&yu.test(Eu(o).toLowerCase())&&(o.children.push(u),i.pop(),u.position&&o.position&&(o.position.end=u.position.end),r=n.children[t+1]))return e.children=i.concat(r.children),n.children.splice(t+1,1),r.position&&e.position&&(e.position.end=r.position.end),t-1}),yu=new RegExp("^([0-9]{1,3}|[a-z]|al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|viz)$");var bu=_n,vu=Wn(function(e,t,n){var u,o,r,i,s=e.children;if(!s||0===s.length||0===t)return;o=-1;for(;s[++o];){if("WordNode"===(u=s[o]).type)return;if("SymbolNode"===u.type||"PunctuationNode"===u.type){if(","!==(r=bu(u))&&";"!==r)return;return(i=n.children[t-1]).children=i.children.concat(s),i.position&&e.position&&(i.position.end=e.position.end),n.children.splice(t,1),t}}});var Bu=_n,xu=In,Su=On(function(e){var t,n,u,o,r=e.children,i=r.length,s=!1;for(;r[--i];)if("SymbolNode"===(t=r[i]).type||"PunctuationNode"===t.type){if(ku.test(Bu(t)))if(s){if("."===Bu(t))if(n=r[i-1],u=r[i+1],n&&"WordNode"===n.type){if(o=r[i+2],u&&o&&"WhiteSpaceNode"===u.type&&"."===Bu(o))continue;r.splice(i,1),n.children.push(t),t.position&&n.position&&(n.position.end=t.position.end),i--}else u&&"WordNode"===u.type&&(r.splice(i,1),u.children.unshift(t),t.position&&u.position&&(u.position.start=t.position.start))}else s=!0}else"WordNode"===t.type&&(s=!0)}),ku=xu.terminalMarker;var wu=On(function(e,t,n){var u,o=e.children;o&&0!==o.length&&"WhiteSpaceNode"===o[0].type&&(n.children.splice(t,0,o.shift()),(u=o[0])&&u.position&&e.position&&(e.position.start=u.position.start))});var _u=Wn(function(e,t,n){var u,o=e.children;if(o&&0!==o.length&&"WhiteSpaceNode"===o[o.length-1].type)return n.children.splice(t+1,0,e.children.pop()),(u=o[o.length-1])&&u.position&&e.position&&(e.position.end=u.position.end),t});var Ou=_n,ju=In,Nu=Wn(function(e,t,n){var u,o,r,i,s,a,c,l;if("SentenceNode"!==e.type)return;u=e.children,r=u.length-1,o=0;for(;++o<r;)if("WhiteSpaceNode"===(l=u[o]).type&&Lu.test(Ou(l)))return e.children=u.slice(0,o),c={type:"SentenceNode",children:u.slice(o+1)},i=u[o-1],s=u[o+1],n.children.splice(t+1,0,l,c),e.position&&i.position&&s.position&&(a=e.position.end,e.position.end=i.position.end,c.position={start:s.position.start,end:a}),t+1}),Lu=ju.newLineMulti;var Pu=Wn(function(e,t,n){if("children"in e&&0===e.children.length)return n.children.splice(t,1),t});var Ru=Mn,Tu=In,$u=Mu;function Mu(e,t){var n=t||e;if(!(this instanceof Mu))return new Mu(e,t);this.doc=n?String(n):null}var Iu=Mu.prototype;function zu(e){return e+="Node",function(t,n,u){null==t&&(t="");return(n||Yu)(t)({type:e,value:String(t)},u)}}function Wu(e,t,n){e.prototype[t]=function(){return this.run(t,n.apply(this,arguments))}}function Vu(e){return function(t,n){var u,o=this;if(!(t in o))throw new Error("Illegal Invocation: Unsupported `key` for `use(key, plugins)`. Make sure `key` is a supported function");if(!n)return;u=t+"Plugins",n="function"==typeof n?[n]:n.concat();o[u]||(o[u]=[]);e(o,u,n)}}Iu.position=!0,Iu.tokenizeSymbol=zu("Symbol"),Iu.tokenizeWhiteSpace=zu("WhiteSpace"),Iu.tokenizePunctuation=zu("Punctuation"),Iu.tokenizeSource=zu("Source"),Iu.tokenizeText=zu("Text"),Iu.run=function(e,t){var n=this[e+"Plugins"],u=-1;if(n)for(;n[++u];)n[u](t);return t},Iu.use=Vu(function(e,t,n){e[t]=e[t].concat(n)}),Iu.useFirst=Vu(function(e,t,n){e[t]=n.concat(e[t])}),Iu.parse=function(e){return this.tokenizeRoot(e||this.doc)},Iu.tokenize=function(e){return function(e,t){var n,u,o,r,i,s,a,c,l,p,d,D;null==t?t="":t instanceof String&&(t=t.toString());if("string"!=typeof t){if("length"in t&&(!t[0]||t[0].type))return t;throw new Error("Illegal invocation: '"+t+"' is not a valid argument for 'ParseLatin'")}if(n=[],!t)return n;i=0,u=0,o=1,r=1,D=e.position?g:f,s=t.length,l="",c="";for(;i<s;)a=t.charAt(i),d=Ku.test(a)?"WhiteSpace":qu.test(a)?"Punctuation":Uu.test(a)?"Word":"Symbol",h(),l=a,a="",p=d,d=null,i++;return h(),n;function h(){p!==d||"Word"!==p&&"WhiteSpace"!==p&&a!==l&&!Hu.test(a)?(c&&e["tokenize"+p](c,D),c=a):c+=a}function g(e){var t=F();return A(e),n;function n(){return t(C.apply(null,arguments))}}function f(){return e;function e(){return C.apply(null,arguments)}}function C(e,t){return t?t.children.push(e):n.push(e),e}function F(){var e=m();function t(t){return t.position=new E(e),t}return t}function A(e){var t=e.length,n=-1,i=-1;for(u+=t;++n<t;)"\n"===e.charAt(n)&&(i=n,o++);-1===i?r+=t:r=t-i}function E(e){this.start=e,this.end=m()}function m(){return{line:o,column:r,offset:u}}}(this,e)},Wu(Mu,"tokenizeWord",function(e,t){var n=(t||Yu)(""),u={type:"WordNode",children:[]};return this.tokenizeText(e,t,u),n(u)}),Wu(Mu,"tokenizeSentence",Ru({type:"SentenceNode",tokenizer:"tokenize"})),Wu(Mu,"tokenizeParagraph",Ru({type:"ParagraphNode",delimiter:Tu.terminalMarker,delimiterType:"PunctuationNode",tokenizer:"tokenizeSentence"})),Wu(Mu,"tokenizeRoot",Ru({type:"RootNode",delimiter:Tu.newLine,delimiterType:"WhiteSpaceNode",tokenizer:"tokenizeParagraph"})),Iu.use("tokenizeSentence",[Un,qn,Yn,Xn,nu,ou,ru]),Iu.use("tokenizeParagraph",[su,lu,hu,Fu,mu,vu,Su,wu,_u,Nu,Pu,ru]),Iu.use("tokenizeRoot",[wu,_u,Pu,ru]);var Uu=Tu.word,Hu=Tu.surrogates,qu=Tu.punctuation,Ku=Tu.whiteSpace;function Gu(e,t){return t&&t.children.push(e),e}function Yu(){return Gu}var Ju=_n,Qu=On,Xu=Pn,Zu=$u,eo=su,to=lu,no=hu,uo=Fu,oo=vu,ro=Su,io=wu,so=_u,ao=Nu,co=Pu,lo=ru,po=ho;go.prototype=Zu.prototype;var Do=new go;function ho(e,t){if(!(this instanceof ho))return new ho(e,t);Zu.apply(this,arguments)}function go(){}ho.prototype=Do,Do.tokenizeSentencePlugins=[Qu(function(e,t,n){var u,o,r,i,s;if("PunctuationNode"!==e.type&&"SymbolNode"!==e.type)return;if(u=n.children,i=u.length,"/"===(s=Ju(e)))(o=u[t-1])&&"w"===mo(Ju(o))&&(u.splice(t,1),o.children.push(e),o.position&&e.position&&(o.position.end=e.position.end));else if(Eo.test(s)){if(o=u[t-1],t>2&&t<i-1&&"WordNode"===o.type&&"WhiteSpaceNode"===u[t-2].type&&"WhiteSpaceNode"===u[t+1].type&&Fo.test(mo(Ju(o))))return u.splice(t,1),o.children.push(e),void(o.position&&e.position&&(o.position.end=e.position.end));t===i-1||"WordNode"!==u[t+1].type||0!==t&&"WordNode"===u[t-1].type||(o=u[t+1],s=mo(Ju(o)),Ao.test(s)?(u.splice(t,1),o.children=[e].concat(o.children),o.position&&e.position&&(o.position.start=e.position.start)):"n"===s&&t<i-2&&Eo.test(Ju(u[t+2]))&&(r=u[t+2],u.splice(t,1),u.splice(t+1,1),o.children=[e].concat(o.children,r),o.position&&(e.position&&(o.position.start=e.position.start),r.position&&(o.position.end=r.position.end))))}})].concat(Do.tokenizeSentencePlugins),Do.tokenizeParagraphPlugins=[Xu(function(e,t,n){var u,o,r=e.children,i=r[r.length-1],s=r[r.length-2];if(i&&"."===Ju(i)&&s&&"WordNode"===s.type&&(u=Ju(s),(fo.test(mo(u))||Co.test(u))&&(s.children.push(i),r.pop(),i.position&&s.position&&(s.position.end=i.position.end),o=n.children[t+1])))return e.children=r.concat(o.children),n.children.splice(t+1,1),o.position&&e.position&&(e.position.end=o.position.end),t-1})].concat([eo,to,no,uo,oo,ro,io,so,ao,co,lo]);var fo=new RegExp("^(al|ca|cap|cca|cent|cf|cit|con|cp|cwt|ead|etc|ff|fl|ibid|id|nem|op|pro|seq|sic|stat|tem|vizinc|ltd|bbls?|cu|doz|fl|ft|gal|gr|gro|in|kt|lbs?|mi|oz|pt|qt|sq|tbsp|tsp|yds?|sec|min|hr|mon|tue|tues|wed|thu|thurs|fri|sat|sun|jan|feb|mar|apr|jun|jul|aug|sep|sept|oct|nov|dec)$"),Co=new RegExp("^(Mr|Mrs|Miss|Ms|Mss|Mses|Mlle|Mme|M|Messrs|Mmes|Jr|Sr|Snr|Dr|Mgr|Atty|Prof|Hon|Rev|Fr|Msgr|Sr|Br|St|Pres|Supt|Rep|Sen|Gov|Amb|Treas|Sec|Amd|Brig|Gen|Cdr|Col|Capt|Lt|Maj|Sgt|Po|Wo|Ph|Ave|Blvd|Mt|Rd|Bldgs?|Nat|Natl|Rt|Rte|Co|Pk|Sq|Dr|Pt|St|Ft|Pen|Terr|Hwy|Fwy|Pkwy|Ala|Ariz|Ark|Cal|Calif|Col|Colo|Conn|Del|Fla|Ga|Ida|Id|Ill|Ind|Ia|Kan|Kans|Ken|Ky|La|Me|Md|Mass|Mich|Minn|Miss|Mo|Mont|Neb|Nebr|Nev|Mex|Dak|Okla|Ok|Ore|Penna|Penn|Pa|Tenn|Tex|Ut|Vt|Va|Wash|Wis|Wisc|Wyo|Alta|Man|Ont|Qué|Que|Sask|Yuk|Beds|Berks|Bucks|Cambs|Ches|Corn|Cumb|Derbys|Derbs|Dev|Dor|Dur|Glos|Hants|Here|Heref|Herts|Hunts|Lancs|Leics|Lincs|Mx|Middx|Mddx|Norf|Northants|Northumb|Northd|Notts|Oxon|Rut|Shrops|Salop|Som|Staffs|Staf|Suff|Sy|Sx|Ssx|Warks|War|Warw|Westm|Wilts|Worcs|Yorks)$"),Fo=new RegExp("^(o|ol)$"),Ao=new RegExp("^(im|er|em|cause|twas|tis|twere|\\d\\ds?)$"),Eo=/^['\u2019]$/;function mo(e){return e.toLowerCase()}const yo=(e,t)=>t.children?t.children.reduce(yo,e):t.value?e+t.value:e,bo=e=>yo("",e),vo=e=>(new po).parse(e).children.reduce((e,t)=>{if("ParagraphNode"===t.type){const u={text:(n=t,yo("",n)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([u])}return e;var n},[]),Bo=e=>(new po).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>{if("SentenceNode"===t.type){const n=((e,t)=>{const n=[];let u=e.children.reduce(function(e,t){if("WhiteSpaceNode"===t.type&&"\n"===t.value){if(n.length){const u=n[0],o={text:n.map(e=>bo(e)).join(""),start:u.position.start.offset,end:t.position.start.offset};return n.splice(0,n.length),e.concat([o])}}else n.push(t);return e},t);if(n.length){const e=n[0],t=n[n.length-1],o={text:n.map(e=>bo(e)).join(""),start:e.position.start.offset,end:t.position.end.offset};u=u.concat([o]),n.splice(0,n.length)}return u})(t,e);return n||e}return e},e):e,[]),xo=e=>(new po).parse(e).children.reduce((e,t)=>"ParagraphNode"===t.type?t.children.reduce((e,t)=>"SentenceNode"===t.type?t.children.reduce((e,t)=>{if("WordNode"===t.type){const u={text:(n=t,yo("",n)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([u])}return e;var n},e):e,e):e,[]);class So{constructor(e){this.results=e}get hasOverlap(){return this.results.filter(e=>"overlap"===e.type).length>0}get surroundedTokens(){return this.results.filter(e=>"within-selection"===e.type).map(e=>e.token)}}const ko=(e,t)=>{const{start:n,end:u}=e,o=t.map(e=>n===e.start&&u===e.end?{token:e,type:"exact-fit"}:n<=e.start&&u>=e.end?{token:e,type:"within-selection"}:(e=>n>=e.start&&n<e.end)(e)||(e=>u>e.start&&u<=e.end)(e)?{token:e,type:"overlap"}:void 0);return new So(function(e){for(var t=-1,n=null==e?0:e.length,u=0,o=[];++t<n;){var r=e[t];r&&(o[u++]=r)}return o}(o))},wo=(e,t)=>{const n=e||"";if(!Array.isArray(t)||0===t.length)return[{text:n,start:0,end:n.length}];const u=(e=>{if(Array.isArray(e)){const t=an(e);return t.sort((e,t)=>{const n=e.start<t.start?-1:e.start>t.start?1:0,u=e.end<t.end?-1:e.end>t.end?1:0;if(-1===n&&-1!==u)throw new Error(`sort does not support intersecting tokens. a: ${e.start}-${e.end}, b: ${t.start}-${t.end}`);return n}),t}return e})(t).reduce((e,t,u,o)=>{let r=[];const i=e.lastIndex;if(t.start===i?r=[{text:n.substring(i,t.end),start:i,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]:i<t.start&&(r=[{text:n.substring(i,t.start),start:i,end:t.start},{text:n.substring(t.start,t.end),start:t.start,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]),u===o.length-1&&t.end<n.length){const e={text:n.substring(t.end),start:t.end,end:n.length};r.push(e)}return{lastIndex:r.length?r[r.length-1].end:i,result:e.result.concat(r)}},{result:[],lastIndex:0});return u.result},_o=()=>{document.getSelection?(document.getSelection().removeAllRanges(),document.getSelection().addRange(document.createRange())):window.getSelection?window.getSelection().removeAllRanges?(window.getSelection().removeAllRanges(),window.getSelection().addRange(document.createRange())):window.getSelection().empty&&window.getSelection().empty():document.selection&&document.selection.empty()};var Oo={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};var jo={50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600"};const No=t,Lo=n,{styled:Po}=o,Ro=s,To=i("@pie-lib:text-select:token-text"),$o=Po("span")(()=>({"&.predefined":{cursor:"pointer",backgroundColor:jo[100],border:`dashed 0px ${jo[700]}`,"& *":{cursor:"pointer",backgroundColor:jo[100],border:`dashed 0px ${jo[700]}`}},"&.correct":{backgroundColor:Oo[500],"& *":{backgroundColor:Oo[500]}}})),Mo=({text:e,predefined:t,onClick:n,correct:u})=>{const o=(e||"").replace(/\n/g,"<br>");if(t){const e=Ro("predefined",u&&"correct");return No.createElement($o,{onClick:n,className:e,dangerouslySetInnerHTML:{__html:o}})}return No.createElement("span",{dangerouslySetInnerHTML:{__html:o}})},Io=["\n"," ","\t"];class zo extends No.Component{constructor(...e){super(...e),zo.prototype.__init.call(this)}static __initStatic(){this.propTypes={text:Lo.string.isRequired,tokens:Lo.array.isRequired,onTokenClick:Lo.func.isRequired,onSelectToken:Lo.func.isRequired,className:Lo.string}}__init(){this.onClick=e=>{const{onSelectToken:t,text:n,tokens:u}=this.props;if(e.preventDefault(),"undefined"==typeof window)return;const o=window.getSelection().toString();if(o.length>0&&Io.indexOf(o)<0&&this.root){let e=(e=>{var t,n=0,u=e.ownerDocument||e.document,o=u.defaultView||u.parentWindow;if(void 0!==o.getSelection){if((t=o.getSelection()).rangeCount>0){var r=o.getSelection().getRangeAt(0),i=r.toString().length,s=r.cloneRange();s.selectNodeContents(e),s.setEnd(r.endContainer,r.endOffset),n=i?s.toString().length-i:s.toString().length}}else if((t=u.selection)&&"Control"!==t.type){var a=t.createRange(),c=u.body.createTextRange();c.moveToElementText(e),c.setEndPoint("EndToEnd",a),n=c.text.length}return n})(this.root);if(e+=n.slice(e).indexOf(o),void 0!==e){const r=e+o.length;if(r<=n.length){const n=ko({start:e,end:r},u);if(n.hasOverlap)To("hasOverlap - do nothing"),_o();else{t({text:o,start:e,end:r},n.surroundedTokens),_o()}}}}}}render(){const{text:e,tokens:t,className:n,onTokenClick:u}=this.props,o=wo(e,t);return No.createElement("div",{className:n,ref:e=>this.root=e,onClick:this.onClick},o.map((e,t)=>No.createElement(Mo,{key:t,...e,onClick:()=>u(e)})))}}zo.__initStatic();const Wo=t,Vo=n,{styled:Uo}=o,Ho=Uo("div")(({disabled:e})=>({whiteSpace:"pre-wrap",...e&&{cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"}}));class qo extends Wo.Component{static __initStatic(){this.propTypes={text:Vo.string.isRequired,tokens:Vo.arrayOf(Vo.shape({text:Vo.string,correct:Vo.bool,start:Vo.number,end:Vo.number})),onChange:Vo.func.isRequired}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),qo.prototype.__init.call(this),qo.prototype.__init2.call(this),qo.prototype.__init3.call(this),qo.prototype.__init4.call(this),qo.prototype.__init5.call(this),qo.prototype.__init6.call(this),qo.prototype.__init7.call(this),qo.prototype.__init8.call(this),qo.prototype.__init9.call(this),this.state={setCorrectMode:!1,mode:""}}__init(){this.onChangeHandler=(e,t)=>{this.props.onChange(e,t),this.setState({mode:t})}}__init2(){this.toggleCorrectMode=()=>this.setState({setCorrectMode:!this.state.setCorrectMode})}__init3(){this.clear=()=>{this.onChangeHandler([],"")}}__init4(){this.buildTokens=(e,t)=>{const{text:n}=this.props,u=t(n);this.onChangeHandler(u,e)}}__init5(){this.selectToken=(e,t)=>{const{tokens:n}=this.props,u=kn(an(n),t,wn);u.push(e),this.onChangeHandler(u,this.state.mode)}}__init6(){this.tokenClick=e=>{const{setCorrectMode:t}=this.state;t?this.setCorrect(e):this.removeToken(e)}}__init7(){this.tokenIndex=e=>{const{tokens:t}=this.props;return t.findIndex(t=>t.text==e.text&&t.start==e.start&&t.end==e.end)}}__init8(){this.setCorrect=e=>{const{tokens:t}=this.props,n=this.tokenIndex(e);if(-1!==n){const e=t[n];e.correct=!e.correct;const u=an(t);u.splice(n,1,e),this.onChangeHandler(u,this.state.mode)}}}__init9(){this.removeToken=e=>{const{tokens:t}=this.props,n=this.tokenIndex(e);if(-1!==n){const e=an(t);e.splice(n,1),this.onChangeHandler(e,this.state.mode)}}}render(){const{text:e,tokens:t}=this.props,{setCorrectMode:n}=this.state;return Wo.createElement("div",null,Wo.createElement(k,{onClear:this.clear,onWords:()=>this.buildTokens("words",xo),onSentences:()=>this.buildTokens("sentence",Bo),onParagraphs:()=>this.buildTokens("paragraphs",vo),setCorrectMode:n,onToggleCorrectMode:this.toggleCorrectMode}),Wo.createElement(Ho,{disabled:n,as:zo,text:e,tokens:t,onTokenClick:this.tokenClick,onSelectToken:this.selectToken}))}}qo.__initStatic(),qo.__initStatic2();const Ko=t,Go=n,{styled:Yo}=o,Jo=s,{Check:Qo}=a,{Close:Xo}=a,{color:Zo}=r,er=Yo("span")(({theme:e})=>({cursor:"pointer",textIndent:0,"&.disabled":{cursor:"inherit",color:Zo.disabled()},"&.disabledBlack":{cursor:"inherit",pointerEvents:"none"},"&.disabledAndSelected":{backgroundColor:Zo.blueGrey100()},[`@media (min-width: ${e.breakpoints.values.md}px)`]:{"&.selectable:hover":{backgroundColor:Zo.blueGrey300(),color:e.palette.common.black,"& > *":{backgroundColor:Zo.blueGrey300()}}},"&.selected":{backgroundColor:Zo.blueGrey100(),color:e.palette.common.black,lineHeight:3.2*parseFloat(e.spacing(1))+"px",border:`solid 2px ${Zo.blueGrey900()}`,borderRadius:"4px","& > *":{backgroundColor:Zo.blueGrey100()}},"&.highlight":{border:`dashed 2px ${Zo.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px"},"&.print":{border:`dashed 2px ${Zo.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*parseFloat(e.spacing(1))+"px",color:Zo.text()},"&.custom":{display:"initial"}})),tr=Yo("span")(({theme:e})=>({position:"relative",borderRadius:"4px",color:e.palette.common.black,lineHeight:3.4*parseFloat(e.spacing(1))+2+"px",padding:"2px"})),nr=Yo(tr)(()=>({border:`${Zo.correctTertiary()} solid 2px`})),ur=Yo(tr)(()=>({border:`${Zo.incorrectWithIcon()} solid 2px`})),or=Yo(tr)(()=>({border:`${Zo.incorrectWithIcon()} dashed 2px`})),rr={color:Zo.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px",display:"inline-block"},ir=Yo(Qo)(()=>({...rr,backgroundColor:Zo.correctTertiary()})),sr=Yo(Xo)(()=>({...rr,backgroundColor:Zo.incorrectWithIcon()})),ar=({useWrapper:e,children:t,Container:n,Icon:u})=>e?Ko.createElement(n,null,t,u?Ko.createElement(u,null):null):t;ar.propTypes={useWrapper:Go.bool,Container:Go.elementType,Icon:Go.elementType,children:Go.node};const cr={text:Go.string,selectable:Go.bool};class lr extends Ko.Component{constructor(...e){super(...e),lr.prototype.__init.call(this)}static __initStatic(){this.rootClassName="tokenRootClass"}static __initStatic2(){this.propTypes={...cr,text:Go.string.isRequired,className:Go.string,disabled:Go.bool,highlight:Go.bool,correct:Go.bool}}static __initStatic3(){this.defaultProps={selectable:!1,text:""}}__init(){this.getClassAndIconConfig=()=>{const{selectable:e,selected:t,className:n,disabled:u,highlight:o,correct:r,animationsDisabled:i,isMissing:s}=this.props,a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,c=lr.rootClassName;if(void 0===r&&t&&u)return{className:Jo(c,"selected","disabledBlack",n),Component:er};if(void 0!==r){const e=!0===r;return{className:Jo(c,"custom",n),Component:er,Container:e?nr:ur,Icon:e?ir:sr}}return s?{className:Jo(c,"custom","missing",n),Component:er,Container:or,Icon:sr}:{className:Jo(c,u&&"disabled",e&&!u&&!a&&"selectable",t&&!u&&"selected",t&&u&&"disabledAndSelected",o&&e&&!u&&!t&&"highlight",i&&"print",n),Component:er,Container:undefined,Icon:undefined}}}render(){const{text:e,index:t,correct:n,isMissing:u}=this.props,{className:o,Component:r,Container:i,Icon:s}=this.getClassAndIconConfig(),a=r||er;return Ko.createElement(ar,{useWrapper:void 0!==n||u,Container:i,Icon:s},Ko.createElement(a,{className:o,dangerouslySetInnerHTML:{__html:(e||"").replace(/\n/g,"<br>")},"data-indexkey":t}))}}lr.__initStatic(),lr.__initStatic2(),lr.__initStatic3();const pr=t,dr=n,{styled:Dr}=o;function hr(e){let t,n=e[0],u=1;for(;u<e.length;){const o=e[u],r=e[u+1];if(u+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=r(n)):"call"!==o&&"optionalCall"!==o||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}const gr=i("@pie-lib:text-select:token-select"),fr=Dr("div")(()=>({backgroundColor:"none",whiteSpace:"pre",cursor:"default",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none","& p":{whiteSpace:"break-spaces",margin:0}})),Cr=e=>e?e.replace(/<[^>]+>/g,""):e;class Fr extends pr.Component{constructor(...e){super(...e),Fr.prototype.__init.call(this),Fr.prototype.__init2.call(this),Fr.prototype.__init3.call(this),Fr.prototype.__init4.call(this)}static __initStatic(){this.propTypes={tokens:dr.arrayOf(dr.shape(cr)).isRequired,className:dr.string,onChange:dr.func.isRequired,disabled:dr.bool,highlightChoices:dr.bool,animationsDisabled:dr.bool,maxNoOfSelections:dr.number}}static __initStatic2(){this.defaultProps={highlightChoices:!1,maxNoOfSelections:0,tokens:[]}}__init(){this.selectedCount=()=>this.props.tokens.filter(e=>e.selected).length}__init2(){this.canSelectMore=e=>{const{maxNoOfSelections:t}=this.props;return 1===t||(gr("[canSelectMore] maxNoOfSelections: ",t,"selectedCount: ",e),t<=0||isFinite(t)&&e<t)}}__init3(){this.toggleToken=e=>{const{target:t}=e,{tokens:n,animationsDisabled:u}=this.props,o=an(n),r=hr([t,"access",e=>e.closest,"optionalCall",e=>e(`.${lr.rootClassName}`)]),i=hr([r,"optionalAccess",e=>e.dataset,"optionalAccess",e=>e.indexkey]),s=void 0!==i?o[i]:void 0;if(s&&void 0===s.correct&&!u&&!s.isMissing){const{onChange:e,maxNoOfSelections:t}=this.props,u=!s.selected;if(1===t&&1===this.selectedCount()){const t=(n||[]).filter(e=>e.selected),r=o.map(e=>wn(e,t[0])?{...e,selected:!1}:{...e,selectable:!0}),a={...s,selected:u};r.splice(i,1,a),e(r)}else{if(u&&t>0&&this.selectedCount()>=t)return void gr("skip toggle max reached");const n={...s,selected:u};o.splice(i,1,n),e(o)}}}}__init4(){this.generateTokensNodes=()=>{const{tokens:e,disabled:t,highlightChoices:n,animationsDisabled:u}=this.props,o=this.selectedCount(),r=[];let i=[];const s=()=>{r.push(pr.createElement("p",{key:`p-${r.length}`},i)),i=[]};return(e||[]).forEach((e,r)=>{const a=e.selected||e.selectable&&this.canSelectMore(o),c=void 0!==e.correct&&(e.selectable||e.selected);"\n\n"!==e.text?(e=>"\n"===e)(e.text)?i.push(pr.createElement("br",{key:`br-${r}`})):a&&!t||c||e.selected||e.isMissing||u&&e.predefined?i.push(pr.createElement(lr,{key:r,disabled:t,index:r,...e,text:Cr(e.text),selectable:a,highlight:n,animationsDisabled:u})):i.push(pr.createElement(pr.Fragment,{key:r},Cr(e.text))):s()}),s(),r}}render(){const{className:e}=this.props,t=this.generateTokensNodes();return pr.createElement(fr,{className:e,onClick:this.toggleToken},t)}}Fr.__initStatic(),Fr.__initStatic2();const Ar=t,Er=n,mr=i("@pie-lib:text-select");class yr extends Ar.Component{constructor(...e){super(...e),yr.prototype.__init.call(this)}static __initStatic(){this.propTypes={onChange:Er.func,disabled:Er.bool,tokens:Er.arrayOf(Er.shape(cr)).isRequired,selectedTokens:Er.arrayOf(Er.shape(cr)).isRequired,text:Er.string.isRequired,className:Er.string,highlightChoices:Er.bool,animationsDisabled:Er.bool,maxNoOfSelections:Er.number}}__init(){this.change=e=>{const{onChange:t}=this.props;if(!t)return;t(e.filter(e=>e.selected).map(e=>({start:e.start,end:e.end})))}}render(){const{text:e,disabled:t,tokens:n,selectedTokens:u,className:o,highlightChoices:r,maxNoOfSelections:i,animationsDisabled:s}=this.props,a=wo(e,n);mr("normalized: ",a);const c=a.map(e=>{const n=-1!==u.findIndex(t=>t.start===e.start&&t.end===e.end),o=n?e.correct:void 0,r=e.isMissing;return{...e,selectable:!t&&e.predefined,selected:n,correct:o,isMissing:r}});return Ar.createElement(Fr,{highlightChoices:!t&&r,className:o,tokens:c,disabled:t,onChange:this.change,maxNoOfSelections:i,animationsDisabled:s})}}function br(e,t){return null!=e?e:t()}function vr(e){let t,n=e[0],u=1;for(;u<e.length;){const o=e[u],r=e[u+1];if(u+=2,("optionalAccess"===o||"optionalCall"===o)&&null==n)return;"access"===o||"optionalAccess"===o?(t=n,n=r(n)):"call"!==o&&"optionalCall"!==o||(n=r((...e)=>n.call(t,...e)),t=void 0)}return n}yr.__initStatic();const Br=e=>"string"==typeof e,xr=()=>{let e,t;const n=new Promise((n,u)=>{e=n,t=u});return n.resolve=e,n.reject=t,n},Sr=e=>null==e?"":""+e,kr=/###/g,wr=e=>e&&e.indexOf("###")>-1?e.replace(kr,"."):e,_r=e=>!e||Br(e),Or=(e,t,n)=>{const u=Br(t)?t.split("."):t;let o=0;for(;o<u.length-1;){if(_r(e))return{};const t=wr(u[o]);!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++o}return _r(e)?{}:{obj:e,k:wr(u[o])}},jr=(e,t,n)=>{const{obj:u,k:o}=Or(e,t,Object);if(void 0!==u||1===t.length)return void(u[o]=n);let r=t[t.length-1],i=t.slice(0,t.length-1),s=Or(e,i,Object);for(;void 0===s.obj&&i.length;)r=`${i[i.length-1]}.${r}`,i=i.slice(0,i.length-1),s=Or(e,i,Object),vr([s,"optionalAccess",e=>e.obj])&&void 0!==s.obj[`${s.k}.${r}`]&&(s.obj=void 0);s.obj[`${s.k}.${r}`]=n},Nr=(e,t)=>{const{obj:n,k:u}=Or(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,u))return n[u]},Lr=(e,t,n)=>{for(const u in t)"__proto__"!==u&&"constructor"!==u&&(u in e?Br(e[u])||e[u]instanceof String||Br(t[u])||t[u]instanceof String?n&&(e[u]=t[u]):Lr(e[u],t[u],n):e[u]=t[u]);return e},Pr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Rr={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const Tr=e=>Br(e)?e.replace(/[&<>"'\/]/g,e=>Rr[e]):e;const $r=[" ",",","?","!",";"],Mr=new class{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const t=this.regExpMap.get(e);if(void 0!==t)return t;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}(20),Ir=(e,t,n=".")=>{if(!e)return;if(e[t]){if(!Object.prototype.hasOwnProperty.call(e,t))return;return e[t]}const u=t.split(n);let o=e;for(let e=0;e<u.length;){if(!o||"object"!=typeof o)return;let t,r="";for(let i=e;i<u.length;++i)if(i!==e&&(r+=n),r+=u[i],t=o[r],void 0!==t){if(["string","number","boolean"].indexOf(typeof t)>-1&&i<u.length-1)continue;e+=i-e+1;break}o=t}return o},zr=e=>vr([e,"optionalAccess",e=>e.replace,"call",e=>e("_","-")]),Wr={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){vr([console,"optionalAccess",t=>t[e],"optionalAccess",e=>e.apply,"optionalCall",e=>e(console,t)])}};class Vr{constructor(e,t={}){this.init(e,t)}init(e,t={}){this.prefix=t.prefix||"i18next:",this.logger=e||Wr,this.options=t,this.debug=t.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,n,u){return u&&!this.debug?null:(Br(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new Vr(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new Vr(this.logger,e)}}var Ur=new Vr;class Hr{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);const n=this.observers[e].get(t)||0;this.observers[e].set(t,n+1)}),this}off(e,t){this.observers[e]&&(t?this.observers[e].delete(t):delete this.observers[e])}emit(e,...t){if(this.observers[e]){Array.from(this.observers[e].entries()).forEach(([e,n])=>{for(let u=0;u<n;u++)e(...t)})}if(this.observers["*"]){Array.from(this.observers["*"].entries()).forEach(([n,u])=>{for(let o=0;o<u;o++)n.apply(n,[e,...t])})}}}class qr extends Hr{constructor(e,t={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n,u={}){const o=void 0!==u.keySeparator?u.keySeparator:this.options.keySeparator,r=void 0!==u.ignoreJSONStructure?u.ignoreJSONStructure:this.options.ignoreJSONStructure;let i;e.indexOf(".")>-1?i=e.split("."):(i=[e,t],n&&(Array.isArray(n)?i.push(...n):Br(n)&&o?i.push(...n.split(o)):i.push(n)));const s=Nr(this.data,i);return!s&&!t&&!n&&e.indexOf(".")>-1&&(e=i[0],t=i[1],n=i.slice(2).join(".")),!s&&r&&Br(n)?Ir(vr([this,"access",e=>e.data,"optionalAccess",t=>t[e],"optionalAccess",e=>e[t]]),n,o):s}addResource(e,t,n,u,o={silent:!1}){const r=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=e.split("."),u=t,t=i[1]),this.addNamespaces(t),jr(this.data,i,u),o.silent||this.emit("added",e,t,n,u)}addResources(e,t,n,u={silent:!1}){for(const u in n)(Br(n[u])||Array.isArray(n[u]))&&this.addResource(e,t,u,n[u],{silent:!0});u.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,u,o,r={silent:!1,skipCopy:!1}){let i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),u=n,n=t,t=i[1]),this.addNamespaces(t);let s=Nr(this.data,i)||{};r.skipCopy||(n=JSON.parse(JSON.stringify(n))),u?Lr(s,n,o):s={...s,...n},jr(this.data,i,s),r.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var Kr={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,u,o){return e.forEach(e=>{t=br(vr([this,"access",e=>e.processors,"access",t=>t[e],"optionalAccess",e=>e.process,"call",e=>e(t,n,u,o)]),()=>t)}),t}};const Gr=Symbol("i18next/PATH_KEY");function Yr(e,t){const{[Gr]:n}=e(function(){const e=[],t=Object.create(null);let n;return t.get=(u,o)=>(vr([n,"optionalAccess",e=>e.revoke,"optionalCall",e=>e()]),o===Gr?e:(e.push(o),n=Proxy.revocable(u,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}());return n.join(br(vr([t,"optionalAccess",e=>e.keySeparator]),()=>"."))}const Jr={},Qr=e=>!Br(e)&&"boolean"!=typeof e&&"number"!=typeof e;class Xr extends Hr{constructor(e,t={}){var n,u;super(),n=e,u=this,["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"].forEach(e=>{n[e]&&(u[e]=n[e])}),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=Ur.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,t={interpolation:{}}){const n={...t};if(null==e)return!1;const u=this.resolve(e,n);if(void 0===vr([u,"optionalAccess",e=>e.res]))return!1;const o=Qr(u.res);return!1!==n.returnObjects||!o}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const u=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const r=n&&e.indexOf(n)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||((e,t,n)=>{t=t||"",n=n||"";const u=$r.filter(e=>t.indexOf(e)<0&&n.indexOf(e)<0);if(0===u.length)return!0;const o=Mr.getRegExp(`(${u.map(e=>"?"===e?"\\?":e).join("|")})`);let r=!o.test(e);if(!r){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(r=!0)}return r})(e,n,u));if(r&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:Br(o)?[o]:o};const r=e.split(n);(n!==u||n===u&&this.options.ns.indexOf(r[0])>-1)&&(o=r.shift()),e=r.join(u)}return{key:e,namespaces:Br(o)?[o]:o}}translate(e,t,n){let u="object"==typeof t?{...t}:t;if("object"!=typeof u&&this.options.overloadTranslationOptionHandler&&(u=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof u&&(u={...u}),u||(u={}),null==e)return"";"function"==typeof e&&(e=Yr(e,{...this.options,...u})),Array.isArray(e)||(e=[String(e)]);const o=void 0!==u.returnDetails?u.returnDetails:this.options.returnDetails,r=void 0!==u.keySeparator?u.keySeparator:this.options.keySeparator,{key:i,namespaces:s}=this.extractFromKey(e[e.length-1],u),a=s[s.length-1];let c=void 0!==u.nsSeparator?u.nsSeparator:this.options.nsSeparator;void 0===c&&(c=":");const l=u.lng||this.language,p=u.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if("cimode"===vr([l,"optionalAccess",e=>e.toLowerCase,"call",e=>e()]))return p?o?{res:`${a}${c}${i}`,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(u)}:`${a}${c}${i}`:o?{res:i,usedKey:i,exactUsedKey:i,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(u)}:i;const d=this.resolve(e,u);let D=vr([d,"optionalAccess",e=>e.res]);const h=vr([d,"optionalAccess",e=>e.usedKey])||i,g=vr([d,"optionalAccess",e=>e.exactUsedKey])||i,f=void 0!==u.joinArrays?u.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,F=void 0!==u.count&&!Br(u.count),A=Xr.hasDefaultValue(u),E=F?this.pluralResolver.getSuffix(l,u.count,u):"",m=u.ordinal&&F?this.pluralResolver.getSuffix(l,u.count,{ordinal:!1}):"",y=F&&!u.ordinal&&0===u.count,b=y&&u[`defaultValue${this.options.pluralSeparator}zero`]||u[`defaultValue${E}`]||u[`defaultValue${m}`]||u.defaultValue;let v=D;C&&!D&&A&&(v=b);const B=Qr(v),x=Object.prototype.toString.apply(v);if(!(C&&v&&B&&["[object Number]","[object Function]","[object RegExp]"].indexOf(x)<0)||Br(f)&&Array.isArray(v))if(C&&Br(f)&&Array.isArray(D))D=D.join(f),D&&(D=this.extendTranslation(D,e,u,n));else{let t=!1,o=!1;!this.isValidLookup(D)&&A&&(t=!0,D=b),this.isValidLookup(D)||(o=!0,D=i);const s=(u.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:D,p=A&&b!==D&&this.options.updateMissing;if(o||t||p){if(this.logger.log(p?"updateKey":"missingKey",l,a,i,p?b:D),r){const e=this.resolve(i,{...u,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const t=this.languageUtils.getFallbackCodes(this.options.fallbackLng,u.lng||this.language);if("fallback"===this.options.saveMissingTo&&t&&t[0])for(let n=0;n<t.length;n++)e.push(t[n]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(u.lng||this.language):e.push(u.lng||this.language);const n=(e,t,n)=>{const o=A&&n!==D?n:s;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,t,o,p,u):vr([this,"access",e=>e.backendConnector,"optionalAccess",e=>e.saveMissing])&&this.backendConnector.saveMissing(e,a,t,o,p,u),this.emit("missingKey",e,a,t,D)};this.options.saveMissing&&(this.options.saveMissingPlurals&&F?e.forEach(e=>{const t=this.pluralResolver.getSuffixes(e,u);y&&u[`defaultValue${this.options.pluralSeparator}zero`]&&t.indexOf(`${this.options.pluralSeparator}zero`)<0&&t.push(`${this.options.pluralSeparator}zero`),t.forEach(t=>{n([e],i+t,u[`defaultValue${t}`]||b)})}):n(e,i,b))}D=this.extendTranslation(D,e,u,d,n),o&&D===i&&this.options.appendNamespaceToMissingKey&&(D=`${a}${c}${i}`),(o||t)&&this.options.parseMissingKeyHandler&&(D=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}${c}${i}`:i,t?D:void 0,u))}else{if(!u.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,v,{...u,ns:s}):`key '${i} (${this.language})' returned an object instead of string.`;return o?(d.res=e,d.usedParams=this.getUsedParamsDetails(u),d):e}if(r){const e=Array.isArray(v),t=e?[]:{},n=e?g:h;for(const e in v)if(Object.prototype.hasOwnProperty.call(v,e)){const o=`${n}${r}${e}`;t[e]=A&&!D?this.translate(o,{...u,defaultValue:Qr(b)?b[e]:void 0,joinArrays:!1,ns:s}):this.translate(o,{...u,joinArrays:!1,ns:s}),t[e]===o&&(t[e]=v[e])}D=t}}return o?(d.res=D,d.usedParams=this.getUsedParamsDetails(u),d):D}extendTranslation(e,t,n,u,o){if(vr([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.parse]))e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const r=Br(e)&&(void 0!==vr([n,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let i;if(r){const t=e.match(this.interpolator.nestingRegexp);i=t&&t.length}let s=n.replace&&!Br(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),e=this.interpolator.interpolate(e,s,n.lng||this.language||u.usedLng,n),r){const t=e.match(this.interpolator.nestingRegexp);i<(t&&t.length)&&(n.nest=!1)}!n.lng&&u&&u.res&&(n.lng=this.language||u.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(...e)=>vr([o,"optionalAccess",e=>e[0]])!==e[0]||n.context?this.translate(...e,t):(this.logger.warn(`It seems you are nesting recursively key: ${e[0]} in key: ${t[0]}`),null),n)),n.interpolation&&this.interpolator.reset()}const r=n.postProcess||this.options.postProcess,i=Br(r)?[r]:r;return null!=e&&vr([i,"optionalAccess",e=>e.length])&&!1!==n.applyPostProcessor&&(e=Kr.handle(i,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...u,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e,t={}){let n,u,o,r,i;return Br(e)&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(n))return;const s=this.extractFromKey(e,t),a=s.key;u=a;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const l=void 0!==t.count&&!Br(t.count),p=l&&!t.ordinal&&0===t.count,d=void 0!==t.context&&(Br(t.context)||"number"==typeof t.context)&&""!==t.context,D=t.lngs?t.lngs:this.languageUtils.toResolveHierarchy(t.lng||this.language,t.fallbackLng);c.forEach(e=>{this.isValidLookup(n)||(i=e,Jr[`${D[0]}-${e}`]||!vr([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||vr([this,"access",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(i)])||(Jr[`${D[0]}-${e}`]=!0,this.logger.warn(`key "${u}" for languages "${D.join(", ")}" won't get resolved as namespace "${i}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),D.forEach(u=>{if(this.isValidLookup(n))return;r=u;const i=[a];if(vr([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.addLookupKeys]))this.i18nFormat.addLookupKeys(i,a,u,e,t);else{let e;l&&(e=this.pluralResolver.getSuffix(u,t.count,t));const n=`${this.options.pluralSeparator}zero`,o=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(l&&(t.ordinal&&0===e.indexOf(o)&&i.push(a+e.replace(o,this.options.pluralSeparator)),i.push(a+e),p&&i.push(a+n)),d){const u=`${a}${this.options.contextSeparator||"_"}${t.context}`;i.push(u),l&&(t.ordinal&&0===e.indexOf(o)&&i.push(u+e.replace(o,this.options.pluralSeparator)),i.push(u+e),p&&i.push(u+n))}}let s;for(;s=i.pop();)this.isValidLookup(n)||(o=s,n=this.getResource(u,e,s,t))}))})}),{res:n,usedKey:u,exactUsedKey:o,usedLng:r,usedNS:i}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n,u={}){return vr([this,"access",e=>e.i18nFormat,"optionalAccess",e=>e.getResource])?this.i18nFormat.getResource(e,t,n,u):this.resourceStore.getResource(e,t,n,u)}getUsedParamsDetails(e={}){const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Br(e.replace);let u=n?e.replace:e;if(n&&void 0!==e.count&&(u.count=e.count),this.options.interpolation.defaultVariables&&(u={...this.options.interpolation.defaultVariables,...u}),!n){u={...u};for(const e of t)delete u[e]}return u}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}class Zr{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ur.create("languageUtils")}getScriptPartFromCode(e){if(!(e=zr(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=zr(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if(Br(e)&&e.indexOf("-")>-1){let t;try{t=Intl.getCanonicalLocales(e)[0]}catch(e){}return t&&this.options.lowerCaseLng&&(t=t.toLowerCase()),t||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach(e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;const n=this.getScriptPartFromCode(e);if(this.isSupportedCode(n))return t=n;const u=this.getLanguagePartFromCode(e);if(this.isSupportedCode(u))return t=u;t=this.options.supportedLngs.find(e=>e===u?e:e.indexOf("-")<0&&u.indexOf("-")<0?void 0:e.indexOf("-")>0&&u.indexOf("-")<0&&e.substring(0,e.indexOf("-"))===u||0===e.indexOf(u)&&u.length>1?e:void 0)}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),Br(e)&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes((!1===t?[]:t)||this.options.fallbackLng||[],e),u=[],o=e=>{e&&(this.isSupportedCode(e)?u.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return Br(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):Br(e)&&o(this.formatLanguageCode(e)),n.forEach(e=>{u.indexOf(e)<0&&o(this.formatLanguageCode(e))}),u}}const ei={zero:0,one:1,two:2,few:3,many:4,other:5},ti={select:e=>1===e?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class ni{constructor(e,t={}){this.languageUtils=e,this.options=t,this.logger=Ur.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,t={}){const n=zr("dev"===e?"en":e),u=t.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:n,type:u});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let r;try{r=new Intl.PluralRules(n,{type:u})}catch(n){if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),ti;if(!e.match(/-|_/))return ti;const u=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(u,t)}return this.pluralRulesCache[o]=r,r}needsPlural(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),vr([n,"optionalAccess",e=>e.resolvedOptions,"call",e=>e(),"access",e=>e.pluralCategories,"access",e=>e.length])>1}getPluralFormsOfKey(e,t,n={}){return this.getSuffixes(e,n).map(e=>`${t}${e}`)}getSuffixes(e,t={}){let n=this.getRule(e,t);return n||(n=this.getRule("dev",t)),n?n.resolvedOptions().pluralCategories.sort((e,t)=>ei[e]-ei[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):[]}getSuffix(e,t,n={}){const u=this.getRule(e,n);return u?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${u.select(t)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",t,n))}}const ui=(e,t,n,u=".",o=!0)=>{let r=((e,t,n)=>{const u=Nr(e,n);return void 0!==u?u:Nr(t,n)})(e,t,n);return!r&&o&&Br(n)&&(r=Ir(e,n,u),void 0===r&&(r=Ir(t,n,u))),r},oi=e=>e.replace(/\$/g,"$$$$");class ri{constructor(e={}){this.logger=Ur.create("interpolator"),this.options=e,this.format=vr([e,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.format])||(e=>e),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:t,escapeValue:n,useRawValueToEscape:u,prefix:o,prefixEscaped:r,suffix:i,suffixEscaped:s,formatSeparator:a,unescapeSuffix:c,unescapePrefix:l,nestingPrefix:p,nestingPrefixEscaped:d,nestingSuffix:D,nestingSuffixEscaped:h,nestingOptionsSeparator:g,maxReplaces:f,alwaysFormat:C}=e.interpolation;this.escape=void 0!==t?t:Tr,this.escapeValue=void 0===n||n,this.useRawValueToEscape=void 0!==u&&u,this.prefix=o?Pr(o):r||"{{",this.suffix=i?Pr(i):s||"}}",this.formatSeparator=a||",",this.unescapePrefix=c?"":l||"-",this.unescapeSuffix=this.unescapePrefix?"":c||"",this.nestingPrefix=p?Pr(p):d||Pr("$t("),this.nestingSuffix=D?Pr(D):h||Pr(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=f||1e3,this.alwaysFormat=void 0!==C&&C,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(e,t)=>vr([e,"optionalAccess",e=>e.source])===t?(e.lastIndex=0,e):new RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,t,n,u){let o,r,i;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},a=e=>{if(e.indexOf(this.formatSeparator)<0){const o=ui(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...u,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),r=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(ui(t,s,r,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...u,...t,interpolationkey:r})};this.resetRegExp();const c=vr([u,"optionalAccess",e=>e.missingInterpolationHandler])||this.options.missingInterpolationHandler,l=void 0!==vr([u,"optionalAccess",e=>e.interpolation,"optionalAccess",e=>e.skipOnVariables])?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>oi(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?oi(this.escape(e)):oi(e)}].forEach(t=>{for(i=0;o=t.regex.exec(e);){const n=o[1].trim();if(r=a(n),void 0===r)if("function"==typeof c){const t=c(e,o,u);r=Br(t)?t:""}else if(u&&Object.prototype.hasOwnProperty.call(u,n))r="";else{if(l){r=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),r=""}else Br(r)||this.useRawValueToEscape||(r=Sr(r));const s=t.safeValue(r);if(e=e.replace(o[0],s),l?(t.regex.lastIndex+=r.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}}),e}nest(e,t,n={}){let u,o,r;const i=(e,t)=>{const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const u=e.split(new RegExp(`${n}[ ]*{`));let o=`{${u[1]}`;e=u[0],o=this.interpolate(o,r);const i=o.match(/'/g),s=o.match(/"/g);(br(vr([i,"optionalAccess",e=>e.length]),()=>0)%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{r=JSON.parse(o),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${n}${o}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;u=this.nestingRegexp.exec(e);){let s=[];r={...n},r=r.replace&&!Br(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const a=/{.*}/.test(u[1])?u[1].lastIndexOf("}")+1:u[1].indexOf(this.formatSeparator);if(-1!==a&&(s=u[1].slice(a).split(this.formatSeparator).map(e=>e.trim()).filter(Boolean),u[1]=u[1].slice(0,a)),o=t(i.call(this,u[1].trim(),r),r),o&&u[0]===e&&!Br(o))return o;Br(o)||(o=Sr(o)),o||(this.logger.warn(`missed to resolve ${u[1]} for nesting ${e}`),o=""),s.length&&(o=s.reduce((e,t)=>this.format(e,t,n.lng,{...n,interpolationkey:u[1].trim()}),o.trim())),e=e.replace(u[0],o),this.regexp.lastIndex=0}return e}}const ii=e=>{const t={};return(n,u,o)=>{let r=o;o&&o.interpolationkey&&o.formatParams&&o.formatParams[o.interpolationkey]&&o[o.interpolationkey]&&(r={...r,[o.interpolationkey]:void 0});const i=u+JSON.stringify(r);let s=t[i];return s||(s=e(zr(u),o),t[i]=s),s(n)}},si=e=>(t,n,u)=>e(zr(n),u)(t);class ai{constructor(e={}){this.logger=Ur.create("formatter"),this.options=e,this.init(e)}init(e,t={interpolation:{}}){this.formatSeparator=t.interpolation.formatSeparator||",";const n=t.cacheInBuiltFormats?ii:si;this.formats={number:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)}),currency:n((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)}),datetime:n((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)}),relativetime:n((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")}),list:n((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)})}}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=ii(t)}format(e,t,n,u={}){const o=t.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(e=>e.indexOf(")")>-1)){const e=o.findIndex(e=>e.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,e)].join(this.formatSeparator)}return o.reduce((e,t)=>{const{formatName:o,formatOptions:r}=(e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const u=e.split("(");t=u[0].toLowerCase().trim();const o=u[1].substring(0,u[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach(e=>{if(e){const[t,...u]=e.split(":"),o=u.join(":").trim().replace(/^'+|'+$/g,""),r=t.trim();n[r]||(n[r]=o),"false"===o&&(n[r]=!1),"true"===o&&(n[r]=!0),isNaN(o)||(n[r]=parseInt(o,10))}})}return{formatName:t,formatOptions:n}})(t);if(this.formats[o]){let t=e;try{const i=vr([u,"optionalAccess",e=>e.formatParams,"optionalAccess",e=>e[u.interpolationkey]])||{},s=i.locale||i.lng||u.locale||u.lng||n;t=this.formats[o](e,s,{...r,...u,...i})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${o}`),e},e)}}class ci extends Hr{constructor(e,t,n,u={}){super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=u,this.logger=Ur.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=u.maxParallelReads||10,this.readingCalls=0,this.maxRetries=u.maxRetries>=0?u.maxRetries:5,this.retryTimeout=u.retryTimeout>=1?u.retryTimeout:350,this.state={},this.queue=[],vr([this,"access",e=>e.backend,"optionalAccess",e=>e.init,"optionalCall",e=>e(n,u.backend,u)])}queueLoad(e,t,n,u){const o={},r={},i={},s={};return e.forEach(e=>{let u=!0;t.forEach(t=>{const i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===r[i]&&(r[i]=!0):(this.state[i]=1,u=!1,void 0===r[i]&&(r[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===s[t]&&(s[t]=!0)))}),u||(i[e]=!0)}),(Object.keys(o).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:u}),{toLoad:Object.keys(o),pending:Object.keys(r),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const u=e.split("|"),o=u[0],r=u[1];t&&this.emit("failedLoading",o,r,t),!t&&n&&this.store.addResourceBundle(o,r,n,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&n&&(this.state[e]=0);const i={};this.queue.forEach(n=>{((e,t,n)=>{const{obj:u,k:o}=Or(e,t,Object);u[o]=u[o]||[],u[o].push(n)})(n.loaded,[o],r),((e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)})(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach(e=>{i[e]||(i[e]={});const t=n.loaded[e];t.length&&t.forEach(t=>{void 0===i[e][t]&&(i[e][t]=!0)})}),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())}),this.emit("loaded",i),this.queue=this.queue.filter(e=>!e.done)}read(e,t,n,u=0,o=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:u,wait:o,callback:r});this.readingCalls++;const i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&u<this.maxRetries?setTimeout(()=>{this.read.call(this,e,t,n,u+1,2*o,r)},o):r(i,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,i);try{const n=s(e,t);n&&"function"==typeof n.then?n.then(e=>i(null,e)).catch(i):i(null,n)}catch(e){i(e)}}prepareLoading(e,t,n={},u){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),u&&u();Br(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Br(t)&&(t=[t]);const o=this.queueLoad(e,t,n,u);if(!o.toLoad.length)return o.pending.length||u(),null;o.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e,t=""){const n=e.split("|"),u=n[0],o=n[1];this.read(u,o,"read",void 0,void 0,(n,r)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${u} failed`,n),!n&&r&&this.logger.log(`${t}loaded namespace ${o} for language ${u}`,r),this.loaded(e,n,r)})}saveMissing(e,t,n,u,o,r={},i=()=>{}){if(!vr([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace])||vr([this,"access",e=>e.services,"optionalAccess",e=>e.utils,"optionalAccess",e=>e.hasLoadedNamespace,"call",e=>e(t)])){if(null!=n&&""!==n){if(vr([this,"access",e=>e.backend,"optionalAccess",e=>e.create])){const s={...r,isUpdate:o},a=this.backend.create.bind(this.backend);if(a.length<6)try{let o;o=5===a.length?a(e,t,n,u,s):a(e,t,n,u),o&&"function"==typeof o.then?o.then(e=>i(null,e)).catch(i):i(null,o)}catch(e){i(e)}else a(e,t,n,u,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,u)}}else this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")}}const li=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),Br(e[1])&&(t.defaultValue=e[1]),Br(e[2])&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach(e=>{t[e]=n[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),pi=e=>(Br(e.ns)&&(e.ns=[e.ns]),Br(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Br(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),vr([e,"access",e=>e.supportedLngs,"optionalAccess",e=>e.indexOf,"optionalCall",e=>e("cimode")])<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),"boolean"==typeof e.initImmediate&&(e.initAsync=e.initImmediate),e),di=()=>{};class Di extends Hr{constructor(e={},t){var n;if(super(),this.options=pi(e),this.services={},this.logger=Ur,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))}),t&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(e={},t){this.isInitializing=!0,"function"==typeof e&&(t=e,e={}),null==e.defaultNS&&e.ns&&(Br(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const n=li();var u;this.options={...n,...this.options,...pi(e)},this.options.interpolation={...n.interpolation,...this.options.interpolation},void 0!==e.keySeparator&&(this.options.userDefinedKeySeparator=e.keySeparator),void 0!==e.nsSeparator&&(this.options.userDefinedNsSeparator=e.nsSeparator),"function"!=typeof this.options.overloadTranslationOptionHandler&&(this.options.overloadTranslationOptionHandler=n.overloadTranslationOptionHandler),!1===this.options.showSupportNotice||(vr([u=this,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||vr([u,"optionalAccess",e=>e.modules,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"optionalAccess",e=>e.indexOf,"call",e=>e("Locize")])>0||vr([u,"optionalAccess",e=>e.options,"optionalAccess",e=>e.backend,"optionalAccess",e=>e.backends])&&u.options.backend.backends.some(e=>vr([e,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0||vr([e,"optionalAccess",e=>e.constructor,"optionalAccess",e=>e.name,"access",e=>e.indexOf,"call",e=>e("Locize")])>0))||"undefined"!=typeof console&&void 0!==console.info&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const o=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let e;this.modules.logger?Ur.init(o(this.modules.logger),this.options):Ur.init(null,this.options),e=this.modules.formatter?this.modules.formatter:ai;const t=new Zr(this.options);this.store=new qr(this.options.resources,this.options);const u=this.services;u.logger=Ur,u.resourceStore=this.store,u.languageUtils=t,u.pluralResolver=new ni(t,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix});this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),!e||this.options.interpolation.format&&this.options.interpolation.format!==n.interpolation.format||(u.formatter=o(e),u.formatter.init&&u.formatter.init(u,this.options),this.options.interpolation.format=u.formatter.format.bind(u.formatter)),u.interpolator=new ri(this.options),u.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},u.backendConnector=new ci(o(this.modules.backend),u.resourceStore,u,this.options),u.backendConnector.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.languageDetector&&(u.languageDetector=o(this.modules.languageDetector),u.languageDetector.init&&u.languageDetector.init(u,this.options.detection,this.options)),this.modules.i18nFormat&&(u.i18nFormat=o(this.modules.i18nFormat),u.i18nFormat.init&&u.i18nFormat.init(this)),this.translator=new Xr(this.services,this.options),this.translator.on("*",(e,...t)=>{this.emit(e,...t)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,t||(t=di),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(e=>{this[e]=(...t)=>this.store[e](...t)});["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(e=>{this[e]=(...t)=>(this.store[e](...t),this)});const r=xr(),i=()=>{const e=(e,n)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),r.resolve(n),t(e,n)};if(this.languages&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initAsync?i():setTimeout(i,0),r}loadResources(e,t=di){let n=t;const u=Br(e)?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if("cimode"===vr([u,"optionalAccess",e=>e.toLowerCase,"call",e=>e()])&&(!this.options.preload||0===this.options.preload.length))return n();const e=[],t=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)})};if(u)t(u);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e))}vr([this,"access",e=>e.options,"access",e=>e.preload,"optionalAccess",e=>e.forEach,"optionalCall",e=>e(e=>t(e))]),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),n(e)})}else n(null)}reloadResources(e,t,n){const u=xr();return"function"==typeof e&&(n=e,e=void 0),"function"==typeof t&&(n=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),n||(n=di),this.services.backendConnector.reload(e,t,e=>{u.resolve(),n(e)}),u}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&Kr.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1)){for(let e=0;e<this.languages.length;e++){const t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,t){this.isLanguageChangingTo=e;const n=xr();this.emit("languageChanging",e);const u=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},o=(o,r)=>{r?this.isLanguageChangingTo===e&&(u(r),this.translator.changeLanguage(r),this.isLanguageChangingTo=void 0,this.emit("languageChanged",r),this.logger.log("languageChanged",r)):this.isLanguageChangingTo=void 0,n.resolve((...e)=>this.t(...e)),t&&t(o,(...e)=>this.t(...e))},r=t=>{e||t||!this.services.languageDetector||(t=[]);const n=Br(t)?t:t&&t[0],r=this.store.hasLanguageSomeTranslations(n)?n:this.services.languageUtils.getBestMatchFromCodes(Br(t)?[t]:t);r&&(this.language||u(r),this.translator.language||this.translator.changeLanguage(r),vr([this,"access",e=>e.services,"access",e=>e.languageDetector,"optionalAccess",e=>e.cacheUserLanguage,"optionalCall",e=>e(r)])),this.loadResources(r,e=>{o(e,r)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e):r(this.services.languageDetector.detect()),n}getFixedT(e,t,n){const u=(e,t,...o)=>{let r;r="object"!=typeof t?this.options.overloadTranslationOptionHandler([e,t].concat(o)):{...t},r.lng=r.lng||u.lng,r.lngs=r.lngs||u.lngs,r.ns=r.ns||u.ns,""!==r.keyPrefix&&(r.keyPrefix=r.keyPrefix||n||u.keyPrefix);const i=this.options.keySeparator||".";let s;return r.keyPrefix&&Array.isArray(e)?s=e.map(e=>("function"==typeof e&&(e=Yr(e,{...this.options,...t})),`${r.keyPrefix}${i}${e}`)):("function"==typeof e&&(e=Yr(e,{...this.options,...t})),s=r.keyPrefix?`${r.keyPrefix}${i}${e}`:e),this.t(s,r)};return Br(e)?u.lng=e:u.lngs=e,u.ns=t,u.keyPrefix=n,u}t(...e){return vr([this,"access",e=>e.translator,"optionalAccess",e=>e.translate,"call",t=>t(...e)])}exists(...e){return vr([this,"access",e=>e.translator,"optionalAccess",e=>e.exists,"call",t=>t(...e)])}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,t={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],u=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const r=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||0===n||2===n};if(t.precheck){const e=t.precheck(this,r);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!r(n,e)||u&&!r(o,e)))}loadNamespaces(e,t){const n=xr();return this.options.ns?(Br(e)&&(e=[e]),e.forEach(e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=xr();Br(e)&&(e=[e]);const u=this.options.preload||[],o=e.filter(e=>u.indexOf(e)<0&&this.services.languageUtils.isSupportedCode(e));return o.length?(this.options.preload=u.concat(o),this.loadResources(e=>{n.resolve(),t&&t(e)}),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(vr([this,"access",e=>e.languages,"optionalAccess",e=>e.length])>0?this.languages[0]:this.language)),!e)return"rtl";try{const t=new Intl.Locale(e);if(t&&t.getTextInfo){const e=t.getTextInfo();if(e&&e.direction)return e.direction}}catch(e){}const t=vr([this,"access",e=>e.services,"optionalAccess",e=>e.languageUtils])||new Zr(li());return e.toLowerCase().indexOf("-latn")>1?"ltr":["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},t){const n=new Di(e,t);return n.createInstance=Di.createInstance,n}cloneInstance(e={},t=di){const n=e.forkResourceStore;n&&delete e.forkResourceStore;const u={...this.options,...e,isClone:!0},o=new Di(u);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));if(["store","services","language"].forEach(e=>{o[e]=this[e]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n){const e=Object.keys(this.store.data).reduce((e,t)=>(e[t]={...this.store.data[t]},e[t]=Object.keys(e[t]).reduce((n,u)=>(n[u]={...e[t][u]},n),e[t]),e),{});o.store=new qr(e,u),o.services.resourceStore=o.store}if(e.interpolation){const t={...li().interpolation,...this.options.interpolation,...e.interpolation},n={...u,interpolation:t};o.services.interpolator=new ri(n)}return o.translator=new Xr(o.services,u),o.translator.on("*",(e,...t)=>{o.emit(e,...t)}),o.init(u,t),o.translator.options=u,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hi=Di.createInstance();hi.createInstance,hi.dir,hi.init,hi.loadResources,hi.reloadResources,hi.use,hi.changeLanguage,hi.getFixedT,hi.t,hi.exists,hi.setDefaultNamespace,hi.hasLoadedNamespace,hi.loadNamespaces,hi.loadLanguages;hi.init({fallbackLng:"en",lng:"en",debug:!0,resources:{en:{translation:{categorize:{limitMaxChoicesPerCategory:"You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",maxChoicesPerCategoryRestriction:"To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s]."},ebsr:{part:"Part {{index}}"},numberLine:{addElementLimit_one:"You can only add {{count}} element",addElementLimit_other:"You can only add {{count}} elements",clearAll:"Clear all"},imageClozeAssociation:{reachedLimit_one:"You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.",reachedLimit_other:"Full"},drawingResponse:{fillColor:"Fill color",outlineColor:"Outline color",noFill:"No fill",lightblue:"Light blue",lightyellow:"Light yellow",red:"Red",orange:"Orange",yellow:"Yellow",violet:"Violet",blue:"Blue",green:"Green",white:"White",black:"Black",onDoubleClick:"Double click to edit this text. Press Enter to submit."},charting:{addCategory:"Add category",actions:"Actions",add:"Add",delete:"Delete",newLabel:"New label",reachedLimit_other:"There can't be more than {{count}} categories.",keyLegend:{incorrectAnswer:"Student incorrect answer",correctAnswer:"Student correct answer",correctKeyAnswer:"Answer key correct"}},graphing:{point:"Point",circle:"Circle",line:"Line",parabola:"Parabola",absolute:"Absolute Value",exponential:"Exponential",polygon:"Polygon",ray:"Ray",segment:"Segment",sine:"Sine",vector:"Vector",label:"Label",redo:"Redo",reset:"Reset"},mathInline:{primaryCorrectWithAlternates:"Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct."},multipleChoice:{minSelections:"Select at least {{minSelections}}.",maxSelections_one:"Only {{maxSelections}} answer is allowed.",maxSelections_other:"Only {{maxSelections}} answers are allowed.",minmaxSelections_equal:"Select {{minSelections}}.",minmaxSelections_range:"Select between {{minSelections}} and {{maxSelections}}."},selectText:{correctAnswerSelected:"Correct",correctAnswerNotSelected:"Correct Answer Not Selected",incorrectSelection:"Incorrect Selection",key:"Key"}},common:{undo:"Undo",clearAll:"Clear all",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Show correct answer",hideCorrectAnswer:"Hide correct answer",commonCorrectAnswerWithAlternates:"Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.",warning:"Warning",showNote:"Show Note",hideNote:"Hide Note",cancel:"Cancel"}},es:{translation:{categorize:{limitMaxChoicesPerCategory:"Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",maxChoicesPerCategoryRestriction:"Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta"},ebsr:{part:"Parte {{index}}"},numberLine:{addElementLimit_one:"Solo puedes agregar {{count}} elemento",addElementLimit_other:"Solo puedes agregar {{count}} elementos",clearAll:"Borrar todo"},imageClozeAssociation:{reachedLimit_one:"Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.",reachedLimit_other:"Lleno"},drawingResponse:{fillColor:"Color de relleno",outlineColor:"Color del contorno",noFill:"Sin relleno",lightblue:"Azul claro",lightyellow:"Amarillo claro",red:"Rojo",orange:"Naranja",yellow:"Amarillo",violet:"Violeta",blue:"Azul",green:"Verde",white:"Blanco",black:"Negro",onDoubleClick:"Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar"},charting:{addCategory:"Añadir categoría",actions:"Acciones",add:"Añadir",delete:"Eliminar",newLabel:"Nueva etiqueta",reachedLimit_other:"No puede haber más de {{count}} categorías.",keyLegend:{incorrectAnswer:"Respuesta incorrecta del estudiante",correctAnswer:"Respuesta correcta del estudiante",correctKeyAnswer:"Clave de respuesta correcta"}},graphing:{point:"Punto",circle:"Circulo",line:"Línea",parabola:"Parábola",absolute:"Valor absoluto",exponential:"Exponencial",polygon:"Polígono",ray:"Semirrecta",segment:"Segmento ",sine:"Seno",vector:"Vector",label:"Etiqueta",redo:"Rehacer",reset:"Reiniciar"},mathInline:{primaryCorrectWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas."},multipleChoice:{minSelections:"Seleccione al menos {{minSelections}}.",maxSelections_one:"Sólo se permite {{maxSelections}} respuesta.",maxSelections_other:"Sólo se permiten {{maxSelections}} respuestas.",minmaxSelections_equal:"Seleccione {{minSelections}}.",minmaxSelections_range:"Seleccione entre {{minSelections}} y {{maxSelections}}."},selectText:{correctAnswerSelected:"Respuesta Correcta",correctAnswerNotSelected:"Respuesta Correcta No Seleccionada",incorrectSelection:"Selección Incorrecta",key:"Clave"}},common:{undo:"Deshacer",clearAll:"Borrar todo",correct:"Correct",incorrect:"Incorrect",showCorrectAnswer:"Mostrar respuesta correcta",hideCorrectAnswer:"Ocultar respuesta correcta",commonCorrectAnswerWithAlternates:"Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.",warning:"Advertencia",showNote:"Mostrar Nota",hideNote:"Ocultar Nota",cancel:"Cancelar"}}}});var gi={translator:{...hi,t:(e,t)=>{const{lng:n}=t;switch(n){case"en_US":case"en-US":t.lng="en";break;case"es_ES":case"es-ES":case"es_MX":case"es-MX":t.lng="es"}return hi.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const fi=t,{styled:Ci}=o,{Check:Fi}=a,{Close:Ai}=a,{color:Ei}=r,{translator:mi}=gi,yi=Ci("div")(({theme:e})=>({display:"flex",flexDirection:"row",alignItems:"center",gap:e.spacing(2),borderBottom:"1px solid lightgrey",borderTop:"1px solid lightgrey",paddingBottom:e.spacing(1),paddingTop:e.spacing(1),marginBottom:e.spacing(1)})),bi=Ci("span")(({theme:e})=>({fontSize:"14px",fontWeight:"bold",color:Ei.black(),marginLeft:e.spacing(1)})),vi=Ci("div")(()=>({position:"relative",padding:"4px",fontSize:"14px",borderRadius:"4px"})),Bi=Ci(vi)(()=>({border:`${Ei.correctTertiary()} solid 2px`})),xi=Ci(vi)(()=>({border:`${Ei.incorrectWithIcon()} solid 2px`})),Si=Ci(vi)(()=>({border:`${Ei.incorrectWithIcon()} dashed 2px`})),ki={color:Ei.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px"},wi=Ci(Fi)(()=>({...ki,backgroundColor:Ei.correctTertiary()})),_i=Ci(Ai)(()=>({...ki,backgroundColor:Ei.incorrectWithIcon()})),Oi=({language:e,showOnlyCorrect:t})=>{const n=[{Icon:wi,label:mi.t("selectText.correctAnswerSelected",{lng:e}),Container:Bi},{Icon:_i,label:mi.t("selectText.incorrectSelection",{lng:e}),Container:xi},{Icon:_i,label:mi.t("selectText.correctAnswerNotSelected",{lng:e}),Container:Si}];return t&&n.splice(1,2),fi.createElement(yi,null,fi.createElement(bi,null,mi.t("selectText.key",{lng:e})),n.map(({Icon:e,label:t,Container:n},u)=>fi.createElement(n,{key:u},fi.createElement(e,null),fi.createElement("span",null,t))))};var ji=function(e){var t=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=document.createElement("div");return t.innerHTML=e.trim(),t}(e),n=document.createElement("div");return n.innerHTML="<div separator='true'>".concat(t.innerHTML,"</div>"),t=n,0===Array.from(t.querySelectorAll("*")).length?e:function(e){var t=e.querySelectorAll("div[separator=true]"),n="";return t.forEach(function(e,u){var o;n+=(o=e,u===t.length-1?o.innerHTML:"".concat(o.innerHTML,"\n\n"))}),n||null}(t)},Ni=e=>{if(!e)return e;const t=ji(e.text||""),n=(e.tokens||[]).reduce((n,u={})=>{const o=ji((e.text||"").slice(u.start,u.end));if(!o)return[...n,u];const r=n[n.length-1],i=(e=>{let n=e;for(;n>=0;){let e=t.slice(n).indexOf(o);if(e>=0)return e+n;n--}return 0})(r?r.end:u.start),s=i+o.length;return[...n,{...u,text:o,start:i,end:s,oldStart:u.start,oldEnd:u.end}]},[]);return{...e,tokens:n,text:t}};const Li=t,Pi=n,Ri=c,{color:Ti}=r,{Feedback:$i}=r,{Collapsible:Mi}=r,{hasText:Ii}=r,{hasMedia:zi}=r,{PreviewPrompt:Wi}=r,{UiLayout:Vi}=r,{styled:Ui}=o,Hi=i("@pie-ui:select-text"),qi=Ui(Vi)({color:Ti.text(),backgroundColor:Ti.background()}),Ki=Ui(yr)(({theme:e})=>({marginBottom:e.spacing(1),marginTop:e.spacing(2),whiteSpace:"normal"})),Gi=Ui("div")(({theme:e})=>({verticalAlign:"middle",marginBottom:e.spacing(1)})),Yi=Ui(Mi)(({theme:e})=>({marginBottom:e.spacing(2)})),Ji={model:Pi.object,session:Pi.object,onSelectionChange:Pi.func.isRequired};class Qi extends Li.Component{static __initStatic(){this.propTypes=Ji}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),Qi.prototype.__init.call(this),Qi.prototype.__init2.call(this),this.state={showCorrectAnswer:this.props.model.alwaysShowCorrect||!1,model:Ni(e.model)}}UNSAFE_componentWillReceiveProps(e){this.setState({showCorrectAnswer:!!e.model.alwaysShowCorrect,model:Ni(e.model)})}__init(){this.toggleShowCorrect=()=>{this.setState({showCorrectAnswer:!this.state.showCorrectAnswer})}}__init2(){this.correctAnswer=()=>{const{model:e}=this.state;return e.tokens.filter(e=>e.correct)}}render(){const{session:e,onSelectionChange:t}=this.props,{showCorrectAnswer:n,model:u}=this.state,{env:o,extraCSSRules:r}=u,{mode:i}=o||{},s=n?this.correctAnswer():e.selectedTokens,a=u.rationale&&(Ii(u.rationale)||zi(u.rationale)),c=u.teacherInstructions&&(Ii(u.teacherInstructions)||zi(u.teacherInstructions));return Hi("[render] selectedTokens:",s),Li.createElement(qi,{extraCSSRules:r},c&&(u.animationsDisabled?Li.createElement(Gi,null,Li.createElement(Wi,{prompt:u.teacherInstructions})):Li.createElement(Yi,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},Li.createElement(Wi,{prompt:u.teacherInstructions}))),Li.createElement(Gi,null,Li.createElement(Wi,{prompt:u.prompt})),!u.alwaysShowCorrect&&Li.createElement(Ri,{show:u.disabled&&u.incorrect,toggled:n,onToggle:this.toggleShowCorrect,language:u.language}),Li.createElement(Ki,{disabled:u.disabled,text:u.text,tokens:u.tokens,selectedTokens:s,onChange:e=>{const n=e.map(e=>{const t=u.tokens.find(({start:t,end:n})=>e.start===t&&e.end===n);return t||e});t(n)},highlightChoices:u.highlightChoices,maxNoOfSelections:u.maxSelections,animationsDisabled:u.animationsDisabled}),"evaluate"===i&&Li.createElement(Oi,{language:u.language,showOnlyCorrect:n}),a&&(u.animationsDisabled?Li.createElement(Gi,null,Li.createElement(Wi,{prompt:u.rationale})):Li.createElement(Yi,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"}},Li.createElement(Wi,{prompt:u.rationale}))),u.correctness&&u.feedback&&!n&&Li.createElement($i,{correctness:u.correctness,feedback:u.feedback}))}}Qi.__initStatic(),Qi.__initStatic2();class Xi extends Li.Component{static __initStatic3(){this.propTypes=Ji}constructor(e){super(e),Xi.prototype.__init3.call(this),this.state={model:e.model,session:e.session}}UNSAFE_componentWillReceiveProps(e){this.setState({model:e.model,session:e.session})}__init3(){this.change=e=>{const t={...this.state.session,selectedTokens:e};this.setState({session:t},()=>{this.props.onSelectionChange(this.state.session.selectedTokens)})}}render(){const{model:e,session:t}=this.state;return Li.createElement(Qi,{model:e,session:t,onSelectionChange:this.change})}}Xi.__initStatic3();const Zi=t,{renderMath:es}=l;class ts extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this.render(),this.dispatchEvent(new g(this.tagName.toLowerCase(),this.isSessionComplete(),void 0!==this._model))}set session(e){if(this._session=e,this._model){const t=Ni(this._model)||{},{tokens:n}=t;let{selectedTokens:u}=e||{};u=u||[];const o=e=>n.find(({start:t,end:n})=>e.start===t&&e.end===n);if(!u.reduce((e,t)=>e&&o(t),!0)){const e=Ni({...this._model,tokens:u})||{},{tokens:t}=e;t&&(this._session.selectedTokens=t)}}Array.isArray(this._session.selectedTokens)||(this._session.selectedTokens=[]),this.render()}get session(){return this._session}isSessionComplete(){const{selectedTokens:e}=this._session||{};return Array.isArray(e)&&e.length>0}selectionChanged(e){this._session.selectedTokens=e,this.dispatchEvent(new C(this.tagName.toLowerCase(),this.isSessionComplete()))}connectedCallback(){this.render()}render(){if(this._model&&this._session){const e=Zi.createElement(Xi,{model:this._model,session:this._session,onSelectionChange:this.selectionChanged.bind(this)});this._root||(this._root=p(this)),this._root.render(e),queueMicrotask(()=>{es(this)})}}disconnectedCallback(){this._root&&this._root.unmount()}}export{ts as default};
|