element-less 0.0.1

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.
@@ -0,0 +1,1319 @@
1
+ import { g as getDefaultExportFromCjs } from "./index-8a31b394.js";
2
+ function _mergeNamespaces(n, m) {
3
+ for (var i = 0; i < m.length; i++) {
4
+ const e = m[i];
5
+ if (typeof e !== "string" && !Array.isArray(e)) {
6
+ for (const k in e) {
7
+ if (k !== "default" && !(k in n)) {
8
+ n[k] = e[k];
9
+ }
10
+ }
11
+ }
12
+ }
13
+ return Object.freeze(Object.defineProperty(n, Symbol.toStringTag, { value: "Module" }));
14
+ }
15
+ var modeJavascript$2 = { exports: {} };
16
+ (function(module, exports) {
17
+ ace.define("ace/mode/jsdoc_comment_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text_highlight_rules"], function(require2, exports2, module2) {
18
+ var oop = require2("../lib/oop");
19
+ var TextHighlightRules = require2("./text_highlight_rules").TextHighlightRules;
20
+ var JsDocCommentHighlightRules = function() {
21
+ this.$rules = {
22
+ "start": [
23
+ {
24
+ token: ["comment.doc.tag", "comment.doc.text", "lparen.doc"],
25
+ regex: "(@(?:param|member|typedef|property|namespace|var|const|callback))(\\s*)({)",
26
+ push: [
27
+ {
28
+ token: "lparen.doc",
29
+ regex: "{",
30
+ push: [
31
+ {
32
+ include: "doc-syntax"
33
+ },
34
+ {
35
+ token: "rparen.doc",
36
+ regex: "}|(?=$)",
37
+ next: "pop"
38
+ }
39
+ ]
40
+ },
41
+ {
42
+ token: ["rparen.doc", "text.doc", "variable.parameter.doc", "lparen.doc", "variable.parameter.doc", "rparen.doc"],
43
+ regex: /(})(\s*)(?:([\w=:\/\.]+)|(?:(\[)([\w=:\/\.]+)(\])))/,
44
+ next: "pop"
45
+ },
46
+ {
47
+ token: "rparen.doc",
48
+ regex: "}|(?=$)",
49
+ next: "pop"
50
+ },
51
+ {
52
+ include: "doc-syntax"
53
+ },
54
+ {
55
+ defaultToken: "text.doc"
56
+ }
57
+ ]
58
+ },
59
+ {
60
+ token: ["comment.doc.tag", "text.doc", "lparen.doc"],
61
+ regex: "(@(?:returns?|yields|type|this|suppress|public|protected|private|package|modifies|implements|external|exception|throws|enum|define|extends))(\\s*)({)",
62
+ push: [
63
+ {
64
+ token: "lparen.doc",
65
+ regex: "{",
66
+ push: [
67
+ {
68
+ include: "doc-syntax"
69
+ },
70
+ {
71
+ token: "rparen.doc",
72
+ regex: "}|(?=$)",
73
+ next: "pop"
74
+ }
75
+ ]
76
+ },
77
+ {
78
+ token: "rparen.doc",
79
+ regex: "}|(?=$)",
80
+ next: "pop"
81
+ },
82
+ {
83
+ include: "doc-syntax"
84
+ },
85
+ {
86
+ defaultToken: "text.doc"
87
+ }
88
+ ]
89
+ },
90
+ {
91
+ token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
92
+ regex: '(@(?:alias|memberof|instance|module|name|lends|namespace|external|this|template|requires|param|implements|function|extends|typedef|mixes|constructor|var|memberof\\!|event|listens|exports|class|constructs|interface|emits|fires|throws|const|callback|borrows|augments))(\\s+)(\\w[\\w#.:/~"\\-]*)?'
93
+ },
94
+ {
95
+ token: ["comment.doc.tag", "text.doc", "variable.parameter.doc"],
96
+ regex: "(@method)(\\s+)(\\w[\\w.\\(\\)]*)"
97
+ },
98
+ {
99
+ token: "comment.doc.tag",
100
+ regex: "@access\\s+(?:private|public|protected)"
101
+ },
102
+ {
103
+ token: "comment.doc.tag",
104
+ regex: "@kind\\s+(?:class|constant|event|external|file|function|member|mixin|module|namespace|typedef)"
105
+ },
106
+ {
107
+ token: "comment.doc.tag",
108
+ regex: "@\\w+(?=\\s|$)"
109
+ },
110
+ JsDocCommentHighlightRules.getTagRule(),
111
+ {
112
+ defaultToken: "comment.doc",
113
+ caseInsensitive: true
114
+ }
115
+ ],
116
+ "doc-syntax": [{
117
+ token: "operator.doc",
118
+ regex: /[|:]/
119
+ }, {
120
+ token: "paren.doc",
121
+ regex: /[\[\]]/
122
+ }]
123
+ };
124
+ this.normalizeRules();
125
+ };
126
+ oop.inherits(JsDocCommentHighlightRules, TextHighlightRules);
127
+ JsDocCommentHighlightRules.getTagRule = function(start) {
128
+ return {
129
+ token: "comment.doc.tag.storage.type",
130
+ regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
131
+ };
132
+ };
133
+ JsDocCommentHighlightRules.getStartRule = function(start) {
134
+ return {
135
+ token: "comment.doc",
136
+ // doc comment
137
+ regex: "\\/\\*(?=\\*)",
138
+ next: start
139
+ };
140
+ };
141
+ JsDocCommentHighlightRules.getEndRule = function(start) {
142
+ return {
143
+ token: "comment.doc",
144
+ // closing comment
145
+ regex: "\\*\\/",
146
+ next: start
147
+ };
148
+ };
149
+ exports2.JsDocCommentHighlightRules = JsDocCommentHighlightRules;
150
+ });
151
+ ace.define("ace/mode/javascript_highlight_rules", ["require", "exports", "module", "ace/lib/oop", "ace/mode/jsdoc_comment_highlight_rules", "ace/mode/text_highlight_rules"], function(require2, exports2, module2) {
152
+ var oop = require2("../lib/oop");
153
+ var DocCommentHighlightRules = require2("./jsdoc_comment_highlight_rules").JsDocCommentHighlightRules;
154
+ var TextHighlightRules = require2("./text_highlight_rules").TextHighlightRules;
155
+ var identifierRe = "[a-zA-Z\\$_¡-￿][a-zA-Z\\d\\$_¡-￿]*";
156
+ var JavaScriptHighlightRules = function(options) {
157
+ var keywordMapper = this.createKeywordMapper({
158
+ "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|Symbol|Namespace|QName|XML|XMLList|ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|SyntaxError|TypeError|URIError|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|isNaN|parseFloat|parseInt|JSON|Math|this|arguments|prototype|window|document",
159
+ // Pseudo
160
+ "keyword": "const|yield|import|get|set|async|await|break|case|catch|continue|default|delete|do|else|finally|for|function|if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|__parent__|__count__|escape|unescape|with|__proto__|class|enum|extends|super|export|implements|private|public|interface|package|protected|static|constructor",
161
+ "storage.type": "const|let|var|function",
162
+ "constant.language": "null|Infinity|NaN|undefined",
163
+ "support.function": "alert",
164
+ "constant.language.boolean": "true|false"
165
+ }, "identifier");
166
+ var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
167
+ var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|u{[0-9a-fA-F]{1,6}}|[0-2][0-7]{0,2}|3[0-7][0-7]?|[4-7][0-7]?|.)";
168
+ this.$rules = {
169
+ "no_regex": [
170
+ DocCommentHighlightRules.getStartRule("doc-start"),
171
+ comments("no_regex"),
172
+ {
173
+ token: "string",
174
+ regex: "'(?=.)",
175
+ next: "qstring"
176
+ },
177
+ {
178
+ token: "string",
179
+ regex: '"(?=.)',
180
+ next: "qqstring"
181
+ },
182
+ {
183
+ token: "constant.numeric",
184
+ // hexadecimal, octal and binary
185
+ regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
186
+ },
187
+ {
188
+ token: "constant.numeric",
189
+ // decimal integers and floats
190
+ regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
191
+ },
192
+ {
193
+ token: [
194
+ "storage.type",
195
+ "punctuation.operator",
196
+ "support.function",
197
+ "punctuation.operator",
198
+ "entity.name.function",
199
+ "text",
200
+ "keyword.operator"
201
+ ],
202
+ regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
203
+ next: "function_arguments"
204
+ },
205
+ {
206
+ token: [
207
+ "storage.type",
208
+ "punctuation.operator",
209
+ "entity.name.function",
210
+ "text",
211
+ "keyword.operator",
212
+ "text",
213
+ "storage.type",
214
+ "text",
215
+ "paren.lparen"
216
+ ],
217
+ regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
218
+ next: "function_arguments"
219
+ },
220
+ {
221
+ token: [
222
+ "entity.name.function",
223
+ "text",
224
+ "keyword.operator",
225
+ "text",
226
+ "storage.type",
227
+ "text",
228
+ "paren.lparen"
229
+ ],
230
+ regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s*)(\\()",
231
+ next: "function_arguments"
232
+ },
233
+ {
234
+ token: [
235
+ "storage.type",
236
+ "punctuation.operator",
237
+ "entity.name.function",
238
+ "text",
239
+ "keyword.operator",
240
+ "text",
241
+ "storage.type",
242
+ "text",
243
+ "entity.name.function",
244
+ "text",
245
+ "paren.lparen"
246
+ ],
247
+ regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(\\s+)(\\w+)(\\s*)(\\()",
248
+ next: "function_arguments"
249
+ },
250
+ {
251
+ token: [
252
+ "storage.type",
253
+ "text",
254
+ "entity.name.function",
255
+ "text",
256
+ "paren.lparen"
257
+ ],
258
+ regex: "(function\\*?)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
259
+ next: "function_arguments"
260
+ },
261
+ {
262
+ token: [
263
+ "entity.name.function",
264
+ "text",
265
+ "punctuation.operator",
266
+ "text",
267
+ "storage.type",
268
+ "text",
269
+ "paren.lparen"
270
+ ],
271
+ regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function\\*?)(\\s*)(\\()",
272
+ next: "function_arguments"
273
+ },
274
+ {
275
+ token: [
276
+ "text",
277
+ "text",
278
+ "storage.type",
279
+ "text",
280
+ "paren.lparen"
281
+ ],
282
+ regex: "(:)(\\s*)(function\\*?)(\\s*)(\\()",
283
+ next: "function_arguments"
284
+ },
285
+ {
286
+ token: "keyword",
287
+ regex: `from(?=\\s*('|"))`
288
+ },
289
+ {
290
+ token: "keyword",
291
+ regex: "(?:" + kwBeforeRe + ")\\b",
292
+ next: "start"
293
+ },
294
+ {
295
+ token: "support.constant",
296
+ regex: /that\b/
297
+ },
298
+ {
299
+ token: ["storage.type", "punctuation.operator", "support.function.firebug"],
300
+ regex: /(console)(\.)(warn|info|log|error|debug|time|trace|timeEnd|assert)\b/
301
+ },
302
+ {
303
+ token: keywordMapper,
304
+ regex: identifierRe
305
+ },
306
+ {
307
+ token: "punctuation.operator",
308
+ regex: /[.](?![.])/,
309
+ next: "property"
310
+ },
311
+ {
312
+ token: "storage.type",
313
+ regex: /=>/,
314
+ next: "start"
315
+ },
316
+ {
317
+ token: "keyword.operator",
318
+ regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
319
+ next: "start"
320
+ },
321
+ {
322
+ token: "punctuation.operator",
323
+ regex: /[?:,;.]/,
324
+ next: "start"
325
+ },
326
+ {
327
+ token: "paren.lparen",
328
+ regex: /[\[({]/,
329
+ next: "start"
330
+ },
331
+ {
332
+ token: "paren.rparen",
333
+ regex: /[\])}]/
334
+ },
335
+ {
336
+ token: "comment",
337
+ regex: /^#!.*$/
338
+ }
339
+ ],
340
+ property: [
341
+ {
342
+ token: "text",
343
+ regex: "\\s+"
344
+ },
345
+ {
346
+ token: [
347
+ "storage.type",
348
+ "punctuation.operator",
349
+ "entity.name.function",
350
+ "text",
351
+ "keyword.operator",
352
+ "text",
353
+ "storage.type",
354
+ "text",
355
+ "entity.name.function",
356
+ "text",
357
+ "paren.lparen"
358
+ ],
359
+ regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function\\*?)(?:(\\s+)(\\w+))?(\\s*)(\\()",
360
+ next: "function_arguments"
361
+ },
362
+ {
363
+ token: "punctuation.operator",
364
+ regex: /[.](?![.])/
365
+ },
366
+ {
367
+ token: "support.function",
368
+ regex: /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|lter|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward|rEach)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
369
+ },
370
+ {
371
+ token: "support.function.dom",
372
+ regex: /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
373
+ },
374
+ {
375
+ token: "support.constant",
376
+ regex: /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
377
+ },
378
+ {
379
+ token: "identifier",
380
+ regex: identifierRe
381
+ },
382
+ {
383
+ regex: "",
384
+ token: "empty",
385
+ next: "no_regex"
386
+ }
387
+ ],
388
+ "start": [
389
+ DocCommentHighlightRules.getStartRule("doc-start"),
390
+ comments("start"),
391
+ {
392
+ token: "string.regexp",
393
+ regex: "\\/",
394
+ next: "regex"
395
+ },
396
+ {
397
+ token: "text",
398
+ regex: "\\s+|^$",
399
+ next: "start"
400
+ },
401
+ {
402
+ token: "empty",
403
+ regex: "",
404
+ next: "no_regex"
405
+ }
406
+ ],
407
+ "regex": [
408
+ {
409
+ token: "regexp.keyword.operator",
410
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
411
+ },
412
+ {
413
+ token: "string.regexp",
414
+ regex: "/[sxngimy]*",
415
+ next: "no_regex"
416
+ },
417
+ {
418
+ token: "invalid",
419
+ regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
420
+ },
421
+ {
422
+ token: "constant.language.escape",
423
+ regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
424
+ },
425
+ {
426
+ token: "constant.language.delimiter",
427
+ regex: /\|/
428
+ },
429
+ {
430
+ token: "constant.language.escape",
431
+ regex: /\[\^?/,
432
+ next: "regex_character_class"
433
+ },
434
+ {
435
+ token: "empty",
436
+ regex: "$",
437
+ next: "no_regex"
438
+ },
439
+ {
440
+ defaultToken: "string.regexp"
441
+ }
442
+ ],
443
+ "regex_character_class": [
444
+ {
445
+ token: "regexp.charclass.keyword.operator",
446
+ regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
447
+ },
448
+ {
449
+ token: "constant.language.escape",
450
+ regex: "]",
451
+ next: "regex"
452
+ },
453
+ {
454
+ token: "constant.language.escape",
455
+ regex: "-"
456
+ },
457
+ {
458
+ token: "empty",
459
+ regex: "$",
460
+ next: "no_regex"
461
+ },
462
+ {
463
+ defaultToken: "string.regexp.charachterclass"
464
+ }
465
+ ],
466
+ "default_parameter": [
467
+ {
468
+ token: "string",
469
+ regex: "'(?=.)",
470
+ push: [
471
+ {
472
+ token: "string",
473
+ regex: "'|$",
474
+ next: "pop"
475
+ },
476
+ {
477
+ include: "qstring"
478
+ }
479
+ ]
480
+ },
481
+ {
482
+ token: "string",
483
+ regex: '"(?=.)',
484
+ push: [
485
+ {
486
+ token: "string",
487
+ regex: '"|$',
488
+ next: "pop"
489
+ },
490
+ {
491
+ include: "qqstring"
492
+ }
493
+ ]
494
+ },
495
+ {
496
+ token: "constant.language",
497
+ regex: "null|Infinity|NaN|undefined"
498
+ },
499
+ {
500
+ token: "constant.numeric",
501
+ // hexadecimal, octal and binary
502
+ regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
503
+ },
504
+ {
505
+ token: "constant.numeric",
506
+ // decimal integers and floats
507
+ regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
508
+ },
509
+ {
510
+ token: "punctuation.operator",
511
+ regex: ",",
512
+ next: "function_arguments"
513
+ },
514
+ {
515
+ token: "text",
516
+ regex: "\\s+"
517
+ },
518
+ {
519
+ token: "punctuation.operator",
520
+ regex: "$"
521
+ },
522
+ {
523
+ token: "empty",
524
+ regex: "",
525
+ next: "no_regex"
526
+ }
527
+ ],
528
+ "function_arguments": [
529
+ comments("function_arguments"),
530
+ {
531
+ token: "variable.parameter",
532
+ regex: identifierRe
533
+ },
534
+ {
535
+ token: "punctuation.operator",
536
+ regex: ","
537
+ },
538
+ {
539
+ token: "text",
540
+ regex: "\\s+"
541
+ },
542
+ {
543
+ token: "punctuation.operator",
544
+ regex: "$"
545
+ },
546
+ {
547
+ token: "empty",
548
+ regex: "",
549
+ next: "no_regex"
550
+ }
551
+ ],
552
+ "qqstring": [
553
+ {
554
+ token: "constant.language.escape",
555
+ regex: escapedRe
556
+ },
557
+ {
558
+ token: "string",
559
+ regex: "\\\\$",
560
+ consumeLineEnd: true
561
+ },
562
+ {
563
+ token: "string",
564
+ regex: '"|$',
565
+ next: "no_regex"
566
+ },
567
+ {
568
+ defaultToken: "string"
569
+ }
570
+ ],
571
+ "qstring": [
572
+ {
573
+ token: "constant.language.escape",
574
+ regex: escapedRe
575
+ },
576
+ {
577
+ token: "string",
578
+ regex: "\\\\$",
579
+ consumeLineEnd: true
580
+ },
581
+ {
582
+ token: "string",
583
+ regex: "'|$",
584
+ next: "no_regex"
585
+ },
586
+ {
587
+ defaultToken: "string"
588
+ }
589
+ ]
590
+ };
591
+ if (!options || !options.noES6) {
592
+ this.$rules.no_regex.unshift({
593
+ regex: "[{}]",
594
+ onMatch: function(val, state, stack) {
595
+ this.next = val == "{" ? this.nextState : "";
596
+ if (val == "{" && stack.length) {
597
+ stack.unshift("start", state);
598
+ } else if (val == "}" && stack.length) {
599
+ stack.shift();
600
+ this.next = stack.shift();
601
+ if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
602
+ return "paren.quasi.end";
603
+ }
604
+ return val == "{" ? "paren.lparen" : "paren.rparen";
605
+ },
606
+ nextState: "start"
607
+ }, {
608
+ token: "string.quasi.start",
609
+ regex: /`/,
610
+ push: [{
611
+ token: "constant.language.escape",
612
+ regex: escapedRe
613
+ }, {
614
+ token: "paren.quasi.start",
615
+ regex: /\${/,
616
+ push: "start"
617
+ }, {
618
+ token: "string.quasi.end",
619
+ regex: /`/,
620
+ next: "pop"
621
+ }, {
622
+ defaultToken: "string.quasi"
623
+ }]
624
+ }, {
625
+ token: ["variable.parameter", "text"],
626
+ regex: "(" + identifierRe + ")(\\s*)(?=\\=>)"
627
+ }, {
628
+ token: "paren.lparen",
629
+ regex: "(\\()(?=.+\\s*=>)",
630
+ next: "function_arguments"
631
+ }, {
632
+ token: "variable.language",
633
+ regex: "(?:(?:(?:Weak)?(?:Set|Map))|Promise)\\b"
634
+ });
635
+ this.$rules["function_arguments"].unshift({
636
+ token: "keyword.operator",
637
+ regex: "=",
638
+ next: "default_parameter"
639
+ }, {
640
+ token: "keyword.operator",
641
+ regex: "\\.{3}"
642
+ });
643
+ this.$rules["property"].unshift({
644
+ token: "support.function",
645
+ regex: "(findIndex|repeat|startsWith|endsWith|includes|isSafeInteger|trunc|cbrt|log2|log10|sign|then|catch|finally|resolve|reject|race|any|all|allSettled|keys|entries|isInteger)\\b(?=\\()"
646
+ }, {
647
+ token: "constant.language",
648
+ regex: "(?:MAX_SAFE_INTEGER|MIN_SAFE_INTEGER|EPSILON)\\b"
649
+ });
650
+ if (!options || options.jsx != false)
651
+ JSX.call(this);
652
+ }
653
+ this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
654
+ this.normalizeRules();
655
+ };
656
+ oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
657
+ function JSX() {
658
+ var tagRegex = identifierRe.replace("\\d", "\\d\\-");
659
+ var jsxTag = {
660
+ onMatch: function(val, state, stack) {
661
+ var offset = val.charAt(1) == "/" ? 2 : 1;
662
+ if (offset == 1) {
663
+ if (state != this.nextState)
664
+ stack.unshift(this.next, this.nextState, 0);
665
+ else
666
+ stack.unshift(this.next);
667
+ stack[2]++;
668
+ } else if (offset == 2) {
669
+ if (state == this.nextState) {
670
+ stack[1]--;
671
+ if (!stack[1] || stack[1] < 0) {
672
+ stack.shift();
673
+ stack.shift();
674
+ }
675
+ }
676
+ }
677
+ return [{
678
+ type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
679
+ value: val.slice(0, offset)
680
+ }, {
681
+ type: "meta.tag.tag-name.xml",
682
+ value: val.substr(offset)
683
+ }];
684
+ },
685
+ regex: "</?(?:" + tagRegex + "|(?=>))",
686
+ next: "jsxAttributes",
687
+ nextState: "jsx"
688
+ };
689
+ this.$rules.start.unshift(jsxTag);
690
+ var jsxJsRule = {
691
+ regex: "{",
692
+ token: "paren.quasi.start",
693
+ push: "start"
694
+ };
695
+ this.$rules.jsx = [
696
+ jsxJsRule,
697
+ jsxTag,
698
+ { include: "reference" },
699
+ { defaultToken: "string.xml" }
700
+ ];
701
+ this.$rules.jsxAttributes = [
702
+ {
703
+ token: "meta.tag.punctuation.tag-close.xml",
704
+ regex: "/?>",
705
+ onMatch: function(value, currentState, stack) {
706
+ if (currentState == stack[0])
707
+ stack.shift();
708
+ if (value.length == 2) {
709
+ if (stack[0] == this.nextState)
710
+ stack[1]--;
711
+ if (!stack[1] || stack[1] < 0) {
712
+ stack.splice(0, 2);
713
+ }
714
+ }
715
+ this.next = stack[0] || "start";
716
+ return [{ type: this.token, value }];
717
+ },
718
+ nextState: "jsx"
719
+ },
720
+ jsxJsRule,
721
+ comments("jsxAttributes"),
722
+ {
723
+ token: "entity.other.attribute-name.xml",
724
+ regex: tagRegex
725
+ },
726
+ {
727
+ token: "keyword.operator.attribute-equals.xml",
728
+ regex: "="
729
+ },
730
+ {
731
+ token: "text.tag-whitespace.xml",
732
+ regex: "\\s+"
733
+ },
734
+ {
735
+ token: "string.attribute-value.xml",
736
+ regex: "'",
737
+ stateName: "jsx_attr_q",
738
+ push: [
739
+ { token: "string.attribute-value.xml", regex: "'", next: "pop" },
740
+ { include: "reference" },
741
+ { defaultToken: "string.attribute-value.xml" }
742
+ ]
743
+ },
744
+ {
745
+ token: "string.attribute-value.xml",
746
+ regex: '"',
747
+ stateName: "jsx_attr_qq",
748
+ push: [
749
+ { token: "string.attribute-value.xml", regex: '"', next: "pop" },
750
+ { include: "reference" },
751
+ { defaultToken: "string.attribute-value.xml" }
752
+ ]
753
+ },
754
+ jsxTag
755
+ ];
756
+ this.$rules.reference = [{
757
+ token: "constant.language.escape.reference.xml",
758
+ regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
759
+ }];
760
+ }
761
+ function comments(next) {
762
+ return [
763
+ {
764
+ token: "comment",
765
+ // multi line comment
766
+ regex: /\/\*/,
767
+ next: [
768
+ DocCommentHighlightRules.getTagRule(),
769
+ { token: "comment", regex: "\\*\\/", next: next || "pop" },
770
+ { defaultToken: "comment", caseInsensitive: true }
771
+ ]
772
+ },
773
+ {
774
+ token: "comment",
775
+ regex: "\\/\\/",
776
+ next: [
777
+ DocCommentHighlightRules.getTagRule(),
778
+ { token: "comment", regex: "$|^", next: next || "pop" },
779
+ { defaultToken: "comment", caseInsensitive: true }
780
+ ]
781
+ }
782
+ ];
783
+ }
784
+ exports2.JavaScriptHighlightRules = JavaScriptHighlightRules;
785
+ });
786
+ ace.define("ace/mode/matching_brace_outdent", ["require", "exports", "module", "ace/range"], function(require2, exports2, module2) {
787
+ var Range = require2("../range").Range;
788
+ var MatchingBraceOutdent = function() {
789
+ };
790
+ (function() {
791
+ this.checkOutdent = function(line, input) {
792
+ if (!/^\s+$/.test(line))
793
+ return false;
794
+ return /^\s*\}/.test(input);
795
+ };
796
+ this.autoOutdent = function(doc, row) {
797
+ var line = doc.getLine(row);
798
+ var match = line.match(/^(\s*\})/);
799
+ if (!match)
800
+ return 0;
801
+ var column = match[1].length;
802
+ var openBracePos = doc.findMatchingBracket({ row, column });
803
+ if (!openBracePos || openBracePos.row == row)
804
+ return 0;
805
+ var indent = this.$getIndent(doc.getLine(openBracePos.row));
806
+ doc.replace(new Range(row, 0, row, column - 1), indent);
807
+ };
808
+ this.$getIndent = function(line) {
809
+ return line.match(/^\s*/)[0];
810
+ };
811
+ }).call(MatchingBraceOutdent.prototype);
812
+ exports2.MatchingBraceOutdent = MatchingBraceOutdent;
813
+ });
814
+ ace.define("ace/mode/behaviour/xml", ["require", "exports", "module", "ace/lib/oop", "ace/mode/behaviour", "ace/token_iterator"], function(require2, exports2, module2) {
815
+ var oop = require2("../../lib/oop");
816
+ var Behaviour = require2("../behaviour").Behaviour;
817
+ var TokenIterator = require2("../../token_iterator").TokenIterator;
818
+ function is(token, type) {
819
+ return token && token.type.lastIndexOf(type + ".xml") > -1;
820
+ }
821
+ var XmlBehaviour = function() {
822
+ this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
823
+ if (text == '"' || text == "'") {
824
+ var quote = text;
825
+ var selected = session.doc.getTextRange(editor.getSelectionRange());
826
+ if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
827
+ return {
828
+ text: quote + selected + quote,
829
+ selection: false
830
+ };
831
+ }
832
+ var cursor = editor.getCursorPosition();
833
+ var line = session.doc.getLine(cursor.row);
834
+ var rightChar = line.substring(cursor.column, cursor.column + 1);
835
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
836
+ var token = iterator.getCurrentToken();
837
+ if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
838
+ return {
839
+ text: "",
840
+ selection: [1, 1]
841
+ };
842
+ }
843
+ if (!token)
844
+ token = iterator.stepBackward();
845
+ if (!token)
846
+ return;
847
+ while (is(token, "tag-whitespace") || is(token, "whitespace")) {
848
+ token = iterator.stepBackward();
849
+ }
850
+ var rightSpace = !rightChar || rightChar.match(/\s/);
851
+ if (is(token, "attribute-equals") && (rightSpace || rightChar == ">") || is(token, "decl-attribute-equals") && (rightSpace || rightChar == "?")) {
852
+ return {
853
+ text: quote + quote,
854
+ selection: [1, 1]
855
+ };
856
+ }
857
+ }
858
+ });
859
+ this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
860
+ var selected = session.doc.getTextRange(range);
861
+ if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
862
+ var line = session.doc.getLine(range.start.row);
863
+ var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
864
+ if (rightChar == selected) {
865
+ range.end.column++;
866
+ return range;
867
+ }
868
+ }
869
+ });
870
+ this.add("autoclosing", "insertion", function(state, action, editor, session, text) {
871
+ if (text == ">") {
872
+ var position = editor.getSelectionRange().start;
873
+ var iterator = new TokenIterator(session, position.row, position.column);
874
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
875
+ if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
876
+ return;
877
+ if (is(token, "reference.attribute-value"))
878
+ return;
879
+ if (is(token, "attribute-value")) {
880
+ var tokenEndColumn = iterator.getCurrentTokenColumn() + token.value.length;
881
+ if (position.column < tokenEndColumn)
882
+ return;
883
+ if (position.column == tokenEndColumn) {
884
+ var nextToken = iterator.stepForward();
885
+ if (nextToken && is(nextToken, "attribute-value"))
886
+ return;
887
+ iterator.stepBackward();
888
+ }
889
+ }
890
+ if (/^\s*>/.test(session.getLine(position.row).slice(position.column)))
891
+ return;
892
+ while (!is(token, "tag-name")) {
893
+ token = iterator.stepBackward();
894
+ if (token.value == "<") {
895
+ token = iterator.stepForward();
896
+ break;
897
+ }
898
+ }
899
+ var tokenRow = iterator.getCurrentTokenRow();
900
+ var tokenColumn = iterator.getCurrentTokenColumn();
901
+ if (is(iterator.stepBackward(), "end-tag-open"))
902
+ return;
903
+ var element = token.value;
904
+ if (tokenRow == position.row)
905
+ element = element.substring(0, position.column - tokenColumn);
906
+ if (this.voidElements && this.voidElements.hasOwnProperty(element.toLowerCase()))
907
+ return;
908
+ return {
909
+ text: "></" + element + ">",
910
+ selection: [1, 1]
911
+ };
912
+ }
913
+ });
914
+ this.add("autoindent", "insertion", function(state, action, editor, session, text) {
915
+ if (text == "\n") {
916
+ var cursor = editor.getCursorPosition();
917
+ var line = session.getLine(cursor.row);
918
+ var iterator = new TokenIterator(session, cursor.row, cursor.column);
919
+ var token = iterator.getCurrentToken();
920
+ if (is(token, "") && token.type.indexOf("tag-close") !== -1) {
921
+ if (token.value == "/>")
922
+ return;
923
+ while (token && token.type.indexOf("tag-name") === -1) {
924
+ token = iterator.stepBackward();
925
+ }
926
+ if (!token) {
927
+ return;
928
+ }
929
+ var tag = token.value;
930
+ var row = iterator.getCurrentTokenRow();
931
+ token = iterator.stepBackward();
932
+ if (!token || token.type.indexOf("end-tag") !== -1) {
933
+ return;
934
+ }
935
+ if (this.voidElements && !this.voidElements[tag] || !this.voidElements) {
936
+ var nextToken = session.getTokenAt(cursor.row, cursor.column + 1);
937
+ var line = session.getLine(row);
938
+ var nextIndent = this.$getIndent(line);
939
+ var indent = nextIndent + session.getTabString();
940
+ if (nextToken && nextToken.value === "</") {
941
+ return {
942
+ text: "\n" + indent + "\n" + nextIndent,
943
+ selection: [1, indent.length, 1, indent.length]
944
+ };
945
+ } else {
946
+ return {
947
+ text: "\n" + indent
948
+ };
949
+ }
950
+ }
951
+ }
952
+ }
953
+ });
954
+ };
955
+ oop.inherits(XmlBehaviour, Behaviour);
956
+ exports2.XmlBehaviour = XmlBehaviour;
957
+ });
958
+ ace.define("ace/mode/behaviour/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/token_iterator", "ace/mode/behaviour/cstyle", "ace/mode/behaviour/xml"], function(require2, exports2, module2) {
959
+ var oop = require2("../../lib/oop");
960
+ var TokenIterator = require2("../../token_iterator").TokenIterator;
961
+ var CstyleBehaviour = require2("../behaviour/cstyle").CstyleBehaviour;
962
+ var XmlBehaviour = require2("../behaviour/xml").XmlBehaviour;
963
+ var JavaScriptBehaviour = function() {
964
+ var xmlBehaviours = new XmlBehaviour({ closeCurlyBraces: true }).getBehaviours();
965
+ this.addBehaviours(xmlBehaviours);
966
+ this.inherit(CstyleBehaviour);
967
+ this.add("autoclosing-fragment", "insertion", function(state, action, editor, session, text) {
968
+ if (text == ">") {
969
+ var position = editor.getSelectionRange().start;
970
+ var iterator = new TokenIterator(session, position.row, position.column);
971
+ var token = iterator.getCurrentToken() || iterator.stepBackward();
972
+ if (!token)
973
+ return;
974
+ if (token.value == "<") {
975
+ return {
976
+ text: "></>",
977
+ selection: [1, 1]
978
+ };
979
+ }
980
+ }
981
+ });
982
+ };
983
+ oop.inherits(JavaScriptBehaviour, CstyleBehaviour);
984
+ exports2.JavaScriptBehaviour = JavaScriptBehaviour;
985
+ });
986
+ ace.define("ace/mode/folding/xml", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(require2, exports2, module2) {
987
+ var oop = require2("../../lib/oop");
988
+ var Range = require2("../../range").Range;
989
+ var BaseFoldMode = require2("./fold_mode").FoldMode;
990
+ var FoldMode = exports2.FoldMode = function(voidElements, optionalEndTags) {
991
+ BaseFoldMode.call(this);
992
+ this.voidElements = voidElements || {};
993
+ this.optionalEndTags = oop.mixin({}, this.voidElements);
994
+ if (optionalEndTags)
995
+ oop.mixin(this.optionalEndTags, optionalEndTags);
996
+ };
997
+ oop.inherits(FoldMode, BaseFoldMode);
998
+ var Tag = function() {
999
+ this.tagName = "";
1000
+ this.closing = false;
1001
+ this.selfClosing = false;
1002
+ this.start = { row: 0, column: 0 };
1003
+ this.end = { row: 0, column: 0 };
1004
+ };
1005
+ function is(token, type) {
1006
+ return token.type.lastIndexOf(type + ".xml") > -1;
1007
+ }
1008
+ (function() {
1009
+ this.getFoldWidget = function(session, foldStyle, row) {
1010
+ var tag = this._getFirstTagInLine(session, row);
1011
+ if (!tag)
1012
+ return this.getCommentFoldWidget(session, row);
1013
+ if (tag.closing || !tag.tagName && tag.selfClosing)
1014
+ return foldStyle === "markbeginend" ? "end" : "";
1015
+ if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
1016
+ return "";
1017
+ if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
1018
+ return "";
1019
+ return "start";
1020
+ };
1021
+ this.getCommentFoldWidget = function(session, row) {
1022
+ if (/comment/.test(session.getState(row)) && /<!-/.test(session.getLine(row)))
1023
+ return "start";
1024
+ return "";
1025
+ };
1026
+ this._getFirstTagInLine = function(session, row) {
1027
+ var tokens = session.getTokens(row);
1028
+ var tag = new Tag();
1029
+ for (var i = 0; i < tokens.length; i++) {
1030
+ var token = tokens[i];
1031
+ if (is(token, "tag-open")) {
1032
+ tag.end.column = tag.start.column + token.value.length;
1033
+ tag.closing = is(token, "end-tag-open");
1034
+ token = tokens[++i];
1035
+ if (!token)
1036
+ return null;
1037
+ tag.tagName = token.value;
1038
+ if (token.value === "") {
1039
+ token = tokens[++i];
1040
+ if (!token)
1041
+ return null;
1042
+ tag.tagName = token.value;
1043
+ }
1044
+ tag.end.column += token.value.length;
1045
+ for (i++; i < tokens.length; i++) {
1046
+ token = tokens[i];
1047
+ tag.end.column += token.value.length;
1048
+ if (is(token, "tag-close")) {
1049
+ tag.selfClosing = token.value == "/>";
1050
+ break;
1051
+ }
1052
+ }
1053
+ return tag;
1054
+ } else if (is(token, "tag-close")) {
1055
+ tag.selfClosing = token.value == "/>";
1056
+ return tag;
1057
+ }
1058
+ tag.start.column += token.value.length;
1059
+ }
1060
+ return null;
1061
+ };
1062
+ this._findEndTagInLine = function(session, row, tagName, startColumn) {
1063
+ var tokens = session.getTokens(row);
1064
+ var column = 0;
1065
+ for (var i = 0; i < tokens.length; i++) {
1066
+ var token = tokens[i];
1067
+ column += token.value.length;
1068
+ if (column < startColumn - 1)
1069
+ continue;
1070
+ if (is(token, "end-tag-open")) {
1071
+ token = tokens[i + 1];
1072
+ if (is(token, "tag-name") && token.value === "") {
1073
+ token = tokens[i + 2];
1074
+ }
1075
+ if (token && token.value == tagName)
1076
+ return true;
1077
+ }
1078
+ }
1079
+ return false;
1080
+ };
1081
+ this.getFoldWidgetRange = function(session, foldStyle, row) {
1082
+ var tags = session.getMatchingTags({ row, column: 0 });
1083
+ if (tags) {
1084
+ return new Range(tags.openTag.end.row, tags.openTag.end.column, tags.closeTag.start.row, tags.closeTag.start.column);
1085
+ } else {
1086
+ return this.getCommentFoldWidget(session, row) && session.getCommentFoldRange(row, session.getLine(row).length);
1087
+ }
1088
+ };
1089
+ }).call(FoldMode.prototype);
1090
+ });
1091
+ ace.define("ace/mode/folding/cstyle", ["require", "exports", "module", "ace/lib/oop", "ace/range", "ace/mode/folding/fold_mode"], function(require2, exports2, module2) {
1092
+ var oop = require2("../../lib/oop");
1093
+ var Range = require2("../../range").Range;
1094
+ var BaseFoldMode = require2("./fold_mode").FoldMode;
1095
+ var FoldMode = exports2.FoldMode = function(commentRegex) {
1096
+ if (commentRegex) {
1097
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1098
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1099
+ }
1100
+ };
1101
+ oop.inherits(FoldMode, BaseFoldMode);
1102
+ (function() {
1103
+ this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
1104
+ this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
1105
+ this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
1106
+ this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
1107
+ this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
1108
+ this._getFoldWidgetBase = this.getFoldWidget;
1109
+ this.getFoldWidget = function(session, foldStyle, row) {
1110
+ var line = session.getLine(row);
1111
+ if (this.singleLineBlockCommentRe.test(line)) {
1112
+ if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
1113
+ return "";
1114
+ }
1115
+ var fw = this._getFoldWidgetBase(session, foldStyle, row);
1116
+ if (!fw && this.startRegionRe.test(line))
1117
+ return "start";
1118
+ return fw;
1119
+ };
1120
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
1121
+ var line = session.getLine(row);
1122
+ if (this.startRegionRe.test(line))
1123
+ return this.getCommentRegionBlock(session, line, row);
1124
+ var match = line.match(this.foldingStartMarker);
1125
+ if (match) {
1126
+ var i = match.index;
1127
+ if (match[1])
1128
+ return this.openingBracketBlock(session, match[1], row, i);
1129
+ var range = session.getCommentFoldRange(row, i + match[0].length, 1);
1130
+ if (range && !range.isMultiLine()) {
1131
+ if (forceMultiline) {
1132
+ range = this.getSectionRange(session, row);
1133
+ } else if (foldStyle != "all")
1134
+ range = null;
1135
+ }
1136
+ return range;
1137
+ }
1138
+ if (foldStyle === "markbegin")
1139
+ return;
1140
+ var match = line.match(this.foldingStopMarker);
1141
+ if (match) {
1142
+ var i = match.index + match[0].length;
1143
+ if (match[1])
1144
+ return this.closingBracketBlock(session, match[1], row, i);
1145
+ return session.getCommentFoldRange(row, i, -1);
1146
+ }
1147
+ };
1148
+ this.getSectionRange = function(session, row) {
1149
+ var line = session.getLine(row);
1150
+ var startIndent = line.search(/\S/);
1151
+ var startRow = row;
1152
+ var startColumn = line.length;
1153
+ row = row + 1;
1154
+ var endRow = row;
1155
+ var maxRow = session.getLength();
1156
+ while (++row < maxRow) {
1157
+ line = session.getLine(row);
1158
+ var indent = line.search(/\S/);
1159
+ if (indent === -1)
1160
+ continue;
1161
+ if (startIndent > indent)
1162
+ break;
1163
+ var subRange = this.getFoldWidgetRange(session, "all", row);
1164
+ if (subRange) {
1165
+ if (subRange.start.row <= startRow) {
1166
+ break;
1167
+ } else if (subRange.isMultiLine()) {
1168
+ row = subRange.end.row;
1169
+ } else if (startIndent == indent) {
1170
+ break;
1171
+ }
1172
+ }
1173
+ endRow = row;
1174
+ }
1175
+ return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
1176
+ };
1177
+ this.getCommentRegionBlock = function(session, line, row) {
1178
+ var startColumn = line.search(/\s*$/);
1179
+ var maxRow = session.getLength();
1180
+ var startRow = row;
1181
+ var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
1182
+ var depth = 1;
1183
+ while (++row < maxRow) {
1184
+ line = session.getLine(row);
1185
+ var m = re.exec(line);
1186
+ if (!m)
1187
+ continue;
1188
+ if (m[1])
1189
+ depth--;
1190
+ else
1191
+ depth++;
1192
+ if (!depth)
1193
+ break;
1194
+ }
1195
+ var endRow = row;
1196
+ if (endRow > startRow) {
1197
+ return new Range(startRow, startColumn, endRow, line.length);
1198
+ }
1199
+ };
1200
+ }).call(FoldMode.prototype);
1201
+ });
1202
+ ace.define("ace/mode/folding/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/folding/xml", "ace/mode/folding/cstyle"], function(require2, exports2, module2) {
1203
+ var oop = require2("../../lib/oop");
1204
+ var XmlFoldMode = require2("./xml").FoldMode;
1205
+ var CFoldMode = require2("./cstyle").FoldMode;
1206
+ var FoldMode = exports2.FoldMode = function(commentRegex) {
1207
+ if (commentRegex) {
1208
+ this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
1209
+ this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
1210
+ }
1211
+ this.xmlFoldMode = new XmlFoldMode();
1212
+ };
1213
+ oop.inherits(FoldMode, CFoldMode);
1214
+ (function() {
1215
+ this.getFoldWidgetRangeBase = this.getFoldWidgetRange;
1216
+ this.getFoldWidgetBase = this.getFoldWidget;
1217
+ this.getFoldWidget = function(session, foldStyle, row) {
1218
+ var fw = this.getFoldWidgetBase(session, foldStyle, row);
1219
+ if (!fw) {
1220
+ return this.xmlFoldMode.getFoldWidget(session, foldStyle, row);
1221
+ }
1222
+ return fw;
1223
+ };
1224
+ this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
1225
+ var range = this.getFoldWidgetRangeBase(session, foldStyle, row, forceMultiline);
1226
+ if (range)
1227
+ return range;
1228
+ return this.xmlFoldMode.getFoldWidgetRange(session, foldStyle, row);
1229
+ };
1230
+ }).call(FoldMode.prototype);
1231
+ });
1232
+ ace.define("ace/mode/javascript", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/javascript_highlight_rules", "ace/mode/matching_brace_outdent", "ace/worker/worker_client", "ace/mode/behaviour/javascript", "ace/mode/folding/javascript"], function(require2, exports2, module2) {
1233
+ var oop = require2("../lib/oop");
1234
+ var TextMode = require2("./text").Mode;
1235
+ var JavaScriptHighlightRules = require2("./javascript_highlight_rules").JavaScriptHighlightRules;
1236
+ var MatchingBraceOutdent = require2("./matching_brace_outdent").MatchingBraceOutdent;
1237
+ var WorkerClient = require2("../worker/worker_client").WorkerClient;
1238
+ var JavaScriptBehaviour = require2("./behaviour/javascript").JavaScriptBehaviour;
1239
+ var JavaScriptFoldMode = require2("./folding/javascript").FoldMode;
1240
+ var Mode = function() {
1241
+ this.HighlightRules = JavaScriptHighlightRules;
1242
+ this.$outdent = new MatchingBraceOutdent();
1243
+ this.$behaviour = new JavaScriptBehaviour();
1244
+ this.foldingRules = new JavaScriptFoldMode();
1245
+ };
1246
+ oop.inherits(Mode, TextMode);
1247
+ (function() {
1248
+ this.lineCommentStart = "//";
1249
+ this.blockComment = { start: "/*", end: "*/" };
1250
+ this.$quotes = { '"': '"', "'": "'", "`": "`" };
1251
+ this.$pairQuotesAfter = {
1252
+ "`": /\w/
1253
+ };
1254
+ this.getNextLineIndent = function(state, line, tab) {
1255
+ var indent = this.$getIndent(line);
1256
+ var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
1257
+ var tokens = tokenizedLine.tokens;
1258
+ var endState = tokenizedLine.state;
1259
+ if (tokens.length && tokens[tokens.length - 1].type == "comment") {
1260
+ return indent;
1261
+ }
1262
+ if (state == "start" || state == "no_regex") {
1263
+ var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
1264
+ if (match) {
1265
+ indent += tab;
1266
+ }
1267
+ } else if (state == "doc-start") {
1268
+ if (endState == "start" || endState == "no_regex") {
1269
+ return "";
1270
+ }
1271
+ var match = line.match(/^\s*(\/?)\*/);
1272
+ if (match) {
1273
+ if (match[1]) {
1274
+ indent += " ";
1275
+ }
1276
+ indent += "* ";
1277
+ }
1278
+ }
1279
+ return indent;
1280
+ };
1281
+ this.checkOutdent = function(state, line, input) {
1282
+ return this.$outdent.checkOutdent(line, input);
1283
+ };
1284
+ this.autoOutdent = function(state, doc, row) {
1285
+ this.$outdent.autoOutdent(doc, row);
1286
+ };
1287
+ this.createWorker = function(session) {
1288
+ var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
1289
+ worker.attachToDocument(session.getDocument());
1290
+ worker.on("annotate", function(results) {
1291
+ session.setAnnotations(results.data);
1292
+ });
1293
+ worker.on("terminate", function() {
1294
+ session.clearAnnotations();
1295
+ });
1296
+ return worker;
1297
+ };
1298
+ this.$id = "ace/mode/javascript";
1299
+ this.snippetFileId = "ace/snippets/javascript";
1300
+ }).call(Mode.prototype);
1301
+ exports2.Mode = Mode;
1302
+ });
1303
+ (function() {
1304
+ ace.require(["ace/mode/javascript"], function(m) {
1305
+ if (module) {
1306
+ module.exports = m;
1307
+ }
1308
+ });
1309
+ })();
1310
+ })(modeJavascript$2);
1311
+ var modeJavascriptExports = modeJavascript$2.exports;
1312
+ const modeJavascript = /* @__PURE__ */ getDefaultExportFromCjs(modeJavascriptExports);
1313
+ const modeJavascript$1 = /* @__PURE__ */ _mergeNamespaces({
1314
+ __proto__: null,
1315
+ default: modeJavascript
1316
+ }, [modeJavascriptExports]);
1317
+ export {
1318
+ modeJavascript$1 as m
1319
+ };