@pie-element/select-text 11.3.4-next.3 → 12.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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>&#8220;Lucy? Are you using your time wisely to plan your project?&#8221; Mr. Wilson asked.</p><p>&nbsp;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&#160;&#34;The Gymnast&#34; 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&#39;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&#8211;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&#8211;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 as e,_dll_prop_types as t,_dll_material_ui__core as n,_dll_material_ui__core_styles as u,_dll_pie_lib__render_ui as r,_dll_classnames as o,_dll_lodash as i,_dll_debug as s,_dll_material_ui__icons as a,_dll_react_dom_server as c,_dll_pie_lib__correct_answer_toggle as l,_dll_react_dom as p}from"../../../@pie-lib/shared-module@^1.17.5/module/index.js";import{_dll_pie_lib__math_rendering as D}from"../../../@pie-lib/math-rendering-module@^3.1.5/module/index.js";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 f=d.ModelSetEvent=h;class g extends CustomEvent{constructor(e,t){super(g.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}g.TYPE="session-changed";var C=d.SessionChangedEvent=g;const F=e,m=t,{Button:E}=n,{Switch:y}=n,{FormControlLabel:v}=n,{withStyles:A}=u,{color:b}=r,B=o;class k extends F.Component{static __initStatic(){this.propTypes={classes:m.object.isRequired,onClear:m.func.isRequired,onWords:m.func.isRequired,onSentences:m.func.isRequired,onParagraphs:m.func.isRequired,setCorrectMode:m.bool.isRequired,onToggleCorrectMode:m.func.isRequired}}static __initStatic2(){this.defaultProps={}}render(){const{classes:e,onClear:t,onWords:n,onSentences:u,onParagraphs:r,setCorrectMode:o,onToggleCorrectMode:i}=this.props;return F.createElement("div",{className:e.controls},F.createElement("div",null,F.createElement(E,{onClick:n,className:e.button,size:"small",color:"primary",disabled:o},"Words"),F.createElement(E,{onClick:u,className:e.button,size:"small",color:"primary",disabled:o},"Sentences"),F.createElement(E,{onClick:r,className:e.button,size:"small",color:"primary",disabled:o},"Paragraphs"),F.createElement(E,{className:e.button,size:"small",color:"secondary",onClick:t,disabled:o},"Clear")),F.createElement(v,{control:F.createElement(y,{classes:{checked:e.checkedThumb,bar:B({[e.checkedBar]:o})},checked:o,onChange:i}),label:"Set correct answers"}))}}k.__initStatic(),k.__initStatic2();var S=A((e=>({button:{marginRight:e.spacing.unit},controls:{display:"flex",alignItems:"center",justifyContent:"space-between"},checkedThumb:{color:`${b.tertiary()} !important`},checkedBar:{backgroundColor:`${b.tertiaryLight()} !important`}})))(k),x=function e(t,n){var u,r,o,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(o="length"in t?t:t.children,1===(r=o.length)&&"value"in o[0])return o[0].value;u=[];for(;r--;)u[r]=e(o[r],i);return u.join(i)};var w=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 O=function(e,t,n){var u,r=-1;if(!e)throw new Error("Iterate requires that |this| not be "+e);if(!N.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(;++r<e.length;)r in e&&"number"==typeof(u=t.call(n,e[r],r,e))&&(u<0&&(r=0),r=u-1)},N={}.hasOwnProperty;var P=O,R=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 P(n,e,t)}}(function(e){return t;function t(t,n){return e(t,n,this)}}(e))};var _=x;var j=function(e,t){return function(n){var u,r,o,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(_(s[l])))&&(u=s[D],r=s[l],o={type:a,children:s.slice(D,l+1)},u.position&&r.position&&(o.position={start:u.position.start,end:r.position.end}),i.push(o),D=l+1);return i}},L=function(e){var t=e.type,n=e.tokenizer,u=e.delimiter,r=u&&j(e.delimiterType,u);return function(e){var u=this[n](e);return{type:t,children:r?r(u):u}}};var T={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]/},I=O,M=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`");I(n,e,t)}}(function(e){return t;function t(t,n){return e(t,n,this)}}(e))};var W=x,z=M((function(e,t,n){var u,r;if("SymbolNode"!==e.type&&"PunctuationNode"!==e.type||"&"!==W(e))return;if(u=n.children,r=u[t+1],0!==t&&"WordNode"===u[t-1].type||!(r&&"WordNode"===r.type))return;u.splice(t,1),r.children.unshift(e),r.position&&e.position&&(r.position.start=e.position.start);return t-1}));var H=x,q=M((function(e,t,n){var u,r,o;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"-"===H(e)&&(u=n.children,r=u[t-1],(!(o=u[t+1])||"WordNode"!==o.type)&&r&&"WordNode"===r.type))return u.splice(t,1),r.children.push(e),r.position&&e.position&&(r.position.end=e.position.end),t}));var V=x,U=T,K=M((function(e,t,n){var u,r,o,i,s,a,c;if(0!==t&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&(u=n.children,(o=u[t-1])&&"WordNode"===o.type)){for(s=t-1,a=[],c=[];u[++s];)if("WordNode"===(r=u[s]).type)a=a.concat(c,r.children),c=[];else{if("SymbolNode"!==r.type&&"PunctuationNode"!==r.type||!$.test(V(r)))break;c.push(r)}if(0!==a.length)return 0!==c.length&&(s-=c.length),u.splice(t,s-t),o.children=o.children.concat(a),i=a[a.length-1],o.position&&i.position&&(o.position.end=i.position.end),t}})),$=U.wordSymbolInner;var J=x,Y=M((function(e,t,n){var u,r,o,i,s,a,c,l=n.children;if(u=l[t-1],r=l[t+1],u&&"WordNode"===u.type&&("SymbolNode"===e.type||"PunctuationNode"===e.type)&&"/"===J(e)&&(o=J(u),a=e,s=[e],c=1,r&&"WordNode"===r.type&&(i=J(r),a=r,s=s.concat(r.children),c++),o.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}));var G=x,Q=T,X=M((function(e,t,n){var u,r,o,i,s,a,c,l;if(0!==t&&"."===G(e)&&(u=n.children,r=u[t-1],o=r.children,i=o&&o.length,"WordNode"===r.type&&1!==i&&i%2!=0)){for(s=i,c=!0;o[--s];)if(a=o[s],l=G(a),s%2==0){if(l.length>1)return;Z.test(l)||(c=!1)}else if("."!==l){if(s<i-2)break;return}if(!c)return u.splice(t,1),o.push(e),r.position&&e.position&&(r.position.end=e.position.end),t}})),Z=Q.numerical;var ee=M((function(e,t,n){var u,r=n.children;if("WordNode"===e.type&&(u=r[t+1])&&"WordNode"===u.type)return r.splice(t+1,1),e.children=e.children.concat(u.children),u.position&&e.position&&(e.position.end=u.position.end),t}));var te=w((function(e,t,n){var u=n.children;if(!e.position)return;0!==t||n.position&&n.position.start||(ne(n),n.position.start=e.position.start);t!==u.length-1||n.position&&n.position.end||(ne(n),n.position.end=e.position.end)}));function ne(e){e.position||(e.position={})}var ue=M((function(e,t,n){var u,r,o=e.children,i=-1;for(;o[++i];)if("WordNode"===o[i].type)return;if(u=n.children[t-1])return u.children=u.children.concat(o),n.children.splice(t,1),u.position&&e.position&&(u.position.end=e.position.end),t;(r=n.children[t+1])&&(r.children=o.concat(r.children),r.position&&e.position&&(r.position.start=e.position.start),n.children.splice(t,1))}));var re=x,oe=T,ie=M((function(e,t,n){var u,r,o,i=e.children;if(i&&0!==i.length&&0!==t&&(u=i[0],r=i[1],o=n.children[t-1],("SymbolNode"===u.type||"PunctuationNode"===u.type)&&se.test(re(u))))return o.children.push(i.shift()),u.position&&o.position&&(o.position.end=u.position.end),r&&r.position&&e.position&&(e.position.start=r.position.start),t-1})),se=oe.affixSymbol;var ae=x,ce=T,le=M((function(e,t,n){var u,r,o,i,s=e.children;if(s&&0!==s.length&&0!==t)for(u=-1;s[++u];){if("WordNode"===(r=s[u]).type){if(!pe.test(ae(r)))return;return o=n.children,(i=o[t-1]).children=i.children.concat(s),o.splice(t,1),i.position&&e.position&&(i.position.end=e.position.end),t}if("SymbolNode"===r.type||"PunctuationNode"===r.type)return}})),pe=ce.lowerInitial;var De=x,de=T,he=M((function(e,t,n){var u=e.children,r=n.children,o=r[t-1],i=u[0];if(o&&i&&"WordNode"===i.type&&fe.test(De(i)))return o.children=o.children.concat(u),r.splice(t,1),o.position&&e.position&&(o.position.end=e.position.end),t})),fe=de.digitStart;var ge=x,Ce=M((function(e,t,n){var u,r,o,i=e.children;if(i&&i.length>1&&(u=i[i.length-1])&&"."===ge(u)&&(r=i[i.length-2])&&"WordNode"===r.type&&Fe.test(ge(r).toLowerCase())&&(r.children.push(u),i.pop(),u.position&&r.position&&(r.position.end=u.position.end),o=n.children[t+1]))return e.children=i.concat(o.children),n.children.splice(t+1,1),o.position&&e.position&&(e.position.end=o.position.end),t-1})),Fe=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 me=x,Ee=M((function(e,t,n){var u,r,o,i,s=e.children;if(!s||0===s.length||0===t)return;r=-1;for(;s[++r];){if("WordNode"===(u=s[r]).type)return;if("SymbolNode"===u.type||"PunctuationNode"===u.type){if(","!==(o=me(u))&&";"!==o)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 ye=x,ve=T,Ae=w((function(e){var t,n,u,r,o=e.children,i=o.length,s=!1;for(;o[--i];)if("SymbolNode"===(t=o[i]).type||"PunctuationNode"===t.type){if(be.test(ye(t)))if(s){if("."===ye(t))if(n=o[i-1],u=o[i+1],n&&"WordNode"===n.type){if(r=o[i+2],u&&r&&"WhiteSpaceNode"===u.type&&"."===ye(r))continue;o.splice(i,1),n.children.push(t),t.position&&n.position&&(n.position.end=t.position.end),i--}else u&&"WordNode"===u.type&&(o.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)})),be=ve.terminalMarker;var Be=w((function(e,t,n){var u,r=e.children;r&&0!==r.length&&"WhiteSpaceNode"===r[0].type&&(n.children.splice(t,0,r.shift()),(u=r[0])&&u.position&&e.position&&(e.position.start=u.position.start))}));var ke=M((function(e,t,n){var u,r=e.children;if(r&&0!==r.length&&"WhiteSpaceNode"===r[r.length-1].type)return n.children.splice(t+1,0,e.children.pop()),(u=r[r.length-1])&&u.position&&e.position&&(e.position.end=u.position.end),t}));var Se=x,xe=T,we=M((function(e,t,n){var u,r,o,i,s,a,c,l;if("SentenceNode"!==e.type)return;u=e.children,o=u.length-1,r=0;for(;++r<o;)if("WhiteSpaceNode"===(l=u[r]).type&&Oe.test(Se(l)))return e.children=u.slice(0,r),c={type:"SentenceNode",children:u.slice(r+1)},i=u[r-1],s=u[r+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})),Oe=xe.newLineMulti;var Ne=M((function(e,t,n){if("children"in e&&0===e.children.length)return n.children.splice(t,1),t}));var Pe=L,Re=T,_e=je;function je(e,t){var n=t||e;if(!(this instanceof je))return new je(e,t);this.doc=n?String(n):null}var Le=je.prototype;function Te(e){return e+="Node",function(t,n,u){null==t&&(t="");return(n||Ue)(t)({type:e,value:String(t)},u)}}function Ie(e,t,n){e.prototype[t]=function(){return this.run(t,n.apply(this,arguments))}}function Me(e){return function(t,n){var u,r=this;if(!(t in r))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();r[u]||(r[u]=[]);e(r,u,n)}}Le.position=!0,Le.tokenizeSymbol=Te("Symbol"),Le.tokenizeWhiteSpace=Te("WhiteSpace"),Le.tokenizePunctuation=Te("Punctuation"),Le.tokenizeSource=Te("Source"),Le.tokenizeText=Te("Text"),Le.run=function(e,t){var n=this[e+"Plugins"],u=-1;if(n)for(;n[++u];)n[u](t);return t},Le.use=Me((function(e,t,n){e[t]=e[t].concat(n)})),Le.useFirst=Me((function(e,t,n){e[t]=n.concat(e[t])})),Le.parse=function(e){return this.tokenizeRoot(e||this.doc)},Le.tokenize=function(e){return function(e,t){var n,u,r,o,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,r=1,o=1,d=e.position?f:g,s=t.length,l="",c="";for(;i<s;)a=t.charAt(i),D=qe.test(a)?"WhiteSpace":He.test(a)?"Punctuation":We.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&&!ze.test(a)?(c&&e["tokenize"+p](c,d),c=a):c+=a}function f(e){var t=F();return m(e),n;function n(){return t(C.apply(null,arguments))}}function g(){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=y();function t(t){return t.position=new E(e),t}return t}function m(e){var t=e.length,n=-1,i=-1;for(u+=t;++n<t;)"\n"===e.charAt(n)&&(i=n,r++);-1===i?o+=t:o=t-i}function E(e){this.start=e,this.end=y()}function y(){return{line:r,column:o,offset:u}}}(this,e)},Ie(je,"tokenizeWord",(function(e,t){var n=(t||Ue)(""),u={type:"WordNode",children:[]};return this.tokenizeText(e,t,u),n(u)})),Ie(je,"tokenizeSentence",Pe({type:"SentenceNode",tokenizer:"tokenize"})),Ie(je,"tokenizeParagraph",Pe({type:"ParagraphNode",delimiter:Re.terminalMarker,delimiterType:"PunctuationNode",tokenizer:"tokenizeSentence"})),Ie(je,"tokenizeRoot",Pe({type:"RootNode",delimiter:Re.newLine,delimiterType:"WhiteSpaceNode",tokenizer:"tokenizeParagraph"})),Le.use("tokenizeSentence",[z,q,K,Y,X,ee,te]),Le.use("tokenizeParagraph",[ue,ie,le,he,Ce,Ee,Ae,Be,ke,we,Ne,te]),Le.use("tokenizeRoot",[Be,ke,Ne,te]);var We=Re.word,ze=Re.surrogates,He=Re.punctuation,qe=Re.whiteSpace;function Ve(e,t){return t&&t.children.push(e),e}function Ue(){return Ve}var Ke=x,$e=w,Je=R,Ye=_e,Ge=ue,Qe=ie,Xe=le,Ze=he,et=Ee,tt=Ae,nt=Be,ut=ke,rt=we,ot=Ne,it=te,st=ct;lt.prototype=Ye.prototype;var at=new lt;function ct(e,t){if(!(this instanceof ct))return new ct(e,t);Ye.apply(this,arguments)}function lt(){}ct.prototype=at,at.tokenizeSentencePlugins=[$e((function(e,t,n){var u,r,o,i,s;if("PunctuationNode"!==e.type&&"SymbolNode"!==e.type)return;if(u=n.children,i=u.length,"/"===(s=Ke(e)))(r=u[t-1])&&"w"===gt(Ke(r))&&(u.splice(t,1),r.children.push(e),r.position&&e.position&&(r.position.end=e.position.end));else if(ft.test(s)){if(r=u[t-1],t>2&&t<i-1&&"WordNode"===r.type&&"WhiteSpaceNode"===u[t-2].type&&"WhiteSpaceNode"===u[t+1].type&&dt.test(gt(Ke(r))))return u.splice(t,1),r.children.push(e),void(r.position&&e.position&&(r.position.end=e.position.end));t===i-1||"WordNode"!==u[t+1].type||0!==t&&"WordNode"===u[t-1].type||(r=u[t+1],s=gt(Ke(r)),ht.test(s)?(u.splice(t,1),r.children=[e].concat(r.children),r.position&&e.position&&(r.position.start=e.position.start)):"n"===s&&t<i-2&&ft.test(Ke(u[t+2]))&&(o=u[t+2],u.splice(t,1),u.splice(t+1,1),r.children=[e].concat(r.children,o),r.position&&(e.position&&(r.position.start=e.position.start),o.position&&(r.position.end=o.position.end))))}}))].concat(at.tokenizeSentencePlugins),at.tokenizeParagraphPlugins=[Je((function(e,t,n){var u,r,o=e.children,i=o[o.length-1],s=o[o.length-2];if(i&&"."===Ke(i)&&s&&"WordNode"===s.type&&(u=Ke(s),(pt.test(gt(u))||Dt.test(u))&&(s.children.push(i),o.pop(),i.position&&s.position&&(s.position.end=i.position.end),r=n.children[t+1])))return e.children=o.concat(r.children),n.children.splice(t+1,1),r.position&&e.position&&(e.position.end=r.position.end),t-1}))].concat([Ge,Qe,Xe,Ze,et,tt,nt,ut,rt,ot,it]);var pt=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)$"),Dt=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)$"),dt=new RegExp("^(o|ol)$"),ht=new RegExp("^(im|er|em|cause|twas|tis|twere|\\d\\ds?)$"),ft=/^['\u2019]$/;function gt(e){return e.toLowerCase()}const{compact:Ct}=i,{clone:Ft}=i,mt=(e,t)=>t.children?t.children.reduce(mt,e):t.value?e+t.value:e,Et=e=>mt("",e),yt=e=>(new st).parse(e).children.reduce(((e,t)=>{if("ParagraphNode"===t.type){const u={text:(n=t,mt("",n)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([u])}return e;var n}),[]),vt=e=>(new st).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],r={text:n.map((e=>Et(e))).join(""),start:u.position.start.offset,end:t.position.start.offset};return n.splice(0,n.length),e.concat([r])}}else n.push(t);return e}),t);if(n.length){const e=n[0],t=n[n.length-1],r={text:n.map((e=>Et(e))).join(""),start:e.position.start.offset,end:t.position.end.offset};u=u.concat([r]),n.splice(0,n.length)}return u})(t,e);return n||e}return e}),e):e),[]),At=e=>(new st).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,mt("",n)),start:t.position.start.offset,end:t.position.end.offset};return e.concat([u])}return e;var n}),e):e),e):e),[]);class bt{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 Bt=(e,t)=>{const{start:n,end:u}=e,r=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 bt(Ct(r))},kt=(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=Ft(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,r)=>{let o=[];const i=e.lastIndex;if(t.start===i?o=[{text:n.substring(i,t.end),start:i,end:t.end,predefined:!0,correct:t.correct,isMissing:t.isMissing}]:i<t.start&&(o=[{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===r.length-1&&t.end<n.length){const e={text:n.substring(t.end),start:t.end,end:n.length};o.push(e)}return{lastIndex:o.length?o[o.length-1].end:i,result:e.result.concat(o)}}),{result:[],lastIndex:0});return u.result},St=()=>{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()},xt=e,wt=t,{withStyles:Ot}=u,{colors:{yellow:Nt}}=n,{colors:{green:Pt}}=n,Rt=o,_t=s("@pie-lib:text-select:token-text"),jt=Ot((()=>({predefined:{cursor:"pointer",backgroundColor:Nt[100],border:`dashed 0px ${Nt[700]}`,"& *":{cursor:"pointer",backgroundColor:Nt[100],border:`dashed 0px ${Nt[700]}`}},correct:{backgroundColor:Pt[500],"& *":{backgroundColor:Pt[500]}}})))((({text:e,predefined:t,classes:n,onClick:u,correct:r})=>{const o=(e||"").replace(/\n/g,"<br>");if(t){const e=Rt(n.predefined,r&&n.correct);return xt.createElement("span",{onClick:u,className:e,dangerouslySetInnerHTML:{__html:o}})}return xt.createElement("span",{dangerouslySetInnerHTML:{__html:o}})})),Lt=["\n"," ","\t"];class Tt extends xt.Component{constructor(...e){super(...e),Tt.prototype.__init.call(this)}static __initStatic(){this.propTypes={text:wt.string.isRequired,tokens:wt.array.isRequired,onTokenClick:wt.func.isRequired,onSelectToken:wt.func.isRequired,className:wt.string}}__init(){this.onClick=e=>{const{onSelectToken:t,text:n,tokens:u}=this.props;if(e.preventDefault(),"undefined"==typeof window)return;const r=window.getSelection().toString();if(r.length>0&&Lt.indexOf(r)<0&&this.root){let e=(e=>{var t,n=0,u=e.ownerDocument||e.document,r=u.defaultView||u.parentWindow;if(void 0!==r.getSelection){if((t=r.getSelection()).rangeCount>0){var o=r.getSelection().getRangeAt(0),i=o.toString().length,s=o.cloneRange();s.selectNodeContents(e),s.setEnd(o.endContainer,o.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(r),void 0!==e){const o=e+r.length;if(o<=n.length){const n=Bt({start:e,end:o},u);if(n.hasOverlap)_t("hasOverlap - do nothing"),St();else{t({text:r,start:e,end:o},n.surroundedTokens),St()}}}}}}render(){const{text:e,tokens:t,className:n,onTokenClick:u}=this.props,r=kt(e,t);return xt.createElement("div",{className:n,ref:e=>this.root=e,onClick:this.onClick},r.map(((e,t)=>xt.createElement(jt,{key:t,...e,onClick:()=>u(e)}))))}}Tt.__initStatic();const It=e,Mt=t,{withStyles:Wt}=u,{clone:zt}=i,{isEqual:Ht}=i,{differenceWith:qt}=i,Vt=o;class Ut extends It.Component{static __initStatic(){this.propTypes={text:Mt.string.isRequired,tokens:Mt.arrayOf(Mt.shape({text:Mt.string,correct:Mt.bool,start:Mt.number,end:Mt.number})),classes:Mt.object.isRequired,className:Mt.string,onChange:Mt.func.isRequired}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),Ut.prototype.__init.call(this),Ut.prototype.__init2.call(this),Ut.prototype.__init3.call(this),Ut.prototype.__init4.call(this),Ut.prototype.__init5.call(this),Ut.prototype.__init6.call(this),Ut.prototype.__init7.call(this),Ut.prototype.__init8.call(this),Ut.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=qt(zt(n),t,Ht);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=zt(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=zt(t);e.splice(n,1),this.onChangeHandler(e,this.state.mode)}}}render(){const{text:e,tokens:t,classes:n,className:u}=this.props,{setCorrectMode:r}=this.state,o=Vt(n.text,r&&n.noselect),i=Vt(n.tokenizer,u);return It.createElement("div",{className:i},It.createElement(S,{onClear:this.clear,onWords:()=>this.buildTokens("words",At),onSentences:()=>this.buildTokens("sentence",vt),onParagraphs:()=>this.buildTokens("paragraphs",yt),setCorrectMode:r,onToggleCorrectMode:this.toggleCorrectMode}),It.createElement(Tt,{className:o,text:e,tokens:t,onTokenClick:this.tokenClick,onSelectToken:this.selectToken}))}}Ut.__initStatic(),Ut.__initStatic2(),Wt((()=>({text:{whiteSpace:"pre-wrap"},noselect:{cursor:"default","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none"}})))(Ut);const Kt=e,$t=t,{withStyles:Jt}=u,Yt=o,{Check:Gt}=a,{Close:Qt}=a,{color:Xt}=r,Zt=({useWrapper:e,children:t,classNameContainer:n,iconClass:u,Icon:r})=>e?Kt.createElement("span",{className:n},t,Kt.createElement(r,{className:u})):t;Zt.propTypes={useWrapper:$t.bool,classNameContainer:$t.string,iconClass:$t.string,Icon:$t.func,children:$t.element};const en={text:$t.string,selectable:$t.bool};class tn extends Kt.Component{constructor(...e){super(...e),tn.prototype.__init.call(this)}static __initStatic(){this.rootClassName="tokenRootClass"}static __initStatic2(){this.propTypes={...en,classes:$t.object.isRequired,text:$t.string.isRequired,className:$t.string,disabled:$t.bool,highlight:$t.bool,correct:$t.bool}}static __initStatic3(){this.defaultProps={selectable:!1,text:""}}__init(){this.getClassAndIconConfig=()=>{const{selectable:e,selected:t,classes:n,className:u,disabled:r,highlight:o,correct:i,animationsDisabled:s,isMissing:a}=this.props,c="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,l=tn.rootClassName;if(void 0===i&&t&&r)return{className:Yt(n.token,n.selected,n.disabledBlack)};if(void 0!==i){const e=!0===i;return{className:Yt(l,n.custom),classNameContainer:Yt(e?n.correct:n.incorrect,n.commonTokenStyle),Icon:e?Gt:Qt,iconClass:Yt(n.correctnessIndicatorIcon,e?n.correctIcon:n.incorrectIcon)}}return a?{className:Yt(l,n.custom,n.missing,n.commonTokenStyle),classNameContainer:n.commonTokenStyle,Icon:Qt,iconClass:Yt(n.correctnessIndicatorIcon,n.incorrectIcon)}:{className:Yt(l,n.token,r&&n.disabled,e&&!r&&!c&&n.selectable,t&&!r&&n.selected,t&&r&&n.disabledAndSelected,o&&e&&!r&&!t&&n.highlight,s&&n.print,u),classNameContainer:undefined,Icon:undefined,iconClass:undefined}}}render(){const{text:e,index:t,correct:n,isMissing:u}=this.props,{className:r,classNameContainer:o,Icon:i,iconClass:s}=this.getClassAndIconConfig();return Kt.createElement(Zt,{useWrapper:void 0!==n||u,classNameContainer:o,iconClass:s,Icon:i},Kt.createElement("span",{className:r,dangerouslySetInnerHTML:{__html:(e||"").replace(/\n/g,"<br>")},"data-indexkey":t}))}}tn.__initStatic(),tn.__initStatic2(),tn.__initStatic3();var nn=Jt((e=>({token:{cursor:"pointer",textIndent:0},disabled:{cursor:"inherit",color:Xt.disabled()},disabledBlack:{cursor:"inherit"},disabledAndSelected:{backgroundColor:Xt.blueGrey100()},selectable:{[e.breakpoints.up(769)]:{"&:hover":{backgroundColor:Xt.blueGrey300(),color:e.palette.common.black,"& > *":{backgroundColor:Xt.blueGrey300()}}}},selected:{backgroundColor:Xt.blueGrey100(),color:e.palette.common.black,lineHeight:3.2*e.spacing.unit+"px",border:`solid 2px ${Xt.blueGrey900()}`,borderRadius:"4px","& > *":{backgroundColor:Xt.blueGrey100()}},highlight:{border:`dashed 2px ${Xt.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*e.spacing.unit+"px"},print:{border:`dashed 2px ${Xt.blueGrey600()}`,borderRadius:"4px",lineHeight:3.2*e.spacing.unit+"px",color:Xt.text()},custom:{display:"initial"},commonTokenStyle:{position:"relative",borderRadius:"4px",color:e.palette.common.black,lineHeight:3.4*e.spacing.unit+2+"px",padding:"2px"},correct:{border:`${Xt.correctTertiary()} solid 2px`},incorrect:{border:`${Xt.incorrectWithIcon()} solid 2px`},missing:{border:`${Xt.incorrectWithIcon()} dashed 2px`},incorrectIcon:{backgroundColor:Xt.incorrectWithIcon()},correctIcon:{backgroundColor:Xt.correctTertiary()},correctnessIndicatorIcon:{color:Xt.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px"}})))(tn);const un=e,rn=t,{withStyles:on}=u,sn=o,{clone:an}=i,{isEqual:cn}=i,ln=s,{renderToString:pn}=c,Dn=ln("@pie-lib:text-select:token-select");class dn extends un.Component{constructor(...e){super(...e),dn.prototype.__init.call(this),dn.prototype.__init2.call(this),dn.prototype.__init3.call(this),dn.prototype.__init4.call(this)}static __initStatic(){this.propTypes={tokens:rn.arrayOf(rn.shape(en)).isRequired,className:rn.string,classes:rn.object.isRequired,onChange:rn.func.isRequired,disabled:rn.bool,highlightChoices:rn.bool,animationsDisabled:rn.bool,maxNoOfSelections:rn.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||(Dn("[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,r=an(n),o=t.closest(`.${nn.rootClassName}`),i=o&&o.dataset&&o.dataset.indexkey,s=i&&r[i];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)),u=r.map((e=>cn(e,t[0])?{...e,selected:!1}:{...e,selectable:!0})),o={...s,selected:!s.selected};u.splice(i,1,o),e(u)}else{if(u&&t>0&&this.selectedCount()>=t)return void Dn("skip toggle max reached");const n={...s,selected:!s.selected};r.splice(i,1,n),e(r)}}}}__init4(){this.generateTokensInHtml=()=>{const{tokens:e,disabled:t,highlightChoices:n,animationsDisabled:u}=this.props,r=this.selectedCount();return(e||[]).reduce(((e,o,i)=>{const s=o.selected||o.selectable&&this.canSelectMore(r),a=void 0!==o.correct&&(o.selectable||o.selected);let c=e;return"\n\n"===o.text?c+"</p><p>":(e=>"\n"===e)(o.text)?c+"<br>":s&&!t||a||o.selected||o.isMissing||u&&o.predefined?c+pn(un.createElement(nn,{key:i,disabled:t,index:i,...o,selectable:s,highlight:n,animationsDisabled:u})):e+o.text}),"<p>")+"</p>"}}render(){const{classes:e,className:t}=this.props,n=sn(e.tokenSelect,t),u=this.generateTokensInHtml();return un.createElement("div",{className:n,dangerouslySetInnerHTML:{__html:u},onClick:this.toggleToken})}}dn.__initStatic(),dn.__initStatic2();var hn=on((()=>({tokenSelect:{backgroundColor:"none",whiteSpace:"pre",cursor:"default","-webkit-user-select":"none","-moz-user-select":"none","-ms-user-select":"none","user-select":"none","& p":{whiteSpace:"break-spaces"}}})))(dn);const fn=e,gn=t,Cn=s("@pie-lib:text-select");class Fn extends fn.Component{constructor(...e){super(...e),Fn.prototype.__init.call(this)}static __initStatic(){this.propTypes={onChange:gn.func,disabled:gn.bool,tokens:gn.arrayOf(gn.shape(en)).isRequired,selectedTokens:gn.arrayOf(gn.shape(en)).isRequired,text:gn.string.isRequired,className:gn.string,highlightChoices:gn.bool,animationsDisabled:gn.bool,maxNoOfSelections:gn.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:r,highlightChoices:o,maxNoOfSelections:i,animationsDisabled:s}=this.props,a=kt(e,n);Cn("normalized: ",a);const c=a.map((e=>{const n=-1!==u.findIndex((t=>t.start===e.start&&t.end===e.end)),r=n?e.correct:void 0,o=e.isMissing;return{...e,selectable:!t&&e.predefined,selected:n,correct:r,isMissing:o}}));return fn.createElement(hn,{highlightChoices:!t&&o,className:r,tokens:c,disabled:t,onChange:this.change,maxNoOfSelections:i,animationsDisabled:s})}}function mn(e){return mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mn(e)}function En(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yn(e){var t=function(e,t){if("object"!==mn(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var u=n.call(e,t||"default");if("object"!==mn(u))return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===mn(t)?t:String(t)}function vn(e,t){for(var n=0;n<t.length;n++){var u=t[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,yn(u.key),u)}}function An(e,t,n){return t&&vn(e.prototype,t),n&&vn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function bn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Bn(e,t){return Bn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Bn(e,t)}function kn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Bn(e,t)}function Sn(e,t){if(t&&("object"===mn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return bn(e)}function xn(e){return xn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xn(e)}function wn(e,t,n){return(t=yn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function On(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,u=new Array(t);n<t;n++)u[n]=e[n];return u}function Nn(e){return function(e){if(Array.isArray(e))return e}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return On(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?On(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Pn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function Rn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pn(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}Fn.__initStatic();var _n={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},jn=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};En(this,e),this.init(t,n)}return An(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||_n,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,u){return u&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,Rn(Rn({},{prefix:"".concat(this.prefix,":").concat(t,":")}),this.options))}},{key:"clone",value:function(t){return(t=t||this.options).prefix=t.prefix||this.prefix,new e(this.logger,t)}}]),e}()),Ln=function(){function e(){En(this,e),this.observers={}}return An(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),u=1;u<t;u++)n[u-1]=arguments[u];if(this.observers[e]){var r=[].concat(this.observers[e]);r.forEach((function(e){e.apply(void 0,n)}))}if(this.observers["*"]){var o=[].concat(this.observers["*"]);o.forEach((function(t){t.apply(t,[e].concat(n))}))}}}]),e}();function Tn(){var e,t,n=new Promise((function(n,u){e=n,t=u}));return n.resolve=e,n.reject=t,n}function In(e){return null==e?"":""+e}function Mn(e,t,n){e.forEach((function(e){t[e]&&(n[e]=t[e])}))}function Wn(e,t,n){function u(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function r(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(r())return{};var i=u(o.shift());!e[i]&&n&&(e[i]=new n),e=Object.prototype.hasOwnProperty.call(e,i)?e[i]:{}}return r()?{}:{obj:e,k:u(o.shift())}}function zn(e,t,n){var u=Wn(e,t,Object);u.obj[u.k]=n}function Hn(e,t){var n=Wn(e,t),u=n.obj,r=n.k;if(u)return u[r]}function qn(e,t,n){var u=Hn(e,n);return void 0!==u?u:Hn(t,n)}function Vn(e,t,n){for(var u in t)"__proto__"!==u&&"constructor"!==u&&(u in e?"string"==typeof e[u]||e[u]instanceof String||"string"==typeof t[u]||t[u]instanceof String?n&&(e[u]=t[u]):Vn(e[u],t[u],n):e[u]=t[u]);return e}function Un(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var Kn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function $n(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return Kn[e]})):e}var Jn="undefined"!=typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,Yn=[" ",",","?","!",";"];function Gn(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(e){if(e[t])return e[t];for(var u=t.split(n),r=e,o=0;o<u.length;++o){if(!r)return;if("string"==typeof r[u[o]]&&o+1<u.length)return;if(void 0===r[u[o]]){for(var i=2,s=u.slice(o,o+i).join(n),a=r[s];void 0===a&&u.length>o+i;)i++,a=r[s=u.slice(o,o+i).join(n)];if(void 0===a)return;if(null===a)return null;if(t.endsWith(s)){if("string"==typeof a)return a;if(s&&"string"==typeof a[s])return a[s]}var c=u.slice(o+i).join(n);return c?Gn(a,c,n):void 0}r=r[u[o]]}return r}}function Qn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function Xn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qn(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qn(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Zn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,u=xn(e);if(t){var r=xn(this).constructor;n=Reflect.construct(u,arguments,r)}else n=u.apply(this,arguments);return Sn(this,n)}}var eu=function(e){kn(n,Ln);var t=Zn(n);function n(e){var u,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return En(this,n),u=t.call(this),Jn&&Ln.call(bn(u)),u.data=e||{},u.options=r,void 0===u.options.keySeparator&&(u.options.keySeparator="."),void 0===u.options.ignoreJSONStructure&&(u.options.ignoreJSONStructure=!0),u}return An(n,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=void 0!==u.keySeparator?u.keySeparator:this.options.keySeparator,o=void 0!==u.ignoreJSONStructure?u.ignoreJSONStructure:this.options.ignoreJSONStructure,i=[e,t];n&&"string"!=typeof n&&(i=i.concat(n)),n&&"string"==typeof n&&(i=i.concat(r?n.split(r):n)),e.indexOf(".")>-1&&(i=e.split("."));var s=Hn(this.data,i);return s||!o||"string"!=typeof n?s:Gn(this.data&&this.data[e]&&this.data[e][t],n,r)}},{key:"addResource",value:function(e,t,n,u){var r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var i=[e,t];n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(u=t,t=(i=e.split("."))[1]),this.addNamespaces(t),zn(this.data,i,u),r.silent||this.emit("added",e,t,n,u)}},{key:"addResources",value:function(e,t,n){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var r in n)"string"!=typeof n[r]&&"[object Array]"!==Object.prototype.toString.apply(n[r])||this.addResource(e,t,r,n[r],{silent:!0});u.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,u,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,t];e.indexOf(".")>-1&&(u=n,n=t,t=(i=e.split("."))[1]),this.addNamespaces(t);var s=Hn(this.data,i)||{};u?Vn(s,n,r):s=Xn(Xn({},s),n),zn(this.data,i,s),o.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?Xn(Xn({},{}),this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"hasLanguageSomeTranslations",value:function(e){var t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((function(e){return t[e]&&Object.keys(t[e]).length>0}))}},{key:"toJSON",value:function(){return this.data}}]),n}(),tu={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,u,r){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,u,r))})),t}};function nu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function uu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nu(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ru(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,u=xn(e);if(t){var r=xn(this).constructor;n=Reflect.construct(u,arguments,r)}else n=u.apply(this,arguments);return Sn(this,n)}}var ou={},iu=function(e){kn(n,Ln);var t=ru(n);function n(e){var u,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return En(this,n),u=t.call(this),Jn&&Ln.call(bn(u)),Mn(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,bn(u)),u.options=r,void 0===u.options.keySeparator&&(u.options.keySeparator="."),u.logger=jn.create("translator"),u}return An(n,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;var n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var u=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],o=n&&e.indexOf(n)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";var u=Yn.filter((function(e){return t.indexOf(e)<0&&n.indexOf(e)<0}));if(0===u.length)return!0;var r=new RegExp("(".concat(u.map((function(e){return"?"===e?"\\?":e})).join("|"),")")),o=!r.test(e);if(!o){var i=e.indexOf(n);i>0&&!r.test(e.substring(0,i))&&(o=!0)}return o}(e,n,u));if(o&&!i){var s=e.match(this.interpolator.nestingRegexp);if(s&&s.length>0)return{key:e,namespaces:r};var a=e.split(n);(n!==u||n===u&&this.options.ns.indexOf(a[0])>-1)&&(r=a.shift()),e=a.join(u)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}},{key:"translate",value:function(e,t,u){var r=this;if("object"!==mn(t)&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"===mn(t)&&(t=uu({},t)),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var o=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,i=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,s=this.extractFromKey(e[e.length-1],t),a=s.key,c=s.namespaces,l=c[c.length-1],p=t.lng||this.language,D=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&"cimode"===p.toLowerCase()){if(D){var d=t.nsSeparator||this.options.nsSeparator;return o?{res:"".concat(l).concat(d).concat(a),usedKey:a,exactUsedKey:a,usedLng:p,usedNS:l}:"".concat(l).concat(d).concat(a)}return o?{res:a,usedKey:a,exactUsedKey:a,usedLng:p,usedNS:l}:a}var h=this.resolve(e,t),f=h&&h.res,g=h&&h.usedKey||a,C=h&&h.exactUsedKey||a,F=Object.prototype.toString.apply(f),m=["[object Number]","[object Function]","[object RegExp]"],E=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,v="string"!=typeof f&&"boolean"!=typeof f&&"number"!=typeof f;if(y&&f&&v&&m.indexOf(F)<0&&("string"!=typeof E||"[object Array]"!==F)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var A=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,f,uu(uu({},t),{},{ns:c})):"key '".concat(a," (").concat(this.language,")' returned an object instead of string.");return o?(h.res=A,h):A}if(i){var b="[object Array]"===F,B=b?[]:{},k=b?C:g;for(var S in f)if(Object.prototype.hasOwnProperty.call(f,S)){var x="".concat(k).concat(i).concat(S);B[S]=this.translate(x,uu(uu({},t),{joinArrays:!1,ns:c})),B[S]===x&&(B[S]=f[S])}f=B}}else if(y&&"string"==typeof E&&"[object Array]"===F)(f=f.join(E))&&(f=this.extendTranslation(f,e,t,u));else{var w=!1,O=!1,N=void 0!==t.count&&"string"!=typeof t.count,P=n.hasDefaultValue(t),R=N?this.pluralResolver.getSuffix(p,t.count,t):"",_=t["defaultValue".concat(R)]||t.defaultValue;!this.isValidLookup(f)&&P&&(w=!0,f=_),this.isValidLookup(f)||(O=!0,f=a);var j=t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,L=j&&O?void 0:f,T=P&&_!==f&&this.options.updateMissing;if(O||w||T){if(this.logger.log(T?"updateKey":"missingKey",p,l,a,T?_:f),i){var I=this.resolve(a,uu(uu({},t),{},{keySeparator:!1}));I&&I.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.")}var M=[],W=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&W&&W[0])for(var z=0;z<W.length;z++)M.push(W[z]);else"all"===this.options.saveMissingTo?M=this.languageUtils.toResolveHierarchy(t.lng||this.language):M.push(t.lng||this.language);var H=function(e,n,u){var o=P&&u!==f?u:L;r.options.missingKeyHandler?r.options.missingKeyHandler(e,l,n,o,T,t):r.backendConnector&&r.backendConnector.saveMissing&&r.backendConnector.saveMissing(e,l,n,o,T,t),r.emit("missingKey",e,l,n,f)};this.options.saveMissing&&(this.options.saveMissingPlurals&&N?M.forEach((function(e){r.pluralResolver.getSuffixes(e,t).forEach((function(n){H([e],a+n,t["defaultValue".concat(n)]||_)}))})):H(M,a,_))}f=this.extendTranslation(f,e,t,h,u),O&&f===a&&this.options.appendNamespaceToMissingKey&&(f="".concat(l,":").concat(a)),(O||w)&&this.options.parseMissingKeyHandler&&(f="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(l,":").concat(a):a,w?f:void 0):this.options.parseMissingKeyHandler(f))}return o?(h.res=f,h):f}},{key:"extendTranslation",value:function(e,t,n,u,r){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,uu(uu({},this.options.interpolation.defaultVariables),n),u.usedLng,u.usedNS,u.usedKey,{resolved:u});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(uu(uu({},n),{interpolation:uu(uu({},this.options.interpolation),n.interpolation)}));var i,s="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(s){var a=e.match(this.interpolator.nestingRegexp);i=a&&a.length}var c=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(c=uu(uu({},this.options.interpolation.defaultVariables),c)),e=this.interpolator.interpolate(e,c,n.lng||this.language,n),s){var l=e.match(this.interpolator.nestingRegexp);i<(l&&l.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&u&&u.res&&(n.lng=u.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,u=new Array(e),i=0;i<e;i++)u[i]=arguments[i];return r&&r[0]===u[0]&&!n.context?(o.logger.warn("It seems you are nesting recursively key: ".concat(u[0]," in key: ").concat(t[0])),null):o.translate.apply(o,u.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var p=n.postProcess||this.options.postProcess,D="string"==typeof p?[p]:p;return null!=e&&D&&D.length&&!1!==n.applyPostProcessor&&(e=tu.handle(D,e,t,this.options&&this.options.postProcessPassResolved?uu({i18nResolved:u},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,u,r,o,i=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!i.isValidLookup(t)){var a=i.extractFromKey(e,s),c=a.key;n=c;var l=a.namespaces;i.options.fallbackNS&&(l=l.concat(i.options.fallbackNS));var p=void 0!==s.count&&"string"!=typeof s.count,D=p&&!s.ordinal&&0===s.count&&i.pluralResolver.shouldUseIntlApi(),d=void 0!==s.context&&("string"==typeof s.context||"number"==typeof s.context)&&""!==s.context,h=s.lngs?s.lngs:i.languageUtils.toResolveHierarchy(s.lng||i.language,s.fallbackLng);l.forEach((function(e){i.isValidLookup(t)||(o=e,!ou["".concat(h[0],"-").concat(e)]&&i.utils&&i.utils.hasLoadedNamespace&&!i.utils.hasLoadedNamespace(o)&&(ou["".concat(h[0],"-").concat(e)]=!0,i.logger.warn('key "'.concat(n,'" for languages "').concat(h.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),h.forEach((function(n){if(!i.isValidLookup(t)){r=n;var o,a=[c];if(i.i18nFormat&&i.i18nFormat.addLookupKeys)i.i18nFormat.addLookupKeys(a,c,n,e,s);else{var l;p&&(l=i.pluralResolver.getSuffix(n,s.count,s));var h="".concat(i.options.pluralSeparator,"zero");if(p&&(a.push(c+l),D&&a.push(c+h)),d){var f="".concat(c).concat(i.options.contextSeparator).concat(s.context);a.push(f),p&&(a.push(f+l),D&&a.push(f+h))}}for(;o=a.pop();)i.isValidLookup(t)||(u=o,t=i.getResource(n,e,o,s))}})))}))}})),{res:t,usedKey:n,exactUsedKey:u,usedLng:r,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,u):this.resourceStore.getResource(e,t,n,u)}}],[{key:"hasDefaultValue",value:function(e){var t="defaultValue";for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,t.length)&&void 0!==e[n])return!0;return!1}}]),n}();function su(e){return e.charAt(0).toUpperCase()+e.slice(1)}var au=function(){function e(t){En(this,e),this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=jn.create("languageUtils")}return An(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=su(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=su(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=su(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var u=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(u)||(t=u)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var u=n.getLanguagePartFromCode(e);if(n.isSupportedCode(u))return t=u;t=n.options.supportedLngs.find((function(e){return e===u?e:e.indexOf("-")<0&&u.indexOf("-")<0?void 0:0===e.indexOf(u)?e:void 0}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var 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||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,u=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=function(e){e&&(n.isSupportedCode(e)?r.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&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))):"string"==typeof e&&o(this.formatLanguageCode(e)),u.forEach((function(e){r.indexOf(e)<0&&o(n.formatLanguageCode(e))})),r}}]),e}(),cu=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],lu={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},pu=["v1","v2","v3"],Du={zero:0,one:1,two:2,few:3,many:4,other:5};function du(){var e={};return cu.forEach((function(t){t.lngs.forEach((function(n){e[n]={numbers:t.nr,plurals:lu[t.fc]}}))})),e}var hu=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};En(this,e),this.languageUtils=t,this.options=n,this.logger=jn.create("pluralResolver"),this.options.compatibilityJSON&&"v4"!==this.options.compatibilityJSON||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=du()}return An(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(e,{type:t.ordinal?"ordinal":"cardinal"})}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((function(e){return"".concat(t).concat(e)}))}},{key:"getSuffixes",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=this.getRule(e,n);return u?this.shouldUseIntlApi()?u.resolvedOptions().pluralCategories.sort((function(e,t){return Du[e]-Du[t]})).map((function(e){return"".concat(t.options.prepend).concat(e)})):u.numbers.map((function(u){return t.getSuffix(e,u,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},u=this.getRule(e,n);return u?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(u.select(t)):this.getSuffixRetroCompatible(u,t):(this.logger.warn("no plural rule found for: ".concat(e)),"")}},{key:"getSuffixRetroCompatible",value:function(e,t){var n=this,u=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),r=e.numbers[u];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));var o=function(){return n.options.prepend&&r.toString()?n.options.prepend+r.toString():r.toString()};return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?"_plural_".concat(r.toString()):o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&u.toString()?this.options.prepend+u.toString():u.toString()}},{key:"shouldUseIntlApi",value:function(){return!pu.includes(this.options.compatibilityJSON)}}]),e}();function fu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function gu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fu(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Cu(e,t,n){var u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=qn(e,t,n);return!o&&r&&"string"==typeof n&&void 0===(o=Gn(e,n,u))&&(o=Gn(t,n,u)),o}var Fu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};En(this,e),this.logger=jn.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return An(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:$n,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?Un(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?Un(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?Un(t.nestingPrefix):t.nestingPrefixEscaped||Un("$t("),this.nestingSuffix=t.nestingSuffix?Un(t.nestingSuffix):t.nestingSuffixEscaped||Un(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,u){var r,o,i,s=this,a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(s.formatSeparator)<0){var r=Cu(t,a,e,s.options.keySeparator,s.options.ignoreJSONStructure);return s.alwaysFormat?s.format(r,void 0,n,gu(gu(gu({},u),t),{},{interpolationkey:e})):r}var o=e.split(s.formatSeparator),i=o.shift().trim(),c=o.join(s.formatSeparator).trim();return s.format(Cu(t,a,i,s.options.keySeparator,s.options.ignoreJSONStructure),c,n,gu(gu(gu({},u),t),{},{interpolationkey:i}))};this.resetRegExp();var p=u&&u.missingInterpolationHandler||this.options.missingInterpolationHandler,D=u&&u.interpolation&&void 0!==u.interpolation.skipOnVariables?u.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return s.escapeValue?c(s.escape(e)):c(e)}}].forEach((function(t){for(i=0;r=t.regex.exec(e);){var n=r[1].trim();if(void 0===(o=l(n)))if("function"==typeof p){var a=p(e,r,u);o="string"==typeof a?a:""}else if(u&&Object.prototype.hasOwnProperty.call(u,n))o="";else{if(D){o=r[0];continue}s.logger.warn("missed to pass in variable ".concat(n," for interpolating ").concat(e)),o=""}else"string"==typeof o||s.useRawValueToEscape||(o=In(o));var c=t.safeValue(o);if(e=e.replace(r[0],c),D?(t.regex.lastIndex+=o.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++i>=s.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,u,r,o=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function s(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var u=e.split(new RegExp("".concat(n,"[ ]*{"))),o="{".concat(u[1]);e=u[0];var i=(o=this.interpolate(o,r)).match(/'/g),s=o.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(o=o.replace(/'/g,'"'));try{r=JSON.parse(o),t&&(r=gu(gu({},t),r))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(o)}return delete r.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){var a=[];(r=(r=gu({},i)).replace&&"string"!=typeof r.replace?r.replace:r).applyPostProcessor=!1,delete r.defaultValue;var c=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){var l=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=l.shift(),a=l,c=!0}if((u=t(s.call(this,n[1].trim(),r),r))&&n[0]===e&&"string"!=typeof u)return u;"string"!=typeof u&&(u=In(u)),u||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),u=""),c&&(u=a.reduce((function(e,t){return o.format(e,t,i.lng,gu(gu({},i),{},{interpolationkey:n[1].trim()}))}),u.trim())),e=e.replace(n[0],u),this.regexp.lastIndex=0}return e}}]),e}();function mu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function Eu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mu(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function yu(e){var t=e.toLowerCase().trim(),n={};if(e.indexOf("(")>-1){var u=e.split("(");t=u[0].toLowerCase().trim();var r=u[1].substring(0,u[1].length-1);if("currency"===t&&r.indexOf(":")<0)n.currency||(n.currency=r.trim());else if("relativetime"===t&&r.indexOf(":")<0)n.range||(n.range=r.trim());else{r.split(";").forEach((function(e){if(e){var t=Nn(e.split(":")),u=t[0],r=t.slice(1).join(":").trim().replace(/^'+|'+$/g,"");n[u.trim()]||(n[u.trim()]=r),"false"===r&&(n[u.trim()]=!1),"true"===r&&(n[u.trim()]=!0),isNaN(r)||(n[u.trim()]=parseInt(r,10))}}))}}return{formatName:t,formatOptions:n}}function vu(e){var t={};return function(n,u,r){var o=u+JSON.stringify(r),i=t[o];return i||(i=e(u,r),t[o]=i),i(n)}}var Au=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};En(this,e),this.logger=jn.create("formatter"),this.options=t,this.formats={number:vu((function(e,t){var n=new Intl.NumberFormat(e,Eu({},t));return function(e){return n.format(e)}})),currency:vu((function(e,t){var n=new Intl.NumberFormat(e,Eu(Eu({},t),{},{style:"currency"}));return function(e){return n.format(e)}})),datetime:vu((function(e,t){var n=new Intl.DateTimeFormat(e,Eu({},t));return function(e){return n.format(e)}})),relativetime:vu((function(e,t){var n=new Intl.RelativeTimeFormat(e,Eu({},t));return function(e){return n.format(e,t.range||"day")}})),list:vu((function(e,t){var n=new Intl.ListFormat(e,Eu({},t));return function(e){return n.format(e)}}))},this.init(t)}return An(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=t.interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}},{key:"add",value:function(e,t){this.formats[e.toLowerCase().trim()]=t}},{key:"addCached",value:function(e,t){this.formats[e.toLowerCase().trim()]=vu(t)}},{key:"format",value:function(e,t,n){var u=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=t.split(this.formatSeparator),i=o.reduce((function(e,t){var o=yu(t),i=o.formatName,s=o.formatOptions;if(u.formats[i]){var a=e;try{var c=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},l=c.locale||c.lng||r.locale||r.lng||n;a=u.formats[i](e,l,Eu(Eu(Eu({},s),r),c))}catch(e){u.logger.warn(e)}return a}return u.logger.warn("there was no format function for ".concat(i)),e}),e);return i}}]),e}();function bu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function Bu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?bu(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bu(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ku(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,u=xn(e);if(t){var r=xn(this).constructor;n=Reflect.construct(u,arguments,r)}else n=u.apply(this,arguments);return Sn(this,n)}}var Su=function(e){kn(n,Ln);var t=ku(n);function n(e,u,r){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return En(this,n),o=t.call(this),Jn&&Ln.call(bn(o)),o.backend=e,o.store=u,o.services=r,o.languageUtils=r.languageUtils,o.options=i,o.logger=jn.create("backendConnector"),o.waitingReads=[],o.maxParallelReads=i.maxParallelReads||10,o.readingCalls=0,o.maxRetries=i.maxRetries>=0?i.maxRetries:5,o.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,o.state={},o.queue=[],o.backend&&o.backend.init&&o.backend.init(r,i.backend,i),o}return An(n,[{key:"queueLoad",value:function(e,t,n,u){var r=this,o={},i={},s={},a={};return e.forEach((function(e){var u=!0;t.forEach((function(t){var s="".concat(e,"|").concat(t);!n.reload&&r.store.hasResourceBundle(e,t)?r.state[s]=2:r.state[s]<0||(1===r.state[s]?void 0===i[s]&&(i[s]=!0):(r.state[s]=1,u=!1,void 0===i[s]&&(i[s]=!0),void 0===o[s]&&(o[s]=!0),void 0===a[t]&&(a[t]=!0)))})),u||(s[e]=!0)})),(Object.keys(o).length||Object.keys(i).length)&&this.queue.push({pending:i,pendingCount:Object.keys(i).length,loaded:{},errors:[],callback:u}),{toLoad:Object.keys(o),pending:Object.keys(i),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(a)}}},{key:"loaded",value:function(e,t,n){var u=e.split("|"),r=u[0],o=u[1];t&&this.emit("failedLoading",r,o,t),n&&this.store.addResourceBundle(r,o,n),this.state[e]=t?-1:2;var i={};this.queue.forEach((function(n){var u,s,a,c,l,p;u=n.loaded,s=o,c=Wn(u,[r],Object),l=c.obj,p=c.k,l[p]=l[p]||[],a&&(l[p]=l[p].concat(s)),a||l[p].push(s),function(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((function(e){i[e]||(i[e]={});var t=n.loaded[e];t.length&&t.forEach((function(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((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var u=this,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,i=arguments.length>5?arguments[5]:void 0;if(!e.length)return i(null,{});if(this.readingCalls>=this.maxParallelReads)this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:i});else{this.readingCalls++;var s=function(s,a){if(u.readingCalls--,u.waitingReads.length>0){var c=u.waitingReads.shift();u.read(c.lng,c.ns,c.fcName,c.tried,c.wait,c.callback)}s&&a&&r<u.maxRetries?setTimeout((function(){u.read.call(u,e,t,n,r+1,2*o,i)}),o):i(s,a)},a=this.backend[n].bind(this.backend);if(2!==a.length)return a(e,t,s);try{var c=a(e,t);c&&"function"==typeof c.then?c.then((function(e){return s(null,e)})).catch(s):s(null,c)}catch(e){s(e)}}}},{key:"prepareLoading",value:function(e,t){var n=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,u,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",u=e.split("|"),r=u[0],o=u[1];this.read(r,o,"read",void 0,void 0,(function(u,i){u&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(r," failed"),u),!u&&i&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(r),i),t.loaded(e,u,i)}))}},{key:"saveMissing",value:function(e,t,n,u,r){var o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:function(){};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(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!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){var s=Bu(Bu({},o),{},{isUpdate:r}),a=this.backend.create.bind(this.backend);if(a.length<6)try{var c;(c=5===a.length?a(e,t,n,u,s):a(e,t,n,u))&&"function"==typeof c.then?c.then((function(e){return i(null,e)})).catch(i):i(null,c)}catch(e){i(e)}else a(e,t,n,u,i,s)}e&&e[0]&&this.store.addResource(e[0],t,n,u)}}}]),n}();function xu(){return{debug:!1,initImmediate:!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:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===mn(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===mn(e[2])||"object"===mn(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,u){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function wu(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function Ou(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);t&&(u=u.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,u)}return n}function Nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ou(Object(n),!0).forEach((function(t){wn(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ou(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Pu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,u=xn(e);if(t){var r=xn(this).constructor;n=Reflect.construct(u,arguments,r)}else n=u.apply(this,arguments);return Sn(this,n)}}function Ru(){}function _u(e){Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach((function(t){"function"==typeof e[t]&&(e[t]=e[t].bind(e))}))}var ju=function(e){kn(n,Ln);var t=Pu(n);function n(){var e,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(En(this,n),e=t.call(this),Jn&&Ln.call(bn(e)),e.options=wu(u),e.services={},e.logger=jn,e.modules={external:[]},_u(bn(e)),r&&!e.isInitialized&&!u.isClone){if(!e.options.initImmediate)return e.init(u,r),Sn(e,bn(e));setTimeout((function(){e.init(u,r)}),0)}return e}return An(n,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));var u=xu();function r(e){return e?"function"==typeof e?new e:e:null}if(this.options=Nu(Nu(Nu({},u),this.options),wu(t)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=Nu(Nu({},u.interpolation),this.options.interpolation)),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){var o;this.modules.logger?jn.init(r(this.modules.logger),this.options):jn.init(null,this.options),this.modules.formatter?o=this.modules.formatter:"undefined"!=typeof Intl&&(o=Au);var i=new au(this.options);this.store=new eu(this.options.resources,this.options);var s=this.services;s.logger=jn,s.resourceStore=this.store,s.languageUtils=i,s.pluralResolver=new hu(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!o||this.options.interpolation.format&&this.options.interpolation.format!==u.interpolation.format||(s.formatter=r(o),s.formatter.init(s,this.options),this.options.interpolation.format=s.formatter.format.bind(s.formatter)),s.interpolator=new Fu(this.options),s.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},s.backendConnector=new Su(r(this.modules.backend),s.resourceStore,s,this.options),s.backendConnector.on("*",(function(t){for(var n=arguments.length,u=new Array(n>1?n-1:0),r=1;r<n;r++)u[r-1]=arguments[r];e.emit.apply(e,[t].concat(u))})),this.modules.languageDetector&&(s.languageDetector=r(this.modules.languageDetector),s.languageDetector.init&&s.languageDetector.init(s,this.options.detection,this.options)),this.modules.i18nFormat&&(s.i18nFormat=r(this.modules.i18nFormat),s.i18nFormat.init&&s.i18nFormat.init(this)),this.translator=new iu(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,u=new Array(n>1?n-1:0),r=1;r<n;r++)u[r-1]=arguments[r];e.emit.apply(e,[t].concat(u))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.format=this.options.interpolation.format,n||(n=Ru),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var a=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);a.length>0&&"dev"!==a[0]&&(this.options.lng=a[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");var c=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];c.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}}));var l=["addResource","addResources","addResourceBundle","removeResourceBundle"];l.forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var p=Tn(),D=function(){var t=function(t,u){e.isInitialized&&!e.initializedStoreOnce&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),p.resolve(u),n(t,u)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?D():setTimeout(D,0),p}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ru,u=n,r="string"==typeof e?e:this.language;if("function"==typeof e&&(u=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return u();var o=[],i=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){o.indexOf(e)<0&&o.push(e)}))};if(r)i(r);else{var s=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);s.forEach((function(e){return i(e)}))}this.options.preload&&this.options.preload.forEach((function(e){return i(e)})),this.services.backendConnector.load(o,this.options.ns,(function(e){e||t.resolvedLanguage||!t.language||t.setResolvedLanguage(t.language),u(e)}))}else u(null)}},{key:"reloadResources",value:function(e,t,n){var u=Tn();return e||(e=this.languages),t||(t=this.options.ns),n||(n=Ru),this.services.backendConnector.reload(e,t,(function(e){u.resolve(),n(e)})),u}},{key:"use",value:function(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&&tu.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"setResolvedLanguage",value:function(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(var t=0;t<this.languages.length;t++){var n=this.languages[t];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var u=Tn();this.emit("languageChanging",e);var r=function(e){n.language=e,n.languages=n.services.languageUtils.toResolveHierarchy(e),n.resolvedLanguage=void 0,n.setResolvedLanguage(e)},o=function(o){e||o||!n.services.languageDetector||(o=[]);var i="string"==typeof o?o:n.services.languageUtils.getBestMatchFromCodes(o);i&&(n.language||r(i),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,o){o?(r(o),n.translator.changeLanguage(o),n.isLanguageChangingTo=void 0,n.emit("languageChanged",o),n.logger.log("languageChanged",o)):n.isLanguageChangingTo=void 0,u.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};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(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),u}},{key:"getFixedT",value:function(e,t,n){var u=this,r=function e(t,r){var o;if("object"!==mn(r)){for(var i=arguments.length,s=new Array(i>2?i-2:0),a=2;a<i;a++)s[a-2]=arguments[a];o=u.options.overloadTranslationOptionHandler([t,r].concat(s))}else o=Nu({},r);o.lng=o.lng||e.lng,o.lngs=o.lngs||e.lngs,o.ns=o.ns||e.ns,o.keyPrefix=o.keyPrefix||n||e.keyPrefix;var c,l=u.options.keySeparator||".";return c=o.keyPrefix&&Array.isArray(t)?t.map((function(e){return"".concat(o.keyPrefix).concat(l).concat(e)})):o.keyPrefix?"".concat(o.keyPrefix).concat(l).concat(t):t,u.t(c,o)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=n,r}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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;var u=n.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===u.toLowerCase())return!0;var i=function(e,n){var u=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===u||2===u};if(n.precheck){var s=n.precheck(this,i);if(void 0!==s)return s}return!!this.hasResourceBundle(u,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!i(u,e)||r&&!i(o,e)))}},{key:"loadNamespaces",value:function(e,t){var n=this,u=Tn();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){u.resolve(),t&&t(e)})),u):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=Tn();"string"==typeof e&&(e=[e]);var u=this.options.preload||[],r=e.filter((function(e){return u.indexOf(e)<0}));return r.length?(this.options.preload=u.concat(r),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";var t=this.services&&this.services.languageUtils||new au(xu());return["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"}},{key:"cloneInstance",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ru,r=Nu(Nu(Nu({},this.options),t),{isClone:!0}),o=new n(r);void 0===t.debug&&void 0===t.prefix||(o.logger=o.logger.clone(t));var i=["store","services","language"];return i.forEach((function(t){o[t]=e[t]})),o.services=Nu({},this.services),o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o.translator=new iu(o.services,o.options),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),u=1;u<t;u++)n[u-1]=arguments[u];o.emit.apply(o,[e].concat(n))})),o.init(r,u),o.translator.options=o.options,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}();wn(ju,"createInstance",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new ju(e,t)}));var Lu=ju.createInstance();Lu.createInstance=ju.createInstance,Lu.createInstance,Lu.dir,Lu.init,Lu.loadResources,Lu.reloadResources,Lu.use,Lu.changeLanguage,Lu.getFixedT,Lu.t,Lu.exists,Lu.setDefaultNamespace,Lu.hasLoadedNamespace,Lu.loadNamespaces,Lu.loadLanguages;Lu.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 Tu={translator:{...Lu,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 Lu.t(e,{lng:n,...t})}},languageOptions:[{value:"en_US",label:"English (US)"},{value:"es_ES",label:"Spanish"}]};const Iu=e,{withStyles:Mu}=u,{Check:Wu}=a,{Close:zu}=a,{color:Hu}=r,qu=o,{translator:Vu}=Tu,Uu=Mu((e=>({flexContainer:{display:"flex",flexDirection:"row",alignItems:"center",gap:2*e.spacing.unit+"px",borderBottom:"1px solid lightgrey",borderTop:"1px solid lightgrey",paddingBottom:e.spacing.unit,paddingTop:e.spacing.unit,marginBottom:e.spacing.unit},key:{fontSize:"14px",fontWeight:"bold",color:Hu.black(),marginLeft:e.spacing.unit},container:{position:"relative",padding:"4px",fontSize:"14px",borderRadius:"4px"},correct:{border:`${Hu.correctTertiary()} solid 2px`},incorrect:{border:`${Hu.incorrectWithIcon()} solid 2px`},missing:{border:`${Hu.incorrectWithIcon()} dashed 2px`},incorrectIcon:{backgroundColor:Hu.incorrectWithIcon()},correctIcon:{backgroundColor:Hu.correctTertiary()},icon:{color:Hu.white(),position:"absolute",top:"-8px",left:"-8px",borderRadius:"50%",fontSize:"12px",padding:"2px"}})))((({classes:e,language:t,showOnlyCorrect:n})=>{const u=[{Icon:Wu,label:Vu.t("selectText.correctAnswerSelected",{lng:t}),containerClass:qu(e.correct,e.container),iconClass:qu(e.correctIcon,e.icon)},{Icon:zu,label:Vu.t("selectText.incorrectSelection",{lng:t}),containerClass:qu(e.incorrect,e.container),iconClass:qu(e.incorrectIcon,e.icon)},{Icon:zu,label:Vu.t("selectText.correctAnswerNotSelected",{lng:t}),containerClass:qu(e.missing,e.container),iconClass:qu(e.incorrectIcon,e.icon)}];return n&&u.splice(1,2),Iu.createElement("div",{className:e.flexContainer},Iu.createElement("span",{className:e.key},Vu.t("selectText.key",{lng:t})),u.map((({Icon:e,label:t,containerClass:n,iconClass:u},r)=>Iu.createElement("div",{key:r,className:n},Iu.createElement(e,{className:u}),Iu.createElement("span",null,t)))))}));var Ku=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 r;n+=(r=e,u===t.length-1?r.innerHTML:"".concat(r.innerHTML,"\n\n"))})),n||null}(t)},$u=e=>{if(!e)return e;const t=Ku(e.text||""),n=(e.tokens||[]).reduce(((n,u={})=>{const r=Ku((e.text||"").slice(u.start,u.end));if(!r)return[...n,u];const o=n[n.length-1],i=(e=>{let n=e;for(;n>=0;){let e=t.slice(n).indexOf(r);if(e>=0)return e+n;n--}return 0})(o?o.end:u.start),s=i+r.length;return[...n,{...u,text:r,start:i,end:s,oldStart:u.start,oldEnd:u.end}]}),[]);return{...e,tokens:n,text:t}};const Ju=e,Yu=t,Gu=l,{color:Qu}=r,{Feedback:Xu}=r,{Collapsible:Zu}=r,{hasText:er}=r,{hasMedia:tr}=r,{PreviewPrompt:nr}=r,{UiLayout:ur}=r,{withStyles:rr}=u,or=s("@pie-ui:select-text"),ir={model:Yu.object,session:Yu.object,onSelectionChange:Yu.func.isRequired};class sr extends Ju.Component{static __initStatic(){this.propTypes={...ir,classes:Yu.object.isRequired}}static __initStatic2(){this.defaultProps={}}constructor(e){super(e),sr.prototype.__init.call(this),sr.prototype.__init2.call(this),this.state={showCorrectAnswer:this.props.model.alwaysShowCorrect||!1,model:$u(e.model)}}UNSAFE_componentWillReceiveProps(e){this.setState({showCorrectAnswer:!!e.model.alwaysShowCorrect,model:$u(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,classes:n}=this.props,{showCorrectAnswer:u,model:r}=this.state,{env:o,extraCSSRules:i}=r,{mode:s}=o||{},a=u?this.correctAnswer():e.selectedTokens,c=r.rationale&&(er(r.rationale)||tr(r.rationale)),l=r.teacherInstructions&&(er(r.teacherInstructions)||tr(r.teacherInstructions));return or("[render] selectedTokens:",a),Ju.createElement(ur,{extraCSSRules:i,className:n.mainContainer},l&&(r.animationsDisabled?Ju.createElement("div",{className:n.prompt},Ju.createElement(nr,{prompt:r.teacherInstructions})):Ju.createElement(Zu,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"},className:n.collapsible},Ju.createElement(nr,{prompt:r.teacherInstructions}))),Ju.createElement("div",{className:n.prompt},Ju.createElement(nr,{prompt:r.prompt})),!r.alwaysShowCorrect&&Ju.createElement(Gu,{show:r.disabled&&r.incorrect,toggled:u,onToggle:this.toggleShowCorrect,language:r.language}),Ju.createElement(Fn,{className:n.textSelect,disabled:r.disabled,text:r.text,tokens:r.tokens,selectedTokens:a,onChange:e=>{const n=e.map((e=>{const t=r.tokens.find((({start:t,end:n})=>e.start===t&&e.end===n));return t||e}));t(n)},highlightChoices:r.highlightChoices,maxNoOfSelections:r.maxSelections,animationsDisabled:r.animationsDisabled}),"evaluate"===s&&Ju.createElement(Uu,{language:r.language,showOnlyCorrect:u}),c&&(r.animationsDisabled?Ju.createElement("div",{className:n.prompt},Ju.createElement(nr,{prompt:r.rationale})):Ju.createElement(Zu,{labels:{hidden:"Show Rationale",visible:"Hide Rationale"},className:n.collapsible},Ju.createElement(nr,{prompt:r.rationale}))),r.correctness&&r.feedback&&!u&&Ju.createElement(Xu,{correctness:r.correctness,feedback:r.feedback}))}}sr.__initStatic(),sr.__initStatic2();const ar=rr((e=>({mainContainer:{color:Qu.text(),backgroundColor:Qu.background()},textSelect:{marginBottom:e.spacing.unit,marginTop:2*e.spacing.unit,whiteSpace:"normal"},prompt:{verticalAlign:"middle",marginBottom:e.spacing.unit},collapsible:{marginBottom:2*e.spacing.unit}})))(sr);class cr extends Ju.Component{static __initStatic3(){this.propTypes=ir}constructor(e){super(e),cr.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 Ju.createElement(ar,{model:e,session:t,onSelectionChange:this.change})}}cr.__initStatic3();const lr=e,pr=p,{renderMath:Dr}=D;class dr extends HTMLElement{constructor(){super()}set model(e){this._model=e,this.render(),this.dispatchEvent(new f(this.tagName.toLowerCase(),this.isSessionComplete(),void 0!==this._model))}set session(e){if(this._session=e,this._model){const t=$u(this._model)||{},{tokens:n}=t;let{selectedTokens:u}=e||{};u=u||[];const r=e=>n.find((({start:t,end:n})=>e.start===t&&e.end===n));if(!u.reduce(((e,t)=>e&&r(t)),!0)){const e=$u({...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=lr.createElement(cr,{model:this._model,session:this._session,onSelectionChange:this.selectionChanged.bind(this)});pr.render(e,this,(()=>{Dr(this)}))}}}export{dr as default};